+2002-05-17 Andrey Volkov (avolkov@transas.com)
+
+ * compile.c: Change literal regnumbers to REGNUMS.
+ Fix instruction and cycles counting
+
2001-12-20 Kazu Hirata <kazu@hxi.com>
* compile.c: Fix formatting.
static int
get_now ()
{
-#ifndef WIN32
- return time (0);
-#endif
- return 0;
+ return time (0); /* WinXX HAS UNIX like 'time', so why not using it? */
}
static int
return X (OP_MEM, SP);
default:
- abort ();
+ abort (); /* ?? May be something more usefull? */
}
}
return t;
default:
- abort ();
+ abort (); /* ?? May be something more usefull? */
}
}
#endif
- cycles += code->cycles;
- insts++;
+ if (code->opcode)
+ {
+ cycles += code->cycles;
+ insts++;
+ }
+
switch (code->opcode)
{
case 0:
{
default:
abort ();
- case 8:
+ case CCR_REGNUM:
v = cpu.ccr;
break;
- case 9:
+ case PC_REGNUM:
v = cpu.pc;
break;
case R0_REGNUM:
case R7_REGNUM:
v = cpu.regs[rn];
break;
- case 10:
+ case CYCLE_REGNUM:
v = cpu.cycles;
longreg = 1;
break;
- case 11:
+ case TICK_REGNUM:
v = cpu.ticks;
longreg = 1;
break;
- case 12:
+ case INST_REGNUM:
v = cpu.insts;
longreg = 1;
break;