att.h revision 18334
1/* Definitions for AT&T assembler syntax for the Intel 80386.
2   Copyright (C) 1988 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING.  If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA.  */
20
21/* Include common aspects of all 386 Unix assemblers.  */
22#include "i386/unix.h"
23
24#define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
25
26/* Define the syntax of instructions and addresses.  */
27
28/* Prefix for internally generated assembler labels.  */
29#define LPREFIX ".L"
30
31/* Assembler pseudos to introduce constants of various size.  */
32
33/* #define ASM_BYTE_OP "\t.byte"  Now in svr3.h or svr4.h.  */
34#define ASM_SHORT "\t.value"
35#define ASM_LONG "\t.long"
36#define ASM_DOUBLE "\t.double"
37
38/* How to output an ASCII string constant.  */
39
40#define ASM_OUTPUT_ASCII(FILE, p, size) \
41do								\
42{ int i = 0; 							\
43  while (i < (size))						\
44    { if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n");	\
45		       fprintf ((FILE), "%s ", ASM_BYTE_OP); }	\
46      else fprintf ((FILE), ",");				\
47	fprintf ((FILE), "0x%x", ((p)[i++] & 0377)) ;}		\
48      fprintf ((FILE), "\n");					\
49} while (0)
50
51/* Do use .optim by default on this machine.  */
52#undef ASM_FILE_START_1
53#define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n")
54
55/* This is how to output an assembler line
56   that says to advance the location counter
57   to a multiple of 2**LOG bytes.  */
58
59#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
60    if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
61
62/* This is how to output an assembler line
63   that says to advance the location counter by SIZE bytes.  */
64
65#define ASM_OUTPUT_SKIP(FILE,SIZE)  \
66  fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
67
68/* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s.  */
69
70#define ASM_NO_SKIP_IN_TEXT 1
71
72#undef BSS_SECTION_FUNCTION  /* Override the definition from svr3.h.  */
73#define BSS_SECTION_FUNCTION \
74void								\
75bss_section ()							\
76{								\
77  if (in_section != in_bss)					\
78    {								\
79      fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP);	\
80      in_section = in_bss;					\
81    }								\
82}
83
84/* Define the syntax of labels and symbol definitions/declarations.  */
85
86/* This is how to store into the string BUF
87   the symbol_ref name of an internal numbered label where
88   PREFIX is the class of label and NUM is the number within the class.
89   This is suitable for output with `assemble_name'.  */
90
91#undef ASM_GENERATE_INTERNAL_LABEL
92#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER)	\
93  sprintf ((BUF), ".%s%d", (PREFIX), (NUMBER))
94
95/* This is how to output an internal numbered label where
96   PREFIX is the class of label and NUM is the number within the class.  */
97
98#undef ASM_OUTPUT_INTERNAL_LABEL
99#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
100  fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
101
102/* This is how to output a reference to a user-level label named NAME.  */
103
104#undef ASM_OUTPUT_LABELREF
105#define ASM_OUTPUT_LABELREF(FILE,NAME)	\
106  fprintf (FILE, "%s", NAME)
107