/* */
/* */
/* */
-/* (C) 1998-2000 Ullrich von Bassewitz */
+/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
fprintf (stderr,
"Usage: %s [options] module ...\n"
"Short options:\n"
+ " -C name\t\tUse linker config file\n"
+ " -Ln name\t\tCreate a VICE label file\n"
+ " -Lp\t\t\tMark write protected segments as such (VICE)\n"
+ " -S addr\t\tSet the default start address\n"
+ " -V\t\t\tPrint the linker version\n"
" -h\t\t\tHelp (this text)\n"
" -m name\t\tCreate a map file\n"
" -o name\t\tName the default output file\n"
" -t sys\t\tSet the target system\n"
" -v\t\t\tVerbose mode\n"
" -vm\t\t\tVerbose map file\n"
- " -C name\t\tUse linker config file\n"
- " -Ln name\t\tCreate a VICE label file\n"
- " -Lp\t\t\tMark write protected segments as such (VICE)\n"
- " -S addr\t\tSet the default start address\n"
- " -V\t\t\tPrint the linker version\n"
"\n"
"Long options:\n"
+ " --config name\tUse linker config file\n"
" --help\t\tHelp (this text)\n"
" --mapfile name\tCreate a map file\n"
+ " --module-id id\tSpecify a module id\n"
" --start-addr addr\tSet the default start address\n"
" --target sys\t\tSet the target system\n"
" --version\t\tPrint the linker version\n",
-static void OptHelp (const char* Opt attribute ((unused)),
+static void OptHelp (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print usage information and exit */
{
+static void OptModuleId (const char* Opt, const char* Arg)
+/* Specify a module id */
+{
+ unsigned long Id = CvtNumber (Opt, Arg);
+ if (Id > 0xFFFFUL) {
+ Error ("Range error in module id");
+ }
+ ModuleId = (unsigned) Id;
+}
+
+
+
static void OptStartAddr (const char* Opt, const char* Arg)
/* Set the default start address */
{
-static void OptVersion (const char* Opt attribute ((unused)),
+static void OptVersion (const char* Opt attribute ((unused)),
const char* Arg attribute ((unused)))
/* Print the assembler version */
{
/* Program long options */
static const LongOpt OptTab[] = {
{ "--config", 1, OptConfig },
- { "--dbgfile", 1, OptDbgFile },
- { "--help", 0, OptHelp },
- { "--mapfile", 1, OptMapFile },
+ { "--dbgfile", 1, OptDbgFile },
+ { "--help", 0, OptHelp },
+ { "--mapfile", 1, OptMapFile },
+ { "--module-id", 1, OptModuleId },
{ "--start-addr", 1, OptStartAddr },
{ "--target", 1, OptTarget },
{ "--version", 0, OptVersion },
unsigned I;
- /* Initialize the cmdline module */
+ /* Initialize the cmdline module */
InitCmdLine (&argc, &argv, "ld65");
/* Evaluate the CC65_LIB environment variable */