home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
c
/
break.arc
/
BREAK.DOC
< prev
Wrap
Internet Message Format
|
1985-08-21
|
2KB
Date: Tuesday, 20 August 1985 11:42:41 EDT
From: Joe.Newcomer@cmu-sei.arpa
To: info-ibmpc@usc-isib.arpa
Subject: Control-break handler
Message-ID: <1985.8.20.15.38.52.Joe.Newcomer@cmu-sei.arpa>
Abstract:
MS-DOS has the truly fascinating feature that it is impossible to
abort a program which has entered an infinite loop. When debugging
a program this becomes very painful. I have written an assembly code
intercept routine that is intended to be used with Lattice C. There is
a routine to call to establish the interceptor, and one which MUST be
called to dis-establish it. When control-break is hit, if the CS:IP
is in the user code, the program is terminated upon return from the
keyboard interrupt handler.
Restrictions: This only works with the S and D (64K code segment) models
of Lattice C. It is very, very, very delicate hackery and has been
tested only in a restricted environment. No guarantees are made, but
it is up to each user to determine if this can work in his/her environment.
The code is a bit rough in spots; I make to pretensions to being an
expert assembler hacker. If anyone can clean it up, feel free to do so.
I may have missed some subtlety of DOS/BIOS interactions as well. Please
let me know.
There are two completely magic stack offsets used to determine the user's
CS:IP when the keyboard interrupt is taken. This is extreme magic.
If anyone knows a better way of doing this than reading the BIOS listings
and using the debugger to determine the magical offsets, I'd love to
hear about it.
This has been tested with Lattice C 2.14 S model code on a Hercules
monochrome card. No keyboard enhancers were in use. This is the only
configuration under which it has been tested. Correctness for other
configurations is pure conjecture.