flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > determining the type of macro arguments

Author
Thread Post new topic Reply to topic
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 14 Nov 2003, 05:44
Fasm gurus Very Happy ,

I am reading up on macros in fasm and writing some nice ones myself Smile I've read about a feature that I would like to have more information about. In the fasm documentation it says I can determine is an argument passed to a macro is a string constant by using eqtype, for instance.. if strConst eqtype "". I would like to know if I can use it with other data types so that I can do something like
if strConst eqtype dword or if strConst eqtype byte etc.

_________________
silkodyssey
Post 14 Nov 2003, 05:44
View user's profile Send private message MSN Messenger Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 14 Nov 2003, 09:40
No, it distinguishes only parsing-related types of "source components". That means it can distinguish between:

  • individual quoted strings (those not being a part of numerical expression),
  • floating point numbers,
  • any numerical expression (note that any unknown word will be treated as label, so it also will be seen as such expression),
  • addresses - the numerical expressions in square brackets (with size operators and segment prefixes),
  • instruction mnemonics,
  • registers,
  • size operators,
  • near/far operators,
  • use16/use32 operators

(I tried to provide a full list this time). When you compare any symbolic values with "eqtype" operator, they can consist of more than one of the above components - in such case "eqtype" returns true only if they contain components of the same type in exacly the same order. For example, the expression
Code:
 4 eax eqtype 8+8 st0    

is true, as both values consist of numerical expression and register.
Post 14 Nov 2003, 09:40
View user's profile Send private message Visit poster's website Reply with quote
silkodyssey



Joined: 02 Oct 2003
Posts: 198
Location: St.Vincent & the Grenadines
silkodyssey 14 Nov 2003, 11:49
Thank you Privalow, eqtype might not work the way I thought it did but you have given me some useful information that I can use. I like the fasm macro system, very powerful.Smile Are there any other features of the macro system that the documentation does not explain?

_________________
silkodyssey
Post 14 Nov 2003, 11:49
View user's profile Send private message MSN Messenger 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.