English
Language : 

DS80C320-MCG Datasheet, PDF (8/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
SFRs are accessed directly between 80h and FFh (128 to 255). The RAM locations between 128 and 255
can be reached through an indirect reference to those locations.
Scratchpad RAM is available for general purpose data storage. It is commonly used in place of off-chip
RAM when the total data contents are small. When off-chip RAM is needed, the Scratchpad area will
still provide the fastest general purpose access. Within the 256 bytes of RAM, there are several special
purpose areas. These are described as follows:
Bit Addressable Locations
In addition to direct register access, some individual bits are also accessible. These are individually
addressable bits in both the RAM and SFR area. In the Scratchpad RAM area, registers 20h to 2Fh are bit
addressable. This provides 126 (16 * 8) individual bits available to software. A bit access is
distinguished from a full register access by the type of instruction. Addressing modes are discussed in
Section 5. In the SFR area, any register location ending in a 0 or 8 is bit addressable. Figure 4-3 shows
details of the on-chip RAM addressing including the locations of individual RAM bits.
Working Registers
As part of the lower 128 bytes of RAM, there are four banks of Working Registers (each). The Working
registers are general purpose RAM locations that can be addressed in a special way. They are designated
R0 through R7. Since there are four banks, the currently selected bank will be used by any instruction
using R0-R7. This allows software to change context by simply switching banks. This is controlled via
the Program Status Word register in the SFR area described below. The Working Registers also allow
their contents to be used for indirect addressing of the upper 128 bytes of RAM. Thus an instruction can
designate the value stored in R0 (for example) to address the upper RAM. This value might be the result
of another calculation.
Stack
Another use of the Scratchpad area is for the programmer’s stack. This area is selected using the Stack
Pointer (SP;81h) SFR. Whenever a call or interrupt is invoked, the return address is placed on the Stack.
It also is available to the programmer for variables, etc. since the Stack can be moved, there is no fixed
location within the RAM designated as Stack. The Stack Pointer will default to 07h on reset. The user
can then move it as needed. A convenient location would be the upper RAM area (>7Fh) since this is
only available indirectly. The SP will point to the last used value. Therefore, the next value placed on
the Stack is put at SP + 1. Each PUSH or CALL will increment the SP by the appropriate value. Each
POP or RET will decrement as well.
MEMORY MAP Figure 4-1
FFFFh
PROGRAM
MEMORY
64K
DATA
MEMORY
0000h
8 of 175