int bit = 0;
int plen = 0;
static boolean init = 0;
- struct h8_opcode *q = h8_opcodes;
+ struct h8_opcode *q;
char CONST **pregnames = mode != 0 ? lregnames : wregnames;
int status;
int l;
status = info->read_memory_func (addr + l, data + l, 2, info);
/* Find the exact opcode/arg combo. */
- while (q->name)
+ for (q = h8_opcodes; q->name; q++)
{
- op_type *nib;
+ op_type *nib = q->data.nib;
unsigned int len = 0;
- nib = q->data.nib;
-
while (1)
{
op_type looking_for = *nib;
}
fail:
- q++;
+ ;
}
/* Fell off the end. */
return 1;
}
-static char *crname[] =
-{"sr", "ccr", "*", "br", "ep", "dp", "*", "tp"};
+static char *crname[] = { "sr", "ccr", "*", "br", "ep", "dp", "*", "tp" };
int
print_insn_h8500 (addr, info)
/* Error return. */
return -1;
-if (0) {
- static int one;
- if (!one )
- {
- one = 1;
- for (opcode = h8500_table; opcode->name; opcode++)
- {
- if ((opcode->bytes[0].contents & 0x8) == 0)
- printf("%s\n", opcode->name);
- }
- }
- }
+ if (0)
+ {
+ static int one;
+ if (!one)
+ {
+ one = 1;
+ for (opcode = h8500_table; opcode->name; opcode++)
+ {
+ if ((opcode->bytes[0].contents & 0x8) == 0)
+ printf ("%s\n", opcode->name);
+ }
+ }
+ }
- /* Run down the table to find the one which matches */
+ /* Run down the table to find the one which matches. */
for (opcode = h8500_table; opcode->name; opcode++)
{
int byte;
int qim = 0;
int i;
int cr = 0;
+
for (byte = 0; byte < opcode->length; byte++)
{
FETCH_DATA (info, buffer + byte + 1);
}
else
{
- /* extract any info parts */
+ /* Extract any info parts. */
switch (opcode->bytes[byte].insert)
{
case 0:
}
}
}
- /* We get here when all the masks have passed so we can output the
- operands*/
+ /* We get here when all the masks have passed so we can output
+ the operands. */
FETCH_DATA (info, buffer + opcode->length);
for (i = 0; i < opcode->length; i++)
{
func (stream, "#0x%0x:8", imm & 0xff);
break;
case PCREL16:
- func (stream, "0x%0x:16", (pcrel + addr + opcode->length) & 0xffff);
+ func (stream, "0x%0x:16",
+ (pcrel + addr + opcode->length) & 0xffff);
break;
case PCREL8:
func (stream, "#0x%0x:8",
}
}
return opcode->length;
- next:;
+ next:
+ ;
}
- /* Couldn't understand anything */
+ /* Couldn't understand anything. */
/* xgettext:c-format */
func (stream, _("%02x\t\t*unknown*"), buffer[0]);
return 1;
-
}