aboutsummaryrefslogtreecommitdiff
path: root/sys/osb/bswap2.f
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/osb/bswap2.f
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/osb/bswap2.f')
-rw-r--r--sys/osb/bswap2.f20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/osb/bswap2.f b/sys/osb/bswap2.f
new file mode 100644
index 00000000..700c8498
--- /dev/null
+++ b/sys/osb/bswap2.f
@@ -0,0 +1,20 @@
+c BSWAP2 - Move bytes from array "a" to array "b", swapping successive
+c pairs of bytes.
+
+ subroutine bswap2 (a, aoff, b, boff, nbytes)
+
+ character*1 a(*), b(*), temp
+ integer aoff, boff, nbytes, i
+ integer aoff1, boff1
+
+ aoff1 = aoff + 1
+ boff1 = boff + 1
+
+ do 10 i = 0, nbytes-1, 2
+ temp = a(aoff1+i)
+ if (i .ne. nbytes) then
+ b(boff1+i) = a(aoff+i)
+ endif
+ b(boff+i) = temp
+ 10 continue
+ end