Fix Opcode generation of ld a,(bc) and ld a,(de) on target z80
[binutils-gdb.git] / gas / read.c
index 5718bf44f9c2f486912cc3c2b295c7e901740523..ec69c4e7a90f84a6f01025f133e5e6dd432c2175 100644 (file)
@@ -2554,8 +2554,13 @@ s_macro (int ignore ATTRIBUTE_UNUSED)
 void
 s_mexit (int ignore ATTRIBUTE_UNUSED)
 {
-  cond_exit_macro (macro_nest);
-  buffer_limit = input_scrub_next_buffer (&input_line_pointer);
+  if (macro_nest)
+    {
+      cond_exit_macro (macro_nest);
+      buffer_limit = input_scrub_next_buffer (&input_line_pointer);
+    }
+  else
+    as_warn (_("ignoring macro exit outside a macro definition."));
 }
 
 /* Switch in and out of MRI mode.  */
@@ -3168,7 +3173,7 @@ s_space (int mult)
 
       if (exp.X_op == O_constant)
        {
-         long repeat;
+         offsetT repeat;
 
          repeat = exp.X_add_number;
          if (mult)
@@ -3449,14 +3454,15 @@ s_weakref (int ignore ATTRIBUTE_UNUSED)
          char *loop;
 
          loop = concat (S_GET_NAME (symbolP),
-                        " => ", S_GET_NAME (symbolP2), NULL);
+                        " => ", S_GET_NAME (symbolP2), (const char *) NULL);
 
          symp = symbolP2;
          while (symp != symbolP)
            {
              char *old_loop = loop;
              symp = symbol_get_value_expression (symp)->X_add_symbol;
-             loop = concat (loop, " => ", S_GET_NAME (symp), NULL);
+             loop = concat (loop, " => ", S_GET_NAME (symp),
+                            (const char *) NULL);
              free (old_loop);
            }
 
@@ -3603,6 +3609,12 @@ pseudo_set (symbolS *symbolP)
       break;
 
     case O_register:
+      if (S_IS_EXTERNAL (symbolP))
+       {
+         as_bad ("can't equate global symbol `%s' with register name",
+                 S_GET_NAME (symbolP));
+         return;
+       }
       S_SET_SEGMENT (symbolP, reg_section);
       S_SET_VALUE (symbolP, (valueT) exp.X_add_number);
       set_zero_frag (symbolP);
@@ -4112,8 +4124,13 @@ emit_expr (expressionS *exp, unsigned int nbytes)
              || (get & hibit) == 0))
        {               /* Leading bits contain both 0s & 1s.  */
 #if defined (BFD64) && BFD_HOST_64BIT_LONG_LONG
+#ifndef __MSVCRT__
          as_warn (_("value 0x%llx truncated to 0x%llx"),
                   (unsigned long long) get, (unsigned long long) use);
+#else
+         as_warn (_("value 0x%I64x truncated to 0x%I64x"),
+                  (unsigned long long) get, (unsigned long long) use);
+#endif
 #else
          as_warn (_("value 0x%lx truncated to 0x%lx"),
                   (unsigned long) get, (unsigned long) use);