1 /* Definitions of various defaults for how to do assembler output
2 (most of which are designed to be appropriate for GAS or for
5 Written by Ron Guilmette (rfg@ncd.com)
7 Copyright (C) 1992 Free Software Foundation, Inc.
9 This file is part of GNU CC.
11 GNU CC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
16 GNU CC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GNU CC; see the file COPYING. If not, write to
23 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
25 /* choose a reasonable default for ASM_OUTPUT_ASCII. */
27 #ifndef ASM_OUTPUT_ASCII
28 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
30 FILE *_hide_asm_out_file = (MYFILE); \
31 char *_hide_p = (char *) (MYSTRING); \
32 int _hide_thissize = (MYLENGTH); \
34 FILE *asm_out_file = _hide_asm_out_file; \
36 int thissize = _hide_thissize; \
38 fprintf (asm_out_file, "\t.ascii \""); \
40 for (i = 0; i < thissize; i++) \
42 register int c = p[i]; \
43 if (c == '\"' || c == '\\') \
44 putc ('\\', asm_out_file); \
45 if (c >= ' ' && c < 0177) \
46 putc (c, asm_out_file); \
49 fprintf (asm_out_file, "\\%o", c); \
50 /* After an octal-escape, if a digit follows, \
51 terminate one string constant and start another. \
52 The Vax assembler fails to stop reading the escape \
53 after three digits, so this is the only way we \
54 can get it to parse the data properly. */ \
55 if (i < thissize - 1 \
56 && p[i + 1] >= '0' && p[i + 1] <= '9') \
57 fprintf (asm_out_file, "\"\n\t.ascii \""); \
60 fprintf (asm_out_file, "\"\n"); \