void classb_crc32_update(uint32_t *checksum, uint8_t data)
{
00000A9B PUSH R16 Push register on stack
00000A9C PUSH R17 Push register on stack
00000A9D MOVW R30,R24 Copy register pair
00000A9E MOV R24,R22 Copy register
(*checksum) ^= (uint32_t)data;
00000A9F LDD R20,Z+0 Load indirect with displacement
00000AA0 LDD R21,Z+1 Load indirect with displacement
00000AA1 LDD R22,Z+2 Load indirect with displacement
00000AA2 LDD R23,Z+3 Load indirect with displacement
00000AA3 EOR R20,R24 Exclusive OR
00000AA4 STD Z+0,R20 Store indirect with displacement
00000AA5 STD Z+1,R21 Store indirect with displacement
00000AA6 STD Z+2,R22 Store indirect with displacement
00000AA7 STD Z+3,R23 Store indirect with displacement
00000AA8 LDI R24,0x08 Load immediate
if ((*checksum) & 0x01)
00000AA9 LDD R16,Z+0 Load indirect with displacement
00000AAA LDD R17,Z+1 Load indirect with displacement
00000AAB LDD R18,Z+2 Load indirect with displacement
00000AAC LDD R19,Z+3 Load indirect with displacement
00000AAD MOVW R22,R18 Copy register pair
00000AAE MOVW R20,R16 Copy register pair
00000AAF LSR R23 Logical shift right
00000AB0 ROR R22 Rotate right through carry
00000AB1 ROR R21 Rotate right through carry
00000AB2 ROR R20 Rotate right through carry
00000AB3 SBRS R16,0 Skip if bit in register set
00000AB4 RJMP PC+0x0009 Relative jump
(*checksum) = ((*checksum) >> 1) ^ CRC32_POLYNOMIAL;
00000AB5 LDI R25,0x20 Load immediate
00000AB6 EOR R20,R25 Exclusive OR
00000AB7 LDI R25,0x83 Load immediate
00000AB8 EOR R21,R25 Exclusive OR
00000AB9 LDI R25,0xB8 Load immediate
00000ABA EOR R22,R25 Exclusive OR
00000ABB LDI R25,0xED Load immediate
00000ABC EOR R23,R25 Exclusive OR
(*checksum) >>= 1;
00000ABD STD Z+0,R20 Store indirect with displacement
00000ABE STD Z+1,R21 Store indirect with displacement
00000ABF STD Z+2,R22 Store indirect with displacement
00000AC0 STD Z+3,R23 Store indirect with displacement
00000AC1 SUBI R24,0x01 Subtract immediate
for (uint8_t i = 8; i > 0; --i)
00000AC2 BRNE PC-0x19 Branch if not equal
}
00000AC3 POP R17 Pop register from stack
00000AC4 POP R16 Pop register from stack
00000AC5 RET Subroutine return