title: How can I print a value in register in decimal?
body: <p>In ARM assembly, how can I print a value in register in decimal? This is the code I have as of now.</p>
  
  <pre><code>MOV     r3, #32         ;bit count = 32
  MOV     r5,#0; r5 will have the converted decimal number
  Loop
  MOV     r0, r2, LSR #31   
  ADD     r5,r5,r0,LSL r3
  MOV     r2, r2, LSL #1           
  SUBS    r3, r3, #1                
  BNE  Loop                 
  </code></pre>
  
  <p>My logic has something wrong. Even if I multiply correctly, the resultant value is still hex. What is the way of converting a hex value to its corresponding decimal value? </p>