Advertisement
4C3

Count no of 1 in binary digit

4C3
Dec 2nd, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. .MODEL SMALL
  2. .STACK 100H
  3. .DATA
  4. .CODE
  5. MAIN PROC
  6.  
  7. XOR BL,BL
  8. XOR AL,AL
  9. MOV CX,8
  10. MOV BL,11111010B
  11.  
  12. TOP:
  13.  
  14. SHR BL,1
  15. JNC SKIP
  16. INC AL
  17. SKIP:
  18. LOOP TOP
  19.  
  20. MOV DL,AL
  21. ADD DL,48
  22. MOV AH,2
  23. INT 21H
  24.  
  25. MAIN ENDP
  26. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement