tdi
Trap Doubleword Immediate
tdi TO, RA, SIM
Compares the contents of a register with an immediate value and invokes a trap handler if specified conditions are met.
Details
The contents of register RA are compared with the sign-extended value of the SI field. If any bit in the TO field is set to 1 and its corresponding condition is met by the result of the comparison, the system trap handler is invoked.
Pseudocode Operation
Programming Note
Generates a program exception (System Call or Trap type) when the trap condition is true. The condition codes in TO select which comparisons trigger the trap: bit 0 = LT, bit 1 = GT, bit 2 = EQ, bit 3 = LU (unsigned), bit 4 = GU (unsigned). TO=31 (all bits set) always traps.
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
| tdge | |
| tdlnl | |
| tdnei |
Example
tdi 4, r4, 4
Encoding
Binary Layout
000010
0
CRb
16
RA
21
SIMM
26
Operands
-
TO
Options -
RA
Src -
SIM
Imm -
SI
Sign-Extended Immediate Value -
CRb
Condition Register Field -
SIMM
Signed Immediate Value