CRC_8: ;INPUT: R0: RAM DATA ; R7: BYTES ;OUTPUT: A ;USE: A, R0, R7
CLR A CRC_8_1: XRL A, @R0 INC R0 CALL CRC8_TAB DJNZ R7, CRC_8_1 RET
CRC8_TAB: XRL A, #57 MOVC A, @A+PC RET ; RET 的机器码 为 0x22 ;DB 022H RET DB 07CH, 09EH, 0C0H, 043H, 01DH, 0FFH, 0A1H DB 0E0H, 0BEH, 05CH, 002H, 081H, 0DFH, 03DH, 063H DB 0BFH, 0E1H, 003H, 05DH, 0DEH, 080H, 062H, 03CH DB 07DH, 023H, 0C1H, 09FH, 01CH, 042H, 0A0H, 0FEH DB 001H, 05FH, 0BDH, 0E3H, 060H, 03EH, 0DCH, 082H DB 0C3H, 09DH, 07FH, 021H, 0A2H, 0FCH, 01EH, 040H DB 09CH, 0C2H, 020H, 07EH, 0FDH, 0A3H, 041H, 01FH DB 05EH, 000H, 0E2H, 0BCH, 03FH, 061H, 083H, 0DDH DB 064H, 03AH, 0D8H, 086H, 005H, 05BH, 0B9H, 0E7H DB 0A6H, 0F8H, 01AH, 044H, 0C7H, 099H, 07BH, 025H DB 0F9H, 0A7H, 045H, 01BH, 098H, 0C6H, 024H, 07AH DB 03BH, 065H, 087H, 0D9H, 05AH, 004H, 0E6H, 0B8H DB 047H, 019H, 0FBH, 0A5H, 026H, 078H, 09AH, 0C4H DB 085H, 0DBH, 039H, 067H, 0E4H, 0BAH, 058H, 006H DB 0DAH, 084H, 066H, 038H, 0BBH, 0E5H, 007H, 059H DB 018H, 046H, 0A4H, 0FAH, 079H, 027H, 0C5H, 09BH DB 0AEH, 0F0H, 012H, 04CH, 0CFH, 091H, 073H, 02DH DB 06CH, 032H, 0D0H, 08EH, 00DH, 053H, 0B1H, 0EFH DB 033H, 06DH, 08FH, 0D1H, 052H, 00CH, 0EEH, 0B0H DB 0F1H, 0AFH, 04DH, 013H, 090H, 0CEH, 02CH, 072H DB 08DH, 0D3H, 031H, 06FH, 0ECH, 0B2H, 050H, 00EH DB 04FH, 011H, 0F3H, 0ADH, 02EH, 070H, 092H, 0CCH DB 010H, 04EH, 0ACH, 0F2H, 071H, 02FH, 0CDH, 093H DB 0D2H, 08CH, 06EH, 030H, 0B3H, 0EDH, 00FH, 051H DB 0E8H, 0B6H, 054H, 00AH, 089H, 0D7H, 035H, 06BH DB 02AH, 074H, 096H, 0C8H, 04BH, 015H, 0F7H, 0A9H DB 075H, 02BH, 0C9H, 097H, 014H, 04AH, 0A8H, 0F6H DB 0B7H, 0E9H, 00BH, 055H, 0D6H, 088H, 06AH, 034H DB 0CBH, 095H, 077H, 029H, 0AAH, 0F4H, 016H, 048H DB 009H, 057H, 0B5H, 0EBH, 068H, 036H, 0D4H, 08AH DB 056H, 008H, 0EAH, 0B4H, 037H, 069H, 08BH, 0D5H DB 094H, 0CAH, 028H, 076H, 0F5H, 0ABH, 049H, 017H ;------------------------------------------------------- 标准法慢 1 个周期! CRC8_TAB: JZ $ + 3 MOVC A, @A+PC RET ;DB 000H DB 0XXH, .....
|