Sie sind auf Seite 1von 48

Topics

1.
2.
3.
4.
5.
6.

Introduction
Programming model of 8085
Instruction set of 8085
Example Programs
Addressing modes of 8085
Instruction & Data Formats of 8085

1. Introduction
A microprocessor executes instructions given by
the user
Instructions should be in a language known to
the microprocessor
Microprocessor understands the language of 0s
and 1s only
This language is called Machine Language

For e.g.
01001111
Is a valid machine language instruction of
8085
It copies the contents of one of the internal
registers of 8085 to another

A Machine language program to


add two numbers
00111110
00000010
00000110
00000100
10000000

;Copy value 2H in register A


;Copy value 4H in register B

;A = A + B

Assembly Language of 8085


It uses English like words to convey the
action/meaning
For e.g.
MOV
ADD
SUB

to indicate data transfer


to add two values
to subtract two values

Assembly language program to add


two numbers
MVI A, 2H ;Copy value 2H in register A
MVI B, 4H ;Copy value 4H in register B
ADD B
;A = A + B
Note:
Assembly language is specific to a given
processor
For e.g. assembly language of 8085 is different
than that of Motorola 6800 microprocessor

Microprocessor understands Machine Language only!


Microprocessor cannot understand a program
written in Assembly language
A program known as Assembler is used to
convert a Assembly language program to
machine language

Assembly
Language
Program

Assembler
Program

Machine
Language
Code

Low-level/High-level languages
Machine language and Assembly language are
both
Microprocessor specific (Machine dependent)
so they are called

Low-level languages
Machine independent languages are called
High-level languages
For e.g. BASIC, PASCAL,C++,C,JAVA, etc.
A software called Compiler is required to
convert a high-level language program to
machine code

MICROPROCESSOR
Microprocessor is a
multipurpose,programmable,clock
driven,register based electronic device
that reads binary instructions from storage
device called memory,accepts binary data
as i/p and process data accordingly

2. Programming model of 8085


16-bit
Address Bus

Accumulator
Register Array

ALU
Flags

Memory Pointer
Registers

8-bit Data
Bus

Instruction
Decoder

Timing and Control Unit

Control Bus

Accumulator (8-bit)

Flag Register (8-bit)


S

B (8-bit)

C (8-bit)

D (8-bit)

E (8-bit)

H (8-bit)

L (8-bit)

AC

CY

Stack Pointer (SP) (16-bit)


Program Counter (PC) (16-bit)
8- Lines

16- Lines

Bidirectional

Unidirectional

AC

CY

There is also the flags register whose bits are affected by the arithmetic & logic
operations.
S-sign flag
The sign flag is set if bit D7 of the accumulator is set after an arithmetic or
logic operation.
0- + Ve
1- -Ve
Z-zero flag
Set if the result of the ALU operation is 0. Otherwise is reset. This flag is
affected by operations on the accumulator as well as other registers. (DCR
B).
AC-Auxiliary Carry
This flag is set when a carry is generated from bit D3 and passed to D4 .
This flag is used only internally for BCD operations.
P-Parity flag
After an ALU operation if the result has an even no of 1s the p-flag is set.
Otherwise it is cleared. So, the flag can be used to indicate even parity.
CY-carry flag
CY = carry is set when result generates a carry. Also a borrow flag.

Overview: 8085 Programming model


1.
2.
3.
4.
5.

Six general-purpose Registers


Accumulator Register
Flag Register
Program Counter Register
Stack Pointer Register

1. Six general-purpose registers


B, C, D, E, H, L
Can be combined as register pairs to
perform 16-bit operations (BC, DE, HL)
2. Accumulator identified by name A
This register is a part of ALU
8-bit data storage
Performs arithmetic and logical operations
Result of an operation is stored in
accumulator

3. Flag Register
This is also a part of ALU
8085 has five flags named
Zero flag (Z)
Carry flag (CY)
Sign flag (S)
Parity flag (P)
Auxiliary Carry flag (AC)

These flags are five flip-flops in flag register


Execution of an arithmetic/logic operation can
set or reset these flags
Condition of flags (set or reset) can be tested
through software instructions
8085 uses these flags in decision-making
process

4. Program Counter (PC)


A 16-bit memory pointer register
Used to sequence execution of program
instructions
Stores address of a memory location
where next instruction byte is to be fetched
by the 8085
when 8085 gets busy to fetch current
instruction from memory
PC is incremented by one
PC is now pointing to the address of next
instruction

