LBU16 000010 |
rt |
base |
encoded offset |
6 |
3 |
3 |
4 |
LBU16 rt, decoded_offset(base) |
microMIPS |
Load Byte Unsigned (16-bit instr size) |
Load Byte Unsigned (16-bit instr size)
To load a byte from memory as an unsigned value
GPR[rt] = memory[GPR[base] + decoded_offset]
The encoded offset field is decoded to get the actual offset value. This decoded value is added to the contents of base register to create the effective address. Table 5.11 shows the encoded and decode values of the offset field.
Table 5.11 Offset Field Encoding Range -1, 0..14
Encoded Input (Hex) |
Decoded Value (Decimal) |
0 |
0 |
1 |
1 |
2 |
2 |
3 |
3 |
4 |
4 |
5 |
5 |
6 |
6 |
7 |
7 |
8 |
8 |
9 |
9 |
a |
10 |
b |
11 |
c |
12 |
d |
13 |
e |
14 |
f |
-1 |
The contents of the 8-bit byte at the memory location specified by the effective address are fetched, zero-extended, and placed in GPR rt. The 4-bit signed offset is added to the contents of GPR base to form the effective address.
The 3-bit register fields can only specify GPRs $2-$7, $16, $17.
decoded_offset = Decode(encoded_offset) vAddr = sign_extend(decoded_offset) + GPR[base] (pAddr, CCA) = AddressTranslation (vAddr, DATA, LOAD) pAddr = pAddrPSIZE-1..3 || (pAddr2..0 xor ReverseEndian3) memdoubleword = LoadMemory (CCA, BYTE, pAddr, vAddr, DATA) byte = vAddr2..0 xor BigEndianCPU3 GPR[rt] = zero_extend(memdoubleword7+8*byte..8*byte)
TLB Refill, TLB Invalid, Address Error, Watch