.export _exit
.import initlib, donelib
.import zerobss, push0
+ .import __CODE_LOAD__, __BSS_LOAD__ ; Linker generated
.import _main
.include "zeropage.inc"
.include "apple2.inc"
+; ------------------------------------------------------------------------
+; The executable header
+
+.segment "EXEHDR"
+
+ .word __CODE_LOAD__ ; Start address
+ .word __BSS_LOAD__ - __CODE_LOAD__ ; Size
+
; ------------------------------------------------------------------------
; Actual code
MEMORY {
ZP: start = $00, size = $1A, type = rw, define = yes;
+ HEADER: start = $0000, size = $4, file = %O;
RAM: start = $800, size = $8E00, file = %O;
}
SEGMENTS {
- CODE: load = RAM, type = ro;
+ EXEHDR: load = HEADER, type = ro;
+ CODE: load = RAM, type = ro, define = yes;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;