};
- struct ReturnException
- {
- };
-
-
#define PARAMS CpuState *state, uint8_t *pc, uint32_t cycle_count, void *dispatch_table_void
#define ARGS state, pc, cycle_count, dispatch_table_void
{
cycle_count += 1;
state->final_cycle_count = cycle_count;
- throw ReturnException();
+ return;
}
void op_add(PARAMS)
state->regs[X0] = param;
uint32_t cycle_count = 0;
void *dispatch_table_void = (void*)&dispatch_table[0];
- try
- {
- while(true)
- {
- uint8_t opcode = *pc++;
- dispatch_table[opcode](ARGS);
- }
+ uint8_t opcode = *pc++;
+ dispatch_table[opcode](ARGS);
- } catch(ReturnException ex)
- {
- return std::make_pair(state->regs[X0], state->final_cycle_count);
- }
+ return std::make_pair(state->regs[X0], state->final_cycle_count);
}
};
- struct ReturnException
- {
- };
-
-
#define PARAMS CpuState *state, uint8_t *pc, Flags flags, uint32_t cycle_count
#define ARGS state, pc, flags, cycle_count
{
cycle_count += 1;
state->final_cycle_count = cycle_count;
- throw ReturnException();
+ return;
}
void op_add(PARAMS)
state->regs[X0] = param;
uint32_t cycle_count = 0;
Flags flags = {0, 0};
- try
- {
- while(true)
- {
- uint8_t opcode = *pc++;
- dispatch_table[opcode](ARGS);
- }
+ uint8_t opcode = *pc++;
+ dispatch_table[opcode](ARGS);
- } catch(ReturnException ex)
- {
- return std::make_pair(state->regs[X0], state->final_cycle_count);
- }
-
+ return std::make_pair(state->regs[X0], state->final_cycle_count);
}
};
- struct ReturnException
- {
- };
-
-
#define PARAMS CpuState *state, uint8_t *pc, Flags flags, uint32_t cycle_count, void *dispatch_table_void
#define ARGS state, pc, flags, cycle_count, dispatch_table_void
{
cycle_count += 1;
state->final_cycle_count = cycle_count;
- throw ReturnException();
}
void op_add(PARAMS)
uint32_t cycle_count = 0;
Flags flags = {0, 0};
void *dispatch_table_void = (void*)&dispatch_table[0];
- try
- {
- while(true)
- {
- uint8_t opcode = *pc++;
- dispatch_table[opcode](ARGS);
- }
- } catch(ReturnException ex)
- {
- return std::make_pair(state->regs[X0], state->final_cycle_count);
- }
+ uint8_t opcode = *pc++;
+ dispatch_table[opcode](ARGS);
+ return std::make_pair(state->regs[X0], state->final_cycle_count);
}
};
- struct ReturnException
- {
- };
-
#define PARAMS CpuState *state, uint8_t *pc, bool flags_zero, bool flags_negative, uint32_t cycle_count, void *dispatch_table_void
{
cycle_count += 1;
state->final_cycle_count = cycle_count;
- throw ReturnException();
+ return;
}
void op_add(PARAMS)
bool flags_zero = false;
bool flags_negative = false;
void *dispatch_table_void = (void*)&dispatch_table[0];
- try
- {
- while(true)
- {
- uint8_t opcode = *pc++;
- dispatch_table[opcode](ARGS);
- }
-
- } catch(ReturnException ex)
- {
- return std::make_pair(state->regs[X0], state->final_cycle_count);
- }
+ uint8_t opcode = *pc++;
+ dispatch_table[opcode](ARGS);
+ return std::make_pair(state->regs[X0], state->final_cycle_count);
}