than the XPC segment, can call other code in the root using short jumps and calls. Code in the XPC segment can also call code in the root using short jumps and calls. However, a long call must be used when code in the XPC segment is called. Functions located in the root have an efficiency advantage because a long call and a long return require 32 clocks to execute, but a short call and a short return require only 20 clocks to execute. The differ- ence is small, but significant for short subroutines.

10000

XPC segment

Compiler notices that

Compiler inserts

code has passed F000.

long jump in code.

E000

D000

Stack segment

Data segment

short calls returns

XPC=N

PC=F000+K

F000

E000

XPC=N+1

PC=E000+K+4

Root segment

Illustration of sliding XPC window

Figure 3-5. Use of XPC Segment

3.2.2 Separate I and D Space - Extending Data Memory

In the normal memory model, the data space must share a 64K space with root code, the stack, and the XPC window. Typically, this leaves a potential data space of 40K or less. The XPC requires 8K, the stack requires 4K, and most systems will require at least 12K of root code. This amount of data space is sufficient for many embedded applications.

One approach to getting more data space is to place data in RAM or in flash memory that is not mapped into the 64K space, and then access this data using function calls or in assembly language using the LDP instructions that can access memory using a 20-bit address. This greatly expands the data space, but the instructions are less efficient than instructions that access the 64k space using 16 bit addresses.

The Rabbit 3000 supports separate I and D or Instruction and Data spaces. When separate I and D space is enabled it applies only to addresses in the root segment or data segment. Separate I and D spaces mean that instruction execution makes a distinction between

User’s Manual

27

Page 36
Image 36
Jameco Electronics 3000, 2000 manual Separate I and D Space Extending Data Memory, Use of XPC Segment