{* TTL Magcard Reader Copyright 1997 Patrick Gueulle *} {* converted from the PDF to PAS by Acidus on 4/2004 *} {* acidus yak.net http://www.yak.net/acidus *} program magcard; uses crt; var t: array[1..240] of byte; e,j,k: byte; procedure read; begin for k:=1 to 240 do begin repeat e:=port[513]; until e and 32 = 0; t[k]:=e; repeat until port[513] and 32 = 32; end; end; procedure build; begin for k:=1 to 240 do begin t[k]:=t[k] and 16; if t[k]=0 then t[k]:=1; if t[k]=16 then t[k]:=0; write(t[k]); end; writeln; end; procedure decode; begin j:=0; repeat j:=j+1; until keypressed or((t[j]=1)and(t[j+1]=1)and(t[j+2]=0)and(t[j+3]=1)and(t[j+4]=0)); repeat if (t[j]=1)and(t[j+1]=1)and(t[j+2]=0)and(t[j+3]=1)and(t[j+4]=0) then write(';'); if (t[j]=1)and(t[j+1]=0)and(t[j+2]=1)and(t[j+3]=1)and(t[j+4]=0) then write('='); if (t[j]=1)and(t[j+1]=1)and(t[j+2]=1)and(t[j+3]=1)and(t[j+4]=1) then write('?'); if (t[j]=0)and(t[j+1]=1)and(t[j+2]=0)and(t[j+3]=1)and(t[j+4]=1) then write(':'); if (t[j]=0)and(t[j+1]=0)and(t[j+2]=1)and(t[j+3]=1)and(t[j+4]=1) then write('<'); if (t[j]=0)and(t[j+1]=1)and(t[j+2]=1)and(t[j+3]=1)and(t[j+4]=0) then write('>'); if (t[j]=0)and(t[j+1]=0)and(t[j+2]=0)and(t[j+3]=0)and(t[j+4]=1) then write('0'); if (t[j]=1)and(t[j+1]=0)and(t[j+2]=0)and(t[j+3]=0)and(t[j+4]=0) then write('1'); if (t[j]=0)and(t[j+1]=1)and(t[j+2]=0)and(t[j+3]=0)and(t[j+4]=0) then write('2'); if (t[j]=1)and(t[j+1]=1)and(t[j+2]=0)and(t[j+3]=0)and(t[j+4]=1) then write('3'); if (t[j]=0)and(t[j+1]=0)and(t[j+2]=1)and(t[j+3]=0)and(t[j+4]=0) then write('4'); if (t[j]=1)and(t[j+1]=0)and(t[j+2]=1)and(t[j+3]=0)and(t[j+4]=1) then write('5'); if (t[j]=0)and(t[j+1]=1)and(t[j+2]=1)and(t[j+3]=0)and(t[j+4]=1) then write('6'); if (t[j]=1)and(t[j+1]=1)and(t[j+2]=1)and(t[j+3]=0)and(t[j+4]=0) then write('7'); if (t[j]=0)and(t[j+1]=0)and(t[j+2]=0)and(t[j+3]=1)and(t[j+4]=0) then write('8'); if (t[j]=1)and(t[j+1]=0)and(t[j+2]=0)and(t[j+3]=1)and(t[j+4]=1) then write('9'); j:=j+5; until keypressed or (j>235); end; begin clrscr; writeln('Please Swipe The Card'); read; build; decode; writeln; writeln; end.