VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Table of contents 8- 132 ADDBEL - Add a bell to a buffer. 9- 155 ADJSEC - Adjust the section size. 10- 192 CHCTRC - Check for CTRL/C being typed. 11- 228 CTTYPE - Check the terminal type. 12- 288 CTYPAH - Clear the typeahead buffer. 13- 304 GTYPAH - Get the typeahead buffer count. 14- 326 DISESC - Disable escape sequences. 15- 347 DOOPEN - Do the initial file open. 16- 420 DOPARS - Parse the command line. 18- 512 DOWAIT - Wait before continuing. 19- 616 STIMER - Start the timer. 19- 637 CTIMER - Cancel the timer. 20- 655 DOWORK - Display the working message. VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 2 1 .TITLE VTLSUB - VTL Subroutines. 2 .IDENT /1.9/ 3 .ENABL LC 4 ;+ 5 ; 6 ; Free software BY 7 ; Project Software & Development, Inc. 8 ; 9 ; This software is furnished for free and may be used and copied as 10 ; desired. This software or any other copies thereof may be provided or 11 ; otherwise made available to any other person. No title to and 12 ; ownership of the software is hereby transferred or allowed. 13 ; 14 ; The information in this software is subject to change without notice 15 ; and should not be construed as a commitment by PROJECT SOFTWARE 16 ; AND DEVELOPMENT, INC. 17 ; 18 ; PROJECT SOFTWARE assumes no responsibility for the use or reliability 19 ; of this software on any equipment whatsoever. 20 ; 21 ; Project Software & Development, Inc. 22 ; 14 Story St. 23 ; Cambridge, Ma. 02138 24 ; 617-661-1444 25 ; 26 ; 27 ; Title: VTLSUB.MAC 28 ; Author: Robin Miller 29 ; Date: July 20, 1983 30 ; 31 ; Description: 32 ; 33 ; This module contains various subroutines for the VTL program. 34 ; 35 ;- 36 .ENABL AMA 37 .NLIST BEX 38 39 .MCALL ASTX$S, CMKT$S, DIR$, MRKT$S, QIOW$, TTSYM$ 40 .MCALL CSI$, FCSBT$, NBOFF$ 41 42 ; STRICT = 0 ; Define for strict parsing syntax. VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 3 44 ;+ 45 ; 46 ; Modification History: 47 ; 48 ; December 4, 1985 by Robin Miller. Edit (09), Version 1.9 49 ; Add check for terminal characteristic TC.AVO (Advanced Video). 50 ; If this is enabled, we set the AVO flag appropriatly. 51 ; 52 ; February 21, 1985 by Robin Miller. Edit (08), Version 1.8 53 ; Check for CTRL/C being typed when searching or the first file 54 ; to prevent error messages from aborted functions. 55 ; 56 ; February 13, 1985 by Robin Miller. Edit (07), Version 1.7 57 ; Don't enable escape sequences for our terminal. Instead, we 58 ; will clear this attribute to ensure the escape sequences are 59 ; passed to us. The read with escape sequences don't work with 60 ; an IO.RTT function on an RSX-11M/M+ system and they don't work 61 ; through DECNET to a VAX/VMS system. 62 ; 63 ; February 13, 1985 by Robin Miller. Edit (06), Version 1.6 64 ; Use MOVB when picking up the typeahead buffer count. The 65 ; MOV word instruction was causing an odd address trap. 66 ; 67 ; October 29, 1984 by Robin Miller. Edit (05), Version 1.5 68 ; Fix problem with edit (01). When terminal type is other than 69 ; VT100, set AVO option in SWMASK word instead of STATUS word. 70 ; 71 ; June 7, 1984 by Robin Miller. Edit (03), Version 1.4 72 ; Call routine VMSPRS to parse multiple file specifications when 73 ; running on VMS to allow "file,file1,...,filen" syntax. 74 ; 75 ; June 7, 1984 by Robin Miller. Edit (02), Version 1.3 76 ; On VMS, if there are no VMS wildcard characters in the filespec, 77 ; use the normal RSX open routines because they are faster. 78 ; ( Removed this edit ... didn't seem that much faster. ) 79 ; 80 ; June 6, 1984 by Robin Miller. Version 1.2 81 ; Add routines STIMER, DOWORK, and CTIMER to display working message 82 ; for routines which take awhile to complete. 83 ; 84 ; May 23, 1984 by Robin Miller. Edit (01), Version 1.1 85 ; Presume terminal has AVO option if other than VT100 terminal. 86 ; 87 ;- VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 4 89 90 ; Bit and offset definitions: 91 92 000000 CSI$ ; Define the CSI offsets. 93 000000 FCSBT$ DEF$L ; Define the FCS bits locally. 94 000000 NBOFF$ DEF$L ; Define the FNB offsets locally. 95 000000 TTSYM$ ; Define the terminal symbols. 96 97 001470 NB.SFL = NB.SD1!NB.SD2!NB.SNM!NB.STP!NB.SVR ; All wildcard bits. 98 99 ; Local equates: 100 101 000002 DLYTIM = 2 ; The number of seconds to delay 102 000002 SECNDS = 2 ; Time unit for seconds. 103 104 ; Local messages: 105 106 000000 120 162 145 WAITM: .ASCIZ "Press any key to continue: " 107 000034 101 142 157 CTRCM: .ASCIZ "Aborted by CTRL/C" 108 .EVEN 109 110 ; QIOW's to get and set the terminal characteristics. 111 112 000056 GETCHA: QIOW$ SF.GMC,TOLUN,TOEFN,,TIOSB,, ; Get term. char. 113 000106 SETCHA: QIOW$ SF.SMC,TOLUN,TOEFN,,TIOSB,, ; Set term. char. 114 115 000136 CLRTAH: QIOW$ SF.SMC,TOLUN,TOEFN,,TIOSB,, ; Clear typeahead. 116 000166 GETTAH: QIOW$ SF.GMC,TOLUN,TOEFN,,TIOSB,, ; Get typehead. 117 118 ; Local storage: 119 120 000216 010 TTYBUF: .BYTE TC.TTP ; Get the terminal type. 121 000217 015 TTYPE:: .BYTE T.V100 ; Default to a VT100. 122 000220 123 .BYTE TC.AVO ; Get Advanced Video status. (09) 123 000221 000 TTYAVO: .BYTE 0 ; And store the value here. (09) 124 000004 TTYSIZ = .-TTYBUF ; Size of status table. 125 126 000222 035 000 SETBUF: .BYTE TC.ESQ,0 ; Enable escape sequences. (07) 127 000002 SETSIZ = .-SETBUF 128 129 000224 071 001 TAHBUF::.BYTE TC.TBF,1 ; Clear/get typeahead buffer count. 130 000002 TAHSIZ = .-TAHBUF VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 5 ADDBEL - Add a bell to a buffer. 132 .SBTTL ADDBEL - Add a bell to a buffer. 133 ;+ 134 ; 135 ; ADDBEL - Add a bell to a buffer. 136 ; 137 ; This routine is called to a BELL character to a buffer. The bell is 138 ; not added to the buffer if suppressing of the bell has been requested. 139 ; 140 ; Inputs: 141 ; R0 = The buffer address. 142 ; 143 ; Outputs: 144 ; R0 = The updated buffer address. 145 ; 146 ; All other registers are preserved. 147 ; 148 ;- 149 000226 032737 000004 000000G ADDBEL::BIT #B.BELL,SWMASK ; Is ringing of bell suppressed ? 150 000234 001403 BEQ 10$ ; If EQ, yes. 151 000236 112720 000007 MOVB #BELL,(R0)+ ; Nope, append the bell. 152 000242 105010 CLRB (R0) ; And terminate with a null. 153 000244 000207 10$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 6 ADJSEC - Adjust the section size. 155 .SBTTL ADJSEC - Adjust the section size. 156 ;+ 157 ; 158 ; ADJSEC - Adjust the section size. 159 ; 160 ; This routine is used to adjust the section size after the number of 161 ; lines to be displayed has been changed. The formula used to calculate 162 ; the section size is: 163 ; 164 ; (max_lines - ((max_lines) / 5) + 1)) = section_size. 165 ; i.e.: 166 ; (20 - ((20 / 5) + 1)) = 15 167 ; (10 - ((10 / 5) + 1)) = 7 168 ; (05 - ((05 / 5) + 1)) = 3 169 ; 170 ; Implicit inputs: 171 ; O.USIZ = The user specified section size (overrides adjustment). 172 ; 173 ; Outputs: 174 ; All registers are preserved. 175 ; 176 ;- 177 000246 004737 000000G ADJSEC::CALL $SAVAL ; Save all registers. 178 000252 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 179 000256 016502 000000G MOV O.USIZ(R5),R2 ; User specified section size ? 180 000262 001010 BNE 10$ ; If NE, yes (use it). 181 000264 004737 000000G CALL CALMAX ; Calculate the maximum lines. 182 000270 010102 MOV R1,R2 ; Save the maximum lines. 183 000272 005000 CLR R0 ; Prepare for the divide. 184 000274 071027 000005 DIV #5,R0 ; Do the 32 bit division: 185 ; R0 = the quotient. 186 ; R1 = the remainder. 187 000300 005200 INC R0 ; Adjust the size by one. 188 000302 160002 SUB R0,R2 ; Calculate the section size. 189 000304 010265 000000G 10$: MOV R2,O.SSIZ(R5) ; Save the new section size. 190 000310 000207 RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 7 CHCTRC - Check for CTRL/C being typed. 192 .SBTTL CHCTRC - Check for CTRL/C being typed. 193 ;+ 194 ; 195 ; CHCTRC - Check for CTRL/C being typed. 196 ; 197 ; This routine is used to check for CTRL/C being typed to abort a function. 198 ; If CTRL/C has been typed, the current cursor position is saved and then 199 ; restored after displaying the abort message. This is done since the 200 ; CTRL/C detection has been deferred until after returning from the table 201 ; parser. At that time, the cursor should be positioned in preparation for 202 ; the next line to be displayed. 203 ; 204 ; Implicit inputs: 205 ; STATUS = CTRL/C typed flag (B.CTRC = bit 15). 206 ; 207 ; Outputs: 208 ; C bit clear/set = CTRL/C not typed / CTRL/C typed. 209 ; 210 ; All registers are preserved. 211 ; 212 ;- 213 000312 004237 000000G CHCTRC::JSR R2,$SAVVR ; Save R0 - R2. 214 000316 005737 000000G TST STATUS ; Was CTRL/C typed to abort ? 215 000322 100022 BPL 100$ ; If PL, no (C bit cleared). 216 000324 012700 000000G MOV #FMTBUF,R0 ; Set address of output buffer. 217 000330 004737 000000G CALL SAVEC ; Save the current cursor position. 218 000334 004737 000000G CALL SETMSG ; Setup to write to message line. 219 000340 012701 000034' MOV #CTRCM,R1 ; Set address of CTRL/C message. 220 000344 004737 000000G CALL MOVEC ; Append it to the output buffer. 221 000350 004737 000000G CALL RESTC ; Restore the cursor position. 222 000354 004737 000000G CALL TYPMSG ; Now display the message. 223 000360 042737 100000 000000G BIC #B.CTRC,STATUS ; Reset the CTRL/C typed flag. 224 000366 000261 SEC ; Show CTRL/C was typed. 225 226 000370 000207 100$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 8 CTTYPE - Check the terminal type. 228 .SBTTL CTTYPE - Check the terminal type. 229 ;+ 230 ; 231 ; CTTYPE - Check the terminal type. 232 ; 233 ; This routine is used to ensure the terminal being used is a VT100 234 ; family terminal. If it is not, an appropriate error message is 235 ; displayed and we exit from the program. 236 ; 237 ; Inputs: 238 ; None. 239 ; 240 ; Outputs: 241 ; C bit clear/set = success/failure. 242 ; 243 ; All registers are preserved. 244 ; 245 ;- 246 .ENABL LSB 247 248 000372 004737 000000G CTTYPE::CALL $SAVAL ; Save all registers. 249 000376 DIR$ #GETCHA ; Get the terminal type. 250 000404 004737 000000G CALL CHKERR ; Check for any errors. 251 000410 103443 BCS 30$ ; If CS, we've had an error. 252 253 ; Ensure the terminal is of the VT100 family. 254 ; Test for vt100 etc outcommented for vt2xx/vt3xx use 255 ; KSnoer 13-apr-89 256 000412 000410 br 10$ ;; Inserted branch to 10$ - 257 ;; as we dont care of tt-type 258 ;; CMPB TTYPE,#T.V100 ; Are we running on a VT100 ? 259 ;; BEQ 10$ ; If EQ, yes (continue ...). 260 261 ; Range of VT100 terminals is T.V101 (24) through T.V132 (31). 262 263 000414 123727 000217' 000024 CMPB TTYPE,#T.V101 ; Is this possible VT100 family ? 264 000422 103427 BLO 20$ ; If LO, no 265 000424 123727 000217' 000031 CMPB TTYPE,#T.V132 ; Really a VT100 family terminal ? 266 000432 101023 BHI 20$ ; If HI, no 267 ;(09) BIS #B.AVO,SWMASK ; Presume we have AVO option. (05) 268 269 ; Check for the Advanced Video Option being enabled. 270 271 000434 105737 000221' 10$: TSTB TTYAVO ; Have Advanced Video Option. (09) 272 000440 001403 BEQ 15$ ; If EQ, no. (09) 273 000442 052737 000040 000000G BIS #B.AVO,SWMASK ; Yes, set the AVO status bit. (09) 274 275 000450 004737 000000G 15$: CALL ANSI ; Put the VT100 in ANSI mode. 276 000454 004737 000000G CALL SETNAR ; Set the screen to narrow mode. 277 000460 042737 100000 000000G BIC #B.STUP,SWMASK ; Show no longer in startup code. 278 000466 DIR$ #SETCHA ; Disable escape sequences. (07) 279 000474 004737 000000G CALL CHKERR ; Check for any errors. 280 000500 000407 BR 30$ ; And return with C bit clear/set. 281 282 000502 20$: ERRMSG NVT100,<%VTL-F-NVT100, not a VT100 family terminal.> 283 000516 000261 SEC ; Show the terminal check failed. 284 000520 000207 30$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 8-1 CTTYPE - Check the terminal type. 285 286 .DSABL LSB VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 9 CTYPAH - Clear the typeahead buffer. 288 .SBTTL CTYPAH - Clear the typeahead buffer. 289 ;+ 290 ; 291 ; CTYPAH - Clear the typeahead buffer. 292 ; 293 ; Inputs: 294 ; None. 295 ; 296 ; Outputs: 297 ; All registers are preserved. 298 ; 299 ;- 300 000522 CTYPAH::DIR$ #CLRTAH ; Clear the typehead buffer. 301 000530 004737 000000G CALL CHKERR ; Check/report any errors. 302 000534 000207 RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 10 GTYPAH - Get the typeahead buffer count. 304 .SBTTL GTYPAH - Get the typeahead buffer count. 305 ;+ 306 ; 307 ; GTYPAH - Get the typeahead buffer count. 308 ; 309 ; Inputs: 310 ; None. 311 ; 312 ; Outputs: 313 ; C bit clear/set = typeahead count / no count. 314 ; 315 ; R1 = The typeahead buffer count. 316 ; 317 ;- 318 000536 GTYPAH::DIR$ #GETTAH ; Get the typeahead buffer count. 319 000544 004737 000000G CALL CHKERR ; Check/report any errors. 320 000550 103404 BCS 10$ ; If CS, we had an error. 321 000552 113701 000225' MOVB TAHBUF+1,R1 ; Else, copy typeahead count. (06) 322 000556 001001 BNE 10$ ; If NE, there was a count. (06) 323 000560 000261 SEC ; Show there was nothing. (06) 324 000562 000207 10$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 11 DISESC - Disable escape sequences. 326 .SBTTL DISESC - Disable escape sequences. 327 ;+ 328 ; 329 ; DISESC - Disable escape sequences. 330 ; 331 ; This routine is called when we exit to disable the escape sequences. 332 ; If this is not done, programs such as EDT will not work with the keypad. 333 ; 334 ; Inputs: 335 ; None. 336 ; 337 ; Outputs: 338 ; All registers are preserved. 339 ; 340 ;- 341 000564 DISESC:: 342 ;*** CLRB SETBUF+1 ; Clear to disable escape seq. (07) 343 ;*** DIR$ #SETCHA ; Now do it. (07) 344 ;*** CALL CHKERR ; Check/report any errors. (07) 345 000564 000207 RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 12 DOOPEN - Do the initial file open. 347 .SBTTL DOOPEN - Do the initial file open. 348 ;+ 349 ; 350 ; DOOPEN - Do the initial file open. 351 ; 352 ; This routine is called to do the command line parsing and opening of 353 ; the first input file. 354 ; 355 ; Inputs: 356 ; R0 = The input buffer address. 357 ; R1 = The buffer byte count. 358 ; 359 ; Outputs: 360 ; C bit clear/set = success/failure. 361 ; 362 ; All registers are preserved. 363 ; 364 ;- 365 000566 004737 000000G DOOPEN::CALL $SAVAL ; Save all registers. 366 000572 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 367 000576 016537 000000G 000000G MOV O.FPTR(R5),INPTR ; Copy address of the input buffer. 368 000604 042737 167563 000000G BIC #^C,STATUS ; Initialize status bits. 369 370 ; Parse the command line using the table parser. 371 372 000612 012705 000000G MOV #START,R5 ; Set the starting state address. 373 000616 004737 000706' CALL DOPARS ; Now parse the command line. 374 000622 103427 BCS 90$ ; If CS, we had an error parsing. 375 376 ; The command line has been successfully parsed. 377 378 000624 032737 000001 000000G BIT #B.CMNT,STATUS ; Did we encounter a comment line ? 379 000632 001023 BNE 90$ ; If NE, yes (return failure). 380 000634 032737 000002 000000G BIT #B.IFIL,STATUS ; Was an input file specified ? 381 000642 001417 BEQ 90$ ; If EQ, no (return failure). 382 383 ; Open the first input file. 384 385 000644 013705 000000G 10$: MOV IENTRY,R5 ; Set active file entry address. 386 000650 016500 000000G MOV O.FDB(R5),R0 ; Copy the FDB address. 387 000654 016501 000000G MOV O.FPTR(R5),R1 ; Copy address of the input buffer. 388 389 .IFNDF RSX11M 390 391 TST VAXFLG ; Are we running on VAX/VMS ? 392 BEQ 20$ ; If EQ, no (use normal open). 393 ;*** BIS #S.RSX,(R5) ; Presume no VMS wildcards. (02) 394 ;*** CALL VMSWLD ; Wildcards in the file spec ? (02) 395 ;*** BCS 20$ ; If CS, no (use RSX parsing). (02) 396 ;*** BIC #S.RSX,(R5) ; Show using VMS wildcards. (02) 397 CALL VMSPRS ; Parse multiple file names. (03) 398 CLR O.CONT(R5) ; Clear the context longword 399 CLR O.CONT+2(R5) ; for VMS wildcard lookup. 400 CALL DOVMS ; Do the VMS wildcard lookup. 401 BCC 15$ ; If CC, open expanded file name. 402 BIT #B.NATV,SWMASK ; Was the native mode routine found ? 403 BEQ 20$ ; If EQ, no (use the normal open). VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 12-1 DOOPEN - Do the initial file open. 404 BR 30$ ; Yes, report the error message. 405 15$: MOV O.FNAM(R5),R1 ; Set address of expanded file name. 406 407 .ENDC ;IFNDF RSX11M 408 409 000660 004737 000000G 20$: CALL OPENR ; Try to open the input file. 410 000664 103007 BCC 100$ ; If CC, success. 411 000666 005737 000000G 30$: TST STATUS ; Was CTRL/C typed to abort ? (08) 412 000672 100403 BMI 90$ ; If MI, yes (inhibit error). (08) 413 000674 004737 000000G CALL OPERR ; Report error/get the next file. 414 000700 103001 BCC 100$ ; If CC, success. 415 416 000702 000261 90$: SEC ; Show failure to open file. 417 418 000704 000207 100$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 13 DOPARS - Parse the command line. 420 .SBTTL DOPARS - Parse the command line. 421 ;+ 422 ; 423 ; DOPARS - Parse the command line. 424 ; 425 ; Use .TPARS to parse the command line. 426 ; 427 ; Inputs to DOPARS: 428 ; R0 = The buffer address. 429 ; R1 = The buffer byte count. 430 ; R5 = The starting state address. 431 ; 432 ; Inputs to .TPARS: 433 ; R1 = Bit 0 in the low byte controls processing of blanks/tabs: 434 ; if 0, ignore blanks, if 1 then pass blanks and tabs. 435 ; The high byte contains the number of characters that 436 ; keywords are alloewed to be abbreviated (0 = exact). 437 ; R2 = The keyword table address. 438 ; R3 = The input string byte count. 439 ; R4 = The input buffer address. 440 ; R5 = The starting state address. 441 ; 442 ; Outputs from .TPARS: 443 ; C bit clear/set = success/failure. 444 ; 445 ; R3 = Zero on success or 446 ; remaining byte count on syntax error. 447 ; R4 = End of input string or 448 ; updated buffer address on syntax error. 449 ; 450 ; All other registers from .TPARS are preserved. 451 ; 452 ;- 453 000706 004737 000000G DOPARS::CALL $SAVAL ; Save all registers. 454 000712 010004 MOV R0,R4 ; Copy the buffer address. 455 000714 010103 MOV R1,R3 ; Copy the buffer byte count. 456 000716 012701 000400 MOV #<<400*1>+0>,R1 ; Ignore blanks, match 1 character. 457 000722 012702 000000G MOV #KEYWRD,R2 ; Address of the keyword table. 458 000726 004737 000000G CALL .TPARS ; Now parse the command line. 459 460 .IF NDF STRICT 461 462 000732 103002 BCC 100$ ; If CC, success. 463 464 .IFF 465 466 BCS 10$ ; If CS, we had an error. 467 BIT #B.CMNT,STATUS ; Was a comment line encountered ? 468 BNE 100$ ; If NE, yes (don't report error). 469 470 ; Don't flag error if spaces and/or tabs at end of command line. 471 472 CALL SKIP ; Skip any tabs and/or spaces. 473 TST R3 ; Any unprocessed characters ? 474 BEQ 100$ ; If EQ, no (this is success). 475 476 .ENDC ;STRICT VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 13-1 DOPARS - Parse the command line. 477 478 000734 004737 000000G 10$: CALL WRTSYN ; Write the syntax error. 479 480 000740 000207 100$: RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 14 DOPARS - Parse the command line. 482 .IF DF STRICT 483 484 .SBTTL SKIP - Skip tabs and/or spaces. 485 ;+ 486 ; 487 ; SKIP - Skip tabs and/or spaces. 488 ; 489 ; Inputs: 490 ; R3 = The byte count. 491 ; R4 = The buffer address. 492 ; 493 ; Outputs: 494 ; R3 & R4 are adjusted past any tabs and/or spaces. 495 ; 496 ; All other registers are preserved. 497 ; 498 ;- 499 SKIP: TST R3 ; Any byte count left ? 500 BEQ 100$ ; If EQ, no. 501 CMPB (R4),#SPACE ; Is this a space ? 502 BEQ 10$ ; If EQ, yes. 503 CMPB (R4),#HT ; Is this a horizontal tab ? 504 BNE 100$ ; If NE, no. 505 10$: INC R4 ; Adjust the buffer address. 506 SOB R3,SKIP ; And loop on the byte count. 507 508 100$: RETURN 509 510 .ENDC ;STRICT VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 15 DOWAIT - Wait before continuing. 512 .SBTTL DOWAIT - Wait before continuing. 513 ;+ 514 ; 515 ; DOWAIT - Wait before continuing. 516 ; PRSPEC - Do special prompting of the user. 517 ; PRUSER - Entry point to always prompt the user. 518 ; PRWAIT - Entry point to always prompt or delay. 519 ; 520 ; These routines are called when we want to wait for the user to respond 521 ; before continuing. If the user has disabled the wait (prompt) feature, 522 ; we delay several seconds to give them time to read the error message. 523 ; 524 ; Actually, we don't wait unless input is from a command file, wildcards are 525 ; active, or multiple files was specified. 526 ; 527 ; Inputs: 528 ; None. 529 ; 530 ; Outputs: 531 ; All registers are preserved. 532 ; 533 ; Implicit outputs: 534 ; TMPBUF = The character typed to continue. 535 ; B.EXIT is set in STATUS if the response is "E". 536 ; B.NEXT is set in STATUS if the response is "N". 537 ; 538 ;- 539 .ENABL LSB 540 541 000742 004737 000000G DOWAIT::CALL $SAVAL ; Save all registers. 542 000746 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 543 000752 016504 000000G MOV O.FNB(R5),R4 ; Copy the FNB address. 544 000756 032737 010000 000000G BIT #B.2FIL,STATUS ; Are we displaying two files ? 545 000764 001035 BNE 10$ ; If NE, yes (prompt the user). 546 547 .IFNDF RSX11M ; VAX/VMS specific code. 548 549 CALL VMSWLD ; Check for VAX/VMS wildcards. 550 BCC 10$ ; If CC, there is a wildcard. 551 552 .ENDC ;.IFNDF RSX11M 553 554 000766 012700 000000G MOV #GCLBLK,R0 ; Set address of the control block. 555 000772 132760 000004 000000G BITB #FD.TTY,F.RCTL(R0) ; Is input from the terminal ? 556 001000 001427 BEQ 10$ ; If EQ, no (presume command file). 557 001002 032764 001470 000020 BIT #NB.SFL,N.STAT(R4) ; Are there any wildcards active ? 558 001010 001023 BNE 10$ ; If NE, yes. 559 001012 016504 000000G MOV O.CSI(R5),R4 ; Copy the CSI bock address. 560 001016 132764 000020 000001 BITB #CS.MOR,C.STAT(R4) ; Were multiple files specified ? 561 001024 001015 BNE 10$ ; If NE, yes. 562 001026 000207 RETURN ; No, don't bother waiting. 563 ; 564 ; This routine is used when set temporarily to narrow screen when 565 ; listing files in wide mode with no advanced video option. 566 ; 567 001030 013746 000000G PRSPEC::MOV STATUS,-(SP) ; Save the current status word. 568 001034 042737 000010 000000G BIC #B.132,STATUS ; Disable wide screen mode. VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 15-1 DOWAIT - Wait before continuing. 569 001042 004737 001106' CALL PRUSER ; Prompt the user for response. 570 001046 052637 000000G BIS (SP)+,STATUS ; Restore previous status word. 571 001052 000207 RETURN 572 573 ; Wait several seconds before we continue. 574 575 001054 004737 000000G PRWAIT::CALL $SAVAL ; Save all registers. 576 577 001060 032737 000200 000000G 10$: BIT #B.WAIT,SWMASK ; Should we prompt or delay ? 578 001066 001011 BNE 20$ ; If NE, we should prompt. 579 001070 012700 000002 MOV #DLYTIM,R0 ; Set number of seconds to delay. 580 001074 012701 000002 MOV #SECNDS,R1 ; Set the time unit for seconds. 581 001100 004737 000000G CALL DELAY ; Now, delay for awhile. 582 001104 000443 BR 100$ ; And continue ... 583 584 ; Prompt the user before we continue. 585 586 001106 004737 000000G PRUSER::CALL $SAVAL ; Save all registers. 587 588 001112 012700 000000G 20$: MOV #FMTBUF,R0 ; Set address of output buffer. 589 001116 004737 000000G CALL CPYPRL ; Position to the prompt line. 590 001122 004737 000000G CALL BOLD ; Add the BOLD video attribute. 591 001126 012701 000000' MOV #WAITM,R1 ; Set the wait message address. 592 001132 004737 000000G CALL MOVEC ; Append it to the output buffer. 593 001136 004737 000000G CALL ATTOFF ; Turn off the video attributes. 594 001142 004737 000000G CALL VTYPE ; Now write it to the terminal. 595 001146 012700 000000G MOV #TMPBUF,R0 ; Set the input buffer address. 596 001152 012701 000001 MOV #1,R1 ; Set the character count to read. 597 001156 004737 000000G CALL GETCMD ; Now, wait until the user responds. 598 599 ; If the user responds with "E", presume end of listing. 600 601 001162 121027 000105 CMPB (R0),#'E ; Does the user want to exit ? 602 001166 001004 BNE 90$ ; If NE, no (check for next). 603 001170 052737 000020 000000G BIS #B.EXIT,STATUS ; Yes, show we are exiting. 604 001176 000406 BR 100$ ; And continue ... 605 606 ; If the user responds with "N", presume display next file. 607 608 001200 121027 000116 90$: CMPB (R0),#'N ; Does user want the next file ? 609 001204 001003 BNE 100$ ; If NE, no (continue ...) 610 001206 052737 000040 000000G BIS #B.NEXT,STATUS ; Yes, presume display next file. 611 612 001214 000207 100$: RETURN 613 614 .DSABL LSB VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 16 STIMER - Start the timer. 616 .SBTTL STIMER - Start the timer. 617 ;+ 618 ; 619 ; STIMER - Start the timer. 620 ; 621 ; This routine is called to start a timer which when it expires will enter 622 ; an AST routine to display the working message at the screen. 623 ; 624 ; Inputs: 625 ; None. 626 ; 627 ; Outputs: 628 ; All registers are preserved. 629 ; 630 ;- 631 001216 004237 000000G STIMER::JSR R2,$SAVVR ; Save R0 - R2. 632 001222 042737 020000 000000G BIC #B.CTIM,SWMASK ; Clear the timer aborted flag. 633 001230 MRKT$S ,#2,#SECNDS,#DOWORK ; Start working message timer. 634 001254 004737 000000G CALL CHKDIR ; Check/display any errors. 635 001260 000207 RETURN 636 637 .SBTTL CTIMER - Cancel the timer. 638 ;+ 639 ; 640 ; CTIMER - Cancel the timer. 641 ; 642 ; This routine is called to disable a previously enabled timer. 643 ; 644 ; Inputs: 645 ; None. 646 ; 647 ; Outputs: 648 ; All registers are perserved. 649 ; 650 ;- 651 001262 052737 020000 000000G CTIMER::BIS #B.CTIM,SWMASK ; Show timer has been aborted. 652 001270 CMKT$S ; Cancel all outstanding timers. 653 001276 000207 RETURN VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 17 DOWORK - Display the working message. 655 .SBTTL DOWORK - Display the working message. 656 ;+ 657 ; 658 ; DOWORK - Display the working message. 659 ; 660 ; This routine is entered after the timer expires to display the working 661 ; message at the screen. 662 ; 663 ; Inputs: 664 ; None. 665 ; 666 ; Outputs: 667 ; All registers are preserved. 668 ; 669 ;- 670 001300 004737 000000G DOWORK::CALL WRTWRK ; Call routine to write message. 671 001304 032737 020000 000000G BIT #B.CTIM,SWMASK ; Has the timer been aborted ? 672 001312 001002 BNE 10$ ; If EQ, yes (don't start again). 673 001314 004737 001216' CALL STIMER ; Start the timer again. 674 001320 005726 10$: TST (SP)+ ; Clear event flag from stack. 675 001322 ASTX$S ; Exit from the AST routine. 676 677 000001 .END VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 17-1 Symbol table ADDBEL 000226RG CTIMER 001262RG FD.CR = 000002 F2.CUP= 000100 N.STAT= 000020 ADJSEC 000246RG CTRCM 000034R FD.DIR= 000010 F2.DCH= 000004 N.UNIT= 000034 ANSI = ****** GX CTRLC = 000003 FD.FTN= 000001 F2.DKL= 000010 OPENR = ****** GX ATTOFF= ****** GX CTRLU = 000025 FD.F11= 040000 F2.EIO= 000400 OPERR = ****** GX BELL = 000007 CTTYPE 000372RG FD.INS= 000010 F2.FDX= 000200 OUTEFN= 000003 BLKSIZ= 001000 CTYPAH 000522RG FD.ISP= 002000 F2.GCH= 000002 OUTLUN= 000003 BOLD = ****** GX C.CMLD= 000002 FD.MNT= 100000 F2.NCT= 001000 OUTMSG= ****** GX BS = 000010 C.DEVD= 000006 FD.OSP= 004000 F2.SCH= 000001 O.CSI = ****** GX B.ATTR= 001000 C.DIRD= 000012 FD.PLC= 000004 F2.SFF= 000040 O.FDB = ****** GX B.AUX = 000200 C.DSDS= 000006 FD.PRN= 000004 GCLBLK= ****** GX O.FNB = ****** GX B.AVO = 000040 C.EXPS= 000060 FD.PSE= 010000 GETCHA 000056R O.FPTR= ****** GX B.BACK= 004000 C.FILD= 000016 FD.RAH= 000001 GETCMD= ****** GX O.SSIZ= ****** GX B.BELL= 000004 C.IDIA= 000036 FD.RAN= 000002 GETTAH 000166R O.USIZ= ****** GX B.CMNT= 000001 C.IDIL= 000034 FD.REC= 000001 GTYPAH 000536RG PRSPEC 001030RG B.CTIM= 020000 C.IDVA= 000032 FD.RWM= 000001 HLPEFN= 000006 PRUSER 001106RG B.CTRC= 100000 C.IDVL= 000030 FD.SDI= 000020 HLPLUN= 000006 PRWAIT 001054RG B.DOPR= 002000 C.MKW1= 000024 FD.SQD= 000040 HOURS = 000004 Q.IOAE= 000012 B.EXIT= 000020 C.MKW2= 000026 FD.TTY= 000004 HT = 000011 Q.IOEF= 000006 B.FE = 000010 C.ODVL= 000040 FD.WBH= 000002 IENTRY= ****** GX Q.IOFN= 000002 B.FERR= 040000 C.SIZE= 000054 FF = 000014 INEFN = 000001 Q.IOLU= 000004 B.FF = 000020 C.STAT= 000001 FF.CHR= 000005 INLUN = 000001 Q.IOPL= 000014 B.GBL = 000400 C.SWAD= 000022 FF.NV = 000003 INPTR = ****** GX Q.IOPR= 000007 B.HDR = 000100 C.TYPR= 000000 FF.POE= 000002 IN2EFN= 000002 Q.IOSB= 000010 B.IFIL= 000002 DATSIZ= 000040 FF.RWD= 000001 IN2LUN= 000002 RECSIZ= 001000 B.MSG = 020000 DEFMOD= 000062 FF.RWF= 000006 KEYWRD= ****** GX RESTC = ****** GX B.NAR = 000001 DEFSWM= 142250 FF.SPC= 000004 LF = 000012 RSX11M= 000000 B.NATV= 040000 DEFTAB= 000010 FILSIZ= 000042 MINUTE= 000003 R.FIX = 000001 B.NEXT= 000040 DEL = 000177 FL.AEX= 000001 MOVEC = ****** GX R.SEQ = 000003 B.OFIL= 000004 DELAY = ****** GX FL.VCP= 000002 MRKEFN= 000010 R.STM = 000004 B.PROT= 002000 DISESC 000564RG FMTBUF= ****** GX MRKENT= 000003 R.VAR = 000002 B.SCRB= 004000 DLYTIM= 000002 FNDSIZ= 000204 MRKLEN= 001750 SAVEC = ****** GX B.SRCH= 000400 DOOPEN 000566RG FO.APD= 000106 NB.ANS= 002000 SECNDS= 000002 B.STUP= 100000 DOPARS 000706RG FO.MFY= 000002 NB.DEV= 000200 SETBUF 000222R B.WAIT= 000200 DOWAIT 000742RG FO.RD = 000001 NB.DIR= 000100 SETCHA 000106R B.WIDE= 000002 DOWORK 001300RG FO.UPD= 000006 NB.NAM= 000004 SETMSG= ****** GX B.XACT= 001000 ERRSIZ= 000120 FO.WRT= 000016 NB.SD1= 000400 SETNAR= ****** GX B.132 = 000010 ESC = 000033 FT.ANI= 000001 NB.SD2= 001000 SETSIZ= 000002 B.2FIL= 010000 FA.APD= 000100 FT.BBF= 000002 NB.SFL= 001470 SE.BIN= 000003 CALMAX= ****** GX FA.CRE= 000010 FT.MBF= 000004 NB.SNM= 000040 SE.FIX= 000002 CHCTRC 000312RG FA.DLK= 001000 F.RCTL= ****** GX NB.STP= 000020 SE.IAA= 000017 CHKDIR= ****** GX FA.ENB= 100000 F1.ACR= 000001 NB.SUP= 020000 SE.ICN= 000001 CHKERR= ****** GX FA.EXC= 002000 F1.BTW= 000002 NB.SVR= 000010 SE.LPR= 000011 CH.AND= 000001 FA.EXL= 004000 F1.BUF= 000004 NB.TYP= 000002 SE.NAT= 000016 CLRTAH 000136R FA.EXT= 000004 F1.CCO= 000020 NB.VER= 000001 SE.NIH= 000014 CMDSIZ= 000400 FA.LKL= 002000 F1.ESQ= 000040 NB.WCH= 004000 SE.NSC= 000012 COMMA = 000054 FA.NSP= 000100 F1.HLD= 000100 NB.WLV= 010000 SE.PAR= 000010 CPYPRL= ****** GX FA.POS= 010000 F1.LWC= 000200 NULL = 000000 SE.SPD= 000006 CR = 000015 FA.RD = 000001 F1.RNE= 000400 NVT100 000000R 002 SE.SPL= 000007 CS.DIF= 000002 FA.RWD= 004000 F1.RPR= 001000 N.ANM1= 000002 SE.TER= 000005 CS.DVF= 000004 FA.SEQ= 040000 F1.RST= 002000 N.ANM2= 000024 SE.UPN= 000013 CS.EQU= 000040 FA.SHR= 000040 F1.RUB= 004000 N.DID = 000024 SE.VAL= 000004 CS.INP= 000001 FA.TMP= 000020 F1.SYN= 010000 N.DVNM= 000032 SF.DEF= 000010 CS.LOG= 000100 FA.WCK= 020000 F1.TRW= 020000 N.FID = 000000 SF.GAC= 002600 CS.MOR= 000020 FA.WRT= 000002 F1.UIA= 000010 N.FNAM= 000006 SF.GMC= 002560 CS.NMF= 000001 FD.BLK= 000010 F1.UTB= 040000 N.FTYP= 000014 SF.GSC= 002540 CS.OUT= 000002 FD.CCL= 000002 F1.VBF= 100000 N.FVER= 000016 SF.RDF= 002460 CS.WLD= 000010 FD.COM= 020000 F2.ALT= 000020 N.NEXT= 000022 SF.SAC= 002620 VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 17-2 Symbol table SF.SMC= 002440 TC.ACD= 000103 TC.RSP= 000003 TF.WAL= 000010 T.V102= 000025 SF.SSC= 002420 TC.ACR= 000024 TC.SCP= 000012 TF.WBT= 000100 T.V105= 000026 SF.STS= 002520 TC.ALT= 000031 TC.SCR= 000011 TF.WIR= 000200 T.V125= 000027 SF.STT= 002500 TC.ANI= 000122 TC.SFC= 000131 TF.WLB= 000001 T.V131= 000030 SPACE = 000040 TC.ANS= 000073 TC.SFF= 000016 TF.WMS= 000020 T.V132= 000031 SPNEFN= 000011 TC.ARC= 000104 TC.SLV= 000050 TF.XCC= 000001 T.V2XX= 000036 START = ****** GX TC.ASP= 000076 TC.SMO= 000027 TF.XOF= 000100 VT = 000013 STATUS= ****** GX TC.AVO= 000123 TC.SMP= 000026 TICKS = 000001 VTYPE = ****** GX STIMER 001216RG TC.BIN= 000065 TC.SMR= 000025 TIEFN = 000004 WAITM 000000R SWMASK= ****** GX TC.BLK= 000042 TC.SSC= 000142 TILUN = 000004 WRTSYN= ****** GX S.ANM1= 000014 TC.BSP= 000023 TC.STB= 000005 TIOSB = ****** GX WRTWRK= ****** GX S.ANM2= 000005 TC.CCF= 000030 TC.SXL= 000150 TMPBUF= ****** GX XTC.DT= 000001 S.BIN = 020000 TC.CEQ= 000046 TC.TAP= 000045 TMPSIZ= 000042 XTC.EN= 000002 S.CONT= 000040 TC.CLC= 000151 TC.TBF= 000071 TOEFN = 000005 XTC.SE= 000004 S.EOF = 000200 TC.CLN= 000152 TC.TBM= 000101 TOLUN = 000005 XTC.VO= 000010 S.EXTA= 000023 TC.CSQ= 000074 TC.TBS= 000100 TTYAVO 000221R XTM.FS= 000000 S.EXTB= 000024 TC.CTC= 000075 TC.TLC= 000130 TTYBUF 000216R XTM.M1= 000006 S.FNAM= 000006 TC.CTS= 000072 TC.TMM= 000143 TTYPE 000217RG XTM.M2= 000007 S.FNB = 000036 TC.DEC= 000124 TC.TRN= 000105 TTYSIZ= 000004 XTM.NO= 177777 S.FNBW= 000017 TC.DLU= 000041 TC.TSY= 000144 TYPMSG= ****** GX XTM.PS= 000001 S.FNTY= 000004 TC.EDT= 000125 TC.TTP= 000010 T.AS33= 000001 XTM.US= 000010 S.FORW= 000004 TC.EPA= 000040 TC.UC0= 000052 T.AS35= 000003 XTM.21= 000005 S.FTYP= 000002 TC.ESQ= 000035 TC.UC1= 000053 T.BMP1= 000035 XTU.CD= 000002 S.NAME= 000400 TC.FDX= 000064 TC.UC2= 000054 T.DTC1= 000040 XTU.CL= 000004 S.NFEN= 000020 TC.FRM= 000043 TC.UC3= 000055 T.KS33= 000002 XTU.DR= 000006 S.NUMB= 002000 TC.FSZ= 000107 TC.UC4= 000056 T.LA12= 000020 XTU.OF= 000010 S.RSX = 100000 TC.HFF= 000017 TC.UC5= 000057 T.LA34= 000022 XTU.ON= 000012 S.RULR= 004000 TC.HFL= 000013 TC.UC6= 000060 T.LA36= 000006 XTU.RI= 000014 S.SEE = 001000 TC.HHT= 000021 TC.UC7= 000061 T.LA38= 000023 XTU.TD= 000020 S.SEL = 000100 TC.HLD= 000044 TC.UC8= 000062 T.LA50= 000032 XTU.TU= 000016 S.SRCH= 000001 TC.HSY= 000132 TC.UC9= 000063 T.LA75= 000043 XTU.UI= 000000 S.STOP= 000020 TC.ICS= 000141 TC.VFL= 000014 T.LCG1= 000045 XT.CPD= 000134 S.TECO= 040000 TC.IMG= 000032 TC.WID= 000001 T.LN03= 000037 XT.DIA= 000000 S.WRAP= 010000 TC.INT= 000127 TC.XMM= 000106 T.LQP1= 000033 XT.DIT= 000113 S.0 = 000001 TC.ISL= 000006 TC.XSP= 000004 T.LQP2= 000034 XT.DLM= 000110 S.100 = 000004 TC.LCP= 000036 TC.8BC= 000067 T.LQP3= 000042 XT.DMD= 000111 S.110 = 000005 TC.LPP= 000002 TF.AST= 000010 T.L100= 000021 XT.DTD= 000003 S.1200= 000013 TC.LVF= 000020 TF.BIN= 000002 T.L120= 000016 XT.DTM= 000001 S.134 = 000006 TC.MAP= 000154 TF.CCO= 000040 T.L180= 000014 XT.DTT= 000112 S.150 = 000007 TC.MAX= 000155 TF.ESQ= 000020 T.L2XX= 000044 XT.D20= 000002 S.1800= 000014 TC.MHU= 000145 TF.NOT= 000002 T.L210= 000041 XT.ENC= 000002 S.19.2= 000025 TC.NBR= 000102 TF.RAL= 000010 T.L30P= 000005 XT.GOV= 000117 S.200 = 000010 TC.NEC= 000047 TF.RCU= 000001 T.L30S= 000004 XT.MTP= 000114 S.2000= 000015 TC.NKB= 000033 TF.RDI= 100000 T.SCR0= 000017 XT.OHS= 000003 S.2400= 000016 TC.NL = 000015 TF.RES= 010000 T.UNK0= 000000 XT.REV= 000136 S.300 = 000011 TC.NPR= 000034 TF.RLB= 000002 T.USR0= 000200 XT.SDE= 000115 S.3600= 000017 TC.NST= 000022 TF.RLU= 001000 T.USR1= 000201 XT.SER= 000001 S.38.4= 000026 TC.OOB= 000140 TF.RNE= 000020 T.USR2= 000202 XT.TAK= 000116 S.4800= 000020 TC.PAR= 000037 TF.RNF= 020000 T.USR3= 000203 XT.THS= 000137 S.50 = 000002 TC.PPT= 000147 TF.RPR= 002000 T.USR4= 000204 XT.TIM= 000133 S.600 = 000012 TC.PRI= 000051 TF.RPT= 004000 T.VT05= 000007 XT.TSP= 000120 S.7200= 000021 TC.PTH= 000146 TF.RST= 000001 T.VT50= 000010 XT.TTO= 000121 S.75 = 000003 TC.P8B= 000070 TF.RTT= 000400 T.VT52= 000011 XT.VER= 000135 S.9600= 000022 TC.QDP= 000153 TF.SYN= 000200 T.VT55= 000012 XT.VOI= 000000 TAHBUF 000224RG TC.RAT= 000007 TF.TMO= 000200 T.VT61= 000013 $SAVAL= ****** GX TAHSIZ= 000002 TC.REM= 000066 TF.TNE= 040000 T.V100= 000015 $SAVVR= ****** GX TC.ABD= 000077 TC.RGS= 000126 TF.UCH= 000002 T.V101= 000024 $$$ = 000053 VTLSUB - VTL Subroutines. MACRO V05.05 Thursday 13-Apr-89 14:07 Page 17-3 Symbol table $$$ARG= 000004 $$$T1 = 000000 .TPARS= ****** GX ...GBL= 000000 ...TPC= 000036 $$$OST= 000014 . ABS. 000000 000 (RW,I,GBL,ABS,OVR) 001330 001 (RW,I,LCL,REL,CON) $ERMSG 000054 002 (RO,D,LCL,REL,CON) Errors detected: 0 *** Assembler statistics Work file reads: 0 Work file writes: 0 Size of work file: 13453 Words ( 53 Pages) Size of core pool: 14530 Words ( 55 Pages) Operating system: RSX-11M/M-PLUS Elapsed time: 00:00:23.49 VTLSUB,VTLSUB/-SP=VTLPRE/PA:1,VTLSUB