home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
dos
/
assist.lzh
/
MS-TUTOR.DOC
< prev
next >
Wrap
Text File
|
1986-01-30
|
27KB
|
727 lines
_________________________________________________
DOS ASSISTANT
Version 2.2
_________________________________________________
MS-DOS TUTORIAL
_________________________________________________
PCM SOFTWARE
P.O. BOX 1915
GRAFTON, VA 23692
Copyright (C) 1986 - John Hensley - All rights reserved
DOS ASSISTANT MS-DOS TUTORIAL Page 1.
CONTENTS
MS-DOS COMMANDS ........................ 3
DISK MANAGEMENT COMMANDS ............... 3
SYSTEM MANAGEMENT COMMANDS ............. 4
BATCH COMMANDS ......................... 5
EXECUTING A DOS COMMAND ................ 5
COMMAND LINE EDITING ................... 6
PATHS AND SUBDIRECTORIES ............... 8
WILDCARDS .............................. 10
BATCH FILES ............................ 11
EDLIN .................................. 13
DEBUG .................................. 15
GLOSSARY ............................... 17
DOS ASSISTANT MS-DOS TUTORIAL Page 2.
MS-DOS COMMANDS
All of the Disk Operating System (DOS) commands belong
in one of three categories:
1. Disk management commands.
2. System management commands.
3. Batch commands.
DISK MANAGEMENT COMMANDS
These commands are used in working with the disk drives
and files contained on your disks:
ASSIGN DEL FORMAT RMDIR
BACKUP DIR MKDIR SORT
CHDIR DISKCOMP PATH SYS
CHKDSK DISKCOPY RECOVER TREE
COMP FDISK RENAME TYPE
COPY FIND RESTORE VOL
With the disk management commands you can manipulate
your disk files in many ways and insure yourself against
the loss of vital information contained in you disk
files. The disk management command allow you to:
- Check your disks or individual files for damage.
- Compare the contents of files or whole disks.
- Copy disk files to other disks or directories.
- Delete unneeded files.
- Display the contents of your disks and directories.
- Make duplicate or backup copies of your disks.
DOS ASSISTANT MS-DOS TUTORIAL Page 3.
DISK MANAGEMENT COMMANDS cont.
- Manage disk subdirectories.
- Prepare new disks to accept files.
- Recover data from damaged disks and files.
- Rename your files.
- Sort the contents of disk files.
SYSTEM MANAGEMENT COMMANDS
These commands control the various settings of the
operating system and take care of the basic interfacing
between the computer and other devices.
BREAK DATE MORE SET
CLS EXIT PATH TIME
COMMAND GRAPHICS PRINT VER
CTTY MODE PROMPT VERIFY
The system management commands allow you to control the
way information is sent between hardware devices, as
well as setting system default values. Some uses of the
commands are:
- Allows background printing of text files.
- Change the standard output devices.
- Change the system defaults.
- Control output to the video display.
- Set the system time and date.
DOS ASSISTANT MS-DOS TUTORIAL Page 4.
BATCH COMMANDS
These commands allow you to make your own custom DOS
commands which may be used to do multiple operations
with one command entry.
ECHO GOTO PAUSE SHIFT
FOR IF REM
The batch commands are like a DOS programming language
which lets you work with the other DOS commands to do
a job in a specific order or if certain conditions are
met. Some uses of batch command are:
- Conditional execution of DOS commands.
- Design automatic start up files. ( AUTOEXEC.BAT )
- Enter a long string of commands with just one word.
- Execute a command a multiple number times.
- Execute a multiple number of commands on a list of
files.
EXECUTING A DOS COMMAND
A command is executed by entering the command name along
with any parameters at the DOS prompt.
A>COMMAND parameter parameter
If a command is transient (must be loaded from a disk
file), you may include a drive designation before the
command name to tell DOS what drive contains the
command's program file.
A>B:COMMAND parameter parameter
DOS ASSISTANT MS-DOS TUTORIAL Page 5.
COMMAND LINE EDITING
Each time you enter a command and press the "Return"
key, DOS saves the command entry and then allows you to
use it again the next time you enter a command. DOS also
allows you to edit the old command entry by deleting
characters from it and inserting characters into it.
The command editing features of DOS can save you time by
allowing you to use portions of the previous command, or
recover commands which did not work properly because a
file or command name was incorrectly spelled.
The DOS editing keys work as follows:
F1 - Copies 1 character from the old command line.
F2x - Copies characters from the old command line
until a character matching x is encountered.
F3 - Copies the remaining characters from the old
command line.
F4x - Deletes characters from the old command line
until a character matching x is encountered.
F5 - Deletes the remaining characters from the old
command line and starts a new command entry.
F6 - Enters an end of file character, "^Z", to the
new command entry.
Ins - Starts the insert mode so that characters
entered do not over write the old command line.
Del - Deletes one character from the old command line.
Esc - Start a new command entry.
DOS ASSISTANT MS-DOS TUTORIAL Page 6.
COMMAND LINE EDITING cont.
The following example will show the effect the editing
keys have on a new command entry. The command entry
represents the previously entered command.
A>COPY a:letter.doc b:letter.bak
F2t - Copies up to the letter "t".
A>COPY a:le
F1 - Copies the letter "t".
A>COPY a:let
F4. - Deletes up to the first period, ".".
A>COPY a:let
F2t - Copies up to the next letter "t".
A>COPY a:let.doc b:le
F4. - Deletes up to the next period, ".".
A>COPY a:let.doc b:le
F3 - Copies the remaining character.
A>COPY a:let.doc b:let.bak
Each time you type in a character it overwrites one in
the old entry. For example if the previous command was:
A>COPY b:old.doc a:new.doc
Now you want to compare the two files to be sure they
are identical. You can type "COMP" to overwrite the
"COPY" command and then press F3 to use the remaining
characters in the old entry. The new entry will be:
A>COMP b:old.doc a:new.doc
DOS ASSISTANT MS-DOS TUTORIAL Page 7.
PATHS AND SUBDIRECTORIES
MS-DOS versions 2.0 and higher allow you to create and
use subdirectories. A subdirectory is just a disk file
acting as a directory to contain information about other
disk files. The operating system can make use of this
information to know where a file is located on the disk,
how large the file is and when the file was last used.
Each file on a disk has a directory entry somewhere on
the disk. To create a subdirectory, enter the command:
A>MKDIR newdir
Where "newdir" is the name you wish to give the your new
subdirectory. The name may contain up to 11 characters.
After a subdirectory is created you can copy files into
it by using a path name to tell the operating system
which directory to copy the files to. A path name is
just a directory name preceded by a backslash "\". To
copy a file with the name "work.doc" into the new
subdirectory, enter the command:
A>COPY work.doc \newdir
If you want to copy a file from a subdirectory, to
another disk or subdirectory, you must identify the
subdirectory in which the file resides by prefixing a
path name to the file being copied. To copy the file
"work.doc" from the subdirectory "newdir" to a disk in
drive b:, enter the command:
A>COPY newdir\work.doc b:
You may use a drive designation when working with
subdirectories to show which drive the path is on:
A>COPY b:newdir\work.doc a:
DOS ASSISTANT MS-DOS TUTORIAL Page 8.
PATHS AND SUBDIRECTORIES cont.
You can create and use as many subdirectories as you
want, and you can even create a subdirectory within a
subdirectory by including a path name when creating a
new subdirectory. To create the subdirectory "second"
within the subdirectory "newdir" enter the command:
A>MKDIR newdir\second
If you are working with files in a subdirectory, you may
wish to use that subdirectory as the current directory.
This will allow you address all of the files in the
second directory without prefixing them with the path
name. To change the current directory to subdirectory
"second" enter the command:
A>CD newdir\second
To change back to the disk's root or master directory
use the command:
A>CD ..\..
The two dots ".." always stand for the root directory of
the current directory. A root directory is the directory
in which the current directory is located in. The path
"..\.." means change to the root directory of the root
directory. This will put us back in the disk's main
directory.
Subdirectories may be deleted if they are no longer
needed. To remove a subdirectory you must first erase
any files in the directory. Use the ERASE or DEL
command to erase any files in the subdirectory to be
deleted and then remove the subdirectory with the
command:
A>RMDIR newdir
DOS ASSISTANT MS-DOS TUTORIAL Page 9.
WILDCARDS
MS-DOS uses the characters "*" and "?" as wildcard
characters. Just like a wild card may represent any
other card, these two characters may be used to
represent any other character in a DOS file name.
The "*" character may be used in place one or more
characters in a file name. When DOS is given a "*" as a
character in a file name, it will accept any file name
that matches all the character up to the "*" character
as the correct file. The file name "w*.doc" would stand
for all file names that started with a "w" and had the
extension of ".doc". If a character is included in a
file name after the "*", it is discarded.
The "*" may also be included in the file name's three
character extension, such as "work.do*". If you use the
file name "*.*", DOS will interpret it as every file
name in the current directory. To copy the files on a
diskette in drive a: to a diskette in drive b: you could
use the command:
A>COPY a:*.* b:
DOS uses the "?" as wildcard replacement of a single
character in a file name. The file name "????????.???"
would be the same as the file name "*.*". If you had the
files "1letter.doc", "2letter.doc", "3letter.doc", etc.,
you could copy all of them from a diskette in drive a:
to a diskette in drive b: with the command:
A>COPY a:?letter.doc b:
The "*" and "?" wildcard characters are very useful but
they should be used with caution. If you delete a file
with the file name *.* you would be erasing the entire
contents of the current directory, so care must be
exercised whenever using wildcards in a file name.
DOS ASSISTANT MS-DOS TUTORIAL Page 10.
BATCH FILES
A batch command is a text file that contains a list of
DOS command to be executed. A batch file may be created
using Edlin. A batch file must use the extension ".bat"
for DOS to be able to use it. These examples show how
to create useful batch files with the line editor
program Edlin. If you create these file with a text
editor other than Edlin, ignore the "*I" and "*E" lines
and the lines containing "^Z". Also ignore the
remaining "*" characters and everything to the left of
them. The "^Z" characters are entered by pressing the
"F6" key.
Command name: SORTDIR.BAT
Usage: SORTDIR [drive:]
Action: Sorts the directory of the specified drive and
displays it one screen at a time. If no drive is
specified, the current drive will be the one
used. The DOS work diskette must be in the
current drive for the batch file to operate.
Example: SORTDIR b:
_________________________________________________
A>EDLIN SORTDIR.BAT
*I
1:* ECHO OFF
2:* CLS
3:* DIR %1 | SORT | MORE
4:* ^Z
*E
_________________________________________________
DOS ASSISTANT MS-DOS TUTORIAL Page 11.
BATCH FILES cont.
Command name: FILLDIR.BAT
Usage: FILLDIR new_dir old_dir [.ext]
Action: Creates a new subdirectory with the name "new_dir"
and then copies all of the files from the
subdirectory "old_dir" into the new directory.
If the optional parameter ".ext" is included,
only the files with that extension will be copied.
If either the new or old directory names are
omitted, instructions will be given.
Example: FILLDIR personal letters .doc
_________________________________________________
A>EDLIN FILLDIR.BAT
*I
1:* ECHO off
2:* IF "%1" == "" GOTO ERROR
3:* IF "%2" == "" GOTO ERROR
4:* MKDIR %1
5:* IF "%3" == "" NO_EXT
6:* COPY %2\*%3 \%1
7:* GOTO END
8:* :NO_EXT
9:* COPY %2\*.* \%1
10:* GOTO END
11:* :ERROR
12:* ECHO USAGE: FILLDIR old_dir new_dir [.ext]
13:* :END
14:* ^Z
*E
_________________________________________________
DOS ASSISTANT MS-DOS TUTORIAL Page 12.
BATCH FILES cont.
Command name: AUTOEXEC.BAT
Usage: Automatic
Action: This is a file which the operating system will
automatically execute each time the computer is
turned on or rebooted. The batch file will allow
you to set the time and date and then it will
execute the help program file ASSIST.COM. If you
use other memory resident programs you may
insert them into the file before line 3. This
will allow the help program to be removed from
memory should you need the memory for something
else. The help program file ASSIST.COM must be
on the boot disk with the AUTOEXEC.BAT file for
this batch command to operated properly.
_________________________________________________
A>EDLIN AUTOEXEC.BAT
*I
1:* DATE
2:* TIME
3:* ASSIST
4:* ^Z
*E
_________________________________________________
DOS ASSISTANT MS-DOS TUTORIAL Page 13.
EDLIN
The Edlin program included with your DOS distribution
diskette is a text editor which allows working with text
files a line at a time. Some uses for the editor are:
- Create and edit text files.
- Search for text strings in a file.
- List text files with each line numbered.
- Replace text strings in a file.
- Delete lines from a file.
Though not as powerful as a full screen word processor,
Edlin does have some advantages over the more powerful
programs. Some of the advantages of the line editor are:
- Fast loading.
- Easy to use with few commands to remember.
- Requires very little disk space.
- Requires very little memory.
To use the Edlin program place your DOS work diskette in
drive a: and enter:
A>EDLIN filename
The selected file will be loaded into memory for editing
and the Edlin "*" prompt will be displayed. If the file
does not exist, it will be created.
DOS ASSISTANT MS-DOS TUTORIAL Page 14.
EDLIN cont.
Unlike the DOS and Debug commands, most parameters used
with Edlin commands are entered before the command:
*1,10L
The first parameter in this example is a starting line
and the second is an ending line. This command would
list lines one through ten from the file being edited.
To edit a line, enter the line number at the prompt:
*14
You will able to type in the new line when the prompt is
preceded by a line number and a colon:
14:*
Pressing the "Return" key completes the entry of a text
line. If you need to insert new lines into an existing
file, use the "I" command. To delete lines from a file
use the "D" command.
If you are working with a file that is to large to fit
into memory, you will need to use the "W" command write
text from the work buffer to the disk, and then use the
"A" command to append more text into the work buffer.
Use the "S" command if you are looking for a specific
string of text in a file and use the "R" command to
replace a string of text with another string. The "R"
command may also used to correct misspelled words in
a file.
DOS ASSISTANT MS-DOS TUTORIAL Page 15.
DEBUG
The Debug program included with your DOS distribution
diskette is a very powerful tool for programmers who
develop programs in 8088 assembly language. Some of the
things you can do with the debugger are:
- Display data from any memory location.
- Display or alter the contents of the cpu registers.
- Display the assembly source code of programs.
- Enter data directly into any memory location.
- Input a byte from a port.
- Move blocks of data between memory locations.
- Output a byte to a port.
- Perform hexadecimal addition and subtraction.
- Read disk sectors into memory.
- Trace the execution of a program.
- Write disk sectors from memory.
- Write short assemble language programs.
To use the Debug program, place you DOS work diskette in
drive a: and enter:
A>DEBUG [file]
When the Debug prompt ,"-", is displayed, you will be
able to enter a Debug command.
DOS ASSISTANT MS-DOS TUTORIAL Page 16.
DEBUG cont.
The most common use for Debug is tracing out problems
in newly created assembly language programs. The best
way to debug a program is to use a structured approach.
This will allow you to move through sections of the
program code which operate as they should, and quickly
find the problem sections.
A good approach is to unassemble a section of code with
the "U" command and look for a convenient break point. A
good place for a break is the address following a "CALL".
Use the G"address" command where "address" is the offset
address of the breakpoint, to execute the program through
the called routine. This will allow you to verify that
the routine does what it is supposed to.
If everything is OK up to the breakpoint, repeat the
process until you come upon a routine that is causing
trouble. When you find a troublemaking routine you can
use the "T" command to step through the routine a line
of code at a time. Carefully examination of the register
contents after each step will allow you to find which
lines of the code are causing the problem.
If you come upon an interrupt call while stepping
through a routine, use the G"address" command where
"address" is the contents of the IP register + 2. This
will execute the program up to the address after the
interrupt call and speed the debugging process.
Remember when working with program files with the .exe
extension that the DS register will not address the data
segment until it is initialized. Most programs will set
DS to the data segment at the start of the code, so
stepping through the first few lines of code will
usually initialize the register and allow you to use it
when addressing the program's data segment.
DOS ASSISTANT MS-DOS TUTORIAL Page 17.
GLOSSARY
boot The process of initializing the MS-DOS
operating system.
byte Represents one character to a computer.
cpu The central processing unit of a computer.
directory A disk file which contains information
about other files on the disk.
disk A magnetic disk able to store information.
May be a flexible floppy diskette or a
mass storage hard disk.
diskette A flexible computer disk used to store
data
DOS The Microsoft Disk Operating System which
controls the operation of the computer.
drive The device which reads and writes data to
and from a magnetic disk.
file A group of text characters or program
steps which are stored on a disk as a
single unit.
hard disk A drive containing a non-removable magnetic
disk which allows storing and retrieving
large amounts of data very quickly.
hexadecimal A numbering system with a base of 16.
KB Represents 1024 characters to a computer.
DOS ASSISTANT MS-DOS TUTORIAL Page 18.
GLOSSARY cont.
memory The part of the computer where information
is stored while the computer is operating.
It may also be call RAM.
monitor A computer's television like video
display.
parameter A character string which is entered with
a DOS command to allow the command to
perform a task in a specific manner.
program A file containing a series of steps which
will be used by the computer to solve a
problem or perform a task.
resident Refers to a program which has the ability
to stay in the computer's memory so that
it will not have to be loaded from a disk
file each time it is used.
software Computer programs.