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:
@@ -112,11 +112,10 @@ L1: lda sp,x
|
|||||||
|
|
||||||
NoIRQ1: jsr callmain
|
NoIRQ1: jsr callmain
|
||||||
|
|
||||||
; Back from main (this is also the _exit entry). Store the return code into
|
; Back from main (this is also the _exit entry). Reset the IRQ vector if we
|
||||||
; ST, where it is accessible from BASIC. Reset the IRQ vector if we chained
|
; chained it.
|
||||||
; it.
|
|
||||||
|
|
||||||
_exit: sta ST
|
_exit: pha ; Save the return code on stack
|
||||||
lda #<__IRQFUNC_COUNT__
|
lda #<__IRQFUNC_COUNT__
|
||||||
beq NoIRQ2
|
beq NoIRQ2
|
||||||
lda IRQInd+1
|
lda IRQInd+1
|
||||||
@@ -148,6 +147,11 @@ L2: lda zpsave,x
|
|||||||
lda mmusave
|
lda mmusave
|
||||||
sta MMU_CR
|
sta MMU_CR
|
||||||
|
|
||||||
|
; Place the program return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Done, restore kernal vectors in an attempt to cleanup
|
; Done, restore kernal vectors in an attempt to cleanup
|
||||||
|
|
||||||
jmp RESTOR
|
jmp RESTOR
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ MemOk: stx sp
|
|||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
; Call module destructors. This is also the _exit entry.
|
||||||
|
|
||||||
_exit: jsr donelib ; Run module destructors
|
_exit: pha ; Save the return code on stack
|
||||||
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; Restore system stuff
|
; Restore system stuff
|
||||||
|
|
||||||
@@ -91,6 +92,11 @@ L2: lda zpsave,x
|
|||||||
dex
|
dex
|
||||||
bpl L2
|
bpl L2
|
||||||
|
|
||||||
|
; Store the return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Reset changed vectors
|
; Reset changed vectors
|
||||||
|
|
||||||
jmp RESTOR
|
jmp RESTOR
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ L1: lda sp,x
|
|||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
; Call module destructors. This is also the _exit entry.
|
||||||
|
|
||||||
_exit: sta ST ; Place return code into ST
|
_exit: pha ; Save the return code
|
||||||
jsr donelib ; Run module destructors
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; Restore system stuff
|
; Restore system stuff
|
||||||
@@ -100,6 +100,11 @@ L2: lda zpsave,x
|
|||||||
dex
|
dex
|
||||||
bpl L2
|
bpl L2
|
||||||
|
|
||||||
|
; Place the program return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Reset changed vectors, back to basic
|
; Reset changed vectors, back to basic
|
||||||
|
|
||||||
jmp RESTOR
|
jmp RESTOR
|
||||||
|
|||||||
@@ -442,7 +442,8 @@ ccopy2: lda __VIDRAM_START__,y
|
|||||||
; Call module destructors. This is also the _exit entry and the default entry
|
; Call module destructors. This is also the _exit entry and the default entry
|
||||||
; point for the break vector.
|
; point for the break vector.
|
||||||
|
|
||||||
_exit: lda #$00
|
_exit: pha ; Save the return code on stack
|
||||||
|
lda #$00
|
||||||
sta irqcount ; Disable custom irq handlers
|
sta irqcount ; Disable custom irq handlers
|
||||||
jsr donelib ; Run module destructors
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
@@ -481,6 +482,12 @@ _exit: lda #$00
|
|||||||
bne @L0
|
bne @L0
|
||||||
.endif
|
.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.
|
; Setup the welcome code at the stack bottom in the system bank.
|
||||||
|
|
||||||
ldy #$FF
|
ldy #$FF
|
||||||
|
|||||||
@@ -363,7 +363,8 @@ Init: jsr initlib
|
|||||||
; Call module destructors. This is also the _exit entry and the default entry
|
; Call module destructors. This is also the _exit entry and the default entry
|
||||||
; point for the break vector.
|
; point for the break vector.
|
||||||
|
|
||||||
_exit: lda #$00
|
_exit: pha ; Save the return code
|
||||||
|
lda #$00
|
||||||
sta irqcount ; Disable custom irq handlers
|
sta irqcount ; Disable custom irq handlers
|
||||||
jsr donelib ; Run module destructors
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
@@ -388,6 +389,12 @@ _exit: lda #$00
|
|||||||
bne @L0
|
bne @L0
|
||||||
.endif
|
.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.
|
; Setup the welcome code at the stack bottom in the system bank.
|
||||||
|
|
||||||
ldy #$FF
|
ldy #$FF
|
||||||
|
|||||||
@@ -71,7 +71,8 @@ L1: lda sp,x
|
|||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
; Call module destructors. This is also the _exit entry.
|
||||||
|
|
||||||
_exit: jsr donelib ; Run module destructors
|
_exit: pha ; Save the return code on stack
|
||||||
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; Restore system stuff
|
; Restore system stuff
|
||||||
|
|
||||||
@@ -86,6 +87,11 @@ L2: lda zpsave,x
|
|||||||
dex
|
dex
|
||||||
bpl L2
|
bpl L2
|
||||||
|
|
||||||
|
; Store the program return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Back to basic
|
; Back to basic
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ L1: lda sp,x
|
|||||||
|
|
||||||
; Back from main (this is also the _exit entry). Run module destructors.
|
; 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
|
sta irqcount ; Disable custom IRQ handlers
|
||||||
jsr donelib ; Run module destructors
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
@@ -113,6 +114,11 @@ L2: lda zpsave,x
|
|||||||
dex
|
dex
|
||||||
bpl L2
|
bpl L2
|
||||||
|
|
||||||
|
; Place the program return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Enable the ROM, reset changed vectors and return to BASIC
|
; Enable the ROM, reset changed vectors and return to BASIC
|
||||||
|
|
||||||
sta ENABLE_ROM
|
sta ENABLE_ROM
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ L1: lda sp,x
|
|||||||
|
|
||||||
; Call module destructors. This is also the _exit entry.
|
; Call module destructors. This is also the _exit entry.
|
||||||
|
|
||||||
_exit: jsr donelib ; Run module destructors
|
_exit: pha ; Save the return code on stack
|
||||||
|
jsr donelib ; Run module destructors
|
||||||
|
|
||||||
; Restore system stuff
|
; Restore system stuff
|
||||||
|
|
||||||
@@ -91,6 +92,11 @@ L2: lda zpsave,x
|
|||||||
dex
|
dex
|
||||||
bpl L2
|
bpl L2
|
||||||
|
|
||||||
|
; Place the program return code into ST
|
||||||
|
|
||||||
|
pla
|
||||||
|
sta ST
|
||||||
|
|
||||||
; Reset changed vectors, back to basic
|
; Reset changed vectors, back to basic
|
||||||
|
|
||||||
jmp RESTOR
|
jmp RESTOR
|
||||||
|
|||||||
Reference in New Issue
Block a user