- The div instruction is used to perform a division.
- Always divides the 64 bits value accross EDX:EAX by a value.
- The result of the division is stored in EAX and the remainder in EDX.
The operation 0x8003 / 0x100 can be written as follows:
mov edx, 0 ; clear dividend
mov eax, 0x8003 ; dividend
mov ecx, 0x100 ; divisor
div ecx ; EAX = 0x80, EDX = 0x3
>>> hex(0x8003 / 0x100)
>>> hex(0x8003 % 0x100)
blog comments powered by