Okay, apparently I had an extra semicolon after the #define statement. Now the program runs with no errors/warnings on compiling, but throws up an application error window when trying to execute the _outp statement. It says that the 'exception priviledged instruction 0xc0000096 occured in the application at the location 0x00408bab. I have no idea what this means. I tried //'ing the two _outp statements and the program runs straight through with no errors.
Does anyone know what the problem is?
Here's what the code looks like now:
Code:
#include <iostream> // Needed for output to screen and input from keyboard
#include <conio.h> // Needed for getch function
#define CONTROL 0x302
using namespace std; // Use in conjunction with "#include <iostream>" to allow using certain commands
int main()
{
_outp(CONTROL, 0x80); // Sends 10000000 to 0x302, turning pin #10 to high
cout << "Pin #10 should be at +5V.\n";
cout << "Hit 'x' to stop signal.\n";
while (getch()!='x')
{
}
_outp(CONTROL, 0x0); // Sets pin #10 back to low
return 0;
}