aboutsummaryrefslogtreecommitdiff
path: root/cpu/m32c.opc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/m32c.opc')
-rw-r--r--cpu/m32c.opc69
1 files changed, 32 insertions, 37 deletions
diff --git a/cpu/m32c.opc b/cpu/m32c.opc
index bc983ea..d2b073d 100644
--- a/cpu/m32c.opc
+++ b/cpu/m32c.opc
@@ -156,27 +156,26 @@ parse_unsigned8 (CGEN_CPU_DESC cd, const char **strp,
int opindex, unsigned long *valuep)
{
const char *errmsg = 0;
- unsigned long value;
+ unsigned long value = 0;
long have_zero = 0;
if (strncasecmp (*strp, "%dsp8(", 6) == 0)
{
enum cgen_parse_operand_result result_type;
- bfd_vma value;
- const char *errmsg;
+ bfd_vma val;
*strp += 6;
errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_8,
- & result_type, & value);
+ & result_type, & val);
if (**strp != ')')
return _("missing `)'");
(*strp) ++;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- {
- return _("%dsp8() takes a symbolic address, not a number");
- }
+ return _("%dsp8() takes a symbolic address, not a number");
+
+ value = val;
*valuep = value;
return errmsg;
}
@@ -253,26 +252,25 @@ parse_signed8 (CGEN_CPU_DESC cd, const char **strp,
int opindex, signed long *valuep)
{
const char *errmsg = 0;
- signed long value;
+ signed long value = 0;
if (strncasecmp (*strp, "%hi8(", 5) == 0)
{
enum cgen_parse_operand_result result_type;
- bfd_vma value;
- const char *errmsg;
+ bfd_vma val;
*strp += 5;
errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_M32C_HI8,
- & result_type, & value);
+ & result_type, & val);
if (**strp != ')')
return _("missing `)'");
(*strp) ++;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- {
- value >>= 16;
- }
+ val >>= 16;
+
+ value = val;
*valuep = value;
return errmsg;
}
@@ -294,27 +292,26 @@ parse_unsigned16 (CGEN_CPU_DESC cd, const char **strp,
int opindex, unsigned long *valuep)
{
const char *errmsg = 0;
- unsigned long value;
+ unsigned long value = 0;
long have_zero = 0;
if (strncasecmp (*strp, "%dsp16(", 7) == 0)
{
enum cgen_parse_operand_result result_type;
- bfd_vma value;
- const char *errmsg;
+ bfd_vma val;
*strp += 7;
errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_16,
- & result_type, & value);
+ & result_type, & val);
if (**strp != ')')
return _("missing `)'");
(*strp) ++;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- {
- return _("%dsp16() takes a symbolic address, not a number");
- }
+ return _("%dsp16() takes a symbolic address, not a number");
+
+ value = val;
*valuep = value;
return errmsg;
}
@@ -354,26 +351,25 @@ parse_signed16 (CGEN_CPU_DESC cd, const char **strp,
int opindex, signed long *valuep)
{
const char *errmsg = 0;
- signed long value;
+ signed long value = 0;
if (strncasecmp (*strp, "%lo16(", 6) == 0)
{
enum cgen_parse_operand_result result_type;
- bfd_vma value;
- const char *errmsg;
+ bfd_vma val;
*strp += 6;
errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16,
- & result_type, & value);
+ & result_type, & val);
if (**strp != ')')
return _("missing `)'");
(*strp) ++;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- {
- value &= 0xffff;
- }
+ value &= 0xffff;
+
+ value = val;
*valuep = value;
return errmsg;
}
@@ -381,21 +377,20 @@ parse_signed16 (CGEN_CPU_DESC cd, const char **strp,
if (strncasecmp (*strp, "%hi16(", 6) == 0)
{
enum cgen_parse_operand_result result_type;
- bfd_vma value;
- const char *errmsg;
+ bfd_vma val;
*strp += 6;
errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16,
- & result_type, & value);
+ & result_type, & val);
if (**strp != ')')
return _("missing `)'");
(*strp) ++;
if (errmsg == NULL
&& result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
- {
- value >>= 16;
- }
+ val >>= 16;
+
+ value = val;
*valuep = value;
return errmsg;
}
@@ -1121,7 +1116,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
};
disassemble_info *info = dis_info;
int mask;
- int index = 0;
+ int reg_index = 0;
char* comma = "";
if (push)
@@ -1135,7 +1130,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
comma = ",";
}
- for (index = 1; index <= 7; ++index)
+ for (reg_index = 1; reg_index <= 7; ++reg_index)
{
if (push)
mask >>= 1;
@@ -1145,7 +1140,7 @@ print_regset (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
if (value & mask)
{
(*info->fprintf_func) (info->stream, "%s%s", comma,
- m16c_register_names [index]);
+ m16c_register_names [reg_index]);
comma = ",";
}
}