DCPU-8 Stock-able Computer

✅ Project Goal

Create a modular stackable 8-bit computer, compatible with:

  • DCPU-8 v0.1 (your custom ISA)
  • Stack-based function calls (CALL, RET, PUSH, POP)
  • Plug-and-play PCBs that connect via a 40-pin backplane

🧱 Module Overview

Each module is a separate PCB. They all plug into a main bus board or stack vertically with headers.

PCB ModuleFunctionFeatures
1. Clock555 Timer / Manual button / Speed switchStep/Run modes
2. Control UnitMicrocode EEPROM sequencerROM-based finite state controller
3. RegistersA, B, IR, MAR, OUT, SP74LS173 or 74LS161
4. ALU + FlagsBasic ALU (ADD, SUB, AND, OR, XOR) + ZUsing 74LS181 or discrete gates
5. MemoryEEPROM (program) + SRAM (data)28C256 + 62256 or similar
6. Stack ModuleStack Pointer, Stack RAM accessSP register, decrement/increment logic
7. Output DisplayLEDs or 7-segment from OUT registerVisual debug
8. System BusBackplane or vertical headersShared control/data/address lines

🔌 Shared Bus Design

A 40-pin dual-row connector (2×20) can be used between all boards. Here’s a typical pin assignment:

Pin RangeSignal TypeNotes
0–7Data Bus (D0–D7)Bidirectional
8–15Address Bus (A0–A7)Unidirectional
16CLKClock
17RSTReset
18Z FlagZero Flag
19C FlagCarry Flag
20IR EnableInstruction Register load
21–29Custom Control Linese.g., Memory Enable, Write, etc.
30–31GND, VccPower lines

You can route these on a vertical header or horizontal backplane (à la RC2014).


🔁 Stack & CALL/RET Implementation

  • Stack Pointer (SP) register uses a counter IC (e.g., 74LS193) and is mapped to a dedicated RAM range (e.g., 0xF0–0xFF)
  • CALL pushes return address onto stack, then jumps
  • RET pops return address back into PC
  • PUSH and POP work with A/B registers and SP

These are microcoded in the Control Unit using EEPROM (e.g., 28C16/28C64).


💾 Program Example: DCPU-8 Adder with CALL

Let’s say your ROM contains this:

assemblyCopyEdit00: 01 10     ; LOAD B, [0x10]
02: 00 11     ; LOAD A, [0x11]
04: 40        ; ADD A, B
05: 20 12     ; STORE A, [0x12]
07: 60 0A     ; CALL function @ 0x0A
09: FF        ; HALT

; Subroutine
0A: 10 2A     ; A = 0x2A (load literal or via [mem])
0C: 20 13     ; STORE A, [0x13]
0E: 61        ; RET

🛠️ Tools You’ll Use

ToolUse
KiCad / EasyEDASchematic and PCB layout
JLCPCB / OSH ParkManufacturing boards
28C256 / 62256EEPROM and RAM (program & data)
74LS / 74HC seriesLogic chips (registers, ALU, control)
Header pins & stack spacersConnect modules in stack/backplane

🚀 Suggested Build Order

  1. Clock Board – verify manual & automatic clock control
  2. Bus Board – shared headers, power rails
  3. Registers Board – implement A, B, OUT
  4. Memory Board – EEPROM for program + SRAM for data
  5. Control Unit – EEPROM-based microcode sequencer
  6. ALU Board – logic for ADD, SUB, AND, etc.
  7. Stack Module – with SP + stack memory
  8. Output Board – LED or display from OUT register