View Single Post
Old Dec 4th, 2006, 7:23 PM   #21
The Dark
Expert Programmer
 
Join Date: Jun 2005
Posts: 852
Rep Power: 4 The Dark is on a distinguished road
well you have two "loop:" lines, so that might be causing a problem.
I don't think you need to put anything in an array. Try some code like this:
[code]
get a
get b

xor a and b into c

set loopCounter to 0
set hamming = 0
loop:
and c with 0x01 into d
if d == 1
increment hamming
shift c right by 1
increment loopCounter
if loopCount <= 32*
goto loop

print hamming

* replace 32 by whatever number of bits you have in your integer

Note: you already have some of this code
The Dark is offline   Reply With Quote