I am busy studying the Assembly and looked at the separation, however I came across a pickle with the following statement:
mov edx,0x00000001 mov eax,0x00000000 mov ecx,0x00000002 idiv ecx
Gdb:
0x08048071 <+17>: mov edx,0x1 0x08048076 <+22>: mov eax,0x0 0x0804807b <+27>: mov ecx,0x2 => 0x08048080 <+32>: idiv ecx
I wanted to split 0x100000000 by 0x00000002, since the range for splitting EDX: EAX I moved 0x1 to EDX and 0x0 to EAX. Then I move 0x2 to ECX and dividing, this unfortunately gives me a floating point exception, I'm not sure what I did wrong.
When using a div (unsigned), it works fine, so I'm wondering what is the difference in interpretation between div and idiv for this particular statement that throws an exception.
assembly x86 linux nasm
Lucas kauffman
source share