English
Language : 

45111 Datasheet, PDF (163/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
15 Appendix E: SX Data Sheet
15.2.14 Jumping Across Pages
When a JMP instruction is executed and the intended destination is on a different page, you must set
the page select bits to point to the desired page before the jump occurs. This can be done discretely with
SETB and CLRB instructions or by writing a value to the STATUS register. The SX offers a single-cycle
instruction called PAGE that sets the page select bits for you. See “Dealing with Code Pages” in Chapter
10.6 for more information. NOTE: Using the @ symbol in the JMP instruction (JMP @label) will cause the
assembler to insert the PAGE instruction before your JMP, during assembly.
Figure 31 - Jumping Across Pages
11 10 9
PAGE label
8
7
6
5
4
3
2
1
0
7
6
5
JMP label
8
7
6
5
4
3
2
1
0
11 10 9
8
7
6
5
4
3
2
1
0
15.2.15 The Call Instruction
When a CALL instruction is executed, four things occur:
1) the current value of the program counter is incremented and pushed onto the top of the stack;
2) the lower eight bits of the address of the label are copied into the lower eight bits of the
program counter
3) the ninth bit of the PC is cleared to zero
4) the page select bits of the STATUS register are copied into the upper bits of the PC. Since bit 8 is
cleared, the call destination must start in the lower half of any page of code space. i.e. $00-$FF,
$200-$2FF, $400-$4FF, etc.
SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc. • Page 163