exif.asm
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:5k
源码类别:

操作系统开发

开发平台:

Visual C++

  1. page 49,132
  2. TITLE exif - executors for IF and ELSE, DO/LOOP, and WHILE/WEND varients
  3. ;***
  4. ;exif - executors for IF and ELSE, DO/LOOP, and WHILE/WEND varients
  5. ;
  6. ; Copyright <C> 1986, Microsoft Corporation
  7. ;
  8. ;Purpose:
  9. ; Executors for IF and ELSE varients.
  10. ; Also contains Executors for WHILE/WEND, and DO/LOOP varients
  11. ;
  12. ;****************************************************************************
  13. .xlist
  14. include version.inc
  15. IncludeOnce executor
  16. IncludeOnce exint
  17. IncludeOnce opcontrl
  18. .list
  19. assumes cs, CODE
  20. assumes es, NOTHING
  21. assumes ss, DATA
  22. sBegin CODE
  23. EXTRN SetProgramMode:NEAR
  24. subttl IF
  25. page
  26. ;exStIfR8
  27. ;Purpose:
  28. ; These handle the case of
  29. ;    IF a!
  30. ; and
  31. ;    IF a#
  32. ;
  33. MakeExe exStR8While,opStWhile
  34. SkipExHeader
  35. MakeExe exStLoopR8Until,opStLoopUntil
  36. SkipExHeader
  37. MakeExe exStDoR8While,opStDoWhile
  38. SkipExHeader
  39. MakeExe exStElseIfR8,opStElseIf
  40. SkipExHeader
  41. MakeExe exStIfR8,opStIf
  42. SkipExHeader ;Fall through 
  43. MakeExe exStIfBlockR8,opStIfBlock
  44. ;Re-written with [4]
  45. fldz ;Put zero on stack
  46. fcompp ;Compare with zero and remove operands
  47. fstsw [Stat] ;Save result of comparison
  48. fwait
  49. mov ax,[Stat]
  50. sahf
  51. jz IfFalse
  52. jmp short IfTrue
  53. ;End of [4]
  54. MakeExe exStI4While,opStWhile
  55. SkipExHeader
  56. MakeExe exStLoopI4Until,opStLoopUntil
  57. SkipExHeader
  58. MakeExe exStDoI4While,opStDoWhile
  59. SkipExHeader
  60. MakeExe exStElseIfI4,opStElseIf
  61. SkipExHeader
  62. MakeExe exStIfI4,opStIf
  63. SkipExHeader
  64. MakeExe exStIfBlockI4,opStIfBlock
  65. pop ax
  66. pop dx
  67. AxDxZtest:
  68. or ax,dx ;PSW.Z set = FALSE
  69. jnz IfTrue ;TRUE
  70. IfFalse:
  71. mov si,PTRTX[si] ;Take the false branch
  72. DispMac
  73. MakeExe exStI2While,opStWhile
  74. SkipExHeader
  75. MakeExe exStLoopI2Until,opStLoopUntil
  76. SkipExHeader
  77. MakeExe exStDoI2While,opStDoWhile
  78. SkipExHeader
  79. MakeExe exStElseIfI2,opStElseIf
  80. SkipExHeader
  81. MakeExe exStIfBlockI2,opStIfBlock
  82. SkipExHeader
  83. MakeExe exStIfI2,opStIf
  84. pop cx ;I2 TRUE or FALSE
  85. jcxz IfFalse ;FALSE
  86. IfTrue:
  87. IfLabFalse:
  88. add si,2 ;Skip operand
  89. DispMac
  90. MakeExe exStDoI2Until,opStDoUntil
  91. SkipExHeader
  92. MakeExe exStLoopI2While,opStLoopWhile
  93. SkipExHeader
  94. MakeExe exStIfGotoLabI2,opStIfGotoLab
  95. SkipExHeader ;Fall into next executor
  96. MakeExe exStIfLabI2,opStIfLab
  97. pop cx
  98. jcxz IfLabFalse ;False case - fall through label
  99. IfLabTrue:
  100. mov si,PTRTX[si] ;TRUE - branch to label
  101. DispMac
  102. subttl IfLabDirect
  103. page
  104. ;IfLabDirect
  105. ;Purpose:
  106. ; Handle the case that there is an IfLab in a direct mode statment.
  107. ; This is kept separate from program mode IfLab as it is speed critical.
  108. ;
  109. MakeExe exStIfLabDirectI2,opStIfLabDirect
  110. xor dx,dx
  111. IfLabDirectCom:
  112. pop ax
  113. IfLabDirectIntCom:
  114. or ax,dx
  115. IfLabDirectFlag:
  116. jz IfLabFalse
  117. IfLabDirectTrue:
  118. mov si,PTRTX[si] ;Load start offset
  119. call SetProgramMode
  120. DispMac
  121. MakeExe exStIfLabDirectR8,opStIfLabDirect
  122. ;Re-written with [4]
  123. fldz ;Put zero on stack
  124. fcompp ;Compare with zero and remove operands
  125. fstsw [Stat] ;Save result of comparison
  126. fwait
  127. mov ax,[Stat]
  128. sahf
  129. jmp IfLabDirectFlag
  130. ;End of [4]
  131. MakeExe exStIfLabDirectI4,opStIfLabDirect
  132. pop dx
  133. jmp short IfLabDirectCom
  134. subttl IfLab
  135. page
  136. MakeExe exStDoI4Until,opStDoUntil
  137. SkipExHeader
  138. MakeExe exStLoopI4While,opStLoopWhile
  139. SkipExHeader
  140. MakeExe exStIfGotoLabI4,opStIfGotoLab
  141. SkipExHeader ;Fall into next executor
  142. MakeExe exStIfLabI4,opStIfLab
  143. pop dx
  144. IfLabFalseOrTrue:
  145. pop ax
  146. or ax,dx
  147. IfLabFlag:
  148. jz IfLabFalse ;FALSE - fall through label
  149. jmp short IfLabTrue ;TRUE - branch to label
  150. MakeExe exStDoR8Until,opStDoUntil
  151. SkipExHeader
  152. MakeExe exStLoopR8While,opStLoopWhile
  153. SkipExHeader
  154. MakeExe exStIfGotoLabR8,opStIfGotoLab
  155. SkipExHeader ;Fall into next executor
  156. MakeExe exStIfLabR8,opStIfLab
  157. ;Re-written with [4]
  158. fldz ;Put zero on stack
  159. fcompp ;Compare with zero and remove operands
  160. fstsw [Stat] ;Save result of comparison
  161. fwait
  162. mov ax,[Stat]
  163. sahf
  164. jmp IfLabFlag
  165. ;End of [4]
  166. subttl Else
  167. page
  168. MakeExe exStElseLabDirect,opStElseLabDirect
  169. mov si,PTRTX[si] ;Load start offset
  170. call SetProgramMode ;Set up for execution
  171. SkipExHeader ;Fall into next executor
  172. MakeExe exStDo,opStDo
  173. SkipExHeader
  174. MakeExe exStEndIfBlock,opStEndIfBlock
  175. SkipExHeader ;Fall into next executor
  176. MakeExe exStElseNop,opStElseNop
  177. DispMac ;Speed critical NOP for ElseNop
  178. MakeExe exStWend,opStWend
  179. SkipExHeader
  180. MakeExe exStLoop,opStLoop
  181. SkipExHeader
  182. MakeExe exStElseLab,opStElseLab
  183. SkipExHeader ;Fall into next executor
  184. MakeExe exStElse,opStElse
  185. mov si,PTRTX[si] ;Perform the branch
  186. DispMac ; and on with the show
  187. sEnd CODE
  188. end