8-bit Computer - Micro Instructions & OpCodes <

Micro Instruction Operation Description
HLT Halt Halt Clock
MI Memory Adress Register IN Get the Memory Address (4-bit) from the Bus
RI RAM IN Get RAM content (8-bit) from the Bus
RO RAM OUT Put RAM content (8-bit) on the Bus
IO Instruction Register OUTPut Instruction Register argument (4-bit) on the Bus
II Instruction Register IN Get Instruction Register value (8-bit) from the Bus
AI 'A' Register IN Get 'A' Register value (8-bit) from the Bus
AO 'A' Register OUT Put 'A' Register value (8-bit) on the Bus
EO SUM Register OUT Put SUM Register value (8-bit) on the Bus
SU Substraction Perform a substract operation
BI 'B' Register IN Get 'B' Register value (8-bit) from the Bus
OI Output IN Get value (8-bit) from the Bus to display it on the LED
CE Counter ENABLE Increase Program Counter by one
CO Counter OUT Put Program Counter content (4-bit) on the bus
J Jump Jump to Memory Address
FI Flag Register IN Get Carry/Zero Flag from SUM Register

Every OpCode requires two Micro Instruction Steps to be fetched from the current Memory Address in to the Instruction Register. We call this operation Fetch.

OpCode # OpCode # << 4 OpCode Syntax Micro Instruction Steps Operation Description
- - - - Step 0: CO MI
Step 1: RO II CE
FetchFetch OpCode from current Memory Address
00 (0000 0000) NOPNOP Step 2: -
Step 3: -
Step 4: -
No Operation Do nothing
1 16 (0001 0000) LDALDA [memory address] Step 2: IO MI
Step 3: RO AI
Step 4: -
Load value in to 'A' Register Load value from RAM in to 'A' Register
232 (0010 0000) ADD ADD [memory address] Step 2: IO MI
Step 3: RO BI
Step 4: EO AI FI
Addition Load value from RAM in to 'B' Register and add it with 'A' Register. The result will be in the SUM Register and stored in to the 'A' Register
348 (0011 0000) SUB SUB [memory address] Step 2: IO MI
Step 3: RO BI
Step 4: EO AI FI SU
Substraction Load value from RAM in to 'B' Register and substract it from 'A' Register. The result will be in the SUM Register and stored in to the 'A' Register
4 64 (0100 0000) STA STA [memory address] Step 2: IO MI
Step 3: AO RI
Step 4: -
Store value in to RAM Store value from 'A' Register in to RAM
5 80 (0101 0000) LDI LDI [4-bit value] Step 2: IO MI
Step 3: -
Step 4: -
Load value in to 'A' Register Load value from Instruction Register in to 'A' Register
6 96 (0110 0000) JMP JMP [memory address] Step 2: IO J
Step 3: -
Step 4: -
JumpJump to Memory Address
7 112 (0111 0000) JC JC [memory address] Step 2: CF=0 -
Step 3: CF=1 IO J
Step 4: -
Step 5: -
Jump on Carry Jump to Memory Address if Carry Flag is set
8 128 (1000 0000) JZ JZ [memory address] Step 2: ZF=0 -
Step 3: ZF=1 IO J
Step 4: -
Step 5: -
Jump on Zero Jump to Memory Address if Zero Flag is set
14 224 (1110 0000) OUT OUT Step 2: AO OI
Step 3: -
Step 4: -
Display value Display value from 'A' Register to the LED
15 240 (1111 0000) HLTHLT Step 2: HLT
Step 3: -
Step 4: -
Halt Halt Clock