X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Flib.4th;h=81b1e6fc8403a7b1977526033846ac314f2ec611;hp=4e732068323e3ab7c710e42c69b722be08101072;hb=dfc28eefbcea7eb34cf9c1e0df010322b291c40a;hpb=366db53c2e77d243c744c11f68b8bdeb575c86e6 diff --git a/src/lib.4th b/src/lib.4th index 4e73206..81b1e6f 100644 --- a/src/lib.4th +++ b/src/lib.4th @@ -149,15 +149,11 @@ : +LOOP IMMEDIATE - trace - ['] DUP , \ Store copy of increment ['] R> , ['] SWAP , ['] R> , ['] SWAP , ['] R> , ['] SWAP , ['] + , ['] 2DUP , ['] - , ['] SWAP , ['] >R , ['] SWAP , ['] >R , ['] SWAP , ['] >R , - trace - \ Condition differently depending on sign of increment ['] SWAP , ['] 0>= , [COMPILE] IF ['] 0<= , @@ -165,16 +161,12 @@ ['] 0> , [COMPILE] THEN - trace - \ Branch back to begining of loop kernel ['] 0BRANCH , HERE @ - , \ Clean up ['] RDROP , ['] RDROP , ['] RDROP , - trace - \ Record address of loop end for any LEAVEs to use HERE @ SWAP ! @@ -217,7 +209,6 @@ REPEAT ; -xx \ COMMENTS ----------------------------------------------------------------------