AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Table of contents 6- 55 CLRMSG - Position/clear the message line. 7- 144 CLRWIN - Clear the display window. 8- 166 WRITPR - Make and write the command prompt. 9- 204 CLRPRL - Position/clear the prompt line. 10- 260 NXTPAG - Format for the next page. 11- 292 CPYBLA - Copy the CR/LF sequence. 12- 317 CPYTOP - Position to top of display window. 13- 348 SCRDWN - Scroll the screen down. 14- 373 SETNAR - Set VT100 to 80 columns. 14- 384 SETWID - Set VT100 to 132 columns. 15- 395 WRTEOF - Write the end of file sequence. 16- 425 WRTHDR - Write the screen header. 17- 460 WRTNAM - Write the file name. 18- 510 PREHDR - Prepare to write header. 19- 566 PRESPN - Write the pre-spawn sequence. 19- 592 AFTSPN - Write the after spawn sequence. 20- 613 CPYSCR - Copy the scroll region sequence. 21- 647 CPYWID - Copy the screen width. 22- 678 CPYACT - Copy the active message. 23- 749 WRTWRK - Display the working message. 24- 791 CLRTTY - Clear the VT100 screen. 25- 808 VTYPE - Write the format buffer. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 2 1 .TITLE AUXSCR - VT100 Screen Formatting 2 .IDENT /1.0/ 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: AUXSCR.MAC 28 ; Author: Robin Miller 29 ; Date: July 23, 1985 30 ; 31 ; Description: 32 ; 33 ; These routines do the screen formatting for the VT100. 34 ; 35 ;- 36 .ENABL AMA 37 .NLIST BEX AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 3 39 40 ; Local equates: Edited F. borger to make errors work right 41 42 000027 MSLINE = 23. ; The message line number. 43 000030 PRLINE = MSLINE+1 ; The prompt line number. 44 000012 LNBIAS = 10. ; The line bias for no AVO. 45 000161 HORLIN = 161 ; Horizontal line (q). 46 47 ; Local messages: 48 49 000000 101 143 164 ACTM: .ASCIZ "Active" 50 000006 ACTS = <.-ACTM>-1 ; Size of active message. 51 000007 127 157 162 WORKM: .ASCIZ "Working ... record " 52 000023 WORKS = <.-WORKM>-1 ; Size of working message. 53 .EVEN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 4 CLRMSG - Position/clear the message line. 55 .SBTTL CLRMSG - Position/clear the message line. 56 ;+ 57 ; 58 ; CLRMSG - Position/clear the error message line. 59 ; CPYMSG - Copy the position/clear sequence (don't display). 60 ; SETMSG - Same as CPYMSG except the REVERSE attribute is added. 61 ; SET2MS - Same as SETMSG except BOLD and second string is added. 62 ; TYPMSG - Entry point to finish buffer and write the message. 63 ; WRTMSG - Same as SETMSG except append and display the message. 64 ; WRT2MS - Same as WRTMSG except a second message is appended. 65 ; WRT4MS - Same as WRT2MS except four strings are displayed. 66 ; 67 ; The message line is either line 23 or line 13 depending on whether the 68 ; terminal has the AVO or not. If the VT100 doesn't have the AVO, and 69 ; we're in 132 column mode, only 14 lines can be displayed at one time. 70 ; 71 ; Inputs: 72 ; R0 = The output buffer address (entry at CPYMSG/SETMSG/TYPMSG). 73 ; R1 = The message string address (entry at WRTMSG). 74 ; R2 = The second string address (entry at WRT2MS). 75 ; R3 = The third string address (entry at WRT4MS). 76 ; R4 = The fourth string address (entry at WRT4MS). 77 ; 78 ; Outputs: 79 ; R0 = The updated output buffer address (return from CPYMSG/SETMSG). 80 ; 81 ; All other registers are preserved. 82 ; 83 ;- 84 000034 004237 000000G CLRMSG::JSR R2,$SAVVR ; Save R0 - R2. 85 000040 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 86 000044 004737 000252' CALL CPYMSG ; Copy the positioning sequence. 87 000050 042737 000000G 000000G BIC #B.MSG,STATUS ; Show no message is displayed. 88 000056 000137 002224' JMP VTYPE ; Write it to the terminal. 89 90 000062 004737 000000G SETMSG::CALL SAVEC ; Save the cursor position. 91 000066 004737 000252' CALL CPYMSG ; Copy the positioning sequence. 92 000072 004737 000000G CALL REVERSE ; Add the REVERSE video attribute. 93 000076 000207 RETURN 94 95 000100 012700 000000G SET2MS::MOV #FMTBUF,R0 ; Set the buffer address. 96 000104 004737 000062' CALL SETMSG ; Setup the message to write. 97 000110 004737 000000G CALL MOVEC ; Append the 1st message string. 98 000114 004737 000000G CALL BOLD ; Copy the BOLD video attribute. 99 000120 010201 MOV R2,R1 ; Set address of second message. 100 000122 004737 000000G CALL MOVEF ; Now append the second message. 101 000126 000207 RETURN 102 103 000130 004237 000000G WRTMSG::JSR R2,$SAVVR ; Save R0 - R2. 104 000134 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 105 000140 004737 000062' CALL SETMSG ; Setup the message to write. 106 000144 004737 000000G CALL MOVEC ; Append the message string. 107 000150 000425 BR TYPMSG ; Write it to the terminal. 108 109 000152 004237 000000G WRT2MS::JSR R2,$SAVVR ; Save R0 - R2. 110 000156 004737 000100' CALL SET2MS ; Set to write 2 string message. 111 000162 000420 BR TYPMSG ; And go do it ... AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 4-1 CLRMSG - Position/clear the message line. 112 113 000164 004237 000000G WRT4MS::JSR R2,$SAVVR ; Save R0 - R2. 114 000170 004737 000100' CALL SET2MS ; Set to write 2 string message. 115 000174 004737 000000G CALL ATTOFF ; Turn off the video attributes. 116 000200 004737 000000G CALL REVERSE ; Add REVERSE video attribute. 117 000204 010301 MOV R3,R1 ; Set address of third message. 118 000206 004737 000000G CALL MOVEC ; Now append the third message. 119 000212 004737 000000G CALL BOLD ; Add the BOLD video attribute. 120 000216 010401 MOV R4,R1 ; Set address of fourth message. 121 000220 004737 000000G CALL MOVEC ; Now append the fourth message. 122 ; Fall through to write it ... 123 124 000224 004737 000000G TYPMSG::CALL ATTOFF ; Turn off the video attributes. 125 000230 004737 000000G CALL ADDBEL ; Ring the bell to wakeup the user. 126 000234 004737 000000G CALL RESTC ; Restore the cursor position. 127 000240 052737 000000G 000000G BIS #B.MSG,STATUS ; Show a message is displayed. 128 000246 000137 002224' JMP VTYPE ; Write it to the terminal. 129 130 000252 004537 000000G CPYMSG::JSR R5,.SAVR1 ; Save R1 - R5. 131 000256 012701 000027 MOV #MSLINE,R1 ; Presume VT100 with AVO. 132 000262 032737 000000G 000000G BIT #B.132,STATUS ; VT100 in 132 column mode ? 133 000270 001406 BEQ 10$ ; If EQ, no (80 column mode). 134 000272 032737 000000G 000000G BIT #B.AVO,SWMASK ; VT100 with advanced video ? 135 000300 001002 BNE 10$ ; If NE, yes. 136 000302 162701 000012 SUB #LNBIAS,R1 ; No, adjust the message line. 137 138 000306 004737 000000G 10$: CALL MAKLIN ; Make the ASCII line number. 139 000312 012701 000001 MOV #1,R1 ; Set the column number. 140 000316 004737 000000G CALL MAKCOL ; Make the ASCII column number. 141 000322 004737 000000G CALL CEOL ; Clear to end of the line. 142 000326 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 5 CLRWIN - Clear the display window. 144 .SBTTL CLRWIN - Clear the display window. 145 ;+ 146 ; 147 ; CLRWIN - Clears the display window. 148 ; 149 ; This routine clears all the lines within the current display window. 150 ; The file name and/or ruler (if any) are left on the screen. 151 ; 152 ; Inputs: 153 ; None. 154 ; 155 ; Outputs: 156 ; All registers are preserved. 157 ; 158 ;- 159 000330 004737 000000G CLRWIN::CALL $SAVAL ; Save all registers. 160 000334 013705 000000G MOV IENTRY,R5 ; Get the current entry. 161 000340 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 162 000344 004737 000752' CALL CPYTOP ; Set to top of the window. 163 000350 004737 000000G CALL CEOS ; Clear to the end of screen. 164 000354 000137 002224' JMP VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 6 WRITPR - Make and write the command prompt. 166 .SBTTL WRITPR - Make and write the command prompt. 167 ;+ 168 ; 169 ; COPYPR - Copy the prompt line sequence. 170 ; WRITPR - Make and write the command prompt. 171 ; 172 ; This routine creates the prompt string from the current record number 173 ; and writes it to the prompt line. 174 ; 175 ; Inputs: 176 ; R0 = The output buffer address (entry at COPYPR). 177 ; 178 ; Outputs: 179 ; R0 = The updated buffer address (entry at COPYPR). 180 ; 181 ; All other registers are preserved. 182 ; 183 ;- 184 000360 105 103 122 PRMSG: .ASCII %ECR>% 185 000364 007 000 .byte 7,0 ; The prompt string. 186 000006 PRMSGL = <.-PRMSG> ; Calculate the prompt size. 187 .EVEN 188 189 000366 004737 000000G WRITPR::CALL $SAVAL ; Save all registers. 190 000372 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 191 000376 004737 000412' CALL COPYPR ; Copy the prompt sequence. 192 000402 004737 000000G CALL CEOL ; Clear to end of the line. 193 000406 000137 002224' JMP VTYPE ; Write it to the terminal. 194 195 000412 004537 000000G COPYPR::JSR R5,.SAVR1 ; Save R1 - R5. 196 000416 004737 000470' CALL SETPRL ; Prepare to write to prompt line. 197 000422 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 198 000426 012701 000360' MOV #PRMSG,R1 ; Set address of EOF string. 199 000432 004737 000000G CALL MOVEC ; Append it to the output buffer. 200 000436 004737 000000G CALL ATTOFF ; Turn off the video attributes. 201 000442 112720 000040 MOVB #SPACE,(R0)+ ; Add a space after the prompt. 202 000446 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 7 CLRPRL - Position/clear the prompt line. 204 .SBTTL CLRPRL - Position/clear the prompt line. 205 ;+ 206 ; 207 ; CLRPRL - Position/clear the prompt line. 208 ; CPYPRL - Copy the position/clear sequence (don't display). 209 ; POSPRL - Position to the prompt line (no other action). 210 ; SETPRL - Same as CPYPRL except BOLD/REVERSE attributes added. 211 ; WRTPRL - Same as SETPRL except append and display the message. 212 ; 213 ; This routine positions to the prompt line, clears the line, then adds 214 ; the BOLD and REVERSE video attributes presuming a message will be 215 ; displayed next. 216 ; 217 ; Inputs: 218 ; R0 = The output buffer address (entry at CPYPRL/POSPRL/SETPRL). 219 ; R1 = The prompt string address (entry at WRTPRL). 220 ; 221 ; Outputs: 222 ; R0 = The updated output buffer address (return from CPYPRL/SETPRL). 223 ; 224 ; All other registers are preserved. 225 ; 226 ;- 227 000450 004237 000000G CLRPRL::JSR R2,$SAVVR ; Save R0 - R2. 228 000454 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 229 000460 004737 000532' CALL CPYPRL ; Move positioning sequence. 230 000464 000137 002224' JMP VTYPE ; Write it to the terminal. 231 232 000470 004737 000544' SETPRL::CALL POSPRL ; Position to the prompt line. 233 000474 004737 000000G CALL BOLD ; Add the BOLD video attribute. 234 000500 000207 RETURN 235 236 000502 004237 000000G WRTPRL::JSR R2,$SAVVR ; Save R0 - R2. 237 000506 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 238 000512 004737 000470' CALL SETPRL ; Setup the buffer to write. 239 000516 004737 000000G CALL MOVEC ; Append the prompt string. 240 000522 004737 000000G CALL ATTOFF ; Append video attributes off. 241 000526 000137 002224' JMP VTYPE ; Write it to the terminal. 242 243 000532 004737 000544' CPYPRL::CALL POSPRL ; Position to the prompt line. 244 000536 004737 000000G CALL CEOL ; Clear to end of the line. 245 000542 000207 RETURN 246 247 000544 004537 000000G POSPRL::JSR R5,.SAVR1 ; Save R1 - R5. 248 000550 012701 000030 MOV #PRLINE,R1 ; Presume VT100 with AVO. 249 000554 032737 000000G 000000G BIT #B.132,STATUS ; VT100 in 132 column mode ? 250 000562 001406 BEQ 10$ ; If EQ, no (80 column mode). 251 000564 032737 000000G 000000G BIT #B.AVO,SWMASK ; VT100 with advanced video ? 252 000572 001002 BNE 10$ ; If NE, yes. 253 000574 162701 000012 SUB #LNBIAS,R1 ; No, adjust the prompt line. 254 255 000600 004737 000000G 10$: CALL MAKLIN ; Make the ASCII line number. 256 000604 012701 000001 MOV #1,R1 ; Set the column number. 257 000610 004737 000000G CALL MAKCOL ; Make the ASCII column number. 258 000614 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 8 NXTPAG - Format for the next page. 260 .SBTTL NXTPAG - Format for the next page. 261 ;+ 262 ; 263 ; NXTPAG - Format for the next page. 264 ; 265 ; This routine is called to format the screen for the next display page. 266 ; The message and prompt lines are cleared, the cursor is positioned at the 267 ; last display line, and the window is scrolled up one line in preparation 268 ; of the next line to be displayed. 269 ; 270 ; Inputs: 271 ; None. 272 ; 273 ; Outputs: 274 ; All registers are preserved. 275 ; 276 ;- 277 000616 004737 000000G NXTPAG::CALL $SAVAL ; Save all registers. 278 000622 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 279 000626 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 280 000632 004737 000252' CALL CPYMSG ; Clear the message line 281 000636 004737 000532' CALL CPYPRL ; and the prompt line. 282 283 ; Next, position to the last display line. 284 285 000642 016501 000000G MOV O.BOT(R5),R1 ; Copy the bottom line number. 286 000646 004737 000000G CALL MAKLIN ; Make the ASCII line number. 287 000652 012701 000001 MOV #1,R1 ; Set for the first column. 288 000656 004737 000000G CALL MAKCOL ; Make the ASCII column number. 289 000662 004737 000706' CALL CPYBLA ; Use CR/LF to scroll the screen up. 290 000666 000137 002224' JMP VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 9 CPYBLA - Copy the CR/LF sequence. 292 .SBTTL CPYBLA - Copy the CR/LF sequence. 293 ;+ 294 ; 295 ; CPYBLA - Copy a carriage return/line feed sequence. 296 ; WRTBLA - Write a blank line to the terminal. 297 ; 298 ; Inputs: 299 ; R0 = The output buffer address. 300 ; 301 ; Outputs: 302 ; R0 = The updated output buffer address. 303 ; 304 ; All other registers are preserved. 305 ; 306 ;- 307 000672 012700 000000G WRTBLA::MOV #FMTBUF,R0 ; Set the output buffer address. 308 000676 004737 000706' CALL CPYBLA ; Fill in a sequence. 309 000702 000137 002224' JMP VTYPE ; And go display it. 310 311 000706 004537 000000G CPYBLA::JSR R5,.SAVR1 ; Save R1 - R5. 312 000712 112720 000015 MOVB #CR,(R0)+ ; Append a carriage return 313 000716 112720 000012 MOVB #LF,(R0)+ ; and a line feed. 314 000722 105010 CLRB (R0) ; Terminate the output buffer. 315 000724 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 10 CPYTOP - Position to top of display window. 317 .SBTTL CPYTOP - Position to top of display window. 318 ;+ 319 ; 320 ; CPYTOP - Copy the positioning sequence (don't display). 321 ; WRTTOP - Write the position to top of display window sequence. 322 ; 323 ; This routine is used to position to the top line of a display window. 324 ; 325 ; Inputs: 326 ; R0 = The output buffer address (entry at CPYTOP). 327 ; R5 = The active file entry address (entry at CPYTOP). 328 ; 329 ; Outputs: 330 ; R0 = The updated output buffer address (return from CPYTOP). 331 ; 332 ; All other registers are preserved. 333 ; 334 ;- 335 000726 004737 000000G WRTTOP::CALL $SAVAL ; Save all registers. 336 000732 013705 000000G MOV IENTRY,R5 ; Get the current entry. 337 000736 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 338 000742 004737 000752' CALL CPYTOP ; Move positioning sequence. 339 000746 000137 002224' JMP VTYPE ; Write it to the terminal. 340 341 000752 004537 000000G CPYTOP::JSR R5,.SAVR1 ; Save R1 - R5. 342 000756 116501 000000G MOVB O.TOP(R5),R1 ; Copy the top line number. 343 000762 004737 000000G CALL MAKLIN ; Make the ASCII line number. 344 000766 012701 000001 MOV #1,R1 ; Set for the first column. 345 000772 004737 000000G CALL MAKCOL ; Now make the column number. 346 000776 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 11 SCRDWN - Scroll the screen down. 348 .SBTTL SCRDWN - Scroll the screen down. 349 ;+ 350 ; 351 ; SCRDWN - Scroll the screen down. 352 ; 353 ; This routine is called to scroll the screen down the specified number 354 ; of lines when we are backing up a partial page. 355 ; 356 ; Inputs: 357 ; R1 = The number of lines to scroll down. 358 ; 359 ; Outputs: 360 ; All registers are preserved. 361 ; 362 ;- 363 001000 004737 000000G SCRDWN::CALL $SAVAL ; Save all registers. 364 001004 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 365 001010 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 366 001014 004737 000252' CALL CPYMSG ; Clear the message line 367 001020 004737 000532' CALL CPYPRL ; and the prompt line. 368 001024 004737 000752' CALL CPYTOP ; Set to top of display window. 369 001030 004737 000000G 10$: CALL RINDEX ; Move screen down (reverse index). 370 001034 077103 SOB R1,10$ ; Loop until we're done. 371 001036 000137 002224' JMP VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 12 SETNAR - Set VT100 to 80 columns. 373 .SBTTL SETNAR - Set VT100 to 80 columns. 374 ;+ 375 ; 376 ; SETNAR - Set VT100 to 80 column mode. 377 ; 378 ;- 379 001042 004237 000000G SETNAR::JSR R2,$SAVVR ; Save R0 - R2. 380 001046 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 381 001052 004737 000000G CALL NARROW ; Set to a narrow screen. 382 001056 000137 002224' JMP VTYPE ; Write it to the terminal. 383 384 .SBTTL SETWID - Set VT100 to 132 columns. 385 ;+ 386 ; 387 ; SETWID - Set VT100 to 132 column mode. 388 ; 389 ;- 390 001062 004237 000000G SETWID::JSR R2,$SAVVR ; Save R0 - R2. 391 001066 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 392 001072 004737 000000G CALL WIDE ; Set to a wide screen. 393 001076 000137 002224' JMP VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 13 WRTEOF - Write the end of file sequence. 395 .SBTTL WRTEOF - Write the end of file sequence. 396 ;+ 397 ; 398 ; WRTEOF - Write the end of file sequence. 399 ; 400 ; This routine is called when a file is being closed to disable the 401 ; scrolling region, put the keypad back in numeric mode, and to set 402 ; the screen narrow if it was set wide. 403 ; 404 ; Inputs: 405 ; None. 406 ; 407 ; Outputs: 408 ; All registers are preserved. 409 ; 410 ;- 411 001102 004237 000000G WRTEOF::JSR R2,$SAVVR ; Save R0 - R2. 412 001106 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 413 ;* CALL NOREG ; Remove the scroll region. 414 001112 004737 000000G CALL NUMKEY ; Put keypad back in numeric. 415 ;* BIT #B.132,STATUS ; VT100 in 132 column mode ? 416 ;* BEQ 10$ ; If EQ, no (already narrow). 417 ;* CALL NARROW ; Yes, set to 80 column mode. 418 ;* BIC #B.132,STATUS ; Show we're now in narrow mode. 419 ;* BR 20$ ; And continue ... 420 421 001116 004737 000544' 10$: CALL POSPRL ; Position to the prompt line. 422 423 001122 000137 002224' 20$: JMP VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 14 WRTHDR - Write the screen header. 425 .SBTTL WRTHDR - Write the screen header. 426 ;+ 427 ; 428 ; WRTHDR - Writes the screen the active file entry. 429 ; 430 ; This routine sets the terminal to either 80 or 132 column mode, positions 431 ; to and writes the file name (if enabled), enables the application keypad, 432 ; sets up the scrolling region, writes a ruler (if enabled), and then leaves 433 ; the cursor positioned at the first display line. 434 ; 435 ; Inputs: 436 ; None. 437 ; 438 ; Outputs: 439 ; All registers are preserved. 440 ; 441 ;- 442 001126 004737 000000G WRTHDR::CALL $SAVAL ; Save all registers. 443 001132 013705 000000G MOV IENTRY,R5 ; Get the current entry. 444 001136 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 445 ;*** BIT #B.2FIL,STATUS ; Are we displaying two files ? 446 ;*** BEQ 10$ ; If EQ, no (only one). 447 ;*** CALL PREHDR ; Clear top or bottom of screen. 448 ;*** BR 20$ ; And continue ... 449 450 ; We only change the width when displaying a single file. 451 452 001142 004737 001650' 10$: CALL CPYWID ; Copy the current screen width. 453 454 001146 004737 001216' 20$: CALL CPYNAM ; Do the file name processing. 455 001152 004737 000000G CALL APPKEY ; Enable the application keypad. 456 001156 004737 001570' CALL CPYSCR ; Setup the scrolling region. 457 001162 004737 002224' CALL VTYPE ; Write the format buffer. 458 001166 000137 000726' JMP WRTTOP ; Set to top of the display window. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 15 WRTNAM - Write the file name. 460 .SBTTL WRTNAM - Write the file name. 461 ;+ 462 ; 463 ; WRTNAM - Write the file name. 464 ; 465 ; Inputs: 466 ; R0 = The output buffer address (entry at CPYNAM). 467 ; R5 = The file entry address (entry at CPYNAM). 468 ; 469 ; Outputs: 470 ; R0 = The updated output buffer address (entry at CPYNAM). 471 ; 472 ; All other registers are preserved. 473 ; 474 ;- 475 001172 004737 000000G WRTNAM::CALL $SAVAL ; Save all registers. 476 001176 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 477 001202 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 478 001206 004737 001216' CALL CPYNAM ; Copy the file name sequence. 479 001212 000137 002224' JMP VTYPE ; And write it to the terminal. 480 481 001216 004537 000000G CPYNAM::JSR R5,.SAVR1 ; Save R1 - R5. 482 ;*** BIT #S.NAME,(R5) ; Is file name display enabled ? 483 ;*** BEQ 100$ ; If EQ, no (we're all done). 484 ;*** BIT #B.2FIL,STATUS ; Are we displaying two files ? 485 ;*** BEQ 10$ ; If EQ, no (continue ...) 486 ;*** BIT #S.RULR,(R5) ; Using ruler in place of name ? 487 ;*** BNE 100$ ; If NE, yes (no file name). 488 489 001222 116501 000000G 10$: MOVB O.FLIN(R5),R1 ; Get the file name line number. 490 001226 004737 000000G CALL MAKLIN ; Make the ASCII line number. 491 001232 012701 000001 MOV #1,R1 ; Set for the first column. 492 001236 004737 000000G CALL MAKCOL ; Make the ASCII column number. 493 001242 032737 000000G 000000G BIT #B.132,STATUS ; Are we in 132 column mode ? 494 001250 001402 BEQ 20$ ; If EQ, no (80 column mode). 495 001252 004737 000000G CALL DWIDTH ; Set for double width. 496 497 001256 004737 000000G 20$: CALL BOLD ; Add the BOLD attribute. 498 001262 004737 000000G CALL REVERSE ; Add the REVERSE attribute. 499 001266 016501 000000G MOV O.FNAM(R5),R1 ; Copy address of the file name. 500 001272 004737 000000G CALL MOVEC ; Copy it to the output buffer. 501 001276 112720 000040 MOVB #SPACE,(R0)+ ; Spaces between 502 001302 112720 000040 MOVB #SPACE,(R0)+ ; the file name 503 001306 112720 000040 MOVB #SPACE,(R0)+ ; and the date. 504 001312 016501 000000G MOV O.FDAT(R5),R1 ; Copy address of creation date. 505 001316 004737 000000G CALL MOVEC ; Copy it to the output buffer. 506 001322 004737 000000G CALL ATTOFF ; Turn off video attributes. 507 508 001326 000207 100$: RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 16 PREHDR - Prepare to write header. 510 .SBTTL PREHDR - Prepare to write header. 511 ;+ 512 ; 513 ; PREHDR - Prepare to write the header. 514 ; 515 ; This routine is used to prepare the screen to write the file name for 516 ; one of the file entrys when displaying two files. The idea here is to 517 ; clear the screen for one file while the other file is left on the screen. 518 ; 519 ; Inputs: 520 ; R0 = The output buffer address. 521 ; R5 = The file entry address. 522 ; 523 ; Outputs: 524 ; R0 = The updated output buffer address. 525 ; 526 ; All other registers are preserved. 527 ; 528 ;- 529 001330 004537 000000G PREHDR::JSR R5,.SAVR1 ; Save R1 - R5. 530 001334 020527 000000G CMP R5,#IFILE1 ; Are we doing the top file ? 531 001340 001015 BNE 10$ ; If NE, no (must be the bottom). 532 533 ; Top file processing: 534 535 001342 016501 000000G MOV O.BOT(R5),R1 ; Get the bottom line number. 536 001346 004737 000000G CALL MAKLIN ; Make the ASCII line number. 537 001352 012701 000001 MOV #1,R1 ; Set for the first column. 538 001356 004737 000000G CALL MAKCOL ; Make the ASCII column number. 539 001362 004737 000000G CALL CEOL ; Clear to end of the line. 540 001366 004737 000000G CALL CBOS ; Clear to beginning of screen. 541 001372 000431 BR 100$ ; And continue ... 542 543 ; Bottom file processing: 544 545 001374 016501 000000G 10$: MOV O.FLIN(R5),R1 ; Get the file name line. 546 001400 004737 000000G CALL MAKLIN ; Make the ASCII line number. 547 001404 012701 000001 MOV #1,R1 ; Set for the first column. 548 001410 004737 000000G CALL MAKCOL ; Make the ASCII column number. 549 001414 004737 000000G CALL CEOS ; Clear to the end of screen. 550 ;*** BIT #S.NAME,(R5) ; Is file name display enabled ? 551 ;*** BNE 100$ ; If NE, yes (continue ...) 552 553 ; Put a delimiter between the top and bottom files. 554 555 001420 004737 000000G CALL SGRAPH ; Turn on special graphics. 556 001424 012702 000120 MOV #80.,R2 ; Presume in 80 column mode. 557 001430 032737 000000G 000000G BIT #B.132,STATUS ; Did we guess correctly ? 558 001436 001402 BEQ 20$ ; If EQ, yes. 559 001440 012702 000204 MOV #132.,R2 ; Else, change the loop count. 560 001444 112720 000161 20$: MOVB #HORLIN,(R0)+ ; Set to write a horizontal line. 561 001450 077203 SOB R2,20$ ; Loop until done. 562 001452 004737 000000G CALL USSET ; Now, back to the ASCII set. 563 564 001456 000207 100$: RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 17 PRESPN - Write the pre-spawn sequence. 566 .SBTTL PRESPN - Write the pre-spawn sequence. 567 ;+ 568 ; 569 ; PRESPN - Write the pre-spawn sequence. 570 ; 571 ; This routine is called before spawning a command line to disable the 572 ; scrolling region, put the keypad back in numeric mode, and position 573 ; to the last line in preparation for the spawned command output. 574 ; 575 ; Inputs: 576 ; None. 577 ; 578 ; Outputs: 579 ; All registers are preserved. 580 ; 581 ;- 582 001460 004237 000000G PRESPN::JSR R2,$SAVVR ; Save R0 - R2. 583 001464 012700 000000G MOV #FMTBUF,R0 ; Set the buffer address. 584 ;* CALL NOREG ; Remove the scroll region. 585 001470 004737 000000G CALL NUMKEY ; Put keypad back in numeric. 586 001474 012701 000030 MOV #PRLINE,R1 ; Presume VT100 with AVO. 587 001500 004737 000000G CALL MAKLIN ; Make the ASCII line number. 588 001504 012701 000001 MOV #1,R1 ; Set the column number. 589 001510 004737 000000G CALL MAKCOL ; Make the ASCII column number. 590 001514 000137 002224' JMP VTYPE ; Write it to the terminal. 591 592 .SBTTL AFTSPN - Write the after spawn sequence. 593 ;+ 594 ; 595 ; AFTSPN - Write the after spawn sequence. 596 ; 597 ; This routine is called after spawning a command line to re-enable the 598 ; numeric keypad. 599 ; 600 ; Inputs: 601 ; None. 602 ; 603 ; Outputs: 604 ; All registers are preserved. 605 ; 606 ;- 607 001520 004237 000000G AFTSPN::JSR R2,$SAVVR ; Save R0 - R2. 608 001524 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 609 001530 004737 000000G CALL APPKEY ; Enable the application keypad. 610 001534 004737 000706' CALL CPYBLA ; Scroll screen via a blank line. 611 001540 000137 002224' JMP VTYPE ; Now go display the sequence. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 18 CPYSCR - Copy the scroll region sequence. 613 .SBTTL CPYSCR - Copy the scroll region sequence. 614 ;+ 615 ; 616 ; CPYSCR - Copy the scrolling region sequence. 617 ; WRTSCR - Write the scrolling region sequece. 618 ; 619 ; Inputs: 620 ; R0 = The output buffer address (entry at CPYSCR). 621 ; 622 ; Implicit inputs: 623 ; O.TOP = The top display window line number. 624 ; O.BOT = The bottom display window line number. 625 ; 626 ; Outputs: 627 ; R0 = The updated output buffer address. 628 ; 629 ; All other registers are preserved. 630 ; 631 ;- 632 001544 004737 000000G WRTSCR::CALL $SAVAL ; Save all registers. 633 001550 013705 000000G MOV IENTRY,R5 ; Copy the file entry address. 634 001554 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 635 001560 004737 001570' CALL CPYSCR ; Copy the scrolling region. 636 001564 000137 002224' JMP VTYPE ; And write it to the terminal. 637 638 001570 004537 000000G CPYSCR::JSR R5,.SAVR1 ; Save R1 - R5. 639 001574 004737 000000G CALL HOME ; Put curser in home position. (01) 640 001600 116501 000000G MOVB O.TOP(R5),R1 ; Copy the top line number. 641 001604 004737 000000G CALL MAKLIN ; Make the ASCII line number. 642 001610 116501 000000G MOVB O.BOT(R5),R1 ; Set the bottom line number. 643 001614 004737 000000G CALL MAKCOL ; Now make the column number. 644 001620 112760 000162 177777 MOVB #'r,-1(R0) ; Convert to set scroll region. 645 001626 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 19 CPYWID - Copy the screen width. 647 .SBTTL CPYWID - Copy the screen width. 648 ;+ 649 ; 650 ; CPYWID - Copy the screen width. 651 ; 652 ; This routine is used to change the terminal width to either narrow 653 ; or wide. 654 ; 655 ; Inputs: 656 ; R0 = The output buffer address (entry at CPYWID). 657 ; 658 ; Outputs: 659 ; R0 = The updated output buffer address (entry at CPYWID). 660 ; 661 ; All other registers are preserved. 662 ; 663 ;- 664 001630 004237 000000G WRTWID::JSR R2,$SAVVR ; Save R0 - R2. 665 001634 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 666 001640 004737 001650' CALL CPYWID ; Copy the current screen width. 667 001644 000137 002224' JMP VTYPE ; Write it to the terminal. 668 669 001650 004537 000000G CPYWID::JSR R5,.SAVR1 ; Save R1 - R5. 670 001654 032737 000000G 000000G BIT #B.132,STATUS ; Are we in wide screen mode ? 671 001662 001003 BNE 10$ ; If NE, yes. 672 001664 004737 000000G CALL NARROW ; No, set to a narrow screen. 673 001670 000402 BR 100$ ; Use common return ... 674 001672 004737 000000G 10$: CALL WIDE ; Set to a wide screen. 675 676 001676 000207 100$: RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 20 CPYACT - Copy the active message. 678 .SBTTL CPYACT - Copy the active message. 679 ;+ 680 ; 681 ; CLRACT - Clear the active message. 682 ; WRTACT - Write the active message. 683 ; 684 ; This routine is used to clear or write the active message on the file 685 ; name line when we're displaying two files. 686 ; 687 ; Implicit inputs: 688 ; O.FLIN = The file name line number. 689 ; 690 ; Outputs: 691 ; All registers are preserved. 692 ; 693 ;- 694 .ENABL LSB 695 696 001700 004737 000000G CLRACT::CALL $SAVAL ; Save all registers. 697 001704 004737 001776' CALL 50$ ; Do the initial processing. 698 001710 103444 BCS 100$ ; If CS, don't write anything. 699 001712 004737 000000G CALL CEOL ; Clear to the end of line. 700 001716 000137 002224' JMP VTYPE ; Display it at the terminal. 701 702 001722 004737 000000G WRTACT::CALL $SAVAL ; Save all registers. 703 001726 004737 001776' CALL 50$ ; Do the initial processing. 704 001732 103416 BCS 30$ ; If CS, show file on message line. 705 001734 004737 000000G CALL REVERSE ; Turn on reverse video attribute. 706 001740 004737 000000G CALL BOLD ; Add the bold attribute also. 707 001744 012701 000000' MOV #ACTM,R1 ; Set the active message address. 708 001750 004737 000000G CALL MOVEC ; Copy it to the output buffer. 709 001754 004737 000000G CALL ATTOFF ; Turn off the video attributes. 710 001760 004737 000752' CALL CPYTOP ; Set to top of the display window. 711 001764 000137 002224' JMP VTYPE ; Display it at the terminal. 712 713 001770 30$: 714 ;*** CALL SHOFIL ; Show file name on message line. 715 001770 004737 000726' CALL WRTTOP ; Set to top of the display window. 716 001774 000412 BR 100$ ; Use common return ... 717 718 ; Subroutine to do common code. 719 720 001776 013705 000000G 50$: MOV IENTRY,R5 ; Copy the file entry address. 721 ;*** BIT #B.2FIL,STATUS ; Are we displaying two files ? 722 ;*** BNE 60$ ; If NE, yes (continue ...) 723 002002 005726 TST (SP)+ ; No, remove the return address. 724 002004 000207 RETURN ; To dismiss the action message. 725 726 002006 000261 60$: SEC ; Presume message is disabled. 727 ;*** BIT #S.RULR,(R5) ; Using ruler in place of name ? 728 ;*** BNE 100$ ; If NE, yes (don't write message). 729 ;*** BIT #S.NAME,(R5) ; Is file name display disabled ? 730 ;*** BEQ 100$ ; If EQ, yes. 731 002010 012700 000000G MOV #FMTBUF,R0 ; Set the output buffer address. 732 002014 004737 002024' CALL CPYACT ; Set to the active position. 733 002020 000241 CLC ; Show we should write message. 734 AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 20-1 CPYACT - Copy the active message. 735 002022 000207 100$: RETURN 736 737 .DSABL LSB 738 739 002024 004537 000000G CPYACT: JSR R5,.SAVR1 ; Save R1 - R5. 740 002030 016501 000000G MOV O.FLIN(R5),R1 ; Copy the top line number. 741 002034 004737 000000G CALL MAKLIN ; Make the ASCII line number. 742 002040 012701 000112 MOV #<80.-ACTS>,R1 ; Presume on a narrow screen. 743 002044 032737 000000G 000000G BIT #B.132,STATUS ; Did we presume right ? 744 002052 001402 BEQ 10$ ; If EQ, yes. 745 002054 012701 000074 MOV #<<132./2>-ACTS>,R1 ; Else, set for a wide screen. 746 002060 004737 000000G 10$: CALL MAKCOL ; Now make the column number. 747 002064 000207 RETURN AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 21 WRTWRK - Display the working message. 749 .SBTTL WRTWRK - Display the working message. 750 ;+ 751 ; 752 ; WRTWRK - Display the working message. 753 ; 754 ; This is routine is called after the timer expires to display the 755 ; working message on the screen. 756 ; 757 ; Inputs: 758 ; None. 759 ; 760 ; Ouputs: 761 ; All registers are preserved. 762 ; 763 ;- 764 002066 004237 000000G WRTWRK::JSR R2,$SAVVR ; Save R0 - R2. 765 002072 012700 000000G MOV #FMTBUF,R0 ; Set address of format buffer. 766 002076 012701 000027 MOV #MSLINE,R1 ; Presume VT100 with AVO. 767 002102 032737 000000G 000000G BIT #B.132,STATUS ; VT100 in 132 column mode ? 768 002110 001406 BEQ 10$ ; If EQ, no (80 column mode). 769 002112 032737 000000G 000000G BIT #B.AVO,SWMASK ; VT100 with advanced video ? 770 002120 001002 BNE 10$ ; If NE, yes. 771 002122 162701 000012 SUB #LNBIAS,R1 ; No, adjust the message line. 772 773 ; Allow field width of 6 for the record number. 774 775 002126 004737 000000G 10$: CALL MAKLIN ; Make the ASCII line number. 776 002132 012701 000033 MOV #<<80.-WORKS>-6>/2,R1 ; Presume we're on narrow screen. 777 002136 032737 000000G 000000G BIT #B.132,STATUS ; Did we presume right ? 778 002144 001402 BEQ 20$ ; If EQ, yes. 779 002146 062701 000032 ADD #<132.-80.>/2,R1 ; No, adjust for a wide screen. 780 002152 004737 000000G 20$: CALL MAKCOL ; Make the ASCII column number. 781 002156 004737 000000G CALL CEOL ; Clear to end of the line. 782 002162 004737 000000G CALL REVERSE ; Add the reverse video attribute. 783 002166 012701 000007' MOV #WORKM,R1 ; Set address of "Working" message. 784 002172 004737 000000G CALL MOVEC ; Copy it to the output buffer. 785 002176 013701 000000G MOV IENTRY,R1 ; Copy the file entry address. 786 ;*** ADD #O.CREC,R1 ; Point to current record number. 787 ;*** CALL CVTDTD ; Convert it to decimal ASCII. 788 002202 004737 000000G CALL ATTOFF ; Turn off the attributes. 789 002206 000406 BR VTYPE ; Now go display the message. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 22 CLRTTY - Clear the VT100 screen. 791 .SBTTL CLRTTY - Clear the VT100 screen. 792 ;+ 793 ; 794 ; CLRTTY - Clear the VT100 screen. 795 ; 796 ; Inputs: 797 ; None. 798 ; 799 ; Outputs: 800 ; All registers are preserved. 801 ; 802 ;- 803 002210 004237 000000G CLRTTY::JSR R2,$SAVVR ; Save R0 - R2. 804 002214 012700 000000G MOV #FMTBUF,R0 ; Store the message here. 805 002220 004737 000000G CALL CLRSCR ; Clear the entire screen. 806 ;*** BR VTYPE ; Write it to the terminal. AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 23 VTYPE - Write the format buffer. 808 .SBTTL VTYPE - Write the format buffer. 809 ;+ 810 ; 811 ; VTYPE - Write the format buffer to the terminal. 812 ; 813 ; Inputs: 814 ; R0 = The updated output buffer address. 815 ; 816 ; Outputs: 817 ; R0 = The starting output buffer address. 818 ; 819 ; All other registers are preserved. 820 ; 821 ;- 822 002224 004537 000000G VTYPE:: JSR R5,.SAVR1 ; Save R1 - R5. 823 002230 010001 MOV R0,R1 ; Copy the buffer address. 824 002232 162701 000000G SUB #FMTBUF,R1 ; Calculate the byte count. 825 002236 012700 000000G MOV #FMTBUF,R0 ; Setup the starting address. 826 002242 004737 000000G CALL WRITIT ; And go write it. 827 002246 000207 RETURN 828 829 000001 .END AUXSCR - VT100 Screen Formattin MACRO V05.02 Thursday 11-Sep-86 18:44 Page 23-1 Symbol table ACTM 000000R COPYPR 000412RG HOURS = 000004 PREHDR 001330RG TOLUN = 000005 ACTS = 000006 CPYACT 002024R HT = 000011 PRESPN 001460RG TYPMSG 000224RG ADDBEL= ****** GX CPYBLA 000706RG IENTRY= ****** GX PRLINE= 000030 USSET = ****** GX AFTSPN 001520RG CPYMSG 000252RG IFILE1= ****** GX PRMSG 000360R VT = 000013 APPKEY= ****** GX CPYNAM 001216RG INEFN = 000001 PRMSGL= 000006 VTYPE 002224RG ATTOFF= ****** GX CPYPRL 000532RG INLUN = 000001 RESTC = ****** GX WIDE = ****** GX BELL = 000007 CPYSCR 001570RG INPSIZ= 000200 REVERS= ****** GX WORKM 000007R BOLD = ****** GX CPYTOP 000752RG LF = 000012 RINDEX= ****** GX WORKS = 000023 BS = 000010 CPYWID 001650RG LNBIAS= 000012 SAVEC = ****** GX WRITIT= ****** GX B.AVO = ****** GX CR = 000015 MAKCOL= ****** GX SCRDWN 001000RG WRITPR 000366RG B.MSG = ****** GX CTRLC = 000003 MAKLIN= ****** GX SECNDS= 000002 WRTACT 001722RG B.132 = ****** GX CTRLU = 000025 MINUTE= 000003 SETMSG 000062RG WRTBLA 000672RG CBOS = ****** GX CTRLZ = 000032 MOVEC = ****** GX SETNAR 001042RG WRTEOF 001102RG CEOL = ****** GX C.BACK= 000002 MOVEF = ****** GX SETPRL 000470RG WRTHDR 001126RG CEOS = ****** GX C.BUFF= 000004 MRKEFN= 000010 SETWID 001062RG WRTMSG 000130RG CLRACT 001700RG C.FORW= 000000 MSLINE= 000027 SET2MS 000100RG WRTNAM 001172RG CLRMSG 000034RG DATSIZ= 000040 NARROW= ****** GX SGRAPH= ****** GX WRTPRL 000502RG CLRPRL 000450RG DEL = 000177 NULL = 000000 SPACE = 000040 WRTSCR 001544RG CLRSCR= ****** GX DWIDTH= ****** GX NUMKEY= ****** GX SPNEFN= 000011 WRTTOP 000726RG CLRTTY 002210RG ERRSIZ= 000120 NXTPAG 000616RG STATUS= ****** GX WRTWID 001630RG CLRWIN 000330RG ESC = 000033 O.BOT = ****** GX SWMASK= ****** GX WRTWRK 002066RG CMDHDR= 000004 FF = 000014 O.FDAT= ****** GX TICKS = 000001 WRT2MS 000152RG CMDMAX= 000024 FMTBUF= ****** GX O.FLIN= ****** GX TIEFN = 000004 WRT4MS 000164RG CMDPAD= 000002 FMTSIZ= 001000 O.FNAM= ****** GX TILUN = 000004 $SAVAL= ****** GX CMDSIZ= 000120 HOME = ****** GX O.TOP = ****** GX TMPSIZ= 000031 $SAVVR= ****** GX COMMA = 000054 HORLIN= 000161 POSPRL 000544RG TOEFN = 000005 .SAVR1= ****** GX . ABS. 000000 000 (RW,I,GBL,ABS,OVR) 002250 001 (RW,I,LCL,REL,CON) Errors detected: 0 *** Assembler statistics Work file reads: 0 Work file writes: 0 Size of work file: 8207 Words ( 33 Pages) Size of core pool: 12758 Words ( 49 Pages) Operating system: IAS Elapsed time: 00:00:25.41 AUXSCR,AUXSCR/-SP=AUXPRE/PA:1,AUXSCR