Chris-Johnston / Easier68k

Work In Progress - A Python M68k assembler and simulator.
https://chris-johnston.me/Easier68k/
MIT License
15 stars 6 forks source link

Added SUB and SUBQ #110

Closed bpas247 closed 6 years ago

bpas247 commented 6 years ago

Fixes #9 and fixes #10. ~Currently execution affecting the CCR correctly is the test that's failing, I'm having a difficult time determining when a borrow is generated (or cleared) for the 'C' bit.~

Chris-Johnston commented 6 years ago

Addresses issue ...

If you use the keyword Fixes #9 instead, you can automatically close the issue.

I'm having a difficult time determining when a borrow is generated (or cleared) for the 'C' bit.

So CMP actually does a subtraction to configure all of the CCR bits, and just doesn't set any output value. Here's how I determined it, which appears to be correct.

https://github.com/Chris-Johnston/Easier68k/pull/109/files#diff-44b3399ca2e2149c3826ea5f8601c354R119

bpas247 commented 6 years ago

@Chris-Johnston I edited my original comment to use Fixes instead of Addresses.

I have also found a fix for the 'C' bit of the CCR. All of the affected unit tests are now passing.

bpas247 commented 6 years ago

~I feel that this branch is completed. Is there anything else that should be done for this OPCODE?~

EDIT: Decided to also implement SUBQ.

bpas247 commented 6 years ago

I've finished my work for this branch, now awaiting review and approval.

bpas247 commented 6 years ago

@Chris-Johnston I removed the commented out lines in a previous commit, so everything should be up to date now. Is there anything else that should be done for these OPCODEs?

Chris-Johnston commented 6 years ago

LGTM, thanks for your hard work