.TITLE STJOB - START OF JOB .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 PPPSTJOB=LB:[200,200]RSXMC/PA:1,[1,1]RUNMAC/ML,SY:[g,m]PPPSTJOB ;+ ; Receive Start-of-Job packets from Queue Manager. ; These come as a pair. The contents of global flag STATE indicates which ; of the two is expected. ;- ; MODIFICATIONS RECORD ; ==================== ; V1.01 13-Jul-82 CJD ; Add conditionals to assemble for RSX V4 modified data packets. .MCALL QIOW$R,QIOW$M .PSECT CODE,I,RO STJOB:: MOVB STATE,%1 ; Fetch and check processor state flag BEQ STJOB1 ; 0 means ready for first start-of-job packet DECB %1 ; 1 means ready for second BEQ STJOB2 JMP ILLCMD ; Anything else is illegal ; Save the useful parts of the first start-of-job packet. STJOB1: INCB STATE ; Set STATE=S.JOB1 .IIF EQ V$$RSN-32, MOV PACKET+Q.PTI,TIUCB ; Issuing terminal UCB for error messages MOV (%5)+,JOBUIC ; Get job UIC, for read access check .IIF EQ V$$RSN-32, CMP (%5)+,(%5)+ ; Address form type byte .IIF GE V$$RSN-40, MOV #PACKET+Q.PFRM,%5 ; Address form type byte MOVB (%5)+,TAPE ; which is tape type (0=8-TRACK, 1=5) MOVB (%5)+,%1 ; "Lines" = format CMPB %1,#F.MAX ; Make sure it's legal BLOS 10$ ; OK if so JSR PC,ILLFRM ; Error message if not CLRB %1 ; Will use default 10$: MOVB %1,QMFORM ; Save format received MOVB (%5)+,FLAGS ; Get no of flag pages. TSTB @%5 ; Do we really want flags? (Q.PFFP<>0)? BNE 20$ ; Yes, done CLRB FLAGS ; No, cancel flags 20$: RTS PC ; Back for second start-of-job packet ; Second Start-of-Job packet. STJOB2:.IIF GE V$$RSN-40, MOV PACKET+Q.PTI,TIUCB ; Issuing terminal UCB for error messages MOV PACKET+Q.PNFI,FILES ; Get no of files in job CLRB RPYPKT+Q.MCP ; Say no copies punched yet QIOW$R PPQIOW,#IO.ATT ; Attach punch MOVB IOSTAT,%1 ; See if it worked BPL 10$ ; Yes, OK CMPB %1,#IE.DAA ; Attached already? BEQ 10$ ; Yes, don't report that JSR PC,QIOERR ; Else error 10$: QIOW$M PPQIOW,#IO.WLB ; Standardise QIO DPB for writes INCB STATE ; Set STATE=S.FILE=2 RTS PC ; and return to wait for QMG .END