Appendix C.1 - The ZX81 for those that understand BASIC |
GeneralIf you already know BASIC then you should not have much trouble using the ZX81; but it has one or two idiosyncrasies.(i) Words are not spelled out, but have keys of their own - this is dealt with in chapter 2 (for keywords & shifted keys) & chapter 5 (for function names). In the text, these words are printed in BOLD TYPE. (ii) ZX81 BASIC lacks READ, DATA & RESTORE (but see exercise 3 of chapter 22 concerning this), user-defined functions (FN & DEF; but VAL can sometimes be used), & multi-statement lines. (iii) The string handling facilities are comprehensive but non-standard - see chapter 21, & also chapter 22 (for string arrays). (iv) The ZX81 character set is completely its own. (v) The television display is not in general memory-mapped. (vi) If you are accustomed to using PEEK & POKE on a different machine, remember that all the addresses will be different on the ZX81. SpeedThe machine works at two speeds, called compute & display mode, & fast mode.In compute & display, the television picture is generated continuously & computing is done during the blank parts at the top & bottom. In fast mode, the television picture is turned off during computing, & is only displayed at the end of the program, while waiting for INPUT data, or during a pause (see PAUSE). Fast mode runs about four times as fast, & should be used for programs with a lot of computing as opposed to output, or when typing in long programs. Switching between speeds is done with the FAST & SLOW statements (q.v.). The keyboardZX81 characters comprise not only the single symbols (letters, digits, etc.), but also the compound tokens (keywords, function names, etc.; these are printed here in BOLD TYPE) & all these are entered from the keyboard rather than being spelled out. To fit this in, some keys have up to five distinct meanings, given partly by shifting the keys (i.e. pressing the SHIFT key at the same time as the required one) & partly by having the machine in different modes.The mode is indicated by the cursor, an inverse video letter that shows where the next character from the keyboard will be inserted. ![]() ![]() In both ![]() ![]() ![]() ![]() ![]() The screenThis has 24 lines, each 32 characters long, and is divided into two parts. The top part is at most 22 lines, and displays either a listing or program output. The bottom part, at least two lines, is used for inputting commands, program lines and INPUT data, and also for displaying reports.Keyboard input: this appears in the bottom half of the screen as it is typed, each character (single symbol or compound token) being inserted just before the cursor. The cursor can be moved left with ![]() ![]() When NEWLINE is pressed, the line is executed, entered into the program, or used as INPUT data as appropriate, unless it contains a syntax error. In this case the symbol ![]() As program lines are entered, a listing is displayed in the top half of the screen. The manner in which the listing is produced is rather complicated, and explained more fully in chapter 9, exercise 6. The last line to be entered is called the current line and indicated by the symbol ![]() ![]() ![]() When a command is executed or a program run, the screen is first of all cleared, & then output is displayed in the top half of the screen and remains until a program line is entered, or NEWLINE is pressed with an empty line, or ![]() ![]() ![]() In certain circumstances, the SPACE key acts as a BREAK, stopping the computer with report D. This is recognized (i) at the end of a statement while a program is running, (ii) while the computer is looking for a program on tape, or (iii) while the computer is using the printer (or by accident trying to use it when it is not there). |
![]() ![]() ![]() |