User`s guide

1/15/03 4-1
Chapter 4
Internal RAM
The LZ87010 has two areas of on-chip Data RAM: 256 bytes of scratchpad RAM and
4,096 bytes of MOVX RAM.
4.1 Theory of Operation
The LZ87010 has four distinct addressing spaces:
1. A 256-byte data address space containing scratchpad RAM at addresses 0x00-0xFF.
2. A 128-byte data address space containing memory-mapped registers (also called
‘special function registers’) at addresses 0x80-0xFF. This overlaps scratchpad RAM
in the memory map. The overlapping spaces are accessed by different addressing
modes.
3. A 64KB data address space at addresses 0x000-0xFFFF, populated with 4KB of on-
chip MOVX RAM. This memory is not expandable. The 4KB RAM is accessed with
the MOVX instruction. It is mapped to fill the full 64KB space, meaning that any MOVX
access in the range of 0x0000-0xFFFF will be treated as an access to the RAM at
0x0000-0x0FFF.
4. A 64KB code address space at addresses 0x0000-0xFFFF mapped either to on-chip
Flash, external program memory, or partly Flash and partly external program memory.
This program memory can also be used for data storage.
These overlapping address spaces can cause confusion. Code memory and data memory
occupy different memory spaces. Data memory is subdivided into four memory spaces, as
shown in Figure 4-1. In software, there is no ambiguity about which space is being
addressed, because different opcodes are used for different address spaces. This is true
everywhere except for selecting between on-chip Flash and external program memory,
which is controlled through the XMCFG register.
Figure 4-1 shows the system memory map.
4.1.1 Scratchpad RAM (256 Bytes)
The 256-byte scratchpad RAM (also called ‘internal’ RAM) is used by the 8051 processor
for registers R0-R7, for the return stack, and for miscellaneous uses. This RAM space is
implemented as high-speed static RAM which can be accessed in a single clock cycle.
This RAM is mapped to the data address range of 0x00-0xFF. The area from 0x00-0x7F
can be addressed with either the direct or indirect addressing modes, both of which use
an 8-bit address. The area from 0x80-0xFF overlaps the special function register (SFR)
space and can be accessed only by the indirect addressing mode; the direct addressing
mode accesses the SFRs.