From a german source:
http://www.bcb-box.de/Informationen/Port/port.html
For a port access under windows 2000 & XP you need a driver. There is a freeware driver : DriverLINX Port I/O Driver for Win95 and WinNT. It's an old one, but it's running without problems under windows 2000 and XP.
You can get the driver from : http://www.driverlinx.com/Software_Prod ... oducts.htm
Here is a code for the Borland C++ Builder 4.0 to work with the driver above.
***********************************************
* Who can translate this code into PureBasic? *
***********************************************
Code: Select all
1. First you have to declarate the function pointer:
typedef void( __stdcall *pOutPort)(DWORD m_addr, DWORD m_value );
2. Then load the dll:
HINSTANCE dllport = LoadLibrary( "dlportio.dll" );
if ( dllport == NULL )
{Application->MessageBox( "dlportio.dll not found.","DLL - error", MB_OK );
return; }
3. Now initialize the pointer :
pOutPort OutPort;
4. Calculate the funtion address:
OutPort = ( void(__stdcall *)(DWORD m_addr, DWORD m_value))
GetProcAddress( dllport, "DlPortWritePortUchar" );
5. Call function:
OutPort( 0x340, 0x55 );
6. Free DLL:
FreeLibrary( dllport );
