1
0
mirror of https://github.com/KarolS/millfork.git synced 2025-01-11 12:29:46 +00:00

In case of overflows, dump stack

This commit is contained in:
Karol Stasiak 2019-07-31 23:36:22 +02:00
parent 31cbb3d42d
commit a1eef66e5c

View File

@ -199,6 +199,8 @@ class EmuZ80Run(cpu: millfork.Cpu.Value, nodeOptimizations: List[NodeOptimizatio
resetNMethod.invoke(cpu)
}
if (cpu.getSP.&(0xffff) < 0xd002) {
log.debug("stack dump:")
(0xD000 until 0xD0FF).map(memoryBank.output).grouped(16).map(_.map(i => f"$i%02x").mkString(" ")).foreach(log.debug(_))
throw new IllegalStateException("stack overflow")
}
// dump(cpu)