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?

Recommended Answers

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

Jump to Post

All 3 Replies

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

commented: 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.

Be a part of the DaniWeb community

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