Logo 
Search:

Assembly Language Articles

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

To read string character by character and display them

Posted By: Rayner Fischer     Category: Assembly Language     Views: 44468

Program to read string character by character and display them.

Code for To read string character by character and display them in Assembly Language

.8086
.MODEL SMALL
.STACK 64
.DATA
        STRING DB ? 
        SYM DB '$'
        INPUT_M DB 0ah,0dh,0AH,0DH,'ENTER STRING',0DH,0AH,'$'
.CODE
MAIN PROC
        MOV AX,@DATA
        MOV DS,AX

        MOV DX,OFFSET INPUT_M    ; lea dx,input_m
        MOV AH,09
        INT 21H

        LEA SI,STRING

INP:    MOV AH,01
        INT 21H

        MOV [SI],AL

        INC SI

        CMP AL,0DH
        JNZ INP

       ; MOV AL,SYM
        MOV [SI],'$'
 
;        MOV DL,0AH
;        MOV AH,02H
;        INT 21H

        MOV DX,OFFSET STRING
        MOV AH,09H
        INT 21H

        MOV AH,4CH
        INT 21H

MAIN ENDP
END MAIN
;-----------------------------------------------------------------------
;OUTPUT
;-----------------------------------------------------------------------
;ENTER STRING
;An Assembly Language is greate
;An Assembly Language is greate
  
Share: 


Didn't find what you were looking for? Find more on To read string character by character and display them Or get search suggestion and latest updates.

Rayner Fischer
Rayner Fischer author of To read string character by character and display them is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

Other Interesting Articles in Assembly Language:


 
Please enter your Comment

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

 
Siby Xavier from India Comment on: Apr 11
please check this link for sample programs
itsourtech.blogs...ot.in/.../...ith-8086_8654.html

View All Comments