CHAPTER 2: ARCHITECTURE

Accessing for addresses 0000H to 003FH

Data in this area is used for a relative address by the "JR [addr6]" and "CALR [addr6]" explained in Section 2.2.3. This area is suitable for setting up various flags and counters since the bit operation instructions (CLR, SET, TST) and increment/decrement instructions (INC, DEC) are provided for accessing this area.

Accessing for addresses FFC0H to FFFFH (I/O memory area)

The bit operation instructions (CLR, SET, TST) are provided for accessing this area. Therefore, control bits in the I/O memory can be operated simply.

Examples:

 

CLR

[0xFFC0],0

...Clears the D0 bit in the I/O memory address FFC0H to "0"

SET

[0xFFD2],3

...Sets the D3 bit in the I/O memory address FFD2H to "1"

2.3.3 Stack and stack pointer

The stack is a memory that is accessed in the LIFO (Last In, First Out) format and is allocated to the RAM area of the address 0000H to 03FFH. The stack area can be set from an optional address (toward the lower address) using the stack pointer.

The S1C63000 contains two stack pointers SP1 and SP2.

(1)Stack pointer SP1

The SP1 is used for the address data stack, and permits 16-bit data accessing.

D15

 

 

 

D10 D9

 

D2 D1 D0

0

0

0

0

0

0

7

SP1

0

0

0

Stack pointer 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8 bits to be modified

Fig. 2.3.3.1 SP1 configuration

As shown in the figure, the D0, D1 and D10–D15 within the 16 bits are fixed at "0". 8 bits of the D2–D9 can be set by software. Furthermore, the hardware also operates for this 8-bit field. Therefore, addressing by the SP1 is done in 4-word units, and a 16-bit address data can be transferred in one accessing. Since the SP1 performs 16-bit data accessing, this stack area is limited to the 16-bit accessible RAM area even though it is within the addresses 0000H to 03FFH.

This stack is used to evacuate return addresses when the call instructions are executed or the interrupts are generated. It is also used when the 16-bit data in the X or Y register is evacuated using the PUSH instruction. The return address data is written into the stack as shown in Figure 2.3.3.2.

The SP1 is decremented after the data is evacuated and is incremented when a return instruction is executed or after returning data by executing the POP instruction.

 

Program memory

 

 

 

 

 

 

 

 

 

 

 

 

ROM

:

 

 

 

 

 

 

PC

 

 

Stack (SP1)

 

 

 

 

Address

 

 

 

 

 

 

 

 

 

ROM

 

 

SP1

 

1234H

CALR sign8

 

 

 

1235H

 

Address

 

 

40H

(= Address 100H)

1235H

:

 

 

 

 

 

 

 

 

 

 

00FFH

5H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00FEH

3H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00FDH

2H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00FCH

1H

 

3FH

(= Address FCH)

 

 

 

 

 

 

 

 

 

PC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1235H

 

 

 

 

SP1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

40H

(= Address 100H)

 

Subroutine

 

 

 

 

 

 

 

 

 

 

00FFH

5H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00FEH

3H

 

 

 

 

 

:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

00FDH

2H

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RET

 

 

 

 

 

 

 

 

 

 

 

00FCH

1H

 

3FH

(= Address FCH)

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 2.3.3.2 Address stack operation

S1C63000 CORE CPU MANUAL

EPSON

19