Which register is used to work with stack memory?
Correct answer: C. Stack pointer
- A. MAR
- B. GPR
- C. Stack pointer
- D. Code segment
Explanation
The stack pointer is a special register that keeps track of the top of the stack. The stack is a LIFO (Last In, First Out) data structure used for function calls, local variables, and parameter passing. The stack pointer is incremented (or decremented depending on the architecture) when data is pushed onto the stack and decremented (or incremented) when data is popped off. This allows the CPU to efficiently track the current position within the stack.In summary, the stack pointer is a specialized register designed to manage the stack memory, making it the most suitable option for working with the stack.
Last updated
About Hardware and Software
Hardware includes the physical components of a computer, such as the CPU, motherboard, registers, memory, storage devices and peripheral equipment. Software covers system software, application software, utilities, drivers and firmware, with attention to how the operating system manages hardware and how software differs from the physical equipment it controls.
Practise Hardware and Software
290 free Hardware and Software MCQs from Computer Science and IT, each with the correct answer and an explanation. Unlimited attempts, no account needed.
Exams that ask Computer Science and IT questions like this
Computer Science and IT is on 40 papers prepared for on TestUstad, and all of them draw the same bank, so this question is worth knowing for every one of them.