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 = strrchr( p1, ':' );
40 if (p2 == NULL) p2 = p1-1;
41 strcpy( baseName, p2+1 );
43 /* Name ends at any separator */
44 p2 = strrchr( baseName, FSEPX );
45 if (p2 != NULL) *p2 = 0;
46 /* SD comment this out since not a ANSI Function */
47 /* strupr( baseName ); */
52 /* Define a symbol for current location: FILE.line# */
53 void DefineNoICE_Line()
58 /* symbol is FILE.nnn */
59 sprintf( name, "%s.%u", BaseFileName( cfile ), srcline[ cfile ] );
61 pSym = lookup( name );
62 pSym->s_type = S_USER;
63 pSym->s_area = dot.s_area;
65 pSym->s_flag |= S_GBL;
68 /* Define a symbol for current location: A$FILE$line# */
74 /* symbol is FILE.nnn */
75 sprintf( name, "A$%s$%u", BaseFileName( cfile ), srcline[ cfile ] );
77 pSym = lookup( name );
78 pSym->s_type = S_USER;
79 pSym->s_area = dot.s_area;
81 pSym->s_flag |= S_GBL;
86 /* Define a symbol for current location: FILE.line# */
87 void DefineNoICE_Line()
89 static int prevFile = -1;
90 static struct area *pPrevArea = NULL;
91 static char baseName[ FILSPC ];
96 /* Get outfilename without extension for use as base symbol name */
101 while ((*p1 != 0) && (*p1 != FSEPX))
106 /* SD Commented this out since it is not a
108 /* strupr( baseName ); */
111 if ((cfile != prevFile) || (dot.s_area != pPrevArea))
114 pPrevArea = dot.s_area;
116 /* file or area change: issue FILE command with base @ */
117 fprintf( ofp, ";!FILE %s %s_%s\n", srcfn[ cfile ],
122 fprintf( ofp, ";!LINE %u. 0x%X\n", srcline[ cfile ], laddr );