From 75ef1f440cb1e3a69e0f9a93b4f2096526adb1c6 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 29 Oct 2020 12:15:21 -0400 Subject: [PATCH] Make MOVE* words use A@ and A! This allows us to remove AMOVE* words. --- blk/355 | 3 +++ blk/367 | 15 +++++++-------- blk/368 | 10 ++++++++-- blk/385 | 12 ------------ blk/386 | 6 ------ cvm/forth.bin | Bin 5200 -> 5167 bytes doc/avr.txt | 6 +++--- doc/dict.txt | 24 ++++++++++-------------- doc/usage.txt | 8 ++++++-- 9 files changed, 37 insertions(+), 47 deletions(-) delete mode 100644 blk/386 diff --git a/blk/355 b/blk/355 index 434d27a..f8305a7 100644 --- a/blk/355 +++ b/blk/355 @@ -9,3 +9,6 @@ DUP I C! LOOP DROP ; : ALLOT0 ( n -- ) H@ OVER 0 FILL ALLOT ; +SYSVARS 0x3e + :** A@ +SYSVARS 0x40 + :** A! +SYSVARS 0x42 + :** A, diff --git a/blk/367 b/blk/367 index 2f33879..f8c67a0 100644 --- a/blk/367 +++ b/blk/367 @@ -1,14 +1,13 @@ : MOVE ( a1 a2 u -- ) ?DUP IF ( u ) 0 DO ( a1 a2 ) - SWAP C@+ ( a2 a1+1 x ) - ROT C!+ ( a1+1 a2+1 ) + OVER I + A@ ( src dst x ) + OVER I + ( src dst x dst ) + A! ( src dst ) LOOP THEN 2DROP ; : MOVE- ( a1 a2 u -- ) - ?DUP IF TUCK + 1- ( a1 u a2+u-1 ) - ROT 2 PICK + 1- ( u a2+u-1 a1+u-1 ) - ROT ( u ) 0 DO ( a2 a1 ) - C@- ( a2 a1-1 x ) - ROT C!- ( a1-1 a2-1 ) SWAP ( a2 a1 ) + ?DUP IF ( u ) 0 DO ( a1 a2 ) + OVER I' + I - 1- A@ ( src dst x ) + OVER I' + I - 1- ( src dst x dst ) + A! ( src dst ) LOOP THEN 2DROP ; : MOVE, ( a u -- ) H@ OVER ALLOT SWAP MOVE ; -: PREV 3 - DUP @ - ; diff --git a/blk/368 b/blk/368 index d1532ba..4928621 100644 --- a/blk/368 +++ b/blk/368 @@ -1,10 +1,16 @@ +: MOVEW ( src dst u -- ) + ( u ) 0 DO + SWAP DUP I 1 LSHIFT + A@ ( dst src x ) + ROT TUCK I 1 LSHIFT + ( src dst x dst ) + A! ( src dst ) + LOOP 2DROP ; +: PREV 3 - DUP @ - ; : [entry] ( w -- ) C@+ ( w+1 len ) TUCK MOVE, ( len ) ( write prev value ) H@ CURRENT @ - , C, ( write size ) - H@ CURRENT ! -; + H@ CURRENT ! ; : (entry) WORD [entry] ; : CREATE (entry) 2 ( cellWord ) C, ; : VARIABLE CREATE 2 ALLOT ; diff --git a/blk/385 b/blk/385 index 60dd886..db838a0 100644 --- a/blk/385 +++ b/blk/385 @@ -2,15 +2,3 @@ ( b1 b2 -- ) : LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ; : LOADR+ BLK> @ + SWAP BLK> @ + SWAP LOADR ; -( Now, adev stuff ) -SYSVARS 0x3e + :** A@ -SYSVARS 0x40 + :** A! -SYSVARS 0x42 + :** A, - -( src dst u -- ) -: AMOVE - ( u ) 0 DO - SWAP DUP I + A@ ( dst src x ) - ROT TUCK I + ( src dst x dst ) - A! ( src dst ) - LOOP 2DROP ; diff --git a/blk/386 b/blk/386 deleted file mode 100644 index 6249a9e..0000000 --- a/blk/386 +++ /dev/null @@ -1,6 +0,0 @@ -: AMOVEW ( src dst u -- ) - ( u ) 0 DO - SWAP DUP I 1 LSHIFT + A@ ( dst src x ) - ROT TUCK I 1 LSHIFT + ( src dst x dst ) - A! ( src dst ) - LOOP 2DROP ; diff --git a/cvm/forth.bin b/cvm/forth.bin index 27637a54082cea6525ec13b140573f75e854855b..5a282b49e25ba93bc017f2e092f7935e0b83ec1c 100644 GIT binary patch delta 2065 zcmYjSeP~lx6hHUn-Mp9gUOt+BsQ993(%KJOOS;KwCfd9I8v)yArCTcz(AMYT)PhE8*^FT4I;Q z^+WSw5FSl}4o0dB1Y&>;^P&#%h-%&x^VX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