beautypg.com

Table data processing instructions, Swap, Applicable program areas operands – Omron SYSMAC CP CP1E-N@@D@-@ User Manual

Page 289: Flags, 2 instructions, N: number of words, R1: first word in range, Operand specifications

background image

2-253

2 Instructions

CP1E CPU Unit Instructions Reference Manual(W483)

T
a

b

le

Data Pr

ocessing

In

stru

ctio

ns

2

SW

AP

Table Data Processing Instructions

SWAP

Applicable Program Areas

Operands

N: Number of words

N specifies the number of words in the range and must be 0001 to FFFF hexadecimal (or &1 to
&65,535).

R1: First word in range

Note R1 and R1+(N-1) must be in the same data area.

Operand Specifications

Flags

Instruction

Mnemonic

Variations

Function

code

Function

SWAP BYTES

SWAP

@SWAP

637

Switches the leftmost and rightmost bytes in all of
the words in the range.

Symbol

SWAP

Area

Step program areas

Subroutines

Interrupt tasks

Usage

OK

OK

OK

Operand

Description

Data type

Size

N

Number of words

UINT

1

R1

First word in range

UINT

Variable

Area

Word addresses

Indirect DM addresses

Constants

CF

Pulse bits

TR bits

CIO

WR

HR

AR

T

C

DM

@DM

*DM

N

OK

OK

OK

OK

OK

OK

OK

OK

OK

OK

---

---

---

R1

---

Name

Label

Operation

Error Flag

P_ER

ON if the N is 0.

OFF in all other cases.

N: Number of words

R1: First word in range

SWAP(637)

N

R1

R1

R1+(N–1)

15

0

8 7

to

to

to

Leftmost byte Rightmost byte

This manual is related to the following products: