Talk:ISRs PIC And Multitasking

From OSDev.wiki
Revision as of 05:46, 9 May 2015 by Combuster (talk | contribs) (Why this is a really bad idea)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

IRQs in C

> No external assembly is needed for this code to work.

The reason for these things to require assembly is that you don't want to make any assumptions to what the compiler does. In fact, the code as compiled with default options breaks the stackframe (there are two push ebp instructions, the other is from gcc) and depending on compiler make and flags there may be many other items at the top of this stackframe. For instance with -fomit-frame-pointer, there push ebp is no longer there, but there is other stack handling and register preservation that puts iret in the wrong stackframe.

Unless there's some serious revamping being planned, I'd recommend deleting this article and its fundamentally broken advice. - Combuster 00:46, 9 May 2015 (CDT)