.title File Protect/Rename Programmed Requests ; DECUS C Calling Format ; ; jsr r5,csv$ ;save r2,r3, and r4 ; ;r5 is parameter base ; ;c$pmtr(r5) is first argument ; ;c$pmtr+2(r5) is second argument ; ;... ; ;return args in r0 ; ... ; user code ; ... ; ; jmp cret$ ;restore r2-r5 and return ; rts pc ;does the same (cret$ follows csv$) ; ; csv$ and cret$ need be used only if arguments are used ; errbyt = 52 arg1 = 2 arg2 = 4 .sbttl File Protection Call ; VOID fprot(str,pflag) ; ; str - a pointer to a 4 word rad50 file name ; pflag - 1 set file protection flag ; - 0 clr file protection flag ; .psect c$code fprot:: mov arg1(sp),f$file ;file name pointer mov arg2(sp),f$flag ;protection flag beq 1$ mov #1,f$flag ;ensure proper value 1$: mov #f$prot,r0 emt 375 rts pc .psect c$data f$prot: .byte 14,43 ;.fprot f$file: .word 0 ;pointer to filespec f$flag: .word 0 ;protection flag .sbttl Rename File ; int rename(dblk) ; ; dblk - Pointer to an 8 word rad50 file specification ; ; returns error code .psect c$code frename:: mov arg1(sp),f$dblk ;load pointer mov #f$renm,r0 emt 375 ;.rename bcc 1$ movb @#errbyt,r0 ;error inc r0 rts pc 1$: clr r0 ;no error rts pc .psect c$data f$renm: .byte 14,4 ;.rename f$dblk: .word 0 ;dblk pointer .end