Write Up 8051 Addition
Write Up 8051 Addition
– 6
Title: Addition of Two 8-bit numbers
Aim: Write an 8051 Microcontroller program for Addition/Subtraction of two 8 and 16-bit numbers
(Using Registers & Memory).
Theory:
Explain the instruction / Assembler directive and Identify Addressing mode
● Mov a, @R0
● add a, @r0
● org 0000h
Algorithm:
Write the algorithm for addition of Two 8 bit and 16 bit numbers stored in internal RAM
Input: Two 8 bit numbers stored in any internal RAM location.
Output: Result of addition of Two 8 bit numbers stored in any register R0 to R7.
Conclusion: Internal memory accesses are studied by performing addition of 8 bit numbers stored in
internal memory
FAQs:
1) What is the difference between the following two instructions in terms of addressing mode and
function performed?
MOV A, #46H, MOV A, 46H
2) What address is assigned to register A and B?
3) Differentiate between Microprocessor and Microcontroller.
4) Explain DJNZ with examples.
References:
1. Ayala,” The 8051 Micro Controller 3rd Edition”, IE
2. Mazidi M. Gillipse J. “The 8051 Microcontroller and Embedded Systems”, Pearson
Education, 2002, ISBN-81-7808-574-7