There is only a store byte instruction, so I don't get it why there are both load byte and load byte unsigned...
I tried looking for it but couldn't find anything helpful.
MIPS registers are 32 bits wide. When you load a single 8-bit byte into one of those registers from memory, you have to decide whether to sign-extend it or not. Hence the two load instructions. When storing, there's no such ambiguity.
A loading example:
.data
variable: .byte 0x80
.text
lb $t0, variable
lbu $t1, variable
After this code runs, t0
will be 0xffffff80
(-128), and t1
will be 0x00000080
(128).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With