namour84 0 Newbie Poster

I am writing a program to calculate how many times the hex decimal number 1ED used between memory locations 0400H and 07FFH and store the result in A ( for 8085)
so my solution is :
MVI C,00H
LXI H,0400H
LXI B,03FFH
MVI A,1EDH
LOOP :CMP M
INX H
JNZ LOOP
MOV A,M
INR C

i don't know what to do even my solution to this point it's incorrect .. soooooooo
plz help me guyssssssssssssssssssssss