Organization of 8085 (Part 1)
Organization of 8085 (Part 1)
Com
DE
2) Register pair
3) Register pair HL
4) Program counter (PC)
5) Stack Pointer (SP)
STJC
CompJer S iene
ALU (Arithmetic Logic Unit):
The Arithm etic Logic Unit perfom s the computing functions. it is
closely associated with Accumu lator, Flag register an d Temporary Dala
register. Arithm etic and logical operations are main ly perform ed in the
ALU. The result is typically deposited in the Accumulator and the status of
the result is deposited in the
flag register.
TYOTI D.
General Purpose Registers:
There are SLX general purp0se registers present in 8085
m icroprOcessor. There nam es are B,C,D,E,H, & L.Through a program
programmer can use these registers. These registers can be used individually
as an8 bit register or two registers together as one 16 bit register but while
form ing pairs only following pairs are allowed BC, DE, & HL. The higher
byte is stored in right register for
byte is stored in left register and the lower
e.g. suppose a no. 153AH is to be stored in register pair BC then higher byte
1SH will get tran sferred in register B and 3AH will get tran sferred in reg ister
C. HL 16 egisterfunctions as a data pointerfeference mem ory address that
is eith er the source or destin ation in many operations. Mem ory location
HL register pair is called "M".
pointed by
D
H
Program Counter
It is a l6 bit register used to keep the track of the address of an
in stru ction in the mem ory that is to be executed. A program is a series of
in stru ctions stored in a memory. If the program is to be run successfully then
all the instructions must occur in corect sequence. PC holds the address of
the instruction to be executed and it autom atically increm ents during the
execution of the in stru ction so that at the end of the execution of the
in struction PC poin ts to the next address. Hence this register is also called a
m em ory pointer.
Sicrni IyorT L D
Instruction Register (IR)and Insiruction Decoder(D):
IR is an 8 - bit register and its only job is to hold instru ction, wh ich is
being exccuted, by the microprocessor. Whenever an in struction is fetched
from the memory address po inter pointed by PC, a copy of it is taken in to
IR The internal data bus does this. Afterward the execution of the
the
instruction begins. During the execution of the instru ction ID reads
contents of IR. The decoder tells Tim ing and Control unit exactly what is to
be done to carry out the instruction, accordingly the instru ction is executed
D Ds Ds D Da D D Do
LsZX Acl X1PX ICYI
SIGN
CARRY
ZERO PARITY
AUXILARY CARRY
1. CY (carry) Flag: Thisflag sets during arith metic operations such as
addition, subtraction elc. For example during addition of two numbers
FFH and 02H, the resultant answer is 101H, which can not be
accomm odated by an 8-bit accumulator. Hence whenever carry is
generated during arithm etic or logical operation CY flag bit sets to
T'. But if carry is not gen erated then CY flag bit rem ains in reset state
(logie 0')
CY flag acts as a borrow fla8 during subtraction, in dicating the
m inuend is less than the subtrahend if the fag is set.
2. P (parity) Flag: This flag tests for the number of "1' bits in the
answer gen erated in ALU. If the answer has even number of 1" and
0 , i t is said that even parily exist and the parity flag bit is set to ]
However if the accumulator holds an cdd number of1 and 0*" (called
odd parity), the parity flag resets to "0'
Ci nte
e.g. if the yesalt of the operatioi s
3tI0I10
Parity Flag will set to 1' as there are even number of 1*an d 0
4. Z (zero) Flag: This flag bit sets to 1' when the resul generated by a
certain operation is zero, an d rem ains in reset state wh en the result is
o n zero.
. S. S(sign) Flag - I t is set to the condition of most sign ificant bit of the
8ccumulator following the execution of arithm etic or logical
instru ctions. These instuctions use the MSB of data to represent the
sign of the number contained in the accumulator. Therefore set sign
flag represents a n egative number where as reset flag means a positive
number. In a given byte if D7" bit of the result is "l' sign flag sets to
the
1, aid the number is viewed as a negative number. *f it zero ,
- O TI D.D no
STJC
RST 5.5 RST 7.5 SID SOD
INTR
L t
Serial 1/0D
Ínterrupt Control
Control
3
PoP CExam ple)
PUSH 4
604
605
66 Nes availa ble
lo (otio n
SP
60& 6B -608
I6o 5C stab lo atjo
1604
w 604 C
16o jSP
N a iiae 605 2.71 34
l605 Oction
605 SP
RegB ReC
606
C 1606
1607 AB 607 AB
608 2A 608 2 A
609 609 18
Slack bé fore uSH operoflon Stack beforre
PoP operokion
RAB Re C Rs Re
603
1604
604 2 Nex gvala le Nel aikbk kokm
605
605 8B
C 6a6 16 06 SP
60 B
160SP 1607 AB
L602 6R 2A
609 TB l609
PUSH oFreti on Stack 4fter PaP opeahon
Slak ater