Guidance
指路人
g.yi.org
software / rapidq / Examples / ASM / crc32 / crc32.asm

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
; Copyright (c) 2002
; Pavel "EvilOne" Minayev
;
; Permission to use, copy, modify, distribute and sell this software
; and its documentation for any purpose is hereby granted without fee,
; provided that the above copyright notice appear in all copies and
; that both that copyright notice and this permission notice appear
; in supporting documentation.  Author makes no representations about
; the suitability of this software for any purpose. It is provided
; "as is" without express or implied warranty.

bits 32

segment .text
start:
   enter 0, 0
   ; load arguments into registers
    mov ebx, [ebp+16]    ; CRC-table
    mov ecx, [ebp+12]    ; string length
   mov esi, [ebp+08]    ; string
   ; initialize
   mov eax, 0xFFFFFFFF
   xor edx, edx
calcbyte:
   ; process a single byte:
   ; crc = table[(unsigned char)crc ^ byte] ^ (crc >> 8)
   mov dl, al
   xor dl, [esi]
   shr eax, 8
   xor eax, [ebx+edx*4]
   inc esi
   loop calcbyte
   ; clean up and return
   leave
   ret 16
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Wed 2024-4-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2002-01-13 00:53:26