flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Problem with fix directive/How to hide macroses

Author
Thread Post new topic Reply to topic
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Hello. I'm trying to hide some macroses to limit its scopes. The problem is that I don't know how to do this without touching the include file. The idea I had was using fix directive but it doesn't work
Code:
irps macroName, test mov load
{
forward
local priv

  macroName fix priv
}
    


The fix has no effect, if I do "macro a{display `test}a" only displays "test". Changing "`test" with "`macroName" displays "priv" (so the definition doesn't get really local). If in the IRPS I add a slash at "macroName fix priv" fix doesn't take effect anymore (no error, nothing fixed at all).

Should I give up? I'm out of ideas of how to make already written macroses available only for a certain part of code. Note that I can't use purge on those private macroses because them are used inside macroses that are public so I can only "unfix" them when I finish to define the public ones.

Thanks for any help on this problem.
Post 12 Jul 2007, 22:08
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
if you are using them only in few macros, then you can define and undefine them inside macro which uses them:

(code not tested)
Code:
macro define_private {
  macro private \{
    ...
  \}
}

macro something1 {
  define_private
  ...
  purge private
}

macro something2 {
  define_private
  ...
  purge private
}

something1 ;works
something2 ;works
private ;causes error
    
Post 12 Jul 2007, 23:28
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Not only are not few but them also define many sub macroses and others preprocessor constructs (there are things like "\\\\\{" already).

Another things that doesn't work are
Code:
macro private {
local priv
  macro fix macro priv
}    
and
Code:
macro private {
local priv
  macro fix macro priv#
}    


The latter because unfortunatelly the # is not available outside macroses (but even if it were working the resulting name would be "privname" and not "priv?XXXXXXXXname" Sad

Thanks for the idea anyway.
Post 12 Jul 2007, 23:48
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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.