home .. forth .. misc mail list archive ..

Re: MISC instruction set


On Fri, 20 Dec 1996, Christophe Lavarenne wrote:

> Decrementing loops with -1s is the less efficient way to count iterations,
> because it implies maximum (longest) carry propagation.
> For shorter carry propagation, left-justify your counter and, instead of
> decrementing a positive counter until it reaches zero, increment it until the
> carry (T's MSBit) is set.  Finally, use the conditionnal add instruction (+*)
> with the increment (a power of 2) under the counter (left justified with its
> LSBit set to force the addition): the increment is not popped.

That was a neat trick.  How about a plain 2* (for loops shorter than 20)?

--
Penio Penev <Penev@pisa.Rockefeller.edu> 1-212-327-7423