45181 Parallax Inc, 45181 Datasheet - Page 105

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
The following code snippet demonstrates this:
Table
Main
MainLoop
;
Both table methods shown above will only access a maximum of 256 elements, however, the DW
method can easily be modified to access every possible address. If speed is desired, the DW method,
above, is 4 cycles shorter per element than the RETW method.
10.6 Dealing with Code Pages
10.6.1 Branching Across Pages
The SX chip’s program memory is organized into pages of 512 words each. If a program won’t fit within
a single page, special care must be taken when branching across page boundaries to avoid misdirected
jumps.
All instructions that perform a jump, except JMP W, JMP and PC+W, use a 9-bit address as the operand.
This limits the jump range to the current page only (512 words). To jump across a page boundary, the
page select bits (the upper bits of the Status register) must first be set to the appropriate page before
executing the jump. The SX assembler provides a convenient method of doing this, as shown below.
To jump across page boundaries:
Specify the jump command (JMP, JB, CJE, etc) with the page-set option (the @ sign preceding the
address).
RESET Main
Idx
; 8-bit data table
,
ORG
DW
DW
MOV
MOV
MOV
IREAD
{use the data}
INC
CJNE
EQU $08
$0
'ABCDEFG'
10, 300, 4095, 0 ; Store numbers
Idx, #Table
M, #Table>>8
W, Idx
Idx
Idx, #11, Main
; Define index symbol
; Store text
; Reset table index
; upper 4-bits of table address
; lower 8-bits of table index
; Retrieve data
; Increment table index
; Continue
10 SX Special Features and Coding Tips
SX-Key/Blitz Development System Manual 2.0 Parallax, Inc. Page 105

Related parts for 45181