hi there,
look here please

http://www.asmcommunity.net/board/index.php?topic=18766

thanks :-)
Posted on 2004-07-02 06:31:20 by Tenshi
Here's the reverse of what you want:



HexToInt PROC USES ebx esi pHexString:DWORD
mov esi, pHexString
xor eax, eax
xor ebx, ebx
mov bl, [esi]
.WHILE bl != NULL
.IF bl > '9'
sub bl, 7
.ENDIF
sub bl, '0'
cmp bl, 0Fh
ja InvalidHexValue
or al, bl
shl eax, 4
InvalidHexValue:
inc esi
mov bl, [esi]
.ENDW

shr eax, 4
ret
HexToInt ENDP


It's not the best code in the world, but you can probably figure out how to rewrite it to do what you want.

Spara
Posted on 2004-07-28 20:10:42 by SowWn
This is an old thread, but this is the best code I could think of right now:



push eax
shr al,4
call outdig
pop eax
outdig:
and al,15
daa
cmp al,10
sbb al,207
stosb
ret
Posted on 2004-07-29 11:32:35 by Sephiroth3
great!!! 8)
just what I needed!!
Posted on 2004-09-21 07:38:10 by motumboe