判断com1是否收到数据:
var
flag:byte;
begin
asm
mov flag,00h
mov dx,3fdh
in al,dx
and al,01h
cmp al,01h
jne @com_in1
mov flag,01h
@com_in1:
end;
end;
可用以上语句判断1000次,若flag不为1 则证明接收超时
收数据:
var
k:byte;
begin
asm
mov dx,3f8h
in al,dx
mov k,al
end;
end;
若为com2,所用地址为2fdh,2f8h