[comp.sys.ibm.pc] Control-C Checking

reb2@ihlpa.UUCP (Brown) (11/18/86)

*** REPLACE THIS LINE WITH YOUR MESSAGE ***

I am having a problem regarding Control-C (Control-Break).
I have a memory-resident program which intercepts the
INT 23h vector, which I believe is the address that gets
conrol when a control-c is detected.  However, when I
interrupt a sample program with a control-break, my
resident routine never gets control.  What am I missing?
The sample program that I interrupt follows:

CODE_SEG	segment		para public 'code'
		assume		cs:CODE_SEG,ds:CODE_SEG,es:CODE_SEG
msg1		db		'OK',0Dh,0Ah,'$'
p0:		push		ds
		xor		ax,ax
		push		ax
		mov		ax,CODE_SEG
		mov		ds,ax
p1:
		xor		ax,ax
		int       	16h
		lea		dx,msg1
		int		21h
		jmp		p1
CODE_SEG	ends
		end	p0

Thanks for any help.

Rick Brown  ihnp4!ihlpa!reb2

rde@ukc.ac.uk (R.D.Eager) (11/20/86)

In article <2324@ihlpa.UUCP> reb2@ihlpa.UUCP (Brown) writes:
>*** REPLACE THIS LINE WITH YOUR MESSAGE ***
>
>I am having a problem regarding Control-C (Control-Break).
>I have a memory-resident program which intercepts the
>INT 23h vector, which I believe is the address that gets
>conrol when a control-c is detected.  However, when I
>interrupt a sample program with a control-break, my
>resident routine never gets control.  What am I missing?

The  problem  is that memory resident programs are children (sort of) of
COMMAND.COM. The  vector  is  reset  (I  believe)   when   the   program
terminates,  even  if  it  stays  resident. Think  of  the  havoc  if it
didn't! The reset value is the default handler in COMMAND.COM, which may
then be taken over again by other programs as they are run.

I think you'll have to dig into the BIOS (or lower) if you  really  want
to do this one.
-- 
           Bob Eager

           rde@ukc.UUCP
           rde@ukc
           ...!mcvax!ukc!rde

           Phone: +44 227 66822 ext 7589