The MASM Forum Archive 2004 to 2012

General Forums => The Laboratory => Topic started by: vanjast on May 22, 2010, 06:02:46 PM

Title: OS - Exception handlers
Post by: vanjast on May 22, 2010, 06:02:46 PM
Preparing for my dsp library...
Does anybody know if windoze has FPU/MMX/SSEx exception handlers, and can they link (Callback) my own handler.

Thanks
van
Title: Re: OS - Exception handlers
Post by: clive on May 22, 2010, 11:57:57 PM
If they fault you can use the normal SEH mechanisms (ie try {} except(EXCEPTION_EXECUTE_HANDLER) {})

Would certainly catch unaligned register load/store.
Title: Re: OS - Exception handlers
Post by: qWord on May 23, 2010, 12:07:37 AM
normally the fpu/mmx and xmm exceptions are masked - you must unmask the them using fldcw/fstcw,stmxcsr/ldmxcsr
Title: Re: OS - Exception handlers
Post by: vanjast on May 23, 2010, 05:58:57 AM
Thanks, Ja, I'm aware of the masking bits, but just worried about an OS handler running away from my app. - Got to keep Control.. :green2
Title: Re: OS - Exception handlers
Post by: Ghandi on May 23, 2010, 10:22:38 AM
If you are using XP onwards, you could always look at Vectored Exception Handlers, they are called prior to the SEH chain being walked. Seeing as its your code you shouldn't run into any problems with a VEH being installed over the top of yours, i'm unaware of the OS installing any over user installed handlers.

HR,
Ghandi