PATH command for Apple II ProDOS
Go to file
Joshua Bell b63dabb7cd Actions: Rev a couple dependencies 2024-01-31 20:31:14 -08:00
.github/workflows Actions: Rev a couple dependencies 2024-01-31 20:31:14 -08:00
.gitignore wip 2019-01-07 19:36:25 -08:00
COMMANDS Add HIDE / UNHIDE commands, to toggle the access "invisible" bit 2023-05-11 09:37:00 -06:00
LICENSE Create LICENSE 2020-11-08 12:43:04 -08:00
Makefile Simplify make/package maintenance 2021-04-17 10:05:22 -07:00
README.md PATH: Shave 9 bytes 2024-01-02 22:17:14 -08:00
bell.cmd.s Add CHTYPE and CHTIME 2021-03-07 15:29:51 -08:00
buzz.cmd.s Add BUZZ command 2021-04-13 21:20:12 -07:00
cd.cmd.s Add TOUCH command 2021-05-02 11:16:11 -07:00
chtime.cmd.s Add TOUCH command 2021-05-02 11:16:11 -07:00
chtype.cmd.s Add TOUCH command 2021-05-02 11:16:11 -07:00
copy.cmd.s COPY: Preserve file modification time 2024-01-01 19:35:14 -08:00
date.cmd.s BI Error constants; coding style 2021-04-15 19:47:41 -07:00
echo.cmd.s Add CD command 2021-04-17 09:58:22 -07:00
hello.cmd.s Add CHTYPE and CHTIME 2021-03-07 15:29:51 -08:00
hide.cmd.s Add HIDE / UNHIDE commands, to toggle the access "invisible" bit 2023-05-11 09:37:00 -06:00
mem.cmd.s Add MEM command, inspired by A2osX's BASIC.FX 2022-08-04 19:29:52 -07:00
more_apple2.inc Add BUZZ command 2021-04-13 21:20:12 -07:00
online.cmd.s Add CHTYPE and CHTIME 2021-03-07 15:29:51 -08:00
package.sh Simplify make/package maintenance 2021-04-17 10:05:22 -07:00
path.s PATH: Shave 9 bytes 2024-01-02 22:17:14 -08:00
prodos.inc Add HIDE / UNHIDE commands, to toggle the access "invisible" bit 2023-05-11 09:37:00 -06:00
touch.cmd.s Add TOUCH command 2021-05-02 11:16:11 -07:00
type.cmd.s Add TOUCH command 2021-05-02 11:16:11 -07:00
unhide.cmd.s Add HIDE / UNHIDE commands, to toggle the access "invisible" bit 2023-05-11 09:37:00 -06:00

README.md

CMD executable PATH for ProDOS's BASIC.SYSTEM

build

💾 Disk images can be found on the Releases page 💾

Build with ca65

Instructions For Users

Installation:

  • Copy files from the floppy disk image to your Apple's hard disk, in a subdirectory e.g. /HD/CMD
  • From BASIC.SYSTEM prompt, run: PATH, e.g. -/HD/CMD/PATH, either from STARTUP or manually

After installation, the usage is:

PATH prefix     - set search path(s) - colon delimited
PATH            - view current search path(s)
cmdname         - load and execute named CMD, if in PATH
  • Once set, binary files of type CMD in the specified directories can be invoked by name.
  • Supports multi-segment, colon-separated paths, e.g. /hd/cmds:/hd2/more.cmds

Example:

] -/hd/cmd/path          - install it
] PATH /hd/cmd:/h2/bin  - set PATH
] PATH                   - verify path
/hd/cmd:/h2/bin
] BELL                   - will invoke /hd/cmd/BELL if present
] HELLO                  - will invoke /hd/cmd/HELLO if present
] ONLINE                 - will invoke /hd/cmd/ONLINE if present

Notes:

  • PATH can be invoked as lower case (e.g. path /hd/cmd)
  • Commands can be invoked as lower case (e.g. hello)
  • A relative PATH (e.g. path bin) only works if an explicit prefix is set.
    • Note that if no prefix has been set, or if you run prefix /, BASIC.SYSTEM will use the last accessed slot and drive and the PREFIX command will report that volume as a prefix even though it is empty.

Sample commands included:

  • HELLO - shows a short message, for testing purposes
  • ECHO - echoes back anything following the command
  • CD - like PREFIX but accepts .., e.g. cd ../dir
  • ONLINE - lists online volumes (volume name, slot and drive)
  • MEM - show memory stats for the BASIC environment
  • COPY - copy a single file, e.g. copy /path/to/file,dstfile
  • TYPE - show file contents (TXT, BAS, or BIN/other), e.g. type filename
  • TOUCH - apply current ProDOS date/time to a file's modification time, e.g. touch filename
  • DATE - prints the current ProDOS date and time
  • CHTYPE - change the type/auxtype of a file, e.g. chtype file,T$F1,A$1234
    • T (type) and A (auxtype) are optional. If neither is specified, current types are shown.
    • S and D arguments can be used to specify slot and drive.
  • CHTIME - change the modification date/time of a file, e.g. chtime file,A$1234,B$5678
    • A (date) and B (time) are optional. If neither is specified, current values are shown.
    • S and D arguments can be used to specify slot and drive.
  • BELL - emits the standard Apple II beep
  • BUZZ - emits the ProDOS "nice little tone"
  • HIDE / UNHIDE - sets / clears the "invisible" bit on a file, used in GS/OS Finder

Instructions For Developers

Behavior of PATH:

  • Search order when a command is typed:
    • ProDOS BASIC.SYSTEM intrinsics (CAT, PREFIX, etc)
    • BASIC keywords (LIST, PRINT, etc)
    • CMD files in paths, in listed order
  • Allocates a permanent buffer to store the code and path (2 pages)
  • Applesoft BASIC commands are unaffected (but can't be CMD names)
    • Commands with BASIC keywords as prefixes are allowed as long as the command continues with an alphabetic character. For example, ONLINE is allowed despite conflicting with the valid BASIC statement ONLINE GOTO10 which is short for ON LINE GOTO 10.

Protocol for CMD files:

  • CMD file is loaded at $4000 and invoked; should return (rts) on completion.
  • $4000-$5FFF is assumed reserved for the CMD file and any buffers it needs.
  • The command line will be present at $200 (GETLN input buffer).
  • Commands can use the BI parser for arguments. See chtype.cmd.s for an example.