English
Language : 

NSB8 Datasheet, PDF (122/158 Pages) List of Unclassifed Manufacturers – BASIC interpreter for Z80 family
grifo®
ITALIAN TECHNOLOGY
LINE EDITOR SPECIFICS AND FUNCTIONS
Assume that you have just strike <CR> to enter the above line 10 into your program. Line 10 is now
the old line. BASIC is waiting for you to type (or use editor commands to help form) a new line. At
this stage, the old line is stored in BASIC’s memory, and two pointers are kept: one to the current
character position in the old line (the OL pointer), and the other to the current character position in
the new line being typed (the NL pointer). Before you start typing the new line, both these pointers
are set at the start of their respective lines (it is obvious that the new line pointer is set to the start of
the new line, since you haven’t typed anything new yet!). Most of the editor functions are most
completely explained with reference to these dual pointers.
Typing a normal character (not a control character editing command) in the absence of any other
editing function will result in both pointers being advanced one position. The typed character is
added to the new line, and the old line pointer now points to the next character in the old line. In the
sequence above, for example, when you typed 20 to start the new program line, the NL pointer ended
up pointing just beyond the 0 in 20, while the OL pointer was skipped past the 10 in the old line, and
pointed at the space just beyond the line number.
Before:
(old line) 10 PRINT etc …
^ OL pointer
(new line)
^ NL pointer next char typed goes here
After:
(old line) 10 PRINT etc …
^ OL pointer
(new line) 20
^ NL pointer next char goes here
in the following paragraphs there are the editing functions, along with the control character
commands which invoke them.
CONTROL-G: COPY REST OF OLD LINE TO END OF NEW LINE
Copy all the characters from the OL pointer character position through the end of the old line over
to the new line, starting at the NL pointer character position. If the OL pointer already points past the
end of the old line, no characters will be copied, and the bell will ring.
CONTROL-A: COPY ONE CHARACTER FOM OLD LINE
The character in the old line pointed to by the OL pointer is copied to the new line at the character
position designated by the NL pointer. As a result, both pointers will be advanced by one position. If
there is no character to copy, the bell rings. Repeated use of the <control-A> command will
eventually give the same result as one <control-G> command.
Page 110
NSB8
Rel. 5.10