MZ-800 course Chapter 2 |
2. BASIC-800 ( 1Z016 / 5Z-009 ) |
The word Extra is placed between quotes because the instructions described
in this section are not really extra, they are just instructions not
mentioned in the manual. These instructions will be discussed below
in more detail. |
BEEP |
After issuing this instruction a short tone of 440 Hz will be audible. |
EDIT |
It is also possible to display an arbitrary line with EDIT, for example: EDIT 10. The EDIT instruction is followed by the line number. EDIT is closely
related to LIST ( followed by one line number ), the main difference
is that the cursor is placed right after the line number when you use
the EDIT command. |
FRAC |
PRINT π and then PRINT FRAC(π) Can you see the difference? Hopefully this example made the function
of FRAC clear. |
HEX$(x) |
PRINT HEX$(15) The inverse ( from HEX to DEC ) can be done by just printing the hexadecimal number. Just try this: PRINT $A0 |
MOD |
PRINT (26 MOD 4) This will yield: 2 ( 26:4 = 6 mod 2 ). |
SPACE$ |
PRINT SPACE$(20);"SHARP" This will put twenty spaces and then the word SHARP on the screen. PRINT SPACE$(80);"SHARP" This will put eighty spaces and then the word SHARP on the screen. etc. This probably clarified the function of SPACE$. It looks a lot like
TAB, but TAB will not clear all characters in the target domain. SPACE$
will do so. |
LOAD ALL |
Because only a few people use a RAM-card in their SHARP, this will
be one of the sporadic times we will go into the RAM-card. |
SAVE ALL |
By using these two instructions it it possible to rename programs on a QD and to remove programs from QD. You will have to reformat the QD to do the latter. This can only be done if you own a RAM-card, otherwise you must use the DELETE program. In the next part of this chapter we will discuss some instructions you can add to BASIC yourself. The function of these new instructions will also follow in the next part of this chapter. You must realize however, that adding new instructions will go at the expense of other instructions. According to the investigation preceding this book, few people use
a plotter extensively. That is why most new instructions will replace
the instructions specifically meant for the plotter. With each new function
the replaced function will be mentioned. |