Re: [Flashforth-devel] For-next loop - full 16bit count?
Brought to you by:
oh2aun
From: om1zz <om...@vo...> - 2015-05-24 13:00:27
|
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). Or to have for..next 16bit and mfor..next with less bits (like an 8bitter mcu processing 255 data values only) :) I. ______________________________________________________________ > Od: Mikael Nordman <mik...@fl...> > Komu: <fla...@li...> > Datum: 24.05.2015 12:39 > Předmět: Re: [Flashforth-devel] For-next loop - full 16bit count? > >Yep, >You are right. next works bu decrementing the index and checking for >carry when the index goes from 0 to 65535. > >The 0 for..next loops zero times. >The 2 for..next loops two times. index values are 1 and 0 >65535 for..next loops 65535 times. Index goes from 65534 to 0 > >for..next was designed to check for the zero count and not loop in case >the count is zero. This is very useful in all cases except if >you want to loop the full 65536 times. > >BR Mike > >On 24.05.2015 13:06, om1zz wrote: >> Hmm, while messing with an external memory I need to count over entire unsigned 16bit for-loop range (to work with a block of 65536 data). >> >> When doing >> >> 65535 for ... next >> >> I get 65535 counts ( 65534..0), but I miss 65535th :) >> >> I've tried >> >> 0 for ... next >> >> but that does not loop. I think with zero input it should count over $ffff down to zero to get the full 16bit scope.. > >------------------------------------------------------------------------------ >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 > |