SYNTAX ZX8&

A PUBLICATION OF THE HARVARD GROUP

VOL.3 NO.2

IN THIS ISSUE

Programs --4K

Nuclear Decay........ 13 Phone Number Word Generator....... 4 Programs--8K PWT 12 cae eles, Ble fd aubes 17 Métoxy -PEEK. joie dyes 16 Moving Billboard...... 8 Phone Number Word Generator....... 4

Salary Scheduling....14

Solving Simultaneous

HOUACTONS "+ 34.054 x. ee aS 9 Beginners

Translating BASICs....3 Book Review

ZX81 ROM Disassembly

Pare Aico ibaa ie did 15 Classified Ads......... 19 Dear Editor............ 10

Hardware Projects

ZX81 RAM Decoding....12 Hardware Review

MX16 RAM Pack......... Z Machine language

Binary Addition and

SUDtTTACtIONawy se meae dt 5 Flags: Of OK ROM ss.0%s0s-< 6 New products, news....1,2 Program corrections..... 2

Tips and Hints Dim as Sum-to-Memory..8 TL$ Translation to 8K.9 Users' Groups.......... i

INDEX OF ADVERTISERS

Kopak Creations Inc..... 5 LJH Enterprises........ 13 MindwWaree «4s Soa68 eadhak 18 PM EMTerprises. 6 ous ds-aas 2 SOLtsyne so ING 6 2345-6 aGe 3 Zeta Software........... 8

ISSN 0273-2696

SINCLAIR DISCONTINUES TECH INFO

FEB., 1982

LINE

Nigel Searle of Sinclair just announced that Sinclair would no longer staff their

technical information line in Boston.

details, see his letter, p.10.

EDGE CONNECTORS AVAILABLE

For

Kopak Creations of New York now offers

46-pin edge connectors for ZX80

81s. Robert

Schiller of Kopak says PVC connectors are

available now for $15.

You'll pet solder tail

and wire wrap connectors for about the same

price soon. New York, NY, 10019, 212/757-869

Kopak Creations, 448 W. 55th St,

8:

NONAUTHORIZED ZX81 SALES AND SERVICE

National Electronics III of Concord, TN, has become a nonauthorized reseller of new

assembled ZX81 systems. Cost:

$4.95 shipping and handling. According to Jeffrey Thomps

National, they also perform out>-

$149.95 plus

on, owner of of-warranty

repairs on ZX8ls, charging actual labor time

($10/hour, $10 minimum) plus parts. most repairs take 1 hour or less. turn-around time is about 48 hours.

service, send your computer to a description of the problem.

write or call you collect with Contact National Electronics II Kingston Pike, Concord, TN, 3792 690-8927, 10-6 M-F, 10-4 Sat.

SYNTAX BINDERS

Now you don't have to wait

He says Their

For ational with hey will n estimate. , 10425 2, 615/

to renew to

get a SYNTAX binder to protect your issues.

You can get the magazine binders

we send to

early renewals for $9.00, including shipping.

These sturdy binders hold 14 iss wires--no punching necessary. Box 457, Harvard, MA 01451.

ues with

SYNTAX, RD 2

MX16-16K RAM FOR USE WITH THE SINCLAIR ZX80® AND zx81®

RAM MODULE

$89.95 PLUS

$3.00 SHIPPING AND HANDLING

90 DAYS WARRANTY PARTS AND LABOR

PM ENTERPRISES

407 E. LINCOLNWAY LAPORTE, INDIANA 46350

(219) 326-7923 CHECK/M.O./M.C./VISA/C.0O.D.

6K RAM ADDITION

Frustrated by the limitations of 2K RAM, Jim Graham of Oakhan, MA, put 6K "under the hood" of his ZX81. He finds it a comfortable compromise, freeing up the edge connector for I/O use. The wire- wrapped module consists of four sockets welded together, needs no board modifications and plugs into the existing RAM socket. For plans, send $2.00 and SASE. Jim Graham, East Hill, Oakham, MA 01068.

SURPLUS KEYBOARDS PLUS DIRECTIONS

The $20 surplus keyboards from John J. Meshna Jr., Inc., mentioned in the Dec.81 issue, now come with wiring instructions for ZxX80s. If you got one without instructions, call Doug Meshna for a free copy. Stock no. SPL-19, John J. Meshna Jr: Ine; PO Box 62, ‘Eo. Lynn; MA, 01904, 617/595-2275.

SYNTAX ERRORS; Peter Ulrich, New York, sent these corrections for Paul Ezra's Brownian Motion program (Dec.81). He explains that Paul's program runs, but gives: curved lines because the manual's sub- routine uses N for 2 different

variables. Change the subroutine: 1150 FOR L=0 TO M 1250 NEXT L This allows these program changes: 4O LET D=INT (RND*42)+1 50 LET A=C 60 LET B=D

David Ornstein corrected his New 8K ROM Routine Addresses list (Jan. 82) issue: LIST at 072C should be LLIST (LIST is at 0730); DCDKB is at O7BD, not O7BC; and RAND is at OE6C, not OE69.

In 4K/1K Blackjack (Jan.82 p.16), line 670 should read PRINT P(Z),CHR$(9) to mask the card.

Jon Passler sent some improvements for his 8K Bar Chart program (Jan. 82) to speed up program execution: 70 IF B(A)=0 THEN STOP

80 FOR P=1 TO B(A)/100+.5

90 PLOT A*2+3,P

100 NEXT P

110 NEXT A

Final Monzxer changes (Nov.81): Add 310 PLOT 23,32. Line 2120 should read 2120 LET A(1)=YR

DISCOUNT ICS

Steve Streebing offers SYNTAX readers factory prime RAM ICs at low rates: HIT 6116-3 16K (2Kx8) CMOS RAM (150nS) for $14.50, 2114L-2 4K (1Kx4) static RAM (200nS) for $3.25 each or 16 for $48.00 (US funds, add $1.25 for shipping). Al Salt used 2114s in his Build Additional RAM (Mar. 81) and others use 6116s as plug-in replacements for the 1K RAM on- board (4118) in ZX81ls with 28-pin sockets. Write Steve at Box 182, Washington, MI, 48094.

TRANSLATING BASICS--WHAT WON'T WORK

With all the software avail- able for other computers, many ZX80 owners want to convert programs from Microsoft BASIC (used in PETs, Apples, and TRS-80s) to ZX80 BASIC. Sometimes this proves futile due to inconsistencies between Microsoft and ZX80 BASIC.

To know 1f your attempts to convert to ZX80 BASIC might work, here are some Microsoft BASIC keywords that cannot be practically translated.

Keyword Description

INT (x) computes the integer value of x; 4K BASIC does this automatically

HCOLOR=x used by Apple to set

a high resolution graphics color

HPLOT

SET all used to light up a

RESET graphics block (pixel)

DRAW or a set of pixels

XDRAW

PLOT

SYS x executes an assembly language subroutine with starting address x. 4K USR(x) does the same job, but since SYS works on computers with a 6502 processor, memory locations will be incompatible

*GETxS used to receive 1 char. from keyboard and store it: as x

ON ERR sends computer to line

GO TO x x if an error occurs

OPEN .

CLOSE all are used for 1/0

CMD x control; since the 4K

PR#x machine does not create

IN#X files, it has no func-

GET #x tions like these

INPUT #x

PRINT #x

*can be converted, but requires too much memory to be practical.

Richard Forsen, New Hartford, NY

ADVENTURE “At

Your space ship is iiyoumek ona strange planet

but you can get out if youm tion of decisions. Written this challenging adventure

vocabulary. 16K

ADVENTURE “B”

