29.12.2012 Views

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

The Programmer's Guide to TRSDOS Version 6 - Tim Mann's Home ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

language (i.e. BASIC, C, PASCAL, ...) need not bother with the SVC as system interfacing<br />

is accomplished within the language interpreter or compiler.<br />

<strong>The</strong> DOS supports up <strong>to</strong> eight logical disk packs or volumes logically numbered 0-7. Each<br />

floppy, be it one or two sided, is treated as a single volume. Hard disk drives<br />

(winchesters) may be treated as a single volume or partitioned in<strong>to</strong> multiple volumes. A<br />

Drive Control Table (DCT) contains the parameters associated with each disk (number of<br />

cylinders, heads, and sec<strong>to</strong>rs per track for example) and also interfaces the disk driver<br />

software <strong>to</strong> the system.<br />

Character Input/Output devices (i.e. keyboard, video display, printer, RS-232 serial<br />

ports, ...) and their associated software driver routines are interfaced <strong>to</strong> the system<br />

via Device Control Blocks (DCB). I/O devices are identified by a two-character device<br />

name such as KI (keyboard input), DO (video output), PR (printer), and CL (communications<br />

line). Whenever a device is specified, it is denoted by an asterisk followed by the<br />

device name <strong>to</strong> form a complete "device specification". <strong>The</strong> reason for this will soon<br />

become evident. Additional devices can be defined <strong>to</strong> the system once an appropriate<br />

software driver is available. <strong>The</strong> device name selection is left up <strong>to</strong> the user.<br />

A collection of data s<strong>to</strong>red on disk is termed a file and is denoted by a file<br />

specification. A complete file specification consists of five parts: a file name of up <strong>to</strong><br />

eight characters, a file extension of up <strong>to</strong> three characters, a file password of up <strong>to</strong><br />

eight characters, the logical drive specification, and optionally, in certain cases of<br />

Partitioned Data Sets (PDS), a member specification of up <strong>to</strong> eight characters. Whenever<br />

users institute a structured naming convention, most files are accessible via the file<br />

name reference only. <strong>The</strong> DOS will search all drives for a file if the drive specification<br />

is omitted from the file specification. In addition, many system utilities and user<br />

applications can use default file extensions <strong>to</strong> separate files in<strong>to</strong> classes. For<br />

example, PRO-CREATE, a popular assembler running under the DOS, will au<strong>to</strong>matically use<br />

the file extension "/ASM" for its source files and "/CMD" for its object code generation<br />

thus alleviating the user of the necessity <strong>to</strong> enter the file extensions (it also helps <strong>to</strong><br />

prevent inadvertently overwriting one file with another). Similarly, LDOS makes<br />

extensive use of default file extensions such as "JCL" for all Job Control Language,<br />

"TXT" for ASCII listings, "FLT" for all device filters, etc.<br />

File specifications and device specifications are generally interchangeable. Thus,<br />

wherever a file specification is needed, a device specification can usually be entered.<br />

This is one of the examples of device independence in the system. <strong>The</strong> pro<strong>to</strong>col used in<br />

character I/O is identical across logical devices (i.e. *KI, *PR, *SO,...) and disk<br />

files. Thus, character I/O is handled the same way regardless of the physical device<br />

identified in the Device/File Control Block (DCB/FCB) - be it physical keyboard, printer,<br />

or disk file. For example, the COPY utility is used primarily <strong>to</strong> copy a file from one<br />

disk <strong>to</strong> another, as in:<br />

COPY ARTICLE/TXT:0 TO ARTICLE/TXT:1<br />

which creates a duplicate on drive 1 of the file specified "ARTICLE/TXT" located on drive<br />

0. In lieu of the file specifications, device specifications could equally be used as in<br />

the following:<br />

COPY *KI TO *PR<br />

which copies keyboard input directly <strong>to</strong> the printer. With ease, a keyboard can be added<br />

<strong>to</strong> a daisy-wheel printer turning it in<strong>to</strong> a temporary typewriter. Perhaps a more useful<br />

illustration would be the convenience of directing program output <strong>to</strong> video display,<br />

printer, or a file depending on the device/file specification provided.<br />

2-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!