home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Computerspiele Selbermachen
/
computerspieleselbermachen.iso
/
pv3d
/
list.asm
< prev
next >
Wrap
Assembly Source File
|
1993-06-13
|
37KB
|
1,043 lines
Page 80,132
Title LIST --- Display contents of ASCII file
Comment |
Command LIST
----------------
Purpose: To display the contents of an ASCII file, line by
line, with operator positioning commands.
Format: LIST [d:][path]filename[.ext]
Remarks: An ASCII file of any size may be listed.
On the COMMAND line, enter a letter or control key:-
Letter(s) Control key Function
----------- ------------ ------------------------
Enter continue to next page
Q, X ESCape terminate and exit to DOS
T HOME restart from first block (top)
B END skip to end of file (bottom)
D PgDn scroll down one page
U PgUp scroll up one page
H or ? F1 list commands (HELP)
L left arrow scroll left 20 columns
R right arrow scroll right 20 columns
P up arrow up one (previous) line
N down arrow down one (next) line
/text find 'text'
A F3 find next occurance of 'text'
ctl-HOME restart from CURRENT block
ctl-PgUp restart from first block (TOP)
ctl-PgDn skip to end of file (BOTTOM)
ctl-left-arrow reset scroll to column 1
F1 Help
F3 Find next
F10 Exit
ALT S Strip/Don't strip MSBit -DS
ALT C Display/Don't display chars 0-31 -DS
Restrictions:
All positioning is relative to the current block in
storage. The size of the block depends on the amount of
memory available, up to 64K.
The maximum record length currently allowed is 255.
Logical records (ending in LF and/or CR) are placed
into the DOS screen buffer - mono or color display.
(patched, prior version didn't accept records ending in CR only) -DS
PC-DOS Version 2.0 or later is required.
ANSI.SYS is NOT required.
Scanning for text:
To scan for a character string, type a slash (/)
followed by one or more (up to 32) characters. The
scan text, but not the slash, is displayed on the
command line. The entire file, from the current line,
is scanned.
If the text is found, the line containing it is displayed
as a blinking line.
If the text is NOT found, an error message is displayed
and the display remains unchanged.
Screen attributes:
There are three classes of attributes used. One for
normal display lines - lines 2 to 24, another for
special lines - lines 1 and 25, and a third for the
background color.
These attributes may be changed by using DEBUG:
at offset 11C = 09 ;special lines, hi-lighted or lt.blue
at offset 11D = 02 ;normal lines, green
at offset 11E = 00 ;background, black
If these values don't match, you have a different version.
----------------------------------------------------------
Written by Vernon Buerg for the IBM PC using DOS 2.0,
and is supplied for public domain use. Not for sale or hire.
Commands ALT S and ALT C added by David Schwartz, Jan. 1985 -DS
Force ASCII 8 BIT by Default By Lecointe Ludovic Juin 1993 -LL
Change: non-displayed control characters no longer occupy a -DS
screen display space. -DS
Version 6.0, Jan. 23, 1985 ( Version 1.5, June 2, 1984) -DS
|
Page
Bios Segment At 40h ;DOS data area
Db 16 Dup (?)
Flag Dw ? ;Hardware features
Db 56 Dup (?)
Cols Dw ? ;Columns on screen
Db 23 Dup (?)
A6845 Dw ? ;Base addr for active card
Bios Ends
Cseg Segment Para Public 'CODE'
Assume CS:Cseg,DS:Cseg,ES:Nothing
Org 100h
List Proc Far
Mov DX,Offset Stackx ;Local stack
Mov SP,DX
Push DS ;Standard linkage
Xor AX,AX ; for DOS return
Push AX
Mov AH,30h ;Check for
Int 21h ; DOS 2.0 or later
Cmp AL,2
Jb TooBad
Jmp Start
TooBad: Mov DX,Offset Sorry ;Say Version 2 required
Mov AH,9
Int 21h
Ret
Page
; Constants and work areas
Special Db 09h ;Attribute for attention
Normal Db 02h ;Normal display attribute
Foregrd Db 07h ;Fill attribute
Blink Equ 0Fh ;Hilite for FIND (143h blinks)
CR Equ 0Dh
LF Equ 0Ah
EOF Equ 1Ah
Eor Equ 1 ;End-of-record
Nodata Equ 2 ;null record
Crt_Col Dw 0 ;Columns for display monitor
Crt_Buf Dw 0 ;Addr of display buffer
Crt_Prt Dw 0 ;Addr of display port
Index Dw 0 ;Current record address
Reclen Dw 0 ; length
Row Db 2 ; display row
Col Db 1 ; display column
Attr Db 02h ; screen attribute
Blknum Db 0 ; block number
Scroll Dw 0 ;Scroll left/right amount
First Dw 0 ;Ptr to top line on screen
Current Dw 0 ;Ptr to top after UP one
Last Dw 0 ;Ptr to last record
Recaddr Dw 0 ;addr of i/o buffer
Handle Dw 0 ;File handle from open
Psize Dw 16 ;Size of a paragraph
Blksize Dw 0 ;File read size
Switch1 Db 0
Switch2 Db 0
Numlf Db 1 ;line feed count
Numcr Db 0 ;C/R count
;char_msk db 07fh ; character mask (7Fh or FFh) -DS
char_msk db 0ffh ; character mask (7Fh or FFh) -LL
min_disp db ' ' ;lowest ord char to display(0 or ' ')-DS
TextMax Db 32 ;Keyboard buffer
TextLen Db 0
TextBuf Db 32 Dup (0) ;Scan text
Prompt Db 'Command:'
Spaces Db 32 Dup (32) ;Scan text entered
Db 'Keys: PgUp PgDn Arrows ESC=exit ?=Help '
Pr_Len Equ This Byte - Prompt
TextMsg Db '*** Text not found ***'
EofMsg Db ' *** End-of-file ***'
EofLen Equ This Byte - EofMsg
Work Db 'LIST ' ;current logical record -DS
Keyin Db 64 ;keyboard buffer size
Keyout Db 0 ; and length read
Filenm Db 76 Dup (0) ;d:path\filename.ext
Askfile Db 13,10,'Enter filename: $'
Openmsg Db ' Open failed, return code='
Opencod Dw '00'
Db '$'
Code2 Db 'File not found $'
Code3 Db 'Path not found $'
Code4 Db 'Too many files $'
Code5 Db 'Access denied $'
Sorry Db Cr,Lf,'Sorry, DOS 2.0 or later required',Cr,Lf,'$'
Org offset Work+256
Workx Equ $-Work
Stack Db 6