free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Rickey's World :: Discussion Forums :: Discuss and Learn :: 8051 Discussion Forum
 
<< Previous thread | Next thread >>
8051 indirect address space meaning
Moderators: Ajay Bhargav, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph, ExperimenterUK, DavesGarage
Author Post
joder
Mon Nov 02 2009, 04:56AM
 User Offline
Registered Member #22373
Joined: Mon Sep 21 2009, 11:41PM

Posts: 11
Thanked 0 times in 0 posts
Dear all,
Could anyone explain the indirect addressing mode in 8051?
In the instruction MOV @Ri, ADDR
is the direct address space is composed by RAM(low 128bytes) + SFR (high 128 Bytes)
And the @Ri address space is pure RAM 256 bytes?

So the data of ADDR can be in low-128 bytes RAM and SFR and then MOV to
higher 128 bytes RAM?

Thanks!~


Back to top

Ajay Bhargav
Mon Nov 02 2009, 11:15PM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7567
Thanked 1330 times in 1254 posts
well indirect addressing means you move data to ram area using pointer rather than giving direct address.

mov @Ri, ADDR

here in above instruction, Ri (R0 or R1 only) act as pointer to address stored in it.

in 8052 we have 256 bytes of General purpose ram out of which 128 bytes is directly addressable and upper 128 bytes are indirect addressable. mainly used by stack in C codes.

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

joder
Tue Nov 03 2009, 02:56AM
 User Offline
Registered Member #22373
Joined: Mon Sep 21 2009, 11:41PM

Posts: 11
Thanked 0 times in 0 posts
Thanks~
So if R0=90h,
for 8052 having 256 GP-ram,
MOV @R0, 90h :
Is the address, 90h coming from SFR space, right?
And the instruction reads [90h] in SFR and move to [90] in high half of 128bytes RAM?
Is my understanding correct?
Thanks!~

Back to top

Ajay Bhargav
Wed Nov 04 2009, 04:14AM
Rickey's World Admin

 User Offline

Registered Member #1
Joined: Fri Feb 24 2006, 04:56AM

Posts: 7567
Thanked 1330 times in 1254 posts
well there is a small catch..

8052 has two pages of upper ram, one which is directly addressable (SFR Page), other which is indirectly accessible (GPRam).

so if you are using indirect addressing you are actually writing to ram, but if you using direct addressing you are writing to SFR.

So MOV @R0,90H will move data to GPRam from SFR location 90H upper GPRAM area

www.rickeyworld.info
If you feel satisfied with the user's forum reply please click on the thank button.

Obey forum rules!
Respect others!
Back to top

 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems