subroutine int2(a,d) c given an integer*2 a with two bytes we store these 2 bytes c in an integer*2 d with the bytes reversed and return d c c we do this by putting the given integer*2 a into c the integer*2 f, with f equivalenced to a char *1 array c(1) c with dimension 2. We have another char *1 array b of dimension 2 c which is equialenced to an third integer*2 d. c We then reverse the order of bytes in b from that in c, and c return the integer*2 d c integer*2 a,f,d,z character*1 b(2),c(2) equivalence (c(1),f) equivalence (b(1),z) f = a c write(6,101) f,a 101 format('int2 f,a: ',6z10) b(1) = c(2) b(2) = c(1) d = z c write(6,102) b,c,d 102 format('int2 b,c,d: ',6z10) return end