support for .zeropage segment in GEOS

git-svn-id: svn://svn.cc65.org/cc65/trunk@1834 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst
2002-12-23 22:14:14 +00:00
parent 31e4d80ac8
commit dc207514dd
13 changed files with 33 additions and 173 deletions

View File

@@ -3,43 +3,16 @@
; (.cvt header must be the *first* one)
; Maciej 'YTM/Elysium' Witkowiak
; 26.10.99, 10.3.2000, 15.8.2001
; 26.10.99, 10.3.2000, 15.8.2001, 23.12.2002
; no __hinit
.export _exit
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.import initlib, donelib
.import pushax
.import _main
.import _MainLoop, _EnterDeskTop
.import zerobss
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave, regbank
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
sp = $72 ; stack pointer
sreg = $74 ; secondary register/high 16 bit for longs
regsave = $76 ; slot to save/restore (E)AX into
ptr1 = $7A ;
ptr2 = $7C
ptr3 = $7E
ptr4 = $70
tmp1 = $fb
tmp2 = $fc
tmp3 = $fd
tmp4 = $fe
regbank = $a3 ; 6 bytes hopefully not used by Kernal
; ------------------------------------------------------------------------
; .org $0400-508 ; $0400 - length of .cvt header
; .include "cvthead.s"
.reloc
.importzp sp
.export _exit
; ------------------------------------------------------------------------
; Create an empty LOWCODE segment to avoid linker warnings
@@ -57,9 +30,9 @@ regbank = $a3 ; 6 bytes hopefully not used by Kernal
; Setup stack
lda #<$6000
lda #<(__RAM_START__ + __RAM_SIZE__)
sta sp
lda #>$6000
lda #>(__RAM_START__ + __RAM_SIZE__)
sta sp+1 ; Set argument stack ptr
; Call module constructors
@@ -76,12 +49,11 @@ regbank = $a3 ; 6 bytes hopefully not used by Kernal
cli
ldy #4 ; Argument size
jsr _main ; call the users code
jmp $c1c3 ; jump to GEOS MainLoop
jmp _MainLoop ; jump to GEOS MainLoop
; Call module destructors. This is also the _exit entry which must be called
; explicitly by the code.
_exit: jsr donelib ; Run module destructors
jmp $c22c ; EnterDeskTop
jmp _EnterDeskTop ; return control to the system