The first is with reference to the article on setting the Arthur prompt to the current directory name which appeared in Archive Vol 2 No4. There is a much easier way of doing this which only uses RMA memory temporarily and does not rely on interception of vectors. The approach required is to set up a special type of system variable which calls a segment of machine code to read or write its value. Full information and an example program are given on pages 347-351 of the programmer's reference manual.
The short BASIC program DirPrmtSrc creates a utility file DirPrompt. The currnet directory prompt is set up by running this utility at the start of a session. DirPrompt creates the variable Curr$Dir and sets Cli$Prompt to print it instead of the normal prompt. When Curr$Dir is created it is given the type 16 which causes the operating system to copy the code for reading it into the system heap where all variables are stored. When the code is called it uses "OS_GBPB" to read the current directory and passes this back as the variable value. No code is needed for writing the variable since it is updated by the current filing system. RMA memory is required to run the utility, but is released as soon as the variable has been created. If you are already in BASIC and have no RMA space then running the BASIC program will do the job if lines 360 and 370 are deleted and the following line inserted
360CALL CreateVar
Notes 1. *UNSET cannot be used to delete a type 16 variable and so, if you wish to revert to the normal prompt you must *UNSET Cli$Prompt. 2. If an error occurs when trying to read the directory, such as when the desktop filing system is in use, then the variable is set to a null string and a blank line is printed before the normal prompt. 3. Once set up, Curr$Dir survives until the next Ctrl Break.