Hmmm, my recollection (not 8080 but other assembler/machine code stuff) is that you often use the stack because you want the program to be "re-entrant" meaning multiple users could be running the same code. Each user runs the same code in memory, but has a copy of their registers including the stack pointer. So if you use the stack for your variables, each user has their own "copy" and the code is then re-entrant. If you hard-code the variable positions, then it can't be re-used.
I'm sure I'm over-simplifying or remembering something, but I believe that is the gist.
A few other benefits I can think of:
- By using the stack for local variables (ie local to a function), these variables become isolated from the rest of the program. When the function completes, those variables can be popped off the stack, ensuring they don't interfere with other parts of the program. So getting away from every variable being "global" is often a goal... helped by using the stack....
- By using the stack for variables, each function call can get its own copy of the variables, making recursion possible and more straightforward...
- Since the stack is dynamic and only uses memory as needed, you're potentially using memory more efficiently, especially if not all variables are used. Given the small amounts of memory many early systems dealt with, memory conservation was always a big issue.
On the downside you have to follow good stack hygiene and worry about overflows, persistence, etc.