Enter the long lost Inca Te

ke the right combina- n machine language, has over 100 words of

$19.95

mople, find your way

through the tricky tunnels tnd corridors and you

may find the lost treasure’ forever.

Or you may be lost

6K $19.95

ALSO Pee SUPER INVASION WALLBUSTERS ROAD TO RICHES

CYBORG WARS ZXCHESS

MACHINE LANGUAGE PROGRAMMING...

TEN EXCITING PROGRAMS FOR THE 2X81: 1K

REVERSI SPACE TREK

UNDERSTANDING YOUR 2X81 ROM

DIRECTORY/RECORD

2 i ee a 6 ee ee WRITE FOR FREE CATALOG

] Pleasesendme__| “A” @ $19.95 each.

Vy Please sendme___| “B” @ $19.95 each| i | Please send mea free software catalog lenclose

copies of ADVENTURE |_ copies of ADVENTURE

SEND CHECK OR MONEY ORDER TO:

SOFTSYNG INC.

PO. Box 480, Murray Hill Station, New York, NY. 10156 (212) 685-2080

Foreign orders must be paid by

nternational Money Order or

foreign draft in U.S. Dollars drawn on a New York bank.

NAME

ADDRESS

CITY

STATE/ZIP

Please add $1.50 shipping & handling

New York residents

add sales tax.

PHONE NUMBER WORD GENERATOR- -4K- 8K

What does your phone number spell out if changed to letters? A friend's phone number, 438-5678, spells GET LOST. A bank's auto loan department answers NEXT CAR.

To encode your number into a readable word, you could just gaze at your telephone dial. But every digit has three letters. A seven digit phone number has 2,187 dif- ferent possibilities! Now a ZX80/1 (4K/1K, 8K/2K) can do it for you.

The program initializes two counters, P and Q (lines 5&7). P counts combinations printed 40 at a time. Q keeps a running total till the ZX80 prints 2187 combinations. You enter the digits via lines. 10- 22. The 2187 words are produced by 2187 iterations through the seven nested FOR loops (lines 24-110). The subroutine at 500-506 prints each letter by converting the digit into a printable ASCII value. It converts 2, for example, into ASCII values 38, 39, and 40, which print A, B, and C. The subroutine at 300-306 signals the ZxX80 to print the next 40 combinations. Lines 200-202 end the program.

RUN, then enter your phone number (hit NL after each digit). About 15 seconds later the first 40 combinations appear. Press NL to see successive groups. The last one ends with "FINE." Don't input the digits 1 and 0--they have no letters on the phone dial. The program suppresses Q and Z since they do not appear on the dial.

This program was inspired by Harvey M. Deitel's Introduction to Computer Programming (Prentice- Hall), a fine book for learning BASIC.

Lawrence Souder, Philadelphia, PA

5 LET P=0 7 LET Q=0 10 INPUT A 12 INPUT B 14 INPUT C

4

506

INPUT D INPUT E INPUT F

bet Zz ine) qa FH Q

FOR

Za

e)

vs) Z2eaHaacaxKN it t i t td te ue a

HPrPoOooCCCOCCoo tH oO

LET N=U GO SUB 500 LET M=C LET N=V GO SUB 500 LET M=D LET N=W GO SUB 500 LET M=E LET N=X

GO SUB 500 LET M=F LET N=Y

GO SUB 500 LET M=G LET N=Z

GO SUB 500 PRINT " "; LET P=P+1 LET Q=Q+1

NNN NM NN bd

IF P>39 THEN GO SUB 300 IF Q=2187 THEN GO TO 200

NEXT T NEXT NEXT NEXT NEXT NEXT NEXT PRINT STOP INPUT R$ LET P=0 CLS RETURN

xKXM SSG

LET J=2*M+32+M+N

"FINE"

IF J>53 THEN LET J=J+1

PRINT CHR$(J);

RETURN

Syntactic Sum:-29058, 4K;

44104,

8K

BINARY ADDITION AND SUBTRACTION

