Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to read a string , character by character and display the same

Posted By: Harry Evans     Category: Assembly Language     Views: 4279

A Program to read a string , character by character and display the same.

Code for Program to read a string , character by character and display the same in Assembly Language

.MODEL  SMALL
.DATA
        
        NW_LINE DB      0AH,0DH,'THE OUTPUT IS: ','$'
        STR1    DB     ?
.CODE

MAIN    PROC

        MOV     AX,@DATA
        MOV     DS,AX
        LEA     SI,STR1

GOBAK:
        MOV     AH,01H
        INT     21H
        CMP     AL,0DH
        JE      BAK
        MOV     [SI],AL
        INC     SI
        JMP     GOBAK

BAK:
        MOV     AL,'$'
        MOV     [SI],AL


        MOV     AH,09H
        LEA     DX,NW_LINE
        INT     21H


        MOV     AH,09H
        LEA     DX,STR1
        INT     21H      

        MOV     AH,4CH
        INT     21H

MAIN    ENDP
        END     MAIN
     

OUTPUT
***********

Z:\SYSTEM~1\AS1>ex2
hello
THE OUTPUT IS: hello
 
  
Share: 



Harry Evans
Harry Evans author of Program to read a string , character by character and display the same is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!