Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

8085 Microprocessor and its application, Study notes of Computer Science

bca 3rd semester notes 8086 microprocessor and its application

Typology: Study notes

2017/2018

Uploaded on 11/02/2018

bala22
bala22 🇮🇳

1 document

1 / 66

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
UNIT I
SYLLABUS
INTRODUCTION TO 8085
Intel 8085 Microprocessor architecture signals Addressing modes Instruction
classification Instruction setTiming diagram ALP format Programming 8085 8-bit
and 16-bit Operation including stack-subroutine Introduction to interrupt handling and
related instructions comparison of 8085 with z80 and 6800.
Basic Concepts of Microprocessors
Differences between: Microcomputer, Microprocessor and Microcontroller
Microcomputer is a computer with a microprocessor as its CPU. Includes memory,
I/O etc.
Microprocessor is a silicon chip which includes ALU, register circuits & control
circuits
Microcontroller is a silicon chip which includes microprocessor, memory & I/O in a
single package.
What is micro?
Micro is a new addition.
In the late 1960’s, processors were built using discrete elements.
These devices performed the required operation, but were too large and too
slow.
It went directly from discrete elements to a single chip. However, comparing
today’s microprocessors to the ones built in the early 1970’s you find an
extreme increase in the amount of integration.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42

Partial preview of the text

Download 8085 Microprocessor and its application and more Study notes Computer Science in PDF only on Docsity!

UNIT – I

SYLLABUS

INTRODUCTION TO 8085

Intel 8085 Microprocessor architecture – signals – Addressing modes – Instruction classification Instruction set—Timing diagram – ALP format – Programming 8085 – 8-bit and 16-bit Operation including stack-subroutine – Introduction to interrupt handling and related instructions – comparison of 8085 with z80 and 6800.

Basic Concepts of Microprocessors

Differences between: Microcomputer, Microprocessor and Microcontroller

  • Microcomputer is a computer with a microprocessor as its CPU. Includes memory, I/O etc.
  • Microprocessor is a silicon chip which includes ALU, register circuits & control circuits
  • Microcontroller is a silicon chip which includes microprocessor, memory & I/O in a single package.

What is micro?

  • Micro is a new addition.
    • In the late 1960’s, processors were built using discrete elements. These devices performed the required operation, but were too large and too slow.
    • It went directly from discrete elements to a single chip. However, comparing today’s microprocessors to the ones built in the early 1970’s you find an extreme increase in the amount of integration.

What is a microprocessor?

  • The word comes from the combination of micro and processor.
  • Processor means a device that processes whatever. In this context processor means a device that processes numbers, specifically binary numbers, 0’s and 1’s.
  • To process means to manipulate. It is a general term that describes all manipulation. Again in this content, it means to perform certain operations on the numbers that depend on the microprocessor’s design. It is a programmable device that takes in numbers, performs on them arithmetic or logical operations according to the program stored in memory and then produces other numbers

As a Programmable device:

  • The microprocessor can perform different sets of operations on the data it receives depending on the sequence of instructions supplied in the given program.
  • By changing the program, the microprocessor manipulates the data in different ways as Instructions, Words, Bytes, etc.
  • They processed information 8-bits at a time. That’s why they are called ―8-bit processors‖. They can handle large numbers, but in order to process these numbers, they broke them into 8-bit pieces and processed each group of 8-bits separately.

What is memory?

  • Memory is the location where information is kept while not in current use. It is stored in memory
  • Memory is a collection of storage devices. Usually, each storage device holds one bit. Also, in most kinds of memory, these storage devices are grouped into

In this system, the microprocessor is the master and all other peripherals are slaves. The master controls all peripherals and initiates all operations. The buses are group of lines that carry data, address or control signals. The CPU interface is provided to demultiplex the multiplexed lines, to generate the chip select signals and additional control signals. The system bus has separate lines for each signal.

All the slaves in the system are connected to the same system bus. At any time instant communication takes place between the master and one of the slaves. All the slaves have tristate logic and hence normally remain in high impedance state. The processor selects a slave by sending an address. When a slave is selected, it comes to the normal logic and communicates with the processor.

The EPROM memory is used to store permanent programs and data. The RAM memory is used to store temporary programs and data. The input device is used to enter program, data and to operate system. The output device is also used for examining the results. Since the speed of IO devices does not match with speed of microprocessor, an interface device is provided between system bus and IO device.

CENTRAL PROCESSING UNIT:

The CPU consists of ALU (Arithmetic and Logic Unit), Register unit and control unit. The CPU retrieves stored instructions and data word from memory; it also deposits processed data in memory.

a) ALU (Arithmetic and Logic Unit)

This section performs computing functions on data. These functions are arithmetic operations such as additions subtraction and logical operation such as AND, OR rotate etc. Result are stored either in registers or in memory or sent to output devices.

b) REGISTER UNIT:

It contains various register. The registers are used primarily to store data temporarily during the execution of a program. Some of the registers are accessible to the uses through instructions.

