;another program to count one bits
.model small
start:  mov     ax, @data
	mov     ds, ax
	mov     es, ax

	mov     ax, count       ;grab the input
	mov     bx, 0000000000000001B  ;mask for one bit at a time
	mov     cl, 16          ;number of times thru loop
deloop: test    ax, bx
	jz      nxt
	inc     num
nxt:    rol     bx, 1           ;setup for next comparison
	sub     cl, 1
	jnz     deloop

	mov     ah, 4ch         ;return to dos
	mov     al, 00          ;error level 0 (no error)
	int     21h             ;dos function call

count  dw 0CCCCh
num    db 0

.stack 100h

	end start