45181 Parallax Inc, 45181 Datasheet - Page 106

SX TECH TOOL KIT NO POWER

45181

Manufacturer Part Number
45181
Description
SX TECH TOOL KIT NO POWER
Manufacturer
Parallax Inc
Series
SXr
Type
Microcontrollerr
Datasheet

Specifications of 45181

Contents
SX Book, SX Key, SX Tech Board, Samples, Resonators, Cable and Manual
Product
Microcontroller Basic Stamps
Operating Supply Voltage
5 V
For Use With/related Products
SX MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
10 SX Special Features and Coding Tips
The following code snippet demonstrates this:
The @ symbol preceding the address causes the assembler to insert a PAGE instruction just before the
JMP to set the page select bits appropriately. The second JMP in line three does not require an @ symbol
since the destination address is within the current page. If the @ was left out of line two, the SX would
jump to address $000 instead of $200. See Chapter 15.2.14 - Jumping Across Pages for more
information.
10.6.2 Calling Across Pages with Jump Tables
Calling subroutines can pose even more boundary problems than jumping across pages. The CALL
instruction uses only an 8-bit address as the operand (the 9
limits the calling destination to the first 256 words of the current page.
Because it is sometimes impossible to organize all subroutines within such a tight space, a common
practice is to make use of a subroutine jump table. The jump table consists of a list of JMP commands to
various subroutines and is located within the first 256 words of the page. The CALL instructions can
simply call the proper location within the jump table and code execution jumps to the appropriate
subroutine, even if it exists in different pages or above the 256 word barrier.
To call subroutines across page boundaries:
Page 106 SX-Key/Blitz Development System Manual 2.0 Parallax, Inc.
1) Design a jump table with the page-set option (the @ sign preceding the addresses).
2) Place the subroutines in any desired location being sure to end them with RETP.
3) Call the subroutine’s alias-name in the jump table.
Start
Routine
ORG $0
JMP @Routine ; Jump to proper page
JMP Start
ORG $200
JMP @Start
; This routine is in page 0
; This routine is in page 1
; Jump back to proper page
th
bit of the address is always cleared). This

Related parts for 45181