Share via


Differences Between RISC and x86 Exception Handling (Windows CE 5.0)

Send Feedback

Exception handling works differently on RISC-based microprocessors (such ARM, SH-4, and MIPS) than on x86 microprocessors. Under many circumstances, the compiler hides the differences; however, the differences become critical when your code contains assembly language segments.

In simplified terms, in an x86 environment, the data structures associated with exception-handling are written onto the stack at runtime. The OS looks at these structures to locate appropriate exception-handling routines.

In a RISC environment, many data structures associated with exception handling are calculated at compile time and are written to the data sections of the module being built.

RISC-based microprocessors support a table-based mechanism using PDATA structures to handle exception processing that depends on the context, the frame and stack pointers, and the program counter.

Because the compiler generates the code segments that set up the stack frame whose address limits are associated with the function table entry, only code that the compiler handles can access the table entry automatically.

Therefore, in a RISC environment, you must write code that manages exception-related processing for any assembly code functions you include.

See Also

Structured Exception Handling in Windows CE | SEH in x86 Environments | SEH in RISC Environments

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.