.TITLE RWATT - READ/WRITE ATTRIBUTES .IDENT /V01/ .NLIST BEX .MCALL QIOW$S,EXIT$S,OPEN$,FSRSZ$,GCMLB$,GCML$,CSI$1,CSI$2 .MCALL FINIT$,NMBLK$,FDBDF$,CSI$SV,CSI$ND,CSI$,DIR$,QIOW$ .MCALL FHDOF$,CSI$SW,ALUN$S,FDOP$A FSRSZ$ 2 BUFFER: .BLKB 512. TIBUF: .BLKB 80. STBUFF: .BLKB 10. ; STATISTICS BUFFER GCML: GCMLB$ 3,ATT ATTFDB: FDBDF$ FDOP$A 2 ATTMSK= 1 HLPMSK= 2 UPDMSK= 4 LSTMSK= 10 SWITCH: CSI$SW AT,ATTMSK,,,,SWTBL CSI$SW HE,HLPMSK CSI$SW UP,UPDMSK CSI$SW LI,LSTMSK CSI$ND SWTBL: CSI$SV OCTAL,ATTNUM,2 CSI$SV OCTAL,ATTVAL,2 CSI$SV OCTAL,ATTVAL+2,2 CSI$SV OCTAL,ATTVAL+4,2 CSI$SV OCTAL,ATTVAL+6,2 CSI$SV OCTAL,ATTVAL+10,2 CSI$SV OCTAL,ATTVAL+12,2 CSI$SV OCTAL,ATTVAL+14,2 CSI$SV OCTAL,ATTVAL+16,2 CSI$SV OCTAL,ATTVAL+20,2 CSI$SV OCTAL,ATTVAL+22,2 CSI$ND ATTNUM: .WORD 0 ATTVAL: .BLKW 10. NUMVAL= 10. CSI$ CSI: .BLKB C.SIZE .EVEN RDATT: QIOW$ IO.RAT,2,1,,IOSTAT,, RDATL: .BYTE -12,0 .WORD BUFFER .BYTE -11,12 .WORD STBUFF,0 WTATT: QIOW$ IO.WAT,2,1,,IOSTAT,, WTATL: .BYTE 4,40 .WORD BUFFER+H.UFAT .BYTE 3,1 .WORD BUFFER+H.UCHA,0 IOSTAT: .WORD 0,0 QIODPB: QIOW$ IO.WVB,5,1,,IOSTAT,, QIOBUF= QIODPB+Q.IOPL QIOLEN= QIODPB+Q.IOPL+2 LINE1: .ASCIZ "WD.00/ %8P" LINE2: .ASCIZ "WD.10/ %8P" LINES: .ASCIZ "STATBK:%5P" LINE3: .ASCIZ "(LEGEND: #0=R.FIX=1,R.VAR=2,FD.FTN=400,FD.CR=1000,FD.BLK=4000)" LINE4: .ASCIZ "( #1=F.RSIZ; #2,3=F.HIBK; #4,5=F.EFBK; #6=F.FFBY)" LINE5: .ASCIZ "(STATBK: #0,1=HI,LO LBN; #2,3=SIZE; #4A=#ACCESS, #4B=#LOCK)" HELP: .ASCIZ "ATT- READ/UPDATE ATTRIBUTES. 'ATT FILESPEC/SW:VL:VL...'" .ASCIZ " WHERE FILESPEC IS THE HEADER, AND THE SWITCHES ARE:" .ASCIZ " /AT:NO.:VAL:VAL...=UPDATE ATTRIBUTES, STARTING WITH" .ASCIZ " WORD # 'NO.', THEN SUCCESSIVELY." .ASCIZ " /HE = THIS HELP TEXT" .ASCIZ " /UP = UPDATE A LOCKED FILE. CLEARS THE LOCK BIT, &" .ASCIZ " COPIES THE FILE SIZE INTO THE EOF & HI BLOCK" .ASCIZ " INDICATORS. FFBY=1000 AND THE RSIZ IS SET TO" .ASCIZ " 1000 IF IT IS ZERO. THIS OPTION MAY CONFLICT" .ASCIZ " WITH '/AT', AND SHOULD BE USED ALONE." .ASCIZ " /LI = LIST OUT THE ATTRIBUTE & STATISTIC INFORMATION" .BYTE 0 .EVEN FHDOF$ DEF$L ; .ENABLE LSB START: FINIT$ ALUN$S #1,#"TI,#0 ALUN$S #2,#"SY,#0 10$: GCML$ #GCML ;GET INPUT LINE BCC 100$ CMPB #GE.EOF,G.ERR(R0) BNE 30$ EXIT$S 30$: QIOW$S #IO.WVB,#5,#1,,,,<#31$,#32$-31$,#40> BR 10$ 31$: .ASCII /ATT - COMMAND ERROR/ 32$: .EVEN ; 100$: CSI$1 #CSI,G.CMLD+2+GCML,G.CMLD+GCML BCC 200$ 110$: QIOW$S #IO.WVB,#5,#1,,,,<#111$,#112$-111$,#40> BR 10$ 111$: .ASCII /ATT - SYNTAX ERROR/ 112$: .EVEN ; 200$: MOV #ATTVAL,R5 MOV #NUMVAL,R4 210$: MOV #152525,(R5)+ SOB R4,210$ CSI$2 R0,OUTPUT,#SWITCH BCC 300$ BR 111$ ; 300$: BIT #HLPMSK,CSI+C.MKW1 BEQ 305$ JMP 1000$ 305$: MOV #ATTFDB,R0 MOV #ATTFDB+F.FNB,R1 MOV #CSI+C.DSDS,R2 CLR R3 CALL .PARSE ;SET UP FDB BCC 400$ 310$: QIOW$S #IO.WVB,#5,#1,,,,<#311$,#312$-311$,#40> JMP 10$ 311$: .ASCII "ATT - FILE PARSE / DIRECTORY ERROR" 312$: .EVEN ; 400$: CALL .FIND ;GET THE FILE ID BCS 310$ DIR$ #RDATT ;READ THE ATTRIBUTES, STATISTICS BLK BCS 410$ TSTB IOSTAT BGT 500$ 410$: QIOW$S #IO.WVB,#5,#1,,,,<#411$,#412$-411$,#40> JMP 10$ 411$: .ASCII /ATT - ATTRIBUTE READ ERROR/ 412$: .EVEN ; 500$: BIT #ATTMSK,CSI+C.MKW1 BEQ 550$ BIC #177760,ATTNUM MOV ATTNUM,R5 MOV R5,R4 NEG R5 ADD #20,R5 CMP R5,#NUMVAL BLE 510$ MOV #NUMVAL,R5 510$: ASL R4 ADD #BUFFER+H.UFAT,R4 MOV #ATTVAL,R3 520$: MOV (R3)+,R2 CMP R2,#152525 BEQ 550$ MOV R2,(R4)+ SOB R5,520$ 550$: BIT #UPDMSK,CSI+C.MKW1 BEQ 580$ BITB #UC.DLK,BUFFER+H.UCHA BEQ 580$ BICB #UC.DLK,BUFFER+H.UCHA MOV STBUFF+4,R0 ;GET HI SIZE MOV STBUFF+6,R1 ;GET LO SIZE MOV R0,BUFFER+H.UFAT+4 MOV R0,BUFFER+H.UFAT+10 MOV R1,BUFFER+H.UFAT+6 MOV R1,BUFFER+H.UFAT+12 MOV #1000,BUFFER+H.UFAT+14 TST BUFFER+H.UFAT+2 BNE 560$ MOV #1000,BUFFER+H.UFAT+2 ;SET DEFAULT TO 512 560$: ; 580$: TST CSI+C.MKW1 ;LISTING IS DEFAULT IF NO FLAGS BEQ 585$ BIT #LSTMSK,CSI+C.MKW1 ;ELSE SEE IF LISTING DESIRED BEQ 600$ ;NO - CONTINUE 585$: MOV #TIBUF,R5 MOV R5,R0 MOV #LINE1,R1 MOV #BUFFER+H.UFAT,R2 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB MOV R5,R0 MOV #LINE2,R1 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB MOV R5,R0 MOV #LINES,R1 MOV #STBUFF,R2 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB MOV R5,R0 MOV #LINE3,R1 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB MOV R5,R0 MOV #LINE4,R1 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB MOV R5,R0 MOV #LINE5,R1 CALL $EDMSG MOV R1,QIOLEN DIR$ #QIODPB ; ; WRITE OUT THE HEADER ATTRIBUTES ; 600$: BIT #,CSI+C.MKW1 ;WRITE REQ'D? BEQ 900$ DIR$ #WTATT BCS 610$ TSTB IOSTAT BGT 900$ 610$: QIOW$S #IO.WVB,#5,#1,,,,<#611$,#612$-611$,#40> JMP 10$ 611$: .ASCII /ATT - WRITE ATTRIBUTES FAILURE/ 612$: .EVEN ; 900$: JMP 10$ ; 1000$: MOV #HELP,R0 1010$: MOV R0,R1 TSTB (R1) BNE 1020$ JMP 10$ 1020$: TSTB (R1)+ BNE 1020$ MOV R1,R2 DEC R1 SUB R0,R1 QIOW$S #IO.WVB,#5,#1,,,, MOV R2,R0 BR 1010$ .END START