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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.