What is the purpose of carry (c) flag and zero (z) flag?
Carry flag conatins the carry after addition or borrow after subtraction. This carry flag also shows error conditions, as dictated through some programs and procedures. And the Zero flag demonstrates that the result of a logical or arithmetic operation is zero. When Z=1, the result is zero; when Z=0, the result is not zero.