APPENDIX A. USER-ACCESSIBLE VARIABLES

SK*DOS variables of interest to the machine language programmer are listed below. They should be addressed using indexed addressing with A6.

LISTED IN ORDER BY NAME

NAME    ADDRESSES       FUNCTION
------  ----------      ----------------
BACKS   736(A6)         Backspace character ($08)
BREAKA  762-765(A6)     Break (Escape) address (long word)
BSECHO  743(A6)         Backspace echo ($08)
CDAY    751(A6)         Current date - day
CMFLAG  793(A6)         Command flag
CMONTH  750(A6)         Current date - month
COMTAB  754-757(A6)     Pointer to command table (long word)
CURRCH  766(A6)         Last character read from buffer
CYEAR   752(A6)         Current date - year
DELETC  737(A6)         Delete character ($18)
DEVERR  3276(A6)        Current error device (1)
DEVIN   3274(A6)        Current input device (0)
DEVOUT  3275(A6)        Current output device (0)
DEVTAB  3278(A6)        I/O device descriptor table
DOSORG  838(A6)         Absolute ORG of SK*DOS
ECHOFL  800(A6)         Input echo flag
ENDLNC  738(A6)         End of line character ($3A)
ENVRON  4074(A6)        1K of environment space
ERRTYP  782(A6)         Error type
ERRVEC  834(A6)         Alternate ERRCODES.SYS vector
ESCAPC  746(A6)         Escape char ($1B)
EXECAD  776-779(A6)     ML execution address (long word)
EXECFL  774(A6)         Execution address flag
FCBPTR  4006(A6)        Pointer to 1st open FCB (long word)
FIADDR  788-791(A6)     File input addr vector (long word)
FNCASE  801(A6)         File Name case flag
FOADDR  784-787(A6)     File output addr vector (long word)
LASTRM  753(A6)         Last terminator
LINBUF  608(A6)         Line buffer (128 bytes)
LPOINT  758-761(A6)     Pointer to line buffer (long word)
MAXDRV  802(A6)         Maximum drive number
MEMEND  796-799(A6)     Last usable memory addr (long word)
NULLWT  3324(A6)        Null wait constant
OCOLUM  3328(A6)        Current output column
OFFSET  770-773(A6)     Offset load address (long word)
PAUSEB  3326(A6)        Output pause control byte
PLINES  3322(A6)        Number of printed lines per page
PREVCH  767(A6)         Previous character read
PWIDTH  3323(A6)        Page column width
REPEAC  749(A6)         Repeat character ($01)
SEQNO   806(A6)         Sequence number
SLINES  3325(A6)        Number of skipped lines betw pages
SPECIO  792(A6)         Special I/O Indicator
SYSDIR  744(A6)         System default directory
SYSTDR  747(A6)         System default drive
USRFCB  0(A6)           User FCB (608 bytes)
USRSPC  4010(A6)        64 bytes of free space for user pgms
WORKDR  748(A6)         Working default drive
WRKDIR  745(A6)         Working default directory

LISTED IN ORDER BY ADDRESS

NAME    ADDRESSES       FUNCTION
------  ----------      ----------------------
USRFCB  0(A6)           User FCB (608 bytes)
LINBUF  608(A6)         Line buffer (128 bytes)
BACKSC  736(A6)         Backspace character ($08)
DELETC  737(A6)         Delete character ($18)
ENDLNC  738(A6)         End of line character ($3A)
BSECHO  743(A6)         Backspace echo ($08)
SYSDIR  744(A6)         System default directory
WRKDIR  745(A6)         Working default directory
ESCAPC  746(A6)         Escape char ($1B)
SYSTDR  747(A6)         System default drive
WORKDR  748(A6)         Working default drive
REPEAC  749(A6)         Repeat character ($01)
CMONTH  750(A6)         Current date - month
CDAY    751(A6)         Current date - day
CYEAR   752(A6)         Current date - year
LASTRM  753(A6)         Last terminator
COMTAB  754-757(A6)     Pointer to command table (long word)
LPOINT  758-761(A6)     Pointer to line buffer (long word)
BREAKA  762-765(A6)     Break (Escape) address (long word)
CURRCH  766(A6)         Last character read from buffer
PREVCH  767(A6)         Previous character read
OFFSET  770-773(A6)     Offset load address (long word)
EXECFL  774(A6)         Execution address flag
EXECAD  776-779(A6)     ML execution address (long word)
ERRTYP  782(A6)         Error type
FOADDR  784-787(A6)     File output addr vector (long word)
FIADDR  788-791(A6)     File input addr vector (long word)
SPECIO  792(A6)         Special I/O Indicator
CMFLAG  793(A6)         Command flag
MEMEND  796-799(A6)     Last usable memory addr (long word)
ECHOFL  800(A6)         Input echo flag
FNCASE  801(A6)         File Name case flag
MAXDRV  802(A6)         Maximum drive number
SEQNO   806(A6)         Sequence number
ERRVEC  834(A6)         Alternate ERRCODES.SYS vector
DOSORG  838(A6)         Absolute ORG of SK*DOS
PLINES  3322(A6)        Number of printed lines per page
PWIDTH  3323(A6)        Page column width
NULLWT  3324(A6)        Null wait constant
SLINES  3325(A6)        Number of skipped lines betw pages
PAUSEB  3326(A6)        Output pause control byte
OCOLUM  3328(A6)        Current output column
DEVIN   3274(A6)        Current input device (0)
DEVOUT  3275(A6)        Current output device (0)
DEVERR  3276(A6)        Current error device (1)
DEVTAB  3278(A6)        I/O device descriptor table
FCBPTR  4006(A6)        Pointer to first open FCB (long word)
USRSPC  4010(A6)        64 bytes of free space for user pgms
ENVRON  4074(A6)        1K of environment space

APPENDIX B. THE FILE CONTROL BLOCK (FCB)

The first 96 bytes of an FCB (numbered 0 through 95 for this discussion) hold the following information:
NAME    BYTE(S)         CONTENTS
------  -------         -----------------
        0               Reserved for future use
FCBERR  1               Error code (see Appendix E)
FCBRW   2               Read / Write / Update status
FCBDRV  3               Drive number (0 through 9)
FCBNAM  4-11            File name (8 bytes)
FCBEXT  12-14           Extension (3 bytes)
FCBATT  15              File attributes
        16-17           Reserved for future use
FCBFTR  18              First track of file
FCBFSE  19              First sector of file
        20-21           Reserved for future use
FCBLTR  22              Last track of file
FCBLSE  23              Last sector of file
FCBSIZ  24-25           Number of sectors in the file
FCBRAN  26              Random file indicator
FCBTIM  27              Time or sequence number
FCBMON  28              Month of file creation (1 through 12)
FCBDAY  29              Day of file creation (1 through 31)
FCBYR   30              Year of file creation (last two digits)
        31-33           Reserved for future use
FCBCTR  34              Current track number
FCBCSE  35              Current sector number
FCBNMB  36-46           Temporary name buffer 1
        47-48           Reserved for future use
FCBDPT  49              Sequential data pointer to next byte 
                            (4 through 255)
        50              Reserved for future use
FCBRIN  51              Random data pointer to next byte 
                            (4 through 255)
FCBNMS  52-62           Temporary name buffer 2
FCBCOL  58              Column position (for use by Basic)
FCBSCF  59              Space compression indicator
FCBSPT  60              Number of sectors per track
        61-63           Temporary storage
        64-67           Reserved for future use
FCBLST  68-71           Next FCB pointer
FCBPHY  72              Physical drive number
        73              Reserved for future use
FCBDIT  74              Directory track number
FCBDIS  75              Directory sector number
        76-77           Reserved for future use
FCBCRN  78-79           Current or desired sector number
        80-95           Reserved for future use
FCBDAT  96              Beginning of data area
The names listed in the above table are those used in the SKEQUATE file; it is convenient to use these names rather than numbers when referring to specific FCB bytes in user programs.

The chart below gives a concise summary of this data; Bytes marked with * are reserved for future use.

      | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9| A| B| C| D| E| F|
      -------------------------------------------------
      |  |Er|RW|Dr|  |  |  |  |  |  |  |  |  |  |  |At|
  $00 |* |ro|Co|iv|<--   File Name      ->|<-> Ext-|tr|
      |  |r |de|e#|  |  |  |  |  |  |  |  |  |  |  |ib|
      -------------------------------------------------
      |  |  |First|  |  |Last |  |  |Ra|Ti|Mo|Da|Ye|  |
  $10 |* |* |Tr & |* |* |Tr & |Size |nd|me|nt|y |ar|* |
      |  |  |Sectr|  |  |Sectr|  |  |om|  |h |  |  |  |
      -------------------------------------------------
      |  |  |Curre|  |  |  |  |  |  |  |  |  |  |  |  |
  $20 |* |* |nt Tr|<- Second File Name  ->|<-> Ext-|* |
      |  |  |& Sec|  (Temp name buffer 1) |  |  |  |  |
      -------------------------------------------------
      |  |Se|  |Ra|  |  |  |  |  |  |  |  |  |  |  |  |
  $30 |* |qP|* |nP|<- Delete File Name  ->|<-> Ext-|* |
      |  |tr|  |tr|  (Temp name buffer 2) |  |  |  |  |
      -------------------------------------------------
      |  |  |  |  | Next open |Ph|  |Direc|  |  |Curr.|
  $40 |* |* |* |* |<-  FCB  ->|Dr|* |Tr & |  |* |Recrd|
      |  |  |  |  |  pointer  |No|  |Sectr|  |  |Numbr|
      -------------------------------------------------
      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
  $50 |<---------------------*----------------------->|
      |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |
      -------------------------------------------------
  $60 |<-- Sector buffer begins here

APPENDIX C. NON-DISK FUNCTIONS

This appendix lists the non-disk function calls for SK*DOS.
 

NAME     OP CODE     FUNCTION
----------- --------- ------------------------------------------
CLASFY     $A02E     Classify alphanumeric characters
DECIN     $A030     Input decimal number
DEFEXT     $A024     Default extension
EXECSD     $A01F     Execute a SK*DOS command
FINDEV     $A012     Find device number from name
FLUSHT     $A044     Flush Type-ahead buffer, if any.
FNPRNT     $A045     Print file directory/name.extension
GETCH     $A029     Get input character with echo
GETDNT     $A03F     Get date and time into
GETNAM     $A023     Get file name into FCB
GETNXT     $A02D Get next character from buffer
HEXIN     $A02F     Input hexadecimal number
ICNTRL     $A028     Input control (see Chapter 14)
INLINE     $A02C     Input into line buffer
INNOEC     $A02A     Get input character without echo (with TA)
INNOE1     $A043     Get input character without echo (bypass TA)
INTDIS     $A040     Disable interrupts
INTENA     $A041     Re-enable interrupts to previous status
LOADML     $A022     Load open machine language file
OCNTRL     $A032     Output control (see Chapter 14)
OUT10D     $A039     Output 5 decimal digits
OUT2H     $A03A     Output 2 hex digits
OUT4H     $A03B     Output 4 hex digits
OUT5D     $A038     Output 5 decimal digits
OUT8H     $A03C     Output 8 hex digits
PCRLF     $A034     Print CR/LF
PERROR     $A037     Print error code
PNSTRN     $A036     Print string (Without CR/LF)
PSTRNG     $A035     Print CR/LF and string
PUTCH     $A033     Output character
RENTER     $A025     Re-enter SK*DOS
RESIO     $A020     Reset I/O pointers
RESTRP     $A021     Reset trap vectors
STATUS     $A02B     Check keyboard for character (with TA)
STATU1     $A042     Check keyboard for character (bypass TA)
TOUPPR     $A031     Convert lower case to upper (in D5!)
VPOINT     $A000     Point to SK*DOS variable area
WARMST     $A01E     Warm start
 
 

APPENDIX D. DISK FUNCTIONS

This appendix lists the disk function calls for SK*DOS.
 

NAME     OP CODE     FUNCTION
---------- ----------     -------------------------------------------
DIROPN     $A00B     Open directory file
DIREST     $A026     Disk restore to track 0
DISEEK     $A027     Disk seek
DSREAD     $A00D     Read directory or system information sector
DSWRIT     $A00E     Write directory or SIS entry
FCLOSE     $A008     Close file
FCSCLS     $A009     Close all open files
FCSINI     $A01B     Initialize File Control System
FDELET     $A00F     Delete a file
FDRIVE     $A01A     Find next drive number
FOPENR     $A005     Open a file for read
FOPENU     $A007     Open a file for update
FOPENW     $A006     Open a file for write
FRBACK     $A015     Backup to previous sector
FREAD     $A001     Read the next byte from file
FRENAM     $A010     Rename a file
FREWIN     $A00A     Rewind file
FRGET     $A016     Read a random byte
FRPUT     $A017     Write a random byte
FRRECD     $A014     Select a specified random sector
FSKIP     $A011     Skip current sector
FWRITE     $A002     Write the next byte to the file
SISOPN     $A00C     Open system information sector
SREAD     $A01C     Read a single sector
SWRITE $A01D     Write a single sector
 

APPENDIX E. SK*DOS ERROR CODES

SK*DOS uses the following error codes; in addition, user programs may use other error codes which are documented in their respective manuals.

1 FCS operation code error
2 File already open or in use
3 File already exists
4 File does not exist
5 Directory Error
7 Disk is full
8 Input past end of file
9 Disk read error
10 Disk write error
11 Disk is write protected
12 Protected file
13 Error in closing file
14 Disk seek error
15 Invalid drive number
16 Drive not ready
18 This FCS operation not permitted on this file
19 Random file operation not allowed
20 Disk I/O error
21 Illegal or missing file name or extension
22 Can't Close error
23 Random file map overflow
24 Specified random sector number is invalid
25 Random sector number does not match file contents
26 SK*DOS command syntax error
28 Missing transfer address
29 Disk has been switched while file was open
30 File not open

Internally, SK*DOS errors are represented by one-byte numbers which are generally placed into byte 1 (the second byte) of a file control block by the File Control System. User programs should test for these by their numbers.

Error messages are generally printed out by using the PERROR routine, which prints out the error number, usually followed by a one-line explanation of the error.

Error 1 (FCS operation code error) is treated a bit differently from the others. When it is encountered, SK*DOS immediately prints an error message and asks whether you wish to continue anyway. If you answer Y, then it will return error 1 to the calling program and continue; any other answer will immediately abort the program, close all files, and return to SK*DOS.

The one-line explanations of errors are obtained from the ERRCODES.SYS file, and will only be obtained if this file is on the system disk; otherwise only the error number will appear. (The ERRCODES.SYS file also contains explanations for 68xxx exceptions. If the processor hits an exception, such as a bus error, it will print error 1xx - where xx is the CPU exception vector number - followed by an explanation taken from the ERRCODES.SYS file.)

APPENDIX F. DEFAULT EXTENSION CODES

The following default extension codes are used by the DEFEXT routine.

0 = .BIN Binary program file
1 = .TXT Text file
2 = .COM Command file
3 = .BAS Basic language file
4 = .SYS SK*DOS system file
5 = .BAK Backup file
6 = .SCR Scratch (temporary) file
7 = .DAT Data file
8 = .BAC Basic compiled file
9 = .DIR Directory
10 = .PRT Printer file
11 = .OUT Output file
12 = .BAT Batch file
13 = .SRC Assembler source file
14 = .PIP Pipe
 
 

