Hey guys, long time no see!
I've working on a project, and I noticed that assume does not work when passed a structure that contains another structure, such as:
include 'struct.inc'
include 'masm.inc'
struct ListStruct
Prev rd 1
Next rd 1
ends
struct TestStruct
Start rd 1
End rd 1
Shared ListStruct <-- assume failed here
ends
format binary
use32
assume edi:TestStruct
StartX: mov [edi+TestStruct.Shared.Next],ecx
mov [edi.Shared.Next],ecx <-- this is never reached by the compiler because of failure on the assume edi line
Both include files were taken from the latest fasm package. This is the error message received:
flat assembler version 1.69.31 (798550 kilobytes memory)
test.asm [18]:
assume edi:TestStruct
masm.inc [49] assume [24]:
reg struct
struct.inc [139] TestStruct [13]:
match , value \\\\{ field type def \\\\}
struct.inc [139] match [0]:
match , value \\\\{ field type def \\\\}
struct.inc [144] ListStruct [13]:
common label . at \\..base \\\}
masm.inc [34] label [3]:
match any,def \\\{ def@assumed reg,.,: \\\} \\}
masm.inc [34] match [0]:
match any,def \\\{ def@assumed reg,.,: \\\} \\}
masm.inc [59] def@assumed [3]:
name equ ..label
error: illegal instruction.
I am not sure if its inside the "struct" or "assume" macro, because if I used
struct TestStruct ListStruct
Start rd 1
End rd 1
ends
then "assume" works fine. It just fails whenever there is a substructure within the structure. Since I have several structures that uses several substructures, including more than one ListStruct, either we can figure out what's wrong and fix "struct", "assume", or both macros, or I could start writing the long way which makes reading the source a bit unweildy (at least in my opinion) when many operations are done on the structure pointed to by a single register.
Thanks all!