Assume all variables are signed 32bit quantities except for
Assume all variables are signed 32-bit quantities, except for when you can tell they are characters. Topic: Function calls in UNIX 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.
Solution
Contents of stack for the functions given:
Pointer
Stack Contents
Address
j
12
i
8
Return address
4
ebp
Offset Starting Address
0
m
-4
n
-8
SomePointer
p
-12
Since the given function is 32-bit (4 bytes) each address has the difference of 4 bytes and the negative address given are reserved by the OS or the kernel to store the values of m, n, p.
| Pointer | Stack Contents | Address |
| j | 12 | |
| i | 8 | |
| Return address | 4 | |
| ebp | Offset Starting Address | 0 |
| m | -4 | |
| n | -8 | |
| SomePointer | p | -12 |