NOTE: Note that the default extension for commands is .COM, which is different from the .CMD used in 6809 SK*DOS. This allows 6809 and 68K commands to coexist on the same disk without the danger of accidentally calling the wrong one.

APPENDIX G. SK*DOS COMMAND SUMMARY

This Appendix describes the commands currently supplied with SK*DOS. From time to time, however, we may add other commands which may not be described here. Most commands will provide you with information on their proper usage if you type the command name, a space, and a question mark, as in
   BUILD ?

ACAT

The ACAT command displays a fully alphabetized catalog listing of a disk or a directory. It is similar to CAT, except that it does not support all of the options that CAT does.

To use ACAT, type the word ACAT, followed by an optional drive number and directory specifier (which defaults to the work drive if not entered). You may follow this with a match-list - additional information if you want only certain files listed. The general format is to enter

ACAT <where>< what>
where the <where> can be either a drive number such as 0 or 1, or a drive number and directory letter such as 1.C/; an asterisk (*) may be used in place of a directory letter to scan all directories on the disk.

The <what> in the above example is a match-list specifying which files are to be listed. The following examples show some possibilities:

ACAT catalogs all files on the current work drive and its default directory

ACAT 1 catalogs all files on drive 1

ACAT 1 TX catalogs all files on drive 1 whose file names begins with the letters TX

ACAT .COM catalogs all files with .COM extensions

ACAT TX.COM catalogs all files whose file name begins with TX and which also have .COM extensions

ACAT TX*E.COM catalogs all files whose file name begins with TX*E, (where * stands for any character) and which also have .COM extensions

ACAT TX   .COM catalogs all files whose name begins TX, and also all files which have .COM extensions.

ACAT 2.C/  TX   .COM catalogs all files whose name begins TX, and also all files which have .COM extensions, but only on drive 2 directory C.

ACAT 2.*/  TX catalogs all files whose name begins TX in all directories of drive 2.

Note how a * is a wild-card character which stands for any character in the middle of a file-spec, and stands for any directory when used in a drive.directory specifier.

Note also that when a drive number is not specified, ACAT defaults to the default work drive and its default subdirectory; if a drive number is specified without a directory code (even if the drive number happens to be the same as the current work drive) then ACAT will search the root directory.

APPEND

The APPEND command is used to combine several `source' files together to make a single large `destination' file. For example, it can combine a number of text files together into a large file, or can combine several machine language programs into one large program. APPEND writes a new destination file, with the original source files left unchanged.

To use this command, type the word APPEND followed by the names of the source files to be combined, followed by the name of the resulting destination file. For example, the command

SK*DOS: APPEND PROG1.BIN PROG2.BIN 2.PROG3.BIN 1.PROG.COM
would combine PROG1.BIN, PROG2.BIN, and 2.PROG3.BIN, in that order, into a new file called PROG.COM on drive 1. (All of the source files must exist, and the destination file must not exist.)

Although files of any type may be appended, usually all the files will be of the same type. The extension of the first source file defaults to .TXT if not specified otherwise, and the extensions of all succeeding files (source and destination) default to the same extension as the first file.

When machine language program files having transfer addresses are appended, the transfer addresses are carried forward into the destination file, but the SK*DOS load routine uses only the last transfer address given.

BACKUP

The BACKUP command is used to make an exact backup of a disk. This command requires two drives.

If BACKUP encounters an error on either the source disk or the destination disk, it will display an error message but continue copying until it finishes the disk. To call BACKUP, enter the command BACKUP followed by the drive numbers of the source and destination drives, as in

SK*DOS: BACKUP 0 1
This command would copy from drive 0 to drive 1. (The two drive numbers must be entered and must be different.) Note carefully - BACKUP copies from the first drive specified to the second drive.

Before BACKUP can be used, you must format the destination disk with the FORMAT command. Furthermore, the destination disk must have at least as many tracks and sectors as the source disk. If it has fewer tracks or sectors, then BACKUP will display an error message and stop.

After BACKUP is finished, the destination disk will have the same apparent number of tracks and sectors as the source disk. For example: suppose you BACKUP a 35-track single density 5-1/4" disk (ten sectors per track) onto a 77-track double density double sided 8" disk. The destination disk will have only 35 tracks and ten sectors per track. (In reality, the remaining tracks and sectors will still be there, but will be completely inaccessible to SK*DOS from then on.)

BEEP and NOBEEP

Assuming that your terminal supports the BELL character (ASCII $07), the BEEP command will sound the bell (or beep) at each SK*DOS: prompt from then on. This is a useful function if you like to walk away from your computer while it is doing a lengthy task.

Once the BEEP command is given, the bell will sound until the computer is rebooted, or until the NOBEEP command is used to cancel BEEP.

BUILD

BUILD is used to generate a text file on the disk. BUILD is not intended to replace a more general purpose editor; instead, BUILD might be used for testing or generating simple files.

The BUILD command line must include the name of the file to be generated. This is usually done by including a file specification after the word BUILD, as in this example:

BUILD TEXT
The file specification defaults to a .TXT extension unless specified otherwise, and also assumes the current working drive.

While entering text with the BUILD command, you may correct any line by backspacing and retyping a character. Or, while still in the middle of a line, you may erase the entire line and start it over by hitting the control-X key. Once the line is entered by hitting the carriage return key, however, it is stored and cannot be changed. In other words, BUILD is not an editor.

The BUILD program ignores control characters, and is limited to a maximum line length of 127 characters.

To end entering text, type a # character at the beginning of a new line.

CACHE

The CACHE command is used to set up a disk cache; that is, a memory area which stores data read from or written to a floppy disk. When SK*DOS tries to subsequently read that data again, it reads it from the cache memory rather than reading it from the physical disk itself. This significantly speeds up disk operations.

There are three ways of calling the CACHE command:

SK*DOS: CACHE NEW  <memory size in K>
sets up a new cache memory of the specified size. For example, the command CACHE NEW 320K would set up a 320K cache memory area. The specified cache memory can range from 32K to 1024K (actually 1 megabyte) in size.

Another way of calling CACHE is with

SK*DOS: CACHE  <drive number>

