TSK3000A Generic Instruction - SUB
Frozen Content
Instruction: Subtract
Assembler Format | Example | Translates to... |
---|---|---|
sub rC, rB | sub $3, $4 | sub rC, rC, rB (with rA = rC) |
sub rC, rA, IMM32 | sub $3, $4, 0x12345678 | see note 2 |
sub rC, IMM32 (see note 1) | sub $3, 0x12345678 | see note 2 |
Notes
- This format can also be written as: sub rC, rC, IMM32 (with rA = rC)
- If the negated signed IMM32 operand fits into a signed 16-bit operand, then these two macro formats translate into a single ADDI machine instruction, with the IMM32 operand negated.
If the IMM32 operand does not fit, or has an unknown value, then these two macro formats translate to:
li $at, IMM32
sub rC, rA, $at