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] allow != instead of <> in as


The following patch will make as accept "!=" as a synonym for 
"<>". The operator "!=" appears in some Z80 sources, and I 
don't see a reason not to allow it.

Regards,
Arnold

gas/ChangeLog
	* expr.c (operator) <case '!'>: allow "!=" for O_ne
	* doc/as.texinfo (infix operators): mention "!=" 

--- gas/expr.c  2005-05-05 11:12:45.000000000 +0200
+++ gas/expr.c.new      2005-10-01 21:28:50.000000000 +0200
@@ -1587,16 +1587,18 @@
       return ret;

     case '!':
-      /* We accept !! as equivalent to ^ for MRI compatibility.  
*/
-      if (input_line_pointer[1] != '!')
-       {
+      switch (input_line_pointer[1]) {
+      default:
          if (flag_m68k_mri)
            return O_bit_inclusive_or;
          return op_encoding[c];
-       }
+      case '!': /* We accept !! as equivalent to ^ for MRI 
compatibility. */
       *num_chars = 2;
       return O_bit_exclusive_or;
-
+      case '=': /* We accept != as equivalent to <> */
+       *num_chars = 2;
+       return O_ne;
+      }
     case '|':
       if (input_line_pointer[1] != '|')
        return op_encoding[c];

--- gas/doc/as.texinfo  2005-10-01 21:53:21.121261048 +0200
+++ gas/doc/as.texinfo.new      2005-10-01 22:26:53.023405432 
+0200
@@ -3619,6 +3619,7 @@
 @item  ==
 @dfn{Is Equal To}
 @item <>
+@itemx !=
 @dfn{Is Not Equal To}
 @item <
 @dfn{Is Less Than}



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