Greetings to all readers. In this episode I will talk about managing our data and the methods that can be used with our MSX. The data that we can manage is divided into many categories; programs, binaries, texts, archives, images and more. To do this, we must use a device that allows us to do this, such as a cassette recorder, a Drive or other devices that have been created, going forward, for this situation (HD, SD, USB and etc.). I won't go into detail about other devices, since in this course I'm only talking about the first version of Basic, used only with tapes and diskettes (only for a few lucky people 🙂 ). Therefore the lesson will be dedicated more to the latter two. Program files are those that we create with Basic, but they can be created by other types of languages. When we type our list, we know that if we turn off our computer it will be lost. To prevent this from happening, we can save it on magnetic media. If we have a cassette recorder, we can save it using the CSAVE "FILE NAME" command, this command is exclusive only for cassettes, the name can be a maximum of 6 characters long. Or it can be saved with the SAVE command, as long as the word CAS is inserted before the name. Without this it will never be registered on the device: SAVE “CAS: File Name”, here too the name must not exceed 6 characters. To recall files saved with CSAVE, we will use CLOAD. Used alone, it will load the first program it encounters. If instead we want to load that particular program we will put the name of the file, if in its loading path it encounters another file, we will see the writing SKIP with the program name and it will not be loaded. To recall a program saved with SAVE we will use LOAD”CAS:”[,R]. Same as CLOAD, if you don't enter any name it will load the first one it encounters, otherwise the specified one. The letter R, which is optional, is used to start the program automatically. The loading time of the cassettes is very long, as you know, but if we want to save faster there is the possibility of increasing the loading speed in baud. You remember that I mentioned something in the SCREEN command, in fact it is the fourth argument. by default it is 1, load 1200 baud but if we bring it to 2, the load will be at 2400 baud: SCREEN 0,,,2. For the disk we will use SAVE and LOAD to save and load our programs. The name can be 8 characters long and we can enter an extension (max 3 characters). Even if it is not mandatory, it is very sensible to add it, so it is easier to understand which particular file it is, for the simple fact that we can have many files on a disk. We will put BAS if it is a Basic program, TXT if it is text and so on. For saving the correct syntax is: SAVE “[DRIVE:]File Name[.Est]”[,A]. DRIVE is used only if we want to save it on a different drive from the one we are working on. The extension is not mandatory, but as I said above, it is good practice to do so. The letter A at the end makes us save the listings in ASCII format. To save programs in Binary or Assembler we use the BSAVE command. The so-called programs are created to work in certain addresses of the MSX memory, therefore when saving the following ones must also be inserted: BSAVE”[unit:]File name[.est]”, Start Address, End Address, Execution Address of the program. the same thing goes for saving portions of VRAM (Video Memory), except that the last option will be the letter S. Drive could be a DRIVE or the recorder, in this last case we will use the CAS: BSAVE “CAS: File Name”, II,IF, IE The extension for disk saves only. To load an assembler file or image, we use the BLOAD command. The correct syntax is: BLOAD”[drive:]Filename[.est]”[,R/S”, Offset. And everything is the same as said above for BSAVE. The difference lies in the final part, where R starts, immediately after loading the Assembler program, while S, the image in VRAM. Offset is the movement of the load address to another part of the RAM but only for assembly programs.
Now I will talk about how to manage personal files: Agendas, family accounts, notes and other things you want to keep track of. To manage this data and create our archives, we have two ways to do it, work by creating sequential or direct access files, also called random. But first some commands that will help us manage our files, to understand how to change their name, copy them or delete them. Let's start with the COPY command which will be used to copy files from one medium to another. A note before continuing, everything I say will only be valid for discs or other media but magnetic tapes or cassettes are excluded, which have many limitations for data storage, I will make a note when this is possible. Syntax: COPY “[media name:] File to copy” TO “[media name:] copied file”. Support name: these are the names of the units where to take it and copy it, it is not mandatory to put them if the copy is made on the same support or on the first parameter, if we are already there. File to copy is the file we want to duplicate, while as you can easily imagine, the second is the exact copy of the first. If we want to leave the name the same we can also omit the name on the second parameter. I'll give you some small examples: COPY “DATI.TXT” TO “B:” . In this case we have copied a file with the same name from drive A to drive B. COPY”DATI.TXT” TO “DATI1.TXT”. in this other one we copied the file, changing the name, onto the same drive. COPY”B:DATA.TXT” TO “A:”. We are on DRIVE A and we have copied the file from DRIVE B to A, using the same name. The COPY command can be used from any medium to copy any file. The KILL command deletes files from media. The syntax is: KILL”[media name] File name”. Support name is as I said above. The operation can be done even if we are in another unit. Filename is what we want to delete. The NAME command changes the name of a file. Syntax: NAME “FILE1” AS “FILE2″. For example, we want to change the extension to the DATI.TXT file: NAME”DATI.TXT” AS “DATI.DAT”. I did not specify the media name because it is superfluous to use it, even if the MSX accepts it, it is useless since it is a command that must always be executed within the same unit. And finally the FILES command which displays all the files found on the disk. Syntax: FILES[“[media name:]file name”]. Using it alone we will see all the files on the current disk. FILES”B:”, we will see the files of DRIVE B, even if we are on DRIVE A. By entering the name of the file, only that will be displayed. In all the commands that I have explained, excluding the NAME, we can use wildcards, the asterisk (*) is valid for an entire word, while the question mark(?) is valid for a character. EXAMPLE: FILES”*.BAS”, will only show us the files with BAS extension, or if we use the COPY command, it will copy all the BAS files, the same thing goes for KILL. KILL”DATA?. TXT". we will delete all files with the word DATA and the character that comes after it; DATA1, DATI2, DATI3, DATIA, etc.
Since I went on too long, I'll continue in the next episode.
Thank you all.


0 Comments