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 |