* as/hc08/aslex.c,
[fw/sdcc] / as / mcs51 / asmain.c
index 79934663b7702ae7aeeff89cca18c99ac893c8f3..3d31bf03b5776e3f2e1eaf51ed2cccf3242304df 100644 (file)
@@ -17,6 +17,7 @@
 #include <string.h>
 
 #include "asm.h"
+#include "strcmpi.h"
 
 /*)Module      asmain.c
  *
  *             VOID    diag()          assubr.c
  *             VOID    err()           assubr.c
  *             int     fprintf()       c-library
- *             int     getline()       aslex.c
+ *             int     as_getline()    aslex.c
  *             VOID    list()          aslist.c
  *             VOID    lstsym()        aslist.c
  *             VOID    minit()         ___mch.c
@@ -288,7 +289,7 @@ char *argv[];
                dot.s_area = &dca;
                symp = &dot;
                minit();
-               while (getline()) {
+               while (as_getline()) {
                        cp = cb;
                        cpt = cbt;
                        ep = eb;
@@ -799,7 +800,7 @@ loop:
                break;
 
        case S_MODUL:
-               getst(id, -1);
+               getst(id, getnb()); // a module can start with a digit
                if (pass == 0) {
                        if (module[0]) {
                                err('m');
@@ -810,6 +811,20 @@ loop:
                lmode = SLIST;
                break;
 
+    case S_OPTSDCC:
+               p = optsdcc;
+               if ((c = getnb()) != 0) {
+                       do {
+                               if (p < &optsdcc[NINPUT-1])
+                                       *p++ = c;
+                       } while ((c = get()) != 0);
+               }
+               *p = 0;
+               unget(c);
+               lmode = SLIST;
+        /*if (pass == 0) printf("optsdcc=%s\n", optsdcc);*/
+        break;
+
        case S_GLOBL:
                do {
                        getid(id, -1);
@@ -931,7 +946,7 @@ loop:
                {
                    getst(id, -1);
                    
-                   if (!strcmpi(id, "on"))
+                   if (!as_strcmpi(id, "on"))
                    {
                        /* Quick sanity check: size of 
                         * Addr_T must be at least 24 bits.
@@ -949,7 +964,7 @@ loop:
                            flat24Mode = 1;
                        }
                    }
-                   else if (!strcmpi(id, "off"))
+                   else if (!as_strcmpi(id, "off"))
                    {
                        flat24Mode = 0;
                    }