title: How to do division in ARM?
body: <p>I m trying to find how to make a division in ARM since there is no <code>DIV</code> command. If that can be done by multiplication of a float number <code>[/9 = *0.09]</code>, by subtraction or by the use of a library. Any way would do.</p>
  
  <p>Currently I am doing division using subtraction using a loop like this but I loose the decimals:</p>
  
  <pre><code>MOV R0,#70 ;Fahrenheit Temperature
  SUB R1,R0,#32 ; Subtracting 32
  MOV R4,#0 ;Counter
  
  LOOP 
  
     ADD R4,R4,#1; Counter+1 -&gt;Is the answer of the division without decimals
     SUB R1,#9
     CMP R1,#0
     BPL LOOP
     MOV R1,R4
  </code></pre>
  
  <p>So basically what I am doing is that I have temperature 70, I subtract 32 and I get 38. Then in the loop I take 9 each time till the reminder is smaller than 9. The answer using normal division is 4.22222. Here I get 5. So my result is not as accurate.</p>