/* gasp.c - Gnu assembler preprocessor main program.
- Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1994, 95, 96, 1997 Free Software Foundation, Inc.
Written by Steve and Judy Chamberlain of Cygnus Support,
sac@cygnus.com
char *program_version = "1.2";
+/* This is normally declared in as.h, but we don't include that. We
+ need the function because other files linked with gasp.c might call
+ it. */
+extern void as_abort PARAMS ((const char *, int, const char *));
+
#define MAX_INCLUDES 30 /* Maximum include depth */
#define MAX_REASONABLE 1000 /* Maximum number of expansions */
if (ptr->value.s.len)
{
if (!again)
- ERROR ((stderr, "redefintion not allowed"));
+ ERROR ((stderr, "redefinition not allowed\n"));
}
ptr->type = hash_string;
{
l = grab_label (&line, &label_in);
sb_reset (&label);
- if (label_in.len)
- {
- /* Munge any label */
-
-
- process_assigns (0, &label_in, &label);
- }
if (line.ptr[l] == ':')
l++;
while (ISWHITE (line.ptr[l]) && l < line.len)
l++;
+ if (label_in.len)
+ {
+ int do_assigns;
+
+ /* Munge the label, unless this is EQU or ASSIGN. */
+ do_assigns = 1;
+ if (l < line.len
+ && (line.ptr[l] == '.' || alternate || mri))
+ {
+ int lx = l;
+
+ if (line.ptr[lx] == '.')
+ ++lx;
+ if (lx + 3 <= line.len
+ && strncasecmp ("EQU", line.ptr + lx, 3) == 0
+ && (lx + 3 == line.len
+ || ! ISFIRSTCHAR (line.ptr[lx + 3])))
+ do_assigns = 0;
+ else if (lx + 6 <= line.len
+ && strncasecmp ("ASSIGN", line.ptr + lx, 6) == 0
+ && (lx + 6 == line.len
+ || ! ISFIRSTCHAR (line.ptr[lx + 6])))
+ do_assigns = 0;
+ }
+
+ if (do_assigns)
+ process_assigns (0, &label_in, &label);
+ else
+ sb_add_sb (&label, &label_in);
+ }
+
if (l < line.len)
{
if (process_pseudo_op (l, &line, &acc))
const char *err;
int line = linecount ();
- err = define_macro (idx, in, &label, get_line);
+ err = define_macro (idx, in, &label, get_line, (const char **) NULL);
if (err != NULL)
ERROR ((stderr, "macro at line %d: %s\n", line - 1, err));
}
do_sdata (idx, line, 'z');
return 1;
case K_ASSIGN:
- do_assign (1, 0, line);
+ do_assign (0, 0, line);
return 1;
case K_AIF:
do_aif (idx, line);
do_aendr ();
return 1;
case K_EQU:
- do_assign (0, idx, line);
+ do_assign (1, idx, line);
return 1;
case K_ALIGN:
do_align (idx, line);
[-Dname=value] create preprocessor variable called name, with value\n\
[-Ipath] add to include path list\n\
[in-file]\n");
+ if (status == 0)
+ printf ("\nReport bugs to bug-gnu-utils@prep.ai.mit.edu\n");
exit (status);
}
show_help ();
/*NOTREACHED*/
case 'v':
- printf ("GNU %s version %s\n", program_name, program_version);
+ /* This output is intended to follow the GNU standards document. */
+ printf ("GNU assembler pre-processor %s\n", program_version);
+ printf ("Copyright 1996 Free Software Foundation, Inc.\n");
+ printf ("\
+This program is free software; you may redistribute it under the terms of\n\
+the GNU General Public License. This program has absolutely no warranty.\n");
exit (0);
/*NOTREACHED*/
case 0: