title: Assembly mod algorithm on processor with no division operator
body: <p>I need to implement a simple macro that finds the modulo of two numbers on a processor that doesn't have a division operator (think ARM). I could use division by repeated subtraction, but I don't know if this was the most efficient or easiest to work with.</p>
  
  <p>Any suggestions? Code would be even more helpful. This particular class has us using a subset of SPARC, so most operations look like this: <code>add r1, r2, rdest</code>. </p>
  
  <p>This particular assignment calls for checking that <code>a mod b == 0</code> or that the remainder of the division is zero. So any hints or suggestions toward an efficient implementation would be most welcome. </p>