This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] alow '$' as hexadecimal prefix on z80


Hello,

The patch below allows to use the hexadecimal prefix, while 
maintaining its role as special symbol denoting the location 
counter.
The controlling macro, DOLLAR_AMBIGU, is already defined in 
config/tc-z80.h, 

Arnold

ChangeLog:
* expr.c (operand <case '$'>): Use DOLLAR_AMBIGU rather than 
flag_mri_m68k as condition for parsing the '$' as a prefix. 
* as.h: Define DOLLAR_AMBIGU if needed.
 
Index: as.h
===================================================================
RCS file: /cvs/src/src/gas/as.h,v
retrieving revision 1.49
diff -u -p -r1.49 as.h
--- as.h	11 Aug 2005 01:25:20 -0000	1.49
+++ as.h	30 Oct 2005 18:34:16 -0000
@@ -586,6 +586,7 @@ int generic_force_reloc (struct fix *);
 #ifdef TC_M68K
 /* True if we are assembling in m68k MRI mode.  */
 COMMON int flag_m68k_mri;
+#define DOLLAR_AMBIGU flag_m68k_mri
 #else
 #define flag_m68k_mri 0
 #endif
@@ -600,6 +601,10 @@ COMMON char *        found_comment_file;
 #define NUMBERS_WITH_SUFFIX 0
 #endif
 
+#ifndef DOLLAR_AMBIGU
+#define DOLLAR_AMBIGU 0
+#endif
+
 #ifndef LOCAL_LABELS_DOLLAR
 #define LOCAL_LABELS_DOLLAR 0
 #endif
Index: expr.c
===================================================================
RCS file: /cvs/src/src/gas/expr.c,v
retrieving revision 1.60
diff -u -p -r1.60 expr.c
--- expr.c	11 Oct 2005 11:16:16 -0000	1.60
+++ expr.c	30 Oct 2005 18:34:19 -0000
@@ -1092,10 +1092,10 @@ operand (expressionS *expressionP, enum 
       if (! flag_m68k_mri)
 	goto de_fault;
 #endif
-      if (flag_m68k_mri && hex_p (*input_line_pointer))
+      if (DOLLAR_AMBIGU && hex_p (*input_line_pointer))
 	{
-	  /* In MRI mode, '$' is also used as the prefix for a
-	     hexadecimal constant.  */
+	  /* In MRI mode and on Z80, '$' is also used as the prefix
+	     for a hexadecimal constant.  */
 	  integer_constant (16, expressionP);
 	  break;
 	}
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]