.TITLE LDSABL Aleda Unit Disable .PSECT Aleda,Gbl,Con .Ident /LVL51C/ .Dsabl GBL ;;********************************************************************** ;; Fortran callable subroutine to disable the specified logical unit #. ;; I/O will be prohibited on the unit after disable. All interrupt ;; linkage will be reverted to the state prior to enable. ;; ;; Supports calls of the form: ;; Ierror = LDsabl ( Unit #, Return Code) ;;********************************************************************** ;; Last Modified: 4-May-84 DVJensen ;; 17-Jul-84 - DVJ - Attempted to remove final interrupt on disable. ;; 11-Oct-85 - DJ Alvdisable for CL-controlled devices - removed to ;; separate module file. ;; ;;********************************************************************** ;; .Mcall $Alv51 .Globl GetDDA,AlvDisable,GetParm ;External Globals $Alv51 ;; Control Word Bits - If set they indicate: ;;********************************************************************** LDsabl:: MOV R5,-(SP) ;SAVE REGISTERS USED MOV R4,-(SP) MOV R3,-(SP) MOV R2,-(SP) MOV R1,-(SP) Clr Return ;Initialize Variables ;Fortran Calling Convention: Clr R0 ;Set for counting the parameters Mov (R5)+,R1 ;Get number of parameters passed. Bic #177400,R1 ;Clear possible high order junk Jsr PC,GetParm ;Get Parm # 1: Logical Unit number. Bcs DsaError ;Required Parm - Abort if not provided. Mov (R4),R3 ;Get the actual unit number Mov R3,Unit ;Save it Getp2: Jsr PC,GetParm ;Get Parm # 2: Return Code Location. Bcs Getp3 ;Continue if not available (defaulted above) Mov R4,Return ;Save the address to return the code to. Getp3: Br DsaGO ;;**************************** DsaError: ; Error occurred - Code is in R0 Neg R0 ; Force return value negative to indicate error Sec ; Set Carry. Br DsaRtn ; and Return. ;;**************************** ;; DsaGO: Jsr Pc,AlvDisable ; Preform the disable on the unit in Reg 3. ; Alvin Disable will report any errors in R0 ; Carry will be set/cleared appropriately. DsaRtn: Mov Return,R1 ; Did the user specify a return location? Beq DsaExit ; No, exit. Mov R0,(R1) ; Return error code to user location. DsaExit: MOV (SP)+,R1 MOV (SP)+,R2 MOV (SP)+,R3 MOV (SP)+,R4 MOV (SP)+,R5 RTS PC ;AND RETURN ;;**************************** Unit: .Word 0 ;Unit number to enable. Return: .Word 0 ;Address of User's Location for Return Code. Control: .Word 0 ;User specified control word. ;;**************************************************************************** .END