.TITLE PPP - PAPER TAPE PUNCH DESPOOLER .IDENT /V1.01/ .NLIST TOC,SYM .ENABL LC ; Main Segment 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 PPP=PPP ;+ ; Root segment of paper tape punch despooler for use with RSX-11M V3.2 ; Queue Manager. For background details of operation, see the RSX-11M ; Utilities Manual, and "The Multi-Tasker", V14 No3 pp88-97 (March 1981). ; ; This segment receives messages from the queue manager, and calls ; appropriate routines to process them. ;- .MCALL FINIT$,SRDA$C,RCVD$C,RCST$C,EXIT$S,DIR$,USTP$C .PSECT CODE,I,RO PPP:: MOV SP,SPSAVE ; Save Initial SP FINIT$ ; Initialise FCS ; Come here when a packet from QMG... is expected or awaited. WAIQMG::MOV SPSAVE,SP ; Restore SP SRDA$C ,CODE ; Disable receive data AST's RCST$C QMG...,TSKBUF,CODE ; Stop for a packet BCS ERROR ; Complain about errors CMP $DSW,#IS.SUC ; Packet waiting when RCST$ issued? BEQ RCVD ; Yes, go process it CMP $DSW,#IS.SET ; No, do we have one to fetch? BNE ERROR ; No, error GET: RCVD$C QMG...,TSKBUF,CODE ; Yes, fetch packet BCC RCVD ; OK if it worked CMP $DSW,#IE.ITS ; Were there none to fetch (someone did an UNStop)? BEQ WAIQMG ; Yes, go back and wait again BR ERROR ; Trap other failure RCVD: MOV #PACKET,%5 ; Address start of packet MOVB (%5)+,%0 ; First byte is function code CMPB %0,#QP.EXT ; Make sure it's legal. QP.EXT is biggest BLOS 15$ ; OK if it is JSR PC,ILLCMD ; No, report illegal one BR WAIQMG ; and wait for another 15$: INC %5 ; Legal code. Point to 2nd word of packet ASL %0 ; Double code for JSR PC,@FUNCTN(%0) ; call from table BR WAIQMG ; Always back for next message ; Directive error ERROR: JSR PC,DIRERR ; Report it BR WAIQMG ; and wait for next message ; STOP and EXIT commands are simple. Do them here. STOP: TSTB STATE ; At end-of-job? BNE 10$ ; No, interrupt DECB STATE ; Yes, stop processor, say dormant 10$: MOV #QM.SPA,%0 ; Recognise solicited pause ; STOP completion doubles as general subroutine to send a message to QMG... SNDQMG::MOV %0,RPYPKT ; Put in first word of reply packet DIR$ #REPLY,DIRERR ; Send reply, with error check USTP$C QMG...,CODE ; Wakeup QMG to receive it RTS PC ; and return to caller EXIT: EXIT$S ; Nothing special to do .PSECT STATIC,D,RO,LCL ; Dispatch table, in order of function codes: ; 0 1 2 3 4 5 6 FUNCTN: STJOB, PROCES, STOP, CONTIN, ENDJOB, START, EXIT .END PPP