I think that people out there can write small portions of code just to test various intructions and then if you put it all together you'll have such a test code. Myself I write such a small thingies to test if I'm thinking good about it's functionality in Michal Kowalski's 6502 simulator.
let's start with LDA: it affects only Z and C in that way:
lda #0 -> Z=1
lda #128 or higher -> N=1
CMP : if argument for cmp is greater than or equal to akku then C=1 N=0 else C=0 N=1 , if operand = akku then Z=1
live things:
LDA #20
CMP #20 -> C=1 , Z=1 , N=0
LDA #10
CMP #20 -> C=0 , Z=0 , N=1
LDA #20
CMP #10 -> C=0 , Z=0 , N=1
too bad somewhere I've had a chart which clearly showed which instructions affects bits in cpu's register but I just lost it. I have similiar thing in book but it's in polish
_________________
owns 1xC128, 1x128D cr ,1xc64 (broken unfortunately) ,1xc64c ,2xc64g (one is broken) ,~4xc64e ,1x1541 ,1x1541-II ,1x1541C and some chips for those machines
www.vulture.c64.org
www.rafalszyja.republika.pl