expat 글 보다가 무슨 말인지 몰라서 검색은 해봤는데 점점더 미궁으로 빠져드는 느낌이다 ㄱ-
일단은 call stack 관련 선언문이라는것 외에는 이해를 전혀 못하겠다 ㅠ.ㅠ
[링크 : http://en.wikipedia.org/wiki/X86_calling_conventions]
일단은 call stack 관련 선언문이라는것 외에는 이해를 전혀 못하겠다 ㅠ.ㅠ
cdecl On the Intel 386, the cdecl attribute causes the compiler to assume that the calling function will pop off the stack space used to pass arguments. This is useful to override the effects of the -mrtd switch. stdcall On the Intel 386, the stdcall attribute causes the compiler to assume that the called function will pop off the stack space used to pass arguments, unless it takes a variable number of arguments. fastcall On the Intel 386, the fastcall attribute causes the compiler to pass the first two arguments in the registers ECX and EDX. Subsequent arguments are passed on the stack. The called function will pop the arguments off the stack. If the number of arguments is variable all arguments are pushed on the stack. [링크 : http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html] |
콜링 컨벤션(Calling convention) MS방식은 5가지 __cdecl __stdcall __fastcall thiscall naked [링크 : http://codesafe.tistory.com/94] |
All arguments are widened to 32 bits when they are passed. Return values are also widened to 32 bits and returned in the EAX register, except for 8-byte structures, which are returned in the EDX:EAX register pair. Larger structures are returned in the EAX register as pointers to hidden return structures. Parameters are pushed onto the stack from right to left. The compiler generates prolog and epilog code to save and restore the ESI, EDI, EBX, and EBP registers, if they are used in the function. Note When a struct, union, or class is returned from a function by value, all definitions of the type need to be the same, else the program may fail at runtime. For information on how to define your own function prolog and epilog code, see Naked Function Calls. The following calling conventions are supported by the Visual C/C++ compiler.
[링크 : http://msdn.microsoft.com/en-us/library/984x0h58%28VS.71%29.aspx] |
[링크 : http://en.wikipedia.org/wiki/X86_calling_conventions]
'Programming > C Win32 MFC' 카테고리의 다른 글
CD-ROM 삽입시 메시지 - win32 api cdrom insert message (2) | 2010.07.04 |
---|---|
변수인데 왜 operation on 'variable' may be undefined 야? (5) | 2010.04.22 |
C++ 클래스 공용 변수 초기화 (3) | 2009.11.25 |
static 변수의 범위(scope of static variable) (0) | 2009.10.29 |
2차원 배열 (0) | 2009.10.27 |