The following can be specified for imm:
Adds the value of the absolute expression, relative expression, or expression with HIGHW, LOWW, or HIGHW1 applied, specified by the first operand, to the value of the register specified by the second operand, and stores the result into the register specified by the third operand.
Relative expression having $label for a label having a definition in the sdata/sbss-attribute section |
The addi machine instruction takes an immediate value in the range of -32,768 to +32,767 (0xFFFF8000 to 0x7FFF)as the first operand. |
If the following is specified for imm, the assembler executes instruction expansion to generate multiple machine instructions. |
Else if reg2 is the same as reg1
Else if reg2 is the same as reg1
Relative expression having #label or label, or that having $label for a label having no definition in the sdata/sbss-attribute section |
addi #label, reg1, r0 |
mov #label, r1 add reg1, r1 |
addi label, reg1, r0 |
mov label, r1 add reg1, r1 |
addi $label, reg1, r0 |
mov $label, r1 add reg1, r1 |
Else if reg2 is the same as reg1
addi #label, reg1, reg2 |
mov #label, r1 add r1, reg2 |
addi label, reg1, reg2 |
mov label, r1 add r1, reg2 |
addi $label, reg1, reg2 |
mov $label, r1 add r1, reg2 |
addi #label, reg1, reg2 |
mov #label, reg2 add reg1, reg2 |
addi label, reg1, reg2 |
mov label, reg2 add reg1, reg2 |
addi $label, reg1, reg2 |
mov $label, reg2 add reg1, reg2 |