Ex 1
Ex 1
-1
Aim:-
To study the microprocessor 8085 kit.
Objectives:-
1. To explain the architecture of the 8085.
2. To explain the classification of the instructions of the 8085.
3. To define the various addressing mode in the 8085 instruction set.
Theory:-
Architecture:-
The 8085 uses three sets of communication lines to perform these functions called Buses:
The Address Bus
The Data Bus
The Control Bus
The Address Bus:- It is a group of 16 lines generally identified as A0 to A15. The address bus is
unidirectional: bits flow in one direction i.e., from the MPU to peripheral devices. The address
bus is used to identify a peripheral or a memory location. The memory location is identified by
its address and the address bus is used to carry this 16 bit address. The total number of memory
locations in 8085 is 216 = 65,536 bits which when converted to kilobytes is 64 kb.
The Data Bus:-It is a group of eight lines used for data flow. These lines are bidirectional i.e.,
data flow in both directions between the MPU and memory and peripheral devices. The MPU
uses the data bus for transferring binary informations. The 8 bit data ranges from 00 to FF. The
8085 microprocessor is known as 8 bit microprocessor because it has 8 lines in data bus.
Control Bus:- The control bus is comprised of various single lines that carry synchronization
signals. The MPU uses such lines for providing timing signals. These are not group of lines like
address or data buses, but individual lines that provide a pulse to indicate an MPU operation. The
MPU generates specific control signals for every operation it performs.
Registers:-The 8085 has six general purpose 8-bit registers are B, C, D, E, H, and L to store data
and an accumulator to perform arithmetic and logical operations. They are combined as BC, DE,
HL to perform 16 bit operations. In addition to this Register array, two 16 bit registers viz. stack
register and program counter are provided.
Accumulator:-The accumulator is an 8-bit register (can store 8 bit data) that is a part of
arithmetic/logic unit (ALU). In general after performing logical or arithmetical operations, result
is stored in accumulator. Accumulator is also identified as Register A.
Flag Register:-ALU of 8085 have five flip flops whose states (set/reset) are determined by the
result data of other registers and accumulator. They are called as Zero, Carry, Sign, Parity and
Auxiliary-Carry flags.
Zero Flag (Z): When an arithmetic operation results in zero , the flip-flop called the Zero
flag - which is set to one.
Carry flag (CY): After an addition of two numbers, if the sum in the accumulator is larger
than eight bits, then the flip-flop uses to indicate a carry called the Carry flag – which is
set to one.
S-Sign (S): It is set to 1, if most significant bit of the result = 1; otherwise reset.
P-Parity (P): If the result has an even number of 1s, the flag is set to 1; for an odd number
of 1s the flag is reset.
Control Generator:- In microprocessor, the Control Generator generates a signal that executes
the operations in accordance to the decoded instructions. In fact it creates a signal (information)
which have details about connections between different blocks of the microprocessor so that data
reaches to the respective place.
Register selector:- Register selector is basically a logical controller which directs switching
between different registers of microprocessor.
Program Counter:-A program counter (PC) is a CPU register in the computer processor which
has the address of the next instruction to be executed from memory. It is a digital counter needed
for faster execution of tasks as well as for tracking the current execution point.A program
counter is also known as an instruction counter, instruction pointer, instruction address register
or sequence control register.
Stack Pointer:- It is a 16 bit register which holds the address of the top of the current stack
before the program counter goes to the interrupt service routine.
Fig(ii) PIN diagram of 8085 microprocessor
Serial I/O pins – SID (Serial Input Data), SOD (Serial Output Data)
These pins are used to interface 8085 with a serial device.
Interrupt Pins –TRAP, RST7.5, RST 6.5, RST 5.5, INTR, INTA
Vectored Interrupts are those which have fixed vector address (starting address of sub-
routine) and after executing these, program control is transferred to that address.
Vector Addresses are calculated by the formula 8 * TYPE
RST 5.5 2C H
RST 6.5 34 H
RST 7.5 3C H
For Software interrupts vector addresses are given by:
RST 0 00 H
RST 1 08 H
RST 2 10 H
RST 3 18 H
RST 4 20 H
RST 5 28 H
RST 6 30 H
RST 7 38 H
Non-Vectored Interrupts are those in which vector address is not predefined. The interrupting
device gives the address of sub-routine for these interrupts. INTR is the only non-vectored
interrupt in 8085 microprocessor.
Priority of Interrupts –
When microprocessor receives multiple interrupt requests simultaneously, it will execute the
interrupt service request (ISR) according to the priority of the interrupts.
TRAP Highest
RST 7.5
RST 6.5
RST 5.5
INTR Lowest
Instruction Classification:-
The function of a microprocessor system is implemented by a sequence of data transfers
between memory, processor and I/O devices and data transformations that occur in the registers
within the microprocessor, manipulating a register under program control addressing it and using
it for data transfer and transformation requires a set of binary codes which comprise the
INSTRUCTION SET OF A MICROPROCESSOR.
The 8085 instructions can be classified into the following five functional categories.
i) Data transfer (copy) operations.
ii) Arithmetic operations.
iii) Logical operations.
iv) Branching operations and
v) Machine-control operations.
Since data and instructions may reside anywhere in internal registers, external registers or
memory, locating them requires a particular addressing. The instructions in these five functional
groups can be categorized according to their method of addressing the hardware registers and
memory. This method is called the ADDRESSING MODE and six modes are available with
8085 which are explained in detail here,
i) Implied addressing
ii) Register addressing
iii) Immediate addressing
iv) Direct addressing
v) Register indirect addressing
vi) Combined addressing.
i. Implied Addressing:-
The instructions using this mode have no explicit operands. Examples include
This mode specifies the register or register pair that contains data. Both the source and
the destination operand are registers.
For example,
MOV B,C
Moves the contents of register C to register B.
For and 8-bit data, this mode uses 2 bytes, with the first byte as the OP code, followed by
1 byte of data. On the other hand, for 16-bit data, this instruction contain 3 bytes, with the
first byte as the OP code followed by 2 bytes of data. For example,
MVI B,05
Loads register B with the value 5 and
LXI H,2050
Loads H with 20 and L with 50.
LDA 2035.
This instruction loads accumulator with the contents of memory locations 2035. This
mode is also called the absolute mode.
This mode contains a register pair which stores the address of data( the higher-order byte
of the address in the first register of the pair, and low-order byte in the second). As an
example,
LDAX B
Loads the accumulator with the contents of a memory location addressed by B and C
register pair.