Page 1 of 1

How to convert ASCII number into decimal number

Posted: Wed Jan 28, 2015 11:51 am
by BrightLight
Hello, I need help.
Let's say we have this code:

Code: Select all

mov si, number
call change_number

number			db "80"
As you can see, the number is actually a number in ASCII text. How do I convert this to 80 itself (non ASCII)? I don't mind if you tell me to do it in hex or decimal, both are fine.
Help will be greatly appreciated! :)

Re: How to convert ASCII number into decimal number

Posted: Wed Jan 28, 2015 11:59 am
by alexfru
I'd expect OS devers to be able to either figure out trivial things like this on their own or have sufficient google-fu skills.
What have you tried?

Re: How to convert ASCII number into decimal number

Posted: Wed Jan 28, 2015 12:01 pm
by BrightLight
alexfru wrote:What have you tried?
Pretty much everything, there's nothing on this topic anywhere.
Just if it may help, I'm doing this in NASM.

Re: How to convert ASCII number into decimal number

Posted: Wed Jan 28, 2015 12:08 pm
by Combuster
The first attempt at finding the answer provided one. Case dismissed.