DOS65 source listing
MON65 6502 monitor sources
MON65 65c02 monitor sources
IO65 ROM source listing
DOS65 utilities sources
IO65 manual english
DOS65 installation release notes
Aanpassing VDU to get a better synced monitor signal
DOS65 AssemblerMW Patches on Micro Ade assembler-editor
DOS65 Assembler Manual Macro-assembler 65(C)02 dutch
DOS65 Editor manual dutch
DOS65 Comal programming manual dutch
DOS65 Eprommer Hardware
DOS65 Eprommer Sofware
DOS65 Hardware beschrijving
DOS65 IBM keyboard hardware en driver
DOS65 IO routines IO65 Routines manual dutch
DOS65 KB9 Basic manual
DOS65 Manual introduction and MON65
DOS65 Manual dutch
DOS65 Modem BCH1200A aansluiten
DOS65 Monitor MON65 monitor verie 2.01 dutch
DOS65 Ombouw CPU Replace the 6502 with a GTE 65SC02 P2 2 MHz
DOS65 Ombouw VDU for IBM CGA
DOS65 Printer EPSON print program
DOS65 ROM I/O 65 ROM routines listing
DOS65 Tape Basicode
DOS bouw Hardware beschrijving ombouw naar DOS65
DOS65 Commands Short command list of MON65, DOS65 EPROM programmer, Editor
From here you find the complete English DOS65 manual, the monitor commands and the API for the file system.
###### #### ###### #### ######## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ###### ## ## ## ## ###### ###### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ###### #### ###### #### #### Disk Operating System 6502 ---- --------- ------ ---- Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 1 DOS 65 MANUAL VERSION 2.02 (1986). INTRODUCTION: DOS65 is a universal disk operating system for 65(C)02 computers. DOS65 has been written by: A.B.M. Brouwer. Nieuwkoopseweg 44, NL-2641 PB Pynacker, Holland. This manual has been written by: A.B.M. Brouwer and A.S. Hankel. Translation from Dutch version: Drs Conrad H.Kleipool In case of problems, get in Erwin Visschedyk touch with: Please note that for DOS65, including without exception all for DOS65 written or developed utilities and associated software, also all DOS65 manuals and other descriptive material, applies: COPYRIGHT (C) 1985 KIM GEBRUIKERSCLUB NETHERLANDS. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 2 TABLE OF CONTENTS page: Table of Contents ........................... 2 CHAPTER 1 Specifications .............................. 4 Hard and software requirements .............. 4 CHAPTER 2 DOS65 glossary, definitions and miscellaneous 5 Default ..................................... 5 Escape and control .......................... 5 Toggle ...................................... 5 Control codes ............................... 5 File ........................................ 5 Extensions .................................. 5 Options and parameters ...................... 6 DOS65 and diskdrives ........................ 6 Input/Output redirect, indirect files ....... 7 Indirect command files with parameters ...... 9 Drive- and Directory Specification .......... 11 DOS65 error messages ........................ 12 CHAPTER 3 DOS65 Standard commands ..................... 14 < ........................................... 14 <T .......................................... 14 > ........................................... 15 >> .......................................... 15 >T .......................................... 15 >P .......................................... 15 <> .......................................... 15 @ ........................................... 16 CHMOD ....................................... 16 DIR ......................................... 16 GO .......................................... 16 LCMD ........................................ 16 LOAD ........................................ 17 RUN ......................................... 17 SAVE ........................................ 17 SEE ......................................... 18 STAT ........................................ 18 SYNC ........................................ 18 CHAPTER 4 DOS65 Utilities ............................. 19 >D .......................................... 19 APPend ...................................... 19 AS .......................................... 19 ASN ......................................... 19 BOOTLINK .................................... 19 CAt ......................................... 20 CLear ....................................... 20 CO .......................................... 20 CREate ...................................... 21 DDoctor ..................................... 21 DELete ...................................... 21 DPTime ...................................... 21 DUmp ........................................ 22 ECHo ........................................ 22 EDitor ...................................... 22 FORMat ...................................... 22 Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 3 HElp ........................................ 24 LIst ........................................ 24 MAP ......................................... 25 MEMFill ..................................... 25 MEMMove ..................................... 25 MONitor ..................................... 25 MTOAS ....................................... 25 OLOad ....................................... 26 PLIst ....................................... 26 PRInt ....................................... 27 REName ...................................... 27 RS232 ....................................... 27 SDir ........................................ 28 SETBegin .................................... 28 SETDrives ................................... 29 SETMode ..................................... 29 SETPrompt ................................... 29 SETRtc ...................................... 29 SETUp ....................................... 29 TIme ........................................ 30 TYpe ........................................ 30 UNEXpand .................................... 30 VFORmat ..................................... 30 CHAPTER 5 Filenames and special characters ........... 31 Filenames ................................... 31 Wildcards ................................... 32 Upper and lower case ........................ 33 APPENDIX DOS65 Installation Manual ................... 34 Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 4 CHAPTER 1: SPECIFICATIONS DOS65. - Suitable for: * 5 1/4 inch disk drives (40/80 tracks, single- and double sided, single- and double density). * hard disk. * virtual disk. - Maximum formatted capacity per disk: 719 KBytes (5 1/4 floppy disk, 80 tracks, double sided, extra density). - Supports: FULL SCREEN EDITOR (ED) ASSEMBLER (Moser, Micro-Ade, AS65 Assembler) FORTH BASIC - Extensive input/output redirect possibilities, - Very user friendly. - Can be adapted to almost any 6502 system. - Very efficient use of disk-space. - Full documentation available. - Transfer rate about 7 Kbyte/second. - Simple hardware. Hard and software requirements. - DOS65 floppy-controller board. The bare board is available from the KIM Users Club Holland. - At least 56 Kbyte RAM memory. - Terminal requirements: 80 columns, cursor positioning. (the Elekterminal is not suitable). - HAVISOFT I/O-program IO65 2.01 is available for implementation of memory-mapped video on ELEKTOR's CPU/VDU configuration. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 5 CHAPTER 2. DOS65-GLOSSARY, DEFINITIONS AND MISCELLANEOUS EXPLANATIONS. Default: Default means normal or usual value of a variable. If for instance a variable has a default value of 2, the number 2 will be substituted for that variable unless the user has previously specified another value for the variable. Escape and control: In DOS65 the ESCAPE-key is used to indicate to the computer that after the ESCAPE-key a command will follow. When the manual mentions ESC A this means that first the ESCAPE key and then the 'A' key has to be pushed. However, if the manual refers to CTL A (control A) you have to push both the control key and the 'A' key at the same time. Toggle: Toggle means that a key can be used to switch a function on and off. If key 'A' toggles a function, pushing the key will alternately switch that function on and off. Control codes: Control codes are ascii-codes with a value between $00 and $1F. Control codes are often used to command or control peripheral equipment such as terminals, printers, modems, etc. Some controlcodes: BS (backspace $08), LF (linefeed $0A). File: A file is essentially a collection of computer data with a specific name tag attached to it and which has been recorded on a disk. These data can be transferred from disk to the computer memory and of course also vice versa from memory to disk. The data in a file can be of all kinds, such as a BASIC-program, a FORTH screen, ASCII characters, but also programs in machine code or a list of commands. To every file is attached an identification tag, called a filename, so every file recorded on a disk has its own name. By using special commands which we will discuss later, we are able to see which files are recorded on a disk, what kind of file it is, determine its length (how many data it contains) and many other features. DOS65 distinguishes between three kinds of files: - Ascii files these files contain ascii characters and can only be used with 'ascii' type commands, such as: List, See, Create, Editor, etc. - Hex files program files in machine code. These files are executed by the Run command or they can be run automatically after typing in their filename (command files). - Binary files program files in machine code, but consisting of several blocks of code each with its own load- and start addresses. Otherwise same as hex files. Extensions: Each file has its own, unique name. However, it would be convenient to Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 6 determine from the filename what kind of file it is. This is the purpose of the extension. The complete filename consists of the unique name fol- lowed by an indicator. On the disk is not only recorded the file with the name FILENAME, but with FILENAME.XXX; XXX being the extension. We suggest you use the following extensions: .TXT Source-file (Moser, Micro-ade) .MAC Assembler source file (AS65). .DOC Documentation-file (correspondence, text, etc.) .LST List-file (assembler listings, Basic). .BIN Object-file, binary file (machine code). A file which contains a letter, could be recorded as: LETTER.DOC; the name before the period is the unique filename followed after the period by the indicator for the kind of file. In view of the interchangeabily of files within our Club we recommend that everybody uses the same kind of extensions. If you use a version of Micro-Soft BASIC which has been adapted for DOS65 you will encounted two extensions which are inserted automatically and which cannot be modified by the user. .BAS indicates a BASIC program in tokenized Basic format (each BASIC keyword is stored as one byte). If such a BASIC program is written on a disk by the command SAVE "NAME", the file will be recorded as NAME.BAS. .VAR concerns a sequential data file, generated by BASIC, which has been written on disk. A .VAR file may be recorded in Ascii and can eventually be processed by the Editor. Finally we should mention that there are filenames without extension. These are external DOS commands (utilities) or command files. Options and parameters: A user communicates with his computer by sending commands. The usual procedure is to type in the name of a command followed by a return, or 'COMMAND <cr>'. The sign <cr> in this manual means pushing the RETURN key. DOS65 offers the user the possibility to send along with certain com- mands additional data such as options and parameters. These additional options modify to some extent the result of a command. Parameters are numerals which are used to limit the range of a command. In DOS65 para- meters are used to add for instance linenumbers to commands. Options must always be preceded by a - (minus sign). Parameters must be preceded by a + (plus sign). The sequence of typing in a command with options and parameters must be: command, space, a minus, one or more option characters, space, a plus, first parameter, a comma, second parameter and finally a return. Example: LIST -CE +10,20. LIST is the command in this example, -CE in- dicates that we want to use options C and E. With +10,20 we are adding parameters 10 and 20. In this manual we will indicate the possible options and parameters by putting these in the description of commands between brackets. Example: LIST [-CELMN +m,n] means that the LIST command has the options C, E, L, M and N, and that one can add two parameters 'm' and 'n'. DOS65 and disk drives. DOS65 leaves the user an ample choice of the number (1 or 2) and the type of drives (40 or 80 tracks, single- or double sided, single- or double density). DOS65 works best with two drives. The first drive, which we call drive-0, has the function of 'systemdrive'. This drive contains the sys- Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 7 temdisk with the DOS65 program itself (the 'BOOT'file), the external DOS65 commands and utilities, and programming languages such as BASIC, FORTH, etc. The second drive (called drive 1) is available as user drive. The user will work on this drive with his own files and record software written by himself. Working with a single drive is possible but not very user friendly. In this case the drive will be used both as system and user drive, which will result in a frequent changing of disks. To recapitulate: DOS65 works best with two drives, double density (like all modern drives) and double sided. 80 tracks drives are preferable, but even 40 tracks drives perform well, although they have only half the capacity. Input/output redirects. Essentially every computer, whether an IBM mainframe or a Junior, can be divided into three distinctive sections. Centrally we find the proces- sing unit, consisting of the processor, memory, etc. This unit proces- ses data and commands, according to a previously laid-down manner (a program). The user of the system supplies these data and commands by means of another section, the input unit. On the other hand the computer also produces data which are transmitted to the user by the third section, the output section. Schematically we could draw this as follows: ---------------- ----------------- ----------------- I I I I I I I INPUT i->->->-i PROCESSING I->->->-I OUTPUT I I I I CPU + MEMORY I I I ---------------- ----------------- ----------------- Usually we will use a keyboard for the input. Output is dispatched to a CRT screen most of the time. Sometimes input and output are combined in a so-called terminal, a unit which comprises both a keyboard and a screen. Input and output redirect means that input or output are not channeled through keyboard or CRT screen, but are directed from or to a file. An example: if we intend to work in BASIC, we will first start up Basic. After the BASIC prompt the computer will now wait for input from the user, who will type in a program. An input-redirect at this point accomplishes that the computer will not wait for input from the keyboard, but will get this input from a file which has been previously recorded on disk. This could be a file written with the editor. Output-redirect: Let stay with BASIC for the time beeing. Supposing we have a BASIC program stored in memory, we could see this program on the screen by using the LIST command. But if we want to edit such a BASIC program with the editor, we must have it in a file. We can produce such a file by means of an output redirect for later use in the editor. Another example: After writing a program in assembler language, we will eventually assemble this program. On the screen will then appear the assembly listing, possibly with error messages. By redirecting this lis- ting to a file we will be able to study this listing later much more ef- Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 8 ficiently. The best way to get acquainted with input and output redirects is to experiment with it and try out various possibilities. You will discover that there are much more useful applications. It is a very efficient tool for the system user to work with his computer. Input redirect: There are two kinds of input redirects, viz.: - input redirect to provide input for a command. - input redirect to execute a command file itself. 1. The syntax of the first kind is: < FILE COMMAND <cr>. In this case the input needed after executing COMMAND will be fetched from FILE. After obtaining this file, FILE is closed and the input redirect is ended. This kind of input redirect can be used with BASIC. For Basic the input appears as if it is being entered from the keyboard. The sequence is as follows: Enter: < FILE BASIC <cr> DOS65 will first proceed to redirect input. If it succeeds in locating FILE on the userdrive, BASIC will be loaded and started. BASIC then reports in in the usual way, for instance: 20473 BYTES FREE MICRO-SOFT BASIC V1.1 OK Normally, without the input redirect, the user will type in his instruc- tions after the prompt OK. With the input redirect these data will be fetched from FILE. When all of FILE has been read in, it will be closed and the input redirect ended. Such a BASIC file could be written with the Editor which is a more user-friendly way than writing in Basic it- self. It can sometimes be convenient to write a indirect command file (filemode -C bit set) with '< BASICFILE BASIC'. By entering just 'COM- MAND' you can start BASIC and execute at the same time the file BASIC- FILE. 2. In case of an input redirect to execute command files, the syntax is as follows: COMMAND <cr> COMMAND is a file containing a list of several individual commands (a command in a command). Of course COMMAND must be a commandfile (filemode C bit set), otherwise it cannot be called as a command. Example of file COMMAND-A which you can write with the CREATE command or with the Edi- tor: CAT DIR SDIR If we enter COMMAND-A <cr> the commands CAT, DIR and SDIR are executed as if they were typed in from the keyboard and afterwards the command input file is closed. Command files can go two levels deep, which means that a command file can include another command file. Example: File COMMAND-B: COMMAND-A TIME BASIC By entering COMMAND-B, COMMAND-A (see above) is executed, TIME is dis- played and BASIC is loaded and started. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 9 Indirect command files with parameters In DOS65 version 2 it is now possible to insert parameters in a command file, which considerably enhances the possibilities of indirect command files. The syntax becomes: COMMAND [ARGUMENT-1] [ARGUMENT-2] COMMAND represents the filename of the indirect command file and both arguments are parameters which we can apply to specific individual com- mands in our command file. Usually these parameters will be filenames on which certain commands in the commandfile are to be executed. First some limitations of the parameters: - arguments must be separated by spaces. - a maximum of two arguments. - the total lenght of the two arguments together is maximum 24 characters. - the arguments must be defined: * at the start of the first level, * with the last command of the first level. - The characters "&1" and "&2" are used together with an individual command line in the indirect command file and refer to ARGUMENT-1 and ARGUMENT-2. - Comments can be inserted in the command file provided they are preceded by the character ';'. WARNING. If you want to experiment with the following examples, use empty diskettes only. Always copy your systemdisk first, render the sys- temdisk write-protected with the special sticker and use empty user disks only. Examples: Write a command file as follows (c.f. Create and Setmode commands, chapter 4): ;this is file AAA TYPE &1 ;end file AAA Line 1 and 3 are comments because they are preceded by ';'. The second line is the command TYPE and '&1' refers to the first argument which we are going to enter together with file AAA. If we execute this indirect command file by: AAA TEST <cr> the result will be: TYPE TEST (file TEST will be typed) The parameter we have entered at the same time as the command file (TEST) has been transferred to the individual commands by calling '&1' or '&2'. Now an example with two parameters: ;this is file AAA TYPE &1 TYPE &2 TYPE &1.mac t.&1.mac TYPE &1 &2 TYPE TEST-B ;end file AAA Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 10 If we enter: AAA TEST-B TEST-C the result will be: line input output 1 ;this is file AAA no output, comment 2 TYPE &1 TYPE TEST-B 3 TYPE &2 TYPE TEST-C 4 TYPE &1.mac t.&2.mac TYPE TEST-B.mac t.TEST-C.mac 5 TYPE &1 &2 TYPE TEST-B TEST-C 6 TYPE &TEST-B TYPE TEST-B 7 ;end file AAA no output. Notes: Line 1 is preceded by ';' and, as a comment, does not have any effect. In lines 2 and 3 you can see that '&1' and '&2' have been substituted by the arguments 1 and 2 of the command entry (TEST-B, TEST-C). In lines 4 and 5 we ordered two files to be 'typed'; this a correct syntax as the TYPE command allows several filenames to be entered, separated by a space. In line 4 the substitution has also taken place in the composite syntax '&1.mac' and 't.&2.mac'. Line 6: As '&' is not followed by the number 1 or 2 but by a filename, the '&' is disregarded and the instruction is executed as a simple 'TYPE TEST-B'. If you mistakenly enter only one parameter while the individual command lines call for two parameters, the system will return an error message as the second command will lack a filename. If you enter in the above example: AAA TEST-B <cr> the system will execute: TYPE TEST-B TYPE ? ERROR MESSAGE In the previous examples file AAA was a first order file but it is also possible to insert a command file in another command file. Example: ;this is file QQQ AAA &1 &2 ;end file QQQ We can now enter: QQQ TEST-B TEST-C <CR> Execution will be as above and the two parameters TEST-B and TEST-C are first substituted in file AAA and subsequently in the individual command lines of AAA. Now a more practical example: If we assemble an AS65 source file called TEST.MAC, the assembled ma- chine code is saved on disk as binary file TEST.BIN. In order to trans- fer this file on the user drive to the system drive as a command file you must execute the following operations: - designate TEST.BIN as a command file, - copy TEST.BIN (user drive) to TEST (systemdrive), - delete TEST.BIN on user drive. We are now able to incorporate these operations in a universal command file 'MAKECOM' which due to the parameter transfer, we can furthermore use in all similar cases. ; file makecom ; ; make from .bin file a command Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 11 ; delete .bin file setmode -c U:&1.bin copy U:&1.bin S:&1 delete -y &1.bin ; end makecom Now run the above command file as: makecom TEST <cr> and all above men- tioned commands will be executed. It should be noted that the parameter transfer can also be used for other data than filenames, such as options. Every time the '&' character appears it will be replaced by the corresponding argument. Example: Create a command file: ; this is file PRINTFILE >P PLIST &1 &2 ; end file printfile If you enter: PRINTFILE -F DOSMANUAL <cr>, the file DOSMANUAL will be printed with formfeeds (-F option). Note 1: The maximum number of files which may be open at any one time is limited to six. With an indirect of two levels, two spooler files and an assem- bler which can open several files at the same time, this number is easi- ly reached. Note 2: In order to distinguish between ordinary command files (containing binary code) and indirect command files, we recommend that filenames of the latter kind are written in lower case. So 'TEST' instead of 'test' and 'makecom' instead of 'MAKECOM'. Output redirect: Standard the output of programs goes to the screen. In case of an output redirect the output goes to a file instead. The output redirect syntax is: > FILE COMMAND <cr> When COMMAND has been executed, FILE is automatically closed. Example: > FILE DIR Command DIR is executed and the output of DIR goes to FILE. Nothing is visible on the screen. Drive- and directory specification: If you enter a filename of a file which is not present on the default drive, you must specify the drive. As a rule the system drive is the default drive for all command files, whereas all other files are called from the user drive. The work drive can be regarded as a scratch pad or a general purpose drive. DOS65 specifies drives as follows: 0: drive 0 1: drive 1 2: drive 2 Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 12 S: systemdrive U: userdrive W: workdrive A drive specification must be terminated by the character ':'. Example: cat directory of user drive (default) CAT S: directory of systemdrive. LIST 0:FILE list FILE which is located on drive 0. Directory specification: DOS65 can allot 8 directories per disk, i.e. one root directory and se- ven sub directories. This facility acts as if the disk has been divided into 8 separate sections. At one time DOS65 has access to one directory only on each drive. If no directory has been selected or assigned the root directory acts as default directory. If for a drive a directory has been assigned, this directory is automa- tically selected if the drive is addressed. If you want to deviate from this directory assignment, you must specify the wanted directory with the filename in the same manner as you specify a drive. The root directory is specified by the character '@', the seven sub directories by 'A' through 'G'. A sub directory is automatically created if a file is written into this directory and deleted if empty. A directory specification is terminated by '/'. Examples: SAVE A/TEST write file TEST to userdrive directory A. LOAD 1:B/TEST load file TEST from drive 1 directory B. COPY 0:C/* 1:A/ Copy all files from drive 0 directory C to drive 1 directory A. For more ample information refer to utility ASN, chapter 4. DOS65 Error messages During a session situations can arise which result in an error message. These situations are: - an incorrect command is being entered, - DOS65 reports an error from within the system. In most cases DOS65 will return a short but adequate message, such as: 'read error', 'option error', etc. In rare cases however you could receive a message "error n"; 'n' representing an error number. A list of these error numbers follows: 1 memory full trying to LOAD a file which exceeds the available text buffer. 2 disk full a WRITE overfilling the disk capacity. 10 file specification filename exceeds 14 characters. 11 device or directory incorrect drive or directory spec. select 12 no filename command cannot be executed without a filename. 13 file not found verify filename, drive- or directory specification. 15 option incorrect option. 16 hex/dec data parameters incorrect. 25 delete protected disk mode is delete protected (-RW) 26 write protected " " " write " (-RD) Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 13 27 read protected " " " read " (-WD) 28 permission denied file is not a command file (not -C) 29 incorrect format command can only be executed with ascii files. 41 existing file entered file already existing (possible with the RENAME command). 42 not the same drive RENAME command with incorrect drive specification. 80 read error deficient disk. 90 write error " " C0 drive not ready no disk in drive or door not locked. D0 disk protected write attempt on protected disk. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 14 CHAPTER 3: DOS65 internal commands. Internal commands are commands for which the software is resident in the DOS65 program, the so-called kernel. This is in contrast to the utili- ties and external commands for which the software must first be loaded from a disk before the command can be executed. All commands may be typed in upper or lower case. Characters which are essential in the command descriptor are indicated in capitals in this manual. LC has the same effect as LCMD (LCmd), LO is the same as LOAD (LOad). In the description of the internal commands in this chapter, and of the utilities in chapter 4, the underlined characters constitute the command or the utility being explained. Options may also be typed in both upper and lower case. The sequence is not essential: -RWD has the same effect as -WDR. Parameters, such as those used in the SAVE command (BG,EN,ST), must be separated by a comma. If a DOS65 user gives a command, the system will first check if this is an internal command, as those described in this chapter. If the command cannot be found, DOS65 will check whether the command is available as a utility on the system drive. Those external commands will be described in chapter 4. If one wishes to select a drive other than the default drive with the command, one must add this instruction to the command. Example: The DIR command without any addition will provide the directory of the user-drive. Other possibilities are: DIR S: directory of the systemdrive, DIR U: directory of the userdrive, DIR 0: directory of drive 0, DIR 1: directory fo drive 1. Input/output redirect commands: Input redirect: normally input of data from the user to the computor is carried out by means of a keyboard. If input is redirected the keyboard will be temporarily disconnected and data will be fetched from a file. Output redirect: The output of a program normally goes to a screen. An output redirect will send the output to a file instead of to the screen. After execution of a command input and output will automatically return to their normal positions, that is: the keyboard and the screen. < FILE COMMAND. The input for command is fetched from FILE. This enables the user to initialise a command from FILE. <T COMMAND Reset input redirect, the keyboard is again released. In fact this command is redundant as normally an input redirect is reset automatically (see above). This command is only used in special cases. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 15 > [-TF] FILE COMMAND The output of command 'COMMAND' will be directed to file 'FILE'. This command enables the user to save the output on disk in order to process or rewrite it afterwards with the editor. If 'FILE' does not yet exist, it will be created. However, if 'FILE' does actually exist it will be overwritten by the new file, unless 'FILE' is write-protected. Also the existing file must be of the ascii type. Options: -T Output goes both to 'FILE' and to the screen. This can be useful if you want to survey the result of 'COMMAND'. Without this option the output goes only to 'FILE' and nothing will be visible on the screen. -F Output is filtered before being directed to 'FILE'. The filter removes all graphic and control characters. Often we do not need these characters in our file and they may even cause problems. The complete syntax of this command with options: > -T FILE COMMAND -T option only > -F FILE COMMAND -F option only > -TF FILE COMMAND both options are selected, this is the most frequently used version. >> [-TF] FILE COMMAND The effect is the same as > FILE COMMAND, but the output is ap- pended to the existing contents of 'FILE' and FILE is not over- written. Options: equal to > FILE COMMAND. >T COMMAND Reset output redirect: output is returned to video display. Like <T, this command is essentially redundant. It will only be used to reset a permanent redirect (see below '<>' command). >P COMMAND A special kind of output redirect, the output will not be direc- ted to a file but to the printer. Option: -T Output also to the screen. <> COMMAND Permanent redirect. This command maintains the input or output redirect after executing 'COMMAND' instead of the usual redirect reset. It can be used to record several results in a single file (output) or to fetch commands from a file (input). Example: < INPUT <> DIR executes the command 'DIR' and fetches the next command from file 'INPUT'. As the DIR command itself does not need any input, normally nothing will be read from file 'INPUT'. If you do not add '<>', the input redirect will be reset after executing DIR and the data in the INPUT file will not be used. Practical applications of this command are limited and you have to be careful in its use. @ FILE [parma parmb] Executes FILE as if it were a command file. It displays the ac- Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 16 tual command lines of FILE before executing these. In this res- pect the '@' command differs from a real command file (c bit set) which you execute by entering 'FILE <cr>'. In this case the commands in FILE will not be displayed. Options: parma parameter &1 parmb parameter &2 (c.f. chapter 2, section concerning indirect files). Example: Suppose we have a file TEST, which contains: ECHO This is file TEST. Entering '@ TEST' will return: ECHO This is file TEST. (the command entry) This is file TEST. (the result of the command) CHMODe -RWD FILE This command changes the mode of the file 'FILE' according to the options you enter. Some examples: CHMOD -R FILE Renders the file readable, the file can be read. CHMOD -W FILE Renders the file writeable, you can now write in the file. CHMOD -D FILE renders the file deleteable, the file can be erased. CHMOD FILE Nothing can be done with this file as it no longer has a mode. It can not be read, written or deleted. Combination options are possible such as -RW, -WD OR -RWD. As a more elaborate change-mode the utility SETMODE is available (c.f. chapter 4). DIR [-/] Shows the directory of a disk, the name of the disk and the num- ber of free blocks. A block represents 256 bytes. Option: -/ Also displays any sub-directories. Examples: DIR Directory of the user-drive. DIR 0: Directory of drive 0. DIR -/ Show all directories of the user drive. DIR -/ S: Show all directories of the system drive. Go XXXX Executes a program or subroutine which starts at address XXXX. XXXX is a hexadecimal number. If the routine ends by a RTS ($60) it returns to Dos after execution. LCmd Executes the last used utility, of which the software is still present in memory. This is a convenient way to recall the last utility without having to load the program of that utility again. One of many applications is the COPY utility when copying seve- ral disks. Supposing that two disks must be entirely copied, the first one will be copied as follows: Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 17 COPY -W 0:* 1: (Function *: c.f. chapter 5) As the program of the COPY utility after copying the first disk is still resident in memory, it is no longer necessary to reload the program again for copying the second disk. You can just type in: LC 0:* 1: You have to pay attention that nothing has been changed in that part of the memory where the utility resides, otherwise the com- puter will crash after LCmd. It is preferable to use this com- mand only immediately after loading a utility. LOad FILE BG,EN The file 'FILE' will be loaded in memory from startaddress BG till endaddress EN. BG and EN are both hexadecimal numbers. If BG and EN are not entered, the startaddress will be fetched from the file information block. If the file does not contain a startaddress (0) an error message will appear and LOAD will stop. Theoretically the maximum endaddress is $FFFF. If this address is exceeded there will also be an error message and LOAD will abort. In practice the maximum endaddress will be lower as the upper part of memory of a 6502 system is always in ROM. The command takes into account that the file may be recorded in binary format. A binary file can contain several distinctive blocks of machine code with different loading addresses. Therefore in a binary file the start addresses and the length are recorded with the file. If the user enters a different startaddress for a binary file, the startaddress in the file will be disregarded and the whole file will be loaded from the entered startaddress BG. When entering BG and EN you must be careful not to overwrite an area of memory where DOS65 or its workmemory resides. When loading long ascii files it is advisable to enter an endaddress which is below the startaddress of DOS65. Usually this start- address is $A000. Run FILE Loads 'FILE' from the indicated drive and executes this file. The file must be executable (SETMODE -E), otherwise it cannot even be loaded. Examples: RUN TEST Loads and runs file TEST from userdrive. RUN 0:TEST The same from drive 0. RUN S:TEST The same from systemdrive. SAve [-AB] FILE BG,EN,ST Writes a block of memory from BG till EN on disk under the name 'FILE'. It is essential to enter BG and EN in order to limit the memory block. If the startaddress of the program differs from BG, the startaddress of the program itself can be entered as ST. BG,EN and ST are all hexadecimal numbers. Be careful: If 'FILE' is an existing file and also not write- protected, it will be overwritten and erased. Options: Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 18 -A Adds the data to an existing binary file; in fact an append function. -B Records the file under binary format. Startaddress and length will also be recorded with the file. SEE FILE Shows an ascii file. It is in fact a simplified version of the LIST utility (c.f. chapter 4). STAT This command shows you which files are still open. Normally DOS65 will close all open files automatically after use. STAT is only used if, for safety reasons, you want to make sure that all files are closed before switching your system off. (See PRINT utility, chapter 4). SYNC This command closes all open files. Option: -N Does not close the file which is in the process of being printed. Special use: a premature interupt of the PRINT command. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 19 CHAPTER 4: DOS65 Utilities. >D COMMAND Output is redirected to a 'dummy routine'; the output of COMMAND goes nowhere. After executing the command output goes back again to the screen. (This utility is not used very often. A practical application is testing a program without getting the output, which you may not need at that moment.) APPend [-AQW] FILE1 FILEn FILE Put FILE1 till FILEn in FILE. Options: -A Append to FILE (without overwriting FILE). -Q Request first if the located file must be put into FILE. -W Wait after COMMAND to enable user to change diskettes. Examples: APPEND FILE1 FILE2 Put FILE1 in FILE2 APPEND -A FILE3 FILE2 Add FILE3 to FILE2 APPEND FILE1 FILE2 FILE3 FILE Put files FILE1, FILE2 AND FILE3 in FILE. If only APPEND is entered, without filenames and options, a menu of the APPEND command is dispayed on the screen. AS [OPTIONS] FILE Assembles the sourcefile FILE. FILE must have an extension .mac. AS65 generates code which defaurlt will be written in file FILE.bin. For more information see AS65 Manual. ASN DRIVE= drive specification, directory specification. Defines systemdrive, userdrive, workdrive and directories. The use of the characters '=', ':' and '/' is optional (c.f. the examples below). Without an entry for the directory the drive specification will apply for the home directory. Without an entry for the drives the directory specification will apply for the user drive. If you only enter ASN without parameters, the command will return with the specifications actually in use. Examples: ASN S=0/@ U=1 system drive 0, user drive 1. ASN S0 1 system drive 0, user drive 1. ASN 1 User drive 1. ASN W1:A/ work drive 1, directory A ASN 1B user drive 1, directory B ASN B user drive directory B ASN without parameters will return in this example: S=0: U=1: W=1:G/ We suggest the following settings for systems with two drives: ASN S=0: U=1: W=1:G/ which you can incorporate in the file LOGIN.COM. The specifications will then be: system drive 0 user drive 1 home directory work drive 1 directory G. BOOTLINK FILE Due to the new organisation of the diskdrives in DOS65 version 2.01 it is essential to use this utility after copying the BOOT Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 20 file. This is the case after copying the system disk, making a back-up of this disk, etc. If you wish to copy the systemdisk from drive 0 to drive 1, the proper procedure is: COPY 0:* 1: Copy all files from drive 0 to drive 1. BOOTLINK 1:BOOT Execute BOOTLINK on file 1:BOOT. BOOTLINK places a pointer in a specific location on the disk. This pointer is necessary to load BOOT (that is DOS65 itself) from IO65 by means of a B command. The bootstrap-loader in IO65 cannot recognise the file BOOT if this pointer is not properly set and as a result it will return a BOOT READ ERROR. CAt FILE CAT (catalogue) command lists a directory with full information of the disk. This information consists of the mode of each file, its number in the directory, the filename, the start address, the length, the date and time of creation or modification of the file. There is a header with the name of the disk and its date of creation and at the bottom the number of free blocks is printed. (A block is 256 bytes) Examples: CAT Prints all files on the userdrive. CAT 0: All files on drive 0. CAT *.TXT All files (on userdrive) of which the filename ends with '.TXT' CAT FILE Abovementioned information of file 'FILE' only. Note: The function of the asterisk (*) is explained in chapter 5. CLear Clears the screen. COpy [-PQW] FILE1 FILE2 Copies FILE1 to FILE2. If FILE2 has not been entered, the name of FILE1 will be used. However, in this case the copy of FILE1 must be recorded on a different disk than FILE1, otherwise FILE1 would be written twice on the same disk (c.f. examples). FILE1 is usually a single name, but it could be several names provided these are separated by a comma and are recorded on the same disk. Options: -P Print a list of files which are being copied. -Q Request first if the located file must be copied. -W Wait after starting and subsequently every time a new disk must be inserted in the drive. Examples: COPY 0:FILE1 1: Copy FILE1 from drive 0 to drive 1. COPY FILE1 FILE2 Copy FILE1 to FILE2 on the user drive. COPY 0:* 1: Copy all files from drive 0 to drive 1. Copy -W 0:* 1: Same as above, but wait before actually copying to enable the user to change disks. COPY 1:*.TXT 0: Copy all files from drive 1 to drive 0 which end by '.TXT'. If you only type COPY without options or FILE a menu of the possibilities of the COPY command will be dispayed. Note: The function of the asterisk (*) will be further explained in Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 21 chapter 5. CREate FILE Creates an empty ascii file with filename FILE. If FILE already existed it will be overwritten. The prompt will now change in '&' and all typed-in characters will be written in FILE. The last character can be erased by the <del> key. If at the beginning of a new line control D (CTL D, $04) is typed in followed by a <cr> FILE will be closed and the CREATE routine will be abandoned for a return to Dos. DDoctor This utility enables you to read specifific sectors of a disk. The sector which has been read in is placed in a buffer and it is possible to move this buffer to a second buffer and vice-versa. In this way a sector can be moved or copied. The contents of the buffer can be modified in two ways: per nibble or per ascii character. DDOCTER has two possibilities to address a sector. The first one is 'logical' meaning that the sectors are numbered in accordance with the interleave factor of the disk (c.f. FORMAT command). The second possibility is 'physical', in this case sectornumbers correspond with the physical location of the sector on the track without taking the interleave factor into account. The default addressing mode is 'logical' addressing. A modified sector can be written back on the disk. It is also posible to search for a specific hex- or asciistring within a sector, a track or on the whole disk. Warning: If you use this utility in a careless or inappropriate way you risk destroying files or a whole disk. With this utility you can obtain access to the internal DOS65 organisation and its directory. We suggest that experiments should only be made using obsolete disks. DELete [-YW] FILE Erase FILE from disk. Options: -W Wait after start to enable user to change disks (if you only have one drive). -Y Delete without previously requesting whether the located file may be deleted. This is a negative option i.e. nor- mally DOS65 will always request prior permission before deleting a file. Examples: DELETE FILE Delete FILE from the user drive. DELETE 0:FILE Delete file from drive 0. DELETE -Y FILE Deletes FILE from user drive without requesting prior permission. DELETE -Y 1:* Deletes all files from drive 1 without requesting prior permission. The whole disk will be erased. DPTime [s] Sets the display time. To avoid a burning-in of the CRT screen the display will be blacked out if no key has been pushed during the time set by [s]. This display-time is entered as a number of seconds between 0 and 65535. Pushing any key reactivates the screen. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 22 DPTIME without parameter displays the last entered value. The default value is 1800 seconds (30 minutes). Examples: DPTIME <ret> returns with:"1800 seconds". DPTIME 60 Sets the display time to 60 seconds. DUmp [-CEM] FILE Displays FILE as a hexdump. Options: -C Clears screen before displaying hexdump. -E Loads FILE into 4 KByte buffer before starting hexdump. -M Stops hexdump after 20 lines. In order to display the remainder of the file use the following keys: <cr> the next line. D the next 10 lines. <space> the next 20 lines. C clear screen and the next 23 lines. CTL C abandon the command, return to Dos. ECHO [-N] TEXT This command send the word 'TEXT' to the display. ECHO ABC puts ABC on the screen. The idea behind this command is that the screen could be an intelligent terminal which can be put into a certain mode by means of the ECHO command. A special application is >P ECHO TEXT. The text will now be sent to the printer in order to put it in a certain mode (lines per inch, special characters, margin, etc.). TEXT may contain any character which you need to set your ter- minal or printer, including all control characters. Option: -N No <cr>($0D) and <lf>($0A) will be sent after TEXT, which normally is automatic. Example: Supposing that a printer can be put into 'elite' mode by sending ESC B, the proper command would be: >P ECHO -N <esc>B EDitor [FILE] Starts the full screen editor and wordprocessor ED65. If FILE is entered and it is an existing editor file, it will be read in. This FILE will then become the edit file (c.f. ED65 manual). FORMat Formats a disk for DOS65. FORMAT asks the following questions: (* = default value). Drive (0,1* or 2)? Enter here the number of the drive in which you have inserted the disk to be formatted. 40(Y) or 80(*) tracks, 2 steps/track(2)? Enter here whether you use a 40 or a 80-tracks drive. It is pos- sible to format with 2 steps per track; this enables you to format a 40 tracks disk with an 80 tracks drive. Single(Y), Double(*) or Extra density(X) Density? Type in the desired density. Attention: extra density cannot be used for system-disks ! Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 23 Single(Y) or Double(*) sided? This depends on the kind of drive you use. Interleave factor (2, 3*, 4 or 5)? Enter here the interleave factor. If you only enter a <return> after the preceding questions, DOS65 will insert the default values (*). Consequently your disk will be formatted as follows: Drive 1, 80 tracks, double density, double sided, interleave factor 3. After receiving the answers to these questions FORMAT requests: Insert diskette in drive n n represents the drive number you have previously indicated. Next FORMAT will ask: Are you sure? If you now answer 'N' the disk will not be formatted, it is now advisable to check whether you have put the proper disk in drive n. If you enter 'Y', FORMAT will ask: Name of diskette ? After typing in the diskette name (maximun 20 characters), the disk will be formatted. If a malfunction occurs during formatting the routine will be terminated and track and sectornumber of the malfunction will be put on display. If the disk has been well formatted and all tracks on the disk check out properly, DOS65 will return with the line: 'succesful format'. TABLE of diskcapacity in 'free blocks' in relation to the drive. Between parenthesis the capacity in KBytes. single-density double-density extra-density 40 tracks, single-sided 397 ( 99) 637 (159) 717 (179) 40 tracks, double-sided 797 (199) 1277 (319) 1436 (359) 80 tracks, single-sided 797 (199) 1277 (319) 1436 (359) 80 tracks, double-sided 1596 (399) 2556 (639) 2876 (719) Further explanation about the notion 'interleave factor': Data is recorded on disks in tracks (40 or 80 per side). The tracks are divided into sectors. The number of sectors depends on the recording format: single-, double- or extra-density. At single-density the number of sectors per track is 8, at double-density 16 and at extra-density 18. Each sector contains 256 bytes. During the formatting operation each sector receives a number indicating the order in which sectors will be read or written. You also should know how DOS65 reads and writes on disk. DOS65 cannot transfer a large block of memory in one single go, but transfers take place in blocks of 256 bytes, in fact in sectors of 256 bytes. In the following simple example we will explain a read operation with sectors of 8 tracks each. Supposing that DOS65 has been ordered to read in one complete track of 8 sectors, the following sequence will take place: - DOS65 waits until sector number 1 passes, - sector #1 will be read into the sector buffer, - the contents of the sector buffer will be blockmoved to the destination address, Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 23 Single(Y) or Double(*) sided? This depends on the kind of drive you use. Interleave factor (2, 3*, 4 or 5)? Enter here the interleave factor. If you only enter a <return> after the preceding questions, DOS65 will insert the default values (*). Consequently your disk will be formatted as follows: Drive 1, 80 tracks, double density, double sided, interleave factor 3. After receiving the answers to these questions FORMAT requests: Insert diskette in drive n n represents the drive number you have previously indicated. Next FORMAT will ask: Are you sure? If you now answer 'N' the disk will not be formatted, it is now advisable to check whether you have put the proper disk in drive n. If you enter 'Y', FORMAT will ask: Name of diskette ? After typing in the diskette name (maximun 20 characters), the disk will be formatted. If a malfunction occurs during formatting the routine will be terminated and track and sectornumber of the malfunction will be put on display. If the disk has been well formatted and all tracks on the disk check out properly, DOS65 will return with the line: 'succesful format'. TABLE of diskcapacity in 'free blocks' in relation to the drive. Between parenthesis the capacity in KBytes. single-density double-density extra-density 40 tracks, single-sided 397 ( 99) 637 (159) 717 (179) 40 tracks, double-sided 797 (199) 1277 (319) 1436 (359) 80 tracks, single-sided 797 (199) 1277 (319) 1436 (359) 80 tracks, double-sided 1596 (399) 2556 (639) 2876 (719) Further explanation about the notion 'interleave factor': Data is recorded on disks in tracks (40 or 80 per side). The tracks are divided into sectors. The number of sectors depends on the recording format: single-, double- or extra-density. At single-density the number of sectors per track is 8, at double-density 16 and at extra-density 18. Each sector contains 256 bytes. During the formatting operation each sector receives a number indicating the order in which sectors will be read or written. You also should know how DOS65 reads and writes on disk. DOS65 cannot transfer a large block of memory in one single go, but transfers take place in blocks of 256 bytes, in fact in sectors of 256 bytes. In the following simple example we will explain a read operation with sectors of 8 tracks each. Supposing that DOS65 has been ordered to read in one complete track of 8 sectors, the following sequence will take place: - DOS65 waits until sector number 1 passes, - sector #1 will be read into the sector buffer, - the contents of the sector buffer will be blockmoved to the destination address, Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 24 - DOS65 will now wait for sector #2 to pass under the recording head, - sector #2 will be read into the sector buffer, - again a blockmove to destination, - and so on until sector #8. The notion 'interleave factor' is directly related to the waiting process we described above. If we select 'interleave factor '1', the sectors are numbered as follows: 1 2 3 4 5 6 7 8 In the above example we saw the following sequence: - sector #1 was read in and blockmoved to destination, - however, during this operation sector #2 has already passed the recording head and DOS65 must now wait for the next pass of sector #2 after almost a complete revolution. In order to read one complete track of 8 sectors DOS65 would need 8 revolutions. By choosing a different interleave factor this delay can be considerably reduced. If we set the interleave factor at 3, the sectors will be num- bered as follows: 1 4 7 2 5 8 3 Between sectors 1 and 2 we now find sectors 4 and 7 and if we apply this to our example you will see that DOS65 no longer needs to wait one revolution before locating the next sector. The new sequence will be: - sector #1 has been read in and blockmoved. In the meantime the disk has continued to rotate and the head will be somewhere over sector #7. - DOS65 starts waiting for sector #2, which now comes after sector #7 ! It is no longer necessary to wait one full revolu- tion. You will now understand that the transfer speed between the computor and the disk is partially determined by the interleave factor. A proper selection of this factor will render the best possible transfer rate under the given circumstances. We have found the value of 3 to be a good compromise for most applicat- ions. However, you are free to experiment with other values if you like; the interchangeability of DOS65 disks is not affected by the interleave factor. HElp [FILE] This utility provides an explanation of the internal commands and utilities of DOS65. If FILE is entered you will only receive information concerning FILE, provided this information is avail- able. LIst [-CELMN +m,n] FILE Displays FILE. FILE must be an ascii file, otherwise DOS65 will return an error message. Negative characters will be printed as '~' characters. DEL ($7F) and control characters will be printed as '^' charac- ters. A TAB character ($09) is executed as 8 spaces. Options: -C Clear screen first. -E Use a 4 Kbyte buffer. -L Print a linenumber in front of each line. -M Pause after a certain number of lines. To continue listing the file you may use the following keys: Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 25 <cr> next line. D the next 10 lines. <sp> the next 20 lines. C clear screen and display the next 23 lines. CTL C Abandon LIST command. -N Do not convert <cr> as <cr> and <lf>. +m,n Display FILE from line n till m; lines are counted according to the number of <cr> ($0D) characters. Note: The -N option is used with printers which generate an automatic linefeed after receiving a <cr>. MAP FILE Shows how a binary file is loaded in memory, i.e. the memory blocks of which the file consists. At the end will be displayed the startaddress of the file (if available). Example: MAP S:EDITOR will return with the display: 2000-3FFF 0400-04FF 0600-06FF 0580-05FF 0700-07FF 2000 (this is the startaddress). MEMFill BEGIN,END,DATA Fills a block of memory from address BEGIN till END with byte DATA. This command must be used with care because if you fill that part of memory where DOS resides (usually $A000-BFFF) your system will crash. Example: MEMFILL 2000,2FFF,AA Fills memory from $2000 till $2FFF with data AA. MEMMove BEGIN,END,DEST A block of memory from address BEGIN till END will be moved to address DEST and further. This is performed in an intelligent way, implying that DOS65 checks where to start. If the memmove is 'up', meaning to a higher address, the program will start moving the highest address upwards. Vice-versa for a move downwards. This way a memory block can be moved to an overlap- ping location. Example: MEMMOVE 2000,2FFF,2800 Data from memoryblock $2000 till $2FFF are moved to $2800 and upwards. This is an overlapping memmove. MONitor Jumps to monitorprogram MON65, c.f. MON65 manual. MTOAS [-OTFLU] FILE Converts an assembler source file from MOSER format to AS65 format. This utility is especially intended for users who pre- viously wrote their sourcefiles in MOSER and wish to change to AS65. It is interesting to convert former MOSER files to AS in view of the enhanced possibilies and higher assembling speed of AS. FILE must have extension .txt to be processed. Files generated by MTOAS receive the same filename FILE, but with the extension Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 26 .mac. This extension is essential for processing by the AS65 assembler. Options: -O Output FILE.mac will not be generated. -T Output also to screen. -F No output formatting. Between each field of source code a space will be inserted instead of a tab character. -L Label, opcode and operand fields are converted to lower case. -U Same as above, but conversion to upper case. NOTE: The option -O seems senseless as no output file is produced. It can be used however together with the T option as -OT, which allows you to make a trial run of the conversion and monitor the result on the screen. OLOad FILE OFFSET Loads a binary file in memory, but takes into account the value of OFFSET which is added to the load addresses in the file. OFFSET must be a positive number and the sum has a maximum of 64K. Beyond that number, 64K is substracted from the result. Examples: OLOAD FILE 1000 Loads FILE $1000 higher in memory. OLOAD FILE F000 Loads FILE $1000 lower in memory. PLIst [-Bn -Cn -E -F -Hn -Ln -Mn -N -On -Pn -Tn -U -W] FILE List FILE with a page format. FILE must be an Ascii file. On each page a header is printed showing time, date, filename and page number. Options: -Bn Break after n characters the column and continue on the next line with the remaining characters. -Cn Omit all characters beyond n in each column and continue with the next line. The B and C options are useful when printing in 2 columns. -E Do not print a heading (time, date, page, etc.). -F Print a formfeed ($0C) instead of empty trailer lines. -Hn Print n empty header lines on top of each page. In case of a heading line with text, this line is included in the number. Default value of n is 3. -Ln Total number of lines per page (default is 72). The number of printed lines per page is the total number minus the header and trailer lines. (Default 72 - 3 - 3 = 66). -Mn Print file in 2 columns. The second column starts at column n. If a line of the first column is longer than n, the line of the second column will be printed imme- diately behind the first column. The lenght of the column is determined by the number of lines per page (-Ln). -N Print file with linenumbers in front of the text. -On Print n spaces at the beginning of each line (left hand margin offset). This applies to the first column only. -Pn Start page numbering by n. Default is 1. -Tn Print n empty trailer lines at bottom of each page. Default value is 3. -U If possible replace multiple spaces by tab characters (file compression). Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 27 -W Wait after each page to change paper. In this case no empty trailer lines will be printed. Note 1: The options of this command vary slightly from the usual option syntax. Normally you may enter all options at the same time, but in PLIST you must enter these separately. For instance -EHL066W is not allowed, but must be typed in as: -E -H0 -L66 -W. Note 2: Default the output of this command is directed to the screen. In order to redirect the output to the printer you must enter >P PLIST FILE. If only PLIST is typed in without options or filenames the com- mand will return a menu of possibilities and options. PRint [-FNPT +m,n] FILE1 FILE2 Prints FILE1 on the printer and also FILE2 if this filename was entered. Options and parameters are valid for both files. Printing is performed as a background activity, that is, if the computer is not busy with other tasks. It implies that you can utilise your computer normally while printing is in process. This is called the SPOOLING principle. There is no printing during disk access or when the printer is not ready. Options: -F Print formfeeds ($0C) instead of empty trailer lines. -N Do not convert <cr> as <cr> <lf>. -P Print in page mode. This is only possible if the -N option has not been retained. The page size may be ad- justed by +m,n (see below). -T Do not expand tabs, i.e. Tab characters will not be replaced by a certain number of spaces. However, tabs can only be expanded if the -N option has not been retained. This option is only useful if the printer is capable of processing tab characters ($09). Normally this option is not used very often. +m,n Defines a new page size. M determines the total number of lines per page, whereas n adjusts the number of printed lines. If you enter m=0, n will still determine the number of printed lines after which a formfeed ($0C) is transmitted. However, if you only enter m, n is set as m minus 6 (6 empty lines). REName [-W] FILE1 FILE2 Rename FILE1 filename FILE2. FILE2 should not yet exist on that disk and obviously select the same drive as FILE1. Option: -W Wait after start to change disks. Examples: RENAME OLD.TXT NEW.TXT Change filename OLD.TXT into NEW.TXT on the userdrive. RENAME -W 0:JIM 0:BOB Change filename JIM into BOB. The file is recorded on the disk in drive 0. Wait after start to change disks. RS232 Adjusts the parameters of the ACIA 6551. Without this utility you would have to set individual bits in the Acia command- and controlregister. RS232 allows you to easily adjust the following parameters: baudrate, wordlength, parity, stopbits, receiver clock, receiver mode, receiver interupt, DTR and transmit Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 28 status. The utility has 6 commands: H displays the help menu. CTL H shift left in the present parameterfield. CTL I shift right in the present parameterfield. CTL J to next parameterfield. CTL K to previous parameterfield. Q Quit RS232 utility. After entering the Q command you will be asked if the present status should be written on disk. In that case these data will be recorded on the systemdisk with filename RS232.DAT. This data can then be loaded in a subsequent session by typing in LOAD RS232.DAT or even automatically if you incorporate this command in the commandfile LOGIN.COM. SDir [-IS] Display a directory in alphabetical order. Options: -I Non-significant characters of the filenames will be displayed inverted. Non-significant characters are characters which need not be typed in when entering the name of a utility. -S Display output in a single column. Examples: SDIR Alphabetical directory of the userdrive. SDIR -I S: An alphabetical directory of the systemdrive. On the systemdrive are recorded all utilities. As all non-significant characters of the utilities will be displayed inverted, you can easily see how to type in the abbreviated names of these commands. SDIR -S Provides an alphabetical directory with all filenames under each other in a single column instead of in five columns. This can be very convenient if you wish to copy a disk. By means of an output redirect you can write the output of SDIR to a command file. In the editor you type COPY in front of each line and by executing this command file you will obtain a copied disk with all filenames in the direcory in alphabetical order. SETBegin FILE BEGIN Changes the startaddress of FILE to BEGIN. When developing software in the assembler it is not always possible to store the object code immediately in the proper memory block. If the object code is for instance written for startaddress $2000 you cannot store the object code there during assembly as the assembler itself would be overwritten and certainly crash. In such a case the object code is stored in a safe area of memory, recorded on disk and afterwards you can set the proper startad- dress of the file by the SETBEGIN command. Example: Supposing you are writing a program which will operate from address $2000 till $2100. In Moser source code you will include .BA $2000 but you will add .MC $8000 in order to store the gene- rated object code in address $8000 and up,as $2000 is not avail- able during assembly. This object code is then written on disk by the DOS65 command SAVE FILE 8000,8100 and FILE will automatically obtain the Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 29 startaddress $8000. By typing in SETBEGIN FILE 2000 you can cor- rect this and FILE will now start at $2000. Please note that you do not need this command with our assembler AS65 as this produces binary files. In these files load- and startaddresses are written in the file itself and the use of SETBEGIN is senseless. SETDrives t1,t2 Sets the headselect time to t1 and the motor-on time to t2. The default values are 5 seconds for t1 and 8 seconds for t2. After DOS65 has finished reading or writing the recording head remains in contact with the disk for t1 seconds and the motor continues to turn for t2 seconds. These default values are a good compromise between the extra wear during t1 and t2 on one hand, and wear caused by frequent head loads and motor starts on the other hand. SETMode -RWDPCE FILE Changes the mode of a file. -R Readable, the file can be read. -W Writeable, one can write in the file. -D Deleteable, file can be erased. -P Not yet in use. -C Command, the file can be used as a command file. -E Executable. -CE This combination sets the mode at X, but is not yet in use. Combinations of these modes are possible, so SETMODE -RW FILE renders a file readable and writeable. You can change the mode of several files at the same time by typing in the filenames separated by a comma or by using special characters (c.f. chapter 5). SETPrompt abcd Changes the standard DOS65 prompt ($) into a prompt of maximum 4 ascii characters of your own choice. Examples: SETPROMPT + <cr> Changes the prompt into '+' SETPROMPT CTL G$ <cr> prompt: a beep followed by '$' SETRtc [H,M,S [D,M,Y]] Sets time and date of the real time clock if this device is im- plemented. You do not need to enter the date if you only wich to set the time. Time or date must be typed in completely and in decimal numbers. If you only enter SETRTC without arguments the command will print time and date. If you use the command without an RTC board being connected you will receive an error message. SETUp This utility should be executed at the beginning of a session as part of the file LOGIN.COM. The functions of this command are: - copy the real time clock registers in the appropriate DOS65 registers. - display a 'Hello' screen. The command will return an error message if a RTC board is not connected to the system. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 30 TIme [H,M,S [D,M,Y]] Set time and date of the internal clock, which is not a real time clock and only provides this function if no real time clock is build in. You do not need to enter the date if you only wish to set the time. Time or date must be typed in completely and in decimal numbers. If you only enter TIME without arguments the command will print time and date. TYpe [-CELMN] FILE Displays an ascii file, the difference with LIST being that characters are printed literally, which means that control characters will be displayed by their hexadecimal value. Options: identical to LIST. UNEXpand [-A] FILE Replace two or more spaces ($20) by one or several tab charac- ters ($09) but only if these spaces are at the beginning of a line. A tab is set as being equal to 8 spaces. Option: -A Replace spaces everywhere in the line and not only at the beginning. VFORmat [-Y] Formats the virtual disk, if present in the system. The command itself determines how much memory is available on the virtual disk. The virtual disk is defined as disk 2: Option: -Y The command does not ask prior to formatting "Are you sure ? (Y/N)". Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 31 CHAPTER 5: FILENAMES AND SPECIAL CHARACTERS. WARNING: This chapter deals with a number of special facilities of DOS65. For the experienced user these possibilities can be very useful. It will allow you to enhance your work with D0S65. However, we have to warn you against unexpected results of the exercises described below. Therefore the following advice: - Never use disks with important files, such as the system disk, etc. - Prepare some 'dummy' files on a separate disk and use this disk for your experiments. This way nothing important can be erased. Some general advice on this subject: - Prepare at regular intervals copies (backups) of important files and disks. Disks are also subject to wear and magnetic information slowly deteriorates, even if it is not read or used. - Never keep your backups with the other disks but store them in a safe place. - Regularly refresh your backups by copying them anew. - Do not put disks on top of your monitor as the magnetic field of the CRT may damage them. - Always remove your disks from the drives before shutting the system down. Filenames. A file is exclusively defined by its name. A filename may be 14 charac- ters long and may contain all characters except: <zero> (Nul $00 <cr> (Carriage return $0D <sp> (Space $20 <,> (Comma $2C Moreover there are special characters which are material when entering a filename: % Defines all following characters as being valid. This implies that the characters $, %, :, `, ^ and ~ may be used in a file- name. Also negative characters (bit 7=1) are allowed. However, the special function of '?' and '*' is eliminated. Example: CREATE %$$$$$$ Creates a file with filename '$$$$$$' \ The effect resembles that of '%', but the escape function is valid for only one character. Example: CREATE \$\%\%\$ Creates a file with filename $%%$ $ Defines all characters following the character '$' as being non- significant. This is a convenient way to abreviate the name of a utility. The filename does not have to be typed in completely if it has been defined in this manner. Example: The system-user has written a utility with filename 'NEWCOMMAND'. In order to execute this utility you must type in NEWCOMMAND <cr>. It is now possible to modify this filename in such a way that only NEWC <cr> has to be entered. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 32 Procedure: - The file is renamed to a temporary filename, which should not already be present on the disk. Command: RENAME NEWCOMMAND DUMMY - This temporary name is renamed back to the original name but now with the addition of '$'. Command: RENAME DUMMY NEWC$OMMAND. Note 1: In the directory the full name NEWCOMMAND will be written, but NEWC <cr> is sufficient to execute the command. NEWCO, NEWCOM, etc have the same effect, however any additional characters you type in should be correct. The command NEWCA for instance will be refused. Note 2: Renaming to a temporary file is necessary, as DOS65 does not accept the command RENAME NEWCOMMAND NEWC$OMMAND. For D0S65 the two filenames are identical. Note 3: The above procedure is only valid for utilities, that is for command files with filemode C set which are called directly from DOS65. For all other files you must enter the complete filename. Note 3: Pay attention not to abreviate two filenames identically. The commands NEWC$OMMAND and NEWC$ATALOGUE may appear different but the abbreviations are the same. If you enter NEWC<cr> in this case, DOS65 runs the corresponding file it encounters first in the directory. Wildcards. A filename which is entered by the user does not have to correspond com- pletely with the filename in the directory. There are three so-called wildcard characters which can be used to replace characters in the file- name. ? The interrogation mark '?' can replace just one (1) character in a filename. This implies that any one character in this place is correct. Example: DIR TE?T Displays all filenames of which the first two characters are TE and the last character a T. The third character is immaterial. * The '*' character replaces 0 or more characters in a filename. This is convenient way to enter just the first few characters of a filename and to consider the remainder as 'don't care'. It also enables you to compare a number of characters in the middle. Examples: DIR *.TXT Displays all filenames which end by 'TXT'. DIR *COM* Displays all filenames which contain the characters COM. DIR TEST* Displays all filenames which begin with TEST. ~ The function of this character is the reverse of the previous two wildcards, DOS65 will not display certain filenames if this character is used in the typed-in filename. Example: DIR *~.b Displays all filenames except those which end by the extension '.b'. Copyright (c) de 6502 Kenners 1986 DOS65-2 Manual Page 33 Note 1: In the above examples we only used the DIR command. Of course the wildcards can be used with any filename. Note 2: Of the above wildcards the * is most often used in practice, see for instance the COPY command. Note 3: We recommend not to use the wildcard * in connection with a function which creates a file (SAVE, CREATE, etc.). Suppose there is already a file 'TESTFILE'. If you would enter now SAVE TEST* 2000,2FFF the file TESTFILE will be overwritten and erased. Upper and lower case. When opening an existing file by typing in its filename for reading or writing in this file, the filename can be entered both in lower and up- per case. If there is an existing file named 'TEST', you can call this file by: LOAD TEST but also by: LOAD test. FORMAT has the same effect as: format. However: When files are created the filename is inserted in the directory in the same way as it was typed in, that is in either lower or upper case. But when writing in a file, DOS65 does not make any distinction between up- per and lower case. This could lead to loss of a file. Therefore never create two files with the same filenames, one being in upper and the other in lower case. Example: Suppose we enter the command: SAVE test. If the file 'test' does not yet exist, it will be created with the filename 'test' in lower case. If the file 'test' did in fact exist, DOS65 will write in this file. But if there is an existing file 'TEST' in upper case, a file 'test' will not be created and the file 'TEST' will be overwritten ! Copyright the 6502 Kenners 1986 DOS65-2 Manual Page 34 APPENDIX: DOS65 INSTALLATION MANUAL. First of all make sure that your hardware is in perfect working order and in conformity with our hardware manual. Installation is nor- mally very simple and most problems are caused rather by harware defi- ciencies than by our software. Insert the supplied DOS65 eproms in the appropriate sockets. The diskette is single sided and either 40- or 80-tracks, depending on your system. Put this diskette in drive 0 and reset. The system will now enter into I/O65. By typing in B, you will activate the bootstrap and start DOS65. At the end of this appendix you will find a number of instruct- ions which depend on the number and kind of your drives. If you are in doubt or if you cannot find a command you may use the HELP facility; type in HELP followed by the desired command name. Just the command HELP displays a list of all valid commands. By typing in a <return> DOS65 re- turns to the command mode. GENERAL. - Start by making a copy of your systemdisk. Do not forget the BOOTLINK command which you must always use after copying a systemdisk. Extra Density is not allowed for a system disk. If necessary, type in after the DOS65 command prompt ($): HELP COPY <return>. - Start D0S65 from the diskette you have just copied (reset and B) and call the configuration program (CONFIG). This program allows adjusting DOS65 to your drives and installs the real time clock program on address $E120 for the Elektor clock board. If you use a different r/t clock board you may have to make other adjust- ments. - CONFIG will ask a number of questions about your system, such as drive steprate, Xtal frequency of the r/t clock, which kind of CRT controller (6545 or 6845), etc. After answering all the questions a new DOS65 will be created and the proper R/T clock routines installed. You must now reset and startup again. - Except for the storage capacity, it does not make a difference whether you use 40- or 80-tracks drives. If you have 80-tracks drives you can still use (format, read & write) 40-tracks diskettes. DOS65 checks itself whether a diskette is 40- or 80- tracks and acts accordingly. For a 40-tracks disk in an 80-tracks drive D0S65 will supply two stepping pulses to step to the next track instead of one; there is no need to adjust the hardware. However, sometimes there are reading problems if a real 40-track drive tries to read a 40-tracks disk made on a 80-tracks drive. A real 40-tracks drive tends to record data 'louder' and also expects a 'louder' signal back. These kind of problems are rare, however. Copyright the 6502 Kenners 1986 DOS65-2 Manual Page 35 - Continue now with one of the following paragraphs: 1 Drive, single-sided. This system is ready to be used. Please note the following in- structions: - Format your disks single-sided only; double- or extra density can be used if the diskettes permit this. - If calling an utility, use the Wait option which allows you to change disks after reading in the utility program. 2 Drives, single-sided - Before starting a session type in the command: ASN U=1: Drive 0 will now be assigned as systemdrive and drive 1 as user- drive. We recommend that you incorporate this command in the file LOGIN.COM. - Format your disks single-sided only; double- or extra density can be used if the diskettes permit this. 1 Drive, double-sided. This system is ready to be used. Please note the following in- structions: - If calling an utility, use the wait option which allows you to change disks after reading in the program of the utility. 2 Drives, double-sided. - Before starting a session type in the following command: ASN U=1: Drive 0 will now be assigned as systemdrive and drive 1 as user- drive. We recommend that you incorporate this command in the file LOGIN.COM. - Format you disks as you wish. If you make a diskette for a friend who only has single-sided drives, format that disk accor- dingly. Command list of MONITOR @ xxxx Modify address (use up and down arrow keys to go forwards and backwards through memory). B xxxx Breakpoint address B S Set breakpoint B R Remove breakpoint. C a1,a2,xx Memory between a1 and a2 compared to xx D xxxx Dissasemble from xxxx E xxxx Execute address xxxx F a1,a2,xx Fill memory between a1 and a2 with xx H a1,a2 Hex and ascii dump of memory between a1 and a2 M a1,a2,a3 Memory between a1 and a2 is copied starting at a3 L List registers P Clears screen - purpose not known Q Quit S a1,a2 Work out checksum of contents of addresses a1 to a2 V a1,a2,a3 Memory between a1 and a2 is compared to memory starting at a3 W a1,a2,xx.. Memory between a1 and a2 is searched for number or string xx + x,y Performs 16 bit hex addition x+y - x,y Performs 16 bit hex subtraction x-y $ xx Converts decimal to hex # xx Converts hex to decimal < Continue execution from previous address ^S Pause during memory dump ^C Abort memory dump ^Y Repeat previous command line Functie beschrijving van DOS65. ------------------------------- In DOS65 zijn standaard functies gedefinieerd die het filesysteem bijhouden. Dit zijn: - Create Maak of open file om in te schrijven. - Open Open file om uit te lezen en/of in te schrijven. - Close Sluit file. - Delete Verwijder file. - Rename Geef de file een andere naam. - Status Haal informatie op over de file. - Read Lees uit de file. - Write Schrijf in de file. - Seek Zoek in de file. Een file is uniek gedefinieerd door zijn naam. Deze mag 14 karakters lang zijn en mag bestaan uit alle karakters behalve <nul>, <cr>, <sp> en ','. Negatieve karakters (bit 7=1) zijn normaal niet toegestaan. Speciale karakters tijdens het definieeren van de filenaam. - ~ Zet een vlag zodat het resultaat na afloop van de filenaam vergelijking met de directory entry omgedraait wordt (true <-> false). Dit kan handig zijn om een file te nemen die ongelijk is aan de de opgegeven filenaam. - ^ Hiermee wordt er expliciet geen verschil meer gemaakt tussen kleine en hoofd letters. Dit verschil wordt ook opgeheven indien in DOSMODE bit 7 staat of bit 6 en er gezocht wordt naar een commando. - % Definieer de volgende karakters als letterlijk. Dit betekent dat de karakters $, %, :, \, ^ en ~, geen speciale functie meer hebben en ook dat er negatieve karakters toegelaten worden. Tevens wordt er bij het vergelijken van de directory entry met de opgegeven filenaam de functie van '?' en '*' uitgeschakeld. - $ Definieer de volgende karakters als negatief. Dit betekent dat als er een commando wordt gezocht, dat deze karakters dan don't care zijn in de zin van dat ze niet noodzakelijk moeten worden opgegeven. Dit karakter heeft alleen zin als de file gecreerd moet worden. Immers alleen dan worden er negatieve karakters in de directory geplaatst. - \ Verzorg een escape functie. '\$' plaatst dus '$' in het filenaam buffer ('\\' plaatst '\' in het buffer). Een ander onderdeel van de filenaam is de selectie van de drive. Deze wordt gedefinieerd aan het begin van de filenaam in de vorm van `n:' waarbij `n' het drivenummer is. Als speciale drive specifikatie is er: - S: systeem (system) drive. - U: gebruikers (user) drive. Achter de ':' komt de filenaam. S of U in de drive specificatie mag ook met kleine letters worden opgegeven. De filenaam die opgegeven wordt, behoeft niet geheel overeen te komen met de gevonden filenaam. Er zijn twee zogenaamde wildcards te weten - ? '?' staat voor de match met precies een (1) karakter. Dit betekent dat elk karakter op die plaats goed is. - * het '*' karakter staat voor een match met nul (0) of meer karakters. Dit is handig om een filenaam als gedeelte op te geven en dan de rest als don't care te beschouwen. Hierbij kan ook een aantal karakters in b.v. het midden worden gematcht. De twee wildcards mogen herhaald gebruikt worden. Voorbeelden. 's:test' file 'test' van de systeem drive. '~test*' neem de file van de gebruikers drive waarvan de eerste vier letters niet gelijk zijn aan 'test'. '0:*.txt' neem van drive 0 de file(s) die eindigen op '.txt'. '\\' file '\'. '%**' file '**'. Naast de filenaam is er ook nog de mode van de file. Deze wordt gedefinieerd als de file gecreerd wordt. De filemode is een byte in de fileinformatie die met de open functie gecheckt wordt. De mode is op te delen in 4 gedeelten. Bit 7-5 r w d Hiermee kan de file beschermd worden voor resp. lezen schrijven en verwijderen. Tijdens de open functie wordt er gecheckt of het desbetreffende modebit staat. B.v. open for read komt met mode bit 7 set en bit 6,5 reset aan en test dus of in de fileinformatie het modebit 7 staat. Bit 4 p Dit is een extra informatie bit dat verder de test tijdens de open functie niet beinvloedt. Bit 3,2 run Deze twee bits geven aan of de file gerunt mag worden. 01 e executable. 10 c command. 11 x (nog) niet gebruikt. Bit 1,0 format Hiermee wordt aangegeven wat voor soort file het is. 01 a ascii (tekst). 10 b binair (object). 11 s source (basic, moser etc.). Bij elke functie is input nodig. Dit is aangegeven bij de beschrijving van de functies. Output is alleen gedefinieerd als er geen fout is opgetreden. Dit wordt gekenmerkt met het laag zijn van de Carry vlag (C=0). Als C=1 dan is er de uitvoer van Error. Voor create, open en rename is er als input een filenaam nodig die meegegeven wordt met (A,Y). A,Y is dan de pointer naar het eerste karakter van de filenaam (A highadres Y lowadres). Bij het definieren van de filenaam worden spaties aan het begin overgelagen. De filenaam wordt beeindigd met <null> (00), <cr> (0D) of het <sp> (20) karakter. Voor rename staat de tweede filenaam achter de eerste, gescheiden door een spatie. A,Y A,Y v v ------------------ ------------------------- |f|i|l|e|n|a|a|m|00| |f|i|l|e|1|20|f|i|l|e|2|00| ------------------ ------------------------- Voor read, write en seek wordt er gebruik gemaakt van vier opeenvolgende geheugenplaatsen. A,Y wordt dan gebruikt als pointer naar de eerste plaats. read write seek ----------------- ----------------- A,Y -> | beginadres low | | functie | |-----------------| |-----------------| | "" high | | 64Kb aantal | |-----------------| |-----------------| |aantal bytes low | |aantal bytes low | |-----------------| |-----------------| | "" "" high| | "" "" high| ----------------- ----------------- Create ------ Maakt een file open om in te kunnen schrijven. Create doet eerst de open functie voor schrijven en als de file niet bestaat, wordt de file gemaakt. Input: X Mode die de file krijgt als zij gemaakt wordt. (A,Y) Naam van de file. Output: X Filenummer. Error: A Foutnummer. Een beschrijving van de filenaam staat bij de functie open. Indien er een metakarakter in de filenaam staat en de file wordt gemaakt, dan wordt dit karakter als normaal karakter beschouwd. Beschrijving mode X. Van mode X worden de hoogste vier bits (rwd en p) laag gemaakt waarna het w bitje wordt geset. Hiermee wordt een 'open for write' functie uitgevoerd. Als nu de file wordt gevonden, kan de open lukken als de file beschrijfbaar is en de run/format mode klopt. Deze vier bitjes zijn immers niet veranderd. Als de file niet gevonden wordt, maakt create de file met de opgegeven filemode. Uitzonderingen op de create zijn: Het meegeven van het filenaam argument: - A=$F8 De filenaam is al gedefinieerd. - A>$F8 Gereserveerd. Open ---- Er zijn een aantal mogelijkheden waarvoor de file geopend wordt. Dit kan zijn: - r (read) open voor lezen - w (write) open voor schrijven. De oude inhoud wordt verwijderd. - r+ open voor lezen met de mogelijkheid tot schrijven in de file. - w+ open voor schrijven met de mogelijkheid om te kunnen lezen. Hiernaast is er de mogelijkheid om een file te openen die hierna verwijderd kan worden. Verder zijn er mogelijkheden om alleen te kijken of de file aanwezig is etc. Input: X Mode voor te openen. (A,Y) Naam van de file. Output: X Filenummer. Error: A Foutnummer. Beschrijving mode X die wordt meegegeven. Allereerst de vier hoogste mode bitjes. Van de rwd modebits (bit 7-5) mag er maar een tegelijk hoog zijn. Er wordt immers geopend voor read, write of delete. Als geen van deze drie hoog is, wordt er niet naar gekeken. Om een file te openen voor r+ of w+ moet naast het r of het w bit, bit 4 hoog zijn. Er wordt dan gekeken of de + optie toegestaan is. Als alleen bit 4 hoog is, wordt de file gewoon geopend maar is het niet mogelijk om de functies read, write, seek of delete op de geopende file te doen. De laagste vier bits (run, format) worden twee bij twee gecheckt. Als de twee bits laag zijn (run of format), geldt dit als don't care en is de mode op die positie niet van belang. B.v. een open met mode X=$80 kan dus alle files openen waarvan het r bitje staat terwijl een open X=$81 alle ascii (bit 0,1 = 01) files kan openen die leesbaar zijn. Uitzonderingen op de standaard open zijn: Het meegeven van het filenaam argument: - A=$F8 Filenaam is al gedefinieerd. Sla dit dus over. - A=$F9 Open de volgende file die met de eerder opgegeven filenaam gevonden kan worden. Deze file kan gevonden worden omdat er enkele metakarakters in de filespecificatie kunnen staan. - A=$FA Open de volgende en als deze niet gevonden wordt kijk dan of er een filenaam achter de vorige filenaam staat. Vervolg hierna dan alsof het een normale open functie is. Met deze mode is het dus mogelijk een opsomming van namen te openen. Als de vorige filespecificatie met ';' is beeindigt (zonder spaties tussen de filenamen), dan worden er dezelfde drive genomen die met de vorige filenaam zijn genoemd. Opties (zoals '~') moeten wel opnieuw genoemd worden. - A>$FA Gereserveerd. De mode die X meeneemt: - X=$00 Kijk alleen in de directory. Als de file gevonden wordt, wordt zij =$01 niet geopend. Er wordt dus niet gekeken naar de mode van de file. De foutvlag staat wel omdat de file na afloop niet geopend is. Als foutnummer wordt 00 meegegeven. Deze mode wordt o.a. gebruikt voor het DIR commando. Error: A Foutnummer. - X=$02 Gelijk aan de mode X=$00 alleen wordt tevens het fileinformatie blok van de gevonden file opgehaald. Deze mode wordt o.a. gebruikt voor het CAT commando. Close ----- Sluit de file. Als er in de file geschreven is, wordt de modify date aangepast. De file wordt in zijn geheel gecontroleerd als de writecheck (bit 0 in DOSMODE) staat. Input: X Filenummer. Error: A Foutnummer. Delete ------ Verwijder de file. De file moet geopend zijn voor te verwijderen. Input: X Filenummer. Error: A Foutnummer. Rename ------ Geef de file een andere naam. De namen moeten gescheiden zijn door een spatie. Input: (A,Y) Twee filenamen achter elkaar. Error: A Foutnummer. Status ------ Haal informatie op of schrijf informatie naar de file. Input: X Filenummer. Y Status functie. Error: A Foutnummer. Functie 0 Positie in de file. Output: A 3: Aan het begin. 4: Aan het eind. Dit is ook de waarde als de file lengte nul heeft. 0: Indien niet 3 of 4. Functie 1 Haal de mode van de file. Output: A Mode van de file. Functie 2 Definieer een nieuwe mode. Als de file gesloten wordt, wordt deze in het fileinformatie blok bewaart. Input: A Nieuwe file mode. Functie 3 Haal het adres op van het filecontrol blok. Output: A,Y Pointer naar het filecontrol blok. Functie 4 Haal het adres op van het system informatie blok. Dit wijst dus naar de desbetreffende disk drive. Output: A,Y Pointer naar het system informatie blok. Functie 5 Haal het adres op waar het eerste karakter staat van de filenaam. Deze pointer wijst dus naar het geheugenblok waar de directory in geplaatst wordt en is dus alleen maar geldig als er ondertussen geen andere file geopend is. Output: A,Y Pointer in het directory blok. Functie 6 Haal de pointer naar het Track Sector List blok. Output: A,Y Pointer naar het TSL blok. Functie 7 Haal de pointer naar het eerste karakter van het data blok. Output: A,Y Pointer in het data blok. Read ---- Lees uit de file en plaats in het geheugen. De file moet geopend zijn om te kunnen lezen (r r+ w+). Input: X Filenummer. (A,Y) Beginadres en het aantal te lezen bytes. Output: X Filenummer. Aantal gelezen bytes. Error: X Filenummer A Foutnummer. Aantal gelezen bytes. Write ----- Haal uit het geheugen en schrijf in de file. De file moet wel open staan om in te kunnen schrijven (w w+ r+). Indien blocksearch (bit 1 van DOSMODE) staat, wordt er in de free map gezocht naar de eerste van het aantal vrije sectoren dat tesamen een aaneengesloten blok vormt dat vrij en benodigt is voor het aantal te schrijven bytes. Input: X Filenummer. (A,Y) Beginadres en het aantal te schrijven bytes. Output: X Filenummer. Aantal geschreven bytes. Error: X Filenummer A Foutnummer. Aantal geschreven bytes. Seek ---- Zoek in de file met een bepaalde functie. Functie: - 1 Zoek t.o.v. het begin het aantal bytes vooruit. - 2 Zoek t.o.v. de huidige plaats het aantal bytes vooruit. - 3 Zoek t.o.v. het eind het aantal bytes vooruit. - 4 Zoek t.o.v. de huidige plaats het aantal bytes terug. - 5 Zoek t.o.v. het eind het aantal bytes terug. Indien het eind van file bereikt wordt, gaat seek verder met 00 te schrijven als dit toegestaan is (r+ w w+ geopend). Input: X Filenummer. (A,Y) Functie en het aantal te zoeken bytes. Output: X Filenummer. Aantal gezochte bytes. Error: X Filenummer A Foutnummer. Aantal gezochte bytes. Naast deze standaard functies zijn er drie, van read, write en seek afgeleide functies. Single Read ----------- Lees een (1) karakter uit de file. Input: X Filenummer. Output: X Filenummer. A Het gelezen karakter. Error: X Filenummer. A Foutnummer. Single Write ------------ Schrijf een (1) karakter naar de file. Input: X Filenummer. A Het te schrijven karakter. Output: X Filenummer. A Het geschreven karakter. Error: X Filenummer. A Foutnummer. Functie Seek ------------ Doet de functie seek met geen (0) of een (1) karakter(s). Er wordt met een karakter gezocht bij mode 2 of 4. Input: X Filenummer. A Functie. Output: X Filenummer. Error: X Filenummer. A Foutnummer. Foutnummers ----------- Fouten tijdens create, open en rename hebben tot gevolg dat de file niet wordt gezocht of dat een gevonden file niet wordt geopend. Fouten tijdens close, delete, status, read, write en seek laten de file open. De fouten zijn hexadecimaal opgegeven. Fout die optreedt bij create, write en seek. - 2 Diskette vol. Fout die optreedt bij seek. - 3 Begin van de file. Fout die optreedt bij read. - 4 Einde van de file. Fouten die optreden bij create, open en rename. - 10 Opgegeven filenaam heeft meer dan 14 karakters. - 11 Device select. De gekozen drive bestaat niet of de specificatie voldoet niet. - 12 Er is geen filenaam gedefinieerd (lengte nul). - 13 De opgegeven file kan niet gevonden worden. - 20 Er is geen vrij filenummer over. Fouten die optreden met create en open. - 21 De gevonden file is al open. - 25 De file kan niet geopend worden om te verwijderen. - 26 De file kan niet geopend worden om in te schrijven. - 27 De file kan niet geopend worden om uit te lezen. - 28 De run modebits van de file komen niet overeen met de gewenste run mode. - 29 De format modebits van de file komen niet overeen met het gewenste type file. Fouten die optreden met close, delete, status, read, write en seek. - 30 De file die correspondeert met het opgegeven filenummer is niet open. - 31 Het opgegeven filenummer bestaat niet. Fout die optreedt met delete. - 35 De file is niet geopend om te verwijderen. Fout die optreedt met write en seek. - 36 De file is niet geopend om in te schrijven. Fout die optreedt met read. - 37 De file is niet geopend om uit te lezen. Fouten die optreden met seek. - 38 De file is niet geopend om uit te lezen of om in te schrijven. - 39 De functie die wordt opgegeven bestaat niet. Fouten die optreden met rename. - 41 De tweede opgegeven file bestaat al. - 42 De tweede file specificeert een ander device (diskette). Fout die optreedt bij status: - 46 Niet bestaande functie. Andere fouten (disk errors) hebben als kenmerk dat het 8e bit hoog is (negatief). Hierna wordt in alle gevallen de desbetreffende file altijd gesloten zonder eventueel een geschreven file te controleren. Deze file is in dat geval niet goed weggeschreven en is dus ook niet goed meer te lezen. Voorkomende disk errors worden direct op de console terminal gemeld als bit 2 staat in de variable DOSMODE. De mogelijke fouten zijn: - 80 Sector bestaat niet of kan niet gelezen worden. - 90 Sector bestaat niet of kan niet beschreven worden. - B0 Geselecteerde diskdrive en/of track bestaat niet. - C0 Diskette bevindt zich niet in de drive. - D0 Diskette is beschermd (write protected). Bij de fout wordt 01 opgeteld bij de systeemsector, 02 bij een directorysector en 04 bij een track-sector-listsector.