Link and Stack Pointer

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So whats th difference between the two???

Wm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay the stack may point to the memory location that holds the return address so what is the link register for?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On an ARM the return address is stored in the link register. A subroutine can choose to store it on the stack or not; if it does not call any other subroutines it's quicker.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There’s loads of generic documentation available to teach yourself what a stack is and what it’s used for.

The link register holds the return address for the current function, which is not pushed on the stack immediately. Read the AVR 32-bit Architecture Manual and the AVR32UC Technical Reference Manual for more info on that. It’s all in there.