1 /* Definitions for BSD assembler syntax for Intel 386
2 (actually AT&T syntax for insns and operands,
3 adapted to BSD conventions for symbol names and debugging.)
4 Copyright (C) 1988 Free Software Foundation, Inc.
6 This file is part of GNU CC.
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING. If not, write to
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 /* Include common aspects of all 386 Unix assemblers. */
23 #include "i386/unix.h"
25 /* Use the Sequent Symmetry assembler syntax. */
27 #define TARGET_VERSION fprintf (stderr, " (80386, BSD syntax)");
29 /* Define the syntax of pseudo-ops, labels and comments. */
31 /* Prefix for internally generated assembler labels. If we aren't using
32 underscores, we are using prefix `.'s to identify labels that should
33 be ignored, as in `i386/gas.h' --karl@cs.umb.edu */
38 #endif /* not NO_UNDERSCORES */
40 /* Assembler pseudos to introduce constants of various size. */
42 #define ASM_BYTE_OP "\t.byte"
43 #define ASM_SHORT "\t.word"
44 #define ASM_LONG "\t.long"
45 #define ASM_DOUBLE "\t.double"
47 /* Output at beginning of assembler file.
48 ??? I am skeptical of this -- RMS. */
50 #define ASM_FILE_START(FILE) \
51 fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
53 /* This was suggested, but it shouldn't be right for DBX output. -- RMS
54 #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */
57 /* Define the syntax of labels and symbol definitions/declarations. */
59 /* This is how to output an assembler line
60 that says to advance the location counter by SIZE bytes. */
62 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
63 fprintf (FILE, "\t.space %u\n", (SIZE))
65 /* Define the syntax of labels and symbol definitions/declarations. */
67 /* This says how to output an assembler line
68 to define a global common symbol. */
70 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
71 ( fputs (".comm ", (FILE)), \
72 assemble_name ((FILE), (NAME)), \
73 fprintf ((FILE), ",%u\n", (ROUNDED)))
75 /* This says how to output an assembler line
76 to define a local common symbol. */
78 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
79 ( fputs (".lcomm ", (FILE)), \
80 assemble_name ((FILE), (NAME)), \
81 fprintf ((FILE), ",%u\n", (ROUNDED)))
83 /* This is how to output an assembler line
84 that says to advance the location counter
85 to a multiple of 2**LOG bytes. */
87 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
88 if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", (LOG))
90 /* This is how to store into the string BUF
91 the symbol_ref name of an internal numbered label where
92 PREFIX is the class of label and NUM is the number within the class.
93 This is suitable for output with `assemble_name'. */
96 #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
97 sprintf ((BUF), "*.%s%d", (PREFIX), (NUMBER))
99 #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
100 sprintf ((BUF), "*%s%d", (PREFIX), (NUMBER))
103 /* This is how to output an internal numbered label where
104 PREFIX is the class of label and NUM is the number within the class. */
106 #ifdef NO_UNDERSCORES
107 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
108 fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
110 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
111 fprintf (FILE, "%s%d:\n", PREFIX, NUM)
114 /* This is how to output a reference to a user-level label named NAME. */
116 #ifdef NO_UNDERSCORES
117 #define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
119 #define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "_%s", NAME)
120 #endif /* not NO_UNDERSCORES */
122 /* Sequent has some changes in the format of DBX symbols. */
123 #define DBX_NO_XREFS 1
125 /* Don't split DBX symbols into continuations. */
126 #define DBX_CONTIN_LENGTH 0
128 /* This is how to output an assembler line defining a `double' constant. */
130 #undef ASM_OUTPUT_DOUBLE
131 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
132 fprintf (FILE, "\t.double 0d%.20e\n", (VALUE))