// Programm für direkte I/O-Zugriffe auf Hardware unter Windows 95/98
// Geschrieben für PCI16/16 DIO-Karte
// Copyright by KOLTER ELECTRONIC 1998, 1999

// #include <windows.h>         // required for all Windows applications
// #include <stdio.h>
// #include <time.h>        
// #include <winuser.h>         

#include <iostream.h>           
#include <stdio.h>             
#include <conio.h>              

int A,B;
unsigned short adr;

main()
{
do {
// I/O-Port BASIS-Adresse wird abgeholt
adr=ret=PciGetIO(0x0010);

// Hardware_Port Eingabe lesen
    A = _inp (adr+4);
    B = _inp (adr+5);
    cout << "Input Port A = " << A; cout << "\n"; 
    cout << "Input Port B = " << B; cout << "\n";

// Hardware_Port Ausgabe schreiben
// _outp(adr+0,A);   _outp... syntax  ist hier zwingend bei C++ 6.0
    
    _outp (adr+0,A);
    _outp (adr+1,B);
	
	} while (!_kbhit()); // wiederholen, bis Taste gedrückt      
 
 return 0;
}

