micro opt for div

This commit is contained in:
folkert van heusden 2022-03-23 17:52:59 +01:00
parent 80fe44ce85
commit 42fe341091

View file

@ -501,10 +501,12 @@ bool cpu::additional_double_operand_instructions(const uint16_t instr)
int32_t quot = R0R1 / divider;
uint16_t rem = R0R1 % divider;
// TODO: handle results out of range
setRegister(reg, quot);
setRegister(reg + 1, rem);
setPSW_n(R0R1 / divider < 0);
setPSW_n(quot < 0);
setPSW_z(quot == 0);
setPSW_v(quot > 0xffff || quot < -0xffff);
setPSW_c(false);