.Title AlvInit Alvin Device Init/Disable All Devices .Psect AlvIni,Gbl,Con .Ident /LVL51 / .Mcall $Alvin .Globl Ldevice, AlvEnable, AlvDisable $Alvin ;;************** ;; AlvInit - ;; Alvin routine to initialize all devices currently defined in ;; the device table. ;; ;; Expects calls of the form: JSR PC,ALVINIT ;; ;- ALVINIT:: Mov R5,-(SP) ; Save registers used. Mov R4,-(SP) Mov R3,-(SP) Mov R2,-(SP) Mov R0,-(SP) MOV #LDEVICE,R4 ; Address of the device table descriptor. MOV (R4)+,R5 ; Get Dev Table base adr, point to end adr. ALGO1: MOV (R5)+,R2 ; Get a device descriptor base address. BEQ ALSKIP ; If zero the device is not defined. Mov Lunit(R2),R3 ; Get the unit number of device to be enabled. Jsr Pc,AlvEna ; Do the enable. ; (ignore any errors returned in R0) ALSKIP: Cmp R5,(R4) ; Is this the last device in the table? Blos ALGO1 ; No, branch to initialize all devices Mov (Sp)+,R0 Mov (Sp)+,R2 ; Restore registers used. Mov (Sp)+,R3 Mov (Sp)+,R4 Mov (Sp)+,R5 Rts Pc ; Return with all devices enabled. ;+ ;;********************************************************************** ;; AlvExit - ;; Alvin routine to disable all devices currently enabled in the ;; the device table. ;; ;; Expects calls of the form: JSR PC,ALVEXIT ;- ALVEXIT:: MOV R5,-(SP) ; Save registers used. MOV R4,-(SP) MOV R3,-(SP) MOV R2,-(SP) Mov R0,-(SP) MOV #LDEVICE,R4 ; Get address of device table Descriptor. Mov (R4)+,R5 ; Get device table base adr, ; point R4 to end adr. ALVEXLP: MOV (R5)+,R2 ; Get a device descriptor address. BEQ ALVEXSKIP ; Branch if slot not occupied. Mov Lunit(R2),R3 ; Get unit number of device to be disabled. Jsr Pc,AlvDisable ; Do the disable ; (ignore any errors returned in R0) ALVEXSKIP: Cmp R5,(R4) ; Is this past device table end? Blos ALVEXLP ; Loop until all devices reverted. Mov (Sp)+,R0 MOV (SP)+,R2 ; Restore registers used. MOV (SP)+,R3 MOV (SP)+,R4 MOV (SP)+,R5 RTS Pc ; Return with all devices disabled. ;;************************************************************************ .End