FORTRAN IV V02.1-1 PAGE 001 0001 program tobin c c c Authors: E.F.Beadel, Jr., Manager c C.A.U.S.E. Instructional Computer Center c SUNY at Oswego c Oswego, NY 13126 c phone: 315/341-3055 c c and c c T.J.Weslowski, Instructor c Computer Science Department c SUNY at Oswego c Oswego, NY 13126 c c Date: 10-aug-83 c c************************************************************ c************************************************************ c c This is the sister program of "TOHEX". This program c reconstructs a disk file from the information contained c in an ascii hex file generated by the program "TOHEX". c c It must be linked with the macro-11 file "UNHEX" as follows: c c FORTRAN TOBIN c MACRO UNHEX c LINK TOBIN,UNHEX c RUN TOBIN c c 0002 integer dada(256),norec 0003 integer cptr,nrec,lnctr,lnq 0004 byte line(64),unhex,char(512) 0005 equivalence (char(1),dada(1)) c c 0006 type *,'Enter input filename' 0007 type * 0008 call assign(50,'',-1,'RDO') 0009 type *,'How many blocks long is the output file to be?' 0010 accept *,norec 0011 type *,'Enter output filename' 0012 type * c c 0013 call assign(51,'',-1,'NEW') 0014 define file 51 (norec,256,U,nrec) c c 0015 lnctr=1 ! init line counter 0016 nrec=1 ! init block counter FORTRAN IV V02.1-1 PAGE 002 0017 cptr=1 ! Init character pointer. c c c 0018 500 read(50,52,end=1000)lnq,line ! fetch a line 0019 52 format(i4,':',64a1) 0020 if(lnq .ne. lnctr) stop 'Line count error' d type 52,lnq,line 0022 lnctr=lnctr+1 ! Update line counter. c c 0023 do 11 j=1,64,2 ! process the line 0024 char(cptr)=unhex(line(j),line(j+1)) 0025 cptr=cptr+1 0026 11 continue c c d type*,'CPTR=',CPTR c c 0027 if(cptr .ne. 513) goto 500! Get another line if buffer not full 0029 write(51'nrec)dada ! Dump the buffer 0030 cptr=1 ! Reset character pointer. 0031 goto 500 ! Process another block c c 0032 1000 close (unit=50) 0033 close (unit=51) 0034 stop 'Program terminated normally.' 0035 end FORTRAN IV Storage Map for Program Unit TOBIN Local Variables, .PSECT $DATA, Size = 001122 ( 297. words) Name Type Offset Name Type Offset Name Type Offset CPTR I*2 001110 J I*2 001120 LNCTR I*2 001114 LNQ I*2 001116 NOREC I*2 001106 NREC I*2 001112 Eqv Local and COMMON Arrays: Name Type Section Offset ------Size----- Dimensions CHAR L*1 $DATA 000002 001000 ( 256.) (512) DADA I*2 $DATA 000002 001000 ( 256.) (256) LINE L*1 $DATA 001002 000100 ( 32.) (64) Subroutines, Functions, Statement and Processor-Defined Functions: Name Type Name Type Name Type Name Type Name Type ASSIGN R*4 UNHEX L*1