Int 21H [1.0] Function 09H Display string

[1] Sends a string of characters to the display.

[2.0+] Sends a string of characters to the standard output device. Output may be redirected. (If output has been redirected, there is no way to detect disk full.)

Call with:

AH = 09H

DS:DX = segment:offset of string

Returns:

Nothing

Notes:

The string must be terminated with the character $ (24H), which is not transmitted. Any other ASCII codes, including control codes, can be embedded in the string.

See Int 21H Functions 02H and 06H for single-character output to the video display or standard output device.

If a Ctrl-C is detected at the keyboard, an Int 23H is executed.

[2.0+] You can also send strings to the display by performing a write (Int 21H Function 40H) using the predefined handle for the standard output (0001H), if it has not been redirected, or a handle obtained by opening the logical device CON.

Example:

Send the string Hello World, followed by a carriage return and line feed, to the standard output device.

cr equ 0dh

lf equ 0ah

msg db 'Hello World',cr,lf,'$'

.

.

.

mov ah,9 ; function number

mov dx,seg msg ; address of string

mov ds,dx

mov dx,offset msg

int 21h ; transfer to MS-DOS

.

.

.