* Moved the BASIC stub that calls the compiled program into it's own segment

named EXEHDR.
* Renamed BASICHDR to EXEHDR for the PET-II machines.
* Moved the call to CHRCH in front of the code that saves the zero page, since
  open files are sometimes remembered in the zero page, so we need to close
  them before we grab a copy.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4507 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2009-12-09 12:42:24 +00:00
parent 1fae13274e
commit 60bc009991
17 changed files with 98 additions and 71 deletions

View File

@@ -20,10 +20,9 @@
IRQInd = $500 ; JMP $0000 - used as indirect IRQ vector
; ------------------------------------------------------------------------
; Place the startup code in a special segment to cope with the quirks of
; plus/4 banking.
; BASIC header with a SYS call
.segment "STARTUP"
.segment "EXEHDR"
.word Head ; Load address
Head: .word @Next
@@ -37,22 +36,28 @@ Head: .word @Next
@Next: .word 0 ; BASIC end marker
; ------------------------------------------------------------------------
; Actual code
; Startup code
Start: sei ; No interrupts since we're banking out the ROM
sta ENABLE_RAM
ldx #zpspace-1
L1: lda sp,x
sta zpsave,x ; save the zero page locations we need
dex
bpl L1
sta ENABLE_ROM
cli
.segment "STARTUP"
Start:
; Close open files
jsr $FFCC ; CLRCH
; Save the zero page locations we need
sei ; No interrupts since we're banking out the ROM
sta ENABLE_RAM
ldx #zpspace-1
L1: lda sp,x
sta zpsave,x
dex
bpl L1
sta ENABLE_ROM
cli
; Switch to second charset
lda #14