Merge pull request #2810 from jedeoric/master

telestrat target : manage main return code
This commit is contained in:
Bob Andrews
2025-07-19 20:06:35 +02:00
committed by GitHub

View File

@@ -1,7 +1,7 @@
;
; Startup code for cc65 (Oric version)
;
; By Debrune J<EFBFBD>r<EFBFBD>me <jede@oric.org> and Ullrich von Bassewitz <uz@cc65.org>
; By Debrune Jérôme <jede@oric.org> and Ullrich von Bassewitz <uz@cc65.org>
;
.export _exit
@@ -36,12 +36,12 @@
; Call the module destructors. This is also the exit() entry.
_exit: jsr donelib
_exit:
; Restore the system stuff.
; Save return code on stack
ldx spsave
txs
pha
jsr donelib
; Copy back the zero-page stuff.
@@ -51,6 +51,16 @@ L2: lda zpsave,x
dex
bpl L2
; Restore the return code.
; The return code is on the stack, so we can just pop it.
; This is the return code from main().
pla
; Restore the system stuff.
ldx spsave
txs
; Back to BASIC.
rts