In: Computer Science
Greetings!!
mov dx, OFFSET Msg
mov ah, 9h
int 21h
This code is used to diplay the content of the string named Msg on to the screen.
Complete code:
org 100h
.data ;data segment
W DW 1234 ;declare 2 bytes in memory with variable name W and initial value of 1234
A DB 23 ;declare 1 byte in memory with variable name A and initial ;value of 23
B DB -12 ;declare 1 byte in memory with variable name B and initial ;value of -12
Msg db "Good Morning!!$" ;declare a string with name Msg and initialized with ;message Good Morning!!
.code ;code segment
mov ax,@data
mov ds,ax
mov dx, OFFSET Msg ;load the address of the string Msg into the register DX ;for displaying to the screen using DOS system call
mov ah, 9h ;parameter for system call for displau=ying the string. ;Each DOS service need a parameter loaded into the AH register before the system ;call
int 21h ;calling DOS system call for displaying the string
hlt ;terminate the execution
ret
Screenshots:
Hope this helps