bsd.h revision 90075
118334Speter/* Definitions for BSD assembler syntax for Intel 386 218334Speter (actually AT&T syntax for insns and operands, 318334Speter adapted to BSD conventions for symbol names and debugging.) 490075Sobrien Copyright (C) 1988, 1996, 2000 Free Software Foundation, Inc. 518334Speter 618334SpeterThis file is part of GNU CC. 718334Speter 818334SpeterGNU CC is free software; you can redistribute it and/or modify 918334Speterit under the terms of the GNU General Public License as published by 1018334Speterthe Free Software Foundation; either version 2, or (at your option) 1118334Speterany later version. 1218334Speter 1318334SpeterGNU CC is distributed in the hope that it will be useful, 1418334Speterbut WITHOUT ANY WARRANTY; without even the implied warranty of 1518334SpeterMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1618334SpeterGNU General Public License for more details. 1718334Speter 1818334SpeterYou should have received a copy of the GNU General Public License 1918334Speteralong with GNU CC; see the file COPYING. If not, write to 2018334Speterthe Free Software Foundation, 59 Temple Place - Suite 330, 2118334SpeterBoston, MA 02111-1307, USA. */ 2218334Speter 2318334Speter/* Include common aspects of all 386 Unix assemblers. */ 2418334Speter#include "i386/unix.h" 2518334Speter 2618334Speter/* Use the Sequent Symmetry assembler syntax. */ 2718334Speter 2818334Speter#define TARGET_VERSION fprintf (stderr, " (80386, BSD syntax)"); 2918334Speter 3018334Speter/* Define the syntax of pseudo-ops, labels and comments. */ 3118334Speter 3218334Speter/* Prefix for internally generated assembler labels. If we aren't using 3318334Speter underscores, we are using prefix `.'s to identify labels that should 3418334Speter be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ 3518334Speter#ifdef NO_UNDERSCORES 3618334Speter#define LPREFIX ".L" 3718334Speter#else 3818334Speter#define LPREFIX "L" 3918334Speter#endif /* not NO_UNDERSCORES */ 4018334Speter 4118334Speter/* Assembler pseudos to introduce constants of various size. */ 4218334Speter 4390075Sobrien#define ASM_SHORT "\t.word\t" 4490075Sobrien#define ASM_LONG "\t.long\t" 4590075Sobrien#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */ 4618334Speter 4718334Speter/* Output at beginning of assembler file. 4818334Speter ??? I am skeptical of this -- RMS. */ 4918334Speter 5018334Speter#define ASM_FILE_START(FILE) \ 5152284Sobrien do { output_file_directive (FILE, main_input_filename); \ 5218334Speter } while (0) 5318334Speter 5418334Speter/* This was suggested, but it shouldn't be right for DBX output. -- RMS 5518334Speter #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */ 5618334Speter 5718334Speter 5818334Speter/* Define the syntax of labels and symbol definitions/declarations. */ 5918334Speter 6018334Speter/* This is how to output an assembler line 6118334Speter that says to advance the location counter by SIZE bytes. */ 6218334Speter 6318334Speter#define ASM_OUTPUT_SKIP(FILE,SIZE) \ 6418334Speter fprintf (FILE, "\t.space %u\n", (SIZE)) 6518334Speter 6618334Speter/* Define the syntax of labels and symbol definitions/declarations. */ 6718334Speter 6818334Speter/* This says how to output an assembler line 6918334Speter to define a global common symbol. */ 7018334Speter 7118334Speter#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ 7218334Speter( fputs (".comm ", (FILE)), \ 7318334Speter assemble_name ((FILE), (NAME)), \ 7418334Speter fprintf ((FILE), ",%u\n", (ROUNDED))) 7518334Speter 7618334Speter/* This says how to output an assembler line 7718334Speter to define a local common symbol. */ 7818334Speter 7918334Speter#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ 8018334Speter( fputs (".lcomm ", (FILE)), \ 8118334Speter assemble_name ((FILE), (NAME)), \ 8218334Speter fprintf ((FILE), ",%u\n", (ROUNDED))) 8318334Speter 8418334Speter/* This is how to output an assembler line 8518334Speter that says to advance the location counter 8618334Speter to a multiple of 2**LOG bytes. */ 8718334Speter 8818334Speter#define ASM_OUTPUT_ALIGN(FILE,LOG) \ 8918334Speter if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", (LOG)) 9018334Speter 9118334Speter/* This is how to store into the string BUF 9218334Speter the symbol_ref name of an internal numbered label where 9318334Speter PREFIX is the class of label and NUM is the number within the class. 9418334Speter This is suitable for output with `assemble_name'. */ 9518334Speter 9618334Speter#ifdef NO_UNDERSCORES 9718334Speter#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 9890075Sobrien sprintf ((BUF), "*.%s%ld", (PREFIX), (long)(NUMBER)) 9918334Speter#else 10018334Speter#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ 10190075Sobrien sprintf ((BUF), "*%s%ld", (PREFIX), (long)(NUMBER)) 10218334Speter#endif 10318334Speter 10418334Speter/* This is how to output an internal numbered label where 10518334Speter PREFIX is the class of label and NUM is the number within the class. */ 10618334Speter 10718334Speter#ifdef NO_UNDERSCORES 10818334Speter#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 10918334Speter fprintf (FILE, ".%s%d:\n", PREFIX, NUM) 11018334Speter#else 11118334Speter#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ 11218334Speter fprintf (FILE, "%s%d:\n", PREFIX, NUM) 11318334Speter#endif 11418334Speter 11590075Sobrien/* The prefix to add to user-visible assembler symbols. */ 11618334Speter 11718334Speter#ifdef NO_UNDERSCORES 11850397Sobrien#define USER_LABEL_PREFIX "" 11918334Speter#else 12050397Sobrien#define USER_LABEL_PREFIX "_" 12118334Speter#endif /* not NO_UNDERSCORES */ 12218334Speter 12318334Speter/* Sequent has some changes in the format of DBX symbols. */ 12418334Speter#define DBX_NO_XREFS 1 12518334Speter 12618334Speter/* Don't split DBX symbols into continuations. */ 12718334Speter#define DBX_CONTIN_LENGTH 0 128