flat 24: mung fReturnSize before packing registers to get packRegForOneUse working...
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 Feb 2000 20:14:36 +0000 (20:14 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 16 Feb 2000 20:14:36 +0000 (20:14 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@109 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/mcs51/gen.c
src/mcs51/gen.h
src/mcs51/main.c
src/mcs51/ralloc.c
src/mcs51/ralloc.h

index 60b7b2dee9199332fae8ea4d1f23b4ae955d0d64..2a912fd81772d481fd74a3d8e2a3b84015adc0a7 100644 (file)
@@ -61,10 +61,10 @@ static char *zero = "#0x00";
 static char *one  = "#0x01";
 static char *spname ;
 
-static char *fReturn8051[] = {"dpl","dph","b","a" };
-static char *fReturn390[] = {"dpl","dph","dpx", "b","a" };
+char *fReturn8051[] = {"dpl","dph","b","a" };
+char *fReturn390[] = {"dpl","dph","dpx", "b","a" };
 unsigned fReturnSize = 4; /* shared with ralloc.c */
-static char **fReturn = fReturn8051;
+char **fReturn = fReturn8051;
 static char *accUse[] = {"a","b"};
 
 static short rbank = -1;
@@ -7287,13 +7287,6 @@ void gen51Code (iCode *lic)
     iCode *ic;
     int cln = 0;
 
-    /* Hack-o-matic: change fReturn based on model. */
-    if (options.model == MODEL_FLAT24)
-    {
-        fReturn = fReturn390;
-        fReturnSize = 5;
-    }
-
     lineHead = lineCurr = NULL;
 
     /* if debug information required */
index 3c56dcfd9be1777462a61d08eea75db59f19caf4..643dfcc3679cb0c4d64e6eaf4cbe8660bc01d951 100644 (file)
@@ -68,5 +68,9 @@ typedef struct asmop {
 
 void gen51Code (iCode *);
 
+extern char *fReturn8051[];
+extern char *fReturn390[];
+extern unsigned fReturnSize;
+extern char **fReturn;
 
 #endif
index 3723fed344ca466c1f334e8a5474fe1a6e2c6bde..e4732ad90d768544c4d0e92b44ae8db5ea40af95 100644 (file)
@@ -7,6 +7,7 @@
 #include "common.h"
 #include "main.h"
 #include "ralloc.h"
+#include "gen.h"
 
 static char _defaultRules[] =
 {
@@ -67,8 +68,9 @@ static void _mcs51_finaliseOptions(void)
                                            * but is ugly. There must be a 
                                            * better way.
                                            */
-       #endif                                      
-        
+       #endif
+        fReturn = fReturn390;
+        fReturnSize = 5;
     } 
 }
 
index eb82aff5a155d9b2d33bf801a7fcad80a2970175..0f01e758b96233da85799425a7aa13ee03dfc82e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "common.h"
 #include "ralloc.h"
+#include "gen.h"
 
 /*-----------------------------------------------------------------*/
 /* At this point we start getting processor specific although      */
index 0488a61c7b5a814faab11865ba9b260824fb1e1a..0e1ecbe049113e67ea8b0bee55ca361f4bb576b9 100644 (file)
@@ -54,7 +54,4 @@ extern regs regs8051[];
 
 regs  *mcs51_regWithIdx (int);
 
-/* in gen.c */
-extern unsigned fReturnSize;
-
 #endif