z80: add missing chkPS, calls

chkPS, used to be only for words that pushed back to PS, but I've
recently removed underflow checks from next and I forgot to add
missing chkPS, calls that go with this change.
This commit is contained in:
Virgil Dupras 2020-08-23 08:38:04 -04:00
parent 46676547d9
commit 7359717000
8 changed files with 23 additions and 31 deletions

14
blk/290
View File

@ -1,10 +1,7 @@
lbluflw BSET ( abortUnderflow )
DE BIN( @ 0x06 ( uflw ) + LDd(i),
JR, lblexec BWR
lblchkPS BSET ( chkPS )
( Note that you only need to call this in words that push
back to PSP. If they don't, calling chkPS is redundant with
check in next )
( thread carefully in there: sometimes, we're in the
middle of a EXX to protect BC. BC must never be touched
here. )
EXX,
( We have the return address for this very call on the stack
and protected registers. 2- is to compensate that. )
@ -12,4 +9,7 @@ lblchkPS BSET ( chkPS )
SP SUBHLd,
EXX,
CNC RETc, ( PS_ADDR >= SP? good )
JR, lbluflw BWR
( continue to uflw )
lbluflw BSET ( abortUnderflow )
DE BIN( @ 0x06 ( uflw ) + LDd(i),
JR, lblexec BWR

View File

@ -12,5 +12,5 @@ CODE ?DUP
HLZ, IFNZ, HL PUSH, THEN,
;CODE
CODE DROP ( a -- )
HL POP,
HL POP, chkPS,
;CODE

View File

@ -1,5 +1,5 @@
CODE 2DROP ( a b -- )
HL POP, HL POP,
HL POP, HL POP, chkPS,
;CODE
CODE 2DUP ( a b -- a b a b )

View File

@ -1,13 +1,11 @@
CODE !
HL POP,
DE POP,
HL POP, DE POP, chkPS,
(HL) E LDrr,
HL INCd,
(HL) D LDrr,
;CODE
CODE @
HL POP,
chkPS,
HL POP, chkPS,
E (HL) LDrr,
HL INCd,
D (HL) LDrr,

View File

@ -1,12 +1,10 @@
CODE C!
HL POP,
DE POP,
HL POP, DE POP, chkPS,
(HL) E LDrr,
;CODE
CODE C@
HL POP,
chkPS,
HL POP, chkPS,
L (HL) LDrr,
H 0 LDri,
HL PUSH,

View File

@ -1,12 +1,10 @@
CODE PC! EXX, ( protect BC )
BC POP,
HL POP,
BC POP, HL POP, chkPS,
L OUT(C)r,
EXX, ( unprotect BC ) ;CODE
CODE PC@ EXX, ( protect BC )
BC POP,
chkPS,
BC POP, chkPS,
H 0 LDri,
L INr(C),
HL PUSH,

13
blk/325
View File

@ -1,15 +1,16 @@
CODE I
L 0 IX+ LDrIXY,
H 1 IX+ LDrIXY,
L 0 IX+ LDrIXY, H 1 IX+ LDrIXY,
HL PUSH,
;CODE
CODE I'
L 2 IX- LDrIXY,
H 1 IX- LDrIXY,
L 2 IX- LDrIXY, H 1 IX- LDrIXY,
HL PUSH,
;CODE
CODE J
L 4 IX- LDrIXY,
H 3 IX- LDrIXY,
L 4 IX- LDrIXY, H 3 IX- LDrIXY,
HL PUSH,
;CODE
CODE >R
HL POP, chkPS,
IX INCd, IX INCd, 0 IX+ L LDIXYr, 1 IX+ H LDIXYr,
;CODE

View File

@ -1,11 +1,8 @@
CODE >R
HL POP, IX INCd, IX INCd, 0 IX+ L LDIXYr, 1 IX+ H LDIXYr,
;CODE
CODE R>
L 0 IX+ LDrIXY, H 1 IX+ LDrIXY, IX DECd, IX DECd, HL PUSH,
;CODE
CODE 2>R PC ORG @ 0x35 + ! ( stable ABI JP )
DE POP, HL POP,
DE POP, HL POP, chkPS,
IX INCd, IX INCd, 0 IX+ L LDIXYr, 1 IX+ H LDIXYr,
IX INCd, IX INCd, 0 IX+ E LDIXYr, 1 IX+ D LDIXYr,
;CODE