mirror of
https://github.com/KarolS/millfork.git
synced 2025-04-10 01:36:59 +00:00
Flow analyser should correctly analyse INC A and DEC A
This commit is contained in:
parent
2779671300
commit
081e3bc55c
src/main/scala/millfork/assembly/opt
@ -223,6 +223,10 @@ object CoarseFlowAnalyzer {
|
||||
currentStatus = currentStatus.copy(n = currentStatus.y.n(_ + 1), z = currentStatus.y.z(_ + 1), y = currentStatus.y.map(_ + 1))
|
||||
case AssemblyLine(DEY, Implied, _, _) =>
|
||||
currentStatus = currentStatus.copy(n = currentStatus.y.n(_ - 1), z = currentStatus.y.z(_ - 1), y = currentStatus.y.map(_ - 1))
|
||||
case AssemblyLine(INC, Implied, _, _) =>
|
||||
currentStatus = currentStatus.copy(n = currentStatus.a.n(_ + 1), z = currentStatus.a.z(_ + 1), a = currentStatus.a.map(_ + 1))
|
||||
case AssemblyLine(DEC, Implied, _, _) =>
|
||||
currentStatus = currentStatus.copy(n = currentStatus.a.n(_ - 1), z = currentStatus.a.z(_ - 1), a = currentStatus.a.map(_ - 1))
|
||||
case AssemblyLine(TAX, _, _, _) =>
|
||||
currentStatus = currentStatus.copy(x = currentStatus.a, n = currentStatus.a.n(), z = currentStatus.a.z())
|
||||
case AssemblyLine(TXA, _, _, _) =>
|
||||
|
@ -308,6 +308,10 @@ object QuantumFlowAnalyzer {
|
||||
currentStatus = currentStatus.mapRegisters(r => r.changeY(_ - 1)).changeNZFromY
|
||||
case AssemblyLine(DEY, Implied, _, _) =>
|
||||
currentStatus = currentStatus.mapRegisters(r => r.changeY(_ - 1)).changeNZFromY
|
||||
case AssemblyLine(INC, Implied, _, _) =>
|
||||
currentStatus = currentStatus.mapRegisters(r => r.changeA(_ - 1)).changeNZFromA
|
||||
case AssemblyLine(DEC, Implied, _, _) =>
|
||||
currentStatus = currentStatus.mapRegisters(r => r.changeA(_ - 1)).changeNZFromA
|
||||
case AssemblyLine(TAX, _, _, _) =>
|
||||
currentStatus = currentStatus.mapRegisters(r => r.copy(x = r.a).afterTransfer(RegEquality.AX)).changeNZFromX
|
||||
case AssemblyLine(TXA, _, _, _) =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user