.title dfind ; ; this routine implements the following fortran interface ; ; status = dfind(fdb, buf, fid) ; ; where fdb is the FDB address returned by dopen ; buf is an array to hold the file name, type and version ; fid is a 3-word array to hold the file id ; ; status = OK if another file was found in the directory ; EOF if no more files in the directory ; .mcall fdof$l, nbof$l fdof$l nbof$l ap=%5 fdb=2 buf=4 fid=6 ok=0 eof=-1 dfind:: mov @fdb(ap),r0 ; FDB address in r0 mov r0,r1 ; FDB address in r1 add #f.fnb,r1 ; FNB address in r1 call .find ; find next directory entry bcs done ; if c set, no more files mov r1,r2 ; FNB address in r2 add #n.fid,r2 ; file id address in r2 mov fid(ap),r3 ; output array address in r3 mov (r2)+,(r3)+ ; copy first word mov (r2)+,(r3)+ ; copy second word mov (r2),(r3) ; copy third word mov r1,r2 ; FNB address in r2 add #n.fnam,r2 ; file name address in r2 mov buf(ap),r3 ; output array address in r3 mov (r2)+,(r3)+ ; copy first word of file name mov (r2)+,(r3)+ ; copy second word of file name mov (r2)+,(r3)+ ; copy third word of file name mov (r2)+,(r3)+ ; copy extension mov (r2),(r3) ; copy version number mov #ok,r0 ; return OK return done: mov #eof,r0 ; return EOF return .end