From: cclist at
sydex.com
On 11 Nov 2007 at 10:37, dwight elvey wrote:
To my knowledge, I don't know if any of the
assemblers had
a CRC calculator built in. The final check number was most
likely calculated after the assembly and just added to the code.
If in the listing, this may have been a second pass through
the assembler.
MAC certainly didn't have one. I assume that the last 2 bytes of the
ROM were the zero-CRC-makers. The "quick and dirty way" to get a
zero sum is to compuate the CRC for the first n-2 bytes of the size n
ROM, then iterate through the 65536 possible 16-bit combinations of
the "corrector" stopping when a zero CRC is hit. It shouldn't take
long, particularly if you're using an emulator on a modern PC.
You could also work out the reverse polynomial, but that sounds like
too much work for what probably will amount to a one-off deal.
Cheers,
Chuck
Hi Chuck
As I recall, you just play the CRC forward with 0's in the
two bytes. The value in the CRC is then just put into
the place of the two bytes. It the will cancel to zero.
I'd have to check that but that is what I recall.
I recall it wasn't all that complicated. Remember,
CRC circuits in controller chip do this for floppy disk
without complicated circuits.
It has been some time since I played with CRC's. I once
had to write test to check CRC chips that used
the Chinese Remainder Theorem to make data correction.
I had to make sure that it corrected correctly by checking
each part of the error correction. That was many years
ago.
Dwight
_________________________________________________________________
Boo!?Scare away worms, viruses and so much more! Try Windows Live OneCare!