flat assembler
Message board for the users of flat assembler.
![]() |
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.
|
|||
![]() |
|
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 |
|||
![]() |
|
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 |
|||
![]() |
|
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. |
|||
![]() |
|
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. |
|||
![]() |
|
bitRAKE 11 Nov 2010, 15:05
All parameters passed in ESP - pointer to structure that is.
![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.