-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathblock-003.fth
More file actions
32 lines (19 loc) · 857 Bytes
/
block-003.fth
File metadata and controls
32 lines (19 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
( Block 3 - Strings )
find fill loaded?
p1vhere $100 + ; p2p1 $100 + ;
fill (dst cnt ch--)>t swap >a for t@ c!a+ nextatdrop ;
move (src dst n--) >r >t >a r> for a@ @ t@ ! a@ cell+ a! t@ cell+ t! nextatdrop ;
cmove (src dst n--) >r >t >a r> for c@a+ c!t+ nextatdrop ;
cmove>(src dst n--) >r r@ + 1- >t r@ + 1- >a r> for c@a- c!t- nextatdrop ;
s-trunc(dst--dst) 0 over c! ;
s-end (str-end) dup s-len + ;
s-cat (dst src--dst)over s-end swap s-cpy drop ;
s-catc (dst ch--dst) over s-end w! ;
s-catn (dst n--dst) <# #s #> s-cat ;
s-scpy (src dst--dst)swap s-cpy ;
s-scat (src dst--dst)swap s-cat ;
s-scatc(ch dst--dst) swap s-catc ;
s-scatn(n dst--dst) swap s-catn ;
s-rtrim(str--str) >r r@ s-end 1- >t
begint@ r@ < c@t 32 > oriftdrop r> exitthen
0 c!t-again;