That’s right–Basil’s Compendium is going to add the TS2068 to its repertoire. But you ZX81/TS1000 enthusiasts need not lose heart.
The two computers use the same microprocessor, the Z80, and are really not awfully different from each other. Sort of like brothers born a year or two apart.
And you won’t have to worry about getting mixed up, either. The two brothers will continue to sleep in separate bedrooms, so to speak, so there won’t be any danger of your not knowing which one is under consideration at the moment.
This installment, though, will be a sort of a REM statement in the Compendium series–it won’t have any chapter number, and it will apply exclusively to the TS2068. After you have read it, you will be able to go back to the beginning of the Compendium and run the same exercises that you have been doing with the ZX81.
And what if you don’t have the back issues of SyncWare News that published those exercises? Well, there’s always the possibility that you can borrow them from your users’ group library. Or you can buy the appropriate back issues. Volumes 2, 3, and 4 are available at $16.95 each. (Each volume is 6 issues–one year’s output.) Or all three for $39.95. Postpaid in the United States. Send your orders to Jeff Moore, our publisher. His address is on our masthead.
If you do buy the back issues, you’ll be getting some that don’t contain the COMPENDIUM. On the other hand, you’ll be getting a lot of other valuable material in addition to the COMPENDIUM.
Or you can wait for the reprint of the entire series to come out–upgraded to include the TS2068 from the beginning. We intend to publish the reprint on an IFWARE® basis–to be published IF there is enough demand. See elsewhere in this issue for the details.
One thing, though. The utility programs in the early chapters won’t work on the TS2068. As a matter of fact, some of those utilities are not needed by the 2068, which has built into its operating system ways of doing the same things.
SO LETS GO
As far as machine coding is concerned, the 2068 differs from the 1000 series in three important respects: first, the “housekeeping” numbers are different; second, the address of the first program byte is different; and third, there are many more of what I described as “no-nos” in Chapter 7 (SWN Vol. 3 #3, page 16). So many of them, in fact, that it is a rare machine code program that won’t evoke the report “K Invalid color” if you incorporate it in a 1 REM line.
There are ways to overcome this problem–one of the most useful is to tinker with bytes 23635 and 23636, which tell the computer where to start looking for the program–in essence, those bytes throw a camouflage net over the material at the bottom of the program, so the computer doesn’t realize that it’s there. But the camouflage is so effective that the computer won’t SAVE or LOAD material down there, either.
Somewhere down the road, this series is going to include a whole section on locations for your code, both for the ZX81 and for the 2068. For the moment, though, let’s make an arbitrary choice.
WHERE TO PUT THE CODE
Tell your computer to
PRINT USR "a"
Be sure to include the quotation marks, or you may get in real trouble. (USR is invoked by pressing the “L” key after pressing CAPS SHIFT and SYMBOL SHIFT simultaneously. You’ll be using it often.) You should get 65368. This marks the beginning of the area allotted to User Defined Graphics. Choose some base number smaller than 65368; for instance, 65000 is a very easy number to remember. A number even easier to use, 6e4 (=60000), is quite satisfactory if it’s in an empty neighborhood.
Whatever base number you choose, remember it. Write it down, if you have a porous memory like mine. Then check to see whether it has already been used. RUN the following mini-program (as a direct command, without a line number):
FOR f=b TO b+100:PRINT f;" "; PEEK f: NEXT f
where b is the base number you have chosen. If you get all zeroes, you’re OK. If that area is filled with an assortment of numbers, it is probably already in use (maybe your printer driver program is residing there, for instance), and you’d better choose another base number. Don’t make it too small, though–and I can’t tell you how small too small is. If you do choose too low a number, there’s a danger of conflict with your program. And how small is too small depends, of course, on how much memory your program needs.
LOADING THE PROGRAM
For a beginner, the easiest way to build a machine code program on the 2068 is through the DATA/READ function. Something like the following:
9000 RESTORE
9010 LET m=65000
9020 READ a
9030 POKE m,a
9040 PRINT m;" ";PEEK m
9050 LET m=m+1
9060 GO TO 9020
and
9900 DATA 42,83,92,35
9910 DATA 17,10,0,1,10,0,62,13
9920 DATA 35,190,32,252,35,62
9930 DATA 35,190,200,190,216
9940 DATA 114,35,115,235,9,235
9950 DATA 24,235
This program, by the way, will renumber the lines of your program, according to the following rules:
Line 1, unchanged
Subsequent lines renumbered 10,20…etc
Lines 8960 and above, unchanged
And watch out for any GO TOs and GO SUBs–it’s almost a sure bet that any lines they refer to will be changed.
THOSE BACK ISSUES
For your convenience, here is an index of the past chapters of BASIL’s COMPENDIUM:
1 Introduction Vol. 2/1 p. 8 2 PEEK, POKE, and USR Vol. 2/2 p. 9 3 Where to Put the Program Vol. 2/3 p. 21 4 LET A=... Vol. 2/4 p. 15 5 Hexadecimal and 256-imal Vol. 2/5 p. 17 6 Deluxe Loader Program Vol. 2/6 p. 21 7 A Few No-nos Vol. 3/3 p. 16 8 LET A=...(again) Vol. 3/6 p. 10 9 Addition Vol. 4/1 p.13 10 Why Use Machine Code? Vol. 4/2 p. 20 11 GO TO/GO SUB Vol. 4/3 p. 19 12 IF...THEN Vol. 4/4 p. 22 13 FOR...NEXT Vol. 4/6 p. 18 14 Input/Output (PEEK and POKE) Vol. 5/1 p. 22
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.