which erases (`flushes') all data from the cache which corresponds to the specified logical drive number.

Finally, the command

SK*DOS:  CACHE STATUS
displays a status report of the cache memory, including the memory size, the number of sectors it can store, the number of sectors currently empty, and the actual number of sectors currently stored for each floppy drive.

IMPORTANT WARNING: Since CACHE has no way of knowing when you insert a new disk into a drive, it is essential that you manually flush the cache each time you swap disks. IF YOU DO NOT DO SO, YOU MAY CORRUPT THE NEW DISK. This will happen because CACHE will think you are still using the old disk, and will read and write data as if the old disk was still in the drive. Any data written to the new disk will go in the locations it would have gone on the old disk. We have recently modified CACHE so that it checks the identification on a disk before all accesses to the directory; this somewhat slows down operation, but does prevent many disk accidents.

Note that CACHE only saves data for floppy disks; it does not store data for the RAM disk (since that would just duplicate data already in RAM) or a hard disk (since hard disks are generally almost as fast as the cache memory). Hence the memory assigned to CACHE is used only for floppy disk data.

The CACHE program can be used in addition to RAMDISK, but if both are used together, then the RAMdisk must be set up first. The reason for this requirement is that this allows the RAMdisk memory to be above the cache memory. If SK*DOS is subsequently rebooted, there is a greater chance of the RAMdisk data being preserved since it is in higher memory. The cache memory, on the other hand, is always erased when rebooting. (This also serves to explain why the cache memory size can be changed while RAMdisk memory size cannot.)

Although CACHE can use anywhere from 32K to 1024K (i.e., one megabyte) of memory, the actual size chosen depends on the application. If you merely intend to use a floppy disk for a few files, then 32K or 64K might be sufficient. If, on the other hand, you intend to do extensive processing with one disk, then the size should be about 20% larger than the size of the floppy disk (since CACHE needs some extra memory for its data storage and for `elbow room'.) If you have several floppy drives, then the cache memory should be large enough to accommodate all of the expected floppy disk operations on all drives.

When you intend to use a single floppy for extensive operations, you can greatly speed up processing by reading the entire floppy into the cache at the beginning (assuming that the cache memory is large enough to hold the disk's contents.) This is easily done by doing a CHECKSUM on the disk, which reads the entire disk and (coincidentally) stores it in the cache memory. Once this is done, SK*DOS will no longer need to read that disk at all; it will only access the disk for writing.

Note that CACHE only stores floppy data; in fact, it goes by the physical drive number rather than the logical drive number. Hence if you use the DRIVE command to reassign a drive's logical drive number (but don't swap diskettes in the drive) CACHE will `follow' the diskette to its new logical drive number.

FInally ... once again ... make sure to flush the cache whenever you change a floppy disk!!

CAT

CAT is used to display the contents (`catalog') of a disk or directory.

At its simplest, invoking the CAT command can be as simple as typing the word CAT , or it can be followed by a number of parameters. A more complex command might be in the form

CAT  <how><where><what>

All of these parameters are optional; any of them can be used, but if you use more than one then they must be in the order shown above: how, where, what. All parameters are entered on the command line. If you forget what to do, the CAT help list can be displayed by entering a command of CAT ?.

<how> Options

The so-called "how" options consist of one or more option letters preceded by a + sign, and should follow after the word CAT, as in
CAT +SDF1
The available options are:

A     Alpha                Alphabetize output by 1st letter
D     Date                 Display file Date
F     File No.             Display File number
M     Maximum        Full listing with all options
N     Non-existent     Display Deleted files with (-)
P     Paging             Paging with printer column width
R     Repeat             Repeat CAT as listed on command line
S     Size                 Display file Size in sectors

CAT normally defaults to the M or Maximum option when none is specified. Entering any option letter on the command line will turn that option on, but all others are turned OFF. Hence you must enter ALL options you want if you enter any at all.

The following gives more information on specific options:

A- This option will group the listing by the first letter, rather than provide a fully alphabetized list (such as provided by ACAT). When the "A" option is used you cannot use any match strings.

D- This option will display the file's creation date. If the month is zero or over 12, CAT will display the month as "BAD".

F- This option will list the actual directory number.

M- The "M" option will provide information on track-sector data and the protect file code information. The "M" option turns on the D,F and S options plus routines needed for the header, track and sector, and protect codes.

N- This option will display deleted file entries that exist in the directory. The actual file may not exist on the disk - it may have been overwritten when it was part of the list of free sectors. You cannot assume a deleted file is intact unless you know it was recently deleted and you have not written enough new files on the disk to reuse the deleted file's sectors. CAT will display a dash (-) as the first character of the file name. This option is useful if you intend to use UNDELETE.

P- This option will enable a paging subroutine to place blank lines on the top and bottom of the page. This is handy when listing a disk with a large number of files. The printer width equate is picked up and used to calculate the number of columns allowed for each form of the printed listing.

R- The "R" option allows CAT to re-start. A prompt will appear at the end of each CAT; enter "E" to exit to SK*DOS, or hit any other key to do another CAT as originally listed on the command line. This option will allow you to change disks and do a CAT without re-entering the data on the command line. The user can select CAT options to control the type of information listed in the disk file.

S- The "S" option will enable the sector size of files to be displayed.

The typical CAT display will look like the following:

Drive: 2 Dir: A/  Disk: SOURCE 4 Created: 31-May-82


File#    Name    Type    Begin    End    Size  Date      Prt
  2      COPY99  .TXT    29-03   11-0F    128  21-Jun-82 D
  12     RANDOM  .SYS R  01-01   01-03      3   3-Nov-81

Files=21  Biggest=206  Total=131/1029  Free=111
The top line of this display provides the drive number, directory, disk name, disk number, and disk creation date.

A separate line describes each file, and provides its number within the disk directory sectors, the name and extension, beginning and ending tracks and sectors, size, and creation date. Random files are identified by the letter R to the right of the extension. The three SK*DOS protect codes are indicated by letters (although the catalog protect bit is not honored by CAT): C = catalog protect; D = delete protect; W = write protect.

The last line indicates the total number of files on the disk, the size of the biggest file on the disk, the total size of the displayed files as compared with the total size of all files on that disk, and the number of free sectors.

<where> Parameter

The "where" parameter specifies which disk or directory to display. This parameter can be either a plain drive number (such as 1) or a drive number, period, directory letter, and a slash (as in 1.C/). An asterisk (*) can be used to mean "all directories" (as in 1.*/).

It is not possible to enter a directory without a drive number preceding it. If no "where" information is entered, then the default work drive and directory are chosen; if only a drive number is entered, then the root directory of that drive is chosen.

<what> Parameters

The "what" parameter specifies a match-list which is compared against the files in the directory, and only those files matching the match-list are displayed. The match-list can contain one or more file-names and/or extensions, or portions of names and extensions. The asterisk (*) is a wild-card character in a match-list which will match against any character in a file name. Here is an example of an elaborate CAT command:
 CAT +AM 1.C/ AD .TXT J*M.BAK
The A and M options specify an alphabetized maximum listing of files in the C directory of drive 1. Only files satisfying one of the following three criteria will be shown: (1) any file whose name begins with AD, (2) any file having a .TXT extension, or (3) any file whose name begins with J, whose third letter is an M, and which have a .BAK extension.

(The original CAT program and documentation were written by, and provided through the courtesy of, Bruno D. Puglia and Leo E. Taylor.)

CHECKSUM

CHECKSUM is used to generate and display a sum of all the bytes on a disk. The check sum is shown as an 8-digit hex number.

CHECKSUM is used simply to verify that the content of a disk has not changed over some period of time. Although it can be used with floppy or hard disks, we find it most useful to use with the RAMDISK program. Whenever we walk away from the computer for an extended length of time while the RAM disk is in use, we run CHECKSUM on leaving, and then again when we return. This makes sure that the contents of the RAM have not accidentally changed, perhaps due to a momentary power interruption while we were gone.

To use CHECKSUM, simply follow it with the drive number, as in

SK*DOS: CHECKSUM 1

COMPARE

The COMPARE command requires two drives, and does an exact, byte by byte, comparison of two disks. It is thus useful for checking whether a disk has been backed up correctly (although the disk will be verified during BACKUP.)

To use COMPARE, type the word COMPARE followed by the drive numbers of the two drives holding your disks, as in

SK*DOS: COMPARE 0 1
which would compare the disks in drives 0 and 1.

If you want to check whether a single disk is readable, you may also specify the same drive number for both disks, as in

SK*DOS: COMPARE 0 0
This mode reads a single disk twice, and checks not only that it is readable, but also that the same data is read both times.

COPY

COPY is used to copy files from disk to disk, or from directory to directory. It can copy just one file, a group of files, an entire directory, or an entire disk. It can also retrieve deleted files (although UNDELETE is generally easier to use), alphabetize while copying, and more.

In its simplest form, the COPY command is used by entering the word COPY, the file-spec of the file to be copied, and the file-spec of the destination. For example,

COPY 0.PROG.TXT 1.NEWPROG.ABC
would copy PROG.TXT from drive 0 to a new file called NEWPROG.ABC on drive 1.

But there are many other possible ways of calling COPY. Although there are some exceptions, the most common form of a COPY command looks like this:

COPY <how><from where> <to where> <since date><match list>

We will leave the how and since date for later, and begin with the from where.

The <from where> parameter

This item describes where the file(s) will come from. It may be

(a) a plain drive number, such as 0 or 2, in which case the current default directory is assumed (except when the F option is used - see later),

(b) a drive number and directory, such as 1.A/ (or 2.*/ where the asterisk would mean all directories), or

(c) a file name and extension, possibly preceded by a drive number and directory. If such a specific file-spec is supplied, then a match-list would not be used. An extension is always required in this case, as this option must narrow down the copy function to a specific file. If a drive and directory are not supplied, then the current default will be used.

The <to where> parameter

This item describes where the file(s) will be copied to. It may be any one of the three formats described under <from where> above. If the where information is incomplete, then the drive and directory will come from the default work values, and the file name will be taken from the "from" list. For example, if the command is
COPY 0.A/FILE2.TXT 2
then the file will be copied to the default directory on drive 2 and will still be called FILE2.TXT. Any other directory would have to be specifically called out. If the "to" directory is specified as */, then the file will be copied to the same directory as it was on the source disk.

The <match-list> parameter

In those cases where the "from" parameter does not provide enough data to specify a specific file, the match list can be used to narrow down the field to a specific file or group of files. This list is essentially a list of one or more file names and/or extensions, or portions thereof. COPY will copy only those files which match the match-list.

If, for example, the match-list consists of the word UN, then any file whose name begins with UN will be copied; if it consists of .TXT then any file with a .TXT extension will be copied. If the match-list item is UN.TXT, then files must both have a name beginning with UN and also must have a .TXT extension. An asterisk can be used as a wild-card character inside a name or extension, as in U*D, which would match with any name such as UAD or UBD or even U8D.

As mentioned earlier, the match-list is optional; if absent, then any file satisfying the <from where> parameter will be copied.

For example, COPY 0 1 PROG.TXT would copy PROG.TXT (and all other files whose name begins with the letters PROG and which have .TXT extensions) from drive 0 to drive 1.

COPY 0 1.D/ A B .BIN would copy all files whose names begin with A or B, or which have a .BIN extension, from drive 0 to directory 1.D/.

The <how> parameter

The <how> parameter describes how the copy is to be done, and allows a variety of variations on the basic COPY command. It is specified by including one or more option letters between the word COPY and the <from where> parameter, which must always begin with a drive number (so COPY can tell where the option letters end and the <from where> parameter begins. The following option letters are allowed:

A     copy in Alphabetical order
C     allow Corrupt files to be copied
D     copy files with newer Date
E     delete Existing destination file
F     copy by File number (alpha not allowed)
K     Kill duplicate file on source
L     List files without copying
M     Make random file
N     copy files Not on destination
O     turn Off defaults
P     Prompt before copying file
R     Recover from track-sector
S     copy Since a specified date
T     Track zero protection override
U     Use current SK*DOS date
W     Wait for disk change
Z     Zap source file after copying

Here are short explanations of these options:

The A option will alphabetize the source directory before files are selected to be copied.

The C option will enable you to copy a file that is damaged by a CRC error or record sequence error. This is a slightly dangerous option which should only be used if you don't have an alternate copy of a file.

The D option will find files that are on both disks and compare their creation dates and times or sequence numbers. If the source file is newer it will be copied as a replacement for the older destination file.

The E option is used when you want to replace a file on the destination disk. This option will suppress the prompt for whether you wish to delete the existing file. It will often be used along with D to update a disk with newer versions of programs.

The F option changes copy's parameters from a match string list to a list of file numbers. Follow the drive numbers with a list of file numbers for those files that you want to copy. File numbers can be found with CAT. A group of files can be specified as a starting and ending number separated by a dash. The command COPY F 0,1 5 13-18 9 will copy file 5, files 13 through 18, and file 9, all to the root directory of drive 1. The "from" drive number always refers to all directories, but you must append .*/ if you wish the files copied to the corresponding directories of the "to" drive. This option is useful for copying the contents of a large disk to two or more smaller ones.

The K option is VERY dangerous. This command isn't really a copy; rather it uses the directory compare routines to delete files from the source disk that appear on the destination. This allows you to clear off extra copies of programs not needed on the source disk. It operates very fast and will clear off a number of files faster than you can hit reset. As with all dangerous options it is protected with an ARE YOU SURE prompt. COPY K 1,0 is most effective in killing files on drive 1 when they exist on drive 0. COPY KD 1,0 will kill the file on drive 1 when it is older than the file on drive 0. Use COPY KDL 1,0 to preview what files will be deleted.

The L option disables the file copy subroutine. This is used to display a list of files that would have been copied if you hadn't used option L. This can be used with other options to check disks for duplicate files, newer dates, bad files, etc.

The M option is used to convert a SK*DOS sequential file into a random file. This option is also used with R to recover a random file by track and sector. NOTE: this option is not used for normal file copying; if the source file is random COPY will automatically make the destination file random.

The N option is used to copy the files on the source disk that are not already on the destination disk. This can be used to add all new files to a backup disk.

The O option is a dummy character used to turn off all default options if you do not want any options. If used with any other option letters it has no effect.

The P option enables this prompt: Prompt off (P); SK*DOS (S); copy (Y/N)? You should respond with P if you want to continue copying without the prompt or S to return to SK*DOS or Y to copy this file. N or any other character will skip to the next file. This is useful for scanning through a disk copying only certain files. Another use is skipping down to a certain file on a disk and copying all files after that.

The R option is used to read a file without using the directory. If the directory of a disk has been destroyed but the user knows the file's starting address, the file can be recovered. The command COPY R 1 2B 5 0.NEWFILE will read from drive 1, track $2B, sector $5 until encountering an end of file or a record out of sequence. The write file extension will default to .SCR. A second use for this option is to recover a deleted file (the first sector of a deleted file can be found with the N option of CAT.) If the file has not been over-written, COPY can recover it. Record sequence checking eliminates UNDELETE's restriction that the file be the last file deleted. Provision was made to start copying in the middle of a file. This is a somewhat dangerous option since it allows the user to override the SK*DOS File Control System. The command must be typed as shown with three numbers and a file name. Only a few other options can be used with R. See M if the original file was random.

The S option is used to copy only files generated on or after the date specified in the "since date" parameter. For example, the command COPY S 0 1 6-28-88 would copy all those files dated June 28th, 1988 or later. Since no directory is specified, only files in the root directory would be copied in this case. The S option can, however, also be combined with several other COPY command features to make more complex commands. The S option can not be combined with the F (copy by file number) option, since the F option will take precedence. (The F and S options are often used for backing up a hard disk to floppy disks. F is used for a complete backup to copy groups of files at a time to separate floppy disks; S is useful in making incremental backups of just those files which have been changed or newly generated in the last few days.)

The T option is used only for those systems that store data files on track zero. COPY normally prevents a file from linking to track zero. Some hard disk systems include track zero as part of their free sector chain; in that case, COPY will switch to the T option automatically.

The U option is used when you want the destination file to have the present SK*DOS date rather than the date of the source file being copied. This may be useful if you know the source file has an erroneous date.

The W option loads COPY, but then waits for any key to be pressed before continuing. This allows you to switch disks before actually copying. (Note that the same effect can be achieved by using GET to load COPY, switching disks, and then using XEQ (plus appropriate arguments) to execute it.)

The Z option is somewhat dangerous. It is used to delete the file from the source disk after it is copied. Essentially the file is moved from one disk to the other.

Option letters are often used in combinations; here are some examples of popular combinations:

DN - Updates the destination with all files from the source that are not on the destination or have an older date on the destination.

EZ - Moves file P.COM from source to destination no matter what.

KD - Kill the file on drive 1 when it is older than the file on drive 0.

LNA - Alphabetically lists those files on the source that are not on the destination.

The <Since date> parameter

This parameter is used only with the S option, and specifies the date used for copying; only files dated on or after this date will actually be copied. The month, day, and year must appear in that order, and may be separated by hyphens or slashes, as in 6-28-88 or 6/28/88. Note that the date must appear after the "to where" parameter, but before the "match-list", if used.

General Comments

It is important to realize that if you get an error while writing a file to the destination disk the new file may be defective. The file may appear in the directory but usually it is incomplete.

The most common error message is DATE BAD. This occurs when the user does not enter a valid date when SK*DOS is booted or by failure of a hardware clock when used for setting the SK*DOS date. COPY will check the date on all files when it reads the disk directory and report any dates outside a reasonable range. This reduces the chance that a bad date will be passed on to the new file. There are two alternatives when the BAD DATE message appears. You can answer Y indicating that you approve of bad dates or answer N and not copy the file. After returning to SK*DOS you can re-enter COPY using option U which will assign the current SK*DOS date to the file or use the DATE command to set the file date to the day the file was made.

In order to check that the destination disk exists and is not write protected, COPY reads the SIS (track 0 sector 3) of the destination disk and then duplicates it on sector 4 (which is an unused sector). If the disk is protected or not ready the program will exit immediately.

(The original COPY program and documentation were written by, and provided through the courtesy of, Bruno D. Puglia and Leo E. Taylor.)

DAMON

DAMON is a trouble-shooting program which displays the drive, track, and sector number of each sector being written or read by SK*DOS, and the address of the current File Control Block. You might use it whenever you want to follow SK*DOS disk accesses to see what it is doing.

DAMON substantially slows down the operation of the disk system, since each sector read or written is accompanied by a display of its number on the screen. Moreover, once activated, the only way to turn it off is to reboot the system. Hence it is a specialty program, to be used only when needed to debug a program.

DELETE

DELETE is used to delete a disk file from a disk.

To delete a file, enter the command DELETE followed by the file name, as in

DELETE TEXT.TXT
The extension is required. The command defaults to the default directory on the work drive.

You may delete several files with one DELETE command by specifying more than one file name. The maximum length of the entire DELETE command, however, is limited to 128 characters.

DEVICE

DEVICE is used to display or install device drivers. To display the current device assignments, simply type the command
SK*DOS:  DEVICE
and you will get a display similar to the following:
The current I/O device assignments are:
    Normal     Device  Device   Driver
     use       number   name
    ------     ------  ------  ---------
   Terminal       0     CONS   Default driver
   Error device   1     CONS   Default driver
   Printer        2     CONS   Default driver
                  3     CONS   Default driver
                  4     CONS   Default driver
                  5     CONS   Default driver
                  6     CONS   Default driver
   Null device    7     NULL   Default driver
To install a new driver, use the format

DEVICE <driver name> AS <device name> AT <Device number>

where

Additional information on DEVICE usage may be found in Chapter 14.
 

DIFF

DIFF is used to compare the contents of two text files and print out any differences between them.

The correct syntax for using DIFF is

SK*DOS: DIFF <file-spec-1> <file-spec-2>

where the file-specs are of the two files being compared.

DIFF compares the two files on a line-by-line basis, so two files having the same text but formatted into different lines will be shown as different. Each time DIFF finds lines which are different, it displays them, and continues until it finds two lines which again match.

DIFF has several characteristics which should be noted. If the two lines are of different lengths, then DIFF will stop at the end of the shorter file and print out the message "No further similarities found". So as to avoid resynchronizing on blank lines, it ignores them. When looking forward for another pair of matching lines, it stops after 50 lines. Hence if there are more than 50 consecutive different lines in the two files, DIFF may not be able to resynchronize at the very end of the dissimilar texts.

DIR

DIR is used to display the contents (directory or catalog) of an entire disk, including all its subdirectories.

DIR is not as useful, and does not provide as much information as some of the other `catalog' utilities such as ACAT, CAT, SCAT, or TCAT. It is, however, memory-resident, so it can be used without having a system disk with another `cat' utility installed in a drive. Except for an optional drive number, DIR accepts no other options or match list arguments.

In addition to providing a list of files on a disk, DIR provides one additional piece of information which the other programs do not provide - a list of subdirectories used on the disk. This is done in the form of a display like this:

Subdirectories used: < ABCDE...UVWXYZ >
Only those letters which are used as subdirectories appear. The symbols < and > appear only in those cases where subdirectories exist with ASCII codes either below A or above Z. Such names are normally illegal, but may still exist if written by programs.
 

DISKNAME

The DISKNAME command is used to change the name, number, or date of a disk. Simply type the command DISKNAME, followed by the logical drive number, as in
   SK*DOS:  DISKNAME 2
DISKNAME will then print out the current values, and allow you to enter new values. You may leave the old name or number unchanged by pressing ENTER, or may leave the date unchanged by answering N to the question.

DOSPARAM

The DOSPARAM command can be used to display or change a number of DOS parameters.

To display the current DOS parameters, use the command

SK*DOS: DOSPARAM [<device number>]

where the <device number> is optional and will default to 0 if not given. DOSPARAM will then print out several system-wide parameters, as well as parameters for the specified device number, as shown in the example below.

SK*DOS PARAMETERS (COMMON TO ENTIRE SYSTEM):

 BS Backspace   = $08 = Control-H     BE BS echo     = $08 = Control-H
 DL Delete      = $18 = Control-X     EL Endline     = $3A = :
 TB Tab         = $00 (none)          ES Escape      = $1B = Control-[
 RP Repeat      = $01 = Control-A     MD Max drive no= 1
 OF OFFSET      = $00005B00           ME MEMEND      = $000BFFFF
    SK*DOS PARAMETERS FOR DEVICE NUMBER 0
 PL Print lines = 0                   SL Skip lines  = 0
 WD Width       = 0                   NL Null wait   = 0
 PS Pause       = NO                  EF End of File = $1A = Control-Z
 BR Baud rate   = 0                   XF X-OFF Char  = $00 (none)
 XN X-ON Char   = $00 (none)
To use DOSPARAM to change one or more parameters, type DOSPARAM, followed by an optional device number, followed by the two-letter abbreviation for the parameter to be changed (see below), followed by an equals sign, and then followed by the new value.

Several parameters can be changed in one command line, as in

  SK*DOS:  DOSPARAM 2 WD=64 BS=$08 PS=N
The PAUSE value is either YES, NO, ON, or OFF; all other values are decimal except those identified with a $.

See the chapter on `User-Accessible Variables' for the explanation of these parameters.

DRIVE

DRIVE is used to reassign different `logical' drive numbers to the actual `physical' drives of your system, or display the current drive assignment, or write-protect a drive. For example, since most users prefer to work with `drive 0' as their main drive, this allows them to use different physical drives as their `drive 0'.

There are two ways of using DRIVE. Just a plain

SK*DOS: DRIVE
will display the current assignment. On the other hand, the command may also be of the form
SK*DOS: DRIVE Lx=Ty[P or U] [LD=MD]
which would assign logical drive x to become Type y. x and y can be numbers from 0 through 9, and T can be N for None, F for Floppy, H for Hard, O for Other, or R for RAM Disk. (There can only be one RAM disk.) Multiple assignments can be made on one line.

There are two options which can be specified, as shown in brackets above. First, any assignment can be followed by the letter P to write-protect that drive, or U to un-protect the drive. Second, the syntax LD=MD ("last-drive equals max-drive-number") would cause DRIVE to set the MAXDRV variable equal to the last drive number currently in use, if it is not already so set.

For example, after the command

SK*DOS: DRIVE L0=F0 L1=H0P L2=N LD=MD
floppy drive 0 would become logical drive 0, hard drive 0 would become logical drive 1 (and write-protected), and logical drive 2 would be disabled. Furthermore, MAXDRV would be set to 1, assuming that there were no other active drives (set via earlier DRIVE statements or by default.)

One physical drive cannot be assigned two logical drive numbers; if you attempt to do so, DRIVE will print an error message and ignore the entire command.

With floppy drives, the DRIVE command is essential if you have more than one floppy disk controller, because it allows you to assign any physical floppy drive to any logical number.

It is also useful with hard disks, for it allows a hard disk to be used as logical drive 0; this is especially useful when SK*DOS is booted from a hard disk rather than a floppy. It is also essential in systems where a hard disk is partitioned into two or more `partitions'; it then allows any combination of disk partitions to be assigned logical drive numbers, and also allows some of them to be write - protected. (If you have a hard disk, then see the HDFORMAT description for further information on hard disk partitions.)

EDLIN

EDLIN is a simple line editor for generating or modifying text files. It is not intended as a replacement for a full screen editor or word processing program; rather, it is designed to perform simple editing functions for users who do not have a more complex editor program.

In keeping with its simplicity, EDLIN has several limitations. It cannot handle a line longer than 79 characters, and it is limited to working with text files which fit wholly into memory. This may be a problem if you only have a few K of free memory, but should not be a limitation in most 68K systems. It does not provide a full screen display, but limits you to working with one line at a time.

EDLIN is called with the command

SK*DOS: EDLIN <file-spec>

where the <file-spec> is the name of the file to be generated or modified. If not specified, the extension defaults to .TXT. If the file already exists, it will be read into EDLIN's memory and can then be edited. When you exit, EDLIN will rename the old file to an extension of .BAK (deleting an old .BAK file if it exists), and rewrite the new file with the same name as the old.

EDLIN is a line editor. That is, it works on lines of text. Each line of the file has a line number; these numbers are dynamic in the sense that they automatically change as new lines are added or deleted. Each time a line is printed out, its current number is printed with a colon at the left, as in

5: THIS LINE IS NOW LINE 5 OF THE FILE
At any time, you work on a so-called current line, which is your base of operations. You can move up or down from that line, but many operations can only be performed on this one current line.

EDLIN has two operating modes: `command' mode and `insert line' mode. In command mode, its prompt is a # sign, often followed by the current line number; in insert mode, its prompt is an = sign.

The command mode supports one-character editing commands such as P for Print or I for Insert. Such commands can be preceded by a line number if you wish to change to a different current line. For example, the command 10P would tell EDLIN to go to line 10 and then print it. (Do not insert a space between a command letter and any of the arguments before or after it.)

The following EDLIN commands can be used:

C - Change a string on current line

The letter C is followed by a delimiter, the old string, the same delimiter, the new string, and the same delimiter. Any character can serve as the delimiter. For example, the command 10C/Hence/Thus/ would go to line 10 and then change Hence to Thus. The command may optionally be followed by an asterisk, as in 10C/Hence/Thus/*, which makes the command a global command, changing all occurrences of Hence to Thus from the current line down to the end of the file.

D - Delete the current line

This command deletes the current line, and renumbers all of the following lines.

F - Find a string below current line

The letter F is followed by a delimiter, the string to be found, and the same delimiter, as in F/this string/. The command may optionally be followed by an asterisk, as in F/this string/*, which makes the command a global command; it will then display every line from the current line down to the end of the file containing the specified string.

G - Go to a line

The G command is used to go to a new current line. It is followed by one of the following: line number, as in G20; the letter T to go to the top of the file; or the letter B, as in GB, to go to the bottom.

I - Insert a new line after the current line

Use the I command to insert one or more new lines after the current line by typing in an I and a carriage return (or enter). The prompt will now switch to an = sign, and you can enter one or more new lines. To switch from enter mode back to command mode, type a # sign at the beginning of a new line.

P - Print

The P command prints one or more lines, beginning at the current line. It may be followed by one of several arguments, as in these examples:

P Prints the current line
P5 Prints 5 lines beginning with the current line
P#5 Prints from the current line down to line number 5
P! Prints from the current line to the bottom of the file

Q - Quit without saving

The Q command exits back to SK*DOS without saving any text on the disk, and is used primarily if you wish to abandon all the work you have edited.

S - Save and then exit to SK*DOS

The S command saves the current text to the disk and then returns to SK*DOS. If, as explained above, EDLIN is modifying an existing file, then it renames the old file to .BAK before saving the new text.

? - Print a help message

Prints a brief summary of EDLIN commands.

FIND

FIND may be used to find specific occurrences of a string within a text file. The syntax is

SK*DOS: FIND <file-spec> <search string>

For example, the command

   SK*DOS:  FIND SKEQUATE END
will display the line number and text of every line in the file SKEQUATE.TXT which contains the string END.

FORMAT

FORMAT is used to initialize a blank floppy disk and prepare it for use with SK*DOS. It completely erases a disk, writes the System Information Sector on the disk, initializes an empty directory, and sets up the remainder of the disk as free space.

This section describes the FORMAT command in general terms; the particular FORMAT command provided for your particular disk controller may be slightly different, but the general operation will be the same. (Note also that there is a different format program, called HDFORMAT, for the hard drive.)

To format a disk, enter the command FORMAT followed by the drive number. For example,

SK*DOS: FORMAT 1
would format the disk in logical drive 1. FORMAT will then ask for more information before it proceeds. The questions it asks depend on the controller.

The 1772 or similar controllers

With the Western Digital WD1772 or similar (1770, 2790, etc.) controllers, FORMAT will continue by asking
HOW MANY TRACKS?
to which you may answer any number from 2 through 80. Be sure not to specify more tracks than your drives can handle. You will normally answer 35 or 40, but formatting fewer tracks is often convenient when you wish to save time and don't need as much space on the disk.

If your disk controller supports double-sided or double density operation, the next questions will be

SINGLE OR DOUBLE SIDED?
SINGLE OR DOUBLE DENSITY?
SINGLE OR DOUBLE DENSITY TRACK 0?
Answer with an S or D, as appropriate. (The track 0 question will only be asked if you had specified double density for the disk itself.)

You should specify a single-density track 0 only if you intend to be compatible with 6809 versions of SK*DOS; the standard SK*DOS/68K format is double density, including a double-density track 0. Although SK*DOS can read and write single-density disks, note that a "boot disk" (i.e., a disk which will be used for booting SK*DOS) must be double density throughout.

You will next be prompted

ENTER DISK NAME:
ENTER DISK NUMBER:
The disk name must conform to standard file-name rules (and may have an extension) and the number may go from 0 through 65535.

IMPORTANT NOTE: Although a disk name and number are not required to use a disk, you should get in the habit of putting a distinctive name and number on every disk because SK*DOS periodically checks them to make sure you have not switched a disk while a file is open on it. Giving every disk the same (or no) name and number will defeat this file protection method.

While formatting the disk, FORMAT will let you know its progress, and may display messages if errors are encountered.

Most of FORMAT's time is spent checking each sector written to make sure it is readable. Unreadable sectors are removed from the chain of free sectors, and at the end of the formatting process, FORMAT displays the number of good free sectors available on the disk. Any number of defective sectors can be thus bypassed, but formatting will be aborted if an error is discovered in several crucial sectors of track 0 (sectors 1, 2, 3, or 5).

You may also specify an optional interleave factor on the command line, as in

SK*DOS: FORMAT 1 5
which would establish an interleave of 5. Allowable values are from 1 to 9 for single-density, 1 to 17 for double density; if no interleave is specified, a default value of 3 is chosen. Changing the interleave constant may speed up some operations but slow down others; the value of 3 seems a good compromise for most uses.

(See also the LINK command description).

The 37C65 controller

The 37C65 controller can handle many more drive and disk combinations than the 1772, so it is more specific in the choices it offers. When you use this controller, FORMAT first checks the drive description information you entered with HUMBUG's IS command to see which type of drive you have. Depending on the drive, it will then give you a choice of two or three different kinds of disks you can format with that drive. The available choices for each kind of drive are:

For the 360K 40-track drive, you can format the following:

For the 720K 80-track drive, you can format the following: For the 1.1 megabyte drive, you can format the following: For the 1.4 megabyte drive, you can format the following: For the 8-inch 77-track drive, you can format the following: (The last format is a very special format, developed for one of our customers, and you will probably never use it.)

You must choose one of the alternates given by typing in its number. FORMAT will then ask for the number of tracks, since users often format fewer than the maximum number of tracks if they need less space and wish to save time.

Formatting with the 37C65 controller provides more options for higher density disks, but fewer for low density disks. For example, it does not allow any single-side formatting, and does not provide as many single-density options.

(See also the LINK command description).

FROMSDOS and TOMSDOS

These two commands are used for transferring text files between SK*DOS/68K and IBM-compatible PC's running MS/PC-DOS, using the 180K disk format (one side of a standard 360K disk).

To transfer a disk between an MS/PC-DOS system and a SK*DOS system, proceed as follows:

1. First use the MS/PC-DOS FORMAT command to generate a special single-sided transfer disk. The command is

FORMAT A: /1
(which assumes that the disk is in drive A:). It is important to start with a fresh, newly-formatted disk. Then do one of the following:

2a. To transfer one text file from MS/PC-DOS to SK*DOS, simply copy it to this disk and then convert it to SK*DOS format with FROMSDOS. Note that only one file may be copied to this disk. If you have more than one file, you must use a fresh disk for each. The syntax for using FROMSDOS is

FROMSDOS <MS/PC-DOS drive number> <SK*DOS file spec>

For example, to copy a file from an MS/PC-DOS disk in drive 1 to FILE.TXT in drive 0, the command would be

FROMSDOS 1 FILE
The SK*DOS file specification defaults to the working drive and a .TXT extension, unless specified otherwise, so the file goes to 0.FILE.TXT if drive 0 is the working drive.

2b. To transfer a file from SK*DOS to MS/PC-DOS, take the disk formatted above to your PC system and run the following Basic program using the PC's Basic or GWBasic (it takes a minute or two):

  10 OPEN "A:TEXT.TXT" FOR OUTPUT AS 1
  20 PRINT #1, "GARBAGE"
  30 GOTO 20
This initializes the disk directory in a special way. Now take the disk to your SK*DOS system and run TOMSDOS to copy the desired file to the disk. Only one file can be copied to this disk; if you have more than one, you must start with another formatted disk. The syntax for using TOMSDOS is

TOMSDOS <SK*DOS file spec> <MS/PC-DOS drive number>

For example,

TOMSDOS FILE 1
would copy 0.FILE.TXT to the previously formatted MS/PC-DOS disk in drive 1. If you get a warning message, make sure that you have specified the correct drive number for the MS-DOS disk.

The disk can now be read on your MS/PC-DOS system. If you wish to copy the file to another disk, you must use the /A option of MS/PC-DOS's COPY command. For example, to copy the file to a hard disk, the command would be

COPY /A A:TEXT.TXT C:

FTOH and HTOF

These two programs are used to do a floppy disk backup on systems which only have one floppy drive, but which have either a hard disk or a large enough RAM disk to store the entire floppy disk contents.

FTOH is used to copy an entire floppy disk (including boot sectors, directory, and even empty sectors) to a disk file on a hard disk or RAM disk. The syntax is

SK*DOS: FTOH <floppy drive number> <hard disk file spec>

HTOF is then used to do the opposite - copy the disk contents from the hard disk or RAM disk file to the floppy disk. The syntax is

SK*DOS: HTOF <hard disk file spec> <floppy drive number>

In both cases, only a floppy drive number is specified as the entire disk is copied, but a hard disk (or RAM disk) file name is needed since the floppy disk contents occupies only a single file on the hard disk or RAM disk.

GET & GETX

GET and GETX are memory-resident commands used to load a binary file into memory. The word GET (or GETX) is followed by the file-name of the file to be loaded. An extension of .BIN is assumed, and the current work drive is used, unless specified otherwise.

For example, the command GET CAT.BIN or just GET CAT would load a binary program called CAT.BIN from drive 0 and place it in memory.

GET and GETX usually add the current value of OFFSET (see Chapter 11) to both the load address and execution address of the program loaded. Most often, this will result in the program being loaded into memory directly above SK*DOS itself.

For special uses, the addition of OFFSET can be defeated by (a) specifying the full name and extension of the file to be loaded, and (b) immediately following it by a - (minus) sign, without a space between the extension and the minus. Note, however, that this is not normally done and may create some problems; read the discussion of the SAVE to see the implications.)

The difference between GET and GETX has to do with error checking. As GET loads a binary file, it checks the loading address of every byte. It will not allow a byte to be loaded below the current value of OFFSET, or above the current value of MEMEND; if any such invalid address is found, GET prints an error message and aborts loading. GETX, on the other hand, does no such checking. In general, you should therefore always use GET rather than GETX; GETX should be reserved only for special (and well thought out!) purposes.

HDFORMAT

HDFORMAT lets you format an MFM hard disk for use with SK*DOS (as opposed to FORMAT, which is strictly for floppy disks). This command will work slightly differently for different systems, and you may have received an addendum which describes any such differences for your system configuration. (The following describes the command as used with the WD1002 controller.)

HDFORMAT is called with the simple command line

   SK*DOS: HDFORMAT
and then proceeds to ask for the information it needs to properly format the hard disk. It's important to answer these correctly, and so we will discuss these questions and their answers at length. The first question is
  Which drive - A or B?
In most instances, only one drive is present and so the choice is A. (The WD1002-HDO controller used on some computers allows three hard drives, which it calls drives 0, 1, and 2, but SK*DOS supports only drives "1" and "2". To avoid confusion with drive numbers under SK*DOS we therefore call these two drives A and B instead of 1 and 2. SK*DOS does not allow what the WD-1002-HDO calls "drive 0" because the WD-1002-HDO switches to this drive number upon powering up, and not putting an actual drive on this port avoids the possibility of the disk being corrupted when powering up or down.)

The next four questions have to do with the size and configuration of the disk, which requires some explanation first.

Hard ("Winchester") drives typically contain several `platters' which rotate on a common shaft. Each platter has two sides, with a head on each side to read and write data. The heads are all mounted on a common assembly so they move in and out together. At any one time, each head is positioned over a circular track on its surface. All of those tracks together make up a `cylinder'. The data on each track is divided into `sectors', with typically thirty two 256-byte sectors per track; the number of sectors per cylinder is then equal to the number per track times the number of tracks per cylinder.

For example, a MiniScribe 3425 drive has two platters with four heads. There are 615 tracks on each platter (so there are 615 cylinders) and 32 sectors on each track. Beyond the 615th track, however, this drive has additional tracks which, though not good for storing data, are specially set up as a `parking area' - an area designed for letting the heads land when power is shut off. The drive instructions specify that the parking area is on cylinder 656.

Winchester drives also use `write precompensation' to reduce write errors. Precompensation is only needed on inner tracks, and different drives need it on different tracks. Many drives start precompensation on track 128, but you should consult the drive manual for the correct number to enter.

Using this information, the next four questions (and their answers for this sample drive) would be

  Number of cylinders (Tracks/Side) to use on drive? 615
  Which cylinder should the drive be parked on? 656
  Which cylinder to start precompensation? 128
  How many heads on the drive? 4
  (There are 32 sectors per track/side.)
The park cylinder is not actually used by HDFORMAT; instead, it is saved and used by the PARK command.) Even when a specific parking area is not suggested by the disk manufacturer, we recommend that you reserve some cylinders for that purpose, and subtract that number of cylinders from the total capacity of the drive.

In some cases, you may want to use only part of a hard disk for SK*DOS, leaving the remainder for some other DOS. In that case, simply specify either a smaller number of heads or a smaller number of cylinders. For example, you could specify 309 cylinders, which would leave the other 306 for use by the other DOS.

SK*DOS next asks

  Enter the required code for drive step rate -
The step rate determines how fast the drive will move the heads from one track to the next. In the buffered mode, the controller tells the drive to move as fast as it can, and simply waits until the head movement is finished; in other modes, stepping signals are sent at fixed intervals from 0.5 to 7.5 milliseconds apart, until the drive is at the requested cylinder. Almost all modern disk drives permit buffered stepping; in that case, enter a code of 0 for an -HDO controller, and a code of 5 for a -WX1, -WX2, -GEN, or similar IBM XT-type controller. For older disk drives, you will have to consult your disk drive manual to determine its capabilities, and then consult the disk controller manual for an appropriate code to enter.

HDFORMAT will now use the data you have entered and compute the total capacity of the disk as specified. If you have entered a smaller number of heads or cylinders because you wish to reserve part of the disk for use by another DOS, then only the usable part of the disk will be used in this calculation. For the above example, HDFORMAT would print out

  Total disk capacity is 19680 K
which is a bit over 19 megabytes.

Because of the structure of SK*DOS, each logical drive is at this time limited to a maximum of 16 megabytes, so the above example shows that this particular Winchester drive has more capacity than SK*DOS can handle as a single drive. It will therefore print out the message

THIS EXCEEDS THE MAXIMUM LOGICAL DRIVE CAPACITY; you 
must therefore partition the disk into 2 to 4 partitions.
  Would you like to partition the disk (Y/N)?
In order to use the full 19+ megabyte disk, you must partition it into at least two partitions. Each of these partitions becomes a separate logical drive, and there is a maximum of four partitions allowed per hard disk. (Even if a drive does not exceed 16 megabytes, you may still partition it even though you do not need to; in our particular example you must answer Y to the last question since the drive is just too big for one partition.) Assuming a Y answer, HDFORMAT then asks
  How many partitions would you like?
Still assuming our previous example, suppose you answer 3 to make three partitions. Then the next series of messages is
  You will now partition the disk by Cylinders (Tracks). 
The TOTAL number of usable cylinders on this drive is 615.
  The MAXIMUM number of cylinders allowed in any one partition is 
512.
  The MINIMUM number of cylinders allowed in any one partition is 
5.
  Decide how you would like to split up the TOTAL number of cylinders 
and enter the counts:
  Cylinders for Partition H0: 205
  Cylinders for Partition H1: 205
  Cylinders for Partition H2: 205
In this example we split the disk evenly by assigning 205 cylinders to each partition. Although there is no need to make the partitions equal, it may be convenient if you intend to use BACKUP to quickly copy one partition to another.

Assuming no further errors, the next message will be

  READY TO FORMAT HARD DRIVE
  ARE YOU SURE YOU WANT TO GO AHEAD?
which should be answered with Y.

There are a number of self-explanatory error messages which may come up during the above procedure. For example, selecting a partition size that is too small or too large, or selecting partition sizes which do not add up to the total number of cylinders on the disk, will give an error message and allow you to re-enter the data.

Once formatting starts, HDFORMAT will print out status information so you can see what it is doing. If the disk has defective sectors, their locations will be displayed and they will be deleted from the free space on the disk. A relatively large number of defective sectors can be tolerated on a disk without a problem, except that logical track 0 sectors 0, 3, and 5 must always be good on every partition - errors in any of these will cause an immediate "Fatal Error" message and HDFORMAT will quit. If this occurs in partition 0 of a disk, then the hard disk is not usable. If it occurs in another partition, however, then it will generally be possible to move these defective sectors to some other track by partitioning the disk differently, and then reformat the disk without problem.

Different disk partitions can be assigned different logical drive numbers with the DRIVE command. Partitions are called H0 through H7, as follows:

Drive A has H0 through H3
Drive B has H4 through H7

Finally, some notes about how HDFORMAT works. Most hard disks arrive from the factory with one or more defects; on a brand new disk drive these will generally be carefully documented on a test printout enclosed with the drive. Most such errors involve just a few bits on isolated tracks; because most modern hard disk controllers use error correction, they are able to correct such minor errors and therefore hide them. As HDFORMAT verifies the disk, however, it writes and then reads each sector. If the sector was not read correctly, then it is obviously bad; even when read correctly, however, HDFORMAT still checks whether a sector required error correction. If so, HDFORMAT tries to read that sector once more. If it still requires error correction (even though it may have been read correctly both times), HDFORMAT still flags that sector as defective. This will hopefully avoid future errors.

You may note that the number of free sectors displayed in a directory printout is always lower than the number calculated from the number of cylinders. Part of this is due, of course, to the fact that the free sector printout does not include those in the directory and system information sector. In addition, HDFORMAT always formats the disk so that each track has the same number of sectors. In some cases the partitions are such that HDFORMAT has to discard a few sectors so as to make the logical tracks all the same length.

The following information may help you to determine the proper settings for your drive; it was obtained from a Western Digital spec sheet and we have not personally checked its accuracy:
 
 

Drive
Cylinders
Heads
Precomp Cyl.
Seagate ST-225
612 
300
Seagate ST4038
733 
300
Seagate 4051
977 
978
Seagate ST4096
1024 
1024
Seagate 251
819 
820
Lapine LT200
612 
613
Maxtor 1085
1024 
1024
Newbury 1085
1024 
1024
Newbury 1140
918 
15 
918
Miniscribe 3425
615 
128
Miniscribe 3650
809 
128
Miniscribe 3425P
615 
128
Miniscribe 3053
1024 
512
Miniscribe 8425 
615 
128

HELP

HELP is simple program which merely reminds you how to get help with other SK*DOS commands - simply type their name, a space, and a question mark.

LINK

LINK is one of the commands used to generate a `bootable' SK*DOS system disk on some systems. It tells the super-boot program where to find the SK*DOS program on the disk.

Here is a short explanation of why LINK is needed. To start SK*DOS, you usually use a monitor command. In systems which contain HUMBUG or another customized monitor, this command may boot SK*DOS directly. In simpler systems, however, this monitor command may only be capable of reading one sector from a disk. In that case, it loads a `super-boot' program from track 0 sector 1 of the disk into memory. The super-boot program then reads the rest of SK*DOS and executes it. Since SK*DOS could be anywhere on the disk, the super-boot needs a quick way of finding it. This is accomplished by using LINK to store the disk address of SK*DOS directly into the super-boot program itself.

LINK is only necessary when you want to generate a `bootable' system disk; data disks which do not contain a copy of SK*DOS and which will never be booted do not need LINK.

There are three basic ways of generating a bootable system disk:

1. Use BACKUP to do a mirror-image copy of an existing bootable system disk onto another formatted disk. Since BACKUP does an exact copy of a disk, the resulting disk will be exactly like the original and will also be bootable. (But if the original disk has unneeded files or defects, so will the new disk.)

2. Use HTOF to restore a disk image (previously stored with FTOH) of a bootable disk onto a floppy disk.

3. Use FORMAT to initialize a blank disk, then use COPY to copy SK*DOS to it, and then use LINK to give its address to the super-boot program. In this way it is possible to copy only needed files to the new disk. Use of COPY instead of BACKUP also compacts the disk and rearranges the files to make disk access faster.

To link a disk, enter the command LINK followed by the SK*DOS file name. For example,

SK*DOS: LINK 1.SK*DOS.SYS
would tell the super-boot in drive 1 where to find the file SK*DOS.SYS. You must enter the extension. The drive number is optional, and will default to the working drive if omitted.

Incidentally, self-contained programs (those which use the monitor but not SK*DOS itself) can also be linked to the super-boot. In that case, they will be loaded and executed directly upon booting the system.

LIST

The LIST command will list the contents of a disk text file to the screen or printer.

The LIST command, in turn, requires the name of a file to list. It assumes that the required file name has been entered on the same line, separated from the word LIST by either a comma or a space. For example,

SK*DOS: LIST TEXT
would list the contents of the file called TEXT. Since LIST is intended for listing text files, it assumes a .TXT extension unless told otherwise. Hence LIST TEXT means the same as LIST TEXT.TXT.
 

LOCATE

LOCATE is used to identify the memory locations into which a binary file will load, and to provide the transfer (or starting) address.

To use it, type the command LOCATE, followed by the name of the file desired, as in

SK*DOS: LOCATE FILE.COM <->
The file name defaults to a .BIN extension if not supplied.

The above example shows an optional - (minus) sign at the end of the command line. This affects the displayed addresses as follows:

If the - is omitted (the default), LOCATE will print the message ADDRESSES, AS IF LOADED WITH CURRENT OFFSET: and display the actual addresses the file would use if loaded or executed with the current OFFSET. (These addresses consist of the addresses stored as part of the disk file, plus the current value of OFFSET.)

If the - is present, LOCATE will print the message ADDRESSES, AS SAVED ON DISK WITHOUT OFFSET and will display the disk file addresses as they exist on the disk file, without adding the current value of OFFSET. This option describes the file, but does not provide the information as to where the file would load in the current system.

Note that LOCATE's printout does not necessarily specify all of the memory used by a particular program, since the program may use memory areas without actually loading anything into them from disk.

When several binary programs are appended together, they may contain more than one transfer address. Although LOCATE will indicate them separately, keep in mind that only the last transfer address will actually be used by SK*DOS.

MAKEMPTY

MAKEMPTY is a command which generates an empty file.

Perhaps a bit of an explanation is in order. SK*DOS does not normally like empty files. When a program asks SK*DOS to open a file for writing, but does not actually write anything into it, SK*DOS does not actually put the file on the disk. In other words, it will not generally create a real, but empty, file on the disk (unless you reset the computer or remove a disk while a file is open for writing, which is something you should never do!)

Nevertheless, there are times when an empty file would be useful - for example, to initialize a data file which is to be read by a Basic program, updated with more data, and then rewritten. That is precisely what MAKEMPTY does.

To use MAKEMPTY, follow the command with a file name, as in

SK*DOS: MAKEMPTY DATAFILE
This command would create an empty file called DATAFILE.DAT on your working drive, since a default extension of .DAT is assumed unless specified otherwise.

The resulting empty file contains all zeroes, which is interpreted by Basic as well as text editors as truly empty; an attempt to read this file will result in an immediate end-of-file indication.

MON and RESET

MON and RESET are used to exit SK*DOS and return back to the system monitor (if there is one in your computer system). Both of these are memory-resident commands.

Not all systems have both MON and RESET; sometimes only one or the other may be available. The difference between them has to do with their treatment of exception vectors (traps).

When running, SK*DOS always resets the "line 1010" exception vector of the 68xxx CPU to its own value. In addition, depending on the state of TRPFLG, SK*DOS may also reset all of the other exception vectors as well. If both MON and RESET exist on a system, then

MON will return to the monitor at a point where the ROM monitor will leave the exception vectors as they were set up by SK*DOS.

RESET will return to the monitor at a point where the monitor will do a complete reset, including reinitializing all of the exception vectors.

PARK

The PARK command is used for parking the heads of hard drives (Winchester drives). It is called simply with
SK*DOS: PARK
and takes its parameters from the data stored on the disk during formatting. Parking the heads of a hard disk drive moves them to a section of the disk which is not used, and prevents possible damage to the usable portion of the disk surface or to the data stored on it.

Parking the heads before moving a disk drive is generally regarded as desirable, although there is some disagreement among users as to whether parking heads is necessary when just shutting the system off. Nevertheless, it is our opinion that devoting a part of the disk to a parking area and then always parking the heads in that area before shutting off the power is a sensible precaution, despite the fact that it may slightly reduce the disk capacity.

The literature accompanying some drives specifies a park cylinder to be used; if so, then the choice is simple. In other cases, however, the choice may not be so clear.

PDELETE

The PDELETE command is used to rapidly delete one or more files from a disk. Its advantage over DELETE is that you need not type in individual file names, since PDELETE will prompt you with the file names.

The syntax for using PDELETE is

SK*DOS: PDELETE <drive number & directory> <optional match list>

The first parameter must include a drive number and may also include a directory name. If only a drive number is specified, then the current default directory of that drive is used; if both a drive number and directory are specified (such as 1.D/) then only the files in that directory may be deleted. An asterisk (*) used as the directory (as in 1.*/) would refer to all directories of the specified drive.

The match list works like that of CAT, COPY, or TCAT. If not given, then PDELETE will prompt with the names of all the files on the specified disk or directory, one at a time. If given, then only files which match the match list will be prompted. For example, the command

SK*DOS:   PDELETE 1 TX .CMD
would prompt with the names of all files whose names begin with TX, or which have .CMD extensions. In each case, you will be asked whether to delete, and can answer Y (yes), N (no), or Q (quit).

PEEK and POKE

The PEEK and POKE commands are similar to the same commands of Basic. These commands can be used to make minor modifications to SK*DOS or other programs.

To use PEEK, give the command PEEK followed by a hexadecimal address. The contents of that address will be printed out.

To use POKE, enter the command POKE followed by the hexadecimal address of the location to be poked and the hexadecimal number to be poked into that location. The POKE command will print out both the old and the new contents as a check.

When PEEKing or POKEing non-existent memory locations, you may get undesirable results. On some systems (which do not generate bus errors), the system may totally die. If the hardware properly generates bus errors, then you will get an error message, either from SK*DOS (if TRPFLG is non-zero so that SK*DOS handles all exceptions), or from the monitor (if TRPFLG is zero so exceptions are handled by the monitor).

PICTEST.BAS

PICTEST.BAS is a Basic program which helps to check that an assembly language program written for use with SK*DOS is indeed relocatable. The version supplied is specifically written for use with RBASIC (or with TSC XBASIC on 6809 systems or with SK*DOS09), but can be easily modified for use with other Basic interpreters.

Although it is somewhat difficult to test an assembly language source file for position independent (relocatable) coding, it is easy to test the machine language object code. The trick is to simply assemble the same program twice, once with an ORG of $0000, and once with a different ORG (such as $1000). If the program is truly relocatable, then the two object codes should be exactly identical (although certain programming techniques may result in slight differences.) Then it is only necessary to compare the two object files for differences. PICTEST.BAS does this job by reading the Motorola S1-type files output by an assembler.

Before using PICTEST.BAS, assemble the program to be tested with two different ORG statements as described above. Then execute your Basic interpreter and load PICTEST.BAS. When it is executed, PICTEST.BAS will ask for the names of the two binary files to be compared. If any differences are found between the two programs, PICTEST.BAS will print out the address where the difference was found.

Once such a list of addresses is found, you should check these against a listing of the program being tested. Some differences may be valid, depending on your programming style; others may be caused by errors, such as perhaps forgetting to use BSR instead of JSR, or forgetting to use (PC) after a variable name.

PROMPT

PROMPT allows you to change the system prompt from the normal SK*DOS: to any other string. For example, users who feel more at home with a shorter prompt such as, perhaps, three plus signs, can change the prompt with the command
SK*DOS: PROMPT +++
The new prompt may be up to 10 characters long, and may include any printable character.

PROMPT only changes the prompt currently in memory - it does not change the prompt string on the boot disk. Hence the original SK*DOS: prompt will return the next time you boot the system. Moreover, PROMPT may only be used once; that is, once PROMPT changes the current prompt it cannot change it again unless you reboot the system.

PROTECT

Files may be assigned one or more kinds of protection codes as follows: The PROTECT command is used to assign protection codes to a file. To use PROTECT, give the command PROTECT, followed by the file name, followed by one or more of the following codes:

C = Catalog protect
D = Delete protect
W = Write protect
X = Cancel protection.

For example, the command

PROTECT SK*DOS.SYS WD
would prevent SK*DOS.SYS from being deleted or written over.
PROTECT LIST.COM XD
would cancel whatever protection LIST.COM currently has and instead substitute delete protection.

If protection codes contradict each other, the rightmost codes take precedence. For example, the code CDWXC would assign catalog, delete and write protection, then cancel them all, and instead provide only catalog protection.

RAMDISK

RAMDISK allows you to set aside a fixed area of your RAM memory as a RAM disk (also called a virtual disk.) The RAM disk is an area of RAM which is used exactly like a real (or physical) disk drive. It has a drive number, is accessed exactly the same as a real disk, has a directory like a real disk, and can store programs or data files like a real disk. The main disadvantage of a RAM disk as compared with a real disk is that the RAM disk becomes erased when power is turned off (or if there is a power outage.) Hence any important data on a RAM disk should be copied to a real disk before power is turned off, and perhaps at frequent intervals between.

RAM disk is enabled with the command

SK*DOS: RAMDISK <drive number> <RAM disk size>

where
 

While RAMDISK is initializing, it will print out a row of periods, one for each "track" being initialized. Note that the RAMDISK program checks for the existence of enough memory, but does not check whether that memory is working correctly.

Once the RAM disk has been initialized, it may be reassigned to a different drive number by again typing the RAMDISK command, followed by the new drive number (but without a size). Its size, however, cannot be changed.

Both the RAMDISK program, as well as the extended disk memory, contain flags which indicate the status of the RAM disk. If you reboot SK*DOS (without powering down the system), the newly booted SK*DOS will not know about the RAM disk, but the RAM disk contents in memory will be retained as long as it is not overwritten with other data. If you immediately enter the RAMDISK command, the RAMDISK program will reenable the RAM disk, but will print the message RAM DISK WAS FORMATTED EARLIER rather than erasing it and formatting it again. Hence your data will be retained in the RAM disk (still assuming, of course, that power has not been turned off in the meantime or that the RAM disk memory has not been overwritten with other data.)

If you do wish to actually erase all data on the RAM disk, insert the word NEW into the command, as in

SK*DOS: RAMDISK NEW x
which will totally erase the RAM disk and then reformat it as drive x.

RAMDISK changes both the OFFSET and MEMEND pointers. The RAMDISK program itself is loaded beginning at the current value of OFFSET, and then OFFSET and OFFINI are changed to point above the program so that subsequent programs are loaded above the RAMDISK program. The virtual disk memory itself, into which RAM disk data is stored, is placed at the top of user memory just under the initial value of MEMEND, and MEMEND is then reset to point just under it.

This has a bearing on what happens if SK*DOS is exited and rebooted while a RAM disk exists. After rebooting, the RAMDISK program will no longer exist in memory, but the RAM disk data should still exist at the top of memory below the current value of MEMEND. As long as no program is run which uses more than 16K of RAM, this data will continue to exist and the RAMDISK can be reinstated by another RAMDISK command without data being lost.

REDOFREE

REDOFREE is used to rearrange the sequence of the free sectors of a disk so they go in order from the outside of the disk toward the inside. The sectors are in this sequence on a fresh disk, but gradually become disordered as a disk is used because each time that a file is deleted, its sectors are added to the end of the free space. The space from deleted files is thus scattered around the disk, with the result that the free space also wanders all around the disk.

The syntax for using REDOFREE is

SK*DOS: REDOFREE <drive number> [D]

REDOFREE then prints a number of basic parameters about the disk, reads all the sectors in the free space, sorts them into numeric order, and finally rewrites the sector linkages to place them into numeric order. (After each of these steps, REDOFREE asks whether to proceed, so you may stop it at any point.)

REDOFREE provides the option of printing a listing of free sector segments both before and after they are sorted. If the listing is selected, each line may be followed by one of two marks:

The optional D argument in the calling line activates one other option in REDOFREE. If you enter the D, then the program will print out the starting track and sector number of all deleted files it finds in the free chain (these are identified by the sequence number 0001), as well as the length of these files. You can use this to search the free space for old deleted files, which can then be copied out to another disk by using the R option of COPY. For example, on a hard disk, this often lets you recover files days or even weeks later.

But note that the sequence numbers are overwritten when you reorganize the free space with REDOFREE. Hence you cannot find files which were deleted before the last time you ran REDOFREE. This free space is marked as "uncommitted free space" when you use the D option.

RENAME

RENAME is used to rename a disk file. To use this command, enter the word RENAME, followed by the old name and the new name, as in
RENAME OLDNAME.TXT NEWNAME.ABC
No quotes are needed, but the extension must be supplied for both names.

Optional drive numbers and/or directory names may be supplied for one or both files, as in

RENAME 1.F/OLDNAME.TXT 1.A/NEWNAME.TXT
If not supplied for the old file, the drive and directory names default to the current work drive and directory. If not supplied for the new file, they are the same as the old file.

S1TOCOM

S1TOCOM is a program which converts a binary file in Motorola S1-S9 format into a binary file in SK*DOS format. It is used to convert the output of some 68000 assemblers into a format which can be loaded and executed by SK*DOS.

S1TOCOM is supplied in two forms - S1TOCOM.COM is the 68K version, while S1TOCOM.CMD is a 6809 version intended for systems programmers who may be using a 6809 system for software development.

The syntax for using S1TOCOM is

SK*DOS: S1TOCOM <file name>[-]

where the file name is the name of the binary S1 file to convert. The input file defaults to a .BIN extension, while the output file will have the same name but with a .COM extension. If a .COM file already exists, S1TOCOM will delete it without any prompt; after it is finished, S1TOCOM will delete the input file, again without any prompt.

If the optional "-" sign does not follow the file name, then the loading and transfer addresses in the output file will be exactly the same as those in the input file. If the "-" sign is entered, then the current value of OFFSET will be subtracted from the addresses given in the input file. The "-" option is primarily for programmers who wish to convert a non-position independent file to SK*DOS operation, and have assembled that file to lie in a memory location known to be available. But note that this option can lead to great problems if the value of OFFSET at the time the conversion to binary is done is not the same as the value when the converted program is executed. It would be much safer to use S1TOCOM without the "-" option, and then use the "-" option of GET, followed by XEQ to execute the final program.

SAVE

This memory-resident command saves binary data from memory to disk. For example, the command
SAVE PROGRAM 9000 A000 9004
would save a file called PROGRAM from memory locations $9000 through $A000, and assign a transfer (starting) address of $9004.

All addresses are hexadecimal, the file name extension defaults to .BIN if not given, and the transfer address is omitted if not given.

Once called, the SAVE command asks the following question:

  SAVE OPTIONS:
    1. USE ABOVE ADDRESSES (IGNORING OFFSET), OR
    2. SUBTRACT OFFSET FROM ABOVE ADDRESSES
  CHOOSE 1 OR 2:
These options affect only the addresses stored on the disk as part of the file, not the address of the memory area saved to disk, as follows: You should try saving a few files and then examining them with LOCATE to get a feeling for these two options.

SCAT & SEQUENCE

SCAT is similar to CAT, but differs in three ways: SCAT is designed for systems which do not have a clock/calendar IC installed. (If you do have a clock, then you should read the description of the TCAT command which, along with time stamping, provides greater capabilities.) When a clock is not installed and interfaced with SK*DOS, as described under TCAT, then SK*DOS automatically assigns a `sequence number' to each file as it is written or updated. This number starts with 1 when the system is booted, and increments by 1 each time a new file is written. When your disk contains a number of files all having the same date, the sequence number tells you what order the files were written in. The SCAT command then prints the catalog, but sorted by date and sequence number so that the most recent file appears on top.

Obviously, if your system has a clock, then using time-stamping and TCAT provides the actual time rather than just a sequence number, but the sequence number is a good second best if no clock is available. It has three characteristics you should keep in mind:

1. Each time the system is powered up, the sequence number starts with 1. In other words, if you turn off the power and then restart, the sequence number will return back to 1. To avoid having multiple files with the same date and sequence number, you may want to get in the habit of manually updating the sequence number if you restart the system, so that it continues with the next higher number. The SEQUENCE command is used for this purpose. For example, to change the number to 7, use the command

SK*DOS: SEQUENCE 7
Typing just SEQUENCE without a number will print out the current sequence number.

2. The sequence number is incremented by 1 for every file written or updated. This includes files being copied, even though copied files are not assigned a new number. In other words, each time you copy a file, the sequence will appear to skip a number; this is the number that would have been assigned to the copied file if it had not kept its old number.

3. Since the sequence number is just a single byte, the maximum number is 255, after which it returns to 0.

SCAT arguments are the same as those for ACAT.

SK*DOS09

SK*DOS09 is 6809 SK*DOS along with a 6809 CPU simulator which allows you to run 6809 SK*DOS (or Flex) programs on your 68K computer. This allows you to run programs which may not be available for the 68000, though at reduced speed.

To run SK*DOS09, simply type the command

SK*DOS:  SK*DOS09
As soon as the program runs, you will be greeted by the familiar SK*DOS signon, except that this time it will be 6809 SK*DOS that is running on your computer and the prompt will change to SK*D09:

Since your 68K computer is essentially interpreting 6809 instructions, you will notice a slight slowdown in operation. On input and output (such as listing a disk directory) you will hardly notice a difference, whereas on heavy computing there may be a significant slowdown, depending on the program being run. Even so, you may want to do certain operations (such as copying a disk) in 68K mode since that will always be faster.

SK*DOS09 will run most 6809 software, although there may be some programs which do not work. This will generally include those which access I/O hardware or other machine parameters directly, bypassing DOS. This includes, for example, programs which require interrupts, such as some text editors with type-ahead buffers. It also means that you cannot use a 6809 FORMAT program to format the disk - you must use the 68K FORMAT instead. Furthermore, although you might be tempted to use the 6809 SK*DOS's TTY command, don't bother; I/O is handled by the 68K SK*DOS, and so use its DOSPARAM command instead. There may be other programs which don't run as well - programs which use some particular characteristic of the 6809 CPU which is difficult or impossible to simulate on the 68K CPU. If you do run across some such example, let us know and we will try to suggest some other approach.

While running SK*DOS09, the ESCape key works normally to temporarily pause output; if you follow it with CR (or RETURN or ENTER or <--', whichever it is called on your terminal), you will return to either SK*DOS09 or, in some cases, to the application program running under SK*DOS09.

Just as the MON command in normal SK*DOS/68K brings you `back out one level' to the program which called it (namely the monitor or boot ROM), so MON in SK*DOS09 brings you out one level to the 68K SK*DOS when you want to exit.

Finally, a few technical details. SK*DOS09 requires a minimum 128K system, and devotes the entire second 64K of that system, from $10000 to $1FFFF, to simulating the 6809 environment. Each location of that 64K `pseudo-memory' corresponds to the equivalent location of a normal 6809 computer system. (For example, the warm start location of 6809 SK*DOS is $CD03, while in SK*DOS09 it is located at $1CD03. The initial "1" is, however, totally transparent to 6809 software, which simply addresses that location as $CD03 as it always has done since the address translation is done entirely by SK*DOS09.) Just as in a true 6809 system, though, only the first 56K is actually used; the last 8K, which would normally be taken up by 6809 I/O and monitor, is empty and available RAM.

In addition, SK*DOS09 also requires approximately 8K of user memory for its 6809 interpreter program. This normally starts at the current value of OFFSET.

SK*DOS09 uses your normal 68K I/O devices, and can access all your 68K disk drives, including RAM disk, although you must make sure that your RAM disk memory does not conflict with the memory used by SK*DOS09. If it does, then SK*DOS09 will print an error message when it is started, indicating that there is not enough memory for it to function.

Since the disk formats for both 6809 and 68K SK*DOS versions are identical, 6809 and 68K files can coexist on the same disk. You will note, however, that 68K command files have the extension .COM, whereas 6809 command files use the .CMD extension. Hence typing a common command such as CAT or DELETE will always call the correct program. (Incidentally, both SK*DOSes will use the same ERRCODES.SYS file, since the error numbers are identical. Further, 6809 SK*DOS ignores .BAT files.)

Finally, SK*DOS09 can only access root directories (i.e., unnamed directories) of drives, since multiple directories were not available on 6809 SK*DOS systems.

STEPRATE

The STEPRATE command is used to set the speed at which SK*DOS commands disk drives to step from track to track. (Depending on your disk controller and disk drivers, this command may not exist, or may be slightly different.

For 5-1/4" disk drives, the allowable step rates are 6, 12, 20, or 30 milliseconds (ms) per step (with most floppy disk controllers), or 2, 3, 12, or 20 ms (with the Western Digital 1772 controller). The step rate is specified after the word STEPRATE as in

SK*DOS: STEPRATE 30
Each time STEPRATE is called it responds by displaying the new step rate setting; if no step rate is specified in the command or an invalid number is specified, then the step rate remains the same and the current value is displayed.

(For those users more at ease with programming floppy disk controllers, the values 0 through 3 {which are the values actually given to the floppy disk controller} may also be specified as follows; the actual numbers depend on thecontroller used:

0 = 6 ms
1 = 12 ms
2 = 20 ms
3 = 30 ms.)

Smaller step rates will produce faster operation, but you should be careful not to specify a value smaller than your disk drives can handle since that may lead to errors. If in doubt, it is better to err on the conservative side.

SYSTEM and WORK

The SYSTEM and WORK commands are used to specify the system and working drives and directories. When SK*DOS is first booted, the root directory of drive 0 becomes the default system and working drive; that is, all programs will be loaded from this system drive/directory, and all files being worked on will be loaded from this working drive/directory. The default drive and directory selection can be changed with these two commands. For example, the command
SK*DOS: SYSTEM 1
would make drive 1 the default system drive, while
SK*DOS: WORK 8.C/
would make drive 8, directory C, the default working drive and directory.

Entering the SYSTEM or WORK command without a valid drive number following causes the current drive and directory to be displayed. Entering a drive number without a directory name switches to the root directory of that drive; it is not possible to enter a directory without a drive number to go with it.

In addition, the system drive (not the work drive) can also be specified as SYSTEM ALL. In this case, SK*DOS will search the root directories of all drives, in numeric order starting with drive 0, until it finds the requested file. If SYSTEM ALL is used, it is important to make sure that MAXDRV is properly set, so that SK*DOS does not try to search drives which do not exist. Use the DOSPARAM command to inspect or change MAXDRV.

TCAT

TCAT is similar to CAT, but differs in three ways:

(1) TCAT prints both the date of each file as well as the time (if one has been assigned to the file),

(2) The catalog listing is sorted by date and time so that the most recent files appear first,

(3) TCAT does not allow all of the options used by the regular CAT command.

Although TCAT is provided primarily for those users who have a clock/calendar installed, it is also useful to others because of its ability to sort directory entries by date to display the latest files first.

Here are a few examples of how to use TCAT:

TCAT
prints a catalog of the default directory of the work disk
TCAT 5
prints a catalog of the root directory of drive 5
TCAT 5 FS
prints a catalog of all files on drive 5 which have names beginning with FS
TCAT 5.A/ FS
prints a catalog of all files on drive 5 subdirectory A which have names beginning with FS
TCAT 5.*/ FS
prints a catalog of all files in all subdirectories on drive 5 which have names beginning with FS
TCAT 5 FS.T .COM
prints a catalog of all files on drive 5 which have file names beginning with FS and also have extensions beginning with .T, and of all files on drive 5 which have the extension .COM
TCAT 5 F*S.T .COM
prints a catalog of all files on drive 5 which have file names beginning with F*S (where * stands for any character) and also have extensions beginning with .T, and of all files on drive 5 which have the extension .COM

The possible options for TCAT are the same as for ACAT and SCAT. (Try TCAT on the SK*DOS disk to see what it does.)

If your system has a clock/calendar IC but your version of SK*DOS does not already have time stamping implemented, information on adding time stamping is provided in the 68K SK*DOS Configuration Manual.

SK*DOS's COPY command carries the old date and time along with the file. Hence copies of your files will have the same date and time as the original.

The time code is based on a 24-hour clock, and is given in tenths of an hour, ranging from 00 to 239. For example, a code of 123 means 12.3 hours, or 3/10 of an hour (18 minutes) past noon. The TCAT program would display this as 12:18. If the time code is 00, which is the case for files without a time, then TCAT will omit the time printout.

TIME

If your system has a clock/calendar IC, then the TIME utility may be supplied with your SK*DOS. It allows you to read and set this clock.

The command

SK*DOS: TIME
is used to display the current time in the format
    DAY MM-DD-YY  HH:MM:SS AM
The command
SK*DOS: TIME S
is used when you want to set the clock. Simply answer the questions asked to set the clock, making sure to use two-digit numbers as requested.

TRACE*** and TRACENAB

TRACE*** is a memory-resident command which allows you to enter a user program with the CPU in trace mode, so that the program can be debugged. This mode requires a monitor ROM, such as HUMBUG, which supports the trace mode.

The TRACE*** command (which has three asterisks as part of the name to avoid the possibility of its being called accidentally) is used just before the command which loads and executes the program being debugged. For example, to debug a program called NEWPROG.CMD, the commands would be

   SK*DOS:  TRACE***
   SK*DOS:  NEWPROG
The TRACENAB command is needed only when tracing with HUMBUG and no previous tracing has been done since turning on the power. When HUMBUG traces a program, it saves the contents of the 68xxx processor's trace trap, places its own trap address into the trap, and then goes to a user program; after returning, it replaces the original address in the trap. When tracing is begun with SK*DOS's TRACE*** command rather than via HUMBUG, HUMBUG's trace routines are entered in the middle and hence HUMBUG does not have a chance to save the previous contents of the trap location. It therefore restores the wrong value into the trap location. TRACENAB corrects that problem in most cases. The correct syntax is
   SK*DOS:  TRACENAB HUMBUG
If TRACENAB does not work properly (such as may happen if you use an old version of TRACENAB), you can get around it by using MON to return to HUMBUG, doing a (harmless) single step with ST 1000, and then returning to SK*DOS with RD. This will also fix the pointer.

UBASIC

UBASIC is not intended to replace a full-featured Basic, but does suffice for some applications. It currently supports the following Basic operations:

FOR ... TO ... (STEP)                 RUN
ON ..... GOTO                         LIST
ON ..... GOSUB                         NEW
PRINT                                     STOP
INPUT                                     DIM
READ                                     GOSUB
RESTORE                             RETURN
POKE  dec. addr, byte           DOS
GO TO                                     INT( )
IF ..... GO TO                             TAB( )
IF ..... THEN                             ABS( )
LET                                         CHR$( )
REM                                         LOAD
DATA                                         SAVE
NEXT                                         LPRINT
PEEK(dec. addr)                         LLIST

Decimal addresses in the above can be 0 through 16777215, but note that trying to PEEK or POKE a nonexistent address may lead to a BUS ERROR.

Although this Basic allows string constants (as in PRINT "HI"), it does not allow string variables (such as A$). Only one statement per line is allowed, the arithmetic is floating point BCD with nine significant digits, and no exponentiation is allowed. Variable names can be A through Z, and A0 through Z9, but array names can only be A() through Z(); one or two dimensions of 1 through 255 are allowed, but subscripts start with 1, not 0.

LPRINT and LLIST are similar to Print and List, respectively, but output to device 3 instead of the current output device (DEVOUT, usually 0).

This Basic is a modification of the (by now almost classical) 4K Basic written by Robert H. Uiterwyk for the first 6800 machines in the mid seventies. The Basic 6800 version of the interpreter is in the public domain and the original Version 2.1 source code is available in the book "Best of Interface Age, Volume 1: Software in BASIC", published in 1979 by dilithium Press, P.O. Box 92, Forest Grove OR 97116. We greatly recommend this book for further information about this interpreter.

Basic error messages are printed in the form

ERROR: ....... IN LINE xxxx
A description of the error replaces the periods, and the line number identifies the location of the error in the program. If no line number is given, the error occurred in a command or direct execution statement.

UNDELETE

UNDELETE is used to restore files which have been accidentally deleted. UNDELETE can only undelete one file at a time - the last file deleted - but it can be used again to undelete the file before that, and so on.

The syntax for using this command is

SK*DOS: UNDELETE <drive-number.file-name.extension>

where the drive number and file name are required, but the extension defaults to .SCR if not given. If you do not know the correct name of the file, assign some dummy name, undelete the file, and then examine it to see what to rename it to. In any case, undeleted files should be examined to check that they are the desired file.

Depending on the size of the file and the size of the free space, the file may exist in the free space for a long time, or it may be written over quite soon. Hence files should be undeleted as soon as possible. In any case, once the free space of a disk is reorganized with REDOFREE, files can no longer be undeleted.

VERIFY

VERIFY is used to turn floppy disk verification on or off. The correct syntax is

VERIFY ON

or

VERIFY OFF

Normally, SK*DOS defaults to verifying all sectors it writes to a floppy disk. Disk operation, however, will be much faster if verification is turned off.

We feel that verification is desirable - after all, disks do occasionally make errors - and therefore SK*DOS normally has verification enabled unless you specifically turn it off. There are, however, some major manufacturers who feel that verification is not necessary, and whose systems default to verification off.

Although we do not recommend turning verification off, you may wish to do so for specific applications - for example, while using HTOF or while doing a backup. These are cases where you can easily check the accuracy of the new disk by doing a CHECKSUM on it.

For example, here is a way to do a very fast hard disk backup onto floppies by turning off verification:
 

VERSION

VERSION is used to determine the version number of a binary file (if that file has a version number included). All SK*DOS utilities, and most other programs, begin with the sequence of instructions
START   BRA.S  START1
        DC.W   $0102
START1  ...    actual program begins here
so that the third and fourth bytes of the program are the version number (0102 in the above example, which is printed as 1.2). VERSION can be used to check that version code. To use it, type the command VERSION followed by the name of the file, as in
 SK*DOS: VERSION COPY
If not entered, the file name defaults to a .COM extension.

XEQ

XEQ is a memory-resident command used to execute a program previously loaded by SK*DOS using the execution address loaded with the file from the disk (as modified by OFFSET).

If the program requires arguments as part of the calling line, these arguments can be placed after the XEQ. For example, suppose the command CAT 0 is used to display a catalog of a disk in drive 1; the command XEQ 1 would then repeat CAT, but would give it the argument 1 to specify drive 1.

Note that XEQ can only be used to repeat disk-resident programs, not memory-resident programs.
 
 

APPENDIX H. ADDENDA AND OTHER INFORMATION

My favorite law (which I affectionately call Stark's First Law of Computerdom) says "A program without bugs must be so simple that it probably wasn't worth writing in the first place."

It is quite likely that somewhere within SK*DOS lie one or more bugs which have yet to be discovered. If you find one, please let us know and we will exterminate it at once. In any case, be sure to follow the instructions on the User Registration page to be sure that we can contact you with updates if required.

This Appendix provides additional information about SK*DOS which does not seem to fit any other section, as well as addenda or corrections to the manual which are discovered after the remainder of the manual is printed.

1. When SK*DOS is first booted, it looks on the boot disk for a text file called STARTUP.BAT. This batch file may have one or more commands which will be immediately executed as if they had come from the keyboard. For example, if this file contains the text

RAMDISK 4 300K <Y
LIST READ-ME
then SK*DOS will set up a 300K RAMdisk as drive 4, and  then list the contents of the file READ-ME.TXT after it asks for the  date, just before it prints its first prompt.2. The <Y in the first line tells SK*DOS to use the text from the Y.PIP file as keyboard input. As you recall, the Y.PIP file we supply on your system disk contains several dozen Y letters. Since the RAMDISK command normally asks you for confirmation that you really want to set up the RAMdisk, the <Y tells SK*DOS to use one of those Y letters as the answer, rather than waiting for you to answer yourself.

 3. To save memory space (as well as to allow some customization of messages), the one-line explanations printed with error messages are contained in a file called ERRCODES.SYS. Whenever PERROR prints out an error code, it looks on the current system drive for the ERRCODES.SYS file. If that file is present, then PERROR searches for the appropriate error number in that file and prints the text immediately following that number. You may LIST ERRCODES.SYS to see the file format, and may make changes with any editor to suit your taste.

The ERRCODES.SYS file contains error codes above 100, although SK*DOS itself only uses error codes through 30. These higher codes are used for 68K exception vectors. Each line of the file begins with a two-character error code number; in order to allow error codes through 240 to be represented with just two characters, the first digit of codes above 99 must be replaced by its corresponding ASCII character. For example, code 100 is represented by :0 since the colon comes after the 9 in the ASCII code, and thus the colon represents the digits 10.

APPENDIX I. ASM: THE 68000/68010 ASSEMBLER

by Edgar M. (Bud) Pass, Ph.D.

Supplied with SK*DOS/68K by arrangement with,
and Copyright (C) 1987 by
Computer Systems Consultants, Inc.
1454 Latta Lane, Conyers, GA 30207
Telephone Number 404-483-4570/1717

Copyright Notice

ASM, the 68000/68010 Assembler, and this appendix are copyrighted and should not be reproduced in any form, except as described here, without prior written consent of an officer of Computer Systems Consultants, Inc. The accompanying diskette may be duplicated for backup purposes by the original license purchaser. Protecting the software from unauthorized use will protect your access to new good software in the future. Programs such as the ASM assembler would cost each user many hours or many thousands of dollars to develop individually. They may be priced so low only because of the expected large volume of sales. So let your friends pay for their software, too!

Limited Warranty Statement

Computer Systems Consultants, Inc., and its agents, makes no express or implied warranties concerning the applicability of the ASM 68000/68010 assembler to a particular purpose. Liability is limited to the original license cost. This warranty is presented expressly in lieu of all other warranties, expressed or implied, including those of merchantability and fitness for use and of all other obligations on the part of Computer Systems Consultants, Inc. and its agents.

Problems and Improvements

Users are encouraged to submit problems and to suggest or to provide improvements for the ASM assembler. Such input will be processed on a best effort basis. Computer Systems Consultants reserves the right to make program corrections or improvements on an individual or wholesale basis, as required. The company is under no obligation to provide corrections or improvements to all users of ASM. In the case of specific situations requiring extensions to ASM or major assistance in its use, consulting is available on a pre-arranged, for-fee basis.

Introduction

This assembler is used to convert 68000/68010 assembler language mnemonics and expressions to 68000/68010 machine language. The syntax of the assembler language which it accepts is compatible with the standard language as implemented in the Motorola 68000 and 68010 Resident Structured Assemblers. In order to be somewhat more compatible, it accepts several directives implemented only by the TSC 68000 Assembler.

It may also be used to produce machine language for any of the other processors in the 680xx family, although with some limitations. For those processors with instruction sets which are supersets of the 68010 instruction set, such as the 68020 and 68030, only those instructions common to the 68010 and to the superset processor may be generated directly by the 68010 assembler. For those processors with instruction sets which are subsets of the 68010 instruction set, such as the 68000 and 68008, only those instructions common to the 68010 and to the subset processor may be correctly generated by the 68010 assembler; those instructions not in the subset will be treated as invalid instructions by the subset processor. The -m0 option may be specified on the command line to inhibit the incorrect generation of code for subset processors.

This assembler provides an absolute assembler capability, and produces object code directly, without the use of a link-editor. It supports conditional assembly, the use of complex arithmetic expressions, and the inclusion of auxiliary source files.

It optionally produces a formatted listing of the program being assembled. On other than minimum systems, its output includes a sorted cross-reference of the symbols declared and used in the program, and English error messages, as appropriate. A macro pre-processor is available.

Invocation of The ASM Assembler

The ASM assembler is invoked with a command line formatted as follows:
ASM [-/+options] source-file[.ext] [object-file]
in which the following symbols are used:

options represents optional assembler options, as described below; multiple options may be separated or may be joined together; the '+' or '-' symbol must be used to start each group of options.

+B, +b, -B, -b

inhibits the construction of the output object file, which is produced by default; this file normally has the same file name as the main program source file, except that it has suffix ".mxt" (formatted as S-records) or ".com" (formatted as binary records), the details of which are described later in this manual.

+F, +f, -F, -f

inhibits the generation of word-alignment bytes generated when directives which cause odd alignment are followed by directives requiring even alignment.

+Hxxx, +hxxx, -Hxxx, -hxxx

sets listing pagination mode and sets page length to decimal xxx, which may not be less than 24 or greater than 130.

+L, +l, -L, -l

inhibits the generation of the formatted source listing; the source listing may be redirected to disk or printer with command line parameters, as supported by the operating system; vertically formatted and paginated listings may be created with the H option.

+Mx, +mx, -Mx, -mx

indicates type of processor for which code is to be generated: 0 for 68000, 1 for 68010, 2 for 68020, 3 for 68030 (1, 2, and 3 cause the same actions).

+Ox, +ox, -Ox, -ox

specifies name of object file to be produced; it will be suffixed as described above, except for minimum systems.

+Pxxx, +pxxx, -Pxxx, -pxxx

sets width of formatted output lines to decimal xxx; the default is 80, but it may be set to any value between 50 and 132; however, setting the output line width less than 64 will inhibit output formatting.

+S, +s, -S, -s

specifies the generation of the formatted and sorted symbol table listing at the end of the source listing on other than minimum systems.

+Tx, +tx, -Tx, -tx

indicates type of object file to be produced: 0 for S3, 1 for S2, 2 for 02, 3 for 03, 4 for 03+21, 5 for 05, 6 = 05+22 (either 0 or 3 is usually the default option, depending upon the system, but minimum systems allow only 0).

+W, +w, -W, -w

causes the assembler to ignore .L, .W, .l, and .w suffixes on labels within expressions, for compatibility with other compilers.

+Zxx, +zxx, -Zxx, -zxx

sets max symbol length to xx bytes; the default for minimum systems is 8 bytes, and for other systems is 31 bytes.

source-file

specifies the main program source file name; it must meet all requirements for a legal file name for the operating system under which the assembler is used.

ext

represents an optional file extension; by default, this assembler expects a source file name to have extension ".txt", if none is specified.

object-file

specifies the name of the object file to be produced; it will be suffixed as described above, except for minimum systems.

If the assembler detects missing or invalid information specified on the command line, it will output a prompt message indicating the correct format of the command line. On other than minimum systems, this prompt provides summary information on valid command lines.

Assembler Syntax

The input to this assembler is one text file containing a number of lines formatted according to the requirements of the 68000/68010 assembler language. Because of the ability of this assembler to include auxiliary text files, source text libraries may be readily established and used. Whatever the source, the lines may be automatically formatted to separate the label, instruction, and operand fields, whenever the output line is specified to be at least 64 characters in width.

The statements acceptable to this assembler are free-field, one statement per line. Intermediate fields are separated by at least one space or tab, and each line is terminated by a carriage return.

There are three types of statements in the assembler language, as follows:

instruction
directive
comment

Each of these statement types is discussed below.

Instruction Statement

An instruction statement consists of zero to four fields, as follows:
[label[:]] [instruction [operand] [comment]]

Label Field

The label field is optional. It is normally used to provide a symbolic name for the address of the machine code generated by the following assembler instruction. However, labels may also be used as parts of arithmetic expressions to assist in the process of assembling the program. If the label field is omitted, it must be represented by a space. Otherwise, the instruction field would be misinterpreted as the label field.

Labels are composed of characters of which all are significant up to the default number of 8 for minimum systems, or 31 for other systems. Only the first eight characters are displayed on the formatted listing.

The first character of a label must be a letter or period, and the remaining characters must be letters, periods, digits, underlines, and dollars. Lower case and upper case letters are considered unique. Label definitions starting at other than the left margin must end with a colon; however, the colon is not considered to be a part of the label name.

No alignment is normally forced before or after a label's value is set. However, alignment may be forced before a label definition by instructions and by certain types of declaratives, if the label is coded on the same line as the instruction or declarative. In order to ensure label alignment (in cases such as labels not coded on the same line as an instruction), an DS 0 or EVEN directives may be inserted on the line before a label definition, or a label may also be coded on the line with one of these directives.

The following symbols may not be used as labels, since to do so would create ambiguous register references:

These represent the following 68000/68010 registers:

Instruction Field

The instruction field contains the 68000/68010 assembler instruction or directive. It will normally always be present, but if it is omitted, the operand and comment fields must also be deleted. If the instruction field consists only of an asterisk, a comment field may follow the instruction field. Lines containing labels only are allowed, as are totally-blank lines. The program counter is always aligned to an even address before a 68000/68010 assembler instruction.

An instruction name contains no more than seven characters, with upper case and lower case non-unique. The complete set of 68000/68010 assembler language instructions is described in the Motorola 68000 and 68010 Resident Structured Assembler manuals. The set of directives accepted by this assembler is described later in this Appendix.

Those 68000/68010 instructions which require data size specification may be suffixed with length modifiers. These include ".b" for 8-bits, ".w" for 16-bits, and ".l" for 32-bits. If no data length modifier is specified, a ".w" suffix is normally assumed, except for branch instructions, for which a ".l" suffix is assumed. The ".w" suffix default also applies to most directives, except for ORG and RORG, for which a ".l" suffix is assumed.

The suffix ".s" is used to indicate short branch instructions. This assembler will not change short branches to long branches or vice versa, and a short branch to the next instruction will not be changed to a long branch, but will be noted as an illegal instruction.

This assembler will not automatically change add, subtract, or move instructions to their equivalent quick immediate form. Although this would produce faster and smaller object code, it may also produce undesirable results in some cases. The programmer is thus responsible for coding the best form of a desired operation.

Operand Field

The operand field contains zero or more parameters of the instruction. If multiple sub-fields are present, they must be separated by a comma. Only the MOVEM instruction allows more than two operands, but the register list of that instruction must be separated with slashes and hyphens, even if only one register is used. Many instructions (such as MOVE) have two operands, which are designated as source and destination sub-fields, from left to right. The DB types of declarative may also contain multiple sub-fields.

This assembler supports the standard Motorola notation for the 68000/68010 effective addressing modes. They are summarized below.

Comment Field

The comment field consists of any text following the fields described above, but preceding the terminating carriage return on the line. It may contain characters with hex values from $20 thru $7E.

Directive Statement

A directive statement consists of one to four fields, as follows:
    [label[:]] directive [operand] [comment]

Label Field

The label field of a directive follows the same rules provided above. However, a label may be used only with the directives indicated below.

Directive Field

The directive field provides information for the assembler, rather than instructions for the 68000/68010 processor. This information includes such items as the base address of the program, the establishment of symbol values, the allocation of storage, the specification of additional source files to be read by the assembler, etc. A list of the directives implemented by this assembler is provided later in this manual. Lower case and upper case letters in the directive field are not considered unique.

Operand Field

The operand field consists of zero or more sub-fields. Multiple sub-fields are separated with commas.

Comment Field

The comment field consists of any text following the fields described above, and preceding the terminating carriage return. The comment field may be composed of characters with ASCII hex values from $20 thru $7E and tab characters.

Comment Statement

A line which starts with an asterisk is ignored by the assembler except for being optionally listed (along with the remainder of the program). A comment statement may be composed of characters with ASCII hex values from $20 thru $7E and tab characters. A comment statement may be labelled, since the asterisk appears to the assembler in this case to be in the instruction field.

Directives

[label[:]] DC   operand[,operand[,...]]
[label[:]] DC.B operand[,operand[,...]]
[label[:]] DC.L operand[,operand[,...]]
[label[:]] DC.W operand[,operand[,...]]
[label[:]] FCB  operand[,operand[,...]]
[label[:]] FCC  operand[,operand[,...]]
[label[:]] FDB  operand[,operand[,...]]
DC specifies the assignment of one or more values into successive words, bytes, or long words. The suffixes are interpreted as described above for instruction suffixes. A DC.B directive not followed immediately by another DC.B directive will normally have a filler byte inserted, if necessary, to force word alignment. FCB and FCC are equivalent to DC.B and FDB is equivalent to DC.W. Strings must be enclosed in single or double quote symbols.
[label[:]] DS    expression
[label[:]] DS.B  expression
[label[:]] DS.L  expression
[label[:]] DS.W  expression
[label[:]] EVEN
[label[:]] RMB   expression
[label[:]] SPACE expression
DS indicates the reservation of a specified number of words, bytes, or long words, usually without placing values into the locations. No word alignment is forced after any DS directive, although word alignment is forced before DS, DS.L, DS.W, and EVEN directives. RMB is equivalent to DS.B, and EVEN is equivalent to DS 0. SPACE is equivalent to DS.B except that the contents of the locations are initialized to binary zeroes.
END [label]
END indicates the logical end of the assembler language unit, although not necessarily the end of the program, as the assembler will continue to process input until it finds physical end of file. Although the END statement may not be labelled, an optional label may appear as an operand indicating the starting address of the program, and will be placed into the output object file as the transfer address.
ENDC
ENDIF
ENDC and ENDIF indicate the end of the range of an IFxx or IFDEF declarative.
label[:] EQU expression
EQU defines a symbol and sets its value to that of the expression. This operand may contain complex expressions, but not forward references, and once defined by an EQU statement or as a program label, a symbol's value may not be changed.
IFxx expression
IFDEF label
IFP1
IFxx or IFDEF indicates the beginning of a sequence of assembler statements which may be logically conditionally included or excluded from the input to the assembler. The xx indicated above must be replaced by EQ, GE, GT, LE, LT, or NE, in order to indicate the condition (expression xx zero) for the inclusion of the assembler statements, which are terminated by a corresponding ENDC/ENDIF directive. IFDEF includes the sequence of statements if the indicated label is defined. IFP1 includes the sequence on the first pass of the assembler, but excludes it on the second pass. IFxx, IFDEF, and IFP1 statements may be nested to 32 aggregate levels.
INCLUDE filename
LIB filename
USE filename
INCLUDE, LIB, and USE provide the name of an auxiliary source file which is logically inserted into the current source file in place of the INCLUDE, LIB, or USE directive. The file name must follow the conventions required by the host operating system.
LIST
LIST allows the source listing to be produced, unless it is suppressed by an option on the command line.
NOLIST
NOLIST suppresses source listing production.
NOPAGE
NOPAGE suppresses source listing pagination.
ORG   expression
ORG.L expression
ORG.W expression
ORG specifies the starting absolute memory base of the program counter. ORG and ORG.L specify long absolute addresses representing the full range of the address space. ORG.W specifies short absolute addresses restricted to the address ranges $00000000-$00007FFF and $FFFF8000-$FFFFFFFF.
PAGE
PAGE causes the next line on the source listing to appear on the next page.
RORG   expression
RORG.L expression
RORG.W expression
RORG specifies the starting absolute memory base of the program counter, and the generation of program-counter-relative effective addresses. RORG and RORG.L specify long absolute addresses representing the full range of the address space. RORG.W specifies short absolute addresses restricted to the address ranges $00000000-$00007FFF and $FFFF8000-$FFFFFFFF.
RPT expression
RPT specifies the number of times the next line in the same source file will be repeated. The next line is always included at least once, even if the value of the expression is zero.
label[:] SET expression
label[:] = expression
SET defines or redefines a symbol and sets its value to that of the expression. This operand may contain complex expressions, but not complex forward references, and this symbol's value may be changed only by another SET or = directive.
SPC
SPC places a blank line in the source listing.
TTL title
NAM title
TTL and NAM specify the title to be placed at the top of each page in the source listing when pagination is active.

Arithmetic Expressions

Expressions consist of combinations of symbols, constants, operators, and parentheses. Symbols must normally be defined before being used in complex arithmetic expression evaluations. All arithmetic and logical operations are performed using 32-bit two's complement integer arithmetic; division is truncated, and overflows are normally lost. Expressions may be forced into 16-bit mode by enclosing them with '(' ... ').W', or by masking them with $ffff.

Symbols used in expressions include the following:

Program labels and symbols are composed of one to 31 characters, starting with a letter or period, as described earlier in this manual.

Constants may be expressed in decimal, hexadecimal, binary, octal, or ASCII, and are constructed as follows:

Object File Formats

One of the object file types produced by this assembler follows the format of the standard Motorola S-records file. The format of each type of S-record is described below.

The record type field is an 'S' and a digit, interpreted as follows:

The number of bytes to follow is indicated as two hexadecimal digits. If an address or value is to appear in this record, it follows the length field just described; it is represented in hexadecimal. If data appears in the record, it follows the starting address, and is represented in hexadecimal. The one's-complement checksum of all of the items is indicated as two trailing hexadecimal digits.

ASM also produces the following object file types, which are compatible with SK*DOS:
 

leadin address length body comments
$02 2-byte - offset 1 byte data   
$03 4-byte - offset 2 byte data default
$05 4-byte 2-byte data   
$16 2-byte - offset none none xfer address
$18 4-byte - offset none none xfer address, default
$19 4-byte non none xfer address
The naming of the object file produced by ASM is dependent upon the type of object file. The following table provides the extensions:
 
Type
Extension
02 / 03 / 05
.COM
S3 / S2
.MXT

68000/68010 Instruction Syntax

The syntax of the assembler language accepted by this assembler is compatible with the standard language as implemented by the Motorola 68000/68010 Resident Structured Assemblers.

Upper and lower case letters in instructions are not considered unique. For those instructions with length modifiers, the suffix ".w" will usually be assumed if none is provided in the instruction field. Branch instructions must be coded with ".s" to indicate short branches or with ".l" or without suffix to indicate long branch instructions. A short branch to the next instruction is invalid and will not be changed to a long branch. For unsized instructions, length modifiers are generally ignored.

Certain instructions (ADD, AND, CMP, EOR, MOVE, NEG, OR, and SUB) have variations in their basic operation codes beyond length modification. The following variations are normally handled by this assembler, but may be coded explicitly, as follows:

Other variations must be coded explicitly (as the assembler has no manner in which to determine that they were desired), as follows: For the MOVEM instruction, if only one register is present in the register list, it must appear as Dx-Dx, Ax-Ax, Dx/Dx, or Ax/Ax. The syntax of the MOVEM requires a register list, not a register.

The BKPT, MOVEC, MOVEM, and RTD instructions and the MOVE CCR,... and MOVE ...,CCR variants of the MOVE instruction are invalid when the 68000 option (-m0) is chosen on the command line, as these are all 68000/68010 instructions.

Error Messages

Most error messages are self-explanatory; however, all of them are briefly explained in the list below. For minimum systems, only error numbers are output by the assembler.

19 Assembler error - An internal error in the assembler has been detected, probably caused by syntax errors in the statement.

07 Bad 16 bit displacement - The displacement value is less than -32768 or greater than +32767.

25 Bad 16 bit displacement range - The displacement value is less than -32768 or greater than +32767.

11 Bad 16 bit extension - The extension value is less than -32768 or greater than +32767.

02 Bad 3 bit value - The quick immediate data value is not in the range 1 to 8, or the specified breakpoint number is invalid.

03 Bad 32 bit field specifier - The bit field value specifies a bit outside of a long word.

31 Bad 4 bit value - The specified vector number is invalid.

08 Bad 8 bit displacement - The displacement value is less than -128 or greater than +127.

26 Bad 8 bit displacement range - The displacement value is less than -128 or greater than +255.

12 Bad 8 bit extension - The extension value is less than -128 or greater than +255.

15 Bad 8 bit field specifier - The bit field value specifies a bit outside of a byte.

22 Bad 8 bit operand - The operand value is less than -128 or greater than +255.

01 Bad address displacement - The displacement is out of range for the effective address type.

06 Bad count operand - The immediate shift count is less than 1 or greater than 8.

10 Bad destination effective address - The destination effective address type is invalid for this type of instruction.

09 Bad destination indexed address - The indexed destination effective address type is invalid for this type of instruction.

13 Bad effective address - The effective address type is invalid for this type of instruction.

14 Bad expression format - The expression is badly-formed or contains a space.

27 Bad expression range - The address expression has a value outside the short addressing range.

18 Bad instruction field - The item in the instruction field cannot be recognized.

20 Bad label usage - The directive statement may not be labelled.

xx Bad library file ... - The indicated library file could not be found.

21 Bad multiple destination - The operand specifies registers not allowed in a multiple destination list.

xx Bad object file ... - The indicated object file could not be created.

16 Bad operand 1 for instruction type - The first operand is improper for this instruction.

04 Bad operand 1 format - The first operand has been coded incorrectly.

17 Bad operand 2 for instruction type - The second operand is improper for this instruction.

05 Bad operand 2 format - The second operand has been coded incorrectly.

23 Bad operand format - The instruction operand field is badly-formed or contains an unintended space or other illegal character.

xx Bad source file ... - The indicated source file could not be found.

xx Library file nest error ... - The indicated library file could not be included, as the nest level is too deep (usually 3 for minimum systems and 12 for others).

24 Phasing error - The non-redefinable symbol has been found to have a different value on the second pass as it had on the first pass of the assembler; This is often due to conditional assembly including different text on the two passes or due to other syntax errors in the assembly text.

28 Redefined symbol - The symbol defined in other than a SET statement has been redefined.

30 Symbol table overflow - The table which contains the program labels has been filled to capacity. Attempt to reduce its size with the Zxx command line option, reduce the number of labels used in the program, reduce their lengths, or divide the program into smaller parts.

29 Undefined symbol - The symbol is used in an expression or in a context which does not allow forward references or is not defined in the program.

USER REGISTRATION AND UPDATE POLICY

In order to register as an authorized user of this product, and to receive updates if any are required, please

1. Fill out and return the Registration Form below to

Star-K Software Systems Corporation

P. O. Box 209

Mt. Kisco, N. Y. 10549

2. Enclose a self-addressed stamped envelope with the name and version of this product written in the lower left corner; we will keep the envelope on file, and use it to notify you of any updates that may be necessary.

3. Note that registration of your purchase is extremely important. We at Star-K stand behind our products, and make great efforts to let our customers know of updates and extensions to their programs. But to make this work, we ask that they send in their registration forms and envelopes. We do not maintain a separate mailing list, and will not notify our customers unless we have this material on file.

4. When we receive your registration, you also become eligible to download software updates from the Star-K BBS at (914) 241-3307.