0% found this document useful (0 votes)
5 views7 pages

EXP 1 - MC

The document outlines an experiment to write and execute an assembly language program for performing addition, subtraction, multiplication, and division of two 8-bit numbers using the 8051 microcontroller and Keil software. It includes the aim, objectives, equipment needed, algorithm, and detailed assembly code for each arithmetic operation. The conclusion indicates successful implementation and understanding of basic operations on 8-bit binary numbers.

Uploaded by

vivan.ubale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

EXP 1 - MC

The document outlines an experiment to write and execute an assembly language program for performing addition, subtraction, multiplication, and division of two 8-bit numbers using the 8051 microcontroller and Keil software. It includes the aim, objectives, equipment needed, algorithm, and detailed assembly code for each arithmetic operation. The conclusion indicates successful implementation and understanding of basic operations on 8-bit binary numbers.

Uploaded by

vivan.ubale
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

EXPERIMENT NO.

1
WRITE AND EXECUTE AN ASSEMBLY LANGUAGE PROGRAM TO
PERFORM ADDITION, SUBTRACTION, MULTIPLICATION &
DIVISION OPERATION OF TWO 8 BIT NUMBERS USING 8051 AND
KEIL SOFTWARE

Name : PRAVEEN SHUKLA


Roll no: 123A2045
Div: A (SE – EXTC)

AIM: - Write and execute an assembly language program for addition of two 8
bit numbers using 8051

OBJECTIVE:
· Students will be able to write program for performing addition operation for
two 8 bit numbers using 8051 Microcontroller and keil IDE.
· Students will be able to verify the result of addition along with the status of
flag bits in the PSW register.
· Students will be able to learn the Keil software and simulation.

EQUIPMENT: 8051 Kit ,Computer/Laptop, Keil IDE Software.

ALGORITHM:
1. Load the two 8-bit numbers in the memory/registers
2. Perform arithmetic operations
3. Check the result

THEORY:
1. DPTR (data pointer ) which is of the 16 bit and consists of DPH and
DPL
PROGRAM:
1.Performing addition operation
`Address:OPCODE INSTRUCTIONS COMMENTS

AC000 To locate the specific


address
C000:90D000 MOV DPTR, #D000H Moving the program to
DPTR
C003:E0 MOV A, @DPTR Take the value of
variable A in DPTR
C004:F8 MOV R0, A Moving the value in A
to R0 in register bank
C005:A3 INC DPTR Incrementing the DPTR
for next instruction
C006:E0 MOV A, @DPTR Take the value in
variable A
C007:28 ADD A,R0 Perform Addition
operation between A ,
R0
C008:A3 INC DPTR Incrementing the DPTR
for next instruction i.e
output value
C009:F0 MOVX @DPTR R0, A Moving the value in
register bank for
displaying the output
C00A:021770 LJMP 6000 3-byte instruction in
which the first byte
represents opcode, and
the second and third
bytes represent the 16-
bit address of the target
location

2. Performing subtraction operation


`Address:OPCODE INSTRUCTIONS COMMENTS

AC000 To locate the specific


address
C000:90D000 MOV DPTR, #D000H Moving the program to
DPTR
C003:E0 MOV A, @DPTR Take the value in
variable A
C004:F8 MOV R0, A Moving the value in A
to R0 in register bank
C005:A3 INC DPTR Incrementing the DPTR
for next instruction
C006:E0 MOV A, @DPTR Take the value of
variable A in DPTR
C007:98 SUBB A,R0 Perform logical
Subtraction operation
between A , R0
C008:A3 INC DPTR Incrementing the DPTR
for next instruction i.e
output value
C009:F0 MOVX @DPTR R0, A Moving the value in
register bank for
displaying the output
C00A:021770 LJMP 6000 3-byte instruction in
which the first byte
represents opcode, and
the second and third
bytes represent the 16-
bit address of the target
location

3. Performing multiplication operation


`Address:OPCODE INSTRUCTIONS COMMENTS

AC000 To locate the specific


address
C000:90D000 MOV DPTR, #D000H Moving the program to
DPTR
C003:E0 MOV A, @DPTR Take the value in
variable A
C004:F5F0 MOV 0F0H , A Moving the value in A
to R0 in register bank
C006:A3 INC DPTR Incrementing the DPTR
for next instruction
C007:E0 MOV A, @DPTR Take the value of
variable A in DPTR
C008:A4 MUL A, B Perform Multiplication
operation between A , b
C009:A3 INC DPTR Incrementing the DPTR
for next instruction i.e
output value
C00A:E5F0 MOV A,B Moving the value of
both a,b in external
memory
C00C:F0 MOVX @DPTR 0F0H, Moving the value in
A register bank for
displaying the output
C00D:021770 LJMP 6000 3-byte instruction in
which the first byte
represents opcode, and
the second and third
bytes represent the 16-
bit address of the target
location

4.Performing division operation

`Address:OPCODE INSTRUCTIONS COMMENTS

AC000 To locate the specific


address
C000:90D000 MOV DPTR, #D000H Moving the program to
DPTR
C003:E0 MOV A, @DPTR Take the value in
variable A
C004:F5F0 MOV 0F0H , A Moving the value in A
to R0 in register bank
C006:A3 INC DPTR Incrementing the DPTR
for next instruction
C007:E0 MOV A, @DPTR Take the value of
variable A in DPTR
C008:A4 DIV A, B Perform division
operation between A , B
C009:A3 INC DPTR Incrementing the DPTR
for next instruction i.e
output value
C00A:E5F0 MOV A,B Moving the value of
both a,b in external
memory
C00C:F0 MOVX @DPTR 0F0H, Moving the value in
A register bank for
displaying the output
C00D:021770 LJMP 6000 3-byte instruction in
which the first byte
represents opcode, and
the second and third
bytes represent the 16-
bit address of the target
location

Output screenshot :
Conclusion : we have successfully implemented the basic operation on
8 bit binary number and understood the terms in microprocessor

You might also like