360 Assembly/360 Instructions/LCR

LCR - Load Register Complement - RR Instruction - Opcode 13

Format

 * LCR 2,6 Copy the two's complement (integer negation) of contents of register 6 into register 2, replacing the existing contents of register 2

The specific syntax is
 * LCR target register, source register.

Example usage
The LCR instruction is used to copy the integer negation of the second register argument (the source register) into the first register argument (the target register), replacing the contents of the target register with the contents of the source register. The following is an example of how the instruction would assemble in various forms from an assembly language listing: 1326       LCR   2,6 1392       LCR   9,2 13FA       LCR   15,10

Typical Usage
When it is necessary to negate a 32-bit integer value.

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

Operation
The LCR instruction copies negation of the 32-bit value from the register specified by the second argument to the register specified by the first argument.

Register 0 is valid for either register and is not ignored as in some other instructions.

Condition Codes
If signed integer overflow occurs, i.e. source is -2147483648 (hex 80000000), 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.

Related instructions

 * To subtract an integer value from register, see SR, S, SH, SL or SLR.
 * To load and complement 64-bit integer value, see LCGR.
 * To load and complement 32-bit integer value and extend it to 64 bits, see LCGFR.