The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: donkey on June 06, 2007, 01:57:25 AM

Title: Slight little problem
Post by: donkey on June 06, 2007, 01:57:25 AM
Hi Jeremy,

I was trying to declare an array of structures that contained child structures, for example

SomeStruct STRUCT
element1 DD
element2 DD
element3 DD
ENDS

MyStruct STRUCT
Member1 DD
SubStruct SomeStruct <>
ENDS

DATA SECTION

TestStructs MyStruct 10 DUP <>

CODE SECTION

...


When doing this I get the following error...

QuoteError!
Line 54 of assembler source file (TestIncludes.asm):-
Label of this name already declared:-
TestStructs.SubStruct.element1 DD 0
  In the struct at Line 22 of assembler source file (TestIncludes.asm)

Any idea how I can go about getting an array like this to work ?

Edgar

Title: Re: Slight little problem
Post by: six_L on June 06, 2007, 04:52:14 AM
testStructs  MyStruct 10 DUP (<>)
Title: Re: Slight little problem
Post by: jorgon on June 06, 2007, 10:50:40 AM
Hi Edgar

This problem arises from the duplicate symbols being created because of the nested structure.
When dealing with the nested structure, GoAsm is normally aware that a DUP has been declared somewhere higher up in the source and does not produce a duplicate label, so this fault shouldn't happen.
I have begun to identify why GoAsm is not aware of this in this particular instance, and I shall provide a fix asap.
Title: Re: Slight little problem
Post by: jorgon on June 07, 2007, 10:07:20 AM
The fix for this problem is attached.

Thanks for letting me know about this.

[attachment deleted by admin]
Title: Re: Slight little problem
Post by: donkey on June 07, 2007, 01:34:05 PM
Thanks very much for the fix Jeremy. FYI, the solution works perfectly well in the DATA SECTION but fails with the same error when used in the CODE SECTION, not sure if this is by design.

Edgar