I am given two numbers and required to divide them.
I figured that the first step would be to move the dividend to EAX, but I also believe that EDX should be 0xffffffff if the sign of the dividend is negative and 0 if it's positive.
The problem is that I don't know how to this. Perhaps I should use some shifting instruction and then assign the value by hand depending on the result, but I am not really sure how to get the MSB of the dividend and how check whether it's 0 or 1. What is a good way to do this?
Please use basic instructions only (like jump, shift, mov, cmp and arithmetic operations). Thanks a lot.
User contributions licensed under CC BY-SA 3.0