Advertisements

"" wrote in message
news:...
>
>Hi,
> I have some very basic questions regarding the stack. Firstly,
>
>1. Who saves the base pointer on the stack - the caller or the callee.
>
>Is there a standard at all. I am talking about the push ebp
>instruction. Assume the code is not optimized etc.
>Thanks
>
>

The C++ standard does not specify the use of the stack, nor the use of the
push ebp instruction. Some architectures don't even have a push ebp
instruction at all.
If you question does not relate to C++, try another newsgroup.

Advertisements

Guest

> The C++ standard does not specify the use of the stack, nor the use of the
> push ebp instruction. Some architectures don't even have a push ebp
> instruction at all.
> If you question does not relate to C++, try another newsgroup.

Do you own the newsgroup. Mind your own business. If people don't
reply I will get the message. I am being very polite with you here.

I am looking at the memory dump of a C++ code. Its been a few years
and I am confused about what I see. Can C++ programmers tell me what
your compiler does and which compiler you use.
(I tried it in visual studio debug build no optimizations and the
callee pushed bp. This is not what I expected. Your thoughts? )
Thanks

"" wrote in message
news:...
>
>
>> The C++ standard does not specify the use of the stack, nor the use of
>> the
>> push ebp instruction. Some architectures don't even have a push ebp
>> instruction at all.
>> If you question does not relate to C++, try another newsgroup.
>
>Do you own the newsgroup. Mind your own business. If people don't
>reply I will get the message. I am being very polite with you here.
>
>I am looking at the memory dump of a C++ code. Its been a few years
>and I am confused about what I see. Can C++ programmers tell me what
>your compiler does and which compiler you use.
>(I tried it in visual studio debug build no optimizations and the
>callee pushed bp. This is not what I expected. Your thoughts? )
>Thanks

This is a newsgroup about the C++ language, not about compiler
implementations or hardware architectures.
I am sorry if you feel offended. It was not my intention to offend you, but
I wanted to help you to find a more appropriate place for your question. I
see no reason to be impolite.
You asked for a standard. In this newsgroup the C++ standard is the
standard. I told you that this standard does not specify the things you
asked.
Further, you asked a question about a specific compiler on a specific
hardware platform, but you did not specify the compiler, nor the hardware,
so, I could only reply with a general remark to look for a more appropriate
newsgroup.
(Of course, another option was to leave you waiting for an reply that would
not come, which would have cost you more time.)
Now you mentioned visual studio (but still no version). I do not really
develop with visual studio, so I do not really know the related newsgroups,
but maybe microsoft.public.vstudio.general may be a starting point.

On Oct 26, 12:06 pm, "" <>
wrote:
> > The C++ standard does not specify the use of the stack, nor the use of the
> > push ebp instruction. Some architectures don't even have a push ebp
> > instruction at all.
> > If you question does not relate to C++, try another newsgroup.

<snip>
> I am looking at the memory dump of a C++ code.

why?
> [It's] been a few years
> and I am confused about what I see. Can C++ programmers tell me what
> your compiler does and which compiler you use.
> (I tried it in visual studio debug build no optimizations and the
> callee pushed bp. This is not what I expected.

why?
> Your thoughts?

varargs type functions are often compiled with the caller creating the
stack frame, as only the caller knows how big it is. Older C compilers
sometime sused this convention for all calls. Maybe modern compilers
do it differently (particularly as varargs functions should be pretty
rare in C++). As people have suggested- read the documentation for
your compiler.

Guest

> > [It's] been a few years
> > and I am confused about what I see. Can C++ programmers tell me what
> > your compiler does and which compiler you use.
> > (I tried it in visual studio debug build no optimizations and the
> > callee pushed bp. This is not what I expected.
>
> why?
>
> > Your thoughts?
>
> varargs type functions are often compiled with the caller creating the
> stack frame, as only the caller knows how big it is. Older C compilers
> sometime sused this convention for all calls. Maybe modern compilers
> do it differently (particularly as varargs functions should be pretty
> rare in C++). As people have suggested- read the documentation for
> your compiler.

So, it looks like -
a) There is no standard
b) There is no convention either.

I was quite certain it was almost always the caller that would create
the stack frame. I take it my memory has failed me.
But thanks for the comment about "varargs type functions".

In my experience with C++ the main program is a top level manager but objects in classes which could be used by demands should be programmed in passive modes via messages send from others. Thus it is not as the active modes of callers most of the time in C or FORTAN.

On 10/27/11 10:32 AM, 88888 Dihedral wrote:
> In my experience with C++ the main program is a top level manager but objects in classes which could be used by demands should be programmed in passive modes via messages send from others. Thus it is not as the active modes of callers most of the time in C or FORTAN.

On Oct 27, 2:46 am, Ian Collins <> wrote:
> On 10/27/11 10:32 AM, 88888 Dihedral wrote:
>
> > In my experience with C++ the main program is a top level manager but objects in classes which could be used by demands should be programmed inpassive modes via messages send from others. Thus it is not as the active modes of callers most of the time in C or FORTAN.
>
> Why do you keep making random posts without any context?

because his responses have no connection to the context. I'm guessing
88888 Dihedral is a rather poorly implemented AI program.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!