#### 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)

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).

The list of available instructions is as follows:

` 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)

`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

llllllll = address low byte (to set in M1/J1)

hhhhhhhh = address high byte (to set in M2/J2)

`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)

` r = destination register (0-A, 1-B)`

ddddd = value (-16..15)