📄 mifare_crc.lst
字号:
C51 COMPILER V8.00 MIFARE_CRC 04/23/2009 15:56:20 PAGE 1
C51 COMPILER V8.00, COMPILATION OF MODULE MIFARE_CRC
OBJECT MODULE PLACED IN .\out_sst89e564\Mifare_CRC.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE source\Mifare_CRC.c LARGE BROWSE ORDER NOAREGS DEBUG OBJECTEXTEND PRINT(.\M
-ifare_CRC.lst) OBJECT(.\out_sst89e564\Mifare_CRC.obj)
line level source
1 /*
2
3 File nmae: Mifare_CRC.c
4 Function :UpdateCrc() and ComputerCrc().This function is
5 original source code in ISO/IEC14443-3 Annex B
6 Comment :This file include all of the commputering ISO/IEC
7 14443-3 Annex B type card's CRC function.
8 Note!! This files should implemented by the Mifare Pro
9 function and computer the CRC for receive data from
10 ISO/IEC 14443-4 type A IC card.
11
12 */
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <string.h>
16 #include <ctype.h>
17 #include "Mifarepro.h"
18
19 //unsigned char First, Second;
20
21 unsigned short UpdateCrc(unsigned char ch, unsigned short *lpwCrc)
22 {
23 1 ch = (ch^(unsigned char)((*lpwCrc) & 0x00FF));
24 1 ch = (ch^(ch<<4));
25 1 *lpwCrc = (*lpwCrc >> 8)^((unsigned short)ch << 8)^((unsigned short)ch<<3)^((unsigned short)ch>>4);
26 1 return(*lpwCrc);
27 1 }
28 void ComputeCrc(char *Data, int Length,unsigned char *TransmitFirst, unsigned char *TransmitSecond)
29 {
30 1 unsigned char chBlock;
31 1 unsigned short wCrc;
32 1
33 1 wCrc = 0x6363; /* ITU-V.41 */
34 1 do
35 1 {
36 2 chBlock = *Data++;
37 2 UpdateCrc(chBlock, &wCrc);
38 2 } while (--Length);
39 1
40 1 *TransmitFirst = (unsigned char) (wCrc & 0xFF);
41 1 *TransmitSecond = (unsigned char) ((wCrc >> 8) & 0xFF);
42 1 }
43
44 //ComputeCrc(BuffCRC_A, length, &First, &Second);
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 195 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- 15
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
C51 COMPILER V8.00 MIFARE_CRC 04/23/2009 15:56:20 PAGE 2
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -