I have written a simple C++ function which only does a simple modulo operation with number 1022. I notice that there are two instructions in the assembly I don't understand. Here is the screenshot of the code:
As I know, eax
will hold the return value. But what I don't understand is that after executing line 16, eax
and edx
will hold the same value, why does line 17 exist, which seems not to be necessary?
Here is the godbolt link. https://godbolt.org/z/o9TTK3hYr