(This is the second part of this intro to machine code programming series. See also last month's column and Computer Number Systems, Feb.81 p.10, for more on binary numbers .--AZ)

The point to learning how to add and subtract binary numbers is to see how "carries" are generated and what happens to those extra digits.

In binary, answers to arith- metic operations are the same as in decimal; they just look different. For example, in decimal, 1+1=2. In binary, 1+1=10 (or 2 in decimal). The first digit, 1, is the carry. Addition is straightforward; just remember that 0+0=0, 1+0=1, 14+1=10 (or O and carry), 1+l+carry=1 and carry:

10001101 = 141 00110101 = 53 +00110010 = 50 +01011011 = 91 LOLI EL. = 191 10010000 = 144

The largest number you can represent in binary with 8 bits is 255. To get an answer greater than 255, the Z80 (the central proces- sor, or CPU, in your ZX80/81) has a 9th bit available to the Accumula- tor (where all bit manipulation takes place): the Carry bit in the Flags register. Disregarding just how the carry is transferred to the high order byte, this is generally how large numbers are saved in 2 bytes or addresses:

HIGH ORDER (2nd) LOW ORDER (lst) 00000000 10010111 = 151

+00000001 <- Carry < +10101000 = 168 00000001 = 256 00111111 = 6

296463 = 319

The low order byte is the first of

the two addresses; the high order

byte is the second. See last

month's column for details. Subtraction is a little

trickier. Let's subtract 45 from

KOPAK GIVES YOU THE POWER!

KOPAK’STM Touch-A-Matic gives you the power to type more accurately and much faster. No wires, no soldering,

KOPAK™M is os offering The Source* ‘America’s Information Utility’. The Source* gives you the power to access a wide array of services including: Barter ¢ Shopping © Business Infor- mation ¢ Career Network e Electronic Mail e Medical Advice e UPI News $9.95 Service and much more. A modem is required to use The Source*. Source ID $100.

simple to install. Our unique vinyl over- lay guides your fingers to the correct keys. Touch typing now possible with your Sinclair* or MicroAce*!

The KOPAKTM Sinclair* female Con- nector gives you the power to use the Z-80 bus. Edgecard connectors specif- ically made for Sinclair* computers. © 46 Pins, 23/23 e All pins are gold plated polarizing pin for correct alignment everytime! Available with Solder-Tail, Wire-Rap and PCBoard. $14.95

More POWER|on the way! KOPAK’STM

Coming Creations:

The KOPAKTM RS-232 Interface

The KOPAKTM Bus

The KOPAMATICTM Keyboard

The KOPAKT™N Printer Kop Memory Products

The KOPAKT™N Disc

‘KOPAK has the POWER to deliver!

KOPAK Creations Inc. Dept. SX

448 West 55th Street New York, NY 10019 (212) 757-8698

TM Trademark jof KOPAK Creations Inc.

Sinclair* is a trademark of Sinclair* Research LTD.

MicroAce* is ajtrademark of MicroAce*

© 1982 rene Inc.

152: First, the Z80 "inverts" 45, or changes all the zeros to ones and ones to zeros (00101101--. 11010010). It then addg 1, giving 11010011, which is 211 in decimal. This is the two's complement of 45. This conversion to two's complement explains why if you POKE -45, then PEEK that location, you /get 211. Next, the Z80 adds 211 to 152:

10011000 = 152 FLIOL001L = -45 or 211 01101011 = 107 (ignore the carry)

The correct answer is 107. Depending on the results of addition and "subtraction" (conversion to two's complement followed by addition), certain flags in the Accumulator-Flags "register-pair" will be changed. NEXT MONTH: THE FLAGS REGISTER Jon Bobst, Zeta Software, P.O. Box 3522, Greenville, SC, 29608-3522

THE FLAGS OF THE 8K ROM PROGRAM

The ZX81 manual states that the three system variables FLAGS, FLAGX and CDFLAG hold various flags to control the BASIC system. But a study of the 8K ROM program dis- closes 12 separate flags.

FLAGS

Bit 0: This flag is. reset whenever a space is to be printed before a token, and set if there is not to be a space. The reading of this flag takes place in the 'EXPAND TOKENS' subroutine at 094B. To see the action of the flag,.enter:

10 REM 123456789 and POKE in the values 253, 203, 1, 134 or 198, 62, 255 or any other TOKEN code, 195, 75, 9. Execute the line by using RAND USR 16514.

Bit 1: This. is the control flag for the printer. The flag is set for printing to the printer and reset for printing to the TV screen. The action of this flag is illustrated by altering the fourth byte of the Bit-0 program to 142 or 206. When 142 is used, the TOKEN prints on the TV display; when 206 is used the TOKEN passes to the printer and is not displayed.

Bit 2: This flag distinguishes between K and L modes. In 'CHOOS- ING K v L MODE' at 0537 the flag is reset for K and set for L mode.

Bit 6: This important flag distin- guishes between the last value on the calculator stack being 'string' (therefore represented by para- meters for its length and start) and 'numeric' (the value is held as a five byte floating-point number). The flag is reset for 'strings' and set for 'numbers.'

Bit 7: This is the syntax flag. Whenever a BASIC line is to have its syntax checked, the LINE- SCANNING subroutine is entered (at OCBA) and this flag is reset to indicate the need to check syntax. However, when a BASIC line is executed the routine is entered

fe)

with bit 7 set. This is done at 0667 for each line.

FLAGX

Bit 0: This flag is used when the current value or string assigned to a given variable name has to be found in the variable area. The flag is reset when the search is for an array variable and set for simple variables.

Bit 1: This flag indicates if a current value or string was found or otherwise. It is reset if an "old' value exists and becomes set if the variable name has not been used so far in the program.

Bit 5: This flag distinguishes between EDIT mode and INPUT mode. The 8K ROM program uses the same code to accept both types of input from the keyboard. The flag is reset for editing and becomes set when an INPUT command is being executed. The actual setting of the flag is done at OEF2, or OEF5 in the 'improved' ROM. (Some parts of the 'old' and 'new' 8K ROMs differ by 3 bytes--see David Ornstein's article, New 8K ROM Potpourri, Nov.81--AZ)

Bit 6: This flag distinguishes between numeric and string INPUTs. In the INPUT command routine this flag is made to be the same state as bit 6 of FLAGS and so is reset for a string and set for a number.

CDFLAG

This byte holds three flags and is perhaps the most interesting of the three flag system variables. The three flags all concern the ZX81's FAST/SLOW operation.

Bit 0: This flag remains reset until a frame of the display is stopped by pressing a key on the keyboard. The flag records this event by becoming set. In FAST mode this isn't very important, but in SLOW mode it results in the exiting from the 'SLOW display loop.' This loop occurs in the 8K

program at O4CF and comprises the two lines: O4CF SLOW-DISP BIT 0, (HL) ;HL

;points to CDFLAG

JR Z,04CF,SLOW-DISP

This is a closed loop unless you realize that in SLOW mode the computer produces a 'frame' every 1/50th of a second. You can ter- minate a frame by pressing a key, and return from the interruption witn s51t-U of CDFLAG set. Bit 6: This is the true FAST/SLOW flag.

executing the SLOW command (0F28- OF2B). Resetting this bit is all that is required to change to FAST mode; however, the transition to SLOW mode is complicated by the need to also change bit 7.

Product: MX16-16K RAM

From: PM Enterprises, 407 E. Lincolnway, Laporte, IN, 46530, 219/326-7923

Price: $89.95 + $3 shipping Note: Insight's RAM pack is now sold by PM Enterprises. It is the same unit.--AZ

At first glance you might ask, "Is that all there is to it?" I opened the shipping box to find a small black plastic case that obviously plugs into the rear of a ZX80/81 or MicroAce computer. The instructions were easy to under- stand and to the point. A simple program listing was also included. It tests the amount of RAM memory contained in the system to check for correct operation of the MX16.

The MX16 requires a different power supply to power the dynamic RAM chips inside. This 12-volt

supply is included with the MX16 to

replace the power supply that came with your computer. It plugs in the same way as your original supply. Your computer may run a little hotter than normal due to the increased voltage at the

It is reset by executing the FAST command (0F23-0F26) and set by

USER REPORT--INSIGHT'S 16K RAM PACK

Bite: of bit 6. only be performed in (like LOADing, SAVEin in PAUSE). When thes be performed then bit act as a temporary ma need for FAST mode.

reads bit 7 as signal mode it should be in

This bit is usually a copy But certain tasks can

the FAST mode g, and staying e tasks are to 7 is reset to rker for the The computer ling which and not the

true FAST/SLOW flag that only indi- eates the overall mode at the time.

Ian Logan, Skellingt

Note:

horpe, England

Further details are avail-

able in Ian's books, Understanding Your ZX81 ROM (for brief details) and The ZX81 Monitor Listing Part

A, 0000-OF54 and Part (for extensive detail

regulator. This shou problem. Insight did not have

supplies in stock.

B, OF55-1DFE s).--AZ

ld not be a

When I bought my MX16,

any power

They offered to

sell me an MX16 without the power

supply at $10 off the of $89.95. Also,

regular price

Insight included

a schematic for building a simple

regulated power supply.

your own may not be n

Building ecessary--my

standard ZX80 supply worked fine.

The only problem

I encountered

seemed to originate in the edge

connector. Moving or

bumping the

computer even slightly caused a system crash. Cleaning the con-

tacts on the computer and eraser and then a electronic contact cl up the problem.

I got my MX16 wi of ordering. This sh anyone waiting for Si their 16K RAM. Insig support was very good phone call brought fa PM Enterprises' servi be seen.

PC board with high quality eaner cleared

thin 14 days ould appeal to clair to ship t's technical --a letter or St results.

ce remains to

The MX16 comes with a 90-

day repair or replacement warranty. I consider the MK16 to be an

excellent value.

Lance M. War

d, Lansing, MI

NEW ZX81 1K PROGRAMS by ZETA Software on cassette tape with listings

ZETAPAK #1: WAR GAMES Bomb Run, Sub Hunter, Barrage, Fighter Pilot*, Torpedo Alley*, & Dragon's Teeth*(tank battle) ZETAPAK #2:BASICALLY BASIC RANDom POKEr, Loop de loop, IF I May, InVariablely DisARRAYed, Return Address, & PseudoPause ZETAPAK #3: SCIFI FANTASY Planetfall*, Hyperspace Display, Wormhole*, Arcade Invaders, Star Catcher*, & Turret Laser

[$9.95 each pak or all 3 for $24.95) TO ORDER...Sena payment plus $2.50

S&H to: ZETA SOFTWARE/PO Box 3522 Greenville, SC 29608-3522

Or write for catalog of 50+ titles.

In Europe, send inquiries only and U$1 bill or DM2 stamp to: DELTASOFT ZP2, Osterfeldstr.79d,D-2000 Hamburg 54,GER

oer aetna

MOVING BILLBOARD- -8K/1K

This program continuously scrolls up to 23 (and more) lines of characters. Do not print more than 32 characters in any PRINT instruction, such as line 150, or the scrolling will fail.

These billboard lines are double-spaced. To increase the spacing, increase the difference between adjacent A(1) values the lines 70-74. If you use many PRINT lines, you must insert a CLS strategy. The use of DIM A(1) as a sum-to-memory strategy is discussed this page. Line 99 causes the billboard to repeat endlessly.

Paul Ezra, San Diego, CA

10 SCROLL

20 DIM A(1)

30 PRINT "MAJOR" 40 LET A(1)=A(1)+1 50 SCROLL

60 PAUSE (80)

page,

110 140 170

THEN THEN THEN THEN THEN THEN

GOTO GOTO GOTO GOTO 200 GOTO 230 GOTO 10

ee

No PWN

PRINT "BIRTHS:" GOTO 40

SCROLL

PRINT "EARTH" GOTO 40

SCROLL

PRINT "LIFE" GOTO 40

SCROLL

PRINT "MAN" GOTO 40

SCROLL

PRINT "CHRIST" GOTO 40 Syntactic Sum: 28015, 8K

DIM AS CALCULATOR SUM-TO-MEMORY

DIM arrays can function as a sum-to-memory system found in many calculators. More importantly, it acts as a counter function and can be used where FOR-NEXT loops will not work. Moving Billboard, this illustrates the counter func- tion. Here's a simple demonstra- tion of the sum-to-memory system:

10 DIM B(1)

20 INPUT A

30 PRINT A

40 LET B(1)=B(1)+A

50 IF A=5 THEN PRINT B(1) 60 GOTO 20

Input a few numbers, hitting ENTER after each. Finish with 5 to execute line 50. B(1)'s value will appear and turns out to be the sum of the input numbers. To regain program listing, input any letter (not a number) and hit ENTER twice.

Change line 60 to 60 GOTO 10 and see that the sum-to-memory function is lost. Each time the computer executes a DIM line, all array values are cleared to zero.

Paul Ezra, San Diego, CA

SOLVING SIMULTANEOUS EQUATIONS

This 8K/1K program uses Crout's reduction to solve simultaneous equations. The number of variables you can use is limited only by your available memory; in 1K this program solves up to 4 equations in ' variables

When you type in the program, ise the INPUT keyword for the input prompts in lines 2 and 25. For example, type 2 INPUT then back- space and hit PRINT. You'll get a space between " and INPUT, but it saves bytes. RUN the program, ther enter the number of equations to solve in response to INPUT N

Enter the coefficients of the variables in matrix form. Say you're solving two equations in two variables: 4a+2b=17 and 2at+7b=10. In matrix form, your variables look like this:

a b result equ. 1 4 2 17 equ.2 2 7 10 This is equivalent to this matrix: a b result equ.) KCl, 1) -KCL,2) KCL 3) equ.2 K(2,1) K(2,2) K(2,3)

