Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit the ISA, decide finally and debug/fix the existing software #57

Open
sy2002 opened this issue Aug 13, 2020 · 2 comments
Open

Revisit the ISA, decide finally and debug/fix the existing software #57

sy2002 opened this issue Aug 13, 2020 · 2 comments
Assignees
Labels

Comments

@sy2002
Copy link
Owner

sy2002 commented Aug 13, 2020

There are open questions that came up while Michael created the great and comprehensive new test_programs/cpu_test.asm. Some of them are described here: #53 (comment) and some of them are described here: #50, #40 and #37

The compromise solution for now is: On the emulator, Bernd already implemented the "non forgetting" SR register and we should also change the hardware accordingly, because this does not seem to break things: #53 (comment)

Still open are topics around the V flag, CMP semantics and other topics.

So this issue is about

  • Revisiting the ISA
  • Finally deciding the route
  • (Here comes the monster loose end): Debug/fix all the existing software, that relies on the "wrong" behaviour, for example of the V flag which is today simply implented as: "adding/subtracting two positive numbers and getting a negative result or adding/subtracting two negative numbers and getting a positive result"

As for the time of creating this issue, we already foresee, that the following might turn out into a large undertaking. So it is labled with "V1.7" as a placeholder for "not in V1.6 but later"

@sy2002 sy2002 added the V1.7 label Aug 13, 2020
MJoergen added a commit that referenced this issue Aug 14, 2020
* The SUB and SUBC instructions generate overflow (V) using a different
algorithm.
* The CMP instruction modifies V, N, and Z using a different algorithm,
and does not change C or X.

These changes should be considered for reverting in V1.7, see Issue #57.
@sy2002
Copy link
Owner Author

sy2002 commented Aug 15, 2020

As decided in our videochat, here is the way forward:

About Overflow

Change overflow handling to "correct behaviour", which is: Is written in the comment of the emulator and what is written here:

http://www.righto.com/2012/12/the-6502-overflow-flag-explained.html

Branch subroutine calls should not modify the status register (just as the hardware is doing right now in V1.6)

About Compare

Change compare to implement a SUB instruction without writing back the results.

**CAUTION: THESE CHANGES WILL BREAK ALL EXISTING SOFTWARE IN SUBTLE AND NOT SO SUBTLE WAYS - A LOT OF DEBUGGING REQUIRED **

@sy2002
Copy link
Owner Author

sy2002 commented Sep 19, 2020

Without having a debugging infrastructure, this one needs to go to 1.8

@sy2002 sy2002 added V2.0 and removed V1.7 labels Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants