ALU Operation
Performs an arithmetic or logic operation on the B (and optionally C) register(s).
r = destination register (0-A, 1-D)
fff = function code (000-NOP, 001-ADD, 010-INC, 011-AND, 100-OR, 101-XOR, 110-NOT, 111-SHL)
The computer is controlled by a series of instructions held in memory (a computer program) that are loaded into the instruction register one at a time and executed. Each instruction is formed of an 8-bit ‘op-code’ and falls in to a class of related instructions (identifiable by the leading part of the op-code).
If you’d like to try out the instructions there’s a full simulation of my relay computer available here which also has additional documentation. If you’d like to know even more you can find source code in my GitHub repo as follows:
The list of available instructions is as follows:
Performs an arithmetic or logic operation on the B (and optionally C) register(s). Branches to a given address if stated condition register flag(s) is set. Address of next instruction can optionally be saved in XY register. M register can also be loaded with 16-bit value (without jump). Copies the content of one 8-bit register to another. Copies the content of one 16-bit register to another. Loads a value between -16 and +15 in register A or B. Loads the value set on the front panel switches into register A or D. Halts execution of the program (optionally reseting the program counter from the front panel switches).ALU Operation
r = destination register (0-A, 1-D)
fff = function code (000-NOP, 001-ADD, 010-INC, 011-AND, 100-OR, 101-XOR, 110-NOT, 111-SHL)Branch/Call & 16-bit Load Immediate
d = destination register (0-M, 1-J)
s = 1 = load PC if sign bit is set (if negative); 0 = ignore sign bit
c = 1 = load PC if carry bit is set (if carry); 0 = ignore carry bit
z = 1 = load PC if zero bit set (if result is zero); 0 = ignore if zero bit set
n = 1 = load PC if zero bit clear (if result is not zero); 0 = ignore if zero bit clear
x = 1 = copy PC to XY; 0 = no copy
hhhhhhhh = address high byte (to set in M2/J2)
llllllll = address low byte (to set in M1/J1)8-Bit Move
ddd = destination register (000-A, 001-B, 010-C, 011-D, 100-M1, 101-M2, 110-X, 111-Y)
sss = source register (000-A, 001-B, 010-C, 011-D, 100-M1, 101-M2, 110-X, 111-Y)16-Bit Move
d = dest reg (0-XY or 1-PC)
ss = src reg (00-M, 01-XY, 10-J, 11-AS)Load Immediate
r = destination register (0-A, 1-B)
ddddd = value (-16..15)Load Switches
d = destination register (0-A, 1-D)
Halt
r = reload program counter (0-no reload, 1-reload from switches)
There’s also a video summary (as at Jan 2020) of the available instructions: