flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > eqtype value like dd ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1815
Roman 16 May 2020, 15:22
I want know is this variable or not using eqtype.
How do this ?
Code:
macro A chV {
if chV eqtype dd
              Msg 'variable'
           end if
}

f1 dd 20

A 22
A f1

    
Post 16 May 2020, 15:22
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 16 May 2020, 15:32
In fasmg you can extract this information using "0 metadataof" or equivalent "sizeof" operator. In fasm 1 it is not exposed directly.
Post 16 May 2020, 15:32
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 16 May 2020, 16:07
Because there is no way to get this information directly in fasm 1, in its 64-bit "fastcall" macro there is the following trick used:
Code:
        virtual
         origin = $
         inc param
         load opcode byte from origin
         if opcode = 67h | opcode = 41h
          load opcode byte from origin+1
         end if
         if opcode and 0F8h = 48h
          size@param = 8
         else if opcode = 66h
          size@param = 2
         else if opcode = 0FFh
          size@param = 4
         else
          size@param = 1
         end if
        end virtual    
But it has a limited use, as it can only distinguish between DB, DW, DD and DQ labels.
Post 16 May 2020, 16:07
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1815
Roman 16 May 2020, 17:50
Thanks
Post 16 May 2020, 17:50
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.