Hi there,

i've just uploaded a crc command listing,
which calculates the CRC of a file

Example:

>crc crc.exe

Maybe its interesting for some.


Here it is.
http://www.nanomonic.de/coding/win32asm/files/crc.asm
Posted on 2001-08-24 11:10:37 by marsface
hi

a little init_crc32 routine optimization.



init_crc32 proc

lea esi, crc32_table ; get table
xor edx, edx ; i = 0


ic0:
mov eax, edx ; c = i
shl eax, 24 ; c = c << 24
mov ecx, 8 ; j = 8

ic1:
; mov ebx, eax ; x = c

add eax, eax ; c = c << 1
jnc ic2 ; [cf] has now the bit.

; and ebx,080000000h ; x & 8000000h
; je ic2 ; if bit not set,
goto ic2
xor eax, CRC32_POLY ; c = c ^ CRC32_POLY

ic2:
loop ic1 ; do it for 8 times

mov [esi], eax ; store final value
lea esi, [esi + 4] ; next in arry
inc dx ; i++
and dx, 0ffh ; i&=255
jne ic0 ; if ZERO, we are done

ret

Posted on 2001-08-24 22:51:57 by marsface