SWAP

SWAP

Operation:
Register [31:16] \s-->; Register [15:0]

Assembler Syntax:
SWAP Dn

Attributes: Size = (Word)

Description: Exchange the 16-bit words (halves) of a
data register.

Condition Codes:

X Not affected.
N Set if the most significant bit of the 32-bit result is
set. Cleared otherwise.
Z Set if the 32-bit result is zero. Cleared otherwise.
V Always cleared.
C Always cleared.

Example:

1)
D0= $12345678
SWAP D0

Result:
D0 = $56781234