360 Assembly/360 Instructions/LCR

< 360 Assembly < 360 Instructions

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.

Opcode

RR Instruction (2 bytes)
Byte 1
bits (0-7)
Byte 2
target register
(8-11)
source register
(12-15)
(in hex) Opcode
13
(4 bits)
0..F / (dec 0..15)
(4 bits)
0..F / (dec 0..15)

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

Previous Instruction
LTR
360 Assembly Instructions
{{{name}}}
Next Instruction
NR
Previous Opcode
12
Next Opcode
14
360 Assembly Language
360 Family Introduction · Basic FAQ · 360 Family · 360 Architecture
360 Instruction Set 360 Instructions · Branch Instructions · Data Transfer Instructions · Control Flow Instructions · Arithmetic Instructions · Logic Instructions · Shift and Rotate Instructions · Other Instructions
Syntaxes and Assemblers 360 Assemblers· Pseudo Instructions
Instruction Extensions Floating Point · High-Level Languages
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.