0

Hello all,

I am trying to self learn the x86 assembly language and I came across a problem that I can't seem to fix. I want to recieve an integer input from the user and convert it to a word. Example: Input = 0 : Output=Zero. Any help?

Edited by Hadi.M

3
Contributors
3
Replies
20
Views
2 Years
Discussion Span
Last Post by gusano79
1

What have you written so far? Is there a specific part of the task you're having trouble with?

Votes + Comments
No actually I have a problem with the entire idea. How do I approach this one?
0

I'd try something like this:

1) I'd create static strings with all your written numbers, eg _zero DB 'Zero',0 etc.
2) I'd put all addresses into a look-up-table, like array DD _zero, _one, ...
3) Then, as the input (BIOS or OS) will be ASCII, you have to convert it to dezimal, which is a simple substraction (see ASCII-table).
4) Now you can simply look-up the address of the corresponding string in the table and voila.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.