Skip to content

LDR (Load Register)

Loads a value into a Destination register.

These instructions load 32-bit values into a register, completely overwriting its previous contents.

0x10 LDR rDst, imm32

Loads a constant 32-bit value directly into the destination register.

ArgumentDescription
rDstThe destination register where the data will be stored.
imm32The 32-bit value to load into the destination register.

0x11 LDR rDst, [rIdx]

Uses the address stored in rIdx to load a 32-bit value from memory into rDst.

ArgumentDescription
rDstThe destination register where the data will be stored.
rIdxThe register containing the memory address to read from.

0x12 LDR rDst, [rIdx + imm16]

Adds a signed 16-bit offset to rIdx to form an effective address, then loads the 32-bit value at that address into rDst.

ArgumentDescription
rDstThe destination register where the data will be stored.
rIdxThe base register containing the memory address.
imm16A signed offset (−32,768 to 32,767) added to the base address.

0x13 LDR rDst, [rIdx + rOff * imm4]

Computes an effective address as rIdx + (rOff × imm4), then loads the 32-bit value at that address into rDst. This is particularly useful for indexing into arrays with a known element stride.

ArgumentDescription
rDstThe destination register where the data will be stored.
rIdxThe base register containing the memory address.
rOffThe register whose value is scaled and added to the base address.
imm4A 4-bit scale factor (0–15) multiplied with rOff to form the offset.

0x14 LDR rDst, [imm32]

Loads the 32-bit value from the fixed memory address specified by imm32.

ArgumentDescription
rDstThe destination register where the data will be stored.
imm32The 32-bit absolute address to read from.