Int 21H [2.0] Function 33H (51) Get or set break flag, get boot drive

Obtains or changes the status of the operating system's break flag, which influences Ctrl-C checking during function calls. Also returns the system boot drive in version 4.0.

Call with:

If getting break flag

AH = 33H

AL = 00H

If setting break flag

AH = 33H

AL = 01H

DL = 00H if turning break flag OFF

01H if turning break flag ON

[4] If getting boot drive

AH = 33H

AL = 05H

Returns:

If called with AL = 00H or 01H

DL = 00H break flag is OFF

01H break flag is ON

[4] If called with AL = 05H

DL = boot drive (1 = A, 2 = B, etc.)

Notes:

When the system break flag is on, the keyboard is examined for a Ctrl-C entry whenever any operating-system input or output is requested; if Ctrl-C is detected, control is transferred to the Ctrl-C handler (Int 23H). When the break flag is off, MS-DOS only checks for a Ctrl-C entry when executing the traditional character I/O functions (Int 21H Functions 01H through 0CH).

The break flag is not part of the local environment of the currently executing program; it affects all programs. An application that alters the flag should first save the flag's original status, then restore the flag before terminating.

Example:

Save the current state of the system break flag in the variable brkflag, then turn the break flag off to disable Ctrl-C checking during most MS-DOS function calls.

brkflag db 0 ; save break flag

.

.

.

; get current break flag

mov ah,33h ; function number

mov al,0 ; AL = 0 to get flag

int 21h ; transfer to MS-DOS

mov brkflag,dl ; save current flag

; now set break flag

mov ah,33h ; function number

mov al,1 ; AL = 1 to set flag

mov dl,0 ; set break flag OFF

int 21h ; transfer to MS-DOS

.

.

.