读bois的程序:
procedure TForm1.Button1Click(Sender: TObject);
var data:Smallint;temp:byte;
decode,passwd:array [0..9] of char;count,I:integer;
begin
count:=0;
asm
mov al,29
out $70,al
mov ah,al
mov al,28
out $70,al
in al,$71
mov data,ax
end;
while data>0 do
begin
if (data<$80) then
begin
passwd[count]:=char(data);
break;
end
else
begin
temp:=data and $3f;
if (temp <= $20) then
temp:=temp or $30;
passwd[count]:=char(temp);
count:=count+1;
data:=data-temp;
data:=data shr 2;
end;
end;
i:=0;
while (count>=0) do
begin
decode[i]:=passwd[count];
count:=count-1;
i:=i+1;
end;
showmessage('the CMOS passwd= '+decode);
end;