TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 1 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (1) ; 0001 MODULE TESTFILE ( main=testfile, ! ; 0002 IDENT = '01' ; 0003 ) = ; 0004 BEGIN ; 0005 ; 0006 ! ; 0007 ! Free software BY ; 0008 ! Project Software & Development, Inc. ; 0009 ! ; 0010 ! This software is furnished for free and may be used and copied as ; 0011 ! desired. This software or any other copies thereof may be provided ; 0012 ! or otherwise made available to any other person. No title to and ; 0013 ! ownership of the software is hereby transferred or allowed. ; 0014 ! ; 0015 ! The information in this software is subject to change without notice ; 0016 ! and should not be construed as a commitment by PROJECT SOFTWARE ; 0017 ! AND DEVELOPMENT, INC. ; 0018 ! ; 0019 ! PROJECT SOFTWARE assumes no responsibility for the use or reliability ; 0020 ! of this software on any equipment whatsoever. ; 0021 ! ; 0022 ! Project Software & Development, Inc. ; 0023 ! 14 Story St. ; 0024 ! Cambridge, Ma. 02138 ; 0025 ! 617-661-1444 ; 0026 ! ; 0027 ; 0028 !++ ; 0029 ! FACILITY: ; 0030 ! ; 0031 ! ABSTRACT: Provides the testfile command as is in RSX11M. ; 0032 ! ; 0033 ! ; 0034 ! ENVIRONMENT: Vax/Vms 1.6 ; 0035 ! ; 0036 ! AUTHOR: M. Erik Husby , CREATION DATE: March 1980 ; 0037 ! ; 0038 ! MODIFIED BY: ; 0039 ! ; 0040 ! , : VERSION ; 0041 ! 01 - ; 0042 !-- ; 0043 ! ; 0044 ! TABLE OF CONTENTS: ; 0045 ! ; 0046 ! LITERALS: ; 0047 ! ; 0048 ! ; 0049 ! INCLUDE FILES: ; 0050 ! ; 0051 Library 'SYS$LIBRARY:STARLET'; ; 0052 Library 'SYS$LIBRARY:CLIMAC'; ; 0053 ! ; 0054 ! Macros ; 0055 ! ; 0056 Macro ; 0057 ! TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 2 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (1) ; 0058 ! define offsets into cli_service_request block ; 0059 ! ; 0060 sym_naml_off= 4,0,16,0 %, ; 0061 sym_namp_off = 8,0,32,0 %, ; 0062 sym_vall_off = 12,0,16,0 %, ; 0063 sym_valp_off = 16,0,32,0 %, ; 0064 ! ; 0065 ! Macro to form a descriptor block ; 0066 ! ; M 0067 desc[] = %charcount(%remaining), ; 0068 uplit byte(%remaining) %; ; 0069 ! ; 0070 ! OWN STORAGE: ; 0071 ! ; 0072 own ; 0073 ! ; 0074 ! output string descriptor ; 0075 ! ; 0076 out_desc : block[dsc$k_s_bln,byte], ; 0077 code_buf : vector[ch$allocation(10)], ; 0078 ! ; 0079 ! testfile filename ; 0080 ! ; 0081 tf_filename : vector[ch$allocation(nam$c_maxrsslcl)], ; 0082 tf_esa : vector[ch$allocation(nam$c_maxrsslcl)], ; 0083 tf_rsa : vector[ch$allocation(nam$c_maxrsslcl)], ; 0084 ! ; 0085 ! file control blocks ; 0086 ! ; P 0087 tf_nam: $nam(esa=tf_esa, ! file name block for the ; P 0088 ess=nam$c_maxrsslcl, ! file to be tested. ; P 0089 rsa=tf_rsa, ! resulting filename ; 0090 rss=nam$c_maxrsslcl), ; P 0091 tf_fab: $fab(fna=tf_filename, ! file attribute block for the ; P 0092 fop=, ; 0093 nam=tf_nam), ; 0094 ! ; 0095 ! get command line block ; 0096 ! ; 0097 get_cmd_line : $clireqdesc(rqtype=getcmd), ; 0098 def_sym_desc : block[cli$k_reqdesc,byte]; ; 0099 ! ; 0100 bind ; 0101 ! ; 0102 file_spec_sym =uplit(desc('FILE_SPEC')), ; 0103 file_code_sym =uplit(desc('FILE_CODE')), ; 0104 code_fmt_desc = uplit(desc('%X!XL')), ; 0105 tf_filename_ptr = tf_filename, ! pointer to initial filename ; 0106 tf_esa_ptr = tf_esa; ! pointer to expanded filename ; 0107 ! ; 0108 ! EXTERNAL REFERENCES: ; 0109 ! ; 0110 ; 0111 EXTERNAL ROUTINE ; 0112 sys$cli : addressing_mode(absolute), ! get command line routine ; 0113 lib$put_output : addressing_mode(absolute); ! output line routine ; 0114 ; ! TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 3 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (2) ; 0115 ROUTINE testfile : NOVALUE = ! ; 0116 ; 0117 !++ ; 0118 ! FUNCTIONAL DESCRIPTION: Performs a testfile command. ; 0119 ! Given a filename, it does a search to determine the complete ; 0120 ! file specification and file status. ; 0121 ! ; 0122 ! ; 0123 ! FORMAL PARAMETERS: ; 0124 ! ; 0125 ! NONE ; 0126 ! ; 0127 ! IMPLICIT INPUTS: ; 0128 ! ; 0129 ! On input, the command line contains a file specification. ; 0130 ! ; 0131 ! IMPLICIT OUTPUTS: ; 0132 ! ; 0133 ! On completion the symbol "FILE_SPEC" is set to ; 0134 ! the complete file specification. ; 0135 ! And the symbol "FILE_CODE" is set to the RMS file status code. ; 0136 ! ; 0137 ! ROUTINE VALUE: ; 0138 ! COMPLETION CODES: ; 0139 ! ; 0140 ! ; 0141 ! SIDE EFFECTS: ; 0142 ! ; 0143 ! NONE ; 0144 ! ; 0145 !-- ; 0146 ; 0147 BEGIN ; 0148 local msglen : word, ; 0149 temp; ; 0150 ! ; 0151 ! Get the command line; ; 0152 ! ; 0153 sys$cli(get_cmd_line); ; 0154 ! ; 0155 ! Move the filename to the file_specification buffer; ; 0156 ! ; 0157 ch$move(.get_cmd_line[cli$w_rqsize], ; 0158 .get_cmd_line[cli$a_rqaddr], ; 0159 tf_filename_ptr); ; 0160 ! ; 0161 ! Do a parse and then the search. ; 0162 ! ; 0163 tf_fab[fab$b_fns]=.get_cmd_line[cli$w_rqsize]; ! set size of filename ; 0164 $parse(fab=tf_fab); ; 0165 $search(fab=tf_fab); ; 0166 ! ; 0167 ! define the symbol "FILE_SPEC" as the filename ; 0168 ! depending on whether or not the file was found. ; 0169 ! ; 0170 if (.tf_fab[fab$l_sts] and sts$m_severity) eql sts$k_success then ; 0171 begin TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 4 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (2) ; 0172 def_sym_desc[sym_vall_off] = .tf_nam[nam$b_rsl]; ; 0173 def_sym_desc[sym_valp_off] = .tf_nam[nam$l_rsa]; ; 0174 end ; 0175 else ; 0176 begin ; 0177 def_sym_desc[sym_vall_off] = .tf_nam[nam$b_esl]; ; 0178 def_sym_desc[sym_valp_off] = .tf_nam[nam$l_esa]; ; 0179 end; ; 0180 def_sym_desc[cli$w_servcod] = cli$k_deflocal; ; 0181 def_sym_desc[cli$b_rqtype] = cli$k_cliserv; ; 0182 def_sym_desc[sym_naml_off] = .file_spec_sym; ; 0183 def_sym_desc[sym_namp_off] = .(file_spec_sym+4); ; 0184 sys$cli(def_sym_desc); ; 0185 ; 0186 ! ; 0187 ! Define the symbol "FILE_CODE" as the RMS file status code ; 0188 ! as a hexadecimal string (similar to $STATUS). ; 0189 ! ; 0190 out_desc[dsc$b_class] = dsc$k_class_s; ; 0191 out_desc[dsc$b_dtype] = dsc$k_dtype_t; ; 0192 out_desc[dsc$w_length] = 10; ; 0193 out_desc[dsc$a_pointer] = code_buf; ; P 0194 $faol(ctrstr =code_fmt_desc, ; P 0195 outlen=msglen, ; P 0196 outbuf=out_desc, ; 0197 prmlst=%ref(.tf_fab[fab$l_sts])); ; 0198 def_sym_desc[sym_naml_off] = .file_code_sym; ; 0199 def_sym_desc[sym_namp_off] = .(file_code_sym+4); ; 0200 def_sym_desc[sym_vall_off] = .msglen; ; 0201 def_sym_desc[sym_valp_off] = code_buf; ; 0202 sys$cli(def_sym_desc); ; 0203 ; 0204 ! ; 0205 ! exit with normal status ; 0206 ! ; 0207 $exit(code=ss$_normal); ; 0208 ; 0209 END; ! end of testfile .TITLE TESTFILE .IDENT \01\ .PSECT $PLIT$,NOWRT,NOEXE,2 P.AAB: .ASCII \FILE_SPEC\ ; 45 50 53 5F 45 4C 49 46 00000 ; 43 00008 .BLKB 3 ; 00009 P.AAA: .LONG 9 ; 00000009 0000C .ADDRESS P.AAB ; 00000000' 00010 P.AAD: .ASCII \FILE_CODE\ ; 44 4F 43 5F 45 4C 49 46 00014 ; 45 0001C .BLKB 3 ; 0001D P.AAC: .LONG 9 ; 00000009 00020 .ADDRESS P.AAD ; 00000000' 00024 P.AAF: .ASCII \%X!XL\ ; 4C 58 21 58 25 00028 .BLKB 3 ; 0002D TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 5 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (2) P.AAE: .LONG 5 ; 00000005 00030 .ADDRESS P.AAF ; 00000000' 00034 .PSECT $OWN$,NOEXE,2 OUT_DESC: .BLKB 8 ; 00000 CODE_BUF: .BLKB 12 ; 00008 TF_FILENAME: .BLKB 96 ; 00014 TF_ESA: .BLKB 96 ; 00074 TF_RSA: .BLKB 96 ; 000D4 TF_NAM: .BYTE 2 ; 02 00134 .BYTE 56 ; 38 00135 .BYTE 96 ; 60 00136 .BYTE 0 ; 00 00137 .ADDRESS TF_RSA ; 00000000' 00138 .WORD 0 ; 0000 0013C .BYTE 96 ; 60 0013E .BYTE 0 ; 00 0013F .ADDRESS TF_ESA ; 00000000' 00140 .LONG 0 ; 00000000 00144 .WORD 0[8] ; 0000# 00148 .WORD 0[3] ; 0000# 00158 .WORD 0[3] ; 0000# 0015E .LONG 0 ; 00000000 00164 .LONG 0 ; 00000000 00168 TF_FAB: .BYTE 3 ; 03 0016C .BYTE 80 ; 50 0016D .WORD 0 ; 0000 0016E .LONG 16777216 ; 01000000 00170 .LONG 0 ; 00000000 00174 .LONG 0 ; 00000000 00178 .LONG 0 ; 00000000 0017C .WORD 0 ; 0000 00180 .BYTE 2 ; 02 00182 .BYTE 0 ; 00 00183 .LONG 0 ; 00000000 00184 .BYTE 0 ; 00 00188 .BYTE 0 ; 00 00189 .BYTE 0 ; 00 0018A .BYTE 2 ; 02 0018B .LONG 0 ; 00000000 0018C .LONG 0 ; 00000000 00190 .ADDRESS TF_NAM ; 00000000' 00194 .ADDRESS TF_FILENAME ; 00000000' 00198 .LONG 0 ; 00000000 0019C .BYTE 0 ; 00 001A0 .BYTE 0 ; 00 001A1 .WORD 0 ; 0000 001A2 .LONG 0 ; 00000000 001A4 .WORD 0 ; 0000 001A8 .BYTE 0 ; 00 001AA .BYTE 0 ; 00 001AB .LONG 0 ; 00000000 001AC .LONG 0 ; 00000000 001B0 TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 6 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (2) .LONG 0[2] ; 00000000# 001B4 GET_CMD_LINE: .BYTE 1 ; 01 001BC .BYTE 0 ; 00 001BD .BYTE 0 ; 00 001BE .BYTE 0 ; 00 001BF .LONG 0 ; 00000000 001C0 .LONG 0, 0 ; 00000000 00000000 001C4 .LONG 0 ; 00000000 001CC .LONG 0 ; 00000000 001D0 .LONG 0 ; 00000000 001D4 DEF_SYM_DESC: .BLKB 28 ; 001D8 FILE_SPEC_SYM= P.AAA FILE_CODE_SYM= P.AAC CODE_FMT_DESC= P.AAE TF_FILENAME_PTR= TF_FILENAME TF_ESA_PTR= TF_ESA .EXTRN SYS$CLI, LIB$PUT_OUTPUT, SYS$PARSE, SYS$SEARCH, SYS$FAOL, SYS$EXIT .PSECT $CODE$,NOWRT,2 TESTFILE: .WORD ^M ;Save R2,R3,R4,R5,R6,R7,R8 0115 01FC 00000 MOVAB W^FILE_SPEC_SYM, R8 ;FILE_SPEC_SYM, R8 58 0000' CF 9E 00002 MOVAB @#SYS$CLI, R7 ;@#SYS$CLI, R7 57 00000000G 9F 9E 00007 MOVAB W^DEF_SYM_DESC+12, R6 ;DEF_SYM_DESC+12, R6 56 0000' CF 9E 0000E SUBL2 #8, SP ;#8, SP 5E 08 C2 00013 PUSHAB -40(R6) ;GET_CMD_LINE 0153 D8 A6 9F 00016 CALLS #1, (R7) ;#1, SYS$CLI 67 01 FB 00019 MOVC3 -32(R6), @-28(R6), -464(R6) ;GET_CMD_LINE+8, @GET_CMD_LINE+12, - 0157 E4 B6 E0 A6 28 0001C ;TF_FILENAME_PTR FE30 C6 00021 MOVB -32(R6), -68(R6) ;GET_CMD_LINE+8, TF_FAB+52 0163 BC A6 E0 A6 90 00024 PUSHAB -120(R6) ;TF_FAB 0164 88 A6 9F 00029 CALLS #1, @#SYS$PARSE ;#1, @#SYS$PARSE 00000000G 9F 01 FB 0002C PUSHAB -120(R6) ;TF_FAB 0165 88 A6 9F 00033 CALLS #1, @#SYS$SEARCH ;#1, @#SYS$SEARCH 00000000G 9F 01 FB 00036 CMPZV #0, #3, -112(R6), #1 ;#0, #3, TF_FAB+8, #1 0170 03 00 ED 0003D ; 01 90 A6 00040 BNEQ 1$ ;1$ 0D 12 00043 MOVZBW -173(R6), (R6) ;TF_NAM+3, DEF_SYM_DESC+12 0172 66 FF53 C6 9B 00045 MOVL -172(R6), 4(R6) ;TF_NAM+4, DEF_SYM_DESC+16 0173 04 A6 FF54 C6 D0 0004A BRB 2$ ;2$ 0170 0B 11 00050 1$: MOVZBW -165(R6), (R6) ;TF_NAM+11, DEF_SYM_DESC+12 0177 66 FF5B C6 9B 00052 MOVL -164(R6), 4(R6) ;TF_NAM+12, DEF_SYM_DESC+16 0178 04 A6 FF5C C6 D0 00057 2$: MOVW #2, -11(R6) ;#2, DEF_SYM_DESC+1 0180 F5 A6 02 B0 0005D MOVB #5, -12(R6) ;#5, DEF_SYM_DESC 0181 F4 A6 05 90 00061 MOVW (R8), -8(R6) ;FILE_SPEC_SYM, DEF_SYM_DESC+4 0182 F8 A6 68 B0 00065 MOVL 4(R8), -4(R6) ;FILE_SPEC_SYM+4, DEF_SYM_DESC+8 0183 FC A6 04 A8 D0 00069 PUSHAB -12(R6) ;DEF_SYM_DESC 0184 F4 A6 9F 0006E CALLS #1, (R7) ;#1, SYS$CLI 67 01 FB 00071 MOVL #17694730, -484(R6) ;#17694730, OUT_DESC 0192 FE1C C6 010E000A 8F D0 00074 MOVAB -476(R6), -480(R6) ;CODE_BUF, OUT_DESC+4 0193 FE20 C6 FE24 C6 9E 0007D MOVL -112(R6), (SP) ;TF_FAB+8, (SP) 0197 6E 90 A6 D0 00084 PUSHL SP ;SP 5E DD 00088 PUSHAB -484(R6) ;OUT_DESC FE1C C6 9F 0008A TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 7 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (2) PUSHAB 12(SP) ;MSGLEN 0C AE 9F 0008E PUSHAB 36(R8) ;CODE_FMT_DESC 24 A8 9F 00091 CALLS #4, @#SYS$FAOL ;#4, @#SYS$FAOL 00000000G 9F 04 FB 00094 MOVW 20(R8), -8(R6) ;FILE_CODE_SYM, DEF_SYM_DESC+4 0198 F8 A6 14 A8 B0 0009B MOVL 24(R8), -4(R6) ;FILE_CODE_SYM+4, DEF_SYM_DESC+8 0199 FC A6 18 A8 D0 000A0 MOVW 4(SP), (R6) ;MSGLEN, DEF_SYM_DESC+12 0200 66 04 AE B0 000A5 MOVAB -476(R6), 4(R6) ;CODE_BUF, DEF_SYM_DESC+16 0201 04 A6 FE24 C6 9E 000A9 PUSHAB -12(R6) ;DEF_SYM_DESC 0202 F4 A6 9F 000AF CALLS #1, (R7) ;#1, SYS$CLI 67 01 FB 000B2 PUSHL #1 ;#1 0207 01 DD 000B5 CALLS #1, @#SYS$EXIT ;#1, @#SYS$EXIT 00000000G 9F 01 FB 000B7 RET ; 0115 04 000BE ; Routine Size: 191 bytes, Routine Base: $CODE$ + 0000 TESTFILE 2-Dec-1981 10:59:00 VAX-11 Bliss-32 V2.1-667 Page 8 01 2-Dec-1981 09:41:56 _DRB2:[SYSMGR.NLSYMB]TESTFILE.BLI;75 (3) ; 0210 END !End of module ; 0211 ELUDOM ; PSECT SUMMARY ; ; Name Bytes Attributes ; ; $OWN$ 500 NOVEC, WRT, RD ,NOEXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; $PLIT$ 56 NOVEC,NOWRT, RD ,NOEXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; $CODE$ 191 NOVEC,NOWRT, RD , EXE,NOSHR, LCL, REL, CON,NOPIC,ALIGN(2) ; LIBRARY STATISTICS ; ; -------- Symbols -------- Blocks ; File Total Loaded Percent Read ; ; _DRB2:[SYSLIB]STARLET.L32;3 3907 48 1 179 ; _DRB2:[SYSLIB]CLIMAC.L32;2 14 2 14 5 ; COMMAND QUALIFIERS ; BLISS /MACHINE=ASS/LIST TESTFILE ; Size: 191 code + 556 data bytes ; Run Time: 00:08.2 ; Elapsed Time: 12:03.9 ; Memory Used: 211 pages ; Compilation Complete .END TESTFILE