# Help in assembly

1. Dec 25, 2007

### $@ l^l^l @ R hi . . . I have been working on a project it's to program Pacman Game using assembly it needs al counter for the number of dots earned by Pacman I have done a counter but it doesn't counting numbers it displays charachters like smily face, heart, and all these whose ASCII code starts from 00H to FFH please if any one knows how can I let it counts and displays numbers ! Thank you . . . 2. Dec 26, 2007 ### CRGreathouse Determine how many decimal digits you will show. Let's say you want to do three digits. For the first, take the number of dots, divide by 100 (= 10^(3-1)), mod 10, using the appropriate operations for the size of the number stored. Then add '0' to get the digit. (reverse Polish notation: N 0x64 / 0x0A % 0x30 +) Just vary the number you divide by each time to get different digits. 3. Dec 26, 2007 ###$ @ l^l^l @ R

thank 4 your reply

but the counter is working properly
except that it doesn't displaying numbers
it displays ascii charachters :S

4. Dec 26, 2007

### Staff: Mentor

You have to convert an integer into ASCII numbers: 48= character "0" for example.

5. Dec 26, 2007

### $@ l^l^l @ R i added 30h to convert ascii to decimal but started counting from 1 then b then symbols :S 6. Dec 26, 2007 ### Hurkyl Staff Emeritus Er, I'm just guessing since you haven't been entirely clear about what precisely you are doing that's failing... Did you instruct the computer to print a single character when, in fact, you are trying to print a double-digit number? 7. Dec 26, 2007 ###$ @ l^l^l @ R

thank u all . . . i did it

Hurkyl ;
ya i was working only on one digit
but when it counted properly from 1 to 9 then gave symbols
i added the other digits
so the counter is perfect
thank u :)

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook