* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[official-gcc.git] / gcc / config / i386 / att.h
blobdf47f891cfd7c88a7ad78938d711dc30e9ad0e20
1 /* Definitions for AT&T assembler syntax for the Intel 80386.
2 Copyright (C) 1988, 1996, 2000 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Include common aspects of all 386 Unix assemblers. */
22 #include "i386/unix.h"
24 #define TARGET_VERSION fprintf (stderr, " (80386, ATT syntax)");
26 /* Define the syntax of instructions and addresses. */
28 /* Prefix for internally generated assembler labels. */
29 #define LPREFIX ".L"
31 /* Assembler pseudos to introduce constants of various size. */
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. */
37 /* How to output an ASCII string constant. */
39 #define ASM_OUTPUT_ASCII(FILE, PTR, SIZE) \
40 do \
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)
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 (target_flags & MASK_INTEL_SYNTAX) \
57 fputs ("\t.intel_syntax\n", FILE); \
58 } while (0)
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")
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. */
68 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
69 if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
71 /* This is how to output an assembler line
72 that says to advance the location counter by SIZE bytes. */
74 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
75 fprintf ((FILE), "\t.set .,.+%u\n", (SIZE))
77 /* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s. */
79 #define ASM_NO_SKIP_IN_TEXT 1
81 /* Define the syntax of labels and symbol definitions/declarations. */
83 /* The prefix to add for compiler private assembler symbols. */
84 #undef LOCAL_LABEL_PREFIX
85 #define LOCAL_LABEL_PREFIX "."
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'. */
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))
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. */
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)
103 /* The prefix to add to user-visible assembler symbols. */
105 #undef USER_LABEL_PREFIX
106 #define USER_LABEL_PREFIX ""