Christopher Butler said about Help me!....
CB> I've got a program here, and it compiled fine a while ago, then I left
CB> it for a bit... I've come back to it, and it crashes when it tries to
CB> do a getch()!
CB> A bit of code that it crashes on:
CB> char i;
CB> if (inp(0x64) & 1) // same as kbhit()
^^^^^^^^^^^^^^^
The problem is here
Here you set the first bit if it is already set, and erase the others.
This port can't be changed, and that is the reason why your computer
crashes.
If you want a chack the state of N-th bit you can do that like this:
... (inp(0x64) && 1)
& - binary AND operator
&& - logical AND operator
CB> i = getch();
CB> else
CB> i = 0;
CU, Gaby
... GPF - the Microsoft Award for Programming Exellence..
--- FMailX 1.22
---------------
* Origin: Tipp-Topp System, Subotica, Yugoslavia (2:37/10)
|