Following is assembly language for multiplying two 16 bit numbers.
LHLD 0002H ;DATA 1
SPHL
LHLD 0004H ;DATA 2
XCHG
LXI H,0000H
LXI B,0000H
NEXT:
DAD SP
JNC LOOP
INX B
LOOP:
DCX D
MOV A,E
ORA D
JNZ NEXT
SHLD 0006H ;LSB
MOV L,C
MOV H,B
SHLD 0008H ;MSB
HLT
I did not understand the instruction ORA D
. Why ORing
is done here? Please can anyone explain it. Thank You!