The first prompt asks for K(1,1), so enter 4. K(1,2) would be 2, K(1,3) would be 17. Then K(2,1) is 2, and so on.

The computer returns the answer in the form U(1)=(solution to first variable) and U(2)=(solu- tion to second variable).

To find .a polynomial of order N-1 to fit N points, add and change these lines:

12 PRINT '" INPUT X";I

14 INPUT X

16 PRINT ' INPUT Y"';I

18 INPUT K(I,N+1)

19: CES delete lines 25, 35 change lines:

20 FOR J=l1 TON 30 LET K(1,J)=X**(J-1)

Enter the X and Y coordinates individually. N now equals the number of pairs of points. The computer returns the coefficients

of the polynomial i (1) +0 (2) x4U(3)X 4U(4)X3 ete. or Y=U(Z)x(Z-1) ,

Y=U

H, 1) 100 110 120

this form:

Lori Olson, Quincy, MA

PRINT '" INPUT N"'

INPUT N CLS

DIM K(N,N+1) FOR I=1 TO N FOR J=1 TO N+1

PRINE ScINPUD (KCV ets ese")

INPUT K(I,J)

NEXT I

FOR I=1 TO N FOR J=I TO N FOR H=I TO I-1

LET K(J,1)=K(J,1)-K(J,H) *K(

NEXT H NEXT H

FOR J=I+1 TO N+L

|

130 FOR H=1 TO I-1

140 LET K(I,J)=K(1I,J)-K(1,H) *K( H,J)

150 NEXT H

160 LET K(I,J)=K(1,J)/K(1,1)

170 NEXT. J

180 NEXT I

190 FOR I=N TO 1 STEP -1

200 FOR H=I+1 TO N

210 LET K(1I,N+1)=K(I,N+1)-K(1,H ) *K(H,N+1)

220 NEXT H

230 NEXT I

240 FOR I=1 TO N-

250 PRINT "U(";1I;")=";K(1,N+1)

260 NEXT I

Syntactic Sum: 30176, 8K TL$ TRANSLATIONS FOR 8K ROM

Substitute the lines

on the right

for lines on the left when trans- lating 4K ZX80 programs to 8K:

is

eas a3

4K

PRINT TLS(STRS (M+A) ) ;

CODE (TLS$(FS))

CODE (TLS (TLS ( F$))

8K

PRINT STRS (M+ A)) (2 TO);

CODE F$(2 TO)

CODE F$(3 TO)

DEAR EDITOR:

Many Sinclair personal compu- ter owners will have noticed that Sinclair Research has changed its policy with regard to dealing with technical questions by phone. We have tried, and for a long time succeeded, in dealing with techni- cal questions over the phone. How- ever, a number of factors have made it impossible to continue providing this service.

First, we are selling more computers than ever before and it is simply not possible to recruit and train a sufficient number of qualified personnel to deal with technical inquiries.

Second, an increasing propor- tion of the computers that we sell are in kit form and the owners of these tend to have complex ques- tions and more of them.

Third, most inquiries are not concerned with the operation of the computer, but rather with applica- tions, modifications, etc.

Fourth, we try to make our products available at the lowest reasonable cost to the consumer and that simply does not allow us to engage in lengthy telephone conver- sations concerning, for example, possible applications of our products.

I would like to take this opportunity to make clear that our repair policies remain unchanged. If you have any problems with your computer within 90 days of pur- chase, it can be returned to us and will be repaired or replaced free of charge.

We will also try to answer any technical questions addressed to us in writing at 4 Sinclair Plaza, Nashua, NH, 03061. This service is exclusively for people who already own a Sinclair computer.

Nigel H. Searle, Sinclair Research, Boston, MA

SYNTAX will also answer technical

questions by phone whenever we can. Call 617/456-3661 at a reasonable hour, Eastern Standard Time.--AZ

Having no knowledge WHATSOEVER of computers, I am considering the Sinclair ZX81 with 16K RAM. What I need is a simple Inventory Control system. Can you lead me to someone who has one?

Jerome Salny, Fairlawn, NJ

If anyone knows a source for such a program, please let me know.--AZ

I recently bought a ZX81 and am very interested in interfacing and control applications. Is any- one out there interested in imple- menting that exciting language, FORTH, on the ZX81?

Cesar A. Sepulveda, Pasadena, CA

Is there a way to hook up a big keyboard on the ZX81? Also why are there only 5 Sinclair software programs? 1 thought there would be a lot more.

Mark Biron, Manchester, NH

You can buy commercial keyboards to hook up. If you want to do it yourself, SYNTAX (Dec.80) published a plan to attach big keyboards to ZX80s. On a ZX80 you wire the key- switches to diodes on the front of the PC board. A ZX81's keyboard is connected by ribbon cable to 2 readers, or connectors, (one 5-pin and one 8-pin). Where we showed eonnections to IC pins in our plan, just connect wires to a 5-pin connector. Where we showed diode connections, connect. to an 8-pin connector. Then plug the new connectors onto the pins on the bottom of the ZX81 board.

According to Sinclair's office in Boston, Sinclair plans no more software. As to why so little, I suppose Sinclair chose to concen- trate on hardware development.--AZ

10

I just received my ZX81 kit on Christmas eve and eagerly assembled it. While the instructions were well written, they deviate from the actual circuit board in 2 jmportant areas. First, resistors R27 and R29 are mounted vertically near the modulator as marked on the PWB, not horizontally near the regulator as shown in the instructions Fig. 6. Second, the 2 small coils provided are not mentioned in the instruc- tions or shown on the schematic. They connected the 9V de input to the regulator when mounted at Il and I2 on the PWB and the unit works fine--I only assume that was as intended!

Kit builders: Read the letter that accompanies the kit. It tells how to add four components that convert from UHF to VHF TV hookups.

Jay Walters, Shreveport, LA

Several ZX81 kit builders have found and resolved problems with their kits. If you're having troubles, call SYNTAX and we'll pass along their discoveries.--AZ

I recently bought a ZX81. As a novice, I am not pleased with the ZX81 BASIC Programming Manual. Is it possible to do regression (linear and multilinear) computa- tions on this computer using a 16K memory module?

George A. Luhrs, Chula Vista, CA In the Nov.81 issue Herb

Sturges noted methods for improving ZX80 cooling. Mr. Sturges is in error about the improvement in heat transfer by painting the heat sink. I don't know how he derived the 20 times improvement over polished aluminum, but it is not true. Painting the heat sink can actually degrade the dissipation capability. A body's thermal blackness has ABSOLUTELY NO RELATION to its color in the visible spectrum. Of the three major means of heat transfer

11

(radiation, conduction and convec- tion), the blackness, or emissiv- ity, affects only radiation. In most electronic pc ueuenitg other than spacecraft, conduction and convection are by far the dominant mechanisms. - Some years ago a company where I worked performed carefully con- trolled experiments confirming that there was usually no |measurable difference in total dissipation between bare, clear anodized, black anodized, and eainted aluminum.

The message: forget about the paint, cut the hole to improve con- vection, and ALWAYS use heat sink compound to improve conduction be- tween the semiconductor and the heat sink. Unless you're going to orbit your ZX80, don't worry. about radiative transfer. If you must have a black heat sink, paint it sparingly (so paint won't act as an insulator), masking off the area where the regulator mounts, and use lacquer, which has a|slightly higher conductivity than enamel.

Gary J. Vincent, |Richardson, TX

USERS' GROUPS

SEATTLE, WA, AREA: Gontact Jeff Pack, 21026 109th SE #708, Kent, WA, 98031, 206/854-6232.

MICHIGAN: Lance Ward wants to organize a group with a monthly newsletter (dues to cover material and postage). Free ads to members and companies discounting products to members. Contact Lance at 433-D E. Edgewood Blvd., Lansing, MI, 48910, 517/393-1357.

CHICAGO, IL, AREA: .P. Weigel is coordinator of the ciicage Area Computer Hobbyist Exchange Z80/Sin- clair Special Interest Group. Yearly S10 dues include the CACHE newletter. For info, send a SASE c/o Box C-176, 323 S. Franklin #804, Chicago, IL, 60606, or call 312/561-6772.

RAM DECODING FOR Zx81

Last March we published Al Salt's plans for adding external RAM to ZX80s. To adapt his Build Additional RAM (SYNTAX 02/03/02) with ZX8ls, you. can take ne of three approaches. The: second two of these plans do not require you to modify the insides of your ZxX81l

You can use all external RAM, by removing the internal RAM and connecting pins 2 and 14 of the 74155 to pin 2T (for top) of the ZX81 edge connector. This method uses pin 2T as an output from the computer to the decoder. Connect CS1 to the first set of external RAM chips.

Or, wire a 74LS138 decoder wired as shown in the following circuit to select the internal set or one of seven external sets of RAM chips. Use pin 2T as an input to the computer from the external

AlO All Al2 Al4

SELECT EXTERNAL

SELECT INTERNAL CHIPS

decoder in this case. (Sinclair used this scheme in their 3K RAM module sold in Europe. Henry April of the Boston Computer Society | independently proposed a similar ~ plan at a recent Society meeting. )

Finally, you can add a 74LS- series inverter (74LS04, for example) in series with Al14 and connect the inverted output to pin 2 of the 74155 decoder. (See additional schematic following. ) Then connect MREQ to pin 14 of the 74155. Connect the RAM CS1 form pin 9 of the decoder to pin 2T of the ZX81. This scheme uses pin 2T as an input to the computer from the external decoder. (This plan comes from John Jarrett's article for SYNTAX on RAM expansion, now being tested.)

Each of the latter schemes is logically correct and used in one or more memory expanders, but we did NOT bench test them.

All 1/6 74LS04 OR EQUIV

Al0 A12 MREQ a Al4 13}3} 15} 1) 14 2 |

