With the assumption that there are 100 eight bit data in a table starting from memory location A000H, write a program to find the sums of even and odd numbers of the table and store the 16-bit sums at the end of the table.
SOLUTION:
SOLUTION:
- Code:
LXI B,0000H
LXI D,0000H
LXI H,0A000H
Agn: MOV A,M
RRC
RLC ;Restore origial data but CY holds D0 bit
JC Odd
ADD C
MOV C,A
JNC Nxt
INR B
JMP Nxt
Odd:ADD E
MOV E,A
JNC Nxt
INR D
Nxt:INX H
MOV A,L
CPI 64H
JNZ Agn
MOV M,C
INX H
MOV M,B
INX H
MOV M,E
INX H
MOV M,D
HLT