Re: [Flashforth-devel] For-next loop - full 16bit count?
Brought to you by:
oh2aun
From: Mikael N. <mik...@fl...> - 2015-05-24 10:38:27
|
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.. |