"П.Нортон "Программно-аппаратная организация компьютера IBM PC"" - читать интересную книгу автора

i : integer;
begin
writeln;
for i := 1 to 8 do
write (' Port Val');
writeln;
end;

procedure header2;
var [static]
i : integer;
begin
writeln;
for i := 1 to 8 do
write (' Val Count');
writeln;
end;
procedure initialise;
begin
count := 0;
headc := 0;
for b := 0 to 255 do
c[b] := 0;

for w := 1 to 25 do
writeln;
writeln('Program for INSIDE THE IBM PERSONAL COMPUTER');
writeln('(C) Copyright Peter Norton, 1983');
writeln('Listing 3.3: PORTTEST - read all ports');
writeln;
writeln('The following may be active ports:');
header1;
end;
procedure scan_all_ports;
begin
for w:=0 to maxword do
begin
b:=inport(w);
c[b]:=c[b]+1;
if not(b in [wrd(0),78,110,188,202,203,207,254,255])
then
begin
write(w:6,b:4);
count:=count+1;
headc:=headc+1;
if headc>159 then
begin
headc:=0;
header1;
end;