[comp.lang.pascal] 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

einstein@cs.mcgill.ca (Michael CHOWET) (06/17/91)

In article <7578@vice.ICO.TEK.COM> bobb@vice.ICO.TEK.COM (Bob Beauchaine) 
writes:
>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.

  Another option to look at if one has the time is writing a little program
of one's own. The ROM BIOS provides for the adjusting of both the typematic
rate and the typematic delay. One can get at them through service 03 of the
interrupt 16h. Place 03h in AH and 05h in AL. BL should then be loaded with
a value between 00h and 1Fh that corresponds to char/s according to a table
I have here but I don't feel like typing. If you are interested to see this
table, it's on page 219 of "_The_New_Peter_Norton_Programmer's_Guide_to_the 
IBM_PC_and_PS/2_". BH should hold a value for the typematic delay, ranging
from 00h to 03h. (Starting at 250 ms and going by increments of 250 ms).

  BTW, default values for the delay and rate are 500ms for the delay (01h
in BH) and either 10.0 or 10.9 chars/sec depending on whether it's a PC/AT
or if it's a PS/2 (oh, and for a feel for the values, that's either 0Ch or
0Bh in BL).

_______________________________________________________________________________
|        McGill University, Montreal, Canada       |"The advocate will refrain|
| Computer Science Undergrad Society - VP External | from making her opponent |
|__ Michael Chowet _ I-Net:einstein@cs.mcgill.ca __|____ disappear" -Data ____|