Professional Documents
Culture Documents
1
AlM: Write a program in 8085 to add two 8 bit numbers using:
i) Immediate addrossing
ii) Direct addressing
ii) Indirect adiressing
ALGORITHM:
7. Jump on if no carry
PROGRAM CODE:
#UsingInumediate Addressing:
AGdress Label Mnemonies Hex Code Comments
2000 MVI C,00 OL, 00 Initialize the carry as zero
2002 MVi A, 04 3E. 04 Load the first 8 bit data in acc
2004 MVI B.02 06,02 Load the first 8 bit data in
register B
2006 ADD B 80 Add the twovalucs
2007 JNC D2,03, 20 Jump on il no carry
200A INR carry is there ineremeníI
20013
by one
Loop STA 2500 32(R).29) Storc the added value in ihe
ccumulator
AP &MC Iat heniual| fCr Dept
200E
MOV A,CC 79 Move the valuc of cary to
the accumulator from
200F register C
STA 2501 32 ()1, 25) | Store the value of carry in
2012 HLT the accumulator
76 Stop the program cxccution
#Using Direct Addressing:
Address Label Mnemonics Hex Code
2000 Comments
2032 MVIC,00 CE, 00 Initialize the carry as zero
2005 LDA2500 3A, K00, 25) Load the first
MOV, B,A 47
8 bit data
Copy the value of 8 bit data
2006
LDA 2501 into register B
3A, (O1, 25) Load the second 8 bit data
2009 ADD B into the accumulator
200A 80 Add the two values
200D JNC D2.OE, 20
INR C Jump on i[ no carry
OC If carry is there increment it i
200E by one
Loop STA 2502 32 (02,25) Store the added valuc in the
2011 accumulator
MOV A,C 79 More the vatue of
carry to
the accumulator
from
2012 Tegister C
STA 2503
32(03, 25) Store the value of
carry in
2015 HLT theaccumulator
16 Stop the program execution
With caTy
Input Address Value
2.500 FF
2501 F
F E
Result:
The assembly language program tor 8 bit addition of
numbers was exccuted successfully by two
using 8085 micro processing kit.
Viva Questions: MP &MCtab Manuul ttig