I am learning about division in assembly language. According to the book I am learning from, the result of the idiv operation is placed in eax and the remainder in edx.
An exercise in the book is to implement number = result % divisor
in assembly.
I would have thought this would be equivalent to a normal divide operation except edx would be the result.
This did not work however and edx returned seemingly garbage.
Why? How do you implemented the above pseudo-code in assembly?