Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

8051 Microcontroller Lab Manual – Complete Practical Programs with Output

Rating
-
Sold
-
Pages
9
Grade
A+
Uploaded on
29-05-2025
Written in
2024/2025

This document contains complete 8051 microcontroller practical programs written in Assembly language and/or Embedded C. It is designed specifically for students pursuing B.Tech, Diploma, or Polytechnic courses in Electronics, Electrical, or Computer Science Engineering. Well-documented 8051 programs for core lab experiments

Show more Read less
Institution
Course

Content preview

EXPERIMENT 3
A. Addition of two 8-bit data
ORG 0000H ; Set the starting address to 0000H
MOV A,30H ; Move the value from memory location 30H into accumulator A
MOV B,31H ; Move the value from memory location 31H into register B
ADD A,B ; Add the contents of register B to the value in accumulator A. Result gets stored in A
MOV 32H,A ; Store the result of the addition (SUM) into memory location 32H
JNC SKIP ; If no carry occurs (CY=0), Jump to the label SKIP
MOV A,#01H ; If carry occurs (CY=1), load the immediate value 01H into accumulator A
SJMP STOP ; Unconditionally jump to the label STOP to terminate further processing
SKIP: MOV A,#00H ; At label SKIP, load the immediate value 00H into accumulator A (no carry case)
STOP: MOV 33H,A ; At label STOP, store the value of CARRY (either 00H or 01H) into memory location 33H
SJMP $ ; Infinite loop to stop program execution
END ; End of the program



EXPERIMENT 3
B. Subtraction of two 8-bit data
ORG 0000H ; Set the starting address to 0000H
MOV A,40H ; Load the value from memory location 40H into accumulator A
MOV B,41H ; Load the value from memory location 41H into register B
CLR C ; Clear the carry flag (ensure no borrow occurs initially)
SUBB A,B ; Subtract the contents of register B from A
MOV 42H,A ; Store the result of the subtraction (DIFFERENCE) into memory location 42H
JNC SKIP ; If no borrow occurs (CY=0), jump to the label SKIP
MOV A,#01H ; If a borrow occurs (CY=1), load the immediate value 01H into accumulator A
SJMP STOP ; Unconditionally jump to the label STOP to terminate further processing
SKIP: MOV A,#00H ; At label SKIP, load the immediate value 00H into accumulator A (no borrow case)
STOP: MOV 43H,A ; At label STOP, store the value of BORROW (either 00H or 01H) into memory location 43H
SJMP $ ; Infinite loop to stop program execution (halts at the STOP label)
END ; End of the program

, EXPERIMENT 3
C. Multiplication of two 8-bit data
ORG 0000H ; Set the starting address to 0000H
MOV A,50H ; Load the value from memory location 50H into accumulator A
MOV B,51H ; Load the value from memory location 51H into register B
MUL AB ; Multiply the contents of A and B (A * B) and stored in A (lower byte) and B (higher byte).
MOV 52H,A ; Store the lower byte of the multiplication result (from A) into memory location 52H
MOV 53H,B ; Store the higher byte of the multiplication result (from B) into memory location 53H
SJMP $ ; Infinite loop to stop program execution (halts at this line)
END ; End of the program



EXPERIMENT 3
D. Multiplication of two 8-bit data
ORG 0000H ; Set the starting address to 0000H
MOV A,60H ; Load the value from memory location 60H into accumulator A (dividend)
MOV B,61H ; Load the value from memory location 61H into register B (divisor)
DIV AB ; Perform division: divide the value in A by the value in B and quotient is stored in A, and the
remainder is stored in B
MOV 62H,A ; Store the quotient (result of division) from A into memory location 62H
MOV 63H,B ; Store the remainder from B into memory location 63H
SJMP $ ; Infinite loop to stop program execution (halts here)
END ; End of the program

Written for

Course

Document information

Uploaded on
May 29, 2025
Number of pages
9
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$5.29
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
asizz

Also available in package deal

Get to know the seller

Seller avatar
asizz karpagam college of engineering
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
7
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions