Annotation of gcc/tm-att386.h, revision 1.1.1.2

1.1       root        1: /* Definitions for AT&T assembler syntax for the Intel 80386.
                      2:    Copyright (C) 1988 Free Software Foundation, Inc.
                      3: 
                      4: This file is part of GNU CC.
                      5: 
                      6: GNU CC is distributed in the hope that it will be useful,
                      7: but WITHOUT ANY WARRANTY.  No author or distributor
                      8: accepts responsibility to anyone for the consequences of using it
                      9: or for whether it serves any particular purpose or works at all,
                     10: unless he says so in writing.  Refer to the GNU CC General Public
                     11: License for full details.
                     12: 
                     13: Everyone is granted permission to copy, modify and redistribute
                     14: GNU CC, but only under the conditions described in the
                     15: GNU CC General Public License.   A copy of this license is
                     16: supposed to have been given to you along with GNU CC so you
                     17: can know your rights and responsibilities.  It should be in a
                     18: file named COPYING.  Among other things, the copyright notice
                     19: and this notice must be preserved on all copies.  */
                     20: 
                     21: 
                     22: #define TARGET_VERSION printf (" (80386, ATT syntax)");
                     23: 
                     24: /* Define the syntax of instructions and addresses.  */
                     25: 
                     26: /* Define some concatenation macros to concatenate an opcode
                     27:    and one, two or three operands.  In other assembler syntaxes
                     28:    they may alter the order of ther operands.  */
                     29: 
                     30: #ifdef __STDC__
                     31: #define AS2(a,b,c) #a " " #b "," #c
                     32: #define AS3(a,b,c,d) #a " " #b "," #c "," #d
                     33: #define AS1(a,b) #a " " #b
                     34: #else
                     35: #define AS1(a,b) "a b"
                     36: #define AS2(a,b,c) "a b,c"
                     37: #define AS3(a,b,c,d) "a b,c,d"
                     38: #endif  
                     39: 
                     40: /* Output the size-letter for an opcode.
                     41:    CODE is the letter used in an operand spec (L, B, W, S or Q).
                     42:    CH is the corresponding lower case letter
                     43:      (except if CODE is L then CH is `l').  */
                     44: #define PUT_OP_SIZE(CODE,CH,FILE) putc (CH,(FILE))
                     45: 
                     46: /* Opcode suffix for fullword insn.  */
                     47: #define L_SIZE "l"
                     48: 
                     49: /* Prefix for register names in this syntax.  */
                     50: #define RP "%"
                     51: 
                     52: /* Prefix for immediate operands in this syntax.  */
                     53: #define IP "$"
                     54: 
                     55: /* Prefix for internally generated assembler labels.  */
                     56: #define LPREFIX ".L"
                     57: 
                     58: /* Output the prefix for an immediate operand, or for an offset operand.  */
                     59: #define PRINT_IMMED_PREFIX(FILE)  fputs ("$", (FILE))
                     60: #define PRINT_OFFSET_PREFIX(FILE)  fputs ("$", (FILE))
                     61: 
                     62: /* Indirect call instructions should use `*'.  */
                     63: #define USE_STAR 1
                     64: 
                     65: /* Prefix for a memory-operand X.  */
                     66: #define PRINT_PTR(X, FILE)
                     67: 
                     68: /* Delimiters that surround base reg and index reg.  */
                     69: #define ADDR_BEG(FILE) putc('(', (FILE))
                     70: #define ADDR_END(FILE) putc(')', (FILE))
                     71: 
                     72: /* Print an index register (whose rtx is IREG).  */
                     73: #define PRINT_IREG(FILE,IREG) \
                     74:   do                                                           \
                     75:   { fputs (",", (FILE)); PRINT_REG ((IREG), 0, (FILE)); }      \
                     76:   while (0)
                     77:   
                     78: /* Print an index scale factor SCALE.  */
                     79: #define PRINT_SCALE(FILE,SCALE) \
                     80:   if ((SCALE) != 1) fprintf ((FILE), ",%d", (SCALE))
                     81: 
                     82: /* Print a base/index combination.
                     83:    BREG is the base reg rtx, IREG is the index reg rtx,
                     84:    and SCALE is the index scale factor (an integer).  */
                     85: 
                     86: #define PRINT_B_I_S(BREG,IREG,SCALE,FILE) \
                     87:   { ADDR_BEG (FILE);                           \
                     88:     if (BREG) PRINT_REG ((BREG), 0, (FILE));   \
                     89:     if ((IREG) != 0)                           \
                     90:       { PRINT_IREG ((FILE), (IREG));           \
                     91:         PRINT_SCALE ((FILE), (SCALE)); }       \
                     92:     ADDR_END (FILE); }
                     93: 
                     94: /* Define the syntax of pseudo-ops, labels and comments.  */
                     95: 
                     96: /* Assembler pseudos to introduce constants of various size.  */
                     97: 
                     98: #define ASM_BYTE "\t.byte "
                     99: #define ASM_SHORT "\t.value "
                    100: #define ASM_LONG "\t.long "
                    101: #define ASM_DOUBLE "\t.double "
                    102: 
                    103: /* String containing the assembler's comment-starter.  */
                    104: 
                    105: #define COMMENT_BEGIN "/"
                    106: 
                    107: /* Output at beginning of assembler file.  */
