<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 07 Nov 2009 00:18:21 +0000 (GMT)
From   : debounce@... (Greg Cook)
Subject: Basic6809 1.00

On Fri, 6/11/09, Rick Murray <rick@...> wrote:

> Phill Harvey-Smith wrote:?
[...]
> > At least with BeebASM, you can use for/next etc to
> create tables.
> 
> Speed of execution is not relevant. Show me the
> code/macro/whatever to
> generate a basic crappy 16 bit CCITT CRC table to use with
> an Xmodem
> receiver.

ORG &2000
.crctab
FOR index, 0, 255
crc1 = index EOR (index AND 240) DIV 16 * 513
crc2 = crc1 EOR (crc1 AND 15) * 4128
        PRINT "crctab[", index, "] = 0x", ~crc2
        EQUW crc2
NEXT
.crctab_end
SAVE "CRCTAB", crctab, crctab_end

Would be more useful as two tables of bytes, though.

> [moot point, to be honest, because Xmodem-checksum is more
> suited to
> lower memory machines than Xmodem-CRC;

True, but not by much.  CFS and RFS use XMODEM-CRC, of course; the
routine is 37 bytes long and loops eight times.  Timewise, a
similar length of code that doesn't loop is not too much slower
than a table driven algorithm...

http://homepages.tesco.net/rainstorm/crc-catalogue.htm#appendix.b

Greg Cook
debounce@...
http://homepages.tesco.net/rainstorm/


      
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>