flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > structure redefinition

Author
Thread Post new topic Reply to topic
zhak



Joined: 12 Apr 2005
Posts: 501
Location: Belarus
zhak 29 Apr 2005, 22:17
I try to create a struct, for example,
Code:
struct MY_STRUCTA
 .param1 dd ?
 .param2 dd ?
ends

struct MY_STRUCTW
 .param1 dd ?
 .param2 dd ?
ends

    

and then give it another name MY_STRUCT.
I tried
MY_STRUCT fix MY_STRUCTA,
MY_STRUCT = MY_STRUCTA,
MY_STRUCT equ MY_STRUCTA

and nothing works.
When using

mov [ebx+MY_STRUCT.param1], eax

after 'fix', fasm tells me "undefined symbol". What is wrong?
Post 29 Apr 2005, 22:17
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 30 Apr 2005, 08:09
"struc{}" doesn't declare relative address labels (labels which give you address inside structure, like MY_STRUCT.param1).

For that reason there was created macro "struct" which does this at place of "ends". So these labels are declared here, and even if you fix MY_STRUCT later, there isn't any place where relative addresses could be declared with new name. Also "MY_STRUCT" in "MY_STRUCT.param1" isn't fixed because "MY_STRUCT.param1" is considered as single symbol to FASM. "." is part of name, not operator.
Post 30 Apr 2005, 08:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number 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.