flat assembler
Message board for the users of flat assembler.
Index
> Main > Is it possible this on "stdcall" macro? |
Author |
|
LocoDelAssembly 22 Oct 2009, 13:58
Yes, and it is very simple:
Code: stdcall ebx, addr ebp + 11223344 |
|||
22 Oct 2009, 13:58 |
|
alorent 22 Oct 2009, 14:26
Woww, LocoDelAssembly, thanks!!!
By the way, I see that the generated code is: Code: lea edx, [ebp + 11223344] push edx call ebx Is it possible to control that code generation and use EAX instead of EDX? That is, like: Code: lea eax, [ebp + 11223344] push eax call ebx I have been looking at the PROC32.INC file, but don't see that code being generate at all. Thanks!!! |
|||
22 Oct 2009, 14:26 |
|
r22 22 Oct 2009, 15:02
@alorent
Try the WIN32AX.INC and WIN32AXP.INC files. The ADDR is part of the PUSHD macro. So replace Code: lea edx,[..address] Code: lea eax,[..address] But if you start editing the includes you'll need to take note when you use a newer/upgraded version of FASM to re-implement your changes. |
|||
22 Oct 2009, 15:02 |
|
LocoDelAssembly 22 Oct 2009, 15:04
You have to look in WIN32?X*.inc instead:
Code: match pushd =addr var,pushd value \{ \local ..opcode,..address virtual at 0 label ..address at var mov eax,dword [..address] load ..opcode from 0 end virtual if ..opcode = 0A1h push var else lea edx,[..address] push edx end if pushd equ \} You can't change the register unfortunately (I mean, without changing the includes). However, if you need such control, besides doing LEA and then using EAX as argument (which only works you need a single argument with the ADDR loaded into EAX), I suggest you not using stdcall at all and doing plain PUSH/CALL yourself. IMHO, macros should only be used when (1) you perform the same task several times, and (2) when you would perform the task in the very same way each time without macros. PS: Well, r22 replied first but I think it is still somewhat important what I've said above |
|||
22 Oct 2009, 15:04 |
|
alorent 22 Oct 2009, 18:28
Thanks a lot guys!!!
|
|||
22 Oct 2009, 18:28 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.