Hey everyone, been using this site for a lot of my programming needs, but is time I would appreciate some help. Just started assembly language and I am having trouble with a problem.
The question: Write a program that will prompt the user to enter a number and then the program will determine the number of 1s that the binary representation of the number contains and display the result.
Example:
Enter in a number: 2
Number of 1s in this: 1
Enter in a number: 3
Number of 1s in this: 2
-------------------------------------------------
So some of the questions I have been considering...
Do I need to convert from decimal input to binary?
I know how to display the message and you need to use int 16h to enter in the decimal number right?
.model small
.stack
.data
message db "Enter in a number:", "$"
.code
main proc
mov ax,seg message
mov ds,ax
mov ah,09
lea dx,message
int 21h
mov ax,4c00h
int 21h
main endp
end main
I am lost lol