First page Back Continue Last page Overview Text


The zero flag is used extensively in loop counting and bit checking code. In a loop count routine, a register or variable can be set to an initial value and decremented every time the code goes through the loop. The zero flag can be checked with every pass through the loop and an appropriate branch instruction can exit the loop when the looping is complete.

The negative flag is set to a one whenever the sign bit of a number is 1. Half-carry is typically used with BCD arithmetic and will not be addressed in this course.