On this page:
ldl
ldh
ldw
ldd
ldr*
ldr
swap*
swap

3 0001 - Register Operations🔗

opcode

(ldl i w)

 
w = bb68-gpr
 
  i : (integer-in 0 255)
  w : (integer-in 0 15)

image

 mask: f000

value: 1000

Loads an 8-bit constant into the bottom 8 bits of the register "w", clearing its higher 8 bits to zero.

opcode

(ldh i a)

 
a = bb68-gpr
 
  i : (integer-in 0 255)
  a : (integer-in 0 15)

image

 mask: f000

value: 3000

Loads an 8-bit constant into the higher 8 bits of the register "a", keeping its lower 8 bits unchanged.

macro opcode

(ldw r:bb68-gpr w:bb68-word)

Loads a 16-bit (word) constant into the register "r".

This is a macroinstruction composed of one LDH and one LDL instruction, each loading a half of the constant.

macro opcode

(ldd p:bb68-gprp l)

Loads 32-bit integer into the specified pair. The higher 16 bits go into the first register and the lower into the second.

private opcode

(ldr* w r)

 
w = bb68-gpr
     
r = bb68-gpr
 
  w : (integer-in 0 15)
  r : (integer-in 0 15)

image

 mask: ff00

value: 2000

macro opcode

(ldr variant)

 
variant = dest:bb68-gpr src:bb68-gpr
  | dest:bb68-gprp src:bb68-gprp
Copies/moves a value to a register or register pair dest from a given register (pair) src.

private opcode

(swap* α β)

 
α = bb68-gpr
     
β = bb68-gpr
 
  α : (integer-in 0 15)
  β : (integer-in 0 15)

image

 mask: ff00

value: 2100

macro opcode

(swap variant)

 
variant = dest:bb68-gpr src:bb68-gpr
  | dest:bb68-gprp src:bb68-gprp
Swaps values of a register or register pair dest with a given register (pair) src.