flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > dot in "struc" question

Author
Thread Post new topic Reply to topic
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix
Hi All!
Please help me to do next thing:
Code:
 struc D init
 {
  ;label . ; if uncommented - got "symbol already defined" error
  match any , init \{ . dd init \}
  match     , init \{ . dd ? \}
  ...Type = 1
 }

 struct A
  d   D
 ends

 a A
 d D

 const = d...Type ; OK
 mov [a.d], 1 ; a.d - OK
 mov eax,a.d...Type ; failed, not defined       


The goal - to get D type work as a part of other structures with "...Type" constant for appropriate structure element defined. Please explain, what is wrong here and how to get it work.

Thanks.

_________________
Flat Assembler is the best!
Post 25 Mar 2009, 18:27
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
I'm sorry, the "struct" macro is not designed to work with structures defined other way than with the "struct" macro itself.
Post 25 Mar 2009, 19:00
View user's profile Send private message Visit poster's website Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix
Yes, with

Code:
 struc A
 {
  .d   D
 }            


instead of struct it works. Tomasz, please tell me if it is possible to extend struct for such things and, if it is not hard fo you, show this extension here as example.

Thanks.
Post 25 Mar 2009, 19:14
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
No, there's no easy way. The design of macro was based on that assumption from the beginning, and it's not possible to easily adapt this design.
Post 25 Mar 2009, 19:24
View user's profile Send private message Visit poster's website Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix
Thank you anyway, Tomasz.
Post 25 Mar 2009, 19:31
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7724
Location: Kraków, Poland
Tomasz Grysztar
Well, I still recommend using only the "struc" directive for any advanced purposes.
Post 25 Mar 2009, 19:40
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.

Powered by rwasa.