1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

Add support for a module id

git-svn-id: svn://svn.cc65.org/cc65/trunk@1266 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-04-25 18:11:05 +00:00
parent 1e0b7c15ad
commit 6e32cf4b11
4 changed files with 26 additions and 11 deletions

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2000 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
@ -823,7 +823,6 @@ static void ParseO65 (void)
/* Remember the attributes read */
unsigned OS = 0; /* Initialize to keep gcc happy */
unsigned ID = 0; /* Dito */
unsigned Version = 0;
/* Read the attributes */
@ -920,7 +919,7 @@ static void ParseO65 (void)
/* We're expecting a number in the 0..$FFFF range*/
CfgAssureInt ();
CfgRangeCheck (0, 0xFFFF);
ID = (unsigned) CfgIVal;
ModuleId = (unsigned) CfgIVal;
break;
case CFGTOK_VERSION:
@ -957,7 +956,7 @@ static void ParseO65 (void)
}
/* Set the O65 operating system to use */
O65SetOS (O65FmtDesc, OS, Version, ID);
O65SetOS (O65FmtDesc, OS, Version, ModuleId);
}

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2001 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@cc65.org */
@ -45,6 +45,7 @@
const char* OutputName = "a.out"; /* Name of output file */
unsigned ModuleId = 0; /* Id for o65 module */
unsigned long StartAddr = 0x200; /* Start address */
unsigned char VerboseMap = 0; /* Verbose map file */

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2001 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@cc65.org */
@ -46,6 +46,7 @@
extern const char* OutputName; /* Name of output file */
extern unsigned ModuleId; /* Id for o65 module */
extern unsigned long StartAddr; /* Start address */
extern unsigned char VerboseMap; /* Verbose map file */

View File

@ -6,7 +6,7 @@
/* */
/* */
/* */
/* (C) 1998-2001 Ullrich von Bassewitz */
/* (C) 1998-2002 Ullrich von Bassewitz */
/* Wacholderweg 14 */
/* D-70597 Stuttgart */
/* EMail: uz@musoftware.de */
@ -105,6 +105,7 @@ static void Usage (void)
" --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",
@ -253,6 +254,18 @@ static void OptMapFile (const char* Opt attribute ((unused)), const char* Arg)
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 */
{
@ -302,6 +315,7 @@ int main (int argc, char* argv [])
{ "--dbgfile", 1, OptDbgFile },
{ "--help", 0, OptHelp },
{ "--mapfile", 1, OptMapFile },
{ "--module-id", 1, OptModuleId },
{ "--start-addr", 1, OptStartAddr },
{ "--target", 1, OptTarget },
{ "--version", 0, OptVersion },