flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > structures in 'proc' macro? |
Author |
|
madmatt 03 Apr 2006, 14:25
Is it possible to have structures in the proc macro?
EX: proc var1, var2, systime:SYSTEMTIME |
|||
03 Apr 2006, 14:25 |
|
Tomasz Grysztar 03 Apr 2006, 15:14
You don't push the structure on stack, you only push the pointer to structure. And pointer is always DWORD.
|
|||
03 Apr 2006, 15:14 |
|
madmatt 03 Apr 2006, 15:36
Yeh, I know, but would it be too difficult to add this feature, it would make coding a bit easier.
|
|||
03 Apr 2006, 15:36 |
|
vid 03 Apr 2006, 15:52
no, IMO it would be stupid to add this feature, mainly because people will use it without knowing what they are doing.
|
|||
03 Apr 2006, 15:52 |
|
madmatt 03 Apr 2006, 17:42
Why would someone use this feature if they don't know what it is, or what it does? Anyways, using assembly for ANYTHING requires a good bit of programming skill to start with.
|
|||
03 Apr 2006, 17:42 |
|
okasvi 03 Apr 2006, 21:26
so what difference would it make to have ptrSomeStructure:STRUCTURE compared to this code?
Code: format PE GUI 4.0 entry start include '%fasminc%\win32ax.inc' struct Bleh asdasd rd 1 asdasd1 rd 1 dwTest rd 1 ends humm dd 69h bleh_struct Bleh proc TestProc ptrBleh:dword mov edx, [ptrBleh] lea ecx, [edx] mov eax, [ecx+Bleh.dwTest] ret endp start: mov ecx, bleh_struct lea eax, [ecx] push dword [humm] pop [eax+Bleh.dwTest] push bleh_struct call TestProc ;eax = 69h _________________ When We Ride On Our Enemies support reverse smileys |: |
|||
03 Apr 2006, 21:26 |
|
madmatt 04 Apr 2006, 11:03
It would push the whole structure on the stack and not just a pointer.
|
|||
04 Apr 2006, 11:03 |
|
Tomasz Grysztar 04 Apr 2006, 12:15
It's not the "proc" macro that pushes parameters on the stack.
|
|||
04 Apr 2006, 12:15 |
|
vid 04 Apr 2006, 13:47
yes, and macros name which does it ends with "d"
|
|||
04 Apr 2006, 13:47 |
|
okasvi 04 Apr 2006, 20:49
madmatt wrote: It would push the whole structure on the stack and not just a pointer. then how would you get them if proc is like this: Code: struct humm dwInStruct rd 1 szInStruct rb 8h ends proc testproc var1:dword var2:dword blehblah:humm ... ret endp would it be like "mov eax, [blehblah.dwInStruct]" ? and how about pushing before calling? _________________ When We Ride On Our Enemies support reverse smileys |: |
|||
04 Apr 2006, 20:49 |
|
madmatt 05 Apr 2006, 09:25
okasvi,
Let me clarify something, the invoke macro would actually push the structure data on the stack. And the proc macro would actually define the stack pointers to the data. And you would access it just like you would a local structure. |
|||
05 Apr 2006, 09:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.