0% found this document useful (0 votes)
56 views16 pages

Microprocessor Lab Manual

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 16

TABLE OF CONTENTS

LA
TITLE DATE SIGN GRADE
B

1 Introduction to 8085 microprocessor kit

Programming based on Data transfer


2
operations

Programming based on Arithmetic and


3
logical operations

4 Programming based on Branch operations

To interface 8255 with 8085


5
microprocessor.

10
Institute of Technology and
Engineering

LABORATORY 1
INTRODUCTION TO 8085 MICROPROCESSOR
KIT
OBJECTIVE
To familiarize with 8085 microprocessor kit and its commands.

PRELAB
1. Understand the 8085 hardware model.
2. Understand the 8085 bus architecture.

BACKGROUND INFORMATION
M85-02 kit is a single board MICROPROCESSOR TRAINING KIT based on 8085
Microprocessor. It contains the following features:

 8085 CPU operating at 6.144 MHz.


 8K bytes of Powerful Monitor Program using 27512 EPROM
 8K bytes of RAM using 6264 with Battery Backup using NiCd Battery. On-board one
memory expansion up to 56KB.

 Three Channel Timer/Counter using 8253 brought out at 10 Pins FRC Connector.24
I/O lines provided through 8255 brought out at 26 Pins FRC Connector to interface
with IC-XX Series.
 22 I/O lines provided through 8155 brought at 26 Pins FRC Connector. RS-232C
interface through SID/SOD lines
 Two mode of commands : Hex Key pad Mode - Serial Mode
 28 keys hexadecimal keyboard and six seven segment display using 8279
Powerful Commands like Examine/Edit Memory, Examine/Edit Register, Single
stepping, Execution, Block Move, Insert Data, Delete Data can be used through
hex keyboard or PC serial mode.

 Facility for Downloading/Uploading files from/to PC.

 All address, data & control lines are available on KXT Bus on 50 pin FRC
Connector to interface with SC-XX Series.
 All ICs are mounted on IC Sockets.

 Bare board Tested Glass Epoxy SMOBC PCB is used.

