THIS ROUTINE MUST NOT BE CALLED BY THE CLIENT PROGRAM. THIS ROUTINE
MUST BE DEFINED AT THE OUTERMOST LEVEL (i.e., not nested inside an-
other routine).
Control/C interrupt handler. Called by MS-DOS when a Control/C is
detected in the input stream. Sets the Control/C flag and dismisses
the Control/C interrupt.
Ray Duncan's book "Advanced MS-DOS" documents the possible actions
that could be taken by a Control/C handler as any one of:
o Take any appropriate action and execute an IRET. The MS-DOS
function in progress will be restarted and return normally.
o Take any appropriate action and execute a far RETURN. If carry
is set, MS-DOS will abort the application and otherwise "will
continue in the normal manner".
o Keep control and never return.
The first alternative is chosen here. Although any MS-DOS function
call can by used an a Control/C interrupt handler, a TURBO function
may have been occurring and so no TURBO functions may be used.
(*
* Standard TURBO procedure entry for routines at the outermost
* level. A different entry sequence is used for routines that are
* within other routines (it must ensure addressability of the
* outer routine's variables), and this other sequence is NOT legal
* for interrupt routines
*)
{ PUSH BP }
{ MOV BP,SP }
{ PUSH BP }
{ JMP procedure body }
InLine ($07/ { POP ES }
$1F/ { POP DS }
$5F/ { POP DI }
$5E/ { POP SI }
$5A/ { POP DX }
$59/ { POP CX }
$5B/ { POP BX }
$58/ { POP AX }
$8B/$E5/ { MOV SP,BP }
$5D/ { POP BP }
$CF) { IRET }
Tests whether a Control/C has occurred. This function MUST be used
rather than just checking the CtrlCFlag variable, as Control/Cs are
detected only at MS-DOS function calls.
FORMAL PARAMETERS:
None.
RETURN VALUE:
TRUE - There is an unhandled Ctrl/C present.
FALSE - There is no unhandled Ctrl/C present.
IMPLICIT INPUTS:
CtrlCCount - The count of outstanding enables of the Control/C pack-
age.
CtrlCFlag - The Control/C pending flag.
IMPLICIT OUTPUTS:
CtrlCFlag - The Control/C pending flag.
SIDE EFFECTS:
May issue an MS-DOS function call permitting Control/C detection.
CtrlCCount - The count of outstanding enables of the Control/C pack-
age.
Interrupt vector 23 (Control/C trap).
IMPLICIT OUTPUTS:
CtrlCCount - The count of outstanding enables of the Control/C pack-
age.
Interrupt vector 23 (Control/C trap).
CtrlCVect - The original Control/C trap vector.