News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Can't use macro (ustr$)

Started by Splash, June 28, 2010, 02:54:53 AM

Previous topic - Next topic

Splash

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.

oex

include \masm32\macros\macros.asm
We are all of us insane, just to varying degrees and intelligently balanced through networking

http://www.hereford.tv

box

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



Splash