Flag – Every bit has different functions
It is 8 bit register,
used to give information of nature of latest result which is obtained from
Arithmetic Logical Unit (ALU)
D7
|
D6
|
D5
|
D4
|
D3
|
D2
|
D1
|
D0
|
CY
|
AC
|
F0
|
RS1
|
RS0
|
OV
|
--
|
P
|
PSW.7
|
PSW.6
|
PSW.5
|
PSW.4
|
PSW.3
|
PSW.2
|
PSW.1
|
PSW.0
|
MSB
|
|
|
|
|
|
|
LSB
|
Bit D7 (Carry flag “CY”)
When carry is generated from MSB of ALU result, then
CY = 1 otherwise CY = 0
Bit D6 (Auxiliary flag “AC”)
When carry is generated from lower nibble ( i.e.
from D3 to D4) of ALU result, then AC = 1 otherwise AY = 0. It is used in BCD
operation.
Bit D5 (F0)
It is user defined flag, User can set / reset this
flag and assigned functions into it.
Bit D4 and D3 (RS1 and RS0)
This are register bank of select bit. They are used
to select any one bank out of 4 register bank at a time. If it is not select then
it default consider as Bank 0
RS1
|
RS0
|
Bank
Selected
|
0
|
0
|
Bank 0
|
0
|
1
|
Bank 1
|
1
|
0
|
Bank 2
|
1
|
1
|
Bank 3
|
Bit D2 (Overflow flag “OV”)
When
the value of result becomes more than destination, then the result cant be
stored and this is overflow, then OV = 1 otherwise OV = 0
Bit D1
It is unused bit.
Bit D0 (Parity Flag)
When parity of the result byte from ALU is even then
P = 1 otherwise P = 0
i.e
Even no of “1”s for P = 1
Odd no of “1”s for P = 0
No comments:
Post a Comment