Logo 
Search:

Assembly Language Articles

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

Program to copy one string into another string use subroutine

Posted By: Reinhart Fischer     Category: Assembly Language     Views: 5598

Write a program to copy one string into another string use subroutine.

Code for Program to copy one string into another string use subroutine in Assembly Language

DIS MACRO STR
        MOV AH,09H
        LEA DX,STR
        INT 21H
ENDM
DATA SEGMENT
    MSG1 DB "ENTER THE STRING : $"
    MSG2 DB "COPYED STRING IS : $"
    LINE DB 10,13,'$'
    STR1 DB 20 DUP('$')
    STR2 DB 20 DUP('$')
DATA ENDS

CODE SEGMENT
         COPY PROC NEAR
         ASSUME CS:CODE
         MOV CX,0000
         MOV CL,BYTE PTR[SI]
         INC SI
      L1:MOV AH,BYTE PTR[SI]
         MOV BYTE PTR[DI],AH
         INC SI
         INC DI
         LOOP L1
         RET
         COPY ENDP
         ASSUME DS:DATA,CS:CODE
START:
         MOV AX,DATA
         MOV DS,AX
         DIS MSG1
         MOV AH,0AH
         LEA DX,STR1
         INT 21H
         DIS LINE
         LEA SI,STR1+1
         LEA DI,STR2
         CALL COPY
         DIS MSG2
         DIS STR2
         MOV AH,4CH
         INT 21H
CODE ENDS
END START

;------
;OUTPUT
;------


    ENTER THE STRING : JINESH
    COPYED STRING IS : JINESH
  
Share: 



Reinhart Fischer
Reinhart Fischer author of Program to copy one string into another string use subroutine is from Frankfurt, Germany.
 
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!