0

I have a problem with understanding how division IDIV works in micro assembly notation. I already have a clue how to start but don't know how to finish:

idiv1: MAR = SP = SP-1:rd
idiv2: H=0
idiv3:

That's all I have till now, I think the problem is, how to actually divide 2 numbers without using direct division.

halfer
  • 19,471
  • 17
  • 87
  • 173
  • Semi-related: [How sqrt() of GCC works after compiled? Which method of root is used? Newton-Raphson?](https://stackoverflow.com/q/54642663) has a high-level overview of hardware div/sqrt units, which iteratively produce more bits of the quotient. Or without any specialized hardware, pure software bit-at-a-time by shifting and subtracting (1 bit per iteration) is an algorithm a CPU could implement in microcode: [How can I multiply and divide using only bit shifting and adding?](https://stackoverflow.com/a/32443307) – Peter Cordes Dec 12 '21 at 21:21

0 Answers0