swap
Swap register halves
Swaps the upper and lower words of a data register.
Size .w
Used in
- Arithmetic, logic and bitsM68K assembly
- Multiply and divide, with the remainderM68K assembly
- A subroutine with its arguments in registersM68K assembly
- Print a number in any base without helpM68K assembly
- A bouncing ballM68K assembly
- The snake gameM68K assembly
- Flappy birdM68K assembly
XNZVC –●●00
- ● set from the result
- 0 always 0
- – not changed
Forms
swap
Operands
Dn- A data register,
d0tod7. More
move.l #$12345678, d0
swap d0 ; d0 = $56781234