Friday 14 October 2011

How to add two numbers without using ADD command?

To add two numbers without using ADD command first we need to understand the basics of addition. The basic of addition is that we increment the first number by 1 upto second number to reach the answer of their additon. The same procedure will be followed here in this program

CODE
MVI A,08
MVI B,54
LABEL: INR A
DCR B
JNZ LABEL
HLT

Screen shot of the program ran in simulator is here:




No comments:

Post a Comment