SYNTAX ZX80
A PUBLICATION OF THE HARVARD GROUP
VOL.3 NO.1
IN THIS ISSUE
4K Programs
Address Book: ..oxs.o4% 17
Black 1e0k. owed dss 6% 16 8K Programs
Bar Chat Cees Gees 15
Breakeven Analysis....4 Beginners' Stories
Binary Representation.6
Equational AND/OR....13
Simulate READ, DATA..17
ZX80 Display File..... 8 Book Review
BASIC Computer Programs
For Business sy. 6 1454 4 Classified Ads......... 20 Dear EdLtotin ied et. bac ny. Hardware Hints,..4..0<8% 9 Hardware Project
Leading Pilter. «asi «9s 2 Hardware Review
CAI Widget Board..... 14
Machine Language
8K Routine Addresses. .3 News, New Products....1,2 Program Changes......... 2 Software Review
JRS Programmable
Moving Display........ 6 Tips and Hints Speed Up Programs..... Z Index of Advertisers Lamo-Lem Labs........ LS LU ENterprises 6 ce cus 6 Mindware Co... .s.see. } PM Enterprises........ 3 Sinclair Research.10,11 SOLES YING. ftp drs ate awa 18 Zeta Software, 2... 17
Remember to return your white renewal card to get a free SYNTAX binder!
ISSN 0273-2696 JAN., 1982
M{CROACE 8K ROM REPLACEMENTS FROM SINCLAIR
If you bought MicroAce's defective 8K ROM, send it to Sinclair Research with $10. They'll send back a good 8K ROM. Sinclair Research, 50 Staniford St, Boston, MA, 02114.
MICROACE OUT OF BUSINESS IN US
"MicroAce will cease trading in the US" in December, Kevin Hawkins of MicroAce just announced. No legal action forces the with- drawal, he said. MicroAce cannot compete with Sinclair's ZX81. CompShop, the parent company, continues to do business in the UK.
MicroAce customers needing repairs should send their kits to Bob Ward, 3176 Oak Knoll, Los Alamitos, CA, 90720. The costs are the same--$25 for computer repairs, $15 for video upgrade kit repairs.
If you have grievances against MicroAce, write to them in England: MicroAce-CompShop,
14 Station Road, New Barnet, Hertsfordshire, p England, EN5 1QW. Kevin said they will , handle any customer complaints but cannot j answer technical questions. They have
received 8K ROMs from Sinclair to fill all backorders. Anyone interested in distrib- uting the video upgrade kit in the US should contact MicroAce at their English address.
NEW ZX81 HARDARE/SOFTWARE VENDOR
Mindware Co. will introduce Barscan for ZX8l1s in the next few weeks. Barscan uses bar code technology to process collected data on attendance and job costs and can produce standardized printed reports. It provides 16K RAM and self-prompting programs for non- technical users.
Mindware will also distribute others' ZX81 hardware and software and will commis- sion specific hardware and business applica- tion packages. Mindware, 70 Boston Post Rd, Wayland, MA, 01778, 617/358-7175.
weg.e ~
SYNTAX ERRORS
SABRE's address is 1718, not 1719, Autrey (Nov.81).
Lance Ward's 8K Slalom program (Dec.81) contained 1 error. The last line of line 30 should read:
1,222 AS83AT 20;,175A5
This adds the last pair of gates. New Syntactic Sum: 20065, 8K Lance also added that for the ZX81, you can delete lines 130 and 140. Insert a FOR-NEXT loop or a PAUSE, varying the length to change the speed of descent.
CLARIFICATION OF BYTES REMAINING
Ian Logan's 8K Bytes Remaining program, Dec.81, uses function key- words for all input except E, the numbers, and the punctuation. Thus after 1 REM type the letter E, the numeral 0, the function RND, the function LN, the function arcosine, a colon, and so on. The only space you type in is 1 after the = sign. The second is put in automatically before the GOSUB.
TRAVEL PACKAGE TO LONDON ZX SHOW
Mindware Co. is sponsoring a travel package to the ZX80/81 Micro Fair show in London. Leaving Jan. 28 from Logan airport in Boston and returning Feb.1, the trip costs $439 per person ($489 single occu- pancy). It includes roundtrip air- fare and hotel. For info or reser- vations, contact Mike Gonnerman at Mindware, 70 Boston Post Rd, Wayland, MA, 01778, 617/358-7175.
8K/16K OWNERS: Zeta Software of Greenville, SC, now offers 8K/16K program cassettes. Their latest catalog lists a flicker-free scifi adventure and statistical math packages, plus 48 4K/1K listings, including READ/DATA. For a free catalog, write Jon Bobst, Zeta Software, P.O. Box 3522, Green- ville, SC, 29608-3522.
SPEED UP YOUR PROGRAMS
Most Sinclair users are new to the programming game. Many will use lines like: 350 GO TO 710
In most cases this is fine, especially in a short program. But in a long program with many GO TO statements, the computer takes a long time for each TV display.
Try this: With the Super Monzxer program (Nov.81) (as an example of a long program) in the computer, add these lines:
3 LET A1=1
4 IF A1<100 THEN LET A1=A1+1
5 IF A1>=100 THEN STOP
6 GOTO 4 RUN and the computer will stop at line 5 in about 1 second.
Now change lines 3 to 6:
3 GOSUB 6000
delete line 4
delete line 6
5 STOP 6000 LET Ai=1 6001 IF A1<100 THEN LET A1=A1+1 6002 IF A1>=100 THEN RETURN 6003 GOTO 6001 RUN and the computer stops at line 5 in about 3 seconds.
The difference in run times is because the computer goes to line l every time it finds a GO TO state- ment. It compares that line number with the GO TO number and continues until they match. Then it executes as required.
To speed up execution, move the calls for actions (GOTO, GOSUB) to high line numbers. ZX80/81s can use line numbers up to 9999. The program might then have a REM statement at line 1 and then some GO SUB destinations, depending on how many groups of action state- ments you moved. Remember to adda RETURN statement for each GO SUB. Then comes the rest of the program. This way, most of the GO TO destin- ations are near line 1, the first place the computer looks for them.
Mort Butler, BW-SABRE Inc., Houston, TX
NEW 8K ROM ROUTINE ADDRESSES
Here are starting addresses MX16 16K for routines in the corrected 8K FOR USE WITH THE ROM. All addresses are hex. SINCLAIR 7x80® Routine Address Use AND 7x81® ENDBYT O1LFC Commonly used by SAVE and LOAD MAIN 0229 Primary display routine SLOWIT 0292 Used by SLOW RAM MODULE KYBRD O2BB Scan keyboard(KB) SAVE O2F6 Write from $89.95 PLUS memory to tape $3.00 SHIPPING LOAD 0340 Read from AND HANDLING tape to memory 90 DAYS WARRANTY NEW 03C3 PARTS AND LABOR Cursor: ie. “ore PM ENTERPRISES . 407 E. LINCOLNWAY eee aor LAPORTE, INDIANA 46350 aTRour 058B (219) 326-7923 GETLNM O5B7 Get a line CHECK/M.O./M.C./VISA/C.O.D. number into DE EDIT 05C4 Edit current line NEWLIN O60C Get another line SCROLL OCOE of input from KB RUNIT 063E Used by RUN SYNTAX OCBA Syntax checker ENTER O6E0 Executed when se OD16 ee eae Class 3 0D28 Class 3 Evaluator LIST O726 GLass..1 OD3C PRLIN 0745 Print a line of Class 2 ODO6B BASIC Class 4 0D85 DCDKB O7BC Decode keyboard ae 6 ae PRDIG O7EL Print digits eoe SBE SENDCH O7F1 Continued here from RST NEXT OE2E COPY. 0869 Copy screen to RAND OE69 printer GOTO OE81 PRINTA O8F5 Print at tate ne PRKW 094B Print keywords R NEXT O9F2 GOSUB OEB5 CLS OA2A RETURN OED8 CLRMEM OA60 Clear memory ake sane PRLNN 0A98 Print line number SLOW OF2B LPRINT OACB PRINT OACF PAUSE OF32 PRSTR 0B6B Print a string a ae emis a CLEAR 149A DE=start address ae ee David Ornstein, Newton, MA
BOOK REVIEW
Title: BASIC Computer Programs for Business, Vol.1 By: Charles D. Sternberg From: Hayden Book Co., 50 Essex, Rochelle Park, NJ 07662 Price: $10.00
While visiting a favorite book store, I discovered a treasure chest of jewels suitable to adorn the ZX80/81. This book offers "over 35 programs covering budgets, depreciation, cash flow, property comparisons, accounts payable, order entry, warehouse locations, inventory turnover analysis, job routing, resource allocation, production scheduling," just to name a few listed on the cover.
Each program is shown as a photo reduction of an actual working program printout, elim- inating the usual typos associated with reprinting program listings. Each program contains adequate REM statements identifying operations and specific routines. The extra plus is the finished product print- out of each program incorporating sample data and output--like having answers in the back of the book.
It is an excellent resource, text and drill book combined. A definite must for those seeking more knowledge and practical use for their ZX80/81 as well as great fun and a good challenge.
You won't be able to immedi- ately type in programs and run them because they are written around a standard format printer--over 32 columns. Also, a few commands appear that the ZX80/81 does not have, such as LSET, FIELD, and READ. Your machine's shortcomings should not inhibit you. The Break- even Analysis program, below, was taken from pp.68-/0 and now fits beautifully in the 8K/16K ZX80/81.
In this program, I deleted printer functions in favor of video display. The STEP function was removed by replacing the FOR loop
4
with an IF-THEN GOTO statement with counter commands. All IF state- ments are clearly defined but all equalization statements must be prefaced with LET statements. RO=P*QO becomes LET RO=P*QO. Without the luxury of a 64 colum printer, I rounded off data to fit. Decimal answers to 4 places were not practical and unnecessary for most uses. You must watch out for a few other minor things, but you'll catch on pretty quickly.
Thus
Mel Routt, Clearwater, FL
BREAKEVEN ANALYSIS--8K/16K
This program requires only a single video format for all control data input with an option to erase and re-enter data. This option occurs just before computation, which doesn't begin until you approve data entries.
The computational mode in the book from which I adapted this program (BASIC Computer Programs for Business, Vol.1, reviewed this page) required a STEP function. Although the 8K ROM provides this function, I replaced it with a counter and IF-THEN GOTO loop; note lines 365 and 370.
All underlined items are inverse graphics. Enter the program, then type RUN to start. Enter total fixed costs and vari- able costs per unit. When you complete the control data input and approve it, the screen goes blank for a while. Be patient. The time varies with the input data.
If you requested a long table, you will require more time and overflow the display area, getting an error 5. Have no fear--just press CONT (continue) and NL each time the screen fills until you reach the end of your table or memory, whichever occurs first.
Try to borrow or buy a copy of the book this program comes from and use their data input. Your results should nearly match theirs.
List of Variables: A=profit or loss F=fixed costs C=total costs P=unit price C0=breakeven costs Q0=breakeven point/qty Ql=start qty R=total revenues Q2=stop qty RO=breakeven revenue S=table increment (step) U=unit cost V=variable cost Vi=total variable cost
Mel Routt, Clearwater, FL
1 REM "PROFLOSS TABLE" 2 REM BY MEL ROUTT, 10/3/81 3 REM ADAPTED FROM PG 69 4 REM "BASIC COMPUTER PROGRAM S FOR BUSINESS, VOL. 1" 5 REM BY CHARLES D. STERNBERG 6 REM COPYRIGHT 1980 7 REM BY PERMISSION MR MADARA S 8 REM HAYDEN BOOK CO. 9 REM ROCHELLE PARK, NJ 07662 10 CLS 15 PRINT 20 PRINT "PROFIT/LOSS/BREAKEVE N TABLE" 25 PRINT 30 PRINT " ENTER CONTROL DATA: 35 PRINT 40 PRINT "FIXED COSTS:";TAB 21 Palen ea 45 INPUT F 50 PRINT F 55 PRINT 60 PRINT "VARIABLE COSTS:";TAB 212" $"5 65 INPUT V 70 PRINT V 75 PRINT 80 PRINT "UNIT PRICE:";TAB 21; "gs 85 INPUT P 90 PRINT P 95 PRINT 100 PRINT "START QTY OF TABLE:" ;TAB 22; 105 INPUT Q1 110 PRINT Q1 115 PRINT 120 PRINT "STOP QTY OF TABLE:"; TAB 22; 125 INPUT Q2 130 PRINT Q2
135 140 ; TAB 145 150 155 160 165 EQ/D
170 175
fi" uw 3
180
185 IF D$="YES"
190
PRINT PRINT 223 INPUT PRINT PRINT PRINT PRINT TYPE
PRINT PRINT W
INPUT
CLS
"INCREMENT TABLE BY:" iS) S)
"IF DATA CORRECTION R "W "vES" W AND Ww "N/L" W .
"IF DATA OK PRESS ""N
D$ THEN GOTO 10
195 PRINT " PROFIT/LOSS (-) /BREA KEVEN TABLE:"
200
205 PRINT "RUN";TAB 7;"JOB";TAB
15;"REV.";TAB 22;"PROF";TAB 27; "UNIT"
210 PRINT "QTY";TAB 7;"COST";TA B 22;"LOSS";TAB 27;"COST"
215. FOR -2=1 -PO..32
220 229 230 235 240 245 250 255 260 265 270 275 280 285 290 295 300 305 310 315 320 325 330 335 340 345 ; TAB 350 355 360
PRINT NEXT I LET QO
=F/(P=V)
LET X=Q0
GOSUB LET Q0 LET RO LET X= GOSUB LET RO LET Q= LET CO
700 =X =P*0O0 RO 700 =X
Q1
=F+ (V*Q0)
LET X=CO
GOSUB LET CO LET V1 LET LET LET LET GOSUB
700
=X =V*Q R=P*Q C=F+ (V*Q) U=C/Q X=U
700
LET U=X LET A=R-C
IF Q<Q GOSUB
0 THEN GOTO 360 600
PRINT QO0;TAB 7;CO;TAB 15;RO0 23; "BREAKEVEN" GOSUB 600
LET QO
=999999999999
PRINT Q;TAB 7;C;TAB 15;R;TA
B 22;A;TAB 27;U 365 LET 0=Q+S 370 IF Q<Q2+S THEN GOTO 295 375 PRINT 380 PRINT "TOTAL VARIABLE COSTS
: $"3V1
385 PRINT
390 PRINT "IF YOU WISH TO RUN N EW DATA TYPE ""YES"" AND ""N Pie
395 PRINT
400 PRINT "IF NOT PRESS ""N/L""
405 INPUT D$
410 IF D$="YES" THEN GOTO 10 415 PRINT
420 PRINT "IT WAS A PLEASURE TO SERVE YOU."
425 STOP
600 FOR I=1 TO 32
605 PRINT "-";
610 NEXT I
615 RETURN
700 LET X=(INT (100*(X+.005)))/ 100
705 RETURN Syntactic Sum: 45638, 8K
NOW AVAILABLE
keyboard .
conversions
e Standard Computer Keyboard ¢ Type programs in half the time e Minimize errors
e Wired keyboard hooks up in minutes Plans for keyboard conversion with reverse video
ce) s45 Keyboard with complete parts and plans t€s68 S6 Wired keyboard, complete with plans sone
Add $5.00 mailing charge for continental U.S. Other locations write for details
L.J.H. Enterprises P.O. Box 6273, Orange, CA 92667 Or call 714) 772-1595
PROGRAMMABLE MOVING DISPLAY
Price: £4.95 “(about $10) ROM/RAM reqd: 4K/1-16K Printed listings? Yes Programs listable? Yes Screen prompts? Yes Easy to load? Yes Display: Excellent From: JRS Software, 19, Wayside Ave., Worthing, England, BN13 3JU
At last you can know the secret of true flicker-free continuous display through soft- ware! If you're a 4K ROM user envying the ZX81's continuous dis- play, envy no more. For about $10 you can code a rock-steady, moving display into your 4K ZxX80.
You get an 8-page instruction booklet, a cassette tape with sample programs, blank and demo coding sheets, and graph paper.
The booklet contains directions for running the demo programs, writing your own moving display routines, and gives directions for RAMs over 1K. <A complete, step-by-step example accompanies the detailed instructions. With no independent thought, I ran through their example and it worked perfectly.
The cassette holds only one copy of each program, so you should immediately make backup copies on your own recorder. The programs are recorded with a voice leader and load easily.
This routine works very well, but be forewarned that it is not a couple lines of BASIC that you plug into your own programs. Planning the display requires forethought and careful plotting on the supplied graph paper. Then you must type in numbers corresponding to calculated locations and charac- ter codes. But JRS's input program and written directions make this task as simple as possible.
The quality of both the display and the documentation impressed me.--AZ
IMPROMPTU SURVEY
Tell a book publisher what you want to know about your computer. Chris Varley, editor, invites you to tell him directly what kind of books you need. Chris Varley, Brady Co., 1610 Worcester Rd., 239A, Framingham, MA 01701.
BINARY REPRESENTATION
Knowing how to manipulate individual bits in your ZxX80 is essential for efficient Machine Code programmming, so knowing what bits and bytes are is essential also.
Mechanically, each address in the ZX80's memory contains 8 bits of information (l byte): 8 "switches" either ''ON" or "OFF". In binary representation, or the number system your computer counts in (see Feb.81 p.10), each switch means 1-ON or O-OFF with these values:
Birr ge PB We See. Be Ze,
BYTE - 06 0 0 0 0 0 0 0 =:0
VALUES:128 64 32 16 8 4 2 1
EX. & Or SOo 2 > PR eed
EX. ¢ “A WO" 2 Oe Sk. OG ok. OSS 170 (or -86)
In 1 byte (8 bits), you can store a positive number from 0 to 255, or a negative number up to 127 if using the left-most bit (#7) as the "sign" bit: O=positive and l=negative. The Z80 uses bit 7 for the sign, so any time you PEEK an adddress holding a negative value, it is displayed in 2's complement. That is why our second example is 170 or -86, and not -42. (More on 2's complement next month, or see any Z80 programming book, like Spracklen's Z80 and 8080 Assembly Language Programming or Zaks' Programming the Z80.--AZ)
You can see that having only 8 bits per address rather limits the numerical value in 1 address. So, the Z80 microprocessor accesses 2 bytes or addresses, one after the
ler’s put the sinclair 2x81 to work!
Have you got a software package or hardware device — elther complete or still in the development stage? We'd like to talk to you about licensing and distributing In the U.S. We've only begun to tap the potential of this machine.
The ZX8I is not only a great game-player, it’s also a powerful computing machine. It is adaptable for literally hundreds of business and industrial applications, such as
Job Costing — Estimating Data Bases — Simulations Software Utilities Machine Language Routines Memory Expansion VO Ports — IlfO Devices
These are some jobs we know it can do, you could probably list half a dozen more. Write or call us about your applications, and we'll send you our brochure.
We have also developed our own I/O device for the ZX81 and would be glad to send you a data sheet on It
—— mindware co.
70 Boston Post Rd., Wayland, Ma., 01778 (617) 358-7175
other, for numbers greater than 255. This means that, in its simplest form (4K ROM), the 2X80 can store numbers from -32767 to +32767 like this:
BIT LOW-ORDER BIT HIGH-ORDER
VALUE VALUE 7 128 x256= 15 (for sign) 6 64 x256= 14 16384 5 32 x256= 13 8192 4 16 x256= 12 4096 3 8 x256= 11 2048 2 4 x256= 10 1024 1 2 x256= 9 512 ¢) 1 x256= 8 256
vides fe + 325,52
255+32512=32767
This chart may explain why, to get a large value, you must multi- ply one of 2 PEEKed pair addresses by 256: Next month: SUBTRACTION
BINARY ADDITION &
Jon Bobst, ZETA Software, P.O. Box 3522, Greenville, SC, 29608-3522
NOTES ON THE ZX80 DISPLAY FILE
Brook Mick's letter (Oct. 81) recalls our early experience with
our ZX80. We tried the exercise in the manual, p.24. In the 15th line, every character typed made
another disappear from the screen! The answer appeared in an article by David Tebbit, reprinted in Sync.
This phenomenon is normal to unexpanded ZX80 RAMs, because of display file space limitations. the 1024 bytes (1K) of RAM, the ZX80 needs 40 to store system vari- ables. It uses another 25 in the display file just to maintain a blank screen (the Linsac Companion, p.64), leaving 959 bytes for dis- played and stored program lines, input and calculated variables, and computed output (display). The more you want displayed, the less RAM available for storage and execution; the more program and variables you want stored the less RAM available for display. The TV screen's size limits also cut down on displayed information.
You ask the 1K ZX80 to rob Peter (display) to pay Paul (stor- age). To comply, it erases screen characters. When it nears the display file limit, the ZX80 sub- tracts bytes from the display file to store newly inputted characters (and erase ones on the screen). Already displayed characters disap- pear from the display file, but not from storage. RUBOUT removes the latest entries from storage, freeing bytes for the display file and lost characters reappear.
A similar thing occurs with a 16K RAM pack, but with worse conse- quences. Total RAM is 16384 (16 x 1024). Subtracting 40 bytes for system variables and 25 for display file leaves you 16310 bytes. The ZX80 expands its storage capacity, but not its display file capacity.
The TV screen gives 24 lines of 32 characters, including spaces, or 768 total ''squares."" Since most keywords and characters occupy l
Of
0
byte, assume the screen holds 768 bytes. Input (program lines and prompt responses) uses far less of this maximum potential than does output. ZX80s permit only 14 full 32-character lines, plus a 15th line of about 10 (prompt response) to 18 (program characters) spaces for keyboard input. This gives you a maximum of 458 to 466 1-byte characters, including spaces.
If you pass this limit, the ZX80 makes room in the display file for more input by sacrificing its supplied cursors and the end quote in string prompt responses. It next removes bytes from the display file, causing screen erasure. For output of computed information, the ZX80 only needs the last screen line to print a run report, or error code. So an output display ean fill 23 lines of 32 characters each (736 in ail) and RUN success- fully. If you ask for 737 charac- ters, the program stops, giving error 5 (no more room on screen) having printed up to 736 1-byte characters, its maximum output at any time. On a 1K machine, the more program and stored variables, the less room in the display file.
A 16K RAM can also output 736 bytes at a time in a successful run, then stops with error 5. Un- til the program and all variables exceed 15583 bytes, the ZX80 won't cut down this maximum display.
Input data also permits this maximum, but cursors and end quotes for strings (needed for acceptable input) use 2-3 of the total 736 screen spaces. To allow for the letter cursor, syntax marker in program input, and mandatory or supplied end quote, keep maximum input display in 1 program line or prompt response to 733 bytes or fewer. If you don't, you won't get an easily cured disappearing act as on the 1K machine. Instead, you'll face an impasse with your ZX80 and have to pull the plug!
Sage Kring, Brookfield, MA
MORE HARDWARE HINTS
Poor Contact
Polish the board edge contacts for the RAM almost to bare copper. Otherwise grit gets in the solder and causes intermittent contact. Coat with high detergent motor oil (Mobil No. 1, for example.); it is designed to prevent oxidation of copper, lead and tin in engines.
Put a pad between the RAM and the computer to prevent rocking. Fasten both to a board to prevent relative motion.
Some of the cable plugs go in too far for a reliable contact. Press a no. 4 split lock washer down to the base of such plugs for correct insertion depth.
Improve the contact between the grounding fingers and the case by placing foil strips in the case. This helps contact the metalized surface of the plastic. Tape the foil in by the ends.
Some computers and RAMs are inadequately masked and metallized where shorts may occur. Tape insulates some areas, but it cuts through. If you scrape the metal from the plastic near the sides or keyboard where shorts might occur, you will permanently cure the shorting problem. Remove only enough metallizing to prevent shorts; otherwise you will create an interference problem.
Heat
Cut ventilating holes or slots in the computer and RAM, then cover the openings with flyscreen to let heat out and keep junk out.
Operation
Keep your TV away from the tape recorder; some pick up the 15 KHz from the TV and feed it to the computer. (It won't load this noise!)
Record valuable tapes on more than one cassette; store them separately. These precautions minimize damage if you mess up the
work tape.
Tape Care
Label cassettes with type- writer correction tape stuck on the back. Store open end down so you can see labels on more tapes and dust falls out, not in.
Keep cassettes in plastic baby bottle bags. They are better than tape boxes at keeping out the worst problem--dust and dirt. Secure with an elastic around the long way of the cassette.
Store tapes edge down in 3x5 metal card file boxes, 5 to a box. This also protects against weak magnetic fields.
Tape Loading
Figure one shows an improved loading filter. This works even better than the one in SYNTAX (p.11 Sept. 81).
Static Control
Static may cause a crash if you shuffle your feet on a rug before touching the computer. Ground yourself and the computer if necessary. On upgraded (8K) ZX80s, put foil under the overlay and ground the foil. Expose an edge of foil to ground yourself.
Brian O'Brien, 15 Country Drive, Weston, MA, 02193, 617/891-8990.
0.22uF COMPUTER TIP
RING
RECORDER
ADD TO EAR CABLE
ADD TO 2X80
JACK FOR /R29 1 EAVESDROPPING Cy ADD FIGURE 1 peeks
Introducing the Sinclair ZX81
If you’re ever going to buy a personal computer, now is the time to do it.
The new Sinclair ZX81 is the most powerful, yet easy-to-use computer ever offered for anywhere near.the price: only $149.95* completely assembled.
Don't let the price fool you. The ZX81 has just about everything you could ask for in a personal computer.
A breakthrough in personal computers
The ZX81 is a major advance over the original Sinclair ZX80—the world’s largest selling personal computer and the first for under $200.
In fact, the ZX81’s new 8K Extended BASIC offers features found only on com- puters costing two or three times as much.
Just look at what you get: Continuous display, including moving graphics B® Multi-dimensional string and numerical arrays
*Plus shipping and handling. Price includes connectors for TV and cassette, AC adaptor, and FREE manual
ay 3 ee ay
a es
Mathematical and scientific functions
accurate to 8 decimal places
@ Unique one-touch entry of key words
like PRINT, RUN and LIST
@ Automatic syntax error detection and
easy editing
@ Randomize function useful for both
games and serious applications
B® Built-in interface for ZX Printer
1K of memory expandable to 16K The ZX81 is also very convenient
to use. It hooks up to any television set
to produce a clear 32-column by 24-line
display. And you can use a regular
cassette recorder to store and recall
programs by name.
If you already own a ZX80 The 8K Extended BASIC chip used in the ZX81 is available as a plug-in replacement for your ZX80 for only $39.95, plus shipping and handling—complete with new key- board overlay and the ZX81 manual. So in just a few minutes, with no special skills or tools required, you can upgrade your ZX80 to have all the powerful features of the ZX81. (You'll have everything except continuous dis- play, but you can still use the PAUSE and SCROLL commands to get moving graphics.) With the 8K BASIC chip, your ZX80 will also be equipped to use the ZX Printer and Sinclair software.
Order at no risk**
We'll give you 10 days to try out the ZX81. If you’re not completely satis- fied, just return it to Sinclair Research and we'll give you a full refund.
And if you have a problem with your ZX81, send it to Sinclair Research within 90 days and we'll repair or replace
it at no charge. **Does not apply to ZX81 kits
NEW SOFTWARE:sSinclair has ZX PRINTER: The Sinclair ZX Printer will work with your ZX81, or ZX80 with 8K BASIC. It will be available in the near future and will cost less than $100.
published pre-recorded pro- grams on cassettes for your ZX81, or ZX80 with 8K BASIC. We're constantly coming out with new programs, so we'll send you our latest software catalog with your computer.
and handling.
16K MEMORY MODULE: Like any powerful, full fledged computer, the ZX81 is expand- able. Sinclair's 16K memory module plugs right onto the back of your ZX81 (or ZX80, with or without 8K BASIC). Cost is $99.95, plus shipping
ZX81 MANUAL: The Zx81 comes with a comprehensive 164-page programming guide and operating manual de- signed for both beginners and experienced computer users. A $10.95 value, it’s yours free with the ZX81.
= a ee
Introducing the ZX81 kit
If you really want to save money, and you enjoy building electronic kits, you can order the ZX81 in kit form for the incredible price of just $99.95* It’s the same, full-featured computer, only you put it together yourself. We'll send complete, easy- to-follow instructions on how you can assemble your ZX81 in just a few hours. All you have to supply is the soldering iron.
How to order
Sinclair Research is the world’s larg- est manufacturer of personal computers.
The ZX81 represents the latest technology in microelectronics, and it picks up right where the ZX80 left off. Thousands are selling every week.
We urge you to place your order for the new ZX81 today. The sooner you order, the sooner you can start enjoying your own computer.
To order, simply call our toll free number, and use your MasterCard or VISA.
ra ‘ To order by mail, please use the coupon. And send your check or money ts order. We regret that we cannot accept
, purchase orders or C.O.D's.
CALL 800-543-3000. Ask for op- erator #509. In Ohio call 800-582-1364. In Canada call 513-729-4300. Ask for operator #509. Phones open 24 hours a day, 7 days a week. Have your Master- Card or VISA ready.
These numbers are for orders only. For information, you must write to Sinclair Research Ltd., 2 Sinclair Plaza, Nashua, NH 03061.
—hcdhBaIm cla ir-
feng rn a
NAME
|AD CODE “4 05SX | PRICEt QTY. AMOUNT 3 ZX81 | $149.95 = 2X81 Kit 99.95 x 8K BASIC chip (for ZX80) 39.95 F 16K Memory Module (for ZX81 or ZX80) 99.95 | Shipping and Handling 4.95 | $4.95 TOTAL
MAIL TO: Sinclair Research Ltd., One Sinclair Plaza, Nashua, NH 03061.
ADDRESS
CITY/STATE/ZIP
t U.S. Dollars
DEAR EDITOR:
I ordered MicroAce's 8K ROM and Flicker-Free Video Upgrade board. When they arrived I easily changed ROMs and the 8K worked fine. The instructions for the upgrade kit were minimal, to say the least, but they did contain John Strain's mod (Sep.81).
When I soldered the capaci- tors, I left enough leads so they could be bent down close to the board (knowing that space would be tight). Then I attached John's mod right on the edge of the FF board, using the resistor and transistor leads for support. I clipped off all the IC and socket prongs from both the ZX80 and the FF board on the solder side. This allowed the 2 boards to get close together, saving space.
I put a piece of 5 mil acetate plastic on the ZX80 board to insu- late it from the FF board bottom and taped them together. Finally, I put another piece of acetate on the ZX80 case where the FF board might touch. The case went togeth- er fine, not even a bulge. The FF upgrade works fine. It even works the FAST and SLOW BASIC commands, like the ZX81, with no problems whatsoever.
A Silver Springs, MD, Reader
My new ZX81 is inconsistent with regard to ''glitches.'' Some- times I get 1 per minute, other- times none for an hour. The AC adapter measures 13.75 Vdc, not 9.75 Vde. Should I return it to the factory?
Bill Hulett, Jackson, MS
Skip Hammel of Sinclair says your glitch problems probably result from your home wiring. Appliances can cause power drops, as when a refrigerator kicks on. Try a line filter (available cheap from Radio Shack) to prevent these problems.
12
The voltage you measured is OK for an unloaded line. When in use, the voltage drops to around 9 V.--AZ
I had a problem with my 16K RAM pack dumping programs on my ZX80. The slightest movement of the RAM pack caused it to dump. took the eraser from a pencil and gently rolled it down between the computer and the RAM pack about 1/4", just enough so the RAM pack fits snugly on the computer. The RAM doesn't lift up when pushed. I've had no problems with dumping.
L
Jim O'Toole, Ridge, NY
Vol.2 No.11 mentions upgrading a ZX81 to 2K RAM by replacing one chip. One article says to use a #6116 (Hitachi); the other says to use a #4816 and one jumper. How do I obtain info on which is which and how to do it? Also, can I use a larger keyboard? What kind?
Howard Kaplan, Van Nuys, CA
To get chip information, contact the manufacturer's local rep or the company itself. See classified ads this issue for a 6116 source. People we've talked to do better with the 6116 chip. To install either, remove the RAM chip(s) on the right of the ZX81 board. (If you got an assembled one, pry the feet off and remove the screws underneath to open the case.) If you have only one RAM chip, it's in a socket with 4 spare pins. Remove this chip and plug in the 6116 or 4816. Remove the jumper marked Ll on the right of the socket and make the connection marked L2 (printed on the board, or see a schematic). If you have two RAM chips, remove them both and install a 28-pin socket where the rightmost chip was, then make the new connection and plug in the new chip.
You can attach a larger key- board to your ZX81. Commercial keyboards, kits and plans are
——<—— ——— eEEEEOEOoEEee RN
available from LJH Enterprises and A.P. Electronics, both in Califor- nia (see ads this issue.) You can also build one yourself using sur- plus materials. Check our how-to
articles in Dec.80 and Mar.81.--AZ
My SABRE 4K memory board came with clear assembly instructions and drawings showing where to put the diodes and jumpers. My only trouble was not telling them I intended to use the board with a 2K MicroAce. When I wrote them about my problem, Mr. Sisco called to tell me that their board bats heads with the 2K MicroAce. They sent me a modification kit, but I just pulled the RAM out of the MicroAce and got 4K with the board. You'll come out money ahead by buying the complete kit from SABRE at $45.
You don't save much looking for the parts. The cheapest I found the 6116 was $15.95.
LaVerne Hoffman, Canby, OR
ATTENTION USERS' GROUPS
Many readers call or write to ask about users’ groups in their areas. Specifically, people in Seattle, Austin, Philadelphia and Chicago are looking for groups to join. Please send us a notice of your existence and we'll send interested ZX80/81 users to you.
BALTIMORE AREA USERS' GROUP: Jack Fogarty is coordinator of the Wes- tinghouse Sinclair Users' Group. Most members are in Westinghouse, but Jack says any area user is welcome. Contact him at Westing- house, Advanced Technology Labs, MS 3525, Box 1521, Baltimore, MD, 21203, 765-7116.
NEW OKLAHOMA USERS' GROUP: Patrick Spera plans to form a users' group in the Midwest City, Del City and Tinker AFB (OK) area. Interested users should contact Sgt. Patrick Spera, T-148, Tinker AFB, OK, 73145, 732-3848.
13
EQUATIONAL AND/OR--8K, 4K
Many users are confused about the logical use of AND and OR in the 8K ROM. Here is a touchstone (demonstration) program illustra- various uses of AND and OR.
10 LET A=1
20 LET
30 LET
40 LET
50 LET
60 IF E=5 AND D=4 AND C=3 THEN
PRINT "THE PEACH ";
70 IF E=4 OR E=5 THEN PRINT "B LOSSOMS ";
80 IF (D=5 AND E=4) OR (D=4 AN D E=5) THEN PRINT "SMELL ";
90 IF (D=4 OR D=5) AND (A=2 OR
A=1) THEN PRINT "GOOD ";
99 IF B=1 OR B=3 OR B=2 THEN P RINT "TODAY." Does the whole the program to
Note that here we are only describing the use of AND/OR sep- arating equations (like X=Y AND Z=A), not the use of AND/OR without equations (like X AND Y). We will tackle the latter use at another time to better separate the two broad uses in your mind.
We recently used this line in a program and it worked:
764 IF M$(C,1)=M$(C,5) AND M$(C ,2)=M$(C,6) AND M$(C,1)=M$ (H, 1) AND M$(C,5)=M$(H,5) AND M$(C,2)= M$(H,2) AND M$(C,6)=M$(H,6) AND ( (M$ (C, 3) <>M$(H,3) AND M$(C,7)<> M$(H,7)) OR (M$(C,4)<>M$(H,4) AN D M$(C,8)<>M$(H,8))) THEN LET E( 1)=E(1)+1 You can use the touchstone program to guide you in contructing such complex lines.
wHodw eo th al Om WN
sentence print? Run
find out.
Paul Ezra, San Diego, CA
Note that if A is true and B is false, A AND B is false, but A OR B is true. In an IF-THEN statement, true results tell the computer to execute the command after THEN. False results cause the computer to skip the command after THEN.--AZ
HARDWARE REVIEW
CAI Instrument's Widget Board Peete «579.95
CAI Instruments, 2559 Arbutus Ct. , Midland, MI, 48640, 517/835-6145
Most of us are pretty tired of waiting up to a year for delivery and then getting equipment and man- uals with obvious mistakes. Couple that with an unresponsive manufac- turer and you get frustrated customers. Because of problems detailed below, SYNTAX recommends that you delay purchasing the Widget until CAI Instruments offers correct, complete, and consistent documentation and prompt shipping schedules. If you can deal with these problems yourself, the Widget provides you with a packaged set of ports and peripheral controllers.
You pay more for the Widget without printer and tape control EPROMS--$80 for the Widget alone, only $60 with printer and tape drive. ROMs come with the peripheral, not with the Widget.
The Widget plugs into the ZX80/81 expansion port. The 16K RAM plugs into a similar port at the rear of the Widget. At the left of the Widget housing you see three connectors--two IC sockets to connect CAI's printer and contin- uous tape drive plus a 20-pin male connector for parallel and serial port outputs.
You MUST add RAM to use the Widget, and all 16K machines we tried appeared to have only 2K remaining with our Widget attached. CAI Instruments say that they use the upper 4K of memory, leaving 12K free with a 16K RAM. We are unable to verify that.
CAI's device produces RS-232C compatible serial output. That means the electrical signals pro- vide well-defined voltages and signal timing. It does NOT mean that all RS-232 control functions or ASCII translations are provided. Nor do you get a standard RS-232
connector.
We judge the pinout, dia- grammed below, to sensibly segre- gate the serial and parallel ports as well as the parallel input and output. To use ribbon cable, you'll have to unscramble things at your end.
RCV D4 D2 DO D6 D3 D5 D2 Dil Oo SO OPO: AOE 865 208 On sO 3 SER OV INPUT DATA OUTPUT DATA OF Or Ol 1-0". Oe OL OE OL. O XMT D7 D3 Dl D5 D4 DO D7 Dé
The bare-bones Widget gives you a fully-buffered expansion port, but no hint of how many loads you can drive. You also get two 8- bit, parallel ports, one input and one output. Third, you get serial I/O with RS-232 signal levels at one, jumper-selected, Baud rate of 300, 1200, 2400, 4800, or 9600.
In my judgement, Widget construction techniques may induce failures and make maintenance tough. Inside, 39 separate pins connect the 2 stacked boards electrically and mechanically--a maintenance nightmare.
Half the ICs are sandwiched between these boards, a problem for both cooling and maintenance. Our sample contains 4 unrestrained long wire jumpers (1 soldered directly to IC pins at the device bodies) --expect trouble here from vibra- tion. When attached, the Sinclair RAM hangs unsupported on its connector.
The instruction manual con- tains inconsistencies in POKE or PEEK addresses and programs that will not run. Modifications listed for the 8K ROM are correct, but not complete. Devise your own scheme to check the status bit on 8K mach- ines because CAI's example ignores 4K/8K ROM differences. CAI pro- vides a schematic with the Widget and hardware buffs could fill in the omissions. Computer and I/0 busses are shown in single-line form with complete pin connections,
We found no pinouts for peripheral sockets. Nine ICs carry no type markings on the schematic. Logi.c circuitry is shown in functional form, but you cannot tell which functions are in which package. CAI provides no IC list.
According to Bob Swann of CAI, we got the wrong page for table B, so we got no pinout diagrams for the connectors. Bob provided the pin numbers (not marked on the Widget) by phone and promised to have someone call us about the program problems. We'll let you know when they do so.
Despite these problems, we successfully operated the device. We ran serial echo checks. We also tested the parallel input and out- put ports. All operations seem correct; we found no bugs other than the unresolved memory issue. In my judgement, the device works with ZX80/8ls. We made no tests with MicroAces.--KO
BAR CHART--8K/2K
Bar Chart uses the 8K PLOT function to simplify the bar chart algorithm. It assumes B(15) has been filled, or partially filled, with values between 0 and 2000.
Lines 20-50 provide scale marks and label 3 of them in 1000s. Line 60 should be 1 TO (size you dimension B to). Line 80 will STOP at the first unfilled element of B. All elements are initially set to 0 with the new ROM. Line 90 sets the range--100 per pixel in this case-- and makes the half-range adjustment (-50) so each pixel represents a midpoint (eg. pixel 100 represents values from 50-149). Line 100 spaces between each bar (A*2) and tabs over to allow for the scale (+3). Line 130 means that to enter a new value, simply enter LET B(A)= (new value), press NL, then GOTO 1. Do not type RUN again.
Set line 90 for the desired pixel range, adjust line 100 to make more room for your scale, if
ZH81 CLASSICS
A CASSETTE OF FOUR CLASSIC COMPUTER GAMES FOR THE 2X81 (AND 8KROM 2X80 & MICROACE)
NEEDS JUST 1K MEMORY!
K-TREK —With suns, bases, Phasers, Warp Drive, Impulse engines, Quadrant display, and an enemy that changes position...and fires back! A color keyboard overlay turns your keyboard into a command console.
LUNAR LANDER —With instrument panel and descending lunar module.
MASTERMIND —Break the hidden code. Nine levels of difficulty.
LIFE —The classic computer game. With generation counter, stop- action key, and large screen display.
ZX81 CLASSICS IS PACKED IN A ZIP-LOCK BAG WITH MANUAL, GAME CARDS, KEYBOARD OVERLAYS, CASSETTE OF GAMES, AND MORE! ALL FOR $9.95 POSTPAID.
ZX8I IK DISASSEMBLER
Reveal the secrets of Sinclair's ROM and expose useful assembly- language subroutines with this Disassembler for 1K memories or more. Translates each Z-80 machine-code instruction into a unique key. Look up the key in the manual to find the assembly-language mnemonic. Also calculates all numbers, addresses, and displace- ments. RAM test also included. Packed in zip-lock bag with manual, reference cards, and cassette of programs. For all ZX81s (and 8K ROM ZX80s & MicroAces)...$9.95 postpaid.
ALSO AVAILABLE: ZX80 Disassembler (for the 4K ROM)...$9.95 postpaid.
LAMO—LEM LABORATORIES, BOX 2382, LA JOLLA, CA 92038
needed, and experiment with various scale representations. I kept mine simple to save memory. DIM(B) can be larger or smaller than 15. Jon Passler, Beverly, MA 1 DIM B(15) 2 FOR X=1 TO 15 3 INPUT B(X) 4 NEXT X 10 REM BAR CHART 20 FOR A=11 TO 21 30 PRINT AT A,1;"-" 40 NEXT A 50 PRINT AT 11,0;"2";AT 16,0;" SAP 22150" 0" 60 FOR A=1 TO 15 70 FOR P=1 TO 43 80 IF B(A)=0 THEN STOP 90 IF B(A)<P*100-50 THEN GOTO
(0-2000)
PLOT A*2+3,P
NEXT P
NEXT A
REM INPUT B(A) Syntactic Sum: 19586, 8K
4K/1K BLACKJACK
In this 4K/1K ZX80 version of 21 you play one-on-one against the computer-dealer. It deals you two cards face up. To take another card, hit NL; to hold, press SPACE NL. The ZX80 then plays out its hand and shows if you win or lose.
You can only play 5 cards, and you cannot convert aces from lls to ls. The computer masks its down card and score until it plays. To play again, hit NL; to exit, hit SPACE NL. Line functions appear after semicolons in each line.
Wayne Root, Garfield Heights, OH
10 DIM P(5) ;your hand
20 DIM C(5) ;computer's hand
30 DIM D(10) ;deck of cards
40 LET Q=0 ;position of card ;in your hand
50 LET U=0 ;position of card ;in computer's hand
60 LET V=1 ;Z2X80's turn? O=yes
70 FOR J=3 TO 5
80 LET C(J)=0 ;clears cards 3,4,5
90 LET P(J)=0 ;of last hand
100 NEXT J
110 GO SUB 360 ;shuffle
120 GO SUB 500 ;deal your card 1
130 GO SUB 550 ;deal ZX80's card 1
140 GO SUB 500 ;deal your card 2
150 GO SUB 550 ;deal ZX80's card 2
160 GO TO 200
170 INPUT A$ ;want a card?
180 IF NOT A$="" THEN GO TO 230
;yes hit NL, no hit space NL
190 GO SUB 500 ;deal you a card
200 IF S>21 THEN GO TO 300 ;lose?
210 IF S=21 THEN GO TO 230 ;if 21 ;then. ZX80's turn
220 GO TO 170
230 LET V=0 snow ZX80's turn
240 GO SUB 600 ;show hidden card
250 GO TO 270
260 GO SUB 550 ;deal ZX80's card
270 IF T<17 THEN GO TO 260 ;ZX80'sS
;total <17?
280 IF T>21 THEN GO TO 340 ;2Z2X80
290 IF T<S THEN GO TO 340 ; loses?
300 PRINT "LOSE"
310 INPUT A$ ;play again?
320 330 340 350 360 370
380 390 400 410 420 430 440
450 460 470 480 490 500 510
520
530 540 550 560
570
580 590 600 610 620 630 640
650 660 670 680 690 700 710 720
730 740 750 760 770
Syntactic Sum:
IF NOT A$="" THEN STOP GO TO 40 ;restart PRINT "WIN" GO TO 310 FOR J=1 TO 10 LET X=RND (52) ; choice FOR W=1 TO 10 IF X=D(W) THEN GO TO 370 NEXT W GO TO 430 LET X=X-13 ;card point value IF X>13 THEN GO TO 420
;shuffle routine ;random card
;that ;card already picked?
IF X>10 THEN LET X=10 ;face ;cards=10 IF X=1 THEN LET X=11 ;aces=11
LET D(J)=X ;place card in deck NEXT J
LET K=0 ;card position in deck RETURN
LET K=K+1 ;next position
LET Q=Q0+1 ;next position in
;your hand LET P(Q)=D(K) ;from deck to ;your hand
GO SUB 600 ;print RETURN LET K=K+1 ;next deck position
LET U=U+1 ;next position in 7Z2X80's hand LET C(U)=D(K) ;from deck to
;Z2X80's hand
GO SUB 600 ;print RETURN CLS ;print subroutine
LET S=0 ;clear your total
LET T=0 ;clear ZX80's total
FOR Z=1 TO 5
IF V=Z THEN GO TO 670 ;if not :ZX80's turn, mask card 1
PRINT P(Z),C(Z) ;print cards
GO TO 680
PRINT P(Z) ,C(Z)
LET S=S+P (Z)
LET T=T+C(Z)
NEXT Z
IF V=1 THEN GO TO 750 7;ZX80's turn yet
PRINT S,T ;print totals
GO TO 760
PRINT S,CHR$ (15)
RETURN
j;masked card 1
;add your score ;add ZX80's score
j;not
smask ZX80's ; score
8075, 4K
ADDRESS AND PHONE BOOK--4K
This 4k program stores ASCII as codes into an array, getting areund the 4K BASIC's lack of string arrays. It stores and prints names and addresses one at a time. This program runs in a 2K machine; for 1K RAM reduce DIM A.
Tvpe in the program, then RUN. Answer A to the first prompt, then enter the requested information. When vou list names, enter A in response to the LS prompt to see the next name. SAVE, then reLOAD. Type GO TO 20, not RUN, to see saved names and addresses.
John Walsh, Van Nuys, CA
(I got about 5 names and addresses in with A dimensioned to 250, using a 16K RAM pack. --AZ)
DIM A(250)
LET N=0
CLS
PRINT "ENTER A TO ADD. Is List." INPUT A$ IF A$="A" CLs
LET X=0 IF A(X)=222 THEN GO TO 130 IF A(X)=130 THEN GO TO 170 PRINT CHR$(A(X));
LET -X=X¥1
IF X=N-1 THEN STOP
GoTo -70
LET X=X+1
GO TO" 70
INPUT A
LET X=xX¥1
CLS
GO TO 70
CLS
PRINT "NAME ?"
GO SUB 500
PRINT "STREET ?"
GO SUB 500 PRINT. "CITY, GO SUB 500 PRINT "ZIP ?"
DEF
THEN GO TO 300
STATE ?"
17
The adventure begins........
oUt FiGy,
ASSIGNMENT: Space Station HEINLEIN on patrol in the N. Polar region of Sol DUTY: Interceptor pilot...practice launching/docking & combat flying ENEMY: Warrior humanoids ("Lizardmen") ORDERS: Kill or be killed
Zetalrek #1
SCOUT FIGHTER 16K RAM for ZX80~8K/ZX81 *Written in BASIC and Machine Code *Active animation...no-flicker displays *Tape-only includes program booklet
PRICE: $14,95 + 2.50 S&H ($17.45) TO: "Scout Fighter SX2",ZETA Software, P.0.Box 3522,Greenville,SC 29608
Or write for catalog of 53+ titles, In Europe, send inquiries only and U$1 bill or DM2 stamp to: DELTASOFT SX2, Osterfeldstr.79d,D-2000 Hamburg 54,GER
GO SUB 500
380 390 400 410 420 430 500 510 520 530 540 550 560 570
PRINT "PHONE ?"
GO SUB 500
LET A(N)=130
LET N=N+1
GO-TO 10
INPUT N$
LET A=CODE (N$)
IF A=1 THEN GO TO 570 LET A(N)=A
LET N=N+1
LET N$=TL$ (N$)
GO- TO 5:10
LET A(N)=222
580 LET N=N+1 590 RETURN
Syntactic Sum:
-24803, 4K
SIMULATE READ, DATA FOR STRINGS
Although your ZX80 (both ROMs) or ZX81 does not have READ, DATA or RESTORE functions, you can easily mimic them with other functions.
Some background: String variables are like numerical vari-
ables, which we've already dis- cussed--they are named by a letter and vou assign values to them. Unlike numerical variables, the value you give a string variable is always a string of characters and these characters can be letters or numbers String variable names always contain one letter and a dollar sign (AS, Q$) and the string itself is in quotation marks.
ZX80/8ls always save variable values, whether strings or numbers. Thus, after running a program and entering values, you can save them on tape with the program. To use them again, remember to type GO TO X, where X is a line number after the variable assignment statements. RUN, CLEAR or NEW will erase the values you saved.
To simulate READ, DATA and RESTORE functions (described last month), you can just assign each string to a different string vari- able. Put the assignment lines at the beginning of your program:
2X81 /\TO
10 INPUT AS
20 INPUT BS The strings you enter for AS and B$ will save with your program. To use them later, type GO TO 30. The program will execute from line 30 on, and not ask you to input A$ and BS again. It will use the strings you already entered.
A way to more closely simulate READ, DATA and RESTORE is to use subroutines. You assign different values to only one string variable. This method also uses the ZX80/81's ability to GO TO a calculated line number. The 4K program accompany- ing our telephone dialer project (Feb. 81) is a simple example.
The program stores names and telephone numbers. To put names into the program, you list them in short subroutines at the end (like DATA statements). We'll ignore the phone numbers here. Use DS as the string variable and put a RETURN after each:
700 LET DS$="UNCLE JIM"
VATA
SUPER INVASION
“The best Sinclair game to hit the market.” - ae rt we
—SYNC Magazine. Amoving graphics game with i i three levels of play. SUPERINVASION challenges «ills ail your skill as you fire lasers at the attacking space a | invaders while maneuvering your space craft to | avoid their deadly lasers. rs
1K $14.95
ADVENTURE “A”
Your space ship is marooned on a strange planet but you can get out if you make the right combina-
vs a.
tion of decisions. Written in machine language, *
this challenging adventure has over 100 words of {it
vocabulary. 16K $19.95
As commander of Starship Enterprise, you find yourself defending a galaxy overrun with the dreaded DRAKONS. Can you destroy them? With five levels of play and excellent graphics, you'll find SPACE TREK entertaining and challenging. Can only be used with the ZX81.
$14.95
16K UNDERSTANDING YOUR ZX81 ROM
This book gives an overview of machine language and describes the operation of the Sinclair ROM. Essential for the serious programmer.
BOOK
WALLBUSTERS
“A breakthrough in creating active display games.'-SYNC Magazine. WALLBUSTERS challenges you to break through two barricades using nine balls and a curved bat. With seven levels of play, WALLBUSTERS is hard to beat. You'll be amazed at the superb graphics in this 1K
game. 1K $14.95 ADVENTURE “B”
Enter the long lost Inca Temple, find your way
Fa, through the tricky tunnels and corridors and you
may find the lost treasure. Or you may be lost
B.. forever. 16K $19.95 TEN EXCITING PROGRAMS FOR THE ZX81: 1K
These BASIC programs on cassette include Lunar Lander, Space War and Brands Hatch. In- cluded are complete listings and suggestions so you can learn and adapt programs. Can only be
used with the 2X81. 1K $14.95
SEND CHECK OR MONEY ORDER TO SOFTSYNG INC. PO. Box 480, Murray Hill Station, New York, NY. 10156
1.50 SHIPPING AND HANDLING
New York residents add sales tax
18
ZXCHESS
This sophisticated chess game has seven levels of play and a detailed display of the board. You can change sides and even change levels of dif- ficulty during a game. You can also start playing from any point in the game and if you get stuck, the computer will recommend a move. $24.95
16K a Ss REVERSI
a it you like Othello, you'll love REVERSI. With the ee board displayed, you can go first or let the computer go and you have a choice of starting positions. 1K $14.95 DIRECTORY/RECORD
Two programs on one cassette with full listings. The DIRECTORY program allows you to read names of programs saved on cassette. The RECORD program allows you to save and load 96 Byte data records on tape and can be incor- porated into other programs.
1K $14.95
MACHINE LANGUAGE PROGRAMMING
Made Simple For the Sinclair ZX81. This book is a complete guide in machine
language for the beginner. BOOK $19.95
704 RETURN
710 LET D$="DIR. ASSISTANCE"
714 RETURN
720 LET D$="'"EMERGENCY"'
724 RETURN . Notice that each set of line num-- bers differs only by 10. This lets us call the subroutines easily.
At the front of the program we find: 100 FOR G=1 TO 10 120 GO SUB 690+G*10
OUR POLICY ON CONTRIBUTED MATERIAL
SYNTAX ZX80 invites you to express opinions related to the ZX80 and the newsletter. We will print, as space allows, letters discussing items of general in- terest. Of course, we reserve the right to edit letters to a suitable length and to refuse publication of any material.
We welcome program listings for all levels of expertise. Programs can be for any fun or useful purpose. We will test run each one before publishing it, but we will not debug programs; please send only workable listings.
In return for your listing, we will pay you a token fee of $2.00 per program we use. This payment gives us the nonexclusive right to use that program in any form, world-wide. This means you can still use it, sell it, or give it away, and so can we.
We will consider submissions of news and hardware or software reviews. Please keep articles short (350-400 words). Again, we reserve the right to edit ac- cepted articles to a suitable length. We will pay 7 cents per 6 characters, including spaces and punctuation, for accepted articles.
When you send in programs for possible publication in SYNTAX, please include the following information:
© How to operate the program, including what to input if it does not contain
prompts.
© Whether you can run the program over again and how.
© How to exit the program.
© The Syntactic Sum (using the Syntactic Sum program in the February,
1981. issue).
© Whether it fits in 1K or 2K RAM (or 16K when available).
© Whether it uses the 4K or 8K ROM.
We pay for this explanatory text at the same rate as for articles in addition to payment for the program itself.
If you want us to return your original program listing or article, please includ
a self-addressed, stamped envelope. Otherwise, we cannot return submitted material.
SYNTAX ZX8O is published
YES! Please send me 12 issues of SYNTAX for
130 PRINT D$ 140 NEXT G
puter goes to 700, as
130). Now it prints
140,
G=2, the computer to 690+2 7 LO. String, Line 714 returns the line 130,.~ The -cyele
In this example, within the FOR-NEXT 1 READ statement. The
DATA statements.
To simulate REST only use a GO TO 100 This sends the comput first "READ" line to over. When you save you can type RUN becal are not stored as var program lines.
These methods wo
e
ROMs.
If G=l then 690+G*10= subroutine's line number.
goes to the next line
Line 710 assign “DIR: “ASSISTANCE”,
all values for D$ hav
routines assigning va
the first The com- signs DS the
700,
string "UNCLE JIM", then returns to the line after the GO
SUB (line UNCLE JIM and 140. Line
>
the end of the FOR-NEXT loop, sends it back to line} 100. so the GO SUB in
Now
| line 120 send *10, or line
s another
to DS; computer to continues till e been read. the GO SUB oop acts as a short sub- lues act as
ORE, you need
statement.
er back to the start all
this program,
use the values iables but as
rk on both
$29.
L] My check for $29 is enclosed. L] Please |charge my L] MasterCard Pee tien casi Make checks payable to: 8 Diner’s Club (J American Express : SYNTAX ZX80, INC. L) VISA’ (J Carte Blanche account Syntax ZX80, Inc. account number RD 2, Box 457, Harvard, MA 01451. Telephone 617/456-3661. exp. date bank number (MC only) 12 issues, $29. Single issue, $4. signature Publisher: Kirtland H. Olson Name Title — Editor: Ann L. Zevnik Organization irae tnd. Printed by Joseph E. Marhefka, Jr. Address — Clinton Offset Printers ; : a. Clinton, MA 01510 <u State ___ Zip © Syntax ZX80, Inc., 1981. All Day Phone (__) Evening Phone {___} ae rights reserved. Photocopying prohibited. ISSN 0273-2696 I own a CJ Sinclair ZX80 UC Sinclair ZX81 Telephone orders call
[1 MicroAce computer.
19
617-456-3661
Syn oe oem
SYNTAX
CLASSIFIED ADS
With SYNTAX classifieds, you can reach thousands of ZX80, ZX81 and MicroAce users to sell, swap or inform. Just $2.75 per line, 4- line min. Send your ad, typed 35 characters per line, with check or Credit card. no. by A5 th. of any month for following month's issue to SYNTAX, RD 2 Box 457, Harvard, MA 01451. No phone orders, please.
NEW 57 KEY KEYBOARD: prewired for ZX80,81,Microace, $30.00 kit $20.00 COMING SOON 16K RAM $65.00 48K RAM $160.00 kits $20.00 less. Need comp onents, have TTIL's volt regs. res, and more. Z80A PIO chip $6.50 ZX80, 81. Software available, send for free catalog; send check or money order to: A.P. Electronics 5945 Kenneth Ave. Carm. Ca. 95608
From the SYNTAX bookshelf: Crash Course in Microcomputers (for beginners), $17.50 plus $1.50 ship- ping. Zilog Z80-Z80A CPU Technical Manual, $7.50, Z80-Assembly Langu- age Programming Manual, $15 (add 5% shipping for Zilog books). 4K ROM Listing with Sinclair's original designer's comments, $40 incl ship- ping. Phipp's ZX80 Pocket Book, $14,95+51.50 first class postage.
20
THE HARVARD GROUP
Bolton Road, Harvard, Mass. 01451
Back issues available, $4 each. article reprints, $l each (see index 12/81). Send check or credit card number to SYNTAX, RD 2 Box 457, Harvard, MA, 01451.
8 4K/1K GAMES ON 1 CASSETTE--$10.00 MASTERMIND- Over 20 levels of play
DOUBLEMIND- Code: 4 pairs of digits SLOT MACHINE- Play $1 to $5
CRAPS- Bet $2 to $20. 7 or 11 wins
TICTACTOE-Can you beat the Computer SUB RESCUE- Pilot to sub's location WHITE HOT NUMBER- 1.Use clues Cold, Warm, Hot, Red Hot, & Ouch. 2. Play against Computer. NEW ENGLAND SOFT- WARE, Box 691, Hyannis, MA 02601.
NEW FASCINATING BLOCK PATTERN gen- erator.Uses hypercube theory. 65535 marvelous designs. 8K ROM/16K RAM. LIST $3.95, TAPE $9.95. !!ACT NOW!! EZRA GROUP II, 4588 CHEROKEE, SUITE THREE, San Diego, California, 92116
FOR SALE: ZX80 (4K ROM 1K RAM) Complete with Learning Lab, back issues of Syne & SYNTAX. $175. Call LOLI 201-967-9112 aft 6 PM.
#6116 2K x 8 150 NS Static RAM Chip Available for delivery @ $19.00 plus $1.00 for shipping. Send check or MO to: Support Systems One, PO Box 1794, Phila., PA 19105
First Class