att.h revision 90075
1179404Sobrien/* Definitions for AT&T assembler syntax for the Intel 80386.
2218822Sdim   Copyright (C) 1988, 1996, 2000 Free Software Foundation, Inc.
3179404Sobrien
4179404SobrienThis file is part of GNU CC.
5179404Sobrien
6179404SobrienGNU CC is free software; you can redistribute it and/or modify
7179404Sobrienit under the terms of the GNU General Public License as published by
8179404Sobrienthe Free Software Foundation; either version 2, or (at your option)
9179404Sobrienany later version.
10179404Sobrien
11179404SobrienGNU CC is distributed in the hope that it will be useful,
12179404Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
13179404SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14179404SobrienGNU General Public License for more details.
15179404Sobrien
16179404SobrienYou should have received a copy of the GNU General Public License
17179404Sobrienalong with GNU CC; see the file COPYING.  If not, write to
18218822Sdimthe Free Software Foundation, 59 Temple Place - Suite 330,
19179404SobrienBoston, MA 02111-1307, USA.  */
20218822Sdim
21179404Sobrien/* Include common aspects of all 386 Unix assemblers.  */
22179404Sobrien#include "i386/unix.h"
23179404Sobrien
24179404Sobrien#define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
25179404Sobrien
26179404Sobrien/* Define the syntax of instructions and addresses.  */
27179404Sobrien
28179404Sobrien/* Prefix for internally generated assembler labels.  */
29179404Sobrien#define LPREFIX ".L"
30179404Sobrien
31/* Assembler pseudos to introduce constants of various size.  */
32
33#define ASM_SHORT "\t.value\t"
34#define ASM_LONG "\t.long\t"
35#define ASM_QUAD "\t.quad\t"  /* Should not be used for 32bit compilation.  */
36
37/* How to output an ASCII string constant.  */
38
39#define ASM_OUTPUT_ASCII(FILE, PTR, SIZE)			\
40do								\
41{ size_t i = 0, limit = (SIZE); 				\
42  while (i < limit)						\
43    { if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n");	\
44		       fputs ("\t.byte\t", (FILE)); }		\
45      else fprintf ((FILE), ",");				\
46	fprintf ((FILE), "0x%x", ((PTR)[i++] & 0377)) ;}	\
47      fprintf ((FILE), "\n");					\
48} while (0)
49
50/* Output at beginning of assembler file.  */
51/* The .file command should always begin the output.  */
52#undef ASM_FILE_START
53#define ASM_FILE_START(FILE)						\
54  do {									\
55	output_file_directive (FILE, main_input_filename);		\
56	if (ix86_asm_dialect == ASM_INTEL)				\
57	  fputs ("\t.intel_syntax\n", FILE);				\
58  } while (0)
59
60/* Do use .optim by default on this machine.  */
61#undef ASM_FILE_START_1
62#define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n")
63
64/* This is how to output an assembler line
65   that says to advance the location counter
66   to a multiple of 2**LOG bytes.  */
67
68#define ASM_OUTPUT_ALIGN(FILE,LOG)	\
69    if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
70
71/* This is how to output an assembler line
72   that says to advance the location counter by SIZE bytes.  */
73
74#define ASM_OUTPUT_SKIP(FILE,SIZE)  \
75  fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
76
77/* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s.  */
78
79#define ASM_NO_SKIP_IN_TEXT 1
80
81/* Define the syntax of labels and symbol definitions/declarations.  */
82
83/* The prefix to add for compiler private assembler symbols.  */
84#undef LOCAL_LABEL_PREFIX
85#define LOCAL_LABEL_PREFIX "."
86
87/* This is how to store into the string BUF
88   the symbol_ref name of an internal numbered label where
89   PREFIX is the class of label and NUM is the number within the class.
90   This is suitable for output with `assemble_name'.  */
91
92#undef ASM_GENERATE_INTERNAL_LABEL
93#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER)	\
94  sprintf ((BUF), "%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUMBER))
95
96/* This is how to output an internal numbered label where
97   PREFIX is the class of label and NUM is the number within the class.  */
98
99#undef ASM_OUTPUT_INTERNAL_LABEL
100#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)	\
101  fprintf (FILE, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
102
103/* The prefix to add to user-visible assembler symbols.  */
104
105#undef USER_LABEL_PREFIX
106#define USER_LABEL_PREFIX ""
107