home *** CD-ROM | disk | FTP | other *** search
/ FreeWare Collection 2 / FreeSoftwareCollection2pd199x-jp.img / ms_dos / ish / ish200s / crc32.asm < prev    next >
Assembly Source File  |  1990-06-14  |  902b  |  46 lines

  1. ;
  2. ;        ish file converter for MS-DOS  Ver 2.00 (90/3/27)
  3. ;
  4. ;
  5. ;        Copyright (c) 1986, 1987, 1989, 1990  by  M. ishizuka
  6. ;        All rights reserved.
  7. ;
  8.  
  9.  
  10.  
  11. ;-----------------------------------------------;
  12. ;                        ;
  13. ;    calc_crc_of_file            ;
  14. ;                        ;
  15. ;    INPUT :    ax (lenght of file (low))    ;
  16. ;        dx (length of file (high))    ;
  17. ;        bx (file handler)        ;
  18. ;    OUTPUT:    CY (error)            ;
  19. ;        ax (crc32 (low))        ;
  20. ;        dx (crc32 (high))        ;
  21. ;        bp (crc16)            ;
  22. ;    ERROR :    NON                ;
  23. ;    BREAK :    flags, cx, si, bp        ;
  24. ;                        ;
  25. ;-----------------------------------------------;
  26.  
  27. calc_crc_of_file:
  28.         mov    word ptr length_of_file_high, dx
  29.         mov    word ptr length_of_file_low, ax
  30.         @@display    msg_crc_checking
  31.         mov    ax, 0ffffh
  32.         mov    dx, ax
  33.         mov    bp, ax
  34.         @@calc_crc_of_file_sub    @@crc16_32_sub
  35.         pushf
  36.         push    ax
  37.         push    dx
  38.         @@display    msg_crc_checking_clr
  39.         pop    dx
  40.         pop    ax
  41.         popf
  42.         not    ax
  43.         not    dx
  44.         not    bp
  45.         ret
  46.