Following operations is used to display message in Assembly language.
In data segment
msg db "ABC$"
MOV ah,09h
MOV dx,offset msg
int 21h
Or
MOV ah,09h
LEA dx,msg
int 21h
Sample program
.model small
.data
msg1 db "Assembly language programs$"
msg2 db 10d,"Example to display any string$"
.code
mov ax,@data
mov ds,ax
mov ah,09h
mov dx,offset msg1
int 21h
mov ah,09h
lea dx,msg2
int 21h
mov ah,4ch
int 21h
end
Output:
Comments
Post a Comment