* as/z80/asmain.c, as/z80/asm.h, as/z80/asdata.c,
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 16 Feb 2008 14:28:22 +0000 (14:28 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 16 Feb 2008 14:28:22 +0000 (14:28 +0000)
  as/link/z80/lkmain.c, as/z80/as_gbz80.dsp, as/z80/as_z80.dsp,
  as/z80/Makefile.in. as/z80/Makefile.bcc:
  applied patch #1893393: patch for as-z80 and link-z80 to generate cdb,
  thanx to Armin Diehl
* as/*/asnoice.c, as/hc08/as_hc08.dsp, as/hc08/Makefile.in,
  as/mcs51/asx8051.dsp, as/mcs51/Makefile.in:
  asnoice.c moved to as/asxxsrc/asnoice.c

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5011 4a8a32a2-be11-0410-ad9d-d568d2c75423

16 files changed:
ChangeLog
as/asxxsrc/asnoice.c [new file with mode: 0644]
as/hc08/Makefile.in
as/hc08/as_hc08.dsp
as/hc08/asnoice.c [deleted file]
as/link/z80/lkmain.c
as/mcs51/Makefile.in
as/mcs51/asnoice.c [deleted file]
as/mcs51/asx8051.dsp
as/z80/Makefile.bcc
as/z80/Makefile.in
as/z80/as_gbz80.dsp
as/z80/as_z80.dsp
as/z80/asdata.c
as/z80/asm.h
as/z80/asmain.c

index 7489e1c16c1c55b35489ab984d7b09e0e028ec42..a9de75a2623b7b768dc8bf7f1bfee5bdaac08223 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-02-16 Borut Razem <borut.razem AT siol.net>
+
+       * 
+
 2008-02-14 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * .version,
diff --git a/as/asxxsrc/asnoice.c b/as/asxxsrc/asnoice.c
new file mode 100644 (file)
index 0000000..7c182e8
--- /dev/null
@@ -0,0 +1,131 @@
+/* asnoice.c */
+
+/*
+ * Extensions to CUG 292 assembler ASxxxx to produce NoICE debug files
+ *
+ * 3-Nov-1997 by John Hartman
+ */
+
+#include <stdio.h>
+#include <setjmp.h>
+#include <string.h>
+#include <ctype.h>
+#include "asm.h"
+
+/* Return basic file name without path or extension.
+   If spacesToUnderscores != 0 then spaces are converted to underscores */
+
+char* BaseFileName( int fileNumber, int spacesToUnderscores )
+{
+        static int prevFile = -1;
+        static char baseName[ PATH_MAX ];
+
+        char *p1, *p2;
+
+        if (fileNumber != prevFile)
+        {
+                prevFile = fileNumber;
+
+                p1 = srcfn[prevFile];
+
+                /* issue a FILE command with full path and extension */
+                fprintf( ofp, ";!FILE %s\n", p1 );
+
+                /* Name starts after any colon or backslash (DOS) */
+                p2 = strrchr( p1, '\\' );
+                if (p2 == NULL) p2 = strrchr( p1, '/' );
+                if (p2 == NULL) p2 = strrchr( p1, ':' );
+                if (p2 == NULL) p2 = p1-1;
+                strcpy( baseName, p2+1 );
+
+                /* Name ends at any separator */
+                p2 = strrchr( baseName, FSEPX );
+                if (p2 != NULL) *p2 = 0;
+                /* SD comment this out since not a ANSI Function */
+                /* strupr( baseName ); */
+
+                if (spacesToUnderscores)
+                {
+                  /* Convert spaces to underscores */
+                  for (p1 = baseName; *p1; ++p1)
+                    if (isspace(*p1))
+                      *p1 = '_';
+                }
+        }
+        return baseName;
+}
+
+/* Define a symbol for current location:  FILE.line# */
+void DefineNoICE_Line()
+{
+        char name[ NCPS ];
+        struct sym *pSym;
+
+        /* symbol is FILE.nnn */
+        sprintf( name, "%s.%u", BaseFileName( cfile, 0 ), srcline[ cfile ] );
+
+        pSym = lookup( name );
+        pSym->s_type = S_USER;
+        pSym->s_area = dot.s_area;
+        pSym->s_addr = laddr;
+        pSym->s_flag |= S_GBL;
+}
+
+/* Define a symbol for current location:  A$FILE$line# */
+void DefineCDB_Line()
+{
+        char name[ NCPS ];
+        struct sym *pSym;
+
+        /* symbol is FILE.nnn */
+        sprintf( name, "A$%s$%u", BaseFileName( cfile, 1 ), srcline[ cfile ] );
+
+        pSym = lookup( name );
+        pSym->s_type = S_USER;
+        pSym->s_area = dot.s_area;
+        pSym->s_addr = laddr;
+        pSym->s_flag |= S_GBL;
+}
+
+#if 0
+OLD VERSION
+/* Define a symbol for current location:  FILE.line# */
+void DefineNoICE_Line()
+{
+        static int prevFile = -1;
+        static struct area *pPrevArea = NULL;
+        static char baseName[ PATH_MAX ];
+
+        int j;
+        char *p1, *p2;
+
+        /* Get outfilename without extension for use as base symbol name */
+        if (baseName[0] == 0)
+        {
+                p1 = srcfn[0];
+                p2 = baseName;
+                while ((*p1 != 0) && (*p1 != FSEPX))
+                {
+                        *p2++ = *p1++;
+                }
+                *p2 = 0;
+                /* SD Commented this out since it is not a
+                   ASNI Function */
+                /* strupr( baseName ); */
+        }
+
+        if ((cfile != prevFile) || (dot.s_area != pPrevArea))
+        {
+                prevFile = cfile;
+                pPrevArea = dot.s_area;
+
+                /* file or area change: issue FILE command with base @ */
+                fprintf( ofp, ";!FILE %s %s_%s\n", srcfn[ cfile ],
+                         baseName,
+                         dot.s_area->a_id );
+        }
+
+        fprintf( ofp, ";!LINE %u. 0x%X\n", srcline[ cfile ], laddr );
+}
+
+#endif
index e8a9f8ad305d2d3afdcfa1572eecc5b3cb83d369..1c0e5b2f4cbcfb1180b5b393471d84ad8c957b64 100644 (file)
@@ -45,10 +45,10 @@ UTILSRC = dbuf.c dbuf_string.c
 UTILLIBOBJS = $(UTILSRC:%.c=$(OBJDIR)/%.o)
 
 ASXXLIB = $(srcdir)/../asxxsrc
-ASXXLIBSRC = strcmpi.c assym.c aslex.c
+ASXXLIBSRC = strcmpi.c assym.c aslex.c asnoice.c
 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
 
-SRC = asmain.c assubr.c asnoice.c \
+SRC = asmain.c assubr.c \
       asexpr.c asdata.c aslist.c asout.c \
       m08ext.c m08pst.c m08mch.c m08adr.c
 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
index 2b2c675e215606d94db1b24328769d8d596aec64..3f2fd2df1c83d966df9665a5b726740db216e1aa 100644 (file)
@@ -107,7 +107,7 @@ SOURCE=.\asmain.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\asnoice.c\r
+SOURCE=..\asxxsrc\asnoice.c\r
 # End Source File\r
 # Begin Source File\r
 \r
diff --git a/as/hc08/asnoice.c b/as/hc08/asnoice.c
deleted file mode 100644 (file)
index 2220d3a..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* asnoice.c */
-
-/*
- * Extensions to CUG 292 assembler ASxxxx to produce NoICE debug files
- *
- * 3-Nov-1997 by John Hartman
- */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <string.h>
-#include <ctype.h>
-#include "asm.h"
-
-/* Return basic file name without path or extension.
-   If spacesToUnderscores != 0 then spaces are converted to underscores */
-
-char* BaseFileName( int fileNumber, int spacesToUnderscores )
-{
-       static int prevFile = -1;
-        static char baseName[ PATH_MAX ];
-
-        char *p1, *p2;
-
-       if (fileNumber != prevFile)
-        {
-               prevFile = fileNumber;
-
-                p1 = srcfn[prevFile];
-
-                /* issue a FILE command with full path and extension */
-                fprintf( ofp, ";!FILE %s\n", p1 );
-
-               /* Name starts after any colon or backslash (DOS) */
-               p2 = strrchr( p1, '\\' );
-               if (p2 == NULL) p2 = strrchr( p1, '/' );
-               if (p2 == NULL) p2 = strrchr( p1, ':' );
-               if (p2 == NULL) p2 = p1-1;
-                strcpy( baseName, p2+1 );
-
-               /* Name ends at any separator */
-               p2 = strrchr( baseName, FSEPX );
-               if (p2 != NULL) *p2 = 0;
-               /* SD comment this out since not a ANSI Function */
-                /* strupr( baseName ); */
-
-                if (spacesToUnderscores)
-                {
-                  /* Convert spaces to underscores */
-                  for (p1 = baseName; *p1; ++p1)
-                    if (isspace(*p1))
-                      *p1 = '_';
-                }
-       }
-       return baseName;
-}
-
-/* Define a symbol for current location:  FILE.line# */
-void DefineNoICE_Line()
-{
-       char name[ NCPS ];
-        struct sym *pSym;
-
-       /* symbol is FILE.nnn */
-        sprintf( name, "%s.%u", BaseFileName( cfile, 0 ), srcline[ cfile ] );
-
-        pSym = lookup( name );
-        pSym->s_type = S_USER;
-        pSym->s_area = dot.s_area;
-        pSym->s_addr = laddr;
-        pSym->s_flag |= S_GBL;
-}
-
-/* Define a symbol for current location:  A$FILE$line# */
-void DefineCDB_Line()
-{
-       char name[ NCPS ];
-        struct sym *pSym;
-
-       /* symbol is FILE.nnn */
-        sprintf( name, "A$%s$%u", BaseFileName( cfile, 1 ), srcline[ cfile ] );
-
-        pSym = lookup( name );
-        pSym->s_type = S_USER;
-        pSym->s_area = dot.s_area;
-        pSym->s_addr = laddr;
-        pSym->s_flag |= S_GBL;
-}
-
-#if 0
-OLD VERSION
-/* Define a symbol for current location:  FILE.line# */
-void DefineNoICE_Line()
-{
-        static int prevFile = -1;
-        static struct area *pPrevArea = NULL;
-        static char baseName[ PATH_MAX ];
-
-        int j;
-        char *p1, *p2;
-
-       /* Get outfilename without extension for use as base symbol name */
-        if (baseName[0] == 0)
-        {
-                p1 = srcfn[0];
-                p2 = baseName;
-                while ((*p1 != 0) && (*p1 != FSEPX))
-                {
-                       *p2++ = *p1++;
-                }
-                *p2 = 0;
-               /* SD Commented this out since it is not a 
-                  ASNI Function */
-                /* strupr( baseName ); */
-       }
-
-        if ((cfile != prevFile) || (dot.s_area != pPrevArea))
-        {
-               prevFile = cfile;
-                pPrevArea = dot.s_area;
-
-               /* file or area change: issue FILE command with base @ */
-                fprintf( ofp, ";!FILE %s %s_%s\n", srcfn[ cfile ],
-                        baseName,
-                        dot.s_area->a_id );
-        }
-
-        fprintf( ofp, ";!LINE %u. 0x%X\n", srcline[ cfile ], laddr );
-}
-
-#endif
index 0c6d5c7580918302452e76ab37879751c23d2c48..fe5c174de6317e03c5fa3f7bd3ad7a50795266e8 100644 (file)
@@ -7,6 +7,7 @@
  * Alan R. Baldwin
  * 721 Berkeley St.
  * Kent, Ohio  44240
+ * 31-Feb-2008 AD added -y to create cdb file for non gameboy
  */
 
 /*
@@ -320,6 +321,14 @@ main(int argc, char *argv[])
 #endif /* GAMEBOY */
 
         syminit();
+
+        if (dflag){
+            SaveLinkedFilePath(linkp->f_idp); //Must be the first one...
+            dfp = afile(linkp->f_idp,"cdb",1);
+            if (dfp == NULL)
+                lkexit(1);
+        }
+
         for (pass=0; pass<2; ++pass) {
                 cfp = NULL;
                 sfp = NULL;
@@ -449,6 +458,7 @@ lkexit(int i)
         if (rfp != NULL) fclose(rfp);
         if (sfp != NULL) fclose(sfp);
         if (tfp != NULL) fclose(tfp);
+        if (dfp != NULL) fclose(dfp);
         exit(i);
 }
 
@@ -976,11 +986,15 @@ parse()
                                 case 'J':
                                         ++symflag;
                                         break;
-                                case 'z':
                                 case 'Z':
                                         oflag = 3;
                                         break;
 #endif /* SDK */
+#ifndef GAMEBOY
+                                case 'z':
+                                        dflag = 1;
+                                        return(0);
+#endif
                                 case 'm':
                                 case 'M':
                                         ++mflag;
@@ -1039,7 +1053,6 @@ parse()
                                 case 'L':
                                         addlib();
                                         return(0);
-
                                 default:
                                         fprintf(stderr, "Invalid option\n");
                                         lkexit(1);
@@ -1404,8 +1417,11 @@ afile(char *fn, char *ft, int wf)
 #else /* SDK */
         if ((fp = fopen(fb, wf?"w":"r")) == NULL) {
 #endif /* SDK */
+            if (strcmp(ft,"adb"))/*Do not complaint for optional adb files*/
+            {
                 fprintf(stderr, "%s: cannot %s.\n", fb, wf?"create":"open");
                 lkerr++;
+            }
         }
         return (fp);
 }
