You are on page 1of 12

1.1 INTRODUCTION (Ref1: Section 1.

1)
Microprocessor is a programmable integrated circuit that can process binary data. Each
specific task that it can perform is triggered by providing a predefined unique instruction.
The list of all instructions of a microprocessor is called its instruction set. It processes the
given data based on the user specified sequence of instructions called program and
outputs are generated accordingly. Primary specification of a processor is the number of
data bits (word length) it can handle at a time. Initial prototypes had 4-bit capability. After
successive upgradation over the time, the latest versions are capable of handling 64-bIts
data.
Microprocessor needs various supportive components such as interface for input / output
device, memory etc. to function as a meaningful system. However, there is another
version of microprocessor which includes all such components within the chip itself so that
the single IC is a complete system. Such a processer is called microcontroller.
Microprocessor can be used to perform all the necessary processing for a computer. The
computers which use a microprocessor as their CPU are called microcomputers. Various
computing systems such as desktops, laptops, netbooks etc. belong to this category and
are mostly used for personal purposes. In higher end computers, single chip processor is
insufficient to handle enormous computational requirements and hence they adopt
different strategies.
1.2 EVOLUTION OF MICROPROCESSORS (Ref1: Section 1.1.1)
1.3 MICROPROCESSOR BASED SYSTEM (Ref1: Section 1.1.2)
Figure below shows the simplified structure of a microprocessor-based computer. It
includes three components: microprocessor, I/O subsystem and memory. These
components are organized around a common communication path called a bus.

MICROPROCESSOR
It is a clock driven semiconductor device capable of performing various computing
functions and making decisions. The microprocessor may be further divided into three
segments: ALU, register array and control unit.
a) Arithmetic and Logic Unit
This is the section in microprocessor where various computing functions are
performed on data such as addition, subtraction, AND, OR etc.
b) Register array
It is the collection of registers used primarily for storing data temporarily during
program execution. They are accessible to the user through instructions.
c) Control unit
It provides the necessary timing and control signals to all operations in the system.
It controls the flow of data between the processor and peripherals.
MEMORY
The memory stores instructions and data in binary format and provides that information
to the microprocessor for program execution. Results are stored back in memory for future
use. The memory block consists of two sections: read only memory (ROM) and read /
write memory popularly known as RAM. The ROM stores programs that do not need
alterations. User programs and data are stored in RAM.
I/O SUBSYSTEM
It communicates with the outside world and includes input devices such as keyboard,
switches, ADC etc. and output devices such as CRT, printer, LEDs etc. The I/O devices are
commonly known as peripherals.
SYSTEM BUS
The system bus is a group of wires used as a communication path between microprocessor
and peripherals. It can be considered as a combinations three buses: address bus, data
bus and control bus.

1.4 COMPUTER LANGUAGES (Ref1: Section 1.2, Ref2: Section 0.3)


There could be three types of languages in relation with a computer: machine language,
assembly language and high-level language.
1.4.1 Machine language
A machine with word length of 8 bits can have 28 (i.e. 256) combinations possible. The
design engineers select certain such combinations and gives a specific meaning to them
by using electronic logic circuits. These patterns are known as instructions. Each processor
will have its own set of instructions. In machine language programming, user gives the
specific binary instruction for performing desired functionality. For convenience, these
instructions are represented in the equivalent hexadecimal form.
1.4.2 Assembly language
Since it is cumbersome for users to program in machine language, manufactures have
devised symbolic English-like words to represent machine language instructions. They are
called mnemonics. The mnemonic for an instruction is prepared such that it hints the
actual functionality. For example, ADD for addition, INR for increment etc. The mnemonics
may be different for various processors.
Mnemonics have two parts in general: opcode and operand. The opcode indicates the
functionality of the mnemonic and operand represents the data on which the operations
is to be performed.
Since the processors understand only machine language, mnemonics should be translated
into binary before execution. It may be carried out either manually or using software. In
manual procedure, the user first write the assembly language program, obtain the
corresponding binary instructions and feed into the machine. In the second method,
translation is handled by an inbuilt software in the system called assembler.
1.4.3 High level language
The machine language and assembly language are considered as low level languages and
are processor dependent. To circumvent this limitation, high level languages such as
BASIC, C, C++ etc. have been devised in which symbols and conventions are drawn from
English. Instructions in these languages are known as statements. Programs written in
high level languages are transferable across the machines having different
microprocessors.
High level language programs should be converted into binary instructions for the
processor to understand. This task is handled by software called compiler / interpreter.
They accept English-like statements as the input and translate them into binary
instructions compatible with the microprocessor used in the system. During the
translation, one statement may need multiple machine language instructions for proper
representation.
1.5 8085 MICROPROCESSOR MODEL (Ref1: Section 2.1)
A microprocessor can be represented in terms of its hardware model and programming
model. The hardware model consists of the physical electronic components and
programming model summarizes the information needed for writing programs.
1.5.1 Hardware Model
The hardware model of 8085 microprocessor shows two major sections: One section
includes the ALU, an 8-bit register called accumulator, instruction decoder and flags. The
second segment shows 8-bit and 16-bit registers.

