.TITLE KWV11A .MCALL EXIT$S,qiow$s ; ; ODD: .WORD 0 ;Odd address indicator ; errtxt: .ascii /kwv11a--- does not exist/ errtxl=.-errtxt .even nopool: .ascii /kwv11a--- no pool space left/ nopoll=.-nopool .even pattxt: .ascii /kwv11a--- patch area not found/ pattxl =.-pattxt .even ; START: CLR ODD ;Say device present CALL $SWSTK,10$ ;Enter system state MOV #1000$,-(SP) ;Return address from $sgfin CALL $SGFIN ;Toggle trap vector TST @#170420 ;Is this device here BCC 1$ ;If cc,yes DEC ODD ;Tell user odd address 1$: RETURN ;Restore trap vectors 1000$: TST ODD ;Was device there BLT 9$ ;If lt,no just exit CLR @#177546 ;Disable line clock MTPS #PR7 ;Disable interupts MOV R0,-(SP) ;save reg. MOV R1,-(SP) ; MOV R2,-(SP) ; MOV R3,-(SP) MOV #5,R2 ;Set loop count MOV #$CKINT,R0 ;Get address to clock interupt code 5$: CMP (R0)+,#12704 ;Look for patch area BEQ 6$ ;if eq,match SOB R2,5$ ;continue with loop 6$: CMP (R0),#$INTCT ;try this as well beq 66$ ;no match found,just exit inc odd ;indicate no br 50$ ;and exit 66$: mov R0,R3 ;copy r0 mov #40,r1 ; call $alocb ;allocate core block bcc 7$ ;if cs no pool mov #2,odd ;mark no pool left br 50$ ;and exit 7$: MOV #4737,-2(R3) ;code for call @#VEC MOV r0,(R3) ; ..... MOV #42737,(R0)+ ;code for bic #200,@#170420 MOV #200,(R0)+ ; ..... MOV #170420,(R0)+ ; ..... MOV #12704,(R0)+ ;code for mov #$ckint,r4 MOV #$INTCT,(R0)+ ; ..... MOV #207,(R0)+ ; code for return MOV @#100,@#450 ;Toggle the interupt vectors MOV @#102,@#452 ;from line clock to KWV11A MOV #$NONSI,@#100 ;Set nonsens interupt for line cock MOV #-2000.,@#170422 ;Set preset value for KWV11A 50$: MOV (SP)+,R3 MOV (SP)+,R2 ;Restore reg. MOV (SP)+,R1 ; MOV (SP)+,R0 ; MTPS #PR0 ;Enable interupts 9$: RETURN ;Return to user state 10$: tst odd ;any error bgt 102$ ;if gt yes blt 101$ ;if lt it doesn't exist MOV #123,@#170420 ;Enable KWV11A EXIT$S ;Exit 101$: mov #errtxt,r1 mov #errtxl,r2 br 104$ 102$: dec odd bgt 103$ mov #pattxt,r1 mov #pattxl,r2 br 104$ 103$: mov #nopool,r1 mov #nopoll,r2 104$: qiow$s #io.wlb,#5,#5,,,, exit$s .END START