home *** CD-ROM | disk | FTP | other *** search
/ Black Art of 3D Game Programming / Black_Art_of_3D_Game_Programming.iso / source / borland / chap_17 / qcpy.asm < prev    next >
Encoding:
Assembly Source File  |  1995-05-25  |  857 b   |  49 lines

  1.  
  2. ; this function performs a memory copy from source to destination using 32
  3. ; bit moves
  4.  
  5. .MODEL MEDIUM                   ; use medium memory model C function names
  6.  
  7. .CODE                           ; begin the code segment
  8.  
  9. .386
  10.  
  11. PUBLIC _fquadcpy                 ; export function name to linker
  12.  
  13. _fquadcpy PROC
  14.  
  15. ARG dest:DWORD, source:DWORD, count:DWORD
  16.  
  17. push bp             ; create stack frame
  18. mov bp,sp
  19.  
  20. push di             ; save a few registers
  21. push si
  22. push ds
  23.  
  24.  
  25. cld             ; clear the direction of movement
  26.  
  27. lds si, source  ; point ds:si at source
  28. les di, dest    ; point es:di at destination
  29.  
  30. mov ecx,count   ; move into ecx number of words
  31. rep movsd       ; move the data
  32.  
  33. pop ds          ; restore the registers
  34. pop si
  35. pop di
  36.  
  37. pop bp          ; restore the stack
  38.  
  39. ret
  40.  
  41. _fquadcpy ENDP
  42.  
  43. END
  44.  
  45.  
  46.  
  47.  
  48.  
  49.