WORM, Part 1

See all articles from T-S Horizons n5
Author(s): Gordon Young
Publication: T-S Horizons
Pub Details: T-S Horizons n5 (Issue 5)
Date: April/May 1984
Pages: 14-15
WORM title screen - A Word Processing Program, ZX81/TS1000, Part One, by Gordon Young (1984)
WORM title screen – A Word Processing Program, ZX81/TS1000, Part One, by Gordon Young (1984)

Do you need a word processor that will work on any printer with the interface you have? Would you like to write your text in 30, 40 or whatever column width you want? I know I did! MEMOTEXT requires the MEMOTECH interface, WORDSINC II only prints on the Timex printer and the others (those with names I forgot after finding out they did not work very well), fell short of working on the machine code, I came up with a usable program, which I have called “WORM”, for lack of a better name. This program has:

**Left/Right justification
**User defined column width
**6,000 character text file
**Dual mode operation
**Global editing (insert/delete)
**Character counter
**Upper/Lower case (for full size printers)
**Machine code fast typing
**Wrap around screen operation
**And more

The nice thing about this is that, you can do all the programming for it by reading this and 2 more issues of this magazine.

If you have never worked with machine code and are afraid to tackle this, don’t be. Just follow directions closely. This month I will provide you with the first steps. Once we get the machine code entered, the rest will be much easier. There is over 2K of machine code that is entered into 4 REM lines. I will provide you with an assembler to enter the codes and a listing of the codes in each line. In addition, a checksum can be used to test your entries for assurance. We will make your 16K TS-1000 computer a very usable word processor.

Begin by turning on the computer and putting it in the FAST mode. Now make line 1 just like that in figure 1. After typing all of this in, press ENTER. It must be exactly like the figure shown! When this has been done, create line 2 with exactly the same REM statement as in figure 1. Do this by using the EDIT command, then press DELETE, which will erase the line number “1”. Then press 2. Repeat this procedure to create lines 3 and 4, with the same REM statement.

At this time, SAVE everything onto tape! DO NOT attempt to edit these lines again.

   1 REM 0::::::::::::::::::::::
:::::::::1::::::::::::::::::::::
:::::::::2::::::::::::::::::::::
:::::::::3::::::::::::::::::::::
:::::::::4::::::::::::::::::::::
:::::::::5::::::::::::::::::::::
:::::::::6::::::::::::::::::::::
:::::::::7::::::::::::::::::::::
:::::::::8::::::::::::::::::::::
:::::::::9::::::::::::::::::::::
:::::::::0::::::::::::::::::::::
:::::::::1::::::::::::::::::::::
:::::::::2::::::::::::::::::::::
:::::::::3::::::::::::::::::::::
:::::::::4::::::::::::::::::::::
:::::::::5::::::::::::::::::::::
:::::::::6::::::::::::::::::::::
:::::::::7::::::::::::::::::::::
:::::::::8::::::::::::::::::::::
:::::::::9::::::::::::::::::::::
:::::::::0

FIGURE #1

9977 LET N=16514
9978 LET M=0
9979 INPUT A
9980 IF A>300 THEN GOTO 9989
9981 POKE N,A
9982 PRINT AT 20,M;A
9983 LET N=N+1
9984 LET M=M+5
9985 IF M<26 THEN GOTO 9979
9986 LET M=0
9987 SCROLL
9988 GOTO 9979
9989 IF A>555 THEN GOTO 9999
9990 IF A=555 THEN GOTO 9997
9991 LET N=N-1
9992 IF M=0 THEN LET M=30
9993 IF M<26 THEN LET M=M-5
9994 IF M=-5 THEN LET M=0
9995 PRINT AT 20,M;" "
9996 GOTO 9979
9997 SAVE "WOR▒"
9998 GOTO 9979
9999 STOP

FIGURE #2

Now, enter the BASIC assembler of figure 2. This will be used to enter the codes. When entering codes for line 2, 3 and 4, you will have to change the address in line 9977 (more on that later). You should now have four REM lines and the assembler starting at address 9977. Again, SAVE everything onto tape (use the other side of the tape just as a precaution).

When using the assembler, you will be entering the codes as listed in figure 3. In using the assembler, you simply enter a code (press ENTER) and continue until you reach the end of the listing. The machine code list has 6 codes across and are to be entered left to right, top to bottom. You can make a correction by pressing 333. This will backspace and correct a wrong entry. You might want to stop and SAVE your entries along the way and to do this, just get the recorder ready and press 555. When all the codes have been entered, enter 999 to stop.

Now you should have line 1 finished and can check your entries by a simple checksum routine that adds each number in the line to produce a sum of all your entries. Do this by entering:

8000 LET Y=0
8005 FOR N=16514 TO 17154
8010 LET Y=Y+PEEK N
8015 NEXT N
8020 STOP

If you RUN the program at line 3000 you should get the sum: 58243

If this is the answer you got, then so far, line 1 is complete! If not, you need a program that will PEEK each address between 16514 and 17154 to check your entries. I have found that some of my readers will accidently make a wrong entry and not get the checksum number correct. If this is your case, add these lines:

8050 FOR N=16514 TO 17154 STEP 6
8055 PRINT AT 19,0;PEEK N;TAB 5;PEEK (N+1);TAB 10;PEEK (N+2);TAB 15;PEEK (N+3);TAB 20;PEEK (N+4);TAB 25;PEEK (N+5)
8060 SCROLL
8065 NEXT N

This will help locate an error. You will still need to determine the address and make the correction.

Next month I will, give you the codes for line 2 and 3. I can’t over emphasize the importance of your machine code entries. A wrong entry could crash the program or worse, write a hundred wrong entries over others, so be careful! You should have no problems, but if you do, write me and I will help you out. More in the next issue!

Gordon Young
P.O.Box 2411
Vista, CA 92083

LINE 1 REM CODES (figure 3, 641 codes for addresses 16514-17154; checksum 58243)
LINE 1 REM CODES (figure 3, 641 codes for addresses 16514-17154; checksum 58243)

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.