Misc flat 24 stack handling fixes
[fw/sdcc] / src / mcs51 / main.c
index 2f22fd76d0c61fcaad3f69e0a8742bcf64a08513..5276dd148782829ca12f3aad919fd1a3ddfa625b 100644 (file)
@@ -8,6 +8,11 @@
 #include "main.h"
 #include "ralloc.h"
 
+static char _defaultRules[] =
+{
+#include "peeph.rul"
+};
+
 /* list of key words used by msc51 */
 static char *_mcs51_keywords[] =     {
     "at",
@@ -55,6 +60,15 @@ static void _mcs51_finaliseOptions(void)
     {
         port->s.fptr_size = 3;
         port->s.gptr_size = 4;
+        port->stack.isr_overhead++;   /* Will save dpx on ISR entry. */
+        #if 1
+        port->stack.call_overhead++;      /* This acounts for the extra byte 
+                                           * of return addres on the stack.
+                                           * but is ugly. There must be a 
+                                           * better way.
+                                           */
+       #endif                                      
+        
     } 
 }
 
@@ -134,6 +148,9 @@ PORT mcs51_port = {
     {
        _linkCmd
     },
+    {
+       _defaultRules
+    },
     {
        /* Sizes: char, short, int, long, ptr, fptr, gptr, bit, float, max */
        1, 1, 2, 4, 1, 2, 3, 1, 4, 4