jbs@eddie.MIT.EDU (Jeff Siegal) (02/26/88)
I am attempting to use "raw" mode to read keyboard input without interference from DOS processing of special chars (^C, ^S, etc.) I find that reading chars works fine (DOS does not interfere), but if attempt to use DOS function 0BH to check the keyboard input status, DOS processes special chars like ^C even though raw mode seems to be properly set. Is there something I am missing, or does this simply not work as I would like. Jeff Siegal
nather@ut-sally.UUCP (Ed Nather) (02/27/88)
In article <8281@eddie.MIT.EDU>, jbs@eddie.MIT.EDU (Jeff Siegal) writes: > I am attempting to use "raw" mode to read keyboard input without > interference from DOS processing of special chars (^C, ^S, etc.) I > find that reading chars works fine (DOS does not interfere), but if > attempt to use DOS function 0BH to check the keyboard input status, > DOS processes special chars like ^C even though raw mode seems to be > properly set. Is there something I am missing, or does this simply > not work as I would like. The DOS function 0Bh works fine so long as there has been no input; If, however, it sees a Ctrl-C it aborts the program unilaterally, without waiting for your program to decide what to do. I had to write a keyboard intercept routine to keep it from doing that. 0Bh works fine if it never sees a Ctrl-C. It's rotten design on somebody's part. -- Ed Nather Astronomy Dept, U of Texas @ Austin {allegra,ihnp4}!{noao,ut-sally}!utastro!nather nather@astro.AS.UTEXAS.EDU
gam3@well.UUCP (G. Allen Morris III) (03/02/88)
use int 21h function 44h. mov ax, 4402h mov bx, handle ; 1 for stdin mov cx, 1 ; charaters to read lds dx, buffer ; ds:dx is a buffer were the chars go. int 21h jnc ok ; error ax = 1 bad function 4 no hanadle 5 access denied 6 bad handle 0dh data invalid 0fh drive # invalied
dan@srs.UUCP (Dan Kegel) (03/03/88)
Ed Nather asked > How do you check to see if there are any characters ready on stdin in RAW > mode? The ususal int 21, ah=0bh (Check Stdin Status) is vulnerable to ^C. In article <5341@well.UUCP> gam3@well.UUCP (G. Allen Morris III) writes: > use int 21h function 4402h (IOCTL Read). This is wrong; none of the usual devices distributed with MS-DOS can do IOCTL reads or writes. Perhaps Morris meant int 21h function 4406h (IOCTL Check Input Status), e.g. mov ax, 4406h mov bx, 0 ; fileno(stdin) int 21h ; AL = 0 if no characters waiting, ffh if at least one char ready. This works even when stdin is redirected to a file. -- Dan Kegel srs!dan@cs.rochester.edu rochester!srs!dan dan%srs.uucp@SOL.cs.rochester.edu