How do set up a Keyboard Interupt

I would like to set up a Keyboard Interupt using interupt 9 and reading the value from port 60h so that I can detect which key is being pressed.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

For Windows Or Dos?

Dos is easy

Windows is even easier
nostromo7Author Commented:
I would like to know how to set it up in dos, please
The proper method for setting an interrupt vector in DOS is through a DOS function call using function number 0x25. The interface to DOS requires assembly language. You may be able to inline it with your compiler, or a dosfunction call method may be provided with your libraries. To do a DOS call you must set AL to the function number (0x25 in this case) place any arguments in the registers designated by the DOS call and execute an interrupt 0x21,like:

INT 21

The argument for Set Interrupt Vector is a 4 byte address contained in DS:DX.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nostromo7Author Commented:
it looks like you know what your on about, but at the moment this kind of technique is out of my league, I have not tried linking assembly language with my c progs so although your answer answers my question I am still stuck with the problem.

What the best way to learn assembly with c progs?
What compiler are you using? In the Microsoft compilers, for instance, there is a function call provided by the library: int86x that does most of the dirty work for you.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.