0% found this document useful (0 votes)
259 views6 pages

8051 Logical Operations

The document outlines an experiment for programming logical operations using the 8051 microcontroller. It includes the aim, required software/hardware, algorithms for logical OR, AND operations, and 1's and 2's complement, along with flowcharts and assembly language programs. The programs detail memory addresses, opcodes, and comments for each operation performed.
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)
259 views6 pages

8051 Logical Operations

The document outlines an experiment for programming logical operations using the 8051 microcontroller. It includes the aim, required software/hardware, algorithms for logical OR, AND operations, and 1's and 2's complement, along with flowcharts and assembly language programs. The programs detail memory addresses, opcodes, and comments for each operation performed.
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/ 6

ET3491 Embedded Systems and IoT Design

EXP.NO:
PROGRAMMING LOGICAL OPERATIONS IN 8051
DATE:

AIM
To write an assembly language program to perform logical operations of two 8 bit
data using 8051 microcontroller.

SOFTWARE/HARDWARE REQUIRED
➢ 8051 Microcontroller kit.

ALGORITHM

Logical OR Operation

Logical AND Operation

1’s and 2’s Complement

TPGIT/ECE Page No:


ET3491 Embedded Systems and IoT Design

FLOWCHART

TPGIT/ECE Page No:


ET3491 Embedded Systems and IoT Design

PROGRAM
Logical OR Operation

Memory Opcod Label Mnemonics Comments


address e
4100 MOV A, #data1 Move data1 to A register

4102 MOV A, #data2 Move data2 to B register

4105 ORL A, B ORL A with B

4107 MOV DPTR, #4150 Move the address 4150 to DPTR

410A MOVX @DPTR,A Store result in DPTR address


410B L1 SJMP L1 (410B) Stop the program

Input Output

Address Data
Address Data

Logical AND Operation

Memory
address Opcode Label Mnemonics Comments

4100 MOV A, #data1 Move data1 to A register


4102 MOV A, #data2 Move data2 to B register

4105 ANL A, B ANL A with B

4107 MOV DPTR, #4150 Move the address 4150 to DPTR

410A MOVX @DPTR,A Store result in DPTR address


410B L1 SJMP L1 (410B) Stop the program

Input:
Address Data

TPGIT/ECE Page No:


ET3491 Embedded Systems and IoT Design

TPGIT/ECE Page No:


ET3491 Embedded Systems and IoT Design

Output:

Address Data

1’s and 2’s Complement

Memory
address Opcode Label Mnemonics Comments

4100 MOV A, #data Move the 8 bit data to accumulator.


4102 CPL A Complement the content of accumulator.
4103 MOV DPTR,#4500H Move the 16 bit address to data pointer.

4106 MOVX @DPTR,A Move the content of accumulator to the


address specified by data pointer.
4107 INC DPTR Increment data pointer.
4108 INC A Increment the content of accumulator.
4109 MOVX @DPTR,A Move the content of accumulator to the
adr specified by data pointer.
410A SJMP Short jump.

Input:
Address Data

Output:

Address Data

RESULT

TPGIT/ECE Page No:


ET3491 Embedded Systems and IoT Design

TPGIT/ECE Page No:

You might also like