Skip to content

PHP/PLP flag setting possibly buggy #12

@migry

Description

@migry

I have now run a 6502 instruction test suite on my Acorn Atom simulator which uses code from this repo.

I found problems with the value returned by the PLP instruction, and got very confused as 0 was pushed with PHP and 0 was popped with PLP, but the testsuite expected $30. Search the 6502.org forum there are various postings about this, suggesting that the missing bit always returns '1' when PLP is executed, but PLP also returns '1' for the break bit, regardless of what was pushed, except in the case of hardware interrupts.

I modified PLP to set the Break and missing bit and the testsuite then ran fully.

This is probably a very low impact bug, and perhaps the author might want to do more research and consider a code change?

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