FLAGS REGISTER IN 8085
Flags are used to indicate the status of the result in the accumulator and other registers. In 8085, flag register has 8 flags but only 5 are implemented. They are
1. Z (Zero) flag
2. CY (Carry) flag
3. AC (Auxiliary) flag
4. S (Sign) flag
5. P (Parity) flag
These five flags are arranged as shown in the figure below
1. Z (Zero) flag
2. CY (Carry) flag
3. AC (Auxiliary) flag
4. S (Sign) flag
5. P (Parity) flag
These five flags are arranged as shown in the figure below
FLAG REGISTER IN 8085 |
1. ZERO FLAG
This flag indicates whether the result of the mathematical or logical unit is zero or not. If the result is zero then this flag is set (high), otherwise reset (low)
2. CARRY FLAG
This flag indicate whether, during addition or subtraction operation carry or borrow is generated or not, if generated then this flag bit is set.
3. AUXILIARY FLAG
It shows the propagation of the bit position 3 to the bit position 4. Consider the example shown below.
D7 | D6 | D5 | D4 | D3 | D2 | D1 | D0 | |
---|---|---|---|---|---|---|---|---|
First Number | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 |
Second Number | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 |
= | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 1 |
Here, a carry is generated from D3 position and propagates to the D4 position. This carry is called auxiliary carry.
4. SIGN FLAG
Sign flag indicates whether the result of any mathematical is negative or positive. If this result is positive, then this flag will reset (low) and if it is negative then it gets set (high). This bit is a replica of D7 bit.
5. PARITY FLAG
Parity means the number of '1s' in a number. If number of '1s' in a number is even, then that number is called as even parity number and if number of '1s' in a number is odd, then that number is called as odd parity number
This flag indicates whether the current result is of even parity (means this flag is high) or odd parity (low).
Thanks for reading.
FLAGS REGISTER IN 8085
Reviewed by Aadi stark
on
March 09, 2020
Rating:
No comments