MEGA65 Welcome Guide
14.2 New BASIC commands
Many new BASIC commands have been added to the factory-installed ROM, or have been added to the User’s Guide
since it was printed. See the latest User’s Guide for specifics. New commands include:
14.2.1 Newer disk commands
MOUNT controls the mounting of disk images and drives to the unit numbers from BASIC, without having to enter the
Freezer.
• To mount a D81 disk image from the SD card to unit 8: MOUNT "FILENAME.D81"
• To mount the built-in physical 3-1/2” disk drive: MOUNT
FORMAT formats (erases) a mounted disk. This is an alias for HEADER.
• To prepare a new disk in unit 8 for use: FORMAT "DISKNAME",I01
• To quick-erase a previously prepared disk in unit 8: FORMAT "DISKNAME"
CHDIR and MKDIR support sub-directories on D81 disks and the SD card.
• To change to a sub-directory of the current directory on unit 8: CHDIR "SUBDIR"
• To return to the root directory on unit 8: CHDIR "/"
• To make a sub-directory on unit 8: MKDIR "SUBDIR"
• To change to a sub-directory on the SD card: CHDIR "SUBDIR",U12
• To change to the parent directory of the current directory (SD card only): CHDIR "..",U12
LOCK and UNLOCK set the status of a file on disk so that it cannot be deleted when locked.
• To lock a file on unit 8: LOCK "FILENAME"
• To unlock a file on unit 8: UNLOCK "FILENAME"
IMPORT takes a SEQ file of PETSCII text as if typed into the BASIC editor. Unnumbered lines are ignored: it does not
run commands in immediate mode.
• To import a text file as BASIC: IMPORT "LISTING"
– Any BASIC program already in memory will remain in memory, with only the lines in the listing overwrit-
ing what is already there. This makes IMPORT useful for adding a file of common routines to an existing
program.
• To export the current BASIC program as a text file that can be imported: DOPEN#1,"LISTING",W:CMD
1:LIST:DCLOSE#1
– Every command that outputs text between CMD 1 and DCLOSE#1 writes to the file. For example, you can
add arguments to LIST to only export a portion of a program: LIST 2000-2999
90 Chapter 14. Recently added features