joder
Nov 2 2009, 4:56 AM
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!~
Ajay Bhargav
Nov 2 2009, 11:15 PM
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.
joder
Nov 3 2009, 2:56 AM
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!~

Ajay Bhargav
Nov 4 2009, 4:14 AM
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007