Search found 3 matches

by modem
Fri Dec 30, 2022 7:41 pm
Forum: General Discussions
Topic: SBC and carry flag
Replies: 8
Views: 3888

Re: SBC and carry flag

barrym95838 wrote:
Don't peek unless you want to, but I offered something a few years back which seems to do the trick:

viewtopic.php?p=37758#p37758
Thanks Mike, that patch works beautifully in my fork of fake6502 and I'm happy to report that my simulator passes the test suite!
by modem
Thu Dec 29, 2022 5:52 pm
Forum: General Discussions
Topic: SBC and carry flag
Replies: 8
Views: 3888

Re: SBC and carry flag

Many thanks to all, those explanations were very helpful.

The bug in my thinking was that I was using twos-complement and carry rather than ones-complement.

The bug in my simulator is that it was using subtraction rather than faithfully reproducing what the real chips do. The value was pulled ...
by modem
Wed Dec 28, 2022 10:48 pm
Forum: General Discussions
Topic: SBC and carry flag
Replies: 8
Views: 3888

SBC and carry flag

I'm playing with Klaus2m5's 6502 test suite and have run in to some behaviour in the SBC tests that has me pulling my hair out. I'm running the tests in a simulator I've built around Omar's modified version of the fake6502 library.

A lot of confusion around ADC/SBC seems to be around the overflow ...