M
mysli
Hi all,
I need to write a ISR using Microsoft VC++ 2005. The proplem is I did
not found any hint on how to do it. I can register any function as a
ISR and it will be called by the hardware interrupt, interrupt 8
(timer) i.e., works fine in my little example progam. But the problem
is the compiler ends every function with RETN, after disassembling the
result of the compilation this can be seen easiely.
Every function starts and ends with:
push ebp //function entry
mov ebp,esp
....
pop ebp
retn //function exit
That's pretty fine for regular functions but as an interrupt handler
the function first of all should save all used registers, EAX is not
save by VC++ since its holding the return value, but ISR doesn't have
any return value. And second it needs to end with a IRETD !!!
Does anyone of you know how to solve this problem, maybe it points out
the VC++ is not the appropiated tool for my project. BTW, I do use VC++
only as editor and compiler, I do not program for windows, I just
generate code which can be executed in protected mode.
Many thanks,
Daniel
I need to write a ISR using Microsoft VC++ 2005. The proplem is I did
not found any hint on how to do it. I can register any function as a
ISR and it will be called by the hardware interrupt, interrupt 8
(timer) i.e., works fine in my little example progam. But the problem
is the compiler ends every function with RETN, after disassembling the
result of the compilation this can be seen easiely.
Every function starts and ends with:
push ebp //function entry
mov ebp,esp
....
pop ebp
retn //function exit
That's pretty fine for regular functions but as an interrupt handler
the function first of all should save all used registers, EAX is not
save by VC++ since its holding the return value, but ISR doesn't have
any return value. And second it needs to end with a IRETD !!!
Does anyone of you know how to solve this problem, maybe it points out
the VC++ is not the appropiated tool for my project. BTW, I do use VC++
only as editor and compiler, I do not program for windows, I just
generate code which can be executed in protected mode.
Many thanks,
Daniel