Fixed issues with the last change: The return code must be pulled from stack

before the stack pointer is reset.


git-svn-id: svn://svn.cc65.org/cc65/trunk@2906 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2004-03-08 20:38:58 +00:00
parent 742d8c3294
commit 7a5d4f3138
6 changed files with 35 additions and 38 deletions

View File

@@ -101,11 +101,6 @@ _exit: pha ; Save the return code
sta irqcount ; Disable custom IRQ handlers
jsr donelib ; Run module destructors
; Restore system stuff
ldx spsave
txs
; Copy back the zero page stuff
ldx #zpspace-1
@@ -119,6 +114,11 @@ L2: lda zpsave,x
pla
sta ST
; Restore the stack pointer
ldx spsave
txs
; Enable the ROM, reset changed vectors and return to BASIC
sta ENABLE_ROM