Permalink
Browse files

preserve vital state in BASIC calls.

Make sure we preserve vital CPU registers when
making BASIC calls or we might tear our hair out later
wondering why things don't work as expected.
  • Loading branch information...
wschaub committed Sep 30, 2017
1 parent 7096bda commit 25dd2740d740a1215ec693453281807883d77e2c
Showing with 4 additions and 2 deletions.
  1. +4 −2 disk/rsdoslib.asm09
View
@@ -17,11 +17,13 @@ BASIC_RETURN:
CLR <DEVNUM
STX <$A6
RTS
BASIC STX <$A6
BASIC:
PSHS U,X,CC
STX <$A6
LDA ,X
ANDCC #$FE
JSR $ADC6
RTS
PULS U,X,CC,PC
;JSR to the subroutine at vector X
;skip over the opcode at the vector using indirect addressing.
;all vector hooks will call LEAS $2,S so we push our return address

0 comments on commit 25dd274

Please sign in to comment.