SWAP
SWAP, SWAPP
SWAP instruction reverses the bytes of the source and save the result in the Destination.
| |
D | Source and Destination |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. |
| Error | Zero | Carry | ||
SWAP SWAPP | D | o | - | o | o | o | - | o | o | - | o | o | o | - | 2 | o | - | - |
Example)
If X01 is ON, the SWAP instruction reverses the order of the high bytes and low bytes of the Y00