From 2d2a846b2548aba3899487511d600e8ff8aa2b26 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 24 May 2020 14:19:25 -0400 Subject: [PATCH] Inline SCPY I'm planning a string reform and it's standing in the way. --- blk/058 | 3 --- blk/367 | 6 ------ blk/368 | 4 +++- blk/369 | 4 ---- blk/399 | 2 +- emul/forth.bin | Bin 6126 -> 6126 bytes 6 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 blk/367 diff --git a/blk/058 b/blk/058 index e9718b2..a323f57 100644 --- a/blk/058 +++ b/blk/058 @@ -5,9 +5,6 @@ LIT -- Write a LIT entry. You're expected to write LIT< x -- Read following word and write to HERE as a string literal. S= a1 a2 -- f Returns whether string a1 == a2. -SCPY a -- Copy string at addr a into HERE, without - NULL termination. - diff --git a/blk/367 b/blk/367 deleted file mode 100644 index 978f27c..0000000 --- a/blk/367 +++ /dev/null @@ -1,6 +0,0 @@ -: SCPY - BEGIN ( a ) - C@+ ( a+1 c ) - ?DUP NOT IF DROP EXIT THEN - C, ( a c ) - AGAIN ; diff --git a/blk/368 b/blk/368 index d851922..6121c98 100644 --- a/blk/368 +++ b/blk/368 @@ -1,5 +1,7 @@ +: +! TUCK @ + SWAP ! ; : [entry] ( w -- ) - H@ SWAP SCPY ( h ) + H@ SWAP + BEGIN C@+ ( w+1 c ) ?DUP IF C, 0 ELSE 1 THEN UNTIL DROP H@ SWAP - ( sz ) ( write prev value ) H@ CURRENT @ - , diff --git a/blk/369 b/blk/369 index 70e7d75..35f6b3f 100644 --- a/blk/369 +++ b/blk/369 @@ -1,11 +1,7 @@ -( Words here until the end of the low part, unlike words - preceeding them, aren't immediately needed for boot. But its - better to have as many words as possible in the xcomp part. ) : IMMEDIATE CURRENT @ 1- DUP C@ 128 OR SWAP C! ; : IMMED? 1- C@ 0x80 AND ; -: +! TUCK @ + SWAP ! ; : -^ SWAP - ; : / /MOD NIP ; : MOD /MOD DROP ; diff --git a/blk/399 b/blk/399 index e0befb6..f299bbe 100644 --- a/blk/399 +++ b/blk/399 @@ -1,9 +1,9 @@ +: LIT< WORD 34 , BEGIN C@+ DUP C, NOT UNTIL DROP ; IMMEDIATE : BEGIN H@ ; IMMEDIATE : AGAIN COMPILE (br) H@ - _bchk , ; IMMEDIATE : UNTIL COMPILE (?br) H@ - _bchk , ; IMMEDIATE : [ INTERPRET ; IMMEDIATE : ] R> DROP ; -: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE : LITA 36 , , ; : COMPILE ' LITA ['] , , ; IMMEDIATE : [COMPILE] ' , ; IMMEDIATE diff --git a/emul/forth.bin b/emul/forth.bin index 221c9e2acf4e04b8393f6aeb64a9d008b06ec412..ba8aebfa4ae4b8012db6db0be84b4fb6adf3568c 100644 GIT binary patch delta 1397 zcmY*ZT}T{P6h1R|#&u_QXJ&t9RYJ_{?wB>&x|FtVV}kCEuF2x+%C17An8X$_HZdt0 z3TdHk><M649Ll`d%tswMKME3TIg3IL z1XvbE;n86OPhE1bvK51FOHU;FvV4k8%TaY(vYk`3Ttfqo}H z&;3p%*RaEI89>0G6RwYCa0&dkt_iU~R;kO~A}+}rP9N=Zf6A@VAKk~M7Uc6%QMl(W zkO#sXt`=D7u3#Mq%A9+ae1hK&SN2=bneNY>tp-uKhufnFR#WWoxCg@<6@h0d=PO2` z0vdP=m|Y+@?Goj(!Q+^`Y@cR9{mA&(b^5MiA(B-kitA(Lb?$B2uO3gw)Ew*_Vp1-Q z?K7YfVyXq{PT963+iK62E%(1xy3>s??y55wnd@zrfMB8lF}kiE<-VdntIv@EwM6|| zM>wJtg)OHAO(73VD=E!{0d)iIgq6wm;ogVJ5Pe5GS07U!2puG^3A_O(;jRCeF?f#< zURx7z$}Cx-e{0RXckmuGxJ3TaVk-Nv{HrxKUf?c~I!~R)f(r^Juxc#`THxzECDp(_ z7KIXaYnB+mLYr|PJ#^aB=!>a&*gjmxVjcb6y~9XwhTiw+T$XNnPMCSMq~_7rl{{zK zbo(JI&Jw1mO4#9;o^H{wH^hmw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