Advertisements
Advertisements
Question
Draw a bit pattern of flag register of Intel 8085 and write the functions of any four flags.
Solution
1) A flag is a single bit status register (Flip-Flop).
2) Flags are either set or reset by ALU according to the result by ALU.
3) Flags are important because they are the conditions for conditional branching instructions.
4) 8085 has five flags. Sign flag, Zero flag, Auxiliary Carry flag, Parity flag and Carry flag. A 8-bit a register is used to represent five flags as shown in the following figure:
Where, S - Sign flag, Z - Zero flag, Ac- Auxiliary Carry flag, P - Parity flag, Cy-Carry flag.
- Sign flag (S): After the execution of arithmetic and logic operation, if the most significant bit of the result is 1, then the sign flag is set to 1 otherwise 0. This flag is used with a signed number. If MSB is 1, the number will be negative and if it is 0, the number will
be positive. - Zero flag (Z): After performing an arithmetic or logic operation, if the result is zero, then zero flag is set to 1, else it is reset. This flag is modified by the results in the accumulator as well as in other registers
- Parity flag (P): Parity flag is set to 1 if the result stored in accumulator contains even parity. i.e. even number of 1’s. If accumulator contains an odd number of 1’s, the flag is 0 i.e. Reset.
- Carry flag (Cy): This flag sets if carry produced by most significant bit during the execution of an arithmetic operation.In subtraction, carry flag serve as borrow flag.
shaalaa.com
Introduction to Microprocessors and Organization of 8085
Is there an error in this question or solution?