Atomic Or (ATMCOR)

Instruction Syntax

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:

  • four byte length - 4-byte aligned
  • eight byte length - 8-byte aligned

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

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2201 Object Not Found
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2C Program Execution
    • 2C04 Branch Target Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation
    • 4402 Literal Values Cannot Be Changed