program portaparalela;
uses wincrt, windos;
var a: byte;
procedure escreve(porta,valor:word);
Assembler;
asm
mov dx, porta
mov ax, valor
out dx, ax
end;
function leitura(porta:word):byte;
var valor: word;
begin
asm
mov dx, porta
in ax, dx
mov valor, ax
end;
leitura := valor;
end;
begin
repeat
clrscr;
writeln((leitura($379)and 8)/8:0:0);
if leitura($379)and 8 = 8 then
write('Led aceso!')
else write ('Led apagado!');
readln;
until keypressed;
end.