user1289
user1289

Reputation: 1321

What is hardware stack?

When processor uses hardware stack, It have to extract operands from so called 'hardware stack'. Is that the same stack in main memory? I think not, if so, where exactly it is and does processor use it only for keeping instruction operands? Is it used for keeping return addresses or no?

Upvotes: 3

Views: 10539

Answers (1)

mikalai
mikalai

Reputation: 1736

It has been never called "hardware" stack - maybe that is some modern variation to distinguish it from some software application. "Stack in main memory" term is vary ambiguous, which can mean a dozen of different things depending on what you understand as 'main memory'.

Regarding details of what is stored in stack during calls, please refer to Calling Conventions and Call stack description.

You may also want to check similar SO questions: What is the role of stack in a microprocessor? and What is a stack pointer used for in microprocessors?

Upvotes: 1

Related Questions