I am read a passage about stack. But I don't understand the following sentence: Since the stack grows down, the first parameter will be stored at the lowest address (this inversion of parameters was historically used to allow functions to be passed a variable number of parameters).
My question is: I think even if the parameters are not inversion-ly stored, we can still allow to pass a variable number of parameters. For example, sp = sp - 4
, then we push the first parameter's value onto the stack
, then we do another sp = sp - 4
and push second parameter
and so on.
Thanks!