; Begin user defined functions ; From: Philip A. Naecker ; FN$CLEAR_BIT - Clear a bit in a longword ; ; Output is a value in R0, R1. -1 if operation successful ; Input is a source longword (to be changed by a single bit) ; and a bit position. $DTR$FUN_DEF FN$CLEAR_BIT, FOR$JIBCLR, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_HEADER HDR = <"Bit"/"Cleared"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_END_DEF ; FN$DEFINE_LOG - Define a logical name ; ; no output ; Input is a string descriptor of the logical name $DTR$FUN_DEF FN$DEFINE_LOG, LIB$SET_LOGICAL, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_END_DEF ; FN$FAO - Formatted ASCII Output ; ; Output is a character string ; Input is of any data type converted to ASCII representation ; and substituted into the output string as specified ; by directive parameters. ; $DTR$FUN_DEF FN$FAO , LIB$SYS_FAO, 11 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 3 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 4 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 5 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 6 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 7 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L, ORDER = 8 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_ADT, ORDER = 9 $DTR$FUN_END_DEF ; FN$LOG - Common Logarithm (Synonym for FN$LOG10) ; ; Output is a floating value in R0, R1 ; Input is a floating value passed by reference $DTR$FUN_DEF FN$LOG, MTH$ALOG10, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_EDIT_STRING ^\ZZ9.999\ $DTR$FUN_HEADER HDR = <"Common"/"Log"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_END_DEF ; FN$MAX - Maximum ; ; Output is a longword ; Input is two longwords ; The result is the maximum of the two $DTR$FUN_DEF FN$MAX, MTH$AMAX1, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_HEADER HDR = <"Maximum"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 2 $DTR$FUN_END_DEF ; FN$MIN - Minimum ; ; Output is a longword ; Input is two longwords ; The result is the minimum of the two $DTR$FUN_DEF FN$MIN, MTH$AMIN1, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_HEADER HDR = <"Minimum"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_F, ORDER = 2 $DTR$FUN_END_DEF ; FN$POWER - Raise a real number to a real power ; ; Output is a floating value in R0, R1 ; Input is two floating values passed by immediate value ; $DTR$FUN_DEF FN$POWER, OTS$POWRR, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F $DTR$FUN_HEADER HDR = <"Power"> $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_F, ORDER = 2 $DTR$FUN_END_DEF ; FN$SET_BIT - Set a bit in a longword ; ; Output is a value in R0, R1 ; Input is a longword source (to be changed by a single bit) ; and, a bit position $DTR$FUN_DEF FN$SET_BIT, FOR$JIBSET, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_END_DEF ; FN$SET_DEFAULT - Set Default Directory ; $DTR$FUN_DEF FN$SET_DEFAULT, SYS$SETDDIR, 3 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_IN_ARG TYPE = FUN$K_NULL $DTR$FUN_END_DEF ; FN$STR_FIRST_CHAR - ASCII value of first string character ; ; Output is a longword ; Input is a string descriptor $DTR$FUN_DEF FN$STR_FIRST_CHAR, LIB$ICHAR, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_EDIT_STRING ^\ZZ9\ $DTR$FUN_HEADER HDR = <"First"/"Character"/"Value"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$STR_LENGTH - Length of a string ; ; Output is a longword ; Input is a source string descriptor $DTR$FUN_DEF FN$STR_LENGTH, LIB$LEN, 1 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_HEADER HDR = <"String"/"Length"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_END_DEF ; FN$STR_REPLACE - String replace ; ; Output is a string ; Input is an output string descriptor, ; an input string descriptor, ; a start position, ; an end position, and ; a replace-string $DTR$FUN_DEF FN$STR_REPLACE, STR$REPLACE, 5 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Substituted"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 3 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 4 $DTR$FUN_END_DEF ; FN$STR_TRANSLATE - String translate ; ; Output is a string ; Input is an output string descriptor, ; an input string descriptor, ; a translation table descriptor, and ; a match-string descriptor. $DTR$FUN_DEF FN$STR_TRANSLATE, STR$TRANSLATE, 4 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"Translated"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 2 $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 3 $DTR$FUN_END_DEF ; FN$STR_EBCDIC_TO_ASCII - Translate EBCDIC to ASCII ; ; Output is a string ; Input is an output string descriptor, ; an input string descriptor, $DTR$FUN_DEF FN$STR_EBCDIC_TO_ASCII, LIB$TRA_EBC_ASC, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"ASCII"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$STR_ASCII_TO_EBCDIC - Translate ASCII to EBCDIC ; ; Output is a string ; Input is an output string descriptor, ; an input string descriptor, $DTR$FUN_DEF FN$STR_ASCII_TO_EBCDIC, LIB$TRA_ASC_EBC, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_HEADER HDR = <"EBCDIC"/"String"> $DTR$FUN_IN_ARG TYPE = FUN$K_DESC, DTYPE = DSC$K_DTYPE_T, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_TEXT , OUT_PUT = TRUE $DTR$FUN_END_DEF ; FN$TEST_BIT - Test a bit in a longword ; ; Output is a value in R0, R1 ; Input is a longword source (to be changed by a single bit) ; and, a bit position $DTR$FUN_DEF FN$TEST_BIT, FOR$BJTEST, 2 $DTR$FUN_OUT_ARG TYPE = FUN$K_VALUE, DTYPE = DSC$K_DTYPE_L $DTR$FUN_EDIT_STRING ^\-9\ $DTR$FUN_HEADER HDR = <"Test"/"Bit"> $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 1 $DTR$FUN_IN_ARG TYPE = FUN$K_REF, DTYPE = DSC$K_DTYPE_L, ORDER = 2 $DTR$FUN_END_DEF ; SPAWN - Create a subprocess ; ; No Output $DTR$FUN_DEF SPAWN, LIB$SPAWN, 0 $DTR$FUN_OUT_ARG TYPE = FUN$K_STATUS $DTR$FUN_NOVALUE $DTR$FUN_NOOPTIMIZE $DTR$FUN_END_DEF