Function return to an Interrupt
Posted: Mon Aug 22, 2005 11:00 pm
Helllo,
I have a question about interrupts ...
In my OS I use the Interrupt (int 30h) to call all functions ... If I call a function without a function return it works fine ... but if i have an function with an function return, I don't konow how to give the return value to the application (back to the application that call the interrupt) back ?? ...
Here is an example how I call a simple function (without a function return) from an application of my OS:
It works fine .. In eax there is the function number (example: eax=1 -> Print a Text ,... )
But If i need a return Value in the Appliction I don't know how does it work ...
Example:
In this example i need the inline asm codelines, that write the return value in B ...
I hope that somebody can help me ...
I have a question about interrupts ...
In my OS I use the Interrupt (int 30h) to call all functions ... If I call a function without a function return it works fine ... but if i have an function with an function return, I don't konow how to give the return value to the application (back to the application that call the interrupt) back ?? ...
Here is an example how I call a simple function (without a function return) from an application of my OS:
Code: Select all
void Test( unsigned int A )
{
asm("movl %0, %%ebx":: "r"(A));
asm("movl $0x01, %eax");
asm("int $0x30");
}
But If i need a return Value in the Appliction I don't know how does it work ...
Example:
Code: Select all
int Test( unsigned int A )
{
int B;
...??
...??
...??
return(B);
}
I hope that somebody can help me ...