N bit wasn't getting set correctly in DIV in overflow cases
This commit is contained in:
parent
aa80882389
commit
1f4e566c9f
1 changed files with 1 additions and 1 deletions
2
op07.py
2
op07.py
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue