Skip to content

SBC mis-simulation (carry bit) #10

@migry

Description

@migry

I have used your code in a simulator project of mine which simulates the Acorn Atom home computer.

I tracked down some faulty behaviour to the first use of a SBC #immediate instruction, which was setting the carry bit incorrectly.

I tried an online interactive simulator just executing SBC #$3F and setting the initial value of A ($0D). It calculated that the carry would be clear whereas your code sets the carry.

I modified the code to calculate the new carry bit using code found in another simulator. This fixed the faulty behaviour, however the simulator has further problems possibly pointing to other issues. I will try a test suite next.

In summary the carry bit calculation for sbc_J appears to be buggy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accuracyThe emulator is not accuratebugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions