126. Conditional trap

126.1. Name

TRAPcc -- Conditional trap                (68020+)

126.2. Synopsis

        TRAPcc
        TRAPcc.w        #<data>
        TRAPcc.l        #<data>

126.3. Function

If "cc CONDITION" is true then there's generation of a level 7 exception, else execution continue normally. Immediate data is optional, if given, the exception sub-routine can use it. Condition code 'cc' specifies one of the following:

BitmapCCNameFlagsBitmapCCNameFlags
0000FFalseZ = 11000VCoVerflow ClearV = 0
0001TTrueZ = 01001VSoVerflow SetV = 1
0010HIHIghC + Z = 01010PLPLusN = 0
0011LSLow or SameC + Z = 11011MIMInusN = 1
0100CCCarry ClearC = 01100GEGreater or EqualN (+) V = 0
0101CSCarry SetC = 11101LTLess ThanN (+) V = 1
0110NENot EqualZ = 01110GTGreater ThanZ + (N (+) V) = 0
0111EQEQualZ = 11111LELess or EqualZ + (N (+) V) = 1

126.4. Format

        -----------------------------------------------------------------
        |15 |14 |13 |12 |11 |10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        |---|---|---|---|---------------|---|---|---|---|---|-----------|
        | 0 | 1 | 0 | 1 | cc CONDITION  | 1 | 1 | 1 | 1 | 1 |  OP-MODE  |
        |---------------------------------------------------------------|
        |                OPTIONAL 16 BITS IMMEDIATE DATA                |
        |---------------------------------------------------------------|
        |                OPTIONAL 32 BITS IMMEDIATE DATA                |
        -----------------------------------------------------------------

OP-MODE
        010-> instruction followed of 16 bits.
        011-> instruction followed of 32 bits.
        100-> instruction with no immediate operand.

126.5. Result

        None.

126.6. See also

TRAP