copyv

copyv ABv → reg

Materializes a large constant from values following the copyv instruction as one or more trailing 32-bit chunks.

Semantics

dstreg = arg(A)
n = arg(B)
R(dstreg) = instr[PC+1]
PC ++
if n > 2
  R(dstreg) = (R(dstreg) << 32) | instr[PC+2]
  PC ++

Examples

copyv R0 400000000
// encoded as: copyv R0 0x1 0x17d78400

copyv R1 0xdeadbeefbabeface
// encoded as: copyv R1 0x2 0xdeadbeef 0xbabeface

// Equivalent "assignment" syntax:
R1 = 0xdeadbeefbabeface
// encoded as: copyv R1 0x2 0xdeadbeef 0xbabeface

RSM instructions

copy
copyv
load
load4u
load4s
load2u
load2s
load1u
load1s
store
store4
store2
store1
add
sub
mul
adds
subs
muls
div
mod
and
or
xor
shl
shrs
shru
binv
not
eq
neq
ltu
lts
lteu
ltes
gtu
gts
gteu
gtes
if
ifz
call
jump
ret
tspawn
syscall
write
read
mcopy
mcmp
stkmem