We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5
This manual was Scanned, OCR and pdf by Stephen Parry-Thomas
For ZX Spectrum users everywhere and to preserve the manual
20-Feb-2004
Editor’s Manual page 1
EDITOR USER MANUAL
FORTH organizes its mass storage into "screens" of 1024 characters.
FORTH may have one screen in memory at a time for storing text. The screens are numbers Ø — 32768.
Each screen is organized as 16 lines with 64 characters per line.
The FORTH screens are merely an arrangement of virtual memory and do not correspond to the screen format of the ZX81 or ZX Spectrum
SELECTING A SCREEN AND INPUT OF TEXT
To start an editing session, the user types EDITOR to invoke the
appropriate vocabulary. The screen is given a number and this is selected, using: n CLEAR (clear screen n and select for editing). To input new text to screen n after CLEAR, the P (put) command is used. Example: Ø P THIS IS HOW 1 P TO INPUT TEXT 2 P TO LINES Ø, 1, 2 OF SELECTED SCREEN
LINE EDITING
During this description of the editor, reference is made to PAD.
This is a text buffer, which may hold a line of text to be found or deleted by a string editing command.
LINE EDITING COMMANDS
n D Delete line n but hold it in PAD. Line 15 becomes free as all statements move up 1 line n E Erase line n with blanks. n I Insert the text from PAD at line n, moving the old line n arid following lines down. Line 15 is lost. n H Hold line n at PAD (used by system more often than by user). n R Replace line n with the text in PAD. n S Spread at line n. Line n and following lines move down 1 line. Line n becomes blank. Line 15 is lost.
Editor’s Manual page 2
SCREEN EDITING COMMANDS
n CLEAR Clear screen n with blanks and select it for editing.
FLUSH Used at the end of an editing session to save the current screen onto tape. L List the current screen. The cursor line is relisted after the screen listing, to show the cursor position. n LIST List screen n and select it for editing: if screen n is not the current screen, it will request to load from tape.
CURSOR CONTROL and STRING EDITING
The screen of text being edited resides in a buffer area of storage. The editing cursor is a variable holding an offset into this buffer area. Commands are provided from the user to position the cursor, either directly or by searching for a string of buffer text, and to insert or delete text at the cursor position.
COMMANDS TO POSITION THE CURSOR
nM Move the cursor by n characters and the cursor line. The position of the cursor on its line is shown by a _ (underline). TOP Position the cursor at the start of the screen.
STRING EDITING COMMANDS
B Used after F to back up the cursor by the length of the most recent text. C text Copy in text to the cursor line at the cursor position. F text Search forward from the current cursor position until string 'text' is found. The cursor is left at the end of the string and the cursor line printed. If the string is not found an error message, # Ø, is given and the cursor repositioned to the top of the screen. N Find the next occurrence of the string found by an F command. TILL text Delete on the cursor line from the cursor till the end of string 'text'. X text Find and delete the next occurrence of the string "text". N.B. Typing C with no text will copy a null into the text at the cursor position. This will abruptly stop later compiling ! To delete this error type TOP X 'N/L'.
# LEAD - - - line— address offset— to— cursor # LOCATE - - - n1 n2 From the cursor position determine the line- no n2 and the offset into the line n1. R# - - -addr A user variable which contains the offset of the editing cursor from the start of the screen. B --- Backup cursor by length of text in PAD. C --- Spread at cursor and copy the following text into the cursor line. CLEAR n--- Clear screen n. can be used to select screen n for editing. D n--- Delete line n but hold in pad. DELETE n--- Delete n characters prior to the cursor. E n--- Erase line n with blanks. F --- Input following text to PAD and search for match from cursor position till end of screen. FIND --- Search for a match to the string at PAD, from the cursor position till the end of the screen. If match not found issue an error message and reposition the cursor at the top of the screen. FLUSH --- Write updated screen to tape. H n--- Hold numbered line at PAD. I n--- Spread at line and insert from PAD. L --- List the current screen. LINE n- - - addr Leave address of line n of current screen. 1 LINE ---f Scan the cursor line for a match to PAD text. Return flag and update the cursor R # to the end of matching text, or to the start of the next line if no match is found.
Editor’s Manual page 4
M --- Move cursor by a signed amount and print its line MATCH cursor— addr bytes left— till— EOL str— addr str— count— tf cursor— advance— till— end of— matching— text—ff bytes—left—till—EOL Match the string at str— addr with all strings on the cursor line forward from the cursor. The arguments left allow the cursor R # to be updated either to the end of the matching text or to the start of the next line. — MOVE --- addr line— no - - - Move a line of text from addr to line of current screen. N --- Find next occurrence of PAD text. P n--- Put the following text on line n. R n--- Replace line n with the text in PAD S n--- Spread. Lines n and following move down. n becomes blank. T n--- Type line n and save in PAD TEXT c--- Accept following text to pad. c is text delimiter. -TEXT Addr 1 count Addr 2 - - boolean True of strings exactly match. TILL --- Delete on cursor line from cursor to end of the following text. TOP --- Position editing cursor at top of screen. WHERE n1 n2 - - - n2 is the block number, n1 is offset into block. If an error is found in the source when loading from tape the recovery routine ERROR leaves these values on the stack to help the user locate the error. WHERE uses these to print screen and line numbers and a picture of where the error occurred. X --- Delete next occurrence of following text.