I, i want to get the ASCII-number of an DB-string.

for an example: 'q'->113
how to get the ascii-number ?

THX + bye !
Posted on 2003-03-12 14:54:22 by Forginforcer
I don't understand what you mean. Do you want to convert a numeric string to its numeric value or do you want the get the ascii code of a single character?
Posted on 2003-03-12 15:10:02 by Odyssey
.data

szString db "Hello", 0

.code
xor eax, eax
mov al, szString[0] [color=green]; eax now equals 72[/color]
mov al, szString[1] [color=green]; eax now equals 101[/color]
mov al, szString[2] [color=green]; eax now equals 108[/color]
mov al, szString[3] [color=green]; eax now equals 108[/color]
mov al, szString[4] [color=green]; eax now equals 111[/color]
mov al, szString[5] [color=green]; eax now equals 0[/color]
There is no conversion from an ascii character to a number because they are the same thing.

mov eax, 'q'

is the exact same thing as saying

mov eax, 113

is the exact same thing as saying

mov eax, 71h
Posted on 2003-03-12 17:33:14 by BubbaFate
Year, I want to show via Messagebox not q, rahter 113.
How to realize that ?
Posted on 2003-03-13 10:14:13 by Forginforcer
Is it that you don't know how to convert a binary number to a decimal number and then display it in a message box?

Is that what you need to learn?

Raymond
Posted on 2003-03-13 10:20:18 by Raymond
Year, I want to show via Messagebox not q, rahter 113.


The easiest way to do that is to use the wsprintf function. Or if you would prefer to write the code yourself you should have a look at
this thread
Posted on 2003-03-13 10:30:45 by Odyssey