flat assembler
Message board for the users of flat assembler.
Index
> Windows > Can't understand STDCALL.INC macro |
Author |
|
Tomasz Grysztar 29 Mar 2004, 21:46
The 8 that is added to EBP is the return address of procedure and the backup of previous EBP value that is always stored on the stack after (that is: below) the parameters.
$ always gives a value of the address at which the current place in code is assumed to occur in memory. You can set this value with the "org" directive (you can even write "$=100h" instead of "org 100h". The special case is the "virtual" directive. This directive marks the temporary code that will not be generated into output file, and you specify address at which it would be supposed to occur in memory. For example: Code: virtual at ebx var1 dd ? var2 dd ? end virtual defines a variable at address "ebx+4", so if you use "mov eax,[var2]" instruction, it will be assembled into "mov eax,[ebx+4]". The "proc" macro starts the virtual block at the appropriate EBP-based address, end this block is ended by the "enter" macro. That's why variables that you put between the "proc" and "enter" won't be actually placed in the code, but they are defined as a local variables with EBP-based addresses. For few more details on using the "virtual", etc. you can look also in manual. |
|||
29 Mar 2004, 21:46 |
|
milind 29 Mar 2004, 22:01
Thanks a lot Privalov it cleared all my doubts. Just one confusion remains. Does this mean that if we declare virtual blocks in our code we will not get the offset as it would be in the output file with the '$' operator. Please clarify.
Thanks for the quick reply. |
|||
29 Mar 2004, 22:01 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.