There are some small mistakes in the comment, also in the video
old: A = A - M - (1 - C) -> A = A + -1 (M - (1 - C)) -> A = A + (-M + 1 + C)
new: A = A - M - (1 - C) -> A = A + -1 (M + (1 - C)) -> A = A + (-M - 1 + C)
code is right, because
-M = +value + 1 ( value = fetched & 0x00FF )
A = A + (value + 1) - 1 + C
thank for your sharing, then I can learn this interesting thing.
There are some small mistakes in the comment, also in the video old: A = A - M - (1 - C) -> A = A + -1 (M - (1 - C)) -> A = A + (-M + 1 + C) new: A = A - M - (1 - C) -> A = A + -1 (M + (1 - C)) -> A = A + (-M - 1 + C)
code is right, because -M = +value + 1 ( value = fetched & 0x00FF ) A = A + (value + 1) - 1 + C
thank for your sharing, then I can learn this interesting thing.