Tuesday, 25 June 2013

8085 program for multi-byte decimal addition

The counter is stored in 8E00H. The first set of numbers is stored from 8E01H onward, and the second set starts from 8F01H. The sum of numbers in corresponding positions is finally placed in the address of the first set of numbers.

Mnemonics:

LXI H, 8E00H
LXI D, 8F01H
MOV C, M
INX H

LOOP:
   LDAX D
   ADD M
   MOV M, A
   DCR C
   INX H
   INX D
   JNZ LOOP
   HLT

Observation table:
Memory Address
Content Before
Content After
8E00
03H
03H
8E01
12
23
8E02
10
25
8E03
09
20
8F01
11
11
8F02
15
15
8F03
11
11

©Dixit Bhatta 2013

2 comments:

  1. The program is for demimal or hexadecimal? As for decimal addition we need to give DAA instruction after ADD instruction.
    When I executed the program it works hexadecimal multibyte addition.

    Thank you.

    ReplyDelete

Was this post helpful? Ask any questions you have, I will try to answer them for you.