accept everything as symbol name in rel-files, bug fix ID 452601
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 30 Aug 2001 10:57:39 +0000 (10:57 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 30 Aug 2001 10:57:39 +0000 (10:57 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1190 4a8a32a2-be11-0410-ad9d-d568d2c75423

as/mcs51/aslink.h
as/mcs51/lklex.c
as/mcs51/lksym.c

index 7b1df7b5258a3c268aa1d0605ce3ea63233c8391..12ef9053dcbf1e1685f9f8d5e90e19f9bdaacf31 100644 (file)
@@ -647,6 +647,7 @@ extern      char            endline();
 extern char            get();
 extern VOID            getfid();
 extern VOID            getid();
+extern VOID            getSid();
 extern int             getline();
 extern int             getmap();
 extern char            getnb();
index 1992a7282bd02076f01dea62b0b86d54b9e4a510..5c51c5939995673d04787c579cd1c75dafbf0df4 100644 (file)
@@ -23,6 +23,7 @@
  *             char    get()
  *             VOID    getfid()
  *             VOID    getid()
+ *             VOID    getSid()
  *             int     getline()
  *             int     getmap()
  *             char    getnb()
@@ -94,6 +95,64 @@ char *id;
                *p++ = 0;
 }
 
+/*)Function    VOID    getSid (char *id)
+ *
+ *             char *  id              a pointer to a string of
+ *                                     maximum length NCPS
+ *
+ *  getSid is derived from getid. It is called from newsym()
+ *  in lksym.c, when an S-record has to be scanned. getSid accepts
+ *  much more characters than getid, which is necessary for SDCC.
+ * 
+ *     The function getSid() scans the current input text line
+ *     from the current position copying the next string
+ *     into the external string buffer (id).  The string ends when a space
+ *  character (space, tab, \0) is found. The maximum number of
+ *     characters copied is NCPS.  If the input string is larger than
+ *     NCPS characters then the string is truncated, if the input string
+ *     is shorter than NCPS characters then the string is NULL filled.
+ *     Intervening white space (SPACES and TABS) are skipped.
+ *
+ *     local variables:
+ *             char *  p               pointer to external string buffer
+ *             int     c               current character value
+ *
+ *     global variables:
+ *             char    ctype[]         a character array which defines the
+ *                                     type of character being processed.
+ *                                     This index is the character
+ *                                     being processed.
+ *
+ *     called functions:
+ *             char    get()           lklex.c
+ *             char    getnb()         lklex.c
+ *             VOID    unget()         lklex.c
+ *
+ *     side effects:
+ *             use of getnb(), get(), and unget() updates the
+ *             global pointer ip the position in the current
+ *             input text line.
+ */
+
+VOID
+getSid (id)
+char *id;
+{
+  register int c;
+       register char *p;
+
+  c = getnb();
+       p = id;
+       do {
+               if (p < &id[NCPS])
+                       *p++ = c;
+               c = get();
+       } while (c != '\0' && c != ' ' && c != '\t');
+       unget(c);
+       while (p < &id[NCPS])
+               *p++ = 0;
+}
+
 /*)Function    VOID    getfid(fid,c)
  *
  *             char *  str             a pointer to a string of
index 229234c71b1007209df8079f48ff464203561c68..f266f31d816f3dfb29bac8b99f6543bbbdd065b4 100644 (file)
@@ -108,6 +108,7 @@ syminit()
  *             Addr_T  eval()          lkeval.c
  *             VOID    exit()          c_library
  *             int     fprintf()       c_library
+ *             char    getSid()        lklex.c
  *             char    get()           lklex.c
  *             char    getnb()         lklex.c
  *             sym *   lkpsym()        lksym.c
@@ -140,7 +141,7 @@ newsym()
        struct sym **s;
        char id[NCPS];
 
-       getid(id, -1);
+       getSid(id);     // old: getid(id, -1);
        tsp = lkpsym(id, 1);
        c = getnb();get();get();
        if (c == 'R') {