Assembly, Call function through Register
Posted: Fri Mar 11, 2011 4:00 am
I am writing a kernel in C and assembly. The main function is written in C, and some hardware specific functions are in assembly.
I have the IDT setup to call assembly functions. Some of these then call a C function.
This is the code I use to call the C function:
Normally I would just use
But this doesn't work, and I'm not sure why. I presume it has something to do with the EIP register and pushing it to the stack.
Can anyone explain how this works?
I have the IDT setup to call assembly functions. Some of these then call a C function.
This is the code I use to call the C function:
Code: Select all
mov eax, _isrhandler
call eax
Code: Select all
call _isrhandler
Can anyone explain how this works?