lotus

previous page: 7.2 Cataloging
  
page up: Apple ][ Emulator Resources Guide
  
next page: 9.0 - Further Reading

8.0 - Apple DOS/ProDOS Commands




Description

This article is from the Apple ][ Emulator Resources Guide, by Alex Maddison with numerous contributions by others.

8.0 - Apple DOS/ProDOS Commands

These commands are intended for use with disk-images which contain either DOS 3.3 or any version of ProDOS. "Changing" the disk-image is equivalent to physically removing a disk from the Apple 5.25" or 3.5" drive and replacing it with another. As such, there is no DOS command to "change" a disk-image - it is a function integral to the emulator you are using (a menu command, icon or key equivalent)... Most disks use custom DOS (especially games) and will automatically boot when the computer is switched on or reset. If it comes up with a "*" prompt after boot, it means that DOS on that disk(-image) is bad, and the computer (or emulator) has entered the Assembly Language Monitor.

"All disk-related operations are controlled by a special program called the DISK OPERATING SYSTEM, or DOS. BASIC transmits requests to DOS for any operation involving the disk. The DOS returns the results to BASIC." ('Apple II User's Guide' p.164) Several versions of DOS exist for the Apple. DOS 3.2 used 13 sector per disk; DOS 3.3 used 16. Filenames under DOS 3.3 could be from 1 to 30 characters in length (comprising any uppercase keyboard character - including spaces and excepting commas). DOS 3.3 cannot accept lower-case commands (so remember to press CAPS LOCK on ][+ machines and emulators) and does not support sub-directories. ProDOS similarly uses uppercase filenames but they are restricted to 15 characters, lowercase commands and sub-directories are accepted. Both DOS 3.3 and ProDOS use the "]" prompt. DOS 3.3 also uses the ">" prompt for Integer BASIC programs.

For a comprehensive guide to the Apple II operating system, try the "Apple II DOS & Commands FAQ" by Nathan Mates <nathan@visi.com>. http://www.visi.com/~nathan/a2/faq/dos.html

A partial list of commands follows:

BLOAD - Loads a machine language (binary) file.

BRUN - Executes a machine language (binary) file.

BSAVE - Saves a machine language (binary) file.

BYE (ProDOS only) - Exits BASIC.SYSTEM.

CAT (ProDOS only) - Abbreviated 40-column catalog giving a list of files, file type, size in blocks and last modification date. Some common ProDOS file type are given below:

      SYS - System executable
      TXT - Text file
      BAS - Applesoft BASIC program (executable)
      BIN - Machine language (binary) file

CATALOG - Under ProDOS, it provides an 80-column listing giving a list of files, file type, size in blocks, modification and creation dates, endfile data and subtype. Under DOS 3.3 it produces a list of files, file type, size in sectors (1 - 255) and disk label. Common DOS 3.3 file types are given below:

      A   - AppleSoft BASIC programs
      B   - Binary image (machine language) files
      I   - Integer BASIC programs
      T   - Text files
      R   - Relocatable binary
      S   - Source
      *   - File is locked (protected from modification/deletion)

CREATE (ProDOS only) - Creates sub-directories.

DELETE - Deletes UNLOCKED files. The command can specify slot, drive or volume number (DOS 3.3) or volume prefix (ProDOS); otherwise it assumes the file is in the current directory.

EXEC - Executes a text file; any text file containing a BASIC program will be automatically input as though it was typed. Direct commands will be executed. Thus BASIC programs can be more easily entered into a text-editor and then EXECuted on an Apple, and then saved.

INIT - Initializes a disk under DOS 3.3, with a greeting program of choice (typically named HELLO). Usage INIT HELLO.

LOAD - Loads an AppleSoft BASIC (or Integer BASIC under DOS 3.3) file.

LOCK - Locks a file.

PREFIX (ProDOS only) - Changes sub-directory.

RENAME - Renames files. Usage RENAME OLDNAME,NEWNAME under DOS 3.3.

RUN - Executes an AppleSoft or Integer BASIC program under DOS 3.3; AppleSoft only under ProDOS (which does not support Integer BASIC). To execute any ProDOS filetype, use the "-" character instead of RUN or BRUN.

SAVE - Saves an AppleSoft BASIC file. Since it is saved into a "tokenised" format (ie. AppleSoft reserved words are replaced by ASCII codes or "tokens") the BASIC files are not plain text. To reverse the EXEC command and produce a plain text copy of a BASIC file; place the following line in the BASIC program and RUN:

0 TEXT:PRINT CHR$(21):HOME:POKE 33,33:PRINT CHR$(4);"OPEN filename.txt":PRINT CHR$(4);"WRITE filename.txt":LIST 1,63999:PRINT CHR$(4);"CLOSE filename.txt": TEXT:END (suggested by Dave Althoff, Jr. <dalloff@freenet.columbus.oh.us>).

UNLOCK - Unlocks the file.

VERIFY - Verifies file (under DOS 3.3, it recalculates the checksum for each sector of the file).

 

Continue to:













TOP
previous page: 7.2 Cataloging
  
page up: Apple ][ Emulator Resources Guide
  
next page: 9.0 - Further Reading