Skip to content

Instruction Set Architecture

Overview

This module specifies the instruction set architecture of the virtual chip that comprises of a minimal set of simple instructions.

Instruction Format

The low-level language will be compiled into binary (machine) code. A compiled instruction, in big endian order, takes 12 bits where; the first 4 represent the instruction and the remaining 8 represent argument(immediate value) passed to the instruction. Thus our virtual chip may be a 12-bit chip for our display unit.

Op CodeOperand(Immediate Value)
000000000000

This implies that the maximum number of instructions that can be supported are 24 = 16 and 28 = 256 for arguments. Consquently, the display unit must have pixel positions ranging from 0 to 255 in both dimenstions (256x256 screen resolution).

Instruction Set

The language is ought to be simple and direct. Supported instructions are listed below illustrating how they should be written and a description of what each does is provided.

What you should know:

  • The state of the pixel can be;
    • on -> 1
    • off -> 0
  • Manipulation of the pixels uses an abstract cursor consisting of two coordinates, x and y stored in internal registers of the chip.
OpcodeMnemonic
0000NOP
0001RESET
0010IRESET
0011INVERT
0100SET
0101MOVX
0110MOVY
0111ADDX
1000ADDY
1001SUBX
1010SUBY
1011-
1100-
1101-
1110-
1111-

This set consists of simple instructions and since this is a simulation, the hardware implementation details are not specified but rather to be implicitly implemented in the virtual chip. For example, SET is a simple instruction that just turns on/off one(current) pixel.

IMPORTANT

The usage and description of each instruction are defined here.

References