Does loading 0x80 produce a negative value?
No. It zero-extends the byte; a successful load of 0x80 gives 0x00000080 on RV32 or 0x0000000000000080 on RV64.
RV32/RV64 Zcb: load a byte at rs1'+offset 0–3, zero-extend to XLEN, and write rd'; both registers are x8–x15.
C.LBU (Zcb, CLB format) loads a byte from rs1' + zero-extended offset into rd', zero-extended to XLEN. rd' and rs1' limited to x8-x15. Expands to lbu rd',uimm(rs1'). Part of Zcb, depends on Zca.
Explore the 16-bit encoding, operands, calculation, and architectural result.
RV32/RV64, Zcb (requires Zca)
16-bit encoding fields
RV32/RV64 Zcb: load a byte at rs1'+offset 0–3, zero-extend to XLEN, and write rd'; both registers are x8–x15.
RV32/RV64 Zcb, x10=0x2000 and mem[0x2001]=0x80, with a successful access: c.lbu x9, 1(x10) gives x9=0x80 with all higher bits zero.
No. It zero-extends the byte; a successful load of 0x80 gives 0x00000080 on RV32 or 0x0000000000000080 on RV64.
The offset is an unsigned byte value from 0 through 3. Byte accesses are naturally aligned, while address validity and accessibility still depend on the EEI.