<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 30 Aug 2006 18:55:18 +0100
From   : Sprow <info@...>
Subject: Re: *INFO

In article <E1GIOG4-0000x5-00@...>,
   Ian Wolstenholme <BBCMailingList@...> wrote:
> Curses, foiled again!

[snip]

> 5 machines later (BBC DFS>>FileStore>>Master 512 ADFS 640K>>Acorn
> A5000 DOS 720K>>PC) it's here:
>
> http://www.BeebMaster.co.uk/Downloads/8271spl.txt

 350IF(length MOD256=0) THEN round=length ELSE round=((length DIV256)+1)*256
 360used=used+round

You can round up to the nearest power of two with devious ANDing:

 350REM Round and add
 360used=used+((length+255)ANDNOT255)

which is one of the few uses of arithmetic NOT,
Sprow.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>