/// DIVU/DIVS by zero: vector 5, stacking the next PC (UM 6.3.5; Table 8-14: 38+). /// /// The flags are undefined in PRM. The pinned corpus has no case (its /// issue #3); WinUAE's 68000 rule (`divbyzero_special`, T2) is used: /// DIVS clears N V C and sets Z; DIVU clears V C and sets N and Z from /// the high word of the dividend. pub(crate) fn divide_by_zero(&mut self, signed: bool, dividend: u32) -> Step { let mut ccr = self.sr & (0xFF00 | X); if signed { ccr |= Z; } else if dividend & 0x8000_0000 != 0 { ccr |= N; } else if dividend & 0xFFFF_0000 == 0 { ccr |= Z; } self.sr = ccr; self.exception(VECTOR_ZERO_DIVIDE, self.pc.wrapping_sub(2), 8, None, true) }