-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsio.asm
More file actions
299 lines (239 loc) · 6.42 KB
/
Copy pathsio.asm
File metadata and controls
299 lines (239 loc) · 6.42 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
.model small
.586
public display_SIO
extrn asstohex:far,clear_screen:far,space_8:far,space:far,first_screen:far,huiche:far,assc:far
.data
cont_0ch db 0
ACT db 0
cr30 db 0 ;control device status
crf0 db 0 ;clock rate
cr70 db 0 ;IRQ
off_set db 0
device_num db 0
register_num db 0
base_address_60 db 0 ;io base_address
base_address_61 db 0
base_address_62 db 0
base_address_63 db 0
;no_active db '--',0dh,0ah,'$'
active db 'active',0dh,0ah,'$'
mesg_sio_title db 'device ACT base_address IRQ clock rate',0ah,0dh,'$'
.code
.startup
display_SIO:
include MACRO_zifu.mac
;--------------------Enter the extended function mode
begain:
PUSHA
mov bh,0
mov dh,0
mov dl,0
mov ah,02h
int 10h
POPA ;START POINT
;set device_num
mov device_num,0
mov cont_0ch,0ch
call clear_screen
msg mesg_sio_title
;--------------------------------INIT
cheak_active_again:
call enter_exten_func ;write 87 to 2eh twice
;--------------------Configuration logical device No. Configuration register CR..
mov dx,2eh
mov al,07h
out dx,al ;point to Logical Device Number Reg
;--------------------
mov dx,2fh
mov al,device_num ;03h no active
out dx,al ;select Logical Device
;-----------------------------------------------------------
;--------------------------------- ;read data all
mov off_set,30h
call read_offset ;active status
mov cr30,al
;--------------------------------
mov off_set,63h
call read_offset
mov base_address_63,al
;-------------------------------
mov off_set,62h
call read_offset
mov base_address_62,al
;------------------------------- ;IO BASE ADDRESS
mov off_set,61h
call read_offset
mov base_address_61,al
;-------------------------------
mov off_set,60h
call read_offset
mov base_address_60,al
;--------------------------------
MOV off_set,70h ; IRQ
call read_offset
mov cr70,al
;--------------------------------
mov off_set,0f0h ; CLOCK RATE
call read_offset
mov crf0,al
;---------------------------------
;--------------------------- Cheack active
mov al,cr30
cmp al,0ffh
jz cheak_device_active ;if (al == 0ff) cheak_device_active (if all data 0ffh no_active else active )
test al,01h ;else test bit0 1:active 0:no active
jnz display_resouce ;if active,show resouce else next device
jmp device_no_active
cheak_device_active:
cmp_63h:
cmp base_address_63,0ffh
jz cmp_62h
jmp display_resouce
cmp_62h:
cmp base_address_62,0ffh
jz cmp_61h
jmp display_resouce
cmp_61h:
cmp base_address_61,0ffh
jz cmp_60h
jmp display_resouce
cmp_60h:
cmp base_address_60,0ffh
jz cmp_CR70
jmp display_resouce
cmp_CR70:
mov al,cr70
cmp al,0ffh
jz cmp_crf0
jmp display_resouce
;---------------------------
cmp_crf0:
mov al,crf0
cmp al,0ffh
jz device_no_active ;if cr70,crf0,cr60_63 all 0ff no_active
jmp display_resouce ;else display resouce
;-----------------------------------
device_no_active:
mov al,device_num
call assc
call space_8
mov al,cr30
call assc
call huiche
;msg no_active
jmp stop_check
display_resouce:
mov al,device_num
call assc
call space_8
mov al,cr30
call assc
;msg active
call space
call space
call space
mov al,base_address_60
call space
call space
call assc
mov al,base_address_61
call assc
call space
;-----------------
mov al,base_address_62
call assc
mov al,base_address_63
call assc
call space_8
call space
call space
call space
mov al,cr70
call assc
call space_8
mov al,crf0
call assc
call huiche
stop_check:
call exit_exten_func
inc device_num
dec cont_0ch
cmp cont_0ch,0
jnz cheak_active_again
NO_INPUT_ISA:
;**********************************************
mov ah,0
int 16h ;
cmp ah,01h
JZ first_screen
cmp al,'1'
jz change_active
JMP NO_INPUT_ISA
;------------------------------
change_active:
mov cx,3
mov device_num,01h
cheak_active1_3:
call enter_exten_func
;--------------------Configuration logical device No. Configuration register CR..
mov dx,2eh
mov al,07h
out dx,al ;point to Logical Device Number Reg
;--------------------
mov dx,2fh
mov al,device_num
out dx,al ;select Logical Device
;-----------------------------------------------------------
;---------------------------------
;read data all
call out_offset
inc device_num
call exit_exten_func
loop cheak_active1_3
jmp begain
;------------------------------
.exit
read_offset proc
push dx
mov dx,2eh
mov al,off_set ;select CR_ cheak_active
out dx,al
mov dx,2fh
in al,dx
pop dx ;
ret
read_offset endp
out_offset proc
push dx
mov dx,2eh
mov al,30h ;select CR_30 cheak_active
out dx,al
mov dx,2fh
in al,dx
xor al,01h ;change bit0 status control active or not active
out dx,al
pop dx ;
ret
out_offset endp
enter_exten_func proc far public
push ax
push dx
mov dx,2eh
mov al,87h
out dx,al
out dx,al
pop dx
pop ax
ret
enter_exten_func endp
exit_exten_func proc far public
push ax
push dx
mov dx,2eh
mov al,0aah
out dx,al
pop dx
pop ax
ret
exit_exten_func endp
end