// Pascal
NumX:=-40; // Assm
MOV EAX,NumX MOV ECX,4 IDIV ECX MOV IntPart, EAX Why does IntPart return 1073741815?
Because the value is unsigned.
In EAX put a converted 4-byte integer -40, which gives the value FFFFFFD8 , or 4294967256 in decimal.
Divide by 4, we get 3FFFFFF6 , or 1073741814 in decimal form.
Here’s how your code should look right:
MOV EAX,NumX CDQ MOV ECX,4 IDIV ECX MOV IntPart, EAX The symbolic EAX extension in EDX:EAX forgotten ...
CDQ - HarrySource: https://ru.stackoverflow.com/questions/606265/
All Articles