There are two tables T1, T2 in memory having ten eight bit data in each. Write a program for 8085 to find the difference of the corresponding element of these two tables. Store the result of each operation on the corresponding element of the third table. Remember that the result should not be negative; it hold be |T1-T2|.
Solution:
Solution:
- Code:
LXI H,0A000H ;T1
LXI D,0B000H ;T2
LXI B,0C000H ;Result
Re:
LDAX D
CMP M
JNC Skip
XCHG
LDAX D
Skip:
SUB M
STAX B
INX H
INX D
INX B
MOV A,L
CPI 0AH
JNZ Re
HLT