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:
@@ -17,18 +17,23 @@
|
|||||||
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
|
; 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
|
; BASIC header with a SYS call
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
.org $0FFF
|
|
||||||
.word Head ; Load address
|
.word Head ; Load address
|
||||||
Head: .word @Next
|
Head: .word @Next
|
||||||
.word 1000 ; Line number
|
.word 1000 ; Line number
|
||||||
.byte $9E,"4109" ; SYS 4109
|
.byte $9E,"4109" ; SYS 4109
|
||||||
.byte $00 ; End of BASIC line
|
.byte $00 ; End of BASIC line
|
||||||
@Next: .word 0 ; BASIC end marker
|
@Next: .word 0 ; BASIC end marker
|
||||||
.reloc
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Actual code
|
; Actual code
|
||||||
|
|||||||
@@ -15,18 +15,23 @@
|
|||||||
.include "../cbm/cbm.inc"
|
.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
|
; BASIC header with a SYS call
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
.org $3FF
|
|
||||||
.word Head ; Load address
|
.word Head ; Load address
|
||||||
Head: .word @Next
|
Head: .word @Next
|
||||||
.word 1000 ; Line number
|
.word 1000 ; Line number
|
||||||
.byte $9E,"1037" ; SYS 1037
|
.byte $9E,"1037" ; SYS 1037
|
||||||
.byte $00 ; End of BASIC line
|
.byte $00 ; End of BASIC line
|
||||||
@Next: .word 0 ; BASIC end marker
|
@Next: .word 0 ; BASIC end marker
|
||||||
.reloc
|
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Actual code
|
; Actual code
|
||||||
@@ -95,6 +100,9 @@ L2: lda zpsave,x
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
; Data
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
zpsave: .res zpspace
|
zpsave: .res zpspace
|
||||||
|
|||||||
@@ -16,9 +16,17 @@
|
|||||||
.include "../cbm/cbm.inc"
|
.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
|
; BASIC header with a SYS call
|
||||||
|
|
||||||
.segment "EXEHDR"
|
|
||||||
.word Head ; Load address
|
.word Head ; Load address
|
||||||
Head: .word @Next
|
Head: .word @Next
|
||||||
.word 1000 ; Line number
|
.word 1000 ; Line number
|
||||||
@@ -34,8 +42,6 @@ Head: .word @Next
|
|||||||
; ------------------------------------------------------------------------
|
; ------------------------------------------------------------------------
|
||||||
; Actual code
|
; Actual code
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
ldx #zpspace-1
|
ldx #zpspace-1
|
||||||
L1: lda sp,x
|
L1: lda sp,x
|
||||||
sta zpsave,x ; Save the zero page locations we need
|
sta zpsave,x ; Save the zero page locations we need
|
||||||
@@ -99,6 +105,9 @@ L2: lda zpsave,x
|
|||||||
jmp RESTOR
|
jmp RESTOR
|
||||||
|
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------
|
||||||
|
; Data
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
zpsave: .res zpspace
|
zpsave: .res zpspace
|
||||||
|
|||||||
Reference in New Issue
Block a user