flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 23 Aug 2011, 08:45
Used this way with "struc", it defines symbols EXCEPTION_POINTERS.ExceptionRecord = 0 and EXCEPTION_POINTERS.ContextRecord = 4. Without this, you couldn't do something like "mov eax, [ebx + EXCEPTION_POINTERS.ContextRecord]", because "EXCEPTION_POINTERS.ContextRecord" symbol wouldn't be defined. "struc" doesn't define it, it is only a special kind of macro. FASM is very lowlevel assembler, and uses this kind of "trickery" quite often, in order to be very powerful by having only handful of simple features, which can be combined to build expected features.
"virtual" itself defines all labels inside it, but not the data. You don't need to really understand this, as long as you only use it for structures. |
|||
![]() |
|
AsmGuru62 23 Aug 2011, 13:23
I use virtual to generate code for structures in IDE I am developing:
Code: virtual at 0 RECT: .Left INT32 ? .Top INT32 ? .Right INT32 ? .Bottom INT32 ? .size =$ end virtual In this case, I can access the members of a structure: Code: macro RECT_WIDTH r32_width, r32_pRect { mov r32_width, [r32_pRect + RECT.Right] sub r32_width, [r32_pRect + RECT.Left] } Or allocate memory for the structure using .size member: Code: invoke HeapAlloc, [hAllocator], HEAP_NO_SERIALIZE, RECT.size |
|||
![]() |
|
ghostreaper 07 Sep 2011, 07:51
thank you all of you very much.I got it!
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.