treated as signed for bit shifting purposes: */
#define FIELDD(word) (BITS (((signed int)word), 0, 8))
-#define PUT_NEXT_WORD_IN(a) \
- do \
- { \
- if (is_limm == 1 && !NEXT_WORD (1)) \
- mwerror (state, _("Illegal limm reference in last instruction!\n")); \
- a = state->words[1]; \
- } \
+#define PUT_NEXT_WORD_IN(a) \
+ do \
+ { \
+ if (is_limm == 1 && !NEXT_WORD (1)) \
+ mwerror (state, _("Illegal limm reference in last instruction!\n")); \
+ a = state->words[1]; \
+ } \
while (0)
#define CHECK_FLAG_COND_NULLIFY() \
#define CHECK_FIELD_A() \
do \
{ \
- fieldA = FIELDA(state->words[0]); \
+ fieldA = FIELDA (state->words[0]); \
if (fieldA > 60) \
{ \
fieldAisReg = 0; \
return "";
}
+static void my_sprintf PARAMS ((struct arcDisState *, char *, const char *,
+ ...));
+
static void
-my_sprintf (
- struct arcDisState * state,
- char * buf,
- const char * format,
- ...)
+my_sprintf VPARAMS ((struct arcDisState *state, char *buf, const char *format,
+ ...))
{
char *bp;
const char *p;
int size, leading_zero, regMap[2];
long auxNum;
- va_list ap;
- va_start (ap, format);
+ VA_OPEN (ap, format);
+ VA_FIXEDARG (ap, struct arcDisState *, state);
+ VA_FIXEDARG (ap, char *, buf);
+ VA_FIXEDARG (ap, const char *, format);
bp = buf;
*bp = 0;
while (1)
switch (*p++)
{
- case 0:
- goto DOCOMM; /* (return) */
+ case 0:
+ goto DOCOMM; /* (return) */
default:
*bp++ = p[-1];
break;
}
DOCOMM: *bp = 0;
+ VA_CLOSE (ap);
}
static void
strcpy (state->commentBuffer, comment_prefix);
else
strcat (state->commentBuffer, ", ");
- strncat (state->commentBuffer, state->comm[i], sizeof (state->commentBuffer));
+ strncat (state->commentBuffer, state->comm[i],
+ sizeof (state->commentBuffer));
}
}
}
instrName = instruction_name (state,
state->_opcode,
FIELDC (state->words[0]),
- & flags);
+ &flags);
if (!instrName)
{
instrName = "???";
if (!repeatsOp)
WRITE_FORMAT_COMMA_x (C);
WRITE_NOP_COMMENT ();
- my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldA, fieldB, fieldC);
}
else
{
WRITE_FORMAT_x (B);
if (!repeatsOp)
WRITE_FORMAT_COMMA_x (C);
- my_sprintf (state, state->operandBuffer, formatString, fieldB, fieldC);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldB, fieldC);
}
write_comments ();
break;
WRITE_FORMAT_x (A);
WRITE_FORMAT_COMMA_x (B);
WRITE_NOP_COMMENT ();
- my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldA, fieldB);
}
else
{
/* This address could be a label we know. Convert it. */
if (state->_opcode != op_LPC /* LP */)
{
- add_target (fieldA); /* For debugger. */
- state->flow = state->_opcode == op_BLC /* BL */
- ? direct_call
- : direct_jump;
- /* indirect calls are achieved by "lr blink,[status];
- lr dest<- func addr; j [dest]" */
+ add_target (fieldA); /* For debugger. */
+ state->flow = state->_opcode == op_BLC /* BL */
+ ? direct_call
+ : direct_jump;
+ /* indirect calls are achieved by "lr blink,[status];
+ lr dest<- func addr; j [dest]" */
}
strcat (formatString, "%s"); /* address/label name */
- my_sprintf (state, state->operandBuffer, formatString, post_address (state, fieldA));
+ my_sprintf (state, state->operandBuffer, formatString,
+ post_address (state, fieldA));
write_comments ();
break;
fieldB = fieldC;
WRITE_FORMAT_x_RB (C);
- my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldA, fieldB, fieldC);
write_comments ();
break;
else
WRITE_FORMAT_RB ();
}
- my_sprintf (state, state->operandBuffer, formatString, fieldA, fieldB, fieldC);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldA, fieldB, fieldC);
write_comments ();
break;
/* [B,A offset] */
if (dbg) printf("7:b reg %d %x off %x\n",
- fieldBisReg,fieldB,fieldA);
+ fieldBisReg,fieldB,fieldA);
state->_ea_present = 1;
state->_offset = fieldA;
if (fieldBisReg)
else
WRITE_FORMAT_RB();
}
- my_sprintf (state, state->operandBuffer, formatString, fieldC, fieldB, fieldA);
+ my_sprintf (state, state->operandBuffer, formatString,
+ fieldC, fieldB, fieldA);
write_comments2(fieldA);
break;
case 8:
static const char *
_auxRegName(void *_this ATTRIBUTE_UNUSED, int regval)
{
- return arcExtMap_auxRegName(regval);
+ return arcExtMap_auxRegName(regval);
}
static const char *
_condCodeName(void *_this ATTRIBUTE_UNUSED, int regval)
{
- return arcExtMap_condCodeName(regval);
+ return arcExtMap_condCodeName(regval);
}
/* Returns the name the user specified extension instruction. */
static const char *
_instName (void *_this ATTRIBUTE_UNUSED, int majop, int minop, int *flags)
{
- return arcExtMap_instName(majop, minop, flags);
+ return arcExtMap_instName(majop, minop, flags);
}
/* Decode an instruction returning the size of the instruction