How the lbu MIPS instruction works

How the lbu MIPS instruction works

b’

n

and not sign extend it but what exactly does this mean?

n

n

Sign-extension: The remaining bits of the word are all set to the value of the most significant bit of the loaded entity.

n

For example: 0x80 => 0xFFFFFF80, and 0x7F => 0x0000007F.

n


n

Zero-extension: The remaining bits of the word are all set to zero.

n

For example: 0x80 => 0x00000080, and 0x7F => 0x0000007F.

n


n

In your example, the byte at 24($R2) is -18 (0xEE), assuming a little-endian layout. This would be 0xFFFFFFEE when sign-extended, and 0x000000EE when zero-extended.

How the lbu MIPS instruction works

Leave a Reply

Your email address will not be published.