Talk:ISRs PIC And Multitasking: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
Content added Content deleted
(Why this is a really bad idea)
 
No edit summary
Line 1: Line 1:
== IRQs in C ==
== IRQs in C ==
Why make this overly complicated hack when using assembly remains both shorter and simpler?
> 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. - [[User:Combuster|Combuster]] 00:46, 9 May 2015 (CDT)

Revision as of 06:14, 9 May 2015

IRQs in C

Why make this overly complicated hack when using assembly remains both shorter and simpler?