Programmering - Assembler - INT - INT21 - 09: Display String

DOS 1.0 : Sends a string to standard output. The string must end with '$' (ascii 36/24h). The '$'-char is not displayed.

AH = 9
DS:DX -> String$
 

 

 

Local message: 'Hello'
msg db 'Hello$'
    mov dx, offset msg
    mov ah, 9
    int 21h
- with new-line:
msg db 'Hello',13,10,'$'
 
If the address of the string is a far pointer:
    push ds
    mov dx, string_segment
    mov ds, dx
    mov dx, string_offset
    mov ah, 9
    int 21h
    pop ds