c) CONTROL UNIT:

It provides necessary timing & control signals necessary to all the operations in the microcomputer. It controls the flow of data between the p and peripherals (input, output & memory). The control unit gets a clock which determines the speed of the p.

The CPU has three basic functions

  • It fetches an instructions word stored in memory.
  • It determines what the instruction is telling it to do.(decodes the instruction)
  • It executes the instruction. Executing the instruction may include some of the following major tasks. o Transfer of data from reg. to reg. in the CPU itself. o Transfer of data between a CPU reg. & specified memory location. o Performing arithmetic and logical operations on data from a specific memory location or a designated CPU register. o Directing the CPU to change a sequence of fetching instruction, if processing the data created a specific condition. o Performing housekeeping function within the CPU itself inorder to establish desired condition at certain registers. o It looks for control signal such as interrupts and provides appropriate responses. o It provides states, control, and timing signals that the memory and input/output section can use.

Memory

To execute a program:

 The user enters its instructions in binary format into the memory.

 The microprocessor then reads these instructions and whatever data is needed from memory, executes the instructions and places the results either in memory or produces it on an output device.

The three cycle instruction execution model

 To execute a program, the microprocessor ―reads‖ each instruction from memory, ―interprets‖ it, then ―executes‖ it.  To use the right names for the cycles

 The microprocessor fetches each instruction, decodes it, and then executes it. This sequence is continued until all instructions are performed.

The 8085 Machine Language

The 8085 (from Intel) is an 8-bit microprocessor. The 8085 uses a total of 246 bit patterns to form its instruction set. These 246 patterns represent only 74 instructions. The reason for the difference is that some (actually most) instructions have multiple different formats. Because it is very difficult to enter the bit patterns correctly, they are usually entered in hexadecimal instead of binary.

For example, the combination 0011 1100 which translates into ―increment the number in the register called the accumulator‖, is usually entered as 3C.

Assembly Language

Entering the instructions using hexadecimal is quite easier than entering the binary combinations. However, it still is difficult to understand what a program written in hexadecimal does. So, each company defines a symbolic code for the instructions.

These codes are called ―mnemonics‖.

The mnemonic for each instruction is usually a group of letters that suggest the operation performed.

  • Using the same example from before, 00111100 translates to 3C in hexadecimal (OPCODE) Its mnemonic is: ―INR A‖. INR stands for ―increment register‖ and A is short for accumulator.

It is important to remember that a machine language and its associated assembly language are completely machine dependent. In other words, they are not transferable from one microprocessor to a different one.

Assembling” The Program

How does assembly language get translated into machine language?

  • There are two ways:
  • 1st there is ―hand assembly‖.
    • The programmer translates each assembly language instruction into its equivalent hexadecimal code (machine language). Then the hexadecimal code is entered into memory.
    • The other possibility is a program called an ―assembler‖, which does the translation automatically.

8085 MICROPROCESSOR ARCHITECTURE

Features of 8085

  • 8-bit general purpose μp

data bus during the second and third clock cycles. 3 stated during Hold and Halt modes.

ALE (Output) Address Latch Enable

It occurs during the first clock cycle of a machine state and enables the address to get latched into the on chip latch of peripherals. The falling edge of ALE is set to guarantee setup and hold times for the address information. ALE can also be used to strobe the status information. ALE is never 3stated.

SO, S1 (Output)

Data Bus Status. Encoded status of the bus cycle: S1 S0 0 0 HALT 0 1 WRITE 1 0 READ 1 1 FETCH S1 can be used as an advanced R/W status.

RD (Output 3state)

READ: indicates the selected memory or 1/0 device is to be read and that the Data Bus is available for the data transfer.

WR (Output 3state)

WRITE: Indicates the data on the Data Bus is to be written into the selected memory or 1/0 location. Data is set up at the trailing edge of WR. 3 stated during Hold and Halt modes.

READY (Input) If Ready is high during a read or write cycle, it indicates that the memory or peripheral is ready to send or receive data. If Ready is low, the CPU will wait for Ready to go high before completing the read or write cycle.

HOLD (Input) It indicates that another Master is requesting the use of the Address and Data Buses. The CPU, upon receiving the Hold request will relinquish the use of buses as soon as the completion of the current machine cycle. Internal processing can continue.

The processor can regain the buses only after the Hold is removed. When the Hold is acknowledged, the Address, Data, RD, WR, and IO/M lines are stated.

HLDA (Output) HOLD ACKNOWLEDGE indicates that the CPU has received the Hold request and that it will relinquish the buses in the next clock cycle. HLDA goes low after the Hold request is removed. The CPU takes the buses one half clock cycle after HLDA goes low.

INTR (Input) INTERRUPT REQUEST is used as a general purpose interrupt. It is sampled only during the next to the last clock cycle of the instruction. If it is active, the Program Counter (PC) will be inhibited from incrementing and an INTA will be issued. During this cycle a RESTART or CALL instruction can be inserted to jump to the interrupt service routine. The INTR is enabled and disabled by software. It is disabled by Reset and immediately after an interrupt is accepted.

