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 Ten Numbers Stored in Contiguous Memory Locations

Program: Add ten numbers stored in contiguous memory locations.

Note: Program starts from memory location 8000H.
         Assuming numbers to be added stored in memory locations 9001H to 900AH.
         Storing sum(lower byte) at 8FFFH, carry(higher byte) at 9000H.

Label
Memory Location
Mnemonics
Opcode
Operand


8000
MVI C, 00
OE
OO


8002
MVI B, 09
O6
O9


8004
LXI H, 9001H
21
O1
90

8007
MOV A,M
7E


LOOP:
8008
INX H
23



8009
ADD M
86



800A
JNC SKIP
D2
0E
80

800D
INR C
OC


SKIP:
800E
DCR B
O5



800F
JNZ LOOP
C2
O8
80

8012
STA 8FFFH
32
FF
8F

8015
MOV A, C
79



8016
STA 9000H
32
OO
90

8019
HLT
76


No comments:

Post a Comment