flat assembler
Message board for the users of flat assembler.

Index > Main > equ with structs

Author
Thread Post new topic Reply to topic
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
Have been trying to hide away my interface declarations again.

Why does something like this: (with the equ in an include file)

Code:
IDIRECTDRAWSURFACE7  equ        interface AddAttachedSurface,AddOverlayDirtyRect,Blt...
primary                         IDIRECTDRAWSURFACE7    


give an Error: Illegal instruction, but the resulting error line works perfectly if substituted into the code?

Code:
primary interface AddAttachedSurface,AddOverlayDirtyRect,Blt...    


Is there a correct to hide away the declaration of data types like this, without using struct?

_________________
This is a block of text that can be added to posts you make.
Post 07 Oct 2011, 23:06
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Hard code the struct (think about obfuscation)
But consider speed and size too Wink
Post 08 Oct 2011, 03:28
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
I don't know what interface is but have you tried using fix instead of equ?
Post 08 Oct 2011, 12:02
View user's profile Send private message Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler
Hey! That works!

So the preprocessor stage is already over when the equ is substituted in, making the macro unintelligible for the compiler?
Post 08 Oct 2011, 12:12
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 619
cod3b453
I wish I knew the order of operations and I could be wrong on this but I think that equ evaluates too early on IDIRECTDRAWSURFACE7, whereas the fix evaluates on primary. Question
Post 08 Oct 2011, 12:46
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.