![]() Many BIOS provide extra functions, and there are many TSR applications you can buy that extend this list even farther. However, since the AT came along, most BIOSes have supported at least the functions above. In fact, only the first three functions were available in the original PC. Note that many of these functions are not supported in every BIOS that was ever written. The shift flags are defined as follows: Ê bit 15: SysReq key pressed bit 14: Capslock key currently down bit 13: Numlock key currently down bit 12: Scroll lock key currently down bit 11: Right alt key is down bit 10:Right ctrl key is down bit 9: Left alt key is down bit 8: Left ctrl key is down bit 7: Insert toggle bit 6: Capslock toggle bit 5: Numlock toggle bit 4: Scroll lock toggle bit 3: Either alt key is down (some machines, left only) bit 2: Either ctrl key is down bit 1: Left shift key is down bit 0: Right shift key is down Returns the current status of the shift flags in ax. Like the ah=01h call except this one does not throw away keycodes that are not PC/XT compatible (i.e., the extra keys found on the 101 key keyboard). Like ah=0 call, except this one passes all key codes, the ah=0 call throws away codes that are not PC/XT compatible. This routine will simply insert the data you provide into the system type ahead buffer. Note that the scan code in ch doesn't have to correspond to the ASCII code appearing in cl. This function stores the value in the cx register at the end of the type ahead buffer. The bh register contains the amount of time to wait before starting the autorepeat operation, the bl register contains the autorepeat rate. The shift flags are defined as follows: Ê bit 7: Insert toggle bit 6: Capslock toggle bit 5: Numlock toggle bit 4: Scroll lock toggle bit 3: Alt key is down bit 2: Ctrl key is down bit 1: Left shift key is down bit 0: Right shift key is downĪl = 5 bh = 0, 1, 2, 3 for 1/4, 1/2, 3/4, or 1 second delay bl= 0.1Fh for 30/sec to 2/sec. Returns the current status of the shift flags in al. The value in ax is undefined if no key is available. ![]() If there is an available key, this function returns the ASCII and scan code value in ax. Sets the zero flag if not key is available, clears the zero flag if a key is available. Wait for a keystroke if the buffer is empty.Ĭhecks to see if a character is available in the type ahead buffer. Reads next available character from the system's type ahead buffer. The BIOS provides the following keyboard functions:īIOS Keyboard Support Functions Function # To call the MS-DOS BIOS keyboard services you use the int 16h instruction. In general, if you do not need the I/O redirection facilities provided by MS-DOS, reading your keyboard input using BIOS functions provides much more flexibility. Furthermore, there are lots of interesting keyboard related variables in the BIOS data area you can poke around at. The gets and getsm routines throw away any non-ASCII keystrokes since it would not be a good thing to insert zero bytes into the middle of a zero terminated string.Īlthough MS-DOS provides a reasonable set of routines to read ASCII and extended character codes from the keyboard, the PC's BIOS provides much better keyboard input facilities. Therefore, the Standard Library getc routine also returns extended keycodes in this manner. Note that the Standard Library routines call MS-DOS to read characters from the keyboard. The code MS-DOS returns on the second call is the extended key code. This tells you that you must call the get character routine again. On the first call MS-DOS returns a zero value. ![]() If you press a key that has an extended code rather than an ASCII code, MS-DOS returns two keycodes. This means that you lose the scan code information the keyboard interrupt service routine saves in the type ahead buffer. The primary thing to note about the DOS calls is that they only return a single byte. MS-DOS provides several calls to read characters from the keyboard. Art of Assembly: Chapter Twenty-3 Ģ0.3 - The Keyboard DOS Interface 20.4 - The Keyboard BIOS Interface
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |