flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > something strange appear. Explain me what happens, please.

Author
Thread Post new topic Reply to topic
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body 25 Oct 2006, 12:17
first code(works normal):
Code:
format PE Console

include 'win32ax.inc'

;macro def_opt456
  ; {
   macro opt6 param
     {
        define hTFs 0
        match =1,param#.proc
        \{ call param
           define hTFs 1 \}
        match =0,hTFs \{ call [param] \}
     }
   ;}

;def_opt456

define EntryPoint.proc 1

.code
EntryPoint:
        int 3
        opt6 EntryPoint

        invoke ExitProcess,0
.end EntryPoint    





in the second code, something strange appear.
Code:
format PE Console

include 'win32ax.inc'

macro def_opt456
   {
   macro opt6 param
     \{
        define hTFs 0
        match =1,param#.proc ;<- here. !!!
        \\{ call param
           define hTFs 1 \\}
        match =0,hTFs \\{ call [param] \\}
     \}
   }

def_opt456

define EntryPoint.proc 1

.code
EntryPoint:
        int 3
        opt6 EntryPoint

        invoke ExitProcess,0
.end EntryPoint    


the string "match =1,param#.proc" after preprocessing looks like:
match=1,param.proc

but I pass to this macro an argument.
i think must be something like:
match =1,EntryPoint.proc then match =1,1

what am i miss?
Post 25 Oct 2006, 12:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 25 Oct 2006, 12:42
you must escape "#" operator too: "\#"
Post 25 Oct 2006, 12:42
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
dead_body



Joined: 21 Sep 2005
Posts: 187
Location: Ukraine,Kharkov
dead_body 25 Oct 2006, 13:44
thanks, vid.
Post 25 Oct 2006, 13:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.