From 5041ceef1317fba40db00ddc5f57b74f7484220d Mon Sep 17 00:00:00 2001 From: johanknol Date: Fri, 27 Dec 2002 11:51:33 +0000 Subject: [PATCH] added option --no-xinit-opt git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2121 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCglobl.h | 3 ++- src/SDCCmain.c | 3 +++ src/ds390/gen.c | 4 ++-- src/mcs51/gen.c | 4 ++-- src/mcs51/main.c | 4 ++++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/SDCCglobl.h b/src/SDCCglobl.h index 4bfc4c32..1a62ccc4 100644 --- a/src/SDCCglobl.h +++ b/src/SDCCglobl.h @@ -289,7 +289,8 @@ extern int nlibFiles; extern char *libPaths[128]; extern int nlibPaths; -extern bool verboseExec ; +extern bool verboseExec; +extern bool noXinitOpt; void parseWithComma (char **, char *); diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 1f198456..5c3e0e27 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -72,6 +72,7 @@ char *relFiles[128]; int nrelFiles = 0; bool verboseExec = FALSE; char *preOutName; +bool noXinitOpt = FALSE; /* uncomment JAMIN_DS390 to always override and use ds390 port for mcs51 work. This is temporary, for compatibility testing. */ @@ -116,6 +117,7 @@ char DefaultExePath[128]; #define OPTION_NO_GCSE "--nogcse" #define OPTION_SHORT_IS_8BITS "--short-is-8bits" #define OPTION_TINI_LIBID "--tini-libid" +#define OPTION_NO_XINIT_OPT "--no-xinit-opt" static const OPTION optionsTable[] = { @@ -197,6 +199,7 @@ optionsTable[] = { { 0, "--tini-libid", NULL," LibraryID used in -mTININative"}, { 0, "--protect-sp-update", &options.protect_sp_update,"DS390 - will disable interrupts during ESP:SP updates"}, { 0, "--parms-in-bank1", &options.parms_in_bank1,"MCS51/DS390 - use Bank1 for parameter passing"}, + { 0, OPTION_NO_XINIT_OPT, &noXinitOpt, "don't memcpy initialized xram from code"}, /* End of options */ { 0, NULL } }; diff --git a/src/ds390/gen.c b/src/ds390/gen.c index d5c29aa6..77bae8aa 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -9489,7 +9489,7 @@ genPointerGet (iCode * ic, iCode *pi) if (p_type == GPOINTER && OP_SYMBOL(left)->remat && IS_CAST_ICODE(OP_SYMBOL(left)->rematiCode)) { left = IC_RIGHT(OP_SYMBOL(left)->rematiCode); - type = type = operandType (left); + type = operandType (left); p_type = DCL_TYPE (type); } /* now that we have the pointer type we assign @@ -10158,7 +10158,7 @@ genPointerSet (iCode * ic, iCode *pi) if (p_type == GPOINTER && OP_SYMBOL(result)->remat && IS_CAST_ICODE(OP_SYMBOL(result)->rematiCode)) { result = IC_RIGHT(OP_SYMBOL(result)->rematiCode); - type = type = operandType (result); + type = operandType (result); p_type = DCL_TYPE (type); } diff --git a/src/mcs51/gen.c b/src/mcs51/gen.c index 86b86649..93395193 100644 --- a/src/mcs51/gen.c +++ b/src/mcs51/gen.c @@ -7640,7 +7640,7 @@ genPointerGet (iCode * ic, iCode *pi) if (p_type == GPOINTER && OP_SYMBOL(left)->remat && IS_CAST_ICODE(OP_SYMBOL(left)->rematiCode)) { left = IC_RIGHT(OP_SYMBOL(left)->rematiCode); - type = type = operandType (left); + type = operandType (left); p_type = DCL_TYPE (type); } /* now that we have the pointer type we assign @@ -8251,7 +8251,7 @@ genPointerSet (iCode * ic, iCode *pi) if (p_type == GPOINTER && OP_SYMBOL(result)->remat && IS_CAST_ICODE(OP_SYMBOL(result)->rematiCode)) { result = IC_RIGHT(OP_SYMBOL(result)->rematiCode); - type = type = operandType (result); + type = operandType (result); p_type = DCL_TYPE (type); } /* now that we have the pointer type we assign diff --git a/src/mcs51/main.c b/src/mcs51/main.c index 7423dd32..b1ca1f29 100644 --- a/src/mcs51/main.c +++ b/src/mcs51/main.c @@ -105,6 +105,10 @@ _mcs51_parseOptions (int *pargc, char **argv, int *i) static void _mcs51_finaliseOptions (void) { + if (noXinitOpt /* || options.model==MODEL_SMALL */) { + port->genXINIT=0; + } + if (options.model == MODEL_LARGE) { port->mem.default_local_map = xdata; port->mem.default_globl_map = xdata; -- 2.47.2