demand_empty_rest_of_line ();
}
+/* Return true if all remaining operands in the opcode with
+ OPCODE_FLAGS can be skipped. */
+static bfd_boolean
+skip_optargs_p (unsigned int opcode_flags, const unsigned char *opindex_ptr)
+{
+ if ((opcode_flags & (S390_INSTR_FLAG_OPTPARM | S390_INSTR_FLAG_OPTPARM2))
+ && opindex_ptr[0] != '\0'
+ && opindex_ptr[1] == '\0')
+ return TRUE;
+
+ if ((opcode_flags & S390_INSTR_FLAG_OPTPARM2)
+ && opindex_ptr[0] != '\0'
+ && opindex_ptr[1] != '\0'
+ && opindex_ptr[2] == '\0')
+ return TRUE;
+ return FALSE;
+}
+
/* We need to keep a list of fixups. We can't simply generate them as
we go, because that would require us to first create the frag, and
that would screw up references to ``.''. */
while (!(operand->flags & S390_OPERAND_BASE))
operand = s390_operands + *(++opindex_ptr);
+ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1]))
+ continue;
+
/* If there is a next operand it must be separated by a comma. */
if (opindex_ptr[1] != '\0')
{
as_bad (_("syntax error; missing ')' after base register"));
skip_optional = 0;
- if ((opcode->flags & (S390_INSTR_FLAG_OPTPARM
- | S390_INSTR_FLAG_OPTPARM2))
- && opindex_ptr[1] != '\0'
- && opindex_ptr[2] == '\0'
- && *str == '\0')
- continue;
-
- if ((opcode->flags & S390_INSTR_FLAG_OPTPARM2)
- && opindex_ptr[1] != '\0'
- && opindex_ptr[2] != '\0'
- && opindex_ptr[3] == '\0'
- && *str == '\0')
+ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1]))
continue;
/* If there is a next operand it must be separated by a comma. */
str++;
}
- if ((opcode->flags & (S390_INSTR_FLAG_OPTPARM
- | S390_INSTR_FLAG_OPTPARM2))
- && opindex_ptr[1] != '\0'
- && opindex_ptr[2] == '\0'
- && *str == '\0')
- continue;
-
- if ((opcode->flags & S390_INSTR_FLAG_OPTPARM2)
- && opindex_ptr[1] != '\0'
- && opindex_ptr[2] != '\0'
- && opindex_ptr[3] == '\0'
- && *str == '\0')
+ if (*str == '\0' && skip_optargs_p (opcode->flags, &opindex_ptr[1]))
continue;
/* If there is a next operand it must be separated by a comma. */