Академический Документы
Профессиональный Документы
Культура Документы
START
STOP
Page 40
OBJECTIVE
To write an assembly language program to add, subtract, multiply and divide two 8-bit &
16-bit numbers using 8051 microcontroller.
LEARNING OUTCOMES
Page 41
IN LAB WORK
PROGRAM
START CLR C
MOV A,#04
ADDC A,#05
MOV DPTR,#4500
MOVX @DPTR,A
INPUT
OUTPUT
START
STOP
Page 42
IN LAB WORK
PROGRAM
START CLR C
MOV A,#08
MOV R1,#04
SUBB A,R1
MOV DPTR,#4500
MOVX @DPTR,A
OUTPUT
Page 43
FLOWCHART
START
STOP
Page 44
IN LAB WORK
PROGRAM
MOV B,#01
MUL AB
MOV DPTR,#4500
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @DPTR,A
STOP SJMP 410E
INPUT OUTPUT
Page 45
FLOWCHART
START
STOP
Page 46
IN LAB WORK
PROGRAM
ADDRESS LABEL MNEMONICS HEXCODES COMMENTS
MOV B,#01
DIV AB
MOV DPTR,#4500
MOVX @DPTR,A
INC DPTR
MOV A,B
MOVX @DPTR,A
STOP SJMP 410E
INPUT
OUTPUT
Page 47
FLOWCHART
Start
Stop
Page 48
IN LAB WORK
PROGRAM
CLR C
MOV A,#20
ADD A,#52
MOV DPTR,#4200
MOV X@DPTR,A
INC DPTR
MOV A,#12
ADD A,#56
MOV X@DPTR,A
SJMP 410F
Page 49
INPUT
OUTPUT
Page 50
FLOWCHART
Start
Stop
Page 51
EXPERIMENTAL SETUP
DISCUSSION OF RESULTS
1. Illustrate the difference between clock frequency and scan frequency?
2. How the program memory is organized in 8051 base d system?
Page 52
VIVA VOCE
1. Name the five interrupt sources of 8051?
2. Explain the contents of the accumulator after the execution of the following program
segments:
3. Write a program to load accumulator A, DPH and DPL with 30H.
4. What is the difference between the Microprocessors and Microcontrollers?
RESULT
Thus the programs to add, subtract, multiply and divide two 8-bit numbers using 8051
microcontroller is executed and the outputs are verified.
Page 53