From: Bernhard H. <Ber...@be...> - 2003-03-03 07:14:19
|
> I'm using the Z80 version of SDCC/ Z80 port of SDCC/ support of Z80 on SDCC. > > I would like to link a C program with assembler routines that are > already programmed in an EPROM. > > > Here is the example code that I would like to run: > > extern void SerialPutString(unsigned char *str); // 0x0C98 > > #include <stdio.h> > > #include "rom_mini.h" > > void main(void) > { > SerialPutString("Hello world"); > } > > > How do I tell the linker that 'such external routine is at which address' ? I've no idea, if this applies to the z80 port, but on mcs51 you have to use function pointers: typedef void (*func_ptr)(unsigned char *str) reentrant; func_ptr SerialPutString = (func_ptr) 0x0C98; void main(void) { (*SerialPutString) ("Hello world"); } Bernhard |