NAME SJCCP - SJ Research Console Control Program SYNOPSIS SJCCP DESCRIPTION SJCCP is the CCP supplied with the ZNOS Econet Operation System interface written by SJ Research. ZNOS resides in sideways ROM or RAM, and the CCP is entered when ZNOS starts up, or when the BDOS is restarted. ZNOS responds to *FX63 to start up the CCP. SJCCP can also be used without ZNOS. Definitions A file is of the form [d:]name[.ext] where d is a drive letter, name is a sequence of one to eight non-blank characters and ext is a sequence of one, two or three non-blank characters. Name and ext cannot include the characters =, , or blank. A * char- acter will match to any number of characters, and a ? will match to any one character. An addr is a 16-bit hexadecimal address. If none is given, it defaults to &0100. A num is an 8-bit decimal number. Params are any parameters, which could be files, or plain text, or both. Prompting The CCP prompts with the current drive letter, followed by the drive letter and current user number, and then either ] if the ZNOS BDOS is present or > if it is not. Commands A CP/M command can be either a built-in command or a disk-based command of the form [d:][name [params...]] where d is a drive specifier, name is the command name and params is any supplied parameters. If a drive is given, then the CCP searches for a file name.COM on that drive, otherwise the current drive is searched. If the file cannot be found on the current drive, then the default search drive and user area is also searched. Built-in Commands Before a command is searched for on a disk, the CCP first checks if it is a built-in command. The built-in commands are as follows: ; A line starting with a ; is treated as a comment, and is ignored. *name A line starting with a * is sent to OSCLI as an OS command. During the duration of the command, the ESCAPE key generates escapes. d: Selects drive d. DIR [file] This produces a directory of the files. If file is given, only the files that match are listed. If the drive is ? then all files in all user areas will be listed with their user numbers. ERA file The specified file or files are erased. If the file given is *.* then you are prompted with Erase all files (Y/N)? before being allowed to erase them. GO [addr] Calls the addr, or &0100 if the addr is not supplied. LOAD file [addr] Loads a file into memory, starting at addr. If addr is not supplied, then the load will be to &0100. OLD [params...] Jumps to the program at location &0100 with the params in the parameter buffers. PRINT num... The nums are send to PRN: as VDU codes. REN file2=file1 Renames file1 to have the name file2. If REN file1 file2 file1 does not exist or file2 already exists, the command will fail. RESET Resets the CCP as though from a warm start, but preserving the current drive. RUN [file [params...]] Loads the file from disk to &0100 and calls it, passing it any params. If there are no parameters, then the program already at &0100 is called. SAVE num file [addr] Save a number of pages of memory num to disk, starting at addr, or &0100 if addr is not supplied. TYPE file The file is typed to CON:. All four possible end of line sequences generate a single newline. USER num Sets the user number to the supplied num. VERS The version string of the CCP is displayed, and the version string of the BDOS, if any is supplied. The current version of the CCP is Version 1.40. VDU num... The nums are sent to CON: as VDU codes. Parameters A command may have parameters after the command name. The text of the parameters is stored in the default DMA buffer at &0080, as a length byte followed by the actual text. If the first two parameters can be parsed as filenames, then they are stored in the default FCBs at &005C and &006C. DIAGNOSTICS * Aborted * An answer other than 'Y' was given to an ERA *.* command. Bad number A num can only be a valid 8-bit decimal number, and an addr can only be a valid 16-bit hex number. Catalogue full There is no more space in the catalogue when trying to create a new file with SAVE. Disk full There is no more room on the disk when trying to create a new file with SAVE. File already exists The new name of a REN command already exists. Illegal filename A file cannot have non-valid characters, the name cannot be more than 8 characters and the ext cannot be more than three characters. File1 in REN cannot include ? or *. file not found An attempt to DIR, ERA, LOAD, REN, RUN, TYPE a file or to run a command when file does not exist. Syntax error Compulsary file ommitted, or too many files supplied, or the files in REN not separated by '=' or ' '. DEFAULT PARAMETERS Some default parameters are stored within SJCCP which can be altered by modifying the SJCCP image. The parameter area is just after the command input buffer at the start of the CCP. It can be found by checking every third byte from the start of the CCP starting at offset 0 until a byte is found that is not a &C3 JP opcode. This is the command buffer length. Increment the address by another two and add the length byte. This is now the address of the parameter area. The following code fragment will do this. LD HL,SJCCP ; Start at start of SJCCP .Scan LD A,(HL) ; Fetch byte INC HL:INC HL:INC HL ; Step forward three bytes CP &C3:JR Z,Scan ; If a JP opcode, loop to check next LD E,A:LD D,0 ; Move length to DE ADD HL,DE:DEC HL ; HL now points to parameter area Parameters +00 Number of columns in DIR listing, default 4. +01 Default command search drive and user, &00 for no search drive. The top nybble is the user area, bottom nybble is 0 for current drive or 1-15 for drive A-O. The default is &01 for drive A, user area 0. A common setting is &F1 for drive A, user area 15.