I would like to know, because I noticed how slow it can be when called over and over.

How would I go about doing

xor ah,ah
int 0x16

Without the interrupt?

Here's a link to my video.. can see small delays keys are pressed quickly or held in near the end when it shows the textbox.

Using NASM 16-bit assembler, intel processor. Thanks in advance.

Recommended Answers

All 8 Replies

int 16h is keyboard interface. Put the desired function in ah and issue int 16h interrupt. See this link for one of many links that describe the services. When ah is 0 (as in xor ax,ax) then int16h will wait for keystroke.

int 16h is keyboard interface. Put the desired function in ah and issue int 16h interrupt. See this link for one of many links that describe the services. When ah is 0 (as in xor ax,ax) then int16h will wait for keystroke.

Thanks, but thats not what I ment. What I want to know is what code does int 0x16 execute?
Is there a way to get around needing to use an interrupt to access to keyboard buffer?

Edit: You can see where it becomes a bit slow at 1:31 in my video.

use a debugger and you should be able to step into the interrupt function. I don't know what code it executes but at some point it will have to access the keyboard device driver. You can install your own int16h interrupt handler but that is not advisable.

use a debugger and you should be able to step into the interrupt function. I don't know what code it executes but at some point it will have to access the keyboard device driver. You can install your own int16h interrupt handler but that is not advisable.

I'll look into a debugger, thanks for the help.

It is possible to get input from the keyboard without calling int 16h, but I would not recommend it unless you know exactly what you are doing and the effects that it would have on the rest of the system. I am assuming that you are not writing an OS, so I would recommend that you simply use what you already have.

It is possible to get input from the keyboard without calling int 16h, but I would not recommend it unless you know exactly what you are doing and the effects that it would have on the rest of the system. I am assuming that you are not writing an OS, so I would recommend that you simply use what you already have.

Actually I am writing an OS.. did you look at my video?

No, I am stuck with dial-up, so most videos are not an option for me, sorry. On a side note, since you are writing an OS, I would recommend taking a look at http://wiki.osdev.org/Main_Page, very much very useful information there (I know from experience). Good luck, an OS is a lot of work.

No, I am stuck with dial-up, so most videos are not an option for me, sorry. On a side note, since you are writing an OS, I would recommend taking a look at http://wiki.osdev.org/Main_Page, very much very useful information there (I know from experience). Good luck, an OS is a lot of work.

Thanks for the link.
I know it's a lot of work. I've been working on mine for almost a month now and only have simple console-based GUI with a decent kernel framework built around it. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.