From 931c812394d037c8137700bb1754e31839be1cb1 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sat, 2 May 2020 19:57:56 -0400 Subject: [PATCH] Remove cmp Not worth the complexity and space. --- blk/003 | 4 ++-- blk/011 | 16 ---------------- blk/012 | 16 ---------------- blk/123 | 2 +- blk/127 | 4 ++-- blk/438 | 10 ---------- blk/439 | 14 -------------- blk/440 | 15 --------------- blk/461 | 2 +- emul/forth.bin | Bin 5876 -> 5721 bytes recipes/rc2014/xcomp.fs | 2 +- 11 files changed, 7 insertions(+), 78 deletions(-) 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 4195a579fc07b9ce17ad745252dce342b5f77cd0..0b1025c0961694e9ea8df0183481801d90d1c8c9 100644 GIT binary patch delta 1621 zcmZ8hT}&KR6h3$6?y@txb7%HvptP}_u3Ng>Ae)qkQM8tUh37y}5W7czLKocJ(lk?4Y zzH{z(&Yj;L+iF#Ay$83x27r;z6wBwyPz#26%x9BDUiO`AzUC`~4=$2CP+0QjL4~_i zmoJhT{+;hllIFuo3z_5d%KpfrGOpOrJH0`NMc z$m;6rO6ODzVvt8!s;o(ZGn^}=vk?a_J20;+J-NfG4e4G5t{~fmEs!9CXyHUEXTl<@ z5vp{m8>BATkjmy$LBw2Tm-*j!s_aSie+6pfic|(KG>I;`$=df`)iQJqD@b4AHx0Vvy+vQ zALg7zwMcky=QB0zW18I= zW%#xJfqavQ=ceOPhHj7*c|{hJ7mGFNxsC5vv6~{g;{(BJLp7263pFH6n!DzgRB246+^N9Hlo%6~Rn8_ZCY-HlXvV`HbX9xlnN zk|kI9>Bh%(H%iLFnJ&cMZ#)p$498&Etl(K<@V$8%-ya6~W@A%8lz+DYSLzuc{{WTA BS~may delta 1841 zcmZ8hUuaup6hHS*(tB@mzk8D=?fx*m4OvZQ?QqkHwat>-rdzTs9ZOanqIGMxFjksw z-5AZf6^Cw&L2>&S)hG;x?xhM9VHKgu*h8^CY=R;(!6JR|VGIk?hdvn3xi_8S!{vVG zcm96AbI$j3+vDfdyC1;auK?ij=c=Xf?MjzW;U|}}eDD0j#<^7Fs^SvaZ*>T@yf5|uH zUCYTo@?CAX@3TOH`}_reTqyB3{fB)OwJKcqFUvLYJpax=HrbgttAWJ&Wg9vZ=M+57 z2{VEX0~4);Uz4s$RpF*|Q!=EA12=-`Ce|(qB~YMQB;Wlyy0otUkM4r#YO{6iMAt?T zpFQL$>#bc4&gqIikvL4paRL+W3BgV}4HH&BUD4BfGes3-W+DBvvVkR0@QP3XFU$zP zVuxa*Cy$MsibtS-S*G3s@rNP+$qKlk4?4lIBR=`&~(|OSxVh>-mh`U^W!?brV+>SdKDwX5?s`VJZ(> zWDz)1J~?EKluubl%cn<%5T;bI^6|KZ0mz_yTt;-BkFeXpwc6Ks%^Q4&aU$@4_)q?& z(H3krN+5#`AJ_lSnEWqeyAbDF%*b2cn>dB}m|K_#t{C@Yop;PBnZ($!k)y+L1H8!1 zidhww&6-FPiTL5Mco^|z(~wroLmoE`Ns}^JEwZbOe`-Fx`4KUHa%gyD&|#h|AVBsS za-m_fWataMn>`$gLR*uHw~WGQ(>nYof)N-P8y^F^Ap+gy;o(E0V@IsM P0^WO`z1M(4*agBrH433% 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 )