[
Institute of Technology and
Engineering
 In-Built Power Supply of +5V/1.5A, ±12V/250mA

List of important commands:

1 Reset: This key initializes the M85-02 kit and displays ‘-SCb 85’ on the
display. A ‘-’ on the left most end of display indicates that the system
is expecting a valid command.

2 Examine/Modify Register: This command is used to examine/modify


any internal register of the CPU. If one wants to examine the contents
of all the registers, one can start from ‘A’ Register and examine all the
registers by pressing next key. Whereas if some specific registers is to
be examined, then the key for that register can be entered directly.
The contents of any register can be changed.

3 Examine/Modify Memory: This command is used to examine the


contents of any memory location and modify the contents of the RAM
area. On pressing this key, a dot is displayed in the end of address field.
One can now enter the address of any location one wants to examine.
Enter the desired address and press NEXT. The content of this location
is displayed in the data field. If one wants to examine the contents of
next location, just press NEXT and the address in the address field will
be incremented by one and its content will displayed in data field.
Same way if one wants to examine the content of previous location just
press PRE key and the address in the address field will be decremented
by one and its contents will be displayed in the data field.

If one wants to modify the contents of any RAM location, then enter the
data and press NEXT. The data field will be written in the address
displayed in the address field and simultaneously the contents of next
location will be displayed.

4 GO: This command is used to execute the program in full clock speed.
On pressing this key, the program counter content is displayed in the
address field with the data in the data field. A dot in the address field
indicates that the address can be changed, if so desired. Enter the
starting address of the program. On entering this address, the data
field gets blanked out. Press Terminate (.) key. The CPU will start
executing the program and E wil be displayed in address field.

[
Institute of Technology and
Engineering
5 Delete: This command allows the user to delete one or more
instructions from the user’s program. In this command all the memory
referenced instructions also get modified accordingly to keep the logic
of the program same.

EXERCISES

1 Examine content of register A and change it to 0x99.


2 Examine the data stored at memory location 2100H and change it to
0x45

Faculty Sign

[
Institute of Technology and
Engineering

LABORATORY 2
PROGRAMMING BASED ON DATA TRANSFER OPERATIONS

OBJECTIVE
To familiarize with the use of data transfer instruction set of 8085

PRELAB
Read data transfer instructions from textbook in detail.

OVERVIEW OF DATA TRANSFER INSTRUCTIONS


Opcode Operand Description

MOV Rd, Rs Copies data from source resister Rs to Rd

MVI R, 8-bit Copies 8-bit data to resister R

Rp, 16- Copies 16-bit data to register pair Rp


LXI bit

SP, 16-
LXI bit Copies 16-bit data to stack pointer SP

Copies 8-bit data stored at memory location specified by


MOV R,M the content of HL register to register R

Copies 8-bit data stored at memory location specified by


LDAX B/D the content of BC or DE register to the accumulator

Copies 8-bit data stored at memory location specified by


LDA 16-bit 16-bit to the accumulator

Copies data from a register R, into the memory location


MOV M,R specified by the HL pair

Stores the content of the accumulator to the memory


STAX B/D location specified by the BC or DE pair

Store the content of the accumulator to memory


STA 16-bit address

[
Institute of Technology and
Engineering

Store 8-bit data to the memory location specified by the


MVI M, 8-bit register pair HL

XCHG Exchange H and L with D and E respectively

EXAMPLE PROGRAM
Load the accumulator and register B with 0x04 and 0x05 respectively. Swap
the content of the accumulator and register B using register C.

EXERCISES

1 Load the memory address 2100H with 0x45 and transfer it to


accumulator. Copy accumulator to register B, C, D, E, H and L.
2 Load the accumulator with 0x45 and save accumulator at memory
location 2105H.
3 Write instructions to load 0x65 in register C and 0x92 in the
accumulator. Store the content of both register at memory location
2122H and 2212H.

[
Institute of Technology and
Engineering

LABORATORY 3
PROGRAMMING BASED ON ARITHMETIC AND LOGICAL
OPERATIONS

OBJECTIVE
To familiarize with the use of arithmetic and logical instruction sets of
8085

PRELAB
Read the instructions related to arithmetic and logical operations in
detail.

OVERVIEW OF ARITHMETIC & LOGICAL INSTRUCTIONS


Opcod e Opera
Description
d

Adds the content of register R to the content of the


ADD R accumulator

ADI 8-bit Adds the 8-bit Data to the content of the accumulator

Subtracts content of register R from the content of the


SUB R accumulator

SUI 8-bit Subtracts 8-bit Data from the content of the accumulator

INR R Increases the content of register R by 1

DCR R Decreases the content of register R by 1

Adds the content of memory location specified by register


ADD M pair HL to the content of the accumulator

Subtracts the content of memory location specified by


SUB M register pair HL from the content of the accumulator

Increment the content of the memory location specified


INR M by register pair HL by 1.

DCR M
Decrement the content of the memory location specified

[7]
Institute of Technology and
Engineering

by register pair HL by 1.

Logically ANDs the content of register R with the content


ANA R of accumulator

Logically ANDs the 8-bit data with the content of the


ANI 8-bit accumulator

Logically ORs the content of register R with content of the


ORA R accumulator

Logically ORs the 8-bit data with the content of the


ORI 8-bit accumulator

Exclusive-ORs the contents of register R with the content


XRA R of accumulator

Exclusive-ORs the 8-bit data with the content of the


XRI 8-bit accumulator

Complements the content of the accumulator


CMA

Rotate accumulator left


RLC

Rotate accumulator left through carry


RAL

Rotate accumulator right


RRC

RAR Rotate accumulator right through carry

Compare register or memory with accumulator


CMP R/M

CPI 8-bit Compare 8-bit data with accumulator

EXERCISES

1 Write an assembly language program for the adding of two 8-bits


numbers stored at memory location 2100H and 2101H respectively.
Store the result at memory location 2102H.
2 Write an ALP to add two sixteen bit numbers and store 16-bit result.
3 Subtract two 8-bit numbers at 2100H and 2101H. Save the result at
location 2102H.
4 Write a program to subtract two 16-bit numbers and store the result.
5 Write ALP to find one’s complement of data 0x55 stored at memory
location 2100H.

[8]
Institute of Technology and
Engineering

6 Write an ALP to find two’s complement of data 0x45 stored at memory


location 2100H.
7 Write an ALP to unpacked data stored at location 2100H. Save result at
memory locations 2101H and 2102H.
8 Write a program that takes two nibbles from 2100H, 2101H and
combines to form byte. The nibbles from 2100 are to be taken as most
significant nibble.

[9]
Institute of Technology and
Engineering

LABORATORY 4
PROGRAMMING BASED ON BRANCH OPERATIONS

OBJECTIVE
To familiarize with the use of branch operation related instructions in
8085 programming

PRELAB
Read and understand utilization of the instructions related to branch
operations.

OVERVIEW OF BRANCH INSTRUCTIONS


Opcode Operand
Description

JMP 16-bit Jump on the 16-bit memory


address
JC 16-bit Jump on Carry

JNC 16-bit Jump on no Carry

JZ 16-bit Jump on Zero

JNZ 16-bit Jump on no Zero

JP 16-bit Jump on Plus

JM 16-bit Jump on Minus

JPE 16-bit Jump on Even Parity

JPO 16-bit Jump on Odd Parity

EXERCISES

1 Write a program to multiply two 8 bit data stored at location 2101H


and 2102H.
2. Write a program to add two BCD numbers located at 2101H and 2102H.

[1
Institute of Technology and
Engineering

3 Write a program to find largest and smallest numbers in block of array


from 2100H to 2109H. Store the result at location 210AH and 210BH.
4 Write an ALP to sort array of 10 elements from 2100H in ascending
order.

[1
Institute of Technology and
Engineering

LABORATORY 5
TO INTERFACE 8255 WITH 8085 MICROPROCESSOR.

OBJECTIVE
To Interface 8255 with 8085.

PRELAB
Read the following topics from textbook

1. Internal architecture of 8255


2. Pin diagram of 8255
3. Programming and interfacing of 8255

BACKGROUND INFORMATION
The 8255 is a general purpose programmable I/O device and has 24 I/O pins
which may be individually programmed. The basic function of 8255 is to
interface general purpose I/O devices to microcomputer system bus. It is
software programmable so that no external logic is necessary to interface the
peripheral devices. The Read/write control logic block receives signals likes
CS, RD, WR, A0, A1 and Reset. The various combinations of A1, A0, RD, WR
and CS control the selection of one of the three ports or the control word
registers.

There are three basic modes of operation that can be selected by the system
software.

MODE 0 = Basic Input/Output.


MODE 1 = Strobed
Input/Output MODE 2 = Bi-
directional Bus

Mode 0

In this mode, the ports can be used for simple input/output operations
without handshaking. If both port A and B are initialized in mode 0, the
two halves of port C can be either used together as an additional 8-bit
port, or they can be used as individual 4-bit ports. Since the two halves
[1
Institute of Technology and
Engineering

of port C are independent, they may be used such that one-half is


initialized as an input port while the other half is initialized as an
output port.

Mode 1

When we wish to use port A or port B for handshake (strobed) input or


output operation, we initialize that port in mode 1. Some of the pins of
port C function as handshake lines.

Mode 2

Only group A can be initialized in this mode. Port A can be used for
bidirectional handshake data transfer. This means that data can be
input or output on the same eight lines (PA0 - PA7). Pins PC3 - PC7 are
used as handshake lines for port A. The remaining pins of port C can be
used as input/output lines if group B is initialized in mode 0.

EXERCISES
1. Draw and explain internal architecture of 8255.
2. Explain various modes and control registers of 8255.
3. Generate square wave at PORT-A, PORT-B and PORT-C of 8255.

[1
Institute of Technology and
Engineering

[1
Institute of Technology and
Engineering

[1
Institute of Technology and
Engineering

[1

You might also like