Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

99 lines
1.7 KiB

  1. ?PLM=1 ; PASCAL Calling convention is DEFAULT
  2. ?WIN=0 ; Windows calling convention
  3. PMODE=1
  4. .xlist
  5. include cmacros.inc
  6. include windows.inc
  7. .list
  8. externA __WinFlags ; in KERNEL
  9. externA __AHINCR ; in KERNEL
  10. externA __AHSHIFT ; in KERNEL
  11. ; The following structure should be used to access high and low
  12. ; words of a DWORD. This means that "word ptr foo[2]" -> "foo.hi".
  13. LONG struc
  14. lo dw ?
  15. hi dw ?
  16. LONG ends
  17. FARPOINTER struc
  18. off dw ?
  19. sel dw ?
  20. FARPOINTER ends
  21. ; -------------------------------------------------------
  22. ; DATA SEGMENT DECLARATIONS
  23. ; -------------------------------------------------------
  24. ifndef SEGNAME
  25. SEGNAME equ <_TEXT>
  26. endif
  27. createSeg %SEGNAME, CodeSeg, word, public, CODE
  28. sBegin Data
  29. sEnd Data
  30. sBegin CodeSeg
  31. assumes cs,CodeSeg
  32. assumes ds,DATA
  33. ;---------------------------Public-Routine------------------------------;
  34. ; MemCopy
  35. ;
  36. ; copy memory
  37. ;
  38. ; Entry:
  39. ; lpSrc HPSTR to copy from
  40. ; lpDst HPSTR to copy to
  41. ; cbMem DWORD count of bytes to move
  42. ;
  43. ; Returns:
  44. ; destination pointer
  45. ; Error Returns:
  46. ; None
  47. ; Registers Preserved:
  48. ; BP,DS,SI,DI
  49. ; Registers Destroyed:
  50. ; AX,BX,CX,DX,FLAGS
  51. ; Calls:
  52. ; nothing
  53. ;-----------------------------------------------------------------------;
  54. cProc MemCopy,<NEAR,PASCAL,PUBLIC>,<ds>
  55. ParmD lpDst
  56. ParmD lpSrc
  57. ParmD cbMem
  58. cBegin
  59. .386
  60. push edi
  61. push esi
  62. cld
  63. mov ecx,cbMem
  64. jecxz mc386_exit
  65. movzx edi,di
  66. movzx esi,si
  67. lds si,lpSrc
  68. les di,lpDst
  69. mov ebx,ecx
  70. shr ecx,2 ; get count in DWORDs
  71. rep movs dword ptr es:[edi], dword ptr ds:[esi]
  72. mov ecx,ebx
  73. and ecx,3
  74. rep movs byte ptr es:[edi], byte ptr ds:[esi]
  75. mc386_exit:
  76. cld
  77. pop esi
  78. pop edi
  79. .286
  80. cEnd
  81. sEnd CodeSeg
  82. end