home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / WNWATTCP.ZIP / ELIB / QCMP.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-09-20  |  1.2 KB  |  66 lines

  1. PAGE    66,132
  2. ;
  3. ;
  4. ;
  5. ;
  6. ;
  7. ;
  8. ;
  9. ;
  10. ;  qcmp.asm
  11. ;
  12. ;  Efficient compare operation.  Does not handle segment wraps!!!!
  13. ;  Returns 0 if compare is identical
  14. ;
  15. ;
  16. ;  Usage :
  17. ;           qcmp( soff, sseg, doff, dseg, count )
  18. ;        unsigned int soff;        /* source offset */
  19. ;        unsigned int sseg;        /* source segment */
  20. ;        unsigned int doff;        /* destination offset */
  21. ;        unsigned int dseg;        /* destination segment */
  22. ;        unsigned int count;        /* byte count */
  23. ;
  24. ;  (c) 1991 University of Waterloo,
  25. ;           Faculty of Engineering,
  26. ;           Engineering Microcomputer Network Development Office
  27. ;
  28. ;  version
  29. ;
  30. ;    0.0    31-Oct-1990   E. P. Engelke  - brief version
  31. ;
  32. ;
  33.     include masmdefs.hsm
  34.     include    model.hsm
  35.  
  36. codedef QCMP
  37. datadef
  38.  
  39. cstart  QCMP
  40. cpublic qcmp
  41.     push    SI
  42.     push    DI
  43.         mov     DX, DS
  44.         mov     AX, ES                   ;save segment registers
  45.  
  46.         lds     SI, +@AB+0[BP]
  47.         les     DI, +@AB+4[BP]
  48.         mov     CX, +@AB+8[BP]          ;byte count
  49.  
  50.         cld
  51.         repe    cmpsb
  52.  
  53.     mov    ES, AX
  54.         mov     DS, DX
  55.     pop    DI
  56.     pop    SI
  57.  
  58.         mov     AX, CX
  59. creturn qcmp
  60.  
  61. cend    QCMP
  62.  
  63.         end
  64.  
  65.  
  66.