Specifications

Operating System Routines
BYTE_SWAP_LONG
BYTE_SWAP_LONG
Swaps the bytes within each longword in a given data transfer buffer.
Module
[DRIVER]VME_SUPPORT
Input
Location Contents
R0 Length of the data transfer buffer in bytes. This
number should fall on a longword boundary.
R1 Address of the data transfer buffer.
Output
Location Contents
R0, R1 Destroyed
(All other registers preserved)
Synchronization
A driver calls BYTE_SWAP_LONG in kernel mode at or above IPL$_ASTDEL.
Description
BYTE_SWAP_LONG swaps the bytes within each longword of a given data
transfer. The data is read from an input system buffer, then the byte positions
of each longword are modified to a mirrored order, swapping the least significant
bytes (LSB) with the most significant bytes (MSB), as shown in the following
figure.
ABCD
DCBA
Original Format:
Swapped Format:
MSB LSB
MSB LSB
ZK3733AGE
Note that if the buffer byte-length is not an exact number of longwords, the bytes
in the last incomplete longword are unaffected.
3–2