What I learned from the module

What I learned from the module

by Anando Nath Rabidas -
Number of replies: 0

Single Character, String and Number Printing to Display.

Write an assembly level program to print a given string .

  1. Create a string
  2. Load the effective address of the string in dx using LEA command
  3. Print the sting by calling the interrupt with 9H in AH
  4. The string must be terminated by ‘$’ sign
.MODEL SMALL 
.STACK 100H 
.DATA 
;The string to be printed 
STRING DB 'Anando Nath Rabidas', '$'
  
.CODE 
MAIN PROC FAR 
 MOV AX,@DATA 
 MOV DS,AX 
  
 ; load address of the string 
 LEA DX,STRING 
  
 ;output the string
 ;loaded in dx 
 MOV AH,09H
 INT 21H 
  
 ;interrupt to exit
 MOV AH,4CH
 INT 21H 
  
MAIN ENDP 
END MAIN 

Output:  Anando Nath Rabidas