Closed cmarrin closed 1 month ago
Motorola tried to negate the formula from the description for an easier version, but then forgot to negate AND to OR.
The description is: ( NOT( Z ) and NOT( N xor V) ) = 1
Translated to a negated more readable formula: ( Z or ( N xor V ) ) = 0
So the errata is:
IFF [ Z ∨ [N ⊕ V] ] = 0 then PC' ← PC + TEMP
P.S.: A-15 = page 63 in the PDF
Btw BLE
is missing outer parenthesis too.
And usage of parenthesis differs for BLS
.
What shall we go for?
(
or square brackets [
? To me it looks like Motorola like squared ones more.Those changes would fit in the related pull request.
Yes I saw that too. But at least it has the right operators. I finally got my emulator working well enough for it to pass all the tests in test09.asm, a little test program I found somewhere (and I need to add to the list of things I’ve gotten from around the web). ~ChrisOn May 10, 2024, at 3:40 AM, Maddes @.***> wrote: Btw BLE is missing outer parenthesis too. And usage of parenthesis differs, see BLS.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
I'm fine with either parentheses. Do you want to open the issue?
In appendix A the descriptions of the branch condition for BGT is:
This is confusing. Is it saying (Z ∧ [N ⊕ V]) = 0 or Z ∧ ([N ⊕ V] = 0)? Either way it gives the wrong results. If all CC flags are zero it means that in the last test the result was neither zero nor negative, so the number is positive and it should take the branch. But both ways fails in this case.
This branch is the converse of BLE, which has the condition:
So it should be the same formula but where the result equals 0 rather than 1. So the right formula for BGT would be:
which implies parens around everything but the ' = 0'. But I think it would be more clear to add parens to both the BGT and BLE cases.