.title puts ; ; subroutine to put a record to a VMS file ; ; call sequence status = puts(rab, buffer, n) ; ; where rab is the integer descriptor from an openf call ; buffer is the buffer containing the record to be put ; n is the number of bytes to put ; ; status returned is OK or ERR ; err=-3 ok=0 rab=4 buf=8 num=12 .psect st_puts_data rel,con,gbl,noexe,wrt,rd,pic,noshr,usr,novec,long inpdsc: .long 256 .address errbuf outdsc: .long 256 .address errbuf errbuf: .blkb 256 .psect st_pure_code rel,con,lcl,exe,nowrt,rd,pic,shr,usr,novec,long .enabl lsb .enabl lsb .entry puts ^m brb 10$ ; branch to common code .entry st_puts ^m ; visible entry point 10$: movl #1,r3 ; initialize retry count movl @rab(ap),r2 ; rab address in r2 movl buf(ap),rab$l_rbf(r2) ; buffer address in rab movw @num(ap),rab$w_rsz(r2) ; # of bytes to put 1$: $put rab=r2 blbc r0,error ; low bit clear => error movl rab$w_rfa(r2),rab_l_curbl(r2) ; save RFA movzwl rab$w_rfa+4(r2),rab_l_curby(r2) ; bisl2 #2,rab$l_ctx(r2) ; set bit to indicate that put was done movl #ok,r0 ret error: decl r3 ; decrement retry count beql 1$ ; try it again $getmsg_s rab$l_stv(r2),outdsc,inpdsc ; format message pushal outdsc ; arg for lib$put_output calls #1,g^lib$put_output ; tell the user movl #err,r0 ret .end