INTA (Output) INTERRUPT ACKNOWLEDGE: is used instead of (and has the same timing as) RD during the Instruction cycle after an INTR is accepted. It can be used to activate the 8259 Interrupt chip or some other interrupt port.

RESTART INTERRUPTS: These three inputs have the same timing as INTR except they cause an internal RESTART to be automatically inserted. RST 7.5 ~~ Highest Priority RST 6.5 RST 5.5 Lowest Priority

TRAP (Input)

Trap interrupt is a nonmaskable restart interrupt. It is recognized at the same time as INTR. It is unaffected by any mask or Interrupt Enable. It has the highest priority of any interrupt.

Vss Ground Reference. Signal Classification of 8085 The signal Classification of 8085 is as shown in fig3.

Fig: 3 Signal Classifications of 8085

System Bus – wires connecting memory & I/O to microprocessor

  • ADDRESS BUS

 Unidirectional

 Identifying peripheral or memory location

– DATA BUS

 Bidirectional  Transferring data

  • CONTROL BUS

 Synchronization signals

 Timing signals  Control signal

ARCHITECTURE OF INTEL 8085 MICROPROCESSOR

Fig:4 Architecture of intel 8085 microprocessor

 Store 8 bit data

 Store the result of an operation  Store 8 bit data during I/O transfer Address

Flag Register

  • 8 bit register – shows the status of the microprocessor before/after an operation
  • S (sign flag), Z (zero flag), AC (auxillary carry flag), P (parity flag) & CY (carry flag)

D7 D6 D5 D4 D3 D2 D1 D S Z X AC X P X CY

Sign Flag

  • Used for indicating the sign of the data in the accumulator
  • The sign flag is set if negative (1 – negative)
  • The sign flag is reset if positive (0 – positive)

Zero Flag

  • Is set if result obtained after an operation is 0
  • Is set following an increment or decrement operation of that register Carry Flag 10110011
  • 01001101

00000000

  • Is set if there is a carry or borrow from arithmetic operation 1011 0101 1011 0101
  • 0110 1100 - 1100 1100

Carry 1 0010 0001 Borrow 1 1110 1001

Auxillary Carry Flag

  • Is set if there is a carry out of bit 3

Parity Flag

  • Is set if parity is even
  • Is cleared if parity is odd

The Internal Architecture

We have already discussed the general purpose registers, the Accumulator, and the flags.

The Program Counter (PC)

  • This is a register that is used to control the sequencing of the execution of instructions.
  • This register always holds the address of the next instruction.
  • Since it holds an address, it must be 16 bits wide.

The Stack pointer

  • The stack pointer is also a 16-bit register that is used to point into memory.
  • The memory this register points to is a special area called the stack.
  • The high order bits of the address remain on the bus for three clock periods. However, the low order bits remain for only one clock period and they would be lost if they are not saved externally. Also, notice that the low order bits of the address disappear when they are needed most.
  • To make sure we have the entire address for the full three clock cycles, we will use an external latch to save the value of AD7– AD0 when it is carrying the address bits. We use the ALE signal to enable this latch.

Demultiplexing AD7-AD

Given that ALE operates as a pulse during T1, we will be able to latch the address. Then when ALE goes low, the address is saved and the AD7– AD0 lines can be used for their purpose as the bi-directional data lines.

Demultiplexing the Bus AD7 – AD

  • The high order address is placed on the address bus and hold for 3 clk periods,
  • The low order address is lost after the first clk period, this address needs to be hold however we need to use latch
  • The address AD7 – AD0 is connected as inputs to the latch 74LS373.
  • The ALE signal is connected to the enable (G) pin of the latch and the OC – Output control – of the latch is grounded

ADDRESSING MODES

The microprocessor has different ways of specifying the data for the instruction. These are called ―addressing modes‖.

The 8085 has four addressing modes:

  • Implied CMA
  • Immediate MVI B, 45
  • Direct LDA 4000
  • Indirect LDAX B

Load the accumulator with the contents of the memory location whose address is stored in the register pair BC).

Many instructions require two operands for execution. For example transfer of data between two registers. The method of identifying the operands position by the instruction format is known as the addressing mode. When two operands are involved in an instruction, the first operand is assumed to be in a register Mp itself.

Types of Addressing Modes

  • Register addressing
  • Direct addressing mode
  • Register indirect addressing
  • Immediate Addressing mode
  • Implied addressing mode Register Addressing This type of addressing mode specifies register or register pair that contains data.ie (only the register need be specified as the address of the operands). Example MOV B, A (the content of A is copied into the register B) Direct Addressing Mode Data is directly copied from the given address to the register. Example LDA 3000H (The content at the location 3000H is copied to the register A). Register Indirect Addressing In this mode, the address of operand is specified by a register pair