* src/port.h,
[fw/sdcc] / src / avr / main.c
index 9ce3cd8ab26424614859d38fd92aebb0b25a2c51..b5f958cab46ea8abe66d15c373f8839fef5c2db9 100644 (file)
@@ -131,6 +131,29 @@ _avr_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
        return TRUE;
 }
 
+/* Indicate which extended bit operations this port supports */
+static bool
+hasExtBitOp (int op, int size)
+{
+  if (op == RRC
+      || op == RLC
+      || op == GETHBIT
+     )
+    return TRUE;
+  else
+    return FALSE;
+}
+
+/* Indicate the expense of an access to an output storage class */
+static int
+oclsExpense (struct memmap *oclass)
+{
+  if (IN_FARSPACE(oclass))
+    return 1;
+    
+  return 0;
+}
+
 /** $1 is always the basename.
     $2 is always the output file.
     $3 varies
@@ -138,12 +161,12 @@ _avr_genIVT (FILE * of, symbol ** interrupts, int maxInterrupts)
     MUST be terminated with a NULL.
 */
 static const char *_linkCmd[] = {
-       "linkavr", "", "$1", NULL
+       "linkavr", "", "\"$1\"", NULL
 };
 
 /* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
 static const char *_asmCmd[] = {
-       "asavr", "$l" , "$3", "$1.s", NULL
+       "asavr", "$l" , "$3", "\"$1.s\"", NULL
 };
 
 /* Globals */
@@ -153,9 +176,11 @@ PORT avr_port = {
        "ATMEL AVR",            /* Target name */
        NULL,                   /* processor */
        {
+         glue,
         TRUE,                  /* Emit glue around main */
         MODEL_LARGE | MODEL_SMALL,
-        MODEL_SMALL},
+        MODEL_SMALL
+       },
        {
         _asmCmd,
          NULL,
@@ -194,6 +219,7 @@ PORT avr_port = {
         NULL,
         0,
         },
+        { NULL, NULL },
        {
         -1, 1, 4, 1, 1, 0},
        /* avr has an 8 bit mul */
@@ -218,7 +244,10 @@ PORT avr_port = {
         NULL,
        NULL,
         NULL,
+       hasExtBitOp,            /* hasExtBitOp */
+       oclsExpense,            /* oclsExpense */
        FALSE,
+       TRUE,                   /* little endian */
        0,                      /* leave lt */
        1,                      /* transform gt ==> not le */
        0,                      /* leave le */