]> git.gag.com Git - fw/sdcc/commitdiff
AVR specific changes
authorsandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 19 Feb 2001 01:59:20 +0000 (01:59 +0000)
committersandeep <sandeep@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 19 Feb 2001 01:59:20 +0000 (01:59 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@638 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/avr/gen.c
src/avr/main.c

index 15c1c19d605f707c6ba58619aa287c53a8a11ad7..191a13d9ae0ed35dbca880a3600251ce7a67309a 100644 (file)
@@ -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)
index 1e95dd7ff426c3d516ed9e6372e522da01cab648..f7bc95f5d299d3dbeaf9edff026b403ed0edd96d 100644 (file)
@@ -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 */