mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 17:58:05 +11:00
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:
parent
46676547d9
commit
7359717000
14
blk/290
14
blk/290
@ -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
|
||||
|
2
blk/308
2
blk/308
@ -12,5 +12,5 @@ CODE ?DUP
|
||||
HLZ, IFNZ, HL PUSH, THEN,
|
||||
;CODE
|
||||
CODE DROP ( a -- )
|
||||
HL POP,
|
||||
HL POP, chkPS,
|
||||
;CODE
|
||||
|
2
blk/312
2
blk/312
@ -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 )
|
||||
|
6
blk/322
6
blk/322
@ -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,
|
||||
|
6
blk/323
6
blk/323
@ -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,
|
||||
|
6
blk/324
6
blk/324
@ -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
13
blk/325
@ -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
|
||||
|
5
blk/326
5
blk/326
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user