Primary design document for the Z80 Sudoku solver.
UNKN EQU 0 ; 0 chosen since valid digits are 1–9
Only the low 4 bits of each cell are significant for the digit value. The upper 4 bits are available for scratch metadata during solving.
The solver operates in-place at address $A000.
Rationale: avoids copy overhead, simplifies HL final requirement, and leverages upper nibble for temporary metadata.
Hybrid constraint-propagation plus depth-first backtracking.
1. Deterministic propagation: compute candidate masks and fill forced cells.2. If unresolved: choose cell with fewest candidates and recurse (DFS).
See sub-note: Z80-sudoku-challenge-memory-map
See sub-note: Z80-sudoku-challenge-algorithm
HL: primary board pointer / return value (must contain base address at HALT).DE: secondary pointer (row/column scans).BC: counters and masks.AF: arithmetic and flag evaluation.