Chapter
1
I
System Calls
SetCtrlCTrapping
CONTROL-C
Check
Function
Call
33H
MS-DOS
only checks
for
a
CONTROL-C
on
the controlling
device when performing function call operations 01H-0CH
to that device. Function Call 33H lets you expand this
checking
to
include any system call. For example, with the
CONTROL-C trapping
off,
all disk
I/O
proceeds without
interruption. With CONTROL-C trapping on, the CON-
TROL-C interrupt is given
at
the system call that initi-
ates the disk operation.
Note that programs using Function Calls 06H
or
07H
to
read CONTROL-Cs as data must ensure that the CON-
TROL-C check is off.
Entry Conditions:
AH
=
33H
AL
=
function
00H
=
Return current state
OIH
=
Set state
OOH
=
Off
OIH
=
On
DL
=
switch (if setting state)
Exit Conditions:
DL
=
current state
OOH
=
Off
OIH
=
On
Error Return:
AL
=
FFH
The function passed in AL was not in the range 00H-
OIH.
Example:
SetCtrlCTrapping
equ
33H
mov dl ,Val
mov a1,func
mow
a1,SetCtrlCTrapping
96