LBU

Load Byte Unsigned

LBU rd, offset(rs1)

Loads an 8-bit byte from memory and zero-extends it.

Details

LBU loads a byte from memory at address rs1+sext(offset), zero-extends it to XLEN bits, and writes it to rd.

Pseudocode Operation

R[rd] = zext(M[R[rs1] + sext(offset)][7:0]);

Example

LBU x10, 0(x2)

Encoding

Binary Layout
imm[11:0]
31:20
rs1
19:15
100
14:12
rd
11:7
0000011
6:0
 
Format I-Type
Opcode 0x03
Extension RV32I

Operands

  • rd
    Destination Register
  • rs1
    Base Address
  • offset
    Byte Offset