ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1
5-bit Opcode
Type of Instruction
ShortNameDescriptionALU functions3-bit OperandCondition tableNameRepresentation
2
00000yeetNOPNo Operation{ }{ }{ }k0TrueIf true
3
00001ALU OperationsADDAdditionAcc + Reg[@]A; R; SARegister[@]k1negativeIf msb == 1
4
00010SUBSubtractionAcc - Reg[@]A; !R; Cin; SARegister[@]k2zeroIf ALU == 0
5
00011INCIncrementReg[@] +1R; Cin;Register[@]k4carryIf over/underflow
6
00100DECDecrementReg[@] -1R; A; !ARegister[@]kCan be combined using OR
7
00101RSHRight ShiftReg[@] /2R; LSRegister[@]k
8
00110LSHLeft ShiftReg[@] x2R; RSRegister[@]k
9
00111XORExclusive OrAcc XOR Reg[@]!A; R; DCC; Cin; SARegister[@]k
10
01000Register
Operations
ASTAccumulator StoreAcc = Reg[@]R; SA;Register[@]kRegisters
11
01001RSTRegister StoreReg[@] = AccA; SA;Register[@]k0
12
01010RAMMSTMemory StoreRAM[next instruction] = Acc{ }{ }k1
13
01011MLDMemory LoadAcc = RAM[next instruction]{ }{ }k2
14
01100StackCALStack CallPush PC to stack; pc = jump address{ }ALU Flags3
15
01101RETStack ReturnPC = Pop Stack{ }ALU Flags4
16
01110InstructionsLIMLoad ImmediateReg[@] = [next instruction]{ }Register[@]k5
17
01111RJPRelative Jump toPC = PC + [next instruction]{ }ALU Flagsthe number given
must be value -1
6
18
10000RJIRelative Jump if notPC = PC + [next instruction]{ }ALU Flags
19
10001JMPJump toPC = [next instruction]{ }ALU Flagsk
20
10010JINJump if notPC = [next instruction] if not{ }ALU Flagsk7
21
10011ClockHLTHalt CPUStop the Clock{ }{ }k
22
23
24
25
26
27
28
29
30
31
32
33
34
35
5-bit opcodeCan be made of
36
yeetNOPNo operation{ }ADD $0, $0, $0
37
0Arithmetic
operations
ADDAddition$A = $B + $C
38
1ADCAdd with carry$A = $B + $C + 1
39
10SUBSubtraction$A = $B - $C
40
11SBBSubtract with borrow$A = $B + $C - 1
41
INCIncrement$A = $B + 1ADC $A, $B, $0
42
DECDecrement$A = $B -1SBB $A, $B, $0
43
RSHRight Shift$A = $B /2BSH $A, $B, -1
44
LSHLeft Shift$A = $B *2BSH $A, $B, 1
45
100BSHBarrel Shift$A = $B << [amount]
46
101MLTMultiply$A = $B * $C
47
110DIVDivide$A = $B / $C
48
111Bitwise Logic
operations
MODModulus/Remaider$A = $B % $C
49
NOTNot Gate$A = ~$BXNOR $A, $B, $0
50
1000OROr Gate$A = $B | $C
51
1001NORNor Gate$A = ~($B | $C)
52
1010XORExclusive Or Gate$A = $B ^ $C
53
1011XNORExclusive Nor Gate$A = ~($B ^ $C)
54
1100ANDAnd Gate$A = $B & $C
55
1101Register operationsNANDNand Gate$A = ~$B | ~$C
56
MOVMove$A = $BADD $A, $B, $0
57
1110IMMLoad Immediate Value$A = [Immediate Value]
58
1111
59
10000
60
10001RAM operationsSTRMemory StoreStores $4, $5, $6, $7 to RAM[address]
61
10010LODMemory LoadRetrieves RAM[address] to $4, $5, $6, $7
62
10011I/O operationsINPort Load$A = port[address]
63
10100OUTPort Storeport[address] = $A
64
10101Value Stack
operations
PSHPush to Value StackPush $A, Push $B, Push $C
65
10110POPPop to Value StackPop to $A, Pop to $B, Pop to $C
66
10111
67
11000BranchesCALCall subroutinePush PC+1 to call stack and PC = A
68
11001RETReturnPC = pop call stack
69
11010BRABranch ifif flags PC = [address]
70
11011BRAINBranch if notif !flags PC = [address]
71
11100BRA$Branch to regif flags PC = $A
72
11101BRAIN$Branch if not to regif !flags PC = $A
73
11111ClockHLTHalt CPU's clock<----
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100