Logo 
Search:

Assembly Language Articles

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

PROGRAM TO COPY ONE STRING INTO ANOTHER STRING WITH AND WITHOUT USING "MOVSB" INSTRUCTION USING MACRO

Posted By: Rose Hughes     Category: Assembly Language     Views: 5346

A PROGRAM TO COPY ONE STRING INTO ANOTHER STRING WITH AND WITHOUT USING "MOVSB" INSTRUCTION USING MACRO.

Code for PROGRAM TO COPY ONE STRING INTO ANOTHER STRING WITH AND WITHOUT USING "MOVSB" INSTRUCTION USING MACRO in Assembly Language

GETSTR MACRO STR
MOV AH,0AH
LEA DX,STR
INT 21h
ENDM

PRINTSTR MACRO STR
MOV AH,09H
LEA DX,STR
INT 21H
ENDM

DATA SEGMENT
        STR1 DB 80,80 DUP('$')
        STR2 DB 80,80 DUP('$')
        MSG1 DB 10,13,'ENTER THE STRING :$'
        MSG2 DB 10,13,'THE COPIED STRING IS :$'
DATA ENDS
CODE SEGMENT
        ASSUME CS:CODE,DS:DATA
        START: MOV AX,DATA
                 MOV DS,AX
        
                 PRINTSTR MSG1
                 GETSTR STR1
                 LEA SI,STR1+2
                 LEA DI,STR2+2
        
                 MOV CL,STR1+1 ;FOR STORING THE LENGTH OF THE STRING
                 MOV CH,00H
       LAB1:   MOV AL,DS:BYTE PTR[SI]
                    MOV DS:BYTE PTR[DI],AL
                    INC DI
                    INC SI  ;FOR GOING TO THE END OF THE STRING
                    LOOP LAB1
        
                   PRINTSTR MSG2
                   PRINTSTR STR2+2
              
                 MOV AX,4C00H
                 INT 21H
CODE ENDS
        END START

OUTPUT
***********
D:\tasm\tasm1>m11
ENTER THE STRING :ABC
THE COPIED STRING IS :ABC
  
Share: 



Rose Hughes
Rose Hughes author of PROGRAM TO COPY ONE STRING INTO ANOTHER STRING WITH AND WITHOUT USING "MOVSB" INSTRUCTION USING MACRO 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!