v.doc vers. 0.6 4/12/90 Bridger Mitchell (Plu*Perfect Systems) V -- quad-directional Z-System file viewer V now supports multiple files, with usage: V filespec1 ... filespecN A filespec is an ambiguous filename and type, preceded by an optional DU: or DIR: specification. Some valid filespecs are: *.DOC WORK:MENU??.TXT A15:*.* FOO.BAR V maintains a ring of all matching files. ^X will move to the next file; ^R moves back to the previous file. ^C exits the program. Because the ring is virtual, V should work on any size disk, regardless of the number of directory entries. (These and all other control commands may be rebound; see below). A list of excluded filespecs is tested; files such as COM, REL, LBR, !!!TIME&.DAT, etc. will be skipped automatically. You can extend this table by patching near the start of V. V uses an in-memory cache to make the most recently read sectors of a file available for re-viewing without additional disk reads. This allows reverse viewing of crunched files, up to the limit of available memory. If, when going in reverse, the cache is exhausted, V will automatically restart the uncrunching process from the beginning of the file and display the first lines. Viewing of adjacent lines/screens is rapid for both ascii and crunched files. Going to the End is also quick in ascii, but results in some delay uncrunching a large file -- the entire file must be uncrunched first. TERMCAP requirements The termcap requirement is the addition of three strings to the standard Z-System termcap. These definitions are already setup in files of type ".NZT" (New Z-System Termcap), available on major Z-Nodes. If your terminal isn't already there, you can add definitions following the initialization and deinitialization strings. NOTE: This uses the STANDARD termcap specification (not the one in experimental use in early 1989 by J. W. Wright). Here's an example for the Wyse-50. DEFB 'TERMINALNAME' ; 13 bytes db 0 ; reserved [ ... next part of termcap omitted...] DEFB ESC,')',0 ; SO - Standout on string DEFB ESC,'(',0 ; SE - Standout end string DEFB 0 ; TI - Terminal init string DEFB 0 ; TE - Terminal de-init string ; ; 3 extensions to standard TCAP follow immediately after "TE" ; DEFB ESC,'R',0 ; DL - Line Delete DEFB ESC,'E',0 ; IL - Line Insert DEFB ESC,'Y',0 ; CD - Clear to End of Screen String ; ; ... the rest of the termcap ... CONFIGURATION You can change the keys that control V by assembling a modified version of the code below and ; ; offsets from 100h for configuration areas ; CONFIGBUF equ 20h HELPBUF equ 80h EXCLUDEBUF equ 200h SPACE equ 20h TAB equ 09h CR equ 0dh LF equ 0ah ; 1. These are the bindings that control the V screen. In addition ; to the one to three keys for each command, V automatically ; picks up the cursor-control keys ("arrow" keys) from the ; Z-System tcap and uses them, in addition to the bindings in ; these tables. ; ; 2. To change the bindings, set the equates for your preferences, ; reassemble this file to HEX, and overlay onto V.COM. ; ; 3. Enter exactly 3 bytes for each binding. Use uppercase for all ; keys. V automatically converts a typed lower case key to upper case. ; Use a nul to indicate the absence of a binding. ; ; 4. Edit the help screen to match your choice of bindings. ; K_up1 equ ',' K_up2 equ 'P'-'@' K_up3 equ 0 ; and, automatically, Z3TCP's left arrow key ; k_pgup1 equ '<' K_pgup2 equ TAB K_pgup3 equ 'Z'-'@' ; and, automatically, Z3TCP's left arrow key K_dn1 equ '.' K_dn2 equ SPACE K_dn3 equ 'N'-'@' ; and, automatically, Z3TCP's up arrow key K_pgdn1 equ '>' K_pgdn2 equ CR K_pgdn3 equ 'V'-'@' ; and, automatically, Z3TCP's down arrow key ; K_left1 equ 'L' K_left2 equ 'A'-'@' K_left3 equ 0 ; K_rt1 equ 'R' K_rt2 equ 'E'-'@' K_rt3 equ 0 ; K_beg1 equ 'B' K_beg2 equ 0 K_beg3 equ 0 ; K_end1 equ 'E' K_end2 equ 0 K_end3 equ 0 ; K_goto1 equ 'G' K_goto2 equ 'S' K_goto3 equ 0 ; K_nxtf1 equ 'X'-'@' K_nxtf2 equ 0 K_nxtf3 equ 0 ; K_prvf1 equ 'R'-'@' K_prvf2 equ 0 K_prvf3 equ 0 ; K_exit1 equ 'C'-'@' K_exit2 equ 0 K_exit3 equ 0 ; ; subttl '---------- KEY BINDINGS ----------' ; ; Each V function has three possible key values. ; V ignores case. ; If you use fewer than three keys, use nulls for the remainder. ; ;; org CONFIGBUF ; beginconfig: ; db '__UP:' k.up: db K_up1,K_up2,K_up3 ; Scroll one line up ; db 'PGUP:' k.pgup:db K_pgup1,K_pgup2,K_pgup3 ; Scroll one page (screen) up ; db '__DN:' k.down: db K_dn1,K_dn2,K_dn3 ; Scroll one line down ; db 'PGDN:' k.pgdown:db K_pgdn1,K_pgdn2,K_pgdn3 ; Scroll one page (screen) down ; db 'LEFT:' k.left: db K_left1,K_left2,K_left3 ; Scroll to left ; db 'RGHT:' k.right:db K_rt1,K_rt2,K_rt3 ; Scroll to right ; db 'BEGN:' k.begin:db K_beg1,K_beg2,K_beg3 ; Display beginning of file ; db '_END:' k.end: db K_end1,K_end2,K_end3 ; Display end of file ; db 'GOTO:' k.goto: db K_goto1,K_goto2,K_goto3 ; Goto (search) for string ; db 'NXTF:' k.nextfile:db K_nxtf1,K_nxtf2,K_nxtf3 ; View next file ; db 'PRVF:' k.prevfile:db K_prvf1,K_prvf2,K_prvf3 ; View previous file ; db 'EXIT:' k.exit:db K_exit1,K_exit2,K_exit3 ; Exit from V. ; configlen equ $-beginconfig ; test0 equ HELPBUF-CONFIGBUF-configlen ds HELPBUF-CONFIGBUF-configlen subttl '---------- HELP AND USAGE ----------' ; ;; org HELPBUF ; ; Edit the message to correspond to the key bindings. ; helpmessage: ; db 'V commands (in addition to Z-System arrow keys):',cr,lf db lf db '1 line down . SP ^N 1 line up , ^P',cr,lf db '1 page down > CR ^V 1 page up < ^Z',cr,lf db 'n pages digit n pages digit',cr,lf db lf db 'right R left L',cr,lf db 'beginning B end E',cr,lf db 'next file ^X prev. file ^R',cr,lf db 'goto/search G exit ^C',cr,lf db 0 ; helpmsglen equ $-helpmessage ;!!! ERROR -- help message is too long. test2 equ EXCLUDEBUF-HELPBUF-helpmsglen ds EXCLUDEBUF-HELPBUF-helpmsglen ; subttl '---------- FILE EXCLUSION LIST ----------' ; ; exclude_cnt: db ??excnt ;; number of items in list exclude_tbl: ; ruler: '--11 bytes-' db '!!!TIME&DAT' db '????????SWP' db '????????BIN' db '????????C?M' db '????????R?L' db '????????Z?L' db '?????????Y?' db '????????LBR' db '????????BSX' db '????????RSX' rept 5*11 ;; space for more db 0FFh ;; list terminator endm ??excnt equ ($-exclude_tbl)/11 db 0 ; ; end vkeys.lib