🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc
Article #15290

Re: Need help on how to access IBM-PC/AT keyboard

#15290
From: Dale Gass
Date: Tue, 20 Jan 1987 12:46
39 lines
2444 bytes
In article <696@pc.ecn.purdue.edu.UUCP>, jmoore@pc.ecn.purdue.edu.UUCP writes:
> I need some information and hints (code would also be accepted)
> on how to access or receive information from the keyboard of an
> IBM-PC/AT.

> We would like to conduct a study of the number of keystrokes
> that are needed for using specific editors. The study requires
> that we time the period between keystrokes, the actual keys that
> have been typed and record them to disk. From all of the 

Although the Keyboard does have its own processor, it doesn't do buffering
of its own--every time a key is struck, and interrupt is sent to the PC
which services the keyboard input (interrupt 9, I believe.)  This interrupt
reads from the keyboard port, decodes the key, and stores it in a buffer
at segment 40h.

By writing another interrupt routine which performs a tally of strokes, and
then jumps to the old interrupt service routine, you can effectively
have your routine called at every keystroke.

Regarding the timing between keystrokes: there is an interrupt (1Ch) that
is called at every clock tick.  This routine is usually pointed to a
IRET instruction and does nothing.  By using this routine to increment
a count somewhere in memory, and having the keyboard interrupt store away
this count and then reset it to zero, you can, in effect, time the
distance between keystrokes.

I hope this was of some help...


***************************************************************************
Dale Gass, Dalhousie U., Halifax, N.S., Canada

UUCP:   {seismo|watmath|utai|garfield}!dalcs!dalegass.UUCP
     				       or dalegass@dalcs.UUCP
        ...!dalcs!dalcsug!dalegass.UUCP  or dalegass@dalcsug.UUCP
CDN:    dalegass@cs.dal.cdn
CSNET:  dalegass%cs.dal.cdn@ubc.csnet
ARPA:   dalegass%cs.dal.cdn%ubc.csnet@CSNET-RELAY.ARPA
Technical Details
Message-ID: <2369@dalcs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!dalcs!dalegass
References: <696@pc.ecn.purdue.edu.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!dalcs!dalegass
From: dalegass@dalcs.UUCP (Dale Gass)
Newsgroups: comp.sys.ibm.pc
Subject: Re: Need help on how to access IBM-PC/AT keyboard
Message-ID: <2369@dalcs.UUCP>
Date: Tue, 20-Jan-87 07:46:25 EST
Article-I.D.: dalcs.2369
Posted: Tue Jan 20 07:46:25 1987
Date-Received: Tue, 20-Jan-87 23:46:16 EST
References: <696@pc.ecn.purdue.edu.UUCP>
Organization: Dept. of Math., Stats & C.S., Dalhousie University, Halifax, N.S., Canada
Lines: 39
Summary: It can be done by intercepting interrupts.