flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Requested feature for the struct macro

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Would anyone know how to modify the struct macro to align structures on any boundry? An example of what I want to do is below. The align command doesn't work inside a struct macro. I get an 'out of memory error' with the macro code shown in the last code block of this post, does anyone else?

Code:
struct D3DXVECTOR4:16 ;alignment is 16 bytes specified by ":16"
     x dd ?
     y dd ?
     z dd ?
     w dd ?
ends    


or

Code:
struct D3DXVECTOR4 ;make the align command work in struct macros
align 16
     x dd ?
     y dd ?
     z dd ?
     w dd ?
ends    


Macro bug?
Code:
struct _alignD3DXVECTOR4
       x dd ?
       y dd ?
       z dd ?
       w dd ?
ends

macro astruct structname {
      align 16
      struct structname
}

section '.data' data readable writeable
  astruct _alignD3DXVECTOR4    
Post 15 Feb 2007, 23:30
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
madmatt:

1) align is "directive" not command
2) there is nothing like "align doesn't work in struc". "Struc" is preprocess time thing (textual substitution), and "align" is later assembly time thing.

but you are right there still is a problem. That's why i use struc not struct -> i know how it works Wink
Post 16 Feb 2007, 01:03
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Does anyone know how to get around this? Confused I'd like to have this feature so I wouldn't have to remember each time I use a stucture that works better with alignment.
Post 17 Feb 2007, 22:43
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-2020, Tomasz Grysztar.

Powered by rwasa.