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:
cuz
2004-03-02 17:08:07 +00:00
parent 910f9277ac
commit 220e5a3898
8 changed files with 58 additions and 11 deletions

View File

@@ -112,11 +112,10 @@ L1: lda sp,x
NoIRQ1: jsr callmain
; Back from main (this is also the _exit entry). Store the return code into
; ST, where it is accessible from BASIC. Reset the IRQ vector if we chained
; it.
; Back from main (this is also the _exit entry). Reset the IRQ vector if we
; chained it.
_exit: sta ST
_exit: pha ; Save the return code on stack
lda #<__IRQFUNC_COUNT__
beq NoIRQ2
lda IRQInd+1
@@ -148,6 +147,11 @@ L2: lda zpsave,x
lda mmusave
sta MMU_CR
; Place the program return code into ST
pla
sta ST
; Done, restore kernal vectors in an attempt to cleanup
jmp RESTOR