1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Move zp space out of crt0.s

git-svn-id: svn://svn.cc65.org/cc65/trunk@1291 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-05-26 09:09:10 +00:00
parent 3aadd7f62b
commit 33c1e82bda
7 changed files with 20 additions and 174 deletions

View File

@ -9,43 +9,14 @@
.import zerobss, push0
.import _main
.include "apple2.inc"
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp regbank, zpspace
; These zero page entries overlap with the sweet-16 registers in
; the standard apple2 linker config. They must be changed if sweet-16
; is to be supported
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
.code
.include "zeropage.inc"
.include "apple2.inc"
; ------------------------------------------------------------------------
; Actual code
.code
ldx #zpspace-1
L1: lda sp,x
sta zpsave,x ; Save the zero page locations we need
@ -90,7 +61,7 @@ L1: lda sp,x
; Call module destructors. This is also the _exit entry.
_exit: jsr donelib
; Restore system stuff
lda #$ff ; Reset text mode

View File

@ -18,39 +18,10 @@
.import _main,__filetab,getfd
.import __CODE_LOAD__, __BSS_LOAD__
.include "zeropage.inc"
.include "atari.inc"
.include "_file.inc"
; ------------------------------------------------------------------------
; Define and export the ZP variables for the runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp fntemp, regbank, zpspace
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
fntemp: .res 2 ; Pointer to file name
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
.code
; ------------------------------------------------------------------------
; EXE header
@ -58,12 +29,12 @@ zpspace = * - zpstart ; Zero page space allocated
.word $FFFF
.word __CODE_LOAD__
.word __BSS_LOAD__ - 1
.code
.reloc
; ------------------------------------------------------------------------
; Actual code
.code
rts ; fix for SpartaDOS / OS/A+
; they first call the entry point from AUTOSTRT and
; then the load addess (this rts here).

View File

@ -12,6 +12,7 @@
.import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
.import __RAM_START__, __RAM_SIZE__
.include "zeropage.inc"
.include "c128.inc"
.include "../cbm/cbm.inc"
@ -21,31 +22,6 @@
IRQInd = $2FD ; JMP $0000 - used as indirect IRQ vector
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp regbank, zpspace
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
; Place the startup code in a special segment to cope with the quirks of
; c128 banking. Do also create an empty segment named "NMI" to avoid
; warnings if the rs232 routines are not used.

View File

@ -10,35 +10,10 @@
.import _main
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.include "zeropage.inc"
.include "c64.inc"
.include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp regbank, zpspace
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
.code
; ------------------------------------------------------------------------

View File

@ -9,7 +9,10 @@
.import popax, return0, _DbgEntry, _set_brk, _end_brk
.import _DbgBreaks
.import _brk_pc
.importzp sp, sreg, ptr1, tmp1, zpspace
.import __ZP_START__ ; Linker generated
.include "zeropage.inc"
; C callable function, will install the debugger
@ -60,7 +63,7 @@ DbgStack:
CTemp:
_DbgCS: .res 2 ; sp
_DbgHI: .res 2 ; sreg
.res 22 ; Other stuff
.res (zpspace-4) ; Other stuff
_DbgSP: .res 1
retsav: .res 2 ; Save buffer for return address
@ -71,7 +74,7 @@ retsav: .res 2 ; Save buffer for return address
DbgSwapZP:
ldy #zpspace-1
Swap1: ldx CTemp,y
lda sp,y ; ######
lda <__ZP_START__,y
sta CTemp,y
txa
sta sp,y

View File

@ -9,40 +9,15 @@
.import zerobss, push0
.import _main
.include "zeropage.inc"
.include "pet.inc"
.include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp regbank, zpspace
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
; BASIC header with a SYS call
.code
; ------------------------------------------------------------------------
; BASIC header with a SYS call
.org $3FF
.word Head ; Load address
Head: .word @Next

View File

@ -8,40 +8,15 @@
.import initlib, donelib
.import push0, _main, zerobss
.include "zeropage.inc"
.include "plus4.inc"
.include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
; Define and export the ZP variables for the C64 runtime
.exportzp sp, sreg, regsave
.exportzp ptr1, ptr2, ptr3, ptr4
.exportzp tmp1, tmp2, tmp3, tmp4
.exportzp regbank, zpspace
.zeropage
zpstart = *
sp: .res 2 ; Stack pointer
sreg: .res 2 ; Secondary register/high 16 bit for longs
regsave: .res 2 ; slot to save/restore (E)AX into
ptr1: .res 2
ptr2: .res 2
ptr3: .res 2
ptr4: .res 2
tmp1: .res 1
tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
regbank: .res 6 ; 6 byte register bank
zpspace = * - zpstart ; Zero page space allocated
; BASIC header with a SYS call
.code
; ------------------------------------------------------------------------
; BASIC header with a SYS call
.org $0FFF
.word Head ; Load address
Head: .word @Next