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:
@@ -363,7 +363,8 @@ Init: jsr initlib
|
||||
; Call module destructors. This is also the _exit entry and the default entry
|
||||
; point for the break vector.
|
||||
|
||||
_exit: lda #$00
|
||||
_exit: pha ; Save the return code
|
||||
lda #$00
|
||||
sta irqcount ; Disable custom irq handlers
|
||||
jsr donelib ; Run module destructors
|
||||
|
||||
@@ -388,6 +389,12 @@ _exit: lda #$00
|
||||
bne @L0
|
||||
.endif
|
||||
|
||||
; Place the program return code into ST
|
||||
|
||||
pla
|
||||
ldy #ST
|
||||
sta (sysp0),y
|
||||
|
||||
; Setup the welcome code at the stack bottom in the system bank.
|
||||
|
||||
ldy #$FF
|
||||
|
||||
Reference in New Issue
Block a user