Micro Processor

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Experiment-1

Objective: Induction to 8085 Microprocessor Experimental Kit.


Theory:
INTRODUCTION TO 8085
INTEL 8085 is one of the most popular 8-bit microprocessor capable of addressing 64
KB of memory and its architecture is simple. The device has 40 pins, requires +5 VV
power supply and can operate with 3MHz single phase clock.
ALU (Arithmetic Logic Unit):
The 8085A has a simple 8-bit ALU and it works in coordination with the
accumulator, temporary registers, 5 flags and arithmetic and logic circuits. ALU has the
capability of performing several mathematical and logical operations. The temporary
registers are used to hold the data during an arithmetic and logic operation. The result is
stored in the accumulator and the flags are set or reset according to the result of the
operation. The flags are affected by the arithmetic and logic operation. They are as
follows:
Sign flagAfter the execution of the arithmetic - logic operation if the bit D7 of
the result is 1, the sign flag is set. This flag is used with signed numbers. If it
is 1, it is a negative number and if it is 0, it is a positive number.
Zero flag
The zero flag is set if the ALU operation results in zero. This flag is
modified by the result in the accumulator as well as in other registers.
Auxillary carry flag
In an arithmetic operation when a carry is generated by digit D3 and
passed on to D4, the auxillary flag is set.
Parity flag
After arithmetic - logic operation, if the result has an even number of
l's the flag is set. Ifit has odd number of l's it is reset.
Carry flag
If an arithmetic operation results in a carry, the carry flag is set. The
carry flag also serves as a borrow flag for subtraction.
Timing and control unit
This unit synchronizes all the microprocessor operation with a clock and generates the
control signals necessary for communication between the microprocessor and peripherals.
The control signals RD (read) and WR (write) indicate the availability of data on the data
bus.
Instruction register and decoder
The instruction register and decoder are part of the ALU. When an instruction is
fetched from memory it is loaded in the instruction register. The decoder decodes the
instruction and establishes the sequence of events to follow.
Register array
The 8085 has six general purpose registers to store 8-bit data during program
execution. These registers are identified as B, C, D, E, H and L. they can be combined as
BC, DE and HL to perform 16-bit operation.
Accumulator
Accumulator is an 8-bit register that is part of the ALU. This register is used to store
8-bit data and to perform arithmetic and logic operation. The result of an operation is
stored in the accumulator.
Program counter
The program counter is a 16-bit register used to point to the memory address of the
next instruction to be executed.
Stack pointer
It is a 16-bit register w hich points to the memory location in R W memory. called the
Stack
Communication lines
8085 microprocessor performs data transter operations using three communication lines
called buses. They are address bus. data bus and control bus.
.Address bus - it is a group of 16-bit lines generally identified as Ao- Ais The
address bus is unidirectional i.e... the bits tlow in one direction from
microprocessor to the peripheral devices. It is capable of addressing 2
memory locations.
Data bus- it is a group of 8 lines used for data flow and it is bidirectional. The
data ranges from 00- FF.
Control bus- it consist of various single lines that carry synchronizing signals.
The microprocessor uses such s1gnals for t1ming purpose.
INTA RST65 SOD Inte 8085 Microarchitectur
Senal O
Intemupt Centrel
Cantral
B intema Dat B
Acc umulato Temp
ina trut a n
(8 8i) Regster
gat
Flag Re gste
Decader and
Machine
Cycle
Enceding
ALU
a a
Multiplere
Timing and Cont
CLK
GEN RESET DMA STATUSS
cONTROL Address Buffer Daral Address Buffe
CLK OUT RESET OUTI HLDA SO
RESET IN= HOLD READY
Address
Decader
ALE Larch
MEMW oW*
A8-AL AG-A7 Da-07
MEMR OR
Address 3us Address Bus Dara Bus
2(A).8 BIT DATA ADDITION
biective: To add two 8 bit numbers stored at consecutive memory locations.
ALGORITHM:
1. Initialize memory pointer to data location.
2. Get the first number from memory in accumulator.
3. Get the second number and perform Addition from the accumulator.
4. If the result yieldsa carry, the content of the acc. is maintained and 01H
is added to Reg C. Reg. C is a register is cleared and the content of that
reg. is incremented in case there is a Carry. If there is no carry the content
of the acc. is directly taken as the result.
5. Store the answer at next memory location.
FLOWCHART:
START

IC) 0OH

[HL]-4500H

[A] [M]

[HLI HL]+1

[A]-[AJ+[M]

Is there a NO
carry?

YES
IC]I+1

[HLIHL}+1

[M] [A]

[HLI HLJ+1

[M) [C)

STOP
Programn:
ADDRESS OPCODE LABEL MNEMONICS OPERANDD OMMENT
4100 START MVI C,00 Clear C reg.
4101
4102 LXI H, 4500O Initialize HL reg. to
4103 4500
4104
4105 MOV A, M Transfer first data to
accumulator
4106 INX H Increment HL reg. to
point next memory
Location.
4107 ADD M Add first number to acc.
Content.
4108 JNC LI Jump to location if result
4109 does not yield carry.
410A
410B INR IncrementC reg.
410C L1 INX Increment HL reg. to
point next memory
Location.
410D MOV M, A Transfer the result from
acc. to memory.
410E INX H Increment HL reg. to
point next memory

410F
Location,
MOV M,C Move carry to memory
4110 HLT
Stop the program

RESULT:
Thus the 8 bit numbers stored at 4500 &4501 added and the result stored
are at 4502 & 4503.

OBSERVATION:
INPUT OUTPUTT
4500 4502
4501 4503

You might also like