gslick: You just reminded me that CMP is basically a subtract operation, so the carry flag does come into play there, so thank you.
So if an ASL was done to kick bit 7 into the carry flag, then the accumulator gets overwritten with a new value, the carry flag should still ride on through with no change, right?
srb1954: That's what I meant - in the other code, I ended up changing out the LSR / BCC or BCS with BIT / BEQ or BNE as appropriate. Went a long way towards clarifying that code...
In this case, the only 68xx support chips I'm dealing with are the 6821 and 6840. Although the control registers are written to fairly frequently in this code, there doesn't seem to be much if any polling of the status registers. Good to know though.
Anyway, looking again at the code, there are only 16 instances of these two opcodes (compared to 50+ instances in the other code, most of which were for the aforementioned bit-shift / branch trick), so it may help if I just list them below:
BCC preceded by ASL THEN LDD: 1
BCS or BCC preceded by LSR: 3 (this is clearly testing current bit 0 - I may just swap that for BIT #$01 then BEQ or BNE as appropriate)
BCC preceded by EOR then BIT: 1
BCS preceded by CLC: 1 (Huh? At least I recognize what the routine it's in does, so I may just swap in the equivalent from the other code!)
BCC preceded by CMP: 4
BCS preceded by CPX: 1
BCS preceded by SBC: 1
BCC preceded by SUB: 1
BCC preceded by STD: 2
One other instance is preceded by a JSR (which itself immediately performs another JSR, so further analysis is needed)