Subversion Repositories Kolibri OS

Rev

Rev 6883 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6883 Rev 6888
1
init_crc_table:
1
init_crc_table:
2
        xor     edx, edx
2
        xor     edx, edx
3
        mov     edi, crc_table
3
        mov     edi, crc_table
4
.1:
4
.1:
5
        mov     ecx, 8
5
        mov     ecx, 8
6
        mov     eax, edx
6
        mov     eax, edx
7
.2:
7
.2:
8
        shr     eax, 1
8
        shr     eax, 1
9
        jnc     @f
9
        jnc     @f
10
        xor     eax, 0xEDB88320
10
        xor     eax, 0xEDB88320
11
@@:
11
@@:
12
        loop    .2
12
        loop    .2
13
        stosd
13
        stosd
14
        inc     dl
14
        inc     dl
15
        jnz     .1
15
        jnz     .1
16
        ret
16
        ret
17
 
17
 
18
crc_continue:
18
crc_continue:
19
; in: eax = pervios crc, ecx = size, esi->buffer
19
; in: eax = pervios crc, ecx = size, esi->buffer
20
; out: eax = crc
20
; out: eax = crc
21
        xor     eax,-1
21
        xor     eax, -1
-
 
22
        jecxz   crc.end
22
		jmp crc.loop
23
        jmp     crc.loop
23
 
24
 
24
crc:
25
crc:
25
; in: ecx=size, esi->buffer
26
; in: ecx=size, esi->buffer
26
; out: eax=crc
27
; out: eax=crc
27
        or      eax, -1
28
        or      eax, -1
28
        jecxz   .end
29
        jecxz   .end
29
.loop:
30
.loop:
30
        movzx   edx, al
31
        movzx   edx, al
31
        xor     dl, byte [esi]
32
        xor     dl, byte [esi]
32
        inc     esi
33
        inc     esi
33
        shr     eax, 8
34
        shr     eax, 8
34
        xor     eax, [crc_table+edx*4]
35
        xor     eax, [crc_table+edx*4]
35
        loop    .loop
36
        loop    .loop
36
.end:
37
.end:
37
        xor     eax, -1
38
        xor     eax, -1
38
        ret
39
        ret