2 ; This must be the *second* file on the linker command line
3 ; (.cvt header must be the *first* one)
5 ; Maciej 'YTM/Alliance' Witkowiak
13 .import zerobss, doatexit
15 ; ------------------------------------------------------------------------
16 ; Define and export the ZP variables for the C64 runtime
18 .exportzp sp, sreg, regsave, regbank
19 .exportzp ptr1, ptr2, ptr3, ptr4
20 .exportzp tmp1, tmp2, tmp3, tmp4
22 sp = $72 ; stack pointer
23 sreg = $74 ; secondary register/high 16 bit for longs
24 regsave = $76 ; slot to save/restore (E)AX into
34 regbank = $a3 ; 6 bytes hopefully not used by Kernal
36 ; ------------------------------------------------------------------------
38 ; .org $0400-508 ; $0400 - length of .cvt header
39 ; .include "cvthead.s"
43 ; ------------------------------------------------------------------------
55 sta sp+1 ; Set argument stack ptr
61 ; Pass an empty command line
68 ldy #4 ; Argument size
69 jsr _main ; call the users code
70 jmp $c1c3 ; jump to GEOS MainLoop
72 ; exit must be called from the code!
75 jsr doatexit ; call exit functions
77 jmp $c22c ; EnterDeskTop