.title ENTER - ENTER a file (set file/enter by ID) ;+ ; ; ENTER - set file/enter by file ID ; ; Program: ENTER.MAR ; Author: David G. North, CCP ; 1333 Maywood Ct ; Plano, Texas 75023-1914 ; (214) 902-3957 ; ; Date: 90.11.16 ; ; Revisions: ; Who Date Description ; D.North 901116 DECUS release (Fall '90) ; D.North 911113 DECUS release (Fall '91) ; ; License: ; Ownership of and rights to these programs is retained by the author(s). ; Limited license to use and distribute the software in this library is ; hereby granted under the following conditions: ; 1. Any and all authorship, ownership, copyright or licensing ; information is preserved within any source copies at all times. ; 2. Under absolutely *NO* circumstances may any of this code be used ; in any form for commercial profit without a written licensing ; agreement from the author(s). This does not imply that such ; a written agreement could not be obtained. ; 3. Except by written agreement under condition 2, source shall ; be freely provided with all binaries. ; 4. Library contents may be transferred or copied in any form so ; long as conditions 1, 2, and 3 are met. Nominal charges may ; be assessed for media and transferral labor without such charges ; being considered 'commercial profit' thereby violating condition 2. ; ; Warranty: ; These programs are distributed in the hopes that they will be useful, but ; WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ; or FITNESS FOR A PARTICULAR PURPOSE. ; ;- $ssdef $psldef $rmsdef ; .library "mar:always" .psect ENTER$DATA,wrt,noexe fab: $fab rab: $rab nam: $nam esa=esa,ess=128,rsa=rsa,rss=128 ; used to rewrite nam esa: .blkb 128 rsa: .blkb 128 $equlst ,,0,2,<,,> fid: .blkw 3 ;place for final file ID fil_d: .long 96,10$ ;fna buffer descriptor 10$: .blkb 96 ;fna buffer fid_d: .long 8,10$ ;fid buffer descriptor 10$: .blkb 8 ;fid buffer seq_d: .long 8,10$ ;seq buffer descriptor 10$: .blkb 8 ;seq buffer rvn_d: .long 8,10$ ;rvn buffer descriptor 10$: .blkb 8 ;rvn buffer d_fid: .ascid /FID/ d_fil: .ascid /FILENAME/ .psect ENTER$CODE,nowrt,exe .entry main, ^m movaw fid,r6 ;point to fid block pushaq d_fid calls #1,g^cli$present blbs r0,10$ ;must have one 5$: ret ;convenient ret instr 10$: pushaw fid_d pushaq fid_d pushaw d_fid calls #3,g^cli$get_value ;retrieve FID blbc r0,5$ ;oops... die cmpl r0,#CLI$_COMMA ;is there more than 1?? beql 20$ ;yep... convert & get next one movzwl #SS$_INSFARG,r0 ;signal bum rap ret ;bomb job 20$: pushl #1 pushl #2 pushaw fil_fid(r6) ;convert to binary pushal fid_d calls #4,g^ots$cvt_tu_l blbs r0,30$ 25$: ret ;convenient ret 30$: pushaw seq_d pushaq seq_d pushaw d_fid calls #3,g^cli$get_value ;retrieve FID blbc r0,25$ ;oops... die movl r0,r2 ;save ret code for later clrw fil_rvn(r6) ;assume rvn=0 pushl #1 pushl #2 pushaw fil_seq(r6) ;convert to binary pushal seq_d calls #4,g^ots$cvt_tu_l blbs r0,40$ 35$: ret ;convenient ret 40$: cmpl r2,#CLI$_COMMA ;was there another value? bneq 50$ pushaw rvn_d pushaq rvn_d pushaw d_fid calls #3,g^cli$get_value ;retrieve FID blbc r0,35$ ;oops... die pushl #1 pushl #2 pushaw fil_rvn(r6) ;convert to binary pushal rvn_d calls #4,g^ots$cvt_tu_l blbc r0,35$ ; ++ ; now the fid has been extracted... see about filename ; -- 50$: pushaq d_fil calls #1,g^cli$present blbs r0,60$ cmpl r0,#CLI$_ABSENT beql 55$ ret 55$: SPRINTF fil_d,,fil_fid(r6),fil_seq(r6),fil_rvn(r6) brw 70$ 60$: movw fil_d,r2 pushaw fil_d pushaq fil_d pushaq d_fil calls #3,g^cli$get_value blbs r0,70$ ret ; ++ ; filename created or extraced, fid extracted... try to enter ; -- 70$: moval fab,r7 movb fil_d,fab$b_fns(r7) ;set filenamesize movab @fil_d+4,fab$l_fna(r7) ;point to name movl #fab$m_nam,fab$l_fop(r7) ; fop=nam- movab nam,fab$l_nam(r7) ; nam=nam $parse (r7) ; parse fab blbc r0,80$ ; on error exit with status movc3 #6,(r6),nam+nam$w_fid ; set fid in nam $enter (r7) ; enter directory pointer blbc r0,80$ ; on error exit with status PRINTF ,- #fil_d,fil_fid(r6),fil_seq(r6),fil_rvn(r6) movzbl #SS$_NORMAL,r0 ret 80$: movl r0,r2 PRINTF ,- #fil_d,fil_fid(r6),fil_seq(r6),fil_rvn(r6) movl r2,r0 ret .end main