4,r3,r2> ; pop local registers and exit return .sbttl fix the file attribute data up by looking at the IFAB ; input: r1 --> FAB for the input file ; r2 --> FAB for the output file ; ; Since these fields all follow each other in order we could ; of course use .assume or assert macros to check for their ; order, but then if rms were altered we would be in trouble. ; As it stands, by doing this (looking at IFABS), we may be ; in trouble for future versions of RMS anyway. It would be ; much simpler if RMS would provide a means to override the ; eof and recordsize markers at runtime. fixatr: save ; save temps please mov o$ifi(r1),r3 ; point to the input file IFAB mov o$ifi(r2),r4 ; point to the output file IFAB cmpb o$rfm(r1),#fb$stm ; stream file as input ? bne 10$ ; no tst f$rsiz(r3) ; yes, stream. Any valid recordsize? bne 10$ ; yes, assume that the rest is valid clrb f$ratt(r4) clrb f$forg(r4) clr f$rsiz(r4) clr f$hvbn(r4) clr f$lvbn(r4) clr f$heof(r4) clr f$leof(r4) clr f$ffby(r4) clrb f$hdsz(r4) clrb f$bksz(r4) clr f$mrs(r4) clr f$deq(r4) clr f$rtde(r4) br 100$ 10$: movb f$ratt(r3),f$ratt(r4) ; stuff the input record attributes movb f$forg(r3),f$forg(r4) ; also stuff the input file org in mov f$rsiz(r3),f$rsiz(r4) ; and the input record size please mov f$hvbn(r3),f$hvbn(r4) ; and the input eof markers mov f$lvbn(r3),f$lvbn(r4) ; like hi and low virtual block mov f$heof(r3),f$heof(r4) ; and the high and low eof block mov f$leof(r3),f$leof(r4) ; numbers also mov f$ffby(r3),f$ffby(r4) ; and, at last, the first free byte movb f$hdsz(r3),f$hdsz(r4) ; VFC header size next movb f$bksz(r3),f$bksz(r4) ; and largest bucket size mov f$mrs(r3) ,f$mrs(r4) ; the maximum record size mov f$deq(r3) ,f$deq(r4) ; and the default extenstion size mov f$rtde(r3),f$rtde(r4) ; and the run time extentsion size 100$: unsave ; all done return .sbttl copyatr copy the input record format to the output file's FAB ; We don't really need this as it turns out we will have to ; do a read attributes for the input file and a write for the ; output file anyway due to problems in marking the EOF point ; and in copying stream ascii files in general. ; It would have been nice to avoid all that. We could avoid ; it if all files had attributes (unlike RSTS) and if we had ; access to RMS blocks regarding EOF info. copyat: mov o$alq+0(r1),o$alq+0(r2) ; allocation is a double word field. mov o$alq+2(r1),o$alq+2(r2) ; $fetch to r0 would clobber r1 also $fetch r0,BKS ,r1 ; the macros select the proper size $store r0,BKS ,r2 ; of the move at a cost in space. $fetch r0,DEQ ,r1 ; done with the allocation and bucket $store r0,DEQ ,r2 ; size, now stuff the extension size. $fetch r0,FOP ,r1 ; o$fop(r2) := o$fop(r1) $set r0,FOP ,r2 ; possibly want a contiguous file $fetch r0,FSZ ,r1 ; get the VFC fixed control size $store r0,FSZ ,r2 ; o$fsz(r2) := o$fsz(r1) $fetch r0,LRL ,r1 ; get the longest record size $store r0,LRL ,r2 ; o$lrl(r2) := o$lrl(r1) $fetch r0,MRS ,r1 ; get the maximum record size $store r0,MRS ,r2 ; o$mrs(r2) := o$mrs(r1) $fetch r0,ORG ,r1 ; get the file organization now $store r0,ORG ,r2 ; o$org(r2) := o$org(r1) $fetch r0,RAT ,r1 ; get the record attributes now $store r0,RAT ,r2 ; o$rat(r2) := o$rat(r1) $fetch r0,RFM ,r1 ; get the record format next $store r0,RFM ,r2 ; o$rfm(r2) := o$rfm(r1) $fetch r0,RTV ,r1 ; get the cluster size next $store r0,RTV ,r2 ; o$rtv(r2) := o$rtv(r1) return ; ... at last .......... .sbttl connect, copy and disconnect from the files to be copied copyfi: save ; save the old FAB addresses clr r4 ; blocks := 0 mov #coprb1 ,r1 ; connect up first please $connec r1 ; connect up now $fetch r0,STS ,r1 ; get the error code out bmi 100$ ; oops mov #coprb2 ,r2 ; connect up first please $connec r2 ; connect up now $fetch r0,STS ,r2 ; get the error code out bmi K11CPYMAC[.050032]K11CPY.MAC[.050032]    X14|H [4;Ik(&'( k ߫H&P` \RrPP2PPzPP{PPPPP2P~\$\\TD 0D \~ hi) +\ ^( n ^( np\^txY\^ˀ\!kVk<\F˰<˴ˬ\VVkˤ1`@lP ABCDEFGHIJKLMNOPQRSTUVWXYZ$.?0123456789<@<SЬTЬ UQS>?\\\\\\\\\`:#@'="\abcdefghi\\\\\\\jklmnopqr\\\\\\\~stuvwxyz\\\\\\\\\\\\\\\\\\\\\\{ABCDEFGHI\\\\\\}JKLMNOPQR\\\\\\\\STUVWXYZ\\\\\\0123456789\\\\\  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~@ggh<i|o<m<4p<p<k|Zn<l fr rwx<x<x<x޺<w@]@@fjnr]Ze@@|> | |v<H|  |  |xz|  |zt f r   < &^ @&@'*/V,"?Lh:hmBmz|z{x`y~|fN|@@|@͂|@ ݃ƃ<ns<|Ŏ |️|ep|u|-@率|<ᄇ2ֻr||ZRM | ntB|xyvZw|J=|R>|J? nnaa|bddf100$ ; oops 10$: clr o$bkt+0(r1) ; setup for sequential reads and writes clr o$bkt+2(r1) ; two words for block numbers clr o$bkt+0(r2) ; do it to both the input RAB and the clr o$bkt+2(r2) ; output RAB $store #copbfs,USZ,r1 ; stuff the buffer size in $store #copbuf,UBF,r1 ; and also the buffer address please $read r1 ; get the next block $fetch r0,STS ,r1 ; get the error code out bmi 90$ ; oops, exit on error please $fetch r5,RSZ ,r1 ; get the byte count please $store r5,RSZ ,r2 ; stuff the buffer size in $store #copbuf ,RBF,r2 ; and also the buffer address please $write r2 ; write the next block $fetch r0,STS ,r2 ; get the error code out bmi 90$ ; oops, exit on error please ash #-11 ,r5 ; convert byte count to blocks add r5 ,r4 ; blocks := blocks + bytecount/512 br 10$ ; next please 90$: $discon r1 ; disconnect from input RAB $discon r2 ; disconnect from the output RAB cmp r0 ,#ER$EOF ; normal exit is always EOF bne 100$ ; exit with error_code = 0 clr r0 ; error_code := 0 100$: unsave ; pop the old FAB addresses now. return ; access streams and return. .end