lhu
, lbu
, and move
Instructions
lhu rd, mem
# load unsigned halfword
lbu rd, mem
# load unsigned byte
move rd, rs
# move register contents
lhu
|
lbu & move
|
|
---|---|---|
.data val0: .byte 0 val1: .byte 1 val2: .byte 2 .text lhu $a0, val1 li $v0, 1 syscall |
.data val0: .byte 0 val1: .byte 1 val2: .byte 2 .text lhu $a0, val0 li $v0, 1 syscall |
.data val: .byte -10 .text lbu $t0, val move $a0, $t0 li $v0, 1 syscall |
Output | Output | Output |
Knock Knock! Who’s there? Cash. Cash who? I knew you were a nut! |