On 06-Jul-97, Gabor Manic wrote to Christopher Butler about Help me!.
CB>> if (inp(0x64) & 1) // same as kbhit()
GM> ^^^^^^^^^^^^^^^
GM> The problem is here
GM> Here you set the first bit if it is already set, and erase the others.
No, he isn't!
GM> This port can't be changed, and that is the reason why your computer
GM> crashes.
He's inputing, not outputing, so there's NP there. I would recomend him
to use kbhit() instead...
GM> If you want a chack the state of N-th bit you can do that like this:
GM> ... (inp(0x64) && 1)
This will work even if the value returned by inp() has not the D0 set,
but other bit.
Internet: jkohen@tough.com þ Javier Kohen/The_Crusher þ
ttp://jkohen.base.org
Fidonet: 4:900/748.3 þ Sk-Network: 200:201/126 þ Rockernet: 33:300/100.3
PGP keyID: 3423EAA9
... Mister Worf, show these children the airlock. þ Picard
-!- CrusherTag 0.3.0.
--- Terminate 4.00/Pro
4:900/748.3)
---------------
* Origin: The King of The Ring BBS þ +54-1-OFF-LINE þ TLD 0 - 7
|