Topic: DMD0029 SWAPB - Swap Bytes |
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
The Swap Bytes (SWAPB) instruction is used to swap the Bytes and / or the Words in the designated range of locations. This instruction will begin at the first Source location and swap the Bytes and / or Words, then store the result in the first destination location. This operation will be repeated the number of times specified by the Elements value on successive Source locations.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Parameters:Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.
Source is the first location to operate on. This can be any readable numeric block location.
Destination is the first location to store the result. This can be any writable numeric block location.
Note: Source and Destination do not have to be the same Type but they must be the same Element Size, that is, they both must consist of Word (16-bit) or DWord (32-bit) size elements. If the Source and Destination are different sizes use the Translate from Do-more (PUBLISH) and Translate to Do-more (SUBSCRIB) instructions to perform the Byte Swap.
Elements specifies how many successive Word or DWord elements the Swap Bytes instruction will operate on.
Select Swap Byte to swap the Bytes in each of the Words or DWord elements.
Select Swap Word to swap the Words in each of the DWord elements.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
See Also:STR2INT - Convert String to Integer
STR2REAL - Convert String to Real
SWAPB - Swap Bytes
PUBLISH - Translate from Do-more
SUBSCRIB - Translate to Do-more
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Related Topics:STREAMIN - Stream In Data from Device
STREAMOUT - Stream Out Data to Device
PACKETIN - Input Data from Packet Device
PACKETOUT - Output UDP to Packet Device
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Rung Example:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|