Board index » delphi » CRC 16-bit and 32-bit

CRC 16-bit and 32-bit

I'm getting extremely frustrated with trying to find the 16-bit CRC used
in IEMSI sessions.   It is supposed to use a $1021 divisor, but I have
about 5 different CRC source codes now, all of them are "standard" and all
give different answers (none of which is correct).

Alls I have that actually works is some 6502 source code, and I'm having
a heck of a time translating it to anything useful.
Can someone translate the following into TP 7.0?   I was kinda confused
by the ROL as the only way I could think of doing it was with a string
representing the binary number and just using a lot of Copy's, but that
would be too slow...

chr = character to update crc16 with
tmp = temporary storage of the chr for manipulation
crc16 = the crc16 word used by IEMSI and X-Modem CRC.

        LDA chr
        LDX #$07
        STA tmp
nextbit ASL tmp
        ROL crc16
        ROL crc16+1
        BCC noxor
        LDA crc16+1
        EOR #$10
        STA crc16+1
        LDA crc16
        EOR #$21
        STA crc16
noxor   DEX
        BPL nextbit

 

Re:CRC 16-bit and 32-bit


Re:CRC 16-bit and 32-bit


Quote
Jeff <edu...@unb.ca> wrote:
>Alls I have that actually works is some 6502 source code, and I'm having
>a heck of a time translating it to anything useful.
>Can someone translate the following into TP 7.0?   I was kinda confused
>by the ROL as the only way I could think of doing it was with a string
>representing the binary number and just using a lot of Copy's, but that
>would be too slow...

Here you go sir.  The assembly files are setup for Microsoft Assembler
6.x, but could easily be ported over to Tasm.
http://www.webworldinc.com/joejared/index.htm
ftp://webworldinc.com/pub/joejared/
--- Fidoknot v1.0
* Origin: Yorba Linda, CA (joeja...@webworldinc.com)

Re:CRC 16-bit and 32-bit


Re:CRC 16-bit and 32-bit


begin 644 crc.zip
<uuencoded_portion_removed>
74U!+!08`````!``$`-P````%$``````Y
`
end

Other Threads