In memory layout of the C++ program




To Mark Randall::First of all thanks for replying . Well i wann to know
the virtual memory layout of the code. and about the assembly code
suppose i have a assembly code i wann to convert it into the exe fileI
wann to know how this can happen. As far as i know the the pointer
addres that we mention in the C++ program are the virtual address. like
suppose i say
int i;int* i_ptr=&i;Here &i returns the virtual address of "i" in the
code. But if u compile this program and get the ASM file you can see
the registers. I dont think the assembly code in the ASM file specifies
the virrtual address. So perhaps for paging the ASM code is converted to
EXE file. I am not sure if this is what happens. I want to know if it is
true. And the stack is not like this as you have mentioned. [Function 1
Vars] [Stack Pointer] [Function 2 Vars] [Stack Pointer] [Function 3
Vars] [Stack Pointer]
But as far as i know it is like first the invironment varriables are
pushed into the stack. then the global values and then the main and
other functions. Well main is replaced by other functions which are
found in the crt0.cpp file.
And the stack pointers you have mentioned, are they storing the virtual
address or the physical address?
If my grammer is poor sorry.



--
DeltaOne
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------



.



Relevant Pages

  • To mark randall
    ... Well i wann to know ... suppose i hav e a assembly code i wann to convert it into the exe fileI ... ASM file you can see the registers. ... And the stack is not like this ...
    (microsoft.public.vc.language)
  • Re: In memory layout of the C++ program
    ... suppose i have a assembly code i wann to convert it into the exe fileI ... wann to know how this can happen. ... But if u compile this program and get the ASM file you can see ... And the stack is not like this as you have mentioned. ...
    (microsoft.public.vc.language)
  • question regarding stack size allocation
    ... The assembly code produced by gcc is the following: ... movl %esp, %ebp ... subl $4, %esp ... The displacement of the stack pointer changes ...
    (comp.lang.c)
  • Re: question regarding stack size allocation
    ... >assembly code produced by gcc. ... >trying to figure out how the stack pointer increments ...
    (comp.lang.c)
  • Re: CPU simulator written in C
    ... C is particularly suitable for such an exercise. ... >- load .asm file ... I hope they're containing machine code and not assembly code, ... Dan Pop ...
    (comp.lang.c)