CRC EQU $6 ; current value of CRC CRC8: EOR CRC ; A contained the data STA CRC ; XOR it with the byte ASL ; current contents of A will become x^2 term BCC UP1 ; if b7 = 1 EOR #$07 ; then apply polynomial with feedback UP1 EOR CRC ; apply x^1 ASL ; C contains b7 ^ b6 BCC UP2 EOR #$07 UP2 EOR CRC ; apply unity term STA CRC ; save result RTS http://forum.6502.org/viewtopic.php?f=2&t=558&p=3519&hilit=Paul+Guertin#p3519