tw
Trap Word
Traps if condition (comparison of words) is met.
Details
The Trap Word instruction compares the low-order 32 bits of register RA with the low-order 32 bits of register RB. If any of the specified conditions (Less Than, Greater Than, Equal, Less Than Unsigned, Greater Than Unsigned) are met and the corresponding TO bit is set, 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.
Example
Encoding
Operands
-
TO
Options -
RA
Src A -
RB
Src B