diff --git a/inc/jsrfar.inc b/inc/jsrfar.inc index 13c74e37..973cf948 100644 --- a/inc/jsrfar.inc +++ b/inc/jsrfar.inc @@ -130,7 +130,7 @@ jsrfar1n: pla plp ; original register widths popped immediately before call jsr jmpfr - php + php ; preserve flags immediately after return from call sep #$20 ; 8 bit accumulator .A8 .I16 @@ -140,7 +140,7 @@ jsrfar1n: lda $02,S ; overwrite reserved byte sta $03,S ; with copy of .P pla - plp + plp ; restore flags to state immediately after call plp rts diff --git a/kernal/drivers/x16/memory.s b/kernal/drivers/x16/memory.s index f0b81b33..800e1970 100644 --- a/kernal/drivers/x16/memory.s +++ b/kernal/drivers/x16/memory.s @@ -290,7 +290,7 @@ __jmpfr: .A16 .I16 pla - plp ; restore register widths immediately before call + plp ; restore all flags immediately before call jsr jmpfr php pha @@ -302,7 +302,7 @@ __jmpfr: sta $03,S ;...with copy of .P pla plp ; restore flags from state immediately after call - plp ; including register widths + plp rts .popcpu