Professional Documents
Culture Documents
Number of 1s and Parity
Number of 1s and Parity
data ends
code segment
push dx push ax
lea bx,num mov cl,[bx] mov dl,[bx+1] sub cl,30h sub dl,30h mov ah,00h mov al,cl mov dh,0ah mul dh add al,dl mov cl,al
pop ax pop dx
call number
mov bx,offset n1
add ch,30h
mov ch,00h
again:
mov ah,00h mov al,ch mov bh,02h div bh cmp ah,00h jnz go1
go1:
end1: ret
endp number