360 Assembly/360 Instructions/A

A - Add - Opcode 5A

Format

 * A 2,N2
 * A 11,106(0,10)

The specific syntax is
 * A target register,offset(index register,base register)

Where the offset, index register and base register values will be determined automatically by the assembler if the USING pseudo-instruction has been used, and the target address label used is within 4096 bytes of the value of some base register.


 * The first argument is a target register which value is affected by the instruction.
 * The second argument is the source value location.
 * The mask, base_register and index_register values are 0 to 15. The offset value is 0 to 4095.

Availability
The A instruction is available on all models of the 360, 370 and z/System.

Operation
The A instruction reads 32-bit integer value from the memory address specified by the argument and adds it to the value of register specified by the first argument. The Condition Code field in the Program Status Word is changed according to the resulting value.

The source argument address shall be aligned to word boundary (i.e. 4 bytes).

Condition Codes
If signed integer overflow occurs, i.e. sum is not between &minus;231 and 231&minus;1, CC is set to 3. Otherwise, CC is set to 0, 1 or 2, if sum is equal to zero, below zero or above zero accordingly.

Exceptions and Faults

 * If signed integer overflow is detected and the bit 36 in PSW is set, operation exception occurs.
 * The source address must be within the range of valid memory or an operation exception occurs.
 * The storage key for the source address must be the same as the current process or a memory protect violate exception occurs.

Related instructions

 * To add value from register, see AR.
 * To add half-word value from memory, see AH.
 * To add value and set condition codes according to unsigned arithmetic, or add not most significant part of multi-word integer value, see AL or ALR.
 * To add floating-point values, see AE, AER, AD or ADR.
 * To subtract integer value, see S, SR, SH, SL or SLR.
 * To check condition code, see BC or BCR.