]> code.bitgloo.com Git - bitgloo/alee-forth.git/commitdiff
:noname, ?do; fix +loop, aligned
authorClyne Sullivan <clyne@bitgloo.com>
Mon, 27 Feb 2023 17:14:43 +0000 (12:14 -0500)
committerClyne Sullivan <clyne@bitgloo.com>
Mon, 27 Feb 2023 17:14:43 +0000 (12:14 -0500)
compat.txt
core.fth

index 91e29316e4665c6dcb5ebb05e451272d312a40e1..364ac7e6db0398531a860c6adbe6e2bc0a0e1634 100644 (file)
@@ -143,9 +143,9 @@ yes 6.2.0280 0>
 yes 6.2.0340 2>R
 yes 6.2.0410 2R>
 yes 6.2.0415 2R@
-    6.2.0455 :NONAME
+yes 6.2.0455 :NONAME
 yes 6.2.0500 <>
-    6.2.0620 ?DO
+yes 6.2.0620 ?DO
 yes 6.2.0698 ACTION-OF
 yes 6.2.0700 AGAIN
 yes 6.2.0825 BUFFER:
index 178a5d28e1bf27c876dd0d84b428f0e6c2c832a9..5832a95b1f27ab7d1b70684d6a17b75ff39abc3e 100644 (file)
--- a/core.fth
+++ b/core.fth
@@ -62,7 +62,7 @@
 : 0=       0 = ;
 : 0<       0 < ;
 : <=       - 1- 0< ;
-: >        <= 0= ;
+: >        swap < ;
 : <>       = 0= ;
 : 0<>      0= 0= ;
 : 0>       0 > ;
 : again    postpone repeat ; imm
 
 : do       ['] _lit , here 0 , ['] >r , postpone 2>r here ; imm
+: ?do      ['] 2dup , ['] _lit , here 0 , ['] >r , ['] = , postpone if
+           ['] 2drop , postpone 2r> ['] drop , ['] >r , ['] exit ,
+           postpone then postpone 2>r here ; imm
 : unloop   postpone 2r> ['] 2drop , ; imm
 : leave    postpone unloop postpone 2r>
            ['] drop , ['] >r , ['] exit , ; imm
-: +loop    postpone 2r> ['] rot , ['] + , ['] 2dup ,
-           postpone 2>r ['] - , ['] 0= , ['] _jmp0 , ,
+: +loop    postpone 2r> ['] 2dup , ['] swap , ['] < , ['] >r ,
+           ['] rot , ['] + , ['] 2dup , ['] swap , ['] < ,
+           ['] r> , ['] ^ , ['] -rot ,
+           postpone 2>r ['] _jmp0 , ,
+           postpone unloop
+           here swap ! ['] r> , ['] drop , ; imm
+: loop     postpone 2r> ['] 1+ , ['] 2dup ,
+           postpone 2>r ['] = , ['] _jmp0 , ,
            postpone unloop
            here swap ! ['] r> , ['] drop , ; imm
-: loop     1 postpone literal postpone +loop ; imm
 : i        postpone r@ ; imm 
 : j        postpone 2r> postpone r@ ['] -rot , postpone 2>r ; imm
 
 : align    here 1 cells 1- tuck & if 1 cells swap - allot else drop then ;
-: aligned  dup 1 cells 1- tuck & if 1 cells swap - allot else drop then ;
+: aligned  dup 1 cells 1- tuck & if 1 cells swap - + else drop then ;
 
 : and      & ;
 : or       | ;
 
 : marker   create _latest @ , here , does>
            dup @ _latest ! cell+ @ here swap - allot ;
+: :noname  0 , here ] ;