Hi,
Im trying to learn to c programming via just reading some internet tutorials.
I am trying to create a program to control the data and status ports of ltp1.
I have all that down pat, but I want my program to run a function, when the program initializes, (It locates the address vaue of LPT1 port).
Is it possible to make the result of that function available globally, for other functions to use.
void config ()
{
unsigned int far *addresspoint;
unsigned int address;
addresspoint=(unsigned int far *)0x00000408;
clrscr();
address = *addresspoint;
printf("Address: 0x%X \n",address);
printf("\n");
printf("Press Any Key to go back to the Menu\n");
getch();
menu();
}
I would Like to use the value of address in other functions, on a global scale.
void output ()
{
outportb(address,0x00);
delay(100);
outportb(address, 0x01);
printf("\n");
printf("Press Any Key to go back to the Menu\n");
getch();
menu();
}
Basically, Id like to run config () first then make the address value available to the output () function.
Any help would be great, also does anyone know any comprehensive c programing books?
Also yes I know, that you can't directly control the port registers in WindowsNT bases systems, must be 98 or before.