Rev 6617 | Rev 6673 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6617 | Rev 6639 | ||
---|---|---|---|
Line 92... | Line 92... | ||
92 | if DYNAMIC_CRC_TABLE eq 1 |
92 | if DYNAMIC_CRC_TABLE eq 1 |
93 | cmp dword[crc_table_empty],0 |
93 | cmp dword[crc_table_empty],0 |
94 | je @f ;if (..) |
94 | je @f ;if (..) |
95 | call make_crc_table |
95 | call make_crc_table |
96 | @@: |
96 | @@: |
97 | end if ;DYNAMIC_CRC_TABLE |
97 | end if |
98 | mov eax,crc_table |
98 | mov eax,crc_table |
99 | ret |
99 | ret |
100 | endp |
100 | endp |
Line 101... | Line 101... | ||
101 | 101 | ||
102 | ; ========================================================================= |
- | |
103 | macro DO1 |
- | |
104 | { |
- | |
105 | xor al,byte[esi] |
- | |
106 | xor al,ah |
- | |
107 | mov eax,[crc_table+eax*4] |
- | |
108 | inc esi |
- | |
109 | } |
- | |
110 | macro DO8 |
- | |
111 | { |
- | |
112 | DO1 |
- | |
113 | DO1 |
- | |
114 | DO1 |
- | |
115 | DO1 |
- | |
116 | DO1 |
- | |
117 | DO1 |
- | |
118 | DO1 |
- | |
119 | DO1 |
- | |
120 | } |
- | |
121 | - | ||
122 | ; ========================================================================= |
102 | ; ========================================================================= |
123 | ;unsigned long (crc, buf, len) |
103 | ;unsigned long (crc, buf, len) |
124 | ; unsigned long crc |
104 | ; unsigned long crc |
125 | ; unsigned char *buf |
105 | ; unsigned char *buf |
126 | ; uInt len |
106 | ; uInt len |
Line 138... | Line 118... | ||
138 | call make_crc_table |
118 | call make_crc_table |
139 | @@: |
119 | @@: |
140 | end if |
120 | end if |
Line 141... | Line 121... | ||
141 | 121 | ||
142 | mov eax,[p1crc] |
- | |
143 | xor eax,0xffffffff |
- | |
144 | mov [p1crc],eax |
122 | mov eax,[p1crc] |
145 | mov ecx,[len] |
- | |
146 | align 4 |
- | |
147 | .cycle0: |
123 | mov ecx,[len] |
148 | cmp ecx,8 |
- | |
149 | jl @f |
- | |
150 | DO8 |
- | |
151 | sub ecx,8 |
- | |
152 | jmp .cycle0 |
- | |
153 | align 4 |
- | |
154 | @@: |
- | |
155 | cmp ecx,1 |
- | |
156 | jl @f |
- | |
157 | DO1 |
- | |
158 | dec ecx |
- | |
159 | jmp @b |
- | |
160 | @@: |
- | |
161 | mov eax,[p1crc] |
- | |
162 | xor eax,0xffffffff |
124 | call crc |
163 | .end_f: |
125 | .end_f: |
164 | ret |
126 | ret |
Line 165... | Line 127... | ||
165 | endp |
127 | endp |