This group of instructions is used to load value from memory to any register. There are special commands for byte, wyde, tetra and octa data.
All instructions allows to form memory address by two ways:
- as a sum of the values from two registers (second and third operands);
- as a sum of a register value (second operand) and byte immediate constant (third operand).
So every operation of this group have two modifications.
Such method of address calculation makes possible to realize indirect and index method of data addressing easily.
To understand the difference between signed and unsigned load please read a page about sign and unsigned data and especially about sign extension.
Code | Mnemonic | Name |
Comments |
80 | LDB $X, $Y, $Z |
load byte |
byte with address [$Y + $Z] is loaded into register X as a signed number (sign bit is extended) |
81 | LDB $X, $Y, Z |
load byte immediate |
byte with address [$Y + Z] is loaded into register X as a signed number (sign bit is extended) |
82 | LDBU $X, $Y, $Z |
load byte unsigned |
byte with address [$Y + $Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
83 | LDBU $X, $Y, Z |
load byte unsigned immediate |
byte with address [$Y + Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
84 | LDW $X, $Y, $Z |
load wyde |
wyde with address [$Y + $Z] is loaded into register X as a signed number (sign bit is extended) |
85 | LDW $X, $Y, Z |
load wyde immediate |
wyde with address [$Y + Z] is loaded into register X as a signed number (sign bit is extended) |
86 | LDWU $X, $Y, $Z |
load wyde unsign |
wyde with address [$Y + $Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
87 | LDWU $X, $Y, Z |
load wyde unsign immediate |
wyde with address [$Y + Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
88 | LDT $X, $Y, $Z |
load tetra |
tetra with address [$Y + $Z] is loaded into register X as a signed number (sign bit is extended) |
89 | LDT $X, $Y, Z |
load tetra immediate |
tetra with address [$Y + Z] is loaded into register X as a signed number (sign bit is extended) |
8A | LDTU $X, $Y, $Z |
load tetra unsigned |
tetra with address [$Y + $Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
8B | LDTU $X, $Y, Z |
load tetra unsigned immediate |
tetra with address [$Y + Z] is loaded into register X as an unsigned number (higher bits are filled by 0) |
8C | LDO $X, $Y, $Z |
load octa |
octa with address [$Y + $Z] is loaded into register X as a signed number |
8D | LDO $X, $Y, Z |
load octa immediate |
octa with address [$Y + Z] is loaded into register X as a signed number |
8E | LDOU $X, $Y, $Z |
load octa unsign |
octa with address [$Y + $Z] is loaded into register X as an unsigned number (identical to 8C instruction) |
8F | LDOU $X, $Y, Z |
load octa unsign immediate |
octa with address [$Y + Z] is loaded into register X as an unsigned number (identical to 8D instruction) |
The instructions LDHT and LDA will be described later.

Examples:
- instruction LDB $1, $2, $3 does the following: calculate memory address as a sum of the values from registers 2 and 3; reads byte from this address and load it to register 1; 7 higher bytes of $1 will be zero
- the only difference of instruction LDB $1, $2, 3 and the previous one is in memory address calculation: here it is a sum of the registers 2 value and constant 3; note that if the last operand is 0, instruction just read memory address stored in register 2
- instruction LDBU $1, $2, $3 have some specific in comparison with the first example: the higher bits of register 1 will be filled not by zero, but by the value of the sign bit from read byte: for example for byte 7F we shall have result 0000 0000 0000 007F, but for 80 - FFFF FFFF FFFF FF80
- instruction LDT $1, $2, $3 reads 4 bytes from memory address [$2 + $3] to register 1; high tetra (4 higher bytes) of $1 will be reset to zero
Related topics:
"MMIX basics" page