Write an assembly language program to ADD six BCD numbers which are stored starting from memory location 8500H. Store the BCD sum and number of times carry generated into the memory locations 9000H and 9001H respectively and display the entire sum at Port 10H and Port 20H.
#ORG 8000H
MVI D,00H
MVI B,05
LXI H, 8500
MOV A,M
LOOP:ADD M
JNC LOOP1
INR D
LOOP1: INX H
DCR B
JNZ LOOP
STA 9000
OUT 10MOV A,D
STA 9001
OUT 20
HLT
#ORG 8500
#DB 1,1,1,1,1,1
Post a Comment
0 Comments