subq
Subtract quick
Subtracts an immediate value of 1 to 8 from the second operand.
Sizes .b .w .l, .w by default
Used in
- Length of a stringM68K assembly
- Reverse a string in placeM68K assembly
- Recursion: factorial and FibonacciM68K assembly
- Binary searchM68K assembly
- The snake gameM68K assembly
- Flappy birdM68K assembly
XNZVC ●●●●●
- ● set from the result
Forms
Operands
The first operand value must be between 1 and 8. If the destination is an address register, it is always treated as a long, and the condition codes are not affected.
move.l #$10, d0
subq.l #8, d0
subq.l #1, d0
; subq.w #9, d0 ; error! immediate must be 1-8