FILE: ZXTMTXT.DOC
Silicon Mtn. Computers
C-12, Mtn. Stn. Group Box
Nelson, BC V1L 2J3
Canada
November 1987
This document details how you can “marry” the popular Memotext word-processor with our ZX-TERM*80 terminal program for the ZX81/TS1000 computers. It details how to up/download “raw” Memotext files, as well as how to upload text files created with Memotext in an ASCII format readable by any computer.
Transferring “raw” files is quite simple, and would be useful for sending entire sets of files to another ZX/TS user, either directly or via a BBS or other service. He could then view, edit, or print the files using Memotext. However, such raw files would not be readable by other computer users; useful if you want to maintain some degree of confidentiality. If you want your files to be formatted, perhaps justified, and readable by anyone, you will have to use the second approach (more complex, but not too difficult once you get the hang of it).
I suggest that you first experiment with the “raw data” approach, perhaps with the co-operation of another local ZX/TS user.
Regardless of which approach you use, the minimum hardware and software you need are as follows:
HARDWARE:
1: ZX81, TS1000 or TS1500 computer. 2: A suitable 48K or 64K RAM, with 8-16K region disabled. 3: Modem (Byte-Back, or preferably Westridge) 4: Suitable static memory in 8-16K, as SCRAM, modified “Hunter board“, or “Delta Device“. 5: M1* adaptor or modification. 6: Tape recorder or other mass-storage. 7: Printer and printer interface.
SOFTWARE:
Memotext, V3 (high memory version)
ZX-TERM*80
I no longer commercially supply Memotext V3. However, if you send $5 to cover tape, photocopying and shipping, I’ll send you a copy on a “shareware” basis. After you get it, send whatever you think it’s worth.
Silicon Mountain will of course supply the ZX-TERM*80 program, on either cassette or EPROM. Write for details.
TRANSFERRING “RAW” MEMOTEXT FILES
To UPLOAD a set of Memotext files in Sinclair/Memotext format, proceed as follows:
1: Set up your system.
2: LOAD Memotext V3, and configure it for your printer and interface. You may optionally load the HELP1 file. Create or load your files in the usual way. If necessary, print them out to be sure they’re as desired. (If the files to be transferred already exist, even if created using a different version, you may skip this step.) Once your files are as you want them, save to tape using SAF (save all files).
3: Use the QIT function to exit Memotext, then enter NEW.
4: LOAD ZT-TERM*80, and configure for your printer interface if desired. Relocate the program to 39024. After entering ZX-TERM*80, use ESCAPE (shift space) to return to BASIC.
5: Re-enter Memotext at the cold boot entry point (RAND USR 43851). Re-LOAD your prepared files using LAF (load all files).
6: Again QIT from Memotext. Do not use RUN, CLEAR or NEW!
7: Re-enter ZX-TERM*80 with RAND USR 42622. Get the other person on the line, and get ready to upload the files. When the other terminal is ready to receive, go to Xmodem with SHIFT 4. Press “U” for “upload.” Then answer “V” for “variables.” The upload will commence.
8: When the transfer is complete, press any key to return to the main loop and terminate the connection.
Downloading is very similar.
1: Set up your system.
2: LOAD Memotext V3, configure it for your printer, and optionally load the HELP1 file.
3: QIT from Memotext, enter NEW, and LOAD ZX-TERM*80.
4: Get on-line, and prepare to download the file. Use SHIFT 4 to go to Xmodem, followed by “D” for “download,” and “V” for “variables.”
5: When the download is complete, return to the main loop and terminate the connection. ESCAPE to BASIC, answering (N)o to “SAVE FILES?”
6: Re-enter Memotext at the warm boot (RAND USR 46555). You can now edit, view, or print the files just downloaded.
TRANSFERRING FILES IN ASCII FORMAT
Usually you will want to transfer your text as ASCII files, formatted and perhaps justified, in other words just as it would appear if you printed it out. We have to take a somewhat different tack to accomplish this. What we will essentially do is “fool” Memotext into thinking that it’s sending the text file to the printer, when actually the translated and formatted file is being stored in “spare” memory. We will then use a short machine-code routine to transfer the finished file into ZX-TERM*80’s DATA REM buffer, for uploading to the other terminal.
Going the other way, downloading an ASCII text file, is of course no problem for ZX-TERM*80. If you relocate your “input buffer” as described, you can then use the little “dump” routine installed at the original buffer location, to send the file to your printer.
Unfortunately, it isn’t feasible to convert such an ASCII file into Memotext format. As a result, you won’t be able to edit downloaded ASCII files. For this reason, we will only discuss how to UPLOAD Memotext files in fully formatted ASCII.
You will normally only transfer one text file at a time, though you could string several short text files together into a single upload. Also, data files are not transferrable using this approach, unless their contents are referred to within the text file.
To upload a Memotext file, follow these steps. As mentioned, it might seem complicated at first; however, after some practise, you’ll find it easier than it first appears.
1-4: Follow steps 1 through 4 as for “raw” uploads. If the files to be uploaded already exist on tape, you can omit steps 2 and 3.
5: After ZX-TERM*80 is installed, ESCAPE to BASIC and LOAD the original copy of Memotext. When asked for your interface type, answer “OTHER.” Then enter the following hexcode sequence:
E52A32407723223240E1C9
This installs a new “printer driver” that sends the translated and formatted ASCII output to memory instead of the printer, starting at the location contained in SEED (more about that later).
6: When prompted for LF/CR options, answer “LF + CR.” This is because most boards want to see both a linefeed and a carriage-return code at the end of every line. Don’t bother loading the HELP1 file; it would be overwritten anyway.
7: After entering Memotext, load your file or files from tape (LTF or LAF). NOTE: the length of your file or files to be sent in a single upload should be less than around 12K. Remember, ZX-TERM*80’s DATA REM buffer is limited to about 15K. In the process of translating, spaces are added (when justifying, indenting, etc.) and LF/CR codes are inserted after every line. As a result, the ASCII translation will typically be somewhat longer than the Memotext “source code.”
HINT: set up your file for 40 or 60-column width, using (edit)W at the beginning, for the convenience of other ZX-TERM*80 users.
8: QIT to BASIC, and enter RAND 50872. This sets the starting address for the ASCII translation, and represents the first byte beyond Memotext’s data area.
9: Re-enter Memotext at the warm boot (RAND USR 46555).
10: “Print” your text file to memory using PTF. Answer (C)ontinuous mode. Justify (Y)es or (N)o as desired. After a few seconds, the program will be back at the FUNCTION? prompt. Repeat for any other text files you wish to send in this upload.
11: QIT to BASIC. Do not enter NEW. Instead, PRINT PEEK 16434+256*PEEK 16435. This will give the ENDING address of your translated file. If this is a low number (below 50872), your text file(s) is/are too long; the “pointer” has wrapped around, and tried to print your file to the ROM. You have to edit them down and repeat the procedure if this happens. Otherwise you’ll crash when you try to import the file into the DATA REM buffer!
12: Without entering any other commands, re-enter ZX-TERM*80 with RAND USR 42622. Get into the main loop, and initialize your DATA REM using SHIFT 8. ESCAPE back to BASIC using shift space, followed by (N)o in response to “SAVE DATA?”.
13: Now comes the only tricky part. We have to enter a little machine-code routine to transfer the file from high memory, into the DATA REM. You have to enter the following commands:
LET A$="EMRND::LEN : GOSUB PIVAL FAST AT LPRINT ):RND GOSUB :. GOSUB ??RNDTAN"
LET A$(21)=CHR$ 83
LET A$(22)=CHR$118
Entering the first command is the one that will seem laborious at first. So here’s a step-by-step procedure for entering this strange-looking command. “sh”=SHIFT, “fn”= FUNCTION (shift ENTER), “gr”=GRAPHIC (shift 9), “DEL”=DELETE (shift 0)
CHAR: KEYS USED LET L A A $ sh U = sh L " sh P E E M M RND fn, T : gr, sh 1 : S, gr LEN fn, K : gr, J, gr GOSUB sh 3, H, sh 5, DEL, sh 8 PI fn, M VAL fn, J FAST sh F AT fn, C LPRINT sh S ) sh 0 : gr, sh H, gr RND fn, T GOSUB sh 3, H, sh5, DEL, sh 8 : gr, K . . GOSUB sh 3, H, sh5, DEL, sh 8 ? ? ? ? RND fn, T TAN fn, E " sh P ENTER
Enter PRINT A$. It should look as shown above. Now enter the other two commands listed above. Again PRINT A$; it should still look the same.
14: Now enter PRINT USR 32771. It should come back with 0. The file is now in your DATA REM buffer!
15: Re-enter ZX-TERM*80 with RAND USR 42622. Use VU DATA (shift 5) to verify that the file has, indeed been translated, formatted, and moved into the DATA REM.
16: Upload the file as usual. SHIFT 4 gets you into Xmodem. Answer (U)pload, then (P)rogram. And away it goes.
16: If you wish to save the translated file, truncated to its actual length, you can of course do so by escaping, then answering (Y)es to “SAVE DATA?”.