title: How to divide in assembly language using addition?
body: <p>In a computer engineering class in high-school, we were given an assignment where we have to divide 2 numbers in assembly language by using the process of addition.</p>
  
  <p>The toy architecture we're programming for doesn't have a division instruction.  The machine has 2's complement addition and bitwise AND/OR/XOR operations, but not subtraction directly: <a href="https://www.csie.ntu.edu.tw/~r03944025/intro2015/files/hw/appendix_c" rel="nofollow noreferrer">https://www.csie.ntu.edu.tw/~r03944025/intro2015/files/hw/appendix_c</a></p>
  
  <p>(Editor's note, the textbook doesn't define a text assembly language, only machine code opcodes and operands for this load/store machine with sixteen 8-bit registers, and a conditional jump-if-zero instruction.)</p>