Professional Documents
Culture Documents
Task 1
Task 1
01 21BEC0816
sl.no. : No. :
Class ID : VL2022230502426
MICROPROCESSORS
Theory
Course Name: AND C1+TC1
Sl.no. :
MICROCONTROLLERS
Date of
Date of Exp. : 18/01/2023 Submissio 18/01/2023
n:
TRA Faculty
Name and Dr. Prachi Sharma
Mobile no. :
Task No.: 1
School of Electronics Engineering
VIT, Vellore
Contents/Index of Task I:
1 AIM 03
2 Tools Required 03
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
3 Algorithm 03
4 Flowchart 04
6 Manual Calculation 05
8 Inference 07
9 Result 08
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 2 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
Aim :
Write a program to calculate y where y = x2 + 2x + 7. x is between 0 and 9 and the look-up table
for x2 is located at the address (code space) of 200H. Register R0 has the x, and at the end of
the program, R2 should have y. Use the simulator to change the x value and single-step through
the program, examining the registers as you go.
Tools Required:
Offline/ Online tools: http://www.edsim51.com/ , https://www.electronicshub.org/8051-
simulators/ , https://www.keil.com/download/product/
https://www.edgefxtech.com/blog/8051-microcontroller-simulator-and-emulator/
https://www.onworks.net/software/app-gsim51-8051-microcontroller-simulator
Algorithm:
1. ORG TO BE 0
2. REGISTER TO BE DATA AS 5
3. REGISTER TO BE DATA AS 1
4. By MOV Command, data in accumulator R0 is assigned.
5. By MOV Command, data in accumulator R1 is assigned.
6. ADD R1 and A and store the data in A using ADDC.
7. This results in 2x term.
8. By MOVC, x2 is formed.
9. By ADDC, add x2 and 2x term and also adding 7 in it.
10. Finally, Result is taken in R2.
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 3 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
Flow Chart:
Program:
ORG 0000H
MOV A,#05D ; AYUSH SINHA(21BEC0816)
MOV B,#01D
MOV R0,A
MOV R1,A
ADDC A,R1
MOV R1,A
MOVC A,@A+DPTR
ADDC A,R1
ADD A,#07D
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 4 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
MOV R2,A
ORG 0200H
DB 00D,01D,04D,09D,16D,25D,36D,49D,64D,81D,100D
END
https://tinyurl.com/sample-1c-ALP
Manual Calculation:
Y=02+2*0+7=7 for x=0 Y=12+2*1+7=10 for x=1
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 5 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
Snip (use SNIPPING TOOL) of the 8051 Assembly level Program with comments and
registers before execution:
Snip of the 8051 Assembly level Program with comments and registers after execution:
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 6 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 7 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
5. List the flags and registers affected and show the contents before and after execution of each
instruction of ALP.
Result: The 8051 ALP to perform addition of 5 8-BIT NUMBERS is executed using keil
software and the results are verified using manual calculation.
Self-Declaration:
Self-attestation and Declaration of not using/submission of the same content for awarding a degree or diploma
must be done by the student at the end.
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 8 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 9 of 10
Photo: Email id: Mobile number:
Lab Slot: L49+L50 L Sl.no. : Name in caps: AYUSH SINHA
WIN 2022-23 Theory Slot: C1/TC1 T Sl. No. : Reg no: 21BEC0816
REFRENCE:
1. https://www.silabs.com/documents/public/presentations/8051_Instruction_Set.pdf
2. https://www.win.tue.nl/~aeb/comp/8051/set8051.html
3. https://www.keil.com/support/man/docs/is51/
4. https://www.keil.com/support/man/docs/is51/is51_opcodes.htm
5. https://www.javatpoint.com/embedded-system-8051-instruction-set
6. https://www.engineersgarage.com/8051-instruction-set/
7. https://ww1.microchip.com/downloads/en/DeviceDoc/doc0509.pdf
SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 10 of 10
Photo: Email id: Mobile number: