Divide By 0 ISR
Divide By 0 ISR
Hi, when a divide by 0 ISR is called, it repeatedly gets called. Ive heard that you not to pop the error code off the stack. But I cant seem to do that. I keep getting general protection faults? Any ideas? this is my ISR:
[extern interrupt_handler]
[global int_00]
int_00:
pusha
push ds
push es
push fs
push gs
mov eax, 0x00
push eax
call interrupt_handler ; Divide by Zero #DE
pop eax
pop gs
pop fs
pop es
pop ds
popa
iret
ta, ash
[extern interrupt_handler]
[global int_00]
int_00:
pusha
push ds
push es
push fs
push gs
mov eax, 0x00
push eax
call interrupt_handler ; Divide by Zero #DE
pop eax
pop gs
pop fs
pop es
pop ds
popa
iret
ta, ash
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Divide By 0 ISR
better check the holly manual, but i think division by zero has a return address that point to the faulty division. Thus if you simply return, it will fire the division exception again and again. What you have to do here is HaLTing ...
Re:Divide By 0 ISR
you can download it or send intel your name and they will send 3 fat FREE books....
Re:Divide By 0 ISR
You can!?!? Free books as in really, really free books? And does this work outside US?slacker wrote: you can download it or send intel your name and they will send 3 fat FREE books....
Re:Divide By 0 ISR
Yes. I've heard of people in Europe and Australia receiving free books shipped from the US.
Re:Divide By 0 ISR
Okay... Do you have a direct link to the ordering page? I have trouble finding any (Intel's site makes me dizzy to say the least...)...
By the way, sorry because this is a bit off topic...
By the way, sorry because this is a bit off topic...
Re:Divide By 0 ISR
I went to the intel site, and unfortunately it says they're not available right now. It does give a 1-800 number to call to get them directly. Let me know if you try this and it works out. The documents are available online at: http://developer.intel.com/design/pentium4/manuals/ and the site to request hardcopies is: http://developer.intel.com/design/pentium4/manuals/index2.htm
- Brandon
- Brandon
Re:Divide By 0 ISR
It's up again. But it seems that it is only for companies... you have to fill in a company name...
Re:Divide By 0 ISR
If they want a company name, give them one. It's not like they'll check it or anything.
Re:Divide By 0 ISR
a suggestion for the repeating: pop the address and increment the pointer, then return. This depends on the opcode size, but that would work if you could inc the right number of bytes to skip the errorneuos divide code.
Regards,
mr. xsism
Regards,
mr. xsism
Re:Divide By 0 ISR
im looking to get these books too. i have searched intels developer site to no avail. i can never find anythign on that site. what exactly do i have to send?
Re:Divide By 0 ISR
With this sort of exception, returning to the running code at the point following the error is a Bad Thing; the code in question is expecting the preceeding computation to have completed with a meaningful result, when in fact the values in question are in an indeterminant state.mr. xsism wrote: a suggestion for the repeating: pop the address and increment the pointer, then return. This depends on the opcode size, but that would work if you could inc the right number of bytes to skip the errorneuos divide code.
The simplest practical solution is to kill the running process and return a failure message of some kind. Not very elegant, but completely general and unlikely to cause a catastophic data corruption later down the line. Halting the process and asking if the user want to open a debugger session is a bit more useful, at least for users who are also programmers.
The Right Thing would be to re-enter the process and raise an exception, so that the program itself could handle the problem sensibly; if the program doesn't trap the error, then halt and ask to open a debugger session. This, however, depends on the language that the app is written in having an exception handling mechanism which can work with your system's exception handlers.
Or perhaps the real Right Thing is to have sanity checks in the code itself, either added manually or inserted by the compiler or interpreter automagically; the extra overhead of the checking would still be less than the overhead of trapping a system exception. Just a thought. ;D