0

Ball In A Box Productions
; *** Count the number of bits in DWORD bitCount proc STDCALL num:DWORD sub eax,eax ; clear a bit counter mov ecx,eax ; zero add ecx,num ; add the number to be bit counted je noBits ; jump and exit if no bits bitLp: inc eax ; count one bit mov ebx,ecx ; get number to bit count dec ebx ; invert all LSB's and ecx,ebx ; clear all the inverted bits jne bitLp ; loop if more bits noBits: ret ; return with bit count in eax bitCount endppseudocode