mirror of
https://github.com/KarolS/millfork.git
synced 2024-08-30 19:29:42 +00:00
Flow analyser bugfixes
This commit is contained in:
parent
bc077d3ada
commit
e95d403752
@ -126,12 +126,12 @@ object Status {
|
||||
implicit class IntStatusOps(val inner: Status[Int]) extends AnyVal {
|
||||
|
||||
def bit0: Status[Boolean] = inner match {
|
||||
case SingleStatus(x) => SingleStatus((x & 1) == 0)
|
||||
case SingleStatus(x) => SingleStatus((x & 1) != 0)
|
||||
case _ => AnyStatus
|
||||
}
|
||||
|
||||
def bit7: Status[Boolean] = inner match {
|
||||
case SingleStatus(x) => SingleStatus((x & 0x80) == 0)
|
||||
case SingleStatus(x) => SingleStatus((x & 0x80) != 0)
|
||||
case _ => AnyStatus
|
||||
}
|
||||
|
||||
@ -251,20 +251,38 @@ case class CpuStatus(a: Status[Int] = UnknownStatus,
|
||||
m: Status[Boolean] = UnknownStatus,
|
||||
w: Status[Boolean] = UnknownStatus
|
||||
) {
|
||||
assert(a ne null)
|
||||
assert(ah ne null)
|
||||
assert(x ne null)
|
||||
assert(y ne null)
|
||||
assert(iz ne null)
|
||||
assert(z ne null)
|
||||
assert(n ne null)
|
||||
assert(v ne null)
|
||||
assert(c ne null)
|
||||
assert(d ne null)
|
||||
assert(m ne null)
|
||||
assert(w ne null)
|
||||
assert(a0 ne null)
|
||||
assert(a7 ne null)
|
||||
// assert(a ne null)
|
||||
// assert(ah ne null)
|
||||
// assert(x ne null)
|
||||
// assert(y ne null)
|
||||
// assert(iz ne null)
|
||||
// assert(z ne null)
|
||||
// assert(n ne null)
|
||||
// assert(v ne null)
|
||||
// assert(c ne null)
|
||||
// assert(d ne null)
|
||||
// assert(m ne null)
|
||||
// assert(w ne null)
|
||||
// assert(a0 ne null)
|
||||
// assert(a7 ne null)
|
||||
// (a, a7) match {
|
||||
// case (SingleStatus(o), SingleStatus(b7)) => if (o.&(0x80).!=(0).!=(b7)) {
|
||||
// println(a)
|
||||
// println(a7)
|
||||
// println(a0)
|
||||
// ???
|
||||
// }
|
||||
// case _ =>
|
||||
// }
|
||||
// (a, a0) match {
|
||||
// case (SingleStatus(o), SingleStatus(b0)) => if (o.&(1).!=(0).!=(b0)) {
|
||||
// println(a)
|
||||
// println(a7)
|
||||
// println(a0)
|
||||
// ???
|
||||
// }
|
||||
// case _ =>
|
||||
// }
|
||||
|
||||
override def toString: String = s"A=$a,B=$ah,X=$x,Y=$y,Z=$iz; Z=$z,N=$n,C=$c,V=$v,D=$d,M=$m,X=$w; A7=$a7,A0=$a0,NZ:$src"
|
||||
|
||||
|
@ -39,7 +39,7 @@ object FlowAnalyzerForTheRest {
|
||||
var currentStatus = c
|
||||
currentStatus = currentStatus.copy(n = Status.SingleFalse)
|
||||
if (currentStatus.src.isFromA) {
|
||||
currentStatus = currentStatus.copy(a7 = Status.SingleTrue)
|
||||
currentStatus = currentStatus.copy(a = currentStatus.a.flatMap(aa => if (aa.&(0x80)!=0) SingleStatus(aa) else AnyStatus), a7 = Status.SingleTrue)
|
||||
}
|
||||
currentStatus
|
||||
}),
|
||||
@ -47,7 +47,7 @@ object FlowAnalyzerForTheRest {
|
||||
var currentStatus = c
|
||||
currentStatus = currentStatus.copy(n = Status.SingleTrue)
|
||||
if (currentStatus.src.isFromA) {
|
||||
currentStatus = currentStatus.copy(a7 = Status.SingleFalse)
|
||||
currentStatus = currentStatus.copy(a = currentStatus.a.flatMap(aa => if (aa.&(0x80)==0) SingleStatus(aa) else AnyStatus), a7 = Status.SingleFalse)
|
||||
}
|
||||
currentStatus
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user