From e2e9faef2cdc3fbe7f33304c89459d52c83ea589 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 13 May 2020 08:50:07 -0400 Subject: [PATCH] Move a bunch of words from core to xcomp core --- blk/393 | 2 +- blk/413 | 8 +++++--- blk/{438 => 415} | 0 blk/422 | 4 +++- blk/430 | 5 ----- blk/439 | 4 +++- blk/440 | 11 ----------- emul/forth.bin | Bin 5899 -> 5899 bytes 8 files changed, 12 insertions(+), 22 deletions(-) rename blk/{438 => 415} (100%) diff --git a/blk/393 b/blk/393 index 98d16d9..1168ed6 100644 --- a/blk/393 +++ b/blk/393 @@ -12,4 +12,4 @@ 0 0x08 RAM+ ! ( 08 == C<* override ) LIT< INTERPRET (find) DROP EXECUTE ; -1 21 LOADR+ +1 22 LOADR+ diff --git a/blk/413 b/blk/413 index 2e22895..6e8981c 100644 --- a/blk/413 +++ b/blk/413 @@ -1,11 +1,13 @@ +: '? WORD (find) ; +: ' + '? (?br) [ 4 , ] EXIT + LIT< (wnf) (find) DROP EXECUTE +; : ROLL DUP NOT IF EXIT THEN 1+ DUP PICK ( n val ) SWAP 2 * (roll) ( val ) SWAP DROP ; - : 2OVER 3 PICK 3 PICK ; : 2SWAP 3 ROLL 3 ROLL ; - - diff --git a/blk/438 b/blk/415 similarity index 100% rename from blk/438 rename to blk/415 diff --git a/blk/422 b/blk/422 index 5e19ff6..8f7dde3 100644 --- a/blk/422 +++ b/blk/422 @@ -9,5 +9,7 @@ 34 , ( 34 == litWord ) ," 0 C, COMPILE (print) ; IMMEDIATE - : ABORT" [COMPILE] ." COMPILE ABORT ; IMMEDIATE +: BS 8 EMIT ; : LF 10 EMIT ; : CR 13 EMIT ; +: CRLF CR LF ; : SPC 32 EMIT ; +: NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ; diff --git a/blk/430 b/blk/430 index 8fa4553..8fea4c3 100644 --- a/blk/430 +++ b/blk/430 @@ -2,11 +2,6 @@ : ] R> DROP ; : LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE : LITA 36 , , ; -: '? WORD (find) ; -: ' - '? (?br) [ 4 , ] EXIT - LIT< (wnf) (find) DROP EXECUTE -; : ['] ' LITA ; IMMEDIATE : COMPILE ' LITA ['] , , ; IMMEDIATE : [COMPILE] ' , ; IMMEDIATE diff --git a/blk/439 b/blk/439 index 8ea4b45..c2c4955 100644 --- a/blk/439 +++ b/blk/439 @@ -7,4 +7,6 @@ = UNTIL DROP ; - +: (ok) SPC ." ok" NL ; +: (uflw) ABORT" stack underflow" ; +: (wnf) (print) SPC ABORT" word not found" ; diff --git a/blk/440 b/blk/440 index 1c9ce35..e69de29 100644 --- a/blk/440 +++ b/blk/440 @@ -1,11 +0,0 @@ -: (uflw) ABORT" stack underflow" ; -: BS 8 EMIT ; -: LF 10 EMIT ; -: CR 13 EMIT ; -: CRLF CR LF ; -: SPC 32 EMIT ; -: NL 0x0a RAM+ @ ( NLPTR ) DUP IF EXECUTE ELSE DROP CRLF THEN ; - -: (wnf) (print) SPC ABORT" word not found" ; -: (ok) SPC ." ok" NL ; - diff --git a/emul/forth.bin b/emul/forth.bin index ea123c9f6a5160ff5ca5e454733bea7c37c7c72b..dc6de170730378c9273de007cd5b45d5bf2e8172 100644 GIT binary patch delta 645 zcmXw0O=uHA6n;Cq85su}5|RiFwUlC-AcRw+A8NUq<$)k*2}xq3nPL-*AaNXPW2I(@&2ccrtgILu((Wx^FRUo6MM z@R&Tpap=oDXO=KCWPlTNY=SkfjF5YTGR0$r$HT~66ITxild@Xc_92ZM$Zr#Nhubg2*-{7m~mJ=%k9+H9bo|ury zFBY=a9DygJM4XYi;pK6DB?M1dVXs6Yf^b0Fo>PvwrEGaJK>MD^4ZD$wGOt4%1G~Y- z|HUjMH)_ppDgX`=gFBtIn+;>5Rb6k_ns%2l`fMYk6+}QLGnjXF?RM2@*&U;1Gv=7H zIzc~sbNqunT8M{)mUHO%qQoeb#s z0et(*ZOvX^EUYoFJxqUVDHQb5Dc`0v#P2YD>5C!-(=Wa(f5_*bMLoQ?dQl zSvn{5s%ytxMF7W z#YhMqF++*Mu55Ewx|s3tAiEx@C^c}wzEA)Og6;x1V8fMD_9rbg4wD zT3N+z*pyy_L^`4YAe6)~^7ajXtDWiZ(pC6+XseFhoXpLjRZ`^#T7oS4_@IATLSvP` z@DGp;%HR8Ye*V5Ol2o^*`ko2|RetuLvyVZ2$YqOtLor^`LuAj#@9A#{qS3%dY9}vw JF#AOi{sCe&oL2w<