.title filnfo ;+ ; integer function filnfo(int, file, access) ;- ap=%5 int=2 file=4 access=6 .psect $r.roi,con,ro,rel,lcl,i .enabl lsb filnfo:: mov #err,-(sp) ; assume error mov @int(ap),r0 ; rat4 unit number call r$gfbk ; retrieve RFDB bcs 100$ ; c set => error bit #rf.clo,(r1) ; file open on unit? bne 100$ ; NO movb r.acc(r1),r0 ; fetch access mov r0,@access(ap) ; return to user add #r.name,r1 ; now have address of file name mov file(ap),r0 ; destination buffer 10$: movb (r1)+,(r0)+ ; copy character bne 10$ ; if not EOS, do again mov #ok,(sp) ; return(OK) 100$: mov (sp)+,r0 ; return(status) return .end