Rewrite quit_code to use ca65 '816 mnemonics and provide some analysis (#79)

* Convert '816 quit code to use ca65 65816 mode.
Add commentary on this code.
This commit is contained in:
mgcaret 2018-04-28 16:00:08 -07:00 committed by Joshua Bell
parent 1e16555b11
commit 68766cb60b

View File

@ -7514,11 +7514,18 @@ stack_data:
.addr $DEAF,$DEAD ; ???
quit_code:
.byte $18,$FB,$5C,$04,$D0,$E0
;; 65816 code:
;; 18 clc ; clear carry
;; FB xce ; exchange carry/emulation (i.e. turn on 16 bit)
;; 5C 04 D0 E0 jmp $E0D004 ; long jump
;;; note that GS/OS GQUIT is called by ProDOS at $E0D000
;;; to quit back to GS/OS.
;;; since DeskTop pre-dates GS/OS, it's likely that this does
;;; a similar function for ProDOS 16.
;;; with GS/OS 5 and 6, this code potentially messes up
;;; the shadow register, $C035
.pushcpu
.setcpu "65816"
clc
xce ; enter native mode
jmp $E0D004 ; ProDOS 8->16 QUIT, presumably
.popcpu
DEFINE_QUIT_PARAMS quit_params