Hi! On Sat, Nov 06, 2010 at 07:10:26PM -0300, Daniel Serpell wrote: > > If I'm getting this right then we could import the symbol _main from > > the "usual" (aka non-standalone-asm-program) linker configs :-) > > Currently, cc65 emits a ".forceimport __STARTUP__" directive in > its assembly output if there is a main function defined in the .c file, > to force the inclusion of the C startup at link time. > > This could be replaced by an import of __STARTUP__ from the > linker config, and the special case for main removed from cc65. Yes, that's what I thought, too. If forcing imports from the config is available (which has more problems than I initially thought), we can make different linker configs that pull in header or initialization stuff. These modules would in turn reference _main. Assumed that I'm able to solve the problems inherent in reading the linker config at start, we can separate the different headers (load address, basic SYS header, EXE header for other platforms or whatever) and add them by using different linker scripts. So the actual format of the output file(s) is determined by the linker scripts, and combinations are easily possible without source code changes. For example a C program that goes to $8000 and can be started with SYS. A useful suggestion from AgentFriday is probably, to place the headers in their own memory area, just to make clear that they're not part of what is loaded to RAM. Regards Uz -- Ullrich von Bassewitz uz@musoftware.de ---------------------------------------------------------------------- To unsubscribe from the list send mail to majordomo@musoftware.de with the string "unsubscribe cc65" in the body(!) of the mail.Received on Sun Nov 7 12:14:11 2010
This archive was generated by hypermail 2.1.8 : 2010-11-07 12:14:14 CET