4 * Extensions to CUG 292 assembler ASxxxx to produce NoICE debug files
6 * 3-Nov-1997 by John Hartman
12 //#if !defined(_MSC_VER)
17 /* Return basic file name without path or extension */
18 static char* BaseFileName( int fileNumber );
20 char* BaseFileName( int fileNumber )
22 static int prevFile = -1;
23 static char baseName[ FILSPC ];
27 if (fileNumber != prevFile)
29 prevFile = fileNumber;
33 /* issue a FILE command with full path and extension */
34 fprintf( ofp, ";!FILE %s\n", p1 );
36 /* Name starts after any colon or backslash (DOS) */
37 p2 = strrchr( p1, '\\' );
38 if (p2 == NULL) p2 = strrchr( p1, ':' );
39 if (p2 == NULL) p2 = p1-1;
40 strcpy( baseName, p2+1 );
42 /* Name ends at any separator */
43 p2 = strrchr( baseName, FSEPX );
44 if (p2 != NULL) *p2 = 0;
45 /* SD comment this out since not a ANSI Function */
46 /* strupr( baseName ); */
51 /* Define a symbol for current location: FILE.line# */
52 void DefineNoICE_Line()
57 /* symbol is FILE.nnn */
58 sprintf( name, "%s.%u", BaseFileName( cfile ), srcline[ cfile ] );
60 pSym = lookup( name );
61 pSym->s_type = S_USER;
62 pSym->s_area = dot.s_area;
64 pSym->s_flag |= S_GBL;
67 /* Define a symbol for current location: A$FILE$line# */
73 /* symbol is FILE.nnn */
74 sprintf( name, "A$%s$%u", BaseFileName( cfile ), srcline[ cfile ] );
76 pSym = lookup( name );
77 pSym->s_type = S_USER;
78 pSym->s_area = dot.s_area;
80 pSym->s_flag |= S_GBL;
85 /* Define a symbol for current location: FILE.line# */
86 void DefineNoICE_Line()
88 static int prevFile = -1;
89 static struct area *pPrevArea = NULL;
90 static char baseName[ FILSPC ];
95 /* Get outfilename without extension for use as base symbol name */
100 while ((*p1 != 0) && (*p1 != FSEPX))
105 /* SD Commented this out since it is not a
107 /* strupr( baseName ); */
110 if ((cfile != prevFile) || (dot.s_area != pPrevArea))
113 pPrevArea = dot.s_area;
115 /* file or area change: issue FILE command with base @ */
116 fprintf( ofp, ";!FILE %s %s_%s\n", srcfn[ cfile ],
121 fprintf( ofp, ";!LINE %u. 0x%X\n", srcline[ cfile ], laddr );