mirror of
https://github.com/cc65/cc65.git
synced 2026-04-21 09:17:52 +00:00
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:
+5
-5
@@ -79,11 +79,6 @@ MemOk: stx sp
|
||||
_exit: pha ; Save the return code on stack
|
||||
jsr donelib ; Run module destructors
|
||||
|
||||
; Restore system stuff
|
||||
|
||||
ldx spsave
|
||||
txs
|
||||
|
||||
; Copy back the zero page stuff
|
||||
|
||||
ldx #zpspace-1
|
||||
@@ -97,6 +92,11 @@ L2: lda zpsave,x
|
||||
pla
|
||||
sta ST
|
||||
|
||||
; Restore the stack pointer
|
||||
|
||||
ldx spsave
|
||||
txs
|
||||
|
||||
; Reset changed vectors
|
||||
|
||||
jmp RESTOR
|
||||
|
||||
Reference in New Issue
Block a user