LT. KERNAL DOS COMMANDS - Version 7.2

DIRECT-MODE FEATURES and COMMANDS


 (DOUBLE UP ARROW) command (double Up Arrow)

Syntax:  (DOUBLE UP ARROW)

The "Double UP Arrow " command restores all your CONFIG'd DEFAULTS for the CPU mode under which you are presently operating.

This is provided as a quick and easy way to return to your 'home' LU/User and colors when you have moved elsewhere on the system, or when a 'break' has changed your screen colors.


ACTIVATE command

Syntax: ACTIVATE

ACTIVATE totally erases an existing logical unit and creates a new 'BAM'. and 'INDEX'. ACTIVATE also gives you the opportunity to create a DOS IMAGE FILE to enhance operating speed on LU's physically distant from the DOS LU (lu 10).

DO NOT USE THIS COMMAND UNTIL YOU HAVE THOROUGHLY READ AND COMPLETELY UNDERSTAND THE ACTIVATE and CONFIG PROCESSES.

ACTIVATE must be run ONLY AFTER the LU 'type' has been assigned via CONFIG.


AUTOCOPY command

Syntax: AUTOCOPY

This self-documenting command allows you to rapidly copy multiple files across LU and USER boundaries.


AUTODEL command

Syntax: AUTODEL

AUTODEL is self-documenting, and allows you to rapidly delete multiple files from a specified lu/user area. If you wish to delete ALL files from an existing LU, ACTIVATE is faster.


AUTOMOVE command

Syntax: AUTOMOVE

AUTOMOVE is a self-documenting command which allows you to rapidly MOVE files from one USER sub-directory of an LU to another USER sub-directory of the same LU.


BUILD command

Syntax: BUILD__filename,nrecs,recl

filename is any legal 1541 filename

nrecs indicates the number of records to be formatted (65535 max)

recl indicates the length in bytes of each record (3072. max)

The maximum allowable size of any one file on the Lt. Kernal system is 32768 hard disk blocks of 512 bytes, or 16.78 megabytes.

BUILD is similar to the 1541 RELative-file formatting function in that it creates a relative file 'formatted' with a number of fixed length records. Unlike the 1541 which requires that you OPEN and POSITION within a relative file to format it, BUILD is a direct mode command, and is EXTREMELY FAST.

The Lt. Kernal will also format a relative file using the 1541 OPEN and POSITION syntaxes, but more slowly than when using BUILD.


BUILDCPM command

Syntax: BUILDCPM

BUILDCPM sets up necessary machine status to construct a CP/M operating system on the CP/M DEFAULT LU you have previously defined via CONFIG.

You must have previously defined a CP/M default LU, and MUST

have ACTIVATEd it prior to invoking BUILDCPM.

You must be in the 128 mode to invoke BUILDCPM. Please refer to Section 'Using CP/M on the Lt. Kernal' prior to using this command.


BUILDINDEX command

Syntax: BUILDINDEX

BUILDINDEX builds a KEY file with up to five DIRECTORIES of keys. Necessary information about the file will be requested by BUILDINDEX as required.

You will first be requested to supply the name of the new KEY file to be built.

You will then be requested to specify how many DIRECTORIES (lists of keys) the file will hold. Once a KEY file is built, the number of directories within it may not be changed. You must build at least one directory, and you are limited to five within any one KEY file.

You will be requested to supply the KEY LENGTH for each directory. This specifies the permanently fixed length of the key strings contained within each of the directories. Each directory's key length may be different and may range from I to 30 characters.

Once you have supplied the key length for the last directory specified, BUILDINDEX will create the KEY file.


CHANGE command

Syntax: CHANGE__ [lu:][user:]filename

CHANGE allows you to change several characteristics of a file. You may CHANGE the:

Filename

User number

Load address

'Dirty flag' (archiving bit)


CHECKSUM command

Syntax: CHECKSUM

CHECKSUM totally checks the integrity of the DOS on LU 10 and forces an UPDATEDOS of all LU's on which Lt. Kernal DOS image files exist.


CLEAR command

Syntax: CLEAR

