Brookshear Machine Instructions

The Brookshear machine has 16 registers, numbered (in hexadecimal) 0x to Fx. Each register holds one byte (8 bits). There are 256 cells in memory, numbered from 00x to FFx. Each cell holds one byte. Each instruction in the language is coded in two bytes. The first half-byte (represented by the first hex digit) contains the opcode. The thirteen forms of instruction are described in the table below.

0iii - No-operation

1RXY - Load register R with contents of location XY

2RXY - Load register R with value XY

3RXY - Store contents of register R at location XY

4iRS - Move contents of register R to register S

5RST - Add contents of registers S and T as binary numbers, place result in register R

6RST - Add contents of registers S and T as floating-point numbers, place result in register R

7RST - OR together the contents of registers S and T , place result in register R

8RST - AND together the contents of registers S and T , place result in register R

9RST - XOR together the contents of registers S and T , place result in register R

ARiZ - Rotate the contents of register R one bit to the right, Z times

BRXY - Jump to instruction at XY if contents of register R equal contents of register 0

Ciii - Halt

DRXY - Jump to instruction at XY if contents of register R are greater than contents of register 0

 

The following conventions are used in the above table:

R,S,T - Register numbers

XY - A one-byte address or data value

Z - A half-byte value

i - Ignored when the instruction is de-coded: usually entered as 0