5. Stack Pointer Register


a 16-bit memory pointer register
Points to a location in Stack memory
Beginning of the stack is defined by loading
a 16-bit address in stack pointer register

8085 BUS ARCHITECTURE

What is Address Bus, Data Bus and Control Bus in Microprocessor | What
are the differences between them:
Microprocessor is processing device of every computing device. It is like an artificial
brain. It needs to communicate with outer world. for example, It needs to
communicate with Input devices to get data,it needs to communicate with memory
to process data according to instructions written in memory and finally it needs to
communicate with output devices to display the output on O/P devices. To
communicate with external world, Microprocessor make use of buses. There are
different types of buses used in Microprocessor:
Address Bus: It is a group of wires or lines that are used to transfer the addresses
of Memory or I/O devices. It is unidirectional.In Intel 8085 microprocessor, Address
bus was of 16 bits. This means that Microprocessor 8085 can transfer maximum 16
bit address which means it can address 65,536 different memory locations. This
bus is multiplexed with 8 bit data bus. So the most significant bits (MSB) of address
goes through Address bus (A7-A0) and LSB goes through multiplexed data bus
(AD0-AD7).

Data Bus:As name tells that it is used to transfer data within Microprocessor and
Memory/Input or Output devices. It is bidirectional as Microprocessor requires to
send or receive data. The data bus also works as address bus when multiplexed with
lower order address bus. Data bus is 8 Bits long. The word length of a processor
depends on data bus, thats why Intel 8085 is called 8 bit Microprocessor because it
have an 8 bit data bus.

Control Bus: Microprocessor uses control bus to process data, that is what to do
with the selected memory location. Some control signals are Read, Write and
Opcode fetch etc. Various operations are performed by microprocessor with the help
of control bus. This is a dedicated bus, because all timing signals are generated
according to control signal.

8085 MicroprocessorArchitecture

The above diagram shows pin diagram for 8085A


It is a 8-bit general purpose p capable of addressing 64K of
memory
Device has 40 pins,requires +5V single power supply and can
operate with 3MHz single phase clock
All the signals are classified into six groups
1. address bus 2. data bus 3 . control and status signal 4. power
supply and frequency signal 5. Externally initiated signals
6 .serial I/O ports
ADDRESS BUS: has 16 address lines and split into two segments:
A15-A8 and AD7-AD0.
A15-A8: Higher order address bus and are unidirectional
AD7-AD0:Lower order address bus and are bidirectional.Thay serve
dual purposehey are used as lower order address bus as well as
data bus.

Take 20H(00100000) address on higher order bus and


05H(00000101) address on low order bus and Let 4Fh
(01001111) be the data.
1st address needs to be latched and used for identifying the memory
address.
The address will then chage to 2005H-204FH
Fig shows demultiplexing the bus AD7-AD0:Uses D latch and ALE
signal.ALE signal is connected to enable(G) pin of the latch,and OC
output control signal of latch is grounded
ALE=1;o/p is transperent output changes according to inputie o/p
represents Address A7-A0
ALE=0;Data is latched

2.Control and status signal:


Two control signal: RD and WR
Both are active low RD indicates that selected I/o Or memory device is
to be read and data are available on data bus
WR indicates data available on databus is to be written on selected
memory or I/O location.
Three Status signals are: IO/M ,S1, ans S0:
IO/M :is a status signal used to differentiate b/w memory and I/o.When
low memory operation.
S1 and S0:

IO/M

S1

S0

Control
signal(all
signals
active low)

Opcode fetch

RD=0

Memory read

RD=0

Memory Write

WR=0

I/O Read

RD=0

I/O Write

WR=0

Interrupt
acknowledge

INTA=0

Halt

Hold

Reset

RD=WR=Z
INTA=1

8085 interrupts and externally initiated signals:


INTR(input):interrupt request.
INTA (output):interrupt acknowledgement>used to acknowledge
interrupt
RST 7.5 ,RST 6.5,RST 5.5(inputs) restart interrupts: vectored
interrupts that transfer program control to specific location
Priority order is 7.5,6.5 and 5.5

Trap(input) :non maskable and has highest priority


Hold(input): Indicates peripheral such as DMA is requesting the use
of address and data busses
HLDA(output) :Hold acknowledge:acknowledges hold request
Ready(input):used to delay MP read or write cycles until slow
responding peripheral is ready to send or accept data.
SID and SOD are two serial transmission signals

Das könnte Ihnen auch gefallen