The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Lupo1989 on March 23, 2009, 05:39:21 PM

Title: Persoon.ID to String
Post by: Lupo1989 on March 23, 2009, 05:39:21 PM
hello MASM32 guys,

I am new with ASM, I read a lot of examples and made some scripts already.
Untile now I have to make Persoon.ID to a String, but i dont know how.
Can someone give me any advises? I already watched in google and i cant find the anser

my scritp is something like this:

.486
.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\user32.lib
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\masm32.lib

PERSOON STRUCT
ID DWORD ?

Move dd PERSOON_Move
PERSOON ENDS

.data
Persoon PERSOON <>

MenuName db "Structure Example", 0
.code
start:
mov eax, 0
mov Persoon.ID, eax

push Persoon.ID ; <----- Over here I have to make it a string, but how???
push offset MenuName
call Persoon.Move
ret

PERSOON_Move proc varMenuName:DWORD, varMessage:DWORD
invoke MessageBoxA, NULL, varMessage, varMenuName, MB_OK
ret
PERSOON_Move endp

end start


PS: sorry for my bad English I Come from Holland

Greeze, Lupo1989
Title: Re: Persoon.ID to String
Post by: ToutEnMasm on March 23, 2009, 06:12:40 PM

It's a dword and you want see it as text ?

Quote
.data

szPersonId db 20 dup (0)

.code
.
.
        invoke dwtoa,Person.Id,addr szPersonId


The dwtoa function is in the masm32.lib,then use szPersonId in the messagebox


Title: Re: Persoon.ID to String
Post by: Lupo1989 on March 23, 2009, 06:19:46 PM
THX!!!!