LPT: Need help to READ and WRITE to port
Hi all,
I want to hook some instrumentation to the LPT1: port, control and read its status through this port. However, my compiler (VC++ 6.0) on a Windows XP machine does not recognize 'inportb' or 'outportb' (used in some very old instructions). Here is the basic elements of that code and what I'm attempting to do;
Code:
#include <stdio.h>
#include <dos.h>
void main(void)
{
int val;
val=inportb(0x378); //readport
outportb(0x378,0x0F); //write to port
val=inportb(0x378); //read again. should be 0F
printf("%x \n",val);
}
Is there some other funciton that I should be using ?
Does someone have a snip of code I could use ?
Thanks