From: jesusc Date: Wed, 29 Jan 2003 09:00:29 +0000 (+0000) Subject: Added options --code-size and --xram-size X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=53075bc7e021fd5771a1663adceb013c8e73f150;p=fw%2Fsdcc Added options --code-size and --xram-size git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2188 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index f9dd2453..a7e4a588 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -250,6 +250,8 @@ struct options int idata_loc; /* indirect address space */ int code_loc; /* code location start */ int iram_size; /* internal ram size (used only for error checking) */ + int xram_size; /* external ram size (used only for error checking) */ + int code_size; /* code size (used only for error checking) */ }; /* forward definition for variables accessed globally */ diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 56000da9..aeb55706 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -122,6 +122,8 @@ char DefaultExePath[128]; #define OPTION_SHORT_IS_8BITS "--short-is-8bits" #define OPTION_TINI_LIBID "--tini-libid" #define OPTION_NO_XINIT_OPT "--no-xinit-opt" +#define OPTION_XRAM_SIZE "--xram-size" +#define OPTION_CODE_SIZE "--code-size" static const OPTION optionsTable[] = { @@ -164,9 +166,11 @@ optionsTable[] = { { 0, "--dumptree", &options.dump_tree, "dump front-end AST before generating iCode" }, { 0, OPTION_DUMP_ALL, NULL, "Dump the internal structure at all stages" }, { 0, OPTION_XRAM_LOC, NULL, " External Ram start location" }, + { 0, OPTION_XRAM_SIZE, NULL, " External Ram size" }, { 0, OPTION_IRAM_SIZE, NULL, " Internal Ram size" }, { 0, OPTION_XSTACK_LOC, NULL, " External Ram start location" }, { 0, OPTION_CODE_LOC, NULL, " Code Segment Location" }, + { 0, OPTION_CODE_SIZE, NULL, " Code Segment size" }, { 0, OPTION_STACK_LOC, NULL, " Stack pointer initial value" }, { 0, OPTION_DATA_LOC, NULL, " Direct data start location" }, { 0, OPTION_IDATA_LOC, NULL, NULL }, @@ -903,6 +907,18 @@ parseCmdLine (int argc, char **argv) continue; } + if (strcmp (argv[i], OPTION_XRAM_SIZE) == 0) + { + options.xram_size = getIntArg(OPTION_IRAM_SIZE, argv, &i, argc); + continue; + } + + if (strcmp (argv[i], OPTION_CODE_SIZE) == 0) + { + options.code_size = getIntArg(OPTION_IRAM_SIZE, argv, &i, argc); + continue; + } + if (strcmp (argv[i], OPTION_DATA_LOC) == 0) { options.data_loc = getIntArg(OPTION_DATA_LOC, argv, &i, argc); @@ -1211,6 +1227,14 @@ linkEdit (char **envp) if (options.iram_size) fprintf (lnkfile, "-a 0x%04x\n", options.iram_size); + /* if xram size specified */ + if (options.xram_size) + fprintf (lnkfile, "-v 0x%04x\n", options.xram_size); + + /* if code size specified */ + if (options.code_size) + fprintf (lnkfile, "-w 0x%04x\n", options.code_size); + if (options.debug) fprintf (lnkfile, "-z\n");