The Keyboard Interface Tutorial By: Inbar Raz Preface: The Keyboard on the IBM PC and compatible is connected to the PPI - Programmable Peripheral Interface, which generally takes care of Keyboard functions, equipment information and timer functions. The PPI is addressable via port reads and writes, to addresses 060h thru 063h. There are several type of keyboards available. The main difference between the various types is the key count. Existing sizez are: 83 Key (Original PC) 84 Key (XT and clones) 101 Key (Usually on AT's and up, called Enhanced Keyboard) In addition to those standard types, there are numerous non-standard types, which varry from manufacturer to manufacturer. There are 102 Key keyboards, keyboards with two F-Key sets (upper and left), keyboards with weird hardly-used keys like 'Macro' and 'Turbo' (which DO have a scan code, though) etcetera. The IBM AT and up provides a better way of negotiating the keyboard, by allowing the user to directly access and command the keyboard, as it will be demonstrated later. Using assembly language, there are two major ways to handle the keyboard and keystrokes: 1. Using DOS functions: DOS provides a useful set of functions to use in context with the keyboard. This includes one-key-input and string input. 2. Using BIOS interrupts: The IBM PC BIOS (Basic Input Output System) provides an interrupt to handle the keyboard - Interrupt 016h (022d). These functions, titles KEYBOARD I/O, are an efficient medium level way of using the keyboard In addition to the Interrupt 016h interface, there is the Keyboard Interrupt, Interrupt 009h. As opposed to the other interrupt, Interrupt 009h is an IRQ - Interrupt Request, which means that it is never called by software. Only hardware, when certain conditions are met, calls IRQ interrupts. Naturally, the user is able to invoke them himself, but that is not commonly done. 3. Direct port access: It is possible to access the keyboard using direct port reads and writes. As mentioned before, this is usually done by addressing the PPI. On AT's and up, however, it is possible to directly access the keyboard itself. The BIOS also supplies a certain amount of information about the keyboard within it's BDA - BIOS Data Area, aka BDS - BIOS Data Segment - which is the segment that lies at paragraph 040h (0040h:XXXXh or 0000h:04XXh): Address Size Contents ßßßßßßß ßßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß 0:0412 1 Errors in PCjr InfraRed keyboard link 0:0417 2 Keyboard status bits. See Keyboard Flags 0:0419 1 Current (accumulating) value of Alt+numpad pseudo-key input. Normally 0. When [Alt] is released, value is stored in kbd buf. 0:041A 2 Address of keyboard buffer head (keystroke at that addr is next) 0:041C 2 Address of keyboard buffer tail 0:041E 32 Keyboard buffer. BIOS stores keystrokes here (head and tail point to addresses from 041Eh to 043Dh inclusive). 0:0480 2 ÝATÞ ðPS/2ð Keyboard buffer offset start address (usually 01Eh) 0:0482 2 end address (usually 03Eh) 0:0496 1 ÝATÞ Keyboard flag bit 4=1 (10h) if 101-key keyboard is attached 0:0497 1 ÝATÞ Keyboard flag for LED 'key lock' display bits 0-2 are ScrollLock, NumLock, CapsLock respectively ****************************************************************************** ****************************************************************************** ****************************************************************************** Using DOS functions: -------------------- DOS provides a set of 7 functions to handle the keyboard: 01h Keyboard Input 06h Console I/O 07h No Echo Unfiltered Input 08h No Echo Filtered Input 0Ah Buffered Input 0Bh Input Status 0Ch Clear Keyboard Buffer & Input DOS Fn 01h: Keyboard Input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 01h ÃÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º AL º Character fetched from the Standard Input ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Reads (waits for) a character from the Standard Input Device. Echoes that character to the Standard Output Device. If Ctrl-Break is detected, INT 23h is executed. Notes: Extended ASCII keystrokes (ie, F1-F12, PgUp, cursor, etc) will require two calls to this function. The first call will return AL=0. The second will return AL with the extended ASCII code. DOS Fn 02h: Display Output ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 02h ÀÄÄÄÄÄÄÄÄĶ DL º Character to send to the Standard Output ÚÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º none º ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Sends the character in DL to the Standard Output. Handles backspace (ASCII 8) by moving the cursor left and leaving the cursor there. If Ctrl-Break is detected, INT 23h is executed. DOS Fn 06h: Console I/O ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 06h ÀÄÄÄÄÄÄÄÄĶ DL º 0 to 0FEh Character to send to the Standard Output º º 0FFh Request for input from the Standard Input ÚÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º ZF º Clear (NZ) if character is ready ÍÍËÍ on input requests ÀÄÄÄÄÄÄÄÄĶ AL º Character read, if ZF is clear ÍÍÍͼ (when DL=0FFh) ÓÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: If DL is 0FFh, this performs a "no wait" console input, returning the Zero Flag (ZF) set (ZR) if there is no character ready. If a character is ready, returns ZF cleared (NZ) with the character that was read in AL. If DL is anything but 0FFh, DL is sent to the Standard Output. Notes: Does not check for Ctrl-Break. Call twice for Extended ASCII. DOS Fn 07h: No Echo Unfiltered Console Input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 07h ÃÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º AL º Character fetched from the Standard Input ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Reads (waits for) a character from the Standard Input Device, returning that character in AL. Unfiltered: Does not detect Ctrl-Break, backspace, etc. Notes: Call twice for Extended ASCII character input. Use Fn 0Bh to check status (if you don't want to wait for a key). DOS Fn 08h: No Echo Console Input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 08h ÃÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º AL º Character fetched from the Standard Input ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Reads (waits for) a character from the Standard Input Device, returning that character in AL. If Ctrl-Break is detected, INT 23h is executed. Notes: Call twice for Extended ASCII character input. DOS Fn 0Ah: Buffered String Input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 0Ah ÀÄÄÄÄÄÄÄÄĶ DS:DX º Address of an input buffer (see below) ÚÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º none º Buffer contains input terminated with CR (ASCII 13h) ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: On entry, the buffer at DS:DX must be set up as: ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄ Ä Ä ³max³ ? ³ ? ? ? ? ? max is maximum acceptable input ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁ Ä Ä (range: 1 to 254) On exit, the buffer is filled: ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄ Ä Ä ³max³len³ T E X T 0Dh len is actual length of input, ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁ Ä Ä less the terminating CR (eg, 4). Characters are read from the Standard Input up to a CR (ASCII 13) or up to the value of max-1. If max-1 is reached, the console bell rings (beeps) for each character until Enter (CR) is read. The second byte of the buffer is filled with the actual length of the input, less the terminating CR. The final character in the buffer is always CR (which is not counted in the length byte). The characters in the buffer (including the len) before the call are used as a "template" and the DOS editing keys are in effect: [Esc] displays "\" and restarts the edit, [F3] displays to the end of the template, [F5] displays "@" and stores the current line as the template, etc. Most Extended ASCII keystrokes are ignored. If Ctrl-Break is detected, INT 23h is executed and the buffer is left unchanged. DOS Fn 0Bh: Check Input Status ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 0Bh ÃÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º AL º 0FFh if a character is available from the Standard Input ÀÄÄÄÄÄÄÄÄĶ º 0 if no character is available ÓÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Checks the status of the Standard Input. If Ctrl-Break is detected, INT 23h is executed. Notes: Use before Fns 01h, 07h and 08h to avoid having DOS wait for a key. This is a simple, non-destructive way to check for Ctrl-Break during long calculations or other processing that does not normally look for input. It lets the user abort from such a sequence. DOS Fn 0Ch: Clear & Input ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 0Ch ÀÄÄÄÄÄÄÄÄĶ AL º DOS input function number (01h, 06h, 07h, 08h, or 0Ah) ÚÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º none º ÀÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: Clears the Standard Input type-ahead buffer then invokes the DOS input function specified by AL. This forces the system to wait for a character to be typed. These values are allowed for AL: 01h Keyboard Input 06h Console I/O 07h No Echo Unfiltered Input 08h No Echo Filtered Input 0Ah Buffered Input ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ In addition to these functions, it is also possible to read a selected amount of characters from the keyboard, using DOS's File Handle functions, as the Keyboard, aka Standard Input, has a pre-set handle of 0000h: DOS Fn 3Fh: Read from keyboard via Handle ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ÚÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Expects º AH º 3Fh ÀÄÄÄÄÄÄÄÄĶ BX º 0000h - Handle for Standard Input (Keyboard) º DS:DX º Address of buffer to receive data º CX º Number of bytes to read ÚÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ³ Returns º AX º Error code if CF is set to CY ÀÄÄÄÄÄÄÄÄĶ AX º Number of bytes actually read ÓÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Description: CX bytes of data are read from the keyboard. The data is placed into the caller's buffer pointed to by DS:DX. Notes: It is handy to use this function for reading default handles such as the Standard I/O handles, instead of the buffered input or character-by-character input functions. When you read from a device, AX returns the length of the line up to and including the termination CR (ASCII 13h). ****************************************************************************** ****************************************************************************** ****************************************************************************** Using BIOS Interrupts: ---------------------- As mentioned before, there are two ways to use interrupts to access the keyboard. The first is Interrupt 016h - Keyboard I/O. INT 16h: Keyboard Services ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ This is the application-level interface to the keyboard. Keystrokes are actually processed asynchronously in the background. As each keystroke is received from the keyboard, it is processed by INT 09h and placed into a circular queue. See AT Keyboard for ways to speed up the keyboard and other hardware info. AH Service ßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß 00h Read (wait for) next keystroke Output: AL = ASCII character (if AL=0, AH is an Extended ASCII keystroke) AH = Scan Code or Extended ASCII keystroke 01h Check if a keystroke is ready (and preview it if so) Output: ZF = ZR = 1 if no key is ready ZF = NZ = 0 if a key is ready. AX is set as for SubFn 00h (but the keystroke has not been removed from the queue). 02h Read the shift-key status. Determine which shift keys are currently being pressed and whether the keyboard is in NumLock state, etc. Output: AL = shift key and 'lock' status as in Keyboard Flags 03h Set keyboard typeamatic rate and delay. (11/15/85 BIOS) Input: AL = 05h (eg, AX = 0305h) BL = Typeamatic rate 0=30 rpts/sec, 1=26...1Fh=2. See AT Keyboard BH = Delay (0=250ms, 1=500ms, 2=750ms, 3=1 second) Output: (none) 04h (reserved) 05h Place a keystroke into the keyboard buffer. (11/15/85 BIOS) Input: CL = ASCII character. CH = Scan Code byte (or 0 if you don't care). Output: AL = Status: 0=success; 1=buffer full 06h-0Fh (reserved) 10h Read (wait for) a keystroke; specific for 101-key 'board (11/15/85 BIOS) Output: AL = ASCII character (if AL=0, AH is an Extended ASCII keystroke) AH = Scan Code or translated Extended ASCII keystroke 11h Preview keystroke; same as 01, but for 101-key 'board (11/15/85 BIOS) Output: ZF = ZR = 1 if no key is ready ZF = NZ = 0 if a key is ready. AX is set as for SubFn 10f but keystroke is still in the buffer. 12h Read shift-key status; same as 02, but for 101-key 'board (11/15/85 BIOS) Output: AL = shift key and 'lock' status. See 101-key Keyboard Flags ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The second is Interrupt 009h - Keyboard Interrupt, IRQ 1 INT 09h: Keyboard Interrupt ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ This hardware-generated interrupt (IRQ 1) is executed upon each press and release of a key. The ROM-BIOS code interprets the keystroke, storing values into the keyboard buffer at 0:041Eh. It also handles the special cases of the PrtSc and SysReq keys, and tracks the status of the shift and case-lock keys. See: INT 16h .......... BIOS service to access the keys stored in the buffer and obtain status of the certain shift keys. Scan Codes ....... a list of the values of each possible keystroke as it is received by INT 09h. Extended ASCII ... for a summary of the values that BIOS stores into the the keyboard buffer after it translates a scan code. Keyboard Flags ... for a summary of how to obtain, test for, and modify the bit-settings of shift and case-lock flags. TSRs (RAM-resident programs) that have a hot-key to trigger a popup usually intercept INT 09h and test for a certain key with a sequence such as this: push ax in al,60h ; Read the key cmp al,POP_KEY ; Is this the hot key? je do_pop ; Yes, trigger the popup ; No, drop through to original driver pop ax jmp cs:[int9_vect] ; Just hop out to original int handler do_pop: ;------ the following housekeeping is needed to satisfy the hdwr int in al,61h ; Get value of keyboard control lines mov ah,al ; Save it or al,80h ; Set the "enable kbd" bit out 61h,al ; And write it out the control port xchg ah,al ; Fetch the original control port value out 61h,al ; And write it back mov al,20h ; Send End-Of-Interrupt signal out 20h,al ; to the 8259 Interrupt Controller ;------ other code handles other tests and finally the popup code ****************************************************************************** ****************************************************************************** ****************************************************************************** Direct port access: ------------------- The keyboard is addressable in two manners. The first, available on all IBM PCs of all types, is by addressing the PPI - Programmable Peripheral Interface. Port Description ßßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß 060h þPC/XTþ PPI port A. Read keyboard scan code: IN al,60h ; Fetche most recent scan code. See INT 09h and Scan Code ÝATÞ keyboard data register. See AT Keyboard 061h þPC/XTþ PPI (Programmable Peripheral Interface) port B. Ö7Â6Â5Â4Â3Â2Â1Â0· º ³ ³ ³ ³ ³0³ ³ º ÓÒÁÒÁÒÁÒÁÒÁÄÁÒÁÒ½ bit º º º º º º ÈÍ 0: Timer 2 gate (speaker) ÍËÍ OR 03h=speaker ON º º º º º ÈÍÍÍ 1: Timer 2 data ÍÍÍÍÍÍÍÍÍÍͼ AND 0FCh=speaker OFF º º º º ÈÍÍÍÍÍÍÍ 3: 1=Read high switches; 0=read low switches(see 62h) º º º ÈÍÍÍÍÍÍÍÍÍ 4: 0=Enable RAM parity checking; 1=disable º º ÈÍÍÍÍÍÍÍÍÍÍÍ 5: 0=Enable I/O channel check º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍ 6: 0=Hold keyboard clock low ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 7: 0=Enable keyboard; 1=disable keyboard ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The second, available only on IBM PC/ATs and up, is by directly commanding the keyboard itself. -= This is for the AT keyboard only. =- Port Description ßßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß 064h ÝATÞ keyboard command register. This port communicates with the 8042 which runs an on-chip control program for the keyboard. It accepts command codes and data bytes. The keyboard of the ÝATÞ (and its Intel 8042 microcomputer interface) is programmable and a lot more interesting than the old-style PC keyboards. Using the information below, you can set the key repeat speed and play games with the "lock" key LED display. Note: This is not a comprehensive coverage of the details of keyboard and 8042 operation, but it should provide some food for thought. Port 60h is for writing data and is maintained for compatibility with earlier models. If the examples using port 64h don't work, try using 60h. Port 64h is for writing commands and data and for reading keyboard status. Before sending a command to the keyboard, the BIOS tests its status (IN al,64h) and makes sure a key isn't being pressed or the internal buffer isn't full, etc. There's a small risk if you just go ahead and send the command: mov al,cmd_code out 64h,al For a two-part command such as setting the typeamatic rate, it's wise to delay a little while between OUTs: mov al,cmd_code out 64h,al mov cx,2000h ;arbitrary ÷ 10ms+ delay: loop delay mov al,data_value out 64h,al Cmd Description ßßßß ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß 0FFh Reset the keyboard and start internal diagnostics 0FEh Resend the last transmission 0FDh-0F7h (NOP) 0F6h Set keyboard to defaults and continue scanning 0F5h Set keyboard to defaults and disable keyboard scanning 0F4h Enable the keyboard. Kybd sends 'ACK', clears buffer, and starts scanning 0F3h Set typeamatic rate and delay. First send 0F3h, then send data byte: Ö7Â6Â5Â4Â3Â2Â1Â0· º0³dly³rept rateº ÓÒÁÄÁÄÁÄÁÄÁÄÁÄÁĽ º È˼ ÈÍÍÍÍÍÍÍÊÍ bits 0-4 set the repeat rate (see below) º ÈÍÍÍÍÍÍÍÍÍÍÍÍ bits 5-6 set initial delay before first repeat: º 00=250ms; 01=500ms; 10=750ms; 11=1000ms ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ bit 7 is always 0 Value Rate Value Rate This chart is a partial guide for the repeat 0 = 30.0 0Ah = 10.0 rate (bits 0-4). You can interpolate for 1 = 26.7 0Dh = 9.2 values not shown, but let's face it, you're 2 = 24.0 10h = 7.5 only interested in the fastest rates. 4 = 20.0 14h = 5.0 8 = 15.0 1Fh = 2.0 The keyboard is initially set to begin repeating after 1/2-second and repeat at a rate of 10 repeats per second. This is much too slow. A data byte of 01h sets the delay to 1/4-second with 26 repeats per second. 0F2h-0EFh (NOP) 0EEh Echo. Diagnostics aid. Simply sends 0EEh right back. 0EDh Turn LED 'lock key' lights on or off. First send 0EDh, then send byte: Ö7Â6Â5Â4Â3Â2Â1Â0· º not used³c³n³sº ÓÄÁÄÁÄÁÄÁÄÁÒÁÒÁÒ½ º º ÈÍ ScrollLock light 01h=turn on º ÈÍÍÍ NumLock light 02h=turn on ÈÍÍÍÍÍ CapsLock light 04h=turn on The bit positions 0-3 correspond to bits 4-6 of the keyboard flags variable in the BIOS Data area. You should make an effort to keep the flags in sync with the lights. For instance, if you do a big favor for the user and set his ten-key pad into NumLock mode (by setting bit 5 of 0:0417h) then be sure to turn on the corresponding LED (eg, bit 1). ****************************************************************************** ****************************************************************************** ****************************************************************************** Additional Information ---------------------- Keyboard Shift Status Flags ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Two bytes at address 0:0417h and 0:0418h identify the status of the keyboard shift keys and keyboard toggles. INT 16h returns the first byte in AL. ÖÄ7ÂÄ6ÂÄ5ÂÄ4ÂÄ3ÂÄ2ÂÄ1ÂÄ0· Perform INT 16h Fn 02h ºI ³C ³N ³S ³a ³c ³sL³sRº or fetch AL=byte at 0:0417h ÓÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒ½ bit º º º º º º º ÈÍ 0: Alpha-shift (right side) DOWN (AL & 01h) º º º º º º ÈÍÍÍÍ 1: Alpha-shift (left side) DOWN (AL & 02h) º º º º º ÈÍÍÍÍÍÍÍ 2: Ctrl-shift (either side) DOWN (AL & 04h) º º º º ÈÍÍÍÍÍÍÍÍÍÍ 3: Alt-shift (either side) DOWN (AL & 08h) º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍ 4: ScrollLock state (AL & 10h) º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 5: NumLock state (AL & 20h) º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 6: CapsLock state (AL & 40h) ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 7: Insert state (AL & 80h) ÖÄ7ÂÄ6ÂÄ5ÂÄ4ÂÄ3ÂÄ2ÂÄ1ÂÄ0· ºi ³c ³n ³s ³ ³sy³aL³cLº fetch AL=byte at 0:0418h ÓÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒ½ bit º º º º º º º ÈÍ 0: Ctrl-shift (left side) DOWN (AL & 01h) º º º º º º ÈÍÍÍÍ 1: Alt-shift (left side) DOWN (AL & 02h) º º º º º ÈÍÍÍÍÍÍÍ 2: SysReq DOWN (AL & 04h) º º º º ÈÍÍÍÍÍÍÍÍÍÍ 3: hold/pause state (AL & 08h) º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍ 4: ScrollLock DOWN (AL & 10h) º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 5: NumLock DOWN (AL & 20h) º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 6: CapsLock DOWN (AL & 40h) ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 7: Insert DOWN (AL & 80h) Notes: Bits 0-2 of 0:0418h are defined only for the 101-key enhanced keyboard. The 101-key BIOS INT 16h Fn 12h returns AL as with Fn 02, but AH is returned with the following bit-flag layout: ÖÄ7ÂÄ6ÂÄ5ÂÄ4ÂÄ3ÂÄ2ÂÄ1ÂÄ0· ºsy³c ³n ³s ³aR³cR³aL³cLº Perform INT 16h Fn 12h (101-key BIOS only) ÓÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒÁÄÒ½ bit º º º º º º º ÈÍ 0: Ctrl-shift (left side) DOWN (AH & 01h) º º º º º º ÈÍÍÍÍ 1: Alt-shift (left side) DOWN (AH & 02h) º º º º º ÈÍÍÍÍÍÍÍ 2: Ctrl-shift (right side) DOWN (AH & 04h) º º º º ÈÍÍÍÍÍÍÍÍÍÍ 3: Alt-shift (right side) DOWN (AH & 08h) º º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍ 4: ScrollLock DOWN (AH & 10h) º º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 5: NumLock DOWN (AH & 20h) º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 6: CapsLock DOWN (AH & 40h) ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 7: SysReq DOWN (AH & 80h) Some older programs change the values of NumLock and CapsLock state bits (at 0:0417h) to force a known status. This is unwise because modern keyboards have indicator lights which will get out of sync with the status. See AT Keyboard for more information on the lock-key LEDs. PCjr status bytes at 0:0488 are omitted for lack of interest. Keyboard Scan Codes ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ When the keyboard forces a hardware interrupt, it passes a Scan Code to the interrupt handler. The handler converts this to an ASCII or Extended ASCII value. For compatibility across the various keyboards, it is wise to avoid using scan codes and stick to the BIOS translation of a keystroke. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Original PC/XT Keyboard ³ When a key is released, the keyboard sends the ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ same value, ORed with 80h (eg, [Ctrl] sends 1Dh when pressed and 9Dh when released). ÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Hex Dec Key ºHex Dec Key ºHex Dec Key ºHex Dec Key ºHex Dec Key ÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 01 1 Esc º12 18 E º23 35 H º34 52 . > º45 69 NumLock 02 2 1 ! º13 19 R º24 36 J º35 53 / ? º46 70 ScrollLock 03 3 2 @ º14 20 T º25 37 K º36 54 Shft(Rt)º47 71 Home [7] 04 4 3 # º15 21 Y º26 38 L º37 55 * PrtSc º48 72 Up [8] 05 5 4 $ º16 22 U º27 39 ; : º38 56 Alt º49 73 PgUp [9] 06 6 5 % º17 23 I º28 40 " ' º39 57 spacebarº4a 74 K - 07 7 6 ^ º18 24 O º29 41 ` ~ º3a 58 CapsLockº4b 75 Left [4] 08 8 7 & º19 25 P º2a 42 Shft(L)º3b 59 F1 º4c 76 Cntr [5] 09 9 8 * º1a 26 [ { º2b 43 \ | º3c 60 F2 º4d 77 Rght [6] 0a 10 9 ( º1b 27 ] } º2c 44 Z º3d 61 F3 º4e 78 K + 0b 11 0 ) º1c 28 Enterº2d 45 X º3e 62 F4 º4f 79 End [1] 0c 12 - _ º1d 29 Ctrl º2e 46 C º3f 63 F5 º50 80 Down [2] 0d 13 + = º1e 30 A º2f 47 V º40 64 F6 º51 81 PgDn [3] 0e 14 bkspº1f 31 S º30 48 B º41 65 F7 º52 82 Ins [0] 0f 15 Tab º20 32 D º31 49 N º42 66 F8 º53 83 Del [.] 10 16 Q º21 33 F º32 50 M º43 67 F9 º 11 17 W º22 34 G º33 51 , < º44 68 F10 º ÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ K indicates a key on the numeric keypad ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ 84-Key AT Keyboard ³ The 84-key keyboard sends the same scan codes as the ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 83-key (original PC) keyboard with the addition that [SysReq] sends scan code 54h (84 decimal). However, the BIOS never lets an application program see this scan code. Instead, it invokes INT 15h SubFn 85h on make or break of the SysReq key. The 'break' (release of a key) is handled differently. Upon a break, the keyboard sends a two-byte sequence: 0F0h, followed by the 'make' scan code. See AT Keyboard Functions for information on programming this keyboard. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ 101-Key Keyboard ³ This keyboard has three separate mappings of the scan ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ codes, selected by communication through port 64h. The keyboard comes to life with scan code set 2 (which is wildly different from the 84-key mapping. However, the scan codes are translated by the hardware keyboard interface before they are made available to programs that read the keyboard. The result is that all of the scan codes identified in the above table are valid when the 101-key 'board comes up naturally. The following table lists the additional scan-codes that are sent by the 101-key 'board. Note that all keys mentioned here refer to the keys that are unique to this keyboard; eg, [Insert] is the dedicated insert key (not KeyPad Ins). ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Key Hex Sequence º Key Hex Sequence ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ F11 ..................... 57 º Home ........ E0 47 F12 ..................... 58 º Shift-Home .. E0 AA E0 47 Right-Alt ............... E0 38 º End ......... E0 4f Right-Ctrl .............. E0 1D º Shift-End ... E0 AA E0 4f PrintScreen ............. E0 2A E0 37 º Up........... E0 48 Shft-PrintScreen (SysReq) E0 37 º Shift-Up .... E0 AA E0 48 Ctrl-PrintScreen (SysReq) E0 37 º Down ........ E0 50 Alt-PrintScreen ......... 54 º Shift-Down .. E0 AA E0 50 Pause ................... E1 1D 45 E1 9D C5 º PageUp ...... E0 49 Ctrl-Pause (Break) ...... E0 46 E0 C6 º Shft-PageUp . E0 AA E0 49 Insert .................. E0 53 º PageDown .... E0 51 Shift-Insert ............ E0 AA E0 52 º Shft-PageDown E0 AA E0 51 Delete .................. E0 53 º Right ....... E0 4D Shift-Delete ............ E0 AA E0 53 º Shift-Right . E0 AA E0 4D Left .................... E0 4B º K Enter ..... E0 1C Shift-Left .............. E0 AA E0 4B º K / ......... E0 35 º Shift-K / ... E0 AA E0 35 ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ K indicates a key on the numeric keypad Note that in cases where a key is similar to another (pre-101) key, the second scan code byte is the same as the original key. Thus, some programs that work at the scan-code level can get away with simply ignoring the E0h prefix. Extended ASCII Keystrokes ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ When INT 16h Fn 00h returns AL=0, then AH will contain an extended ASCII keystroke as listed in these tables. When a DOS Character I/O function returns a character of 00h, you should make a second call to obtain the extended ASCII value. ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ· º Key Hex Dec º Key Hex Dec º Key Hex Dec º Key Hex Dec º ÇÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ º F1 3B 59 º Shift-F1 54 84 º Ctrl-F1 5E 94 º Alt-F1 68 104 º º F2 3C 60 º Shift-F2 55 85 º Ctrl-F2 5F 95 º Alt-F2 69 105 º º F3 3D 61 º Shift-F3 56 86 º Ctrl-F3 60 96 º Alt-F3 6A 106 º º F4 3E 62 º Shift-F4 57 87 º Ctrl-F4 61 97 º Alt-F4 6B 107 º º F5 3F 63 º Shift-F5 58 88 º Ctrl-F5 62 98 º Alt-F5 6C 108 º º F6 40 64 º Shift-F6 59 89 º Ctrl-F6 63 99 º Alt-F6 6D 109 º º F7 41 65 º Shift-F7 5A 90 º Ctrl-F7 64 100 º Alt-F7 6E 110 º º F8 42 66 º Shift-F8 5B 91 º Ctrl-F8 65 101 º Alt-F8 6F 111 º º F9 43 67 º Shift-F9 5C 92 º Ctrl-F9 66 102 º Alt-F9 70 112 º º F10 44 68 º Shift-F10 5D 93 º Ctrl-F10 67 103 º Alt-F10 71 113 º ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ ÖÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ· º Key Hex Decº Key Hex Dec º Key Hex Dec º Key Hex Dec º ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ º Alt-A 1E 30 º Alt-P 19 25 º Alt-3 7A 122 º down 50 80 º º Alt-B 30 48 º Alt-Q 10 16 º Alt-4 7B 123 º left 4B 75 º º Alt-C 2E 46 º Alt-R 13 19 º Alt-5 7C 124 º right 4D 77 º º Alt-D 20 32 º Alt-S 1F 31 º Alt-6 7D 125 º up 48 72 º º Alt-E 12 18 º Alt-T 14 20 º Alt-7 7E 126 º End 4F 79 º º Alt-F 21 33 º Alt-U 16 22 º Alt-8 7F 127 º Home 47 71 º º Alt-G 22 34 º Alt-V 2F 47 º Alt-9 80 128 º PgDn 51 81 º º Alt-H 23 35 º Alt-W 11 17 º Alt-- 82 130 º PgUp 49 73 º º Alt-I 17 23 º Alt-X 2D 45 º Alt-= 83 131 º º º Alt-J 24 36 º Alt-Y 15 21 º º ^left 73 115 º º Alt-K 25 37 º Alt-Z 2C 44 º NUL 03 3 º ^right 74 116 º º Alt-L 26 38 º º Shift-Tab 0F 15 º ^End 75 117 º º Alt-M 32 50 º Alt-0 81 129 º Ins 52 82 º ^Home 77 119 º º Alt-N 31 49 º Alt-1 78 120 º Del 53 83 º ^PgDn 76 118 º º Alt-O 18 24 º Alt-2 79 121 º ^PrtSc 72 114 º ^PgUp 84 132 º ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º 101-key Keyboard Extensions Supported by BIOS º ÖÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÒÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄ· º Key Hex Dec º Key Hex Dec º Key Hex Dec º ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ º F11 85 133 º Alt-Bksp 0E 14 º Alt- K / A4 164 º º F12 86 134 º Alt-Enter 1C 28 º Alt- K * 37 55 º º Shft-F11 87 135 º Alt-Esc 01 1 º Alt- K - 4A 74 º º Shft-F12 88 136 º Alt-Tab A5 165 º Alt- K + 4E 78 º º Ctrl-F11 89 137 º Ctrl-Tab 94 148 º Alt- K Enter A6 166 º º Ctrl-F12 8A 138 º º º º Alt-F11 8B 139 º Alt-up 98 152 º Ctrl- K / 95 149 º º Alt-F12 8C 140 º Alt-down A0 160 º Ctrl- K * 96 150 º º Alt-[ 1A 26 º Alt-left 9B 155 º Ctrl- K - 8E 142 º º Alt-] 1B 27 º Alt-right 9D 157 º Ctrl- K + 90 144 º º Alt-; 27 39 º º º º Alt-' 28 40 º Alt-Delete A3 163 º Ctrl- K Up [8] 8D 141 º º Alt-` 29 41 º Alt-End 9F 159 º Ctrl- K Cn [5] 8F 143 º º Alt-\ 2B 43 º Alt-Home 97 151 º Ctrl- K Dw [2] 91 145 º º Alt-, 33 51 º Alt-Insert A2 162 º Ctrl- K Ins[0] 92 146 º º Alt-. 34 52 º Alt-PageUp 99 153 º Ctrl- K Del[.] 93 147 º º Alt-/ 35 53 º Alt-PageDown A1 161 º º ÓÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÐÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĽ K indicates a key on the numeric keypad (when not in NumLock mode) ============================================================================== For any ideas, requests, corrections ("There is always one more bug") or whatever, contant the author at: Fido: Inbar Raz, 2:401/100.1 Inbar Raz, 2:403/100.42 Internet: nyvirus@weizmann.weizmann.ac.il Inbar.Raz@p1.f100.n401.z2.fidonet.org Inbar.Raz@p42.f100.n403.z2.fidonet.org Snailmail: Inbar Raz 5 Hanegev Street Yavne 70600