lbz
Load Byte and Zero
lbz RT, D(RA)
Loads a byte from memory into the low 8 bits of a register and clears the upper 56 bits.
Encoding
Binary Layout
34
0:5
RT
6:10
RA
11:15
D
16:31
Operands
-
RT
Target Register -
D
Displacement (16-bit Signed) -
RA
Base Register
Example
lbz r3, 0(r4)
// Load byte from address in r4.
Related
More in Base
Reference
View in PowerISA v3.1C Specification ↗
OPF Power ISA v3.1C
Description
The effective address (EA) is computed as the sum of the contents of register RA and the sign-extended immediate value D. The byte at EA is loaded into RT, with the upper 56 bits set to zero.
Operation
if 'lbz' then
EA ← (RA|0) + EXTS64(D)
RT ← EXTZ(MEM(EA, 1))
Programming Note
The lbz instruction is commonly used for loading a single byte from memory into a register while zeroing out the upper bits. Ensure that the address is properly aligned to avoid potential performance penalties or exceptions. This instruction operates at user privilege level and will raise an exception if the EA is outside the valid address space.