Professional Documents
Culture Documents
Lecture 14-Software Architecture -Flag Register
Lecture 14-Software Architecture -Flag Register
Lecture 14-Software Architecture -Flag Register
● BRANCH : CSE
● CREDITS : 3
● IA: 30 MARKS
● LECTURE : 14
● BRANCH : CSE
● CREDITS : 3
● IA: 30 MARKS
● UNIT : 2
● LECTURE : 14
FLAGS :
• As we know that in 8085, mostly ALU Operations output stored in Accumulator. But sometime we want
• For Example: Let a student give exam and result declared . Now student does not emphasize on the
• So we can say that in 8085 we also have some status/condition of Output related to basic ALU
• These flags have critical importance in the decision-making process of the microprocessor.
• The conditions (set or reset) of the flags are tested through the software instructions. That’s why
it is considered in Software Architecture. User can also access this Flag Register by writing
Instruction for Carry Flag.
• For example, the instruction JC (Jump on Carry) is implemented to change the sequence of a
program when CY flag is set. The thorough understanding of flag is essential in writing assembly
language programs.
They are called Zero (Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags.
UNIT 2
LECTURE 14
• It is part of ALU
• The ALU includes five flip-flops, which are set or reset after an operation according to data
• They are called Zero(Z), Carry (CY), Sign (S), Parity (P), and Auxiliary Carry (AC) flags; their bit
• The most commonly used flags are Zero, Carry, and Sign. The microprocessor uses these flags
Auxiliary carry(AC):
• It is Flip which can be SET or RESET by ALU operation
• Store 1 Bit
• Indicate Condition of Output
• The Auxiliary Carry (AC) flag is used only for BCD operations where it represents the presence or
absence of carry from the 4th bit to 5th bit .
• Get affected by ALU Operation Result.
• If an operation performed in ALU generates the carry from lower nibble (D0 to D3) to upper nibble (D4
to D7) AC flag is set, else it resets. Or if during Execution of Operation, if Carry generated on D3 Bit
and transfer to D4 Bit than AC Flag Set.
Zero flag(z):
It is Flip which can be SET or RESET by ALU operation
Store 1 Bit
Indicate Condition of Output
Used in Searching a Number, as Counter etc .
UNIT 2
LECTURE 14
Sign flag(s):
• It is Flip which can be SET or RESET by ALU operation
• Store 1 Bit
• Indicate Condition of Output
• Used in defining the status of Signed Number Operation etc .
• Get affected by ALU Operation Result.
• If after ALU Operation of Signed Number & MSB bit =0 then the number is positive, else it is
negative.
•
UNIT 2
LECTURE 14
Parity flag(p):
• Store 1 Bit
• If the ALU result contains even no. of ones this flag is set and for odd no. of ones this flag is
reset.