MOVE
Set the left register to the value of the right operand (register or literal value).
| Opcode | Bytes | Cycles | Form | Example |
|---|---|---|---|---|
| $40 | 3 | 2 | MOVE B:_, {BYTE} | MOVE B:1, 123 |
| $41 | 3 | 2 | MOVE P:_, {S_BYTE} | MOVE P:2, 123 |
| $B2 | 4 | 2 | MOVE P:_, {PAIR} | MOVE P:2, 12345 |
| $42 | 3 | 2 | MOVE I:_, {S_BYTE} | MOVE I:4, 123 |
| $B3 | 4 | 2 | MOVE I:_, {S_PAIR} | MOVE I:4, 12345 |
| $E2 | 5 | 2 | MOVE I:_, {U_TRIO} | MOVE I:4, $12_3ABC |
| $43 | 3 | 2 | MOVE I:_, XHEX {XINT} | MOVE I:4, XHEX $D000_0000 |
| $44 | 3 | 3 | MOVE B:_, B:_ | MOVE B:1, B:2 |
| $45 | 3 | 3 | MOVE P:_, P:_ | MOVE P:2, P:4 |
| $46 | 3 | 3 | MOVE I:_, I:_ | MOVE I:4, I:8 |
| $26 | 2 | 2 | MOVE SP, I:_ | MOVE SP, I:4 |
| $27 | 2 | 2 | MOVE I:_, SP | MOVE I:4, SP |
| $B4 | 4 | 1 | MOVE FP, {U_TRIO} | MOVE FP, $12_3ABC |
| $14 | 1 | 1 | MOVE FP, SP | MOVE FP, SP |
| $15 | 1 | 1 | MOVE SP, FP | MOVE SP, FP |
Notes
-
The left operand is the target where the output will go.
-
For example,
MOVE P:0, 123puts the literal value 123 into registerP:0. -
For example,
MOVE B:1, B:2copies the value ofB:2into the registerB:1. -
For example,
MOVE I:4, XHEX $D000_0000puts the value$D000_0000intoI:4. Large numbers must be compatible with XHEX encoding. -
This instruction does not affect the CPU condition flags.
Jump forms
Two forms of the JUMP pseudo-instruction are actually implemented as MOVE instructions involving the IP register:
| Opcode | Bytes | Cycles | Raw form | Jump example |
|---|---|---|---|---|
| $B5 | 4 | 1 | MOVE IP, {U_TRIO} | JUMP FIXED $12_3ABC |
| $28 | 2 | 2 | MOVE IP, I:_ | JUMP I:4 |