Atomic Or (ATMCOR)

Bound program access

Built-in number for ATMCOR4 is 675. ATMCOR4 ( op1 : address of a unsigned binary(4) value (has alignment restrictions - see description below) mask : unsigned binary(4) value ) : unsigned binary(4)

Built-in number for ATMCOR8 is 676. ATMCOR8 ( op1 : address of a unsigned binary(8) value (has alignment restrictions - see description below) mask : unsigned binary(8) value ) : unsigned binary(8)

Description  Sets bits in the value pointed to by op1, according to a bit mask, in a single atomic operation. The bits in the value pointed to by op1 that correspond to the one bits in mask are set to 1. The bits in the value pointed to by op1 that correspond to the zero bits in mask are not modified.

The updated bit values for the storage pointed to by op1 are determined as follows:

Original op1 Bit Mask Bit Resulting op1 Bit
0 0 0
0 1 1
1 0 1
1 1 1

The value pointed to by op1 and the mask value must have the same length. Failure to have the operands the same length will not be detected and the results of the instruction are undefined when this occurs.

The first operand must be aligned based on its length:

Failure to have the first operand aligned properly will not be detected, but the results of the instruction are undefined when this occurs.

This operation is useful when a variable containing bit flags is shared between two or more threads. When updating such a variable, it is important to make sure that the entire operation is performed atomically (not interruptible). See Atomicity for additional information.

The primary purpose of this instruction is to manipulate a variable which is shared by two or more threads, but this instruction does not synchronize storage. When sharing more than one variable between multiple threads or processes, be aware of storage synchronization issues. See Storage Synchronization Concepts for additional information.

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2C Program Execution

36 Space Management

44 Protection Violation