16 74LS155 8

$5V OR OV 74155

9

CcS1

2T ON ZX81(RAM CS)

LOADING PROBLEMS WITH ZX81 KITS

If you have loading problems with a kit ZX8l, see if you cracked C10 during assembly. Some machines LOAD fine with 1 (or 2)K internal memory, but not with 16K. If you hear ''shortwave radio noises" (high pitched sounds) with 16K attached, try this. Move Cll and R27 to be physically attached at the MIC connector of your ZX81. This also works on assembled ZX8l1s, if you have the skill to do it, but voids your warranty.

12

NUCLEAR DECAY SIMULATION--4K/1K

A popular lab exercise uses special dice to simulate radio- active decay. Marked die faces show the decay probability. After shaking and throwing the dice, re- place those with marked sides show- ing with spheres (stable atoms) or dice with different decay probabil- ity (radioactive daughters). Use over 200 atoms for a smooth graph.

This program throws, examines and exchanges dice. You get data to plot a decay chain from radio- active parent to stable population.

The prompt asks for the number of generations. Enter 2 to decay to a stable isotope, or 3 to 5 for a decay chain. Next, enter the relative half-life of each genera- tion, corresponding to the total number of faces on the die. For example, 8 denotes a 1 in 8 chance of decay for each atom in that generation during each pass. Then, enter the initial number of atoms. The program stops when the popula- tion consists entirely of stable atoms. Graphs derived from this program agree well with experiment.

S. Sanderson, Carpentersville, IL

10 DIM H(5)

20 DIM A(5)

30 PRINT "NUCLEAR DECAY SIMULA TION" 40 PRINT 50 PRINT 60 PRINT (>1)" 70 INPUT PRINT PRINT "RELATIVE 1/2 LIFE (F ON DIE)" FOR I=1 TO G1 PRINT "GEN. (";1;") = "; INPUT H(I) PRINT H(I) NEXT I LET A(G)=0 LET K=0 PRINT "INITIAL NO. OF ATOMS

"HOW MANY GENERATIONS

J

G

13

NOW AVAILABLE

yboard . CONVEFSIONS

e Standard Computer Keyboard

ke

¢ Type programs in half the time

¢ Minimize errors

e Wired keyboard hooks up in minutes

Plans for keyboard conversion with reverse video NOW $5:00

Keyboard with complete parts and plans NOW $55.00 Wired keyboard, complete with plans NOW $75.00 Add $5.00 mailing charge for continental U.S.

Other locations write = details,

Mail for terpris

L.J.H. Enterprises P.O. Box 6273, Orange, CA 92667 or call 714/547-8717

180 INPUT A

190 LET A(1)=A 200 FOR I=1 TO G-1 210 IF A(I)=0 THEN GO TO 280 220 LET N=A(I) 230 FOR J=1 TO N 240 IF NOT RND(H(I))=1 THEN GO

