The Functional Block Diagram of 8085A Is Shown in Fig.4.1
The Functional Block Diagram of 8085A Is Shown in Fig.4.1
INTERRUPT
SERIAL I/O
(Internal Bus) 8 8
8 8
8 8 8
8 8
B(8) C(8)
FR(S) IR(8)
D(8) E(8)
A(S) TR(S)
8 H(8) L(8)
INTERRUPTION
8
8 DECODER&
M/C ENCODER PC(16)
ALU
SP(16)
8
8
W(8) Z(8)
OUTPUT SIGNALS
16 (AB)
8
8
D7-D0
A15-A8 A7-A0
8 8
Timing and control 8
Unit
ADDER BUFFER ADDERR/DATA BUFFER
X1
CLK STATUS CONTROL
CKT
X2 SIGNALS
8
8
A15-A8 AD7-AD0
HLDA RESET IN
CLK (OUT) S1 ALE WR
The figure shown does not include the control signals driving
internal registers.
Flags register:
The ALU influences a number of flip flops called flags which
store information related to the results of arithmetic and logical
operations. Taken together this flags constitute a flag register.
Flag register is an 8-bit register accessible to the user through
instruction. Each bit in the flag register has a specific function. Only 5
bits out of 8 bits are used as shown below:
D7 D6 D5 D4 D3 D2 D1 D0
S Z X AC X P X CY
The three crossed bit are redundant bits and not used. They
can be either ‘0’ or ‘1’ but normally they are forced to be zero. The
other five bits are affected as a result of execution of an instruction.
All instructions do not affect these flags e.g. data transfer operation
do not affect these flags. The meaning and the effect of these flags
are as follows.
Example 1:
Let us consider the execution of the instruction ADD B.
ADD is the mnemonic for addition. The first operand is known to exist
in the accumulator (Reg. A). Register B contains the second operand.
The meaning of the instruction is add the contents of the B register to
the contents of A register and store the result back in the accumulator
(A). Symbolically we can write,
(A) (A) + (B)
Let as suppose the register contents are (A) = 9BH, (B) = A5H
before the execution of the instruction. It means,
(A) = 9BH → (1001 1011)2
(B) = A5H → (1010 0101)2
ADD B = (A+B) → (0100 0000)2
As a result of addition, there is a carry from b3 to b4 position and
therefore AC is set. Also there is a carry from the MSB out and,
therefore, CY flag is also set. Soon after the execution of ADD B
instruction the accumulator contains (A) = (0100 0000)2 = 40H and is
non-zero. Therefore Z flag is reset to zero. Also, result contains only
one ‘1’, an odd number. Therefore, parity bit is also be reset to zero.
Since the MSB of the result is zero, therefore the sign (S) bit is also
reset. Thus the flag register, soon after the execution of the
instruction, contains (0001 0001)2 = 11H.
Example 2:
Let us consider the execution of another instruction SUB B.
SUB is the mnemonic for subtraction. Accumulator consists of first
operand. Register B contains the second operand. The meaning of
the instruction is subtract the contents of the B register from the
contents of A register and store the result back in the accumulator
(A). Symbolically we can write,
(A) (A) - (B)
Let as suppose the register contents are (A) = A5H, (B) = 9BH
before the execution of the instruction. It means,
Before execution A = A5H and B = 9BH
(A) = 1010 0101 → (1010 0101)2
(B) = 1001 1011 2’s complement → (0110 0101)2
Carry 1 (0000 1010)2
Since result is non zero, therefore, Z bit is ‘0’. Sign bit is also ‘0’
because MSB of the result is ‘0’. AC is also ‘0’ because in addition
(2’s complement), there is no carry from b3 to b4. Parity bit is ‘1’ (2
ones). CY bit seems to be ‘1’. But it is complemented and then
stored. Therefore, CY bit is stored as ‘0’. It also indicates that (A) is
having larger number than register (B), otherwise smaller one. Thus
the flag register, after the execution of the instruction, contains (0000
0100)2 = 04H.
Let us consider (A) is having 9B H and (B) is A5 H before execution.
(A) = 1001 1011 → (1001 1011)2
(B) = 1010 0101 2’s complement → (0101 1011)2
Carry 0 (1110 0110)2
Therefore, in this case, the flag bits will be S=1, Z=0, AC=1, P=1,
CY=1 (complement of ‘1’ obtained in addition). Thus the flag register,
after the execution of the instruction, contains (1001 0101)2 = 95H.