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