Logo 
Search:

Assembly Language Articles

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

A PROGRAM TO WRITE A PROGRAM TO EXCHANGE TWO MEMORY LOCATIONS WITH OUT USING `XCHG' INSTRUCTION

Posted By: Adalwolf Fischer     Category: Assembly Language     Views: 13504

A PROGRAM TO WRITE A PROGRAM TO EXCHANGE TWO MEMORY
LOCATIONS WITH OUT USING `XCHG' INSTRUCTION.

Code for A PROGRAM TO WRITE A PROGRAM TO EXCHANGE TWO MEMORY LOCATIONS WITH OUT USING `XCHG' INSTRUCTION in Assembly Language

DATA SEGMENT
        A DB 50H
        B DB 60H
DATA ENDS

CODE SEGMENT

        ASSUME DS:DATA,CS:CODE
        START:
                MOV AX,DATA
                MOV DS,AX

                MOV AL,A      
                MOV AH,B
                MOV BL,AL
                MOV AL,AH
                MOV AH,BL
                MOV A,AL
                MOV B,AH

                MOV AX,4C00H
                INT 21H

CODE ENDS
        END START

OUTPUT
***********

 BEFOR           AFTER
 ax 0000        ax 06C1
 bx 0000        bx CD36
  
Share: 



Adalwolf Fischer
Adalwolf Fischer author of A PROGRAM TO WRITE A PROGRAM TO EXCHANGE TWO MEMORY LOCATIONS WITH OUT USING `XCHG' INSTRUCTION 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!