Free Electronic Circuits & 8085 projects

Electronic projects with circuit diagram and 8085 microprocessor projects.

Add two 8-bit numbers

Published on Nov 11 2009 // Learners

Statement: Add the contents of memory locations 4000H and 4001H and place the result in memory location 4002H.


Sample problem

(4000H) = 14H

(4001H) = 89H

Result     = 14H + 89H = 9DH

 

Source program

LXI H 4000H : HL points 4000H

MOV A, M : Get first operand

INX H : HL points 4001H

ADD M : Add second operand

INX H : HL points 4002H

MOV M, A : Store result at 4002H

HLT : Terminate program execution

Flowchart

3 - Flow chart for Add two 8-bit numbers

Note: In Program 1, direct addressing instructions are used, whereas in Program 2, indirect addressing instructions are used.

Related Programs for Beginners: (Click down)

Store 8-bit data in memory

Add two 16-bit numbers

Subtract two 16-bit numbers.

Finding Two’s complement of a number