N bit wasn't getting set correctly in DIV in overflow cases

This commit is contained in:
Neil Webber 2023-10-10 21:04:01 -05:00
parent aa80882389
commit 1f4e566c9f

View file

@ -99,7 +99,7 @@ def op071_div(cpu, inst):
q, rem = divmod(dividend, divisor) q, rem = divmod(dividend, divisor)
q *= posneg q *= posneg
if q > 32767 or q < -32768: if q > 32767 or q < -32768:
cpu.psw_n = 0 cpu.psw_n = (q < 0)
cpu.psw_z = 0 cpu.psw_z = 0
cpu.psw_v = 1 cpu.psw_v = 1
cpu.psw_c = 0 cpu.psw_c = 0