.title point ; ; ; subroutine which positions software tools file to a specific ; disk address. ; ; call sequence: status = point(rab, addr1, addr2) ; ; where ; rab is the integer descriptor from the openf call ; addr1,addr2 are the integers returned by a markl call ; ; returns ; OK(0) if successful ; EOF(-1) if successful and at end of file ; ERR(-3) if any error in positioning file ; ; ok=0 eof=-1 err=-3 rab=4 adr1=8 adr2=12 ; ; ; local buffer for dummy reads ; .psect st_point_data rel,con,gbl,noexe,wrt,rd,pic,noshr,usr,novec,long buf: .blkb 4 ; .psect st_pure_code rel,con,lcl,exe,nowrt,rd,pic,shr,usr,novec,long .entry point ^m movl @rab(ap),r2 ; rab address in r2 movl @adr1(ap),rab$w_rfa(r2) ; copy block number beql rewind ; if 0, rewind file movw @adr2(ap),rab$w_rfa+4(r2) ; copy byte offset movb rab$b_rac(r2),-(sp) ; save old rac $rab_store rab=r2,rac=rfa ; set to RFA $find rab=r2 ; position file movb (sp)+,rab$b_rac(r2) ; restore rac field moval buf,rab$l_ubf(r2) ; set up for dummy read movw #4,rab$w_usz(r2) ; $get rab=r2 ; get sets up next record brb retrn rewind: $rewind rab=r2 ; rewind file to set next rec retrn: movl @adr1(ap),rab_l_curbl(r2) ; fill in current record movzwl @adr2(ap),rab_l_curby(r2) ; ret .end