Skip to Main Content
8051 Microcontroller (Internals, Instructions, Programming and Interfacing)
book

8051 Microcontroller (Internals, Instructions, Programming and Interfacing)

by Subrata Ghosal
May 2024
Intermediate to advanced content levelIntermediate to advanced
503 pages
17h 2m
English
Pearson India
Content preview from 8051 Microcontroller (Internals, Instructions, Programming and Interfacing)
58
ARITHMETIC OPERATIONS
Example 5.1
Purpose: To visualize complete data fl ow along with data processing.
Problem
Assume that memory locations, 04H and 05H, contain two unsigned 8-bit numbers. Write a program to add
these two numbers and store it in memory location 30H. Assume that register bank #0 is selected.
Solution
Locations 04H and 05H become R4 and R5 of the current bank, respectively.  erefore, following steps may
be planned:
Step 1: Copy one operand, say R4, in the accumulator.
Step 2: Add the accumulator with the other operand, that is R5.
Step 3: Copy the result in the accumulator to location 30H.
Following instructions are necessar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

8051 Microcontroller, Internals, Instructions, Programming and Interfacing, 2nd Edition

8051 Microcontroller, Internals, Instructions, Programming and Interfacing, 2nd Edition

Subrata Ghoshal

Publisher Resources

ISBN: 9781282655034Publisher Website