Professional Documents
Culture Documents
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.
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.
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.
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.
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.