Assembly Function

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
chris

Assembly Function

Post by chris »

I am having trouble with my assembly function for changing ISR's. It is called "change_isr", and when I link my kernel it says:

undefined reference to 'change_isr'

I've got the prototype in a header file and it is included. I've also tryed putting it directly in the C file, but it shows no difference.
Therx

Re:Assembly Function

Post by Therx »

C Functions need a leading underscore so in the assembly source rename the function to _change_isr. Like wise if you try to call a C function from asm then prefix an underscore to the function name eg

ASM

Code: Select all

global _sharethis
extern _getthis

_sharethis: jmp _getthis
C

Code: Select all

extern void sharethis();
void gethis();

...
sharethis();
...

void getthis()
{
 ...
}
pete
chris

Re:Assembly Function

Post by chris »

Thanks I got it working now :)
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Assembly Function

Post by Candy »

This (afaik) doesn't work under linux, as GCC does not prepend the _'s.
chris

Re:Assembly Function

Post by chris »

Yeah, it wasn't the _'s, I messed up the [global <func>].
Post Reply