2 MEMORY AND OPERATIONS

2.1.3 Jump instructions

A jump can be made using the instructions in Table 2.1.3.1.

Table 2.1.3.1

Jump instructions

 

 

Type of jump

 

Instruction

 

 

 

Unconditional

 

JP

 

 

 

Conditional

 

JP C, JP NC, JP Z, JP NZ

 

 

 

Subroutine call

 

CALL, CALZ

 

 

 

Return

 

RET, RETS, RETD

 

 

 

Page set

 

PSET

 

 

 

Indirect

 

JPBA

 

 

 

The differences between jumps within the same page and jumps from one page to another is as follows.

Jumps within the same page

A jump can be made within the same page using any of the following instructions:

JP, JP C, JP Z, JP NZ, JPBA or CALL

The destination address is specified by the 8-bit operand. A label can be used to specify a destination address with the S1C62 Family cross assembler.

Jumps from one page to another

The destination bank and page should be set using PSET before executing a JP instruction.

2.1.4 PSET with jump instructions

PSET loads the four low-order bits (page part) of its 5-bit operand to NPP (new page pointer) and loads the high-order bit (bank part) to NBP (new bank pointer). Executing a JP instruction immediately after PSET causes a jump to the bank specified by NBP, the page specified by NPP and the step specified by the JP instruction operand. See Figure 2.1.4.1.

Bank 0

Bank 0 Page 3

Bank 0 Page 2

Bank 0 Page 1

Bank 0 Page 0

Step 0

Step 1

Step 254

Step 255

 

Bank 0

Page 15

 

 

 

 

Jump with PSET can go anywhere

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank

0

Page 14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

within the program memory

Step

0

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Jump can go between banks

 

 

 

PSET

 

 

 

 

 

 

 

 

 

 

 

 

 

JUMP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

254

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

255

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank 1

 

Bank 1

Page 15

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank

1

Page

14

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

JUMP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank 1

Page 3

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank

1

 

Page 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank

 

1

 

Page

1

 

 

 

 

Step

254

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bank

1

 

 

 

Page

0

 

 

 

 

 

 

Step 255

 

 

 

 

 

 

Step

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Jump without PSET

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

can go anywhere

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

within one page

 

 

 

 

 

 

 

 

 

 

254

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step

255

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Fig. 2.1.4.1 The PSET and jump instructions

2.1.5 Call instructions

As only the page data specified by NPP is loaded to PCP when a call instruction is executed, subroutine calls between banks are not possible. Jumps between banks can only be made using JP instructions.

S1C6200/6200A CORE CPU MANUAL

EPSON

5