sim/ucsim/gui.src/Makefile.in: target "install" builds the same packages as target...
[fw/sdcc] / as / mcs51 / lkmem.c
index 9ff0c161f9bf91956ce938565e31598dd2e114a7..6a2d8770c5563cea8cd604be87a9583eb3329ed4 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 #include "aslink.h"
+#include "strcmpi.h"
 
 int summary(struct area * areap) 
 {
-       #define EQ(A,B) !strcmpi((A),(B))
+       #define EQ(A,B) !as_strcmpi((A),(B))
        #define MIN_STACK 16
        #define REPORT_ERROR(A, H) \
        {\
@@ -251,9 +252,8 @@ int summary(struct area * areap)
        }
 
        /*Report the position of the begining of the stack*/
-       /* TODO find flag for DS390 */
        fprintf(of, "\n%stack starts at: 0x%02lx (sp set to 0x%02lx)",
-               0 ? "16 bit mode initial s" : "S", Stack.Start, Stack.Start-1);
+               rflag ? "16 bit mode initial s" : "S", Stack.Start, Stack.Start-1);
 
        /*Check that the stack pointer is landing in a safe place:*/
        if( (dram[Stack.Start] & 0x8000) == 0x8000 )
@@ -314,7 +314,7 @@ int summary(struct area * areap)
        else
                sprintf(end,  "0x%04lx", XRam.Size+XRam.Start-1);
        sprintf(size, "%5lu", XRam.Size);
-       sprintf(max, "%5lu", XRam.Max);
+       sprintf(max, "%5lu", xram_size<0?XRam.Max:xram_size);
        fprintf(of, format, XRam.Name, start, end, size, max);
 
        /*Report Rom/Flash totals:*/
@@ -324,7 +324,7 @@ int summary(struct area * areap)
        else
                sprintf(end,  "0x%04lx", Rom.Size+Rom.Start-1);
        sprintf(size, "%5lu", Rom.Size);
-       sprintf(max, "%5lu", Rom.Max);
+       sprintf(max, "%5lu", code_size<0?Rom.Max:code_size);
        fprintf(of, format, Rom.Name, start, end, size, max);
 
        /*Report any excess:*/
@@ -333,12 +333,14 @@ int summary(struct area * areap)
                sprintf(buff, "Insufficient INDIRECT RAM memory.\n");
                REPORT_ERROR(buff, 1);
        }
-       if((XRam.Start+XRam.Size)>XRam.Max)
+       if( ((XRam.Start+XRam.Size)>XRam.Max) ||
+               (((int)XRam.Size>xram_size)&&(xram_size>=0)) )
        {
                sprintf(buff, "Insufficient EXTERNAL RAM memory.\n");
                REPORT_ERROR(buff, 1);
        }
-       if((Rom.Start+Rom.Size)>Rom.Max)
+       if( ((Rom.Start+Rom.Size)>Rom.Max) ||
+               (((int)Rom.Size>code_size)&&(code_size>=0)) )
        {
                sprintf(buff, "Insufficient ROM/EPROM/FLASH memory.\n");
                REPORT_ERROR(buff, 1);