program looplicht; uses wincrt;
const
	LPT1D=$3bc;
	LPT1S=LPT1D+1;
	vertraging=5000000;
type
	patroon = array [1..8] of byte;
	patronen = array [0..3] of patroon;
var
	p: patronen;
	teller: integer;
	wacht: longint;
	pat: byte;
begin
	p[0,1]:=$aa; p[0,2]:=$33; p[0,3]:=$55; p[0,4]:=$cc;
	p[0,5]:=$99; p[0,6]:=$cc; p[0,7]:=$66; p[0,8]:=$33;
	p[1,1]:=$81; p[1,2]:=$81; p[1,3]:=$42; p[1,4]:=$24;
	p[1,5]:=$18; p[1,6]:=$18; p[1,7]:=$24; p[1,8]:=$42;
	p[2,1]:=$10; p[2,2]:=$20; p[2,3]:=$40; p[2,4]:=$80;
	p[2,5]:=$01; p[2,6]:=$02; p[2,7]:=$04; p[2,8]:=$08;
	p[3,1]:=$80; p[3,2]:=$40; p[3,3]:=$20; p[3,4]:=$10;
	p[3,5]:=$08; p[3,6]:=$04; p[3,7]:=$02; p[3,8]:=$01;
	teller:=1;
	while port[LPT1S] and $20 = $20 do
	begin
		pat:=port[LPT1S] and $18;
		pat:=pat shr 3;
		port[LPT1D]:=p[pat,teller];
		wacht:=vertraging;
		repeat
			wacht:=wacht-1
		until wacht=0;
		teller:=teller+1;
		if teller>8
		then
			teller:=1
	end
end.
