Logo 
Search:

Assembly Language Articles

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

PROGRAM TO WRITE A PROGRAM TO PERFORM AN EXCHANGE OF ELEMENTS OF TWO ARRAY

Posted By: Aidan Evans     Category: Assembly Language     Views: 4089

A PROGRAM TO WRITE A PROGRAM TO PERFORM AN EXCHANGE OF
ELEMENTS OF TWO ARRAY.

Code for PROGRAM TO WRITE A PROGRAM TO PERFORM AN EXCHANGE OF ELEMENTS OF TWO ARRAY in Assembly Language

DATA SEGMENT

        ARY DB 10H,20H,30H,40H,50H
        ARY1 DB 15H,25H,35H,45H,55H 

DATA ENDS

CODE SEGMENT

        ASSUME DS:DATA,CS:CODE

        START:

                MOV AX,DATA
                MOV DS,AX

                MOV CX,05H
                LEA SI,ARY
                LEA DI,ARY1

                LAB:
                        MOV AL,DS:BYTE PTR[SI]
                        MOV AH,DS:BYTE PTR[DI]
                        MOV DS:BYTE PTR[DI],AL
                        MOV DS:BYTE PTR[SI],AH
                        INC SI
                        INC DI
                        LOOP LAB

                MOV AX,4C00H
                INT 21H

CODE ENDS
        END START


OUTPUT
***********
4FF7:00F0 44 3A 5C 54 41 53 4D 5C
4FF7:00F8 54 41 53 4D 31 5C 54 44
4FF7:0100 15 25 35 45 55 10 20 30
4FF7:0108 40 50 00 00 00 00 00 00
  
Share: 



Aidan Evans
Aidan Evans author of PROGRAM TO WRITE A PROGRAM TO PERFORM AN EXCHANGE OF ELEMENTS OF TWO ARRAY is from London, United Kingdom.
 
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].

 
No Comment Found, Be the First to post comment!