#include <reg5000.h> #include <stdio.h> void main(void); void writebyte (unsigned char ch); void main() { unsigned char ch; ch=0x0A; writebyte(ch); } void writebyte (unsigned char ch) { ACC=ch; #pragma ASM PUSH MCON ORL MCON, #4 MOVX @R0, A DEC R0 POP MCON #pragma ENDASM }
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: ?C_STARTUP MODULE: rtc-func.obj (RTC_FUNC)
s/STARTINIT.A51/STARTUP.A51/g (meant STARTUP.a51 not STARTINIT.a51) sorry (coffee depletion imminent)
Doh!! Just to follow up... I found the answer here: http://www.keil.com/support/docs/1980.htm and for those too lazy to look above, here it is... CAUSE When you compile all your C modules with the SRC directive and the assembler, the linker does not detect the required C run-time libraries (because the files were assembled). In this case, you must add the libraries to your project manually. RESOLUTION For a project in the SMALL memory model that uses no floating point arithmetic, C51S.LIB is required. For a project in the LARGE memory model that uses floating-point, C51FPL.LIB and C51L.LIB are required. If a project uses floating arithmetic, it is important that C51FPx.LIB is included before the standard library file C51x.LIB. Otherwise printf and scanf will not work with floating-point numbers.
Just included a dummy C file into your project. Right now it thinks you are compiling a pure assemble routine, and it does not include the C runtime modules.