Created
February 6, 2016 10:50
-
-
Save abrarShariar/fe7eaf1e0875f093bee3 to your computer and use it in GitHub Desktop.
swap variable(char) with intermediate register
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;swap between two varible with intermediate register | |
.model small | |
.stack 100h | |
.data | |
a db ? | |
b db ? | |
.code | |
main proc | |
mov a,'1' | |
mov b,'2' | |
;before swap | |
mov ah,02 | |
mov dl,a ;1 | |
int 21h | |
mov dl,b ;2 | |
int 21h | |
xchg dl,a ;swap | |
mov b,dl | |
;tab | |
mov ah,02 | |
mov dl,09h | |
int 21h | |
;after swap | |
mov dl,a | |
int 21h ;2 | |
mov dl,b | |
int 21h ;1 | |
main endp | |
end main | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment