Z80 Sudoku — Design Overview

Memory Layout

Board located at $A000 – $A050 (81 bytes).

Each byte structure:

bits 0–3  = value (0–9)
bits 4–7  = temporary workspace (candidate mask or flags)

Sentinel Value

UNKN EQU 0 — zero is unused by valid Sudoku digits (1–9).

Algorithm Strategy

Phase 1: Deterministic constraint propagation.

Phase 2: Depth-first backtracking using stack frames.

Stack Frame Concept

Each guess frame stores:

• Cell index (0–80)

• Remaining candidate mask

Register Conventions (Draft)

HL → board pointer

DE → secondary scan pointer

BC → loop counters / index math

A → candidate mask / temporary arithmetic

Navigation

Back to Project Index