title: Convert C to ARM Assembly program
body: <p>I have this C program:</p>
  <pre><code>void Move1Disk(int fm, int to);
  
  void Hanoi(int num, int fm, int to, int aux)
  {
      if (num &gt; 1) Hanoi(num - 1, fm, aux, to) ;
      Move1Disk(fm, to) ;
      if (num &gt; 1) Hanoi(num - 1, aux, to, fm) ;
  }
  </code></pre>
  <p>I have written this but can not compile, can anyone please tell me the issue?</p>
  <pre><code>Hanoi(int, int, int, int):
          cmp     r0, #1
          push    {r4, r5, r6, r7, r8, lr}
          mov     r5, r1
          mov     r7, r2
          movgt   r4, r0
          movgt   r6, r3
          ble     .L9
  .L3:
          sub     r4, r4, #1
          mov     r0, r4
          mov     r3, r7
          mov     r2, r6
          mov     r1, r5
          bl      Hanoi(int, int, int, int)
          mov     r1, r7
          mov     r0, r5
          bl      Move1Disk(int, int)
          cmp     r4, #1
          beq     .L2
          mov     r3, r5
          mov     r5, r6
          mov     r6, r3
          b       .L3
  .L9:
          mov     r6, r1
  .L2:
          mov     r1, r7
          mov     r0, r6
          pop     {r4, r5, r6, r7, r8, lr}
          b       Move1Disk(int, int)
  </code></pre>
  <p>here I have included the main <a href="https://www.engr.scu.edu/%7Edlewis/book3/labs/Lab5dMain.c" rel="nofollow noreferrer">main method</a></p>
  <p>and a picture of the error message:
  <img src="https://i.stack.imgur.com/vYjZu.jpg" alt="[error message]" /></p>