Hey all,
I know this is a masm forum.. but I've recently been using FASM too and the one thing I really love in MASM which I haven't been able to get right in FASM is the following syntax to access data/structures:
mov eax,(MyStructureType PTR [edi]).member
Obviously this doesn't work in FASM, does anyone know a similar type of syntax for FASM? Google and the manual haven't been very helpful ;)
Ok I found it...
mov eax,[edi+MyStructureType.member]
that works... however, RADASM doesn't pickup the autocomplete due to the structure being declared as:
struct MyStructureType
val dd 0
ends
instead of:
MyStructureType struct
val dd 0
ends
Is there a way to get RADASM to pickup both?
I see in Radmasm's page that the ASM programming pack also supports fasm. You need to specify fasm instead of masm in its ini file.
Ok I eventualllly got it right... the steps are:
Use the fasm.ini file
in your fasm code include the struct macro file to support more classic struc style as follows:
include 'c:/fasm/include/macro/struct.inc' ; FASM Structures.
Then you can declare structures using
struc NAME
member dd ?
ends
then you need to update the main ini file for struct members and code blocks to support the name post identifier and an ends without a name.. and it all comes together.
johnsa,
Concerning the structure question:
One of the many uses of virtual
struc MyStructureType
val dd 0
ends
mov edi, "address of MyStructureType"
virtual at edi
myStruc MyStructureType
end virtual
mov eax, [myStruc.val]
hth,
farrier