You are on page 1of 10

DOC/LM/01/28.02.

02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

EC18412 MICROPROCESSOR AND MICROCONTROLLER BASED SYSTEM


DESIGN LABORATORY
OBJECTIVES:
The student should be made to:
Introduce ALP concepts and features
Write ALP for arithmetic and logical operations in 8085, 8086 and 8051
Differentiate Serial and Parallel Interface
Interface different I/Os with Microprocessors
Be familiar with MASM
LIST OF EXPERIMENTS:
8085 PROGRAMS USING KIT:
1. Basic arithmetic and Logical operations, Move a data block without overlap
8086 PROGRAMS USING KIT & MASM:
2. Code conversion, decimal arithmetic and Matrix operations.
3. String manipulations, sorting and searching
4. Counters and Time Delay
Peripherals and Interfacing Experiments:
5. Traffic light control
6. Stepper motor control
7. Digital clock
8. Key board and Display
9. Serial interface and Parallel interface
10. A/D and D/A interface and Waveform Generation
8051 Experiments using kits and MASM
11. Basic arithmetic and Logical operations
12. Find 2’s complement of a number
13. Unpacked BCD to ASCII

TOTAL: 45 PERIODS
OUTCOMES:
At the end of the course, the student should be able to:
Write ALP Programmes for fixed and Floating Point and Arithmetic
Interface different I/Os with processor
Generate waveforms using Microprocessors
Execute Programs in 8051
Explain the difference between simulator and Emulator

1
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

EX: NO:1 – ARITHMETIC AND LOGICAL OPERATIONS ON 8 BIT BINARY DATA


USING 8085 KIT

1.1 AIM:

To perform the following arithmetic operations on 8 bit binary (hex) data using 8085 kit.
a) Addition
b) Subtraction
c) Multiplication
d) Division

ALGORITHM:

1. A) ADDITION OF 8 BIT BINARY DATA:-

1. Declare the segments and clear the registers which are used.
2. Load the data in two variables.
3. Move the data to the registers.
4. Add the contents of the registers and check for the carry.
5. Store the result & carry in the memory location and display the contents of the memory
location Halt

1. B) SUBTRACTION OF 8 BIT BINARY DATA:-

1. Declare the segments and clear the registers which are used.
2. Load the data in two variables.
3. Move the data to the registers.
4. Subtract the contents of the registers and check for borrow.
5. Store the result & borrow in the memory location and display the contents of the memory
location and halt

1. C) MULTIPLICATION OF 8 BIT BINARY DATA:-

1. Declare the segments and clear the registers which are used.
2. Load the data in two variables.
3. Move the data to the registers.

2
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

4. Read data and if one of the operand is zero then go to step 6.


5. Perform multiplication.
6. Store the result and carry and halt

1. D) DIVISION OF 8 BIT BINARY DATA:-

1. Declare the segments and clear the registers which are used.
2. Load the data in two variables.
3. Move the data to the registers.
4. Clear the quotient and remainder
5. Read data and if dividend is zero then set the result as zero and go to step 8.
6. Read data and if divisor is zero the print divide by zero error and go to step 10.
7. Perform dividend / divisor.
8. Store the quotient and the reminder.
9. Display the quotient and reminder .Halt

8085 ALP TO ADD TWO 8 BIT NUMBERS USING 8085 KIT

Address Label Mnemonics Opcode Comments


8800 MVI C,00 0E,00 Put the value 00 in C register
8802 LDA 8900 3A,00,89 Load accumulator value in 8900
8805 MOV B,A 47 Move the A value to B register
8806 LDA 8901 3A,01,89 Load A again in 8901
8809 ADD B 80 Add A & B
880A JNC L1 D2,0E,88 If no carry jump to L1
880D INR C 0C Increment C register by 1
880E L1 STA 8902 32,02,89 Store the sum value in 8902
8811 MOV A,C 79 Move the value of C to
Accumulator
8812 STA 8903 32,03,89 Store the carry value in 8903
8815 HLT 76 Stop the program

3
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

Output using 8085 kit:

Input address Input data Output address Output data


8900 1A 8902 49 (sum)
8901 2F 8903 00 (carry)

8085 ALP TO SUBTRACT TWO 8 BIT NUMBERS USING 8085 KIT

Address Label Mnemonics Opcode Comments


8800 MVI C,00 0E,00 Put the value 00 in C register
8802 LDA 8900 3A,00,89 Load accumulator value in 8900

8805 MOV B,A 47 Move the A value to B register


8806 LDA 8901 3A,01,89 Load A again in 8901
8809 SUB B 90 Add A & B
880A JNC L1 D2,10,88 If no carry jump to L1
880D INR C 0C Increment C register by 1
880E CMA A BF Complement A register
880F INR A 3C Increment C register
8810 L1 STA 8902 32,02,89 Store the difference value in 8902
8813 MOV A,C 79 Move the value of C to
Accumulator
8814 STA 8903 32,03,89 Store the borrow value in 8903
8817 HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 8D 8903 0F (difference)
8901 7E 8904 00 (borrow)

4
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

8085 ALP TO MULTIPLY TWO 8 BIT NUMBERS USING 8085 KIT

Address Label Mnemonics Opcode Comments


8800 MVI C,00 0E,00 Put the value 00 in C register

8802 LDA 8900 3A,00,89 Load accumulator value in 8900


8805 MOV B,A 47 Move the A value to B register
8806 LDA 8901 3A,01,89 Load A again in 8901
8809 MOV D,A 57 Move the value in A to D register
880A MVI A,00 3E,00 Store the immediate value 00 in A register
880C L2 ADD B 80 Add A & B
880D JNC L1 D2,15,88 If no carry jump to L1
8810 INR C 0C Increment C register by 1
8811 DCR D 15 Decrement D register
8812 JNZ L2 C2,0C,88 Increment C register
8815 L1 STA 8902 32,02,89 Store the lower byte value in 8902
8818 MOV A,C 79 Move the value of C to Accumulator
8819 STA 8903 32,03,89 Store the higher byte value in 8903
881C HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 BF 8902 FB (lower byte)
8901 EF 8903 A8 (upper byte)

5
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

8085 ALP TO DIVIDE TWO 8 BIT NUMBERS USING 8085 KIT

Address Label Mnemonics Opcode Comments


8800 MVI C,00 0E,00 Put the value 00 in C register

8802 LDA 8900 3A,00,89 Load accumulator value in 8900


8805 MOV B,A 47 Move the A value to B register
8806 LDA 8901 3A,01,89 Load A again in 8901
8809 L2 CMP B B8 Compare A & B register
880A JC L1 DA,12,88 If carry jump to L1
880D SUB B 90 Sub A & B
880E INR C 0C Increment C register by 1
880F JMP L2 C2,09,88 Jump to L2
8812 L1 STA 8902 32,02,89 Store the quotient value in 8902
8815 MOV A,C 79 Move the value of C to Accumulator
8816 STA 8903 32,03,89 Store the remainder value in 8903
8819 HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 08 8902 02 (Quotient)
8901 04 8903 00 (Remainder)

RESULT:

Thus 8085 ALP to perform arithmetic operations like addition, subtraction, multiplication
& division on 8 bit binary (hex) data was executed using 8085 kit.

6
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

1.2 .AIM :
To perform the following basic logical operations on 8 bit binary (hex) data using 8085 kit.

a) Logical OR
b) Logical AND
c) Logical XOR
d) Logical NOT
PROGRAM TO PERFORM BASIC LOGICAL AND OPERATION

Address Label Mnemonics Opcode Comments


8800 LDA 8900 3A,00,89 Load accumulator value in 8900
8803 MOV B,A 47 Move the A value to B register
8804 LDA 8901 3A,01,89 Load A again in 8901
8807 ANA B AC AND A & B
8808 STA 8902 32,02,89 Store the result value in 8902
880B HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 1D 8902 15
8901 57

PROGRAM TO PERFORM BASIC LOGICAL OR OPERATION

Address Label Mnemonics Opcode Comments


8800 LDA 8900 3A,00,89 Load accumulator value in 8900
8803 MOV B,A 47 Move the A value to B register
8804 LDA 8901 3A,01,89 Load A again in 8901
8807 ORA B B0 OR A & B
8808 STA 8902 32,02,89 Store the result value in 8902
880B HLT 76 Stop the program

7
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

Output using 8085 kit:

Input address Input data Output address Output data


8900 3E 8902 7E
8901 4E

PROGRAM TO PERFORM BASIC LOGICAL EX-OR OPERATION

Address Label Mnemonics Opcode Comments


8800 LDA 8900 3A,00,89 Load accumulator value in 8900
8803 MOV B,A 47 Move the A value to B register
8804 LDA 8901 3A,01,89 Load A again in 8901
8807 XRA B A8 XOR A & B
8808 STA 8902 32,02,89 Store the result value in 8902
880B HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 3D 8902 11
8901 2C

PROGRAM TO PERFORM BASIC LOGICAL NOT OPERATION

Address Label Mnemonics Opcode Comments


8800 LDA 8900 3A,00,89 Load accumulator value in 8900
8803 CMA A 2F Complement the value in A reg.
8804 STA 8901 32,01,89 Store the result value in 8901
8807 HLT 76 Stop the program

Output using 8085 kit:

Input address Input data Output address Output data


8900 7C 8901 83

8
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

EX:NO:2. BLOCK TRANSFER OF DATA WITHOUT OVERLAP

AIM:
To move a data block from source to destination without overlap using 8085 kit.

ALGORITHM :
1. Start.
2. Load the accumulator with no. Of elements as input.
3. Move the content of A to C register.
4. Load the desired inputs to HL register.
5. Load the desired inputs to DE register.
6. Load the inputs through the accumulator.
7. Store the contents of A in DE register.
8. Increment HL,DE register.
9. Decrement C register.
10. Repeat the steps.
11. Stop the program.

PROGRAM:

Address Label Mnemonics Opcode Comments


8800 LDA 8900 3A,00,89 Accumulator is loaded with input
8803 MOV C,A 4F Content of A is moved to C register
8804 LXIH, 8A00 21,00,8A Source location is loaded
8807 LXID, 8B00 11,00,8B Destination location is loaded
880A L1 LDAX M 7E Input is loaded
880B STAX D 12 Data in A is stored in DE register
880C INX H 23 HL register pair is incremented by 1
880D INX D 13 DE register pair is incremented by 1
880E DCR C 0D Decrement C register by 1
880F JNZ L1 C2,0A,88 If no zero, jump to L1
8812 HLT 76 Stop the program

9
DOC/LM/01/28.02.02

Lab Manual LM- EC18412


EC18412 MICROPROCESSOR AND MICRO Revision No:00
CONTROLLER BASED SYSTEM DESIGN Date:26/11/2019
LABORATORY
BRANCH: ECE SEM: IV

Sample Input and Output:

Source array Destination array


Address Data Address Data
8900 06(count) 8B00 AA
8A00 AA 8B01 BB
8A01 BB 8B02 CC
8A02 CC 8B03 DD
8A03 DD 8B04 EE
8A04 EE 8B05 FF
8A05 FF

RESULT:

Thus an 8085 ALP to move a block of data bytes from source to destiantion was
executed in 8085 kit.

10

You might also like