Skip to content

Subtraction

The following opcodes are used for subtraction:

  • SUBI — Subtract Signed Integer
  • SUBU — Subtract Unsigned Integer
  • SUBF — Subtract Floating Point

SUBI — Sub Signed Integer

Algorithm
    L2 = L2 - <signed_imm>
    L2 = L2 - <reg_val>
    L2 = L2 - <const>
1
2
3
4
5
6
7
8
    ; imm +ve
        SUBI    1
    ; imm -ve
        SUBI    -123
    ; reg val
        SUBI    val(QT)
    ; const
        SUBI    SOME_CONST_VAL
Opcode Operand Type Destination
14 Signed 64-bit integer L2 (implicit)

Identified as memonic #SUBI, SUBI is used to subtract a 64-bit signed value from the L2 register

SUBU — Sub Unsigned Integer

Algorithm
    L3 = L3 - <unsigned_imm>
    L3 = L3 - <reg_val>
    L3 = L3 - <const>
1
2
3
4
5
6
    ; imm +ve
        SUBU    1
    ; reg val
        SUBU    val(QT)
    ; const
        SUBU    SOME_CONST_VAL
Opcode Operand Type Destination
19 Unsigned 64-bit value L3 (implicit)

Identified as memonic #SUBU, SUBU is used to subtract a 64-bit unsigned value from the L3 register

SUBF — Sub Float value

Algorithm
    L1 = L1 - <float>
    L1 = L1 - <reg_val>
    L1 = L1 - <const>
1
2
3
4
5
6
    ; imm float
        SUBF    3.14
    ; reg val
        SUBF    val(QT)
    ; const
        SUBF    SOME_CONST_VAL
Opcode Operand Type Destination
24 64-bit Float Value L1 (implicit)

Identified as memonic #SUBF, SUBF is used to subtract a 64-bit floating point value from the L1 register