td

Trap Doubleword

td TO, RA, RB

Traps if condition (comparison of doublewords) is met.

Details

The Trap Doubleword instruction compares the contents of register RA with the contents of register RB. If any bit in the TO field is set to 1 and its corresponding condition (less than, greater than, equal, less than unsigned, or greater than unsigned) is met by the result of the comparison, the system trap handler is invoked.

Pseudocode Operation

a ←(RA)
b ←(RB)
if (a < b) & TO0 then TRAP
if (a > b) & TO1 then TRAP
if (a = b) & TO2 then TRAP
if (a <u b) & TO3 then TRAP
if (a >u b) & TO4 then TRAP

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

td 4, r4, r5

Encoding

Binary Layout
31
0
TO
6
RA
11
RB
16
68
21
 
Format X-form
Opcode 0x7C000088
Extension Base

Operands

  • TO
    Options
  • RA
    Src A
  • RB
    Src B