From 640e3321fc1575f06683460622416809961119cb Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 14 May 2020 09:54:33 -0400 Subject: [PATCH] Move a bunch of words from XPACKed core to xcomp core --- blk/414 | 5 +++++ blk/437 | 4 +++- blk/438 | 1 + blk/439 | 14 -------------- blk/441 | 13 ------------- blk/443 | 4 ---- emul/forth.bin | Bin 5875 -> 5875 bytes 7 files changed, 9 insertions(+), 32 deletions(-) create mode 100644 blk/414 delete mode 100644 blk/439 delete mode 100644 blk/441 diff --git a/blk/414 b/blk/414 new file mode 100644 index 0000000..ad14ea9 --- /dev/null +++ b/blk/414 @@ -0,0 +1,5 @@ +: [IF] + IF EXIT THEN + LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ; +: [THEN] ; + diff --git a/blk/437 b/blk/437 index 361aab2..3c53782 100644 --- a/blk/437 +++ b/blk/437 @@ -3,7 +3,9 @@ : LOOP COMPILE (loop) H@ - , ; IMMEDIATE ( LEAVE is implemented in low xcomp ) : LITN 32 , , ( 32 == NUMBER ) ; -: _ ( : will get its name at the very end ) +( gets its name at the very end. can't comment afterwards ) +: _ BEGIN LIT< ) WORD S= UNTIL ; IMMEDIATE +: _ ( : will get its name almost at the very end ) (entry) [ 14 ( == compiledWord ) LITN ] C, BEGIN diff --git a/blk/438 b/blk/438 index cb829de..1296f6f 100644 --- a/blk/438 +++ b/blk/438 @@ -7,3 +7,4 @@ ; IMMEDIATE ';' XCURRENT @ 4 - C! ':' X' _ 4 - C! ( give : its name ) +'(' X' _ 4 - C! diff --git a/blk/439 b/blk/439 deleted file mode 100644 index b6e9c1c..0000000 --- a/blk/439 +++ /dev/null @@ -1,14 +0,0 @@ -XPACKed core - -Most of Collapse OS' core words are cross compiled (B390). -However, some of them are too dynamically referenced to be -cross-compiled without great pain, so we XPACK (B267) them, -that is, we put them in source form in the target's -initialization section (see B89). - -These words will be compiled into RAM at initialization, which -is a bit wasteful both in RAM and in boot time, so we will -typically relink (B120) that newly compiled binary and append -it to our existing binary for optimal resource usage. - -Load range: 440-446 diff --git a/blk/441 b/blk/441 deleted file mode 100644 index 7bd64ff..0000000 --- a/blk/441 +++ /dev/null @@ -1,13 +0,0 @@ -: _ BEGIN LIT< ) WORD S= UNTIL ; IMMEDIATE -40 CURRENT @ 4 - C! -( Hello, hello, krkrkrkr... do you hear me? - Ah, voice at last! Some lines above need comments - BTW: Forth lines limited to 64 cols because of default - input buffer size in Collapse OS - - 40 is ASCII for '('. We do this to simplify XPACK's task of - not mistakenly consider '(' definition as a comment. - LIT<: 34 == litWord - LITA: 36 == addrWord - COMPILE: Tough one. Get addr of caller word (example above - (br)) and then call LITA on it. ) diff --git a/blk/443 b/blk/443 index c80b968..5d02510 100644 --- a/blk/443 +++ b/blk/443 @@ -6,7 +6,3 @@ H@ 2- ( push a. -2 for allot offset ) ; IMMEDIATE -: [IF] - IF EXIT THEN - LIT< [THEN] BEGIN DUP WORD S= UNTIL DROP ; -: [THEN] ; diff --git a/emul/forth.bin b/emul/forth.bin index cdb375150f1202f4037b482910861c61d0e666e5..13e1e922490460a7117d498e79a5ebd6af66ee01 100644 GIT binary patch delta 1283 zcmZWpUuYY39RJ?kFI|`9es`D4#Vyb^Y0@mWx(<~JcD2c_ON~lJyybeQXmhh>U9Ao>1G$9!ufdcW$F5rEVxDJ_ph!BfSGf_fqZR2@E@d z;s%Bisz=WoNWZ5tnN0o)G%%zkJ3zRtFwceWHkm==?IUm5tM6XBWmAruqN_eDJrNSm z+>Y}a92_FOmI4{GAA~q}z%7P66!g$c)ko?Pa*I^S9lnap+Wbrq6f{hD%8J`JbORd- zlN;#pK&p8eeungH>$*LR#vMKat?Q7J`Ih*K50B>fuL0DqHS6{%%sJ-~)>;NZAo3eaw#Yb@=0O3yo(lmFKTub*nsy{6Sb$lGp(T`)rea2UYQfp1txLx-3<) ze$!;|p&j;mn1@G<1leoN`VHHlQ86%>+|%0%Edm?)9!eQ$ zI292uMlzV@j;Kdcg>>mIE_$ z<@u6Z;Bc3}9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