I need to add 4 bytes of data 03H, 02H, 05H, 01H using the stack and store the result in 3350H in the i8085 microprocessor. The data bytes come from 4 contiguous memory locations starting 3300H. How to go about doing this? So far I have done this:
LXI SP,3599H ;Stack initialised
MVI L,00H
PUSH H
POP PSW ;Flags Cleared
LXI H,3300H
PUSH H
INX H
PUSH H
INX H
PUSH H
INX H
PUSH H
MVI A,00H
POP B
ADD B
POP B
ADD B
POP B
ADD B
POP B
ADD B
STA 3350H
HLT
I'm sure this isn't a good method because there is a lot ot repeating. Can there be some sort of loops to make it work better?