An instruction consists of the following two elements.
(1) Mnemonic: Specifies the operation of the instruction.
(2) Size specifier: Specifies the size of the data which undergoes the operation.
A mnemonic specifies the operation of the instruction.
Example:
MOV: Transfer instruction
ADD: Arithmetic instruction (addition instruction)
A size specifier specifies the size of the operand(s) in the instruction code.
A size specifier specifies the operation size of the operand(s). More exactly, it specifies the size of data to be read to execute the instruction. The following can be specified as size.
A size specifier can be written in either uppercase or lowercase.
Example: MOV.B #0, R3 ... Specifies the byte size.
Size specifiers can be and must be used for the instructions whose mnemonics are suffixed with ".size" in the Instruction Format description of the RX Family Software Manual.
Branch distance specifiers are used in branch and relative subroutine branch instructions.
The following can be specified as length.
A distance specifier can be written either in uppercase or lowercase.
BRA.W label ... Specifies 16-bit relative.
BRA.L R1 ... Specifies register relative.
This specifier can be omitted. When the specifier is omitted, the assembler automatically selects the distance from among S, B, W, and A to generate the smallest opcode when the following conditions are all satisfied.
(1) The operand is not a register.
(2) The operand specifies the destination for which the branch distance is determined at assembly.
Examples: Label + value determined at assembly
Label - value determined at assembly
Value determined at assembly + label
(3) The label of the operand is defined within the same section.
Note that when a register is specified as the operand, branch distance specifier L is selected.
For a conditional branch instruction, if the branch distance is beyond the allowed range, a code is generated by inverting the branch condition.
The following shows the branch distance specifiers that can be used in each instruction.