Skip to main content

MOVE

Set the left register to the value of the right operand (register or literal value).

OpcodeBytesCyclesFormExample
$4032move b:_, {byte}move b:1, 123
$4132move p:_, {s_byte}move p:2, 123
$b242move p:_, {pair}move p:2, 12345
$4232move i:_, {s_byte}move i:4, 123
$b342move i:_, {s_pair}move i:4, 12345
$e252move i:_, {u_trio}move i:4, $12_3abc
$4332move i:_, xhex {xint}move i:4, xhex $d000_0000
$4433move b:_, b:_move b:1, b:2
$4533move p:_, p:_move p:2, p:4
$4633move i:_, i:_move i:4, i:8
$2622move sp, i:_move sp, i:4
$2722move i:_, spmove i:4, sp
$b441move fp, {u_trio}move fp, $12_3abc
$1411move fp, spmove fp, sp
$1511move sp, fpmove sp, fp

Notes

  • The left operand is the target where the output will go.

  • For example, move p:0, 123 puts the literal value 123 into register p:0.

  • For example, move b:1, b:2 copies the value of b:2 into the register b:1.

  • For example, move i:4, xhex $d000_0000 puts the value $d000_0000 into i: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:

OpcodeBytesCyclesRaw formJump example
$b541move ip, {u_trio}jump fixed $12_3abc
$2822move ip, i:_jump i:4