To simulate stack storage in a C program, you need to emulate the four basic parts of a stack:
- The stack storage
- A stack pointer
- A function to push a value onto the stack
- A function to pop a value from the stack
Further, you need to implement controls that prevent a stack overflow or underflow. And you can get real fancy, but those four items are the basics.
Continue reading
