flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > struc x{} and macro and sizeof.x error.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1807
Roman 20 Mar 2015, 12:10
I want do this.
Code:
macro UINT chName { chName dd 0}
    


Code:
struc X
{
UINT x;
}
    


I want get size struc X, but fasm get me error.
I do mov eax,sizeof.X and get error.

I copy many struc from c++, and I want to do less work. Very Happy
Post 20 Mar 2015, 12:10
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20358
Location: In your JS exploiting you and your system
revolution 20 Mar 2015, 12:20
You need to define what you want sizeof.X to be.
Code:
struc X arg {
  .:
  UINT arg
  sizeof.#arg = $ - .
}    
Post 20 Mar 2015, 12:20
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1807
Roman 20 Mar 2015, 14:44
revolution
not work.

I do
Code:
myt X
sizeof.myt error !
    
Post 20 Mar 2015, 14:44
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 22 Mar 2015, 10:28
revolution wrote:
You need to define what you want sizeof.X to be.
Code:
struc X arg {
  .:
  UINT arg
  sizeof.#arg = $ - .
}    
This sample has a few things mixed. The "sizeof" defining line should look more like:
Code:
sizeof.#. = $ - .    
Post 22 Mar 2015, 10:28
View user's profile Send private message Visit poster's website 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.