home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / wattcp.zip / QCMP.ASM < prev    next >
Assembly Source File  |  1991-05-22  |  1KB  |  62 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.         mov     DX, DS
  42.         mov     BX, ES                   ;save segment registers
  43.  
  44.         lds     SI, +@AB+0[BP]
  45.         les     DI, +@AB+4[BP]
  46.         mov     CX, +@AB+8[BP]          ;byte count
  47.  
  48.         cld
  49.         repe    cmpsb
  50.  
  51.         mov     AX, CX
  52.  
  53.         mov     ES, BX
  54.         mov     DS, DX
  55. creturn qcmp
  56.  
  57. cend    QCMP
  58.  
  59.         end
  60.  
  61.  
  62.