//PROGRAM TO OBTAIN ADDRESSES OF PRINTER PORTS
#include <stdio.h>#include <dos.h>
void main(void)
{
unsigned int far *ptraddr; /* Pointer to location of Port Addresses */
unsigned int address; /* Address of Port */
int i;
ptraddr=(unsigned int far *)0x00000408;
for (i = 0; i < 3; i++)
{
address = *ptraddr;
if (address == 0)
printf ("No port found for LPT%d \n", i+1);
else
printf("Address assigned to LPT%d is %Xh\n", i+1,address);
*ptraddr++;
}
}
Note :Execute this code on your own risk.
No comments:
Post a Comment