TO 270

LET A(I)=A(I)-1 LET A(I+1)=A(I+1) +1

NEXT J

NEXT I

LET K=K+1

CLS

PRINT "PASS ";K PRINT

FOR I=1 TO G PRINT "GEN. ("323") = ";A(I

NEXT I IF A(G)=A THEN GO TO 410

PRINT "NL TO CONTINUE" INPUT A$

IF A$=""" THEN GO TO 200

STOP

PRINT

PRINT

Syntactic Sum:

"ALL ATOMS STABLE" -17745, 4K

SALARY SCHEDULING COST COMPUTATION

This 8K/16K program computes salary schedules for two or three classes of teachers (or other workers). For a two column schedule, enter all zerosfor the prompts about the third class (Mast+). At the end of the second column, it will ask if you want another. Enter NO and touch NL. The computer will give you schedule cost and total number of teachers for the entire two column schedule. For a three column display, answer YES to the prompt and enter data for the third class.

For both two- and three-column schedules, you see column cost, number of teachers and number of increments at the end of each column.

Lines 65, 67 and 69 (inputs BY, MY, MAY) determine the number of years in each column. Lines 41-63 are prompts and inputs for the initial salary in each column and the increment size for each column. Increments within a column must be the same, but they may vary between columns. Line 19 is an input statement for the school/ corporation name.

Each column's cost is calcu- lated: ed. cost=(#teachers* begin- ning sal. )+(#increments*increment size). Knowing the number of in- crements in each column is very useful in schedule development.

Robert M. DeMunbrun, Rushville, IN 1 PRINT TAB 8;"EQUAL INCREMEN TT " 3 PRINT TAB 8;"SALARY SCHEDUL ING" 6 PRINT TAB 7;"COST COMPUTATI ON uw 9 PRINT TAB 15;"By" 12 PRINT TAB 7;"R.M. DEMUNBRUN 15 PRINT 18 PRINT "SCHOOL CORP NAME?" 19 INPUT A$ 20 PRINT A$

21 PRINT

24 PRINT TAB 6;"1980 81 SCHOOL YEAR"

27 PRINT

36 PRINT

39 PRINT

41 PRINT "BEG BACH SALARY?"

43 INPUT B

45 PRINT "BACH INCREMENT?"

47 INPUT I1

49 PRINT "BEG MAST SALARY?"

51 INPUT M

53 PRINT "MAST INCREMENT?"

55 INPUT I2

57 PRINT "MAST+ SALARY?"

59 INPUT MA

61 PRINT "MAST+ INCREMENT?"

63 INPUT I3

64 PRINT "YRS BACH COLUMN?"

65 INPUT BY

66 PRINT "YRS MAST COLUMN?"

67 INPUT MY

68 PRINT "YRS MAST+ COLUMN?"

69 INPUT MAY

70 LET N=-1

72 PRINT TAB 1;"DEGREE";TAB 17 ; "YEARS"

73 PRINT TAB 1;"TEACHERS";TAB

17;" INCREMENTS"

74 W 3s) 95 100 105

PRINT

110 PRINT TAB 1;"BACH" ; TAB 17;N 120 INPUT NO

130 LET TE1=TE1+NO

140 LET IN=N*NO

150 LET IN1=IN1+IN

170 PRINT TAB 1;NO;TAB 17;IN 180 PRINT

185 GOTO 100

190 LET C=B*TE1

200 LET CIN=IN1*T1

210 LET COST1=C+CIN

220 PRINT TAB 1;"BACH COST";TAB 16;"$";TAB 17;COST1

230 PRINT

240 PRINT TAB 1;"NO. TEACH"; TAB 17;TE1

250 PRINT

260 PRINT TAB 1;"NO. INCREMENTS "sTAB 17;IN1]

280 PRINT

LET TE1=0 LET IN1=0 LET N= IF N>BY THEN GOTO 190

N+i

290 LET N=-1

14

300 LET TE2=0

330 LET IN2=0

340 LET N=N+1

350 IF N>MY THEN GOTO 430

360 PRINT TAB 1;"MAST";TAB 17;N 370 INPUT NO

380 LET TE2=TE2+NO

390 LET IN=N*NO

400 LET IN2=IN2+IN

410 PRINT TAB 1;NO;TAB 17;IN 420 PRINT

425 GOTO 340

430 LET C2=M*TE2

440 LET CIN2=IN2*12

450 LET COST2=C2+CIN2

460 PRINT TAB 1:"MAST COST";TAB 16;"$":TAB 17;COST2

470 PRINT

480 PRINT TAB 1;"NO. TEACH";TAB 17; TE2

490 PRINT

500 PRINT TAB 1;"NO. INCREMENTS ";TAB 17;IN2

510 PRINT

520 PRINT "ANOTHER COLUMN? ""YE S we OR wea NO wo

530 INPUT B$

540 IF B$="YES" THEN GOTO 600 550 LET TC1=COST1+COST2

560 PRINT TAB 1;"SCHEDULE COST" ;TAB 16;"$";TAB 17;TC1

580 LET TEA=TE1+TE2

590 PRINT TAB 1;"NO. TEACHERS"; TAB 17;TEA

595 GOTO 900

600 LET N=-1

610 LET TE3=0

640 LET IN3=0

645 LET C=0

650 LET N=N+1

660 IF N>MAY THEN GOTO. 740

670 PRINT TAB 1;"MAST+";TAB 17; N

680 INPUT NO

690 LET TE3=TE3+NO

700 LET IN=N*NO

710 LET IN3=IN3+IN

720 PRINT TAB 1;NO;TAB 17;1N

730 PRINT

735 GOTO 650

740 LET C=MA*TE3

750 LET CIN3=IN3*I3

760 LET COST3=C+CIN3

770 PRINT TAB 1;"MAST+ COST";TA B 16;"$";TAB 17;COST3

780 PRINT 790 PRINT TAB 1;"NO, 17;TE3

800 PRINT 810 PRINT TAB 1;"NO, ";TAB 17;IN3

820 PRINT

825 PRINT

830 LET TEACH=TE1+T ‘840 PRINT TAB 1;"TO B 17; TEACH

850 PRINT

TEACH" ; TAB

INCREMENTS

2+TE3 . TEACH";TA

860 LET TC2=COST1+COST2+COST3

870 PRINT TAB 1;"SCHEDULE COST" ;TAB 16;"$"3TAB 17;7TC2

900 STOP Syntactic Sum: 64742, 8K

BOOK REVIEW

Title: Sinclair ZX81 ROM Disassembly Part A: O0O00H-OF54H

By: Dr. Ian Logan From: Melbourne House Ltd. Price $20.00 in US

Ian Logan has disassembled and annotated the ZX81 Monitor, easing

your access to the r improved 8K ROM. (I

utines of the you have an

old ROM--PEEK 54=132--this disas-

sembly doesn't match

your machine. )

This analysis is more up-to-date.

than the lst ed. Companion. functions except for point calculator.

I find the book

of The ZX81 Ian's book includes all

the floating

useful and

reasonably done, although several obvious typos make me nervous (p.2:

0028 listed twice, O02Bs. p29: not 401FH). I would routine I intended t PEEKing appropriate Preceding every you will find a conc

the second is 16417 equals 4021H,

verify any use by ocations. ajor routine, se functional

description of the code--very useful for quick understanding. In particular, you can examine

the LPRINT, LOAD and

SAVE routines.

These last two differ from the 4K routines published earlier (SYNTAX,

May 81 & Jul.81).

Logan's book doesn't list hex codes following addresses, which makes checking difficult. Also, the notation differs from Logan's earlier 4K ROM disassembly; here you'll find both subroutine names and hex addresses in commands (like CALL 031E,OUT-BYTE). Compare the CALL example with LD HL,+VERSN (see sample routine following). Al- though good to locate subroutines, the names aggravate the problem of counting bytes. If you count bytes between 030B and 031E, only one name (VERSN) has bytes associated with it. Further, the typeface doesn't distinguish system vari- ables carrying Sinclair names, from those which Dr. Logan named.

Logan's notes on the system variables include both decimal and hex addresses, but not the save and poke codes from Sinclair's manual. Logan details the flag functions by bit (as Sinclair did not), and his alternative expressions of system variables enhances understanding.

All things considered, Logan's comments plus the additional data on flags add real value to the disassembly. In future editions, would urge Dr. Logan to include each address and the code in the ROM as well as to separate variable names from the commands. Also, system variables should stand out from monitor calls.--KO

THE ‘SAVE’ COMMAND ROUTINE

zZ

HL is set to point to the start of the program name. There is a 6 second header and then the bytes of the name and the program are passed out to the cassette recorder.

02F6 SAVE CALL 03A8,NAME JR C,02F4,REPORT-F EX DE,HL LD DE, + 12CB 02FF HEADER CALL OF46,BREAK-1 JR NC,0332,BREAK-2 0304 DELAY-1 DJNZ 0304,DELAY-1 DEC ODE LD A,D OR c JR NZ,02FF,HEADER 030B OUT-NAME CALL 031E,OUT-BYTE BIT 7,(HL) INC HL JR Z,030B,OUT-NAME LD HL, + VERSN 0316 OUT-PROG. CALL 031E,OUT-BYTE CALL 01FC,LOAD/SAVE JR 0316,OUT-PROG. 031E OUT-BYTE LD E,(HL

8K MEMORY PEEK

This slow but simple program peeks memory 100 bytes at a time. It displays consecutive bytes in 5 columns by 20 rows. Designed for the ZX81, it works with 16K RAM.

To use, enter the program, then RUN. Type any address start- ing with an even hundred, then ENTER (use 0 to see the first 100 bytes in ROM). After 15 seconds the screen displays 100 bytes starting at the address you entered. Type CONT ENTER and the next screen listing continues at the next address. The program runs faster in the FAST mode on a ZX8l.

We can provide this program on cassette for $7.31 if you want a working copy. We cannot trouble- shoot your typed program.

Joseph L. Hartmann Jr., 101 Tonnele

Ave, Jersey City, NJ 07306

10 PRINT "ADDRESS IS =",

20 INPUT A

30 CLS

35 PRINT AT 0,6;"WAIT 15 SECON ps"

37 PAUSE 80

38 POKE 16437,255

40 PRINT AT 0,6;"+00 +20 +40 + 60 +80"

50 FOR I=1 TO 20

60 PRINT AT I+1,0;A-1+1

70 NEXT I

90 FOR J=1 TO 5

95 FOR I=1 TO 20

100 PRINT AT I+1,6+4* (J-1) ; PEEK

(A-1+I)

110 NEXT I

120 LET A=A+20

130 NEXT J

140 STOP

150 GOTO 40

Syntactic Sum: 19776, 8K

Readers have written in looking for users' groups in San Francisco, San Diego, and Manhattan, NY. Send us information about your group and we'll put interested people in touch with you.

AWARI- -8K/16K

Awari is an ancient African game for two players. Six piles of three stones each are arranged in front of opposing players, with each player's "home' to the right of the piles. The play gonsists.of taking all the stones in one of the player's piles and, moving counter- clockwise, dropping one stone in each pile or home until all are dropped. If a player's last stone falls in his home, then he gets a second move. If the last stone falls in an empty pile and the opposite pile is not empty, then the player can move the last stone plus all stones in the opposite pile to his home. The game enas when either player runs out of moves. The player with the most stones in his home wins.

Sample strategy: 5 3

0 A

i

3

3 0 1

The computer would most likely move its number 6 pile (top left with 5 counters), since it would end up with 1+1+3 or 5 more counters in its home. Moving its pile 1 or 4 would only result in 4 more points. Were it your turn, a good defensive move would be your pile 2 with 3 counters. But moving pile 3, 5 or 6 first would be even better since you would get 1 more point plus a second move to take pile 2 out of harm's way.

This Awari game is a simpli- fied version of one in Basic Compu- ter Games by Creative Computing. Although it only knows offensive moves, it plays a reasonably good game. If you're like me, you'll lose often enough to keep it inter- esting. The first player to move is chosen randomly, and then the first move alternates if you press NL or ENTER at the end of each game. Input STOP for your move to

17

quit, then continue with GOTO 940 or RUN. Input any character at the end of a game to see the listing.

Note that the <>/ (not equal to) sign is shift T; don't type less than and greater| than signs. To enter lines 690 and 710, type the line number, PRINT command and " mark, then press shift 9 to change to graphics. Press shift 7 25 times for line 690, shift 5 once for line 710. Press shift 9 again to return to normal input mode, then type the ending |' mark.

Jon Passler, Beverly, MA

REM AWARI RAND LET K1=INT DIM A(14) DIM S(14) FOR I=1 TO 13 LET A(I)=3 NEXT I LET A(7)=0 LET K=K1 LET Z=3 LET J=15 GOSUB 68C GOTO K*40+110 PRINT "YOUR MOVE"; GOTO 230 PRINT "AGAIN"; GOTO 230 PRINT "MY TURN-N/L"; INPUT I$ GOTO 270 PRINT "AGAIN-N/L"; INPUT I$ GOTO 270 INPUT M IF A(M)=0 THEN GOTO 230 PRINT ": "3M , GOTO 500 IF Z>3 THEN GOTO| 300 LET M=INT (RND*¥2)+12 GOTO 490 FOR I=1 TO 14 LET S(1I)=A(TI) NEXT I LET H1=A(14)-A(7) FOR J=8 TO 13 IF A(J)=C THEN GOTO 470 LET M=J

(RND*2) +1

MINDWARE CO.

Products that supplement nature’s computer

Do you have the ZX81 product American business is READY TO BUY?

We develop and distribute ZX81 products for business applica- tions. If you have a software package or hardware device that ex- ploits the ZX81 as a working tool for management, we want to hear from you. Using national advertising in trade publications, and direct mail, we will put your products before the marketplace. the potential market is unlimited: factories... credit unions ... machine shops ... retail stores . . . universities ... . photographers .. . travel agencies . . . realtors What do we want? Give us a chance to review your software ap- plications packages and hardware devices with an eye to making you a sound royalty offer. If you are interested, call us or send a summary description. Be sure to include an explanation of the benefits, the potential end- users, and any facts that set your application apart from the others.

Our address is: MINDWARE CO. 70 Boston Post Road, Wayland, MA 01778 (617) 358-7175

370 GOSUB 50U

380 LET H2=A(14)-A(7)

390 IF M=14 AND K=2 THEN LET H2 S242.

400 IF ABS (H1+H2)<2 THEN LET H 2=H2+2 .

410 IF H1>H2 THEN GOTO 440

420 LET H1=H2

430 LET W=J

440 FOR I=1 TO 14

450 LET A(1I)=S(T)

460 NEXT I

470 NEXT J

480 LET M=W

490 PRINT ": ";M-7

500 LET I=A(M)

510 LET A(M)=0

520 FOR I=I TO 1 STEP -1

530 LET M=M+1

540 IF M>14 THEN LET M=M-14

550 LET A(M) =A(M) +1

560 NEXT I

570 IF A(M)=1 AND M<>7 AND M<>1 4 THEN IF A(14-M)<>0 THEN GOTO 5 90

580 GOTO 620

590 LET A(INT K*7)=A(INT K*7)+A

j (14-M) +1

600 LET A(14-M) =0

610 LET A(M)=0

620 IF: J<14 THEN RETURN

630 IF Z=3 THEN GOTO 670

640 FOR I=1 TO 11

650 SCROLL

660 NEXT I

670 LET Z=14

680 PRINT AT 0,12; "AWARI"

690 PRINT AT 2-2,1;°2==ame SSR |! (25 shift 7)

700 FOR I=Z-2 TO Z+7

710 PRINT AT I,26;"8" (shift 5) 720 NEXT I

730 PRINT AT Z,5;A(13);" ";A(1 aye MSR (ATS “ACTON ON FAL Oye MGR be)

740 PRINT AT 24+2,1;"";

750 IF A(14)<10 THEN PRINT " -";

760 PRINT A(14);TAB 23;A(7)

770 PRINT AT 2+4,5;A(1)3" “"s3A( 2yeN~ Nea sat MAA Gh) 3" "sA(6)

780 PRINT AT Z+7,1;"";

790 IF Z=3 THEN RETURN

800 FOR I=1 TO 6

810 IF A(I)<>0 THEN GOTO 840 820 NEXT I

830 GOTO 870

840 FOR I=8 TO 13

850 IF A(I)<>0 THEN GOTO 980 860 NEXT I

870 LET D=A(14)-A(7)

880 IF D=0 THEN PRINT "DRAW" 890 IF D<O THEN PRINT "YOU WIN

BY "s=-D 900 IF D>O THEN PRINT "I WIN BY aoe 3B 910 INPUT I$ 920 CLS

930 IF I$<>"" THEN LIST 10 940 IF K1=1 THEN LET W=2 950 IF K1=2 THEN LET W=1 960 LET K1=W 970 GOTO 40 980 IF (M=7 AND K=1) OR (M=14 A ND K=2) THEN GOTO 1030 990 LET W=K 1000 IF W<2 THEN LET K=2 1010 IF W>1.5 THEN LET K=1 1020 GOTO 140 1030 LET K=K+.5 1040 GOTO 140 Syntactic Sum: 5918, 8K

18

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 eredit card no. by 15th of any month for following month's issue to SYNTAX, RD 2 Box 457, Harvard, MA 01451. No phone orders, please.

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 cf yeneral 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 include

a self-addressed, stamped envelope. Otherwise, we cannot return submitted material.

D&D fans love Solo Dungeons with ZX80-81 state hich Wiettag $5.0 Sealed letters for special rooms Halfling 454 Hallsville TX 75650

4 HOME FINANCE PROGRAMS ON CASSETTE Income Averaging;Mortgage Payments; Auto Loan;Intérest Analysis; (8K/1K) All for $5.95;Ck payable to J.Pyryt 95 Union Avenue, Garfield, NJ 07026

ZX81 SOFTWARE - For 1K or 16K RAM. Games, business,math, and more! Send SASE for free catalog to: Great Lakes Software,201 Burlington Rd. , Valparaiso, IN 46383

#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

7 1K ZX81 GAMES ON CASSETTE--$10.00 Mastermind, Slot Machine, Craps, Sub Rescue, White Hot Number, and more. NEW ENGLAND SOFTWARE, Box 691, Hyannis, MA 02601. (Also for ZX80).

New 57 key keyboards with keytops similar to ZX80 and ZX81 words on

CLASSIFIEDS CONTINUED NEXT PAGE >

SYNTAX ZX80 is published YES! Please send me 12 issues of SYNTAX for $29.

monthly by a wholly-owned OC) My check for $29 is enclosed. | (1 Please|charge my L) MasterCard subsidiary of The Harvard Group. Make checks payable to: CO) Diner’s Club 1 American Express Syntax ZX80, Inc. SYNTAX ZX80, INC. LC) VISA CO Carte Blanche account

RD 2, Box 457, Harvard, MA 01451. account number

Telephone 617/456-3661.

12 issues, $29. Single issue, $4. exp. date

bank number (MC only)

signature ___ a ee es

Publisher: Kirtland H. Olson

Editor: Ann L. Zevnik Name Title

Printed by Joseph E. Marhefka, Jr. ptpaniaton ——

Clinton Offset Printers Address

Clinton, MA 01510 City Siate ip © Syntax ZX80, Inc., 1981. All Day Phose’t ) Sate Se. a rights reserved. Photocopying meV PME Dan ears ere I own a CJ Sinclair ZX80 CO Sinclair ZX81 Telephone orders call

C) MicroAce computer. 617-456-3661

19

top. All commarids available on keys Prewired $55.00 kit $45.00 without printed keytops $35.00 kit-$25.00 Kit for putting on keytops $10.00 Z80A PIO chip $4.10 Free catalog. Calif. res. add tax. Incl. $2.50 for shipp. & hand. A.&P. Elec- tronics 5945 Kenneth Ave #34

Carm. CA. 95608

ZX81/1K Listings: imp UFO keeps score, 3 ships. Bomb Search, 9 stories 81 rooms. $1+SASE Fr. Bowes Box 148 Hopewell Jct. NY 12533.

Wanted to buy--back issues of Sync or SYNTAX magazines. J.S. Woodson K4DP 3154 Pitzer's Ridge Rd.

Covington, VA. 24426 (703)962-4268

FOR SALE: Sinclair ZX81 with Sin- clair 16K Memory Module and manual. Purchased Nov. '81-$200.00 Call- (617) 668-7896 aft. 7PM 16K GAMES FOR THE ZX81/ZX80 8K ROM ZX8 TREK - 5 levels of difficulty with 20 battle command options. CRIBBAGE - the computer challenges you at the game of Cribbage. TANK BATTLE - find the computer's tank before it locates yours. Cassette + manual - $14.95 ea. game A.Nisbet, 6 Moffatt Court, Rexdale, Ontario, Canada, M9V 4El1

THE HARVARD GROUP

Bolton Road, Harvard, Mass. 01451

SYNTAX

EZRA GROUP II EZRA GROUP IIL The ZX80/81's are making a name with LOW prices... WE CHALLENGE THE SOFTWARE COMPANIES

TO LOWER THEIR PRICES!

for ZX81/ZX80/8k ROM 1K and 16K RAM versions

Moving Billboard.!!SIDEWAYS!!..1.00 HOLSE: PACC oa Hath pau 6 ate eae ane e 1,00 Quilt Painter. (from Keyboard)..1.00 Metric: COnVErs LON ...2 eects a dae xs 1.00 Functorial Hypercube Course With PROSE AMS: 6.0 sis He gals 1.95 Postase per Orden s. cadet ous s .50

Self Addressed Stamped Envelope Gets You Our Goodies Catalog 5222 REM ORDERS AND CATALOG RQUESTS IN BFR MARCH 3RD GET FREE SCREEN PA INTER PRGRM(SMTHNG LK ETCH-A-SKTCH) EZRA GROUP II EZRA GROUP II P.O. Box 5222 San Diego, California

92105 *KNOW YOUR BIO-RHYTHMS..... for ZX8l *DISPLAY 12 MO CALENDAR....for ZX81 *DISPLAY ONE NO CALENDAR...for ZX81 Each of the programs provide info

for any year starting with 1900 Individual listings-$1.50 each-all three on CASSETTE.only...$6.95 FREE BIO-RHYTHM FORMS WITH CASSETTE

Send for free software catalog

| UAS Box 612 Haddonfield N.J. 08033 20

U.S. Postage PAID Harvard, MA Permit No. 01451

First Class