Move the startup code into its own segment

git-svn-id: svn://svn.cc65.org/cc65/trunk@1581 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2002-11-22 17:43:30 +00:00
parent 3274257528
commit bbbf2ac45a
3 changed files with 35 additions and 13 deletions

View File

@@ -15,25 +15,30 @@
.include "../cbm/cbm.inc"
; ------------------------------------------------------------------------
; Create an empty LOWCODE segment to avoid linker warnings
.segment "LOWCODE"
; ------------------------------------------------------------------------
; Place the startup code in a special segment.
.segment "STARTUP"
; BASIC header with a SYS call
.code
.org $3FF
.word Head ; Load address
Head: .word @Next
.word 1000 ; Line number
.byte $9E,"1037" ; SYS 1037
.byte $00 ; End of BASIC line
@Next: .word 0 ; BASIC end marker
.reloc
; ------------------------------------------------------------------------
; Actual code
ldx #zpspace-1
L1: lda sp,x
sta zpsave,x ; Save the zero page locations we need
sta zpsave,x ; Save the zero page locations we need
dex
bpl L1
@@ -95,6 +100,9 @@ L2: lda zpsave,x
rts
; ------------------------------------------------------------------------
; Data
.data
zpsave: .res zpspace