def _divide_by_zero(self, signed: bool, dividend: int) -> None: """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 (docs/undocumented-behavior.md). """ ccr = self.SR & (0xFF00 | X) if signed: ccr |= Z elif dividend & 0x80000000: ccr |= N elif not dividend & 0xFFFF0000: ccr |= Z self.SR = ccr self._exception(VECTOR_ZERO_DIVIDE, self._pc - 2, idle=8, by_instruction=True)