411 REFERENCE · Wikibooks
360 Assembly/360 Instructions/AL
Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.
__TOC__
AL - Add Logical - Opcode 5E
Format
AL 2,N2
AL 11,106(0,10)
The specific syntax is
AL 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.
RX Instruction (4 bytes)Byte 1Byte 2Bytes 3 and 4target registerSource Address(8 bits)Opcode5E(4 bits) 0..F(4 bits)indexregister0..F(4 bits)baseregister0..F(12 bits)offset0..FFF
The first argument is a target register which contains the first summand before the operation and the result after the operation.
The second argument is the source value (the second summand) location.
The mask, base_register and index_register values are 0 to 15. The offset value is 0 to 4095.
Availability
The AL instruction is available on all models of the 360, 370 and z/System.
Operation
The AL 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 least significant 32 bits of the 33-bit result sum is placed to the target register. The Condition Code field in the Program Status Word is changed according to the resulting value (sum), treated as unsigned integer (see below).
The source argument address shall be aligned to word boundary (i.e. 4 bytes).
Condition Codes
The least significant bit of CC field of the PSW is set if sum is not zero and cleared otherwise.
The most significant bit of CC field of the PSW keeps carry bit (i.e. the most significant bit of the 33-bit sum).
Exceptions and Faults
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.
Notes
The AL and ALR instructions are useful to implement adding of integer values longer than 32 bit in code that is intended to run in 24- or 31-bit address spaces. In that case, one should use AL or ALR to count all parts of the sum (possibly except the most significant one), and, if CC is 2 or 3 after the adding (i.e. carry have happened), increment the nearest higher part of the sum.
Related instructions
To add value logically from register, see ALR.
To add value arithmetically from memory, see A.
To subtract integer value, see S, SR, SH, SL or SLR.
To check condition code, see BC or BCR.
AHI ALC 5D D 5F SL