Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

Lab Reg.

01 21BEC0816
sl.no. : No. :

Student Name : Ayush Sinha

Class ID : VL2022230502426

Course Code : BECE204P Slot & Semester : L49+L50

MICROPROCESSORS
Theory
Course Name: AND C1+TC1
Sl.no. :
MICROCONTROLLERS

Program Title : B.tech in ECE

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:

Sl.no. Components Page. nos. Check


marks

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

5 Program with comments 04

6 Manual Calculation 05

7 Output –Register contents before 06


and after every line executed

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

Output: Registers containing the Result:


(ex R0=05H, A=04AH)

Manual Calculation:
Y=02+2*0+7=7 for x=0 Y=12+2*1+7=10 for x=1

Similarly, We will go from x=0 to 9 to get different values of y.

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

Results and Observations

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

Inferences: *Answer the five questions neatly with 100 % clarity.


1. Calculate the amount of time required to perform the task assembly level program.

2. Calculate the Amount of memory required to store 8051 MC ALP in memory.

3. List the addressing modes used in each instruction of 8051 ALP.

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

4. List the type of instruction used in ALP.

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.

Step 1: Kindly download the Template and upload in your G drive.


Step 2: Upload in docs.google.com opened with your official mail id.
Step 3: Enter /update your details in the name and header footer.
Step 4: Create a Tinyurl link for sharing the file with <Slot><sl.no.><your reg.no.>_Task
<no.>
Step 5: Upload in LAB record for verification and approval by respective TRA.
Step 6: Kindly upload the Tinyurl link in Google sheet.
ASCII CHART for reference

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

APP and SOFTWARE TOOLS:


1. https://play.google.com/store/apps/details?id=com.peterhohsy.C8051_studio&hl=en_US&gl=US&pli=1
2. https://roboticelectronics.in/edsim51-simulator/
3. https://www.silabs.com/developers/8-bit-8051-microcontroller-software-studio
4. https://8051-ide.informer.com/
5. https://www.microchip.com/en-us/tools-resources/develop/mplab-x-ide

SENSE, VIT BECE204P - 𝜇C and its applications LAB Date: Dec 17, 2022 Page 10 of 10
Photo: Email id: Mobile number:

You might also like