beautypg.com

Echelon Series 6000 Chip databook User Manual

Page 28

background image

symbol NEXT refers to the next element in the data stack, which is determined by contents

of the location (BP+DSP) in memory, and is thus not an actual processor register.

Figure 4. Base-Page Memory Layout

The data stack grows from low memory towards high memory, and is managed through the

DSP (Data Stack Pointer) register. Pushing a byte of data onto the data stack involves the

following steps:

1. Incrementing the DSP register
2. Storing the current contents of TOS at the address (BP+DSP) in memory
3. Moving the byte of data to TOS

Popping a byte of data from the data stack involves the following steps:

1. Moving TOS to the destination
2. Moving the contents of the address (BP+DSP) in memory to TOS
3. Decrementing the DSP register

The return stack grows from high memory towards low memory, and is managed through the

RSP (Return Stack Pointer) register. Calling a subroutine involves the following steps:

1. Storing the high byte of the instruction pointer (IP) register at the address (BP+RSP)

in memory

2. Decrementing RSP
3. Storing the low byte of IP at the address (BP+RSP) in memory
4. Decrementing RSP
5. Moving the destination address to the IP register

Similarly, returning from a subroutine involves the following steps:

16

Hardware Resources