Bit 7 of 0xA4 is 1, so
that bit to all high order three bytes of
lbu zero-extends the byte from memory.
and storing bytes is used
for processing text and for low-level
(such as assemblers and operating systems).
Graphics programs, also, make frequent use
of these operations.
Both operations could be done using
with bit manipulation instructions,
but it is convenient to have byte-length load and store.
There is an instruction for storing a byte:
sb t,off(b) # The byte at off+b <— low-order # byte from register $t. # b is a base register. # off is 16-bit two's complement.
There is no need for two "store byte" instructions. Whatever is in the low-order byte of the register is copied to memory. The rest of the register is ignored. Of course, the register does not change.