cleaned up the mess I left behind
[fw/sdcc] / as / mcs51 / lkmain.c
index 1d8df7cf6c9d69ecab8d6dc4733dcfc3d23ee4a3..8ea5fde7f25b69ec70309c8b3b909a66cc1301cb 100644 (file)
@@ -245,6 +245,7 @@ char *argv[];
        
        if (dflag){
            //dfp = afile("temp", "cdb", 1);
+               SaveLinkedFilePath(linkp->f_idp); //Must be the first one... 
                dfp = afile(linkp->f_idp,"cdb",1); //JCF: Nov 30, 2002
            if (dfp == NULL) 
                lkexit(1);
@@ -458,7 +459,6 @@ link_main()
                sdp.s_area = NULL;
                sdp.s_areax = NULL;
                sdp.s_addr = 0;
-               // jwk lastExtendedAddress = -1;
                break;
 
        case 'M':
@@ -790,6 +790,16 @@ parse()
                                        iramsav();
                                        return(0);
 
+                               case 'v':
+                               case 'V':
+                                       xramsav();
+                                       return(0);
+
+                               case 'w':
+                               case 'W':
+                                       codesav();
+                                       return(0);
+
                                case 'z':
                                 case 'Z':
                                        dflag = 1;                                      
@@ -918,14 +928,14 @@ setbas()
                        }
                        if (ap == NULL) {
                                fprintf(stderr,
-                               "No definition of area %s\n", id);
+                               "ASlink-Warning-No definition of area %s\n", id);
                                lkerr++;
                        } else {
                                ap->a_addr = v;
                                 ap->a_type = 1;        /* JLH: value set */
                        }
                } else {
-                       fprintf(stderr, "No '=' in base expression");
+                       fprintf(stderr, "ASlink-Warning-No '=' in base expression");
                        lkerr++;
                }
                bsp = bsp->b_base;
@@ -1160,6 +1170,29 @@ iramsav()
     iram_size = 128;           /* Default is 128 (0x80) bytes */
 }
 
+/*Similar to iramsav but for xram memory*/
+VOID
+xramsav()
+{
+  unget(getnb());
+  if (ip && *ip)
+    xram_size = expr(0);       /* evaluate size expression */
+  else
+       xram_size = rflag?0x1000000:0x10000;
+}
+
+/*Similar to iramsav but for code memory*/
+VOID
+codesav()
+{
+  unget(getnb());
+  if (ip && *ip)
+    code_size = expr(0);       /* evaluate size expression */
+  else
+       code_size = rflag?0x1000000:0x10000;
+}
+
+
 /*)Function    VOID    iramcheck()
  *
  *     The function iramcheck() is used at the end of linking to check that
@@ -1230,6 +1263,8 @@ char *usetxt[] = {
        "  -u   Update listing file(s) with link data as file(s)[.RST]",
        "Miscellaneous:\n"
        "  -a   [iram-size] Check for internal RAM overflow",
+       "  -v   [xram-size] Check for external RAM overflow",
+       "  -w   [code-size] Check for code overflow",
        "End:",
        "  -e   or null line terminates input",
        0