Arithmetic and logic operations are performed in the ALU. Results are stored in the
accumulator and flags are set or reset to reflect the nature of results. Both sections are
connected using multi-wired internal connections called system bus. The system bus
consists of three components: 16-bit address bus, 8-bit data bus and control bus. The
address bus is used to send out the memory address, data bus to transfer data
bidirectionally and the control bus for handling timing signals.

1.5.2 Programming Model


Programming model does not reflect the physical structure of the processor but includes
the information that is critical for writing assembly language programs. The model
includes six general purpose registers, accumulator, flag register, stack pointer and
program counter.

Registers: 8085 microprocessor has six general purpose registers of 8-bit size viz. B, C,
D, E, H & L. They can also be used as register pairs BC, DE and HL to handle 16-bit values.
Accumulator: It is an 8-bit register and a part of ALU. It is used for performing arithmetic
and logical operations. It is denoted as register A.
Flags: They are individual flip flops which are set or reset as per the result of an operation.
8085 has five flags viz. Zero (Z), Carry (CY), Sign (S), Parity (P) and Auxiliary Carry (AC).
They are placed at specific bit positions of an 8-bit flag register.

Flags have critical importance in the decision-making process of the microprocessor. The
condition (set or reset) of the flag may be tested using appropriate instructions to decide
further course of action.
Program Counter (PC): it is a 16-bit register used to hold the address of the next
instruction to be executed. When one fetching is ongoing, PC is incremented by 1 to point
to the address of next fetching.
Stack Pointer (SP): It is a 16-bit register used as a pointer for the top of stack memory.
It is modified each time a data is written into or read from the stack.
1.6 8085 PROGRAMMING
1.6.1 Addressing Modes (Ref2: Section 0.9.2)
Operand indicates the data on which specified operation is to be performed by the
processor. It could be provided in three ways: data may be in a register, memory location
or included in the instruction itself. Addressing mode implies the way in which an operand
is presented for execution. There are five addressing modes in 8085 processor: register
addressing, direct addressing, immediate addressing, indirect addressing and implied
addressing.
Register addressing: all the operands are registers. eg: MOV A, B; ADD C.
Direct addressing: operand is a memory location and its address is mentioned in the
instruction. eg: STA address; LDA address.
Immediate addressing: source operand is a data of 8 /16-bits and is included in the
instruction itself. eg: MVI B, data; ORI data
Indirect addressing: One of the operand is a memory location and indirectly specified. i.e.
instead of providing the address directly, it is loaded into a 16-bit register pair and its
name is mentioned in the instruction. eg. MOV C, M; STAX B.
Implied addressing: Operands are obvious from the opcode itself and will not be
mentioned specifically. eg. CMA; STC
1.6.2 Instruction Set Classification (Ref1: Section 2.2)
An instruction is a binary pattern implemented inside a microprocessor to perform a
specific function. The list of all instructions, called instruction set, shows what functions a
processor can perform. The 8085 instruction set consists of 74 basic instructions and
considering all variations, total number of instructions in the set is 246. The instructions
are classified into five functional categories: data transfer, arithmetic, logical, branching
and machine control.
Data transfer (copy): This group of instructions copies data from one location (source) to
another (destination) without changing the source contents. Flags bits are not affected
during the process. The data transfer can be of following types:
a) between two registers (eg: MOV A, B)
b) between memory location & register (eg: LDA address, MOV C, M)
c) specific data byte to a register / memory location (eg: MVI D, data)
d) between an I/O device & accumulator (eg: IN port address, OUT port address)
Arithmetic: This group of instructions performs arithmetic operations such as addition,
subtraction, increment and decrement. One of the operands will be the accumulator for
addition / subtraction operations. (ADD H, INR E, SUI Data)
Logical: These instructions perform logical operations such as AND, OR, XOR, Rotate,
Compare and Complement. For all logical instructions, one operand will be the
accumulator. (ANA D, ORI Data, CMP L)
Branching: This group of instructions alters the sequence of program execution either
conditionally or unconditionally. They include functions like Jump, Call, Return and Restart.
(JZ address, JNC address, CALL address)
Machine Control: These instructions control machine functions. They are Halt, Interrupt
and No Operation. (HLT, EI, DI, NOP)
Note: The size of an instruction may vary between 1-3 bytes. Instructions that mention
an 8-bit data are two byte long while those consisting of 16-bit data/address are 3-byte
type. All other instructions belong to 1-byte type.

