1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-03-11 05:32:06 +00:00
0
Command Line & System Environment (CMDSYS)
David Schmenk edited this page 2024-11-14 10:53:46 -08:00

PLASMA, as implemented on the Apple 8 bit machines, runs from a command line environment that provides basic filesystem navigation as well as the ability to launch system programs and PLASMA programs. This environment allows automatic dependency loading for modules, a default directory for system libraries and programs, and a number of utilities to operate on the filesystem all within the command line interface without resorting to system programs. The PLASMA editor and compiler can be run from the command line.

Apple 1

The Apple 1 is a very constrained system compared to the ][ and ///. It is required to have the CFFA1 disk adapter installed to provide file storage and a full 32K od RAM. To get the files onto the CF card required the use of CiderPress and they must be placed in one directory. Most PLASMA programs won't work on the Apple 1 due to limited filesystem support, video/graphics capabilities, and lack of audio output. It does, however, make a good place to start when porting PLASMA to a new platform.

Apple ][

To boot directly into PLASMA, you will need to put the system files in the root prefix of the boot device and make sure PLASMA.SYSTEM is the first SYSTEM file in the directory. Otherwise, start PLASMA.SYSTEM from your program launcher of choice. All Apple ][ models with 64K and two floppy drives are supported up to a maxed out IIGS with accelerator and hard drive.

65802/65816 Support

PLASMA can utilize the 16 bit features of the 65802 and 65816 processors to improve performance of the PLASMA VM operation. This is transparent to the programmer/user and doesn't make any additional memory or capabilities available to PLASMA. PLASMA will automatically run the most optimal VM for your configuration.

Apple ///

The Apple /// gets the environment it always wanted: The ability to navigate the filesystem with a command line interface. The Apple /// always boots from the floppy drive, even if a hard disk is installed. PLASMA2-A3MAME.PO is an Apple 3 bootable disk containing the SOS.DRIVER configured for the Apple 3 Ready-To-Run Mame environment. apple3.hd is the pre-installed PLASMA hard disk image set up for Apple 3 Ready-to-Run. For a physical Apple 3, the PLASMA2-FPSOS.PO floppy should be updated with the SOS.DRIVER configured for the machine. Once booted, type S /HARDISK/PLASMA (or your install directory of choice) to change to, and set, the system directory. This can be automated by creating an AUTORUN file on the boot floppy with the above command in it.

PLASMA Command Line Shell

PLASMA incorporates a very basic command line shell to facilitate navigating the filesystem and executing both SYSTEM/SOS programs and PLASMA modules. It has a few built-in commands:

Command Operation
C [PREFIX] Catalog prefix
P <PREFIX> change to Prefix
/ change to parent prefix
V show online Volumes
S <PREFIX> set System prefix*
+SOS <SOS.INTERP> [PREFIX] launch SOS interpreter*
-<SYSTEM PROGRAM> [PARAMS] launch SYSTEM program**
+<PLASMA MODULE> [PARAMS] exec PLASMA module
[Optional parameters]
<Required parameters>
* Apple /// only
** Apple ][ only

The shell is very brief with error messages. It is meant solely as a way to run programs that accept command line parameters and take up as little memory as possible. It does, however, provide a rich runtime for PLASMA modules.

Included Modules

PLASMA comes with many library modules used by the tools, demos and sample code. The PLASMA system volume must remain in place for the duration of PLASMAs run otherwise it won't be able to find CMD or the system libraries. Probably the most useful included module is the editor. It is used for editing PLASMA source file, assembly source files, or any text file. Execute it with:

+ED [TEXT FILE] [GOTO LINE NUMBER]

The file manipulation utilities to copy, delete, rename, create directories, and change file type and aux type remove the need for external programs to do the same. PLASMA can now be installed with the tools included on the PLASMA2-SYS boot floppy. They are:

+COPY [-R] <SRCPATH>+ <DSTPATH>
+DEL [-R] <FILEPATH>
+REN <FILENAME> <NEWNAME>
+NEWDIR <NEWDIRECTORY>
+TYPE <FILENAME> [NEWTYPE [NEWAUX]]
+CAT [-R] <FILEPATH]

The -R option will operate on the directories recursively. Wildcard filenames can be specified with '*' matching zero or more characters, and '?' matching any character. When copying files to the current directory, = can be used as a shortcut.

Compiler Modules

The build disk includes sample source, include files for the system modules, and the PLASMA compiler+optimizer modules. The compiler is invoked with:

+PLASM [-[W][O[2]] <SOURCE FILE> [OUTPUT FILE]

Compiler warnings are enabled with -W. The optional optimizer is enabled with -O and extra optimizations are enabled with -O2. The source code for a few sample programs are included. The big one, RPNCALC.PLA, is the sample RPN calculator that uses many of PLASMA's advanced features. The self-hosted compiler is the same compiler as the cross-compiler, just transcribed from C to PLASMA (yes, the self-hosted PLASMA compiler is written in PLASMA). It requires patience when compiling: it is a fairly large and extensive program.

Assembly Toolkit

The PLASMA module was originally architected around the REL file generated by the ProDOS toolkit assembler, EDASM. This minor update fixes the PLASMA relocating loader to handle 8 bit fixups. PLASM generated modules only use 16 bit fixups, so not an issue for existing modules. Download the toolkit that includes the ProDOS EDASM assembler and sample code.

PLASMA Assembly Language Toolkit

FORTH Module

A FORTH language module capable of interpreting script files and interactive programming. Further documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/PLFORTH.md. Samples scripts are in /HARDISK/BLD/SCRIPTS

LISP 1.5 Module

An early implementation of LISP is available to learn and experiment with this intriguing language. One of the first REPL programming environments, it has a long history in the annals of computing. Further documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/DRAWL.md. Samples scripts are in /HARDISK/BLD/LISP

Demos

There are some demo programs included for your perusal. Check out ROGUE for some diversion. You can find the documentation here: https://github.com/dschmenk/PLASMA/blob/master/doc/Rogue%20Instructions.md. A music sequencer to play through a MockingBoard if it is detected, or the built-in speaker if not. A minimal Web server if you have an Uthernet2 card (required). Try SPIDERSfor some hires shoot'em-up action. Bug reports appreciated.

Video Playlist

There is a YouTube playlist created for learning PLASMA.