The following can be specified for displacement (disp):
The ld.b, ld.bu, ld.h, ld.hu, and ld.w instructions load data of 1 byte, 1 halfword, and 1 word, from the address specified by the first operand, int the register specified by the second operand.
If any of the following is specified for disp, the assembler generates one ld machine instructionNote. In the following explanations, ld denotes the ld.b/ld.h/ld.w/ld.bu/ld.hu instructions. |
Relative expression having $label for a label having a definition in the sdata/sbss-attribute section |
The ld machine instruction takes an immediate value in the range of -32,768 to +32,767 (0xFFFF8000 to 0x7FFF) as the displacement |
If any of the following is specified for disp, the assembler performs instruction expansion to generate multiple machine instructions. |
Absolute expression having a value exceeding the range of -32,768 to +32,767, but within the range of -4,194,304 to +4,194,303 |
Relative expression having #label or label, or that having $label for a label having definition in the sdata/sbss-attribute section |
If an absolute expression, a relative expression having !label, a relative expression having #label, or a relative expression having #label and with LOWW applied is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [r0] is specified. |
If a relative expression having $label, or a relative expression having $label and with LOWW applied, is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [gp] is specified. |
If a relative expression having %label is specified as disp, [reg1] can be omitted. If omitted, the assembler assumes that [ep] is specified. |
ld.b and ld.h sign-extend the data of 1 byte and 1 halfword, respectively, and load the data into a register as 1 word. |
If a value that is not a multiple of 2 is specified as disp of ld.h, ld.w, or ld.hu, the assembler aligns disp with 2 and generates a code. Then, the assembler outputs the following messages. |
If r0 is specified as the second operand of ld.bu and ld.hu, the assembler outputs the following message and stops assembling. |