.TITLE RD PSEUDO-REMOTE DISK HANDLER ; Multiprocessor V5 .ENABL LC ; COPYRIGHT (c) 1985 by ; H.H. Klin. Neuro. AZG ; ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE ; ; Handler-Queue of communcations handler contains pointers to handler ; blocks with the following format: ; ----------------------------------------- ; HDBLK: ! SPFUN CODE 0-377 ! UNIT NR. 0-377 ! ; ! Q-ELEMENT POINTER ! ; ! RETURN ADRES ! ; ! SPFUN DATA ! ; ----------------------------------------- .SBTTL MACROS AND DEFINITIONS .IIF NDF,TIM$IT TIM$IT= 1 ;Default TIME-OUT support! .IIF NDF,MMG$T MMG$T = 1 ;Default XM support ; >>>> NOTE: this handler can adapt to non-XM with SET XX SYSGEN ! <<<< .MCALL .DRDEF, .PRINT .DRDEF RD, 377, FILST$!SPFUN$!VARSZ$, 16.,0,0 ;Minimum size = 4Kw VM: ; DEFAULTs, may be changed with SET command: ; ======= UNITST = 11. ;Value of first unit nr. of this device UNITNR = 4 ;Total number of units for " " PD$VEC = 310 ;Vector of datacommunication handler(DR=310, WB=270, QN=170) .DRSET SHOW,-1,S.SHOW ;;SHOW .DRSET RSPVEC,477,S.VEC,OCT ;;Vector DC-handler .DRSET UNITS, 7 ,S.US, ;;Set total device unit nrs. .DRSET UNIT0,15.,S.U0, ;;Set RSP UNIT start number .DRSET SYSGEN,-1,S.SYS ;;Set SYSGEN bits NR = 4 ;Total nr. of numbers to be printed. S.SHOW: MOV R4,-(SP) MOV R5,-(SP) MOV PC,R4 ADD #NUMBER-.,R4 MOV PC,R5 ADD #TEXT-.,R5 MOV #NR,R1 MOV PC,R2 ADD #OUTP-.,R2 LOOP: MOV (R4)+,R0 MOV R2,R3 CALL CNV8 .PRINT R5 .PRINT R2 ADD #8.,R5 SOB R1,LOOP MOV PC,R0 ADD #TAIL-.,R0 .PRINT MOV (SP)+,R5 MOV (SP)+,R4 CLC RETURN S.VEC: MOV R0,PDVEC MOV R0,NUMBER ;For SHOW BR ZZZZ S.US: MOV R0,UNITS ;Set No. DEVICE UNITs MOV R0,US ; and for SHOW BR ZZZZ S.U0: MOV R0,UNIT0 ;Set RSP UNIT START. MOV R0,U0 ;for SET SHOW ZZZZ: CMP R3,R0 RETURN RMON = 54 SYSOP = 372 S.SYS: MOV @#RMON,R3 MOV SYSOP(R3),60 ;SYSGEN options RETURN NUMBER: .WORD PD$VEC .WORD RDSTS U0: .WORD UNITST US: .WORD UNITNR TEXT: .ASCII <12>/RSPvc=/<200> .ASCII /Status=/<200> .ASCII /Unit0 =/<200> .ASCII /Units=/<200> OUTP: .BLKB 9. TAIL: .ASCIZ / Pseudo DISK/ .EVEN ; Routine converts bits to octal ASCII string. ; R0; Contains bits to be converted ; R3; Points to output area ; Size of area should be nr. digits plus two ; On return R3 points to string terminator ; Note: Contens of R0, R3 is changed!! CNV8:: MOV R1,-(SP) CALL CONVRT MOVB #' ,(R3)+ MOVB #200,@R3 MOV (SP)+,R1 RETURN CONVRT: MOV R0,R1 CLR R0 DIV #8.,R0 MOV R1,-(SP) TST R0 BEQ DONE CALL CONVRT DONE: MOVB (SP)+,@R3 BISB #'0,(R3)+ RETURN .IIF GT <.-1000>, .ERROR .-1000 ;SET code too big! .SBTTL DRIVER ENTRY .DRBEG RD MOV RDCQE,R4 MOVB Q$UNIT(R4),R1 ;Get device UNIT nr. BIC #^C<7>,R1 ;strip to 0-7 CMPB UNITS,R1 ;Valid number? BLOS RDERR ADD UNIT0,R1 ;Make new unit number; RSP CLR SPDATA ;SPFUN data word in HDBLK=0. CLR R0 BISB Q$FUNC(R4),R0 BEQ RDWT ;Read/write only. ;-----------------------------------------------------------------------; SPFUN: CMP R0,#373 ;Size request? BNE RDERR ; ; Variable size support: ; SWAB R0 BIS R0,R1 MOV #1,Q$WCNT(R4) ; size requires 1 word to receive MOV #1,SPDATA ;.SPFUN word count ; Standard read/write RDWT: TST Q$WCNT(R4) BEQ RDFIN ; Set up HDBLK for this handler. MOV PC,R2 ;PIC ADD #HDBLK-.,R2 ; of Handler block MOV R2,R0 ;R0 must contain pointer to HDBLK MOV R1,(R2)+ ;copy unitnr. in HDBLK MOV R4,(R2)+ ; " Q-pointer " " MOV PC,R1 ADD #RDFIN-.,R1 MOV R1,(R2)+ ;copy return adress in HDBLK MOV @PDVEC,R5 ;Get where SYS-handler is. BEQ RDERR ;PD: should be loaded! TST -(R5) ;jump back over abort entry PD JMP -(R5) ;JUMP to SYS-H body. UNIT0: .WORD UNITST ;RSP device unit start nr. UNITS: .WORD UNITNR PDVEC: .WORD PD$VEC HDBLK: .BYTE 0 ;FUNC RSPUNT: .BYTE 0 ;UNITNR .WORD 0,0 ; Q-pointer, RET adres SPDATA: .WORD 0 .SBTTL Abort and Interrupt service: ABORT: MOV @PDVEC,R5 ;Get where DC-handler is. JMP -(R5) ;JUMP to abort entry of DC/SYS body. BR ABORT ;Abort entry of This Handler RDINT:: .SBTTL OPERATION COMPLETE RDERR: BIS #HDERR$,@-(R4) RDFIN: .DRFIN RD .DREND RD .END