.TITLE HL RSP-PSEUDO HANDLER for remote MAIL exchange, ; Multiprocessor V5 display remote devices, ; Read/Write access .IDENT /V05.00/ ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++; ; COPYRIGHT (c) 1985 by ; ; H.H. Klin. Neuro. AZG ; ; ; ; This software is furnished under a LICENSE and may be USED ONLY IN ; ; ACCORDANCE WITH THE TERMS OF SUCH LICENSE. This software or ; ; any other copies thereof may not be provided or otherwise made ; ; available to any other person. NO TITLE TO AND OWNERSHIP OF THE ; ; SOFTWARE IS HEREBY TRANSFERRED. ; ; ; ; 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 ! <<<< ; Error logging NOT included! .ENABL LC .MCALL .DRDEF,.PRINT .DRDEF HL,377,SPFUN$,0,0,0 ; DEFAULTs, may be changed with SET command: ; ======= UNITST = 8. ;Value of first unit nr. of this device UNITNR = 2 ;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 HLSTS U0: .WORD UNITST US: .WORD UNITNR TEXT: .ASCII <12>/RSPvc=/<200> .ASCII /Status=/<200> .ASCII /Unit0 =/<200> .ASCII /Units =/<200> OUTP: .BLKB 10. TAIL: .ASCIZ /<< HELLO/ .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 HL MOV HLCQE,R4 ; ; 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 MOVB Q$UNIT(R4),R1 ;Get device unit nr. BIC #^C<7>,R1 ;strip to 0-7 CMP UNITS,R1 ;Valid number? BLOS HLERR ADD UNIT0,R1 ;Make new unit number. CLR SPDATA ;Clear SPFUN data word in HDBLK. ; ; Check if SPFUN: ; =============== ; Valid codes 300 => request size for RSP unit 0 ; 301 => request size for RSP unit 1 ; . ; 317 => request size for RSP unit 17 = 15. TSTB Q$UNIT(R4) BNE RW ;If not 0 pass all requests as they are. CLR R3 BISB Q$FUNC(R4),R3 BEQ RW SUB #300,R3 ;SPFUN to code 0 ... 15. BMI HLERR CMP R3,#16. BHIS HLERR MOV #1,Q$WCNT(R4) MOV #1,SPDATA ;.SPFUN word count MOVB #373,Q$FUNC(R4) MOV #373,R1 ;Load SPFUN size request SWAB R1 BIS R3,R1 ;Load new RSP unit nr. RW: TST Q$WCNT(R4) BEQ HLDONE MOV R1,(R2)+ ;copy unitnr. in HDBLK MOV R4,(R2)+ ; " Q-pointer " " MOV PC,R1 ADD #HLFIN-.,R1 MOV R1,(R2)+ ;copy return adress in HDBLK MOV @PDVEC,R5 ;Get where SYS-handler is. BEQ HLERR ;PD: should be loaded! TST -(R5) ;jump back over abort entry PD JMP -(R5) ;JUMP to SYS-H body. PDVEC: .WORD PD$VEC UNIT0: .WORD UNITST UNITS: .WORD UNITNR 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 SYS-handler is. BEQ HLERR ;PD: should be loaded! JMP -(R5) ;JUMP to SYS-H body. HLABRT: BR ABORT ;Abort entry of HL: HLINT:: .SBTTL OPERATION COMPLETE HLERR: MOV HLCQE,R4 BIS #HDERR$,@-(R4) HLDONE: HLFIN: .DRFIN HL .DREND HL .END