si (Subtract Immediate) instruction
Purpose
Subtracts the value of a signed integer from the contents of a general-purpose register and places the result in a general-purpose register.
Syntax
Bits | Value |
---|---|
0 - 5 | 12 |
6 - 10 | RT |
11 - 15 | RA |
16 - 31 | SI |
Description
The si instruction subtracts the 16-bit signed integer specified by the SINT parameter from the contents of general-purpose register (GPR) RA and stores the result in the target GPR RT. This instruction has the same effect as the ai instruction used with a negative SINT value. The assembler negates SINT and places this value (SI) in the machine instruction:
ai RT,RA,-SINT
The si instruction has one syntax form and can set the Carry Bit of the Fixed-Point Exception Register; it never affects Condition Register Field 0.
Parameters
Item | Description |
---|---|
RT | Specifies target general-purpose register for operation. |
RA | Specifies source general-purpose register for operation. |
SINT | Specifies 16-bit signed integer for operation. |
SI | Specifies the negative of the SINT value. |
Examples
The following code subtracts 0xFFFF F800 from the contents of GPR 4, stores the result in GPR 6, and sets the Carry bit in the Fixed-Point Exception Register to reflect the result of the operation:
# Assume GPR 4 contains 0x0000 0000
si 6,4,0xFFFFF800
# GPR 6 now contains 0x0000 0800
# This instruction has the same effect as
# ai 6,4,-0xFFFFF800.