Place the return code into ST
git-svn-id: svn://svn.cc65.org/cc65/trunk@2884 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -96,7 +96,8 @@ L1: lda sp,x
|
||||
|
||||
; Back from main (this is also the _exit entry). Run module destructors.
|
||||
|
||||
_exit: lda #0
|
||||
_exit: pha ; Save the return code
|
||||
lda #0
|
||||
sta irqcount ; Disable custom IRQ handlers
|
||||
jsr donelib ; Run module destructors
|
||||
|
||||
@@ -113,6 +114,11 @@ L2: lda zpsave,x
|
||||
dex
|
||||
bpl L2
|
||||
|
||||
; Place the program return code into ST
|
||||
|
||||
pla
|
||||
sta ST
|
||||
|
||||
; Enable the ROM, reset changed vectors and return to BASIC
|
||||
|
||||
sta ENABLE_ROM
|
||||
|
||||
Reference in New Issue
Block a user