c71e249a4e
First substantive commit: the entire Sprinter C compiler tree on top of
the bare README+gitignore initial commit.
What's in here:
bin/sprinter-cc — driver script invoking SDCC + linker + mkexe
libc/ — Sprinter-specific libc layer over ESTEX/BIOS
(conio, gfx, io, mem, stdio + headers)
runtime/ — crt0 variants (default/small/banked/minimal)
+ heap + bank trampolines
toolchain/ — mkexe (SprintEXE packer, C + tests)
examples/ — 30 demo programs (gfx, file I/O, env, time, …)
lib/Makefile — builds the libc archive (sprinter.lib)
docs/ — converted Sprinter manuals + asm reference samples
third_party/ — solid-c reference compiler dump + sdcc setup script
release_docs/ — packaging / release notes
gitignore overhaul:
• Drop dangerous blanket patterns: *.asm (would hide docs/samples/*.asm)
and *.exe (case-insensitive match was hiding third_party/solid-c/*.EXE
on macOS APFS). Replaced with examples/*/*.{asm,exe,…} and lib/*.lib.
• Restore tracking of toolchain/mkexe/tests/{one,big}.bin — those are
INPUT fixtures, not build outputs.
• Collapse the duplicated SDCC/C/Sdcc sections into one section per
concern (build outputs / vendored / OS-junk).
• Add .sprinter-cc-*/, build/ (catches lib/build/ too), .claude/.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
157 lines
3.3 KiB
Z80 Assembly
157 lines
3.3 KiB
Z80 Assembly
;[]=======================================================================[]
|
|
;
|
|
; fn_load.z80 -- primary loader of Flex Navigator v1.10
|
|
;
|
|
; Copyright (C) 2000 Anton Enin
|
|
;
|
|
; This program should be compiled using z80asm
|
|
; http://www.zxasm.narod.ru/
|
|
;
|
|
; z80asm.exe -f bin main.z80 -o a_print.exe
|
|
;
|
|
;[]=======================================================================[]
|
|
|
|
org 0x80EA
|
|
section .text
|
|
|
|
EXEhead: db "EXE" ; exe header
|
|
db 0 ; +3
|
|
dw EntryExec-EXEhead
|
|
dw 0x0000 ; +4
|
|
dw EXEend-EntryExec ; +8
|
|
dw 0, 0 ; +10
|
|
dw 0 ; +14
|
|
dw EntryExec ; +16
|
|
dw EntryExec
|
|
dw 0x80FF
|
|
|
|
;[]=======================================================================[]
|
|
; input:
|
|
; IX - pointer from DOS
|
|
|
|
EntryExec: DI
|
|
LD A, (IX-0x03) ; current file handle
|
|
LD (.hFile), A ; save
|
|
LD HL, .copyright_str
|
|
LD C, 0x5C ; print text
|
|
RST 0x10
|
|
LD C, 0x00
|
|
RST 0x10
|
|
LD A, D
|
|
OR A
|
|
JR NZ, .next1
|
|
LD HL, .incor_dos_str
|
|
LD C, 0x5C ; print text
|
|
RST 0x10
|
|
LD A, (.hFile)
|
|
LD C, 0x12
|
|
RST 0x10 ; close current file
|
|
LD BC, 0xFF41
|
|
RST 0x10 ; exit
|
|
.next1
|
|
LD BC, 0x063D
|
|
RST 0x10 ; need 6 memory pages
|
|
JR NC, .next2 ; CY - not enough memory
|
|
LD HL, .no_memory_str
|
|
LD C, 0x5C ; print text
|
|
RST 0x10
|
|
LD BC, 0xFF41
|
|
RST 0x10 ; exit
|
|
.next2
|
|
LD (.hMem), A ; memory handle
|
|
LD HL, .Buffer
|
|
LD C, 0xC5
|
|
RST 0x08 ; get memory pages list
|
|
LD A, (.MPg) ; set pages from 0xC000
|
|
OUT (0xE2), A
|
|
LD HL, 0x8500 ;FNMAIN
|
|
LD DE, end1-0x8500
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.FPg)
|
|
OUT (0xE2), A
|
|
LD HL, 0xC000 ;FNFUNCT
|
|
LD DE, end2-0x4000
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.VPg) ;FNVIEW
|
|
OUT (0xE2), A
|
|
LD HL, 0xC000
|
|
LD DE, 0x19A6
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.EPg) ;FNEDIT
|
|
OUT (0xE2), A
|
|
LD HL, 0xC000
|
|
LD DE, 0x273B
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.HPg) ;FNHELP
|
|
OUT (0xE2), A
|
|
LD HL, 0xC000
|
|
LD DE, end3-0x4000
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.FNPg) ;FNFONT
|
|
OUT (0xE2), A
|
|
LD HL, 0xC000
|
|
LD DE, end4-0x4000
|
|
LD A, (.hFile)
|
|
LD C, 0x13
|
|
RST 0x10
|
|
JP C, .disk_error
|
|
LD A, (.hFile)
|
|
LD C, 0x12
|
|
RST 0x10 ;close current file
|
|
LD A, (.MPg)
|
|
OUT (0xE2), A
|
|
LD A, (.hMem)
|
|
LD (.FNIndef), A
|
|
LD HL, .FPg
|
|
LD DE, .FunctPg
|
|
LD BC, 0x0005
|
|
LDIR
|
|
JP EntryPoint
|
|
.disk_error:
|
|
LD A, (.hMem) ; free memory
|
|
LD C, 0x3E
|
|
RST 0x10
|
|
LD A, (.hFile)
|
|
LD C, 0x12
|
|
RST 0x10 ; close current file
|
|
LD HL, .load_err_str
|
|
LD C, 0x5C ; print text
|
|
RST 0x10
|
|
LD BC, 0xFF41
|
|
RST 10h ; exit
|
|
|
|
.hFile db 0x00
|
|
.hMem db 0x00
|
|
.Buffer
|
|
.MPg db 0x00
|
|
.FPg db 0x00
|
|
.VPg db 0x00
|
|
.EPg db 0x00
|
|
.HPg db 0x00
|
|
.FNPg db 0x00
|
|
db 0x00
|
|
|
|
.copyright_str: db 0x0D, 0x0A
|
|
db "The Flex Navigator, ver 1.10, Copyright (C) 1999 by Enin Anton, St-Petersburg.", 0x0D, 0x0A
|
|
db "All rights reserved.", 0x0D, 0x0A, 0x00
|
|
.incor_dos_str: db "Incorrect DOS version, need DOS 1.00 or high.", 0x0D, 0x0A, 0x00
|
|
.no_memory_str: db "Not enough memory to load program.", 0x0D, 0x0A, 0x00
|
|
.load_err_str: db "Disk loading error.", 0x0D, 0x0A, 0x00
|
|
|
|
EXEend:
|