Dividing two signed 32 bit in assembly (x86-64)

0

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.

assembly
x86-64
asked on Stack Overflow Apr 10, 2020 by EL_9

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0