Fixed-point trap instructions
Fixed-point trap instructions test for a specified set of conditions.
Fixed-point trap instructions test for a specified set of conditions. Traps can be defined for events that should not occur during program execution, such as an index out of range or the use of an invalid character. If a defined trap condition occurs, the system trap handler is invoked to handle a program interruption. If the defined trap conditions do not occur, normal program execution continues.
The contents of register RA are compared with the sign-extended SI field or with the contents of register RB, depending on the particular trap instruction. In 32-bit implementations, only the contents of the low-order 32 bits of registers RA and RB are used in the comparison.
The comparison results in five conditions that are ANDed with the TO field. If the result is not 0, the system trap handler is invoked. The five resulting conditions are:
TO Field Bit | ANDed with Condition |
---|---|
0 | Less than |
1 | Greater than |
2 | Equal |
3 | Logically less than |
4 | Logically greater than |
Extended mnemonics for the most useful TO field values are provided, and a standard set of codes is provided for the most common combinations of trap conditions.