The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Splash on June 28, 2010, 02:54:53 AM

Title: Can't use macro (ustr$)
Post by: Splash on June 28, 2010, 02:54:53 AM
Hi all!
I can't use macro ustr$.

This is my code:

.386

.model flat, stdcall
option casemap :none
include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
include \masm32\include\masm32.inc
includelib \masm32\lib\masm32.lib

.data
MessageTitle    db      "Result", 0
Result          db      "0"

.code
start:
    mov eax, 10
    add eax, 10
    mov Result, ustr$(eax)
    invoke MessageBox, NULL, addr Result, addr MessageTitle, MB_OK
    invoke ExitProcess, 0   ;The end :)
end start


I got this error:
QuoteC:\Users\Igor\Desktop\MASM32\hellow.asm(21) : error A2006: undefined symbol : ustr$

I know that is a stupid question, but I am new to assembly, and don't understand how
to use macros.  :red

Sorry my bad english skills too. I am portuguese speaker.
Title: Re: Can't use macro (ustr$)
Post by: oex on June 28, 2010, 03:09:05 AM
include \masm32\macros\macros.asm
Title: Re: Can't use macro (ustr$)
Post by: box on June 28, 2010, 03:11:57 AM
Try this:


    include \masm32\include\masm32rt.inc

.data
MessageTitle    db      "Result", 0

.data?
Result          dd      ?

.code
start:
    mov eax, 10
    add eax, 10
    mov Result, ustr$(eax)
    invoke MessageBox, NULL, Result, addr MessageTitle, MB_OK
    invoke ExitProcess, 0   ;The end :)
end start


Title: Re: Can't use macro (ustr$)
Post by: Splash on June 28, 2010, 03:14:17 AM
box:
thanks!!!
Worked! :D