calling external 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
slacker

calling external function

Post by slacker »

i am trying to call a c function from my ISR written in asm code. i want to compile a binary file so i can use org. but i cant use extern and call with that binary file to call the c function because it gives me an error: idt.asm:28: error: binary output format does not support external references

waht should i do to be able to call the external c function and align my variables to 0x600?

thank you.
Chris Giese

Re:calling external function

Post by Chris Giese »

Compile the C code and assemble the asm code into a relocatable format (DJGPP COFF, Win32 PE COFF, ELF, .OBJ, or a.out), then use a linker to combine the relocatable files into an executable file.

Usually, the linker has an option to set the ORG value. Check the "Starting virtual address" rows in this table: http://my.execpc.com/~geezer/temp/linkers.htm

If you're using the GNU linker (ld), using a linker script is a good idea.
Post Reply