Help with Assembly: Pacman Game Counter Not Counting Numbers

  • Thread starter Thread starter $ @ l^l^l @ R
  • Start date Start date
  • Tags Tags
    Assembly
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 6K views
$ @ l^l^l @ R
Messages
4
Reaction score
0
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 anyone knows how can I let it counts and displays numbers !

Thank you . . .
 
Physics news on Phys.org
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.
 
thank 4 your reply

but the counter is working properly
except that it doesn't displaying numbers
it displays ascii charachters :S
 
i added 30h to convert ascii to decimal
but started counting from 1 then b then symbols
:S
 
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?
 
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 :)