]> git.sur5r.net Git - cc65/blobdiff - src/da65/infofile.c
Style and alignment fixes.
[cc65] / src / da65 / infofile.c
index 4ee1ffd79c5de7f2aa51ff9cd1943c39d21ddffd..6db82cb362c1f8ac86ac02497aded79370896b2a 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000-2011, Ullrich von Bassewitz                                      */
+/* (C) 2000-2014, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
@@ -59,6 +59,7 @@
 #include "opctable.h"
 #include "scanner.h"
 #include "segment.h"
+#include "handler.h"
 
 
 
@@ -376,17 +377,19 @@ static void LabelSection (void)
 /* Parse a label section */
 {
     static const IdentTok LabelDefs[] = {
-        {   "COMMENT",  INFOTOK_COMMENT },
-        {   "ADDR",     INFOTOK_ADDR    },
-        {   "NAME",     INFOTOK_NAME    },
-        {   "SIZE",     INFOTOK_SIZE    },
+        {   "COMMENT",      INFOTOK_COMMENT     },
+        {   "ADDR",         INFOTOK_ADDR        },
+        {   "NAME",         INFOTOK_NAME        },
+        {   "SIZE",         INFOTOK_SIZE        },
+        {   "PARAMSIZE",    INFOTOK_PARAMSIZE   },
     };
 
     /* Locals - initialize to avoid gcc warnings */
-    char* Name    = 0;
-    char* Comment = 0;
-    long Value    = -1;
-    long Size     = -1;
+    char* Name      = 0;
+    char* Comment   = 0;
+    long Value      = -1;
+    long Size       = -1;
+    long ParamSize  = -1;
 
     /* Skip the token */
     InfoNextTok ();
@@ -448,6 +451,17 @@ static void LabelSection (void)
                 InfoNextTok ();
                 break;
 
+            case INFOTOK_PARAMSIZE:
+                InfoNextTok ();
+                if (ParamSize >= 0) {
+                    InfoError ("ParamSize already given");
+                }
+                InfoAssureInt ();
+                InfoRangeCheck (1, 0x10000);
+                ParamSize = InfoIVal;
+                InfoNextTok ();
+                break;
+
             default:
                 Internal ("Unexpected token: %u", InfoTok);
         }
@@ -484,6 +498,9 @@ static void LabelSection (void)
     } else {
         AddExtLabelRange ((unsigned) Value, Name, Size);
     }
+    if (ParamSize >= 0) {
+        SetSubroutineParamSize ((unsigned) Value, (unsigned) ParamSize);
+    }
 
     /* Define the comment */
     if (Comment) {
@@ -748,16 +765,13 @@ static void SegmentSection (void)
     if (Start < 0) {
         InfoError ("Start address is missing");
     }
-    if (Start == End) {
-        InfoError ("Segment is empty");
-    }
     if (Start > End) {
         InfoError ("Start address of segment is greater than end address");
     }
 
     /* Check that segments do not overlap */
     if (SegmentDefined ((unsigned) Start, (unsigned) End)) {
-        InfoError ("Segments cannot overlap");
+        InfoError ("Segments must not overlap");
     }
 
     /* Remember the segment data */