Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plz, help about floating-point programming !

Status
Not open for further replies.

gaique

Technical User
Nov 9, 2005
2
JP
In usual case, the result of floating-point division by 0 is infinite. I 'd like to detect by interrupt when some value is divided by 0. Besides, I want to catch an interrupt and print out any message in this case.
I am a freshman in ASM so plz help me solve this problem.
Thank you very much !
 
I'm not sure if this applies to the FPU, but Int 0 is the Divide By Zero interrupt on the x86 family of processors.

To trap this you would need to place the address of your handler in the four bytes at memory locations 00 to 03.

(Keep a copy of the orignal value at that address and restore it when your program terminates - by the way, you would also need to disable interrupts while you are changing the address)


Hope this helps.

[vampire][bat]
 
Can you give some more detail (code) ?!?
 
The floating point processor has its own interrupt number on the processor from 386+.
The number is 16h

Succes, Tessa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top