This site is developed to help engineering students. The site is new. Right now, we have only microprocessor programs in here. We will keep including more topics on more subjects in the future.
Microprocessor 8085 Programs

Monday, June 24, 2013

Add Two Numbers Stored In Memory

Program: Add two numbers stored in memory and save the sum & carry in memory.

Note: Program starts from memory location 8000H.
         Assuming the two numbers stored in 9000H and 9001H;
         Storing sum/lower byte at 9002H, carry/higher byte at 9003H.

Label
Memory Location
Mnemonics
Opcode
Operand


8000
MVI C, 00H
0E



8001


OO


8002
LDA 9000H
3A



8003


OO


8004


90


8005
MOV B, A
47



8006
LDA 9001H
3A



8007


O1


8008


90


8009
ADD B
80



800A
JNC SKIP
D2



800B


0E


800C


80


800D
INR C
OC


SKIP:
800E
STA 9002H
32



800F


O2


8010


90


8011
MOV A,C
79



8012
STA 9003H
32



8013


O3


 8014 


90


8015
HLT
76


No comments:

Post a Comment