flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Where would i put "align 4" in the ends macro?

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 03 May 2006, 01:45
I'm having trouble finding a place to put an "align 4" in the ends macro. Where, in the ends macro I would put this?
Post 03 May 2006, 01:45
View user's profile Send private message Reply with quote
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 23 Aug 2006, 06:15
I tried this:
Code:
struct cord
x rb ?
y rb ?
align 4
z rb ?
ends
    

but it doesn't seems to afect in any way
but you can align all the structure like:
Code:
align 4
mycord cord
    

I don't know if this is what you want.
Post 23 Aug 2006, 06:15
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt 27 Aug 2006, 20:04
Just wanted to know where in the struct macro itself to put an "align 4" so I wouldn't have to do it after every struct define, that's all. For some reason It didn't work for me.
Post 27 Aug 2006, 20:04
View user's profile Send private message Reply with quote
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 28 Aug 2006, 04:09
in the include/macro/struct.inc file:
just at the begining of the macro :

Code:
macro struct name
 {  align 4    ;<--here
 fields@struct equ name
   match child parent, name...
...
...
...
...    

I think that will align all the structures you create with the struct macro
to a dword boundary.
Post 28 Aug 2006, 04:09
View user's profile Send private message Reply with quote
UCM



Joined: 25 Feb 2005
Posts: 285
Location: Canada
UCM 28 Aug 2006, 13:44
No, it will only align where you originally defined the struct and not where you use it Wink
Post 28 Aug 2006, 13:44
View user's profile Send private message Reply with quote
daluca



Joined: 05 Nov 2005
Posts: 86
daluca 29 Aug 2006, 06:21
yes! my mistake:

I tried a quick solution assembling a file with just three structures,
but I declare the structure and then use it. That's why I got an alignment.
but if I declare the structures somewhere else: no alignment.

Well then,I join in to the question: what can we do to get automatic alignment everytime we use a structure defined with the struct macro?
Post 29 Aug 2006, 06:21
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.