unix.h revision 18334
150476Speter/* Definitions for Unix assembler syntax for the Intel 80386.
231027Sache   Copyright (C) 1988, 1994 Free Software Foundation, Inc.
331027Sache
431027SacheThis file is part of GNU CC.
531027Sache
631027SacheGNU CC is free software; you can redistribute it and/or modify
731027Sacheit under the terms of the GNU General Public License as published by
8134336Stjrthe Free Software Foundation; either version 2, or (at your option)
9134336Stjrany later version.
10134336Stjr
11134336StjrGNU CC is distributed in the hope that it will be useful,
12134336Stjrbut WITHOUT ANY WARRANTY; without even the implied warranty of
13134336StjrMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14134336StjrGNU General Public License for more details.
15134336Stjr
16134336StjrYou should have received a copy of the GNU General Public License
17134336Stjralong with GNU CC; see the file COPYING.  If not, write to
18134336Stjrthe Free Software Foundation, 59 Temple Place - Suite 330,
19134336StjrBoston, MA 02111-1307, USA.  */
2031027Sache
2131027Sache/* This file defines the aspects of assembler syntax
2231027Sache   that are the same for all the i386 Unix systems
23134336Stjr   (though they may differ in non-Unix systems).  */
24134336Stjr
25134336Stjr/* Define some concatenation macros to concatenate an opcode
26134336Stjr   and one, two or three operands.  In other assembler syntaxes
27134336Stjr   they may alter the order of ther operands.  */
28134336Stjr
29134336Stjr/* Note that the other files fail to use these
30134336Stjr   in some of the places where they should.  */
31134336Stjr
32134336Stjr#if defined(__STDC__) || defined(ALMOST_STDC)
33134336Stjr#define AS2(a,b,c) #a " " #b "," #c
34134336Stjr#define AS2C(b,c) " " #b "," #c
3531027Sache#define AS3(a,b,c,d) #a " " #b "," #c "," #d
3631027Sache#define AS1(a,b) #a " " #b
3731027Sache#else
38134336Stjr#define AS1(a,b) "a b"
39134336Stjr#define AS2(a,b,c) "a b,c"
40134336Stjr#define AS2C(b,c) " b,c"
41134336Stjr#define AS3(a,b,c,d) "a b,c,d"
42134336Stjr#endif
43134336Stjr
44134336Stjr/* Define macro used to output shift-double opcodes when the shift
4531027Sache   count is in %cl.  Some assemblers require %cl as an argument;
4631027Sache   some don't.  This macro controls what to do: by default, don't
4731027Sache   print %cl.  */
48134336Stjr#define AS3_SHIFT_DOUBLE(a,b,c,d) AS2 (a,c,d)
49134336Stjr
50134336Stjr/* Output the size-letter for an opcode.
51134336Stjr   CODE is the letter used in an operand spec (L, B, W, S or Q).
52134336Stjr   CH is the corresponding lower case letter
53134336Stjr     (except if CODE is `Q' then CH is `l', unless GAS_MNEMONICS).  */
54134336Stjr#define PUT_OP_SIZE(CODE,CH,FILE) putc (CH,(FILE))
5531027Sache
5631027Sache/* Opcode suffix for fullword insn.  */
5731027Sache#define L_SIZE "l"
5831027Sache
5931027Sache/* Prefix for register names in this syntax.  */
6031027Sache#define RP "%"
6131027Sache
6274570Sache/* Prefix for immediate operands in this syntax.  */
6331027Sache#define IP "$"
6431027Sache
6531027Sache/* Indirect call instructions should use `*'.  */
6654090Sache#define USE_STAR 1
6731027Sache
6831027Sache/* Prefix for a memory-operand X.  */
6931027Sache#define PRINT_PTR(X, FILE)
7031027Sache
7131027Sache/* Delimiters that surround base reg and index reg.  */
7231027Sache#define ADDR_BEG(FILE) putc('(', (FILE))
7331027Sache#define ADDR_END(FILE) putc(')', (FILE))
7431027Sache
7531027Sache/* Print an index register (whose rtx is IREG).  */
7631027Sache#define PRINT_IREG(FILE,IREG) \
7731027Sache  do								\
7854090Sache  { fputs (",", (FILE)); PRINT_REG ((IREG), 0, (FILE)); }	\
7953943Sache  while (0)
8053943Sache
8153943Sache/* Print an index scale factor SCALE.  */
82134336Stjr#define PRINT_SCALE(FILE,SCALE) \
83134336Stjr  if ((SCALE) != 1) fprintf ((FILE), ",%d", (SCALE))
84134336Stjr
85134336Stjr/* Print a base/index combination.
86134336Stjr   BREG is the base reg rtx, IREG is the index reg rtx,
87134336Stjr   and SCALE is the index scale factor (an integer).  */
88134336Stjr
89134336Stjr#define PRINT_B_I_S(BREG,IREG,SCALE,FILE) \
90134336Stjr  { ADDR_BEG (FILE); 				\
91134336Stjr    if (BREG) PRINT_REG ((BREG), 0, (FILE));	\
92134336Stjr    if ((IREG) != 0)				\
93134336Stjr      { PRINT_IREG ((FILE), (IREG));		\
9453943Sache        PRINT_SCALE ((FILE), (SCALE)); }	\
9574413Sache    ADDR_END (FILE); }
9653943Sache
9774413Sache/* Define the syntax of pseudo-ops, labels and comments.  */
9853961Sache
9974413Sache/* String containing the assembler's comment-starter.  */
10053961Sache
10174413Sache#define ASM_COMMENT_START "/"
10274413Sache#define COMMENT_BEGIN "/"
103
104/* Output to assembler file text saying following lines
105   may contain character constants, extra white space, comments, etc.  */
106
107#define ASM_APP_ON "/APP\n"
108
109/* Output to assembler file text saying following lines
110   no longer contain unusual constructs.  */
111
112#define ASM_APP_OFF "/NO_APP\n"
113
114/* Output before read-only data.  */
115
116#define TEXT_SECTION_ASM_OP ".text"
117
118/* Output before writable (initialized) data.  */
119
120#define DATA_SECTION_ASM_OP ".data"
121
122/* Output before writable (uninitialized) data.  */
123
124#define BSS_SECTION_ASM_OP ".bss"
125
126/* This is how to output a command to make the user-level label named NAME
127   defined for reference from other files.  */
128
129#define ASM_GLOBALIZE_LABEL(FILE,NAME)	\
130  (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
131
132/* By default, target has a 80387, uses IEEE compatible arithmetic,
133   and returns float values in the 387, ie,
134   (TARGET_80387 | TARGET_IEEE_FP | TARGET_FLOAT_RETURNS_IN_80387) */
135
136#define TARGET_DEFAULT 0301
137
138/* Floating-point return values come in the FP register.  */
139
140#define VALUE_REGNO(MODE) \
141  (GET_MODE_CLASS (MODE) == MODE_FLOAT				\
142   && TARGET_FLOAT_RETURNS_IN_80387 ? FIRST_FLOAT_REG : 0)
143
144/* 1 if N is a possible register number for a function value. */
145
146#define FUNCTION_VALUE_REGNO_P(N) \
147  ((N) == 0 || ((N)== FIRST_FLOAT_REG && TARGET_FLOAT_RETURNS_IN_80387))
148
149