title: Using ARM assembly language to find two's Complement
body: <p>Write a program in ARM assembly language that will calculate the two's complement of a 32-bit number that is in R2. The result should be in Register R3.</p>
  
  <p>I'm new to ARM coding. I feel like I'm over complicating things, it should be simple. I think I'm getting my location pointer wrong.</p>
  
  <pre><code>Loop:   SUB     R0, [R2, R1], #1
      SUB R1, R1, #1
      CBNZ    R0, Cont
      LDRB    [R3,R1], #1
      B   Exit
  Cont:   LDRB    [R3,R1], #0
      B   Loop
  Exit:   SUB     R0, [R2, R1], #1
      SUB R1, R1, #1
      CBZ R0, One
      LDRB    [R3,R1], #1
      SUB R0, R1, #1
      CBZ R0, Done
      B   Exit 
  One:    LDRB    [R3,R1], #0
      SUB R0, R1, #1
      CBZ R0, Done
      B   Exit
  Done:   LSL R3
  </code></pre>