CLEAR permits you to clear the 'dirty-flags' of all files in a specified LU/USER area. CLEAR will request the LU and USER parameters from you at the appropriate time. To clear the dirty-flag for a single file, use the CHANGE command.

Dirty-flags (archiving bits) are the mechanism the Lt. Kernal uses to do archival backups to floppy disk. Whenever a file is either created or modified, the Lt. Kernal sets a 'flag' bit in that file's directory entry saying that the file has been modified. Only performing a backup copy of the file via FASTCOPY, or executing the CLEAR command will erase that bit. Files with the archiving bit set may be selectively listed with DIR by using the C option.


CONFIG command

Syntax: CONFIG

CONFIG allows the user to establish custom system characteristics for the Lt. Kernal.

System characteristics affected are

In addition to all these things, in a multi-user system, the 'master' user may configure these items for EACH of up to 16 separate CPU's connected to the system. CPU's OTHER than the 'master' may only change their OWN CONFIG parameters.

The following is a list of the default parameters:

LU# Beg. Cyl # of Cyl

DOS 0000 30

0 0030 200

1 0230 200

2 0430 166


COPY command

Syntax: COPY___["][lu:][user:] [newfilename] = [lu:][user:]oldfilename["]

Mode: Direct or Run

COPY creates a new file copied from oldfilename into newfilename. Copy will copy files across logical unit (logical drive) boundaries to the currently active subdirectory (user#)

The syntax in RUN mode is:

OPEN Ifn,dev,15,"C[lu]:destfile=[lu:]sourcefile"

Note that almost all the COPY parameters are optional. Several syntaxes will accomplish a COPY of a file.

1. COPY THISFILE=THATFILE

will copy the file named THATFILE into a new file called

THISFILE on the logical drive on which you are currently

working.

Now assume that you are 'logged' (working) on LOGICAL DRIVE #1 and working in User sub-directory 12 (1:12:).

  • 2. COPY 2:THISFILE=THATFILE

    will copy the file named THATFILE from logical drive 1 into a new file called THISFILE on logical drive #2, User #12 (2:12:).

    3. COPY 2: =THATFILE will copy the file named THATFILE from logical drive 1 into a new file of the SAME name on logical drive #2, subdirectory 12.

    4. COPY 2:10:=3:5:THATFILE

    will demonstrate the ability to copy from and to logical drives on which you are NOT logged. The syntax above will copy THATFILE from logical drive #3 subdirectory #5 to logical drive #2, subdirectory #10 even though you are currently working on logical drive #1, user 12.

    5. COPY =3:THATFILE

    will copy THATFILE from logical drive #3 to your currently logged logical unit (2) and currently working subdirectory (12).

  • The optional quotation marks in the syntax definition for COPY are allowed so that graphics characters may be included in the filenames.


    D command

    Syntax: D[-drvnum]

    drvnum is the desired hardware device number of the hard disk

    D is used to temporarily change the device number of the hard disk from the CONFIGured default. D typed without a drive number will cause the device number to revert to the power-on default.


    DEL command

    Syntax: DEL-line number or

    DEL-[beg.line]-[end. line]

    DEL deletes BASIC program lines in memory. When the hyphen is used to indicate a range-delete, at least one line number must be given, (either beginning or end) to satisfy the range calculation.


    DI command

    Syntax: DI

    DI (display index) is a self-documenting command. DI displays all of the active keys in the directories of a KEY file.

    FILE TYPE DEFINITIONS

    The Lt. Kernal DOS supports the Commodore conventions for file type, such as "SEQ", "REL", etc., but uses within its own operations a more finely divided set of file definitions. Each Lt. Kernal file type is assigned a numeric type. The types are:

    TYPE DEFINITIONS

    1 CONTIGUOUS DOS system file

    2 CONTIGUOUS DOS system processor

    3 RANDOM DOS external system

    4 KEY file for indexed RELative files

    5 - Type 5 is an User-Defined Contiguous data file

    6-10 UNASSIGNED

    (Note: File types 11 - 15 are Contiguous Block structure.)

    11 BASIC language program file

    stored block-list random

    12 MACHINE LANGUAGE program file (Binary file, typ. M/L)

    stored block-list random

    13 SEQUENTIAL FILE (i.e. editor text)

    stored block-list random

    14 USER FILE

    15 RELATIVE FILE


    DIR command

    Syntax: DIR__[[lu:[user:]]:[Tfiltyp][P][S[A][G][C]__][filename]

    DIR is a powerful directory command that allows a directory of the hard disk to be listed or optionally printed. Listings based on file type or file name matches with wild-cards and don't-care characters are supported. You may use either trailing OR leading wildcards in the filename specification. The options are:

    lu requests the logical drive # from which the DIRectory will be read user requests the subdirectory on the requested lu.

    Tfityp (type) filtyp is the numeric hard disk file type.

    P (print) causes the listing to be printed

    S (sort) causes the listing to be alphabetized

    A (all users) lists from all subdirectories on the requested LU

    G (global) lists from all subdirectories of ALL LU's

    C (changed) lists only those files Changed or Created since the last backup or CLEAR command was issued. The directory listing for any file which reflects a 'changed' status will have an exclamation (!) mark appended to the end.

    The options may be used singly or combined in any order except that the ':options' field must precede the file name specification, and that the G and A options override the optional user #, and G automatically implies the A option.

    Examples:

    DIR - causes a screen listing of all hard disk files in the current LU/USER area in which you are operating.

    DIR :P - causes a printed directory of all hard disk files in the current subdirectory and LU.

    DIR 1:4: MYFI - causes a directory of all files on LU I under subdirectory #4 whose names begin with the sequence 'MYFI'. Note that the trailing '*' is IMPLIED, and does not need to be entered.

    DIR T4A - causes a directory of all type 4 (KEY) files in all subdirectories of the current LU.

    DIR :SG - causes a directory of ALL files on ALL LU's to be listed in alphabetic order.

    DIR *.ASM - causes a directory of all files whose names contain the string '.ASM' anywhere after the first character.

    DIR :C - causes a directory from the currently active LU and USER subdirectory of all files which have been Created or Changed since the last backup or CLEAR.

    -FULL OPTIONS EXAMPLE-

    This example uses all the options which may be meaningfully combined.

    Example:

    DIR : T11SPGC ?YFIL* - causes an alphabetized, printed directory of all BASIC programs on the hard disk which were created or modified since the last backup or CLEAR, the first character of whose names we do not care and whose names' next four characters are 'YFIL'.


    DUMP command

    Syntax: DUMP-[range__][lu:]seqfile

    Range is the range of basic lines to dump in the form startline#-endline#.

    seqfile is the filename of the desired new text file to be created.

    DUMP causes a new sequential file to be created then writes the detokenized version of the BASIC program in memory into the sequential file.

    DUMP turns BASIC programs into editable text files and also functions in both C-64 and 128 modes.

    Example:

    DUMP 200-250 1:myfile would cause current BASIC lines 200 through and including 250 to be written to the SEQuential file MYFILE on hard disk logical unit 1.


    ERA command

    Syntax: ERA__[lu:[user:]]filename

    ERA erases (scratches) the NEXT file from the hard disk which qualifies according to the filename given. If the user: field is not sup plied, then the file MUST exist on the currently active subdirectory, the message "FILE BELONGS TO ANOTHER USER" will be issued, and the ERAse will be aborted.

    The 'pattern-match scratch override' discussed in CONFIG will not cause ERA to delete multiple files. If you wish to delete several files at once, then the AUTODEL command should be used.


    EXEC command

    Syntax: EXEC_[lu:[user:]]filename

    filename may be any valid TEXT file stored as PRG, USR, or SEQ formats.

    EXEC provides an easy and natural way to automate procedures which otherwise would have to be performed manually.

    EXEC performs the commands and statements contained in the file as if they had been typed from the keyboard. EXEC files may contain any characters which are legal to be typed from the keyboard. "Normal" lines of text such as commands or lines of BASIC code should be terminated with carriage returns. This is how most wordprocessors store text.

    EXEC is a direct-mode command which can supply input to running programs and/or other direct-mode commands. EXEC may not work properly with types of programs that "clear" the input buffer before proceeding to the next input.


    FASTCOPY command

    Syntax: FASTCOPY

    FASTCOPY is a self-documenting, menu driven file copy and backup/restore utility. FASTCOPY will only work properly on a Commodore 1541/1571 disk drive (or fully compatible clone).

    The 1541/1571 disk drive MUST be assigned Drive #8 for FASTCOPY to function.

    FASTCOPY will allow you to

    • BACKUP your hard disk or an LU/USER area of your disk to diskettes rapidly

    • RESTORE your hard disk or an LU/USER area from diskettes rapidly.

    FASTCOPY will report any floppy diskette errors encountered during the copy process, but DOES NOT REPRODUCE DISKETTE ERRORS ON THE DESTINATION DISKETTES. It is not intended for use as a 'protected-disk' copier.


    FETCH command

    Syntax: FETCH [lu:]filename

    filename is a SEQuential text file image of a BASIC program (created via DUMP).

    FETCH causes a text image of a BASIC program to be reloaded into memory in tokenized form for SAVEing as an actual program file. FETCH is the reciprocal command to DUMP.

    The use of these two commands in conjunction with one another allows the programmer to utilize the features of a text editor to revise and edit BASIC programs. The FETCH command functions for both the C-64 and 128 BASIC.

    For example: FIND /GOTO 650/,100-650 will find any occurrence of GOT0650 between and including lines 100 and 650.


    FIND command

    Syntax: FIND delimSTRINGdelim[<line-range>

    Both delim characters are the same and NOT included in STRING.

    FIND searches for and lists lines of BASIC in which the STRING is found.

    FIND will find combinations of TEXT and TOKENIZED BASIC and ignores useless space embedded in BASIC command.


    GO64 command

    Syntax: G064 or GO 64

    Mode: 128 direct

    G064 sends the CPU to the C-64 mode of operation, and sets the system parameters to the CONFIGed defaults for the C-64 mode.


    GO128 command

    Syntax: G0128 or GO 128

    Mode: C-64 direct on 128's only

    G0128 sends the CPU to the 128 mode of operation., and sets the system parameters to the CONFIGed defaults for the 128 mode.


    GOCPM command

    Syntax: GOCPM

    Mode: C-64 or 128 direct on 128s only

    GOCPM sends the CPU to the CPM mode of operation IF a CP/M LU has been defined and activated, and IF a CP/M operating system has been built on the LU.


    ICQUB (Image - Capturing Quick Utility Backup) command

    Syntax: ICQUB or filename

    filename is the name of an auto-loader built by the ICQUB utility.

    ICQUB (pronounced 'icecube') permits you to capture and save to the hard disk certain copy protected software.

    SOFTWARE CAPTURED BY ICQUB CANNOT BE USED ON ANY OTHER COMMODORE COMPATIBLE DISK DRIVES.

    ICQUB functions only in the C-64 mode. ICQUB is designed NOT to be a 'pirating tool'. The 'copies' it creates of the protected software require the Lt. Kernal hardware to be present in order for them to run.

    ICQUB does allow you to back up many of your own(ed) copy protected software packages on the Lt. Kernal. It does so by allowing you to load protected software into your computer from a floppy disk, then capturing a running image of the program. This technique will not allow you to run software which periodically re-checks its protection scheme, unless you are willing to have the protected disk in your floppy disk drive continually while using the captured copy.

    Since ICQUB actually snap shots a running program, some software which appears not to work when ICQUB'd may work if you choose another time or stage of operation at which to capture the copy. Once a working copy is captured, it should work every time. Don't give up on a package just because your first try didn't produce a working program. Most software will ICQUB on the first try - but not all packages will.

    ICQUB is simple to use, and for the most part it is self-documenting. Be sure that you are logged on to the LU on which you wish the capture to take place before invoking ICQUB.

    When you type the ICQUB; command, you will be presented with a menu. You may:

    • Select from ICQUB; files already on any LU

    • Run the 'current' (last) capture file on this LU

    • Assign a new name to the current capture file on this LU

    • Capture a new program via ICQUB on this LU

    • Return to Basic

  • OPTION #1 You will be presented with a files list similar to that which AUTODEL and AUTOCOPY produce from which to select your program. From this list you will also be permitted to select a file for which to build an 'auto-loader'. Once built, the auto-loader may be directly invoked just by typing its name at the READY prompt.

    OPTION #2 You can test the current ICQUBCAPTUREFILE without bothering to search the list above.

    OPTION #3 You may give ICQUBCAPTUREFILE a new name. Actually, ICQUBCAPTUREFILE is copied into the new file so that ICQUBCAPTUREFILE will not have to be re-built for option #4. The new filename will be your own selected 12 character name followed by the suffix -.ICQ- (i.e. MYFILECAPTUR.ICQ).

    OPTION #4 You may capture a new program into ICQUBCAPTUREFILE. If ICQUBCAPTUREFILE does not exist on the currently logged LU when you select this option, it will be built. It may take as long as a minute to allocate capture space. Once the space is allocated, the computer will seem to 'reset'. and return to a normal power-up screen, as if the Lt. Kernal were NOT present.

  • This is the point at which you LOAD your protected software from the floppy disk. When the program has progressed to the point at which you wish to capture it, press the ICQUB button on your Lt. Kernal Host Adapter. When the capture is complete, the Lt. Kernal will return to control.

    Here's a brief hint on capturing. The ICQUB button performs much the same function as the RESTORE key on your computer. An example will show you how that affects captures.

    Let's say you have a wordprocessor running which always returns to its 'main menu' when you press RUN/STOP and RESTORE simultaneously. The proper way to capture that software would be to allow it to get to a point where you COULD return to the main menu, then to hold down RUN/STOP and instead of pressing RESTORE, to then press the ICQUB button.

    When the captured version is run, it will go directly to the main menu! You will have to experiment. Each software package ICQUB's a little differently.

    OPTION #5

    You may return to BASIC. Things will be a little 'messed-up' if you attempt to get back to BASIC any way other than via option #5, and you'll probably have to reset your computer to get back to proper operation.

    NOTE: Make sure your screen border color is NOT black or you will get a blank screen. Use CONFIG to change to any other color.


    invoke (feature)

    Syntax: [lu:][user:]filename

    Any legal filename typed beginning in the first column of the screen will cause the system to attempt to load and execute that file. The INVOKE feature works for both BASIC and machine language programs. Simply type the program's name, followed by a carriage return.


    L or LOAD command

    Syntax: LOAD " [lu:][user:] filename",dev[,sa]

    dev is the drive selected

    sa is the secondary address where

    0 or none = BASIC load

    and 1 = machine-language load

    in the Direct-Mode, LOAD may be abbreviated to

    L_["][lu:]filename["]

    with optional quotation marks about the name and without specifying either device number or secondary address.

    when used in this abbreviated syntax, LOAD will load the file at its correct load address depending on the file type.

    Example: L 1:MYFILE - LOADs the program MYFILE from the hard disk logical unit #1.


    LKOFF command

    Syntax: LKOFF

    LKOFF turns off the Host Adapter and puts the computer in the mode being used (C-64 or 128). It allows direct computer use without disconnecting the Lt. Kernal. To go back to your Lt. Kernal, do a system reset.


    LKREV command

    Syntax: LKREV

    LKREV reports the Lt. Kernal DOS Version number and release date.


    LU command

    Syntax: LU[_lunumb]

    lunumb is the number of the logical unit on which you wish to begin operation.

    lunumb may range from 0-10 decimal.

    LU typed without a number following will log you onto the power-on default logical unit specified in CONFIG.


    MERGE command

    Syntax: MERGE_[lu:]filename

    filename is the name of any disk-resident BASIC program file.

    MERGE can actually merge or interleave the lines of the specified ~BASIC file on disk with the BASIC program currently in memory. If you wish to append basic files using MERGE, RENUMber one or both programs first so that the line numbers of the two do not conflict with or interleave one another.

    In the case of lines of the disk based program duplicating line numbers of the program in memory, the lines from disk will replace lines of the same numbers in memory.

    Merge presently functions only in the C-64 mode.


    OOPS command

    Syntax: OOPS

    OOPS will attempt to recover the LAST file ERAsed, SCRATCHED or SAVEd with replacement on the currently logged logical unit into a new file named OOPSFILE#. The # character will be replaced with a digit from I to 9. Up to 9 OOPSFILEs may be created before you MUST rename or delete some of them.

    If any disk activity has taken place that makes it impossible to recover the last file deleted. OOPS will report the file as unrecoverable. Only the LAST file deleted is ever OOPSable.

    It is important to remember that any SAVE or OPEN for writing or appending AFTER a file is accidentally SCRATCHED or ERAsed will make it impossible to recover the file via OOPS.


    QUERY command

    Syntax: QUERY-[lu:]filename

    QUERY will tell you all the pertinent information about the file requested. Depending on the file type of the file, the following file characteristics may be described:

    File size (hard disk blocks) LU

    USER # Lt. Kernal numeric file type

    Commodore convention file type Hard disk file header address

    # records (REL files) Record length (REL files)

    load address keys/directory (KEY files)

    # directories (KEY files) of active keys (KEY files)


    RECOVER command

    Syntax: RECOVER

    RECOVER builds the Index on the selected LU. The old 'system index' file is deleted, then the entire LU is scanned for legitimate files. Each file found during the scan has its name placed in the new index.

    After the scan, validate is automatically run to check the integrity of the new index and to rebuild the Bitmap for that LU.


    RENUM command

    Syntax: RENUM[__incr[.newstart[,oldstart-oldend]]]

    incr is the desired line increment over the RENUMbered range of lines.

    newstart is the line number to be assigned to the first line of the RENUMbered range of lines.

    oldstart-oldend is the range of OLD line numbers which you wish to be RENUMbered. At least the hyphen and one old line number are required to satisfy the range option.

    i.e. 10-500 (all lines between and including 10 and 500)

    or -350 (all lines from the start of the program up to and including line 350)

    or 510- (all lines after and including line 510)

    If you specify a SINGLE line number without the hyphen, the effect would be as if you had typed the range 'oldstart-63999'.

    if no options are specified, the defaults will be set as if you had typed:

    RENUM 10, 10,0-63999

    RENUM will renumber a BASIC program currently in memory. If no options are specified, the entire program will be renumbered. The renumbered program will begin with line 10 and line numbers will increment by 10.

    The options provide extremely powerful editing capabilities to BASIC. Proper use of the options will even allow blocks of code to be moved within a BASIC program.

    Any error in GOTO or GOSUB targets which would make renumbering impossible will cause an error message along with a listing of the line in which the error occurred. If any fatal renumbering error does occur. the BASIC program will be returned unmodified so that you may more easily debug the error. RENUM does not recognize the GO TO variant of GOTO.

    RENUM is very fast. A typically organized BASIC program 24 Kbytes long takes about 14 seconds to renumber. Most BASIC programs are not nearly that long, and routine RENUMbering of short programs is almost instantaneous.

    RENUM will NOT preserve a machine language tail on the end of a BASIC program. If you do RENUMber this sort of 'hybrid' program, you will have to manually re-link the machine language portion of it. Also. RENUM uses all of the BASIC space and parts of the memory under the BASIC ROM for line and target buffers. Any programs resident in those areas at RENUMber time will be destroyed.

    The options are powerful enough to be somewhat dangerous if used improperly, so some examples of RENUMber's use are appropriate. Here is a review of the RENUM syntax.

    Syntax: RENUM[-incr[,newstart[,oldstart-oldend]]]

    example 1. RENUM

    Typing just RENUM without options will renumber the entire BASIC program in memory to a beginning line number of 10 and with line numbers incrementing by 10.

    example 2. RENUM 1

    will renumber the entire program to a beginning line number of 10 and with line numbers incrementing by 1.

    example 3. RENUM 2,5000

    will renumber the entire program to a beginning line number of 5000 with line numbers incrementing by 2.

    To demonstrate this command, the program:

    10 REM THIS IS A LINE NUMBERING EXAMPLE

    12 GOTO 15

    15 PRINT "HELLO"

    30 LET A=I:PRINT A:GOTO 10

    would be renumbered to this:

    5000 REM THIS IS A LINE NUMBERING EXAMPLE

    5002 GOTO 5004

    5004 PRINT "HELLO"

    5006 LET A= LPRINT A:GOTO 5000

  • example 4. RENUM 1,10,5000-5004

    To demonstrate this command, the program:

  • 5000 REM THIS IS A LINE NUMBERING EXAMPLE

    5002 GOTO 5004

    5004 PRINT "HELLO"

    5006 LET A=PRINT A:GOTO 10

    5008 END

    would be renumbered to this:

    10 REM THIS IS A LINE NUMBERING EXAMPLE

    11 GOTO 12

    12 PRINT "HELLO"

    5006 LET A= LPRINT A:GOTO 10

    5008 END

    EXACTLY the same effect could have been produced by typing:

    RENUM 1,10,-5004

    You could complete the renumbering of the last result by typing:

    RENUM 1,13,5006

    which would yield:

    10 REM THIS IS A LINE NUMBERING EXAMPLE

    11 GOTO 12

    12 PRINT "HELLO"

    13 LET A~I:PRINT A:GOTO 10

    14 END

    EXACTLY the same effect could have been produced by typing

    RENUM 1,13,5006-5008 or RENUM 1,10

    Now on to the very powerful and somewhat DANGEROUS subject of moving lines via RENUM. You can actually edit your BASIC programs using the full options list of RENUM to cause groups of lines to be moved elsewhere in the program, but some cautions need to be kept in mind.

    FIRST, if you plan to move lines about in your program, SAVE a current copy to disk before you start the changes. It is possible to accidentally overwrite lines by mis-specifying options.

    SECOND, if you actually PLAN to overwrite some lines, remember that the lines PHYSICALLY encountered LAST in the renumbering process will overwrite any lines of the same numbers which were encountered earlier. Some examples will clarify this process.

    example 5. Take the following program:

    10 GOSUB 70:PRINT A

    20 PRINT "THIS IS A BLOCK-MOVE EXAMPLE"

    30 INPUT A

    40 PRINT A

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    70 PRINT "THIS IS A FAVORITE SUBROUTINE OF MINE"

    80 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    90 PRINT "AREA OF THE PROGRAM"

    100 A=O:RETURN

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    typing RENUM 1,5000,70-100 would yield:

    10 GOSUB 5000:PRINT A

    20 PRINT "THIS IS A BLOCK-MOVE EXAMPLE"

    30 INPUT A

    40 PRINT A

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    5000 PRINT "THIS IS A FAVORITE SUBROUTINE OF MINE"

    5001 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    5002 PRINT "AREA OF THIS PROGRAM"

    5003 LET A=0:RETURN

    The lines from 70 through 100 actually moved. Be careful, though, because. this process could also modify your program's flow.

    We could INTENTIONALLY overwrite part of the program like this:

    Taking the same original program as above:

    10 GOSUB 70:PRINT A

    20 PRINT "THIS IS A BLOCK-MOVE EXAMPLE"

    30 INPUT A

    40 PRINT A

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    70 PRINT "THIS IS A FAVORITE SUBROUTINE OF MINE"

    80 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    90 PRINT "AREA OF THE PROGRAM"

    100 A=O:RETURN

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    Typing RENUM 10,10,70-100 would yield

    10 PRINT "THIS IS A FAVORITE SUBROUTINE OF MINE"

    20 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    30 PRINT **AREA OF THE PROGRAM

    40 A =0:RETURN

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    Note that the original lines 10-40 were overwritten by old lines 70-100. More specifically, since lines 70-100 were encountered LAST in the program with the new line numbers 10-40, they took precedence. and overwrote any earlier encountered lines of the same numbers.

    As a final example of the same effect, let's take example 5 program once more:

    10 GOSUB 70:PRINT A

    20 PRINT "TIES IS A BLOCK-MOVE EXAMPLE"

    30 INPUT A

    40 PRINT A

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    70 PRINT -THIS IS A FAVORITE SUBROUTINE OF MINE

    80 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    90 PRINT "AREA OF THE PROGRAM"

    100 A=O:RETURN

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    Typing RENUM 10,70,10-40 would yield:

    50 IF A< 10 THEN GOTO 110

    60 GOTO 120:REM JUMP OVER SUBROUTINE

    70 PRINT "THIS IS A FAVORITE SUBROUTINE OF MINE"

    80 PRINT "WHICH I SHOULD REALLY MOVE OUT OF THIS"

    90 PRINT "AREA OF THE PROGRAM"

    100 A=O:RETURN

    110 PRINT "A IS LESS THAN 10"

    115 GOTO 130

    120 PRINT "A IS GREATER THAN OR EQUAL TO 10"

    130 END

    The lines 10-40 WERE actually renumbered to the range 70-100, but since other lines of the same range were encountered LATER in the renumbering process, they were replaced.

    We could have protected against accidental overwriting of lines, but the power of having that capability strongly outweighs the dangers. We do suggest, though, that you be VERY careful with the range option of RENUM until you become comfortable with what it can do.

    Any time lines are moved with RENUM, the message

    'RE-ORDERING DISPLACED LINES'

    will appear. If the program is quite large and the lines have moved to very near the beginning of the program, the re-ordering process could take several minutes.

    RENUM presently functions only in the C-64 mode. The 128 has a built-in renumber function.


    S command

    Syntax: S

    The S command is a special direct-mode implementation of SAVE. S allows easy and fast re-saving with replacement of a BASIC program presently being edited.

    For any BASIC program which has been LOADed (via LOAD or the L command) and edited, merely typing S and carriage return will cause the program to be re-SAVEd under the original file name. Also see SAVE command for the abbreviated S syntax with a file name supplied.


    SAVE command

    Syntax: SAVE "[<range >][lu:]filename",dev

    dev is the disk selected onto which to save the file.

    SAVE may be abbreviated in the Direct-mode to:

    S-["][< range >][lu:]filename["]

    with optional quotation marks about the filename and without specifying the disk's device number.

    Where <range> is specified, the range may be stated either in hexadecimal or decimal and is an INCLUSIVE range.

    Examples:

    S < $20004000 > MYFILE -saves the area memory from Hex 2000 through and including Hex 4000 to the hard-disk.

    SAVE "<1024-4096>MYFILE",8 -saves the area of memory from decimal address 1024 through and including location 4096 to drive #8.


    SHIP command

    Syntax: SHIP

    SHIP causes the hard disk's heads to be moved to the proper zone for shipping. THIS COMMAND MUST BE EXECUTED PRIOR TO MOVING OR SHIPPING YOUR HARD DRIVE.

    Simply type SHIP and carriage return, and wait for the drive message, "PREPARED FOR SHIPPING" to appear. WAIT an additional 30 seconds and then turn your Lt. Kernal OFF. This 30 seconds of inactivity will completely park the head of the Miniscribe drives.

    You may then transport the system.

    In a multi-drive system, SHIP parks the heads of ALL drives.

    If you have a 40 Meg drive, the head will park itself when you turn off the power to the drive (as well as most newer SCSI-1 hard drives).


    TYPE command

    Syntax: TYPE__[lu:]filename

    TYPE causes any file specified in the filename to be listed to the screen WITHOUT disturbing the present contents of BASIC memory.

    The TYPE command is very valuable for extracting portions of diskresident BASIC programs for use in a program presently being edited.

    Type is also useful for displaying the contents of relative and sequential files. Type will display Program and User files, but usually their contents will be meaningless as displayed text.


    UPDATEDOS command

    UPDATEDOS updates the DOS image files which you may have installed on various LUs. It is run after one or more LU partitions have been created via CONFIG. Please see the section CONFIG for more detail on this feature and DOS image files.

    UPDATEDOS is automatically run whenever required.


    USER command

    Syntax: USER[__user#]

    user# is a decimal number in the range 0-15

    USER causes you to be 'logged' into the requested subdirectory of the LU on which you are currently working. Subsequent DIR's, SAVE's, or COPY's will be directed to/from the requested subdirectory supplied in the user# field. USER typed without a specified # will cause you to log into the CONFIGured power-up default subdirectory.


    VALIDATE command

    Syntax: VALIDATE

    VALIDATE operates on the currently selected LU, performs 60 integrity checks on each file in the LU, and completely rebuilds the BAM (Discbitmap) for the LU.