Program CardReader; Uses Crt,Binary; Const gameport=$201; Procedure Wait_start; Begin Repeat Until (Port[gameport] and 32)=0; End; Function data_readable:boolean; Begin data_readable:=((Port[gameport] and 32)=0); End; Procedure Wait_clock; Begin Repeat Until (Port[gameport] and 16)=0; End; Procedure Wait_clock_end; Begin Repeat Until (Port[gameport] and 16)=16; End; Function data_input:byte; Begin If (Port[gameport] and 64)=0 Then data_input:=0 Else data_input:=1; End; Function card_at_end:boolean; Begin card_at_end:=((Port[gameport] and 128)=0); End; Procedure test; Begin Wait_start; Repeat Writeln(ByteBin(Port[$201])); Until keypressed; End; Begin ClrScr; Wait_start; While data_readable Do Begin Wait_clock; Write(data_input); Wait_clock_end; End; Repeat Until KeyPressed; End.