ADC and SBC both add the carry flag to the sum. So ADC #0 will either leave A as it is, or add 1 to it, and SBC #0 will either subtract 1 or leave A unchanged. Without seeing the code you're looking at, my guess would be that these instructions follow other ADC or SBC instructions, and are used to add an 8 bit value to a 16 bit value, like this:
Code: Select all
lda result
clc
adc value
sta value
lda result+1
adc #0
sta result+1
to add 8 bit value to 16 bit result, or
Code: Select all
lda result
sec
sbc value
sta value
lda result+1
sbc #0
sta result+1
to subtract 8 bit value to 16 bit result.
The carry flag is used to handle the carry between individual bytes of a larger addition or subtraction. ADC and SBC always use the carry flag: there is no ADD or SUB instruction. So it's normal to start an addition with either CLC (for addition) or SEC (for subtraction) to say that there is no carry into the lowest byte.
The reason that you start with C=1 for subtraction is that it's actually an addition in disguise: rather than implementing another circuit to do the subtraction directly, it uses the addition circuit. To subtract, negate the second operand and then add it. To negate in two's complement you invert every bit and then add one. And rather than having more circuitry to add one, you do that by starting a subtraction with the carry flag set.
If CPA is meant to be "compare A", in line with CPX and CPY, then it does exist: it's called CMP.