The following can be specified for imm:
Adds the value of the register 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 second operand.
Adds the value of the absolute expression or relative expression specified by the first operand to the value of the register specified by the second operand, and stores the result in the register specified by the second operand.
If this instruction is executed in syntax "add reg1, reg2", the assembler generates one add machine instruction. |
If the following is specified as imm in syntax "add imm, reg2", the assembler generates one add machine instructionNote. |
The add machine instruction takes a register or immediate value in the range of -16 to +15 (0xFFFFFFF0 to 0xF) as the first operand. |
If the following is specified for imm in syntax "add imm, reg2", the assembler executes instruction expansion to generate one or more machine instructions. |
Absolute expression exceeding the range of -16 to +15, but within the range of -32,768 to +32,767 |
If all the lower 16 bits of the value of imm are 0
Relative expression having !label or %label, or that having $label for a label with a definition in the sdata/sbss-attribute section |
add !label, reg |
addi !label, reg, reg |
add %label, reg |
addi %label, reg, reg |
add $label, reg |
addi $label, reg, reg |
Relative expression having #label or label, or that having $label for a label having no definition in the sdata/sbss-attribute section |