Sunday, August 26, 2012

8085 microprocessor


Flags 

The ALU includes five flip-flops, which are set or reset after  an operation according 
to data conditions of the result in the accumulator and other registers. They are called 
Zero(Z), Carry (CY), Sign (S), Parity (P),  and Auxiliary Carry (AC) flags; they are 

listed in the Table and their bit positions in  the flag register are shown in the Figure 
below. The most commonly used flags ar e Zero, Carry, and Si gn. The microprocessor 
uses these flags to test data conditions. 
  
For example, after an addition of two numbers , if the sum in the accumulator id larger 
than eight bits, the flip-flop us es to indicate a carry  -- called the Carry flag (CY) -- is 
set to one. When an arithmetic operation  results in zero, the flip-flop called the 
Zero(Z) flag is set to one. The first Figure shows an 8-bit register, called the flag 
register, adjacent to the accumulator. However,  it is not used as a register; five bit 
positions out of eight are used to store the outputs of the five flip-flops. The flags are 
stored in the 8-bit register so that the programmer can examine these flags (data 
conditions) by accessing the register through an instruction. 

No comments:

Post a Comment