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