Logo 
Search:

Assembly Language Articles

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

PROGRAM TO READ STRING FROM KEYBOARD AND PERFORM REVERSE OF STRING

Posted By: Arnelle Schmidt     Category: Assembly Language     Views: 9746

PROGRAM TO READ STRING FROM KEYBOARD AND PERFORM REVERSE OF STRING.

Code for PROGRAM TO READ STRING FROM KEYBOARD AND PERFORM REVERSE OF STRING in Assembly Language

        .MODEL SMALL

        .STACK 32

        .DATA

               STR1 DB 0DH,0AH, 'ENTER THE STRING :- $'
               STR2 DB 0DH,0AH, 'YOUR REVERSED STRING IS   :- $'
               nl db 0dh,0ah,'$' 

        .CODE
         START:

                MOV AX,@DATA
                MOV DS,AX


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

                MOV CL,00
                MOV AH,01H

         READ:

                INT 21H


                MOV BL,AL

                PUSH BX
                inc cx
                CMP AL,0DH

                JZ DISPLAY
                
                JMP READ
                
         DISPLAY:

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

                lea dx, nl
                mov ah,09h
                int 21h
                                
         ANS:
                MOV AH,02H
                POP BX
                MOV DL,BL
                INT 21H
                LOOP ANS


        .EXIT

        END  START



;***************************************output*****************************

;ENTER THE STRING :- samir


;YOUR REVERED STRING IS   :- rimas
  
Share: 



Arnelle Schmidt
Arnelle Schmidt author of PROGRAM TO READ STRING FROM KEYBOARD AND PERFORM REVERSE OF STRING is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
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!