.TITLE F4PVMF - FORTRAN ENVIRONMENT SUBROUTINES .SBTTL F4PVMF - TITLE PAGE .PSECT VMX$$$,RO,I .IDENT /V01.01/ .ENABL LC ; ; ************************************************************************ ; * ; THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS ONLY. DIGITAL EQUIPMENT * ; COMPUTER USER'S SOCIETY, DIGITAL EQUIPMENT CORPORATION, MONSANTO, AND * ; THE AUTHOR DISCLAIM ALL WARRANTIES ON THE PROGRAM, INCLUDING WITHOUT * ; LIMITATION, ALL IMPLIED WARRANTIES OF MERCHANTABLITY AND FITNESS. * ; * ; FULL PERMISSION AND CONSENT IS HEREBY GIVEN TO DECUS AND TO THE DECUS * ; SPECIAL INTEREST GROUPS TO REPRODUCE, DISTRIBUTE, AND PUBLISH AND * ; PERMIT OTHERS TO REPRODUCE IN WHOLE OR IN PART, IN ANY FORM AND * ; WITHOUT RESTRICTION, THIS PROGRAM AND ANY INFORMATION RELATING TO IT. * ; * ; ************************************************************************ ; ; FORTRAN ENVIRONMENT SUBROUTINES ; ; VERSION: V01.01 ; ; AUTHOR: R.W. STAMERJOHN MAPC 02-NOV-81 ; ; MODIFICATION HISTORY: ; ; V01.01 RWS 02-NOV-81 INITIAL VERSION ; .SBTTL F4PVMF - DECLARATIONS .DSABL GBL .DSABL CRF ; ; MACRO LIBRARY CALLS: ; ; None. ; ; GLOBAL DECLARATIONS: ; .GLOBL CHK$VF ;Check calling arguments .GLOBL ERR$VF ;Process errors ; ; GLOBAL REFERENCES: ; .GLOBL STOP$ ;Fortran STOP routine ; .ENABL CRF .SBTTL CHK$VF * CHECK CALLING FORTRAN ARGUMENTS ; ;+ ; This routine checks the correct number of arguments were supplied ; by the calling program (Fortran calls). If not, an appropriate ; Fortran error is declared. ; ; INPUT: ; ; Call by: JSR PC,CHK$VF ; .BYTE Maximum arguments,Minumum arguments ; ; R5 = Fortran calling block ; ; OUTPUT: ; ; Fortran calling block checked to make sure no more than maximum ; number of arguments are specified and minumum are present (not ; null). The minumum arguments must be at the beginning. ; ; R5 = (R5)+2 (Address of first argument) ; ; REGISTERS: ; ; Uses: R0-R1 Saves: R2-R5 Stack: 0 words ;- CHK$VF:: ;Ref label MOV @(SP),R0 ;Get maximum, minmum number ADD #2,(SP) ;Update stack pointer for return ; ; Check correct number of Fortran calling arguments. ; CMPB (R5),R0 ;Does number of arguments exceed limit? BHI 9000$ ; If HI - yes, error SWAB R0 ;Get minumum number in low byte CMPB (R5),R0 ;Are the minimum arguments present? BLO 9000$ ; If LO - no, error ; ; Check required arguments are non-null. ; TST (R5)+ ;Advance to first argument MOV R5,R1 ;Copy Fortran argument block 1000$: DECB R0 ;Count argument checked BMI 1100$ ; If MI - all done CMP #-1,(R1)+ ;Is argument null? BEQ 9100$ ; If EQ - yes, error BR 1000$ ;Loop to next argument 1100$: RETURN ;Return to caller ; ; Declare Fortran errors. ; 9000$: TRAP <128.+80.> ;Declare invalid number of arguments 9100$: TRAP <128.+81.> ;Declare invalid argument .SBTTL ERR$VF * PROCESS ERROR (FORTRAN ENVIRONMENT) ; ;+ ; This process VM errors in a Fortran environment. It does a user-traceback ; and then issues a Fortran STOP with the appropriate error message. ; ; INPUT: ; ; Call by: JSR PC,ERR$VF ; ; R0 = Error message address ; ; OUTPUT: ; ; A Fortran traceback is output (98) and then a Fortran STOP is ; executed. ; ; REGISTERS: ; ; Uses: R0-R5 Saves: N.A. Stack: 1 words ;- ERR$VF:: ;Ref label TRAP <128.+98.> ;Issue traceback request MOV R0,-(SP) ;Push message address CALL STOP$ ;Call Fortran stop routine .END