Rev 6797 | Rev 6801 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6797 | Rev 6799 | ||
---|---|---|---|
Line 160... | Line 160... | ||
160 | mov match_head,eax |
160 | mov match_head,eax |
161 | if FASTEST eq 0 |
161 | if FASTEST eq 0 |
162 | push ebx |
162 | push ebx |
163 | mov ebx,[s+deflate_state.w_mask] |
163 | mov ebx,[s+deflate_state.w_mask] |
164 | and ebx,str |
164 | and ebx,str |
- | 165 | shl ebx,2 |
|
165 | add ebx,[s+deflate_state.prev] |
166 | add ebx,[s+deflate_state.prev] |
166 | mov byte[ebx],al |
167 | mov [ebx],eax |
167 | pop ebx |
168 | pop ebx |
168 | end if |
169 | end if |
169 | mov eax,[s+deflate_state.ins_h] |
170 | mov eax,[s+deflate_state.ins_h] |
170 | shl eax,2 |
171 | shl eax,2 |
171 | add eax,[s+deflate_state.head] |
172 | add eax,[s+deflate_state.head] |
Line 177... | Line 178... | ||
177 | ; Initialize the hash table (avoiding 64K overflow for 16 bit systems). |
178 | ; Initialize the hash table (avoiding 64K overflow for 16 bit systems). |
178 | ; prev[] will be initialized on the fly. |
179 | ; prev[] will be initialized on the fly. |
Line 179... | Line 180... | ||
179 | 180 | ||
180 | macro CLEAR_HASH s |
181 | macro CLEAR_HASH s |
- | 182 | { |
|
- | 183 | ;mov eax,[s+deflate_state.hash_size] |
|
- | 184 | ;dec eax |
|
- | 185 | ;shl eax,2 |
|
- | 186 | ;add eax,[s+deflate_state.head] |
|
181 | { |
187 | ;mov dword[eax],NIL |
182 | mov eax,[s+deflate_state.hash_size] |
188 | mov eax,[s+deflate_state.hash_size] |
183 | dec eax |
- | |
184 | shl eax,2 |
- | |
185 | add eax,[s+deflate_state.head] |
- | |
186 | mov dword[eax],NIL |
- | |
187 | mov eax,[s+deflate_state.hash_size] |
- | |
188 | dec eax |
189 | ;dec eax |
189 | shl eax,2 ;sizeof(*s.head) |
190 | shl eax,2 ;sizeof(*s.head) |
190 | stdcall zmemzero, [s+deflate_state.head], eax |
191 | stdcall zmemzero, [s+deflate_state.head], eax |
Line 191... | Line 192... | ||
191 | } |
192 | } |
Line 585... | Line 586... | ||
585 | xor eax,eax ;stdcall calc_crc32, 0, Z_NULL, 0 |
586 | xor eax,eax ;stdcall calc_crc32, 0, Z_NULL, 0 |
586 | @@: |
587 | @@: |
587 | end if |
588 | end if |
588 | mov dword[ebx+z_stream.adler],eax |
589 | mov dword[ebx+z_stream.adler],eax |
589 | mov dword[edi+deflate_state.last_flush],Z_NO_FLUSH |
590 | mov dword[edi+deflate_state.last_flush],Z_NO_FLUSH |
590 | - | ||
591 | stdcall _tr_init, edi |
591 | stdcall _tr_init, edi |
Line 592... | Line 592... | ||
592 | 592 | ||
593 | mov eax,Z_OK |
593 | mov eax,Z_OK |
594 | .end_f: |
594 | .end_f: |
Line 1923... | Line 1923... | ||
1923 | inc esi |
1923 | inc esi |
1924 | mov ecx,[strend] |
1924 | mov ecx,[strend] |
1925 | sub ecx,edi |
1925 | sub ecx,edi |
1926 | jz @f |
1926 | jz @f |
1927 | repe cmpsb |
1927 | repe cmpsb |
- | 1928 | dec edi |
|
- | 1929 | dec esi |
|
1928 | @@: |
1930 | @@: |
Line 1929... | Line 1931... | ||
1929 | 1931 | ||
1930 | mov eax,[edx+deflate_state.window_size] |
1932 | mov eax,[edx+deflate_state.window_size] |
1931 | dec eax |
1933 | dec eax |
Line 1966... | Line 1968... | ||
1966 | cmp eax,[limit] |
1968 | cmp eax,[limit] |
1967 | jle .cycle0end |
1969 | jle .cycle0end |
1968 | dec dword[chain_length] |
1970 | dec dword[chain_length] |
1969 | cmp dword[chain_length],0 |
1971 | cmp dword[chain_length],0 |
1970 | jne .cycle0 |
1972 | jne .cycle0 |
- | 1973 | align 4 |
|
1971 | .cycle0end: ;while (..>.. && ..!=0) |
1974 | .cycle0end: ;while (..>.. && ..!=0) |
Line 1972... | Line 1975... | ||
1972 | 1975 | ||
1973 | mov eax,[edx+deflate_state.lookahead] |
1976 | mov eax,[edx+deflate_state.lookahead] |
1974 | cmp [best_len],eax |
1977 | cmp [best_len],eax |
Line 2279... | Line 2282... | ||
2279 | 2282 | ||
2280 | cmp dword[edi+deflate_state.lookahead],MIN_LOOKAHEAD |
2283 | cmp dword[edi+deflate_state.lookahead],MIN_LOOKAHEAD |
2281 | jge .cycle0end |
2284 | jge .cycle0end |
2282 | cmp dword[edx+z_stream.avail_in],0 |
2285 | cmp dword[edx+z_stream.avail_in],0 |
- | 2286 | jne .cycle0 |
|
2283 | jne .cycle0 |
2287 | align 4 |
Line 2284... | Line 2288... | ||
2284 | .cycle0end: ;while (..<.. && ..!=..) |
2288 | .cycle0end: ;while (..<.. && ..!=..) |
2285 | 2289 | ||
2286 | ; If the WIN_INIT bytes after the end of the current data have never been |
2290 | ; If the WIN_INIT bytes after the end of the current data have never been |
Line 2409... | Line 2413... | ||
2409 | 2413 | ||
2410 | mov ecx,0xffff |
2414 | mov ecx,0xffff |
2411 | mov eax,[edi+deflate_state.pending_buf_size] |
2415 | mov eax,[edi+deflate_state.pending_buf_size] |
2412 | sub eax,5 |
2416 | sub eax,5 |
2413 | cmp ecx,eax |
2417 | cmp ecx,eax |
2414 | jle @f ;if (..>..) |
2418 | jle .cycle0 ;if (..>..) |
2415 | mov ecx,eax |
- | |
2416 | @@: |
2419 | mov ecx,eax |
Line 2417... | Line 2420... | ||
2417 | ;ecx = max_block_size |
2420 | ;ecx = max_block_size |
- | 2421 | ||
2418 | 2422 | ; Copy as much as possible from input to output: |
|
2419 | ; Copy as much as possible from input to output: |
2423 | align 4 |
2420 | .cycle0: ;for (;;) { |
2424 | .cycle0: ;for (;;) { |
2421 | ; Fill the window as much as possible: |
2425 | ; Fill the window as much as possible: |
2422 | cmp dword[edi+deflate_state.lookahead],1 |
2426 | cmp dword[edi+deflate_state.lookahead],1 |
Line 2433... | Line 2437... | ||
2433 | jmp .end_f |
2437 | jmp .end_f |
2434 | @@: |
2438 | @@: |
2435 | cmp dword[edi+deflate_state.lookahead],0 |
2439 | cmp dword[edi+deflate_state.lookahead],0 |
2436 | je .cycle0end ;if (..==0) break ;flush the current block |
2440 | je .cycle0end ;if (..==0) break ;flush the current block |
2437 | .end0: |
2441 | .end0: |
2438 | ; Assert(s->block_start >= 0, "block gone"); |
2442 | cmp dword[edi+deflate_state.block_start],0 |
- | 2443 | jge @f |
|
- | 2444 | zlib_assert 'block gone' ;Assert(..>=0) |
|
- | 2445 | @@: |
|
Line 2439... | Line 2446... | ||
2439 | 2446 | ||
2440 | mov eax,[edi+deflate_state.lookahead] |
2447 | mov eax,[edi+deflate_state.lookahead] |
2441 | add [edi+deflate_state.strstart],eax |
2448 | add [edi+deflate_state.strstart],eax |
Line 2821... | Line 2828... | ||
2821 | mov dword[edi+deflate_state.match_available],1 |
2828 | mov dword[edi+deflate_state.match_available],1 |
2822 | inc dword[edi+deflate_state.strstart] |
2829 | inc dword[edi+deflate_state.strstart] |
2823 | dec dword[edi+deflate_state.lookahead] |
2830 | dec dword[edi+deflate_state.lookahead] |
2824 | ;.end4: |
2831 | ;.end4: |
2825 | jmp .cycle0 |
2832 | jmp .cycle0 |
- | 2833 | align 4 |
|
2826 | .cycle0end: |
2834 | .cycle0end: |
2827 | cmp dword[flush],Z_NO_FLUSH |
2835 | cmp dword[flush],Z_NO_FLUSH |
2828 | jne @f |
2836 | jne @f |
2829 | zlib_assert 'no flush?' ;Assert (..!=..) |
2837 | zlib_assert 'no flush?' ;Assert (..!=..) |
2830 | @@: |
2838 | @@: |