hello sorry which method is the correct one we solved a question me and my friend in different methods and we went to our prof he said his method is the correct one and i couldn't get his idea so this one the first one is my way of solution
oh first of all the question :P is to write a FUNCTION ((xvy)^z)*2 and where x y and z are memory locations a000h,a001h,a0002h and store the result in a003 and a004 ( 8085)
MY SOLUTION
LXI H, A000H
MOV A,M
INX H
ORA M
INX H
ANA M
MVI B,02H
MOV A,B
LOOP : ADD B
DCR B
JNZ LOOP
STA A003
STA A004
HLT
. THAT WAS MY WAY AND PLZ IF THERE IS A MISTAKE JUST SHOW ME WHERE IS IT AND MY FRIEND SOLUTION WHICH IS THE CORRECT ONE :(
MVI D,00H
LXI H,A00H
MOV A,M
INX H
ORA M
INX H
ANA M
ADD A
JNC LP
INR D
LP : INX H
MOV M,A
INX H
MOV M,D
HLT
THNX IN ADVANCE GUYS