REKLAMA

DrDobbs-1976-05-v1n5.pdf

MCY7880 i układ mikroprocesorowy na polskich elementach

Tak swoją drogą, istnieje jakaś otwarta implementacja BASIC-a dla 8080, Jak chcesz być w duchu epoki - trzeba przepisać z czasopisma :).


Pobierz plik - link do postu

dr. dobb's journal of

--alisthenics

rthodontia

Running Light Without Overbyte
May, 1976

Box 310, Menlo Park CA 94025

Volume 1. Number 5

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS
In

This

Issue . . .
Copyright Mania

3

1976 Trenton Computer Festival, a photo essay

4

TIDBITS
40 Chars/Line Printer for $250
Day Recommends Science Articles

6

Votrax Makes the Offer

7

Bad Bit Getters, memory test program

Ray Boaz

9

UNIZAP: a modification of the Shooting Stars game

J. Shepard 10

Palo Alto Tiny BASIC
Li-Chen Wang
user documentation & complete, annotated source code
A Note to Members of SCCS Concerning Lou Fields

12

the Editor 25

Index to The Computer Hobbyist

26

Texas Tiny BASIC (TBX) Marrie.-. TV-Cassette Operating
System (TVCOS)

28

NOTES
What's a BAMUG?
JIPDEC Visits PCC
Chicago Stores
The Alpha-Numeric Music Sytem
Malcolm Wright
Program Rei)ository & Tape Duplication Facility
Byte Swap want ads
BASIC Just Won't Cut I~ letter
.How 'Bout Small PASCAL, editor's reply
Subscription & Information Form
PCC Bookstore Offerings
10% off IMSAI Products for Journal Readers

27
27
27
31
32
32
32
32
33
35
36

DON'T KEEP IT A SECRET!

A

t

SUBMITTING

ITEMS FOR
PUBLICATION

Let us know what exciting new software and systems you are '
working on. We'll tell everyone else (if you wish). Maybe
someone is also working on the same thing. You can work
together and get results twice as fast. Or, may be someone
else has already done it; no reason for everyone to reinvent
the wheel.

DIR

DOBB'S JOURNAL

Of'

COMPUTER CALISTHENICS & ORTHODONTIA

t
t
t
t

·~]-= "

~

;,

~
\A~,,

;%;

-

DATE'M-Pl.ease include your name, address, and date on
Volume 1, Number 4; April, 1976
all tidbits you send to us.
Box 310, Menlo Park CA 94025
TYPE'M-If at all possible, items should be typewritten,
Copyright © 1976 by People's Computer Company
double-spaced, on standard, 8~ x 11 inch, white paper. If we
can't read it; we can't publish it. Remember that we will be
retyping an natural language (as opposed to computer languages)
Publisher
communications that we publish.
People's Computer Company
PROGRAM USTINGS-We will accept hand-written
1010 Doyle, Menlo Park, California
programs only as a very last resort. Too often, they tend to say
Editor
(415) 323-3111
something that the computer would find indigestible. On the
Jim C. Warren, fr.
other hand, if the computer typed it, the computer would
Contributing Editors
probably accept it-particularly if it is a listing pass from an
F. f. Greeb
assembler or other translator.
Lichen Wang
It is significantly helpful for program listings to be on
continuous paper; either white, or very light blue, roll paper, or
fan-folded paper. Since we reduce the copy in size, submitting it
Dennis Allison
on individual pages forces us to do a significant amount of extra
Underdog
cutting and pasting. For the same reason, we prefer that you
Rosehips Malloy
exclude pagination or page headings from any listings.
Please, please, please put a new ribbon on your printer
Circulation & Subscriptions
before you run off a listing for publication.
Mary Jo McPhee
In any natural language documentation accompanying a
Bulk Sales
program listing, please refer to portions of code by their address
or line number or label, rather than by page number.
DRAWINGS & SCHEMATICS-Please draw them signifiPrinter
Nowels Publications, Menlo Park 94025
cantly larger than the size you expect them to be when they are
published. Take your time and make them as neat as possible. We
POSTMASTER: Please send Form 3579 to: Box 310, Menlo Park
do not have the staff to retouch or re-draw illustrations. Use a
CA 94025. Return postage guaranteed. Application to mail at
black-ink pen on white paper.
second-class postage rates is pending at Menlo Park CA.
LEITERS FOR PUBLICATION-We are always interested
Published 10 times per year; monthly, excluding July & December.
in hearing your praise, complaints, opinions, daydreams, etc. In
U.S. subscriptions:
foreign subscriptions:
£ letters of opinion for publication, however, please back up any
(Subscnpiion blank is on page 33.)
Add $4 per year to U.S. '
opinions that you present with as much factual information as
rates for surface mail.
£ possible.
$1.50 for a single mire.
Add 112 per year to U.S. f
$3 for the ffrst three issues.
We are quite interested in publishing well-founded,
rates for air mail.
$10 per year.
responsible evaluations and critiques of anything concerning
hobbyist hardware or software, home computers, or computers
Discounts available for bulk orders.
.
.
and people.
We may withhold your name from a pubhshed letter if _you
Disclaimer
so request. We will not publish correspondence, however, which
We serve as a communication medium for the exchange of
is sent to us anonymously.
.
information. We do not guarantee the validity of that information.
We reserve the right to edit letters fm purposes of clanty
Reprint privileges
and brevity.
Articles herein that are copyrighted by individual authors or
ADVERTISING-Advertising from manufacturers and
otherwise explicitly marked as having restricted reproduction rights
vendors may be accepted by us. However, we reserve the right to
may not b.: reprinted or copied without permission from People's
refuse any advertising from companies which we feel fall short of
Computer Company, or the authors. All other artiC~ may be
our rather picky standards for ethical behavior and responsiveness
reprinted for any non-commercial purpose, provided a credit-line is
to consumers. Also, any such commercial advertiser is herewith
included. The credit-line should indicate that the material was
informed that we will not hesitate to publish harsh criticisms of
· reprinted from Dr. Doblb's .Journal of Computer Calisthenics &
their products or services, if we feel such criticisms are valid.

t

t

't
t

t
t
t
t
t
t
t
t

t

t

t
t

t
t

t

Orthodontia, Box 310. Menlo Park CA 94025.
1)-F.

't

Dobb's Journal of Computer Calisthenics & Chthodontia, Ben: 310, Menlo Park CA 94025

May, 1976

COPYRIGHT MANIA: It's mine; it's mine,
and you can't play with it!
During the past year or so, People's Computer Com~any
has received several letters-with-enclosures from one Calvin N.
Mooers of Rockford Research, Inc. in Cambridge Mass. We
initiated the rather unfortunate contact by asking him for information about an interesting but relatively obscure computer
language that he had developed called TRAC. (Note: TRAC is,
at the least, a registered trademark, and probably patented,
copyrighted, and marked with infra-red dye to boot.) What we
have since received from this person, however, appears to
primarily be concerned with copyrights, patents, trade-marks,
and the like. We don't really know -because we didn't take the
time to wade through all of it. He has sent us a copyrighted
price list for his software and documentation that included an
entire paragraph about its copyright protection and registered
service mark, a mimeographed policy on copyrights and
!rade-marks, an article concerning a $3 million suit against
some companies that purportedly have used Mooers' language,
and two copies of a major article that Mooers wrote concerning software copyrighting (we hesitate to give the actual name
and source of the article-we might be sued for reprinting the
title without the author's permission). Oh yes, he also included
some information about his computer language. Incidentally,
. he explicitly prohibited us from publishing most of his letters
... which saved us at least several microseconds in our reaching the decision not to reprint them. Needless to say, Mooers
has shown great interest in (preoccupation with?) the manner
in which many hobbyists obtain their software, and has written us concerning this topic ... but we can't let you know
what he said because he prohibited us from printing or paraphrasing it.
If you are interested in the topic of proprietary software, you might look up Mooers' name in some readers'
guide to computer science literature.
There is an interesting clincher to this little story:
Enclosed with Mooers' most recent paper deluge concerning
copyright protection were reproduced copies of two articles
from Computerworld newspaper. Yes, Computerworld is copyrighted and includes an explicit prohibition against reproduction of material appearing in it unless written permission is
obtained. No, the copies that Mooers included with his letter
did not include any indication that he had obtained such
permission.
[Editor's Note: We have no quarrel with copyrighting,
whether it is applied to publications or to software. You may
note that most of the PCC publications are copyrighted,
including Or. Dobb's Journal. We do object, however, to the
incredible teapot tempest that has recently been raised concerning proprietary software and the hobbyist community. We
also object to the blanket indictment that has been laid on
all hobbyists: " . . . most of you steal your software " (the
essence of Bill Gate's widely publicized February 3rd, openletter to hobbyists).
1. We feel that it unjustifiably casts a shadow on the
entire hobbyist community.
·
·
2. We know there are many hobbyists who are not
thieves in spite of the fact that copyrighted software is as easy

May, 1976

to copy as are copyrighted newspaper articles.
3. We feel this proprietary preoccupation is a waste and
misuse of time and energies of talented software professionals.
4. We feel there are differences between marketing software to hobbyist/consumers for their entertainment, and marketing software to the business and industrial community
where it is used directly or indirectly for financial gain. We
find it unreasonable and impractical to attempt to sell software to hobbyists when its price is half the cost of their hardware systems. It is unreasonable because it's too expensive. It
is impractical because, at best, software is very difficult to
protect against reproduction.
Furthermore, it is naive to attempt to market software
to hobbyists via a royalty agreement with a hardware manufacturer. The analogy comes to mind of someone developing
an excellent and useful reference book, then attempting to
market it via a royalty agreement with a manufacturer of
copying machines, knowing that the manufacturer is going to
place the book next to their copiers with a sign saying, " If
you want a copy of this book, you must send us $350. "
We feel there are only two practical choices in marketing
software for the hobbyist community: 1) Charge very little
for your software, and depend on volume sales for your
profit; 2) Charge a great deal for your software, and sell it to
your only controllable marketplace: the hardware manufacturers. They need it to enhance their hardware. They are also
the only ones who are making sufficient profit to be able to
afford your high price.
We believe that we are exemplifying these viewpoints
relevant to the copyrighting of PCC publications. Please note
the statement of Reprint Privileges inside the front page of
each issue of Dr. Dobb's Journal. You may also note that,
since we are marketing to the non-profit-making hobbyists,
our subscription rate is $10/year. Compare this to, for instance, the $28/year that Microcomputer Digest charges for a
smaller, monthly publication, or the $10 to $40 that DataPro
charges for a single copy of some of their slender reports. But,
these latter publications are being marketed to the highly
profitable business and industrial computer communities. We
have no particular quarrel with this. We are simply pointing
out that one adjusts to the realities of one's chosen marketplace.
Finally, to those software professionals and hardware
manufacturers who choose to provide low-cost ~oftware to the
hobbyist community: We wish to actively encourage your
efforts. As you develop such software, if you will forward
information about it, we will be pleased to publicize it, without cost. We believe that you are taking the right track in
this new and exciting area.] --Jim C. Warren, Jr.

THE SIX PROJECT STAGES
Wild Enthusiasm
Disillusionment
Total Confusion
Search for the Guilty
Punishment of the Innocent
Promotion of the Nonparticipants

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 3

THE 1976 TRENTON COMPUTER FESTIVAL
by Sol Libes
[Editor's Note: The 1976 Trenton Computer Festival was the
first manufacturer-independent computer convention of
national scope for hobbyists. It was held on May 2nd.]
Back in November 1975 when Al Katz and I conceived
of a Computer Festival, if you had said that 1,500 people
would attend, I would have said you didn't know what you
were talking about. And, if you had said that we would have
45 exhibitors, I would have thought that you belonged in the
" cuckoo nest. " But, it all happened on May 2nd at Trenton
" 'tate College in New Jersey.

SOL LIBES, ACG-NJ president, spoke at the
" Computer Club Congress " .
What started out as a small affair for about 300 people
(we only had about 100 members at the time), six to nine
exhibitors, and a flea market, exploded. Considering that we
did not anticipate such a large affair, it is incredible that everything went so well.

PAT DEITTMAN and associate prepared for demonstration on use of microcomputers by radio amateurs.

FLEA MAR KET scene

Page 4

The Festival turned into a National Convention-the first of
its kind. People came from California, Colorado, Florida, North
Carolina, Virginia, Washington DC, Maryland, Ohio, Pennsylvania, Massachusetts, Illinois, Indiana, New York, Connecticut,
New Hampshire, Michigan, and, of course, New Jersey-18
states in all!
There were 26 speakers with such well known authorities
as Dr. Robert Suding, Hal Chamberlin, and Dave Ahl. They
spoke on subjects such as the Z-80 Mpu-including demo,
computer music, computer graphics, writing softll':are, 16-bit
mpu's, etc.
The exhibitors included DEC, Motorola, RAC, Digital

Dr. Dobb's Journal of Computer Calisthenics & Orthodo_!'tia, !!ox 310, Menlo Park CA 94025

May~

1976

Group, dealers for MITS, IMS, Sphere, E & L, HAL Communications, and many others.
Amateurs set up demo's of their systems. There was a free
program-copying service for programs in the public domain.
There was a huge outdoor flea market.
Ona exhibitor, who had brought 14 CRT terminals (@$500
apiece) to the festival, sold 12 within minutes after the doors
opened. By noon, all his stock was gone and he closed up his
booth!
Of course, I was very busy during the Festival, but I did
manage to go to two talks-and they were great. I heard Hal
Chamberlin's talk on computer music. Hal is doing some
radically new things using his IMP 16-bit mpu and a special
Fourier hardware system to create music that is better than
that I have heard from systems using other techniques. Hal
played a tape of the Bach Toccata & Fugue in D Minor
which was programmed on a 16-bit machine and processed
through his Fourier circuitry to produce a rendition which

MORE flea market

DR. ROBERT SUDING talked about, and demonstrated his new Z-80 microcomputer system.

DAVE AHL (Creative Computing editor) spoke on
HAL CHAMBEFUJN (left), Computer Hobbyist editor,
demorostrnted his new techniques for computer music.
May, 1976

Dr. Dobb's Journal of Computer

Calisttie~ics

computer games.

& _Qrthodontia, Box 310, Menlo Park CA 94025

Page 5

40 CHARS/LINE PRINTER FOR $250
sounded like the best musician I have ever heard.
The other talk I heard was Dr. Robert Suding's concerning
the new Zilog Z-80 Mpu. Bob had received an engineering
sample of the Z-80 about 6 weeks ago and quickly and easily
reworked a Digital Group CPU board to accept the Z-80 (it
is not pin compatible with the 8080). Bob showed his system with a very impressive CRT display of all those Z-80
double registers.
All I can say is, if you were not there, you really missed
the event of the year. (there must have been about 100 Mpubased systems up and running).

by Southwest Technical Products Corp. staff

219 W. Rhapsody, San Antonio TX 78216
(512) 344-0241
Southwest Technical's PR-40 Alphanumeric Printer Kit
is a 5x7 dot matrix impact printer similar in operation to the
well-known Centronics printers. It prints the 64 character
•Jpper case ASCII set with 40 characters/line at a print rate of
75 lines/minute on standard 3-7/8 " wide rolls of adding
machine paper. One complete line is printed at a time from an
internal forty-character line buffer memory. Printing " takes place
either on the receipt of a carriage return or automatically
whenever the line buffer memory is filled.
The printer is available in kit form only and includes
the assembled print mechanism, chassis, circuit boards, components, 120/240 VAC-50/60 Hz power supply, assembly instructions, one ribbon and one roll of paper. It sells for
$250 postpaid in the U.S., and delivery is 30 days.

ED GERRI spoke on computer graphics.

··••••········•···········••
DAY RECOMMENDS

100 door prizes-worth about $2K-were handed out
at the festival.

photos by Marj Kirk

Page 6

Dear Jim Warren Jr.
There are two excellent articles in May 7, 1976,
Science:
" Microprocessors?-An End User's View'~ R.E. Dessy,
pp 511-518.
" Microprocessor Aplications: A Less Sophisticated
Approach, " J.T. Arnold, pp 519-523.
Jim Day

Dr. Dobb''s Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May, 1976

Votrax makes the off er
speech synthesis kit for under $1K
by John McDaniel

6

April 26, 1976
Dear Jim:
This letter is to confirm our conversation with regard to
the VOTRAX Synthesizer Kit which we had discussed.
As I indicated in our conversation, VOTRAX was not
aware of the computer hobbyist market, and therefore had not
addressed itself to providing anything for that community.
As a result of preliminary investigation, I am pleased to
relate to you that we could provide a VOTRAX Synthesizer
in a kit form for a price not to exceed $1000. However, we
require more information as to the specifications of the kit
and the size of market potential, before we can commit to
this price. Our quotation on a minimum order and delivery
would be contingent on receiving this data.
Based on the text of your announcement in Dr. Dobb's
Journal [Volume 1, Number 3, page 12], I believe that I have
mislead you with regard to the size of the VOTRAX market.
Your inference was that the VOTRAX market is not very
large at present. This is not correct and, I am afraid, would
tend to mislead your readers as to the impact the hobbyist
market would have. This is not to say, however, that we're
not interested in providing something for those users.
I hope that this information will be of benefit to you.
I look forward to meeting with you again at the Home-Brew
Computer Club Meeting. If I can be of further service, please
don't hesitate to contact me.
Sincerely,
John H. McDaniel
4340 Campus Dr., No. 212
Regional Sales Manager
Newport Beach CA 92660
Vocal Interface Division
(714) 557-9181
BASIC SYNTHESIZER INTERFACE SPECIFICATIONS
GENERAL DESCRIPTION
The synthesizer requires 8 parallel data bits on its input
pins in order to operate. Of these 8 bits, 6 are used for
phoneme slection and 2 are used for inflection level selection.
The synthesizer provides a clock output which must be
used to time the input data. Data should only be presented or
changed on the positive transition of this clock .
.Also provided is a status indicator (zero decode), which
signals the presence of input data. This is useful when the
synthesizer is operated from a buffer memory interface.
All signals are TTL signal elvels, except audio output.
Pin Description, Conn. 6, (Front Mother Board)
Connector
Pin No. Function
4

5

May, 1976

Description

Data In, Inflection MSB 1 TTL load,
Neg. True
Data In, Inflection LSB 1 TTL load,
Neg. True

See Signal
Function
A

A

7

8

9
10
11

2

3
13
15
1 & 10

s
p

A & N

1 TTL load,
Neg. True
1 TTL load,
Data In, Phoneme
Neg. True
1 TTL load,
Data In, Phoneme
Neg. True
1 TTL load,
Data In, Phoneme
Neg. True
1 TTL load,
Data in, Phoneme
Neg. True
Data In, Phoneme LSB 1 TTL load,
Neg. True
Output, Phoneme Clock 2 TTL loads,
Neg. Pulse
2 TTL loads,
Output, Zero Decode
Pos. Ture
Output, Audio Control Ext. 50K Vol.
Con. Wiper
Output, Audio Ground Audio Return
Interface Supply
Output, +5 VDC
Interface Supply
Output, +12 VDC
Interface Supply
Output, - 12 voe
Signal Return
Ground
Data In, Phoneme MSB

A
A

A
A
A
A
B

c
0
D
E
E
E
E

SIGNAL FUNCTION DESCRIPTION
A. Data In (Pins 4-11) Six bit phoneme code and 2 bit
inflection code inputs. All phoneme inputs high are
Null code causing no output condition.
B. Phoneme Clock Output (Pin 2) Provides internal tim·
ing of synthesizer and must be used to control data
input. Data should only be presented or changed on
the positive edge of this signal. When all phoneme data
inputs are high, this clock runs with a period of 6
milliseconds. When data input is present, the period
lengthens, depending on speech rate and the particular phoneme.
C. Zero Decode Output (Pin 3) This signal indicates the
status of data by a high signal in absence of data and
a low signal when any phoneme data input is low.
D. Audio Control Output (Pins 13 & 15) 1-2 volt maxi:
mum audio signal from 50K external volume control.
Additional external audio amplifier required to drive
speaker.
E. Power Supply Voltages. The basic synthesizer re·
quires the following power:
+5 VOC regulated @ 120 MA
+12 VDC regulated @ 160 MA
-12 VDC regulated @ 200 MA
Pins A & N should be used for power supply returns,
and Pin 15 for external audio amplifier ground
return.

Dr. Dobb's Journal of Computer Calisthenic_:; & Orthodontia, Box 310, Menlo Park CA 94025

Page 7

III.

DIAGRAMS
Conn. h

Conn. 5

-~

I
I

I
I

10

I
I
I
I

3
Mother Board........---.~
...:::.

Inputs

Audio Output

~volume

,,,. 1 3 Audio Out

I

SOK

I

15 itt.udio _Gnd

jPowcr

IInput

i~n

~

....~~~

si--~~~~~.....,.~~---~~~~~~~~~~~~~~~~--il--t--

R
Ap

s
rl2

t

t::: -12
-CJ Gnd

Ll

FRONT MOTHER BOARD

:\!UT r;S: 1.
2.
3.
4.

Conn. 6 mounted on front mother board,
Conn. 5 requires jumpers as shown.
Power supplied to push on tabs on rnother board.
Audio contro1 connected to solder points on mother board.

INPUT /OUT PUT WA VEFOH MS
I

Phoneme Clock

I

I

I

I

~
i'6 MS-?!;-----.

I

Varie~

with

= & gt; JJ. .--__.j " " " " " ---.

I

I

I

I

fi:6 MS~

