Hello i'm just started with assembler I hope someone can help me with this : I have a number in esi and i want to display the decimal of it in a messagebox can someone tell me how to do that ? thanks.:)
Posted on 2001-11-06 12:30:06 by pietje
Included in the MASM32 package is the MASM32.LIB, in this wonderous collection of useful little routines is one which does exactly what you want - dwtoa!

It takes two arguments:
a DWORD - your number to be converted
a pointer to the buffer where the text will be written.

e.g.


.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
include \masm32\include\masm32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\masm32.lib

.data
buffer db 32 dup (0)

.code
start:
invoke dwtoa, 0AFh, ADDR buffer
invoke MessageBox, NULL, ADDR buffer, NULL, MB_OK
invoke ExitProcess, eax
end start


Mirno
Posted on 2001-11-06 12:44:10 by Mirno
Perfect ,exactly what i was looking for thank you very much!
Posted on 2001-11-06 12:58:05 by pietje