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?
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?
What have you written so far? Is there a specific part of the task you're having trouble with?
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.
Here's a more complete approach to converting from numbers to words (in English, anyway).
As for the programming task, what assembler are you using? Are you writing something that will run on the same machine you use to code it, or do you have a virtual environment along the lines of 8086tiny?
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.