Lord Loh.
Full Member level 4
Hi,
Below is a Turbo C code for parallel port testing....
When I test this code on machines with WindowsXP, I see an output like
However, when I run this code on win98 systems,
What could be the reason? I have not tested this on any other OS. How can I get over this problem.
Below is a Turbo C code for parallel port testing....
Code:
#include<stdio.h>
#include <conio.h>
#include <dos.h>
int main(void)
{
int far *LPT1=(int far*)0x408;
int portID=*LPT1;
short int inData, outData;
clrscr();
printf("LPT1 Address is at %X\n",portID);
while(!kbhit())
{
inData=inportb(portID);
printf("Read :%X\n",inData);
outData=inData^0xFF;
outportb(portID,outData);
printf("Write :%X\n",outData);
delay(1000);
}
return 0;
}
When I test this code on machines with WindowsXP, I see an output like
Code:
Read : AA
Write: 55
Read: AA
Write: 55
However, when I run this code on win98 systems,
Code:
Read : AA
Write: 55
Read: 55
Write: AA
What could be the reason? I have not tested this on any other OS. How can I get over this problem.