.TITLE KWV11A .MCALL EXIT$S VEC=104 ODD: .WORD 0 ;Odd address indicator 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 101$ ;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 #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 BNE 100$ ;no match found,just exit MOV #4737,-2(R0) ;code for call @#VEC MOV #VEC,(R0) ; ..... MOV #VEC,R0 ;Get start of patch area 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 100$: MOV (SP)+,R2 ;Restore reg. MOV (SP)+,R1 ; MOV (SP)+,R0 ; MTPS #PR0 ;Enable interupts 101$: RETURN ;Return to user state 10$: MOV #123,@#170420 ;Enable KWV11A EXIT$S ;Exit .END START