[comp.lang.c] Overcoming delay thru use of keyboard buffer

cyhutson@images.cs.und.ac.za (06/07/91)

Hi there!!

Can anyone help me?!

As most people know, when you type at the keyboard, interrupt
9h (ROM BIOS) is executed and puts the ascii code for the character
and possibly also the scan code, into the keyboard buffer, which
by the way is 32 bytes long, hence a total of only 16 characters
can be stored in the buffer.

What I want to do is the following :
* reduce the delay that occurs through the character having to pass via 
  the keyboard buffer.

So, of course, how do I do this??

As far as I am concerned (and I could be totally wrong here) I must
either 
1) reduce the keyboard buffer to 0 so nothing is stored in it, or
2) somehow increase the size of the buffer and rewrite the interrupt 
   so that when a keystroke is called, not only the ascii code (and
   possibly the scan code) is saved, but also the time at that 
   particular instant in time. 

Problem is , I don't know how to do this, either of my suggestions.

Can anyone pleez help me, either with alternative suggestions, or even 
clues on how to do this.

Thanks again
bye
celia hutson
cyhutson@images.cs.und.ac.za
 

bobb@vice.ICO.TEK.COM (Bob Beauchaine) (06/09/91)

In article cyhutson@images.cs.und.ac.za writes:
>Hi there!!
>
>Can anyone help me?!
>
>What I want to do is the following :
>* reduce the delay that occurs through the character having to pass via 
>  the keyboard buffer.
>
>So, of course, how do I do this??

  Get a copy of quickeys.com.  It's a tsr utility that takes up only
  a few hundred bytes of memory per invocation.  Each time you run the
  utility, the delay between keystrokes is shortened.  Available on
  PCMagnet on Compuserve, or possibly at an anonymous ftp site, since
  it is a public domain program.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 

Bob Beauchaine bobb@vice.ICO.TEK.COM 

C: The language that combines the power of assembly language with the 
   flexibility of assembly language.

dave@tygra.Michigan.COM (David Conrad) (06/10/91)

Er, what is it you're trying to achieve?  The keyboard buffer doesn't
have to fill before characters are available to a running program.
When a key is pressed, int 9h decodes it and places it into the buffer.
This is, for all practical purposes which I can imagine, instantaneous.
The key can then be read by calling the bios routines under int 16h, 
which are, if anything, faster than int 9h.  What's the problem?
--
David R. Conrad
dave@michigan.com
-- 
=  CAT-TALK Conferencing Network, Computer Conferencing and File Archive  =
-  1-313-343-0800, 300/1200/2400/9600 baud, 8/N/1. New users use 'new'    - 
=  as a login id.  AVAILABLE VIA PC-PURSUIT!!! (City code "MIDET")        =
   E-MAIL Address: dave@Michigan.COM

mouse@thunder.mcrcim.mcgill.edu (der Mouse) (06/11/91)

In article <1991Jun7.070027.3308@images.cs.und.ac.za>, cyhutson@images.cs.und.ac.za writes:

> As most people know, when you type at the keyboard, interrupt 9h (ROM
> BIOS) is executed and puts the ascii code for the character and
> possibly also the scan code, into the keyboard buffer, which by the
> way is 32 bytes long, hence a total of only 16 characters can be
> stored in the buffer.

Most people?  You're in the wrong group.  Try an IBM-PC-specific group.
This is related to neither Pascal nor C.  In comparison to the vast
variety of machines on which one can use Pascal or C, the variety of
machines where your lead-in is true is very tiny - bascially, the
IBM-PC clone world.  (Large in number of machines, small in number of
machine *types*.)

I think you really don't need the speed you think you do.  If you're
really really sure you do, try building your own handler for interrupt
9...just be *very* sure to reset it when you're done!

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu