home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / hamradio / wattcp.zip / QMOVE.ASM < prev    next >
Assembly Source File  |  1991-04-29  |  1KB  |  63 lines

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