Memory Architecture
The MCS-51 has four distinct types of memory – internal RAM, special function registers, program memory, and external data memory.
Internal RAM (IRAM) is located from address 0 to address 0xFF. IRAM from 0x00 to 0x7F can be accessed directly, and the bytes from 0x20 to 0x2F are also bit-addressable. IRAM from 0x80 to 0xFF must be accessed indirectly, using the @R0 or @R1 syntax, with the address to access loaded in R0 or R1.
Special function registers (SFR) are located from address 0x80 to 0xFF, and are accessed directly using the same instructions as for the lower half of IRAM. Some of the SFR's are also bit-addressable.
Program memory (PMEM, though less common in usage than IRAM and XRAM) is located starting at address 0. It may be on- or off-chip, depending on the particular model of chip being used. Program memory is read-only, though some variants of the 8051 use on-chip flash memory and provide a method of re-programming the memory in-system or in-application. Aside from storing code, program memory can also store tables of constants that can be accessed by MOVC A, @DPTR, using the 16-bit special function register DPTR.
External data memory (XRAM) also starts at address 0. It can also be on- or off-chip; what makes it "external" is that it must be accessed using the MOVX (Move eXternal) instruction. Many variants of the 8051 include the standard 256 bytes of IRAM plus a few KB of XRAM on the chip.
Read more about this topic: Intel MCS-51
Famous quotes containing the words memory and/or architecture:
“These Flemish pictures of old days;
Sit with me by the homestead hearth,
And stretch the hands of memory forth
To warm them at the wood-fires blaze!”
—John Greenleaf Whittier (18071892)
“Art is a jealous mistress, and, if a man have a genius for painting, poetry, music, architecture or philosophy, he makes a bad husband and an ill provider.”
—Ralph Waldo Emerson (18031882)