* as/mcs51/lkarea.c: removed old K&R style,
[fw/sdcc] / src / xa51 / main.c
index 53b54359adb1199e4ff6a724ef4424d4770f34f1..3c1d73fb951a9af227a8bb7c72bda042bbdadfd5 100755 (executable)
@@ -42,7 +42,11 @@ static char *_xa51_keywords[] =
   NULL
 };
 
-extern int rewinds;
+/* rewinds declared in asm.c, function printCLine().
+ * Currently commented out.
+ *
+ * extern int rewinds;
+ */
 void   _xa51_genAssemblerEnd (FILE * of)
 {
   //fprintf (stderr, "Did %d rewind%c for c-line in asm comments\n", rewinds,
@@ -60,7 +64,7 @@ _xa51_init (void)
 }
 
 static void
-_xa51_reset_regparm ()
+_xa51_reset_regparm (void)
 {
   regParmFlg = 0;
 }
@@ -188,6 +192,30 @@ static bool cseCostEstimation (iCode *ic, iCode *pdic)
     return 1;
 }
 
+/* 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
@@ -213,6 +241,7 @@ PORT xa51_port =
   "MCU 80C51XA",                       /* Target name */
   NULL,                                /* Processor name */
   {
+    glue,
     FALSE,                     /* Emit glue around main */
     MODEL_PAGE0,
     MODEL_PAGE0
@@ -230,7 +259,8 @@ PORT xa51_port =
     _linkCmd,
     NULL,
     NULL,
-    ".rel"
+    ".rel",
+    1
   },
   {
     _defaultRules
@@ -245,6 +275,7 @@ PORT xa51_port =
     "CSEG    (CODE)",
     "DSEG    (DATA)",
     NULL, //"ISEG    (DATA)",
+    NULL, //"PSEG    (PAG,XDATA)",
     "XSEG    (XDATA)",
     "BSEG    (BIT)",
     NULL, //"RSEG    (DATA)",
@@ -271,10 +302,24 @@ PORT xa51_port =
   {
     2, -2
   },
+  {
+    xa51_emitDebuggerSymbol
+  },
+  {
+    255/3,      /* maxCount */
+    3,          /* sizeofElement */
+    /* The rest of these costs are bogus. They approximate */
+    /* the behavior of src/SDCCicode.c 1.207 and earlier.  */
+    {4,4,4},    /* sizeofMatchJump[] */
+    {0,0,0},    /* sizeofRangeCompare[] */
+    0,          /* sizeofSubtract */
+    3,          /* sizeofDispatch */
+  },
   "_",
   _xa51_init,
   _xa51_parseOptions,
   NULL,
+  NULL,
   _xa51_finaliseOptions,
   _xa51_setDefaultOptions,
   xa51_assignRegisters,
@@ -284,12 +329,16 @@ PORT xa51_port =
   _xa51_genAssemblerEnd,
   _xa51_genIVT,
   _xa51_genXINIT,
+  NULL,                        /* genInitStartup */
   _xa51_reset_regparm,
   _xa51_regparm,
   NULL, // process_pragma()
   NULL, // getMangledFunctionName()
   NULL, // hasNativeMulFor()
+  hasExtBitOp,                 /* hasExtBitOp */
+  oclsExpense,                 /* oclsExpense */
   TRUE, // use_dw_for_init
+  TRUE,                                /* little endian */
   0,                           /* leave lt */
   0,                           /* leave gt */
   1,                           /* transform <= to ! > */