unsigned char LocalsAreStatic = 0; /* Make local variables static */
unsigned char SignedChars = 0; /* Make characters signed by default */
unsigned char Verbose = 0; /* Verbose flag */
-unsigned char IncSource = 0; /* Include source as comments */
+unsigned char AddSource = 0; /* Add source lines as comments */
unsigned char DebugInfo = 0; /* Add debug info to the obj */
unsigned char Debug = 0; /* Debug mode */
-
+
extern unsigned char LocalsAreStatic; /* Make local variables static */
extern unsigned char SignedChars; /* Make characters signed by default */
extern unsigned char Verbose; /* Verbose flag */
-extern unsigned char IncSource; /* Include source as comments */
+extern unsigned char AddSource; /* Add source lines as comments */
extern unsigned char DebugInfo; /* Add debug info to the obj */
extern unsigned char Debug; /* Debug mode */
/* Output the source line in the generated assembler file
* if requested.
*/
- if (IncSource && line[Start] != '\0') {
+ if (AddSource && line[Start] != '\0') {
AddCodeLine ("; %s", line+Start);
}
+static void OptAddSource (const char* Opt, const char* Arg)
+/* Add source lines as comments in generated assembler file */
+{
+ AddSource = 1;
+}
+
+
+
static void OptAnsi (const char* Opt, const char* Arg)
/* Compile in strict ANSI mode */
{
{
/* Program long options */
static const LongOpt OptTab[] = {
+ { "--add-source", 0, OptAddSource },
{ "--ansi", 0, OptAnsi },
{ "--cpu", 1, OptCPU },
{ "--debug-info", 0, OptDebugInfo },
LongOption (&I, OptTab, sizeof(OptTab)/sizeof(OptTab[0]));
break;
- case 'd': /* debug mode */
+ case 'd': /* debug mode */
Debug = 1;
break;
while (*P) {
switch (*P++) {
case 'l':
- LocalsAreStatic = 1;
- break;
+ LocalsAreStatic = 1;
+ break;
}
}
break;
DefineSym (GetArg (&I, 2));
break;
- case 'I':
+ case 'I':
OptIncludeDir (Arg, GetArg (&I, 2));
break;
break;
case 'T':
- IncSource = 1;
- break;
+ OptAddSource (Arg, 0);
+ break;
- case 'V':
- OptVersion (Arg, 0);
- break;
+ case 'V':
+ OptVersion (Arg, 0);
+ break;
- case 'W':
- NoWarn = 1;
- break;
+ case 'W':
+ NoWarn = 1;
+ break;
- default:
+ default:
UnknownOption (Arg);
- break;
- }
- } else {
- if (fin) {
- fprintf (stderr, "additional file specs ignored\n");
- } else {
- fin = xstrdup (Arg);
+ break;
+ }
+ } else {
+ if (fin) {
+ fprintf (stderr, "additional file specs ignored\n");
+ } else {
+ fin = xstrdup (Arg);
inp = fopen (fin, "r");
if (inp == 0) {
Fatal (FAT_CANNOT_OPEN_INPUT, strerror (errno));