Re: [Flashforth-devel] For-next loop - full 16bit count?
Brought to you by:
oh2aun
From: om1zz <om...@vo...> - 2015-05-26 08:21:37
|
Some reasoning to mu suggestion below: 1. we talking here forth - a better macro assembler 2. with your scenario we move towards a primitive function with "more intelligence" than one would expected from a better assembler.. 3. imho for-next in forth is an equivalent of "decrement and skip if zero" construct, where (at least me since '82) observed the behaviour when putting zero in it loops for a lot of times around :) Igor >Hmm, the old FOR shall behave, I think: > >2 for ---> 1 0 (2 counts) >0 for ----> 65535 65534 .. 0 (65536 counts) > >new ?FOR > >2 ?for ---> 1 0 (2 counts) >0 ?for ---> skip (none count) > >So no change with 99,99999% of old code. >I. > >______________________________________________________________ >> Od: Mikael Nordman <mik...@fl...> >> Komu: <fla...@li...> >> Datum: 26.05.2015 06:38 >> Předmět: Re: [Flashforth-devel] For-next loop - full 16bit count? >> >>I did some experiments with this and have now two for..next loops >>: t for r@ u. next ; ok<#,ram> >>: tt for2 r@ u. next ; ok<#,ram> >>9 t 8 7 6 5 4 3 2 1 0 ok<#,ram> >>9 tt 9 8 7 6 5 4 3 2 1 0 ok<#,ram> >> >>The only problem is the naming of the words. >>The old FOR ideally should be called ?FOR >>and the new one FOR. >>But that introduces a problem with existing FF code... >> >>Mike >> >>On 24.05.2015 16:00, om1zz wrote: >>> Yea, I do understand the zero loop skip intention, but I consider that a bug. >>> There is no way to do full 65536 loops with 16bit without doing 0 for..next. >>> >>> As the web knowledge says - there are only incompatible for-next loops and inefficient and lazy do-loops :) >>> >>> I would recommnd to change the behavior to full 16bit, entering 0 should be the users responsibility (similar as divide by zero). >> >>------------------------------------------------------------------------------ >>One dashboard for servers and applications across Physical-Virtual-Cloud >>Widest out-of-the-box monitoring support with 50+ applications >>Performance metrics, stats and reports that give you Actionable Insights >>Deep dive visibility with transaction tracing using APM Insight. >>http://ad.doubleclick.net/ddm/clk/290420510;117567292;y >>_______________________________________________ >>Flashforth-devel mailing list >>Fla...@li... >>https://lists.sourceforge.net/lists/listinfo/flashforth-devel >> > |