Hey how can I convert a raw hex number such as 01h to '1'? I've looked everywhere but I can't find anything about it :(
Cannot you construct a simple
"jump table"
e.g.
with byte ptr's...?
Each byte...
0,1,2,3,4,5,6,7,8,9
would point to...
30,31,32,33,34,35,36,37,38.39
Just a suggest to help you.
asmftw,
If by "raw hex" you mean a value stored in a register or memory, there have been multiple methods posted here, and there are at least five in the MASM32 library. The methods differ depending on the base of the string, typically 2, 10, or 16, and range from easy to understand and slow to difficult to understand and fast. In the MASM32 library see:
dwtoa
dw2hex
dw2ah
udw2str
ltoa (actually a wrapper for wsprintfA)
For easy to understand and slow see the dw2dec, dw2hex, and b2bin procedures in the support module available here (http://www.masm32.com/board/index.php?topic=7270.msg53765#msg53765). These procedures are 16-bit code, but the same concepts are applicable to 32-bit code.
Thank you I'll use those macros. I used a jmp before but macros are more efficient.
Correction
The line should have read
30,31,32,33,34,35,36,37,38,39
or error
you could process each number as a byte and add 30 :)