Google

Jun 25, 2008

assambley Language program for swapping two numbers

swap the two numbers
the following program will swap the two numbers
eg; 23 will be changed to 32

LDA 2000H
MOV B,A
LDA 2200H
STA 2000H
MOV A,B
STA 2200H
HLT
the algorithm of the program is simple just copy the fist number in to register B and second number in to register A while storing store them in the reverse way that id first store the contents in the A first and then store the contents in register B

No comments: