att.h revision 117395
1136849Sscottl/* Definitions for AT&T assembler syntax for the Intel 80386. 2149871Sscottl Copyright (C) 1988, 1996, 2000, 2001, 2002 3136849Sscottl Free Software Foundation, Inc. 4136849Sscottl 5136849SscottlThis file is part of GNU CC. 6136849Sscottl 7136849SscottlGNU CC is free software; you can redistribute it and/or modify 8136849Sscottlit under the terms of the GNU General Public License as published by 9136849Sscottlthe Free Software Foundation; either version 2, or (at your option) 10136849Sscottlany later version. 11136849Sscottl 12136849SscottlGNU CC is distributed in the hope that it will be useful, 13136849Sscottlbut WITHOUT ANY WARRANTY; without even the implied warranty of 14136849SscottlMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15136849SscottlGNU General Public License for more details. 16136849Sscottl 17136849SscottlYou should have received a copy of the GNU General Public License 18136849Sscottlalong with GNU CC; see the file COPYING. If not, write to 19136849Sscottlthe Free Software Foundation, 59 Temple Place - Suite 330, 20136849SscottlBoston, MA 02111-1307, USA. */ 21136849Sscottl 22136849Sscottl 23136849Sscottl/* Define the syntax of instructions and addresses. */ 24136849Sscottl 25142988Sscottl/* Prefix for internally generated assembler labels. */ 26142988Sscottl#define LPREFIX ".L" 27136849Sscottl 28136849Sscottl/* Assembler pseudos to introduce constants of various size. */ 29136849Sscottl 30136849Sscottl#define ASM_SHORT "\t.value\t" 31136849Sscottl#define ASM_LONG "\t.long\t" 32136849Sscottl#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */ 33136849Sscottl 34136849Sscottl/* How to output an ASCII string constant. */ 35136849Sscottl 36136849Sscottl#define ASM_OUTPUT_ASCII(FILE, PTR, SIZE) \ 37136849Sscottldo \ 38136849Sscottl{ size_t i = 0, limit = (SIZE); \ 39136849Sscottl while (i < limit) \ 40136849Sscottl { if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n"); \ 41136849Sscottl fputs ("\t.byte\t", (FILE)); } \ 42136849Sscottl else fprintf ((FILE), ","); \ 43136849Sscottl fprintf ((FILE), "0x%x", ((PTR)[i++] & 0377)) ;} \ 44136849Sscottl fprintf ((FILE), "\n"); \ 45136849Sscottl} while (0) 46136849Sscottl 47136849Sscottl/* Output at beginning of assembler file. */ 48136849Sscottl/* The .file command should always begin the output. */ 49136849Sscottl#undef ASM_FILE_START 50136849Sscottl#define ASM_FILE_START(FILE) \ 51136849Sscottl do { \ 52136849Sscottl output_file_directive (FILE, main_input_filename); \ 53136849Sscottl if (ix86_asm_dialect == ASM_INTEL) \ 54136849Sscottl fputs ("\t.intel_syntax\n", FILE); \ 55136849Sscottl } while (0) 56136849Sscottl 57136849Sscottl/* Do use .optim by default on this machine. */ 58136849Sscottl#undef ASM_FILE_START_1 59136849Sscottl#define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n") 60136849Sscottl 61136849Sscottl/* This is how to output an assembler line 62136849Sscottl that says to advance the location counter 63136849Sscottl to a multiple of 2**LOG bytes. */ 64190809Sdelphij 65190809Sdelphij#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 66136849Sscottl if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) 67190809Sdelphij 68136849Sscottl/* This is how to output an assembler line 69136849Sscottl that says to advance the location counter by SIZE bytes. */ 70136849Sscottl 71136849Sscottl#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 72136849Sscottl fprintf ((FILE), "\t.set .,.+%u\n", (SIZE)) 73136849Sscottl 74136849Sscottl/* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s. */ 75136849Sscottl 76136849Sscottl#define ASM_NO_SKIP_IN_TEXT 1 77136849Sscottl 78136849Sscottl/* Define the syntax of labels and symbol definitions/declarations. */ 79136849Sscottl 80136849Sscottl/* The prefix to add for compiler private assembler symbols. */ 81136849Sscottl#undef LOCAL_LABEL_PREFIX 82136849Sscottl#define LOCAL_LABEL_PREFIX "." 83136849Sscottl 84136849Sscottl/* This is how to store into the string BUF 85136849Sscottl the symbol_ref name of an internal numbered label where 86136849Sscottl PREFIX is the class of label and NUM is the number within the class. 87136849Sscottl This is suitable for output with `assemble_name'. */ 88136849Sscottl 89136849Sscottl#undef ASM_GENERATE_INTERNAL_LABEL 90136849Sscottl#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 91136849Sscottl sprintf ((BUF), "%s%s%ld", LOCAL_LABEL_PREFIX, (PREFIX), (long)(NUMBER)) 92136849Sscottl 93136849Sscottl/* This is how to output an internal numbered label where 94136849Sscottl PREFIX is the class of label and NUM is the number within the class. */ 95136849Sscottl 96136849Sscottl#undef ASM_OUTPUT_INTERNAL_LABEL 97136849Sscottl#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 98136849Sscottl fprintf (FILE, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM) 99136849Sscottl 100136849Sscottl/* The prefix to add to user-visible assembler symbols. */ 101136849Sscottl 102136849Sscottl#undef USER_LABEL_PREFIX 103136849Sscottl#define USER_LABEL_PREFIX "" 104136849Sscottl