diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-21 16:59:28 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-02-21 16:59:28 -0500 |
commit | 572a79b4c724d4c6c7770874bafc5546139f44b7 (patch) | |
tree | a3e800c1c0d49de8b18b5ffb8f0a7010b36dd8e2 | |
parent | 9a5b8581d0fb18d20ac21b8d1f96bf18806f1742 (diff) |
add recurse, move
-rw-r--r-- | compat.txt | 4 | ||||
-rw-r--r-- | core.fth | 13 |
2 files changed, 12 insertions, 5 deletions
@@ -96,7 +96,7 @@ yes 6.1.1805 LSHIFT yes 6.1.1870 MAX yes 6.1.1880 MIN yes 6.1.1890 MOD - 6.1.1900 MOVE +yes 6.1.1900 MOVE yes 6.1.1910 NEGATE yes 6.1.1980 OR yes 6.1.1990 OVER @@ -104,7 +104,7 @@ yes 6.1.2033 POSTPONE yes 6.1.2050 QUIT yes 6.1.2060 R> yes 6.1.2070 R@ - 6.1.2120 RECURSE +yes 6.1.2120 RECURSE yes 6.1.2140 REPEAT yes 6.1.2160 ROT yes 6.1.2162 RSHIFT @@ -116,9 +116,9 @@ : create align here bl word count nip cell+ allot align ['] _lit , here 3 cells + , ['] exit , 0 , dup @ 31 & over _latest @ - 6 << or over ! _latest ! ; -: does> _latest @ - dup @ 31 & + cell+ aligned - 2 cells + +: _latword _latest @ + dup @ 31 & + cell+ aligned ; +: does> _latword 2 cells + ['] _jmp over ! cell+ here swap ! ] ; : >body cell+ @ ; @@ -132,3 +132,10 @@ : quit begin _rdepth 1 > while r> drop repeat postpone [ ; : abort begin depth 0 > while drop repeat quit ; + +: recurse _latword , ; imm + +: move begin dup 0 > while + rot dup @ >r cell+ + rot r> over ! cell+ + rot 1- repeat drop 2drop ; |