How do you do addition of 32 bit numbers in 8085?
In order to add 32 bit numbers in the 8085, you need to add them
8 bits at a time, tracking the carrys between each add.
LXI B,first_number
LXI H,second_number
LXI D,result
LDAX B ;first byte - no carry in
ADD M
STAX D
INX B; point to next byte
INX D
INX H
LDAX B ;second byte - carry in
ADC M ;note the ADC instead of ADD
STAX D
INX B; point to next byte
INX D
INX H
LDAX B ;third byte - carry in
ADC M
STAX D
INX B; point to next byte
INX D
INX H
LDAX B ;fourth - carry in
ADC M
STAX D