Help with Assembly: Pacman Game Counter Not Counting Numbers

  • Thread starter Thread starter $ @ l^l^l @ R
  • Start date Start date
  • Tags Tags
    Assembly
Click For Summary

Discussion Overview

The discussion revolves around programming a counter for a Pacman game using assembly language. Participants address issues related to displaying numbers correctly, as the counter initially shows ASCII characters instead of numerical digits.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant describes a problem where the counter displays ASCII characters instead of numbers, seeking help to resolve this issue.
  • Another participant suggests determining the number of decimal digits to display and provides a method for extracting individual digits from the total count.
  • A participant mentions that they added 30h to convert ASCII to decimal but encountered issues with the counter starting from 1 and then displaying symbols.
  • There is a suggestion to ensure that the correct number of characters is printed, especially when dealing with double-digit numbers.
  • A later reply indicates that the original poster resolved the issue by adjusting their approach to count properly from 1 to 9 before adding additional digits.

Areas of Agreement / Disagreement

The discussion shows a progression from confusion about the counter's output to a resolution, with some participants providing suggestions and clarifications. However, there is no explicit consensus on the initial methods used to display numbers correctly.

Contextual Notes

Some limitations include unclear descriptions of the initial implementation and the specific operations being performed, which may affect the understanding of the problem.

Who May Find This Useful

This discussion may be useful for individuals working on assembly programming, particularly those interested in game development and character display issues.

$ @ 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 . . .
 
Technology 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
 
You have to convert an integer into ASCII numbers: 48= character "0" for example.
 
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 :)
 

Similar threads

  • · Replies 30 ·
2
Replies
30
Views
7K
Replies
12
Views
2K
  • · Replies 20 ·
Replies
20
Views
6K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 75 ·
3
Replies
75
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K