📄 querybio.asm
字号:
INCLUDE model.inc
INCLUDE fastlynx.inc
.CODE text
@FxQueryBios PROC USES CX SI ES
PUBLIC @FxQueryBios
;* void _far _fastcall FxQueryBios(struct FxBiosInfo _near *);
int 11H
mov al, ah
mov cl, 6
shr ah, cl ; Isolate # of printer ports in ah
shr al, 1
and al, 7 ; Isolate # of serial ports in AL
cmp al, 4
jbe save_counts
mov al, 4
save_counts: mov dx, ax ; DH = # serial ports, DL = # printer
mov ax, 40H
mov es, ax
xor si, si
xor cx, cx
serial_loop: cmp cl, dl
jae setup_parallel
mov ax, es:[si]
or ax, ax
jz setup_parallel
mov [bx + si].FxBiosInfo.serial_address, ax
inc cl
add si, 2
jmp serial_loop
setup_parallel: xor si, si
parallel_loop: cmp ch, dh
jae store_nums
mov ax, es:[si + 8]
or ax, ax
jz store_nums
mov [bx + si].FxBiosInfo.parallel_address, ax
inc ch
add si, 2
jmp parallel_loop
store_nums: mov word ptr [bx].FxBiosInfo.num_serial, cx
ret
@FxQueryBios ENDP
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -