Long story short, I finally created advanced struct macro for fasm g, based on and inspired by Tomasz's example, which can do some cool things. Would be glad if you could test it away and point to any bugs or suggest optimizations.
Before I start describing the macro, I'd like to say my thanks to Tomasz for this wonderful engine. When I first tried it when it first appeared I was like yeah, okay, its interesting. But it took some time and learning effort to realize how extremely cool it is.
In its current implementation the macro may not work correctly with pe.inc from examples if relocations are present in output .exe. This is because I redefine standard data types like dd or dword and align macro. I myself don't use pe.inc from examples and at the moment didn't have enough time to test against it. Sorry. I'll tune this later, when come back from vacation (having a flight in the morning).
; it's possible to fill the array with values
list1LISTletters:<1,2,3,4> ; or it's possible to override data types to fill more array elements at once
list2LISTletters:<word0x1111, word0x2222> list3LISTletters:<dword0x44444444> ; it's also possible to use smaller datatypes to initialize the variable
; but in this case the value will be padded with zeroes to data type size
point2POINTx:<word0x5555> ; point2 POINT x:<word 0x5555, word 0x6666> is not allowed
; it's possible to address any item in the array separately
list4LISTletters: 'a', letters: 'b', letters: 'c' ; data type can be overriden, too
arrays of structures
The same rules apply to variables which define structures
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