News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

When must I cleanup to adjust the stack Pointer

Started by tathams, April 07, 2006, 02:30:01 PM

Previous topic - Next topic

tathams

From reading various docs I understand that different calling conventions require the caller or the callee to adjust the stack pointer before returning or just after returning from a function call.

If I use the Invoke SomeFunction, PARAM1, PARAM2 etc  macro type of calling things do I have to do anything afterwards.

Many of these functions are stdcall which I think will cleanup after themselves but others might be C or syscall or PASCAL.

Thanks in advance for you help


BogdanOntanu

Theoretically, IF you define the function prototype corectly, the assembler will do this for you.
(ie it will clear the stack acording to the function's calling convention)

In Win32 API wsprintf is notorious CDECL, all other API is STDCALL.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

tathams

Excellent. Another reason to use all of the features of a modern assembler.