zxgammon.asm
The file to assemble: places the program and the loading screen in memory, and writes the snapshot and the tape (with its BASIC loader). Download · All the source
; zxGammon: backgammon for the 48K ZX Spectrum.; Copyright (C) 2026 Paul Hankin. Free software under the GNU General; Public License, version 3 or later; see COPYING.;; Assemble with sjasmplus (https://github.com/z00m128/sjasmplus):;; sjasmplus zxgammon.asm;; which writes zxgammon.sna (a snapshot) and zxgammon.tap (a tape, with a; BASIC loader). Every other file here is included from game.asm, but the; loading screen (loading.scr), included below; the neural net's weights; are in n2data.asm. device zxspectrum48 include "game.asm"PROGLEN equ ENGINEEND-$5e00 org $4000 incbin "loading.scr" savesna "zxgammon.sna",$5e00; The tape: a BASIC loader (BORDER 0: PAPER 0: INK 0: CLEAR 24063:; LOAD "" SCREEN$: POKE 23739,111: LOAD "" CODE: RANDOMIZE USR 24064),; the loading screen and the program, in one block.; The loader is put in memory only now, after the snapshot is saved. org $fd00LOADER: db $00,$0a,$57,$00,$e7,$30,$0e,$00,$00,$00,$00,$00,$3a,$da,$30,$0e db $00,$00,$00,$00,$00,$3a,$d9,$30,$0e,$00,$00,$00,$00,$00,$3a,$fd db $32,$34,$30,$36,$33,$0e,$00,$00,$ff,$5d,$00,$3a,$ef,$22,$22,$aa db $3a,$f4,$32,$33,$37,$33,$39,$0e,$00,$00,$bb,$5c,$00,$2c,$31,$31 db $31,$0e,$00,$00,$6f,$00,$00,$3a,$ef,$22,$22,$af,$3a,$f9,$c0,$32 db $34,$30,$36,$34,$0e,$00,$00,$00,$5e,$00,$0dLOADLEN equ $-LOADER emptytap "zxgammon.tap" savetap "zxgammon.tap",basic,"zxGammon",LOADER,LOADLEN,10 savetap "zxgammon.tap",code,"zxGammon",$4000,6912 savetap "zxgammon.tap",code,"zxGammon",$5e00,PROGLEN