diff --git a/blk/003 b/blk/003 index 13b3bb5..129d8dd 100644 --- a/blk/003 +++ b/blk/003 @@ -8,8 +8,8 @@ reference. Contents 4 DOES> 6 Compilation vs meta-comp. - 8 I/O 11 Chained comparisons -14 Addressed devices 18 Signed-ness + 8 I/O 14 Addressed devices +18 Signed-ness diff --git a/blk/011 b/blk/011 index b4e33da..e69de29 100644 --- a/blk/011 +++ b/blk/011 @@ -1,16 +0,0 @@ -Chained comparisons - -The unit "cmp.fs" contains words to facilitate chained -comparisons with a single reference number. This allows, for -example, to easily express "a == b or a == c" or "a > b and a < -c". - -The way those chained comparison words work is that, unlike -single comparison operators, they don't have a "n1 n2 -- f" -signature, but rather a "n1 f n2 -- n1 f" signature. That is, -each operator "carries over" the reference number in addition -to the latest flag. - - - - (cont.) diff --git a/blk/012 b/blk/012 index 781cffd..e69de29 100644 --- a/blk/012 +++ b/blk/012 @@ -1,16 +0,0 @@ -(cont.) You open a chain with "<>{" and you close a chain with -"<>}". Then, in between those words, you can chain operators. -For example, to check whether A == B or A == C, you would -write: - -A <>{ B &= C |= <>} - -The first operator must be of the "&" type because the chain -starts with its flag to true. For example, "<>{ <>}" yields -true. - -To check whether A is in between B and C inclusively, you would -write: - -A <>{ B 1 - &> C 1 + &< <>} - diff --git a/blk/123 b/blk/123 index 9c27211..87f1519 100644 --- a/blk/123 +++ b/blk/123 @@ -2,7 +2,7 @@ : ASKIP ( a -- a+n ) DUP @ ( a n ) ( ?br or br or NUMBER ) - DUP <>{ 0x67 &= 0x53 |= 0x20 |= 0x24 |= <>} + DUP 0x67 = OVER 0x53 = OR OVER 0x20 = OR OVER 0x24 = OR IF DROP 4 + EXIT THEN ( regular word ) 0x22 = NOT IF 2+ EXIT THEN diff --git a/blk/127 b/blk/127 index d343e58..4d4166c 100644 --- a/blk/127 +++ b/blk/127 @@ -1,7 +1,7 @@ : RLWORD ( ol o a1 a2 -- ) SWAP DUP C@ ( ol o a2 a1 n ) - DUP <>{ 0x0e &= 0x2b |= <>} NOT IF ( unwind all args ) - 2DROP 2DROP EXIT THEN + DUP 0x0e = OVER 0x2b = OR NOT IF + ( unwind all args ) 2DROP 2DROP EXIT THEN 0x2b = IF 2+ THEN ( ol o a2 a1 ) 1+ ( ol o a2 a1+1 ) BEGIN ( ol o a2 a1 ) diff --git a/blk/438 b/blk/438 index 85be626..ffe20dd 100644 --- a/blk/438 +++ b/blk/438 @@ -1,13 +1,3 @@ -( Words useful for complex comparison operations ) - : >= < NOT ; : <= > NOT ; : 0>= 0< NOT ; - -( n1 -- n1 true ) -: <>{ 1 ; - -( n1 f -- f ) -: <>} SWAP DROP ; - - diff --git a/blk/439 b/blk/439 index 70f887c..8b13789 100644 --- a/blk/439 +++ b/blk/439 @@ -1,15 +1 @@ -: _|& - ( n1 n2 cell ) - >R >R DUP R> R> ( n1 n1 n2 cell ) - @ EXECUTE ( n1 f ) -; - -( n1 f n2 -- n1 f ) -: _| - CREATE , DOES> - ( n1 f n2 cell ) - ROT IF 2DROP 1 EXIT THEN ( n1 true ) - _|& -; - diff --git a/blk/440 b/blk/440 index 2c6113b..e69de29 100644 --- a/blk/440 +++ b/blk/440 @@ -1,15 +0,0 @@ -: _& - CREATE , DOES> - ( n1 f n2 cell ) - ROT NOT IF 2DROP 0 EXIT THEN ( n1 true ) - _|& -; - -( All words below have this signature: - n1 f n2 -- n1 f ) -' = _| |= -' = _& &= -' > _| |> -' > _& &> -' < _| |< -' < _& &< diff --git a/blk/461 b/blk/461 index 832ca57..cbc4472 100644 --- a/blk/461 +++ b/blk/461 @@ -8,7 +8,7 @@ DROP 8 0 DO C@+ - DUP <>{ 0x20 &< 0x7e |> <>} + DUP 0x20 < OVER 0x7e > OR IF DROP '.' THEN EMIT LOOP diff --git a/emul/forth.bin b/emul/forth.bin index 4195a57..0b1025c 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ diff --git a/recipes/rc2014/xcomp.fs b/recipes/rc2014/xcomp.fs index d45d569..0dce60c 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -23,7 +23,7 @@ H@ 256 /MOD 2 PC! 2 PC! (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -422 441 XPACKR ( core cmp ) +422 441 XPACKR ( core ) 446 452 XPACKR ( parse ) 358 360 XPACKR ( acia.fs ) 442 445 XPACKR ( print )