I have this function:
我有这个功能:
void run(int PC)
{
int A = 0, op = 0, arg = 0, i = 0;
char *xpress = NULL, *acode = NULL, strarg[CL_ARG_SIZE];
while (1)
{
printf("PC: %03x | A: %03i |", PC, A);
op = data[PC]; arg = data[PC+1];
PC += 2;
for (i=0 ; i<21 ; ++i)
if (op == opcode_table[i].op)
{
acode = opcode_table[i].mnemo;
sprintf(strarg, "0x%x", arg);
xpress = replace(opcode_table[i].instruct, "_", strarg);
break;
}
printf(" %s %x\t| %s \t", acode, arg, xpress);
step();
exec_instruct(op, arg, &A, &PC);
}
}
void run(int