1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-25 21:29:25 +00:00

Fix Z80 reverse flow analysis for CP

This commit is contained in:
Karol Stasiak 2018-07-03 01:45:58 +02:00
parent be04c9b195
commit e5ee32f7d6

View File

@ -216,14 +216,12 @@ object ReverseFlowAnalyzer {
currentImportance = currentImportance.butWritesRegister(ZRegister.A) currentImportance = currentImportance.butWritesRegister(ZRegister.A)
case ZLine(OR | AND, OneRegister(ZRegister.A), _, _) => case ZLine(OR | AND, OneRegister(ZRegister.A), _, _) =>
currentImportance = currentImportance.butReadsRegister(ZRegister.A) currentImportance = currentImportance.butReadsRegister(ZRegister.A)
case ZLine(AND | ADD | SUB | OR | XOR, OneRegister(s), _, _) => case ZLine(AND | ADD | SUB | OR | XOR | CP, OneRegister(s), _, _) =>
currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsRegister(s) currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsRegister(s)
case ZLine(ADC | SBC, OneRegister(s), _, _) => case ZLine(ADC | SBC, OneRegister(s), _, _) =>
currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsRegister(s).butReadsFlag(ZFlag.C) currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsRegister(s).butReadsFlag(ZFlag.C)
case ZLine(DAA, _, _, _) => case ZLine(DAA, _, _, _) =>
currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsFlag(ZFlag.H) currentImportance = currentImportance.butReadsRegister(ZRegister.A).butReadsFlag(ZFlag.H)
case ZLine(CP, OneRegister(s), _, _) =>
currentImportance = currentImportance.butReadsRegister(s)
case ZLine(INC | DEC | INC_16 | DEC_16, OneRegister(s), _, _) => case ZLine(INC | DEC | INC_16 | DEC_16, OneRegister(s), _, _) =>
currentImportance = currentImportance.butReadsRegister(s) currentImportance = currentImportance.butReadsRegister(s)
case _ => case _ =>