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

操作系统开发

开发平台:

Visual C++

  1. ; BIOS Interface Macros - Version 1.0 - for Microsoft Macro Assembler 5.0
  2. ; (C) Copyright Microsoft Corporation, 1987.
  3. .XCREF
  4. .XLIST
  5. IF1
  6. ; 0Fh
  7. @GetMode MACRO
  8. mov ah,0Fh
  9. int 10h
  10. ENDM
  11. ; 00h
  12. @SetMode MACRO mode
  13. mov al,mode
  14. xor ah,ah
  15. int 10h
  16. ENDM
  17. ; 0Bh
  18. @SetColor MACRO color
  19. sub bh,bh
  20. mov bl,color
  21. mov ah,0Bh
  22. int 10h
  23. ENDM
  24. ; 0Bh
  25. @SetPalet MACRO color
  26. mov bh,1
  27. mov bl,color
  28. mov ah,0Bh
  29. int 10h
  30. ENDM
  31. ; 05h
  32. @SetPage MACRO page
  33. mov al,page
  34. mov ah,05h
  35. int 10h
  36. ENDM
  37. ; 03h
  38. @GetCur MACRO page
  39. IFNB <page>
  40. mov bh,page
  41. ELSE
  42. xor bh,bh
  43. ENDIF
  44. mov ah,03h
  45. int 10h
  46. ENDM
  47. ; 02h
  48. @SetCurPos MACRO column,row,page
  49. IFNB <column>
  50. mov dl,column
  51. ENDIF
  52. IFNB <row>
  53. mov dh,row
  54. ENDIF
  55. IFNB <page>
  56. mov bh,page
  57. ELSE
  58. xor bh,bh
  59. ENDIF
  60. mov ah,02h
  61. int 10h
  62. ENDM
  63. ; 01h
  64. @SetCurSz MACRO first,last
  65. mov ch,first
  66. mov cl,last
  67. mov ah,01h
  68. int 10h
  69. ENDM
  70. ; 08h
  71. @GetChAtr MACRO page
  72. IFNB <page>
  73. mov bh,page
  74. ELSE
  75. sub bh,bh
  76. ENDIF
  77. mov ah,08h
  78. int 10h
  79. ENDM
  80. ; 09h
  81. @PutChAtr MACRO char,atrib,page,repeat
  82. IFNB <char>
  83. mov al,char
  84. ENDIF
  85. IFNB <atrib>
  86. mov bl,atrib
  87. ENDIF
  88. IFNB <page>
  89. mov bh,page
  90. ELSE
  91. xor bh,bh
  92. ENDIF
  93. IFNB <repeat>
  94. mov cx,repeat
  95. ELSE
  96. mov cx,1
  97. ENDIF
  98. mov ah,09h
  99. int 10h
  100. ENDM
  101. ; 0Ah
  102. @PutCh MACRO char,atrib,page,repeat
  103. IFNB <char>
  104. mov al,char
  105. ENDIF
  106. IFNB <atrib>
  107. mov bl,atrib
  108. ENDIF
  109. IFNB <page>
  110. mov bh,page
  111. ELSE
  112. xor bh,bh
  113. ENDIF
  114. IFNB <repeat>
  115. mov cx,repeat
  116. ELSE
  117. mov cx,1
  118. ENDIF
  119. mov ah,0Ah
  120. int 10h
  121. ENDM
  122. ; 06h and 07h
  123. @Scroll MACRO distance,atrib,upcol,uprow,downcol,downrow
  124. IFDEF upcol
  125. mov cl,upcol
  126. ENDIF
  127. IFDEF uprow
  128. mov ch,uprow
  129. ENDIF
  130. IFDEF upcol
  131. mov dl,upcol
  132. ENDIF
  133. IFDEF updownrow
  134. mov dh,downrow
  135. ENDIF
  136. IFDEF atrib
  137. mov bh,atrib
  138. ELSE
  139. mov bh,07h
  140. ENDIF
  141. IF distance LE 0
  142. mov ax,0600h + (-(distance) AND 0FFh)
  143. ELSE
  144. mov ax,0700h + (distance AND 0FFh)
  145. ENDIF
  146. int 10h
  147. ENDM
  148. ; 08h, 06h, and 02h
  149. @Cls MACRO
  150. @GetChAtr
  151. mov bl,bh
  152. mov bh,ah
  153. sub cx,cx
  154. mov dx,184Fh
  155. mov ax,0600h
  156. int 10h
  157. mov bh,bl
  158. sub dx,dx
  159. mov ah,02h
  160. int 10h
  161. ENDM
  162. ENDIF
  163. .CREF
  164. .LIST