Publication 1762-RM001C-EN-P
Math Instructions 10-11
Addressing Modes and File Types can be used as shown in the following
table:
Example:
Source Value before executing SWP instruction: abcdefghijklmnopqrstuvwxyzabcdefg
Source Value before executing SWP instruction: badcfehgjilknmporqtsvuxwzy
abcdefg
The underlined characters show the 13 words where the low byte was
swapped with the high byte.
Table 10.14 SWP Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page4-2.
Parameter
Data Files Function Files
CS - Comms
IOS - I/O
Address
(1)
Mode
(1) See Important note about indirect addressing.
Address
Level
O
I
S
B
T, C, R
N
ST
L
MG, PD
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
DAT
TPI
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Source ••• • •
Length
• •
IMPORTANT
You cannot use indirect addressing with: S, ST, MG, PD,
RTC, HSC, PTO, PWM, STI, EII, BHI, MMI, DAT, TPI, CS,
IOS, and DLS files.
SWP
Swap
Source #ST10:1.DATA[0]
Length 13
SWP