.import zerobss, push0
.import _main
- .include "apple2.inc"
+ .include "zeropage.inc"
+ .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
+; Actual code
.code
-; ------------------------------------------------------------------------
-; Actual code
-
ldx #zpspace-1
L1: lda sp,x
sta zpsave,x ; Save the zero page locations we need
; Call module destructors. This is also the _exit entry.
_exit: jsr donelib
-
+
; Restore system stuff
lda #$ff ; Reset text mode
.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
.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).
.import __IRQFUNC_TABLE__, __IRQFUNC_COUNT__
.import __RAM_START__, __RAM_SIZE__
+ .include "zeropage.inc"
.include "c128.inc"
.include "../cbm/cbm.inc"
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.
.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
; ------------------------------------------------------------------------
.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
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
DbgSwapZP:
ldy #zpspace-1
Swap1: ldx CTemp,y
- lda sp,y ; ######
+ lda <__ZP_START__,y
sta CTemp,y
txa
sta sp,y
.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
.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