Divide by 0 exception when dividing 4 by 2 ?
Posted: Thu Mar 30, 2017 2:52 am
Hello,
I am currently running my 32-bit protected mode code in Bochs.
I have loaded GDT, IDT and PIC, and interrupts are enabled.
To write my itoa implementation, I have to use the DIV instruction, which calls int 0 everytime.
Here is my test code :
This code calls my divide by 0 exception handler, and I don't know why.
Thanks by advance,
Ankeraout.
I am currently running my 32-bit protected mode code in Bochs.
I have loaded GDT, IDT and PIC, and interrupts are enabled.
To write my itoa implementation, I have to use the DIV instruction, which calls int 0 everytime.
Here is my test code :
Code: Select all
mov eax, 4
mov ecx, 2
div ecx ;will call int0
Thanks by advance,
Ankeraout.