How can i count the number of zeros in an integer using assembly ???

Recommended Answers

Let's forget the "using assembly" part of the question for a second... do you have an idea of how to count the zeros in an integer at all? Please give us what you've come up with so far.

Jump to Post

All 3 Replies

Let's forget the "using assembly" part of the question for a second... do you have an idea of how to count the zeros in an integer at all? Please give us what you've come up with so far.

actually i do .. for example in java if u want to count the zeroes in the number the code will be as follows


int count=0;
int number;
while (number>0){
if (number % 10 == 0){
count=count +1;
}
number=number/10;
}

Okay! Where are you getting stuck translating this to assembly? Also, which assembler are you writing for?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.