🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #873

Re: Avoiding ^C

#873
From: Steve Resnick
Date: Fri, 06 Jul 1990 22:07
41 lines
2306 bytes
In article <1990Jul5.171205.2036@tc.fluke.COM> mason@tc.fluke.COM (Nick Mason) writes:
[Stuff Deleted]
>OK, OK, here's the BIG secret to get rid of ^C on the screen.
>
>Keyboard processing uses lots of interrupts on a PC. Hardware int 9,
>software 16, 1B and 23 to name a few.
>
>When ctrl-C is pressed, two interrupts are affected, 0x1B and 0x23.
>
>0x23 has been previously discussed , and is the MS-DOS interrupt
>associated with ^C.  The interrupt not discussed, is 0x1B the BIOS
>interrupt associated with ^C.  It is this interrupt that puts the
>*&$^@!ing '^' and 'C' in the keyboard buffer.  
>
>To totally turn off ^C I do something similar to the following:
>

This isn't entirely true...

The BIOS responds to ^[Break], DOS reponds to ^C. If you press ^[Break]
int 1BH is executed by the int 09H handler. This gets picked up by DOS
and you get the stupid ^C character. If you intercept the 1BH handler, 
you will avoid getting the ^C when you press ^[Break]. If you press ctrl-C
you will still get the silly ^C display. The only sure-fire meathod I have
been able to come up with is: Use the BIOS for all of your keyboard I/O.
I have noticed that even funcitons like kbhit() will cause you to get the
^C on the screen, so you will need to once again bug int 16H for the input
status.


If you HAVE to use stdio, there might be some diddling of the I/O streams
to set "raw" mode. I have never tried this so I cannot recomend this.

Hope this is usefull.....
Steve

-- 
--------------------------------------------------------------------------------
Steve Resnick -<stever@octopus.COM apple!octopus!stever sun!vsi1!octopus!stever>
408/241-1533 Process Scientific, Inc.
"0x2B|~0x2B THAT is the question!"
Technical Details
Message-ID: <1990Jul6.220720.15747@Octopus.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!mips!prls!pyramid!octopus!stever
References: <10688@spool.cs.wisc.edu> <577@dg.dg.com> <1990Jun30.203726.7480@sjsumcs.sjsu.edu> <1990Jul5.171205.2036@tc.fluke.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!mips!prls!pyramid!octopus!stever
From: stever@Octopus.COM (Steve Resnick )
Newsgroups: comp.sys.ibm.pc.programmer
Subject: Re: Avoiding ^C
Message-ID: <1990Jul6.220720.15747@Octopus.COM>
Date: 6 Jul 90 22:07:20 GMT
References: <10688@spool.cs.wisc.edu> <577@dg.dg.com> <1990Jun30.203726.7480@sjsumcs.sjsu.edu> <1990Jul5.171205.2036@tc.fluke.COM>
Reply-To: stever@octopus.UUCP (Steve Resnick )
Organization: Octopus Enterprises, Cupertino CA
Lines: 41