2 MEMORY AND OPERATIONS

2.1.6 PSET instruction

Jump or call instructions must follow PSET immediately in order for PSET to affect the destination address. When a jump or call is not immediately preceded by PSET, the destination address is within the current page.

Some examples using PSET are shown in Table 2.1.6.1.

 

 

 

 

 

Table 2.1.6.1 PSET examples

 

 

 

 

 

Bank

Page

Stap

Instruction

Operation

 

 

 

 

 

 

0

01H

10H

PSET

13H

 

0

01H

11H

JP

08H

The program jumps to bank 1, page 3, step 8.

 

 

 

 

0

01H

21H

PSET

15H

 

0

01H

22H

NOP5

 

The data set by PSET is canceled.

0

01H

23H

JP

09H

The program jumps to bank 0, page 1, step 9.

 

 

 

 

0

01H

55H

SCF

 

C flag is set.

0

01H

56H

PSET

14H

 

0

01H

57H

JP

C, 07H

The program jumps to bank 1, page 4, step 7 because C flag = 1.

 

 

 

 

0

01H

60H

RFC

 

C flag is reset.

0

01H

61H

PSET

05H

 

0

01H

62H

JP

C, 08H

No jump occurs because C flag = 0.

0

01H

63H

JP

09H

The data set by PSET is canceled, and the program jumps to bank 0, page 1, step 9.

 

 

 

 

2.1.7 CALZ instruction

CALZ is a direct subroutine call instruction. It calls a subroutine, in page 0 of the current bank, from any page without requiring the use of PSET.

If CALZ is executed immediately after PSET, the bank and page set by PSET is canceled. This allows direct subroutine calls to page 0, minimizing repeated code and unnecessary use of PSET. See Figure 2.1.7.1.

 

 

 

 

Bank 0

Page 0

 

 

 

 

 

 

 

 

 

 

EEE....................

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank 0

Page

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

PSET

0AH

 

 

Not effect

 

 

 

 

 

CALZ

EEE

on destination

of CALZ

LD

A,0

 

 

Fig. 2.1.7.1 The use of the CALZ instruction

6

EPSON

S1C6200/6200A CORE CPU MANUAL