RTUComputer ScienceYr 2023 · Sem 32023

Q10Microprocessor and Microcontroller

Question

2 marks

What is the role of stack pointer (SP) and program counter (PC)?

Answer

The PC tracks the memory address of the next instruction, while the SP manages the LIFO memory stack.

The Program Counter (PC) is a highly specialized 16-bit register that rigorously maintains the exact memory address of the absolute next instruction to be fetched, sequentially guiding program execution. The Stack Pointer (SP) is another specialized 16-bit register that holds the memory address of the very top of the Stack, managing critical LIFO (Last-In-First-Out) operations during interrupts and subroutines.

Back to Paper