title: ARM: link register and frame pointer
body: <p>I'm trying to understand how the link register and the frame pointer work in ARM.  I've been to a couple of sites, and I wanted to confirm my understanding.</p>
  
  <p>Suppose I had the following code:</p>
  
  <pre><code>int foo(void)
  {
      // ..
      bar();
      // (A)
      // ..
  }
  
  int bar(void)
  {
      // (B)
      int b1;
      // ..
      // (C)
      baz();
      // (D)
  }
  
  int baz(void)
  {
      // (E)
      int a;
      int b;
      // (F)
  }
  </code></pre>
  
  <p>and I call foo().  Would the link register contain the address for the code at point (A) and the frame pointer contain the address at the code at point (B)?  And the stack pointer would could be any where inside bar(), after all the locals have been declared?</p>