1.6.3 Overview of Instruction Set (Ref1: Section 2.5)


1.6.4 Simple Programs
Program to find out the largest in a set of 5 numbers
MVI C, 04H; Count value given must be one less than the total numbers.
LXI H, 1000H
MOV A, M
Repeat: INX H
CMP M
JNC Here
MOV A, M
Here: DCR C
JNZ Repeat
STA 2000H
HLT

1.6.5 Integrated Development Environment (IDE) (Ref1: Section 11.2-11.4)


Assembly language program for an 8085 system can be developed in a Windows PC using
the outlined steps:
1. Editing: Writing the assembly language program.
2. Assembling: Converting the mnemonics into object code.
3. Linking: Creating an executable binary code out of the program.
4. Simulation: Verifying the program execution.
5. Debugging: Troubleshooting the program.

The IDE is a collection of software tools that enables the user to develop programs for the
desired processor.
EDITOR: It allows the user to enter, modify and store a group of text under a file name.
The process is known as editing. Editors are of two types: line editors (such as Notepad)
work with one line at a time and full screen editors (word processors such as MS-Word)
manage a full screen of information at a time. While saving the program for 8085, it must
be given file extension .asm so that it can be recognized by the subsequent tools. The file
thus generated is called source code.
ASSEBLER: It is the tool that translates source code into binary code form and generates
object file. This function is similar to hand assembly, in which user looks up the code for
each mnemonic in the list. Assembler also perform related functions such as error checking
and memory address allocation. Together with object file, assembler also generates a list
file and a HEX file. The former is for documentation purpose and latter will be downloaded
to the target system at the end of the development cycle.
While using assembler, it is to be noted that the target system and program development
PC must have same processor. However, cross-assembler is an assembler that can
generate the object code for desired processor while working on a system with different
processor. i.e. if a Pentium based PC to being used to develop the program for an 8085
system, then cross-assembler is required for the process.
LINKER: It accepts the object file and generates an executable file in binary code.
SIMULATOR: It enables the user to execute the generated program in PC without having
the target system so that the program can be verified. There may also be facilities to
observe intermediate results.
DEBUGGER: It allows the user to test and debug the program file. Following functions are
usually possible in debugging:
• Make changes in program file
• Examine and modify memory contents
• Set breakpoints and display register contents
• Trace the program execution one instruction at a time
• Disassemble the program
Note: After the development process, the binary code (HEX file) of the program is
transferred to the target system. Once downloaded, the program can be executed in the
target system independently.

1.7 MICROPROCESSOR OPERATIONS (Ref1: Section 3.1)


Microprocessors can be programmed to perform various functions on given data by
selecting appropriate instructions. These instructions are given to the processor in a
sequence by writing into its memory. The processor reads one instruction at a time,
decodes it and perform corresponding data manipulation. Results may either be stored in
memory or sent to output devices. In addition, it can respond to a variety of external
signals. The functions performed by the microprocessors can be classified into three
categories:
1. Microprocessor-initiated operations
2. Internal operations
3. Peripheral (externally-initiated) operations
1.7.1 Microprocessor-initiated operations and 8085 Bus organization
Microprocessor performs primarily five operations.
1. Memory Read: Read data / instruction from memory
2. Memory Write: Writes data into memory
3. I/O Read: Accepts data from input device
4. I/O Write: Sends data to output device
5. Acknowledging a peripheral request
All these operations are part of the communication process between MPU and peripheral
devices / memory. For this process, MPU needs to perform following steps.
Step 1: Identify the peripheral / memory location with its address
Step 2: Transfer binary information (data / instruction)
Step 3: Provide timing / synchronization signals
The 8085 MPU performs these functions using three sets of communication lines called
buses: address bus, data bus and control bus. They are together known as system bus.

