flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Help with a macro mod. |
Author |
|
madmatt 12 Jul 2005, 07:24
How would I make the latest 'proc' macro allow me to use "ret value", which would produce the code:
Code: mov eax, value
retn
|
|||
12 Jul 2005, 07:24 |
|
Vasilev Vjacheslav 13 Jul 2005, 04:24
macro return val
{ mov eax,val ret } |
|||
13 Jul 2005, 04:24 |
|
madmatt 13 Jul 2005, 17:56
hmmm, didn't think of making a separate macro, was putting the macro code right in with the 'proc' macro.
thanks! I'll give it a try MadMatt |
|||
13 Jul 2005, 17:56 |
|
madmatt 14 Jul 2005, 00:27
Sorry, but I need something that works inside the 'proc' and 'cproc' macro(s), I need it to: mov eax, value:retn, not whatever it does now.
|
|||
14 Jul 2005, 00:27 |
|
Reverend 15 Jul 2005, 08:33
Replace ret macro from 'proc' with this:
Code: macro ret val \{ leave if ~ val eq mov eax, val end if if args retn args else retn end if \} |
|||
15 Jul 2005, 08:33 |
|
madmatt 15 Jul 2005, 14:42
I don't think this will work with the latest macros, the proc macro has now been broken into 3 or 4 pieces.
|
|||
15 Jul 2005, 14:42 |
|
Tomasz Grysztar 15 Jul 2005, 15:07
I suggest you to use the other name (like "return" proposed above - I recommend it as the best solution), since "ret value" for MASM compatibility now mean the same as "retn value" - encodes the single instruction, as opposed to "ret", which unrolls the whole epilogue code. I will soon finish documenting new "proc" in the Win32 Headers documentation, and it will tell you also how to enable custom prologue/epilogue.
The solution proposed by Reverend will also work, if you decide to use the custom definition of "proc" macro. However I tried to make "proc" customizable enough without the need to change standard headers. |
|||
15 Jul 2005, 15:07 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.