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: 605
Roman
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: 17342
Location: In your JS exploiting you and your system
revolution
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: 605
Roman
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: 7734
Location: Kraków, Poland
Tomasz Grysztar
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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.