Here is the question that I am stuck on, or rather don't seem to understand..
Q.) Write assembly code to implement the following function calls, using C/UNIX calling conventions. Show the contents of the stack on entering the called function
int myfunc2(int,char*); //prototype
...
char[] bob=”Bob's your uncle!”;
...
myfunc2(18, bob); //function call
Heres the extent of what I understand, function parameters are passed from the end to the front. Also since the parameters are not a 32 bit quantity only the address of the beginning of the array is pushed onto the stack So the parameters would be pushed onto the stack like so..
|-----------------------------------|
| bob (address) |
|-----------------------------------|
| 18 |
|-----------------------------------|
This is what I think the contents of the stack would look like, an alternative would be adding addresses of all the contents of array bob into the stack. The powerpoint slide where I am learning from is not too clear on this and there is not further examples, I just want to make sure my understanding of the subject is correct before I proceed further. Thanks! Any help or guidance would be much appreciated.