My aim was to increment a word length value in R17:R16 by a constant amount like this:
subi R16,-0x40 clr a adc R17,a
fails if, for example, R17:R16 holds 0x0140. I get 0x0280. How come R17 goes from 0x01 to 0x02? Turns out that the subi instruction sets the carry despite the minuend equalling the subtrahend and contrary to the Instruction Set manual (p153). What am I missing? Obviously easy to fix, but since there is no adi instruction, why not have subi work as expected?