diff --git a/blk/243 b/blk/243 index beb5ac2..0165ad0 100644 --- a/blk/243 +++ b/blk/243 @@ -5,7 +5,7 @@ : JPNEXT, 26 BJP, ; ( 26 == next ) -: chkPS, 29 BCALL, ; ( 29 == chkPS ) +: chkPS, L4 @ BCALL, ; ( chkPS, B305 ) : CODE ( same as CREATE, but with native word ) (entry) diff --git a/blk/283 b/blk/283 index 5dc07d8..b23332b 100644 --- a/blk/283 +++ b/blk/283 @@ -5,7 +5,7 @@ NOP, ( 0a, unused ) 0 JPnn, ( 0b, cellWord ) 0 JPnn, ( 0e, compiledWord ) 0 JPnn, ( 11, pushRS ) 0 JPnn, ( 14, popRS ) EXDEHL, JP(HL), NOP, ( 17, nativeWord ) -0 JPnn, ( 1a, next ) 0 JPnn, ( 1d, chkPS ) +0 JPnn, ( 1a, next ) 0 JPnn, ( unused ) NOP, NOP, ( 20, numberWord ) NOP, NOP, ( 22, litWord ) NOP, NOP, ( 24, addrWord ) NOP, NOP, ( 26, unused ) 0 JPnn, ( RST 28 ) diff --git a/blk/299 b/blk/299 index d0246db..e69de29 100644 --- a/blk/299 +++ b/blk/299 @@ -1,16 +0,0 @@ -L1 BSET PC ORG @ 0x1e + ! ( 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 ) - EXX, -( We have the return address for this very call on the stack - and protected registers. 2 - is to compensate that. ) - HL PS_ADDR 2 - LDddnn, - SP SUBHLss, - EXX, - CNC RETcc, ( PS_ADDR >= SP? good ) - JR, L2 BWR ( abortUnderflow-B298 ) - - - - diff --git a/blk/300 b/blk/300 index 517be4c..04cef3b 100644 --- a/blk/300 +++ b/blk/300 @@ -3,14 +3,14 @@ PC ORG @ 0x1b + ! ( next ) we jump to current IP, but we also take care of increasing it by 2 before jumping. ) ( Before we continue: are stacks within bounds? ) - L1 @ ( chkPS ) BCALL, - ( check RS ) - IX PUSHqq, HL POPqq, + ( PS ) HL PS_ADDR LDddnn, + SP SUBHLss, + JRC, L2 BWR ( abortUnderflow-B298 ) + ( RS ) IX PUSHqq, HL POPqq, DE RS_ADDR LDddnn, DE SUBHLss, JRC, L2 BWR ( IX < RS_ADDR? abortUnderflow-B298 ) E 0 IY+ LDrIXY, D 1 IY+ LDrIXY, - IY INCss, - IY INCss, + IY INCss, IY INCss, ( continue to execute ) diff --git a/blk/305 b/blk/305 index a3d756d..8779003 100644 --- a/blk/305 +++ b/blk/305 @@ -1,15 +1,15 @@ -( Core words ) -( KEY and EMIT are not defined here. There're - expected to be defined in platform-specific code. ) - - -CODE EXECUTE - DE POPqq, - chkPS, - JR, L3 BWR ( execute-B301 ) - - - +L4 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 ) + EXX, +( We have the return address for this very call on the stack + and protected registers. 2 - is to compensate that. ) + HL PS_ADDR 2 - LDddnn, + SP SUBHLss, + EXX, + CNC RETcc, ( PS_ADDR >= SP? good ) + JR, L2 BWR ( abortUnderflow-B298 ) diff --git a/blk/306 b/blk/306 index 942a8b9..360be1c 100644 --- a/blk/306 +++ b/blk/306 @@ -1,16 +1,16 @@ +( Core words ) +( KEY and EMIT are not defined here. There're + expected to be defined in platform-specific code. ) + +CODE EXECUTE + DE POPqq, + chkPS, + JR, L3 BWR ( execute-B301 ) + ( a b c -- b c a ) CODE ROT - HL POPqq, ( C ) - DE POPqq, ( B ) - BC POPqq, ( A ) + HL POPqq, ( C ) DE POPqq, ( B ) BC POPqq, ( A ) chkPS, - DE PUSHqq, ( B ) - HL PUSHqq, ( C ) - BC PUSHqq, ( A ) + DE PUSHqq, ( B ) HL PUSHqq, ( C ) BC PUSHqq, ( A ) ;CODE - - - - - diff --git a/emul/forth.bin b/emul/forth.bin index a8d3ae1..eca4d96 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