Re[2]: argv



Hi David,

I don't have any templates because templates are not a part of any machine
code language specification, nor are they necessary when programming in
assembly, since everything is hand-coded to whatever specification you feel
like coding it to.

_pascal was used for older 16-bit Windows programs.
_stdcall is used for newer 32-bit Windows programs.
_cdecl is the defacto standard for all main() functions *declared* in C.

All three conventions use the same stack parameter order of right-to-left.
That means the stack will look the same for _stdcall and _cdecl upon entry to
main() on a 32-bit system:

   esp-0 = rtn addr
   esp-4 = *argc
   esp-8 = ***argv

The fact that GCC is based on all three C standards, which means that
main(*argc,***argv) in GTK must be _cdecl, but even if it weren't, the only
difference that could matter here, is that the stack would look like this upon
entry to main() on a 32-bit system:

   esp-0 = rtn addr
   esp-4 = ***argv
   esp-8 = *argc

_fastcall is not applicable here, but in the case of GCC/GTK, it would mean
ecx and edx would contain the first two command line parameters, which they
most definitely do not in this instance.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]