Click to switch representation:
Instruction Set Overview OpCode Matrix Instruction Details
Each opcode has an associated color which represents the flag (combination) that is available to that opcode. Because of this, I only need to connect a single flag-bit to the controller, which saves address/input bits in order to be able to have a full 8-bit opcode input. The single flag-input-bit is selected with a 3-to-8 multiplexer from all the available flags. The control bits for the multiplexer are the three most significant bits of the opcode.
| Color/Opcode range | Available flag (combination) |
|---|---|
| 000xxxxx | ZF (= ALU Zero-Flag) |
| 001xxxxx, 010xxxxx | CF (= ALU Carry-Flag) |
| 011xxxxx | VF (= ALU Overflow-Flag) |
| 100xxxxx | NF ⊕ VF |
| 101xxxxx | (NF ⊕ VF) ∨ ZF |
| 110xxxxx | CF ∨ ZF |
| 11100xxx | SER_RX_RDY |
| 11101xxx | SER_TX_RDY |
| 11110xxx | NF (= ALU Negative-Flag) |
| 11111xxx | Not assigned yet |