{ ********************************************************************** ** Program: S1DEB4.PAS Version: 1.1 - 28 Jenuary 1999 ** ** Firm: GRIFO(r) Via Dell'Artigiano 8/6 ** ** 40016 San Giorgio di Piano (BO) ** ** Tel. 051-892052 FAX 051-893661 ** ** Developed by: Tassinari Enea ** ********************************************************************** This program allows to display on the A port the dip switch status if any. In order to make an easier visualization of the status lines, it is necessary to get a 20 pins flat cable for connecting GPC(r)15R CN9 connector to TIO 16 CN1 connector, or DEB-01 CN15 connector. } program S1DEB4; {$C-} { Ctrl+C = OFF} const CNT=$17; { control and command register of the PPI 82C55 } PDA=$14; { data register of the A port } PDB=$15; { data register of the B port (dip switch) } var STATO:byte; RIS:integer; TASTO:char; procedure INIZIALIZZAZIONE; { Initialization of the control register of the 82C55 } begin port[CNT]:=139; end; function LETTURA (INDIRIZZO:integer):byte; { read the dip switch status } begin LETTURA:=port[INDIRIZZO]; end; procedure SCRITTURA (STATO:byte); { write on the A port, the B port status } begin port[PDA]:=STATO; end; begin {program main } clrscr; INIZIALIZZAZIONE; gotoxy(10,3); writeln('VISUALIZATION ON A PORT, THE DIP SWITCH STATUS IN PROGRESS'); gotoxy(25,4); write('Press any key for exit'); repeat begin RIS:=LETTURA(PDB); SCRITTURA(RIS); end; until keypressed; SCRITTURA(255); { Led off in the end time } read(kbd,TASTO); end.