New Member FAQ
|
Forums
|
Earn Revenue
|
Distance Education
|
Help Topics
|
Admissions 2013
Login
Register
Articles
Practice Tests
Ask Experts
Question Papers
Jobs
Universities
Colleges
Courses
Schools
Gift Shop
|
Bookmarks
|
Reviews
|
Learn English
|
Social Hub
|
Training
|
New Posts
|
My India
|
Members
|
Polls
|
Active Members
Today
mahi patel
(370)
R Pramod
(229)
Stalin.J
(135)
Last 7 Days
R Pramod
(1035)
K Mohan
(761)
yash
(534)
more...
Resources
»
Articles/Knowledge Sharing
»
Education
Microcontroller 8051 Addressing modes ( With Examples )
Posted Date:
04-Aug-2009
Category:
Education
Author:
Poonia Boy
Member Level:
Gold
Points
: 25
Dear Reader,
If you are interested in hardware field, then one of the most important thing you must know before going forward in the field is addressing modes because if you are not familier with addressing modes then you cannot program a device or circuit, no matter how intelligent you are ? Here I am going to tell you addressing modes of 8051.
These modes are applicable to whole 8086 family including microprocessors of the given family, thus these are very important for hardware designing and programming.
The 8051's addressing modes are designed from the perspective that data-access priority should reflect how the data is to be accessed. In most applications, very few variables are accessed a lot, some quite a bit, and most quite infrequently. In designing 8051 Intel used this philosophy to specify the single-byte/12-clock-cycle instruction cycle for determining how data would be accessed.
The four modes which can be used for addressing any variable in microcontroller memory are explained below :-
Immediate Addressing
The first addresing mode is basically not an addressing mode, it is just a method to pass the value to be executed as part of the instruction. The immediate value is specified by placing a '#' character in front of the immediate value to be passed. For example look at the following instruction : -
add A, #77 ; add 77 to the accumulator
this instruction will add 77 (decimal) to the contents of the accumulator and store the result in accumulator. This method is used when we are required to pass certain integer values into calculation like multiplication and division.
Bank Addressing
Bank addressing mode allows programmer to access a byte in the current register bank. This is most efficient ( both in terms of clock cycle and control store ) method of accessing data. Most register instruction execute in one register cycle and only require one byte to execute the instruction. The 8 bytes are known as R0 through R7. For example
add A, R2 ;add content of R2 to accumulator and store result in accumulator
Direct Memory Addressing
It differs from register addressing in that any byte within the first 256 addresses can be accessed by specifying 8-bit address. When using this mode, there are few things watch out for. The first RAM addresses ( 080h to 0FFh, if the device you are using has RAM at these locations ) cannot be accessed by direct memory addressing. If you specify an instruction like : mov A, 088h
You wil load the accumulator with the contents of the TCON register located at address 088h rather than the contents of RAM byte.
Register Indirect Addressing
As the name indicates it is an indirect mode of addressing. It user R0 or R1 as an 8-bit index register to access a byte in the first 256 addresses of the data space. As : -
orl A, @R0
The register indirect addressing mode is identified by the symbol '@' before either R0 or R1. Using any other bank (R2 to R7) will result in an error. This is all about the addressing in 8051 microcontroller. I think the information is useful to you.
Best Regards,
Sunil Saharan Working for an ideal and peaceful society.
Did you like this resource? Share it with your friends and show your love!
Tweet
Responses to "Microcontroller 8051 Addressing modes ( With Examples )"
No responses found. Be the first to respond...
Feedbacks
Post Comment:
Notify me by email when others post comments to this article.
Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
No HTML formatting and links to other web sites are allowed.
This is a strictly moderated site. Absolutely no spam allowed.
Name:
Sign In
to fill automatically.
Email:
(Will not be published, but
required
to validate comment)
Type the numbers and letters shown on the left.
Next Resource:
AMIE section-A Question papers
Previous Resource:
RADAR-Seminar
Return to Resources
Post New Resource
Category:
Education
Post resources and
earn money
!
More Resources
AMIE section-A Question papers
CUSAT, B-Tech Degree 8th Semester EE804(A) Question Paper
Our Approach - Why Good Schooling is not enough
B-Tech Degree 8th Semester Examination (Supplimentary), September 2008
Call Center Management
CAT MOCK TEST PAPER
Popular Tags
Tag posting guidelines
Search Tags
Microcontroller addressing
.
Addressing modes of 8051
.
Subscribe to Email
Get Jobs by Email
Forum posts by Email
Articles by Email
Awards & Gifts
Online Members
venkatesh
Lakshmi Narayan
Muneer.police
Ashok Goyal
Dr.Ms. Subrota Ghosh
preeti
MURUGESAN
jyothirmayi
Jose Mathew
karthik
sherin susan paul
More...