Back to the 2023 paper

Module 2: The 8051 Architecture

20237m

Explain the functions of SP and PC registers in 8051 microcontroller.

Worked SolutionAI Assisted

Functions of SP and PC

Stack Pointer (SP, 81H, 8-bit): Points to top of stack in internal RAM. PUSH increments then writes, POP reads then decrements. SP=07H after reset → first push to 08H. Manages calls, interrupts, context save. Can relocate: MOV SP,#60H.

Program Counter (PC, 16-bit): Holds address of next instruction byte. Automatically increments on fetch; loaded by LJMP/AJMP/SJMP/CALL/RET/interrupt vectoring. Determines execution flow. Invisible directly but accessed via MOVC, PUSH PC via CALL.

Together they control sequence (PC) and LIFO storage (SP) for subroutines/interrupts.

Similar questions

Official AppAndroid App

PYQDeck for Android

Solve BEU previous-year exam papers anywhere, anytime. Fast search, offline paper viewing, and step-by-step solutions designed specifically for your phone.