L
lik765
Unregistered / Unconfirmed
GUEST, unregistred user!
在Win2000下用delphi嵌入汇编语言进行I/O操作,运行时出错,此程序在WIN98下运行正常,代码如下:
addr:=$300;
function AD(pot:byte):word;
var ddh:byte;
begin
asm
mov dx,addr
mov al,pot
out dx,al
mov dx,addr+1
mov al,0
out dx,al
end;
repeat
asm
mov dx,addr+3
in al,dx
mov ddh,al
end;
until (ddh and $80)=$0;
asm
mov dx,addr+2
in ax,dx
and ax,0fffh
mov result,ax
end;
end;
addr:=$300;
function AD(pot:byte):word;
var ddh:byte;
begin
asm
mov dx,addr
mov al,pot
out dx,al
mov dx,addr+1
mov al,0
out dx,al
end;
repeat
asm
mov dx,addr+3
in al,dx
mov ddh,al
end;
until (ddh and $80)=$0;
asm
mov dx,addr+2
in ax,dx
and ax,0fffh
mov result,ax
end;
end;