bsd.h revision 50397
1197679Sdes/* Definitions for BSD assembler syntax for Intel 386 257429Smarkm (actually AT&T syntax for insns and operands, 357429Smarkm adapted to BSD conventions for symbol names and debugging.) 457429Smarkm Copyright (C) 1988, 1996 Free Software Foundation, Inc. 557429Smarkm 657429SmarkmThis file is part of GNU CC. 757429Smarkm 860573SkrisGNU CC is free software; you can redistribute it and/or modify 965668Skrisit under the terms of the GNU General Public License as published by 1065668Skristhe Free Software Foundation; either version 2, or (at your option) 1165668Skrisany later version. 1265668Skris 1365668SkrisGNU CC is distributed in the hope that it will be useful, 1465668Skrisbut WITHOUT ANY WARRANTY; without even the implied warranty of 1565668SkrisMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1660573SkrisGNU General Public License for more details. 1792555Sdes 1860573SkrisYou should have received a copy of the GNU General Public License 1965668Skrisalong with GNU CC; see the file COPYING. If not, write to 2065668Skristhe Free Software Foundation, 59 Temple Place - Suite 330, 2165668SkrisBoston, MA 02111-1307, USA. */ 2265668Skris 2365668Skris/* Include common aspects of all 386 Unix assemblers. */ 2465668Skris#include "i386/unix.h" 2565668Skris 2665668Skris/* Use the Sequent Symmetry assembler syntax. */ 2765668Skris 2865668Skris#define TARGET_VERSION fprintf (stderr, " (80386, BSD syntax)"); 2965668Skris 3065668Skris/* Define the syntax of pseudo-ops, labels and comments. */ 3165668Skris 3265668Skris/* Prefix for internally generated assembler labels. If we aren't using 3365668Skris underscores, we are using prefix `.'s to identify labels that should 3465668Skris be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ 3565668Skris#ifdef NO_UNDERSCORES 3665668Skris#define LPREFIX ".L" 3765668Skris#else 3857429Smarkm#define LPREFIX "L" 3957429Smarkm#endif /* not NO_UNDERSCORES */ 4057429Smarkm 41162852Sdes/* Assembler pseudos to introduce constants of various size. */ 42162852Sdes 43124208Sdes#define ASM_BYTE_OP "\t.byte" 44162852Sdes#define ASM_SHORT "\t.word" 45162852Sdes#define ASM_LONG "\t.long" 46162852Sdes#define ASM_DOUBLE "\t.double" 47162852Sdes 48162852Sdes/* Output at beginning of assembler file. 49124208Sdes ??? I am skeptical of this -- RMS. */ 50162852Sdes 51162852Sdes#define ASM_FILE_START(FILE) \ 52162852Sdes do { fprintf (FILE, "\t.file\t"); \ 53162852Sdes output_quoted_string (FILE, dump_base_name); \ 54162852Sdes fprintf (FILE, "\n"); \ 55162852Sdes } while (0) 56162852Sdes 57162852Sdes/* This was suggested, but it shouldn't be right for DBX output. -- RMS 58162852Sdes #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */ 59162852Sdes 60162852Sdes 61162852Sdes/* Define the syntax of labels and symbol definitions/declarations. */ 6257429Smarkm 6357429Smarkm/* This is how to output an assembler line 6457429Smarkm that says to advance the location counter by SIZE bytes. */ 6557429Smarkm 6657429Smarkm#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 6757429Smarkm fprintf (FILE, "\t.space %u\n", (SIZE)) 6860573Skris 6960573Skris/* Define the syntax of labels and symbol definitions/declarations. */ 7076259Sgreen 7160573Skris/* This says how to output an assembler line 7269587Sgreen to define a global common symbol. */ 73162852Sdes 7460573Skris#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ 7576259Sgreen( fputs (".comm ", (FILE)), \ 7676259Sgreen assemble_name ((FILE), (NAME)), \ 7776259Sgreen fprintf ((FILE), ",%u\n", (ROUNDED))) 7892555Sdes 7998675Sdes/* This says how to output an assembler line 80197679Sdes to define a local common symbol. */ 8160573Skris 8260573Skris#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ 8360573Skris( fputs (".lcomm ", (FILE)), \ 8460573Skris assemble_name ((FILE), (NAME)), \ 8560573Skris fprintf ((FILE), ",%u\n", (ROUNDED))) 8660573Skris 8760573Skris/* This is how to output an assembler line 88192595Sdes that says to advance the location counter 89192595Sdes to a multiple of 2**LOG bytes. */ 90197679Sdes 91197679Sdes#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 92197679Sdes if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", (LOG)) 93197679Sdes 94197679Sdes/* This is how to store into the string BUF 95197679Sdes the symbol_ref name of an internal numbered label where 9657429Smarkm PREFIX is the class of label and NUM is the number within the class. 97197679Sdes This is suitable for output with `assemble_name'. */ 98197679Sdes 99197679Sdes#ifdef NO_UNDERSCORES 100197679Sdes#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 101197679Sdes sprintf ((BUF), "*.%s%d", (PREFIX), (NUMBER)) 10257429Smarkm#else 103197679Sdes#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 104197679Sdes sprintf ((BUF), "*%s%d", (PREFIX), (NUMBER)) 105197679Sdes#endif 106197679Sdes 107197679Sdes/* This is how to output an internal numbered label where 108197679Sdes PREFIX is the class of label and NUM is the number within the class. */ 109197679Sdes 110197679Sdes#ifdef NO_UNDERSCORES 111197679Sdes#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 11257429Smarkm fprintf (FILE, ".%s%d:\n", PREFIX, NUM) 113197679Sdes#else 114197679Sdes#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 11557429Smarkm fprintf (FILE, "%s%d:\n", PREFIX, NUM) 116197679Sdes#endif 117197679Sdes 11857429Smarkm/* The prefix to add to user-visible assembler symbols. */ 119197679Sdes 120197679Sdes#ifdef NO_UNDERSCORES 12157429Smarkm#define USER_LABEL_PREFIX "" 122197679Sdes#else 123197679Sdes#define USER_LABEL_PREFIX "_" 12457429Smarkm#endif /* not NO_UNDERSCORES */ 125197679Sdes 126197679Sdes/* Sequent has some changes in the format of DBX symbols. */ 12757429Smarkm#define DBX_NO_XREFS 1 128197679Sdes 129197679Sdes/* Don't split DBX symbols into continuations. */ 13057429Smarkm#define DBX_CONTIN_LENGTH 0 131197679Sdes