home *** CD-ROM | disk | FTP | other *** search
/ Large Pack of OldSkool DOS MOD Trackers / cdfm.zip / COPYMEM.RT < prev    next >
Text File  |  1993-03-02  |  646b  |  29 lines

  1. public  _copymem
  2. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  3. ; Copy a block of memory to another (possibly overlapping) location
  4. ; In:
  5. ;   ECX - length of block
  6. ;   ESI -> source
  7. ;   EDI -> destination
  8. ; Out:
  9. ;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  10. _copymem:
  11.         push ecx
  12.         push esi
  13.         push edi
  14.         cmp esi,edi
  15.         jae short copymemf0
  16.         add esi,ecx
  17.         add edi,ecx
  18.         dec esi
  19.         dec edi
  20.         std
  21. copymemf0:
  22.         rep movsb
  23.         cld
  24.         pop edi
  25.         pop esi
  26.         pop ecx
  27.         ret
  28.  
  29.