Under MS-DOS version 2 or later, you can substantially increase display speeds for well-behaved application programs without sacrificing hardware independence by selecting binary (raw) mode for the standard output. In binary mode, MS-DOS does not check between each character it transfers to the output device for a Ctrl-C waiting at the keyboard, nor does it filter the output string for certain characters such as Ctrl-Z.
Bit 5 in the device information word associated with a device handle controls binary mode. Programs access the device information word by using Subfunctions 00H and 01H of the MS-DOS IOCTL function (I/O Control, Int 21H Function 44H). For example, the sequence on the following page places the standard output handle into binary mode.
; get device information...
mov bx,1 ; standard output handle
mov ax,4400h ; function 44h subfunction 00h
int 21h ; transfer to MS-DOS
mov dh,0 ; set upper byte of DX = 0
or dl,20h ; set binary mode bit in DL
; write device information...
; (BX still has handle)
mov ax,4401h ; function 44h subfunction 01h
int 21h ; transfer to MS-DOS
Note that if a program changes the mode of any of the standard handles, it should restore those handles to ASCII (cooked) mode before it exits. Otherwise, subsequent application programs may behave in unexpected ways. For more detailed information on the IOCTL function, see Section II of this book, "MS-DOS Functions Reference."