flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Same var in 2 different macros isn´t working

Author
Thread Post new topic Reply to topic
FlashBurn



Joined: 06 Jan 2005
Posts: 87
FlashBurn 28 Feb 2005, 08:28
I have these 2 macros:

Code:
;----------------------------
macro call proc, [arg]
{
common
                __ARGC= 0
   if ~ arg eq
forward
              __ARGC= __ARGC+1
reverse
 if arg in <eax,ebx,ecx,edx,esi,edi,ebp,esp>
           push arg
            __ARGC= __ARGC+1
    else
                push arg
    end if
common
    end if
              call proc
   if ~ arg eq
         add sp,2*__ARGC
     end if
}
;----------------------------

;----------------------------
macro calld proc, [arg]
{
common
               __ARGC= 0
   if ~ arg eq
forward
              __ARGC= __ARGC+1
reverse
         push arg
common
  end if
              call proc
   if ~ arg eq
         add sp,4*__ARGC
     end if
}
;----------------------------
    


If I use the above code the 2nd macro will always mov 0 into sp! Why? If I use another name for __ARGC it is working.
Post 28 Feb 2005, 08:28
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 28 Feb 2005, 10:29
Maybe you need to declare __ARG as local?
Post 28 Feb 2005, 10:29
View user's profile Send private message Visit poster's website ICQ Number 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.