Address bus: It is a group of 16 lines identified as A15 – A0 providing unidirectional


communication from MPU to peripherals. Address bus is used to perform step1.
In a computer system, each peripheral or memory location is identified by a binary
number called address and it is sent via the address bus. Number of address bus lines
determine the number of memory locations that the processor can handle. The 16-bit
address bus in 8085 microprocessor provides a maximum capability of handling 216
(65536= 64K) memory locations. Assuming one byte size for a location, it can be stated
that 8085 processor has 64KB memory capacity.
Note: Intel 8086 has 20 address lines while Pentium has 32 address lines.
Data bus: It is a group of 8 lines identified as D7-D0 providing bidirectional data flow MPU
and peripheral devices / memory. The MPU perform step2 using data bus.
The eight-line data bus enables the MPU to handle any 8-bit data out of 256 possible
numbers ranging from 00 to FFh (0 to 25510). Hence, 8085 is known as 8-bit
microprocessor.
Note: Intel 8086 has 16 data lines and 80486 has 32 data lines.
Control bus: It is composed of various single lines that carry synchronization signals. The
MPU uses such lines to perform step3.
Control bus is not a group of lines like address or data bus, but individual lines that provide
a pulse to indicate an MPU operation. The MPU generates specific control signals for every
primary operation (read / write) it performs. These signals are used to identify a device
type (peripheral / memory) with which the MPU intends to communicate.
NOTE: To read a memory location, MPU places the 16-bit address on the address bus. The
address is decoded and corresponding memory location is identified. Then MPU sends a
Memory Read pulse as the control signal to activate the memory chip. Now the contents
of the location (8 bit) are placed on the data bus and brought to the processor.

1.7.2 Internal data operations


The internal architecture of the processor determines how and what operations can be
performed with the data. These operations are:

1. Store 8-bit data (in registers)


2. Perform arithmetic / logic operations (using ALU and Accumulator)
3. Test for conditions (using flag bits)
4. Sequence the execution of instructions (using Program Counter)
5. Stack operations during execution (using stack Pointer)
To perform these operations the processor needs registers, ALU, Control logic and control
buses.
1.7.3 Peripheral (Externally-initiated) operations
External devices can initiate following operations for which specific pins of microprocessor
chip are assigned:
1. Reset: To reset all registers and suspend all internal operations.
2. Interrupt: To force the processor to hold the normal execution and perform urgent
functions. On completion, the processor resume the interrupted execution. Stack
memory is utilized in this process.
3. Ready: To force the processor to enter into wait state. It is used primarily to
synchronize the slow peripherals with the processor.
4. Hold: To force the microprocessor to relinquish the control of system bus to another
controller device such as DMAC.
1.8 8085 MICROPROCESSOR
1.8.1 Pin configuration and functions (Ref1: Section 4.1.1)

8085 Pin diagram


8085 schematic
diagram
1.8.2 Demultiplexing the bus AD7-AD0 (Ref1: Section 4.1.3)
The signal lines AD7-AD0 in 8085 serve dual purpose. They are used as low-order address
bus as well as the data bus. i.e. the signal lines will contain the address of the peripheral
in the first part of the reading / writing cycle and data byte in the second part. This is
known as multiplexing the bus. Therefore, the address information must be preserved
separately and this process is called latching.

The 8085 processor is provided with an 8-bit latch IC74LS373 for holding the low-order
address and is controlled by ALE signal. The bus AD7-AD0 is connected to the input of the
latch IC and ALE is connected to its ENABLE pin. At the beginning of the reading / writing
cycle, ALE is high and the latch is transparent. i.e. the output changes with the input.
Therefore, the low-order address will be at its output. Later, ALE is made low, the address
value will be held in the latch and continue to be available at its output. Further changes
at the input will not affect its output. Another set of connections attached to AD7-AD0 bus
facilitates the transfer of data byte.
Note: Intel has designed IC8155 which is capable of demultiplexing the AD7-AD0 bus
internally and provides separate signals.
1.8.4 Internal Architecture

Reference:
1. Ramesh S. Goankar. 8085 Microprocessors Architecture Application and
Programming. Penram International, 5/e.

2. Lyla B.Das : Microprocessors and Microcontrollers, Pearson Education,2011.

You might also like