Tandy 1000 DOS 2x 3x PDF
Tandy 1000 DOS 2x 3x PDF
Tandy 1000 DOS 2x 3x PDF
•
TERMS AND CONDITIONS OF SALE AND LICENSE OF TANDY COMPUTER EQUIPMENT AND
SOFTWARE PURCHASED FROM RADIO SHACK COMPANY-OWNED COMPUTER CENTERS. RETAIL
STORES AND RADIO SHACK FRANCHISEES OR DEALERS AT THEIR AUTHORIZED LOCATIONS
LIMITED WARRANTY
CUSTOMER OBLIGATIONS
A CUSTOMER assumes full responsibility that this computer hardware purchased (the Equipment) and any
copies of software Included with the Equipment or licensed separately (the 'Software) meefs fhe spec,t,cat,ons
capacity. capab",tles versatll:ty. and other requllements at CUSTOMER
CUSTOMER assumes full responsibility for the condition and effecf,veness of the operatmg environment 10 which
the Equipment and Software are to function. and for ItS msfallatlon
II. LIMITED WARRANTIES AND CONDITIONS OF SALE
A For a pellod of nmety (90) calendar days froID the date of the Radio Shack sales document received upon
purchase of the Equipment RADIO SHACK warrants to the ollglnal CUSTOMER that fhe Equipment and the
medium upon which fhe Software IS stored IS tree from manufactullng defects. This warranty is only applicable
to purchases of Tandy Equipment by the original customer from Radio Shack company-owned computer
centers. retail stores, and Radio Shack franchisees and dealers at their authorized locations. The warranty IS
vOid It the Equipment or Software has been sublected to Improper or abnormal If a manulactullng defect IS
discovered dUling the stated warranty pellod the defective Equlpmenl must returned to a Radio Shack
Computer Center. a Radio Shack retarl store. a partlClpatmg Radio Shack tranchlSee or a partlClpatmg Radio Shack
dealer for repall along with a copy of the sales document or lease agreement The oliglOal CUSTOMERS sale and
excluSive remedy In the event of a defect IS limited to the correction of the delect by repall replacement or
refund of the purchase pllce at RADIO SHACKS elecflon and sale expense RADIO SHACK has no obligation to
replace or repair expendable Items
RADIO SHACK makes no warranty as to the design capability. capacity or sUitability lor use of the Software
except as provided 10 thIS paragraph Software IS licensed on an AS IS baSis. wllhout warranty The ollglnar
CUSTOMERS excluSive remedy 10 the event of a Soltware manufactullng defect IS ItS repall or replacement
wlthm thllty (30) calendar days of the date of the Radio Shack sales document received upon license of the
Software. The defectIVe Software shall be returned to a Radio Shack Computer Center. a Radio Shack retarl store
a partlclpatiOg Radio Shack franchISee or Radio Shack dealer along with the sales document
Except as provided herem no employee. agent. franchisee, dealer or other person IS authorIZed to give any
warranties of any nature on behalf of RADIO SHACK
EXCEPT AS PROVIDED HEREIN. RADIO SHACK MAKES NO EXPRESS WARRANTIES. AND ANY tMPLIED
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE IS LIMITED IN ITS DURATION
TO THE DURATION OF THE WRITIEN LIMITED WARRANTIES SET FORTH HEREIN.
Some states do not allow l'm!lallons on how long an Implied warranty lasts. so the above Ilmltatlon(s) may not
apply to CUSTOMER
III. LIMITATION OF LIABILITY
A EXCEPT AS PROVIDED HEREIN. RADIO SHACK SHALL HAVE NO LIABILITY OR RESPONSIBILITY TO CUSTOMER
DR ANY OTHER PERSON OR ENTITY WITH RESPECT TO ANY LIABILITY, LOSS OR DAMAGE CAUSED OR
ALLEGED TO BE CAUSED DIRECTLY OR INDIRECTLY BY "EQUIPMENT" OR "SOFTWARE" SOLD, LEASED.
LICENSED DR FURNISHED BY RADIO SHACK. INCLUDING, BUT NOT LIMITED TO, ANY INTERRUPTION OF
SERVICE, LOSS OF BUSINESS DR ANTICIPATORY PROFITS OR CONSEQUENTIAL DAMAGES RESULTING FROM
THE USE DR OPERATION OF THE "EQUIPMENT" OR "SOFTWARE." IN NO EVENT SHALL RADIO SHACK BE
LIABLE FOR LOSS OF PROFITS. DR ANY INDIRECT, SPECIAL. OR CONSEQUENTIAL DAMAGES ARISING OUT OF
ANY BREACH OF THIS WARRANTY DR IN ANY MANNER ARISING OUT OF OR CONNECTED WITH THE SALE.
LEASE. LICENSE, USE DR ANTICIPATED USE OF THE "EQUIPMENT" OR "SOFTWARE."
NOTWITHSTANDING THE ABOVE LIMITATIONS AND WARRANTIES, RADIO SHACK'S LIABILITY HEREUNDER FOR
DAMAGES INCURRED BY CUSTOMER OR OTHERS SHALL NOT EXCEED THE AMOUNT PAID BY CUSTOMER FOR
THE PARTICULAR "EQUIPMENT" OR "SOFTWARE" INVOLVED.
RADIO SHACK shall not be lrable for any damages caused by delay 10 dellvellng or furnIShing Equlpmenf and or
Software
No action allSing out of any clarmed breach of IhlS Warranfy or transactions under this Warranty may be brought
more than two (2) years after the cause 01 action has accrued or more than four (4) years after the date of the
Radio Shack sales document lor the EqUipment or Software whichever fllst occurs
Some states do not allow the limitation or exclUSion of Incidental or consequentral damages so the above
Ilmltatlon(s) or excluslon(s) may not apply to CUSTDMER
IV. SOFTWARE LICENSE
RADIO SHACK granfs to CUSTOMER a non-exclUSive. paid-up license to use the TANDY Software on one computer
subject to the follOWing proVIsions
A Except as otherwISe proVided 10 thiS Sottware License. applicable copyllghl laws shall apply to the Software
B Title to the medium on which the Software IS recorded (cassefte and or dISkette) or stored (ROM) IS transterred to
CUSTOMER. but not title to the Sottware
CUSTOMER may use Software on a multiuser or network system only If either. the Software IS expressly labeled
to be for use on a mulfluser or network sysfern or one copy of thIS software IS purchased lor each node or
terminal on which Software IS to be used SimUltaneously
CUSTOMER shall not use. make. manulacfure. or reproduce copies of Software except tor use on one computer
and as IS specifically proVided 10 thIS Software license Customer IS expressly prohlb!ted tram dlSassembllOg the
Software
CUSTOMER IS permlfted to make additional copies of the Software only for backup or archival purposes or If
additional copies are reqUired In the operation of one computer With the Software. but only to the exfent the
Software allows a backup copy to be made. However. for TRSDDS Software. CUSTOMER IS permlfted to make a
limited number of additional copies for CUSTDMERS own use
CUSTOMER may resell or dlStlibute unmodified copies of the Software provided CUSTDMER has purchased one
copy 01 the Software lor each one sold or dlStlibuted. The provISions of thIS Software license shall also be
applicable to third parties recelvlOg copies at the Software tram CUSTOMER
G. All copyllght notices shall be retarned on all copies of the Software
V. APPLICABILITY OF WARRANTY
A The terms and conditions of thIS Warranty are applicable as between RADID SHACK and CUSTOMER to either a
sale of fhe Equlpmenf and or Software license to CUSTOMER or fa a transaction whereby Radio Shack sells or
conveys such EqUipment to a thlld party for lease to CUSTOMER
The Ilmlfaflons at lrabilify and Warranty prOVISions herein shall mure to the benefit of RADIO SHACK. the author.
owner and or licensor of the Software and any manufacturer of the EqUipment sold by Radio Shack
VI. STATE LAW RIGHTS
The warranties granted herein give the original CUSTOMER specific legal rights. and the original CUSTOMER may
have other lights which vary from state to sfate 686
TANDY 1000
MS-DOS
REFERENCE
MANUAL
Tandy 1000 EX/SX BIOS Compatibility Software: © 1984,
1985, 1986 Tandy Corporation and Phoenix Software
Associates, Ltd. All Rights Reserved.
10 9 8 7 6 5 4 3 2
ABOUT THIS MANUAL
Part 1. Introduction
1 How to Use MS-DOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Entering a Command. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Executing a Program. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Editing and Special Keys 1
The Control Keys. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Organization of Information 5
The File System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
The Root Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Filenames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Extensions 6
Examples of Filenames . . . . . . . . . . . . . . . . . . . . . . . . . 7
Wild Cards 8
Pathnames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Device Names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Directories 9
Creating Directories , 12
Deleting Directories 13
The Current Drive 14
The Current Directory , 14
Home Directories , 16
Anonymous Directory Names , 17
3 Redirecting Commands............................ 19
Input And Output , 19
Filters 20
Command Piping , 20
4 Batch Files , 21
Executing Several Commands. . . . . . . . . . . . . . . . . . . . . .. 21
The Batch File , 21
Executing a Batch File 22
Summary of the Batch File Process , 23
The Autoexec.bat File. . . . . . . . . . . . . . . . . . . . . . . . .. 24
Batch Files With Replaceable Parameters. . . . . . .. 24
Creating a Batch File With Replaceable
Parameters 25
Executing a Batch File With Replaceable
Parameters 25
Sample Use of Replaceable Parameters. . . . . . . . . .. 26
Reminders about Batch Files , 27
III
Contents
iv
Contents
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Index 351
v
Chapter 1
Entering a Command
You can enter a command whenever the screen displays the sys-
tem prompt. The command may have a maximum of 127 charac-
ters, including any combination of uppercase or lowercase letters.
End each command by pressing [ENTER I. For example, type:
cIs [ENTER I
and MS-DOS executes the CLS command, which clears the
screen and displays the system prompt.
Executing a Program
You can also execute a program (such as the BASIC language
application supplied on your system diskette) at the system
prompt. If an entry is not a recognized command, MS-DOS com-
pares it with the program names in the current directory. If it
finds a match, MS-DOS loads and runs the program. Otherwise,
the screen displays an error message. For example, type:
bas i c I ENTER 1
to load BASIC.
1
Chapter 1 / How to Use MS-DOS
_
-_._-------------_.. .._ - - - - - - - - - -
2
Chapter 1 / How to Use MS-DOS
Keys Function
I CTRL I CIJ stops execution of a command.
I SHIFT I I PRINT I sends everything currently displayed on the
screen to the line printer.
I PRINT I, I CTRL I 1]], sends all output to the line printer, as well as
or [CTRL I [[) to the screen. Press again to stop the function.
I BACKSPACE I or removes the last character from the command
[ CTRL I [[] line and erases the character from the screen.
I CTRL I QJ causes a line end and carriage return but does
not send the line to be executed or processed.
You can continue to add to the command line
before pressing I ENTER I to terminate input.
I HOLD I or halts scrolling. Press I HOLD I or I CTRL I (]J to
[CTRL I []] resume scrolling.
(ESC I voids the current line and clears the command
line buffer. It then outputs a backslash (\),
carriage return, and line feed. The template, a
storage area that contains the last MS-DOS
command you used, is not affected. Although
the system prompt is not displayed, the system
is ready for a command.
3
Chapter 2
ORGANIZATION OF INFORMATION
ROOT (\)
rl- - - - r - I- - - - I - - - - , I - - - - - - r - - - . . "
USER PAYROLL ADS format.eom find.exe dlskeopy.eom
~
JAN MIKE
~
DEPT1 DEPT2
rh
tv radio news
MEMOS
r--1 job1
~ ~
a-m n-z a-m n-z
~
staff mgrs
5
Chapter 2 / Organization Of Infornwtion
Filenames
Each file has a name that can be a maximum of eight charac-
ters long. You can use letters, numbers and some symbols.
Allowable characters are:
• Uppercase letters: (A-Z)
• Lowercase letters: (a-z)
• Decimal digits: (0-9)
• Symbols: $ & # o/t:. ' ( ) - ((L ' { } , !
Do not include more than eight characters in a filename. MS-
DOS truncates the filename to the first eight characters. For
example, MS-DOS truncates both Accountsl and Accounts2 to
accounts. Because two files (that are in the same directory) can-
not have the same name, MS-DOS overwrites and destroys the
old file.
Extensions
You can use an extension to provide additional information on a
file. Always precede extensions with a period ( . ); they can be a
maximum of three characters long. Do not include more than
three characters. If you do, MS-DOS truncates the extension to
the first three characters.
6
Chapter 2 / Organization Of Information
Extensions such as .new, .irs, and .pay let you create files that
have the same name (but different extensions) or they can help
you divide files into categories.
You can also use an extension to indicate file type, such as the
following:
Examples of Filenames
Some legal filenames are:
rawdata2
REPORTS
X.x
proJect%.txt
PROG1 . ba5
SAMFILE
2AR.dat
The examples below are illegal filenames:
*' isn't a legal character for names
.DATA the period can be used only to separate the file-
name and extension
open ordr a name cannot contain a space
7
Chapter 2 / Organization Of Information
Wild Cards
MS-DOS lets you use these shorthand notations in filenames and
extensions:
? The question mark indicates that any character can
occupy that position.
* The asterisk indicates that any character can occupy
that position or the remaining positions in a filename
or extension.
Wild card examples and the results you can expect are given
below.
You type: MS-DOS finds: Examples:
test?run.exe All files in one directory that test1run.exe
begin with test, have any test3run.exe
character next, followed by
run with the extension .exe.
test*.exe The files above plus all files test.exe
in one directory that begin testall.exe
with test and have the test1.exe
extension .exe.
oldfile.* All files named oldfile (in one old f i 1 e . bas
directory), regardless of their old f i 1 e . ex e
extensions. old f i 1 e . txt
Pathnames
Because directories are organized in a multilevel fashion, MS-
DOS needs exact directions or pathnames to find files. A path-
name is a list of directories and filenames from the root direc-
tory down to the file you want to access. Each pathname can
have a maximum of 63 characters.
Refer to the previous MS-DOS disk diagram. To access the Radio
file, tell MS-DOS the path to follow from the root directory to
the file, separating the branches with backslashes. For instance,
to display the contents of the Radio file, type:
t y Pe \ ads \ r a d i 0 I ENTER I
8
Chapter 2 / Organization Of Information
Device Names
Each input/output device the system supports has a unique
name. The device names are as follows:
• AUX (auxiliary) usually refers to the RS-232 serial port
but can be any device you specify using the CTTY
command.
• CON (console) refers to the screen or keyboard.
• PRN (printer) refers to Printer 1.
• LPTl, LPT2, LPT3 (line printer) refer to Printer 1,
Printer 2, and Printer 3, respectively.
• COMl, COM2 (communications) refer to serial Port 1
and Port 2.
• NUL (null) refers to a non-existent device.
Note: You cannot use any of the device
names above as file names.
Directories
MS-DOS directories are collections of files. Look at the following
example to understand how they are created and used.
Assume that the disk in Drive B is newly formatted and con-
tains only a root directory. You can use EDLIN to create the test
file on Drive B. To do so, type:
e d 1 i n b: \ f i 1 e 1 . t 5 t I ENTER I
9
Chapter 2 / Organization Of Inforrrw,tion
After you type ill] I ENTER I, EDLIN displays the asterisk to indi-
cate it's ready for another command. To exit EDLIN and return
to MS-DOS, type:
e [ ENTER I
The screen displays the system prompt again. Use the DIR com-
mand, which lists the files in a directory:
d i r b: \ [ENTER J
10
Chapter 2 / Organization Of Information
11
Chapter 2 / Organization Of Information
Creating Directories
The MKDIR command creates a new directory on any drive. To
create a new directory called MYDIR in the Drive B root direc-
tory, type:
mkdi r b: \mydi r [ENTER I
MS-DOS automatically makes MYDIR a subdirectory of the
Drive B root directory. You can check it by using DIR:
di r b: \ [ENTER I
The screen shows:
Volume in drive B has no label
Directory of B:\
FILE1 TST 58 8-24-86 9: ~7a
12
Chapter 2 / Organization Of Infornwtion
Deleting Directories
Before deleting a directory, first remove all files in that direc-
tory. Follow these steps:
1. Use the DIR command to see what files are in the
directory.
2. Use the COPY command to copy any files you may need
to another directory.
3. Use the ERASE command to remove all files from the
directory.
4. Use the RMDIR command to remove (delete) the
directory.
If there are subdirectories in the directory you wish to delete,
follow the previously described procedure for deleting these
directories.
13
Chapter 2 / Organization Of Information
Changing the current drive. You can change the current drive
quickly. To do so, enter the drive specification at the system
prompt. For example, at A>, type:
b: [ENTER I
The screen shows a new system prompt, B>, to indicate you are
now in Drive B.
14
Chapter 2 / Organization Of Information
Notice that you should not precede this pathname with a back-
slash. That is because the pathname \MEMOS specifies a direc-
tory that does not exist-one that would be an immediate
subdirectory of the root directory.
If you are still in \ USER \ MIKE, you can specify a file in that
directory by giving only the filename. For example, if you type:
dir Job1
15
Chapter 2 / Organization Of Information
Home Directories
MS-DOS also remembers your previous current directory. If your
current directory is B: \ PAYROLL and then you change it to
A:USER \MIKE, MS-DOS remembers that you were using
B: \ PAYROLL. For your convenience, it makes \PAYROLL the
home directory of Drive B, until you change to another Drive B
directory.
Whenever you specify a file or directory within or below
B: \ PAYROLL, you need not include the directory name PAY-
ROLL. For example, suppose you are in Drive A. If you type:
type b:staff [ENTERI
16
Chapter 2 / Organization Of Information
17
Chapter 2 / Organization Of Information
18
Chapter 3
REDIRECTING COMMANDS
sorts the information in the file Names and displays the sorted
output.
To redirect the output of the DIR command so it goes to a file,
use a greater-than sign (» in your command. For example:
dir >myfiles [ENTERI
This command sorts the information in the file Names and sends
the sorted output to the file Listl in the current directory.
19
Chapter 3 / Redirecting Commands
Filters
A filter is a command that operates on data in some way before
outputting it-usually to the screen or a file. The MS-DOS fil-
ters and functions are:
• FIND - Searches for occurrences of a requested string
of text in a file.
• MORE - Causes screen output to be displayed, one
screen at a time. To view the next screen, press any key.
• SORT - Sorts text from A-Z or from Z-A (reverse sort).
Note: By combining commands and filters, you
can replace several commands with a few filters,
as described below.
Command Piping
Piping lets you give more than one command at a time to the
system. It does this by making one command's output another
command's input.
To pipe commands, divide them with the pipe separator, the ver-
tical bar ( I ). (You produce the vertical bar by pressing 4 on the
keypad when the [NUM LOCK I key is off or by pressing [SHIFT I 4 on
the keypad when the [NUM LOCK) key is on.) All output generated
by the command to the left of the bar becomes input for the com-
mand to the right.
For example, you can sort your directory listing. Type:
di r I 5 0 r t [ENTER I
to display an alphabetically sorted listing of the current direc-
tory. This command:
di r I so r t > d irE' C • f i 1 [ENTER I
sends the same listing to the file Direc.fil in the current direc-
tory. If the file does not exist, MS-DOS creates it.
di r b: I >b : d irE' C • f i 1 [ENTER I
makes an alphabetically sorted listing of the current directory of
Drive B and sends the listing to the file Direc.fil in the home
directory on Drive B. MS-DOS creates the file, if necessary.
20
Chapter 4
BATCH FILES
21
Chapter 4 / Batch Files
At this time, you can type d i r [ENTER I to verify that the file is
created.
REM and PAUSE. You use REM and PAUSE only in batch files.
The REM command lets you include remarks in your batch file
that will not affect the operation of the command. The remarks
in the prepdisk.bat file are to remind you what the file does.
Should you forget, you can type:
type prepdisk.bat [ENTER I
and MS-DOS displays the contents of the file, including the
remarks.
The PAUSE command lets you control how much of the file you
want to execute. When it reaches a PAUSE command, MS-DOS
pauses and displays the message:
Strike a key when ready . . .
You may continue execution by pressing any key, or you can halt
it by pressing [ CTRL 1 cn
Executing a Batch File
To execute your batch file, you must be in the directory that con-
tains the file. (See "The Current Directory" in Chapter 2.) Then,
enter the filename without the extension. For example, to execute
prepdisk.bat, type this at the system prompt:
pre p dis k [ENTER I
Execution proceeds just as if you entered each command line at
the keyboard.
22
Chapter 4 / Batch Files
,-----
23
Chapter 4 / Batch Files
24
Chapter 4 / Batch Files
To use this file to format the Drive B disk, enter the batch file
name and the drive specification to replace %1, as shown here:
pre p dis k b: [ENTER I
The next two sections tell more about creating and executing
batch files that have dummy parameters.
25
Chapter 4 / Batch Files
The result is the same as if you had entered each command with
its parameters, as follows:
copy a: prog1 . mac b: prog2. mac [ENTER I
tyep b:prog2.mac [ENTER]
type myflle.bat [ENTERI
26
Chapter 4 / Batch Files
The result is the same as if you had entered each command with
its parameters, as follows:
copy mail.dat newmall.dat IENTER]
type newmail.dat [ENTER]
50rt/+5 <newmall.dat >50rt.dat (ENTER]
type 50rt.dat [ENTERI
---_._---_._--------
27
Chapter 4 Batch Files
28
Chapter 5
MS-DOS COMMANDS
29
Chapter 5 / MS-DOS Comnwnds
30
Chapter 5/ MS-DOS Commands
COMMAND PURPOSE
FOR Executes several items with one
command
FORMAT Prepares disks for system use
GOTO Jumps to selected routine in batch files
GRAPHICS Copies screen graphics to printer
HFORMAT Prepares a hard disk for system use
HSECT Formats hard sectors on a hard disk
IF Allows conditional execution in batch
files
JOIN Joins a disk drive to a pathname
KEYTXX Replaces the current keyboard program
LABEL Modifies a volume label
LF Suppresses the line feed after a carriage
return
LPSETUP Enables a printer filter that allows
pagination
MKDIR/MD Creates a new directory
MLFORMAT Formats a hard disk partition
MLPART Creates a hard disk partition
MODE Sets video, printer, and communication
parameters
MORE Stops screen scroll - awaits key press
PATCH Modifies a disk file
PATH Specifies path to external commands
PAUSE Suspends batch execution, displays
message
PRINT Background printing of up to 10 files
PROMPT Creates a new system prompt
RECOVER Recovers bad sectors on a disk
31
Chapter 5 / MS -DOS Commands
COMMAND PURPOSE
REM Allows comments in a batch file
RENAME/REN Change (Rename) filenames
REPLACE Updates previous versions of a file
RESTORE Copies files from diskette to hard disk
RMDIR/RD Deletes a specified directory
SELECT Changes the curent country code
SET Establishes a common replacement
parameter
SHARE Installs file sharing and locking
SHIFT Moves replaceable parameters in batch
files
SHIPTRAK Parks hard disk heads
SORT Sorts input from keyboard or a file
SPOOLER Sends commands to the printer spooler
SUBST Substitutes a virtual drive name for a
pathname
SYS Transfers system files to disk
TIME Displays or sets system time
TREE Display all disk directories and files
TYPE Displays contents of specified file
VER Displays MS-DOS version number
VERIFY Verifies that files are intact
VOL Displays volume label of specified disk
XCOPY Copies files and directories
32
Chapter 5 / MS-DOS Commands
33
Chapter 5 / MS -DOS Commands
rename,aflle bfile
34
Chapter 5 / MS-DOS Commands
35
Chapter 5/ MS-DOS Commands
Also, certain commands listed in this manual are valid only for a
specific version of MS-DOS or apply only to hard disk systems.
These commands are indicated as follows:
~MS-DOS ~MS-DOS /#c~ MS-DOS
r 8 jV2.U [§o IV3.2 \~~
I ~J!) hard disk
o Command 'Command ~ Command
If you are not sure which version of the operating system your
computer uses, type VER I ENTER I.
SynonylIlous Keywords
Some commands give you a choice of keywords to accomplish the
same task. Fbr example, you can type either DEL or ERASE when
deleting files. You can also shorten MKDIR to MD, CHDIR to CD,
and RMDIR to RD.
36
Chapter 6
COMMAND REFERENCE
APPEND External
~~ APPEND [pathnameJ [;[pathnameJ ... J
Sets a search path for data files.
Parameters
pathlWme specifies the drives and/or directories that MS-DOS
searches for a data file.
_ ._ _ •• o. •• _
37
Chapter 6 / Command Reference
Example
Suppose you want to access data files in a directory called LET-
TERS on drive B and in a directory called REPORTS on drive
A. To do this, type:
append b:letters;a:reports
38
Chapter 6 / Command Reference
ASSIGN External
I ~ 1 ASSIGN [drivel [=] drive2 [. ..]]
Reassigns drive names (letters). MS-DOS will route requests for
a disk drive to the reassigned drive.
Parameters
drivel is the drive letter you wish to reassign.
drive2 is the drive letter to be given drivel.
Example
assign a=c b=c
39
Chapter 6 / Command Referem;e
ATTRIB External
G-~l
',3.2) ! ATTRIB [read][archive] pathname
Sets or resets the read-only and archive attributes of a file; dis-
plays the attributes of a file.
Parameters
read can be either + R or - R. + R sets the read-only attribute
of a file to ON. - R sets the read-only attribute of a file to OFF.
archive can be either + A or - A. + A sets the archive attribute
of a file to ON. - A sets the archive attribute of a file to OFF.
path name is the path to the file you wish to reference.
Example
attrib +r myflle.txt
40
Chapter 6 / Command Referem;e
BACKUP External
I Q
Y
I
~=D~.~.~ BACKUP
I .~.~ [/D:date]
[pathname] drive: [IS] [1M] [fA]
Copies (backs up) one or more files from a hard disk to floppy
disks (diskettes). To use files that are on backup diskettes, you
must use the RESTORE command to copy them back to hard
disk. Do not try to use them otherwise.
Parameters
pathname specifies the file you want to back up.
drive: specifies the disk to receive the files.
IS causes BACKUP to copy all files in the specified directory
and all directories below it.
1M causes BACKUP to copy only those files that have been modi-
fied since the last backup.
IA tells BACKUP to add the files (to be backed up) to the
diskette already in the specified drive, rather than prompting
you to insert a new diskette.
If you omit the IA parameter, BACKUP asks you to insert a
diskette. Then, before backing up any hard disk files, it erases
any existing files on the diskette. When the diskette is filled,
BACKUP asks you to insert another. Be sure to label each
diskette so you know the proper order of the backups.
lD:date copies only those files created on or after the date speci-
fied (in the mm-dd-yy format).
41
Chapter 6 / Command Reference
Examples
b a c k up *. * a: (ENTER I
backs up all the files in the current directory. You must first use
the FORMAT command to prepare several diskettes for informa-
tion storage. Then insert the first formatted diskette into Drive
A and type the command as above. Whenever it fills a diskette,
BACKUP prompts you for another.
backup lnvntory.dat a: la (ENTERI
backs up all batch Cbat) files from the current directory to Drive
A. This command erases any existing files on the diskette before
copying files to it.
b a c k up c: 5 tor e 1 \ 5 ale 5 • da t a: I a (ENTER I
backs up the file sales.dat that is in the STOREl directory in
Drive C to the diskette in Drive A, without erasing the
diskette's existing files.
backup *.* a:/m[ENTER]
42
Chapter 6 / Command Reference
BACKIJP External
I~~I
BACKUP [pathname]drive: [IS] [1M] [/A]
3.2
[lP] [lD:mm-dd-yy][lT:hh:mmx]
[/L:filename]
Backs up one or more files from a hard disk to a floppy disk.
Parameters
pathname is the path to the hard disk file you want to back up.
drive: the disk to receive the files.
/S produces a backup of subdirectories also.
/M backs up only those files that have been changed since the
last backup.
/A adds the specified files to those already on the backup floppy
disk. The existing files on the floppy diskette are not erased.
/P saves the file copies in a "packed" format that conserves
diskette space. It creates a subdirectory on the floppy diskette if
that is the only way to fill the floppy diskette. Warning: IBM'M
BACKUP/RESTORE compatibility can be lost if this switch is
used.
!D backs up only those files that were last modified at or after
the specified date.
/T backs up only those files that were last modified at or after
the specified time. hh can be 01-12. mm can be 00-59. x can be
a for a.m. or p for p.m.
/L creates a backup log entry in the file specified. If not speci-
fied, the file is given the name Backup.log, and is placed in the
root directory of the diskette. The first line of the file contains
the backup date and times. Each subsequent line contains the
filenames and the number of the floppy disk on which the files
are stored. This information is useful when restoring a particu-
lar file from a floppy diskette. By looking at Backup.log file, you
know which disk to specify for restore. On subsequent restore
operations, because Backup.log already exists, the current entry
is appended to the file.
43
Chapter 6 / Command Reference
Examples
backup c: a: Is
44
Chapter 6 / Command Reference
backup c: store1 a: Ii Id
45
Chapter 6 / Command Reference
BREAK Internal
BREAK switch
Turns the [CTRL I [TI check on or off or displays the current set-
ting. The BREAK command affects only application programs. It
has no affect at the MS-DOS command level or to BASIC
programs.
Parameters
switch can be ON or OFF.
ON tells MS-DOS to check for I CTRL I [TI from the keyboard
whenever an application program makes any type of MS-
DOS function call.
OFF tells MS-DOS to check for a ! CTRL I [TI only when a
screen, keyboard, printer, or serial port function call is
made.
If you omit both ON and OFF, MS-DOS displays the current set-
ting of BREAK.
Examples
b rEa k 0 ff I ENTER I
turns off the MS-DOS [CTRL I [TI check. Use this command before
running an application program that uses the [CRTL] m
function
key. Pressing I CTRL I [TI will affect your program instead of the
operating system.
b rEa k 0n I ENTER I
turns the [CTRL I [TI check on. Use this command after you have
finished running your application program and are planning to
use MS-DOS.
b rEa k [ENTER I
displays the current setting of the I CTRL I [IJ check.
46
Chapter 6 / Command Reference
Parameters
pathname specifies the directory that is to be the current direc-
tory. Pathname must be another directory on the current disk. If
you are changing the home directory of a disk other than the
current disk, you must specify the drive that contains the direc-
tory. Pathname must be another directory on that disk.
If you omit pathname, MS-DOS displays the pathname of your
current directory. This lets you verify a directory change or the
name of a directory should you forget.
47
Chapter 6 / Command Referem:e
Examples
b: [ENTER I
c h d 1 r \ use r (ENTER I
changes the current drive to Drive B, then changes the current
directory to \ USER.
chd1 r " I ENTER]
puts you in (changes your current directory to) the parent direc-
tory of your current directory, if you are in a subdirectory.
chd i r \ I ENTER j
(1) changes the current directory on Drive A from the root direc-
tory to \ USER \ LETTERS and (2) changes the current directory
of Drive B from the root directory to \ USER \MEMOS. Now,
instead of typing:
copy b:\user\memos\filename
a:\user\letters\filename (ENTERJ
for every file you copy between the two directories, you need only
type:
copy b:filename filename
48
Chapter 6 I Command Reference
Parameters
pathnamel specifies an entire disk or an individual file to check.
If you specify a file, CHKDSK displays information about both
the drive and the file.
IF tells CHKDSK to correct any errors it can and update the
disk. Do not use this parameter if you include a pathname.
IV causes CHKDSK to display messages while it is running and
gives detailed information about any errors it finds.
pathname2 specifies the file to which CHKDSK is to redirect its
output. Do not use this parameter if you use the IF parameter.
The report includes two hidden files. These are the system
files. You cannot see these files when you use the DIR
command.
49
Chapter 6 / Command Reference
Examples
c h kd s k / f [ENTER I
checks the directory of the current disk, displays the errors, asks
if you want to fix them, and acts accordingly.
c h kd s k b: / v (ENTER I
checks the directory of the disk in Drive B, displaying
the name of every directory and file on the disk, and
reports on progress. CHKDSK asks if you want to fix
any errors. It cannot do so, however, until you specify
the IF switch.
chkdsk b:>\user\tom\errors [ENTERj
50
Chapter 6 / Command Reference
Examples
c 1 5 [ENTER I
clears the monitor screen and moves the prompt and cursor to
horne position (the top left corner of the screen).
51
Chapter 6 / Command Reference
COMMAND External
3.2 '
COMMAND [pathname] [device:] [IF] [IE: size]
[Ie string]
Parameters
pathname tells the command processor where to look for the
COMMAND.COM file if it needs to reload the transient part into
memory.
device: lets you specify a different device (such as aux) for input
and output. See the CTTY command in this chapter for more
information.
IP tells COMMAND.COM not to exit to a higher level.
IE:size specifies the environment size, where size is the size in
bytes. The size may range between 128 and 32768 bytes. The
default value is 128 bytes.
If size is less than 128 bytes, MS-DOS defaults to 128 bytes and
gives the message:
Invalid environment size specified
52
Chapter 6 / Command Reference
COpy Internal
COpy source pathname [target pathname]
[/~] [/13] [/'1]
Copies one or more files: (1) to the same directory (as the
source), giving the new file a different filename or (2) to another
directory on any disk, giving the new file the same or a different
filename.
Parameters
source pathname is the file to be copied.
target pathname is the name and destination to be given the
newly created file.
If you omit the filename from the target pathname, MS-DOS
assumes you want to give the new file the same filename as the
source file.
IA tells MS-DOS to treat the file as an ASCII file (also called a
text file) when used with a source file. MS-DOS copies only to
the first end-of-file (EOF) character.
IA tells MS-DOS to add an EOF character to the end of the file
when used with the target file.
IB tells MS-DOS to treat the file as a binary file, such as a pro-
gram file, when used with the source file. Therefore, MS-DOS
copies the entire file. When used with the target file, it tells MS-
DOS not to add an EOF character to the end of the file.
Each of these switches (fA and IB) affects the file immediately
preceding it in the command line and all files following, until
another IA or IB is encountered.
For example, if you type this:
copy thisfde fa thatfile I ENTER I
the I A parameter affects both files. If you type this:
copy thlsfile fa thatfile fb I ENTER I
53
Chapter 6 / Command Reference
If you omit the /A and!B switches, MS-DOS uses /B. Notice that
this default is the opposite of that for the COPY/APPEND and
COPY/COMBINE commands.
N tells MS-DOS to verify that the sectors written to the disk
are recorded properly. This parameter slows the process because
MS-DOS must check each entry recorded on the disk.
54
Chapter 6 / Command Reference
i"'
I
• Remember, the target disk must be formatted and the
target directory must exist.
i"'
) .
Examples
r-' copy *. * / a b: I ENTER I
l ' copies all the files from A: \ to B: \.
r-- mk d 1 r \ bin I ENTER I
I
l
'
_I cop Y for mat . com \ bin I ENTER I
transfers external commands to another directory by first creat-
~
ing the directory \ BIN in the root directory of the system disk
i in Drive A and copying Format.com into it. You can now copy
'-
any other .com files you use regularly into the \BIN directory.
copy \per50nal.dat b: I ENTER I
copies the file personal.dat from the root directory of Drive A to
55
Chapter 6 / Command Reference
, I
!-J
COPY/APPEND Internal
COpy target pathname + source pathnamel !
, ,
)
'---'
[+ source pathname2 .. , ] [IA] [lB] [IV]
Adds one or more files to the end of another existing file. The :'---'i
files are added in the order in which you list them. When you
append files, the original source files still exist separately. The
information from them is copied, not moved.
u
Parameters
I :
i
target pathname is the file to receive the appendages named in '---'
the source pathnames.
source pathname is the file(s) that will be added or appended to I 1
i I
target pathname.
IA tells MS-DOS to treat the file as an ASCII file when used , ~l
56
,i , Chapter 6 / Command Reference
, ,
Notice that this default is the opposite of that for the regular
, COPY command.
IV tells MS-DOS to verify that the sectors written to the disk
are recorded properly. When you use this parameter the process
slows because MS-DOS must check each entry recorded on the
disk.
r-'
I
I' I
57
Chapter 6 / Command Reference
I ,
Examples
copy b:read.dat + write.dat + print.dat I ENTER I
appends the files Write.dat and Print.dat that are in the current
directory to the file Read.dat that is in the current directory of
Drive B. MS-DOS adds an EOF character to the end of Read.dat.
cop Y b 1 9 . t 5 t H • 1st I ENTER I
appends all files that have the extension .lst, and that are in the
current directory, the the file Big.tst, that also is in the current ; i
directory. MS-DOS adds an EOF character to the end of Big.tst.
cop y pro 91 . ex e I b + pro 92 . ex e I ENTER I i
'--J
I !
I !
:I
,
I
I
I ,
---'
I I
~
I
----'
58
r-
I Chapter 6 / Command Reference
~
I
COPY/COMBINE Internal
I
I
:
~ COpy source pathnamel [+ source pathname2 ... ]
target pathname [lA] [lB] [IV]
Combines any number of source files into a target file. The files
are ~dded in the order in which you list them. When you com-
bine files, the original source files still exist separately. The
IL I information from them is copied, not moved.
_I
Parameters
IA tells MS-DOS to treat the file as an ASCII file when used
with the source file. MS-DOS copies only the information up to
the first EOF character.
IA tells MS-DOS to add an EOF character to the end of the file
when used with the target file.
IB tells MS-DOS to treat the file as a binary file, such as a pro-
gram file, when used with the source file. Therefore, MS-DOS
copies the entire file. When used with the target file, this
r parameter tells MS-DOS not to add an EOF character to the end
of the file.
"
Each of these switches (fA and IB) affects the file immediately
preceding it in the command line and all files follow~ng, until
another I A or IB is encountered.
1 1
For example, if you type this:
I
copy myflle.txt /a + salflle.txt onefile.txt
I ENTER I
the IA parameter affects all three files. If, however, you type
this:
r- copy myflle.txt /a + salfile.txt /b onefile.txt
i : I ENTER'
the IA parameter affects only Myfile.txt.
n If you omit the IA and IB switches, MS-DOS uses IA. Notice that
this default is the opposite of that for the regular COPY
command.
J'
II ' IV tells MS-DOS to verify that the sectors written to the disk
are recorded properly. This parameter slows the process because
MS-DOS must check each entry recorded on the disk.
59
I !
Chapter 6 / Command Reference L-:
~ I
: I
, i
i
60
I, Chapter 6 / Command Reference
Ii
[ i
Examples
COPY B:mem05.txt + B:letter5.txt B:corr.txt
I I
I ENTER I
combines the files Memos.txt and Letters.txt that are in the cur-
r-""'
I ' rent directory on Drive B. COPY copies information only up to
[
the first EOF character in each source file. Then it places the
information in the file Corr.txt in the same directory and adds
I
I
', an EOF character to the end of that file.
I '
COPY A:\5tat51.dat + A:\5tat52.dat
B:\al15tat5.dat [ENTER I
combines the files Stats1.dat and Stats2.dat that are in the root
directory of Drive A. COPY copies information only up to the
first EOF character in each source file. Then COPY places the
information in the file Allstats.dat in the root directory of Drive
B. MS-DOS adds an EOF character to the end of Allstats.dat.
,..-, COpy a.com + b.com + B:c.com oneprog.com
l : IB I ENTER I
combines the files A.com and B.com that are in the current
directory, with the file C.com that is the currrent directory of
Drive B. COpy copies information only up to the first EOF char-
acter in each source file. Then it places the information in the
r:
l I
file Oneprog.com in the current directory. It does not add an
EOF character to the end of that file.
n
\ ;
,........,
l I
r:
l
.
~
,
, ,
: '
,--,
I I
61
Chapter 6 / Command Reference
I 1
LJ
COPYDOS External
I ~ 'COPYDOS ; i
L
Copies operating system files onto an application program
, ,
diskette. : '
LJ
Suggestions and Notes
• Some application programs do not include an operating system i I
L......i
on the program diskette. This means you cannot boot (initial-
ize) your computer with that diskette and must use a system
I :
diskette to boot your computer. To avoid needing two diskettes ! ;
-----'
when executing a program, transfer the startup system files
to your application diskette with COPYDOS.
, 1
'-'
insert the destination diskette in drive B. At this point,
remove the system diskette from drive A and insert the desti-
; 1
nation diskette in its place, then continue with the COPYDOS ,
---..J
I
procedure.
, !
, I
I---..J:
!I
,-- ,
I
~l
, 1
~
62
,-
I
Chapter 6 / Command Reference
Examples
COpyd05 I ENTER I
,
, ,
Formats and copies the necessary system boot files to a diskette.
The diskette is first formatted. Be sure you do not use the ver-
i sion of COPYDOS on a diskette containing data you do not wish
! ' to erase.
copyd05 P I ENTER I
Copies the necessary system files to a diskette to make it boota-
ble. Using COPYDOS in this manner will change the contents of
an application diskette but will not erase any data previously
contained on the diskette and will not affect its operation. The p
parameter must be in lowercase.
r
I :
,-.,
! .
63
"
Parameters i i
Examples
c tty aux I ENTER I
moves all command input/output (I/O) from the current device to
the auxiliary device.
c tty con I ENTER I
changes the input device to the keyboard and the output device
to the screen.
64
Chapter 6 / Command Reference
DATE Internal
DATE [mm-dd-yyyy]
Enters or changes the system date. This date is recorded in the
directory for any files you create or change. You can also use
this command to display the current date.
MS-DOS is programmed to change the months and years cor-
,,r-:. rectly, taking into account leap years and the number of days in
the months.
Parameters
mm-dd-yyyy specifies the date in numerical form. mm (month) is
a one- or two-digit number in the range 1-12. dd (day of month)
is a one- or two-digit number from 1-31. yyyy (year) is a two-
digit number in the range 80-99 (1980 is assumed) or a four-
digit number in the range 1980-2099.
~
• You can change the date from the keyboard or from a batch
i . file. (Normally, MS-DOS displays a date prompt each time you
start up your system. It does not, however, if you use an auto-
exec.bat file. Therefore, you may want to include a DATE com-
,,,..----, mand in that file.)
• When you change the date known to the system, you also
change the date in any application program you use. This can
be very handy.
65
, i
Chapter 6 / Command Reference
Press I PRINT I again to turn off the print output function. Now
use I SHIFT I I PRINT I, I PRINT I, I CTRL I W, or the PRINT command as
necessary to make your printout.
• In Version 3.2 MS-DOS, you can change the format in which
the date is displayed and entered. The COUNTRY command
in the CONFIG.SYS file lets you change the date format to
the European standard, dd-mm-yy. Refer to Appendix B for
more information.
I
~
Examples
date I ENTER I : !
~
displays the current date and prompts you for the new date. For
example, if the date is July 16, 1986, MS-DOS displays:
Current date 15 Men 7-16-1986
Enter new date:
You can now change the date or press I ENTER I to bypass the
prompt.
da t e ~ 7/1 4/1986 I ENTER I
enters the current date as July 14, 1986.
, I
~
i
66
Chapter 6 / Command Reference
r
I :
DEL (Delete) Internal
~ See the ERASE command.
,
r--'
i i
,....,
·i i ,
·, ,'
,---,
,
I ,
I '
r-1
; i
· I
I
i
i I
,--'
i ;
,....-,
I '
, I
r--'
I
; ,
r
I
~
; \
r--'
i
67
Chapter 6 / Command Reference
DIR [pathname][lP][lW]
Displays: (1) information about all files or the specified files
that are in the current directory or in the directory specified by
pathname or (2) information about the file specified by
pathname.
Parameters
pathname indicates a specific file. If you omit the pathname,
MS-DOS lists the directory entries for all files that are in the
current directory. You can use the MS-DOS wild cards in the
pathname.
,I !'
IP selects the page mode. With IP, display of the directory pauses
when the screen is filled. It displays this message:
Strlke a key when ready ...
To resume display of output, press I SPACEBAR I.
IW selects a wide display. With IW, MS-DOS displays filenames
only; it does not display sizes or modification dates.
, .,
68
Chapter 6 / Command Reference
.--
., ,'
Examples
:- dlr b:\u5er\mai15rt.bat [ENTER I
, :
provides information on how much space B: \ USER \ mailsrt.bat
takes on the disk in Drive B and how much space remains.
di r b: \ I ENTER I
tells you the name of the files in Drive B. The backslash indi-
cates the root directory. If the file you want is not in the root
directory, use the DIR command as needed to check the
subdirectories.
I PRINT I di r I ENTER I
a listing of the directory goes to the printer, as well as to the
screen, until you again press I PRINT I.
; 1
di r b: I ENTER 1
displays, in the wide mode, the names of all files in the current
directory.
di r \ U5 e r \ * • bat / p I ENTER I
displays a list of all batch files in the \ USER directory on the
current drive. MS-DOS halts (pauses) the display when the
.
r
'")
screen is full. Press I SPACEBAR I to continue.
dir a:\U5er\acct.* [ENTER 1
69
Chapter 6 / Command Reference
DISKCOMP External
DISKCOMP [drivel:] [drive2:] [11] [18] , I
Parameters
drivel: is the drive containing the source diskette for the
comparison.
drive2: is the drive containing the target diskette.
/l compares only the first side of the diskettes.
/8 compares only eight sectors per track.
, I
70
, j Chapter 6 / Command Reference
r-:
i I
• If no parameters are specified, DISKCOMP will do a single
drive comparison using the current drive.
r, ~'
• During the DISKCOMP process, you will be informed of any
disk cylinders or tracks that do not match. DISKCOMP will
then continue with the comparison.
I '
• Copies of diskettes made using the COpy command will not
usually be identical. Data is not necessarily copied in the
r---, same position on the target diskette as it was located on the
, !
: \
source diskette. Use the DISKCOPY command for mirror-
image copies of diskettes.
.---,
,I i, • If a read error occurs on a track of one diskette, that track is
l _I reported as differing.
• You cannot compare a double-sided diskette with a single
I i' sided diskette. Trying to do so will cause an error message.
,
• Diskettes with a different number of sectors per track cannot
,--, be compared.
,,
• Drivel and drive2 cannot be virtual drives, such as those cre-
ated with the Version 3.2 SUBST command.
!
I ' Examples
.--, dlscomp [ENTERI
I '
l ' compares two diskettes for identical data on the current drive.
You will be prompted when to swap diskettes.
r , d 15k com p a: b: / 1 / 8 [ ENTER I
l ~
,...--,
! '
l '
.....
,
l
71
Chapter 6 / Command Reference
DISKCOPY External
DISKCOPY [source drive:] [target drive:] [11]
Makes exact copies of the diskette in the source drive on the
diskette in the target drive.
Parameters
source drive: is the drive containing the diskette you want to '-...J
copy.
target drive: is the drive containing the diskette to receive the
copy.
/1 copies only the first side of a diskette.
72
Chapter 6 / Command Reference
Examples
i l diskcopy IENTERJ
r-,
I
....
, .
; ,
I '
73
Chapter 6 / Command Reference
: '
DISKTYPE External
DISKTYPE [drive:] ,
, ;
'-"'~
Parameters
drive: is the disk drive for which you wish to determine the type.
It can be either a floppy drive or a hard drive. If drive is not
specified, the default drive is used.
Examples
DISKTYPE A:
DISKTYPE c:
displays the following message:
Fixed dISk contains 4 heads, 2ilil cylinders, 17
sectors/track
74
,
I- i
~ -"
Chapter 6 / Command Reference
! '
l .
ECHO Internal
)' ECHO [switch] [message]
Turns the batch ECHO feature on or off. Also lets you use mes-
I sages while the batch files are executing.
~ - I
Parameters
switch can be ON or OFF. ON tells MS-DOS to display batch file
commands. OFF tells MS-DOS not to display batch file
commands.
message is text the screen displays when ECHO is encountered.
I :
Notes and Suggestions
l '
• If you do not specify a switch or message, MS-DOS displays
the current setting of ECHO.
• Normally, the screen displays (echoes) commands in a batch
file as you run the file. ECHO OFF turns off this feature.
ECHO ON turns it on again. (Note: ECHO is automatically
restored to its previous setting after a batch file executes.)
• ECHO message displays the specified message, regardless of
n whether ECHO is on or off.
i 1
• Specifying ECHO OFF at the MS-DOS prompt turns off the
system prompt.
:-'
! I
I I
• Use ECHO OFF when you do not want to clutter the screen
with unnecessary information.
• You can turn off ECHO and insert your own messages to be
displayed while a batch file is executing.
; (
,i ;
75
Chapter 6 / Command Reference
Example
The following batch file formats a disk in Drive B and then
checks the disk. (The file uses some external commands, so it
must be created in a directory that contains the external
commands.)
copy con prepdisk.bat I ENTER I
ech0 0 f f I ENTER I
rem ThlS formats and checks dlsks In drive E IENTERj
rem i t i s cal led pre p dis k . bat I ENTER I
format b: I ENTER I
echo do you want to check drive b? I ENTER I
pause I ENTER I
c h k d s k b: I ENTER I
ech0 0 n I ENTER I
ffiJ I ENTER I
When you run the file, MS-DOS displays:
echo off
The FORMAT copyright is displayed, then the screen shows:
Insert new diskette for drive E: i !
Format Complet'e
nnnnnn bytes total disk space
nnnnnn bytes available on dlsk
Format another (YIN)? Do you want to check
Drlve E?
Strike a key when ready ...
nnnnnn bytes total dlsk space
nnnnnn bytes available on dlsk
nnnnnn bytes total memory
nnnnnn bytes free
As you can see, the commands are not echoed. The screen does
display the prompt Do you want to check Drive E? This is
because the ECHO command used here includes the message
parameter.
76
Chapter 6 / Command Reference
I '
i
ERASE Internal
ERASE pathname
DEL pathname
Erases (deletes) one or more files from current directory or from
the directory specified by pathname. By erasing unnecessary
files, you can create more free space in a directory.
! I
Parameters
pathname specifies the file you want to delete.
l
,, -'
,i
Notes and Suggestions
I I
• If you omit the filename from the pathname, MS-DOS
assumes you want to erase all files in the directory. CUsing
the wild card *.* as. the filename is the same as omitting the
filename.)
• If you use the full wild card C*.*), ERASE prompts: Are you
5 u r e (Y / N )? If you type Y I ENTER I, MS-DOS erases the files. If
you type N [ENTER I, MS-DOS exits the command.
• If you omit thE! entire pathname, ERASE returns an error
II message.
I
77
Chapter 6 / Command Reference
Examples
ere s e *. 1 s t [ENTER I ,
; 'I
'
....,....\
I
would be used after you combine the files A.lst and B.lst from
the current directory into a new file All.lst on a different direc-
tory. It would erase all files with the extension .lst in the cur-
rent directory. You should make sure that there are no other
files you wish to keep that have the .lst extension.
Warning: If you include an extension, such as the .lst
used here, ERASE does not prompt you before erasing
the files, regardless of whether use a wildcard. It
prompts only when you use the full wildcard (*.*). , ,
--'
erases +he file Text.txt from the directory BIN \ USER \ MARY
on the current disk.
era s e b: \ use r \ J0 hn\ * .* I ENTER I I I
'-J
tells MS-DOS to delete all the files in the directory
\USER\JOHN on Drive B. MS-DOS asks: Are you sure? (VI
N)?
erase b: \bi n\user \mary I ENTER I
tells MS-DOS to erase all files in the \BIN\ USER\MARY
directory on Drive B. MS-DOS prompts: Are yo u sur e (V IN)?
era s e f i 1 e 2 I ENTER I , ,
I :
78
Chapter 6 / Command Reference
I ,
r I
Parameters
source pathname specifies the file to be converted. If you do not
include an extension in the source pathname, the extension
defaults to .exe. .
target pathname specifies a file to receive the converted program
file. If you omit the drive, EXE2BIN uses the drive specified in
,~, the source pathname. If you omit the extension, it gives the new
file the extension .bin. If you omit the entire target pathname,
EXE2BN uses the source pathname.
79
Chapter 6 / Command Reference
,I !,
When this kind of conversion is complete, you can rename the
resulting file, giving it a .com extension. Then the command
processor can load and execute the program in the same way
as it does the .com programs supplied on your MS-DOS disk.
• If CS:IP does not meet either criterion (discussed in the pre-
ceding Notes and Suggestions)-or if it meets the .com file cri-
terion but has segment fixups-EXE2BIN displays an error
message. EXE2BIN also displays an error message if the file
is not a valid executable file.
Examples
exe2bln testfile.exe b: [ENTERI I
'......J
converts the file Testfile.exe that is in the current directory to
binary format and places the new file, Testfile.bin, in the current
i :
directory of Drive B.
exe2bln e:\user\oldfile.exe e:newfile I ENTER]
i ,.
converts the file Oldfile.exe that is in A: \ USER to binary format !..-;
and places the new file, Newfile.bin in the current directory of
Drive A.
! :
-'
i I
, ,
: ~
: i
~
80
iJ Chapter 6 / Command Reference
n
!
EXIT
1
Internal
r:
: I EXIT
Returns control from a secondary command processor to the
n invoking program, if one exists. If you have entered a secondary
command processor from an application program, use EXIT to
return to the application.
n
I : Notes and Suggestions
• While running an application program, you may need to use
, ,
; I
an MS-DOS command. To do so, you must first invoke a sec-
ondary command processor from your program. Enter the
command you wish to use. When complete, enter EXIT to
I : return to your application program.
l :
Examples
Invoke a secondary command processor from your program, then
type your command.
d l r b: I ENTER I
ex 1 t I ENTER I
!I
l J
G
I '
r-'
I, II
I J
81
Chapter 6 / Command Reference
f I
L...J
Fe (File Comparison) External
18: Fe
:
[/number] [lB] [Ie] [lW] pathnamel
pathname2 [>target pathname]
82
-
I
l ~
Chapter 6 I Command Reference
r:
, -
I I
For example:
...--,
! : matches
Ii
, I
and
r;
I I
! '
(Each underscore represents a white space in these examples.)
Use the /W parameter only in source comparisons.
pathnamel pathname2 can be either source files (files that con-
tain source statements of a programming language) or binary
files (files output by the assembler, the linker, or a Microsoft
n
L_
high-level language compiler).
and returns to the system prompt. For binary files larger than
available memory, FC compares both files completely, overlay-
n
l '
ing the portion in memory with the next portion from disk.
This does not affect the command output.
• The two kinds of comparisons are line-by-line and byte-by-
~
l ' byte.
In a line-by-line comparison, FC marks off blocks of lines and
:
I
' then compares the lines within each block. In a byte-by-byte
comparison, FC simply displays the bytes that are different.
• If FC finds many differences (involving many lines), it only
reports that the files are different. Then it stops.
,..,
J I
l l
83
Chapter 6 / Command Reference
A A J !
B B
M C
D L I i
o S
S W
W X
X Y
Y Z
Z P 1
R E -J
U N
N Q I
Q V ~
T
V
To compare the files line-by-line, type:
fc /1 I
name1.~rc name2.~rc ENTER I I
I
I
'--J
84
Chapter 6 / Command Reference
.----
i ! FC begins by marking off the blocks of lines. Whenever FC
encounters a match, it ends a block. Therefore, FC blocks off
the lines as follows:
name1.src name2.src
A A
B B
M C
D L
0 S
S
W W
X X
Y Y
Z Z
~I
.
R P
l j U E
N N
Q Q
T V
V
n
! FC ignores matching blocks that are before the first mis-
match. It also ignores blocks in which at least the specified
! number of lines match. In this case, the number is one. For
i each set of blocks that contains a mismatch, however, FC dis-
plays thf') following information:
,.., • -----------------NAME1.SRC
I
• The lines in the Namel.src block that differ from those in the
corresponding Name2.src block
• The line that is the same (the last line in the block)
• -----------------NAME2.SRC
r:
I
! , • The lines in the corresponding Name2.src block that differ
from those in the Namel.src block
.........,
i '
85
Chapter 6 / Command Refererwe
• The line that is the same (the last line in the block)
Therefore, for the files Name1.src and Name2.src, Fe displays:
-----------------NAME1.SRC
M
D
o
5
-----------------NAME2.SRC
C
; I
L ,~
----------------NAME1 .SRC
R
U
N
-----------------NAME2.SRC
P
E
N
T
V
-----------------NAME2.SRC
V
You can print the differences on the line printer using the
same two source files. To do this, type: . ,
~
86
Chapter 6 / Command Reference
,........
I '
I '
Examples
~
n
1- \
,.......,
i \
i I
.........,
\ ;
r:
t i
n
! ;
I
,.,
I I
I '
n
, '
I '
,I '
'
87
Chapter 6 / Command Reference
,
l
,i
Fe (File Comparison)
rQl Fe [lA] [lB] [Ie] [lL] [lLBn] [IN] [IT] [lW]
~ [lnumber] pathnamel pathname2
o [> target pathname] i
i
.....-'
Compares the contents of two files or sets of files.
Parameters
pathnamel and pathname2 specify the files to compare.
IA abbreviates the output of an ASCII comparison. Normally, FC
displays only the matching lines that precede and follow each set
of differences. It uses an ellipsis (. ..) to represent the intermedi-
ate (non-matching) lines. (See "Notes and Suggestions," below,
for more information on how FC reports differences.)
IB forces a binary comparison of the files. FC compares the two
files byte-by-byte, and makes no attempt to resynchronize after
a mismatch. It displays mismatches in the following format:
xxxxxxxx yy zz )
!
--!
where xxxxxxxx is the relative address of the pair of bytes (from
the beginning of the file). Addresses start at 00000000. yy and
z z are the mismatched bytes from pathnamel and pathname2,
respectively. If one file contains less data than the other, Fe dis-
plays a message, telling you which is longer.
IB is the default when you compare .exe, .com, :sys, .obj, .lib, or
.bin files.
IC causes the matching process to ignore the case of letters,
interpreting them as all uppercase. For exmaple: , '
---'
88
, ,
; I Chapter 6 / Command Reference
l ; ILBn sets the internal line buffer to the number of lines speci-
fied by n. Files that have more than this number of consecutive,
!"\ non-matching lines cause the comparison to cancel. If you omit
! '
this parameter, FC uses 100.
IN displays the line numbers in an ASCII comparison.
IT does not expand tabs to spaces. The default is to treat tabs as
spaces to eight column positions.
matches:
n and:
!, :
________Mo r e da t a_ t o_be f 0 un d _
i I
I •
p p
I i
For each block that contains a mismatch, FC displays:
***** filenElme1
last line that matches in the two files
intermediate, non-matching lines in first file
L
next line that matches in the two files , ,.
***** filenElme2 ,
, .
last line that matches in the two files
intermediate, non-matching lines in second file
next line that matches in the two files i
***** L.
: i
90
c--"""'
n
~_ I
Therefore, for the above files, it displays the following. (The
notes do not appear.)
n i ***** Fl1e1.src
b
d
,..--,
, \ e
1 i
f
k Note: Filel contains bdefk
,..-- where File2 contains bghk.
***** Fl1e2.src
! i b
9
h
k
*****
***** File1.src
m
n
Note: Filel contains mno
nt J 0
l j *****
91
Chapter 6 / Command Reference
. I
• You can redirect FC-s output to a file by appending ) tar -
ge t pa t hname to the FC command. For example, to send
:.......J
displays: I
resynch failed. Files are too different LJ
Then, it returns to the MS-DOS system prompt.
Examples
J
f c / b t est 1 . s r e t est 2 . s r c > t est 3 . s r c I ENTER I I
:
I
I
l-.I
does a binary comparison of the files Test1.src and Test2.src that
are in the current directory, and redirects output to the file
Test3.src that is also in the current directory.
fc /4/w/c b;\user\myfile.src
b : \ use r \ my f 1 1 e 1 • s r c I ENTER I I i
does a line-by-line comparison of B: \ USER \ Myfile.src and U
B: \ USER \ Myfile1.src, compressing white spaces and ignoring
case. After FC finds a mismatch, at least four lines in a row I
must match for the file to be considered matching. ~
: I
L.....J
J
J
J
I I
I I
L.....J
92
Chapter 6 / Command Reference
FDISK External
I'
I ~~
..
~/
FDISK
Creates, changes, deletes or displays hard disk partitions. Use
this command to initially install a hard disk drive, to change
the current partitions, or to check the current partitions. When
initializing a hard disk, FDISK is used in conjunction with
HSECT and HFORMAT or HSECT and FORMAT, depending on
the version of the operating system you are using.
Enter selectlon--->
Press ESC to exit to MSDDS.
• A hard disk can be partitioned to install more than one oper-
ating system on it, or for other specialized applications. Using
FDISK you determine where and how much or the total disk to
allocate for separate DOS systems.
• Up to four partitions can be made on a hard disk. If you do not
.--
I intend on using more than one disk operating system, or if
I you are not sure what systems you may use in the future,
specify one partition.
~,
93
I
Example ,
,
I
I
LJ
f d1 S k I ENTER I
,
loads FDISK from the current drive and displays the FDISK r
menu. To partition Drive C, press 1. The screen displays: --.J
,
-..J
94
Chapter 6 / Command Reference
FIND External
~
,
1 '
FIND [IV] [Ie] [IN] "string" [pathname ...]
FIND is a filter that searches for the specified string of text in
r
I
one or more files which are specified by one or more pathnames.
Capitalization and punctuation in the string must be the same
as in the file.
Parameters
pathname is the file to search. If you omit the pathname option,
FIND uses text from the standard input device.
string is the text for which to search. Enclose the string in
quotes. For example, to search the Bookl.txt and Book2.txt files
in the current directory for all occurrences of this string:
The whiteness of the whale
type:
find "The whiteness of the whale" book1.txt
r boo k 2 . txt I ENTER I
[
MS-DOS displays the lines in the order in which the files are
specified. If the string contains quotations, enclose each quota-
n
I
tion in double quotes. For example, to find all occurrences of this
string:
Aye, "Moby D1Ck" is a whale of a story.
[ that are in the file Book1.txt in the current
directory, type:
I,
95
Chapter 6 / Command Reference '
I I
~
Notes and Suggestions
• Using FIND with the IN parameter, you can determine which i,
lines contain the specified string. Then, knowing the line '-'
numbers, you can easily enter the EDLIN Edit Line command
and change every occurrence of the string. (See Part 3,)
• Suppose one of your suppliers, Johnson Auto Parts, buys out
another, Samuel Parts. You need to change all occurrences of
u
Samuel Parts to Johnson Auto Parts, in your I
B: \ USER \ Invntory.dat file. To find the line number of each c..J
occurrence, type:
find In "samuel parts" b:\user\invntory.dat
I ENTER I
MS-DOS might display a list like this:
---------B:\user\invntory.dat J
[1lspark plugs
[5ldistributor caps
[9l14" rad hose
200 6-16-83 Samuel Parts
50 6-16-83 Samuel Parts
25 6-16-83 Samuel Parts
u
(2" dia.>
Examples
find Ie 11- ..
b:\user\profits.dat
J
displays the number of times a negative sign occurs in
B: \ USER \Profits.dat. In this way, you can see at a glance how
many negative numbers you have in the file. (Notice the space
J
after the negative sign. This is included so MS-DOS does not I
find hyphenated words.) !
'---'
dir b:1 find Iv "dat"
displays all names of the files in the home directory of the disk
in Drive B that do not contain the string DAT.
J
J
96
J
Chapter 6 / Command Reference
r
!
FOR Internal
FOR %C IN (set) DO command
(regular MS-DOS command)
I' Executes the specified command once for each item in set.
i
Parameters
n
, set is a list of items. Each item in the list is separated with a
space or comma. You can include wildcards in the list. Files,
directories, and disk drives are only a few of the items you can
I~.
I
list.
%C is anyone-character variable except 0-9 that MS-DOS uses
to represent the items in set. DO tells MS-DOS to do the
I'
I '
command.
%%C is the same as %C, except the second percent sign is
required when the command is in a batch file.
~
I '
command is the command you are executing.
97
Chapter 6 / Command Refereru:e
Examples
for io fin (a: \ b: \ b : \ use r) dod 1 r io f I ENTER!
MS-DOS displays the listing for each of the three directories ~J
A: \, B: \, and B: \ USER, in order.
copy con 3dir.bat I ENTER I
rem This file displays directory listings for
io 1, io 2, and io 3 I ENTER I
rem it is called 3dlr.bat [ENTERI
for io io fin (i. 1 io 2 io 3) dod i r io io f I ENTER!
[ill [ ENTER I
, I
.asm. :-.J
for iof in (taxfile autofile homefi"le) do del iof
[ ENTER I J
deletes the three files, in order, from the current directory.
:..---l
I
J
i !
98
e-J
r---
, I
Chapter 6 / Command Reference
~
I '
FORMAT External
r
i
I ~ I FORMAT [drive] [IV] [11] [18] [lB] [IS]
Prepares the blank floppy diskette in the specified drive for use
by defining the tracks and sectors and writing system informa-
tion onto the diskette. You can format either a blank diskette or
a diskette already formatted. If the diskette is already formatted
r-' and you reformat it, you lose whatever programs or data are on
I ' it.
This command applies to floppy diskette only. To prepare a hard
r
I
disk, you must use the HFORMAT command.
Parameters
I:
I drive is either Drive A or Drive B. For example, if you specify
Drive A, FORMAT prompts:
r-'
I ,' Insert new diskette for drive A:
(
and strike any key when ready
Insert into Drive A the diskette to be formatted. Press the space
bar.
If you omit the drive specification, MS-DOS formats the diskette
in the current drive.
,
r-'
I ,
:
IV causes FORMAT to prompt for a volume label after the
diskette is formatted. If you use this parameter, you can enter a
r
i
label of a maximum of 11 characters, or you can press I ENTER I to
bypass the prompt. Entering a volume label helps keep track of
your diskettes.
11 performs a single-sided format of a diskette. If you omit 11,
FORMAT performs a double-sided format.
i
I
'' 18 causes a format of eight sectors per track. If you omit 18,
I FORMAT uses nine sectors per track.
IB formats eight sectors per track and allocates space for the
~'
l
hidden system files. Use the IB parameter to create a diskette on
which you can place any version of MS-DOS using that version's
SYS command. Do not use IB with IS or IV.
r! IS causes FORMAT to copy the hidden system files and COM-
MAND.COM to the diskette after it is formatted. This makes
r-.
the newly formatted diskette a system diskette.
i
99
Chapter 6 / Command Reference I
e-..J
I ,
---..J
Notes and Suggestions
• Use FORMAT to prepare a new disk to receive data. Before
you can store information on a new disk, you must prepare it
using FORMAT. After formatting, record the volume label and
date of creation. Store this information in a safe place. It helps
you estimate how long a diskette has been in use.
While formatting the diskette, FORMAT displays:
, :
Insert new diskette for drive A: U
and strike any key when ready
Note that FORMAT prompts you to insert the disk. If the disk
is already in the drive, press the space bar. FORMAT
displays:
For ma t tin 9 ... 1 I
.~
100
Chapter 6 / Command Reference
r-'
II ''
Examples
I for rna t I ENTER I
I
,----,
i
I
,----,
I
,----,
i
r-'
I
101
Chapter 6 / Command Reference
, I
FORMAT External
I ~ 1 FORMAT drive: [lB] [IV] [11] [18] [IS] : )
~
Prepares the disk in the specified drive for use by defining the
tracks and sectors and writing system information onto the disk.
Parameters
drive: is the disk drive to format.
IB formats a diskette with eight sectors per track and allocates
space for the hidden system files. If you use this switch, you can , i
place any version of MS-DOS on the diskette using that version's e-.J
SYS command. If you do not use IB, you can place only MS-DOS
version 3.2 on the diskette with the SYS command. Do not use I
IB with IS or IV. ----.J
102
r--
i
I ' Chapter 6 / Command Reference
r-
I '
t
• You must specify the drive that you want to format.
• FORMAT uses the drive type to determine the default format
r
( for a disk.
• When you format a hard disk, FORMAT prompts you with the
It following:
_
Enter current Volume Label for drive (x:)
~
I
Press I ENTER I if your hard disk does not have a volume label. (If
,- your hard disk has never been formatted, or if it has a bad
boot sector, FORMAT will not prompt you for a volume label.)
r If the volume label that you enter does not match the label on
I the hard disk, FORMAT displays the message:
Invalid Volume ID Format fallure
Otherwise, FORMAT continues:
WARNING, ALL DATA ON NON-REMOVABLE DISK DRIVE
"
I
t
x WILL BE LOST! Proceed with Format (YIN)?
If you want to format your hard disk, type Y I ENTER I. If you do
r not want to FORMAT your hard disk, type N I ENTER I.
• If the operating system isn't on the default drive, FORMAT
prompts you to insert a system disk in the default drive (or in
Drive A if the default drive is a hard disk drive).
• When formatting is complete, FORMAT displays a message
r--"1 showing the total disk space, any space marked as defective,
!: the total space used by the operating system (when you use
the /S switch), and the space available for your files.
• Formatting destroys any previously existing data on a disk.
• FORMAT ignores drive assignments created with the
ASSIGN command.
• You should not use FORMAT with drives used in the
ASSIGN, JOINT or SUBST commands.
,.,
I
:
103
Chapter 6 / Command Reference
\
,
.:
• You cannot format drives over the network. FORMAT returns L....J
the following errorlevel codes:
! )
a= Successful completion ~
3 = Terminated by user (Control-C)
4 = Fatal error
(any error other than 0, 3, or 5)
5 = "N" response to hard disk prompt, "Proceed with
format (YIN)?"
You can check these exit codes by using the errorlevel option
with the IF batch processing command.
• Use FORMAT to prepare a new disk to receive data. Before , ,
I
you can store information on a new disk, you must prepare it :~
104
Chapter 6 / Command Reference
r GOTO Internal
r- GOTO label
A batch file command that transfers control to the line (in the
I batch file) following the one specified by label.
I
Parameters
:-
I
I
label is a character string. MS-DOS considers only the first 8
characters; it ignores the rest. When a batch file executes, the
r
I
l .
screen does not display its labels. Therefore, you can use labels
to include comments in a batch file.
~
Examples
copy can chekdest.bat [ENTERI
rem When executing, substltute the drive for %1
and the d ire et a r y for %2 I ENTER I
rem When executing, substitute the source file
for %3, the tar get for %4 I ENTER I
I
%1 ENTER I
c h d l r %2 I ENTER I
i f nat ex 1 s t %4 got a 9 I ENTER I
t Y P e i. 4 I ENTER I
p a use I ENTER I
: 9 I ENTER I
cap y i.3 i. 4 I ENTER I
: end I ENTER I
mJ [ENTER I
105
Chapter 6 / Command Reference
1 ;
1
1 1
l.-J
This batch file checks to see if a file exists before copying it.
Suppose Newfile.asm exists in the root directory of Drive B, and
you execute the batch file by typing: ; )
u
Chekdest B: \ oldfile.asm newfile.asm I ENTER I
As instructed in the command line, the batch file replaces %1 1
1
J
I
en
Newfile.asm, press the space bar. If not, press I CIRL I
I
L.-....J'
If Newfile.asm does not exist in the directory, the batch file goes
I i
to the line following :G. Therefore, it does the copy automatically, I
e-J
1
without pausing.
I I
U
i.J
I '
J
1 I
---'
106
Chapter 6 / Command Reference
n GRAPHICS External
i: GRAPHICS ptype [lR] [lB] [leR] [lLF]
Reproduces a graphics screen on a printer
I
I
Parameters
ptype is one of the following printers:
Code Printer
CGP220 The Tandy CGP-220 color ink jet printer
STANDARD Any Tandy printer (other than the CGP-220
or the DMP-llO) without DIP switch set-
r tings for
compatibility
Tandy and PC printer
r
I
,.....,
,i
107
Chapter 6 / Command Reference
, .
i I
~
Notes and Suggestions
• The fCR and fLF switches only affect printers that are Tandy ! I
DMP standard, or are PC compatible. If you find that a line
feed is not performed when required, or that an unwanted
blank line is printed between text, use the appropriate fCR or
fLF switch to correct the problem.
:Lji
• Once GRAPHICS is initialized, reset the computer to turn off
this function. If GRAPHICS is not initialized, pressing I SHIFT I
[ PRINT I causes a text screen to be printed. When GRAPHICS is
initialized, I SHIFT II PRINT I causes the image of a graphics screen
to be printed. Pressing I SHIFT I I PRINT I a second time terminates
. i
a current print operation. u
• Graphics images are printed in a maximum of 8 shades of
gray on a black and white printer, or in 16 colors on a CGP- I
I
!
I
220 printer. On black and white printers, the image is printed ~
J
I I
----'
108
,
~
1 .
Chapter 6 / Command Reference
I
I
'
'.
HFORMAT External
r
I
1
8o 1 ~ HFORMAT [drive][lS][lV][lB]
~
Parameters
drive is a drive specification of C: or greater. If you omit the
drive, HFORMAT uses Drive C.
IS causes HFORMAT to copy the hidden system files and
I COMMAND.COM from the MS-DOS system disk in Drive A to
L _
the hard disk after it is formatted. This makes the newly format-
r---,
ted disk a system disk.
I
I IV causes HFORMAT to prompt for a volume label after the disk
is formatted. If you use this parameter, you can enter a label of
a maximum of 11 characters, or you can press [ENTER I to bypass
the prompt.
IB causes HFORMAT to prompt for information it needs to lock
r out flawed areas on the hard disk so that MS-DOS never writes
to them. (Having a small number of flawed areas is not
uncommon.)
,...,
I
L Notes and Suggestions
• Appendix D outlines the entire hard disk setup procedure.
I : Refer to this appendix as necessary when setting up your
hard disk.
r-' • Before you can store information on a hard disk, you must
I
I
prepare it using HFORMAT. During formatting, you have the
option of transferring the system files to the hard disk, mak-
ing it a system disk. System files can only be transferred
r--'
I ' using HFORMAT IS. Type cOP Y A: * . * c: I ENTER I to copy all
other files from your system diskette to your hard disk.
• Immediately after you enter the HFORMAT command, HFOR-
r
t MAT displays a message such as:
Press any key to begin formatting drive
r
I
109
Chapter 6 / Command Reference
J
Press the space bar. HFORMAT displays:
Formatting cylinders
I :
o
i I
, !
L,..J
When the format is done without error, each dash, which rep- \ :
resents an area on the disk, becomes a period. A question
mark in place of a period indicates that a portion of the disk
contains flawed areas. HFORMAT locks out these areas so
that MS-DOS never writes to them.
When the format is complete, MS-DOS displays this message:
, I
nnnnnnnn bytes total disk space U
nnnnnnnn bytes in bad sectors
nnnnnnnn bytes available on disk
J
Examples
)
hfor ma t / s [ENTER I
U
formats Drive C and transfers the system files to it. After
removing the Drive A diskette and resetting your computer, you
can start up your system under hard disk control.
, I
, !
'---'
, I
, I
---'
L
: I
~
I
--.J
, I
I I
'----'
110
Chapter 6 / Command Reference
I'
,
-HSECT External
..-
I
I
I~ Ilei HSECT [drive:]
Formats hard sectors on a hard disk. Use FDISK and HFORMAT
I to complete the hard disk format process.
l ~
Parameters
..-
l drive is the hard disk to be formatted. Your primary hard disk is
Drive C, a secondary hard disk is designated Drive D. If you
omit drive, HSECT uses Drive C.
I
I
l _.
Notes and Suggestions
Example
r-
I . h:oect c:
loads HSECT from the current drive, and formats the hard sec-
tors of Drive C. The prompt, Format completed!, appears
when the process is finished.
r
!
i"
111
I I
Chapter 6 / Command Reference U
HSECT External
~B HSECT i
,
~
I
I
Hard formats track and sector information on the hard disk. Use
FDISK and FORMAT to complete the hard disk format process. i I
~
LJ
Which hard drive do you
want to format (C/O)
? : '
w
To format the primary hard disk drive, type c\ ENTER I. To for-
mat a secondary hard disk drive, type d I ENTER I.
• After you select the disk to format, the screen displays the fol-
lowing warning:
All data on drlve x wlll be DESTROYED!!
Do you want to contlnue (YIN)
J
? )
I !
If you continue, HSECT erases all data from the hard disk. '-
Use HSECT only when you are installing an operating
system on your hard disk for the first time.
I ;
L..-J
Type n [ENTER 1 to exit the formatting procedure and return to
the Main Menu, or type y [ ENTER I to continue.
112
Chapter 6 / Command Reference
I
I
113
Chapter 6 / Command Reference . i
U
I
I
i
I
IF Internal '--'
Parameters
NOT changes the IF command so that the command executes
only when the condition is false.
condition is one of the following:
ERRORLEVEL number indicates that the command is to
execute only if the program previously executed by COM-
MAND has an exit code of number or higher.
stringl = = string2 indicates that the command is to exe-
cute only if stringl and string2 are identical after parame- i I
t--1
ter substitution. Strings may not have embedded
separators.
, I
EXIST pathname indicates that the command is to execute '---.!
only if the file specified by pathname exists.
I •
: I
U
I
.--1
,I I,
~
114
Chapter 6 / Command Reference
I:
I'
!
I'
i
115
Chapter 6 / Command Reference I
.
I
I
LJ
Examples
if not exist myfile echo can't find flle I ENTER I
displays Can' t fin d f i 1e if the file Myfile doesn't exist.
if exist all.lst goto g
sends program execution to the line after :G if all.lst exists. LJ
:! ~
I I
~
I I
I
I I
I
I
.-..1
\ I
LJ
\ I
L.J
116
i
i : Chapter 6 / Command Reference
JOIN
I (ifJ 1 JOIN [drive:] [pathname] [lD]
Parameters
drive: is the drive to be joined.
pathname is the drive and directory to which drive is joined.
/D turns off the effects of a previous JOIN command. You cannot
use /D with the pathname parameter.
~
I
117
Chapter 6 / Comnwnd Reference J
i
KEYTXX External e.-J
I ~ 1 KEYTXX [IUS]
Replaces the current ROM BIOS keyboard program with an
international keyboard program. i f
U
Parameters
IUS tells KEYTxx to convert character scan codes to US scan : I
LJ
codes.
gram, press I CTRL I I SHIFT I [ill. (Use the shift key on the left side U
of the keyboard.) To select the resident KEYTXX program
with true scan codes, press I CTRL II SHIFT I [ill. To select the resi-
dent KEYTXX program with US scan codes, press I CTRL II SHIFT I J
[ill.
• Although you can have more than one KEYTXX program res- : I
ident in memory at one time, you can operate only in the last U
loaded version.
: [
• You can use the SELECT command to create a DOS diskette I
L...J
,
I"'
I
~'
[ :
I:
n
I ~
r-'
I :
\:
r
[
I
i
'
119
Chapter 6 / Command Reference
J
I
LABEL External U
I
~
I I
LJ
I
U
120 J
Chapter 6 / Command Reference
LF External
~ LF
! '
n
I
,--,
I
,--;
I ~
I
I'
I '
I'
,
121
Chapter 6 / Command Reference
LPSETUP External
LPSETUP switch, ptype, port [,page] : I
'-
Enables a printer filter that allows pagination. The text for the
page header and footer are entered into this filter with special , I
Escape Code Sequences. LJ
Parameters , I
i
,........)
switch is the filter status:
ON causes the printer pagination filter to become resident
and to take control. J
OFF temporarily disables this filter.
ptype is the printer type:
TANDY is a Tandy printer that is not in IBM mode.
: I
IBM is a Tandy or other printer that is set in IBM emulation U
mode. (See your printer manual for more information.)
port is the parallel printer port this pagination printer filter
uses. port can be 1, 2, or 3. u
page is the starting page number, in the range 1-65535, of the , I
, I
printout. The default page number is 1. '---.J
122
Chapter 6 / Command Reference
I~
• The first three parameters must all be included on the com-
mand line when ON is specified. OFF should be specified
r
I
alone. For example, LPSETUP ON, 18M, 1 and LPSETUP OFF
are valid commands, but LPSETUP ON, IBM is not.
• Each time LPSETUP is turned on, any previous escape codes
I'
sent to a printer in IBM mode (or to LPDRVRSYS) that deal
i ' with page length or perforation skip are cancelled. Otherwise,
there would be conflicts between the pagination attempted by
LPSETUP and that by the IBM printer or LPDRVRSYS. If
your printer is not IBM-compatible, and has been issued
escape codes an IBM printer would not understand, consult
r: your printer manual and cancel those codes to prevent the
I same printer/LPSETUP pagination conflicts mentioned above.
In particular, use whatever code it takes to cancel skip
perforation.
• Each time you invoke LPSETUP with the ON parameter, the
line number is set to 1, and the page number is either set to
the page number value in the command line, or to 1 if you
r j , omit that parameter. All other pagination settings (number of
lines per page, number of lines to skip over page perforation,
,..--. etc.) are not changed until a new escape code is issued for
I . that particular pagination setting.
I
• You must re-type the LPSETUP command each time the clock
inside your computer rolls over to a new 24-hour period (day)
to insure LPSETUP has the current date.
• If the parallel port number you specify is not available
..... (because the appropriate parallel board is not installed in
! your machine), you will be told so, and the entire command
will be aborted!
r:
I
,--,
I :
~
I
123
Chapter 6/ Command Reference
I i
~
• The characters I CNTL I II) (form feed) and I CNTL I IT] (end-of-file
marker) are trapped by LPSETUP, and are never actually
sent to the printer. A I CNTL III) will cause LPSETUP to auto-
matically print a footer on the current page, skip perforation,
and print the header on the next page, in that order. A I CNTL I
[I] will also cause LPSETUP to print the current page footer i
and issue perforation skip, but the new page number is set LJ
back to 1, and the header on this new page is not printed until
the first character to be printed on that page is sent. Hence, , I
issue a I CNTL I II) (by the LPRINT CHR$(&HC); command in ~
BASIC, or by using the PRINT utility) after each printed file
when you want to print your next file at the beginning of a
new page, but you do not want the page number of that next
page set back to 1; Issue a I CNTL I IT] (by the LPRINT J
CHR$(&H1A); command in BASIC) when you want the same
results, but with the page number set back to 1. Note, how- , I
ever, that a I CNTL I IT] has no effect if issued immediately l-i
after a I CNTL I II); at least one line of text must be printed
beyond the page header before a I CNTL I IT] will be heeded! I I
L ....I
• Each time you change the pagination format of LPSETUP
using one or more escape code sequences, be sure to set your
printer to top of form on a new page, and re-invoke the , I
I
LPSETUP command. L...J
124
i
I
I
' Chapter 6 / Command Refereru::e
r:
I " ESC 9B(Hex) 0 or 1
Input to toggle automatic page numbering on and off,
respectively, Note that embedded page numbering by the
"P + =" delimiter will always print the page number at
the designated location.
r-' ESC 9C(Hex), 0 or 1
i ' Input to specify the end-of-line character for each line
printed: 0 = line feed after each carriage return (ASCII
......
I
OD hex); 1 = line feed only after each line feed character
i ' (ASCII OA hex). Whether AUTOMATIC page numbering
is on or off.
ESC 'C' 1 to 255
Input to select number of lines per page.
...... ESC 'N' 1 to 255
i ' Input to set number of lines to skip over perforation per
page.
ESC '0'
Input to turn off page perforation skip.
n
L ;
Examples
lpsetup on,tandy,1 ,65fil
,r-"'
I
I
I
'•
!
I"'
,I
125
, J
Chapter 6 / Command Reference ~
I I
LJ
To send escape code sequences in formatting your printed page,
refer to this BASIC example.
I •
~
10 LPRINT CHR$(&H1B);CHR$(&H99); 'PRINT :
l---i
ESC,99,<HEADER TEXT>,0
20 LET HEAD$="*** THIS IS THE HEADER
i i
***"+CHR$(&HD)+CHR$(&HA)+"SECoND LINE"
30 LPRINT HEAD$;CHR$(&HD);CHR$(&HA);
LJ
40 LPR I NT "ON TH I S 3RD LI NE OF THE HEADER, DATE:
, I
D+=; TIME: T+=; PAGE: P+="; I I
50 LPRINT CHR$(&HD);CHR$(&HA); l.-!
60 LPRINT CHR$(0);
70 LPRINT CHR$(&H1B);CHR$(&H9A); 'PRINT I •
ESC,9A,<FooTER TEXT>,0 U
80 LET FooT$="*** THIS IS THE FOOTER
***"+CHR$(&HD)+CHR$(&HA)+"LINE 2" , )
90 LPRINT FooT$;CHR$(&HD);CHR$(&HA); ~
100 LPRINT CHR$(0);
110 LPRINT CHR$(&H1B);CHR$(&H9B); 'PRINT ESC,9B,0
, I
OR 1
120 LPRINT CHR$(1); 'TURN ON AUTOMATIC PAGE U
NUMBERING.
130 LPRINT CHR$(&H1B);CHR$(&H43); 'PRINT ESC, , I
'C',<# LINES PER PAGE> U
140 LPRINT CHR$(66); '(66 LINES/PAGE
IN THIS EXAMPLE).
150 LPRINT CHR$(&H1B);CHR$(&H4E); 'PRINT ESC,
'N',<# LINES TO SKIP PERF
160 LPRINT CHR$(2); '(SKIP ON, SKIP
2 LINES IN THIS EXAMPLE). ,I
L-J
170 LPRINT CHR$(&H1B);CHR$(&H9C); 'PRINT ESC,9C,<0
OR 1> TO SET END-oF-LINE
180 LPRINT CHR$(O); 'CHARACTER ,, .i
(CARRIAGE RET, IN THIS EXAMPLE). --..J
j
126
r---'
r
i
MKDIR (Make Directory) Internal
r-
,, MKDIR pathname
MD pathname
Makes a new directory. You use the MKDIR command to create
a hierarchical directory structure.
Parameters
pathname tells MS-DOS under which directory to create the new
directory and specifies the name to give it. The pathname can
i! ' be either relative or absolute.
I"'
I '
I
I"'
i
I
~
I"'
I
(
[ \
r-
i
I
,--..
i
I
127
Chapter 6 / Command Reference
Examples
mk d i r \ bin I ENTER I I '
~
creates a directory that you can use to contain your external
commands. Use COpy to copy your command files into this
( ~
directory, then use PATH to tell MS-DOS where to search for the I •
commands. W
, I
\ 1
. I
I I
----J
r
~
!
-1
128
~
r
I \
MLFORMAT External
I ~ 1~ MLFORMAT drive:
Formats a DOS2 partition created previously using
!
I
MLPART.COM (and accessed via the installable MLPART.SYS
device driver). You must format the partition to use it.
r-'
I Parameters
i '
drive: is the logical drive letter that refers to the DOS2 parti-
tion to format. MS-DOS assigns and displays the letter when it
r installs the MLPART.SYS device driver (loads it from disk into
memory). It displays the letter in the following format:
Tandy MLPART version xx.xx.xx
split disk drive
Installing additional drive on
!
I ' Notes and Suggestions
• Appendix D outlines the entire hard disk setup procedure.
r1 ' Appendices Band C include information on installing
MLPART.SYS. Refer to these appendices as necessary when
setting up your hard disk.
rI
t '
Examples
r--; rn 1 for rna t e: [ENTER I
I
r \
I
formats logical drive E.
r
I '
r-'
l '
r
I
129
:I '
Chapter 6 / Command Reference L-!
MLPART External
~/#-
! @ I ~D~ MLPART
,
I
,
,
i (
LD ~ L..-.J
r
l
Examples
m1 par t I ENTER I
loads mlpart from the current drive, and displays the MLPART
menu. To create one or more DOS2 partitions (assuming you
....- have a DOS partition), press OJ. The screen displays the status
I '
l of Drive C in this format:
,..--,
Partltion Status Type Start End Size
I 1 N DOS ~ 49 5~
! \
ri
,..,
I !,
I
,-.,
i :
\'
i
I
131
Chapter 6 / Command RefereW)e
I i
MODE External
Sets video monitor, line printer and communication interface I :I
L-.."
parameters.
MODE [characters][shiftf1j]
I I
Shifts the video screen left or right. characters is the desired
character width (40 or 80). shift can be R (right) or L (left). T
produces a video test screen for evaluating the shift. A prompt
asks if you wish another shift. Answer Y (yes) or N (no).
MODE linefeed
Sets printer linefeed off or on. linefeed can be LFOFF or LFON.
MODE printer
Sets printer type. printer can be DMP (dot matrix), DWP (daisy
wheel), or NL (reset).
MODE scan iL-....J:
Sets video scan lines. scan can be either 200 or 225.
MODE [video][characters] iu i
Sets video mode and characters-per-line. video can be BW (black
and white) or CO (color). clw,racters can be 40 or 80. I 1
MODE COLORMAP [old color new color] ~
LJ
Black Blue Green Cyan
Red Magenta Yellow Gray
Dark Gray Light Blue Light Green Light Cyan
Light Red Light Magenta Light Yellow White
: i
---l
132
Chapter 6 / Command Reference
l _
MODE COMnumber: [baud][parity][databits][stopbits][P]
Sets the RS232 communication parameters:
number is the RS232 port to set, either 1 or 2.
baud can be a baud rate of 110, 150, 300, 600, 1200, 2400,
r
I
parity
4800, or 960. The default is 300.
can be N (no parity), 0 (odd parity), or E (even par-
ity). The default is E.
,....-. databits can be either 7 or 8. The default is 7.
i . stopits can be either 1 or 2 stopbits. The default is 1.
l ~
P tells the printer to continuously retry to output on
timeout errors.
l : To reset a RS232 port to the default values, type: MODE COM
number I ENTER I, where number is the RS232 port number. The
default values are set and displaved on the screen.
MODE FAST
Sets the CPU speed to 7.16 MHz (the default).
MODE LPTl:characters [ltype][,P]
,..,
I ,
Sets printer characters-per-line. characters can be 80, or 132.
L~ type is the printer type: DMP for dot matrix printers or PC for
PC-compatibles. The default is DMP. IP causes continuous retry
on timeout errors.
MODE LPTl: timeout
Sets the line printer timeout delay. timeout can be LONG (2
I'
l
minutes) or SHORT (45 seconds).
M<j)DE LPTl: = COMnumber:
r-:
I Redirects parallel printer output to the specified RS232 channel.
1- '
number can be 1 or 2. Initialize the selected RS232 channel
using MODE COMnumber: before redirecting printer output.
r
I .
I
133
! !
Chapter 6 / Command Reference ,
i.-J
I
: I
MODE MONO [switch] ~
: I
L...J
134
!
l Chapter 6 / Command Reference
,.........,
mode com1: 3fHl n 8 1 [ENTER I
I
: sets the Number 1 RS232 interface to 300 baud, no parity, 8
databits, and 1 stop bit.
" mode fa5t I ENTER I
L
sets the CPU speed to 7.16 MHz.
mode lpt1 : 132/pc I ENTER I
specifies a line printer column width of 132 for a PC-compatible
printer.
mod e 1 p t 1: 1 on 9 I ENTER I
sets a two-minute line printer timeout delay.
mode lpt1: =com1 I ENTER I
redirects printer output to serial Port 1.
~
L.. mode mono on I ENTER I
sets the computer to use color-oriented software with a mono-
r-'
I : chrome monitor.
mode 51 ow I ENTER I
,--,
i sets the CPU speed to 4.77 MHz.
l
mod e t v [ ENTER I
sets 200 video scan lines, color video mode, and 40 characters
per line.
-,
,I '
,--.
I
C ,
135
I, II
Chapter 6 / Command Reference
MORE External
MORE L.\
I
Examples , '
~
type myfdes.comlmore I ENTER I
displays the file Myfiles.com one screen at a time. MS-DOS dis- I
IENTER I to continue.
type b:acetspay.datlmore I ENTER J
LJ
displays the file Acctspay.dat from the home directory of Drive
B, one screen at a time. MS-DOS displays the message _MORE_ i '
at the bottom of each screen. Press IENTER I to continue. L.J
;
U
i
,
i;
L...l
, i
~
: i
"--"
J
!
,~
I
136
:-
L_~ Chapter 6 / Command Reference
PATCH External
PATCH pathname,address,datal,data2
Lets you make minor corrections in any disk file, provided that:
• You know the location of the bytes you want to change.
• You want to replace one list of hexadecimal values
with another list of the same length.
........, Parameters
L pathname is the file you want to change.
address is the starting address of the data to be changed (in
hexadecimal) .
datal is the list of the hexadecimal values to be changed.
~
I I
I data2 is a list of the hexadecimal data values to replace datal.
patch b:filex.exe,1A23,4462A3,436~B2
IENTERJ
patches the file FILEX.EXE, located on Drive B. The command
changes bytes lA23 through lA25 to the hexadecimal values 43,
60, and B2 (assuming that they are originally 44, 62, and A3).
........,
i
:-
I
137
Chapter 6 / Command Reference I
I
I
,
~
PATH Internal
PATH [;][pathname[;pathname ... ] I,
I '
L..-!
I'
Parameters ,
, I
I ;
I '
~
I I
I '
~
u
\ I
:--J
138
J
Chapter 6 / Comrnand Reference
[
Notes and Suggestions
• PATH gives you the option of using commands that are not in
the current directory. Suppose the root directory in Drive A
contains so many files it is difficult to use efficiently. To save
space, create the directory A: \ BIN (using MKDIR) and put
your commands there (using COPY). Then remove your com-
mands from the root (\) of Drive A (using DEL).
Now, suppose you start up MS-DOS and immediately format a
disk in Drive B. Because FORMAT is an external command,
you must do either of the following:
• Use CHDIR to make A: \ BIN your current directory.
• Use PATH to make MS-DOS search A: \ BIN for external
commands. You can specify A: \ BIN only, or you can specify
all directories on Drive A, separating them with semi-
colons. To specify A: \ BIN only, type:
I' path a:\bin I ENTER J
I
Type PATH I ENTER I to verify the path setting.
Examples
r-
L._
139
I I
Chapter 6 / Command Reference L;
, i
-J
PAUSE Internal
PAUSE [message] I i
~
Suspends execution of the batch file and lets you exit the batch
file or continue. I I
~
Parameters
message specifies a message to display. The message and s t r ike
a key when ready . . . appear on the screen if echo is on.
, I
At this time, you can press the space bar to continue execu- I
tion, or you can press I CTRL I (]J to display: --'
Terminate batch job (YIN)?
\
, I
If you press Y, execution ceases and control returns to MS- L.J
DOS. If you press N, execution continues.
,I
• During the execution of the batch file, you might need to per- ,
form some action before executing the next command (change '-.-J
diskettes or ready the printer, for example).
:
Whenever this is the case, include a PAUSE command where ~
necessary. For example, suppose you want to list two files that
are on different diskettes. Create a batch file by typing: \
, I
~
140
Chapter 6 / Command Reference
r
I '
,
i
\ '
r,
141
Chapter 6 / Command Reference
l
I
'---'
I
Examples
echo pre55 ctrl-c If un5ure or [ENTER I
pau5e [ENTER I J
pauses execution and displays the message:
,
Pre55 CTRL-C if un5ure or Strike a key when I
~
I
ready
I I
I
'---'
I l
~
!
I )
I I
LJ
; I
'--'
i I,
----J
142
Chapter 6 / Command Reference
PRINT External
I ~ I PRINT [pathname [Ie] [lP]. ..] [IT]
Lets you put a maximum of ten files in the print queue, so that
MS-DOS prints them automatically while you process other MS-
DOS commands. This is called background printing. The printer
must be connected and ready.
Parameters
pathname is the name of the file you want to print. The path-
name can include a drive reference but cannot include direc-
tories. The file must be in the current directory of the drive
specified.
~
l IC deletes (cancels) from the print queue the file that immedi-
ately precedes and all files that follow IC in the command line.
IP adds to the print queue (prints) the file that immediately pre-
cedes and all files that follow IP in the command line.
IT deletes (terminates) from the print queue all files that are
[ there, waiting to be printed.
Regardless of the number of IC and IP parameters your com-
mand includes, each switch always affects the file immediately
I, : preceding it. For example, if you type this:
pr 1 nt bud 9 e t /P 5 ale 5 r en tal 5 / C I ENTER)
MS-DOS adds the files Budget and Sales, but cancels the file
Rentals.
If you omit all parameters, PRINT displays the contents of the
print queue.
r-'
I .
i
I1
143
Chapter 6 / Command Reference 1 I
U
: I
U
, ,
~
: I
--J
144
J
Chapter 6 / Command Reference
oI
Examples
pr i n t / t I ENTER I
empties the print queue.
prlnt a:\temp1 .tst/c a:\temp2.tst a:\temp3.tst
I ENTER I
removes the files A: \ Templ.tst, A: \ Temp2. tst, and
A: \ Temp3.tst from the print queue.
p r 1 n t t em p 1 . t s t / c t em p 2 . t s t / pte mp 3 . t s t I ENTER I
removes the file Templ.tst from the queue and adds the files
Temp2.tst and Temp3.tst. PRINT can output either of the follow-
ing messages to the printer. They serve only to remind you that
the printout is incomplete.
All flIes Canceled by operator
You used the IT parameter to cancel the printing of all files in
the print queue.
drive:filenBme.ext Canceled by operator
I You used the Ie parameter to cancel the current file in the print
queue.
r---:
[ .
145
Chapter 6 I Command Reference ,
LJ
PRINT External
I a 1 PRINT [pathname [lD:device] [/B:size] ,
,
1
r
Prints a file on a line printer while you are processing other MS-
DOS commands (background printing). J
Parameters
pathname is the name of the file you wish to print. The path-
name is a complete path, including drive and directories.
ID:device specifies the print device. If not specified, the default LJ
device is LPT1 (printer numberl). If you do not use ID:device, the
first time you use PRINT, it qisplays a prompt that asks for the r !
print device. ~
~
• The disk containing the files to be printed must remain in the
specified drive until all printing is complete.
146
J
Chapter 6 / Command Reference
Examples
r-
I . print temp1.tst temp2.tst temp3.tst
I
stores the three files indicated in the print queue. If your printer
is connected and ready, background printing begins.
print It
empties the print queue.
print a:temp1.tst Ie a:temp2.tst a:temp3.tst
removes the three files indicated from the print queue.
prlnt temp1.tst Ie temp2.tst Ip temp3.tst
removes Temp1.tst from the queue, and adds Temp2.tst and
Temp3.tst to the queue.
I
I
I
I
,!
I
r-'
!
147
Chapter 6 / Command Reference J
. I
PROMPT Internal ~
PROMPT [prompt-text]
w
I
Parameters
prompt-text is a string of characters to set as the prompt. It can
be any of the following: i I
LJ
• A string of characters, such as your name.
• A special prompt in the format $character, in which character
is one of those in the chart below.
J
• A combination of characters, strings, and special prompt(s).
In the prompt text you must precede the following symbols
J
with the $ character.
, I
I
Character Prompt L..J
b The I symbol cJ
A carriage return and line feed
q The = symbol J
h A backspace
e The escape sequence J
If you omit prompt-text, MS-DOS sets the current drive speci-
fication as the prompt.
148
J
Chapter 6 / Command Reference
• By setting the time as the prompt, you can check the time
without entering the TIME command. In this way, you can
also time the execution of commands and programs. To set the
time as the prompt, type:
p romp t $ t I ENTER I
• You can use $_ to insert a carriage return and line feed in
your prompt:
r:
I '
prompt TIME $q $t$_DATE $q $d I ENTER I
In this case, the new system prompt is similar to the
n
I I
following:
TIME = ~:~7:~4.~7
DATE = Thu 11-15-1984
n
I ' • Because your computer has an ANSI escape sequence driver
(ANSLSYS), you can use escape sequences in your prompts, if
the ANSI device driver is configured into your system. (See
I'
I ' Appendix B.) For example:
prompt $e[7m$n:$e[m I ENTER I
sets the prompts in reverse video mode and returns to normal
video mode for other text.
r:
I
Examples
pro mp t $n $ 9 I ENTER J
sets the prompt A>. Regardless of which drive you are in, this is
the prompt.
149
Chapter 6 / Command Reference . I
L...J
prompt $p I ENTER I
sets the current directory, including the current drive, as the
prompt.
Note: As you can see from the A$g example, some
prompts hinder rather than help. Use PROMPT
carefully.
: j
U
LJ
J
!
LJ
I
J
! I
~
I
. I
LJ
: I
~
150
I: Chapter 6 / Command Reference
RECOVER External
,---,
,I RECOVER pathname
RECOVER drive:
Recovers (1) a file that contains bad sectors, or (2) all files on a
disk that contains bad sectors in its directory.
,--' Parameters
j \
pathname specifies the file to recover.
,---, drive: specifies the disk to recover.
! :
Notes and Suggestions
~
1
I
'
I
• If you perform the RECOVER procedure on an entire disk, it
changes all filenames to the format, filennnn.rec, where nnnn
is a four digit number unique to each file.
~
[ I • In recovering files that contain bad sectors, MS-DOS reads the
file sector by sector. It marks the bad sectors in a system
table so that the data is never again allocated to them.
~
I • In recovering disks that contain bad sectors, MS-DOS scans
the disk File Allocation Table (FAT) for chains of allocation
units. It creates a new root directory for each chain. Use the
RECOVER drive: command only if the disk's directory is
unusable.
• If there is not enough room in the root directory, RECOVER
displays a message to this effect. It then stores information
about the extra files in the File Allocation Table. When there
is enough room, you can use RECOVER again to regain the
I"
I files.
• If you have trouble storing and manipulating information, the
~ disk may have a flawed sector. Running CHKDSK (check
I I
disk) should indicate whether this is the case. If the file that
contains the flawed sector is a text file, recover the file. This
saves all information except that in the flawed sector. Reenter
Ir . the lost information. If the file is a data file, recovering the
file mayor may not help.
r, • If you are a beginner, you may prefer reentering all informa-
I ' tion rather than trying to recover a file.
r
I '
151
Chapter 6 / Command Reference !
u
:L..Ji
Examples
recover \user\sam\pamphlet.txt I ENTER J
i .;
recovers the file \ USER \ SAM \ Pamphlet.txt that is on the cur- "--"
rent disk.
recover oldbook.txt I ENTER I : I
'---!
i j
I I
• I
'-,
; i
L.J
,
I i
'--.!
152
I Chapter 6 / Command Reference
l
Parameters
remark is a message tl;lat a batch file displays during execution
if ECHO is on.
Examples
r--'
rem Thi5 flle i5 called billfile.bat I ENTER I
l
The REM statement is displayed if ECHO is on.
r
! .
rem pathname1
r,2
replace5 r,1, pathname2 replace5
:
The above command creates a batch file that, when executed,
first reminds you to replace parameters %1, %2, and %3 when
executing the file. The second remark simply reminds you of the
file's name.
rI '
I
153
Chapter 6 / Command ReferelWe ! !
~
, I
RENAME Internal LJ
MS-DOS changes only the extension of all .lst files that are in
I I
the current directory. The new extension is .prn. The file Sue-
file.lst, for example, becomes Suefile.prn. ~
Examples I
_! I
r en b: \ u 9 e r \ 9 11 . da t 9 12 . da t I ENTER I
changes the name of the Gll.dat file that is in B: \ USER to : 1
g12.dat. U
Drive B, to Myfile.
I !
, !
'---'
154 J
Chapter 6 / Command Reference
r
I
REPLACE External
r--'
I : [a 1 REPLACE source pathname [target pathname]
y [lA] [lD] [lP] [lR] [IS] [lW]
Parameters
i
L _ IA adds new files to the target directory instead of replacing
existing ones. Do not use this switch with ID or IS.
ID replaces files in the target directory only if the source files are
newer than the corresponding target files. Do not use this switch
with IA.
IP prompts you before replacing a target file or adding a source
file.
Replace (filename) ? (YIN) _
r
!
155
Chapter 6 / Command Reference
I I
'-..J
I
• If REPLACE encounters an error, it returns one of the follow-
ing errorlevel codes:
, I
1 Command line error I
~
I
This command. adds any files from the default directory of drive , :I
,
A with an extension of PRD (that do not currently exist in the '--.J
\MSTOOLS directory on drive C) to C:\MSTOOLS.
156
r-
.....
I '
RESTORE External
I"
I@I~~
i
RESTORE source drive: [target drive:]
o ....... pathname[lS][lP]
• If you wish to restore several files but not the entire disk, as
in the previous example, you may want to create a batch file
r
I consisting of the necessary backup commands. Then you can
do all the backups by simply running the batch file.
r'
I
I
157
i
Chapter 6 / Command Reference L--l
,I
Examples
res tor e i3: c: * . d i3 t / P I ENTER I I I
,""":fvI
restores all files from Drive A that have the extension .dat and
that were backed up from the current directory of drive C.
, I
res tor e i3: c: \ use r \ 5 tor e 1 • d i3 t I ENTER I ~
restores from Drive A the file Storel.dat that was backed up
from the USER directory of Drive C.
I I
---.J
I :
~
i I
U
I i
L.J
I
L..J
I
I )
L!
i
I I
'---'
\ i
I '
C-.J
158
r-
I ,
!l
RESTORE External
\'
i RESTORE source drive: [target drive:]
pathname [IS] [lP] [lB:date] [lA:date]
[/~:time] [/~:time] [/1V1] [/~]
r !L restores only those files that were last modified at or later than
the given time.
r
r
1M restores only those files that have been modified since the last
backup.
IN restores only those files that no longer exist on the target drive.
n
,-...,
l
ri
159
Chapter 6 / Command Reference
Examples
restore a: c:\ Is
i
V
I
restores all files backed up from all directories on Drive C.
restore a: c:*.dat/p I I
~
restores all files from Drive A that have the extension .dat, pre-
viously backed up from the current directory of Drive C.
I '
U
\ :
U
, I
: I
--.J
I )
LJ
LJ
J
~
I
160
Chapter 6 / Command Reference
Parameters
pathname is the name of the subdirectory to be removed.
! '
r-'
r
l
161
Chapter 6 / Command Reference J
I I
chdlr\user\ann\accts :..J
copy drugstor.dat b:\user\sue [ENTERI
erase drugstor.dat (ENTER I : I
c h d i r .. [ ENTER I u
rmdir\user\ann\accts [ENTERJ
\ '
U
i I
I I
~
I
,
II
C-.--.!
I I
I I
U
\ I
~
J
I
I
----.I
I
162
Chapter 6 / Command Reference
SELECT External
I,
I .
I ~ 1 SELECT country [keyboard[lUS]]
Changes the current country code or creates an internationally
configured backup MS-DOS diskette.
Parameters
country is the country code that MS-DOS uses to select the date
and time format, the currency symbol and the decimal separa-
tor. If you only specify country in the SELECT command, the
r
l .
current configuration is changed to the new country code. If you
also specify keyboard with or without IUS, a new MS-DOS
diskette is created. The IUS switch can only be used with a key-
board parameter. The following table shows the valid country
codes:
Country Country Keyboard
[ Code Code
Belgium 032 FR
~
I '
France 033 FR
Germany 049 GR
Italy 039 IT
Portugal 351 SP
Spain 034 SP
Netherlands 031 UK
United Kingdom 044 UK
Australia 061 US
French Canada 002 US
Israel 972 US
Middle East 785 US
United States 001 US
Denmark 045 *
r-' Finland 358 *
I i Norway 047 *
Sweden 046 *
Switzerland 041 *
*Indicates keyboard driver can be obtained separately.
r
I
163
Chapter 6 / Command Reference J
\ 1
Examples I '
I I
L-!
5elect ftl44 uk
causes the current date and time format, currency symbol and
decimal separator to change to French formats. " I
c.J
164
iL ;
Chapter 6 / Command Reference
SET Internal
r SET [name = [string]]
I
Sets an environmental variable equal to a string.
Parameters
name is the environment variable to assign to, string. name
cannot be numeric.
string is the string you are naming in the environment. If you
omit the string parameter, SET removes the variable name from
the environment. string cannot be numeric.
If you omit all parameters, SET displays the current environ-
ment variables and their settings.
l . cop y a: 7. f i 1 e n a me 7. b: I ENTER I
Note: Within the batch file commands, the string is
r enclosed by percent signs. Within the SET com-
mand, it is not.
!"""
The first time you run all the batch files, you may want to
[ , substitute Myfile for filename. To do this, use the SET com-
mand before you begin. Type:
I'
I
165
I \
Chapter 6 / Command Reference
U
I J
---l
I
~
166
r-
l Chapter 6 / Command Reference
167
Chapter 6 / Command Reference . I
.--1
1 I
Examples ~
I ENTER I
5 et d rive = b:
I '
LJ
LJ
i J
e...-..J
J
J
168
r-
I Chapter 6 / Command Reference
SHARE External
I ~ 1 SHARE [IF:space] [lL:locks]
Parameters
[' /F:space allocates file space (in bytes) for recording file sharing
i information. Each open file needs the length of the full filename
plus 11 bytes. The average pathname is 20 bytes. The default
value is 2048 bytes.
L:locks specifies the number of locks allowed. The default is 20.
r
, .
Notes and Suggestions
• Once you use SHARE in an MS-DOS session, SHARE checks
all read and write requests.
I'
I • MS-DOS uses SHARE only when networking is active.
Include the SHARE command in the AUTOEXEC.BAT file if
you wish to install shared files at startup.
Example
share /f:4096 /1:30
doubles the default number of bytes for the storage of file sharing
information, and increases the number of allowable locks to 30.
I'
I
169
Chapter 6 / Command Reference
: I
U
SHIFT Internal
SHIFT
Lets you use more than the usual ten replaceable parameters
I I
(0%-9%) in batch file processing. c...J
Notes and Suggestions
• To see how SHIFT works, suppose a batch file, Money.bat,
contains replaceable parameters, defined on the left in the fol-
lowing chart. When you enter the SHIFT command, each defi-
nition shifts one place. Instead of replacing %n, it replaces
%n-l.
Definitions Before Definitions After I I
Shift Shift I.-;
%0 = Money %0 = Pharm.dat
, I
%1 = Pharm.dat %1 = Autodeal.dat LJ
%2 = Autodeal.dat %2 =. Hardware.dat
%3 = Hardware.dat %3 = Grocery.dat
%4 = Grocery.dat %4 = Dimestor.dat
%5 = Dimestor.dat %5 = Theater.dat
: I
L...J
%6 = Theater.dat %6 = Cafe.dat
%7 = Cafe.dat %7 = Photo.dat J
%8 = Photo.dat %8 = Beauty.dat
I
%9 = Beauty.dat %9 = Undefined LJ
As you can see, %9 is now open to be redefined. Money, on the
I
other hand, no longer replaces any parameter. If you must U
refer to Money again, you must· set an environment variable
equal to %0 before you use the SHIFT command.
• You can execute as many shifts as needed. If you do, however,
include ECHO %n in your file as needed to keep track of each
replaceable parameter's current definition.
, I
U
:----'!
I '
170
Chapter 6 / Command Reference
Examples
shi f t I ENTER I
shifts all parameters that replace the parameters %0 through
%9 down one. Suppose that, before the shift, %1 equals Den-
r-. file.dat and %2 equals Myfile.dat. After the shift, %0 equals
I ' Denfile.dat and %1 equals Myfile.dat.
copy con shiftcop.bat I ENTER)
rem Stop execution at pause after all files are
cop i e d I ENTER I
I
: p a use ENTER I
p a use I ENTER I
cop y a: \ use r \ X 1 b: \ use r \ X 1 I ENTER I
s h i f t I ENTER I
got 0 p a use I ENTER I
I'
I rm I ENTER I
is a batch file that lets you copy as many files as you wish from
A: \ USER to B: \ USER. It substitutes the first given file for %1
and copies it. Then it substitutes the next file, copies it, and so
on. This way you can use SHIFT to gain access to more than ten
replaceable parameters. Even if you don't need that many
iI parameters, however, you can use SHIFT to save typing time.
To copy the files Find.exe, Name 1. asm, and Name2.asm from
A: \ USER to B: \ USER, enter the name of the batch file, followed
by the files to copy, as shown here:
shiftcop find.exe name1.asm name2.asm I ENTER I
r
I ' The batch file pauses before each copy, giving you the option to
stop. After it copies all files, press I CTRL I @] at the PAUSE prompt
r
I
(Stnke a key when ready ••• ).
r
I
171
Chapter 6 / Command Reference J
I I
~
SHIPTRAK External
lei SHIPTRAK i
1-.1
j
--J
Example
5 hip t r a k I ENTER I
J
parks your hard disk heads at the innermost tracks.
, f
i
L.....J
I
172
I ' Chapter 6 / Command Refere17£e
SORT External
SORT [lR] [I + n] [<input pathname]
[>output pathname]
SORT is a filter that reads input from the standard input device,
sorts the data, and writes it to the standard output device.
I'
I
Parameters
<input pathname specifies the file to be sorted. If you omit this
r-' parameter, SORT sorts keyboard input.
I >output pathname specifies the file to receive the sorted infor-
mation. If you omit this parameter, SORT sends the output to
the display.
/R reverses the sort (sorts from Z to A). If you omit this parame-
ter, the sort is from A to Z.
r:
L ' / + n begins the sort at Column n. If you omit this parameter,
the sort begins at Column 1.
r--;
r
i
173
Chapter 6 / Command Reference , I
LJ
! I
L..J
Examples
sort /r <unsort.txt >sort.txt I ENTER I ,
i ,
I
~....J
reads the file Unsort.txt, sorts the information in reverse alpha-
betical order, and writes the output to a file named Sort.txt.
di r Iso r t / +14 I ENTER I
, i
'--I
pipes the output of the DIR command to the SORT filter, which
sorts the directory listing, starting at Column 14, and displays , 1
the output. '-.J
d 1 r Iso r t / +14 I m0 r e [ENTER I
: I
is the same as the previous command, except that the MORE fil- LJ
ter displays the directory one screen at a time.
, I
LJ
: I
, I
,----'
1
: I
'U
, I
I I
L...J
I I
-.J
I
I I
LJ
J
l I
~
174
r-
I: SPOOLER External
II SPOOLER [lprinter] [lP] [IS] [Ie] [lG]
,
Lets you send commands to and get the status of the print
spooler, assuming the SPOOLERSYS device driver exists in
your CONFIG.SYS file.
Parameters
printer is the number of the printer you want to use. It can be
either 1 or 2. If you omit the number, the system assumes 1.
Notice that you must precede the number with a slash (I). You
can install two spoolers if you have two printers connected.
/P pauses the spooler. Using the /P switch is similar to toggling
r; the off-line switch on the printer. Using /P a second time turns
I '
off the pause. The pause goes off automatically when the printer
buffer is full to prevent the computer from locking up.
r
l ' /S interrupts the spooler's buffering so that your computer imme-
diately stops printing data in the buffer. All printer data goes
directly to the printer. This feature enables you to print data
r""'" without waiting until the buffer is empty. LIse /S again to
I '
restart the buffering.
I' /C clears the spooler. Any data remaining in the buffer is not
I ' printed.
/G returns the status of the spooler (installed, pause on/off, buff-
ering on/off, size of buffer, percentage of buffer full).
spooler 12 Ip I ENTER J
pauses print spooling for Printer 2.
I )
s p 0 0 1e r 12 1 P I ENTER I -.J
\ J
, J
I
~
i i
LJ
, I
i I
L.J
, I
-J
, I
\, I
I
--!
, I
~
I I
I
-.i
176
Chapter 6 / Command Reference
SUBST External
I ~ 1 SUBST [drive:] [pathname] [lD]
Examples:
subst d: b:\usr\fred\forms
r-
I"'
I .
I •
177
Chapter 6 / Command Reference i
L...J
, I
I :
SYS (System) External L...J
SYS drive: I ,I
....J
Transfers two hidden system files from the current disk to a for-
matted diskette in the specified drive. I i
Parameters
\ }
drive: is the drive containing the diskette to receive the files. ii'
L...J
I I
I I
U
I )
, I
I .
'--J
i I
I
I I
I i
LJ
I I
~
178
Chapter 6 / Command Reference
TIME Internal
TIME [time]
Displays or sets the time. You can change the time from the key-
r! board or from a batch file. (Normally, MS-DOS displays a time
prompt each time you start up your system. It does not, however,
if you use an AUTOEXEC.BAT file. Therefore, you may want to
r--' include a TIME command in that file.)
I
Parameters
r: time specifies-the time to set in the hh:mm:ss.cc format.
hh = 0-23 (hours)
mm = 0-59 (minutes)
ss = 0-59 (seconds)
r
I I
cc = 0-99 (hundredths of a second)
If you include only part of the information (such as the hours)
rI and press I ENTER I, the fields that follow default to zero.
.
I '
If you omit the entire time parameter, TIME displays the cur-
rent time and prompts you to enter the new time. Enter it in the
~ 24-hour format, or press I ENTER I if you do not want to change the
I time displayed.
,r
I
179
Chapter 6 I Command Reference i
-1
, I
, I
• You can also use DATE and TIME to include the date and --.J
time on a printout. (See the DATE command.)
I
• TIME lets you keep track of the time and can give you an L-l
idea of how long it takes to run a particular ·program.
• You can change the time format by adding the COUNTRY , :
I
command to your CONFIG.SYS file. Refer to Appendix B for ~
more information.
Examples '--
I
tim e 1 4 I ENTER I
sets the time to 2:00 p.m.
TIM E 2: 32 I ENTER I
, /
tim e 0: 0 : 0 • 5 I ENTER I
I i
I
sets the time to one-half (50/100) second past midnight. L-J
:'-.Ji
: I~
, !
I I
L-...J
, I
i I
L.J
i I
.........J
180
Chapter 6 / Command Reference
r TREE Internal
TREE [drive:][lF]
,,
\
Parameters
I' drive: is the drive that contains the diskette you wish to exam-
1
ine. If you do not specify drive, the current drive is assumed.
IF displays all files in all levels of subdirectories.
\'
i
Examples
I""' t r e e b: I ENTER I
l
displays all the directories at all levels contained on the diskette
in Drive B.
t r e e a: If> P r n I ENTER I
lists to the printer all subdirectories and filenames on the
diskette in Drive A.
tree a:/f>adir.filIENTER!
I""'
I
! '
r'"""""'
I
,..--,
j
rI
181
, I
Chapter 6 / Command Reference I I
LJ
i
TYPE Internal \.......J
I
TYPE pathname I I
w
Displays the contents of the specified file. TYPE makes only one I
, !
change to the file's format. It expands tabs to spaces consistent '---'
with a tab stop at every eighth column.
Parameters
pathname is the name of the file to list.
,
\ I
L-J
Notes and Suggestions
• A display of binary files sends control characters (such as I I
bells, form feeds, and escape sequences) to the standard out- I
L-J
I
put device.
• Use TYPE to see if you need to change a file. If so, you can
use EDLIN to make the change. (See Part 3 for information
on EDLIN).
\ i
I I
Examples U
;
r
e...-i
182
J
Chapter 6 / Command Reference
\'
I VER (Version) Internal
VER
Displays the number of the MS-DOS version that you are using.
Example
ve r I ENTER I
r
t _
displays the version number.
r
r
! '
r--"
I
/
[""'
l \
,---,
I t
r.
,
183
,
Chapter 6 / Command Reference i
~
VERIFY Internal
VERIFY [switch]
J
Turns the verify' switch on or off, or displays the current setting
of VERIFY. VERIFY has the same purpose as the IV switch in I
I i
i
Examples :~!
ve r i f yon I ENTER I
, ,I
tells MS-DOS to verify all writes to disk. ,
I........!
ve r i f Y 0 f f I ENTER I
I
tells MS-DOS to stop verifying writes to disk. I I
l-l
i I
~
. ,
L-J
I !
~
184
r-
I Chapter 6 / Command Reference
,.,
!
VOL (Volume) Internal
1 VOL [drive:]
Displays the volume label of the disk in the specified drive. (You
r can assign a label by using the IV parameter in the FORMAT
!- command.) If the disk does not have a volume label, VOL
displays:
~ Volume in drive n has no label
Parameters
drive: indicates the disk for which you wish to display the label.
If you omit the drive, MS-DOS displays the volume label of the
current disk.
Example
r, vol b: I ENTER I
MS-DOS displays a message similar to this:
Volume in drive B is DISKONE
vo 1 I ENTER I
rL
displays the volume label of the current disk.
...
l
~
185
, I
Chapter 6 / Command Reference I
e--.J
I
I I
XCOpy External :....J
Parameters
source pathname is the name of the drive, directories, andlor file
you want to copy. If you omit the directory part of source path-
, I
name, XCOPY copies the file from the current directory. If you
omit the filename part of source pathname, XCOPY uses the LJ
wildcard *.*, and copies all files in the directory.
target pathname is the name of the drive, directories, or file to :
LJ
:
which you are copying. If you omit the directory part of target
pathname, XCOPY copies to the current directory. The default , I
filename is *.* U
IA copies only source files that have their archive bit set. It does
not change the archive bit of the source file. (See ATTRIB for , I
information on how to set the archive bit.) \, ,j
L....J
IS copies the specified directory and its subdirectories (as long as -.J
i
the subdirectories are not empty). When used with IE, IS copies
the empty subdirectories, as well. If you omit IS, XCOPY works
within one directory.
: I
~
186
Chapter 6 / Command Reference
n
! \
copy Ib xcopy.exe
mcopy.exe I ENTER I
,.--,
This creates a new command called MCOPY.EXE. Now, you
can use the MCOPY command the same way you use XCOPY,
l : except that you won't receive the prompt.
Examples
xcopy a: b: Is Ie IENTERJ
r
t '
187
Chapter 6 / Command Reference ! ~
copies the file Jobstat from the current directory to the STATUS
directory of Drive B, and verifies that the source and target files
are identical.
xc 0 pya: b: / a I ENTER I
copies all read-only files in the current directory of Drive A to
Drive B.
xcopy a: b:\modfiles\ /d:11/15/86IENTERI
I :
, !
........J
I
:-.1
188
r--'
I !
r--'
l. ,1
I :
t. J
n
n
l ;
--,
i !
n
I'
l j
--,
I I
l J
n
Chapter 7
r
i
THE LINE EDITOR (EDLIN)
r-'
I
Although the line editor EDLIN and the MS-DOS Commands
editing function are separate utilities, many of their operation
keys are identical. This chapter provides a quick reference for
these keys. Chapter 8 provides sample sessions and instructions
for command-line editing. Understanding the command editing
features will greatly assist you in learning the full editing fea-
I'
i tures of EDLIN, described in Chapter 9.
Function Keys
You can accomplish many editing functions by using special
keys. Following is a chart that illustrates each key and its
function.
Function Key(s) Description
189
: I
Chapter 7 / The Line Editor (EDLIN) ~
I I
U
: I
'---'
190
Chapter 8
EDITING COMMANDS
I
'-
MS-DOS has several special editing features to help you change
commands. Learning to use these features can save you time.
I,
The Template
i'
! . You edit commands in MS-DOS through a special storage area,
the template. When you press I ENTER I after typing a command,
MS-DOS sends the command to the cpmmand processor (COM-
MAND.COM) for execution. It also sdnds the command to the
template. Only one command at a time is stored-the last com-
mand entered. You can then recall the command from the tem-
r plate for editing or reexecution.
I
r-,
I
191
j i
Chapter 8 / Editing Commands U
I ;
, I
i I
Now type: '--J
asm_
i
L.-i
I
The letters asm replace the letters com, resulting in:
dir prog.csm_
!
L...J
I
This new command line is now in the template. To execute it,
press [ ENTER I.
I
I I
i
L....)
Overtype and Insert
Replace DIR with the TYPE command by typing: iI I
,
L.-i
TYPE_
The characters TYPE automatically replace the characters DIR ,
I I
1
Now press [INSERT I, press the space bar, then press ffiJ. The result
I 1
is: LJ
TYPE prog.asm_
To execute the new command, press [ ENTER I. : i .........J
put the new line in the template, although it has not sent it to
be executed. , ,
;L..JI
Now edit the line BYTE prog.asm so it becomes TYPE prog.asm.
To do so, type:
ITl80ffiJ J
The 8 copies a single character Y from the template to the
command line. The resulting command line is:
,TYPE prog.asm_
-,
I
--J
192
I'
i Chapter 8 / Editing Commands
Deleting
n
, I
You can make the same change another way. To edit the line
BYTE prog.asm, press [ill again. Then type:
I DELETE I I DELETE I G I INSERT I [YJ (I) [ill
Pressing I DELETE I twice deletes the first two characters (B and n.
The G key copies the third letter T. I INSERT I enters the insert
mode so that you can insert the letters Y and P. [ill copies the
rest of the template.
I DELETE I does not affect the command line. It affects the template
by deleting the first character. lliJ deletes characters in the tem-
plate, up to but not including a given character.
n
r---
I :
r-'
I
l '
n
: '
I'
t '
r-'
I :
t '
I~' t
, '
\"',
,I
193
I I
---.J
I I
U
i l
,-I
,
, I
----J
i I
'---.J
I
'---.J
,
! ,
L....J
!
LJ
I
---J
,-
Chapter 9
EDITING FILES
I '
The techniques for editing command lines also apply to editing
files. In addition, there are several other special features avail-
able for creating, changing, and manipulating blocks of text.
!
L '
Files created with EDLIN are divided into lines of a maximum
of 254 characters. During editing, EDLIN generates and displays
I a number for each line. If you insert or delete lines, it automati-
I '
cally renumbers any following lines to maintain consecutive
numbering. The line numbers are only to aid in editing; they
r; are not actually in the file.
I :
Creating a File
n You can create your own file with EDLIN by typing:
,.., edll n pa thname I ENTER I
, I '
'
where pathname refers to either an existing file (that you wish
to edit) or one that you wish to create. In this case, create a
r-: sample file for editing by typing:
I '
edlin sampfile [ENTER I
r-'
I '
Note: If you wish to have the file reside in.a directory
I other than the home directory, you would give a path-
name to the desired directory. This command, for
example, tells EDLIN to create the file in the current
directory of Drive B:
edlin b: sampfl1e I ENTER I
,.......,
!
In either case, EDLIN displays the message and prompt:
i '
New fl1e
r-'
I ' *
~ ,
to indicate it has created the sample file. You are now in the
EDLIN command mode and can enter any of the commands out-
i lined in Chapter 10.
I
r! '
I
195
Chapter 9 / Editing Files iL...Ji
Inserting Text
1. Type I (ENTER I to begin inserting text. The screen displays: I
I
'
I
U
New file
*I
; j
1 :*_ l----..J
2. On Line 1, type:
i I
This 1 s a sam p 1 e f i 1 e I ENTER I <.-J
3. Type:
! I
The edlting keys are easy to use \ ENTER I U
4. When EDLIN displays the next line number, type I CTRL I @].
This exits the insert mode and returns the EDLIN prompt
(* ).
5. Type 1 I ENTER I to tell EDLIN to display Line 1. The screen I I
You can enter no more than 254 characters into each line. To end ,
one line and start another, press I ENTER I. EDLIN places the cur-
~
I I
i--.J
rent line in the template and displays the next line number.
f I
I I
---J
196
~
EDLIN displays:
~
l
197
,
Chapter 9/ Editing Files L.J
i, I
I
LJ
Example 1: Copy Char (G)
Using the Copy Char function, G, copy characters from the tem-
plate to the new line.
1. Press G once. The screen looks like this:
i j
1 :*This is a sample file '--..J
1 :*T_
this:
2:*The editing keys are easy to use
\ !
2:*_
2. Type ill] a . The screen looks like this:
2:* The editing keys are easy to use 1 !
2:* The editing keys_ ~
3. Now copy the rest of the template, using the Copy All func- \ !
tion, [TI]. The screen looks like this: '.-.J
I
198
,
i
I ' Chapter 9 / Editing Files
,I :
, I
2. Press the Copy All editing key, [ill. The screen looks like
this:
i" : 1 :*This is e semple file
1 :*This is e semple file_
c--1
! \
I
199
Chapter 9 / Editing Files
I !
1 !
'---1
Example 5: Delete to Char (Cill)
Using the Delete to Char function, Un delete a number of char- I
,
l
,
acters up to-but not including-the specified character.
1. At the EDLIN prompt, type 1 I ENTER ,. The screen looks like
, !
this: , :
2. Type: LJ
Names and addresseslESCj
i i
The screen looks like this: ~
200
l I Chapter 9/ Editing Files
r
I '
3. Press the Copy All key, [ill. The screen looks like this:
~
1 :*This is a sample file
i i 1 :*Names and ad,dresses\
Th1S is a sample file __
r'
, '
4. Type [CTRL I [I) to continue to the next example.
j'
Example 7: Insert (I INSERT I)
,I
The 'INSERT I key acts as a switch to turn the insert mode on and
off. Use this key to insert a word in Line 1 of the sample file.
n 1. At the EDLIN prompt, type
this:
1 [ENTER I. The screen looks like
r
! I
1 :*This
1: *__
is a sample fl1e
,---,
2. Press the Copy to char key, 1m and press f. The screen
Il 'i looks like this:
1 :*This is a sample file
n 3.
1: *Th1S is a sample __
n
t _:
1 :*This 1S a sample edit __
,...,
I i
201
Chapter 9 / Editing File$
I '
I i
'----'
1. At the EDLIN prompt, type 2 I ENTER I. The screen looks like
this:
r 1
2:*The edlting keys are easy to use W
2:*_
2. Type:
Replacing the template
Then press em. Notice that the @ symbol appears after the ,
,
......J
)
I
this:
I I
2:*The editing keys are easy to use
2:* __
, ,
i i
'------.J
202
l !
Chapter 9/ Editing Files
n
I ' 2. Press the Copy to char key, [ill, and then type a. The
screen shows:
n
! ' 2:*The editing keys are easy to use
2:*The editing keys_
3. Then type:
simplify editing tasks I ENTER I
The screen looks like this:
2:*The edlting keys are easy to use
2:*The edlting keys simplify editing tasks
*
Notice that after you press I ENTER' the EDLIN prompt
returns to the screen.
"
! : 4. Type 2 [ENTER ,. The screen looks like this:
2:*The editing keys simplify editing tasks
2:_
As you can see, Line 2 now contains the new sentence you
entered.
r;
I :
,.,
i :
I '
~
, !
i '
n
I
I
iI
l '
....,
I( :,
203
, I
I I
l...-J
i 1
~
i
I ,
'--"
: :
U
i i
LJ
u
\I i•
L.J
I i
LJ
I ,
. I
L...
I
I
l---!
I
LJ
I
I
~
.----
IJ Chapter 10
1"1
I '
EDLIN COMMAND REFERENCE
1 __ ;
I'
I :
In addition to the editing keys, EDLIN also supports many pow-
erful commands that let you manipulate an entire file or several
lines at a time.
Ii,
;
n
l )
.----
!, ,'
205
Chapter 10 / EDLIN Command Reference
I I
In the first case, you must use a semicolon to sepa- --.J
multiple command: W
5 T his s t r i n9 I CTRL 1m - 5, + 5L I ENTER I
searches for the string, This string, and then dis-
plays the 5 lines that immediately precede the
matched string and the 5 lines that immediately
follow it. If the search fails then EDLIN displays
the numbers of the relative lines.
, I
• You can enter EDLIN commands with or without a space I
~
I
• Control characters (such as I CTRL I[TI and I CTRL 1m) can be '--'
inserted into text and even used for the Search and
Replace commands. To do this, first type I CTRL 10 and
, I
then the desired control character. I--J
• Delimiters (spaces or commas) are required only
between adjacent line numbers. You may want to use i '
them, however, to separate commands and parameters LJ
for better readability.
• Commands become effective after you press I ENTER I. .LJ
I :'
, ,,
'--'
I ,
I I
LJ
I ,
, i
206
r--.
i : Chapter 10/ EDLIN Command Reference
t. _~
Command Summary
I ' The EDLIN commands are summarized in the following table.
r :
Command Purpose
I""' line Edits the specified lines
I I
A Appends lines
C Copies lines
D Deletes lines
E Ends editing
I Inserts lines
L Lists text
M Moves lines
P Pages text
Q Quits editing
R Replaces lines
S Searches text
T Transfers lines
W Writes lines
Command Parameters
,..--,
Most EDLIN commands require you to specify a line number, a
string, or a range of lines to be affected by the command. These
l ; are the command parameters. Command parameters may vary
according to the EDLIN' command, but, generally, they are as
r--:
I '
follows.
i
,...,
II !
'
! \
;:
I
l
207
I :
Chapter 10 / EDLIN Command Reference
i
line (line number) !.........:
~
• A number less than 65534. If you specify a number
larger than the number of existing lines, EDLIN adds a
line to the file.
LJ
• A pound sign (N), indicates the last line of a program.
For example, the command # I will begin an insert at the
end of your program.
string (a group of characters)
i i
This parameter represents a portion of text EDLIN is to find, LJ
replace, delete, or use to replace other text. Use this parameter
only with the Search and Replace commands. End each string 1 )
with I CIRL I [I). Do not include spaces between strings or between , I
---.J
a string and the command letter (unless you want those spaces
to be part of the string).
, I
L.....J
II :
I
L.....J
,
L
:i
~
I II
L..J
208
r-
I
l :
I
Chapter 10 / EDLIN Command Reference
,.....,
I I
Append Lines (A)
I' [number]A
Adds the specified number of lines from disk to the file being
edited in memory. The lines are added at the end of the file.
This command is meaningful only if the file being edited is too
large to fit into memory. Before using this command, you must
write the portion of the file that was loaded into memory (and
which has been edited) to disk. Refer to the Write Lines
command.
Ii
l ' When the Append command reads the last line of the file into
memory, EDLIN displays the message:
r:
L !
End of input file
If you omit the number of lines, EDLIN appends lines until
available memory is 75% full. However, if memory is already
[J 75% full, EDLIN does nothing.
Example:
I]
I !
1 ~ ~ A (ENTER I
appends 100 lines from the disk to the file in memory.
[!
n
! :
r:
I, i
~
I '
209
Chapter 10 I EDLIN Command Reference i i
L...;
· 1
I I
Copy Lines (C) LJ
[linel][,line2],line3[, count]C f I
U
Copies all lines rangIng from line1 to line2, placing them imme-
diately ahead of line3. Using the count parameter, you can copy
the lines as many times as you want.
If you omit linel or line2, EDLIN copies the current line. If you
omit the count, EDLIN copies the line(s) only once. I· ]I
LJ
Note: If you omit the linel parameter, your command
must include a comma immediately preceding the I I
line2 parameter. LJ
The file is renumbered automatically after the copy, and the I 1
U
I
Examples: I, !I
~
Assume that the following file exists and is ready to be edited. If
you want to create the file, see the Insert command.
1: This sample file
2: shows what happens
3: when you use ! i
4: the Copy command u
5: to copy text in your file.
, I
To copy this entire block of text, at the EDLIN prompt type:
U
1 , 5 , 6 C I ENTER I
I i
LJ
I II
210
Chapter 10/ EDLIN Command Reference
Notice that the first line copied becomes the current line.
-,
I i If you want to insert lines between other lines, use line3 to spec-
ify the line before which you want the text copied. For example,
assume that you want to insert Lines 5-8 before Line 3 in the
following file:
1: Thi5 5ample file
....,
i '
2: 5how5 what happen5
3: when you U5e the Copy command
4: to copy text in your file.
5: If you 50 cho05e,
6: you may a150 in5ert
7: a group of line5 withln
8: other part5 of the file.
9: The copy command
10: i5 ver5atile.
i '
I
r-,
! I
1';
l I
211
Chapter 10 / EDLIN Command Reference
;
I I
The command 5,8, 3C IENTER Iresults in the following file: L...J
L
I '
LJ
iLJ'
, I
L-...:
I !
L...J
J
,-
I
212
: ' Chapter 10 / EDLIN Command Reference
r-',
Delete Lines (D)
[linel] [,line2]D
Deletes linel or all lines within the range linel to line2 from a
file.
EDLIN automatically renumbers the lines to maintain consecu-
tive numbering in the file.
Parameters
You can omit the linel parameter:
,line2D I ENTER I
If you do, EDLIN starts deleting at the current line and ends at
line2. Your command line must include the comma before line2
to indicate you are omitting linel.
You can omit the line2 parameter:
,...., line 1D I ENTER I or
,
I
I
'
linel,D I ENTER I
If you do, EDLIN deletes only linel.
If you omit linel and line2, EDLIN deletes only the current line.
D I ENTER I
. 1,
,
• I
213
Chapter 10 / EDLIN Command Reference
Examples:
Assume that the following file exists and is ready to be edited.
Line 30 is the current line:
1: This sample file
2: shows how
3: the Delete command functions.
4: All that is requlred
5: ln most cases
26: is to specify
27: a number of lines
28: to be deleted;
29: deleting can often help
30:*to clean up your files.
Type:
5,25D [ENTERI
'-
214
Chapter 10 / EDLIN Command Reference
,6D I ENTER I
!
215
: ,
Chapter 10 / EDLIN Command Reference
Notes
, ,
• If you omit the line (you only press I ENTER I), EDLIN loads the ~
Example
Assume the following file exists and you wish to edit Line 4:
1: This is a sample file.
2: used to show
3: the editing of line
4:*four.
Type 4 I ENTER I at the EDLIN prompt. The screen looks like this:
4: *four
4:
216
Chapter 10 / EDLIN Command Reference
l 1
Press I INSERT), type the word number, followed by a single space,
and press I INSERT ) again. Then, to copy the rest of the line, press
, '
the Copy All editing key, [ill. The screen shows:
4:*four
4:*number four __
r--
I; ,
!
,, I
i'
;
, '
217
Chapter 10 / EDLIN Command Reference
218
Chapter 10 / EDLIN Command Reference
Insert (I)
[line] I
Notes
;--.
• If you use a pound sign (#) to specify the line, or if the line
you specify is any number larger than the number of the
last line-EDLIN appends the lines to the end of the file.
In this case, the last line inserted becomes the current
line.
Examples
,---.,
;
Assume that the following file exists and is ready to be edited:
1: This is a sample file
2: to show what happens
3: when using the Insert command
4: in your files
To insert text before a specific line that is not the current line,
type the line number and I, then press I ENTER I. For example, type
3 I I ENTER 1
.....-.,
i The result is:
3:*_
219
Chapter 10 / EDLIN Command Reference
5:*_
Now type:
eve r y tim e you ins e r t new 1 i n e s I ENTER I
When EDLIN displays the number for the next line, type I CTRL I
W to return to the EDLIN prompt (*). Type L I ENTER I to list the
file. The screen looks like this:
1: This is a sample flle
2: to show what happens
3: to the line numbers
4: <how they are renumbered)
5:*every time you insert new llnes
6: when using the Insert command
7: in your files
To add lines to the end of the file, type:
8 I I ENTER I
The screen shows:
8:*_
220
Chapter 10 / EDLIN Command Reference
,, ,
,
Type ICTRL \ @] when the number for Line 12 is displayed. Then,
at the EDLIN prompt, type LI ENTER I to list the file. The screen
~,
looks like this:
1: This is a sample file
2: to show what happens
3: to the line numbers
4: (how they are renumbered)
5: every time you insert new lines
6: when using the Insert command
7: in your files
8: The Insert command
9: can be used
10: to add new lines
11: to the end of your file.
~,
~
;
I
r--.
; ,
221
Chapter 10 / EDLIN Command Reference
·List (L)
[linel][,line2jL
Notes
• You can omit linel:
, line2L I ENTER I
If you do, the display begins before the current line and ends
with line2. The comma is required to indicate that you omit-
ted linel.
• You can omit line2:
linel L I ENTER I
If you do, EDLIN displays 23 lines, starting with linel.
• If you omit both parameters, EDLIN displays 23 lines-the 11
lines immediately preceding the current line, the current line,
and the 11 lines immediately following the current line. If
fewer than 11 lines precede the current line, EDLIN displays
more lines that follow the current line to make a total of 23
lines.
• If some of your lines are longer than the screen width (require
more than 1 display line) they will still be counted as a single
line by EDLIN. In other words, if the List command requires
more text than the screen can display, the excess will scroll
off the top.
222
Chapter 10/ EDLIN Command Reference
Examples
Assume that the following file exists and is ready to be edited:
1: Thi5 i5 a 5ample file
2: u5ed to 5how the li5t command.
3: See what happen5 when you U5e
4: li5t Cll with different parameter5
5: or without any
223
Chapter 10 / EDLIN Command Reference
224
Chapter 10 / EDLIN Command Reference
Example
, ;
. ,
225
Chapter 10 / EDLIN Command Reference
Page (P)
[line 1][, line2] P : ;
!..j
Pages through a file 23 lines at a time or lists the specified
block of lines. ,I '
'
'--..J
Notes
I
• You may omit the linel parameter, as in ,line2P I ENTER ,. --.-J
If you do, EDLIN uses the current line number plus 1, unless
the current line is Line 1. The comma is required to indicate
that you omitted the linel parameter.
• You may omit the line2 parameter, as in ,linelP I ENTER I. If you
do, EDLIN lists 23 lines.
• The last line displayed becomes the current line. This com-
mand differs from the List command in that the Page com- ,
,I ,r
mand changes the current line to the last line displayed. '----
Example , ,I
,
iI
~
226
Chapter 10 / EDLIN Command Reference
r-
i
Quit (Q)
r-'
I Quits the editing session without saving any changes you may
i
have made to the file.
EDLIN prompts you to make sure you don't want to save the
changes. Press Y if you want to quit the editing session without
saving any changes. Press N to continue editing.
Example
* Q I ENTER I
Abort edit (Y/N) __
r--
I
!
,..,
I
I. .'
227
I
Chapter 10 / EDLIN Command Reference I i
occurrence. U
Notes:
J
• If you omit linel, Replace starts the search at the line
immediately following the current line; it stops at line2.
I
\ 1
i
• If you omit stringl and string2, EDLIN uses the most
recent string specified with a Search (or Replace) command
i
L.-..
228
J
Chapter 10 / EDLIN Command Reference
Examples:
,..--
,I Assume that the following file exists and is ready for editing:
1: This sample file
2: shows how the Replace command works and how
3: when you use Replace
4: certain words and phrases
5: may be exchanged for
6: other words and phrases
7: in your file.
To replace all occurrences of and with or in the above file, type:
L 1 ,7Rand ICTRLJIIJ or [ENTER]
The result is:
2: shows how the Replace commor works or how
4: certaln words or phrases
6: other words or phrases
Note that Lines 1, 3, 5, and 7 are not displayed because they are
not changed:
To avoid unwanted changes, you can include the? parameter, for
example, type:
2, 7?RandlcTRLIIIJ or IENTER J
,... Now, whenever Replace finds the and string, you have the oppor-
tunity to accept or reject the change.
I
Note that in the first Replace Command line a space was typed
;---'
after and and or. In the second command with ?R, spaces were
I
I
not typed.
229
, ,
Chapter 10 / EDLIN Command Reference -.-J
Searches all lines within the range linel to line2 for each occur-
rence of the text string. I '
L.J
Notes
• You must terminate the string by pressing I ENTER \.
• If you omit the question mark (?), Search displays the first
line (in the specified range) that matches the string. That
line becomes the current line, and the Search command
terminates.
,
• If the string does not occur between linel and line2, Search , I
'---.J
displays the message:
Not found
, I
'--.J
• If you include the question mark, Search displays the first
line that contains the string. It then prompts you with the
message:
O.K.?
If you press either Y orl ENTER I, the line becomes the current I I
I
line, and the search terminates. If you press any other key, '---'
the search continues until it finds another match or searches
all lines.
• You can omit the linel parameter, by typing the command in
this format: ,line2Sstring I ENTER I.
If you do, the search begins at the line that immediately fol-
lows the current line.
• You can omit the line2 parameter, by typing the command in
this format: linel Sstring I ENTER I or linel, Sstring I ENTER I
• If you omit the string, Search uses the last search string that
was used in a Replace or Search command. If there is no
search string (no previous search or replace has been done),
the command terminates immediately.
, I
I
• Search looks for the string exactly as you specify it in the ~
command. Therefore, enter the string in the same combination
of upper and lowercase characters as it appears in the text. I I
,I
'------'
230
Chapter 10 / EDLIN Command Reference
Examples
Assume that the following file exists and is ready to be edited.
Line 5 is the current line.
1: This sample file
2: shows how the Search command functions
3: to locate and point out
4: a specified string
5:*in a range of lines
6: of your file.
7: The Search command
8: may include the optional parameter? and
9: 2 line parameters for the range.
This is probably not the and you are looking for. To find the next
r-- occurrence of and, at the EDLIN prompt, type:
I
S (ENTER I
i
I
I
!
231
Chapter 10 / EDLIN Command Reference
I )
~
Line 3 becomes the current line.
To search through several occurrences of a string until you find : ;
the correct one, type:
1, ? Sand
i ,
i !
The result is: '---'
O.K.? Y
I I
The search continues until you press Y or the file runs out of ~
lines. At that time, Search displays the message:
Not found
j
\ }
: [
'-...J
I t
--J
,I !,
L.-.i
232
Chapter 10 / EDLIN Command Reference
I ;
Transfer Lines (T)
,,
~
'
[line]T[ drive] filename
Inserts (merges) the contents of a specified file into the file being
edited. The transferred file is inserted just ahead of the specified
line or current line.
After the file is inserted, the merged file is renumbered
I
L_ automatically.
Notes
• If you omit line, the file contents are inserted ahead of the
current line.
• The file to be transferred is read from the current directory of
the specified drive or the default drive. If you issued a path
when EDLIN was started, that path serves as the current
directory. All subsequent Transfer Lines commands use that
directory.
Example
1 HE: myf i 1 e I ENTER I
inserts the contents of B:Myfile into the file being edited.
B:Myfile is inserted just before Line 10.
l! ',
i, '
I""'
I :
233
Chapter 10 / EDLIN Command Reference
, )
~
Write Lines (W)
[number]W
Note
If you omit the number, EDLIN writes lines until 25% of mem-
ory is freed. If at least 25% already is freed, EDLIN takes no
action. All lines remaining in memory (not written to disk) are
renumbered starting with Line 1.
Example
1 "" wI ENTER I
writes Lines 1 through 100 to disk and renumbers the file in
memory, starting with Line 101 as Line 1.
, I
i-.J
i
L..1
I ,
'---'
234
n
I ;
........,
,t l
n
! ,
c_ ,
1~
! i
\ __J
n
LJ
I
l ~
Chapter 11
,
I"'
' Basic Information
Programs are written in source code. Passing the source code
through a compiler or an assembler produces an object module.
This object module, however, cannot be understood by the com-
puter directly.
To produce machine language code that the computer can under-
stand, you must pass the object module through the link process.
Following is a summary of the linker requirements and
functions.
System Requirements
The linker requires the following:
I
• At least 50K bytes of memory. 40K bytes are for code
I and data; the remaining 10K bytes are for run space.
• One disk drive, if output is sent to the same diskette
from w4ich input was taken.
• Two disk drives, if output is sent to a different
diskette.
Because the linker does not allow time to swap
diskettes during operation on a one-drive configura-
tion, the use of two disk drives is more practical.
I'
l
I"'
!
,...,
I
235
Chapter II/Linking Object Modules
the linker resolves all external references (makes sure they are
defined). If any external reference is not defined in the object ,,
modules, the linker searches up to eight library files for the
definition. U
Linker U
libraries listing
.lib map I
I
--..J
Up to 8 libraries
can be searched
r-------l.----,
. I
Used only if run VM.TMP Run file ~
file is larger .exe
than memory
!
~
236
Chapter ii/Linking Object Modules
Definitions
r The following explanations of the terms used in this section will
! help you understand how the linker works. Generally, if you are
linking object modules compiled from BASIC, Pascal, or another
high level language, you do not need this information. If you are
writing and compiling programs in assembly language, however,
you must understand the linker and the following definitions.
,---, (Chapter 12 also contains useful information on how the linker
I ,
works.)
! '
,I '
! -'
237
Chapter 11 I Linking Object Modules
Memory
Example
Segment Class ,I
L-J
Name Name
Segment 1 PROG.1 CODE
Segment 2
Segment 12
PROG.2
PROG.3
CODE
DATA J
I
Note that segments must have different segment names but may
~
or may not have the same class name. Segments 1, 2, and 12
form a group; the group address is the lowest address of Segment
1 (the lowest address in memory).
J
Segment
A segment is a contiguous area of memory up to 64K bytes long.
It can be located anywhere in memory on a paragraph (16-byte)
boundary. The contents of a segment are addressed by a segment
address and an offset within that segment. Segments can I i
L-..J
overlap.
I
----'
238
Chapter II/Linking Object Modules
! I
Group
.--, A group is a collection of segments that fit within a 64K byte
I
area of memory. The segments do not need to be contiguous. The
group address is the lowest address of the lowest segment in that
group. At link time, the linker analyzes the groups and then ref-
erences the segments by the group address. A program can con-
sist of one or more groups.
~ When writing in assembly language, you can assign the names
: I
! of groups in your program. In high-level languages, the compiler
automatically assigns the names. The linker checks to see that
the object modules of a group meet the 64K-byte constraint.
Class
A class is a collection of segments. The naming of segments to a
class controls the order and relative placement of segments in
memory. In an assembly language program, you assign names to
r-'
the classes. In high-level language programs, the compiler auto-
!
i '
matically assigns the names.
All segments assigned to the same class are loaded into memory
, , contiguously. The segments are ordered within a class, in the
i I order they are encountered by the linker in the object files. One
class precedes another in memory only if a segment for the first
class precedes all segments for the second class in the input to
the linker. Classes can be any size, and groups can span classes.
Refer to Chapter 12 for information on how to assign group and
class names and on how the linker combines and arranges seg-
ments in memory.
Command Prompts
r-, When the linker is started (see "Starting the Linker" later in
I
I
this chapter), a series of four prompts appears on your display.
When you type a response to a prompt and press I ENTER I, the next
prompt appears.
After the last prompt, the linker begins linking. If it finishes
successfully, the linker exits, and the screen displays the MS-
DOS system prompt. If an error occurs, the linker displays the
appropriate error message.
239
Chapter 11 / Linking Object Modules ~
,
The linker prompts for the names of the object, run, and list files
and for libraries. Use a standard MS-DOS pathname to reference
each file.
The prompts are discussed below in the order they appear.
Defaults are shown in square brackets ([]) following the prompt.
To select a default, press I ENTER I in response to a prompt. The
Db j e c t Mod u 1 e 5: prompt is the only one that requires you to
type a pathname.
assigns the run file the extension .exe, even if you specify
an extension other than .exe. ,
~
• If you do not enter a pathname in response to this prompt,
the linker uses the first pathname typed in response to the
Object Modules: prompt. For example, if your first object I
,
, ,,
.
240
Chapter 11 I Linking Object Modules
r:
! ;
The linker provides three command characters.
I'
,I . • Plus Sign (+). Use the plus sign to separate entries
and extend lines as needed. (A blank space can be
used instead to separate entries.)
n
l ! If the response to the 0 b j e c t Mod u 1e 5: 0 r L 1 bra r -
i e 5: prompt is too long to fit on a line, type 81 ENTER I
at the end of the line. The prompt appears again, and
r:,
t you can continue typing the response. After listing all
the modules, press I ENTER I.
241
Chapter 11 / Linking Object Modules
\ I
u
You use the seven linker switches to control various linker func-
. tions. Switches can be grouped at the end of any response or dis-
tributed at the ends of several. To specify a switch, type a slash ',u
(;) followed by the switch name (that you can abbreviate to the
first letter). : I
~ I
• IDSALLOCATE - The ID switch tells the linker to
load all data at the high end of the data segment. If
L.....J
,
i
.
i
I
------J
242
~
rI ' ~
I
• IHIGH - The IH switch causes the linker to place the
run file as high as possible in memory. If you omit IH,
the linker places the run file as low as possible in
memory.
Important: Do not use IH with Pascal or FORTRAN
I'
I '
programs.
n
• ISTACK:size - The IS switch lets you specify the
stack size. If you omit IS, the linker calculates the
1 ' required stack size from information in the object
modules provided by the compiler or assembler.
r:
I
,
243
Chapter 11 / Linking Object Modules
I \
i ;
L..J
size can be any positive value (in decimal) up to
65535 bytes. If you enter a value in the range 1-511,
the linker uses 512. I '
:-:
At least one object (input) module must contain a
stack allocation statement. If it does not, the linker
displays the error message: , I
1--,
Warning: No STACK Segment
.
• INO - the IN switch tells the linker not to search the
default (product) libraries in the object modules. For
:
W
are displayed.
• including all responses on the command line. \, )
I
, I
'---
• creating a file to automatically respond to the
prompts.
, I
I ,
L.!
Method 1: Keyboard Responses
'"
To load the linker into memory and display the four prompts, one
at a time, type:
LI NK I ENTER I
I
, I
These prompts and possible responses are described under "Com- LJ
mand Prompts."
I i
I
244
i : Chapter 11 / Linking Object Modules
r-;
,!
245
I ;
Chapter 11 / Linking Object Modules , I
'----'
I, 'I
Use switches and command characters in the response file the U
same way as they are used for responses typed from the
keyboard. i )
L-.'_)
When the link session begins, each prompt is displayed, in order,
with the responses from the file. If the file does not contain a , ,
I ,
response for a prompt, the linker displays the prompt and waits I
LJ
for a valid response.
Example [
l---l
fun text table care
IP 1M
funlist i
L..J
coblib.li.b
The first line in this file tells the linker to load four object mod- , I
ules: Fun, Text, Table, and Care. L.J
The second line omits a name for the run file, thus the linker
will use the name Fun.exe. When the linker encounters the \ j
/P switch, it pauses to let you swap disks. After doing so, press
the space bar to continue. Because the line includes the 1M
switch, the linker produces a public symbol map (see \ \
"Switches"). LJ
The third line tells the linker to name the list file Funlist.map.
\ I
, I
The fourth line tells it to search the library file Coblib.lib. U
I I
..-l
In response to the MS-DOS prompt, type:
1 1 n k 1 ENTER I I
\
I
U
I '
--..J
I
I ,
c......J
, I
I
--..J
246
I I Chapter 11 / Linking Object Modules
r"'
I ,
l I
\"' Notes
I '
I.
• Because you specify 1M, the linker displays an alphabetical
and a chronological listing of public symbols.
G
i ' • By responding PRN to the List File: prompt, you redirect your
output to the printer.
• Because you specify the IL switch, the linker lists all line
numbers for all modules. (The IL switch can generate a large
amount of output.)
Ii
i ' • Because you press I ENTER I in response to the Lib r a r i e s :
prompt, the linker performs an automatic library search.
r> Once the linker locates all libraries, the linker map displays' a
I ) list of segments in the order of their appearance within the load
\ '
module. The list might look like this:
n
l I
Start Stop Length Name
00000H 009ECH 09EDH CODE
f"/ 009F0H 01166H 0777H FUNSEG
! :
The information in the start and stop columns shows the 20-bit
r-:
I '
L
247
Chapter 11 / Linking Object Modules
Because you used the 1M switch, the linker displays the public
symbols by name and value. For example:
ADDRESS PUBLICS_BY_NAME
1
~J
!
009F:0012 BUFFERS
009F:0005 CURRENT_DDS_LOCATION
i !
009F:0011 DEFAULT_DRIVE
009F:000B DEV I CE_LI ST
009F:0013 FILES
009F:0009 FINAL_DDS_LOCATION j •
L.J
009F:000F MEMORY_SIZE
009F:0000 FUN
" I
ADDRESS PUBLICS_BY_VALUE LJ
009F:0000 FUN
009F:0005 CURRENT_DDS_LOCATION
FINAL_DDS_LOCATION , I
009F:0009
'---'
009F:000B DEVICE_LIST
009F:000F MEMORY_SIZE
009F:0011 DEFAULT_DRIVE i I
009F:0012 BUFFERS LJ
009F:0013 FILES
I ;
L....J
LJ
I. !I
L.-J
I '
f~
,
I~
, I
i........JI
I .
I '
L-J
i I
• I
~
248
Chapter 12
r-,
l :
I :
You can link files totaling one megabyte. The output file from
the linker (a run file) is not bound to specific memory addresses
and, therefore, can be loaded and executed at any convenient
address. The relocation information is a list of long addresses
that must change when the executable image is relocated in
---, memory. See "Long References" later in this chapter for an
: ' explanation.
L '
.-- Definitions
I ~
I '
n
i ;
249
Chapter 12 / Link Technical Reference
! ;
'--l
How the Linker Combines and Arranges
Segments
The linker works with four combine types, which are declared in
the source module for the assembler or compiler. The types are:
private, public, stack, and common. The memory combine type ,
!
I
:
(available in Microsoft's Macro Assembler) is synonymous with U
the public combine type. The linker does not automatically place
memory combine type as the highest segment (as defined in the
Intel standard). ! '
, !
~
I i
I I
U
i =
250
I
l
'
' Chapter 12 / Link Technical Reference
.--.
I I
I
Common
0
00 Common segments of the same
~O
~
, , name and class name are loaded
overlapping one another. There
is only one canonical frame for
r
I
all common segments of the same
name. The length of the common
area is the length of the longest
r--"
, , segment.
L ..
Placing segments in a group in the assembler provides offset
addressing of items from a single canonical frame for all seg-
ments in that group.
DS:DGROUP XXXXOH 0 - relative offset
Any number of other An operand of
~
segments can intervene DGROUP ZOO in
between segments of a assembly language
group.
Thus, the offset of ZOO
I zool returns the offset of
ZOO from the
can be greater than beginning of the first
r-", the size of segments in segment
l ) the group combined, (Segment A here).
but no larger than
1'1
64K.
I ,
I i
Segments are partitioned by declared class names. The linker
loads the segments belonging to the first class name encoun-
tered, then loads all the segments of the next class name encoun-
tered, and so on until all classes are loaded.
If your program contains:
,-,
I !
l _ A SEGMENT 'ZOO'
B SEGMENT 'BAZ'
C SEGMENT 'BAZ'
~ D SEGMENT 'NEW'
I '
E SEGMENT 'ZOO'
"
I
I
L
I
,
,
r
l '
251
Chapter 12 / Link Technical Reference
,
l.......J
the Linker loads the segments as:
'ZOO' ; I
A
E
'BAZ' ..
, I
B ~
C
'NEW'
D ,---'
A ENDS
B SEGMENT 'CONST'
B ENDS , ]
I '
C SEGMENT 'DATA' :.-J
C ENDS
1 :
I i
U
252
r-
I : Chapter 12 I Link Technical Reference
,.---
I !
I _
If you want memory Combine Type to be loaded as the last seg-
ment of your program, you can use this method. Add MEMORY
between SEGMENT and 'MEMORY' in the E segment line
above. Note, however, that these segments are loaded last only
because you imposed this control on them, not because of any
inherent capability in the linker or assembler operations.
r, ,
I '
Segment Addresses
,....,
I
The 8088 must be able to address all segments in memory. Any
'...- - 20-bit number can be addressed. The 8088 represents these
numbers as two 16-bit numbers (for example, hex F:12). The F is
l !
a canonical frame address, and the 12 is the offset.
L'
The canonical frame address is the largest frame address or seg-
ment address that can contain the segment. An offset is the seg-
I I ment's location, offset from the beginning of the canonical frame.
L ~
The linker recognizes a segment by its canonical frame address
.---. and its offset within the frame .
I ,
I I
To convert the address F:12 to a 20-bit number, shift the frame
address left four bits and add the offset as shown in this
example:
FO
+ 12
1',
I, I F:12= 102 (20-bit address)
.---.
l :
,l.
I,
253
Chapter 12 / Link Technical Reference
Relocation Fixups
The linker performs relocation fixups (or resolves) on four types
of references in object modules: Short, Near self-relative, Near
segment-relative, and Long.
, I
I
---.J
I
I i
~
254
,--,
[ ,
Chapter 12 / Link Technical Reference
r--
I ,
! '
• Near Segment-Relative References: Given the target's
canonical frame, another frame is specified (via an
G
, , ASSUME directive or the: operator in assembly lan-
f , guage or via a high-level language convention). The
target must be addressable through the canonical
frame specified. The linker generates the fixup error
r message under either of the following conditions:
The offset of the target within the specified
i :
frame is greater than 64K or less than zero.
I ;
The beginning of the canonical frame of the tar-
get is not addressable by the specified frame.
The resulting value of a near segment-relative refer-
ence must be an unsigned word (16 bits).
I
L '
• Long References: Long references have a target and
another frame (specified by an ASSUME or by a high-
level language). The target must be addressable
through the canonical frame specified. The linker gen-
L_~ erates the fixup error message under either of the fol-
lowing conditions:
,---,
j :
l '
r-:
I :
255
Chapter 12 / Link Technical Reference
! ~
L.J
MS-LIB The Library Manager
This utility is provided for advanced programmers. If you are not j I
an advanced user, you have no need for this utility. LJ
With the MS-LIB library manager, you can create library files i i
to use with MS-LINK. You can also modify library files by: ----J
• Deleting modules from a library.
, I:
\
• Adding object files (as modules) to a library. '---'
Order of Operations
During each library session, MS-LIB first deletes or extracts
modules; then it appends new modules to the end of the file.
During those operations, MS-LIB reads each module into mem-
ory and checks it fQr consistency. It then writes back to the file I
all modules you wish to retain. While doing so, it closes up the U
disk space to keep the library file as small as possible.
After appending all new modules, MS-LIB creates the index that
MS-LINK uses to find modules and symbols in the library file.
If you wish, you can instruct MS-LIB to store the index in a list-
ing file. The file contains two lists. The first is an alphabetical
list of all PUBLIC symbols, each followed by the name of the
module that contains it. The second is a cross-reference list -
an alphabetical list of the modules, each followed by a list of the , I
PUBLIC symbols in the module. , I
L-1
I, :I
-----J
: I
U
i I
LJ
256
rI : Chapter 12 / Link Technical Reference
Running MS-LIB
To start MS-LIB, you can do any of the following:
f'
!
• Enter the LIB command without options; then respond
to the three prompts.
n Library File:
Enter the name of the library you want to create or modify. If
you omit an extension, MS-LIB assumes .LIB. For example, to
n specify the library SAMPLE.LIB, at the prompt type:
SAMPLE I ENTER I
,n \
If you specify a library that does not exist, MS-LIB displays:
Library file does not exist. Create?
r-' Type YES I ENTER I to create the file or NO I ENTER I to stop the
I : session.
I'
i
257
Chapter 12 / Link Technical Reference .~
:
I II
Operation: l......J
List, in any order, any modules you want to delete or extract and I '
any object files you want to append. Precede each name with the
command character that specifies the type of operation you want
L
to perform on that module or file. The command characters that
apply are: I '
LJ
• Minus sign (-), which deletes
• Asterisk (*), which extracts i ;
L....:
• Plus sign (+), which appends
For example, to delete the module LESS and append the object I I
List file: ,
I !
~
Enter the filename of the listing file you want to create. For
example, to create the listing file CROSSLST, at the prompt,
type: ,
: t
'
L.....J
CRDSSLST I ENTER I
If you press only I ENTER I at the prompt, MS-LIB uses NUL and
thus does not create a listing file. LJ
Method 2: Responses on Command Line I I
I I
~
To use this method, enter the command in this format: LIB
library operations, listing I ENTER I
i
The command line option, defined under "Method 1: Keyboard LJ
Responses," accomplish the same purposes outlined in that sec-
tion. For example, the following command deletes the module , I
i
------I
I
258
r-
I
: I
Chapter 12 / Link Technical Reference
n Notice that there is no space between library and the first com-
mand character.
n
, ,
I ' If you type only a library name followed by a semicolon (;) MS-
LIB reads the library file and checks it for consistency. It per-
forms no other operations. For example, to perform a consistency
check on the PASCAL library file, type:
LIB PASCAL; [ENTERI
rj
I
If you type only a library name followed by a comma (,) and a
listing filename, MS-LIB checks the library file for consistency
and produces the listing file. It performs no other operations. For
n
I '
example, to perform a consistency check on the library file PAS-
CAL and then create the listing file PASCROSS.PUB, type:
LIB PAS CAL, PAS CR0 S S . PUB I ENTER I
'.
filespec is the name of a previously created file that contains
i i responses to the MS-LIB command prompts.
A response file has one line of text for each response. Be sure
r-1
, I your responses are in order so that they apply to the appropriate
[
prompts.
Use the command characters in the response file the same as
n you use command characters on the keyboard.
When the library session begins, MS-LIB displays each prompt
with its response. Whenever you have not specified a response,
Ii MS-LIB uses the default.
If you type a library filename followed by a semicolon, MS-LIB
I" I reads the file and checks it for consistency but performs no other
I
operations.
If you enter a library filename and then a comma, and then a
listing filename, MS-LIB performs the consistency check and
produces the listing file.
r-;
I I
259
Chapter 12 / Link Technical Reference
I I
Here are two sample response files: U
PASCAL I ENTER I
, CROSSLST I ENTER I
The above file causes MS-LIB to read the library file PAS-
CAL.LIB, perform a consistency check, and create the listing file ,
I
I
.
I
,
CROSSLST. L.J
PASCAL I ENTER I
+MORE-LESS I ENTER I ,
i I
]
l......J
The above file causes MS-LIB to delete the module LESS from
the library file PASCAL.LIB and add the object file MORE.OBJ. I I
MS-LIB does not create a listing file. LJ
Command Characters
! I
Several command characters help simplify the task of using MS- ~
LIB. Four of these specify particular operations. They are:
, \
: j
L..J
260
Chapter 12/ Link Technical Reference
Asterisk (*)
An asterisk preceding a module name instructs MS-LIB to
extract (copy) that module from the library into an object file.
MS-LIB assigns the object file specification, using this format
r
I ,
current drive:module name.OBJ
I '
For example, if the current drive is Drive A and the mod-
ule name is CURSOR, the object file specification is
n A: CURSOROBJ. If you do not want to use the current drive,
copy the file to another. If you want to use the current drive but
not the .OBJ extension, rename the file .
.--
I I
l I Ampersand (&)
The ampersand extends the current line when you specify the
r-1
I ' operations to perform. When you place an ampersand at the end
i l
of a line, MS-LIB displays the Opera t ion: prompt again so that
you can type more responses:
Operation: +CURSOR-HEAP+ HEAP*FOIBLES&
Operation: *INT+ASSUME+RIDEj I ENTER I
..., Use the ampersand as many times as necessary. Only disk space
i 1 limits the number of modules you can append or extract. You can
delete as many modules as exist.
n
I i
Semicolon (;)
At any time after the first prompt (Li bra r y Fi 1e :), you can
select default responses to the remaining prompt(s). To do so
type [JI ENTER I
Caution: Once you have entered the semicolon, you can no longer
respond to any of the remaining prompts. Therefore, do not use
the semicolon to skip only the 0per at ion: prompt. To skip one
p~ompt, use the I ENTER I key.
Ii I GTRL J[]]
! '
Typing I CTRL J[]] stops the library session at any time. If you
j; enter an incorrect response, such as an incorrect filename or
I ! module name, type I CTRL I[]] to exit MS-LIB. Then restart the
session.
Ii If you make an error before you press I ENTER I use I BACKSPACE I to
! ' delete characters in that line.
~
I
261
J
1
I j
L-..I
! I
LJ
i
u
i
U
\ i
~
, ]
'--'
, I
LJ
,
U
, I
I '
U
I
I I
'--'
J
,"---'
I
"
I
c }
I
1------'
i, II
Il
I
J
"
I
L _.
:
I
i
'
,---'
I i
1--'
L J
11
L :
1---'
!
I"'
! Chapter 13
!,
The MS-DOS DEBUG is a utility program to aid you in testing,
changing, and observing the operation of executable object files.
You can use DEBUG to alter the contents of a file or register and
then immediately execute the program to see if the changes are
valid without reassembling the program.
r--
To enter the DEBUG program, type:
I
DEBUG [pathname] [parameters] I ENTER I
("""'
Note: When DEBUG is initialized, it sets a program
I : segment prefix (PSP) at Offset 0 in the program work
area. If you don't specify a pathname, you may over-
write the default PSP. If you are debugging a .com or
("""'
I .exe file, however, tampering with the PSP below rela-
I '
tive address 5CR will cause DEBUG to terminate.
263
Chapter 13/ The DEBUG Utility LJ
DEBUG Commands
i )
A DEBUG command consists of one letter followed by one or , J
S--l
more parameters. You can use any combination of uppercase and
lowercase letters in commands and parameters. While using
DEBUG, you can also use the control keys (described in Chapter , i
1) and the MS-DOS editing functions (described in Part 3.) ---1
Notes
• You can terminate any DEBUG command by typing I CTRL I en
• To stop the screen from scrolling, type I CTRL I en to continue , I
i i
D CS:g00 CS:110 LJ
tError
i
LJ
I
I I
'--'
: I
u
I II
'-----'
264
I ' Chapter 13 I The DEBUG Utility
r
I
Command Summary
Command Syntax
Assemble A [address]
r-
I . Compare C range address
!
i_
•
'
Input I portaddress
Load L [address [drive sector sectorcount]]
Move M range address
Name N filespec1 [filespec2]
r
I '
Output o portaddress byte
Proceed P[ = address][ualue]
r
I '
Quit Q
Register R [registername]
8earch 8 range list
Trace T [= address] [value]
I""'
Unassemble U [range address]
i '
Write W [address [drive sector sectorcount]]
n
I '
Command Parameters
address is a one- or two-part designation in one of the following
formats.
t~
• An alphabetic segment register designation and an
offset value. Example: C8:0100
l \
r:
i i
265
\ !
Chapter 13/ The DEBUG Utility LJ
1
U
• A segment address and an offset value. Example:
04BA:OIOO
i I
• An offset only, in which case the default segment is
used. DS is the default segment for all commands
L..i
except G, L, T, U, and W, for which the default seg-
ment is es.
3 Drlve D
U
• addressl address2 . i )
L.J
Example: C5 : 1 13 13 1 1 13
\ ,
address2 must be an offset value. L-:
i
i
"--'
I
266
Chapter 13/ The DEBUG Utility
I'
I
• addressLvalue
value is the number of bytes on which a command
operates. If you omit Lvalue, DEBUG assumes a value
of 80 bytes. Do not use this format if another hex
value follows the range.
r
r _~ Example: CS: 100 L 10
cs: 1 00
~ The limit for range is 10000 hex. To specify a value of 10000 hex
L within four digits, enter 0000 (or 0).
registername (See the explanation of the Register command for a
list of valid register names.)
sector sectorcount is a one- to three-character hexadecimal value
indicating the relative sector number on the disk and the num-
ber of disk sectors to be written or loaded.
The first sector of Track 0 on Head 0 is Sector O. The remaining
r:
I
sectors of Head 0, Track 0 are numbered consecutively. Number-
ing continues with the first sector of the Head 1 track that is of
the same radius as Track O. When all sectors on all heads of the
ic track (that is of the same radius as Track 0) are numbered,
; numbering continues with' the first sector of Head 0 of the next
track.
r---'
!
I '
string is any number of characters enclosed in quotation marks,
either single (,) or double ("). The ASCII values of the charac-
ters in the string are used as a list of byte values.
r
( , If quotation marks are to be used within a string, they must be
either the opposite set or they must be doubled.
Examples of the correct uses of quotation marks:
\Thi5 1 5 tring" i5 correct.'
r--' \Thi5 \ \5tring' , i5 correct.'
! "Thi5 \5tring' i5 correct."
:
"Thi5 II 1 5 tring" II i5 correct."
i Examples of incorrect uses of quotation marks:
I ;
\Thi5 \5trlng' i5 not correct.'
"Thi5 1 5 trlng" i5 not correct."
value is a hexadecimal value that is a maximum of four
characters.
267
Chapter 13 / The DEBUG Utility 1
L.J
!
I ,
: l
~
ASSEMBLE
A [address] I
J
I
,
'-'
Assembles Macro Assembler statements directly into memory.
Parameters
address is the starting address for the instructions to be assem-
bled in memory.
If you omit the address, the Assemble command begins at the
next address following the last assembled program. If no Assem-
ble statement was used previously, assembly starts at CS:0100.
All numeric values are hexadecimal and can be entered as 1-4
characters.
Notes
• If a statement contains a syntax error, DEBUG displays:
tError
: I
and redisplays the current assembly address.
G
• The segment override mnemonics are CS:, DS:, ES:, and SS:.
The mnemonic for the far return is RETF. String manipula- I
I
tion mnemonics must explicitly state the string size. For c...-J
example, use MOVSW to move word strings and MOVSB to
move byte strings.
I !
• Prefix mnemonics must be specified in front of the opcode to
which they refer.
I '
Examples
Near/Far
i I
0100: 0500 JMP 502 a 2-byte short jump ~
0100:0502 JMP NEAR 505 a 3-byte near Jump
0100:0505 JMP FAR 50A a 5-byte far Jump I I
'--.J
The assembler automatically assembles short, near, or far jumps
and calls, depending on byte displacement, to the destination
address. These may be overridden with the NEAR or FAR prefix. ,
I I
i
The NEAR prefix can be abbreviated to NE. L..-J
i )
~
268
r--
!I Chapter 13 / The DEBUG Utility
r-'
1 ' Word Ptr/Byte Ptr
NEG BYTE PTR [128]
DEC WO [S 1 ]
r;
Register Indirect Commands
, i
ADD BX,34[BP+2]. [SI-1]
POP [BP+DI]
rJ PUSH [SI]
I I
it '\
-,
I
[ I
r-'
i :
269
Chapter 13/ The DEBUG Utility
Opcode Synonyms
LDDPZ HH'J i .
LDDPE Hllil ~
JA 100
JNBE 100
, I
All opcode synonyms are also supported. ~
WAIT/FWAIT
FWAIT FADD ST,ST(3) ; This line will
assemble
; FWAlT prefiX I
~
FLD TBYTE PTR [BX] ; This line will not
The WAIT or FWAIT must be explicitly specified for 8087 ,
opcodes. i
L..J
, I
COMPARE
C range address \
,
.-
I
L....-i
Compares memory specified by range to a memory block of the
same size beginning at address. )
I
'-J
Parameters
range is the beginning location and the number of bytes of ~h:,
first block of memory to be compared.
address is the beginning address of the block of memory to
which range will be compared.
If the two areas of memory are different, DEBUG displays the
differences in this format:
addressl bytel byte2 address2
addressl bytel refers to the address and contents of a location in I
, ,I
the specified range. w
byte2 address2 refers to the corresponding address and contents
in the block starting at address.
270
,-
I
l Chapter 13/ The DEBUG Utility
Example
C 1 0 0 , 1FF 30 0 I ENTER I
C 100L100 300 I ENTER I
--
It . are two commands that have the same effect. Each command
compares the block of memory from DS:l00 to DS:1FF with the
,---,
block of memory from DS:300 to DS:3FF.
I I
I
,--, DUMP
I '
D [address]
r--- D [range]
I I
! ,
Parameters
address is the beginning memory location for DUMP.
range is the number of bytes to be displayed.
I :
Notes and Suggestions
• The dump is displayed in two portions:
• A hexadecimal portion where each byte is displayed in
hexadecimal.
• An ASCII portion. Each byte is displayed as an ASCII
character. Characters that cannot be displayed are
shown as a period (.)
271
Chapter 13 I The DEBUG Utility
, : I
Example
Des: 1 0 0 1 09 I ENTER I , i
L'
DEBUG displays the contents of the range C:100 109 in the fol-
lowing format:
04BA:0100 54 4F 4D 20 53 41 57 59-45 52 TOM u
SAWYER
! ;
L.J
ENTER
E address [list] , ,
!
~
I
Parameters
address is the beginning location of the memory block to receive
new values.
I '
'---'
list is the new values to be entered.
, i
'~I
, I
I I
1----1
272
\
i ' Chapter 13/ The DEBUG Utility
Notes
• If you type the optional list of values, DEBUG replaces the
contents of memory, beginning at address, with the new val-
ues. For example:
I""' E DS: 1liHl 45 A1 "abc" I!lF
I '
I I
Example
E C5 : 1 I!ll!l [ENTER I
...-, causes DEBUG to enter byte values into memory beginning at
: i
,_ I DS:I00. DEBUG displays the address and its contents (EB) as
shown here.
I
, ' \
1!l4BA:I!lUI!l EB.
~
I ,
273
;
Chapter 13/ The DEBUG Utility \
To change the value from EB to 41, type 41 (at the present cur-
sor position) and press the space bar. DEBUG stores the value 41
and displays the contents of the next byte:
~4BA:~1~~ EB.41 1~.
To display the contents of the next two bytes, press the space bar
II ''
twice more. You might see ~
\ !
FILL ! •
F range list
- Fills the memory locations in the specified range with the values
in the list. i .
: I
--.J
Parameters
range is the area of memory to receive the new values.
list is the data values to be placed in range.
Notes
• If the list contains fewer bytes than the range, DEBUG uses
the list until all locations in the range are filled. \ :
~
• If the list contains more bytes than the range, DEBUG
ignores the extra values in the list.
• If you enter only an offset for the starting address of the
range, DEBUG uses the segment indicated by Register DS.
274
l ,
Chapter 13/ The DEBUG Utility
,.......,
I
Example
F 04BA:100 L 100 42 45 52 54 41 IENTERJ
causes DEBUG to fill memory locations 04BA:IOO through
04BA:IFF with the bytes specified. The five values are repeated
," '
until alllOOH bytes are filled.
i"" GO
G [=addressl[address2 ... ]]
Executes a program currently in memory. Execution stops at
specified breakpoints, and the registers, flags, and instruction
line for the next instruction to be executed are displayed.
Parameters
addressl is the start location of the program to be executed.
address2 ... gives the addresses for optional breakpoints.
,, ,
Notes
• If you include addressl, execution begins at addressl in the
CS segment. The equal sign ( = ) is required.
• If addressl is omitted, the program execution starts at the
current instruction. The address of the current instruction is
determined from the contents of the CS and IP registers.
---,
i
, \
275
, I
Chapter 13/ The DEBUG Utility I
L-'
:
Example
G CS : 7 5 5 il I ENTER I
causes the program currently in memory to execute up to j, :I
address 7550 in the CS segment. DEBUG restores the original
instructions, displays the register contents and the flags, and the
Go command ends.
, I
L
, I
, 1
I-..J
276
Chapter 13/ The DEBUG Utility
HEX
\ , ''
H valuel value2
Performs hexadecimal arithmetic on valuel and value2.
Parameters
I '
i
valuel value2
DEBUG first adds valuel and value2 and then subtracts value2
from valuel. The sum and difference are displayed on one line.
Example
I ,
H 19F 1 QJ A I ENTER I
causes DEBUG to perform the arithmetic and displays the
results:
QJ2A9 QJQJ95
The sum of 19F and lOA is 02A9, and the difference is 0095.
,--;
[ I
INPUT
,...,
I I portaddress
..--l Inputs and displays one byte from the specified port.
i :
Parameters
l_ ; porta<jdress is a 16-bit port address in hexadecimal.
Example
I 2F8 I ENTER I
causes DEBUG to input the byte at Port 2F8 and display it. If
, the byte is 42, DEBUG displays:
I \
42
277
I :
LOAD
L [address[drive sector sectorcount]]
,
Loads a file into memory. , ;
j :
Parameters
address is the beginning memory location for a file load.
drive sector is the absolute disk sectors that contain the file to
be loaded. I '
LJ
sectorcount is the number of disk sectors to be loaded.
I i
Notes
• Before a file can be loaded, it must have been named either
when DEBUG was started or with the Name command. Both
procedures format a filespec properly in the File Control Block
at CS:5C.
• If you omit all parameters, DEBUG loads the file into memory
at address CS:I00 and sets BX:CX to the number of bytes
loaded. If you specify address, DEBUG loads the file beginning
at the specified address in memory. In both cases, the file is , ,
,I
read from the drive specified in the filespec or from the
default drive if no drive was specified.
• When all parameters are specified, absolute disk sectors are 1
~
:
\ :
I i
c.-..J
278
Chapter 13/ The DEBUG Utility
Example
DEBUG I ENTER I
N f i 1 e • com I ENTER I
L I ENTER I
DEBUG loads the file called File.com from the default disk. To
load only portions of a file or certain sectors from a d~sk, type a
command similar' to the following:
L 04BA:100 2 0F 6D I ENTER I
DEBUG loads 6DH (109) consecutive sectors into memory from
Drive C, beginning with absolute sector number OF (15). The
data is placed beginning at address 04BA:0100.
MOVE
i; M range address
Moves the block of memory specified by range to the location
:.: beginning at address.
Parameters
i
l ' range is the beginning location and number of bytes of memory
to be moved.
", '
I I address is the beginning address location to receive the moved
data.
279
Chapter 13/ The DEBUG Utility
Notes
• Overlapping moves (where some locations in the range are i I
also in the block beginning at address) are performed without : I
loss of data. The addresses in the range remain unchanged
unless new data is written to them by the move.
. i
• If only an offset is used for the starting address of range or for L
address, the segment indicated by register DS is used. To
specify an ending address for the range, enter only an offset
value. !L.;'
Example )
I
NAME L.J
280
r-
I
I,_ I
Notes
• Four areas of memory can be affected by the Name command:
DS:5C File Control Block for filel
DS:6C File Control Block for file2
DS:80 Count of characters
DS:81 All characters typed
I '
• A File Control Block (FCB) for the first filespec parameter
I , given to the Name command is set up at DS:5C. If you include
filespec2, an FCB is set up for it at DS:6C. DS:80 contains the
number of characters typed after the letter N in the Name
command line. All characters typed after the N are stored
beginning at DS:81.
n
I '
Examples
N f i 1e 1 . ex e I ENTER I
,..---.,:' L I ENTER I
I
L~ N flle2.dat flle3.dat I ENTER I
G I ENTER I
The Name command sets Filel.exe as the filespec for the Load
command that follows. After Filel.exe is loaded into memory, the
Name command is used again this time to specify the parame-
ters to be used by Filel.exe. When the Go command is executed,
Filel.exe is executed as if file1 file2.dat fl1e3.dat had
been entered at the MS-DOS command level.
DEBUG prog.com [ENTER I
N param1 param2/c t ENTER I
G I ENTER I
i I
I I
n
I '
~ ;
281
Chapter 13/ The DEBUG Utility
OUTPUT
o portaddress byte :
:'-..J'
\
Example
, I
o 2FB 4F ; :
causes DEBUG to output the byte value 4F to Port 2F8.
! 1
LJ
PROCEED
1 (ijJ 1 p [= address] [value]
Parameters
:I
L.-i
I ;
~
282
r-
II
Chapter 13/ The DEBUG Utility
r-
i
Examples
,Ii '
!
'
QUIT
n'
I
Q
Ends the DEBUG program. The Quit command exits DEBUG
n without saving the file you are debugging and returns to the
MS-DOS command level.
r-.
I '
Example
l !
Q I ENTER I
r- ends DEBUG and returns to the MS-DOS system prompt.
i '
! :
I i
I '
, I
REGISTER
R [registernameJ
r-,
I ,
I :
Performs these functions:
i!
\
]Parameters
registername is the name of the register to be displayed.
n
I \
283
! j
Chapter 13/ The DEBUG Utility L..J
Notes
LJ
• If you enter R with no registername, DEBUG displays the con- i ~
! I
tents of all registers and flags, together with the next instruc- L--
tion to be executed.
• If you include a registername, DEBUG displays the 16-bit r, !I
value of that register in hexadecimal, and then displays a '--'
BX SI CS
CX DI IP
DX DS PC
SP ES F i i
L.1
, I
U
, I
I i
'--'
i i
284
Chapter 13 / The DEBUG Utility
r-'
I I
I I
I . The flags are listed below with their codes for set and clear:
Flag Name Set Clear
n
I '.
I
Overflow (yes/no) OV NV
Direction (decrement/increment) DN UP
Interrupt(enable/disable) EI DI
Sign (negative/positive) NG PL
n Zero (yes/no) ZR NZ
Auxiliary carry (yes/no) AC NA
r-'
, I
! , Parity (even/odd) PE PO
.--,
Carry (yes/no) CY NC
I I
l ! At the RF command, DEBUG displays the flags in the order
shown above at the beginning of a line. The hyphen prompt ( - )
appears at the end of the line. Now you can change any of the
flag values by typing alphabetic pairs, in any order. You need
not leave spaces between the flag entries. Press [ENTER I to make
r-,
the changes and exit the command. Flags for which you did not
I ; type a new value remain unchanged.
Examples
n
[ .
RW!@]
causes DEBUG to display all registers, flags, and the next
n instruction to be executed. For example, if the location is
CS:llA, the display looks similar to this:
AX=0E00 BX=00FF CX=0007 DX=01FF
SP=039D BP=0000 SI=005C DI=0000
DS=04BA ES=04BA SS=04BA CS=04BA
IP=011A NV UP DI NG NZ AC PE NC
[
r:I
04BA:011A CD21 INT 21
r:
I . RF I ENTER I
DEBUG displays. the flags
n
I :
NV UP DI NG NZ AC PE NC-
;-'
I
285
Chapter 13/ The DEBUG Utility
~
r
SEARCH
LJ
S range list
Searches specified memory for a list of bytes. LJ
Parameters 1- 1
!
L...J
range is the start and end address in memory where search will
be conducted.
list are the byte values to find. i !
'---'
Notes ,
~ I
,i
LJ
i ,
~
286
Chapter 13/ The DEBUG Utility
! ' Example
S C5 : 1 'l 'l 1 1 'l 4 1 I ENTER I
causes DEBUG to search,the addresses from C8:100 to C8:110
for 41H. If two matches are found, DEBUG displays a response
,-' similar to this:
!
'l4BA:'l1'l4
'l4BA:'lUD
I '
TRACE
II T [= address] [ value]
Executes one or more instructions and displays the register con-
tents, flags, and next instruction after each.
Parameters
=address is the address of the instruction where trace is to
begin.
value is the number of instructions to be traced (beginning with
, I address).
Notes
: I
• If you enter T with no parameters, DEBUG executes the
instruction at C8:IP (the current instruction) and displays the
i
registers and flags. If you enter the optional = address, trac-
" ' ing begins at the specified address. The optional value causes
DEBUG to execute and trace the number of instructions speci-
fied by value.
i :
: i
• When tracing more than one instruction, you can suspend the
display by pressing I CTRL I m
in order to study the registers
and flags for any instruction. Press the space bar to continue
scrolling.
', <I
,
287
i I
Chapter 13/ The DEBUG Utility I
LJ
I
Examples
T [ENTER I
i J
causes DEBUG to display the registers and flags for the current ~
T=011A 1 0 [ENTER I
, !
DEBUG executes 16 (10 hex) instructions beginning at OllA in
the current segment and displays the registers and flags after LJ
each instruction.
\ !
l..J
UNASSEMBLE i i
:-.J
U [address]
U [range]
Disassembles instructions and displays their addresses, their
hexadecimal values, and the source statements that correspond
to them. I I
LJ
Parameters
~I l,
address is the address of instructions to be disassembled.
range is the number of bytes to disassemble.
i !
~
Notes
• The display of disassembled code looks like a listing for an ! I
assembly language source file. The U command, without : I
288
J
l ; Chapter 13 / The DEBUG Utility
I'
i i
• If you enter the U command with the range specified, DEBUG
disassembles all bytes in the range.
• In all cases, DEBUG may disassemble and display slightly
more bytes than the default amount or the number you
requested. This is because instructions are of varying lengths,
and the last instruction disassembled may include more bytes
than expected.
• When only an offset is used for the starting address, the seg-
lf! I ment indicated by register CS is used.
• If you have altered some locations using DEBUG, you can
~
I : enter the U command for the changed locations, view the new
I i instructions, and use the disassembled code to edit the source
file.
I i
I ~
Example
U~4BA:1~~ L1 ~ I ENTER I
I'
I
causes DEBUG to disassemble 16 bytes beginning at address
04BA:0100 and displays information similar to the following:
.,.......,
,I :, ~4BA:~10~ 2~6472 AND [51 + 72] ,AH
" '
~4BA: 69 DB 69
Ii ~4BA:~104 7665 JBE ~16B
i :
~4BA:~1~6 2~737~ AND [BP + D1 + 70] ,DH
o
I
~4BA:~1~9 65 DB 65
~4BA:~1~A 63 DB 63
n
, '
~4BA:~1~B 69 DB 69
~4BA:~1~C 66 DB 66
~4BA:~10D 69 DB 69
~4BA:~10E 63 DB 63
1;
I: ~4BA:~1~F 61 DB 61
"
i, i
I
289
Chapter 13/ The DEBUG Utility
I )
i
I..-!
WRITE
, I
W [address[drive sector sectorcountJJ ! :
drive sector designates the disk drive to be used for the save.
sector designates the starting diskette sector for the save.
sectorcount indicates the number of sectors to be used in the
save.
i, f
I
'--..J
Notes
• If no parameters ~re given, the file save begins at CS:I00. If I l
only the address parameter is given, the W command writes ~
the file beginning at that address. In either case, you must be
certain that BX:CX contains the number of bytes to write.
This value may have been set correctly by the DEBUG or Load
commands, but later altered by a Go or Trace command. (Note
that if you load and modify a file, the name, length, and start-
ing address are already set correctly as long as the length has ,
!
I
-....-l
not changed.)
• The file must have been named either with the DEBUG start-
up command or with the Name command. Both commands for-
mat a filespec properly in the File Control Block at CS:5C.
DEBUG writes the file to the drive specified in the filespec or
to the default drive if none is specified. I
\ '
'
L..-.
: '
i ,
I I
~
290
I ' Chapter 13/ The DEBUG Utility
rr
l I
• When all parameters are specified, the write begins from the
~
memory address specified. The file is written to the specified
,I '
' drive (0 = Drive A, 1 = Drive B, and so on). DEBUG writes
'-~
the file beginning at the sector specified by sector, until the
number of sectors specified by sectorcount have been written.
• If only an offset is entered for the starting address, the seg-
ment indicated by register CS is used.
,.--.
i : • If a disk write error occurs, DEBUG displays a message. Press
, I
[ill to redisplay the Write command, and then press I ENTER I.
• Be very careful when you write to absolute sectors on the
disk. Data that was previously in these sectors is destroyed.
Example
n
'_I w CS:1~~ 1 37 2E I ENTER J
..--,
I
I ;
,r-1,
! .~
,.-.
I
i
--1
, I
:I '
(
,...,
i \
I i
r:
i i
291
, ,
~
n
! j
n
i . j
r-:
, !
;---J
i !
I
I ':
I I
~
i '
I'
I '
i
i
;-]
l j
n
r:
I
r--
l ' Chapter 14
r
l I Device Error Messages
Device errors refer to problems with your computer and its
peripherals, such as disk drives, modems and printers. If a
Device Error occurs at any time during a command or program,
MS-DOS returns an error message in the following format:
rI '
type error action device name
Abort, Ignore, Retry:
r
293
Chapter 14 / Problems and Error Messages
,.--,
l Bad command
MS-DOS issued an invalid command for the device driver. Try
the command again. If it continues to fail, contact the dealer
from whom you bought the device driver.
Bad unit
A device driver passed an invalid sub-unit number. Contact the
dealer from whom you purchased the device driver.
Data
The data cannot be read or written correctly. You probably have
a flawed disk.
Disk
r MS-DOS has found an error it does not recognize.
FeB unavailable
L__ FCB's might not be high enough.
General failure
,...,
I A hardware error or the disk is not formatted.
l _
Invalid disk change
A diskette was removed while files were open.
Lock violation
r-'
I : All or part of a source file is locked and cannot be read. Wait a
few moments and try again.
No paper
The printer is out of paper.
.....-,
l ' Non-DOS disk
The disk is not in a format recognizable by MS-DOS.
Not ready
The device is not ready. Check to see that the drive latches are
closed and that all devices are on and ready.
Ir-'.
r
!
295
Chapter 14 / Problems and Error Messages
I i
Read fault G
The device cannot successfully read the data. You may have a
flawed disk. Try to copy all files to another disk. If this fails, you
probably have a hardware problem. Contact your dealer. J
Sector not found I !
MS-DOS is requesting a sector number higher than the highest ~
number on the disk.
I I
I I
Seek o
The disk drive or hard disk cannot locate the proper track on the
disk.
Sharing violatlon
A file is open in a sharing mode that does not allow the com- - I
mand to write to the file. LJ
Write Fault , I
I I
~
The device cannot successfully write the data. You may have a
flawed disk. Try to copy all files to another disk. If this fails, you
probably have a hardware problem. Contact your dealer.
Write protect
You tried to write to a write-protected diskette. Remove the i i
write-protect tab and try again. L.-I
I
'--'
I
1
296
.J
Chapter 14/ Problems and Error Messages
rI
Command Error Messages
r The following errors can occur while using MS-DOS commands.
Acce55 denied
You tried to replace or copy to a write-protected, read-only, or
locked file.
297
Chapter 14/ Problems and Error Messages
If you press [Y] (for yes) in response to this prompt, CHKDSK ---J
recovers the lost blocks it found' when checking the disk.
CHKDSK creates a directory entry and a file for you with the
filename FILEnnnn.CHK. If you press []] (for no) in response to
this prompt, CHKDSK frees the lost blocks so they can be
reallocated.
298
r-
I I Chapter 14/ Problems and Error Messages
I:
!
Destinatlon disk format error
An error occurred during formatting. The disk may be flawed, or
you may have inserted it in the drive incorrectly.
Dlrectory is joined
n One of your file allocation tables has a defective sector in it. MS-
DOS automatically uses the other FAT. To ensure that you do not
lose data, use the COPY command to copy all files to another
disk.
Divide overflow
n The processor has set the divide overflow flag. This is usually
caused by a program attempting to divide by zero.
n
, '
,-..
I
299
I
Chapter 14/ Problems and Error Messages U
U
file canceled by operator
This is a reminder only. You used the IC parameter with PRINT ,
: I
I
j
300
,-
iI ) Chapter 14/ Problems and Error Messages
,..,
i
filename is cross-linked on cluster
~
This CHKDSK message names each of the two files in error.
,
I
I
. Copy both files, and delete both cross-linked files (the original
files).
n First cluster number is invalid
r entry truncated
This error is corrected automatically by CHKDSK.
Insufficient memory
301
Chapter 14/ Problems and Error Messages
. I
L;
Intermediate file error during pipe
The pipe operation makes use of temporary files on the disk that
MS-DOS automatically deletes after the piping operation is com-
plete. An error occurred in one of these files.
f •
Invali~ COMMAND.COM I
'-.J
I
Insert COMMAND.COM disk in default drive
and strike any key when ready
The program you just ran uses almost all of memory. MS-DOS
must now reload the COMMAND.COM file from disk. However,
MS-DOS cannot find COMMAND.COM on the disk, or the copy
found is invalid. Insert a disk that contains a copy of COM- I i
MAND.COM similar to the version that is on the disk you used L
to start MS-DOS.
! I
Invalid country code i l
~
You specified a parameter that does not exist. Check the com-
mand syntax in this manual. , 1
, f
302
Chapter 14/ Problems and Error Messages
r-'
,
303
Chapter 14/ Problems and Error Messages
Syntax error
Reenter the command, using the proper syntax.
I !
304
Chapter 14/ Problems and Error Messages
Warning-directory full
The disk does not contain enough directory space to recover more
files. Copy some files to another disk, then erase the originals.
Run RECOVER again.
305
Chapter 14/ Problems and Error Messages
Entry Error
The last command typed contained a syntax error. Reenter the
command, using the correct syntax.
rary file. Also be sure that the file does not have the same name I~
Insufficlent memory
There is not enough memory to run EDLIN.
Free some memory by writing files to disk or by deleting files
before restarting EDLIN. Use the Write command and then the
Append command.
306
Chapter 14/ Problems and Error Messages
Invalid Parameter
You specified a switch other than /B when starting EDLIN.
Specify the /B switch when you start EDLIN.
307
Chapter 14/ Problems and Error Messages
308
Chapter 14/ Problems and Error Messages
VM read error
This is a disk error; it is not caused by the linker.
309
Chapter 14/ Problems and Error Messages
310
....----,
I !
c ~
'I
---,
I
I
J
........,
I
I
Appendix A
The following table lists the keys, in scan code order, and the
ASCII codes generated by each (which depends on the shift sta-
! tus). The entries in the table are:
• SCAN CODE - a value in the range 01H-5AH (hexadec-
imal) that uniquely describes which key is pressed.
• KEYBOARD LEGEND - the physical marking(s) on
the key. If multiple markings exist, they are listed from
top to bottom.
• NORMAL - the normal (unshifted) ASCII value
(returned when only the indicated key is pressed).
~
311
, !
Appendix A / ASCII and Scan Codes
., Appendix A / ASCII and Scan Codes
,.......,
;
SCAN KEYBOARD ASCII CODES
CODE LEGEND NORMAL SHIFT CTRL ALT REMARK
35 / ? 02F 03F
36 RIGHT * SHIFT
SHIFT
37 PRINT * * X072 X046 print screen
~
i SCREEN
! 38 ALT * alternate mode
39 SPACE BAR 020 020 020 x020
3A CAPS LOCK * caps lock
3B Fl X03B X054 X05E X068
3C F2 X03C X055 X05F X069
3D F3 X03D X056 X060 X06A
3E F4 X03E X057 X061 X06B
3F F5 X03F X058 X062 X06C
40 F6 X040 X059 X063 X06D
41 F7 X041 X05A X064 X06E
42 F8 X042 X05B X065 X06F
43 F9 X043 X05C X066 X070
44 FlO X044 X05D X067 X071
45 NUMLOCK * number lock
46 HOLD * * * * freeze display
-, 47 7 \ 037 05C X093 t
48 8 - 038 07E X094 t
~
49 9 pGUP 039 X049 X084 I
r-
313
Appendix A / ASCII and Scan Codes I i
~
,
, '
means this key combination is suppressed in the keyboard
driver
X values preceded by X are extended ASCII codes (codes pre-
ceded by an ASCII NUL)
t The I ALI I key provides a way to generate the ASCII codes of
decimal numbers between 1 and 255. Hold down the I ALI I ~
i
The ASCII and Scan Codes table listed the ASCII codes (in
hexadecimal) generated by each key. This table lists the charac-
,
ters generated by those ASCII codes. , '
, ,I
314
- - - - - - ---- - - - ~ -
r--"'
~-
( -
315
Appendix A / ASCII and Scan Codes
i
~\
B 066 42H b 098 62H
C 067 43H c 099 63H
D 068 44H d 100 64H
E 069 45H e 101 65H ~
.
] 093
094
5DH
5EH
} 125
126
7DH
7EH
095 5FH DEL 127 7FH i I
'--'
DEC = decimal, HexadecimalCH), CHR = character,
LF = Line Feed, FF = Form Feed, CR = Carriage Return,
DEL = Rub out
, ,
I
~
-----:
316
-- - -- - - - - - --
,-,
Appendix A / ASCII and Scan Codes
,
,
003
004
•• ETX
EaT
••
005 ENQ
006 ACK
007 (beep) BEL
008 a BS
009 (tab) HT
010 (line feed) LF
011 (home) VT
012 (form feed) FF
013 (carriage return) CR
014 n SO
015
016
017
.
p-
....
SI
DLE
DC1
018 DC2
-~
, 019
020
021
,
!!
§
DC3
DC4
NAK
022 SYN
023 -.1. ETB
024 t CAN
;--;
025 ~ EM
i
026 SUB
027 ESC
028 (cursor right) FS
029 (cursor left) GS
030 (cursor up) RS
031 (cursor down) US
317
Appendix A / ASCII and Scan Codes
,
~
040 077 M
041 078 N
042 079 0
043 + 080 P
044 081 Q
045 082 R
~
046 083 S
047 / 084 T
048 0 085 U
049 1 086 V
050 2 087 W
051 3 088 X
052 4 089 Y
053 5 090 'z
054 6 091 [
055 7 092 \ -
056 8 093 1
057 9 094 II :
,-J
058 095
059 096
060 < 097 a
061 = 098 b
062 > 099 c
063' ? 100 d
064 @ 101 e
065 A 102 f
066 B 103 9 ~
067 C 104 h
068 D 105
318
Appendix A / ASCII and Scan Codes
106 j 143 A
, 107 k 144 E
~ -
108 I 145 ill
109 m 146 ~
110 n 147 0
111 0 148 0
112 P 149 0
113 q 150 A
u
'.
114 151 U
115 s 152 y
116 153 0
117 u 154 0
118 v 155 4:
119 w 156 £
120 x 157 l
,.-.>.
121 Y 158 Pt
122 z 159 f
123 160 a
124 161
125 162 6
126 163 U
127 0 164 n
128 C 165 N
129 U 166 ~
130 e 167 Q
~
.'
131 a 168 i
132 a 169 r-
133 a 170 --,
134 a• 171 V2
135 lf 172 V~
136 e" 173 i
137 e 174 «
)
138 e 175
139
140 I
I 176
177
.,.~~
141 178 ~
142 A 179 I
319
Appendix A / ASCII and Scan Codes
:~
ASCII CHARACTER CODES
ASCII ASCII
Code Character Code Character <....-J
-•
r
181 9 219
182 -11 220
183 -" 221 I
- I
184 ={
222
185 ~I 223
186 224 a
187 =;] 225 (3
188 ,:) 226 r
189 ...lJ 227 n
190 :d 228 r
191 ...., 229 a
192 L 230 1.1
193 -L 231 T
194 I 232 ~ ~
195 233 Q
~
196 234 fl
197 + 235 cl LJ
198 f= 236 00
199 I~ 237 0 I
I
200 lh 238 ( ----'
207 d: 245 J
208 .JL 246
209 =;= 247 ::::
211 lL 249 e
,
212 b 250 • ---"
213 F 251 V
214 rr 252 '1
215
. 253 2
216
217
*=F
...J
254
255
•
(blank 'FF)
!
320
-
Appendix B
The cursor blinks as the system waits for you to enter text-in
this case, the CONFIG.SYS commands. Regardless of how you
create the file, press (l[] to end input and to save on disk the
lines you typed. Again, be sure to save CONFIG.SYS in your
system root directory so that MS-DOS can execute it on startup.
Because MS-DOS executes CONFIG.SYS only at startup, MS-
DOS does not recognize new commands in CONFIG.SYS until
you reboot. Therefore, always reboot the computer each time you
add commands to the file.
I
, '
,
, '
321
Appendix B / Configuring YOur System
:-..J
CONFIG.SYS Commands
Here is a summary of the commands you can use in your CON-
FIG.SYS file. Following the summary is 'a detailed explanation of
each command. (See Appendix C for information about the var-
ious device drivers you can install using the DEVICE command.)
Command Purpose
322
Appendix B / Configuring Thur System
BREAK
BREAK [switch]
Sets the I GIRL I W check. Switch can be ON or OFF.
,, ,
Normally, MS-DOS checks for [GIRL I W only while writing to the
screen or printer, reading from the keyboard, or performing
asynchronous communications. Therefore, you cannot stop execu-
tion of a program unless it is performing one of those functions.
Setting BREAK to ON lets you extend the I GIRL I W check to
other functions, such as disk reads and writes. Setting BREAK
,I '
, to OFF re-establishes the system default (OFF).
Example:
break=on
extends the I GTRL I W check.
, ,
,
BUFFERS
BUFFERS = number
Lets you set the number of disk buffers that MS-DOS allocates
in memory at the time you start the system.
A disk buffer is a block of memory in which MS-DOS temporar-
ily stores data during disk input/output operations whenever the
amount of data read or written is not an exact multiple of the
sector size. Buffers are 512 bytes long, and the default number of
buffers is two.
Increasing the number of buffers can increase the speed of oper-
ations, as data still resident in the buffers can be read without
additional disk drive access. (The greater the number of buffers,
the greater the block of data available in memory.) If you cl'eate
many subdirectories, you can increase efficiency by using a num-
ber in the range 20 to 30. For application programs such as word
processors, you might find that a number in the range 10 to 20
provides the best performance. Experiment to find the ideal num-
ber to use, or consult your application program manual for the
requirements of a specific program. The maximum number of
buffers allowed is 99.
323
Appendix B / Configuring YOur System
Example:
buffers=10
sets the number of disk buffers to 10.
COUNTRY
I ~ 1 COUNTRY = country code
Enables MS-DOS to use the date and time format and to pro-
duce the currency symmbols for any of several countries.
The following table lists the valid country codes. The default is
001 (for the United States). ,
!
.
I
~
Country Code Country Code
Australia 061 Middle East 785
Belgium 032 Netherlands 031
French Canada 002 Norway 047
Denmark 045 Portugal 351
Finland 358 Spain 034 ,
.-J
France 033 Sweden 046
Germany 049 Switzerland 041
Italy 039 United Kingdom 044
Israel 972 United States 001
Example:
country=033
sets the country code to 033 (France).
DEVICE
DEVICE = pathname
: I
324
Appendix B I Configuring Your System
Example:
device=b:hdrive.5Y5
~
! ,
installs HDRIVE.8YS (the driver that lets you use non-standard
hard disks with your system) from the root directory of the
diskette in Drive B.
Note: Because MS-DOS installs the driver each time
you start up the system, place the driver on the cur-
.
I
, rent system disk. Then, you don't have to specify (in
the DEVICE command) where to look for the driver.
!
! ,
DRIVPARM
;-'.
: '
~ 1 DRIVPARM = ID:n [Ie] [IF:n] [lH:n] [IN] [lS:n]
9 [IT]
Lets you define parameters for block devices when you start MS-
DOS, overriding the original MS-DOS device driver settings.
,
I I
'
ID:n specifies a logical drive number. n can be in the range
255. Drive A == 0, Drive B == 1, Drive C == 2, and so on.
°to
325
Appendix B / Configuring Thur System
• I
Example:
You might have a computer with an internal tape drive unit on
Drive D that is configured at boot time to write 20 tracks of 40 , -,
sectors per track. If you want to reconfigure this tape drive to
write 10 tracks of 99 sectors each, you can put the following line
in your CONFIG.SYS file:
drivparm=/d:3 /f:6 /h:1 /5:99 /t:10
DRIVPARM=/D:1 /F:2
or ! '
DRIVPARM=/D:1
326
,---.
I
Appendix B / Configuring }Our System
.-
I FCBS
I ~ 1 FeBS nl,n2
Sets the number of files opened by file control blocks that can be
opened at anyone time, and lets you specify a number of these
to protect from inadvertent closure.
nl specifies the number of files opened by FCBs that can be
opened at anyone time. nl can be in the range 0 to 255. The
r,---,
, default value is 4.
n2 specifies the number of files opened by FCBs that MS-DOS I
cannot close automatically if an application tries to open morE(
than nl files by FCB. This option protects the first n2 files
opened by FCBs from being closed. n2 can be in the range 0 to
255. The default value is O.
i I
Example:
fcbs=4,2
specifies that four files can be open, and protects two files.
! !
t ,
FILES
,
,'--'
FILES = number
\ '
327
Appendix B / Configuring }bur System
Example:
r '
! :
sets the number of accessible open file handles to 20.
LASTDRIVE
I CifJ 1 LASTDRIVE = drive
Sets the last valid drive designation that MS-DOS accepts. This
command is only useful in a network environment.
drive is the logical drive specification of the last valid drive. It is
a letter in the range A to Z. Note that you do not place a colon
following the drive letter. The default value is E.
At startup, MS-DOS recognizes five drive letters, A-E, regard-
less of the number of physical drives you have on your system. A
network redirection must occur to make any of the extra drives
defined by LASTDRIVE valid.
MS-DOS allocates a data structure for each drive you specify.
Therefore, do not specify more than necessary.
Example: \ :
lastdrive=m
, '
sets the last drive to Drive M, unless you have added an exter- I •
SHELL
SHELL = pathname
Causes MS-DOS to start a command processor other than the
standard COMMAND.COM processor.
This command is intended for system programmers who write , ,
'-..-J
their own top-level command processor.
328
iI _ : Appendix B / Configuring YOur System
Example:
5hell=\bln\command.com /e:3~~~ a:\bin /p
f !
uses the COMMAND.COM shell in the \ BIN directory with an
environment size of 3000 bytes.
I i
I
Sample CONFIG.SYS File
A typical CONFIG.8YS file might look like this:
buffer5=1~
file5=12
device=\bin\network.5Y5
break=on
5hell=a:\bln\command.com /e:3~~~ a:\bin /p
la5tdrive=e
This file sets the number of disk buffers to 10 and the maximum
number of open files to 12. It also tells MS-DOS to search for the
pathname \ BIN \ NETWORK to find the device you are adding
to the system. The file is usually supplied on disk with your
device. Be sure you save the device file in the directory that you
specify with the DEVICE command.
The file also sets the MS-DOS command EXEC to the COM-
MAND.COM file located on disk in Drive A in the \BIN direc-
r-
,
I
I
, tory. The IE switch sets the size of the environment to 3000
I
bytes. The A:\BIN tells COMMAND.COM where to look for
itself when it needs to be reread from disk. The IP switch tells
I i
COMMAND.COM that it is the first program running on the
system so that it can process the MS-DOS EXIT command. (See
COMMAND in Part 2 for more information on the command
processor.)
The last logical drive on the system is Drive E, unless you have
added an external logical device, using DRIVER.SYS. (See
Appendix C for more information on DRIVERSYS.)
i .
329
Appendix B / Configuring }Our System
Changing CONFIG.SYS
If CONFIG.8YS is already on your diskette, before creating a
new file be sure it does not contain data you want. To read an
existing file, type:
t y P e con fig. s Ys I ENTER I i I
'---"
330
Appendix C
n
. , Your MS-DOS system can use several device drivers. A device
driver is a program that controls external devices or executes
other programs. The Version 2.11 MS-DOS device drivers are
included on the MS-DOS/BASIC system diskette. Version 2.11
drivers are: ANSI.SYS, KEYCNVRT.SYS, LPDRVR.SYS,
.--
, , SPOOLERSYS, and VDISKSYS. In Version 3.2 MS-DOS, both
the MS-DOS/BASIC system diskette and the Supplemental Pro-
grams diskette contain device drivers. Version 3.2 drivers are:
ANSI.SYS, DRIVERSYS, KEYCNVRT.SYS, LPDRVRSYS,
,r:
l I
MLPART.SYS, SPOOLERSYS, and VDISKSYS.
Device Driver Purpose
~
ANSI.SYS Provides programmers with many extended
I ! screen and keyboard features, such as the
ability to change graphics functions.
n
, >
DRIVERSYS Enables your system to support more than
two floppy disk drives and more than two
hard disk drives. Also, DRIVERSYS lets
you assign more than one logical drive let-
ter to a single drive.
r--"1
KEYCNVRT.SYS Converts certain keyboard characters for
i
I
;
_'
application software compatibility.
LPDRVRSYS Lets you configure your system to take full
,-, advantage of your printer's capabilities.
i ;
MLPART.8YS Lets you access multiple MS-DOS partitions
on a hard disk drive.
SPOOLERSYS Lets you continue processing data while
printing.
VDISK.SYS Lets you establish a virtual disk drive in
RAM.
,.,
, I
331
Appendix C / Installable Device Drivers
, ,
LJ
ANSI.SYS
(For Extended Screen and Keyboard Control)
ANSI.SYS is a loadable driver that provides programmers with
many extended screen and keyboard features. With it installed,
you can change graphics functions, move the cursor, and f 1
reassign the meaning of any key on the keyboard by issuing spe- U
cial character sequences from within your program. These
sequences are valid only when issued through MS-DOS function
calls 1, 2, 6, and 9. For more information, see your MS-DOS Pro-
grammer's Reference Manual.
Include the following command in your CONFIG.SYS file to
install the ANSI.SYS driver:
DEVICE =ANSI.SYS
I !
I @o j (For
DRIVER.SYS
Additional Disk Drives)
DRIVERSYS is an installable device driver that enables your
system to support more than two floppy disk drives and more
than two hard disk drives.
In addition, DRIVERSYS lets you assign more than one logical
drive letter to a single drive.
i I
To install the DRIVERSYS driver, include a DEVICE command
in your CONFIG.SYS file, using this format:
DEVICE =DRIVER.SYS /D:n [lC] [/F:n] [lH:n] [IN] [lS:n]
[/T:n]
where: f '
! I
have a computer with two floppy disk drives, the drives are num- ~
bered 0 and 1. If you add another floppy disk drive, its physical
drive number is hexadecimal 02. (The first external floppy drive .- ,
is always hexadecimal 02.) ~
If you have one floppy disk drive and one hard disk drive, the
floppy disk drive is hexadecimal 00, and the hard disk drive is i'
hexadecimal 80. '--J
I ,
1
'--J
332
Appendix C / Installable Device Drivers
KEYCNVRT.SYS
(For Key Conversion)
KEYCNVRT.8YS lets you generate keyboard characters other
than Tandy scan codes. This driver is for application software
compatibility.
Include the following DEVICE command in your CONFIG.SYS
file to install the KEYCNVRT.SYS driver:
DEVICE = KEYCNVRT.SYS
333
Appendix C I Installable Device Drivers
i '
LPDRVR.SYS
(For Extended Printer Capabilities)
The loadable printer driver extends the useable capabilities of a
Tandy printer. The functions of LPDRVR are:
• Set the number of lines per page
• Set vertical tabs
• Set the form feed function
• Set horizontal tabs
• Tab horizontally
• Set the skip perforation function
• Cancel the skip perforation function
• Ignore the next n codes
• Reset the printer driver
• Convert a single code into a series of printer codes
• Repeat n characters ,
• Suppress the line feed function '--
334
Appendix C / Installable Device Drivers
Example:
This example uses BASIC to set the number of lines per page to
55:
Iprint chr${27>;chr${67>;chr${SS> I ENTER I
CHR$(27) sends the ESCAPE, CHR$(67) sends the C, and
;- CHR$(55) sends the number of lines.
. !
335
Appendix C / Installable Device Drivers
336
Appendix C I Installable Device Drivers
r--"
337
Appendix C / Installable Device Drivers
1
8o 1 MLPART.SYS
(For Multiple DOS Partitions)
MLPART.SYS is an installable device driver that lets your com-
puter access multiple, non-bootable (DOS2) partitions on a hard
disk drive. To create these partitions, you use the MLPART.COM
command. (See "MLPART" in Part 2 of this manual.) ,
~
,
338
Appendix C / Installable Device Drivers
SPOOLER.SYS
(For Buffering Data to the Printer)
SPOOLERSYS is a loadable driver that buffers data to the
printer by temporarily placing the data in memory. SPOOLER
spools the data to the printer whenever the printer is available.
In this way, you can continue to use your computer to process
data while printing other data.
To install the printer buffer driver, include a DEVICE command
in your CONFIG.SYS file, using this format:
DEVICE = SPOOLER [lprinter] [size]
where:
...-,
J: /printer is the number of the printer you want to use (lor 2). If
you omit the number, the system assumes you want to use
Printer 1. Notice that you must precede the number with a slash
(I). You can install two spoolers if you have two printers
connected.
size is the size of the buffer in kilobytes. If you omit size, the
system uses 20K.
! ,
;c _
339
Appendix C / Installable Device Drivers
VDISK.SYS '.........J
340
I ' Appendix C / Installable Device Drivers
I \
r;
I :
: I
I '
I '
~ )
\'
I
I: \
I ,
! ~
;-,
I I
: 1,
341
i
Appendix D
343
Appendix D / Hard Disk Setup
.
~
'
I •
I •
L......J
344
, ,
GLOSSARY
,--..
) ,
-0 Following is a list of terms, used in this manual, that may not
be familiar to you.
345
Glossary
346
[ \
Glossary
1 ,
directory A disk area that keeps track of your files.
Each disk may have several directories,
each of which may contain several subdirec-
tories or files or both.
disk file A disk area in which you store information.
display Text or graphics that appears on the video
screen of your computer.
drive The mechanical portion of your computer's
magnetic storage device.
dummy A command parameter that is to be
argument replaced before the command can execute
successfully. The replacement parameter or
value can come from a program or from
operator input.
dump Send data or information to a device. You
, could dump a screen (text on the monitor)
, , to a disk or dump a buffer to a printer.
error Text on the screen that indicates a problem.
I ,
See Section VI for a description of error
messages.
ext or An appendage to a filename, 1-3 characters
extension long, that provides further identification.
Extensions often indicate a type of file such
as maillist.bas where .bas is the extension
and indicates a BASIC file.
external Procedures or utilities not resident in mem-
commands ory. External commands must be loaded
from disk into the computer before they can
be executed.
filename The name given to a file. It may be 1-8
characters long.
filespec A filename plus its extension, such as
1-..-_-
MEMOS.bas.
filter A function that performs a specific opera-
tion on data (such as sorting or searching)
as it flows between 2 devices (such as disk
and a printer), or between files.
347
: i
Glossary ~
I
:......J
format The process of dividing a disk into tracks
and sectors and writing on it the system
information used to store data. : !
"---'
input Information or data being received by a
device. I
348
Glossary
349
i~:
I
i
I
'---'
,
.---....C
,
I
'--'
i
: I
'----'
~
I
;
i
'--'
INDEX
/CR 107
/LF 107
3 1I2-inch drive, configuring in system 325-327
background 345
background printing 143-147
BACKUP 41-45
backup file, created with EDLIN 197
r- backup log entry 43
I ' BACKUP/RESTORE compatibility 43
backups, where BACKUP places files 44
r- BASIC 252
I batch file 345
calling one from another 27
conditional execution of commands 114-116
r creating 21-22
i . displaying message 140-142
executing 22
,.-, including remarks 22, 153
,J ,' pausing 22
percent sign 28
replaceable parameters 24-27
351
Index
,
i
~
suspending execution 140-142
transferring control to another line 105-106
where to create 23 i:-...,J!
batch file process, summary 23
baud rates 133
binary 345
binary file 53, 56, 59
displaying 182
J
BIOS 346
. i
black and white printer 108 LJ
block device, defining parameters for 325-327
BREAK 46
buffer 346
BUFFERS, CONFIG.SYS command 323-324
byte alignment 249
I :
I I
canonical frame 249 '---'
canonical frame address 253
carriage return 107
CGP-220 printer 107 I
'---'
I
character scan codes, converting to US scan codes 118
characters-per-line, setting 132
CHDIR 47-48
CHKDSK 49-50
class 238-239
CLS 51
COBOL 252
color TV 134
C01il, C01i2 9, 64 , )
! t
combine types 249 L...-J
command 346
editing 189-193
entering 1 : !
~
entering more than one at a time see batch files and
command piping
I
executing for several items in a set 97-98 I
352
Index
DATE 65-66
date ,
changing 65-66 I ;
changing format 66 ~
displaying 65-66
format for entering 65 ,
,
;
LOAD 278-279
MOVE 279-280
NAME 280-281
OUTPUT 282
PROCEED 282-283
QUIT 283 I ;
L.J
REGISTER 283-286
SEARCH 286-287
TRACE 287-288
UNASSEMBLE 288-289
WRITE 290-291
DEBUG command summary 265
DEBUG error messages 310
DEBUG, starting 263
default 33, 346 I I
DEL see ERASE , ,
~
deleting
from the template 193
library modules 260
lines with EDLIN 213-215
strings with EDLIN 228-229
delimiter 34, 346 , :
destination 34
device 346
device drivers see installable device drivers , I
directories 5, 347
backing up 43
r changing 47-48
i
checking 49-50
checking, sending output to a file 49-50
copying 186-188
creating 12-13, 127-128
current see current directory
deleting 13, 161-162
displaying 10-12, 68-69
parent see parent directory 17
root see root directory 6
wide display 68-69
directory names, anonymous 17-18
disk buffers, setting number 323-324
disk file 347
disk, bootable 99, 102, 109
DISKCOMP 39,70-71
DISKCOPY 39, 72-73
diskettes
comparing 70-71
copying 72-73
I
I '
formatting 99-104
DISKTYPE 74
display 347
displaying a command line 191-192
displaying lines with EDLIN 222-224
DMP 132
1"""1
I
DMP-110 printer 107
I ' DOS partition see FDISK
DOS2 partition
accessing see CONFIG.8YS commands, MLPART.SYS
,\ l, creating 130-131
I '
formatting 129
double-sided diskette, formatting as single-sided 99, 102
r drive 347
current see current drive
joining to a pathname 117
size and capacity 74
support of additional drives 332-333
type 74
II drive letter, reassigning 39
, dummy argument 347
dump 347
,... DWP 132
!
355
Index
\ ;
ECHO 75-76
editing a file in parts 234
editing functions :
I
I
I
EDLIN 2 ~
MS-DOS 2
editing keys 1-2
EDLIN command format and rules 205-206
EDLIN command parameters 207-208
EDLIN commands
Append Lines 209
Copy Lines 210-212
Delete Lines 213-215
i
Edit Line 216-217
U
End Edit 218 ,
Insert 219-221
List 222-224 , !
I
Move Lines 225 ----'
Page 226
Quit 227
Replace'String 228-229
Search Text 230-232
Transfer Lines 233
Write Lines 234 i
~
EDLIN command summary 207
EDLIN editing keys
copy all 199
copy character 198
copy to character 198
delete character 199
delete to character 200
enter line 202-203
replace template 201-202 I
,
.
I
356
Index
"........,
I
\
I
'
DEBUG 310
EDLIN 305-307
linker 308-310
errors that CHKDSK corrects 50
Escape Code Sequences 124-125
EXE2BIN 79-80
executable file, converting to binary file format 79-80
EXIST 114
EXIT 81
extended printer capabilities 334-338
extended screen and keyboard features 332
extending lines in library manager command 261
Ii '
'
extension 6-7, 347
external commands 29,347
order of search 138
transferring to another disk 54
extracting library modules 261
FC 82-92
FDISK 93-94, 111, 112, 343
File Allocation Table 151
file control blocks 327-328
file editing 195-203
file handles 327-328
filename extension see extension
filenames 6-7, 347
files
adding to backup 43-44
appending to existing files 56-58
checking 49
combining 59-61
comparing 82-92
copying 53-55, 186-188
creating with EDLIN 9-12, 195-196
deleting 77-78
n displaying contents 10-11, 181, 182
! :
displaying date and time modified 68
editing with EDLIN 197
inserting text with EDLIN 196
making minor changes to files 137
merging with EDLIN 233
r packing on backup diskette 43-44
! ' paging through with EDLIN 226
patching 137
recovering 151-152
357
I
Index L:
i :
renaming 154
restoring backed up files 157-160
saving with EDLIN 196 : I
updating 155-156 '--'"
verifying 184
file sharing 169 , ,
allowing over a network 40 i :
filespec 347
file system 5
filter 20, 347
FIND 20,95-96
floppy diskette see diskette
FOR 97-98
FORMAT 112, 343
format 348
FORMAT 73, 93, 99-104 , I
FORTRAN 242,243,252 L--
358
! _i Index
IF 114-116
input 348
input/output device, changing 64
input/output, redirecting 19
inserting text
n
! I
in a command line 192
with EDLIN 219-221
installable device drivers
r-',
I\ ANSLSYS 332
configuring in system 324-325
DRIVERSYS 332-333
I ' KEYCNVRT.SYS 333-334
t ' LPDRVRSYS 334-338
MLPART.SYS 338-339
SPOOLERSYS 339
I
I
' summary of drivers 331
VDISKSYS 340-341
internal 348
r , internal commands 29
internationally configured MS-DOS diskette 163-164
i keys
backspace 3
control-c 3, 34, 70, 242, 261, 264
!
I
359
,I :
,
Index e.-i
\ I
~
control-h 3
control-j 3
control-n 3
control-p 3
control-s 3, 264
escape 3
hold 3,34
print 3
shift-print 3
KEYTXX 118-119 . !
o
keywords 35
synonymous 36 , ;
360
J
Index
r--'
I
public 250
stack 250
,i : linker switches
, \'
I IDSALLOCATE 242
IHIGH 243
ILINENUMBERS 243
IMAP 243
INO 244
r--',
IPAUSE 243
ISTACK 243-244
! list file 236, 241
loading a line for editing with EDLIN 216-217
long references 255
LPDRVRSYS 123, 124
LPSETUP 122-126
Escape Code Sequences 124-125
LPT 9,348
machine language code 235
MCOPY.EXE 187
Media Error Map 113
media types, backing up between different types 43-45
r memory combine type 253
I merging files with EDLIN 233
messages, displaying during batch file execution 75-76
minus sign, used to delete library modules 260
MKDIR 12-13, 127-128
MLFORMAT 129,344
MLPART (MLPART.COM) 130-131, 344
r MLPART.SYS 129,130,344
MODE 132-135
modified files
backing up 41-43, 45
copying 186-188
monochrome monitor, using color-oriented software 134, 135
n MORE 20,136
moving lines with EDLIN 225
MS-DOS commands, quick reference 30-32
MS-DOS version, displaying 182
~
I
MS-LIB see library manager 256-261
multiple DOS2 partitions, accessing 338-339
,
1
~
NL 132
non-active partition 94, 129
notation 35-36
NUL 9
pagination 122-126
paging through a file with EDLIN 226
paragraph alignment 249 :w i
parameter 348
parameters 33
parent directory 17 I
i
parity 133 L-J
compatibility 107-108
control codes 335-337 , I
driver 334-338 ~
linefeed 132, 134
parameters 134
362
Index
I '
I
read-only attribute 40
RECOVER 151-152
relative line numbers in EDLIN 205
REM 22,153
RENAME 154
REPLACE 155-156
replaceable parameters 348
using more than ten 170-171
replacing strings with EDLIN 228-229
RESTORE 157-160
finding which disk to restore 43
RMDIR 13, 161-162
root directory 6,349
joining to a different pathname 117
RS-232 ports 9,64
RS232 communication parameters, setting 133, 135
run file 240
~
saving a file after editing with EDLIN 218
i saving in the template 192
screen scroll 34
screen
I' clearing 52
i
displaying 20, 136
shifting left and right 132
,,..... searching for strings with EDLIN 230-232
I sector 151-152
sectors, verifying after copy 54, 57, 59
segment addresses 253
segments 238
how the linker loads segments 251-253
SELECT 163-164
j
I
363
Index
I
semicolon U
in linker 242
in library manager 261 I I
serial port 9 u
I
SET 165-168
SHARE 169
SHIFT 25,170-171
~
I
SHIPTRAK 172
short references 254
SORT 20, 173-174
source 34 J
source code 235
special keys 1-2
special type 35-36 L.:
SPOOLER.SYS 175-176
stopbits 133
strings 208, 349 L....i
deleting with EDLIN 228-229
replacing with EDLIN 228-229
searching for with EDLIN 230-232
subdirectories '--'
copying 186-188
displaying 181 i
restoring 157, 159 ~
target 34
template 191, 349 I
temporary file 237 L--
text file see ASCIr file
text
finding 20, 95-96
l..-J
sorting 20
TIME 179-180
toggle 349
track 349 ~
TREE 181
364 '--!
I
Index
TYPE 182
VER 183
VERIFY 184
verify 349
verifying sectors after copy 54, 57, 59
video display, shifting left and right 134
G
I
video mode, setting 132, 134
video palette color, changing 132, 135
video scan lines, setting 132, 134
virtual disks 340-341
virtual drive name 177
VM.TMP 237
r- VOL 185
. i
volume label 68, 99, 102, 109, 126-127, 185
,---,
, '
i
~_.
,
,-
I I
~ \
~
, 1
• I
,-,
I '
~l
' ....
,-
I 1
t,.,_\
365
'-..J
'---