Computes the difference between the contents of two general-purpose registers and stores the result or the value zero in a general-purpose register.
Note: The doz instruction is supported only in the POWER architecture.
POWER | |
---|---|
doz | RT,RA,RB |
doz. | RT,RA,RB |
dozo | RT,RA,RB |
dozo. | RT,RA,RB |
The doz instruction adds the complement of the contents of general-purpose register (GPR) RA, 1, and the contents of GPR RB, and stores the result in the target GPR RT.
If the value in GPR RA is algebraically greater than the value in GPR RB, then GPR RT is set to 0.
The doz instruction has four syntax forms. Each syntax form has a different effect on Condition Register Field 0 and the Fixed-Point Exception Register.
Syntax Form | Overflow Exception (OE) | Fixed-Point Exception Register | Record Bit (Rc) | Condition Register Field 0 |
doz | 0 | None | 0 | None |
doz. | 0 | None | 1 | LT,GT,EQ,SO |
dozo | 1 | SO,OV | 0 | None |
dozo. | 1 | SO,OV | 1 | LT,GT,EQ,SO |
The four syntax forms of the doz instruction never affect the Carry bit (CA) in the Fixed-Point Exception Register. If the syntax form sets the Overflow Exception (OE) bit to 1, the instruction affects the Summary Overflow (SO) and Overflow (OV) bits in the Fixed-Point Exception Register; the Overflow (OV) bit can only be set on positive overflows. If the syntax form sets the Record (Rc) bit to 1, the instruction effects the Less Than (LT) zero, Greater Than (GT) zero, Equal To (EQ) zero, and Summary Overflow (SO) bits in Condition Register Field 0.
# Assume GPR 4 holds 0x0000 0001. # Assume GPR 6 holds 0x0000 0002. doz 4,4,6 # GPR 4 now holds 0x0000 0001.
# Assume GPR 4 holds 0x0000 0001. # Assume GPR 6 holds 0x0000 0000. doz. 4,4,6 # GPR 4 now holds 0x0000 0000.
# Assume GPR 4 holds 0x0000 0002. # Assume GPR 6 holds 0x0000 0008. dozo 4,4,6 # GPR 4 now holds 0x0000 0006.
# Assume GPR 4 holds 0xEFFF FFFF. # Assume GPR 6 holds 0x0000 0000. dozo. 4,4,6 # GPR 4 now holds 0x1000 0001.
Fixed-Point Arithmetic Instructions.