logoalt Hacker News

HarHarVeryFunnytoday at 12:01 PM1 replyview on HN

The 6502 doesn't support XOR A or SUB A, and in fact doesn't have a SUB opcode at all, only SBC (subtract with carry, requiring an extra opcode to set the carry flag beforehand).


Replies

flohofwoetoday at 1:07 PM

I was handwaving over the details, SBC is identical to SUB when the carry flag is clear, so it's understandable why the 6502 designers didn't waste an instruction slot.

EOR and SBC still have the same cycle counts though.

show 1 reply