From 887304dc58841096754a4fec65f2238858f2e804 Mon Sep 17 00:00:00 2001 From: sandeep Date: Mon, 19 Feb 2001 01:59:20 +0000 Subject: [PATCH] AVR specific changes git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@638 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/avr/gen.c | 48 ++++++++++++++++++------------------------------ src/avr/main.c | 6 +++--- 2 files changed, 21 insertions(+), 33 deletions(-) diff --git a/src/avr/gen.c b/src/avr/gen.c index 15c1c19d..191a13d9 100644 --- a/src/avr/gen.c +++ b/src/avr/gen.c @@ -70,8 +70,7 @@ static char *larray[4] = {"lo8", "hi8", "hlo8", "hhi8"}; static char *tscr[4] = {"r0", "r1", "r24", "r25"}; -static struct - { +static struct { short xPushed; short zPushed; short accInUse; @@ -79,8 +78,7 @@ static struct short debugLine; short nRegsSaved; set *sendSet; - } -_G; +} _G; extern int avr_ptrRegReq; extern int avr_nRegs; @@ -123,20 +121,18 @@ emitcode (char *inst, char *fmt,...) va_start (ap, fmt); - if (inst && *inst) - { - if (fmt && *fmt) - sprintf (lb, "%s\t", inst); - else - sprintf (lb, "%s", inst); - vsprintf (lb + (strlen (lb)), fmt, ap); - } + if (inst && *inst) { + if (fmt && *fmt) + sprintf (lb, "%s\t", inst); + else + sprintf (lb, "%s", inst); + vsprintf (lb + (strlen (lb)), fmt, ap); + } else vsprintf (lb, fmt, ap); - - while (isspace (*lbp)) - lbp++; - + + while (isspace (*lbp)) lbp++; + if (lbp && *lbp) lineCurr = (lineCurr ? connectLine (lineCurr, newLineNode (lb)) : @@ -161,17 +157,15 @@ getFreePtr (iCode * ic, asmop ** aopp, bool result, bool zonly) /* first check if x & z are used by this instruction, in which case we are in trouble */ if ((xiu = bitVectBitValue (ic->rUsed, X_IDX)) && - (ziu = bitVectBitValue (ic->rUsed, Z_IDX))) - { - goto endOfWorld; - } + (ziu = bitVectBitValue (ic->rUsed, Z_IDX))) { + goto endOfWorld; + } xou = bitVectBitValue (ic->rMask, X_IDX); zou = bitVectBitValue (ic->rMask, Z_IDX); /* if no usage of Z then return it */ - if (!ziu && !zou) - { + if (!ziu && !zou) { ic->rUsed = bitVectSetBit (ic->rUsed, Z_IDX); (*aopp)->type = AOP_Z; @@ -5420,17 +5414,11 @@ genAVRCode (iCode * lic) { cdbSymbol (currFunc, cdbFile, FALSE, TRUE); _G.debugLine = 1; - if (IS_STATIC (currFunc->etype)) - emitcode ("", "F%s$%s$0$0 ==.", moduleName, currFunc->name); - else - emitcode ("", "G$%s$0$0 ==.", currFunc->name); + emitcode("",".type %s,@function",currFunc->name); _G.debugLine = 0; } /* stack pointer name */ - if (options.useXstack) - spname = "_spx"; - else - spname = "sp"; + spname = "sp"; for (ic = lic; ic; ic = ic->next) diff --git a/src/avr/main.c b/src/avr/main.c index 1e95dd7f..f7bc95f5 100644 --- a/src/avr/main.c +++ b/src/avr/main.c @@ -40,7 +40,7 @@ static int regParmFlg = 0; /* determine if we can register a parameter */ static void _avr_init (void) { - asm_addTree (&asm_asxxxx_mapping); + asm_addTree (&asm_gas_mapping); } static void @@ -142,12 +142,12 @@ _avr_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts) */ static const char *_linkCmd[] = { - "aslink", "-nf", "$1", NULL + "avr-ld", "", "$1", NULL }; static const char *_asmCmd[] = { - "asx8051", "-plosgffc", "$1.asm", NULL + "avr-as", "", "$1.asm", NULL }; /* Globals */ -- 2.47.2