.TITLE SETFLG - SET UP FLAG PAGE(S) STRING .IDENT /V1.01/ .NLIST TOC,SYM .ENABL LC ; Part of Sira Paper Tape Punch Despooler. ; ; COPYRIGHT(C) 1981,1982 Sira Institute Ltd., ; South Hill, Chislehurst, Kent, BR7 5EH, England. ; ; Author: C.J. Doran ; ; Assemble as: ; >MAC PPPSETFLG=PPPSETFLG ;+ ; Load file name, date, and time into flag page(s) string. ;- .MCALL DIR$ ; Macro to copy N bytes from where %1 points to where %0 points. .MACRO BCOPY N .REPT N MOVB (%1)+,(%0)+ .ENDR .ENDM ; Macro to get specified file attributes .MACRO GETATT TYPE,SIZE,ERR MOV #!,RATATT DIR$ #RATQIO,ERR .ENDM GETATT .PSECT CODE,I,RO SETFLG::MOV #HEADER,%0 ; Address tape header string MOVB FDB+F.FNB+N.DVNM,(%0)+ ; Copy device name, 1st char MOVB FDB+F.FNB+N.DVNM+1,(%0)+ ; and second MOV FDB+F.FNB+N.UNIT,%1 ; Get unit number CLR %2 ; No leading zeroes JSR PC,$CBOMG ; Octal magnitude MOVB #':,(%0)+ ; Terminated by colon MOV FILUIC,%3 ; Get file UIC MOV %0,%2 ; Copy string address CLR %4 ; Clear %4 for no leading zeroes, enclosing [] JSR PC,.PPASC ; in ASCII UIC MOV %2,%0 ; Put pointer back into %0 MOV #FDB+F.FNB+N.FNAM,%4 ; Address file name MOV #3,%3 ; 3 words of name 10$: MOV (%4)+,%1 ; Fetch Radix-50 word BEQ 12$ ; Don't bother to convert if 0 JSR PC,$C5TA ; Convert anything else to ASCII 12$: DEC %3 ; Decrement counter BGT 10$ ; Repeat if still in filename BMI 15$ ; Done if filetype 13$: CMPB -(%0),#<' > ; Trim trailing spaces from filename BEQ 13$ INC %0 ; Re-adjust pointer MOVB #'.,(%0)+ ; Precede filetype with '.' BR 10$ ; and go convert it 15$: MOVB #';,(%0)+ ; Precede version number with ';' MOV (%4)+,%1 ; Fetch it CLR %2 ; No leading zeroes JSR PC,$CBOMG ; Octal magnitude MOVB #' ,@%0 ; Then spaces .REPT 3 ; 4 of them MOVB (%0)+,@%0 .ENDR INC %0 ; Include the last MOVB #377,@%0 ; Fill in with padding 16$: CMP %0,#DATIM-1 ; Until time string BHIS 20$ ; Finished when reached it MOVB (%0)+,@%0 ; Keep padding until then BR 16$ ; Put last revision date and time into appropriate locations 20$: GETATT -15,43 ; Read dates BCC 30$ ; OK if it worked JMP QIOERR ; QIO error if not 30$: MOV #DAY,%0 ; Address dd-mm-yy MOV #BUFFER+2,%1 ; Now in 2nd word of buffer BCOPY 2 ; Copy dd INC %0 ; Bypass - BCOPY 3 ; Copy mmm INC %0 ; Bypass - again MOVB @%1,YEAR ; Put 1st digit of year in copyright message BCOPY 1 ; and in date string MOVB @%1,YEAR+1 ; Second year digit ditto BCOPY 1 MOV #TIME,%0 ; Point to time string BCOPY 2 ; Copy hour, 2 bytes INC %0 ; Bypass colon BCOPY 2 ; Minutes, 2 bytes CLRB ENDTIM ; Assume no copyright reqd CMPB FLAGS,#1 ; But is it? BLOS 40$ ; Yes, leave in terminating null MOVB #'C,ENDTIM ; No, put back 'C' of "COPYRIGHT" 40$: RTS PC ; Set up as much as needed .END