News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Equating structures for UNICODE et al

Started by donkey, February 27, 2006, 02:13:55 AM

Previous topic - Next topic

donkey

Hi Jeremy,

I was wondering why I can't use an equate for structures, for example...

HD_ITEM STRUCT
mask DD
cxy DD
pszText DD
hbm DD
cchTextMax DD
fmt DD
lParam DD
iImage DD
iOrder DD
type DD
pvFilter DD
ENDS

HDITEM equ HD_ITEM


This would be handy for the STRINGS UNICODE switch in INC files, for example you could have 2 structures...

MYSTRUCTW STRUCT
uString DW 16 DUP (?)
ENDS

MYSTRUCTA STRUCT
aString DB 16 DUP (?)
ENDS

#IF STRINGS UNICODE
MYSTRUCT=MYSTRUCTW
#ELSE
MYSTRUCT=MYSTRUCTA
#ENDIF


Allowing a block of definitions at the end of the file as opposed to spread out through it. It would make it easier to have nested #IF/#ENDIF blocks for IE and Windows versions as well as UNICODE.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Actually the examples you give do compile ok.  I found the problem arises when you try to provide an override when declaring the structure eg. MyData MYSTRUCT <"hello struct">
What seems to be happening is that GoAsm deals with the structure properly and applies the overrides, but because MYSTRUCT is really an equate, this confuses GoAsm when it finishes assembling the sructure.  It tries to deal with the override a second time.  This bug will need some careful attention so I shall fix it as soon as I have a quiet moment.
Thanks for bringing this to my attention, Donkey.
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

Hi Jeremy,

The bug also appears when you declare the structure as LOCAL, it will not recognize the new structure label.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable

jorgon

Edgar

Got to the bottom of this one!
The fix is in GoAsm Version 0.55.03 beta available from here.

Many thanks
Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

donkey

Thanks Jeremy,

A quick test shows it working perfectly, the macro problem as well.

Edgar
"Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." -- Bender
"It was just a dream, Bender. There's no such thing as two". -- Fry
-- Futurama

Donkey's Stable