IBM SA14-2339-04 Personal Computer User Manual


 
Instructions by Category B-33
B.6 Arithmetic and Logical Instructions
Table B-7 lists the arithmetic and logical instructions. Arithmetic operations are performed on integer
or ordinal operands stored in registers. Instructions using two operands are defined in a three-
operand format, where the operation is performed on the operands stored in two registers, and the
result is placed in a third register. Instructions using one operand are defined in a two-operand format,
where the operation is performed on the operand in one register, and the result is placed in another
register. Several instructions have immediate formats, in which one operand is coded as part of the
instruction itself. Most arithmetic and logical instructions can optionally set the Condition Register
(CR) based on the outcome of the instruction.
Table B-7. Arithmetic and Logical Instructions
Mnemonic Operands Function
Other Registers
Changed Page
add RT, RA, RB Add (RA) to (RB).
Place result in RT.
9-6
add. CR[CR0]
addo XER[SO, OV]
addo. CR[CR0]
XER[SO, OV]
addc RT, RA, RB Add (RA) to (RB).
Place result in RT.
Place carry-out in XER[CA].
9-7
addc. CR[CR0]
addco XER[SO, OV]
addco. CR[CR0]
XER[SO, OV]
adde RT, RA, RB Add XER[CA], (RA), (RB).
Place result in RT.
Place carry-out in XER[CA].
9-9
adde. CR[CR0]
addeo XER[SO, OV]
addeo. CR[CR0]
XER[SO, OV]
addi RT, RA, IM Add EXTS(IM) to (RA|0).
Place result in RT.
9-9
addic RT, RA, IM Add EXTS(IM) to (RA|0).
Place result in RT.
Place carry-out in XER[CA].
9-10
addic. RT, RA, IM Add EXTS(IM) to (RA|0).
Place result in RT.
Place carry-out in XER[CA].
CR[CR0] 9-11
addis RT, RA, IM Add (IM
||
16
0) to (RA|0).
Place result in RT.
9-12