|
|
1.1 ! root 1: /* Definitions for Sun 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, Sun 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\t" ! 99: #define ASM_SHORT "\t.value\t" ! 100: #define ASM_LONG "\t.long\t" ! 101: #define ASM_DOUBLE "\t.double\t" ! 102: ! 103: /* String containing the assembler's comment-starter. */ ! 104: ! 105: #define COMMENT_BEGIN "/" ! 106: ! 107: /* Output at beginning of assembler file. */ ! 108: /* The .file command should always begin the output. */ ! 109: ! 110: #undef ASM_FILE_START ! 111: #define ASM_FILE_START(FILE) \ ! 112: do { \ ! 113: extern char *version_string, *language_string; \ ! 114: fprintf(FILE, "\t.file\t\"%s\"\n", dump_base_name); \ ! 115: fprintf(FILE, "\t.version\t\"%s %s\"\n", \ ! 116: language_string, version_string); \ ! 117: if (optimize) ASM_FILE_START_1 (FILE); \ ! 118: } while (0) ! 119: ! 120: #define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n") ! 121: ! 122: /* Output to assembler file text saying following lines ! 123: may contain character constants, extra white space, comments, etc. */ ! 124: ! 125: #define ASM_APP_ON "/APP\n" ! 126: ! 127: /* Output to assembler file text saying following lines ! 128: no longer contain unusual constructs. */ ! 129: ! 130: #define ASM_APP_OFF "/NO_APP\n" ! 131: ! 132: /* This is how to output an assembler line ! 133: that says to advance the location counter ! 134: to a multiple of 2**LOG bytes. */ ! 135: ! 136: #define ASM_OUTPUT_ALIGN(FILE,LOG) \ ! 137: if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) ! 138: ! 139: /* This is how to output an assembler line ! 140: that says to advance the location counter by SIZE bytes. */ ! 141: ! 142: #define ASM_OUTPUT_SKIP(FILE,SIZE) \ ! 143: fprintf ((FILE), "\t.set\t.,.+%d\n", (SIZE)) ! 144: ! 145: /* Output before read-only data. */ ! 146: ! 147: #define TEXT_SECTION_ASM_OP "\t.text" ! 148: ! 149: /* Output before writable data. */ ! 150: ! 151: #define DATA_SECTION_ASM_OP "\t.data" ! 152: ! 153: /* Define the syntax of labels and symbol definitions/declarations. */ ! 154: ! 155: /* This says how to output an assembler line ! 156: to define a global common symbol. */ ! 157: ! 158: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ ! 159: ( fputs ("\t.comm\t", (FILE)), \ ! 160: assemble_name ((FILE), (NAME)), \ ! 161: fprintf ((FILE), ",%d\n", (SIZE))) ! 162: ! 163: /* This says how to output an assembler line ! 164: to define a local common symbol. */ ! 165: ! 166: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ ! 167: (data_section (), \ ! 168: ASM_OUTPUT_LABEL ((FILE), (NAME)), \ ! 169: fprintf ((FILE), "\t.set\t.,.+%d\n", (SIZE))) ! 170: ! 171: /* This is how to store into the string BUF ! 172: the symbol_ref name of an internal numbered label where ! 173: PREFIX is the class of label and NUM is the number within the class. ! 174: This is suitable for output with `assemble_name'. */ ! 175: ! 176: #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ ! 177: sprintf ((BUF), ".%s%d", (PREFIX), (NUMBER)) ! 178: ! 179: /* This is how to output a reference to a user-level label named NAME. */ ! 180: ! 181: #define ASM_OUTPUT_LABELREF(FILE,NAME) \ ! 182: fprintf (FILE, "%s", NAME) ! 183: ! 184: /* This is how to output an internal numbered label where ! 185: PREFIX is the class of label and NUM is the number within the class. */ ! 186: ! 187: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ ! 188: fprintf (FILE, ".%s%d:\n", PREFIX, NUM) ! 189: ! 190: /* This is how to output a command to make the user-level label named NAME ! 191: defined for reference from other files. */ ! 192: ! 193: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ ! 194: (fputs ("\t.globl\t", FILE), assemble_name (FILE, NAME), fputs ("\n", FILE)) ! 195: ! 196: /* How to output an ASCII string constant. */ ! 197: ! 198: #define ASM_OUTPUT_ASCII(FILE, p, size) \ ! 199: { int i=0; \ ! 200: while (i < size) \ ! 201: { if (i%10 == 0) { if (i!=0) fprintf (FILE, "\n"); \ ! 202: fprintf (FILE, ASM_BYTE); } \ ! 203: else fprintf (FILE, ","); \ ! 204: fprintf (FILE, "0x%x",(p[i++] & 0377)) ;} \ ! 205: fprintf (FILE, "\n"); }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.