@@ -1451,11 +1467,14 @@ char *usetxt[] = {
         "Output:",
         "  -i   Intel Hex as file[IHX]",
         "  -s   Motorola S19 as file[S19]",
+#ifndef GAMEBOY
+        "  -z   Produce SDCdb debug as file[cdb]",
+#endif
 #ifdef SDK
 #ifdef GAMEGEAR
-        "  -z   Gamegear image as file[GG]",
+        "  -Z   Gamegear image as file[GG]",
 #else
-        "  -z   Gameboy image as file[GB]",
+        "  -Z   Gameboy image as file[GB]",
 #endif /* GAMEGEAR */
 #endif /* SDK */
         "List:",
index 9745bce8e91746298f302556375ec00433e79192..efcdd5d6208ba0844dd2b210897cd68352492345 100644 (file)
@@ -45,10 +45,10 @@ UTILSRC = dbuf.c dbuf_string.c
 UTILLIBOBJS = $(UTILSRC:%.c=$(OBJDIR)/%.o)
 
 ASXXLIB = $(srcdir)/../asxxsrc
-ASXXLIBSRC = strcmpi.c assym.c aslex.c
+ASXXLIBSRC = strcmpi.c assym.c aslex.c asnoice.c
 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
 
-SRC = asmain.c assubr.c asnoice.c \
+SRC = asmain.c assubr.c \
       asexpr.c asdata.c aslist.c asout.c \
       i51ext.c i51pst.c i51mch.c i51adr.c
 OBJS = $(SRC:%.c=$(OBJDIR)/%.o)
diff --git a/as/mcs51/asnoice.c b/as/mcs51/asnoice.c
deleted file mode 100644 (file)
index 2220d3a..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/* asnoice.c */
-
-/*
- * Extensions to CUG 292 assembler ASxxxx to produce NoICE debug files
- *
- * 3-Nov-1997 by John Hartman
- */
-
-#include <stdio.h>
-#include <setjmp.h>
-#include <string.h>
-#include <ctype.h>
-#include "asm.h"
-
-/* Return basic file name without path or extension.
-   If spacesToUnderscores != 0 then spaces are converted to underscores */
-
-char* BaseFileName( int fileNumber, int spacesToUnderscores )
-{
-       static int prevFile = -1;
-        static char baseName[ PATH_MAX ];
-
-        char *p1, *p2;
-
-       if (fileNumber != prevFile)
-        {
-               prevFile = fileNumber;
-
-                p1 = srcfn[prevFile];
-
-                /* issue a FILE command with full path and extension */
-                fprintf( ofp, ";!FILE %s\n", p1 );
-
-               /* Name starts after any colon or backslash (DOS) */
-               p2 = strrchr( p1, '\\' );
-               if (p2 == NULL) p2 = strrchr( p1, '/' );
-               if (p2 == NULL) p2 = strrchr( p1, ':' );
-               if (p2 == NULL) p2 = p1-1;
-                strcpy( baseName, p2+1 );
-
-               /* Name ends at any separator */
-               p2 = strrchr( baseName, FSEPX );
-               if (p2 != NULL) *p2 = 0;
-               /* SD comment this out since not a ANSI Function */
-                /* strupr( baseName ); */
-
-                if (spacesToUnderscores)
-                {
-                  /* Convert spaces to underscores */
-                  for (p1 = baseName; *p1; ++p1)
-                    if (isspace(*p1))
-                      *p1 = '_';
-                }
-       }
-       return baseName;
-}
-
-/* Define a symbol for current location:  FILE.line# */
-void DefineNoICE_Line()
-{
-       char name[ NCPS ];
-        struct sym *pSym;
-
-       /* symbol is FILE.nnn */
-        sprintf( name, "%s.%u", BaseFileName( cfile, 0 ), srcline[ cfile ] );
-
-        pSym = lookup( name );
-        pSym->s_type = S_USER;
-        pSym->s_area = dot.s_area;
-        pSym->s_addr = laddr;
-        pSym->s_flag |= S_GBL;
-}
-
-/* Define a symbol for current location:  A$FILE$line# */
-void DefineCDB_Line()
-{
-       char name[ NCPS ];
-        struct sym *pSym;
-
-       /* symbol is FILE.nnn */
-        sprintf( name, "A$%s$%u", BaseFileName( cfile, 1 ), srcline[ cfile ] );
-
-        pSym = lookup( name );
-        pSym->s_type = S_USER;
-        pSym->s_area = dot.s_area;
-        pSym->s_addr = laddr;
-        pSym->s_flag |= S_GBL;
-}
-
-#if 0
-OLD VERSION
-/* Define a symbol for current location:  FILE.line# */
-void DefineNoICE_Line()
-{
-        static int prevFile = -1;
-        static struct area *pPrevArea = NULL;
-        static char baseName[ PATH_MAX ];
-
-        int j;
-        char *p1, *p2;
-
-       /* Get outfilename without extension for use as base symbol name */
-        if (baseName[0] == 0)
-        {
-                p1 = srcfn[0];
-                p2 = baseName;
-                while ((*p1 != 0) && (*p1 != FSEPX))
-                {
-                       *p2++ = *p1++;
-                }
-                *p2 = 0;
-               /* SD Commented this out since it is not a 
-                  ASNI Function */
-                /* strupr( baseName ); */
-       }
-
-        if ((cfile != prevFile) || (dot.s_area != pPrevArea))
-        {
-               prevFile = cfile;
-                pPrevArea = dot.s_area;
-
-               /* file or area change: issue FILE command with base @ */
-                fprintf( ofp, ";!FILE %s %s_%s\n", srcfn[ cfile ],
-                        baseName,
-                        dot.s_area->a_id );
-        }
-
-        fprintf( ofp, ";!LINE %u. 0x%X\n", srcline[ cfile ], laddr );
-}
-
-#endif
index f6698da802d6b9efe79af85ee9c8fa20dd099319..6e3afef9d3afa1da1ded3a0dd4bd39edfc91bb96 100644 (file)
@@ -108,7 +108,7 @@ SOURCE=.\asmain.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\asnoice.c\r
+SOURCE=..\asxxsrc\asnoice.c\r
 # End Source File\r
 # Begin Source File\r
 \r
index f5107635cd59c0862cbee9adce1cf033ab232a4c..47d093a51a99861a445dc355a09174afc22e2803 100644 (file)
@@ -7,7 +7,7 @@ PRJDIR          = ../..
 CFLAGS          = $(CFLAGS) -DINDEXLIB -DMLH_MAP -DSDK
 
 OBJECTS       = asdata.obj asexpr.obj aslex.obj aslist.obj asmain.obj \
-                asout.obj assubr.obj z80adr.obj z80ext.obj \
+                asout.obj assubr.obj z80adr.obj z80ext.obj asnoice.obj \
                 z80mch.obj z80pst.obj \
                 ../asxxsrc/strcmpi.obj ../asxxsrc/assym.obj ../asxxsrc/aslex.obj \
                 ../../support/Util/dbuf.obj ../../support/Util/dbuf_string.obj
index 54fc52041eaf8df1d15d1940104d8edca2c7067a..e005ab658f1f5307af986ce49cfe6dd636c344ce 100644 (file)
@@ -12,7 +12,7 @@ UTILSRC = dbuf.c dbuf_string.c
 UTILLIBOBJS = $(UTILSRC:%.c=$(OBJDIR)/%.o)
 
 ASXXLIB = $(srcdir)/../asxxsrc
-ASXXLIBSRC = strcmpi.c assym.c aslex.c
+ASXXLIBSRC = strcmpi.c assym.c aslex.c asnoice.c
 ASXXLIBOBJS = $(ASXXLIBSRC:%.c=$(OBJDIR)/%.o)
 
 SRC = asmain.c assubr.c \
index f960d441db2162483f8648e47a1a24c5a623856e..6c6740e17982dabc1ae2311b438b991b4d478f6c 100644 (file)
@@ -112,6 +112,10 @@ SOURCE=.\asmain.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\asxxsrc\asnoice.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\asout.c\r
 # ADD CPP /D "GAMEBOY"\r
 # End Source File\r
index 23aa96ea85f52de15f42922c1207b4032dc5b93c..6f8f82359bd760c008c91bca4f978e34c1050337 100644 (file)
@@ -108,6 +108,10 @@ SOURCE=.\asmain.c
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\asxxsrc\asnoice.c\r
+# End Source File\r
+# Begin Source File\r
+\r
 SOURCE=.\asout.c\r
 # End Source File\r
 # Begin Source File\r
index 1f7add6bbcf3a36bb271a9596593572c01fc6b6d..505732acb6605e006cfa77a76c6f190da5094ca2 100644 (file)
@@ -73,10 +73,14 @@ int     pass;           /*      assembler pass number
                          */
 int     lflag;          /*      -l, generate listing flag
                          */
+int     cflag;          /*      -c, generate sdcdb debug info
+                         */
 int     gflag;          /*      -g, make undefined symbols global flag
                          */
 int     aflag;          /*      -a, make all symbols global flag
                          */
+int     jflag;          /*      -j, generate debug information flag
+                         */
 int     oflag;          /*      -o, generate relocatable output flag
                          */
 int     sflag;          /*      -s, generate symbol table flag
index b403e7349fab4cfc93481eecc27a1a6b2268ca6f..a5c3d10964d01c297cac7ab4d2a353fcc179b775 100644 (file)
@@ -22,7 +22,7 @@
  * Extensions: P. Felber
  */
 
-#define VERSION "V01.75"
+#define VERSION "V01.75 + SDCC mods"
 
 /*
  * Case Sensitivity Flag
 #define OTHERSYSTEM
 #endif
 
+/*
+ * PATH_MAX
+ */
+#include <limits.h>
+#ifndef PATH_MAX                                /* POSIX, but not required   */
+#if defined(_MSC_VER) || defined(__BORLANDC__)  /* Microsoft C or Borland C*/
+#include <stdlib.h>
+#define PATH_MAX        _MAX_PATH
+#else
+#define PATH_MAX                                /* define a reasonable value */
+#endif
+#endif
+
+#ifdef _WIN32       /* WIN32 native */
+
+#  define NATIVE_WIN32          1
+#  ifdef __MINGW32__  /* GCC MINGW32 depends on configure */
+#    include "../../sdccconf.h"
+#  else
+#    include "../../sdcc_vc.h"
+#    define PATH_MAX  _MAX_PATH
+#  endif
+
+#else               /* Assume Un*x style system */
+#  include "../../sdccconf.h"
+#endif
+
 /*
  * Assembler definitions.
  */
@@ -361,10 +388,14 @@ extern  int     pass;           /*      assembler pass number
                                  */
 extern  int     lflag;          /*      -l, generate listing flag
                                  */
+extern  int     cflag;          /*      -c, generate sdcdb debug information
+                                 */
 extern  int     gflag;          /*      -g, make undefined symbols global flag
                                  */
 extern  int     aflag;          /*      -a, make all symbols global flag
                                  */
+extern  int     jflag;          /*      -j, generate debug information flag
+                                */
 extern  int     oflag;          /*      -o, generate relocatable output flag
                                  */
 extern  int     sflag;          /*      -s, generate symbol table flag
@@ -593,6 +624,10 @@ extern  VOID            out_lw();
 extern  VOID            out_rw();
 extern  VOID            out_tw();
 
+/* asnoice.c */
+extern void DefineNoICE_Line();
+extern void DefineCDB_Line();
+
 
 /* Machine dependent variables */
 
index 9e6c63812e7df5fcee2f56de20235a00c2bacc9c..0629710d26e04e30bbe42e34aa278002133ad5ef 100644 (file)
@@ -11,6 +11,7 @@
 
 /*
  * Extensions: P. Felber
+ * 13-Feb-08 AD -j and -c as in 8051 as
  */
 
 #include <stdio.h>
  *                                      line number
  *              int     lop             current line number on page
  *              int     oflag           -o, generate relocatable output flag
+ *              int     jflag           -j, generate debug info flag
  *              int     page            current page number
  *              int     pflag           enable listing pagination
  *              int     pass            assembler pass number
@@ -196,11 +198,22 @@ main(int argc, char **argv)
                                         ++aflag;
                                         break;
 
+                                case 'c':
+                                case 'C':
+                                    ++cflag;
+                                    break;
+
                                 case 'g':
                                 case 'G':
                                         ++gflag;
                                         break;
 
+                                case 'j':               /* JLH: debug info */
+                                case 'J':
+                                        ++jflag;
+                                        ++oflag;        /* force object */
+                                        break;
+
                                 case 'l':
                                 case 'L':
                                         ++lflag;
@@ -999,6 +1012,17 @@ loop:
          * all the assembler mnemonics.
          */
         default:
+                /* if cdb information then generate the line info */
+                if (cflag && (pass == 1))
+                    DefineCDB_Line();
+
+                /* JLH: if -j, generate a line number symbol */
+                if (jflag && (pass == 1))
+                {
+                   DefineNoICE_Line();
+                }
+
+
                 machine(mp);
         }
         goto loop;
@@ -1160,13 +1184,14 @@ phase(struct area *ap, Addr_T a)
 
 char *usetxt[] = {
 #ifdef SDK
-        "Usage: [-dqxgalopsf] outfile file1 [file2 file3 ...]",
+        "Usage: [-dqxjgalopscf] outfile file1 [file2 file3 ...]",
 #else /* SDK */
-        "Usage: [-dqxgalopsf] file1 [file2 file3 ...]",
+        "Usage: [-dqxjgalopscf] file1 [file2 file3 ...]",
 #endif /* SDK */
         "  d    decimal listing",
         "  q    octal   listing",
         "  x    hex     listing (default)",
+        "  j    add line number and debug information to file", /* JLH */
         "  g    undefined symbols made global",
         "  a    all user symbols made global",
 #ifdef SDK
@@ -1178,6 +1203,7 @@ char *usetxt[] = {
         "  o    create object output file1[REL]",
         "  s    create symbol output file1[SYM]",
 #endif /* SDK */
+        "  c    generate sdcdb debug information",
         "  p    disable listing pagination",
         "  f    flag relocatable references by  `   in listing file",
         " ff    flag relocatable references by mode in listing file",