title: Return from a procedure in ARM assembly
body: <p>When creating a function in ARM assembly, I usually push contents of <code>LR</code> register into <code>r4-r5</code> at the beggining and after the function has finished I pop <code>r4-r5</code> to <code>PC</code>:</p>
  
  <pre><code>.global myfunc
  .type   myfunc, %function
  
  myfunc:
  push {r4-r5,lr}
  ... do stuff...
  pop {r4-r5,pc}
  </code></pre>
  
  <p>However, I have read that using <code>stmfd</code> and <code>ldmfd</code> one might get better performance: </p>
  
  <pre><code>myfunc:
  stmfd sp!,{r4-r11,lr}
  ...do stuff...
  ldmfd sp!,{r4-r11,pc}
  </code></pre>
  
  <p>What is exactly the <code>sp</code>? I presume it's not really worth saving all the registers <code>r4-r11</code> in case I'm not actually using them inside <code>myfunc</code>, right? So the push-pop variant is better in that case?</p>