8085 Basics
8085 Basics
• As a CPU
• 8085 programing model
• 8085 pin diagram
• 8085 Architecture
As a CPU
• The microprocessor is a programmable device that takes in numbers, performs on
them arithmetic or logical operations according to the program stored in memory
and then produces other numbers as a result.
• Programmable device: The microprocessor can perform different sets of
operations on the data it receives depending on the sequence of instructions
supplied in the given program. By changing the program, the microprocessor
manipulates the data in different ways. –
• Instructions: Each microprocessor is designed to execute a specific group of
operations. This group of operations is called an instruction set. This instruction set
defines what the microprocessor can and cannot do.
• Takes in: The data that the microprocessor manipulates must come from
somewhere. • It comes from what is called “input devices”. • These are devices
that bring data into the system from the outside world. • These represent devices
such as a keyboard, a mouse, switches, and the like.
• Numbers: The microprocessor has a very narrow view on life. It only understands
binary numbers. A binary digit is called a bit (which comes from binary digit). The
microprocessor recognizes and processes a group of bits together. This group of
bits is called a “word”. The number of bits in a Microprocessor’s word, is a measure
of its “abilities”.
A microprocessor based system
Microprocessor consists of: –
Control unit: control
microprocessor operations.
ALU: performs data processing
function.
Registers: provide storage internal
to CPU.
Interrupts
Internal data bus
• In addition to the arithmetic & logic circuits, the ALU includes the accumulator, which
is part of every arithmetic & logic operation.
• ALU includes a temporary register used for holding data temporarily during the
execution of the operation
Programing model
REGISTERS
The Registers are of 8-bit & 16-bit size used for
different purposes
• A- Accumulator – This is an special purpose
register. All the ALU operations are
performed with reference to the contents
of Accumulator.
• B,C,D,E,H,L – General purpose registers.
These registers can also used for 16-bit
operations in pairs. The default pairs are BC,
DE & HL.
• F – Flag register – This register indicates the
status of the ALU operation.
D7 D6 D5 D4 D3 D2 D1 D0
S Z AC P CY
Sign Flag: It occupies the seventh bit of the flag register, which is also known
as the most significant bit. It helps the programmer to know whether the
number stored in the accumulator is positive or negative. If the sign flag is
set, it means that number stored in the accumulator is negative, and if reset,
then the number is positive.
Zero Flag:: It occupies the sixth bit of the flag register. It is set, when the
operation performed in the ALU results in zero(all 8 bits are zero), otherwise
it is reset. It helps in determining if two numbers are equal or not.
Auxiliary Carry Flag: It occupies the fourth bit of the flag register. In an
arithmetic operation, when a carry flag is generated by the third bit and
passed on to the fourth bit, then Auxiliary Carry flag is set. If not flag is reset.
This flag is used internally for BCD(Binary-Coded decimal Number)
operations.
Parity Flag: It occupies the second bit of the flag register. This flag tests for
number of 1’s in the accumulator. If the accumulator holds even number of
1’s, then this flag is set and it is said to even parity. On the other hand if the
number of 1’s is odd, then it is reset and it is said to be odd parity.
Carry Flag: It occupies the zeroth bit of the flag register. If the arithmetic
operation results in a carry(if result is more than 8 bit), then Carry Flag is set;
otherwise it is reset.
• PC – Program Counter – This is a 16-bit register used to
address the memory location from where an instruction is
going to be executed.
• SP – Stack pointer - This is a 16-bit register used to address
the top of the stack memory location.
• Temporary register, W & Z – These registers are only used by
8085 and are not available for the programmer.
• Address Bus (A15-A8 and AD7-AD0): The microprocessor 8085
has 16 bit address lines from A15-A8 and AD7-AD0. These
lines are used to transfer 16 bit address of memory as well as
8-bit address of I/O ports.
• Data Bus: The lower 8 lines (AD7-AD0) are often called as
multiplexed data lines.
Pin Diagram of 8085
40 pins classified into 6 groups:
1. Data bus
2. Address bus
4. Externally generated
5. Serial interface