Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!sri-spam!ames!sdcsvax!nosc!cod!bmarsh From: bmarsh@cod.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: How do you flush the PC's keyboard? Message-ID: <708@cod.UUCP> Date: Tue, 2-Jun-87 13:13:03 EDT Article-I.D.: cod.708 Posted: Tue Jun 2 13:13:03 1987 Date-Received: Thu, 4-Jun-87 05:48:36 EDT References: <747@thumper.UUCP> Organization: Naval Ocean Systems Center, San Diego Lines: 36 Summary: Use the bdos() function. In article <747@thumper.UUCP>, tr@thumper.UUCP writes: > According to _Advanced MS-DOS_ by Ray Duncan, DOS function C (hex) > resets the input buffer and then gets a character for input using one > of five DOS functions. They are 1, 6, 7, 8, and A (hex). They always forget to add the fact that you can use this function with a 'function' of zero. This will flush the keyboard input buffer, then return without asking for a character, exactly as you wanted. > I am using Lattice C. Is there a standard way of doing this with C or > Assembler? bdos(0x0c, 0x00, 0x00); or mov ax,0c00h int 21h > Thank you for your attention. You people are great. Thanks. (blush ;-) > -- > Tom Reingold > INTERNET: tr@bellcore.bellcore.com > UUCP: {seismo,ihnp4,ucbvax,decvax}!bellcore!tr > {ulysses,allegra,clyde,princeton}!bellcore!tr --------- Bill Marsh, Naval Ocean Systems Center, San Diego, CA {arpa,mil}net: bmarsh@cod.nosc.mil uucp: {ihnp4,akgua,decvax,dcdwest,ucbvax}!sdcsvax!nosc!bmarsh "If everything seems to be coming your way, you're probably in the wrong lane."