Files
Basys3Terminal/games/keep/crt0.s
T
brad ArantandClaude Opus 5.5 743071cff3 The Iron Keep: a top-down escape game, held-key ports, monitor HEX loader
games/keep: an original game in C for the Z-80 using the sprites - twelve
rooms, guards that patrol, see along rows and columns and shoot, keys and
locked doors, gold, ammunition and a crown to steal. gen.py holds the art
and castle map and checks reachability; test-keep.py runs it in z80emu on
a model of the board's ports, takes screenshots and has a bot play it
through. keep.bas loads KEEPGAME at 8600h and CALLs it.

Ports 88h/89h read keys held down (ps2_keystate), the monitor writes
Intel HEX records typed at its prompt, and tools/send-hex.py sends a
whole file and saves it as a memory file. Testbench covers both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 09:21:02 -08:00

38 lines
963 B
ArmAsm

; Start-up for a machine-code program that BASIC CALLs at 8600h: clear the
; variables, run main, and return to BASIC. The program has no initialised
; variables (gen.py's tables are const, so they stay in the code).
.module crt0
.globl _main
.globl s__DATA, l__DATA
.area _HEADER (ABS)
.org 0x8600
start:
ld hl, #s__DATA
ld bc, #l__DATA
ld a, b
or c
jr z, go
ld (hl), #0
dec bc
ld a, b
or c
jr z, go
ld d, h
ld e, l
inc de
ldir
go:
jp _main ; main's RET goes back to BASIC
.area _HOME
.area _CODE
.area _INITIALIZER
.area _GSINIT
.area _GSFINAL
.area _DATA
.area _INITIALIZED
.area _BSEG
.area _BSS
.area _HEAP