0% found this document useful (0 votes)
6 views14 pages

Embedded Intro+Expt No 1

The document outlines an assembly language program for the 8051 microcontroller, focusing on arithmetic, logical, branching, and loop operations. It includes specific programs for addition, subtraction, multiplication, division, and logical operations like AND, OR, and XOR, as well as a looping example. Additionally, it poses questions for a viva related to the features and functionalities of the 8051 microcontroller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views14 pages

Embedded Intro+Expt No 1

The document outlines an assembly language program for the 8051 microcontroller, focusing on arithmetic, logical, branching, and loop operations. It includes specific programs for addition, subtraction, multiplication, division, and logical operations like AND, OR, and XOR, as well as a looping example. Additionally, it poses questions for a viva related to the features and functionalities of the 8051 microcontroller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

EXP1: Programming using Arithmetic, Logical, branching, and loop

operations by 8051 Microcontroller.


AIM: To write an Assembly Language Program to perform Arithmetic, Logical, branching, and
loop instructions of 8051
APPARATUS:
1. Lab Computer

2. Keil Software

PROCEDURE:

ARITHMETIC OPERATIONS

Program: 8 Bit Addition

ORG 00h
MOV A,#12
MOV B,#45
ADD A,B
END
Program: 8 Bit Subtraction

ORG 00h
MOV A,#45
MOV B,#15
SUBB A,B
END
Program: 8 Bit Multiplication

ORG 00h
MOV A,#12h
MOV B,#12h
MUL AB
END
Program: 8 Bit Division

ORG 00h
MOV A,#45h
MOV B,#05h
DIV AB
ENDS
LOGICAL OPERATIONS

Program: AND Operation

ORG 00h
MOV A,#22h
MOV R0,#0Fh
ANL A,R0
END
Program: OR Operation

ORG 00h
MOV A,#22h
MOV R0,#0Fh
ORL A,R0
END
Program: XOR Operation

ORG 00h
MOV A,#22h
MOV R0,#0Fh
XRL A,R0
END
Program: Bit Manipulation Instructions

ORG 00h
MOV A,#55h
CPL A
END
BRANCHING AND LOOP OPERATIONS

Program: Write a program to add 2 to register A 100 times using looping.

ORG 00h
MOV A, #00
MOV R1, #100
LOOP: ADD A, #02
DJNZ R1, LOOP
END

RESULT: Programming using arithmetic, logical, branching, and loop instructions of 8051

Viva:
1) What are the features of 8051 microcontrollers?
2) Explain PSW?
3) What are bank registers?
4) What is internal memory in 8051?
5) Explain about shift and rotate instruction?

You might also like