Professional Documents
Culture Documents
Es& Iot Design Lab-Exp No.1
Es& Iot Design Lab-Exp No.1
LABORATORY MANUAL
PREPARED BY APPROVED BY
LIST OF EXPERIMENTS:
CYCLE I
1. Programming Arithmetic and Logical Operations in 8051.
2. Generation of Square waveform using 8051.
3. Programming using On–Chip ports in 8051.
4. Programming using Serial Ports in 8051.
5. Design of a Digital Clock using Timers/Counters in 8051.
6. Interfacing ADC and DAC
7. Blinking of LEDs and LCD
8. Interfacing keyboard and Stepper Motor
CYCLE II
AIM:
To write and execute assembly language programs for Addition, Subtraction,
Multiplication, Division, AND & OR operation using an 8051 microcontroller.
APPARATUS REQUIRED:
S.NO APPRATAUS NAME RANGE QUANTITY
1. 8051 Microcontroller Kit - 01
2. Power Supply Unit 5V 01
ALGORITHM:
ADDITION:
1. Clear carry
2. Move data1 to accumulator
3. Add data2 with accumulator.
4. Move content in memory location to DPTR.
5. Increment DPTR.
6. Add with carry
7. Move data to the DPTR location
8. Stop the program.
PROGRAM:
ADDITION:
ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS
8100 C3 CLR C Clear Carry
8101 74,04 MOV A, #DATA1 Move data1 to acc
8103 24,02 ADD A, #DATA2 Add data2 with acc
90,85,0 DPTR, Move content in 4500 to
8105 MOV
0 #8500h DPTR.
Move data to DPTR
8108 FO MOVX @DPTR, A
location
8109 A3 INC DPTR Increment DPTR
810A 74,12 MOV A, #DATA1 Move data1 to acc
810C 34,56 ADDC A, #DATA2 Add with carry
Move data to DPTR
810E FO MOVX @DPTR, A
location
SUBTRACTION: MULTIPLICATION
TABULATION:
SUBTRACTION
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
TABULATION:
MULTIPLICATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
SUBTRACTION: MULTIPLICATION:
1. Clear carry 1. Move data1 to accumulator
2. Move data1 to accumulator 2. Move data2 to B reg.
3. Subtract data2 with accumulator. 3. Multiply accumulator with B reg.
4. Move content in memory location 4. Move content in memory location
to DPTR. to DPTR.
5. Move data to DPTR location 5. Move data to DPTR location
6. Stop the program. 6. Increment DPTR
7. Move Content of B reg to
accumulator.
8. Stop the program.
PROGRAM:
SUBTRACTION:
PROGRAM:
MULTIPLICATION:
ADDRESS LABEL OPCODE MNEMONICS OPERAND COMMENTS
A,
8100 74,0A MOV Move data01 to acc
#DATA01
75, F0, B,
8102 MOV Move data02 to B reg
88 #DATA02
8105 A4 MUL AB Add data2 with acc
90,85,0 DPTR,#85 Move content in 4500 to
8106 MOV
0 00h DPTR.
Move acc value to DPTR
8109 FO MOVX @DPTR, A
location
TABULATION:
DIVISION
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
ALGORITHM:
DIVISION: AND OPERATION:
1. Move data1 to accumulator 1. Move data1 to accumulator
2. Move data2 to B reg. 2. Do AND operation between data1
3. Divide accumulator with B reg. & data2.
4. Move content in memory location to 3. Move content in memory location
DPTR. to DPTR.
5. Move data to DPTR location 4. Move data to DPTR location
6. Increment DPTR 5. Stop the program.
7. Move Content of B reg to
accumulator.
8. Stop the program.
PROGRAM:
DIVISION:
FLOWCHART:
OR OPERATION:
TABULATION:
OR OPERATION:
INPUT OUTPUT
ADDRESS DATA ADDRESS DATA
PROGRAM:
OR OPERATION:
VIVA VOCE:
1. What is the difference between microprocessor and microcontroller?
2. Why is microcontroller 8051 called as 8 bit controller?
3. Name any 2 logical operation instructions.
4. Explain about the instruction SJMP
RESULT:
Thus assembly language program for Addition, Subtraction, Multiplication,
Division, AND & OR operation has been written and executed successfully
using 8051 microcontrollers.