I take it you're looking for a Hamming Distance or something. You can get a value with a zero in each bit that is different by using XOR. If you want to deal with ones, then invert it. You can count by setting up a loop and applying an AND mask for each bit, successively, or you can use shift/rotate and count when the carry flag is set after each shift/rotate. I haven't written 8085 assember in about 15 years, so I'm not posting actual code.

If you set b0 of the mask and AND it with the target, then you can tell if the target bit was set by the outcome. If it's set, increment your count. Move the bit in the mask to b1. Wash, rinse, repeat, until done.