1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-07-05 10:28:58 +00:00

Tweaks divide-by-zero timing.

This commit is contained in:
Thomas Harte 2019-05-03 14:29:36 -04:00
parent 34fe9981e4
commit a0eb20ff1f

View File

@ -884,15 +884,21 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
Divisions.
*/
#define announce_divide_by_zero() \
active_program_ = nullptr; \
active_micro_op_ = short_exception_micro_ops_; \
bus_program = active_micro_op_->bus_program; \
\
populate_trap_steps(5, get_status()); \
bus_program->microcycle.length = HalfCycles(8); \
\
program_counter_.full -= 2;
case Operation::DIVU: {
// An attempt to divide by zero schedules an exception.
if(!active_program_->source->halves.low.full) {
// Schedule a divide-by-zero exception.
active_program_ = nullptr;
active_micro_op_ = short_exception_micro_ops_;
bus_program = active_micro_op_->bus_program;
populate_trap_steps(5, get_status());
program_counter_.full -= 2;
announce_divide_by_zero();
break;
}
@ -951,11 +957,7 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
// An attempt to divide by zero schedules an exception.
if(!active_program_->source->halves.low.full) {
// Schedule a divide-by-zero exception.
active_program_ = nullptr;
active_micro_op_ = short_exception_micro_ops_;
bus_program = active_micro_op_->bus_program;
populate_trap_steps(5, get_status());
program_counter_.full -= 2;
announce_divide_by_zero()
break;
}
@ -1005,6 +1007,8 @@ template <class T, bool dtack_is_implicit, bool signal_will_perform> void Proces
active_step_->microcycle.length = HalfCycles(cycles_expended * 2);
} break;
#undef announce_divide_by_zero
/*
MOVEP: move words and long-words a byte at a time.
*/