Datasheet
15 8 7 0
15 8 7 0
Low Byte
Low ByteHigh Byte
High Byte
Before SWPB
After SWPB
0
x
0...
19
19
16
16
15 8 7 0
15 8 7 0
Low Byte
Low ByteHigh Byte
High Byte
Before SWPB
After SWPB
www.ti.com
Instruction Set Description
4.6.2.48 SWPB
SWPB Swap bytes
SWPB dst
Syntax
Operation dst.15:8 ↔ dst.7:0
Description The high and the low byte of the operand are exchanged. PC.19:16 bits are cleared in
register mode.
Status Bits Status bits are not affected
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example Exchange the bytes of RAM word EDE (lower 64KB)
MOV #1234h,&EDE ; 1234h -> EDE
SWPB &EDE ; 3412h -> EDE
Figure 4-41. Swap Bytes in Memory
Figure 4-42. Swap Bytes in a Register
211
SLAU144J–December 2004–Revised July 2013 CPUX
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated