CPU uses stack to pass parameters and to save return address before jumping to next function call. It also uses stack memory for loading and storing local variables. Below is a stack grow example of a function call which has this following prototype-
int function (int argument1, int arrgument2)
Here we have a local variable Local.
Program calls more and more inner functions, call frame grows.
With the above prototype compiler pushes argument2 then argument1 and then call the function.
Call instruction pushes the return address and further inside the function compiler
pushes BP. Compiler will put local after this.
Now as stack grows in a perticuler direction so after each and every inner function call,
address of the local would be either increasing or decreasing position.
If we compare the address values we would definitely get the direction details.
Here is a small C code example. Here we are passing the address of a local of an outer function to an inner
function call. Now as we called a function stack has grown. Next is compare the address of two locals.