Interrupt Service Routines: Difference between revisions

Jump to navigation Jump to search
→‎Naked Functions: prolouge is at the beginning, epilogue is at the end
[unchecked revision][unchecked revision]
(Unbreak markup)
(→‎Naked Functions: prolouge is at the beginning, epilogue is at the end)
Line 88:
 
====Naked Functions====
Some Compilers can be used to make interrupt routines, but requires you to manually handle the stack and return operations. Doing so requires that the function be generated without an epilogue or prologue. This is called making the function ''naked'' - this is done in Visual C++ by adding the attribute ''_declspec(naked)'' and in clang-llvm by adding the attribute ''__attribute__((naked))'' to the function. You need to verify that you do include a return operation (such as ''iretd'') as that is part of the prologueepilogue that the compiler has now been instructed to not include.
 
If you intend to use local variables, you must set up the stack frame in the manner which the compiler expects; as ISRs are non-reentrant, however, you can simply use static variables.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu