
CHAPTER 2 V
R
4120A
Preliminary User’s Manual S14767EJ1V0UM00
99
2.3.7.4 Instruction details
(1) Load and store instructions
Load and Store instructions move data between memory and the general registers. The only addressing mode
that is supported is the mode for adding immediate offset to the base register.
Table 2-35. Load and Store Instructions (1/3)
Instruction
Format and Description
Load Byte
LB ry, offset (rx)
The 5-bit immediate is zero extended and then added to the contents of general register rx to form the
virtual address. The bytes of the memory location specified by the address are sign extended and
loaded into general register ry.
Load Byte Unsigned
LBU ry, offset (rx)
The 5-bit immediate is zero extended and then added to the contents of general register rx to form the
virtual address. The bytes of the memory location specified by the address are zero extended and
loaded into general register ry.
Load Halfword
LH ry, offset (rx)
The 5-bit immediate is shifted left one bit, zero extended, and then added to the contents of general
register rx to form the virtual address. The halfword of the memory location specified by the address is
sign extended and loaded to general register ry.
If the least significant bit of the address is not 0, an address error exception is generated.
Load Halfword
Unsigned
LHU ry, offset (rx)
The 5-bit immediate is shifted left one bit, zero extended, and then added to the contents of general
register rx to form the virtual address. The halfword of the memory location specified by the address is
zero extended and loaded to general register ry.
If the least significant bit of the address is not 0, an address error exception is generated.
LW ry, offset (rx)
The 5-bit immediate is shifted left two bits, zero extended, and then added to the contents of general
register rx to form the virtual address. The word of the memory location specified by the address is
loaded to general register ry. In the 64-bit mode, it is further sign extended to 64 bits.
If either of the lower two bits is not 0, an address error exception is generated.
LW rx, offset (pc)
The two lower bits of the BasePC value associated with the instruction are cleared to form the masked
BasePC value. The 8-bit immediate is shifted left two bits, zero extended, and then added to the
masked BasePC to form the virtual address. The contents of the word at the memory location
specified by the address are loaded to general register rx. In the 64-bit mode, it is further sign
extended to 64 bits.
Load Word
LW rx, offset (sp).
The 8-bit immediate is shifted left two bits, zero extended, and then added to the contents of general
register sp to form the virtual address. The contents of the word at the memory location specified by
the address are loaded to general register rx. In the 64-bit mode, it is further sign extended to 64 bits.
If either of the two lower bits of the address is 0, an address error exception is generated.