(ASM_OUTPUT_NEWLINE): Delete.
authorJim Wilson <wilson@gcc.gnu.org>
Sun, 14 Aug 1994 23:09:34 +0000 (16:09 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Sun, 14 Aug 1994 23:09:34 +0000 (16:09 -0700)
(ASM_OUTPUT_ASCII): Define.

From-SVN: r7923

gcc/config/mips/bsd-5.h
gcc/config/mips/mips-5.h
gcc/config/mips/svr3-5.h
gcc/config/mips/svr4-5.h

index bc26533..eb71514 100644 (file)
@@ -46,9 +46,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #define MD_STARTFILE_PREFIX "/bsd43/usr/lib/cmplrs/cc/"
 #define MD_EXEC_PREFIX "/bsd43/usr/lib/cmplrs/cc/"
 
-/* Some RISCOS assemblers misassemble \n in a .ascii,
-   so we use \X0A instead.  */
-#define ASM_OUTPUT_NEWLINE(STREAM) \
-  fputs ("\\X0A", (STREAM));
-
 #include "mips/mips.h"
+
+/* Some assemblers have a bug that causes backslash escaped chars in .ascii
+   to be misassembled, so we just completely avoid it.  */
+#undef ASM_OUTPUT_ASCII
+#define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                 \
+do {                                                   \
+  unsigned char *s;                                    \
+  int i;                                               \
+  for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
+    {                                                  \
+      if ((i % 8) == 0)                                        \
+       fputs ("\n\t.byte\t", (FILE));                  \
+      fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
+    }                                                  \
+  fputs ("\n", (FILE));                                        \
+} while (0)
index 3c8ce39..252becf 100644 (file)
@@ -26,9 +26,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt1.o%s crtn.o%s}}"
 
-/* Some RISCOS assemblers misassemble \n in a .ascii,
-   so we use \X0A instead.  */
-#define ASM_OUTPUT_NEWLINE(STREAM) \
-  fputs ("\\X0A", (STREAM));
-
 #include "mips/mips.h"
+
+/* Some assemblers have a bug that causes backslash escaped chars in .ascii
+   to be misassembled, so we just completely avoid it.  */
+#undef ASM_OUTPUT_ASCII
+#define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                 \
+do {                                                   \
+  unsigned char *s;                                    \
+  int i;                                               \
+  for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
+    {                                                  \
+      if ((i % 8) == 0)                                        \
+       fputs ("\n\t.byte\t", (FILE));                  \
+      fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
+    }                                                  \
+  fputs ("\n", (FILE));                                        \
+} while (0)
index 2a2028c..5e7e111 100644 (file)
@@ -68,9 +68,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Generate calls to memcpy, etc., not bcopy, etc.  */
 #define TARGET_MEM_FUNCTIONS
 
-/* Some RISCOS assemblers misassemble \n in a .ascii,
-   so we use \X0A instead.  */
-#define ASM_OUTPUT_NEWLINE(STREAM) \
-  fputs ("\\X0A", (STREAM));
-
 #include "mips/mips.h"
+
+/* Some assemblers have a bug that causes backslash escaped chars in .ascii
+   to be misassembled, so we just completely avoid it.  */
+#undef ASM_OUTPUT_ASCII
+#define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                 \
+do {                                                   \
+  unsigned char *s;                                    \
+  int i;                                               \
+  for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
+    {                                                  \
+      if ((i % 8) == 0)                                        \
+       fputs ("\n\t.byte\t", (FILE));                  \
+      fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
+    }                                                  \
+  fputs ("\n", (FILE));                                        \
+} while (0)
index e13cb86..5c134c8 100644 (file)
@@ -71,9 +71,20 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* Generate calls to memcpy, etc., not bcopy, etc.  */
 #define TARGET_MEM_FUNCTIONS
 
-/* Some RISCOS assemblers misassemble \n in a .ascii,
-   so we use \X0A instead.  */
-#define ASM_OUTPUT_NEWLINE(STREAM) \
-  fputs ("\\X0A", (STREAM));
-
 #include "mips/mips.h"
+
+/* Some assemblers have a bug that causes backslash escaped chars in .ascii
+   to be misassembled, so we just completely avoid it.  */
+#undef ASM_OUTPUT_ASCII
+#define ASM_OUTPUT_ASCII(FILE,PTR,LEN)                 \
+do {                                                   \
+  unsigned char *s;                                    \
+  int i;                                               \
+  for (i = 0, s = (unsigned char *)(PTR); i < (LEN); s++, i++) \
+    {                                                  \
+      if ((i % 8) == 0)                                        \
+       fputs ("\n\t.byte\t", (FILE));                  \
+      fprintf ((FILE), "%s0x%x", (i%8?",":""), (unsigned)*s); \
+    }                                                  \
+  fputs ("\n", (FILE));                                        \
+} while (0)