phoneme { & lt; ..·
speech rate
Phoneme Data In
(D 0 - D 5 1

Zero Decode
----------~--~fS'I.---- " " "

NOTES:
l.
2.
3.

Page 8

Data in should be changed on positive edge of phoneme clock.
Zero decode output may contain spikes when data changes.
Data in is negative true (1 TTL load with 4. 7K pullup resistor).

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May, 1976

BAD BIT GETTERS:
Memory Test Programs

A065 06
A066 A7
A068 A6

00
00

A06A 11
A06B 26

OD

A06D 4C
A06E SC
A06F 26

FS

by Ray Boaz
(reprinted with permission from Homebrew Computer Oub

Newsletter)
Every computer system needs a memory test program or
two to ensure a high level of confidence in the memory systern hardware. One bad memory bit. can send a program off to
Never-Never Land. The memory test programs listed here are
for use v,ith 6800 systems operating " With MIKBUG as a system
monitor. MIKBUG is a simple monitor (as it was meant to be)
which has many useful subroutines. Several of them are made
use of in these memory test programs.
The terms used herein are consistent " With the 6800 nomenclature. A and B are the two accumulators, X is the index
register, PC is the program counter, SP is the stack pointer, CCR
is the condition code register, and M is the memory location of
interest.
Of the two programs, the shortest, MTl, is written to be
used in the 6810 RAJvI used by MIKBUG as a scratch-pad. It is
27 bytes long and fits into address space A060 to A07 A. This
,should work well for the SWTP 6800 Computer Systems. The
second, MT2, is a more general test program but takes up S8
bytes total. The start and end addresses in MTl are direct
operands and therefore, shown blank in the listing, MT2 uses
locations A002-3 for start, and A004-S for end addresses. So
these locations must be loaded before the programis started.
Also in MT2 the I/O interrupt pointer locations (A000-1 are
used so if applicable it must be set after running MT2. In
general, both MTI and MT2 operate the same until an error is
found.
In both programs a store is made to an M start address, then
the data is fetched back, compared to good data, and if true, it
is incremented to test M again ·with A+ 1. This continues for all
256 bit cornbinations-00 to FF. Then Xis incremented, and
the next location is tested. This continues until the address is
encountered.
In MTl, on finding an error, a branch to MIKBUG software
interrupt is made which results in the· status registers being
printed out as follows: CCR-B-A-X-PC-SP. B is the good data,
A is the error data, and X is the address with the error. If
testing lK bytes, 2000-23FF, and an error was found which
resulted in B=OO, A=OO and X=007, the chip containing data
bit 7 (MSB) at M=2007 is bad. M+l must be loaded as the new
start address to continue the test to end address.
MT2 on finding an error goes to a routine to print A-B-X,
then continues to the next M until end address is reached. Here
again, A=error data, B=good data, and X=M error.
Both of these programs have worked well as memory testers
and as chip testers for 2102 type memory chips.

A07S 26

EC

A077 7E

EOE3

A07A 3F
MT2
0000 FE

A002

0003 4F
0004 SF
ooos 06
0006 A7
0008 A6

00
00

OOOA 11
OOOB 26

OD

OOOD 4C
OOOE SC
OOOF 26

FS

0011 08
0012 BC

A004

OOlS 26

EC

0017 7E

EOE3

OOlA B7
OOlD F7
0020 FF
0023 CE

AOOO
AOOl
A002
E19D

0026 BD
0029 CE

E07E
AOOO

002C BD

EOCA

002F BD

EOCA

0032 BD

EOC8

JSR

003S 7C

A003

INC

·0038 20

C6

BRA

START LDX

LOAD X WITH START
ADDR
OMT
CLRA CLEAR A
CLRB CLEARB
CLEAR CCR
TAP
NVAL STAA STORE A AT X ADDR
LDAA LOAD A WITH DATA
JUST STORED
COMPARE B-A
CBA
IF NOT SAME BRANCH
BNE
TO ERROR
INCA ELSE INCREMENT A
INCB INCREMENT B
IF B NOT EQUAL TO 00
BNE
BRANCH TONVAL
ELSE INCREMENT X
INX
COMPARE X TO END
CPX
ADDR+l AT A004
IF NOT SAME BRANCH
BNE
TO 011.fT
ELSE JUMP TO MIKBUG
JMP
CONTROL
ERRORSTAA STORE AAT AOOO
STAB STORE B AT AOOl
STX
STORE X AT A002
LDX
LOAD X WITH ADDR
OF CR/LF/* STRING
JSR
JUMP TO PRINT CR/LF /*
LDX
LOAD X WITH ADDR OF
ERROR DATA
JUMP TO PRINT ERROR
JSR
(A)
JUMP TO PRINT DATA
JSR

(B)

MTl
A060 CE

START LDX

A063 4F
A064 SF

OMT

May, 1976

A071 08
A072 8C

TAP
CLEAR CCR
NVAL STAA STORE A AT X ADDR
LDAA LOAD A WITH DATA
JUST STORED
COMPARE B-A
CBA
BNE
IF NOT SAME BRANCH
TO ERROR
INCA ELSE INCREMENT A
INCB INCREMENT B
BNE
IF B NOT EQUAL TO 00
BRAN:'.H TO NVAL
ELSE INCREMENT X
INX
COMPARE X TO END
CPX
ADDR
IF NOT SAME BRANCH
BNE
TOOMT
ELSE JUMP TO MIKBUG
JMP
CONTROL
PRINT ERROR STATUS
ERRORSWI

CLRA
CLRB

LOAD X WITH START
ADDR
CLEAR A
CLEAR B

JUMP TO PRINT ERROR
ADDR (X)
INCREMENT M FOR
NEW START ADDR
BRANCH TO START

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 9

UNIZAP-A MODIFICATION OF 'SHOOTING STARS'
by John C. Shepard

EDITOR'S NOTE: A game called TEASER, written in BASIC,
was published in the September, 1974, issue of PCC, The game
was redone by Willard I. Nico under the title of " Shootl.ng
Stars'; and was published as an eight-page article in the May,
1976, issue of Byte (pages 42-49). UNIZAP is a variation of
Nico's " Shooting Stars " game.
1
2
3
4

5
6

1 UN!ZAP' - A MODIFICATION OF 1 SHOOTING SHAS', A P
I DESCRIBED IN THE MAY ISSUE OF llYTE MAGAZINE (If 9).
;
I CONVERTED TD RUN ON INTEL SOK-U~ B0s• SYSTE~lS BY
I
JOHN Co SHEµAAD
;

.

; THIS PHOGRAM IS PUULIC DJMAH:. •• SEE BYTE MAG. FOR

9

Ii
I

1~

1 ·1
12
1:l

14
15
16

17
18
19
2~
101~
,~~3

31
21
1~¢6 CD
1~~y ¢6
1¢¢B ©E

,,,D 5m

EE 12
25 12
32 11
~0

¢1

23

24
25
26

21

1~¢E 14
1~~F 1E ~A
1~11 10
1~12 CA
1~15 78

21
22

28
29
3v1

9f 11

31
32

1G16 FE 06
1~1tl CA JE
1118 FE ~3
1010 CA JE
1020 FE ~5
1~22 CA 46

1~

1~

11

33
34
35
36
37
38

H:lS AF
1'1126 7ll
1 ;,\27 ~iF

39

112B 47

42

3[
·~2E C3
·1~31 JE
1~J3 CD
1r36 3E

41
2A
33 1¢
20
28 11
2~

co

28 11

1~38 C3
103E 3E
1~4~ CD
1•143 C3
1045 AF
1~47 79

11 1j
klD
28 11
25 1~

1030

1W48 ~F
1~49

114C
104F
1052
1¢55
1V.S7
H15A
1W5B
1•sE
1~5F
1~62

CJ
21
CD
CD
1E
21
BE
CA
10
CA

43
44
45
46
47
48
49
5~

51
52
53
54
55
56

29
61
32
18
.¢9
30

11
11
11
11

69

1~

11

08 1¢

23

,.63 23
111164 23
1~65 23
1066 C3
1•69 23
106A 7E
1~60 A7
10fiC C2
1W6F 79
1 \i7f1 fE
1~72 C2
1075 C3

GElCH
ECHO
HOLE
STAR
WHY
SPACE
QllE
COLON
ZERO
CR

57
SD
59
60
61
62
63
64
6S
66
67
68
69

78

1~

'11
12 11
70 10

71
72
73
74
75
76
77
7R
79

EQU

f,.JV

ARC
i " 'tV
PSllDOT I JNC
MV!
Jt'1?
LOACOT1 MUI
00171
LALL
MVI
CALL
JMP
CRLf1
MVI
CALL
JMP
TESTS: XRA
MilV
ARC
JllP
GOTSTR: LXI
CALL
CALL
MVI
LXI
NXTGRP: C~P
JZ
OCR
JZ
lNX

A,B

H,A
LJAOUT
A,STAR
Du!T
A,HOLE
OUTPUT
A,S~ACE

llUTPUT
ULOOP2
A,CR
clUTPIJT
NCDOT
A
A,C
PSUDOT
H,URSHOT
MESAGE
INPUT
E,~9H

H,mKTBL
M
FOUND
E
INVALD
H

HIX

FOUND:

H

INX
INX
JMP
INX

H
H
NXTCRP
H

MUV

A,M

ANA
JNZ
f10V

A
UNI2A
A,C

CPI

\l1 H

JNZ
Jl'1P

BADl'lOV
NXTOYT

r1JV

A ,B
l'1

1~70 78
1 ~79 A6

8\11

UN!2A•

tl1

1¢7A CA 12 11
1170 23

82
83

ANA
JZ
NXTBYT 1 INX

Page 10

3 1\H

EQU '/DH
EQU ~FFH
START: LXI SP, 12EEH
LXI H,TITLE
CALL MESAGE
MVI 8,¢~H
MV! C,il1fi
MUV D,B
UN!O!S: !NR D
UNLOOP1 MVI E,~AH
IJLOOP2: OCR E
JZ
W!NTST
M8V A,E
CPI ~GH
:JZ
CRLF
CPI ~3H
JZ
CALF
CPI ~5H
JZ
ffST5
NEOllT: XRA A

7~

SA HI

ORG 1 f,110H
EQU i'.21BH
EQU if.1F4H
EQll 20H
EQU 7AH
EqU ~9H
EQll 2\IH
EQU 51H
EQU 3AH

l'IES~O

4(11

~~29 02 31 ,~
1~2C

" '*****if·**-*************-************4-**l~************

BADl'lOV
H

;
;
;
;
;

A c~ao PLACE TU START!
INPUT fmtlTlNE user-written
ECHO ROUTPJE user-written
A DDT
A STAR

; A

11

Y11

B4

90

1 ~n4 4F

~E ,~

91

10ro FE 51
10DA C2 96 , .

92
93

10~0

94
95
96

21 77 11
CD 32 11
1093 C3 EF 1~
1196 21 6F 12
1~99 co 32 11
109C C3 •r Hr

1m9m

97

[1

B,A

Jr~P

LOSTST

A,C
A
LDTSTR
H,WHIM51
r1ESAGE
E,ZERO
B,E
C,E
0

1

1£ 3~

; A SPACE

10fl3 40

J A uq11
; A i
; A " f/111

1mn4 1s

111

OCR

10U5 7A
1 ~06 A7
1~87 CA
1ti1BA 3E
:JlilBC 1C
1~00 BB
1 ~BE C2
10C1 1E
1 ~C3 ¢C
10C4 89
H1CS C2
111CA ~E
1 & gt; :CA \14
1 ~CB 15
1~CC C7
10rT 7tl

112

mv
ANA
JZ
MVI
MOR DEC! INA
CMP
JNZ
MVI

3 Ir 5,) 9 SU

t~-YECIA.Li

fET

113

ES 10
3A

114
115
116
117

CB 1 ~

, 18

3~

119

,20

123
124
125

1 ~iD0 f " E 3~
~002

C2 DE

1~

120
129

D
l'lOROEC
A,u
ZERO
THREEO

13~

MjV

131

CPI

zun

J'J7

MHWRT
LS1:;rr;

1~0'1 C2 E2

1\1

132

1~QU

[J fS H1

133
13 & lt; \

H~[1

79

135

1''£2 CD 211 11

136
137
1 Jtl

; ANO PHHH lT

B

OCR
Jr;z
MDV
CPI
JNZ

HID6 FE 3m
1\'1DC co 21l 11

; LJAD A GLALK HJL[
1 PRINT THE CHARACTER
, LOAD A SPALE
; PRINT THAT, TUO
; GO HACK INTJ UNIVERSE P
; LllAO A CARRIAGE REfURN
; PRINT IT. OUTPUT SIJPPLI
; GU BACK AND DO MURE UNI
; CLEAR LARRY (AND A)
; GET POSITION FIVE STATU
I PUT STATUS INTO LARRY
I REJOIN MAIN ROUTINE
; POINT TO 'YOUR Sl\OT?' M
; PRINT MESSAGE
I GET PLAYER'S INPUT
; LOOP COUNT FUR TAULE SE
; POINT TJ THE MASK TAHLE
J DOES INPUT EQUAL TA8LE
l IF Sll, GO ALTER UN IVERS
; OTtf[RWISE, OElRE~ENT LO
; Ir LOUP HAS EN~ED, CHAR
I OTHERWISE I~CREMENT
; TABLE POINTER FUUR
I
TIMES TO GEJ TJ NEXT
j
ENTRY
l THEN TEST THAT ENTRY
; POINT TO POSITION MASK
; ANO LOAD MASK INTO A
; SET THE FLAGS
; IF MASK NUT 0 THEN FRIN
; OTHERWISE THE CENTER PO
I IS STAR IN CENTER?
; If NOT THEN IT'S A WRON
! ELSE GO PROCESS STAR
I REST OF UN!VEHSE Tll A
I AND WITH MASK TU ISOLAT
; IF NO STAR THEN wRUNG M
! POINT TO GALAXY MASK

C

C
TALLY
C,ZERO

1 ~~os 79

; CLEAR rAHRY (AND A)
RQTATE NEXT PLAlE INTJ
SAVE IT IN B fOR A hi~JL
If ULACK HULE, LG bLA~K
ELSE LOAD A STAii

TALLY
£,ZERO

HJR

TALLY:

126
127

! fti.lVE UNIVERSE T:J A

;
;
;
;

£

!NR

122

3~

A,D
A
LSTSIG
A,COLON
E

Cl'iP
JNZ
MVI

121
CB 1~

1~

~FrH

JNZ

H1AA 21 92 11
101\0 CD 32 11

BC

11r~LUOP

A,8

M
.JV
ANA
JNZ
LXI
CALL
l'iVI
mv
l'iOV

1 •As 79
1 ti1AG A7
1.A7 C2 4C 10

1•02 43

; A ZERO
; END OF MESSAGE FLAG
; SET UP STACK PTR.
; LOAD P~!NTER TO TITLE M
; PRINT IT
I INITIALIZE UNIVERSE
I
TO STARTING PATTERN
I CLEAR SHOT LOUNTER
; INCREMENT SHOT COLUTER
; LOOP COUNT 1~ ITERATIJN
; DECRrncrn LOOP COllNTlR
I IF LUUP D~NE, GO TU WIN
; MDU[ COUNTER FOR TESTIN
; IS LOOP IN 4TH CYCLE7
! IF SO, DO A CR/LF
; lS LOOP IN 7Ttl CYCLE?
; If SU, DO A CR/LF
I IS IT STAR FIVE?

H

MUV A,C
XRA l'I
MDV C,A
JMP llN!DIS
INUALD: CPI QUE
JNZ NOTVAL
LXI H,HEQUIT
CALL MESAGE
Jr1P .~GAIN
NOTVAL: LX! H,~ADNUM
CALL MESAGE
\JINTST: MOV
CPI

78

1elA¢ fE fF
1WA2 C2 Vl~ 11

106~

A,8

XRA

MuV
INX

i37

88
89

10R?. 79
1 \i\fl3 AE

,mos cJ

i'10V

85
86

H'M 47
11\l\1 23

1~9f

7

s

1 v·1E ?fi
107f AC

1.··rs 7n

1•1[6

co

2!! 11

H1E9 21 AL:
32
'l0f.F 21 CA
1 ~F2 CD Y'
111if5 CD 1f'
1ii1F8 fE 59
1 ~FA CA \l\1
1\'IEC CU

11
11
11
11
11

111116 C2
'l1~9 21
110C CO
110F C3
1112 21
1115 CD
1118 C3
1118 cs
111C CD
111F CD

4C 1~
EB 11
32 11
ff Hl
\.'.1 12
32 11
~F 10
F4 i1

LXI

141
142
143
144

Jl'iP

LOST ST: ANA

148

:;.~Z

149
15©

MOU

151
i 52
153
154

155
156
157
159
16~

162

'1125 CfJ F4 01

163
164

113~

1131 cg
1132 7E
1133 FE ff

LXI
CALL
CALL
CPI
JZ

106

1123 lfiE ~D

C1
C9
C5
4f
CD F4 ¢1
C1

AGAIN:

147

161

1128 70

fl.,[
UIJTPUT

CALL f'iES/\CE

11?2 59

1129
112A
1128
112C
1120

A 9C

UllTPltT

14~

1 Sll
11J vi2

lHIH-'Uf

1]9

1 W 145

1 ~FD C3 ~? vi~
i 1V\lli A?
1W1 C2 4C 1~
11$4 79
11 ~15 A7

~~'.:;

Tl!REEO: Cl\LL
[l,';V
rJIDPnT: GLL
LSP\Jr,: 111,v
u\ll

ApC

165

ANA

JNZ
LXI
CALL
JMP
BAOMOU: LXI
CALL
JMP
INPUT 1 PUSH
CALL
CALL
MUV
riv I

mv

POP

17~

171
172

MESAGE: M0V

173

CPI

157
168

169

H,ACNrlES
MCSAGE
H:PllT
WHY
START
~¢~7H

A
GOTSTR
A,C
A

COTSTR
H,LOSTMS
FtESAGI:
AGAIN
H,BADMES
~lCSAGE

UNLOOP
fl

Gf:l CH
~CHO

c~c

c ,CR

CALL f.l.HO

RET
OUTPUT: PUSK
MDV
LALL
POP

166

H,luINft52

A,l
ll

B
C,A
ECHO
0

~

;
;

I'i IT (A:JC!l) l(H1'. !U'.~
'1F~ rJ\Jf or:,tJ'._A)' 2 ~If'·,•/)
If-

'.jlJ

lJJ'-,Pl ;\_( i1:~1.

ft/;

f

ur.,1_r_J' ' A
; fETlH r:IU!Jl.t (,!.,!! ' "
; Ol " f'LAY Z !JJ•,J J',, I [IT

' or:,JJLAY :1

; n:TUI 1''.:J LJf'lf {
; ui~f--lLAY !1L1'•1AiNlNG O]L;rr

;
l
l
I

POINT
PR I NT
µJINT
PHINT

T0 2ND HALF LIF WI
THE ~lESSAliE
TO 'AGAIN?' MESSA
IT

; GET PLAYER'S RESPONSE
I IS ANSWER 'YES'?
! If Sll, 00 GAME AGAIN

; ELSE, UALK TO KIT EXIT
I SET FLAGS
l CONTINUE IF FRINGE NOT
I TEST CENTER POSITION
I SET FLAGS
I IF CENTER NOT ZERu, GO
I POINT TU 'YOU LOST' MES
; Pl\!NT IT
I SEE If HE WANTS TO PLAY
; Pil!NT TO 'BAD MOVE' MES
I PRIIH IT
; AND BACK INTO GAME
; SAVE B, C RECS. FRUM ~iLIN
I GET A CHARACTER FRu~1 US
; ECHO !Tl
; S/1VE !Tl
; DO A CR/LF
; USING THE ECHOER
; GET THE INPUT OACK
; RESTORE B,C REGISTERS
; THEN JUST RETURN
; SAVE B,C RE1iI5TERS FROM
; LOAD C~~RACTER TD PRINT
I PRINT IT
; RESTORE 8,C REGS.
; lHEN RETL!i:N

RET

A,M
l'IESNO

174

RZ

1136 CD 28° 11

175

1139 2:1

175

113A C3 32 11

177

CALL OUTPUT
Il & lt; X H
:MP MESAGE

1135 CB

l FETCH UNIVERSE AGAIN
; AND COl•lPLUIENT IT (THAN
; THEN REPLACf. IT
J PllINT TU CENTER l·lASK
; FETCH CENTER OF UNIVERS
; CO~lPLEMENT CENTCH
; AND SAVE THE CE~ITER OF
; GO DISPLAY THE NEW UNIV
l WAS SHUT 'QUIT'?
I If NUT DO DAD STAR AUUTI
I POINT TU •you QUIT' MES
; PR HlT MESSAGE
; SEE IF HE WANTS TD TRY
;POINT TO BAD MFSG.
J PRINT IT
; CO BACK AND REPRINT UNI
; MUVE UNIVERSE TO A
; ARE ALL FRINGE STARS P
; IF NOT, SEE If PLAYER H
; FETCH CENTER OF UNIUERS
; SET FLAGS
I IF CENTER NOT EMPTY, ND
; POINT TO 1ST HALF 8F WI
; AND PRINT WIN MESSAGE
l BEGIN BINARY TU DECIMA
! CONVERSION BY SETTING
; REGISTERS TU (ASCII) ZE
; GET RID OF LAST SHOT
; MUVE SHclT CLIUiH TO A fO
; SET FLAGS
; If ZERO, SKIP CONVERSIO
; SET A TO OVERFLOW COD
; COUNT UP 1 IN 1'S DIGIT
; IS IT = TD OVERFL01ol7
; If NOT THEN TALLY AND C
; ELSE RESET 1'S DIGIT~
; AND CARRY INTO NEXT DIG
I IS IT = TU 0 VERFLOW TOO
; IF NUT THEN TALLY & CON
; ELSE RESET MIDDLE UIG!
; AND CAHHY INTO HVl'S DI
! DECREMENT SCURE FOR TAL
• IF NOT ZERU THEN KEEP L
: FETLH LEADING DIGIT TO
'; IS IT ( A'.iCII) lERrJ 7 c
• If fJLlT orsrL;\Y 3 OILIT~
' FEfLH rlIDDL.E D!L!T Ti! A,

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

I GET CHAR. FHOM ~EMORY
I IS IT STOP CUOE?
J YES. HETURN TO CALLER
! NO. PRINT CHAR.
l me. MESSAGf. POINTER
; CO 8!1CK AND GET SOME 1'10

May, 1976

1130 31
113E ~1

178

~1SKTBl

311i, ~1H, 0UH, iJ'!H

1 lJU

1141
1142
1143
1144

32

NO ERRORS ra1mo IN THIS

179

08

10•

OG

1gAF7JrF4702J11~3E2AL333103E2DCC~U113E20L07U11C3111~JfJ!~D7U11~J~51~AF'lg
0fL321J1 .-1216111 CDJ211ifJ10111 [ ·''J~~13011 : & lt; ECA691 ~~1 fiCAtifi1 ~i73232323L.3:.iA1 ·1l237f:A7

32H,02H,07H,~~ll,33H

¢4H,16H,.-JH,34H,~OH

c27r;1 \17 & lt; JF-'E J1 C21211 LYID1 /7, 'il6LA 12112371' AF 47237'.ll\E4FUi[1 ,:F[51 C2 %10217711
C03211C3tT11121Gr12C03211 i:J'.':r1 ':~7:.:F " Ef F C2 ~;i,1117'-JA 7C24C11,G219211C.-132111 [ 3(Jld4B
1 ~1?f\f\'/l.r.c-j1~)3[~1 co: iC2; () 11-11 f'.5 ,;1f.[_ & lt; JC2L:u1~H·iE:3 1:~lll15C2!JL 1 ~i7df[3,.:c2or1 ~~7~FE3~)
C?f21 \iC3E S1 ~1C.Q2D11 /l.:~:02G1171 i LD:~~1121W.~111_03211~1L.'.\11t:O]211 I .[J " l ~\11 F [~.· iLA~·11A
1r;\r::11·17',1!1A?r24C11179i\ 7C74C1 ;:21 [,:11 ~03211 OEF1 ;·21,1112LU3211 u.:r1 ,:c o':D1 J•,',;:rn
F4~i151J~\[~'.tJLDr 4L,17!lC1c9r·.:14rcnF4~· 1 c:11:!J7f " FEFFC:.:CU281123l332·11 :~1 '.·1 ~·1; j.,, 13 {'.,'L ~7
'i~i33~~L\ 16 ~\1 ]4 ,;i:'. rJ ,'. 03 5 .'.~1Sf\ ~~1361 ~~fl4 ;. '.n3 7 2~~68 ~i1 3,J, ~iE ~ip~13911 ~ 'D~~~1 ~)02 ~·12 0~ \.·:~ ,i2 li12 ~

~2
~7


1145 33
11~6

1147
1148

¢4
16
¢1

1149 34
114A i1fl
1148 29
114C

207 ~is94r sss22 ts3 4,. 14r 54 2 ~~3i::2V;Ff1:0 ~o~:n 594F 5~:;2 ·,; 4 " I~~ ~J ~64~;2~1 s ss .;2 l1544 r 4 r 2 \' 11 5..-11
531•94C5fJCorr:';lJ~~u .'O'.:i9!;f ~;S2:':~i7 414E2 ·,~212121 :/.osrJ M 552 v'r464 1J52 4S & lt; i4:t~WF7. ~~~)3Ai.:4F

181

DG

ifl2

DO

5(532~2E2E~E2,l424~153542.;SJ434FS7452~4 1 JS32~31312~~UF.FVD574f-554L442JS94~·~5

29H, ~l¢H ,35H, 0~H, 5AH

l1H,36H,10H,94H,¢0H

2\.l4C494il452 ~1544F " 2 .i~14r.-2 59:.' !, " ti 14 7 414 " ;.J4E3FTF~~04!i~~)5fJ212'.·~5~!4f-S~/2~i4C4\· '.:354 ~· ~is4
41•452:·~4 7414D4 5..JOFF\ " & lt; [l'; " .()5··l4r SS2 ~4D~15\l2l·~4r~ 4[4l. 5'..J21/534~t4F 4f !J42 & lt; ;i'..i3~4415L :i32C
2~ 5455 52 MJ/t 55 :l ~'.C'lF F 1/(J .~0~·1021\2 E2 A2 C' .~2 t. 2 A2:, 55,i E 4 1J SA41 ~3 ·,12 ~J2 A2 E_ 2 A~ t 2 A2 [2 A;.1U~10
2~2~l2(2~1202~2;'.2(3~2G322~33~02~2~2~2~2~2~2~12~2,)342~l352~J6/02~2~12;2~2;2~2~
2 ~2 ~~372 ~'.3 :i 2 ~i3'-} ~)Ol' O~iOtF ~054 59 5C4 52 ~31205441 J 52 552 ~-)392 ~~2l2 [2E2~~4 F 5?.2'./!2:.lS122

M

1140 JS
114( ~~
114F SA
115~ ~1

1151 36
1152 1 ~
1153 94
1154 ~11

1155 YI

20544f " 2~51554954~0f " f

1158
115C
1150
11 SE
11 SF

1161 ¢0
1176
1177
1178
1179
117A
119~
1191
1192

STAR

186
187

CR
URSHOT, Q[J
YOUR SHOT
ASC I
DU MES ND
HEQU!T 1 DO rn, CR ,CR
ASC 'YUU GIVE UP TOO
CR ,MEStm

19.
191
192

WlNMSii; DO

& gt; '

EASILY'

rn,rn,rn

1193 \!O
11'14 j10

'y;j!_I

ASC

193
194

OD

195

/\SC

I

19G

[)i.)

f'~[S.JO

ASC

'

LION 111'

en

197
191i

WINMS21

11CA 00
11rn

199

A[;N~i(Si

11E7 FF

2•1

YlJiJ f!R[D
~;Hl)TS

0

'

°' OEST SLURE IS 11

!Jii lH ,~lSt " D

'

11rq IT

20$

11EB ¢0

2~2

11E9

11ff ¢0

204

12~¢ FF
12~1 ~o
1202

2~5
2~6

L.OSTMS• D8

8AOMES: DB

08

TITLE:

1M~
Hl~E
1 & gt; 11pf
1111

BADMOV

F.ESAGE

1 ~2{ " " 1

l'ISKTBL

112B
1132
1130

HEOUIT
\JJ!NMS1

1161
1177
1192

08

1228

211
212

DO

1240 ~D

213
214

CB

124E

215
216

D~

217

11133
1 ~JE
1 ~146
1 :.14C
H15A

1V169
1\178

unsHoT

11 ~.i
1112
1110

W!Nri52

1~AC

AGW'1(S

11 CA
11[8

LOSTMS
BAOMES
TITLE
BAONUM

1201
1225
126F

Note that the assembler doesn't cakufate the 'ASC' values in
the listing--but leaves space for them. The hex dump has the
ASCH in it. Prog. requires less than 700 bytes. The 11 step
solution is 5,2,1,8,5,3,2,7,9,8,5

LIKE TO TRY AGAIN? 1

en

CR
CR

TUfiKEY'

CR

ASC

218

1\129
HLl1

INPUT
OUTPUT

H'DE
1 ~~(2
1\1(5
111EF

OB CR,CR

21~

~lo

LSTS l G
AGAIN
LOSTST

~IESNO

ASC 'YOU & lt; •1AY ONLY SHOOT STARS~
DB CR,f'lLSNO

2vl7

1226 ~O
1227 ~.(l

~D

MIDP~T

v1~3D
~i~~fi1o
v,~rr

ASC 'HEYi YOU LOST THE GAME'
OB eR ,MESNO

2¢e

2W9

DO CH
A5C 'WOULD VLlU

Du

2\13

12SC
1250
1268
126C

'!~JA

f'iESND
START
UNIOIS
l'NLODP
ULOOP2
NEDOT
PSLIDOT
LOAOOT
DOIT
CRLF
TESTS
GUTS TR
NXTGRP
FOUrJO
UNI2A

DU

ff

124~

1102~
~,1,,,

CR

0D

123E & lt; lD
123F llO

·I ,i9F
1 i·loc
1 ilCB

QUE

oo~H,01H

08

185

1f19

12113
1223 ~D
1224 ff
1225 ~D

MOR DEC
TALLY
THREED

zrno

~D

PD

li!INTST

v1~s9

1 ~70
1 ~:rn

10%

COLON

¢D

1195
11A¢ 0D
11A1
11AB FF
11AC
11Ui CD

oM2A

NXTBVT
I NU ALO
NOT VAL

SPACE

4~H,0EeH,1¢H,39H,U¢H

DO

184

108

~o

~1?10

111f4
v1020

WHY

Ff

¢0

V~.LLIE

GET CH

116¢ 01
1162

TABLE

[CHO
HOLE

37H,20H,6BH,.1H,38H

08

103

E0

39

D~

SYMBOL

NAl'iE

1156 21~
1157 G!I

1158 ¢1
1159 Jr.
115A 4~

ASS[~OLY

31EE12212512CD3211~6(~JE~15~141EJA10CADf1G70FE06CA3l1~FE~3CAJE1~FEmscA46

113F (\O
1140 ~1

ASC

ASC

ASC
DB

l*o*~*•~ UNIZf-\P
CR,CR
I

*•*.,*,/P

1 2 :'.I'

CR
4

6'

CR
I

8 9•

CH~

Cf't i & gt; C?.

~Mf.:Sf'JO

PD

1260 ~o

126[ FF
126F \lD
12711

219
220

1290 (bo

221

BADNUM: 08 CR
ASC
'TYPE 1 THHU 9 " .. DR

DO

CR

" Q "

Ttl QUIT'

,~1ES'•D

1291 ff

May, 1976

Dr. Dobb's Journal of Computet Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 1.1

en

....

CD

...

3:
& lt;

..
,

U1

II.)

0

~

ID

) & gt;

n

~

" ti

:I

.s::
0
.

0

w

...

x

0

ttJ

:I

...
iii'

0

c..

0

...
::r

0
...

" '
,..

;;·

:I

iii'

n

.
...
::r
..

~

c

...

" C

3

0

n

0

...

..

...
:I

c

0

'-

.,.·

a
a

0

c

c
...

II.)

" ti

..
..
" '
...

divide.
multiply.
subtract.
add.
greater than (compare).
less than (compare) •
equal to (compare).
not equal to (compare).
greater than or equal to (compare).
less than or equal to (compare).

In statement 10, A will be set to 123 if
and to 789 if X & lt; Y. In statement 20, the
like a logical AND, and the " + " o~erator
OR. In statement 30, Y will be a random

X & gt; Y, to 1156 if X=Y,
" * " operator acts
acts like a logical
number between 0

10 LET A= (X & gt; Y) *123+ (X=Y) *1156+ (X & lt; Y) *789
20 IF (U=1)*{V & lt; 2}+(U & gt; V}*(U & lt; 99)*(V & gt; 3} PRINT " YES "
30 LET R=RND(100), A=(R & gt; 3)+(R & gt; 15)+(R & gt; 56)+(R & gt; 98)

Expressions are formed with numbers, variables, and functions
with arithmetic and compare operators between them. + and signs can also be used at the beginning of an expression. The
value of an expression is evaluated from left to right, except
that * and / are always done first, and then + and -, and then
compare operators. Parentheses can also be used to alter the
order of evaluation. Note that compare operators can be
used in any expression. For example:

Expressions

+, -, *• and / operations result in a value between
-:!2767 and 32767. (-32768 is also allowed in some cases.)
All compare operators result in a 1 if true and a 0 if not
true.

& gt; =
& lt; =

#

& lt;

+
& gt;

*

I

Arithmetic and Compare Operators

There are 3 functions:
ABS(X) gives the absolute value of x.
FND(X) gives a random number between 1 and X (inclusive).
SIZE gives the number of bytes left unused by the program.

Functions

There are 26 variables denoted by letters A through z.
There is also a single array w(I). The dimension of this
array is set automatically to make use of all the memory
space that is left unused by the program.
(i.e., 0 through
SIZE/2, see SIZE function below.)

Variables

All numbers are integers and must be less than 32767.

Numb~rs

THE LANGUAGE

5

s:: ) & gt; s::

a

5· ;- ; ...
C

..



~
" " "

co

....

f'

I'll

.,,
" °

C -· " ' " " .,.•

a c §' ·
1»'gCD;t2,CD::E

CD

o ... x ...

) & gt; 2 CD ttJ ) & gt;

::+

...

CD

3 !D

0

... 0

& lt;

CD

;S·m

C:O

CDCD:::I' "

I'll

i "

:I' "

~ & lt; ;,:;·

'03~~

i -·

-

:I' " -·

~

I

::r-.=t

" " 'I

e: :;·;
..+D & gt; 3CDic ....
· " 'o
CDC.CD
C

g

0

cn-tt::r+r+--t\

:::icCDCD " 'o
~SP & lt; a ... :::1
;:;: 3 1»0.,.o,...
om:::ic-+c.:r
" " ::l.C.::E6f0CD

?6f

c...:::13om & lt; -



CD; ;}
.. - ....
3 =!»
I'll
-.D & gt; l'D::E
!cnr+m~~:l

~ ~ ~. ~ ~

3:;::••

5::~3.:::1§:.,..§

I

en C.
:r
... ...
.... O " 0 ....
• :r .... D & gt; CDc:::I' "
:;•

0 CD
~-s-:::1

I'll

:::i3~cg:

c.5·ggCD & lt; C
-·:I
c D & gt; 0 ...

c=; & J & lt; c.:::1. " '~

-.3:::1Zl.+ " 2.
-I
.+C:!i;CD
-· 0 .+ CD CD 3 ) & gt;
.... :I' "
:::1
en CD & lt; .. 0-··.+:::l:S
'C;:::i:r;r.
Ctlc• ,...1».,.
) & gt; O " D & gt; :r ... (j' el
en:::cnCDQ:::I

!!.

) & gt;



(1)

0

s-a
......
Cl

o

~

~
0

~

& lt;

::I

~

S'

.:r
.

C.

c.n

N

( " ) 0


m en
-I

u;·

:I' "

3

" 2.
::I

CD

& lt; ~

D & gt;

0

CD n

3

:;. IQ

0

... ::I


-h

en-c

-c
( " ) 5!:

Ct! ::I

) & gt;

& lt; ...

£!F;~ a~
:5: m CD -I CD
" ti
.. :;· a;

en .,, & gt; & lt;


CD 0

.. !:!!.

& lt; ~
.... CD CD
0 ......

..tn

l! 0 ' "
... 3 -·
Sl CD a

n " '..:::!

.. 0 ' & lt; :!
0 ::I (1)

enm3i::E
()1)8-·::t,CD
8mage:
'C
ID

ar;~~
& lt; ...... 0
CD !t iil "

& lt; -1 ....

c: " g. 3 'C ;- -3·
CCDCDOD & gt;

...

& .



3
3

~ D & gt; CDncnO " CD
" " a :I CD

01-t-:::I

2,
-I
:I
c.
" " .+ - CD " ' -· :r :I
CD " " -·
& lt;
...- 0 C. • •
...•
...
.... :I -· & lt;
Ct!
n " '
:rcc:::i
) & gt;
::!
0
CD·~Ctl

::i. o 3



c. -·
CD " '
.......
c

(1)

....
.... & lt;

CD

't::s ::.
~

~ ...

CD " "
c. ::T
CD
& lt; " )
Cl ::!?

b

::: :-.
~

~
!::...
:I' "

CD

8
-· ~

g

'C


:I

;

:::?.



3

n
0

tn

cn

'al

Q;

O " 0 !»
& lt; -· .......
.... ::I c ....
CD en (i; 0

::: :I .... w
O~CDZ!

3

:I -· ...
..... ::I
;I° C-IC

0

::E -· ::.· 0

c.. ....

" ' " 'l:,:CDcn
r+ " t

c::,1»3
:I
5!: D & gt;
C. O " CD ::I
CDC 111 C.

::I

-· CD

~
...

. -· " ° " °
a & lt;

-· ....

!» ~ 0 111
'C !» IQ ....
mc.a .. m
O " CD D & gt; n
:::o3CD

n n -. " "

o:c


~CDaCD

Ct!
& gt; ...
c:·

~ ~ !!.

(C

:::l

~

::I

~
(I)

c

h

O' "

& lt;

=i:'§ 'C
3
:I :::;;

& lt;

-I

:;·


.... a;

0

...

:I

0

;;!, ::E

CD

c::::
... ...
& lt; ;:::

c: "

a~

...

~

-· Cl
b

::.

c.

:I ....



::: CD
::e s:: (j; ~- ::e ......
Ci & gt; m
0
::r'

!.

g

:I



••

::e

§'. :;·

Ct! 'C

en c -·
5!: g.

) & gt;

c.. c=;


:I CD
CD -·
;;;· ... ::E ... 0 .... c: " cc. = CD :I 'C
O "
" 2. §. !.. l! & lt; 0 ... ... 111 ...• c. " 2.
Q) =t. " " ~ " " 'I Q) -0 ,,, " "
CD CD..
& lt; .,.C. .... " ' " " O !»
CC.en
-· :;• 0 0 0' :I' " QI) 0 s:: CD - " "
ausn " " :;:1CDQ
-~-pr.-

-g.

D & gt; .+D & gt; 0 " 0 D & gt; CD
~
O "
i;i' cc ~ ;- m ;- I
..._ l'O CD !!I. g el :I
C.
- C " " ' .+

(';.+C
OG:r
~ ... 'CD & gt; 3·.0~

ca'

=


CD 3 0c'C .... : & lt; 'C !»
......
!!I....
0
n

c. 'C -· c c ... 0 ...-' .:: ..-:r
.
CD-.:;:11»0 " .,. ....
.,.CDic-:::::r " .+ co ....
....
i " 'C ~ S. CD i " " " " co co
en ......i
~ - · :2. !» :I m; - en ......i
& lt;
•• Cf)
c.
I
0 0

:es=§:'§.) & gt;

& lt; ::E c

111 CD

& lt; ::iE CD

n

......

U'l

& gt;

ea

' & lt;

~
....
::s

0

& gt;
.....
,.

0


.....

~

..

~

REM anything goes

REM or BEMARK Command

concatenation are not shown in the examples.

A=234-5*6~

A=A/2, X=l-100, iil(X+9)=A-1

V=(A & gt; B}*X+(A & lt; ~*Y

will set the variable U to either 1 or 0 depending on whether
A is not equal to or is equal to B; and set the variable V to
either X, Y or 0 depending on whether A is greater than, less
than, or equal to B •

LET U=l#B,

vill set the variable A to the value of the expression 234-5•6
(i.e., 204) 6 set the variable A (again) to the value of the
expression A/2 (i.e., 102), set the variable x to the value of
the expression 1\-100 (i.e., 2), and then set the variable iil (11)
to 101 (where 11 is the value of the expression X+9 and 101 is
the value of the expression A-1}.

LET

~W

..

" ti

.,
...

U1

,,,,

.!»
0

ti)

l & gt;

( " )

...
" '
,..

" ti

0

::i

:s:
..

0

- "

w

)(

0

Ill

:J

...
;;;·

0

a.

0

::r

....

20
0

n

= LET

F.=FOR
IN.=INPUT
P.=PRINT
R.=RQN
TO=TO

GOS.=GOSUB
L.=LIST
REM=REMIRK
s.=SIZE

G.=GOTO
N.=NEW
R.=RETURN
s.=STEP

'

CBA '

on the

9

CBA '•

will print the values of A and B in 6 spaces, the values of c,
D, and E in 3 spaces, and the values of F and G in 10 spaces.
If there are not enough spaces specified for a given value to
be printed, the value will be printed with enough spaces
anyway.

PRINT A, B, #3, C, D, E, i10, F, G

" PRINT " .

will produce the same output as before, except that there is
no CR-LF after the last item is printed. This enables the
program to continue printing on the same line with another

PPINT A*3+1, " ABC 123 !@# " ,

will print the value of the expression A*3+1 (i.e., 307) • the
string of characters " ABC 123 l@I " , and the string " CBA " •
and then a CP.-LF. Note that either single or double quotes can
be used to quote strings, but pairs must be matched.

PRINT A*3+1, " ABC 123 !i!Jt " ,

will cause a carriage-return (CR) and a line-feed
output device •

Tiny Basic commands are liste~ below with examples. Remember PRINT 1 ABC 1 , - , 1 IXX 1
that cammands can be concatenated with semi-colons. In order
to store the statement, you must also have a statement number will print the string " lUlC " • a CR without a LF ~ and then the
in front of the co1111u.nds. Tl;e .statement number and the

Commands

A statement consists of a statement number of between 1 and
32767 followed by one or more commands.
Commands ln the
same statement are separated by a semi-colon " : " .
" GOTO " , " STOP " , and " BETDRN " commands must be tbe last
command in any given statement.

Statements

Implied

S.=STOP

R.=RND

l.=ABS
IF=IF
N.=NEXT

You may truncate all command keywords and function names
and follow them by a period. " P. " , " PR. " , " PR!. " , and
" PPIN. " all stand for " PRINT " . Also the vord LET in LET
command can be omitted. The " shortest " abbreviation for all
keywords are as follows:

You may use blanks freely, except that numbers, command key
words, and function names can not have embedded blanks •

~LF)

abbreviation and blanks

.

' "

:J

PP INT

will delete all

::r

.

;;;·

statem~nts.

NEW

..

!!l
n
PRINT command

will print out all the statmentes in numerical order
starting at statement 120.

LIST 120

will print out all the statmentes in numerical order.

LIST

will start to execute the program starting at the lowest
statement number.

RON

.All the commands described later can be used as direct
commands except the following three, they can only be used
as direct command and not as part of a statement:
LET Command

This line will be ignored by TBio

Direct Commands

and 4 vith a prescribed probability distribution of: Ji of
being O, 15-3=12% of being 1, 56-15=413 of being 2,
98-56=423 of being 3, and 100-98=2% of being 4.

...

3

,,
c

0

n

0

....

" '

:J

r::

.

....
0

er
.,.·

er

0

0

0
:'

OI

'8

ID

....

& lt;

~

~

A*10+B

GOSUB command is similar to GOTO command except that: a) the
current statement number and position vhthin the statement is
remembered: and b) a semi-colon and other commands can follow
it in the same statement.

GOSUB and RETURN Commands

will cause the execution to jump to a different statement
numb~r as computed from the value of the expression.

GO~O

will cause the execution to iump to statement 120. . Note that
GOTO command cann~t be followed by a semi-colon and other
commands. It must be ended with a CR.

GOTO 120

CD

.....

co

...

& lt;

m

will cause the execution to jump to statement 120.

3::: GOSUB 120

~

c

" '
N

~

~

~

~

~

~

~
m

c

~

)(

gi GOTO Command

m

~ will test the value of the expression A & lt; B.
If it is not zero
o (i.e., if it is true), the commands in the rest of this
; statement will be executed. If the value of the expression is
~zero (i.e., if it is not true), the rest of this statement will
o be skipped over and execution continues at next statement.
~ Note that the word " THEN " is not used.

~
r;· IF A & lt; B LET X=3; PRINT 'THIS STRING'

..

':/'
CD

!a " IF Command

m

strings and the " - " have the same effect as in " PRINT " .

INPUT A, 'STRING', -, " ANOTHER STRING " , B

= The
0

c
....

'ti

3

0

m

This is the same as the command above, except the prompt " A: "
i•; replaced by " WHAT IS THE WEIGHT: " and the prompt " B: " is
.... replaced by 1.1 AND SIZE: " . Again, both single and double quotes
i;; & gt; can be used as long-as they are matched.

~

'WHAT IS THE WEIGHT 1 A, " AND SIZE " B

When this command is executed, Tiny Basic will.print " A: " and
wait to read in an expression from the input device. The
variable A will be set to the value of this expression. Then
" B: " is printed and varable B is set to the value of the next
exprssion read from the input device. Note that not only
numbers, but also exprssions can be read as input.

INPUT A, B

INPUT command

string " XXX " · (over the ABC} followed by a CR-LF.

~INPUT
c

~

~

o

~

~

" '

CD

ca

The depth of nesting is limited only by

The execution of program or listing of program can be stopped

Stopping the Execution

This command stops the execution of the program and returns
control to direct commands from the input device. It can
appear many times in a program but must be the last command in
any given statement. i.e., it cannot be.followed by a semicolon and other commands.

STOP

STOP command

FOR can be nested. The depth of nesting is limited only by
the stack space. If a new FOR command with the same control
variable as that of an old FOR command is encountered, tha old
FOF will be terminated automatically.

Th~

name of the variable (X) is checked with that of the most
recent FOR commani. If they do not agree, that FOR is
terminated and the next recent FOR is checked, etc. Whan a
match is found, this variable will he set to its current value
plus the valuE of the SIEP expression saved by the FOR
command. The updated value is then compared with the value of
the TO expression also saved by the FOR command. If this is
within the limit, execution will jump back to the command
following the FOR command. If this is outside the limit,
execution continues following the NEXT command itself.

NEXT X

The STEP can be positive, negative or even zero. The word
STEP and the expression following it can be omitted if the
desired ST~P is +1.

The variable X is set to the value of the expression A+1. The
values of the expressions (not the expressions themselves) 3*B
and c-1 are remembered. The name of the variable X, the
statement number and the position of this command within the
statement are also remembered. Execution then continues the
normal way until a NEXT command is encountered.

FOR X=A+1 TO 3*B STEP C-1

FOR and NEXT Commands

GOSUB can be nested.
the stack space;

A PETURN command must be the last command in a statement and
followed hy a CR. When a RETURN command is encountered, it
will cause the execution to jump back to the command following
the most recent GOSUB command.

RETUFN

will cause the execution to jump to different statements as
computed from the value of the expression A*10+B.

GOSUI3 A*10+B

GO'IO

412?

where

412
does not exist

32767

" May,

1~76

*

TINY BASIC FOR INTEL aoav
VERSION leO
BY LI-CHEN WANG
10 JUNE, 1976
@COPYLEFT
ALL WRONGS RESERVED

LODI

'AN'

E

u

NZ
A.L

D

AoH

LD
A,( DEJ
CMPI ' '
RET
NZ
I NC
DE
.JMP SSl

LOD
CMP
RET
LOO
CMP
RET
CHAR

Page 15

IGNBLK
SUSI ' i l '
RET
C
.JMP
NZ,TVl
I NC
DE
CALL P.ARN
ADD
HL,HL
J MP
c.aHOW
PUSH DE
XCH
HL.DE
CALL SIZE
COMP
.IMP C ,ASORRY
l.001 tLoVARBGN
EF
D640
08
C2580C
13
CDFB04
29
DA9FOO
05
EB
CD3D05
E7
DAD005
2100 IF ilililil
00 39
00 3B
003C
CO 3F
0040
0043
0044
00 47
0048
0049
004C
00 40
0050

*
0038

POP
AF
CALL FIN
.JMP
OWHAT
CHAR 1 G 1
Fl
CD9105
C3A405
47

13
C328CO

co

lA
FE20

70
BB
C9
414E

7C
BA

co

*
0030
00 31
0034
00 37

00 28
0029
00 28
002C
00 2D



0021
00 22
i):l2::S
00 24
00 25
0026

*0 20
0

* 18
00

A
OC2

CALL EXPR2
PUSH HL
.JMP
EXPRl
CHAR • w•

A.ocsw

AF

A ,iilCR

XCH
HL,{ SP)
I GNBLK
CMP
M
.JMP
TCl

ORG
x•oooo•
DI

LOO[ SP, ST ACK
.JMP
STl
CHAR 'L'

CD5504
00 1 B ES
00 lC C31104
001F 57

SSl

CRLF

START

PUSH
LO
l OR
.JMP

@•••

F5
0011 3A0008
0014 B7
00 15 C31A07

• 10
00

OOOE 3EOD



*
0008 E3
0~09 EF
OOOA BE
0008 C36800

F3
310020
C3BA00
4C

5

***

7

***
C!NOT A VARIABLE
NOT " iii " ARRAY
IT IS THE " @ " ARRAY
il SHOULD BE FOLLOWED
BY (EXPR) AS ITS INDEX
IS INDEX TOO BIG?
WILL IT OVERWRITE
TEXT?
FIND SIZE OF FREE
AND CHECK THAT
IF SOo SAY " SORRY "
IF NOTo GET ADDRESS

*** TSTV OR RST
TEST VARIABLES

PRINT " WHAT? " IF WRONG

*** FINISH/RST 6 ***
CHECK END OF COMMAND

IN TEXT (WHERE DE- & gt; )
AND RETURN THE FIRST
NON-BLANK CHAR. IN A

*** IGNBLK/RST
IGNORE BLANKS

4 ***
DE
RETUPN CORRECT C AND
Z FLAGS
BUT OLD A IS LOST

*** COMP HL WITH
OR RST
COMPARE

OR RST 3 ***
AN EXPRESION
REST OF IT IS AT EXPRl

*** EXPR
EVALUATE

2 ***
ONLY
IF OCSW SWITCH IS ON
PEST OF THIS IS AT OC2

*** CRLF ***
*** OUTC OR RST
PRINT CHARACTER

TEST CHARACTER
REST OF THIS IS AT TCl

*** TSTC OR RST 1 ***
IGNORE BLANKS AND

GO TO THE MAIN SECTION

*** START/RESTART ***
INITIALIZE THE STACK

THE 8080 INSTRUCTION SET LETS YOU HAVE 8 ROUTINES IN LOW
MEMORY THAT MAY BE CALLED BY RST Ne N BEING 0 THROUGH 7.
THIS IS A ONE BYTE INSTRUCT ION AND HAS THE SAME POWER AS
THE THREE BYTE INSTRUCTION CALL LLHHe
TINY BASIC WILL
USE RST 0 AS START OR RESTART AND RST 1 THROUGH RST 7 FOR
THE SEVEN MOST FREQUENTLY USED SUBROUTINES.
TWO OTHER SUBR~UTINES (CRLF AND TSTNUM) ARE ALSO IN THIS
SECTION.
THEY CAN BE REACHED ONLY BY 3-BYTE CALLS •

0000
0001
0004
0007

*



*
*
*
*
*

*


*
**************************************************************
*
* *** ZERO PAGE SUBROUTINES ***




*

*
*
*

························································••****

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Verify the corrections by " LIST nnnn " and hit tbe Control-c
key while the line is being printed.

To delete a statement, type the statement number and a CR
only.

To correct a statement, you can retype the statement number
and the correct commands. Tiny Basic will replace the old
statement with the new one.

can delete the last character by the Rub-Out key or delete the
entirP. line by the Alt-Mode key. Tiny basic will echo a
back-slash for each Rub-Out. Echo for Alt-Mode consists of a
LF, a CR, and an up-a=row.

lf you notice an error in typing before you hit the CR, you

Error Corrections

(3)SORRY means it understands you and knows how to do it but
there is not enough memory to do it.

380

HOW?

where B*C is greater than

HOW? means it understands you but does not know hov to do it.

A=B+3, C=(3+4?, X=4

3i0 LET A=B*C?+2

HOW?

(21

WHAT?
260 LET

Example:

where PRINT is misstyped

WHAT? means it does not understand you.

WHAT?
210 P?TINT " ?HIS "

(11

There are only three error conditions in TINY BASIC. The
statPment with the error is printeJ out with a question mark
inserted at the point where the error is detected.

Error Report

To read back such a paper tape, type " NEW " , CR, and Control-o,
then turn on the paper tape reader. When the paper tape is
read, turn the reader off and type a Control-0 again.

To produce such a paper tape, type " LIST " without CR. Turn on
the paper tape punch and type a few Control-Shift-P's and then
a CR. When listing is finished, type more control-Shift-P's
and turn off the punch.

The Control-0 key on the input device can be used to turn the
output device ON and OFF. This is useful when you want to
read in a program punched on paper tape.

Control of Output Devicq

by the control-c key on the input device.

-------------·-·-·-··-·-·' "

0069

13

4E
0600
09
Cl
lB

cs

23
CA7300

FE3A

3EFO
A4
C29FOO
04

;::. 0082
GO 84
c. 00 65
0 0088

210000

0089 cs

*

• ***

***

OF @(EXPR) .ANO PUT IT
IN HL
C FLAG IS CLEARED
NOT @, IS IT A TO Z?
IF NOT RETURN C FLAG

XCH HLe(SP)
I GNBLK
CMP M
INC HL
..IMP z.TC2
PUSH BC
LOO C,M
LODI 8 ,o
ADO HLoBC
POP BC
DEC OE
.I NC
OE
INC HL
XCH
HL.(SP)
RET U

u

H,A

H

***

***

***

***

***

TSTC OR RST l
THIS IS AT LOCo 8
AND THEN JMP HERE
COMPARE THE BYTE THAT
FOLLOWS THE RST INSTo
WITH THE TEXT & lt; DE- & gt; & gt;
IF NOT =• ADD THE 2ND
BYTE THAT FOLLOWS THE
RST TO THE OLD PC
IoEot 00 A RELATIVE
JUMP IF NOT =
IF =• SKIP THOSE BYTES
ANO CONTINUE

IF A THROUGH Z
OE
HLoVARBGN COMPUTE ADDRESS OF
THAT VARIABLE
L
AND RETURN IT IN HL
L
L.A
WITH C FLAG CLEARED
A,o


c

27

u

SUBDE
DE

CHAR 'WHAT?' ellCR
CHAR 'SORRY• o@CR

WHAT

SORRY

0K • 1 @CR

CHAR

01(
1

***

. TSTNUM LODI HL,o
LOO B,H
TEST TSTNUM TEXT IS
IF THE
A NUMBER
I GNBLK
IF NOT, RETURN 0 IN
CMPI • O•
TNl
RET, C
B ANO HL
IF NUMBERS, CONVERT
CMPI X•3A•
TO BINARY IN HL ANO
RET
NC
SET B TO # OF DIGITS
L CO I A• X • FO '
IF H & gt; 255, THERE IS NO
AND H
ROOM FOR NEXT DIGIT
JMP NZt QHOW
B COUNTS # OF DIGITS
lNC
B
PUSH BC
LOO
ac .. Ha.....
HL•l·O*HL+(NE\tl DlGlT)
ADD HLoHL
WHERE 10* IS DONE BY
ADD HLoHL
SHIFT ,4ND ADO
ADD HL,BC
ADD HL, HL
LO
Ao (OE)
AND (DIGIT) IS FROM
STRIPPING THE ASCII
INC DE
ANDI X•OF•
CODE
ADO L
LOO LtA
LODI A.O
ADC H
LOO H,A
POP BC
LO
A,(OE)
00 THIS DIGIT AFTER
JMP NS,TNl
DIGIT. S SAYS OVERFLOW
PUSH DE
CHOW
ERROR: " HOW? "
LOOI DE.HOW
AHOW
JMP ERROR
HOW
CHAR 'HOW 1 • • & lCR

TC2

TCl

TSTC

TVI

CALL
POP
RET
CMPI
CMC
Fl ET
l NC
LOOI
ROT
ADO
LOO
LODI
AOC
LOO
RET

a & gt;

....,

(l)



_. *

~

MAIN
THIS IS THE MAIN LOOP THAT COLLECTS THE TINY BASIC· PROGRAM

s:: ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••


~

o

40o

w

) & gt;

n

~

e:

0
" II

-

~

s::

;:;


@•••

OOBE 09
oo er- 29
lA
00 91 13
0092 E60F
0(194 85
0095 6F
0096 3E00
0098 BC
0099 67
00 9A Cl
0'. & gt; 98 lA
009C F27COO
00 9F DS
OOAO 11 A600
OOA3 C3A805
OOA6 4B4F573F
OOAA OD
OOAB 4F4B
OOAD OD
OOAE 574841543F
OOB3 OD
00B4 534F525259
OOB9 OD

w 0090

~

DI 00 80 29

• 0.0 BC 29

iii' ()OBA 4440

~

g'

0 00 81 DO

08

EF
FE30

:;. 0077
CD 00 7A
:!. OD 78
S: 00 7C
2 " 007E
007F

44

23
E3
0076 C9

iii'*

~

~

... 0060
OCl6E
3 0070
'Cl 0071
c 00 72
;: 00 73
.. 0074
0 0075

o 00 6C

-

0

.,.· *
... *
*
!:; *
; 0068

0053
CD 00 56
-0057
a & gt; 00 58

CD6005
01
C9
FElB
005A 3F
0058 08
oosc 13
0050 2100\F
0060 07
c 0061 85
.. 00 62 6F
. 0063 3EOO
:;i 0065 SC
r:T 0066 67
r:T 0067 C9

" II

:

INITIALIZES THE
THEN IT PROMPTS
& gt; " AND READS A LINEo
IF THE LINE STARTS WITH A NON-ZERO
NUMBERo THIS NUMBER IS THE LINE NUMBER.
THE LINE NUMBER
(IN 16 BIT BINARY) AND THE REST OF THE LINE (INCLUDING CR)
IS STORED JN THE MEMORY.
IF A LINE WITH THE SAME LINE
NUMBER IS ALREDY THERE• IT IS REPLACED BY THE NEW ONE.
IF
THE REST OF THE LINE CONSISTS OF A CR ONLY, IT IS NOT STORED
ANO ANY EXISTING LINE WITH THE SAME LINE NUM8ER IS DELETED.

AFTER A LINE IS INSERTED, REPLACED, OR DELETED, THE PRCGRAM
LOOPS BACK ANO AS & lt; FOR ANOTHER LINE.
THIS LOOP WILL BE
TERMINATED WHEN IT READS A LINE WITH ZERO OR NO LINE
NUMBER; ANO CONTROL IS TRANSFERED TO " DIRECT " •

11

co

llABOO

C01406

Cl
CAF501
18
7C
12
16
70
12
C505
79
93
F5

BS

220308
3E3E
CDD60!5
DS
11371F
C077DO
EF
7C

220708

C03C06
21CBOO
220108
210000

97

0117 .SC

0103 6069
0105 221308
0108 Cl
0109 2Al 308
OlOC Ft
0100 ES
OlOE FE03
0110 CAOOOO
0113 85
0114 6F
0115 .3EOO

0100 CDB006

*

OOFC Cl
OOFO 2A 1308

05
C2080l
D5
OOF9 C03006

OOE9
OOEA
OOEB
00 EC
OOEE
OOEF
OOFO
00 Fl
OOF4
OOF5
OOF8

OOEB

OODF
OOEO
OOEl
00 E2
OOE3
OOE6
OOE7

oooc

00 09

0008

00 Ct
OOC4
OOC7
OOCA
OOCD
OQDO
0003
0005

00

OOBO

z111aa

ST4

ST3

ST2

BCoDE- & gt; BEGIN• ENO

BACKUP DE AND SAVE
VALUE OF L1NE # THERE

HL=VALUE OF THE # OR
0 IF NO # WAS FOUND
BC- & gt; ENO OF LINE

PROMPT • & gt; • AND
READ A LINE
DE- & gt; ENO OF LINE
DE- & gt; BEGINNING OF LINE
TEST IF IT IS A NU~BER

A=O
PRINT STRING UNTIL CR
LITERAL •)
CURRNT- & gt; LINE # = 0

AOC

H

A=N OF 8YTES IN LINE
FIND THIS LINE IN SAVE
AREA, DE- & gt; SAVE AREA
NZ:NOT FOUNOo INSERT
Z!FOUND. DELETE IT
FIND NEXT LINE
OE- & gt; NEXT LINE
POP BC
BC- & gt; LINE TO BE DELETED
HLoTXTUNF HL- & gt; UNFILLED SAVE AREA
LO
CALL MVUP
MOVE UP TO DELETE
TXTUNF- & gt; UNFILLEO AREA
LOO HL.BC
ST
HLoTXTUNF UPDATE
GET READY TO INSERT
POP BC
HL,TXTUNF BUT FIRST CHECK IF
LO
THE LENGTH OF NEW LINE
AF
POP
15 3 (LINE # AND CRl
PUSH HL
CMPl 3
THEN DO NOT INSERT
JMP ZtSTART
MUST CLEAR THE STACK
COMPUTE NEW TXTUNF
ADO L
LOO Lo A
LOOI A ,o

SUB A
CALL PRTST G
LOOI HL,ST2+1
ST
HL,CURRNT
LOOI HL.O
ST
HL,LOPVAR
ST
HL,STKGOS
LODI A.• & gt; •
CALL GETLN
PUSH DE
LODI OE,BUFFER
CALL TSTNUM
I GNBLK
LOO
A.H
IOR L
POP BC
JMP
z.oIRECT
DEC DE
LOO A.H
ST
Ao(OE)
DEC OE .
LOO
A,L
ST
A,(OE}
PUSH BC.OE
LOO
AoC
SUB E
PUSH AF
CALL FNOLN
PUSH OE
.JMP NZ,ST4
PUSH DE
CALL FNONXT

* (SEE NEXT SECTION), " CURRNT•• SHOULD POINT TO A Oo
*
*
START LODI SP, STACK THIS IS AT LOCo 0
ANO JUMP TO HERE
*
CALL CRLF
OOBA COOEOO·
ST 1
DE- & gt; STRING
LODI DE,OK

pqoGRA~

*
SAVE AREA
* LABELED " TXTBGN " AND ENDED AT STARTS AT THE MEMORY LOCATION
WE ALWAYS
* TINY BASIC AT " TXTBGN " • THE " TXTEND " • PORTION IS FILL THIS
* AREA STARTING
UNFILLED
POINTED
* BY THE CONTENT OF A MEMORY LOCATION LABELED " TXTUNF " •
* THE MEMORY LOCATION " CURRNT " POINTS TO THE LINE NUMBER
* THAT IS CURRENTLY BEING INTERPRETED. WHILE WE ARE IN
* THIS LOOP OR WHILE WE ARE INTERPRETING A DIRECT COMMAND
*

*
*
*
*
*
*
*

*
*
*
*
*

* AND STO~ES IT IN THE MEMORY.
* STACK AND SOME OTHER OUT " (CR)OK(CR} " • AND
* AT START. IT PRINTS INTERNAL VARIABLES.

;:::

II

ll001F
E7
D2CF05
221308
01
CDC6(;6
01 El
CD8006
C30300

67

a & gt; aaa

LOO
LODI
COMP
.IMP
ST
POP
CALL
POP
CALL
JMP
H1A
HL- & gt; NEW UNFILLED AREA
L.IE1TXTEND CHECK TO SEE IF THERE
IS ENOUGH SPACE
NC.QSORRY SORRY, NO ROOM FOR IT
HL1TXTUNF OK, UPDATE TXTUNF
DE
DE- & gt; OLO UNFILLED AREA
MVOOWN
DE1HL
OE- & gt; BEGIN1 HL- & gt; END
MVUP
MOVE NEW LINE TO SAVE
ST3
AREA

*
*

.



••A'•' IN THE STRING WILL TERMINATE THE TEST AND THE PARTIAL
E.G.• ·• p,•, 1 PRe 't
•·•PRI•'• •PRIN•'• OR 'PRINT• WILL ALL MATCH 'PRINT'•

AT·•eXEC•, DE SHOULD PdINT TO THE STRING AND HL SHOULD POINT
TO THE TABLE-la
AT '0IRECT 1 1 OE SHOULD POINT TO THE STRING,
HL WILL BE SET UP TO POINT TO TABl-lt WHICH IS THE TABLE OF
ALL DIRECT ANO STATEMENT COMMANDS•

*
*

~19B

012F
012F
0133
0135
0 l 38
0 l 3A
0130
Ol 3F
0 l 3F
0143
0145
0148
Cl 4A
0 l4C
014E.
0152
0154
0159
0 l 5B
0161
0163
0166
0 l 68
Ol 6B
016D
0 l 72
0174
0179
9-17B
Ol7F
0181
0183
018B
0193

*

.

TABl .

TABZ
4E455854
8349
4C4554
8407
4946
839A
474F544F'
8252
474F535542
8281
52455455524E
82Dl
524540
8396
464F52
82EA
494E505554
8361
5052494E54
8279
5.3S44F50
822F
8401
594F55204D415920
494E534552542020
404F524520 434F40
40414E44532E
TAB4
524E44
8506
414253
8531
S3495A45

4C495354
8261
52554E
8233
4E4557
8226
*

t

1

GOTO t .GOTO

IF' e IF

1

RETURN 1 .RETURN

ITEM

ITEM

1

SIZE 0 1SIZE

'ABS' eABS

*

FUNCTIONS
EOU
ITEM • RND 1 1RND

ITEM eDEFL T
CHAR •vou MAY INSERT

l 'fEM •·STI & gt; P 1 •STOP·

ITEM •PRINT 1 1PRINT.

I TEM ' FOR• •FOR
ITEM 1 INPUT 1 elNPUT

I TEM •REM• 1REM

ITEM

MORE COMMANDS. 1

DIRECT/STATEMENT

ITEM ·. •GO SUB• •GO SUB

ITEM

ITEM.

ITEM. •LET• eLET

EOU

l TEM. •NEXT• ,NEXT

ITEM 'NEW• .NEW

ITEM .• AUN. tRUN

EQU
DIRECT COMMANDS
I TEM · 1LI ST 1 •LIST

*

ENO OF TABLE IS AN ITEM WITH A .JUMP ADDRESS ONLYe
IF THE
STRING DOES NOT MATCH ANY OF THE OTHER ITEMS, IT WILL
MATCH THIS NULL ITEM AS DEFAULT.

OlAl
OlAl
~ 01A4
" " 01 A6
CD
01A9
_.
...., OlAB

~

0

" "

tO

) & gt;

2:
;::
n

" ti

0

:..

CD

s:

;:;
.

w

x

o

ell


~

:i

o

g_

:r

0
:l

20



:i

;

::

r+

*
....
:: *

THE TABLE CONSISTS OF ANY NUMBER OF ITEMSt
EACH ITEM
*-IS A STRING OF CHARACTERS WITH BIT 7 SET TO 0 ANO
!!: *.A JUMP AOOR!::SS STORED HI-LOW WITH BIT 7 OF THE HIGH
n
BYTE SET TO l •

~

3

O

n *·MATCH WILL BE CONSIDERED AS A MATCH,

0
~

!. •

c
;

0

111•

o



EXEC ***

c..

&

* THIS SECTION. OF THE CODE TESTS A STRING AGAINST A TABLE.
* WHEN A MATCH IS FOUND. CONTROL IS TRANSFERED TO THE SECTION
* OF CODE ACCORDING TO THE TABLE•

TABLES *** DIRECT ***

g:

c •
:' *. ***
*
c

*
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

& lt; 0118
0119
_. OllC
~ 0110
0) 0120
0123
0124
0127
0129
012C



OlFS

8530

l

" TO " IN " FOR "

*

111 1 1XP12

• & gt; 1 t XP 13

I

ITEM t XPl 7

ITEM ' & lt; 1 1 XP16

ITEM ' & lt; =• tXP14

ITEM •=•eXPl5

I TEM

ITEM

ITEM .FR3
EQU *
RELATION OPERATORS
I TEM ' & gt; = • ~ XP l 1

EOU

EXS

EX3
EX4

EX2

EXI

. EXEC
EXO

*

.JMP
INC
POP
.JMP
LOOI
INC
CMP
JMP
LOO
INC
LOO
ANDI
LOO
POP
JMP

CMP

M

NC1 EX 2
HL
DE
EXO.
AeX'7F'
HL
M
NC1EX4
AeM
HL
LoM
X'7F 1
H1A
AF
(HL)

EQU
IGNBLK
PUSH OE
LO
Ao(OE)
INC OE
CMPI t , t
JMP
Z1EX3
INC HL
CMP M
JMP z.Ex1
LOOI A1X'7F•
DEC OE
CMP M
JMP c.Exs
INC
HL

CLEAN UP THE GABAGE
AND WE GO 00 IT

MASK OFF BIT 7

LOAD HL WITH THE JUMP
ADDRESS FROM THE TABLE

BUMP TO NEXT TAB. ITEM
RESTORE STRING POINTER
TEST AGAINST NEXT ITEM
PARTIAL MATCH, FINO
JUMP ADDR •• WHICH IS
FLAGGED BY BIT 7

ELSE, SEE IF BIT 7
OF TABLE IS'SET1 WHICH
IS THE .JUMP ADDR• (HIJ
C!YES. MATCHED
NC!NO• FIND JUMP ADDRe

HL- & gt; TABLE
IF MATCH, TEST NEXT

*** EXEC ***
IGNORE LEADING BLANKS
SAVE POINTER
IF FOUND '•' IN STRING
BEFORE ANY MISMATCH
WE DECLARE A MATCH

FOR 'RUN•: GO EXECUTE THE FIRST STORED LINE IF ANY; ELSE



GO
'START'•
* FORBACK TO AND 'GOSUB•: GO EXECUTE THE TARGET LINE.
FOR •GOTO'
* FOR ALL OTHERS: IF •CURRNT• - & gt; 01 TO SAVED RETURN LINE.
•RETURN• ANO •NEXT•: GO BACK
*
GO TO 'START•, ELSE



* WHAT FOLLOWS IS THE CODE TO EXECUTE DIRECT AND STATEMENT
• COMMANDS. CONTROL IS TRANSFERED TO THESE
THE
• COMMAND TABLE LOOKUP CODE OF 'DIRECT' AND POINTS VIALAST
'EXEC' IN
• SECTION. AFTER THE COMMAND IS EXECUTED, CONTROL IS
* TRANSFERED TO OTHER SECTIONS AS FOLLOWS:

• FOR 'LIST•. 1 NEW'• AND 'STOP•: GO BACK TO 'START'



······•*******************************************************

01F8.EF
OlF9D5
OlFA lA
01FB 13
OlFC FE2E
01FE CAl702
0201 23
0202 BE
0203 CAFAOl
0206 3E7F
0208 lB
0209 BE
020A DA1E02
0200 23
020E BE
020F 020D02
0212 23
0213 01
0214 C3F801
0217 3E7F
0219 23
02lA BE
0218 021902
021E 7E
021F 23
0220 6E
0221 E67F
0223 67
0224 Fl
0225 E9

• FA
•TO•,

MORE FUNCTIONS•

ITEM eOWHAT
" STEP'' IN " FOR "
ITEM •STEP 1 1FR2

EQU
ITEM

ITEM eXP40
CHAR •YOU MAY INSERT

DIRECT LOOI HL.TABl-1 *** DIRECT ***

84EC
594F55204D415920
494E534552542020
404F524520 46554E
4354494F4E53 .
TABS
544F
S2FA
85A4
TAB6
53544550
8304
8308
TABB
3E30
8417
23
8410
3E
8423
30
8432
3C30
842A
3C
8438
643E

OlFS 212E0l

01 AF
01B1
01B3
OlBB
01C3
OlCB
0101
01Dl
01D3
0105
0107
0107
01 OB
0100
OIOF
OlDF
01E1
OlE3
01E4
OlE6
01E7
01E9
OlEA
01 EC
01EE
OlFO
OlFl
OlF3

" V

DI

*GO EXECUTE NEXT COMMANDe

.


(THIS IS DONE IN

FINISH•e)

0

...*

0

*
::' *
0 *
*
er *

*
*

*

*

~

*

.

.

RUNSML CALLiCHKIO·
*** RUNSML ***
LOOI HL.TAB2-1 FIND COMMAND IN TAB2
JMP
EXEC ANO EXECUTE IT



*** GOTO EXPR ***
SAVE FOR ERROR ROUTINE
MUST FIND A CR
FIND THE TARGET LINE
NO SUCH LINE #
CLEAR THE PUSH OE
GO DO IT

.

s:

DI



A (CRLF) ts GENERATED AFTER THE.ENTIRE LIST HAS BEEN

A BACK-ARROW .MEANS GENERATE A (CRl WITHOUT CLF)
.

.
.

... *
~
.,, *

-::-

COMMAND IS 'PRINT••••;• OR 'PRINT ,,,,(CR)•
WHERE '••••' IS A LIST OF EXPREStONS1 FORMATS• BACKARROWSo AND STRINGSe THESE ITEMS ARE SEPERATEO BY COMMAS,

• THE NUMBERISOF POUND SIGN FOLLOWED A EXPRESION IS IT CONTROLS
A
BY A NUMBER,
* A FORMAT
SPACES THE VALUE OF
GOING TO
* BE PRINTED• IT STAYS av ANOTHER FORMAT.
• COMMAND UNLESS CHANGED EFFECTIVE FOR THE RESTIF OF THE PRINT
NO FORMAT IS
•• SPECIFIED, 6 POSITIONS WILL.BE USED •
• A STRING IS QUOTED IN A PAIR OF SINGLE QUOTES OR A PAIR OF
• DOUBLE QUOTES.




*

~

N
U'I

• PRINT



*
*
*

ID

-v

* *** LIST *** & PAI NT *** .
DI
LIST HAS TWO FORMS:
~
1 LISTCCR)'
LISTS ALL SAVED
n .. •LIST f(CR)' START LIST AT LINES LINE f
THIS
& gt;
YOU CAN STOP THE LISTING BY CONTROL C KEV

.

*
**************************************************************

s •

CD
:I

PUSH DE
CALL ENDCHK
CALL FNOLN
JMP
NZoAHOW
POP AF
JMP RUNT SL

EXPR

GOTO,

0252 OF
0253 D5
)( 0254 COAOOS..
w 02S7 C01406
c; 02SD C2AOOO
02SA

Fl
S: 025E C34202

~
Ill
0

::i

02 49 CD3207
024C 213EO 1
:::!'. 024F C3F801

g-

0

#

*** RUNNXL ***
FIND WHATEVER LINE f
c:PASSEO TXTUNFo QUIT

HL,DE
*** RUNTSL ***
HL,CURRNT SET 1 CURRNT 1 - & gt; LINE
HLoDE
INC. oe.2
BUMP PASS LINE #

RUNTSL XCH
ST·
XCH

.. *
R " 0242

::i

*** STOPCCRJ ***

CALL.ENOCHK
*** PUN(CR) ***
LOOI OEeTXTBGN FIRST SAVED LINE

CALL ENOCHK
RSTART

EB
0 0243 220 l 08
.. 0246 EB
;. 0247 1313

RUN

STOP·

CALL ENDCHK
*** NEW (CR ) * **
LOOI HLoTXTBGN
ST
HLoTXTUNF

RUNNXL LODI HL.O,
CALL 'FNOLNP
JMP CoSTART

CDAOOS
1 I 1 50 8

022F CDAOOS
0232 C7

NEW

0239 210000'
023C C01C06
ii' 023F OAOOOO

~

TXTBGN 1

•GOTO EXPA(CA)t EVALUATES THE EXPRESSION, FIND THE TARGET
* LINE, AND JUMP TO 'RUNTSL' TO DO ITe

*
t & gt; 0 2 36
0233
::

~

~

'D

GOES BACK TO 'START'

1

THERE ARE 3 MORE ENTRIES IN 1 RUN 1 :
1 RUNNXL•
FINDS NEXT LINEo STORES ITS ADDRe ANO EXECUTES ITe
'RUNTSL' STORES THE ADDRESS OF THIS LINE AND EXECUTES ITe
•RUNSML• CONTINUES THE EXECUTION ON SAME LINEe

n 0226 CDAOOS
0
0229 211508
3 022C 221308

0

*

*
.
... .

~
c
;

STOP(CR1

1

NEW(CR)' SETS 'TXTUNF' TO POINT TO

•RUN(CR)' FINDS THE FIRST STORED LINE, STORE ITS ADDRESS CIN
'CURRNT' & gt; • ANO START EXECUTE IT.
NOTE THAT ONLV THOSE
COMMANDS IN TAB2 ARE LEGAL FOR STORED PROGRAM.

1

1

* *** NEW *** STOP *** RUN ( & FRIENDS) *** & GOTO ***

c: •

;

1

m **************************************************************

...

~

CD7700
CDAC05
CD1406
OAOOOO
CDAA06
~0.320-7·

{'H!79-

C09105
C3BD02
CDOEOO
F7
OF
CS
CD6E06
Cl
C39B02

06

COOEOO
C33902
CF
23
05
OF
40
C39B02
C048C & gt; 6
C3A802
CF
2C

06

CDOEOO
C34902
CF
OD

06

CIEO &
CF
38

CALL 1' STNU M
CALL ENOCHK
CALL FNDLN
JMP c. START
CALL. PRTLN
.C.,t.LL. C-HK{·G
CALL FNOLNP
JMP LSl

PR8

PR6

PR3

PRl

PRO

PR2

C.L
PR3
QTSTG
PRB
• , 1 .PR6
CALL FIN
JMP PRO
CALL CRLF
FINISH
EXPR
PUSH ec
CALL PRTNUM
POP ec
JMP PR3

EXPR
LOO
JMP
CALL
JMP
TSTC

CALL CRLF
JMP RUNNXL
TSTC '# 1 oPRl

CALL· CRLF
JMP RUNSML
TSTC i & gt; CRoPRO

.PRINT, LODI Co6
Ts·rc • ~ • .PR2

LSI

LI ST

MORE TO PRINT?

PRINT THE VALUE

EVALUATE THE EXPR

IN THE LI STe
LIST CONTINUES
LIST ENDS

YES, EVALUATE EXPRe
AND SAVE IT IN C
LOOK FOR MORE TO PRINT
OR IS IT A STRING?
IF NOT, MUST SE EXPRe
IF 11 o11 o GO FINO NEXT

ALSO GIVE CR-LF AND
GO TO NEXT LINE
ELSE IS IT FORMAT?

GIVE CR-LF AND
CONTINUE SAME LINE
IF NULL LIST (CR)

C = # OF SPACES
IF NULL LIST & 11;11

TEST IF THERE IS A •
IF NO II WE GE " T A 0
FIND THIS OR NEXT LINE
C!PASSED TXTUNF
PRINT THE LINE
s::rup IF Hl·T CGNTROL.-E:
FIND NEXT LINE
ANO LOOP BACK

O~

1

GOSUB EXPR (CR)' IS LIKE THE 'GOTO'

1

1

02Bl COF106
02B4 OF
0205 05
02B6 C01406
0269 C2AOOO
02BC 2A01G8
02BF es
02CO 2A0308
02C3 E5
02C4 210000
02C7 220708
02CA 39
02CB 220308
02CE. C34202
0201-COAOOS

*
*

1

1

1

CALL
EXPR
PUSH
CALL
JMP
LO
PUSH
LO
PUSH
LODI
ST
ADD
ST

PUSHA

T~E

1

OE

SAVE THE CURRENT " FOR "
PARAMETERS
AND TEXT POINTER
FNOLN
FIND THE TARGET LINE
NZoAHOW
NOT THERE. SAV " HOW? "
HLoCURRNT FOUND IT1 SAVE OLD
• CUR RNT. OLD 'STKGos·•
HL
HL,STKGOS
HL
AND LOAD NEW ONES
HLoO
HL1LOPVAR
HL,SP
HLoSTKGOS
THEN RUN THAT LINE
JMP
RUNTS1..
THERE MUST BE A CR
RETURN CALL. . ENDCHK·

1

GD SUB

U~DOS

• SAVED IN THE STACK. IF WE ARE IN THE MAIN ROUTINE• 'STKGOS
IS ZERO (THIS WAS DONE BY THE " MAIN " SECTION OF THE CODE)o
• BUT WE STILL SAVE IT AS A FLAG FOR NO FURTHER 'RETURN' So
• •RETURN{CR)•
'GOSUB'
* RETURN THE EXCUTIONEVERYTHING THAT AFTER DID. AND THUS
THE COMMAND
MOST RECENT
• NEVER HAD A GOSUB' TO IS IS THUS IT INDICATES THAT WE
•GOSUB•,
IF •STKGOS
ZEROo
*
AND
AN ERROR •



IN

EXCEPT
TEXT
• COMMANDt SAVE SOTHAT THE CURRENT CAN BEPOINTER, STACK POINTER
ARE
THAT EXECUTION
CONTINUED AFTER THE
• ETC. EVEN RECURSIVE)• THEORDER THAT MUST BE CAN BE NESTED
SUBROUTINE •RETURN•.
• THE STACK POINTER IS SAVED SAVE AREA •GOSUB OLD STKGOS IS
CANO
STACKED.
*
IN STKGOS•. THE

•GOSUB EXPR;•

*·*** GOSUB *** & RETURN***

*
*
*


···············································•**************

0279
027B
027C
0270
027E
0281
0284
0285
0286
0287
028A
0280
028E
028F
0290
0291
0292
029!5
0298
0298
029C
0290
029E
02AJ.
02A4
02A7
02A8
02A9
02AA
02AD
02AE

*

0273 C01C06
0276 C36A02

0264
0267
026A
.026D

*
0261

* PRINTED OR IF THE LIST IS A NULL LIST.
HOWEVER IF THE LIST
* ENDED WITH A COMMAo NO CCRLF) IS GENERATED.

!:

02E2 220108
02E5 01
02E6 CD0506
02E9 F7.

HLeSTKGOS
LOO
" •H
IOR L
JMP Z•OWHAT
LOO
SPoHL
POP
HL
ST
HL.STKGOS
POP
HL
ST · HL.CURRNT
POP
DE
CALL. POPA
FINISH

LO

AND THE OLD •CURRNT'
OLD TEXT POINTER
OLD " FOR " PARAMETERS
ANO we ARE BACK HOME

ANO THE OLD •STKGOS'

SO, WE SAY: " WHAT? "
ELSE1 RESTORE IT

OLD STACK POINTER
0 MEANS NOT EXIST

U)

_.

CD

~

-o

111

" "

~

U & gt;

~

~

.,

-o

0

:I

~

.o

-'

w

x

o

tD

f'

::!'.

:::i

g-

0

~

CF

C30803
210100
220908
2A0108
22000 8

C07E05
2B
220708
210001
C3F801
OF
220808
210601
C3F801

c

0320 C22303

0328 28
032C BA

0327 CA4403
032A 7E

OJ 26 86

0324 7E
0325 23

0321 39
0322 3E
0323 09

031E EB
031F 60
0320 68

0315 220F08
0318 OlOAOO
0318 2A0708

0314 EB

02ED
02FO
02Fl
02F4
02F7
02FA
02F8
02FE
0301
0304
0305
0308
0308
030E
0311

02EA COF106



*

FR7

FR3
FR4
FRS

FA2

FRI .

FDR

CMP

.JMP

LOO
DEC

CALL
CALL
DEC
ST
LODI
jMP
EXPR
ST
LODI
JMP
EXPA
JMP
LODI
ST
LO
ST
XCH
ST
LOOI
LO
XCH
LOO
LOO
ADD
SKIP
AOO
LOO
INC
I OR
JMP
0
NZ1FR7

HL

.t M
..

ZoFR8

M

AoM
HL

Ht., BC

SAME AS THIS ONE?

0 SAYS NO.MORE IN IT

EACH LEVEL JS 10 DEEP
GET THAT OLD 'LOPVAR'

SAVE THE OLD SAVE AREA
SET THE CONTROL VARe
HL IS ITS ADDRESS
SAVE THAT
USE 1 EXEC 1 TO LOOK
FOR THE WORD 1 T0'
EVALUATE THE LIMIT
HLoLOPLMT SAVE THAT
HLo T AB6-1 USE 'EXEC' TO LOOK
EKEC
FOR THE WORD 'STEP'
FOUND IT, GET STEP
FR4
NOT FOUND, SET TO l
HLol
HLoLOPINC SAVE THAT TOO
HLoCURRNT SAVE CURRENT LINE #
HL1LOPLN
AND TEXT POINTER
HLoDE
HLeLOPPT
ac.10
DIG INTO STACK TO
Hl.oLOPVAR FIND 'LOPVAR'
HLoOE
HeB
LoB
HL=O NOW
HLoSP
HERE IS THE STACK

PUSH A
SETVAL
HL
HL1LOPVAA
HL. TAB5-l
EKEC

EXPl=l•
floEoo WITH A STEP OF +l• & gt;
TBI WILL .FIND THE VARIABLE V.AR. AND SET ITS VALUE TO THE
CURRENT VALUE OF EXPle
IT ALSO EVALUATES EXPR2 AND EXPl
ANO $AVE ALL'THESE TOGETHER WITH T.HE TEXT POINTER ETCe IN
THE •Fo~· s .. VE AP.EA. WHICH CONSISTS OF 'LOPVAR•. •LOPINC•.
~
• LOPLMT•
• LOPLN'
·ANO
IF THERE IS
n • THING IN t THE SAVE o AREA • LOPPT' • INDICATED BY ALREADY SOME(THIS IS
A NON-ZERO
0

3 • •LOPVAR•)o THEN THE OLD SAVE AREA IS SAVED IN THE STACK
'ti

BEFORE THE NEW ONE OVERWRITES IT.
TBl WILL THEN DIG IN THE STACK AND FIND OUT IF THIS SAME
~
ID

VARIABLE WAS USED IN ANOTHER CURRENTLY ACTIVE 'FOR' LOOP.
IF THAT IS THE CASE, THEN THE OLD 'FOR' LOOP IS DEACTIVATED.
t & gt; • (PURGED FROM THE STACK •• )
::
: • •NEXT VAR' SERVES AS THE LOGICAL (NOT NECESSARILLY PHYSICAL)
:r
END OF THE 'FOR' LOOPe
THE CONTROL VARIABLE VAR. IS CHECKED
WITH THE •LOPVAR•e
IF THEV ARE NOT THE SAME, TBI DIGS IN
~
;;·
THE STACK TO FIND THE RIGHT CNE ANO PURGES ALL THOSE THAT
DID NOT MATCHe
EITHER WAYo TBI THEN ADOS THE •STEP' TO
" '
THAT VARIABLE AND CHECK THE RESULT WITH THE LIMIT.
IF IT
RO
0 • IS WITHIN THE LIMIT, CONTROL LOOPS BACK TO THE COMMAND
FCLLOWING THE 'FOR'•
IF OUTSIDE THE LIMIT, THE SAVE ARER
;.
IS PURGED AND EXECUTION CONTINUES.

.g •

.
.
.....
.
.
.. .
.
.
.
....

~

.......................•......................................

·g'· '* *** FOR *** & NEXT ***
er * •FOR• HAS TWO FORMS:
er *
.,.· " ' ·•FOR VAR=EXPl TO EXP2 STEP EXP1' ANO 'FOR VAR=EXPl TO EXP2 •
'THE. SECOND FORM MEANS THE SAME THING AS THE FIRST FORM WITH

c •

,OI

" " " 02DC F9
02 00 El
020E 220308
:o2E1 El

0207 7C
.. 0208 es
ID 0209 CAA405

~ 0204 2A0308

7E

ee

·

ANO CONTINUE

GET ADDRESS OF VARe
C oOWHAT .
NO VARl.e.BLEt " WHAT?•
YES, SAVE IT
HLoVARNXT
SAVE TEXT POINTER
OE
Hl.1DE
HLoLOPVAR GET VARo IN 'FOR'
A oH
0 SAYS NEVER HAO ONE
L
ZoAWHAT
SO WE ASK: " WHAT ? 11
ELSE WE CHECK THEM
Z1NX3
OKo THEY AGREE
NO, LET'S SEE
DE
POPA.
PURGE CURRENT LOOP
-t.-0
HL .. V-AAN~T ANO POP ONE LEVEL
JMP NXO
GO CHECK AGAIN
COME HERE WHEN AGREED
LOO EoM
.I NC
HL
LOO
O,M
OE=VALUE OF VARe
LO
HLoLOPINC
PUSH HL
ADD HLoOE
AOD ONE STEP
XCH HLoDE
LO
HLoLOPVAR PUT IT BACK
LOO
M1E
INC HL
LOO M,O
LO
HLoLOPLMT HL- & gt; LIMIT
AF
OLD HL
POP
I OR
A
JMP NSoNXl.
STEP & gt; 0
XCH HL, OE
STEP & lt; 0
CALL CKHLOE
COMPARE WITH LIMIT
POP OE
RESTORE TEXT POINTER
OUTS IDE LIMIT
JMP CoNX2
LO
HL.LOPLN WITHIN LIMIT, GO
ST
HL1CURRNT BACK TO THE SAVED
LO
HL1LOPPT 1 CURRNT 1 AND TEXT
XCH HL,OE
POINTER
FINI SH
PURGE THIS LOOP
CALL POPA
FI NISH

TSTV
JMP
ST
PUSH
XCH
LO
LOO.
IOR
JMP
COMP
JMP
POP
CALL

ANO PURGE 10. WORDS
IN THE STACK
JOB OONEo RESTORE DE

TRY TO MOVE SP

YESo FOUND ONE

THE OTHER H " LF7

*
*

&

( &

*

* •INPUT• COMMAND IS LIKE THE •PRINT' COMMAND, AND IS FOLLOWED
" ' BY A LIST OF ITEMS.
IF THE ITEM IS A STRING IN SINGLE OR
DOUBLE QUOTESt OR IS A BACK-ARROW, IT HAS THE SAME EFFECT AS
IN 'PRINT••
IF AN ITEM IS A VARIABLE, THIS VARIABLE NAME IS
* PRINTED OUT FOLLOWED BY A COLONo
THEN TBI WAITS FOR AN
EXPR. TO BE TYPED INe THE VARIABLE IS THEN SET TO THE
•-VALUE OF THIS EXPR.
IF THE VARIABLE IS PROCEDED av A STRING

ZE~O.

FOLL~WED


****REM*** IF*** INPUT***
LET
OEFLT) ***
• 'REM• CAN BE
* TBl TREATS IT LIKE AN BY ANYTHING FALSE CONDITION.BY TBio
ANO IS IGNORED
*
•IF' WITH A
• •IF• IS FOLLOWED BY AN·EXPRo AS A CONDITION ANO ONE OR MORE
• COMMANDS (INCLUDING CUTHER •tF•S) SEPERATEO BY SEMI-COLONS.
" ' NOTE THAT THE WORD •THEN' IS NOT USEOo TBI EVALUATES THE
* EXPR.
IF THE
• EXPRo IF IT IS NON-ZEP01 EXECUTION CONTINUES• IGNORED ANO
IS
THE COMMANDS THAT FOLLOWS ARE
*
• EXECUTION CONTINUES AT THE NEKT LINEo
*

NX2

NX I

Nx3

N & gt; CO

NEXT'

FR8

E

1'.M

NZoFR7
HLoOE ·
HLoO
HL1S9
LOO
BC1HL
LOOI HL,10
ADO HLoDE
CALL MVOOWN
LOO SP1HL
LO
HLoLOPPT
XCH HL,OE
FINISH

JMP
XCH
'LODI
AOD

CMP

LOO

***********************************************************~~·



038A 220108
0380 2AOF08
0390 EB
0391 F7
0392 CD0506
039S F7

0387 2AODOB

0380 CD7605
0383 01
0384 OA9203

037F EB

0378 87
037C F28003

037A Fl

GJ71 2A0708
0374 73
0375 23
0376 72
0377 2AOB08

036E ES
OJ6F 19
0370 EB

0365 C3S003
0368 Se
0369 23
036A 56
0368 2A0908

.0'562 2A0SG &

0358 CA6803
035E 01
035F CDOS06

035A E7

0352 2A0708
0355 7C
0356 BS
0357 CAA505

0349
034A

FF
DAA405
0;340 220S08
0350 OS
0351 EB

••

033C

033A 4440
210AOO
033F 19
0340 CDC606
0343 F9
0344 2AOF08
0347 EB
0348 F7

0339 39

0332 C22303
0335 EB
0336 210000

0330
0331

-:
.

• IF THE INPUT EXPRo IS INVALID, TBI WILL PRINT " WHAT? " •
* " HOW? " OR " SORRY " AND REPRINT THE PROMPT AND REDO THE INPUT.
THE EXECUTION WILL NOT TERMINATE UNLESS YOU TYPE CONTROL-Ce
THIS IS HANDLED IN 'lNPERR'•

*
*
*

• (AGAIN IN SINGLE OR DOUBLE QUOTES)o THE STRING WILL BE
* PRINTED FOLLOWED BY A COLON•
TBI THEN WAITS FOR INPUT EXPRe
* AND SET THE VARIABLE TO THE VALUE OF THE EXPRe

*

0390 C24902
03AO C03206
03A3 024202
03A6 C7

039A OF
0398 7C
039C BS

0)

co
.....

...

3:

& lt;

U1

N

co
.,.
c

~

n

~

,,
..
..

0

:I

s:
" '

0

c,.)

...

x

0

al

:I

...
;;;·

0

0
0.

::r

....

I & lt; "
0

:I

.;;·
.

iii'

" '
...
::r

n

c

El
220108

DI

01

0381
0381 05
0382 CD4a06
0385 C38F03
038a FF
0389 OAF903
03BC C3CF03
03BF 05
OJCO FF
03C1 DAA409
03C4 lA
03C5 4F
03C6 97
03C7 12
03Ca Dl
03C9 C03C06
OJCC 79
OJCD 18
OJCE 12
OJCF OS
0300 EB
0301 2A0108
0304 ES
0305 218103
OJOa 2201oa
030a 210000
03DE 39
OJOF 220S08
03E2 D5
OJEJ 3E3A
OJES CD0605
oJEa t137tF
03EB OF
03EC 000000
03EF 01
OJFO EB
03Fl 73
03F2 23
03F3 72
03F4 El
03F5 220108
03F8 01
03F9 Fl
03FA CF
03F8 2(

*

03AB
OJAC
03AF
0380

F9

... •
.. CJAA 2A0508
. 03A7

'ti

3

0

n

...

" '
0

:I

0

C "
C "

0

c

aaaa

IP4

IP3

IP2

INPUT

I Pl

A •• :

HLoDE
HL.CURRNT
HL
HL1 I Pl
HLoCURRNT
HLoO
HLeSP
HL1STKINP
OE

C.E

Ao (OE)
OE
PRTSTG
A.C
OE
A. (DE)

A

CoOWHAT
Ao (OE)
C1A

C.IP4
IP3
OE



OE
QTSTG
lP2

A NEGATIVE NUMBER
AS A FLAG
SAVE SP TOO

ALSO SAVE •CURRNT'

SAVE IN CASE OF ERROR

PRINT STRING AS PROMPT
RESTORE TEXT

*** INPUT ***
SAVE IN CASE OF ERROR
IS NEXT ITEM A STRING?
NO
YES. BUT FOLLOWED BY A
VARIABLE?
NO,
YESe
INPUT VARIABLE
SAVE FOR •PRTSTG'
MUST BE VARIABLE NOW
" WHAT? " IT IS NOT?
GET READY FOR 'PRTSTG•

AND OLD TEXT POINTER
REDO INPUT

*** INPERR ***
RESTORE OLD SP
AND OLD 1 CURRNT 1

N01 CONTINUE
YES1 SKIP REST OF LINE
AND RUN THE NE & gt; & lt; T LINE
IF NO NEXTo RE-START

*** IF ***
IS THE E & gt; & lt; PR.=O?

OLD HL
I
PRINT THIS TOO
GETLN
ANO GET A LINE
DEoBUFFER POINTS TO BUFFER
EVALUATE INPUT
CAN BE 1 CALL ENOCHK 1
3
POP
OE
01 & lt; 1 GET OLD HL
XCH HLoDE
LOO
MoE
SAVE VALUE IN VARe
INC HL
LOO Ill, oD
POP HL
GET OLD 'CURR NT•
ST
HLoCURRNT
POP OE
AND OLD TEXT POINTER
AF
POP
PURGE JUNK JN STACK
TSTC 1 •'o1P5
IS NEXT CH1 • • •?

EQU
PUSH
CALL
JMP
TSTV
JMP
JMP
PUSH
TSTV
JMP
LO
LOO
SUB
ST·
POP
CALL
LOO
DEC
ST
PUSH
XCH
LO
PUSH
LODI
ST
LODI
ADD
ST
PUSH
LODI
CALL
LODI
EXPR
NOP

HL.STKINP
SP1HL
HL
HLoCURRNT
DE
DE

E & gt; & lt; PR
LOO
AoH
IOR L
JMP NZoRUNSML
CALL FNDSKP
JMP NCoRUNTSL
RSTART ·

INPERA LO
LOO
POP
ST
POP
POP

IF

.. • 'LET' IS FOLLOWED BY A LIST OF ITEMS SEPERATED BY COMMAS •

c • EACH ITEM CONSISTS OF A VARIABLE• AN EQUAL SIGNo ANO AN EXPRe
TeI
THE EXPRe ANO SET THE VARlBLE TO
• TBI EVALUATES HANDLE 'LET• COMMAND WITHOUT THE THAT VALUE •
ALSO
WORD 'LET•.
• THIS WILL DONE BY •OEFLT••
IS
.... •
• 210000
REM
LODI HL.O
0396
*** REM ***
c
THIS IS LIKE 'IF 0'
SKIP
. 0399 3E

N
0

(Q

IPS


C30704
F7

(13

CD7E05
CF
2C
LT1

JMP LET
FINISH

CALL SETVAL
TSTC·'•'oLTl

LO
A• (DE)
CMPI GlCR
JMP
Z oLTl

JMP I Pl
FINISH

ITEM BY HEM
UNTIL FINISH

*** LET ** " '
SET VALUE TO VAR.

" '** OEFLT ***
EMPTY LINE IS OK
ELSE IT IS 'LET'

YES, MORE ITEMSo

& gt; C • • •,)

210EOI
0414 C3F801
0417 CD4004
041A 08
041B 6F
041C C9
0410 CD4004
0420 .ca
0421 6F
0422 C9
0423 CD4004
0426 ca
.()42·7--Da
0428 6F
0429 C9
042A CD4004
0420 6F
042E ca
042F oe
0430 6C
0431 C9
0432 C04004
0435 co.·
0436 6F
0437 C9
0438 C04004
0438 DO
043C 6F
0430 C9
04 JE El
043F C9
0440 79
0441 E1C1
0443 ESCS
0445 4F
0446 CD5504
0449 EB
044A E3
044B CD760!5
044E 01
044F 210000
0452 3E0l'


0411

XP18

XP17

XP16

XPIS

XPl4

XP13

XP12

XPll

EXPRI

LODI HL• TAB8- l
JMP EXEC
CALL· XP18
RET · C
LOO LoA
RET U
CALL XP18
RET
Z
LOO L ,A
RET U
CALL XP18
RET Z
·RET
& lt; :
LOO LoA
RET U
CALL: XP18
LOO L •A
RET Z
RET C
LOO
L1H
RET U
CALL XP18
RET NZ
LOO L•A
RET
U
CALL )(Pl8
RET
NC
LOO L•A
RET U
POP HL
RET U
LOO A•C
POP HL1BC
PUSH HLoBC
LOO C1A
CALL EXPR2
XCH HL.DE
XCH HLo CSP)
CALL CKHLDE
POP OE
LOOI HLtO
LOOI A •I

1

GET 2ND & lt; EXPR2 & gt;
VALUE IN DE NOW
tST & lt; EXPR2 & gt; IN HL
COMPARE 1ST WITH 2NO
RESTORE TEXT POINTER
SET HL=O• A•l

NOT RELeOPe
RETURN HL= & lt; EXPR2 & gt;
SUBROUTINE FOR ALL
RELeOPo•S
REVERSE TOP OF STACI & lt;

RELoOP, " & lt; "
F " LS Ee RETURN HL=O
ELSE SET HL=t

REL.OP. " = "
FALSE, RETRUN HL=O
ELSE SET HL=l

ELSE SET HL=O

REL, OP• " & lt; " ' "
SET HL=l
RELo TRUEo RETURN

REL• OP ... & gt; "
FALSE
ALSO FALSE• HL-0
TRUEo HL=l

REL, OP• " N "
FALSE. RETURN HL=O
TRUEo RETURN HL=l

LOOKUP REL•OP•
GO DO IT
REL. OP. tt & gt; = "
NOo RETURN HL=O
YESo RETURN HL=l

& 1•


• & lt; EXPR4 & gt; ::= & lt; VARIABLE & gt;
& lt; FUNCTION & gt;

C & lt; EXPR & gt; J
• & lt; EXPR & gt; IS RECURSIVE SO THAT V " .RIABLE CAN HAVE AN & lt; E & gt; & lt; PR & gt;
• AS INDE & gt; & lt; • FUNCTIONS CAN HAVE AN & lt; E & gt; & lt; PR & gt; AS ARGUMENTS, AND

PARANTHESE.
* & lt; EXPR4 & gt; CAN BE AN & lt; EXPR & gt; IN EXPR2

CALL
THIS IS AT LOCo 18
E & gt; & lt; PR

PUSH HL
SAVE & lt; EXPR2 & gt; VALUE

1

:= & lt; EXPR2 & gt;
• & lt; EXPR & gt; : & lt; RELoOP• & gt; IS ONE OF THE OPERATORS IN TABB ANO THE
• WHERE & lt; E & gt; & lt; PR2 & gt; & lt; RELe0Pe & gt; & lt; EXPR2 & gt;
• RESULT OF THESE OPERATIONS IS IF TRUE AND 0 IF FALSE •
• & lt; EXPR2 & gt; ::=(+ OR -l & lt; EXPR3 & gt; C+ OR - & lt; E & gt; & lt; PRJ & gt; & gt; f••••)

ANO & lt; •••• & gt;
* WHERE Ct ARE OPTIONAL OR /XE XPR4 & gt; ARE OPTIONAL REPEATS •
& lt; E & gt; & lt; PR3 & gt; ::= & lt; EXPR4 & gt; l & lt; *

*

•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
* *** EXPR ***

• •E & gt; & lt; PR• EVALUATES ARITHMETICAL OR LOGICAL EXPRESSIONS•

0407
040A
040B
040C
0400
0410
LET

*
0401
lA
0402 FEOO
0404 CA1004

OEFLT

03FC ()3
(i3FD C3B103
0400 F7

0~72

:;.

N

.,
"

...

U'I

N

o

~

) & gt;

(')

.,
~

_,

9

:I

" '

$

?

w
-'

& gt; & lt;

o

~
OJ

:-.

g

a.

o

C2B004
C3DB04
CF
2F
44
ES
COE604
0600
C06705
EB
E3
CD6705
7A
83
CAAOOO
C5
CD4A05
.6069

30

04 85
0488
0486
04BC
0480
04BE
04BF
04C2
04C4
04C7
04C8
04C9
04CC
04CD
04CE
0401
0402
0405

0484

049A

0498
0499

0495

Oo\90
()4-.'.'E
0_49104A2.
04;A:3
()4A4
04A5
04AB
0_4A9
04AC
\i4AO
0480
0481

FA6404
AC
F26404
C39FCO
CF
20
83
E5
C08904
C06A05
C36B04

01

210000
C37F04
CF
28
00
C08904
CF
28
15
E5
C08904
EB
EJ
7C
AA
7A
19

06

CF
20

COE604
CF
2A
2C
ES
CDE604
C.600
CD670 5
EB
E3
C0670S
7C
87'
CAAB04
7A
82
EB
C2AOOO
70
210000
87
CAD804
19
DAAOOO

*

.... 0475
n 0476
o 04 79
3 047C
" O
0470
~ 047E
~
047F
n 0480
., 0483
::: 0486
::i
; 0489
:l
048C
" 0480
" ' 048E
!20 04BF
O 0490
... 0493

0

... 0455
CD 0456
.... 0457
en 0458
0458
045E
045F
0460
0461
0464
c 0465
:' 0466
c 0467
o 0468
CT 0468
C:: 046C
' " 0460
ls° 046E
c 046F
; C\470
~ 0471

*

3:
~ 0454 C9

XP34

& gt; & lt; P33

XP32

X?Jl

EXPR3

XP26

XP25

XP24
0

AoD

D

LOO
I OR
NZoAHOW

HLoOE

CHKSGN
HLoOE
HLoC SP)
CHKSGN

s.o

Z oAHOW
BC
DIVIDE
HLoBC

E

LOO

IOR
JMP
PUSH
CALL
LOO

AoD

CALL
XCH
XCH
CALL

LOOi

PUSH HL
CALL EXPR4

LOO

AoL
LODI HLoO
IOR
A
JMP
ZoXP35
ADO
HLoDE
JMP
CoAHOW
DEC
A
JMP
NZoXP33
JMP
XP35
TSTC '/'oXP42

XCH
JMP

Z • XP3 2

SAY " HOW? "
ELSE SAVE SIGN
USE SUBROUTINE
RESULT IN HL NOW

YES, SAVE tST & lt; EXPR4 & gt;
AND GET 2ND ONE
CLEAR 8 FOR SIGN
CHECK SIGN OF 2NO
PUT 2ND IN OE
GET tST IN HL
CHECK SIGN OF 1ST
DIVIDE BY 07

FINISHED
DIVIDE?

OVERFLOW

PUT SMALLER IN HL
ALSO & gt; • ~ILL OVERFLOW
THIS IS DUMB
CLEAR RESULT
ADD AND COUNT

HOW ABOUT DE

A

I OR

NO
YESo

Cl-IKSGN
HLoDE
HL1(SP)
CHKSGN
AoH

JM?

YESo SAVE lST
AND GET 2NO & lt; EXPR4 & gt;
CLEAR B FOR SI.GN
CHECK SIGN
2ND IN OE NOW
lST IN HL
CHECK SIGN OF lST
IS HL & gt; 255 7

a.o

HL

EXPR4

PUSH
CALL
LODI
CALL
XCH
XCH
CALL
LOO

YES, SAVE lST & lt; EXPRJ & gt;
GET 2NO & lt; EXPR3 & gt;
NEGATE
.
AND ADD THEM
GET lST & lt; EXPR4 & gt;
MULTIPLY?

HL
EXPR3
CHGSGN
XP24

OVERFLOW

POINTER
DIFFER
EQUAL

CALL EXPR4
TSTC '*'oXP34

PUSH
CALL
CALL
JMP

JMP

l':SoXP23
QHOW
TSTC •-•,XP42

H

AoD
HLoDE
OE
S 1XP23
RESTORE TEXT
lST 2ND SIGN
1ST 2ND SIGN
SO IS RESULT
ELSE WE HAVE
SUBTRACT?

YES1 SAVE VALUE
GET 2ND & lt; EXPRJ & gt;
2ND I " l DE
1ST IN HL
COMPARE SIGN

PUSH
CALL
XCH
XCH
LOO
XOR
LOO
ADD
POP
JMP
XOR
JMP

XP22
XP23

HL
EXPR3
HLtDE
HL1(SP)
A,H

lST & lt; EXPR3 & gt;
ADD?

CALL EXPR3
TSTC 1 + 1 oXP25

XP21

NAGATIVE SIGN?
YESo FAKE '0- 1
TREAT LIKE SUBTRACT
POSITIVE SIGN? IGNORE

TSTC •- 1 oXP21

U

LOOI - HLoO
JMP
XP26
TSTC •+• • XP22

EXPR2

RO

Cl
01
7C
87
FA9FOO
78
87
FC6A05
C38C04

*
es

CDFB04
7C
87
FA9FOO

COFB04
C06705
7C
84
FA9FOO
C9
2Al308
05
EB
21001F @aa@
CD6005

POP
LOO
I OR
JMP
LOO
I OR
CALL
JMP

POP

RET

oXP43

L

*** RND(EXPR) ***
EXPR MUST SE +

ELSE SAY: " WHAT? "

" tEXPR) "

u

I OR
JMP

u

u

*** SIZE ***
GET THE NUMBER OF FREE
BYTES BETWEEN 'TXTUNF'
AND •VARBGN'

*** ABS(EXPR1 ***
CHECK SIGN
NOTE THAT -32768
CANNOT CHANGE SIGN
SO SAY: " HOW? "

*
*

*

&

Cl'::HL.DE ***

1

SUBOE• ·sUBTRACTS OE. FROM HL

•01v1oe• DIVIDES HL BY DE. RESULT IN BC. REMAINDER IN H..

* *** DIVIDE *** SUBOE *** CHKSGN *** CHGSGN ***

*

*
*************•***************•********************************

RET

0549 C9

0€·

HL.TXTUNF
LO
PUSH OE
XCH HLoDE
LOOI HLtVAR8GN
CALL suaoE·

RET

H
S oOHOW

CALL PARN
CALL CHKSGN
LOO
AoH

RET

CoRAl
WRAP AROUND IF LAST
LODI HL,START
LOO EoM
HL
I NC
LOO
D1M
ST
HLoRANPNT
POP
HL
XCH
HL9DE
PUSH SC
RND(N)=MOO(M,N)+t
CALL DIVIDE
POP
ec.oE
INC
HL

COMP
JMP

AND NON-ZERO
JMP
PUSH DE,HL
SAVE BOTH
HLoRANPNT GET MEMORY AS RANDOM
LO
LOOI DEoLSTROM NUMBER

JMP
I OR

s.aHow
z.aHOW

QWHAT

u

')t

CALL PARN
LOO
AoH
I OR
A

JMP

--P-OP·

St ZE

ABS

RAl

RNO

XP42
XP43

EXPR
TSTC

OK
NO OIGITo MUST BE

OR IS IT A NUMBER
II OF D IGit

VALUE IN HL

FINO FUNCTION IN TAB4
AND GO DO IT
.
NOo NOT A FUNCTION
NOR A VARIABLE
VARIABLE

CHANGE SIGN IF NEEDED
LOOK FOR MORE TERMS

S,CHGSGN
XP31

A

ELSE IT IS OVERFLOW

GET SIGN BACK
ANO TEXT POINTER
HL MUST BE +

SoOHOW
AtB

A

ec

DE
AtH

EXPR4 · LODI HL,TAB4-l
JMP
EXEC
TSTV
JMP
C1XP41
LOO A,M
INC HL
LOO
HtM
LOO LeA
RET
u
XP4l
CALL TSTNUM
LOO
AoB
lOR
A
RET NZ
PARN
TSTC •(•,XP43
XP40

XP35

-C5 4-8-·-IH-

0531
0534
0537
0538
0539
053C
0530
0540
0541
0542
0545

*

CA9FOO
05E5
2Al 108
11FF07
E7
OA2105
210000
SE
23
56
221108
0527 El
0528 EB
0529 cs
052A CD4A05
0520 ClDl
052F 23
0530 C9

0506
0509
050A
050B
050E
OSOF
0512
0514
0517
051A
051B
051E
0521
0522
0523
0524

CF
28
05
OF
CF
29
01
C9
C3A405

co

04E6
04E9
04EC
04EO
04FO
04Fl
04F2
04F3
04F4
04F5
04F8
04F9
04FA
04FB
C4FC
04FD
04FE
04FF
0500
0501
0502
0503

*
21 AOOl
C3F801
FF
DAF504
7E
23
66
6F
C9
CD7700
78
87

0407
0408
0409
04DA
0408
040E
04DF
04EO
04E3

o~

~'.

ti')

.....

w

' & lt;

.s:

(J'1

N

0

.!»

l & gt;
w

( " )

';;'

'...
"

" ll

0

::I

" '

s:

0

-'

w

)(

0

" '
o;

....

:J

0

a.

.0

:r

....
...

0

" '
go

n

::i

" '

" '
...
" '
:r

( " )

~

c
....

't:i

3

( " )
0

0

...,

....
0
c:
...
::i
' "

.,,·

0
C "
C "

c
...
c

l\~

~ h~~

i ' " .

~~

ES

CD6005
025705

oc

67
OEFF

El

70

41

70

SUB DE

DV2

OV1

c

u

SU BOE
NCoDV2
HL.DE

c

c.-1

A,L
HL
H.A

f:!,

DVl

11~0

L,H

CHGSGN LOO

7C

C9

41'

23

78
EE80

on

XOR
..I MP
XCH
COMP
RET

Ci & lt; Hl..OE LOO

RET

LOO

LOO
X ORI

i NC

LOO

u

HLoDE

NS,CK i

AoH
D

u

B•A

)( • 80 •

L•A
HL
A,S

9

CMA

0

A.L

~.A

LOO
LOO

CMA

A•H

SAME SIGN?
YES, COMPARE
NO• XCH AND COMP

AND ALSO FLIP 19

& gt; l & lt; & gt; lr & gt; l & lt;

CHGSGN J!llj & lt; $
CHANGE SIGN OF HL

IF -• CHANGE SIGN

" ENDCHK " CHECKS IF A COMMAND IS ENDED WITH CRo
THIS IS
REOU! RED XN CERTAIN COMMANDS• {GOTO• RETURNo AND STOP ETC, I

•FIN " CHECKS THE END OF A COMMAND.
IF IT ENDED W(TH u;n,
EXECUTION CONTINUES.
IF IT ENDED WITH A CR, IT FINDS THE
NEXT LINE AND CONTINUE FROM THEREe

*

• " ERFlOR " PRINTS THE STRING PO !NTED ev DE (AND ENOS \ti ITH CR).
*IT THEN PRINTS THE LINE POINTED BY •CURRNT' WITH A~? "
$
INSERTED AT ~HERE THE OLD TEXT POINTER (SHOULD BE ON TOP
OF THE STACK) POINTS TO.
EXECUTION OF TB IS STOPPED
& gt; I & lt; AND TBI XS RESTARTEDs
HOWEVER. IF 9 CURRNT' - & gt; ZERO
* (IN01CATING A DIRECT COMMAND & gt; o THE DIRECT COMMAND IS NOT
iii PR!NTEOe
AND U " • CURRNT• - & gt; NEGATIVE II «INDICATING •XNPUT'

" '

*


*
*
*

" '
****** " '******* " '************** " '********************************
* *** SETVAL *** FIN *** ENDCHX *** & ERROR ( & FRIENDS) ***
ll & lt;
• THEN AN EXP~. XT AEVALUATES THE EXPRo ANO AN EQUAL SIGN AND
* " SET\/AL~ EXPECTS VARIABLE. FOLLOWED SV SET THE VARIABLE
*
* TO THAT VALUEe

057C E7
0570 C9

0578 EB

0576 7C
0577 AA
0578 F21'C05

*

0570
0571
0572
0574
0575

056B 2F
056C 67
0560 7D
056E 2F
056F 6F

FO

NS

IOR

87

" '
0568
0569

056A
A

A.H

CHKSGN LOO

0567 7C

RET

H.A
u

*** CHKSGN ***
CHECK SIGN OF HL

A•H
D

HL

LoA

LOO

LOO

:..:

AoL

sue

LCD

0564 9A
0565 67

0566 C9

RESULT IN C
DUMB ROUTINE
DIVIDE BY SUBTRACT
AND COUNT

SAVE RESULT IN B
{REMAINOER+L)/DE

*** DIVIDE ***
DIVIDE H BY OE

-o

*** SUBOEDE FROM
SUBTRACT ***

LOO
LODI
CALL
LOO
LOO
POP
LOO
LOO!
INC
CALL
JMP
ADO
RET

DI YXDE PUSH HL

TO

SBB
LOO
RET

93
0562 6F
0563 7C

0561

*
0560

055E HI
055F C9

0551
0552
0553
0554
0555
0557
0558
0556

054B 6C
054C 2600
054E C05505

*
*
054A

$

1-l..e

• •cHKSGN° CHECKS SIGN OF
iF +, NO CHANGEo .IF
CHANGE

* SIGN AND FLIP SIGN OF Bo
•· •CHGSGN• CHNGES SIGN·OF HI.. AND 8 UNCONDITIONALLY.
" ' •CKHLOE• CHECKS SIGN OF HL AND OEo lF DIFFERENT• HL AND OE
*
IF SAME SIGN.
INTERCHANGED.
EITHER
• ARE lNTERCHANGEOoTHEN COMPARED NOT THE FLAGS@
CASEo HL OE ARE
SET

0592 38

18

• ; 0

AlllHAT

POP
.JMP
RET

AF

RUNNXI.
u

OUTC

POP
ST
LODI

DEC

I NC
IOR
POP
JMP
LOO
XOR
JMP
CALL

LOO

PUSH
LODI
SUB
CALL
POP
LD
PUSH
SUB
ST
LO
PUSH

***

REDO INPUT
ELSE PRINT THE LINE
UPTO WHERE THE 0 IS
RESTORE THE CHARACTER

XF ZERO• JUST RESTART
IF NEGATIVE,

***

***
***

AND THE REST OF THE
LINE
THEN RESTART
OSORRY
ASORRV

***
i & lt; **

fJ • (DE)
" •• 1.

H?tia!

PRINT A

S •I NP ERR
PRTLN
DE
AF

A

A.M

CE
Z .START

M

~

•HOW?•
OR •SORRY•
SAVE THE CHARACTER
AT WHERE OLD DE - & gt;
ANO PUT A 0 THERE

& gt; 1 & lt; $$

*** AWHAT ***
QWHAT
***
*** ERROR ***
PRINT •wHAT?•o

*** ENDCHK ***
END WITH CR?
OK, ELSE SAY: " WHAT? ..

YES. PURGE RETo ADORo
RUN NEXT LINE
ELSE RETURN TO CALLER

~l " •
PURGE RETo AOORo
CONTINUE SAME LINE
NOT «;tt. IS IT CR?

*** FIN

NO " = " SIGN

EVALUATE EXPR5
VALUE IN BC NOW
jET ADDRESS
SAVE VALUE

HL.CURRNT GET CURRENT LINE
HL
Ao 111
CHECK THE VALUE
HL

11. (DE)
AF
A
Ao(DE)

PRTSTG
CE

A

OE
OEo\!IHAT

SUB A
CALL PRTSTG
RSTART
OSORRV PUSH DE
AS OR RV LODI DE.SORRY
ERROR
JMP

ERROR

OWHAT

.Fli

QWHAT

ENOCH! & lt; I GN8LK
CMPX ilCR
RET
Z

FU

HI..
MeB

u

POP
AF
JMP RUNSMI..
TSTC @CR,Fl2

TSTC

..IMP

LOO
RET

l NC

EXPR
LOO ec.HL
POP
HL
LOO
P.l.C

***

SETVAL ***
" WHAT? " NO VARIABLE
SAVE ADDRESS OF VAR.
PASS " = 00 SIGN

*

FNDLN ( & FRIENDS)
A INPUT LINE INTO •BVFFER'•
IT FIRST PROMPT
THE CHARACTER IN A (GIVEN ev THE CALLER). THEN xr FILLS THE

* *** GETLN ***
*
& gt; I & lt; 'GETLN' READS

***************************************~*********************
!lo
.

" '

0503 C3A805

05DO 116400

OSCF 05

05C9 D7
05CA 97
05C8 C03C06
05CE C7

05C5 Fl
05C6 12
05C7 3E3F

05C4

0580 87
05BE FAA703
05C1 COAA06

OSBC 7E

05B7 86
05ae 01
0589 CAOOOO

0585 7E
05B6 23

05F.H 2AO 10 8
0584 E5

05A\E F5
05AF 97
0560 12

OSAC Di
OSAO lA

05A5 1 l AEOO
05AB 97
05A9 CD3C06

05A4 D5

*

EF
05Al FEOO
05A3 ca
05AO

*

059C C33902
059F C9

0593 04
0594 Fl
0595 C34902
0598 CF
0599 OD
C59A 04
0598 Fl

FU

0591 CF

*
FllN

0580 C9
058E C3A405

058C 70

0588 23

058A 71

SV!

El

0584 30
08
OF
4440

0585
0586
0587
0589

SETVAL TSTV
JMP c.awHAT
PUSH HL
T STC • =• oS Ill

PELATED TO •ERROR• ARE THE FOLLOWING:
•a~~AT• SAVES TEXT POINTER IN STACK ANO GET MESSAGE " WHAT?~
•AWHAT• JUST•GET MESSAGE " WHAT? " AND JUMP TO 'ERROR'•
'OSDR~V•
AND 8 ASORRV• 00 SAME KIND OF THING.
•aHOw• AND •AHow• IN THE ZERO PAGE SECTION ALSO DO THIS

057E FF
057F DAA405
0582 E5
0583 CF

*
*
*

" '
*
*

$
COMMAND, THE 1NPUT LINE !S NOT PRINTED ANO EXECUTION IS
*NOT TERMINATED BUT CONTINUED AT " INPERA'o

s::··




" '

05FS

ca

05F4 12
05F5 13
05F6 FEOD

05F! CAOC06

g

0605 16
0606 3E5C

*
061C

0624 !.A
0625 95
0626 47

1'-1

w

N

~

DA3106

062E BO
0621 " C9

0620 l8

062A

0629 9C

0630 13
0631 13

' " 0630
*

-c

(11

0627 13
0628 lA

0623 08

~

0621
0622 El

~
,,.

w

28

ET

0620

" ;f 06 lC ES
~ 0610 2Al3C &

o

" " 0615 87
::. 0616 IFA9FOO.
~ 0619 111508

7C

;;;· 0606 07
~ 0609 C3DA05
060C CDOEOO'
0
x 060F 3E5E
w 06U C30605

....

CAOCOE!.

05FF 76
0600 FE37

05FC C2DA05

c. 0602

0

;

.,

f & lt; O 05F9

78
O 05FA FE7F

::r
~
;;·
" '

~

~ 05EC CAFF05
:: OSEF FE70

c C5E6 67
(; 05E7 CADA & lt; i5
" ' 05EA FE7F

l_c; ~614

l

07

GETLN

LOO
IOR
JMP
LODI

f'L2

INC:

FNONXT EOO
X NC

*** GETLN * " '*
PROMPT AND INIT.

GU

*

OE
OE

u

e

C.Ft.2
DE

A.( DE)
H

DE

.L
8oA

A• (OE)

c

HL

*** FNONXT ***
FIND NEXT LKNE
JUST PASSED BYTE i & 2

GET BYTE 2
COMPARE HIGH ORDER
NO, NOT THERE YET
ELSE WE EITHER FOUND
ITo OR !T IS NOT THERE
Nc.z:FOUNO; NC.NZ:NO

GET LINE Ill BACK
C ,NZ PASSED END
WE DID NOT •. GET BVTE 1
IS THIS THE LINE?
COMPARE LOW ORDER

*
*** FNOLNP ~ ***
HL
SAVE LINE
HLeTXTUNF CHECK IF WE PASSED END
HL

*** FNOLN ***
CHECK SIGN OF

HL
s.aHO~
IT CANNOT BE DE.TXTBGN lNITo TEXT POINTER

A.H
A

GO GET NEXT INPUT
REDO ENTIRE L !Ne
CRe LF AND UP-ARROW

DEoBUFFER
CHECK KEYBOARD
CHKIO
:Z .GL l
NO INPUT• WAIT
INPUT, ECHO BACK
@LF
IGNORE LF
z.GL1
A
IGNORc NULL
ZeGL1
@DLCH
DELETE LAST CHARACTER?
Z.GL3
VES
iilOLLN
DELETE THE WHOLE LINE?
ZoGL4
YES
A.( DE)
ELSE• SAVE INPUT
DE
AND BUMP POINTER
@CR
WAS IT CR?
z
YES, ENO OF LINE
AoE
ELSE. MOPE FREE ROOM?
€UFENDo & gt;
NZo GL 1
YESe GET NEXT INPUT
A.E
DELETE LAST CHARACTER
eUFFERe: & gt; BUT DO WE HAVE ANY?
z.GL4
NO. REDO WHOLE LINE
OE
YES. SACKUP POINTER
A .@BKS
AND ECHO A BACK-SLASH

CALL CRLF
LOOI A~@UPA
J MP
GETLN

JMP

OUTC

LODI

DEC

JMP

CMPJ

LOO

RET
LOO
CMPI
.I MP

KNC
CMP!

.JMP
CMPX
JM?
ST

CMPI

!OR
.JMP

JMP

OUTC:
LODI
CALL
.JMP
OUTC
C:MPl

FNOLNP EOU
PUSH
LO
DEC
COMP
POP
RET
LO
SUB
LOO
XNC
LO
SBB
JMP
DEC
Y OR
RET

FU,

f'NDLN

GI..~

GL3

~ 05D7 1t371F iliHil ·
..,. 05DA CD320 7
GL.1
( " ) 0500 CAOA05
o 05EO 07
3 05E1 FEOA
" l:l 05E3 CADAO!S

;

.. ·•
05D6

*
*
*
*

1 FNDLN°

FINDS A LlNE WITH A GIVEN LINE M (IN HI..) IN THE
• TEXT SAVE A~EAo
De IS USED AS THE TEXT POINTER.
IF THE
• LI NE IS FOUN09 DE WILL POINT TO THE BE GINN ING OF THAT LINE
$
CleE•o THE LOW SVTE OF THE LINE Ill), AND FLAGS .ARE NC & z.,
..,_-IF--T#Al'-~-INE--·l5-·NCH· THE-A£- AN·O-·A-L-i-NE -WITH A HIGHER-id-NE -410 4' IS FOUND• OE POI NT S TO THERE .AND FLA & lt; :S ARE NC & NZ e
IF
:' 41 WE REACHED THE ENO OF TEXT SAVE ARE ANO CANNOT FIND THE
LXNEv FLAGS ARE C & NZ.
~ • " FNDLN• WILL INITIALIZE DE TO THE BEGINNING OF THE TEXT SAVE
~ •
AREA TO START THE SEARCHe SCME OTHER ENTRIES OF ~HIS
~
ROUTINE WILL NOT INITIALIZE CE ANO 00 THE SEARCH.
" ' lll ,•FNDLNP• WILL START WITH DE AND SEARCH FOR THE LINE lie
~
·•FNDNXT " WILL.BUMP OE ev 2. FIND A CR AND THEN START SEARCH.
c
'FNDSKP 0 USE OE TO FIND A CRv AND THEN STRART SEARCHo

THE BUFFER ANO ECHOSo
IT IGNORES LF•S AND NULLS, euT STILL
_., " ' ECHOS THEM BACK.
RUB-OUT ts USED TO CAUSE IT TO DELETE
co • THE LAST CHAAATER (tF THERE 15 ONE)e AND ALT-MOD IS USED TO
CAUSE IT TO DELETE THE WHOLE LINE ANO START IT ALL OVERo
....
Cl & gt; . •
CR SIGNALS THE ENO OF A LINEe AND CAUSE 8 GETLN• TO ~ETURNe

~

. DI

131
C31C06

lA
FEOO
C23106

AoCOE)

CMPI a CR
.HIP
NZoFL2
INC OE
JMP
FLl

IFNOSKP LO

***

FNOSKP $ & gt; 111'I
TRY TO FINO CR
KEEP LOOKING
FOUND CRo SKIP OVER
CHECK IF END OF TEXT

HOWEVER~

INC
DE
CMP
a
RET
z
OUTC
CMPI @CR
.J MP
NZ.PSl
RET
u

BUMP POINTER
SAME AS OLD A?
YES, RETURN
ELSE PRINT lT
lllAS IT A CR?
NO, NEXT
YES, RETURN

~

•QTSTG• LOOKS FOR A BACK-ARROW. SINGLE QUOTEe OR DOUBLE
QUOTE.
IF NONE OF THESEo RETURN TO CALLER.
IF BACK-ARROlllo
OUTPUT A CR WITHOUT A LFe
IF SINGLE OR DOUBLE QUOTE. PRINT
THE STRING IN THE QUOTE ·AND DEMANDS A MATCHING UNQUOTE.
AFTER THE·-PIUNTING THE NEXT 3 BYTES OF THE CALLER IS SKIPPED
OVER (USUALLY A JUMP INSTRUCTION & gt; •

22

232323

FEOD
El
CA3902

C03C06

OF
3E22

CF

FEOD
C23D06
C9

07

ee
cs

0682.

066F
0672
0673
C674
0675
0678
067B
0670
067E
067F

l10AOO
05
42

1431

CIHA05

co
cs

C06705
F27E06
0620

OD

066E 05

$

0658 27
065C 05
065D 3E27
065F C34006
0662 CF
0663 5F
0664 08
0665 3E80
0667 07
0668 07
0669 El
066A C35606
0660 C9

0659 E9
065A CF

0656

*

0648
0649
064A
0648
0640
0650
0652
0653

063F
06 40
0641
0642
0644
0647

063E 13

$

A " ;

QT3
iD 9

,,.• 0

PIO

PN2

c

NS.PN!

LOO

A •I'll

LOOK e. ,_ •
OEC c
PUSH BC
CALL OIVH & gt; E

JMP

CALL CHKSGN

DEC

LODI A.x•ao•
OUTC
OUTC
POP
HL
JMP OT2
RET u

LODI A.@QT
JMP
OH
TSTC @8KAoOT5

CALL

PRTSTG
CMPt lilCR
POP
HL
JMP
z.RUNNXL
I NC
HLv3
( HL)
JMP
TSTC " 1ClToOT4

LODI

TSTC

PRTNUM PUSH DE
LOOI OE.tO
PUSH DE
LOD
e.o

QTS

QT4

Qr;ll

QT2

QU

QTSTG

***

& gt; ! & lt; lillll!

SAVE AS A FlAG
B=SIGN
C=SPACES
CHECK SIGN
NO SIGN
S=SIGN
•-• TAKES SPACE
SAVE SIGN & SPACE
DEV I DE HL B'f 10
RESULT ()?

*** PRTNUM
DECIMAL

NONE OF ABOVE

YES. CR WITHOUT LF
DO IT TWICE TO GIVE
TTY ENOUGH TIME
RETURN ADDRESS

YES. 00 SAME
AS IN "
XS IT BACK-ARROW?

XS IT A • 1

OTSTG

IT IS A "
PRINT UNTIL ANOTHER
WAS LAST ONE A CR?
RETURN ADDRESS
WAS CR, RUN NEXT LINE
SK[P 3 BYTES ON RETURN
RETURN

***

$ •PRTNUM•
THE NUMBER IN HL•
BLANKS ARE ADDEO
* IF NEEDED PRINTS NUMBER OF DIGITS ISLEADING THAN THE IN !N
TO PAD THE NUMBER OF SPACES TO THE NUMBER
c.
IF THE
LARGER
$ Ce ALL
NEGATIVE SIGN KS ALSO
* PRINTED DIGITS ARE PRINTED ANYWAYe SIGN IS NOTo
ANO COUNTED IN• POSITIVE
" '
* •PRTLN• PRINTS A SAVED TEXT LINE WITH LINE - ANO ALL•
ill.
063C 47
PFITSTG LOO
E!oA
*** pqTSTG ***
063D lA
LO
A• COE)
GET A CHARACTER
PSl

$

lll
$

*
*
*
lll

$

$

..

1 PRTSTG•
PRINTS A STRING POINTED BV DEe
IT STOPS PRINTING
AND RETURNS TO C.ALLER WHEN EITHER A CR IS PRINTED OR WHEN
• THE NEXT BYTE ts THE SAME AS WHAT WAS IN A CGKVEN av THE
$ CALLER)e
OLD A JS STORED IN e. OLD B IS LOSTe

" '

*
****** " '************** " '***************************************
* *** PRTSTG *** QTSTG *** PRTNUM *** & PRTLN ***
*

*

0632
0633
0635
0638
0639

:

Bl

C.IH3F06

06AO FEOA

0693 FA9C06
0696 3E20
0698 01
0699 C39006
069C 7a
0690 07
069E SD
069F 7B

ca

06AB
06AC
06AD
-06AE
06AF
06BO
06B2
066S
06B7
0668
06B9
06BC

*
06AA

C03C06
C9

97

07

lA

6F
13
.IA
6?
13
OE04
CD6E06
3E20

06A4 C630 ·
06A6 07
06A7 C39F06

06A3

$$$

PRTLN

PN6

FINS

PN4

PN3

ec
c

PRTLN $$$
LOW ORDER LINE a

CALL
RET

***

IF SO, RETURN
ELSE COVERT TO ASCII
AND PRINT THE DIGIT
GO BACK FOR MORE

PRINT SIGN
MAYBE - OR NULL
LAST REMAINDER IN E
CHECK DIGIT IN E
10 IS FLAG FOR NO MORE

MORE?

NO LEADING BLANKS
LEADING BLANKS

YES. WE GOT ALL
NOo SAVE REMAINDER
ANO COUNT SPACE
HL IS OLD BC
MOVE RESULT TO BC
AND DIV I DE BV 10
WE GOT ALL DIGITS IN
THE STACK
LOOK AT SPACE COUNT

c. "

OE

·H-eA·

&

PRTSTG

u

ANO THEN THE TEXT

FOLLOWED BY A BLANK

PRINT 4 DIGIT LINE a

A,(OE)

CE

Lo A

HIGH ORDER

Ao (OE)

PN6

•o•

l

CE

10

AoE

e.1..

CALL PRTNUM
LOOI A•• •
OUTC
SUB A

LODI

1 NC

·L & lt; JD-

INC
LO

LOO

LO

.JMP

LC!D
CMPl
POP
RET
ADDI
OUTC

LOO

LOO AoC
!OR
A
.J MP
S,PN5
LODI A'• •
OUTC
.J MP
PN4
LOO AoB
OUTC

DEC

POP

PUSH
LOO
.JMP

HL ·
HLoBC
PN2

1-'L.CSP)
I..

XCH
DEC

ZoPN3

c

IOR
.J MP

ca

0680 Ei'

*
06BE

06C3 C3BD06

N

" "

" '

O & gt;

!;3

.

0606

Cl

e:i

0602 C3C606

0601 77

06CF 2B
0600 iA

06C6 78
06C7 92
06C8 C2CE06
06CB 79
06CC 93
06CO ce
06CE se

... 0605
" '

.....

~

:S:

(JI

0

06C2 03

w

) & gt;

9

POPA

MDI

SUB
.JMP

POP

POP

.JMP

LOO

LO

DEC

RET
DEC

SUB

LOO

MVOO\llN LOO

.JMP

COMP
RET
LO
ST
I NC
I NC
Ao (DE)

z

IBC

HL

MVDOWN

Mo A

Ao COE)

DE
HL

z

E

.11.C:

0
NZoMOl

AoB

M\IUP

A.,(BC)
DE
BC

=

BC
RETURN ADOR.
RESTORE LOPVAR. BUT

YESo RETURN
ELSE MOVE A BYTE
BUT FIRST DECREASE
BOTH PO INTERS AND
THEN DO IT
LOOP BACK

NO, GO MOVE
MAYBE. OTHER BYTE?

BC

$$$

*** MVDOWN
TEST IF DE'=

UNTIL DONE

GET ONE BYTE
MOVE IT
INCREASE BOTH POINTERS

***= MVUP RETURN
DE
HL • ***

FOR• LOOP VARIABLE SAVE AREA INTO THE

MVUP

9 PUSHA•
STACKS THE
STACK

=

•MVUP' MOVES A BLOCK UP FROM WHERE OE- & gt; TO WHERE BC- & gt; UNTIL
OE " ' HI..
•MVOOWN• MOVES A BLOCK DOWN FROM WHERE DE- & gt; " TO WHERE HL- & gt;
UNTIL DE
BC
" POPA " RESTORES THE •FOR• LOOP VARIABLE SAVE AREA FROM THE
STACK

066F IA
06CO 02
06Cl 13

0

'I': "

!:

.,, *

::s

" ' *
0

0

$
$

w
... *
*

s:

$

0

)(

$$$

.



l/ll
...



~

::.'.

..

~

0

&

PUI

PU SHA

PP &

=O MEANS NO MORE

HL

HLoSTKLMT
CALL CHGSGN
POP ec
ADD HLoSP
.JMP NCeOSORRY
HLeLOP\IAR
LO
LOO AoH
1 OR L
JMP
ZoPU1
HL1LOPPT
LD
PUSH HL
LD
HLoL.OPLN
PUSH HL
LO
HLeLOPU4T
PUSH HL
HL.LOPINC
LO
PUSH HL
LO
HL,LOPVAR
PUSH HL
PUSH BC
RET u
LOOI

** " '

BC = RETURN ACDRe

ELSEo MORE TO SAVE

PUSH.A
BC=RETURN ADDRESS
IS STACK NEAR THE TOP?
YESe SORRY FOR THAT.
ELSE SAVE LOOP VAR•S
BUT IF LOPVAR IS 0
THAT WILL BE ALL

***

~DDRe

ZoPPl
YEP. GO RETURN
HL
NOPo RESTORE OTHERS
HLeLOPINC

L

A,H

HL~LOPVAR

HLoLOPLMT
HL
HL.LDPLN
POP
HL
ST
HL.LOPPT
PUSH BC
BC = RETURN
RET u

ST
POP
ST
POP
ST

POP

JMP

XOR

ST
LOO


•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
• *** OUTC * " '* CHI & lt; 10 **•
*

0718 cs
0719 C9

0717 ES

0706 E5
070C 2AOB08
070F E5
0710 2A0908
0713 ES
0714 2A0708

0704 2AOF08
07()7 E5
0708 2A0008

21A71F li & gt; ilHi & gt; la

06F4 CD6A05
o6r7 Cl
06F8 39
06F9 02CF05
06FC: 2A070f3
06FF 7C
0700 BS
0701 CAl707


06F!

06FO C9

06E7

El
06E8 221'008
06EB El
06EC 220F08
06EF cs

06E4 220808

0607 220708
06DA 7C
0608 B5
C6DC CA.EF06
06DF El
06EO 220908
06E3 El

C21FO 7
Fl
C9
DBOO

co

073A .•.E:67F

0737 CB
0738 DBOI

0735 E620

0734 00

072F 3EOD
07 31 C9
0732 OBOO

072E 07

072C 3EOA

0728

0727 0301
0729 FEOD

0726 Fl

0723 CAiF07

0721 E602

07 iA
0710
071E
071F

*



II & lt;

..

*
ill

CHKIO

OC3

OC2

Di.ITC

1

AF

ZoOC3

x•o2•

0

u

AF

A
NZeOCl

AF

A .oc:sw

INP

u

0

NOP

ANDI x•20•
RET
z
!NP
1
ANO! X 0 7F "

PET

CMPI

ilCR
RET NZ
LODI l.oilLF
OUTC
LOOI A.. lilC:R

PUSH
LO
IOR
.JMP
POP
RET
I NP
ANDI
.JMP
POP
OUT·

***

***

CHKIO
STATUS BIT FLIPPED?
MASK STATUS BIT
NOT READYo RETURN " Z "
READY• READ DATA
MASK BIT 7 OFF

IT JS ON
IT IS OFF
RESTORE AF AND RETURN
COME HERE TO DD OUTPUT
STATUS BIT
NOT READY. WAIT
READYo GET OLD A BACK
AND SEND IT OUT
WAS IT CR?
NO. FINISHED
ves. WE SEND LF TOO
THIS IS RECURSIVE
GET CR BACK JN A

IS AT LDC. 10
CHECK SOFTWARE SWITCH
THIS

INPUTo IT WILL RETURN TO
IF THERE IS INPUT, Z FLAG
1N Ao
HOWERERo lF THE
INPUT IS A CONTROL•o. THE •ocsw• SWITCH IS CO~PLIMENTEDo AND
Z FLAG, IS RETURNEDo
IF A CONTROL-C IS READo 1 CHKI0' WILL
RESTART TBX 'AN: & gt; DO NOT RETURN TO THE CALLER.
l~

*
*
$
*
•· •CHKIO• CHECKS THE INPUTe
iti
* THECLEARED WITHTHE INPUT BYTE· NO
CALLER
THE Z FLAG SETe
lll IS
ANO
IS

THE ONLY l/O ROUTINES IN TBle
CONTROLLED BY A SOFTWARE SWITCH •ocsw•.
IF OCSW=O
1 0UTC•
WILL .JUST RETURN TO THE CALLERo
IF OCSW IS NOT Oo
IT WILL OUTPUT.THE SYTE IN Ae
IF THAT IS A CR• ALF IS ALSO
SEND OUTe ONLY THE FLAGS MAY BE CHANGED AT RETURNv ALL REG.
ARE RESTOREDe

.....................•......•................................. •
$THESE ARE
g *
" ' •cure• IS
MVUP
MllDOlllN *** POPA ***
PUSHA ***

:;,

5 & gt;

" '
" "

e;·

~

::r

~

::::

t & gt;

.,

i:

c

-o

o
3

o

..,, 06A2 01 .

;

;
.,

c:

~

a:
..

Q' "

0

87

0690 OD
0691 79

Ci6 92

0

0

068F Cl

068C C37F06

0688 2D
0689 ES
06BA 6069

0687 E3

0684

0683

:'

~

ID

IQ

A NOTE TO MEMBERS OF THE
SOUTHERN CALIFORNIA COMPUTER SOCIETY

fields did NOT donate these copie~, and, after havinq the
opportunity to see him in
we wish to adamantly state
that PCC does NOT support Mr. Fields in any way!
2. Along with these 500 free copies o·f FCC, we also

by Jim C. Warren, Jr., Editor, Dr. Dobb's Journal

forwarded a number of other PCC puhlications, as per Mr.
Fields' teleµhone order of April 12th. His order totaled
$359.75 (unrelated to the free FCC copies). We forwarded
the telephone-ordered publications to Mr. Fields with the
understanding thJt he was r~presenting SCCS.
In spite of repeated billings, to date he has paid only
$59.75, received June 10th. Our cor.1:acts vvith the other
SCCS officers have consistently show1« them to be responsible,
trustworthy, and responsive.
3. As a result o-f ti•e above-noted incidents, PCC will
make no further donations or sales through Mr. Fields to
SCCS. We will be delighted, however, to work with any of
the many other secs officers.
l\lote: We do not mean this to i11 any way reflect
negatively on the SCCS, nor on the many Society officers
who ure doing an excellent job of administering a worth·
whiie
that p1 ovides r~mny u:ieful services to the
crnnputer : " iobbyist corwr:unity.

am writing to object to several of the actions of
Louis G. Fields, vice president of SCCS, that have recently
come to our attention.
1. On April 12th, we sent Mr. Fields 500 copies of the
March-April issue of People's Computer Company newspaper,
for distribution at the April 24th SCCS meeting, compliments
of PCC.
I happened to attend the meeting and found that, 1'irst
of all, Mr. Fields had failed to bring most of that supply to
the meeting, and secondly, those he had distributed were
stamped in oversized red letters, " Compliments of Louis G.
Fields. "
This may have given the completely foise impression ma1·
either Mr. Fields was the donor of these complimentary
copies, or that PCC was somehow supporting Mr. Fields. Mro

u

I::: & gt; «'-

1!100

r-z

c::; ... l/l

,...

ccr u..

l/lOOZ

UV

...
a:

0

0

0

" '
8
::!:

:l!:

0

v..

c

a:: w 1- [!: a:

l.!J
Vl
UZ·l.:'Z

a::UJro

~4'.~a.

Ul-11l

w~-~o

•!C

roz:iwww

01-

({Jo

z-Z_; & gt; & gt;
:io

_; & lt; t & lt; t

za.~- & lt; l) & lt; I)

LLll-

OU.

Wl-ZUJ 0. WO:: O'. " " " Wl-0 Zl-1-

& gt;

_JQ'.~~ & gt; L
OU~ZXZ::: & gt; XX
~WBOCWCU.ZMMWCAWW

w
u
& lt;

& lt; i:I & lt; llQ.Vlt-~•·

a:

)( & lt; ;('f

O'.WWllJ

& gt; ~U.1-0.0QCZ

H..l...Ji-IX i 1-i-

0

~a

h~a.

Oll.0::
" " "
UJ

I:

(fllf)

If)

U.

......
U:

~-U.Z!-1-

l!J & gt; -::: & gt; ll.J & gt; -P & gt; O

ro

w

0

\~WU.OU)

.JOO;JJ

W

a:

er:

!ll:E

& lt;

1If)

IM

& lt; ( " 1-1.!J " '..l
' " " 'IX:: & gt; l.!.O:
O::i-0.U.i-tl.

& lt; CXZ:: & gt; & gt; & lt; O
; & gt; U.l~~rouJt-

: & gt; l
U
& lt; (

!-

m

a.

Ill

a:
& lt;

:r

v

::E'
Cl

...
u

oQlo
1\1 & lt; t " '
QI Cl) I{)

OU.Ill

& lt; ht

ICl N & lt; t

I()

.. & lt; t " l
q IO & lt; t

oo ...
(I),..

co

OCIJM

Of " lo

& lt; tN & lt; t
o & lt; to
C\J & lt; t Ill

IO & lt; t & lt; d'

Ill II.. UJ

oo-QI

(\f & lt; t

& lt; t
& lt; OO & lt; t

& lt; tNU " !

Mlllll'l

& lt; t & lt; t Ill

ll'lO & lt; t
Ill 1\1.Q & gt;

l[llO(\J

IL ... & lt; t
& lt; It & lt; t It)
fflOl " l
& lt; t c.\J & lt; t

& lt; t. & lt; t & lt; t

Niil¢

ou ...
C\J 1\1 & lt; t

& lt; Ol " lo

()\,...11..


& lt; t

lD & lt; t
Ill l.P

llllflM & lt; t It) u.. oNo
& lt; t U'l Ill • • N & lt; l " N
U.llloU...., & lt; tNUU.ON
& lt; t & lt; tCIJ & lt; t & lt; tllllON & lt; tNllJ

U'l

OWO & gt;
... & lt; l' & lt; t

ol " )UJ

... & lt; t & lt; t
& lt; t U " ! I{)
OOOI
In N & lt; t
l " ll'lO
If) I!) & lt; t

tO

q. " '

& lt; t & lt; t
IO & lt; tllJUJOOU
& lt; t & lt; tl!lNNN & lt; t
N

a:

l " ll.!..

f'.O

I-

& lt; H:!'
!ilN
1111' & gt; WOo & gt; Q..J

lll & lt; l'NNMI')

" '

!z:U..Z2
Z0

z

((~
ll.I

I-

~IX~Zl & gt; -S & gt; " " " " -!...JUQ..:;J©W

ID

VJ

Q'.

IJ..W
U..11..
:i :'.)

-I
:.£

u

I!I!

I-

O;!ll'-11..l!..I'-0 & gt; ·1!'1,...1'- " l'.
!i.. ll.. IL
~!.

& lt; O
0

i-!/ll-0..a::ui-

ZOX:ZcZ:l!:ZI-

a: :I!'. a: :i! o. o.. n. n. u. z1-1-1-

u:ii-.;1-00000...:xx & gt; i:
Q~J ti) .'»(/l _J__j .J =~ & lt; & gt; J (( ( " " - ~-t-1

I:!
& lt; !

;':!

mm

~

ll

«(

Ill

UOICJW .. f'-

& lt; tN & lt; t & lt; tl'll " I
o & lt; l'Qllfl©O

N & lt; tlll & lt; r!\IN
& lt; tl.UN & lt; OU\fl
& lt; t & lt; t & lt; t & lt; tN & lt; l'

C\JUJ\OMQIOIO
Ul & lt; t & lt; t-l!llllNN

u..-oMl'-W

IL " " OUlaJU'lill

11.0 & lt; Hl'W©
& lt; tN & lt; r & lt; t & lt; tlf)

& lt; t & lt; tN & lt; t & lt; t & lt; t & lt; t

& lt; t & lt; l " N & lt; t & lt; t & lt; t

UJNCU..NMWO,..OIUJM & lt; toOOM & lt; tOU.. & lt; tOO & lt; tU..~Mrow~mu.u-c

U..UMNMVIJ..UUl!l & lt; tl.PlfllflNNIOl!llfl & lt; t & lt; t & lt; t & lt; t & lt; t & lt; tU'l & lt; t & lt; tNq & lt; t & lt; t & lt; t & lt; t & lt; t

uw~ & lt; tlll & lt; 0mowu..,._u..,..(ll~(ll~f " lIDMroU•u•momo-~-morou.

,.. ...

Mf " l & lt; t & lt; t & lt; t & lt; t & lt; t & lt; t & lt; t & lt; tl!l11J\()~,._,...mmro(ll0101ccmmuuocawwu.11..u.
,..,...,...,..,...,...,..,..,..,..,..,..,..,..,..,...,...,..,..,...,..,..,..,..,..,..,..,..,..,..~

...

~~

oooooooooooooooooooooooooooooooo~ogo

May, 1976

0..1-

u

VJ " (
!O: & lt; ll

Ill

a:

..
& lt; O!
- & lt; Q.Q.b-I- & lt; (
:E::EO::El-:E:EWVl:t
V " " l-IV\ll " " !VO:a:V

,._CD

zw
H & gt;
• 'i

I-

:J

rnw

a:

lo & lt; d

00

a

0
:E

Q.Q.

U..!DO
o & lt; to

o.

q; :.!

l!..

-·'l'.WZ

;:) & lt; 1:

\)

Ill

::: & gt;

UN•
•:CUN
) & gt;
r.IZ & lt; • & lt; tUf'll:il:I-•

.

Zt:r\.?O

1-0:

~

w
u.

~w~-.qf)

oo
lry1-u1..Jtu
roOI({J m
~

0

a:

!/)

W4Z

& lt; :i:
,.. Lu

wzoo a::

0

::t

Cl :::i

v " ' a

II)

z

0:-LU

& lt; ;{ ;)

z
& lt; (

& gt;
& lt; (

31
lllO

1-1-o:t.:i

0

z

WI-I-;)

Z & lt; l):JO::•

:I
I!.

...
'

folllO
UJl/lOilJW
l!l,...Z & gt; W

,_,zuo

& lt;

a:

0

wro:Jzv1
m o..wo

z
....
....
u
z

0
0

: & gt;

.

•Z

0 •O

z
...
I-

UJl-Z- & lt; 111
l:ZO:l1-0 ::: & gt; lllll'I
OVl-UJ " " '
z UJCZ:l:
& lt; 1-a:
1-

ucr.Jo
00
1-:Ecro
...
I- f-

_,,
" " 'Ul

UJ

0::

a

$

II)

o: I- & lt;
era:: c:o.

1-U

Z
OU.
OUJ I IL

0:

...J " '
CD

Oi.X

ill

0

ID
ZINl-W
... .JZ V

I :it: 0.. U.
.JUMU..
OUJ.JO

z

:l!'.
:l: & lt; (

e

.......

O..u:

UJ

.

.

:l!:Z
lllO

oo

0000·000iill

00

00000000

l!.uO

vo~OQOO..,.,

1.1.ao

oooooooltl

o ... r'J ll)il'Jl'-O & gt; wou. " 'n •n 6
co
coocoo~~~Q
ro ro ro ro ro & lt; 0 ro w ro r.o ro & lt; IHI.
Oe & gt;

C);;_')Q'\.-')' " ;IO " 't "

Dr. Dobb's Journal of Computer Calisthenics & Orthodont.;a, Bol & lt; 3·10, Menlo Park CA 94025

o

('~

Page 25

INDEX TO THE COMPUTER HOBBYIST
VOLUME 1, ISSUES 1 THROUGH 9
This is an excellent newsletter. We strongly recommend it to
every serious computer hobbyist. Not flashy; no side-show .
just excellent, comprehensive, well-written articles.
-Jim Warren

The Computer Hobbyist is a newsletter/magazine totally
dedicated to the use of computers and associated devices as a
hobby. Both software and hardware are discussed in feature
articles. Circuit diagrams and program listings frequently supplement these articles. In addition to the features, each issue
contains an editorial and regular columns on surplus, letters

from subscribers, and want ads free to subscribers. Occasionally, as the material warrants, book and product reviews are
printed. Frequency of publication varies from 4 to 12 weeks,
so subscriptions are for a particular number of issues rather
than a time period. The Computer Hobbyist is offset printed
on looseleaf 8Y. " x11 " paper suitable for ring binding (except
for the first three issues which were folded to half size) and
is mailed third class to subscribers in the continental United
States.
Occasionally, printed circuit boards and other hard to
find components are made available to aid our readers in
constructing the projects written up.
For further information write to: The Computer
Hobbyist, Box 295, Cary NC 27511.

THE COMPUTER HOBBYIST
NUMBER 1
1. A GRAPHICS DISPLAY FOR THE 8008 PART 1 - Fundamental concepts and programming
technique for inexpensive vector graphics display.
2. SURPLUS SUMMARY - THE TELETYPE STORY - Survey of teleprinter equipment suitable
for computer output.
3. NOTES ON THE 8008 INSTRUCTION SET - Some simple tips for more effective 8008
programming not mentioned in the Intel manuals.
NUMBER 2
1. THE 8080 IS HERE - MITS ALTAIR 8800 product line preview and comments on the
future of hobby computers.
2. LOGIC SYMBOL CONVENTIONS or HOW TO READ TCH LOGIC DIAGRAMS - Discussion of
MIL-STD-806C logic symbols and logic design using the " dot convention " .
3. A GRAPHICS DISPLAY FOR THE 8008 PART 2 - Description and diagram of digital and
analog circuitry for vector graphics display generator.
4. INTERFACING A 5-LEVEL TELEPRINTER PART l - Description of simple current loop
interface with common teleprinters.
·
NUMBER 3
l. A GRAPHICS DISPLAY FOR THE 8008 PART 3 - Description and diagram for large
screen XYZ -scope using common magnetic deflection CRT's and photos of display.
2. BOOK REVIEW - Critical review of MICROCOMPUTER DESIGN from Martin Research.
3. CHESS BOARD DISPLAY - Description and listing of chessboard and chesspiece
display program, fits in about 500 bytes.
4. INTERFACING A 5-LEVEL TELEPRINTER PART 2 - Description and listing of print
software that accepts ASCII input.
5. A CHEAP MARK SENSE CARD READER - Description and diagram of circuit for reading
pencilled data from tab cards with surplus Western Union card reader.
NUMBER 4
l. HUMAN INTERFACE YOUR GRAPHICS DISPLAY - Description, diagram, and driver software
for a 4 variable proportional control input for interactive graphics.
2. 8008 vs 8080 vs IMP-16 WHICH MICROPROCESSOR FOR YOU?. - Detailed comparison of
strengths and weaknesses of microprocessors available to hobbyists.
NUMBER 5
1. TCH AUDIO CASSETTE DATA RECORDING STANDARD PART 1 - Rationale and description of
proposed data recording standard for recording on audio cassettes.
2. RANDOM NUMBER GENERATOR - Description and listing of random number generator,
sequence length over 2 billion, program length 40 bytes
3. TCH STANDARD AUDIO CASSETTE INTERFACE - Description and diagram of machine
independent audio casse~te interface conforming to TCH standard.
4. DRAWING WITH YOUR POT CONTROLS - Description and listing of program for
inte~active drawing on graphics display.
NUMBER i
1. TCH AUDIO CASSETTE· DATA RECORDING STANDARD PART 2 - Discussion of logical data
format, cyclic redundancy error detection technique, and summary of standard.
2. ADD A DATA STACK TO YOUR 8008 - Description, circuit, and timing diagram for a 16
byte push-pop stack enhincement for 8008; machine status save/restore routine.
3. THE TCH CASSETTE INTERFACE PRINTED CIRCUIT BOARD - description, foil patterns,

Page 26

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May, 1976

parts list and assembly diagram for TCH audio cassette interface.
NUMBER 7
1. TCH AUDIO CASSETTE STANDARD ROM - Description and listing of audio ~assette
software for both 8008 and 8080.
Also order form for 1702/5203 programming.
2. BOOK REVIEW - Critical review of MACHINE LANGUAGE PROGRAMMING FOR THE 8008
by Nat Wadsworth of Scelbi Computer Consulting Inco
~- -~ --~
3. NEW PRODUCTS - Brief review of Micro 400 computer kit and the Cramerkit series of
microcomputer kits.
4. COMPUTER PING-PONG - Discussion, description, and listing of ping-pong program
using the TCH graphic display and pot controls.

NUMBER 8
l. INTERFACING THE ALTAIR 8800 PART l - Detailed discussion of system loading
considerations, timing diagrams, and example TCH cassette and ROM interface.
2. NEW PRODUCTS - Brief review of Altair 680, JOLT, and Sphere computer kits.
Brief
discussion of Mini-Software's FORTRAN system for the 8080.
3. AN IMP-16 MICROCOMPUTER SYSTEM PART I - Overall system description of high
prrlorm.inc1' lb hit mlcrocomputrl- con1;tructio11 projf'ct.
4. WHAT TillS COUNTRY NE~DS IS A GOOD $20 MICROPROCESSOR - Discussion of features and
programming considerations of the MOS Technology 650X series of microprocessors.
NUMBER 9
l. TCH SUPER SIMPLE FLOPPY DISK INTERFACE PART l - General description of floppy
disk drives and discussion of controller requirements.
2. INTERFACING THE ALTAIR 8800 PART 2 - Discussion of polled interru~t scheme that
doesn't require a vectored interrupt card, diagram for interrupting keyboard.
3. AN IMP-16 MICROCOMPUTER SYSTEM PART 2 - Detailed discussion of system bus
controller.
Also schematic and timing diagrams for bu~ controller •

................................................. v

JIPDEC VISITS PCC
We didn't know that People's Computer Company fame
had spread so far. On May 19th, we were visited by the
Microprocessor Application Study Team from the Japan Information Processing Development Center. The team included
Professor Hidetoshi from Keio University; Koichiro Ishihara, a
Research Fellow with Hitachi Systems Development Lab;
Tatsui Miyakawa, Manager of Fujitsu's Computer Science lab;
and Kazuya Watanabe, from NEC (Nippon Electric Company).
We were surprised, honored, and delighted by their visit, and
pleased with the opportunity to exchange ideas and information.
What may be even more interesting to our readers is that,
in the face of all of the massive microprocessor research and
manufacturing that is centered in the San Francisco Bay area,
this JIPDEC group chose to visit only PCC and IMS Associates, Inc. (I MSAI).

CHICAGO STORES:
CHICAGO COMPUTER STORE
ITTY BITTY MACHINE CO.
There are two new computer stores in the Chicago area:
Chicago Computer Store (handles MITS stuff)
517 Talcott Rd at Hwy 62
Park Ridge IL 60068
Itty Bitty Machine Co. (handles IMSAI, etc.)
1316 W. Chicago Ave.
Evanston Ill.

WHAT'S A BAMUG?
by Richard Lindberg
BAMUG stands for [San Francisco] Bay Area Microprocessor's Users Group. It is one of the many computer
hobby clubs which have sprung up like weeds in the past year.
We meet in San Leandro, Cal., on the first Thursday of each
month. Meetings are held at the Great Western Savings building
at E. 14th and Davis, at 7 p.m.
BAMUG is a relatively small group. Anyone is welcome to
join us, but we are mostly interested in the Intel 8080. We are
starting a software library which, though still small, contains
some very useful programs.
We try to keep the meetings interesting. We have some
demonstration at every meeting, if possible. At the last meeting
we had one of our members, Ken Jackman, tell us some of the
concepts involved in Nim-like games. He is writing a book on
the subject and presents it well with the aid of his vintage Nova.
At the next meeting we will have George Morrow. He will
be hauling odds and ends out of his basement to show us. Of
particular interest is his inexpensive tape cassette interface. We
also hope to get a preview of his 16K ALTAIR-IMSAI compatible RAM board.
We have voluntary dues of 50 cents per meeting, but you
are welcome to attend without paying. If you have a program
to contribute to our library, please bring us a copy.
(Reprinted with permission from Homebrew Computer Club
Newsletter)

TedN elson of Computer Lib has a hand in the second one.

-Mav. 1976

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 27

1·'exas 1'in)p B,;1SIC (TBX) Marries
sette Oj)er tin.g Systeni (TV COS)
by Digital Group Software Svstern3, Inc. staff
Box 6528, Denver CO 80206; (303) 861-'l 686
QUESTION:

ANSWER:

b.

What could almost be better than i:d•1ing your
micro programs run correctly?
Having unique micro software to utilize to vom
heart's content!! 'Nhether to create some fantastic program(s) or to have the facility to
entertain yourself and/or friends w1lh programs
and games requiring a bit of " think po•Ner "
especiallv for those days when your " think
power " cou!d stand a bit of bolstering!

c.

All this is possible thanks to the software pcitka•Jes rK»N
being provided by Digital Group Software Systen1s, inc.,
(DGSS), which was recently established and is haaded by
Chuck and Dianne Howerton. Software which is now avai!ab!e
on cassette tapes, complete (for the most part) with documentation for each offering. is as follows:

1. TINY B.ASIC

EXTEi~DED

d.

e.

(TBS-TVCOS)

101(, VERSION 1
Created by Dick \Nhipple and John Arnold of Tyler,
I exas, based upon design criteria published in Dr. Dobh's
Journal Volume 1, rJumbC & gt; r ·1, page 14. Dr. Robe!°t Suding of
The Digital Group designed and developed 'the softvJare interfaces between TXB (Tlf'J'{ Bfi.S!C EXTENDED) and the TVCassette Operating System (TVCOS) for the Digital Group
8080 microcomputer. This is a superset of TINY BASIC as
originally proposed; a limited and modi1ied subset of the fuli
BASIC language. It has 26 possible simple or dimensbned
variables, 4 immediate commands (LST, ~JEW, RUN, and SZE),
and 12 commands (DIM, DTA, E\\!D, FOR, GOTO, GOSUB,
IF, l~J, LET, f\lXT, PR, and RET) which may be entered
either as program statements or immediate execution commands. Also included is a RN or Random ~Jurnbe1· generator,
14 pages of documentation, which lets you do everything
with TINY BASIC E)(TENDED that is presentlv pos~ible, is
also included.
PRICE: $5.00 @ rnssette with doeucnentation.

2. TINY BASIC GAMES, DGSS SET 1

Contains 5 games written in TBX language-3 games are
TBX versions of games listed in either 101 Computer
Games or What to do After You Hit Return [Both are
available through PCC bookstore. Please see inside of
back cover.]. Other two games are original products of
author Howerton. Games on Set 1 tape are:

PRICE:
NOTE:

TINY BASIC GAMES, DGSS Set 1, and
all TINY BASIC GAMES are read in

program into micro-computer .•.•
and away (:RUNcr) you goll
3.

TINY BASIC GAMES, DGSS Set 2

All the games in this set were adapted to
TBX-TVCOS by Dr. Robert Suding from 101
COMPUTER GAMES, PEOPLE'S COMPUTER COMPANY
and WHAT TO DO AFTER YOU HIT RETURN.
a. WAR-3: An artillery duel between 2
or 3 armies - OBJECT: To blast the
b.

c.

CHOMP: 2 or more players t@ke
turns biting into the poisioned
cookie - Each trying to force

e.
Page 28

$5.00 @ cassette with documentation

AFTER " bootstrapping " TBX-TVCOS

d.

a.

one of the others to take the
poisioned " byte " !!!
CHECKERS: You against the computer in this classic board
,game - WARNING: The computer is
as crafty as a 6-year old playing
his first game I !
TIC-TAC-TOE: The computer plays
a fairly reasonable game with
just enough randomness in its
selection to make the game interesting - Can be beaten.
DIGIGUESS: Try to guess a 4 digit number " thunk " up by the computer based upon clues it supplies.
BRAINTEASER: A strategy game - You
against your own worst enemy ... YOUI
Try to create a pattern working with
a set of rules to drive you nuts!ll

opponent(s).
THERAPY: Have a relaxing " conversation " with DR. THERAPY and investigate your inner problem(s).
GOLF:
9 holes of championship
play on the " micro-links " - Hooks
and slices are rare and 1-putts
from 40 feet are fairly common.
REVERSE: Test your skills at arranging things in sequential order
from a random beginning according
to a fixed set of rules.
BIORYTHM: Predict your " highs " and

Dr. Dobb's Journal of Cornputer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May,. 1976

" lows " from a computer-produced
chart based upon your personal statistics.
PRICE:

guesses the computers' number by
asking questions.
BLACKJACK: From 1-9 players Play against the house in this
Casino game.
FACTOR: A bonus program which
will compute the factors of any
number up to 32,767 or tell you
if it .is prime.
BATUM: A super bonus game which
is a varient of 23-MATCHES. Good
selections will really make the
conputer think I I

e.

$5.00 @ cassette with documentation
f.

TINY BASIC GAMES, DGSS Set 3

4.

All the games in this set were adapted to
TBX-TVCOS by Ted Holdahl from 101 COMPUTER
GAMES.
a. TAXMAN: Test your knowledge of factoring by trying to beat the TAXMANll
It' s tough but he ~ be beaten I I
b. SNARK: Learn symbolic logic and the
use of Ven diagrams while trying to
find the SNARK.

c.
d.

e.
f.

TRAP: Find the computers' number by trapping it between two
guesses of your'own.
NUMBER: Learn binary-searching
techniques while trying to pinpoint a randomly-generated number between 1 and 100.
SQUARE-ROOTS: Computes the
square root of any number from
-32K to +32K.
CLOCK: This bonus program keeps
accurate time using loopinq techniques and displays on the screen
to the nearest second.

PRICE:

5.

g.

PRICE:

KINGDOM; LIFE 1 & LIFE 2
(all on one. tape)

6.

KINGDOM: Lets you be the " KING "
of land/bushels/population of YOUR
" KINGDOM " - Object of game is to
accumulate 1 million acres and/or
bushels which can only be accomplished by buying and selling land.

a.

T & lt; ~11t-11

b.

c.

PRICE:
7.

00

cations all KINGS have!!
LIFE 1: Standard LIFE which will
take a pattern and, with simple
rules of LIFE, iterate until a
stable situation is reached.
LIFE 2: Bi-Symetrical pattern generator based upon modified rules of
LIFE but a stable situation is NEVER
achieved - Will continue to run and
never repeat pattern for approximately 1031 years!!

TINY BASIC GAMES, DGSS Set 4

May, 1976

your nhllit.y to buy and aoll

thono itomn and outwit tho compli

$5.00 @ cassette with documentation.

All the games in this set were adapted
to TBX-TVCOS by Ted Holdahl from 101
COMPUTER GAMES.
a. HAMURABI: Try governing ancient
Sumaria successfully. The author
says that the object of the game
is to discover the rules.
b. STARS: Guess the computers' number based on clues which tell you
whether your warm, hot, or cold.
c. 23-MATCHES: Outfox the computer
by making it take the last match
in the pile - You ~ beat it if
you try hard enough.
d. 20-QUESTIONS: Take-off on an old
radio~TV' game where the player

$5.00 @ Cassette with documentation.

$5.00 @ cassette with documentation (sort of) II

EDUCATOR 8080

Designed to assist the micro-computer user
in understanding the effect that the execution of various instructions has on
status and operation of micro-processor
unit - Provides continuous real-time display of status flags, Accumulator, B and
C registers which reflect their contents
as changed and/or modified by instructions

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 29

issued by user - Complete with EDUCATOR
instruction set.
PRICE:

$10.00 @ cassette with documen-

tation.
8.

AMATEUR RADIO HAM CASSETTE
FOR 8080

Amateur Radio (CW) Send and Reciive
RTTY (Baudot) Send and Receive

cw·

Receive is automatically selfadjusting to any CW speed sent
cw Send has 8 100-character memorion that may bo individually

cnllod up

cw

Send also features a 256-character software FIFO buffer

RTTY Receive can select 60, 66 and
100 Words per Minute (WPM); upper
or lower case output to TV.
RTTY Send program can send at 60,
66, or 100 WPM.

All 4 programs are designed to reside simultaneously in a lOK
Digital Group 8080 system.
PRICE:

9.

" Delete " (DEL) routines which allow one
to insert or delete octal code at any
point in your program. These routines
move the following instructions in memory to make room for the new instructions or close up a space. In addition,
the addresser of JMP and CAL instructions are modified as appropriate·to
maintain proper loop registration. A
program to zero memory was added (ZRO).
And a program to load ASCII directly
into memory (helpful for TVT output)
was also developed (TXT).
The use of this operating system in
program development would typically
involve the following steps:

1)
2)
J)

4)

5)

6}

Documentation and cassette
HAM-1 $5.00

OPERATING GUIDE - TVT MONITOR B
FOR 8008 BASED SYSTEMS

The TVT Monitor 8 is a modification and
extention of the Monitor 8 published by
MIL before their untimely demise. The
original Monitor B was written to be
usod with teletype/paper tape input and
output. The TVT Monitor 8 is designed
to be used with a Digital Group TVT,
ASCII keyboard and Digital Group Cassette

tape interface as input and output.
Several features were added to the Monitor 8 to increase its usefulness. One
of these is software scrolling of the
TVT. This causes the TVT to simulate
the format of a teletype by displaying
the previous seven lines. Two other
additions were the " Insert " (INS) and

ZRO - zero program storage area
Symbolic input of rough program
draft
TXT - input of any ASCII
characters needed
DPS - symbolic dump to verify proqram
or Q~Q - octal dump
to verify c:ode
XQT - execute program as subroutine of monitor
SBP - set break point to
print out register and
flag status at any program step
EDT,INS,DEL - theee functions
~---;;an be used to change,
insert, or delete, instructions at any location. A particular advantage of this monitor
is that on deletion or
insertion of instructions
the code following is
moved up or down in memory and all JMP and CAL
instructions are modified
to maintain registration.

ONCE THE PROGRAM IS RUNNING TO YOUR
SATISFACTION~

8)

CPY - moves blocks of data

9)

TM - changes JMP and CAL

around im memory
arguments to reflect

Dr. Dobb's Journai of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May; 1976

10)

11)

new page numbers
TAS - can be used to store
completed program on
cassette tape
PRG - can be used (if one has
the proper hardware) to
program EPROM's.

P:dce:

MONITOR-8

$6.00

This package runs only on
aoog-bssed systems - will not run bn BOBO.

unless accompanied by a self-addressed
stamped mailer. Obviously, if many
users send in submissions, duplications
will occur. In this event, date of
receipt AND quality of work will
determine which contributor's
submission will be utilized. Royalties
will be paid quarterly in cash or may
be applied to the purchase of products
at a discounted rate.

PLEASE NOTE:

All the above described programs
and games can be obtained either
by ordering through the Digital
Group or, if your order is exclusively for software, yon may order
direct from:
Digital Group Software Systems
PO Box 1086
Arvada, CO 80001
Should you have any immediate
questions, Chuck or Dianne may
be reached at (303) 422-6197.
Please try to restrict calls to
9 - 5pm Mon - Saturday.
watch for the next Digital Group
Flyer to find out what's new in
the way of available programs and/
or games and other interesting
items for your microcomputer.
NOTE: All TINY BASIC EXTENDED
(TBX-TVCOS) users are encouraged
to develep additional programs
and games which will run-under
the system. Users who submit
programs and/or games to DGSS with
appropriate documentation and who
consent to permit DGSS to distribute
copies will· be paid a small royalty
for each copy sold. Submissions
must include a cassette tape
containing the program or game and
typewritten documentation as
required. All submissions will be
acknowledged but cannot be returned

May, 1976

THE ALPHA-NUMERIC MUSIC SYSTEM
by Malcolm Wright
In the January, 1976, issue of PCC Newspaper, an article
was published on a music program for the 8080 CPU, called
" Alpha-Numeric Music with Amplitude Control. " Since January, the PCC bookstori;i has made this 22-page article available for $2. The interest at the Home Brew Computer Club,
computer stores, and mail orders has been relatively high.
There have been many other music routines written for the
8008 and 8080 CPU's, but Alpha-Numeric Music seems to be
getting a great deal of interest from music majors, as well as
the general hobbyist. Why?
looking into the Alpha-Numeric Music (ANM) program.
one can see many features that don't exist in most of the
other routines.
1. An easy-to-follow encoding scheme for writing
music. Not just number look-up tables for coding, but letters
like C, D# (D-sharp), A! (A-flat), for the actual notes to be
played.
2. A range of 6 octaves can be played, from about
31 Hz up to 2092 Hz.
3. Different voicing (different sounds) can be specified
any time in the musical piece by typing CTR l-E and a
number 0 thru 9 to pick the sound.
4. Three different volume levels can be called upon for
loud and soft passages of music.
5. The duration of the note can be set from a whole
note (W) down to a thirty-second note (T), to satisfy most
music fans, any time in the musical measure.
6. The tempo of the music can be changed to three
different rates including a nominal 100 beats a minute.
If you have a convenient way of loading programs into
your 8080 computer, I am sure you will enjoy this program.
This is a NOTEworthy routine that will MEASURE up
to any other music program and help you SCALE new heights
in micro-computer enjoyment by BEATing the dull and
average software.

Editor's Note: Malcolm Wright is the designer of this system,
and the author of Alpha-Numeric Music with Amplitude
Control. Please see page 35 for ordering information.

Dr. Drobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 31

PROGRAM
A

REPOSITORY

PUBL.IC DOMAIN

&

TAPE

ALTERNATIVE: TO

DUPLICATION

FACILITY

MA.NIJFACTURE.:ns· USER

GROUPS

The Community Computer Center (CCC) will act as a
repository for program tapes; both source tapes and binary tapes.
Everyone wishing to contribute programs to the public domain
may do so by forwarding appropriate paper tapes to CCC. In
particular, if you are hesitant about submitting a program for
publication in Dr_ Dobb 's Journal because you don't want to
hassle with its distribution, you are encouraged to forward the
tapes to CCC and the documentation to the Journal for publication.
The CCC will thus serve as a desirable alternative and
supplement to the User Groups that are controlled and operated
by many of the processor manufacturers, some of whom charge
up to $100 for " membership " and access to the programs that
their customers developed and offered to the User Group, without
compensation.
There is no membership fee for access to the tapes from the
Community Computer Center. Instead, one pays only for the
duplication and mailing costs:
Duplication charge: $1/ounce or fraction thereof, for tapes
(weighed after punching on fanfold tape)
(Add 6% tax for orders mailed to a California address)
Postage & handling: $0.50 on orders of $5 and less
$1 on orders exceeding $5
Payment must accompany all orders. Orders will be mailed
First Class, within 3 days of receipt.
Lists of available tapes will be published, periodically, in
Dr. Dobb 's Journal, as well as being available from CCC:

Community Computer Center
1919 Menalto Avenue
Menlo Park, CA 94025
( 415)326-4444
The following source tapes are currently available. They
are programs written for the version of BASIC that is implemented
,for the HP 2000F minicomputers, and are discussed in What To Do
After You Hit Return (available from the PCC Bookstore, $6.95).
Numher Guessing Games
Nun1hl!'r
Abase

Sl2

8oJr1.l G:urn:s
Quhu:5

2

Trap
Stars
Clocks

3

Rnvcr

8;1~cls

3

But1011

Wdc.:omc to the Caves

2

QuaJ~I

2
SIO

Wnn.IG.1mcs
11:.rn~mn

Mudlih
Word

" Nimlikc " Games

2JM1 & lt; h
Batnum
Nim

3
3
6
2
SI I

~L & gt;

$22

J

s

7

~brl;t•I

5

Slock
Polky
Polut
Science Fiction

s

4
4
G~mi:s

Tratlct

S!trl
Usl Chapter

Crash
Lunar

'2

Rl..'vcrs
Zc.·ros

2
SI I

TaxmJn
The following t:·m·.cs arc in
0-Jflmuulh BASIC
Murie

3
3
3
3
3
For historical rea1'ons,

Sl2
10

9
$10

4
3

2
3
3

R~S(llC

rec mainlnins a d;ffcri:nt

pr kc schedule for pmt:.ig...: and banJling

on this pJrtkular set of tapes:
i.:h:1rg.l~

aml tJx. JS aho\.'e
postage and hanJl111!!.:
$0.50 on ordcr'i untkr $10
S 1.00 on {1rJcr
SI 0 ur more

nr

Page 32

Sd~!B;e

Civil:!

s4

duplic:ition

s9

5
4
5

Kin~

s

Zot

Ufe
Amaze

Caws2
Btisincss & Sod;JI
llanubi

3
4
3

Ch0mp

Sunsgn
Biosin
ManJal

Caves I
Wumpus

2

Lt'11Cr
Al·a~d

l liJc-n-Sl'l!k in
flrnllc
Mu!tWmp
Su.;1rk
P..d ttrn Gam & lt; !s
!};ogle

SI I
5
4
3
5

GonHlku
Teaser

b~te

We are experimenting with offering a " Want Ad " section. We
will continue to do it as long as we can afford it (in terms of
staff time and printing costs). Note: the charge for running an
ad will undoubtedly increase as our circulation (and printing
costs) increases.
Please follow these instructions in submitting ads. Ads received in
other than this form cannot be accepted, and will be returned to the
sender.
1.
Type the ad, with a blank space between each line, in lines no
more than 50 character positions in length.
2.
Include at least your name and address as part of the ad.
" Blind " ads will not be accepted.
3.
Compute the charge on the basis of $1 per line or partial line,
per issue.
Forward the typed copy and a check or money order payable
4.
to " PCC, " to: DDJ Byte Swap, PCC, Box 310, Menlo Park CA 94025.
Do not send r.ash. Your cancelled check is your receipt. Payment
must accompany the ad.
OQOOOOQOOQQQQQQQORRRRRRROORRRRpOQORROROgDAOA

SELL: MIL MOD-8 with MONITOR, TVT-1 with UART and keyboard, Creed TTY, Altair 8800 new kit, unassembled. Send SASE to
R. Schultz, 611 N. Dexter, Lansing MI 48910. -5/14/76

" BASIC JUST WON'T CUT IT.
GET STARTED ON A NEW LANGUAGE. "
Dear Jim Warren,
May 15, 1976
I think you are wasting good space with still another
version of BASIC. BASIC just won't cut it.
Suggest you get started on a new language for hobbyists
with the best features of many languages. Should come in
various sizes, always upward compatible. Also, it should be
interpretive for fast programming, and c0mpilable for fast
execution.
24365 Clipstone
Bill Roch
Woodland Hills CA 91364
HOW 'BOUT SMALL PASCAL?
Bill,
I fully agree. You're asking for a lot in requesting various
sizes + upwards compatibility + interpretable + compilable, but
I hope to offer at least part of that in our next HLL (High
Level Language) for micros. Unless someone else volunteers to
initiate a HLL project through the Journal in the next month or
three, I hope to start a build-your-own-compiler project called
SMALL PASCAL. My plan is to detail the design of each
module of a compiler in a series of articles. The compiler will
be for a block-structured PASCAL-like language, trimmed for
microcomputer size, and modified as appropriate for a pre·
sumed interactive, stand-alone environment (as opposed to a
batch system). At this point, expandability and interpretability
are low-priority goals for this project, but I'll keep them in
mind.
I defmitely wish to " push " a " good " HLL, instead of con, tinning emphasis or reinforcement of BASIC. BASIC is better
than nothing (and, currently, nothing else is available for
hobbyists). However, I see no reason to continue to eat 19¢
hamburgers when classy filet mignons are available at the cost
of a little interesting effort. -JCW, Jr.

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May, 1976

DR. COBB'S JOURNAL Of' COMPUTER CALISTHENTICS AND ORTHODONTIA

is published ten time per year' monthly except in

July and December.
U.S. Subscriptions:

For foreign subscriptions:

D $1.50 for a single copy: Vol. __ , No.__
D add $4.00 per year for surface mail, or
D $3.00 for the first three issues
D add $12.00 per year for air mail
D $10.00 per year (10 issues/year): Begin with Vol. __ No. __
Payment must accompany the subscription. We do not invoice for subscriptions or single orders.
Necessary Information:

Send to: PCC
P.O. Box 310
Menlo Park, Ca. 94025
Name (last name f i r s t ) - - - - - - - - - - - - - - - - - - - - - - - - - - -

Mailing A d d r e s s - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

City ____________ State _ _ _ _ _ _ _ Zip Code _ _ _ _ _ _ _ __
D yes D no: This information may be published in directories and lists of individuals interested in
computers in non-commercial environments.
Optional Information:
Equipment that you have or are planning on purchasing, immediately:
Make & model - - - - - - - - - - - - Manufacturer - - - - - - - - - - - - - CPU model - - - - - - - - - - - - - CPU Manufacturer - - - - - - - - - - - I/OD e~ces _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __
Mass storage peripherals

Primary areas of interest concerning non-commercial and home computers:

Questions: What would you like to see published in DR. COBB'S JOURNAL? It will help guide us if you will rate these, I to IO
(I - minimally desire; 10 - super-eager to see) or 0 (would prefer we not waste space publishing it).
___ Schematics and acticles from all of the computer club newsletters
_ _ Short news articles directly related to home computers
_ _ Short news articles concerning computers in general, particularly their social implications
_ _ Indices to all articles in all other computer hobby publications
_ _ Indices to selected articles from other computer, electronic, and trade publications
_ _ Letters ha~ng technical, critical, or entertaining content
_ _ Classified ads (as opposed to display advertising)
_ _ Suggestions and " blue skying " about what can be done with home computers in the foreseeable future.

~

OVER~

, Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 33

--·· -·

·-

-· ···-··-

Directories of:
_ _ Users of home computers and their equipment
_ _ Computer stores and distributers
_ _ Manufacturers of computer kits
'

Source code listings and documentation:

_ _ Computer clubs
_ _Sources of used equipment
_ _ Microprocessor and minicomputer manufacturers

For which microprocessors?

_ _ Nearly full-sized (much less can be published)
Reduced as in recent issues (more difficult to read, but more info included in each issue)
-What kind of software would you like to see developed and placed in the public domain?
Importance Rating

Software Description

i
Place
13-cent
stamp
here

DR DOBB'S JOURNAL OF
COMPUTER CALISTHENICS & ORTHODONTIA

PCC
BOX 310
MENLO PARK CA 94025

i

To use this as a self-mailer: 1. Fold it so this third covers the tap third. 2. Place the proper postage, above. 3. If you are subscribing, insert your
check so that it crosses a fold. 4. Staple this closed with a single staple, making sure that the staple pierces the check.
(Better still, stick all of this in your own envelope, and mail it to us.)

What else would you like to see us publish? Please use another page or ten, if you need them.

Page 34

Dr. Cobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

May, 1976

ACTIVE FILTER COOKBOOK
Don Lancaster. 1975. 240 pp. $14.95.

E

ADVANCED APPLICATIONS FOR POCKET CALCULATORS
Jack Gilbert. 1975. 304 pp. $5.95.
ALPHA-NUMERIC MUSIC WITH AMPLITUDE CONTROL
Malcolm Wright. 1975. 23 pp. $2. Xeroxed.

MATH WRITING & GAMES IN THE OPEN CLASSROOM
Herbert Kohl. 1974. 252 pp. $2.45.
MY COMPUTER LIKES ME WHEN I SPEAK IN BASIC
Bob Albrecht. 1972. 64 pp. $2.

MY COMPUTER LIKES ME WHEN I SPEAK JN BASIC
Bob Albrecht. 1972. 64 pp. $2.

BIOFEEDBACK: Turning on the Power of your Mind
Marvin Karlins & Lewis Anderson. 1973. 190 pp. $1.25.

MICROPROCESSOR/MICROPROGRAMMING HANDBOOK
Brice Ward. 1976. 294 pp. $6.95.

BIOFEEDBACK AND THE ARTS
Edited by David Rosenboom. 1976. 163 pp. $12.95. Hardbound.

NEW MIND, NEW BODY; BIO-FEEDBACK: New Directions for
the Mind
Barbara Brown, Ph.D. 1974. 523 pp. $2.50.

BASIC
Albrecht, Finkel, & Brown. 1973. 325 pp. ,J3.95.
BASIC BASIC
James Coan. 1970. 256 pp. $3.95.
BASIC PROGRAMMING
Kemeny & Kurtz. 1961, 1971. 150 pp. $6.95.
THE JJEST OF CREATIVE COMPUTING, Vol. 1
David Ahl, editor. 1976. 328 pp. $8.95.
BODY TIME
Gay Gaer Luce. 1973. 411 pp. $1.25.
THE BUGBOOK I & II with INSTRUCTOR'S WORKBOOK
Rony, Larsen, & Braden. 1974. $16.95. 2 volumes + workbook.
THE BUGBOOK Ill
Rony, Larsen, & Titus. 1975. $14. 95.
CALCULATOR CALCULUS
George McCarty. 1975. 254 pp. $8. 75.
COMPUTER LIB/DREAM MACHINES
Theodore Nelson. 1974. 18,6 pp. $7.
COMPUTERS & COMPUTATION
Scientific American. 1950 - 1971. 280 pp. $6.
ELECTRONIC PROJpCTS FOR MUSICIANS
Craig Anderton. 1975. 134 pp. $6.95.
FUNDAMENTALS & APPLICATIONS OF DIGITAL LOGIC CIRCUITS
Sol Libes. 1975. 192 pp. $5.98.
FUN & GAMES WITH THE COMPUTER
Edwin Sage. 1975. 360 pp. $5.95.
GAMES, TRICKS, & PUZZLES FOR A HAND CALCULATOR
Wallace Judd. 1974. 100 pp. $2.95.
GAMES WITH THE POCKET CALCULATOR
Thiagaragan & Stolovitch. 1976. 64 pp. $2.
GETTING THE MOST OUT OF YOUR ELECTRONIC CALCULATOR
William Hunter. 1974. 204 pp. $4.95.
INTRODUCTION TO MICROCOMPUTERS
Adam Osborne & Associates, Inc. 1975. 384 pp. $7.50.

101 BASIC COMPUTER GAMES
David Ahl, editor. 1974. 250 pp. $7.50.
PRINCIPLES & PRACTICE OF ELECTRONIC MUSIC
Gilbert Trythall. 1973. 214 pp. $6. 95.
PROBLEMS FOR COMPUTER SOLUTION
Gruenberger & Jaffray. 1965. $7.95.
PROBABILITY
D.J. Koosis. 1973. 163 pp. $2.95.
PROFESSOR GOOGOL'S MATH PRIMER
Sam Valenza Jr. 1973. 144 pp. 13.25.
PROF E. McSQUARED'S (ORIGINAL FANTASTIC & SATISFYING
CALCULUS PRIMER)
Swann & Johnson. 1975. 111 pp. $2.95.
PROGRAMMING PROVERBS
Henry Ledgard. 1975. 134 pp. $5.95.
PCC GAMES' PROGRAM LISTINGS
PCC. 1974. 31 pp. $2.
STATISTICS
D.j. Koosis. 1972. 282 pp. $3.95.
TEACH YOURSELF BASIC, Volumes 1 & 2
Tecnica Education Corp. 1970. 64 pp each. $1.95 each.
TTL COOKBOOK
Don Lancaster. 1974. 328 pp. $7.95.
TV TYPEWRITER COOKBOOK
Don Lancaster. 1976. 256 pp. $9.95.
D CYBERNETIC FRONTIERS

Stewart Brand. 1974. 96 pp. 12.
THE UNIVERSAL TRAVELER
Don Koberg & Jim Bagnall. 1974. 128 pp. $4.95.
WHOLE EARTH EPJLOG
Stewart Brand, editor. 1974. 318 pp. $4.
WHAT TO DO AFTER YOU HIT RETURN or PCC'S FIRST BOOK
OF COMPUTER GAMES
PCC. 1975. 157 pp. $6.95.

List tit6e and quantity for each item you wish to order. {Orders to be shipped within California require a sales ta:1t remittance of 6%.) For orders
less than $Hl, a~d $1 for postage and handling; for orders $10 and more, add $2. Send your order, along with your check or money order, to:
PCC, Box 310, Menlo Park CA 94025. Thank you.

May, 1976

Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box 310, Menlo Park CA 94025

Page 35

DR DOBB'S JOURNAL OF
COMPUTER CALISTHENICS & ORTHODONTIA

PCC
Box 310
Menlo Park CA 94025

=

I

=

IS

I

s

I

DR. DOBB'S JOURNAL

E

c s
s

from

ENT

c

Y FRIE

c

PUTERS

(THROUGH JULY 31 ST, 197 6)
Applied Computer Technology (ACT) plans to open the " Kentucky Fried Computers " computer
store in Berkeley, California, later this ye::ir. Until then ACT will sell computer kits on a mail order
and telephone order basis. Kits may be picked up in person, by appointment, or shipped at the
customer's option.
While we can't offer the kind of one-to-one customer service we would like until we open the
store, we can fill an important need for computer hobbyists: we sell from stock--your order goes out
the door as soon as you pay for it.
Right now we are stocking IMSAI Computers (1-8080 with 22-slot motherboard), and IMSAI
4K RAMS (RAM4A-4). We will also take orders on any other IMSAI products. These products have
the foll IMSAi warrnnty, and IMSAI will provide their excellent customer assistance service.
Clip the coupon for your 10% discount. California residents add 6% sales tax. Add 2% for
shipped orders (excess refunded).
Our motto: A computer in every pot.
Applied Computer Technoiogy

DR. DOBB1 S DISCOUNT COUPON
10% off on Kentucky Fried Computer Orders
Offer good through July 31, 1976

1038 Merced St
Berkeley CA 94707

(415) 527-6760