4.2. Instruction Formats

Six basic instruction formats shall support 16 and 32-bit instructions. The operation code (opcode) shall normally consist of the 8 most significant bits of the instruction.

4.2.1. Register-to-Register Format

The register-to-register format is a 16-bit instruction consisting of an 8-bit opcode and two 4-bit general register (GR) fields that typically specify any of 16 general registers. In addition, these fields may contain a shift count, condition code, opcode extension, bit number, or the operand for immediate short instructions.


 MSB                            LSB
------------------------------------
|     Opcode     |  GR1   |  GR2   |
------------------------------------
  0             7  8    11 12    15

4.2.2. Instruction Counter Relative Format

The Instruction Counter (IC) Relative Format is a 16-bit instruction consisting of an 8-bit opcode and an 8-bit displacement field.


 MSB                         LSB
-----------------------------------
|     Opcode     |  Displacement  |
-----------------------------------
  0             7  8            15

4.2.3. Base Relative Format

The base relative instruction format is a 16-bit instruction consisting of a 6-bit opcode, a 2-bit base register field and an 8-bit displacement field. The base register (BR) field allows the designation of one of four different registers.


 MSB                            LSB
------------------------------------
|   Opcode   | BR |  Displacement  |
------------------------------------
  0         5  6 7  8            15

BR = 0  implies general register 12
BR = 1  implies general register 13
BR = 2  implies general register 14
BR = 3  implies general register 15

4.2.4. Base Relative Indexed Format

The base relative indexed instruction format is a 16-bit instruction consisting of a 6-bit opcode, a 2-bit base register field, a 4-bit opcode extension and a 4-bit index register field. The base register (BR) field allows the designation of one of four different base registers and the index register (RX) field allows the designation of one of fifteen different index registers.


MSB                               LSB
-------------------------------------
|   Opcode   | BR | Op.Ex. |   RX   |
-------------------------------------
  0         5  6 7  8    11 12    15

BR = 0  implies general register 12
BR = 1  implies general register 13
BR = 2  implies general register 14
BR = 3  implies general register 15
RX = 0  implies no indexing

4.2.5. Long Instruction Format

The Long Instruction Format is a 32-bit instruction consisting of an 8-bit opcode, a 4-bit general register field, a 4-bit index register field and a 16-bit address field.


MSB                                                            LSB
------------------------------------------------------------------
|    Opcode      |  GR1   |   RX   |    16-Bit Address Field     |
------------------------------------------------------------------
  0             7  8    11 12    15 16                         31 

Typically, GR1 is one of the 16 general registers on which the instruction is performing the operation. RX is one of the 15 general registers being used as an index register. The 16-bit address field is either a full 16-bit memory address or a 16-bit operand if the instruction specifies immediate addressing.

4.2.6. Immediate Opcode Extension Format

The immediate opcode extension format is a 32-bit instruction consisting of an 8-bit opcode, a 4-bit general register field, a 4-bit opcode extension and a 16-bit data field. Typically, GR1 is one of the 16 general registers on which the instruction is performing the operation. Op.Ex. is an opcode extension.


MSB                                                            LSB
------------------------------------------------------------------
|    Opcode      |  GR1   | Op.Ex. |    16-Bit Immediate Data    |
------------------------------------------------------------------
  0             7  8    11 12    15 16                         31 

4.2.7. Special Format

The special instruction format is a 16-bit instruction consisting of an 8-bit opcode followed by an 8-bit opcode extension (Op.Ex.).


MSB                              LSB
-----------------------------------
|   Opcode       |     Op.Ex.     |
-----------------------------------
  0             7  8            15