.title assngi ;+ ; int = assngi(ext, access, int) ; ; assigns file ext to rat4 unit int, closing int first if open ; ; returns ERR if any error occurs ;- ap=%5 ext=2 access=4 int=6 ; ; .psect $r.roi,con,ro,rel,lcl,i .enabl lsb assngi:: mov @int(ap),r0 ; rat4 unit number call r$gfbk ; get RFDB address bcs 100$ ; c set => invalid unit call r$clsf ; close the file if necessary cmp #read$r,@access(ap) ; READ access? bne 10$ ; NO call r$opnf ; open existing file at READ access return 10$: call r$cref ; create file with access return 100$: mov #err,r0 ; return ERR return .end