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.

195 lines
3.5 KiB

  1. ;/*
  2. ;* INTEL CORPORATION PROPRIETARY INFORMATION
  3. ;*
  4. ;* This software is supplied under the terms of a license
  5. ;* agreement or nondisclosure agreement with Intel Corporation
  6. ;* and may not be copied or disclosed except in accordance with
  7. ;* the terms of that agreement.
  8. ;* Copyright (c) 1991,1992,1993,1994,1995,1996,1997 Intel Corporation.
  9. ;*
  10. ;*/
  11. .486P
  12. ;RDPMC
  13. rdpmc macro
  14. db 0Fh
  15. db 033h
  16. endm
  17. ;UD2
  18. ud2 macro
  19. db 0Fh
  20. db 0Bh
  21. endm
  22. ;FCOMI Compare Real and Set EFLAGS
  23. OPTION NOKEYWORD:<fcomi>
  24. fcomi macro dst:req, src:req
  25. local x, y
  26. IF (OPATTR(src)) AND 00010000y ; register
  27. freg = @SubStr(src,4,1)
  28. ELSE
  29. ERROR INVALID SOURCE REGISTER (src)
  30. ENDIF
  31. x:
  32. FADD dst, src
  33. org x
  34. db 0DBh
  35. db 0F0h + freg
  36. y:
  37. endm
  38. ;FCOMIP Compare Real and Set EFLAGS
  39. OPTION NOKEYWORD:<fcomip>
  40. fcomip macro dst:req, src:req
  41. local x, y
  42. IF (OPATTR(src)) AND 00010000y ; register
  43. freg = @SubStr(src,4,1)
  44. ELSE
  45. ERROR INVALID SOURCE REGISTER (src)
  46. ENDIF
  47. x:
  48. FADD dst, src
  49. org x
  50. db 0DFh
  51. db 0F0h + freg
  52. y:
  53. endm
  54. ;FUCOMI Compare Real and Set EFLAGS
  55. OPTION NOKEYWORD:<fucomi>
  56. fucomi macro dst:req, src:req
  57. local x, y
  58. IF (OPATTR(src)) AND 00010000y ; register
  59. freg = @SubStr(src,4,1)
  60. ELSE
  61. ERROR INVALID SOURCE REGISTER (src)
  62. ENDIF
  63. x:
  64. FADD dst, src
  65. org x
  66. db 0DBh
  67. db 0E8h + freg
  68. y:
  69. endm
  70. ;FUCOMIP Compare Real and Set EFLAGS
  71. OPTION NOKEYWORD:<fucomip>
  72. fucomip macro dst:req, src:req
  73. local x, y
  74. IF (OPATTR(src)) AND 00010000y ; register
  75. freg = @SubStr(src,4,1)
  76. ELSE
  77. ERROR INVALID SOURCE REGISTER (src)
  78. ENDIF
  79. x:
  80. FADD dst, src
  81. org x
  82. db 0DFh
  83. db 0E8h + freg
  84. y:
  85. endm
  86. ;FCMOVB FCMOVE FCMOVBE FCMOVU FCMOVNB FCMOVNE FCMOVNBE FCMOVNU
  87. ;These instructions are reserved by the assembler but complains if
  88. ;you try use them. Undefine them before we build the macros
  89. OPTION NOKEYWORD:<fcmovb fcmove fcmovbe fcmovu fcmovnb fcmovne fcmovnbe fcmovnu>
  90. Mfcmov macro dst:req, src:req, op1, op2
  91. local x, y
  92. IF (OPATTR(src)) AND 00010000y ; register
  93. freg = @SubStr(src,4,1)
  94. ELSE
  95. ERROR INVALID SOURCE REGISTER (src)
  96. ENDIF
  97. x:
  98. FADD dst, src
  99. org x
  100. db op1
  101. db op2 + freg
  102. y:
  103. endm
  104. ;Need to validate arguments
  105. MDfcmovd macro op1:req, op2:req, ex1:req
  106. fcmov&ex1 macro dst:req, src:req
  107. Mfcmov dst, src, op1, op2
  108. endm
  109. endm
  110. MDfcmovd 0DAh, 0C0h, b
  111. MDfcmovd 0DAh, 0C8h, e
  112. MDfcmovd 0DAh, 0D0h, be
  113. MDfcmovd 0DAh, 0D8h, u
  114. MDfcmovd 0DBh, 0C0h, nb
  115. MDfcmovd 0DBh, 0C8h, ne
  116. MDfcmovd 0DBh, 0D0h, nbe
  117. MDfcmovd 0DBh, 0D8h, nu
  118. ;CMOVxxx
  119. cmovop_ macro op:req, dst:req, src:req
  120. local x, y
  121. IF (OPATTR(dst)) AND 00010000y ; register
  122. x:
  123. bsf dst, src
  124. y:
  125. org x+1
  126. db op
  127. org y
  128. ELSE
  129. ERROR INVALID DESTINATION REGISTER (dst)
  130. ENDIF
  131. endm
  132. cmovdf_ macro code:req, ex1:req, ex2, ex3
  133. cmov&ex1 macro dst:req, src:req
  134. cmovop_ code, dst, src
  135. endm
  136. ifnb <ex2>
  137. cmov&ex2 macro dst:req, src:req
  138. cmovop_ code, dst, src
  139. endm
  140. endif
  141. ifnb <ex3>
  142. cmov&ex3 macro dst:req, src:req
  143. cmovop_ code, dst, src
  144. endm
  145. endif
  146. endm
  147. cmovdf_ 040h, o
  148. cmovdf_ 041h, no
  149. cmovdf_ 042h, b, nae, c
  150. cmovdf_ 043h, ae, nb, nc
  151. cmovdf_ 044h, e, z
  152. cmovdf_ 045h, ne, nz
  153. cmovdf_ 046h, be, na
  154. cmovdf_ 047h, a, nbe
  155. cmovdf_ 048h, s
  156. cmovdf_ 049h, ns
  157. cmovdf_ 04Ah, p, pe
  158. cmovdf_ 04Bh, np, po
  159. cmovdf_ 04Ch, l, nge
  160. cmovdf_ 04Dh, ge, nl
  161. cmovdf_ 04Eh, le, ng
  162. cmovdf_ 04Fh, g, nle