answersLogoWhite

0


Best Answer

C100 LXI H C200 21 ;

Load the HL register pair immediately

C101 00 ;

C102 C2 ;

C103 MOV B M 46 ;

Move the memory content

(Total number of

data)

in to B register

C104 MVI C 00 0E ;

Initialize

the

C register with 00

H

C

105 00 ;

C106 SUB A 97 ;

Clear the ac

cumulator

C107 INX H 23 ;

Increment the HL register pair (to get the

next

input data)

C108 MOV A M 7E ;

Move the memory content

in to

accumulator

C109 DCR B 05 ;

Decrement the B register

c

o

n

tent

C10A INX H 23 ;

Increment the HL register pair

C10B ADD M 86 ;

Add the memory content to

accumulator

C10C JNC C110 D2 ;

Jump if carry = 0, to C110

H

C10D 10 ;

C10E C1 ;

C10F INR C 0C ;

Increment the C register content

C110

DCR B 05 ;

Decrement the B register content

C111 JNZ C10A C2 ;

Jump if no zero to C10A

H

C112 0A ;

C113 C1 ;

C114 STA C300 32 ;

Store

the

accumulator content

(sum) at C300

H

C115 00 ;

C116 C3 ;

C117 MOV A C 79 ;

Move the C register content to accumulator

C118 STA C301 32 ;

Store

the

accumulator content

(

carry

) at C300

H

C119 01 ;

C11A C3 ;

C11B HL

T 76 ;

Halt the exection

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Assembly language pgm to find sum of n numbers?
Write your answer...
Submit
Still have questions?
magnify glass
imp