title: assembly return
body: <p>a small portion of my code  </p>
  
  <pre><code>swi  r6,r0,LCD_ CONT  
  addi r10,r0,6  
  
  firstdelay:  
  addi r10,r10,-1  
  bnei r10,firstdelay  
  swi  r0,r0,LCD_ CONT  
  addi r10,r0,30
  
  seconddelay:  
  addi r10,r10,-1  
  bnei r10,seconddelay  
  swi  r5,r0,LCD_DATA  
  </code></pre>
  
  <p>i have to delay multiple times throughout the program but want to keep it small. id like to write something along the lines of:</p>
  
  <pre><code>swi  r6,r0,LCD_ CONT  
  addi r10,r0,[delayamount]  
  bri  Delay  
  swi  r0,r0,LCD_ CONT  
  addi r10,r0,[newdelayamount]  
  bri  Delay
  
  Delay:  
  addi r10,r10,-1  
  bnei r10,Delay  
  [return to where I was previously in the code]
  </code></pre>
  
  <p>so my issue is: how do i get back to where i was in the code without having to create multiple delays and just run through the code straight. thanks everyone!</p>