SUBROUTINE SIXBIT(IN) C Version 01.00 C Routine to convert data packed in 8-bit format C from RDLIN, into 6-bit packed ascii C The array IN contains the 8-bit data, which C is to be repacked into IN C If less than 18 characters are input, up to C the 18th position is packed with spaces. C This is so file names for USR are handled C properly. DIMENSION IN(1) LOGICAL END END=.F. DO 450 J=1,132,2 JM1=J-1 IF(END)GOTO 440 !Go get first characters 410 ITEMP=GETWRD(IN(JM1/3+1),J,63)*64 IF(ITEMP.NE.0)GOTO 430 !Upper byte ok, go get lower C Sentinel on upper byte means we've got to C do a little diddling to remove the last character CALL PUTWRD(IN(LAST),LASTB,GETWRD(IN(LAST),LASTB,4032)+32) 420 WORD=2080 !fill with spaces (4040 octal) END=.T. !Set end flag GOTO 440 !Go stuff the spaces in. 430 WORD=GETWRD(IN(J/3+1),J+1,63) !Get low order byte IF(WORD.EQ.0)GOTO 420 !Sentinel: last char was CR C !so we'll ignore it. 435 WORD=WORD+ITEMP !Add in upper byte 440 IF(END.AND.J.GT.18)GOTO 460 LAST=JM1/6+1 !Save index for above (420) LASTB=JM1/2+1 !ditto 450 CALL PUTWRD(IN(LAST),LASTB,WORD) 460 CALL PUTWRD(IN(J/6+1),LASTB+1,0) !Sentinel for saftey RETURN END