diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/osb/bytmov.f | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/osb/bytmov.f')
-rw-r--r-- | sys/osb/bytmov.f | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/osb/bytmov.f b/sys/osb/bytmov.f new file mode 100644 index 00000000..b866e852 --- /dev/null +++ b/sys/osb/bytmov.f @@ -0,0 +1,27 @@ +c BYTMOV -- Byte move from array "a" to array "b". The move must be +c nondestructive, allowing a byte array to be shifted left or right a +c few bytes, hence calls to zlocva() are required to get the addresses of +c the arrays. + + subroutine bytmov (a, aoff, b, boff, nbytes) + + character*1 a(*), b(*) + integer aoff, boff, nbytes + integer fwaa, lwaa, fwab, i + + call zlocva (a(aoff), fwaa) + call zlocva (a(aoff+nbytes-1), lwaa) + call zlocva (b(boff), fwab) + + if (fwaa .eq. fwab) then + return + else if (fwab .ge. fwaa .and. fwab .le. lwaa) then + do 10 i = nbytes-1, 0, -1 + b(boff+i) = a(aoff+i) + 10 continue + else + do 20 i = 0, nbytes-1 + b(boff+i) = a(aoff+i) + 20 continue + endif + end |