flat assembler
Message board for the users of flat assembler.
Index
> Main > Optimization of "format MS COFF" connected to C _ |
Author |
|
revolution 11 Nov 2010, 07:57
The fastcall standard is already defined about the order of register assignment. You don't need to "tell" MSVC, you just use them in the order that the fastcall standard defines. MSVC assigns them according to fastcall, and you consume them according to fastcall.
|
|||
11 Nov 2010, 07:57 |
|
mkm79 11 Nov 2010, 08:06
revolution wrote: The fastcall standard is already defined about the order of register assignment. You don't need to "tell" MSVC, you just use them in the order that the fastcall standard defines. MSVC assigns them according to fastcall, and you consume them according to fastcall. MSDN says about __fastcall: Quote:
So, it clear that only 2 registers will be used. But in 32-bit mode we have at least eax,ebx,ecx,edx,esi,edi (and more, depending on target CPU, MMX & SSE registers). maybe existing some other calling convention "__supercall"? _________________ Best regards, Kostya |
|||
11 Nov 2010, 08:06 |
|
mkm79 11 Nov 2010, 08:16
Intresting.
Borland has different __fastcall Quote:
Thus, i suppose that in MSVC i should use __asm keyword to call my fast function. Is there are any info regarding "Best Practices for mixing FASM and MSVC" ? _________________ Best regards, Kostya |
|||
11 Nov 2010, 08:16 |
|
revolution 11 Nov 2010, 08:40
Yes, as you discovered compilers differ in what that think is fastcall.
Also keep in mind that you need to comply with the saving and restoring of EBX, EDI, ESI and EBP if you use them. You can't simply use registers as you feel like it, else your program will likely end up crashing. |
|||
11 Nov 2010, 08:40 |
|
mindcooler 11 Nov 2010, 12:28
Code: mov eax,[a1] add eax,[a2] add eax,[a3] Ahh, that feels better. _________________ This is a block of text that can be added to posts you make. |
|||
11 Nov 2010, 12:28 |
|
bitRAKE 11 Nov 2010, 15:05
All parameters passed in ESP - pointer to structure that is.
|
|||
11 Nov 2010, 15:05 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.