Guest
Hello all the experts here,
I would like to know how a typical porcessor executes a function call
or subroutine call in a assembly code.
I know it uses stack for doing it and I do understand the mechanism
about the stack here. I would want to go one step further and ask you
how it exaclty saves the internal variable, returned variable and call
in functions and all those things. If you see I am asking something
like a compiler design, where in it maps the high-level language into
architecture specific assembly code. I would really appreciate if you
could do with an example.
I propose something like this,
main {
int k = foo (int a, int b, int c);
foo uses lets says 5 local varaibles.
where in foo calls another function
int l = foo1 (int d, int e);
foo1 uses 2 local variables.
Please shed some thought on this.
Thanks in advance
Hariharan K Srinivasan.
I would like to know how a typical porcessor executes a function call
or subroutine call in a assembly code.
I know it uses stack for doing it and I do understand the mechanism
about the stack here. I would want to go one step further and ask you
how it exaclty saves the internal variable, returned variable and call
in functions and all those things. If you see I am asking something
like a compiler design, where in it maps the high-level language into
architecture specific assembly code. I would really appreciate if you
could do with an example.
I propose something like this,
main {
int k = foo (int a, int b, int c);
foo uses lets says 5 local varaibles.
where in foo calls another function
int l = foo1 (int d, int e);
foo1 uses 2 local variables.
Please shed some thought on this.
Thanks in advance
Hariharan K Srinivasan.