1.1.1.2 ! root      108: /* The .file command should always begin the output.  */
1.1       root      109: 
                    110: #undef ASM_FILE_START
                    111: #define ASM_FILE_START(FILE)                           \
1.1.1.2 ! root      112:   do { sdbout_filename ((FILE), main_input_filename);  \
        !           113:        if (optimize) ASM_FILE_START_1 (FILE);          \
1.1       root      114:      } while (0)
                    115: 
                    116: #define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n")
                    117: 
                    118: /* Output to assembler file text saying following lines
                    119:    may contain character constants, extra white space, comments, etc.  */
                    120: 
                    121: #define ASM_APP_ON "/APP\n"
                    122: 
                    123: /* Output to assembler file text saying following lines
                    124:    no longer contain unusual constructs.  */
                    125: 
                    126: #define ASM_APP_OFF "/NO_APP\n"
                    127: 
                    128: /* This is how to output an assembler line
                    129:    that says to advance the location counter
                    130:    to a multiple of 2**LOG bytes.  */
                    131: 
                    132: #define ASM_OUTPUT_ALIGN(FILE,LOG)     \
                    133:     if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
                    134: 
                    135: /* This is how to output an assembler line
                    136:    that says to advance the location counter by SIZE bytes.  */
                    137: 
                    138: #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
                    139:   fprintf ((FILE), "\t.set .,.+%d\n", (SIZE))
                    140: 
                    141: /* Output before read-only data.  */
                    142: 
                    143: #define TEXT_SECTION_ASM_OP ".text"
                    144: 
                    145: /* Output before writable data.  */
                    146: 
                    147: #define DATA_SECTION_ASM_OP ".data"
                    148: 
                    149: /* Define the syntax of labels and symbol definitions/declarations.  */
                    150: 
                    151: /* This says how to output an assembler line
                    152:    to define a global common symbol.  */
                    153: 
1.1.1.2 ! root      154: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
1.1       root      155: ( fputs (".comm ", (FILE)),                    \
                    156:   assemble_name ((FILE), (NAME)),              \
                    157:   fprintf ((FILE), ",%d\n", (SIZE)))
                    158: 
                    159: /* This says how to output an assembler line
                    160:    to define a local common symbol.  */
                    161: 
1.1.1.2 ! root      162: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
1.1       root      163:   (data_section (),                            \
                    164:    ASM_OUTPUT_LABEL ((FILE), (NAME)),          \
                    165:    fprintf ((FILE), "\t.set .,.+%d\n", (SIZE)))
                    166: 
                    167: /* This is how to store into the string BUF
                    168:    the symbol_ref name of an internal numbered label where
                    169:    PREFIX is the class of label and NUM is the number within the class.
                    170:    This is suitable for output with `assemble_name'.  */
                    171: 
                    172: #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \
                    173:   sprintf ((BUF), ".%s%d", (PREFIX), (NUMBER))
                    174: 
                    175: /* This is how to output a reference to a user-level label named NAME.  */
                    176: 
                    177: #define ASM_OUTPUT_LABELREF(FILE,NAME) \
                    178:   fprintf (FILE, "%s", NAME)
                    179: 
                    180: /* This is how to output an internal numbered label where
                    181:    PREFIX is the class of label and NUM is the number within the class.  */
                    182: 
                    183: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)     \
                    184:   fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
                    185: 
                    186: /* This is how to output a command to make the user-level label named NAME
                    187:    defined for reference from other files.  */
                    188: 
                    189: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
                    190:   (fputs (".globl ", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE))
1.1.1.2 ! root      191: 
        !           192: /* How to output an ASCII string constant.  */
        !           193: 
        !           194: #define ASM_OUTPUT_ASCII(FILE, p, size) \
        !           195: { int i=0;                                             \
        !           196:   while (i < size)                                     \
        !           197:     { if (i%10 == 0) { if (i!=0) fprintf (FILE, "\n"); \
        !           198:                       fprintf (FILE, ASM_BYTE); }      \
        !           199:       else fprintf (FILE, ",");                                \
        !           200:        fprintf (FILE, "0x%x",(p[i++] & 0377)) ;}       \
        !           201:       fprintf (FILE, "\n"); }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.