]> code.bitgloo.com Git - bitgloo/alee-forth.git/commitdiff
add recurse, move
authorClyne Sullivan <clyne@bitgloo.com>
Tue, 21 Feb 2023 21:59:28 +0000 (16:59 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Tue, 21 Feb 2023 21:59:28 +0000 (16:59 -0500)
compat.txt
core.fth

index bfdbb5edc8f955c8436197b9d2c07a9b65ce68a7..b225c1688f871f347d647c9f338c8b6f877cc36b 100644 (file)
@@ -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
index e46196459ff54888b02130decd6b66255bd3ae29..d1562310edbf542f7868b3c6c901e008e4890922 100644 (file)
--- a/core.fth
+++ b/core.fth
 : 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+ @ ;
 
 : 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 ;