invoke atodw, addr MyDWORD, addr MyString

That's how I assumed it should work?
It doesn't seem to...
A 'lil help please:)
Posted on 2003-03-18 04:24:31 by Homer
Here is a quick example:

.model flat,stdcall
option casemap:none

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

string db '7546754',0
format db 'eax=%u',0
buffer db 12 dup(?)
invoke atodw,addr string ; eax=7546754
invoke wsprintf,addr buffer,addr format,eax
invoke StdOut,addr buffer
invoke ExitProcess,0
end start

Posted on 2003-03-18 04:52:17 by Vortex
i figured out that

invoke atodw, MyDWORD, addr MyString

works fine... for some reason the method doesn't want the address of the DWORD.
Posted on 2003-03-18 05:03:25 by Homer
The reason being that the return value can be dword and not a string. When working with strings, you need to know the address of the string.
Posted on 2003-03-18 06:52:39 by roticv
The atodw function from the MASM32.lib requires only ONE argument, i.e. the address of the alphanumeric string. It returns the dword binary result in EAX from where you can do whatever you want with it.

If you are using a atodw function from some other library, you should verify how many parameters are required, their type, and their order, i.e. learn how to use each library function properly.

Posted on 2003-03-18 10:47:57 by Raymond
you're right, i musta been thinking of dwtoa
Posted on 2003-03-18 10:52:33 by Homer