9号功能:dos功能调用的9号功能完成字符串输出,串事先需要用$结尾
data segment
sting db 'hello world!$'
data ends
code segment
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
;因为9号功能是识别ds:dx中存放的串地址,然后进行输出
;所以需要将串的首地址要放在ds:dx中,然后调用9号功能
lea dx,string ; 相当于mov dx,offset string
mov ah,9
int 21h
mov ah,4ch
int 21h
code ends
end start