Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6857179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:59:01+00:00 2026-05-27T01:59:01+00:00

I am reading definitions over and over again and I still not getting what

  • 0

I am reading definitions over and over again and I still not getting what are SP and LR in ARM? I understand PC (it shows next instruction’s address), SP and LR probably are similar, but I just don’t get what it is. Could you please help me?

edit: if you could explain it with examples, it would be superb.

edit: finally figured out what LR is for, still not getting what SP is for.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T01:59:02+00:00Added an answer on May 27, 2026 at 1:59 am

    LR is link register used to hold the return address for a function call.

    SP is stack pointer. The stack is generally used to hold "automatic" variables and context/parameters across function calls. Conceptually you can think of the "stack" as a place where you "pile" your data. You keep "stacking" one piece of data over the other and the stack pointer tells you how "high" your "stack" of data is. You can remove data from the "top" of the "stack" and make it shorter.

    From the ARM architecture reference:

    SP, the Stack Pointer

    Register R13 is used as a pointer to the active stack.

    In Thumb code, most instructions cannot access SP. The only
    instructions that can access SP are those designed to use SP as a
    stack pointer. The use of SP for any purpose other than as a stack
    pointer is deprecated. Note Using SP for any purpose other than as a
    stack pointer is likely to break the requirements of operating
    systems, debuggers, and other software systems, causing them to
    malfunction.

    LR, the Link Register

    Register R14 is used to store the return address from a subroutine. At
    other times, LR can be used for other purposes.

    When a BL or BLX instruction performs a subroutine call, LR is set to
    the subroutine return address. To perform a subroutine return, copy LR
    back to the program counter. This is typically done in one of two
    ways, after entering the subroutine with a BL or BLX instruction:

    • Return with a BX LR instruction.

    • On subroutine entry, store LR to
    the stack with an instruction of the form: PUSH {,LR} and
    use a matching instruction to return: POP {,PC} …

    This link gives an example of a trivial subroutine.

    Here is an example of how registers are saved on the stack prior to a call and then popped back to restore their content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this link http://dec.bournemouth.ac.uk/staff/awatson/micro/articles/9907feat2.htm I could not understand this following statements from
I'm reading up on concurrency. I've got a bit over my head with terms
I've been reading both definitions and they seem quite the same. Could anyone point
Reading over some example Objective C code just now. @property (nonatomic, strong) IBOutlet UILabel
I am reading the HTTP Header Field Definitions in order to parse accept headers
I'm reading Bruce Eckel's Thinking in Java and there's an exercise I'm just not
After reading this article Storing C++ template function definitions in a .CPP file ,
I've always used a *.h file for my class definitions, but after reading some
I am currently reading the specification for BPMN 2.0 . In this specification, definitions
I have been reading about REST and SOAP, and understand why implementing REST can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.