ALU of 8085 have five flip flops whose states (set/reset) are determined by the result data of other registers and accumulator.
They are called as Zero, Carry, Sign, Parity and Auxiliary-Carry flags.
- Zero Flag (Z): When an arithmetic operation results in zero , the flip-flop called the Zero flag - which is set to one.
- Carry flag (CY): After an addition of two numbers, if the sum in the accumulator is larger than eight bits, then the flip-flop uses to indicate a carry called the Carry flag – which is set to one.
- Sign (S): It is set to 1, if bit D7 of the result = 1; otherwise reset. D7 is the first digit of a binary number.
- Parity (P): If the result has an even number of 1s, the flag is set to 1; for an odd number of 1s the flag is reset.
- Auxiliary Carry (AC): In an arithmetic operation, when a carry is generated by digit D3 and passed to digit D4, the AC flag is set. Generally this flag is used internally for Binary Coded Decimals (BCD).
Figure shows a 8-bit flag register, adjacent to the accumulator. It is not used as a register. Out of eight bit-positions, five positions are used to store the outputs of five flip-flops.
Some of the arithmetic operations are -
- ADD : Add
- ADI : Add Immediate
- SUB : Subtract
- SUI : Subtract Immediate
So all of the given options will be correct.