twi
Trap Word Immediate
Compares the contents of register RA with an immediate value and invokes the system trap handler if any specified condition is 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 |
|---|---|
| tweq | |
| twgti | |
| twllei |
Example
Encoding
Operands
-
TO
Options -
RA
Src -
SIM
Imm -
SI
Sign-Extended Immediate Value -
CRb
Condition Register Field -
L
Link Bit -
Ra
Source General Purpose Register -
SIm
Immediate Value -
LK
Link Bit