Leaked source code of windows server 2003
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.

166 lines
4.5 KiB

  1. title "Move Test"
  2. ;++
  3. ;
  4. ; Copyright (c) 2001 Microsoft Corporation
  5. ;
  6. ; Module Name:
  7. ;
  8. ; move.asm
  9. ;
  10. ; Abstract:
  11. ;
  12. ; This module implements code to test x86 move instruction timing.
  13. ;
  14. ; Author:
  15. ;
  16. ; Mark Lucovsky (markl) 28-Sep-1990
  17. ;
  18. ; Revision History:
  19. ;
  20. ;--
  21. .386p
  22. .xlist
  23. include ks386.inc
  24. include callconv.inc
  25. .list
  26. _TEXT SEGMENT DWORD PUBLIC 'CODE'
  27. ASSUME DS:FLAT, ES:FLAT, SS:NOTHING, FS:NOTHING, GS:NOTHING
  28. subttl "Move To register"
  29. ;++
  30. ;
  31. ; VOID
  32. ; FASTCALL
  33. ; RegToMem (
  34. ; IN ULONG Count,
  35. ; IN PULONG Address
  36. ; )
  37. ;
  38. ; Routine Description:
  39. ;
  40. ; This function performs a move dword to register in a loop such that the
  41. ; loop overhead is negligible.
  42. ;
  43. ; Arguments:
  44. ;
  45. ; Count (ecx) - Supplies the iteration count.
  46. ;
  47. ; Address (edx) - Supplies the source address.
  48. ;
  49. ; Return Value:
  50. ;
  51. ; None.
  52. ;
  53. ;--
  54. cPublicFastCall RegToMem, 2
  55. RTM10: mov [edx], eax ; repeat move 32 times in a loop
  56. mov [edx], eax ;
  57. mov [edx], eax ;
  58. mov [edx], eax ;
  59. mov [edx], eax ;
  60. mov [edx], eax ;
  61. mov [edx], eax ;
  62. mov [edx], eax ;
  63. mov [edx], eax ;
  64. mov [edx], eax ;
  65. mov [edx], eax ;
  66. mov [edx], eax ;
  67. mov [edx], eax ;
  68. mov [edx], eax ;
  69. mov [edx], eax ;
  70. mov [edx], eax ;
  71. mov [edx], eax ;
  72. mov [edx], eax ;
  73. mov [edx], eax ;
  74. mov [edx], eax ;
  75. mov [edx], eax ;
  76. mov [edx], eax ;
  77. mov [edx], eax ;
  78. mov [edx], eax ;
  79. mov [edx], eax ;
  80. mov [edx], eax ;
  81. mov [edx], eax ;
  82. mov [edx], eax ;
  83. mov [edx], eax ;
  84. mov [edx], eax ;
  85. mov [edx], eax ;
  86. mov [edx], eax ;
  87. dec ecx ;
  88. jnz RTM10 ;
  89. fstRET RegToMem
  90. fstENDP RegToMem
  91. subttl "Move To register"
  92. ;++
  93. ;
  94. ; VOID
  95. ; FASTCALL
  96. ; MemToReg (
  97. ; IN ULONG Count,
  98. ; IN PULONG Address
  99. ; )
  100. ;
  101. ; Routine Description:
  102. ;
  103. ; This function performs a move dword to register in a loop such that the
  104. ; loop overhead is negligible.
  105. ;
  106. ; Arguments:
  107. ;
  108. ; Count (ecx) - Supplies the iteration count.
  109. ;
  110. ; Address (edx) - Supplies the source address.
  111. ;
  112. ; Return Value:
  113. ;
  114. ; None.
  115. ;
  116. ;--
  117. cPublicFastCall MemToReg, 2
  118. MTR10: mov eax, [edx] ; repeat move 32 times in a loop
  119. mov eax, [edx] ;
  120. mov eax, [edx] ;
  121. mov eax, [edx] ;
  122. mov eax, [edx] ;
  123. mov eax, [edx] ;
  124. mov eax, [edx] ;
  125. mov eax, [edx] ;
  126. mov eax, [edx] ;
  127. mov eax, [edx] ;
  128. mov eax, [edx] ;
  129. mov eax, [edx] ;
  130. mov eax, [edx] ;
  131. mov eax, [edx] ;
  132. mov eax, [edx] ;
  133. mov eax, [edx] ;
  134. mov eax, [edx] ;
  135. mov eax, [edx] ;
  136. mov eax, [edx] ;
  137. mov eax, [edx] ;
  138. mov eax, [edx] ;
  139. mov eax, [edx] ;
  140. mov eax, [edx] ;
  141. mov eax, [edx] ;
  142. mov eax, [edx] ;
  143. mov eax, [edx] ;
  144. mov eax, [edx] ;
  145. mov eax, [edx] ;
  146. mov eax, [edx] ;
  147. mov eax, [edx] ;
  148. mov eax, [edx] ;
  149. mov eax, [edx] ;
  150. dec ecx ;
  151. jnz MTR10 ;
  152. fstRET MemToReg
  153. fstENDP MemToReg
  154. _TEXT ends
  155. end