Académique Documents
Professionnel Documents
Culture Documents
A LABORATORY MANUAL OF
MICROPROCESSORS
AND
INTERFACING
CERTIFICATE
This is to certify that Mr. / Miss. ____________________________
Of_____________SEM.____________branch_______________
Enrolment no. __________________ has satisfactorily completed
his/her term work in the subject
___________________________________ for the term ending in
_______________ 20 / 20
Date: ___________
INDEX
SR. PAGE
DATE PROGRAM STATEMENT GRADE SIGN
NO. NO.
1 A data byte is stored at location C100H. Write
instructions to transfer this data byte to
accumulator using three different op-codes
namely (i) MOV (ii) LDAX (iii) LDA.
2 Register B Contains 32H.Use (i) MOV (ii) STAX to
copy this content to location D100H.
3 Add two 8 bit numbers such that numbers are
stored in memory location C100H and C101H.
Store the answer in memory location C104H.
Take care for carry.
4 Add two 16-bit numbers. Take data from
memory and store answer in memory.
5 Block transfer. Ten bytes of data are stored in
location C100H-C109H. Transfer the entire block
of data to new memory location starting at
D100H.
6 Six bytes of data are stored in memory locations
starting at C100H.Add all the data bytes. Use
registers B to save any carries generated, while
adding data bytes. Store the sum at two
consecutive memory locations.
7 Write a Program to take a data from memory
location C100H. if it is greater then 7FH send it
to port 01H else send it to port 00H
8 Write a program to take a data from location
C100H & C101H. Add this data. If answer is
greater then FFH store the answer in B register
else store it in C register.
9 A set of ten current readings is stored in memory
locations starting at C100H. Add all the positive
readings (<12710).Reject all negative readings.
Output FFH to port1 at any time when the sum
exceeds eight bits to indicate overload,
otherwise Display the sum.
10 A set of Current readings is stored in memory
locations starting at C100H. The end of data
string is indicated by the data byte 0DH (ASCII
Code of enter).Copy this string contents at
another location up to the end of string.
11 Write a program to arrange data in descending
order. Assume five bytes are stored in successive
memory locations starting from C100H.
12 An array of binary numbers is stored in memory
starting from address C100H. There are ten
numbers in the array. Write an ALP which finds
out quantity of positive no., negative no. and
zeros in the data array and stores the result in
memory location starting from address C200H.
----------------------------------------------------------------
| Intel|
| |
| 88888 000 88888 5555555 A |
| 8 8 0 0 8 8 5 A A |
| 8 8 0 0 0 8 8 5 A A |
| 88888 0 0 0 88888 555555 AAAAAAA |
| 8 8 0 0 0 8 8 5 A A |
| 8 8 0 0 8 8 5 A A |
| 88888 000 88888 555555 A A |
| |
| MICROPROCESSOR PIN DIAGRAM|
| |
| _________ _________ |
| _| \__/ |_ |
| --> X1 |_|1 40|_| Vcc (+5V) |
| _| |_ |
| --> X2 |_|2 39|_| HOLD <-- |
| _| |_ |
| <-- RESET OUT |_|3 38|_| HLDA --> |
| _| |_ |
| <-- SOD |_|4 37|_| CLK (OUT) --> |
| _| |_ ________ |
| --> SID |_|5 36|_| RESET IN <-- |
| _| |_ |
| --> TRAP |_|6 35|_| READY <-- |
| _| |_ _ |
| --> RST 7.5 |_|7 34|_| IO/M --> |
| _| |_ |
| --> RST 6.5 |_|8 33|_| S1 --> |
| _| |_ __ |
| --> RST 5.5 |_|9 32|_| RD --> |
| _| |_ __ |
| --> INTR |_|10 8085A 31|_| WR --> |
| ____ _| |_ |
| <-- INTA |_|11 30|_| ALE --> |
| _| |_ |
| <--> AD0 |_|12 29|_| S0 --> |
| _| |_ |
| <--> AD1 |_|13 28|_| A15 --> |
| _| |_ |
| <--> AD2 |_|14 27|_| A14 --> |
| _| |_ |
| <--> AD3 |_|15 26|_| A13 --> |
| _| |_ |
| <--> AD4 |_|16 25|_| A12 --> |
| _| |_ |
| <--> AD5 |_|17 24|_| A11 --> |
| _| |_ |
| <--> AD6 |_|18 23|_| A10 --> |
| _| |_ |
| <--> AD7 |_|19 22|_| A9 --> |
| _| |_ |
| (Gnd) Vss |_|20 21|_| A8 --> |
| |______________________| |
-----------------------------------------------------
Microprocessors & Interfacing EC Department
ADDRESSING MODES
Implied Addressing:
The addressing mode of certain instructions is implied by the instruction’s function. For
example, the STC (set carry flag) instruction deals only with the carry flag, the DAA
(decimal adjust accumulator) instruction deals with the accumulator.
Register Addressing:
Quite a large set of instructions call for register addressing. With these instructions, you
must specify one of the registers A through E, H or L as well as the operation code. With
these instructions, the accumulator is implied as a second operand. For example, the
instruction CMP E may be interpreted as 'compare the contents of the E register with the
contents of the accumulator.
Most of the instructions that use register addressing deal with8-bit values. However, a
few of these instructions deal with 16-bit register pairs. For example, the PCHL instruction
exchanges the contents of the program counter with the contents of the H and L registers.
Immediate Addressing:
Instructions that use immediate addressing have data assembled as a part of the
instruction itself. For example, the instruction CPI 41H. When this instruction is executed,
the processor fetches the first instruction byte and determines that it must fetch one
more byte. The processor fetches the next byte into one of its internal registers and then
performs the compare operation.
Notice that the names of the immediate instructions indicate that they use immediate
data. Thus, the name of an add instruction is ADD; the name of an add immediate
instruction is ADI.
All but two of the immediate instructions uses the accumulator as an implied operand, as
in the CPI instruction shown previously. The MVI (move immediate) instruction can move
its immediate data to any of the working registers including the accumulator or to
memory. Thus, the instruction MVI D, OFFH moves the hexadecimal
Value FF to the D register.
The LXI instruction (load register pair immediate) is even more unusual in that its
immediate data is a 16-bit value. This instruction is commonly used to load addresses into
a register pair. As mentioned previously, your program must initialize the stack pointer;
LXI is the instruction most commonly used for this purpose. For example, the instruction
LXI SP, 3OFFH loads the stack pointer with the hexadecimal value 30FF.
Microprocessors & Interfacing EC Department
Direct Addressing:
Jump instructions include a 16-bit address as part of the instruction. For example, the
instruction JMP 1000H causes a jump to the hexadecimal address 1000 by replacing the
current contents of the program counter with the new value 1000H.
Instructions that include a direct address require three bytes of storage: one for the
instruction code, and two for the 16-bit address
INSTRUCTION TYPES
Instruction Naming Conventions: The mnemonics assigned to the instructions are
designed to indicate the function of the instruction.
MOV Move
MVI Move Immediate
LDA Load Accumulator Directly from Memory
STA Store Accumulator Directly in Memory
LHLD Load H & L Registers Directly from Memory
SHLD Store H & L Registers Directly in Memory
An 'X' in the name of a data transfer instruction implies that it deals with a register pair
(16-bits);
Arithmetic Group:
The arithmetic instructions add, subtract, increment, or decrement data in registers or
memory.
Logical Group:
This group performs logical (Boolean) operations on data in registers and memory and on
condition flags.
The logical AND, OR, and Exclusive OR instructions enable you to set specific bits in the
accumulator ON or OFF.
The Compare instructions compare the content of an 8-bit value with the contents of the
accumulator;
CMP Compare
CPI Compare Using Immediate Data
The rotate instructions shift the contents of the accumulator one bit position to the left or
right:
RLC Rotate Accumulator Left
RRC Rotate Accumulator Right
RAL Rotate Left through Carry
RAR Rotate Right through Carry
Branch Group:
The branching instructions alter normal sequential program flow, either unconditionally
or conditionally. The unconditional branching instructions are as follows:
JMP Jump
CALL Call
RET Return
Conditional branching instructions examine the status of one of four condition flags to
determine whether the specified branch is to be executed. The conditions that may be
specified are as follows:
Microprocessors & Interfacing EC Department
NZ Not Zero (Z = 0)
Z Zero (Z = 1)
NC No Carry (C = 0)
C Carry (C = 1)
PO Parity Odd (P = 0)
PE Parity Even (P = 1)
P Plus (S = 0)
M Minus (S = 1)
MVI A, 05H 3E 05
RST 1 CF
Then enter:-
Go Address EXEC
Background:
The MICROFRIEND DYNA-85 kit is based on the INTEL 8085 designed specifically for
training & development applications.
The µP trainer kit consists of basic units required for a simple computer, namely, a
microprocessor chip (CPU), memory (EPROM, and RAM), input device (Hex / ASCII
keyboard) and output device (seven segment display unit).
Software in the form of a set of instructions written using the 8085 instruction set makes
the µP perform a set of desired operations.
It has to be borne in mind that the instructions NEEDNOT be converted into the
hexadecimal form while keying in. The mnemonics are only to be entered. The hex code of
each instruction and required no of bytes for each are automatically calculated.
Single key system commands are provided in the trainer kit for facilitating easy operation
of the kits. These commands
are described below:
<A address>→ To assemble a program i.e. Enter the instruction at the specified
address.
<Enter>→To go next address to enter another instruction
<GO> → Used for loading program counter with the memory address of the beginning
of the program and execute the program
Practical-1 DATE: / /
Aim: - A data byte is stored at location C100H. Write instructions to transfer this data byte to
accumulator using three different op-codes namely (i) MOV (ii) LDAX (iii) LDA.
Output:-
1
Microprocessors & Interfacing EC Department
Practical-2 DATE: / /
Aim: - Register B Contains 32H.Use (i) MOV (ii) STAX to copy this content tolocation D100H.
Output:-
2
Microprocessors & Interfacing EC Department
Practical-3 DATE: / /
Aim: - Add two 8 bit numbers such that numbers are stored in memory location C100H and C101H.
Store the answer in memory location C104H. Take care for carry.
Output:-
3
Microprocessors & Interfacing EC Department
Practical-4 DATE: / /
Aim: - Add two 16-bit numbers. Take data from memory and store answer in memory.
Output:-
4
Microprocessors & Interfacing EC Department
Practical-5 DATE: / /
Aim: - Block transfer. Ten bytes of data are stored in location C100H-C109H. Transfer the entire block of
data to new memory location starting at D100H.
-Output:-
5
Microprocessors & Interfacing EC Department
Practical-6 DATE: / /
Aim:-Six bytes of data are stored in memory locations starting at C100H.Add all the data bytes. Use
register B to save any carries generated, while adding data bytes. Store the sum at two consecutive
memory location.
Output:-
6
Microprocessors & Interfacing EC Department
Practical-7 DATE: / /
Aim:- Write a Program to take a data from memory location C100H. if it is greater then 7FH send it to
port 01H else send it to port 00H.
Output:-
7
Microprocessors & Interfacing EC Department
Practical-8 DATE: / /
Aim: - Write a program to take a data from location C100H & C101H. Add this data. If answer is greater
then FFH store the answer in B register else store it in C register.
Output:-
8
Microprocessors & Interfacing EC Department
Practical-9 DATE: / /
Aim: - A set of ten current readings is stored in memory locations starting at C100H. Add all the positive
readings (<12710).Reject all negative readings. Output FFH to port1 at any time when the sum exceeds
eight bits to indicate overload, otherwise Display the sum.
Output:-
9
Microprocessors & Interfacing EC Department
Practical-10 DATE: / /
Aim: - A set of Current readings is stored in memory locations starting at C100H. The end of data string
is indicated by the data byte 0DH (ASCII Code of enter).Copy this string contents at another location up
to the end of string.
Output:-
10
Microprocessors & Interfacing EC Department
Practical-11 DATE: / /
Aim: - Write a program to arrange data in descending order. Assume five bytes are stored in successive
memory locations starting from C100H.
Output:-
11
Microprocessors & Interfacing EC Department
Practical-12 DATE: / /
Aim: - Write An array of binary numbers is stored in memory starting from address C100H. There are ten
numbers in the array. Write an ALP which finds out quantity of positive no., negative no. and zeros in
the data array and stores the result in memory location starting from address C200H.
Output :-
12
Microprocessors & Interfacing EC Department
Practical-13 DATE: / /
Aim: - Ten data are stored from memory location C100H. Write a program to arrange them in odd &
even data. Store the even data first starting from C200H location.
Output:-
13
Microprocessors & Interfacing EC Department
Practical-14 DATE: / /
Output:-
14
Microprocessors & Interfacing EC Department
Practical-15 DATE: / /
Aim: -
15
Microprocessors & Interfacing EC Department
Output:-
16