![]() ![]() MZ-800 course Chapter 1 |
||||||||||||
1. Things worth knowing | ||||||||||||
Now we shall discuss which actions you must perform in order for you to use the peripherals and other things important to use the computer and utilize the rest of the book.
When you turn on your computer and a QD resides in the QUICK-DISKdrive, the QD-drive will start automatically and if the first program on the QD is an OBJ-file it will be loaded. If more than one OBJ-files are on the QD, it is a bit more tricky. How should you load those programs? This is how:
This was a short discussion on how to load an OBJ-file from QD. There are many more instructions that can be used inside the MONITOR, but they will be discussed when you actually need them. Let us now discuss the most important BASIC instructions you might
need when using peripherals. |
||||||||||||
Writing a program and beyond | ||||||||||||
You can see your work afterwards or in between with the LIST instruction. You can see everything by simply typing LIST <cr>. If the listing does not fit on one screen then the whole listing will still be shown. You can stop the listing by pressing SHIFT / BREAK, or interrupt it by pressing the space bar ( to resume press any key ), or interrupt it by pressing and holding the BREAK-button. When you release the BREAK-button the listing will continue. When you are done typing, or you just want to save your program to QD or tape, you can do this with the SAVE instruction. First you must know where your program will be saved, on QD or tape. If you only own a tape recorder you may skip the following part: You can save your program by typing the following: SAVE "CMT:xxxxxx" <cr> - for the tape recorder or SAVE "QD:xxxxxx" <cr> - for the QD Here xxxxxx can be replaced with any arbitrary name, as long as its length does not exceed 16 characters. You can also make use of the DEFAULT instruction. When you type DEFAULT "QD:" <cr> then everything is automatically saved to and loaded from QD. When you type DEFAULT "CMT:" <cr> then everything is automatically saved to and loaded from tape. After you have used DEFAULT or if you only own a tape recorder, typing SAVE "xxxxxx" <cr> will suffice. When you want to load a program from tape or QD, you can do this with the LOAD instruction. It works exactly like the SAVE instruction. Just replace all occurrences of SAVE with LOAD. When you have finished writing the program you can run it with the RUN instruction, but everybody knows that, right? If you want to remove a program from memory you type NEW <cr>. When you type LIST <cr> afterwards, you will only see the message Ready or something similar in another language. But enough about SAVING, LOADING, RUNning and LISTing. If you want to write your own program you will also need to know how to read the status of the keys, how to read the JOYSTICK and how to control a printer and so on. First something about programming itself. You will not be able to make
your own programs immediately, but you could make changes to existing
programs. You could, for example, convert a program using the keyboard
to a program using the joystick. This is often more easy than it would
seem at first glance. |
||||||||||||
STICK(n) | ||||||||||||
Sometimes the instruction is accompanied by the STRIG instruction, which is usually followed by the same number between parenthesis. If you want to change the game in order to use the joystick, you simply replace the 0 with a 1 or a 2. The other way around is exactly the same. If you encounter the STRIG instruction you will also have to replace the number to the same one you used with STICK. By the way: you can use STRIG to switch between the space bar and the fire-button on the joystick. How do we find out if and where STICK / STRIG occurs in a program? You can use the SEARCH instruction to find out. Just type: SEARCH "STICK" <cr> and all occurrences of STRIG are located. Analogous: SEARCH "STRIG" <cr> Unfortunately not all programs read the keyboard or joystick with the
STICK instruction. Further on another method for reading the joystick
is discussed. For the real beginner this will be too difficult to understand
at this time, that is why we will not discuss it here. |
||||||||||||
GET | ||||||||||||
10 GET A$ :IF A$="" THEN 10 it means that the program will loop until a key is pressed. There are a few more things you can do with GET, but that also qualifies
as hard for beginners and the manual describes this function in detail,
so we will not discuss this any further. |
||||||||||||
PRINTER-control | ||||||||||||
With PRINT/P you can send some text to the printer, for example: PRINT/P "NEPTUNES." You can also make a printout of the whole screen. Unfortunately this is not done with the HCOPY instruction as you might expect, a special program must be used. These programs are known as HCOPY-programs. There are at least 4 HCOPY programs for different printers. |