Template:360 opcode RX

From Wikibooks, open books for an open world
Jump to: navigation, search
RX Instruction (4 bytes)
Byte 1 Byte 2 Bytes 3 and 4
target register Source Address
(In Hex) (8 bits)
Opcode
{{{1}}}
(4 bits)

0..F
(4 bits)
index
register

0..F
(4 bits)
base
register

0..F
(12 bits)
displacement
0..FFF
  • The first argument is a target register which value is affected by the instruction.
  • The second argument is the source value location address where the contents are to be loaded into the target register. This consists of a base register, an index register, and a displacement address. The displacement is used as an unsigned offset of 0 to 4095 from the value in the base register, and this displacement is added to the value contained in the base register. If the index register is 0, it is ignored; otherwise, its contents are added to the previous result to obtain the final address.
  • The base_register and index_register values are 0 to 15. The offset address is 0 to 4095.

Usage for this template: {{360 opcode RX|opcode}}
or {{360 opcode RX|opcode|S}}
or {{360 opcode RX|opcode|B}}
Where opcode is the 2-digit hexadecimal opcode value and the second parameter is used, S when the register is a source value rather than the target value; B when this is a branch instruction.