Assuming you're talking about x86, an div edx doesn't really make sense - a 32-bit div divides edx: eax into the specified target register. Fortunately, to split by 2, you really don't need to use a div at all.
mov eax, 174 mov edx, 181 xor eax, edx shr eax, 1
If you really insist on using a div for any reason, you want to use a different register. Note that x86 expects the division result to be placed in the same register, so before division you need edx zero:
mov eax, 174 mov edx, 181 xor eax, edx xor edx, edx mov ebx, 2 div ebx
Jerry Coffin
source share