Skip to main content

Full text of "Dr. Dobb's Journal - Vol 3"

See other formats


Dr. DoBB'S (OURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 


A Reference Journal for Users of Home Computers 


Volu me Th ree 




I’i The People’s Computer Company Series 
























4 




\ 

j 









Dr. Dobb’s Journal 

of Computer Calisthenics 6 Orthodontia, 

Volume Three 




1 








Dr. DoBB'S JOURNALof 

COMPUTER 

(Calisthenics ^5 Orthodontia 

Running Light Without Overbyte 


A Reference Journal for Users of Home Computers 


Volume Th ree 



K3 The People's Computer Company Series 


[7TI HAYDEN BOOK COMPANY, INC. 
1 H I Rochelle Park, New Jersey 











Acknowledgments 

Profuse thanks to all the authors and readers who contribute articles and share 
ideas with Dr. Dobb’s. Dr. Dobb's Journal, distributed worldwide, owes its 
existence to you. Thanks also to the employees and other supporters of People’s 
Computer Company who have seen Dr. Dobb’s through its inception, growing 
pains and success. 

Full-page computer art by David Dameron. 

Linocut of griffin by Wendy Palmer. The mythological griffin, half lion and half 
eagle, has long stood as an enemy of ignorance. 


ISBN 0-8104-54904 


Copyright ©1980 by People’s Computer Company. All rights reserved. No 
part of this book may be reprinted, or reproduced, or utilized in any form or 
by any electronic, mechanical, or other means, now known or hereafter invented, 
including photocopying and recording, or in any information storage and 
retrieval system, without permission in writing from the Publisher. 

Printed in the United States of America 


3 4 5 6 7 8 9 PRINTING 


81 82 83 84 85 86 87 88 


YEAR 



Editors Prefa ce 


The third volume of Dr. Dobb's Journal represented a year of growth and maturity in the 
field of small computers, a maturity evident among manufacturers and users. Although Dr. 
Dobb’s has always been primarily a software journal, Volume III reflects this increased sophisti¬ 
cation with a substantial increase in the number of software articles. It branched out to include 
more microprocessors, most notably the 6502, used in the Apple, PET, and KIM 1. Software 
was somewhat different from that submitted in 1977; the earlier emphasis on systems yielded 
to the exploration of programming languages and to theoretical articles on computing in 
general. New implementations of languages for microcomputers SAM-76, UCSD PASCAL, 
BASEX, and FORTH were given extensive treatment. 

Yet, there were still specialized applications, utilities, and unique discoveries made by 
readers eager to share their findings. Graphics programs for various systems, a Z-80 debugger, a 
KIM-1 editor, a renumbering program for the Apple, several 6502 cassette interface routines, 
and much, much more were published. 

Many of the articles stressed technique rather than specific implementation, which speaks 
for the sophistication of the readers. As the year progressed, readers were able to adapt tech¬ 
niques and examples to their particular hardware system requirements. Specific applications 
articles stressed the algorithmic aspect more than in the past. (For example, see Richard 
Emerson’s “Shorter Printer Driver for PolyMorphic BASIC.” The article gives a specific appli¬ 
cation, and gives the reader introduction to the concept of circular buffers. J.M. Terry offers 
an equally informative discussion of the basics of list processing; Mike Gabrielson gives a clear 
and entertaining look at “Binary Tree Manipulation.”) 

Reader debates ranged from controversies over hex versus octal notation to the relative 
merits of languages. Follow, for example, the lively exchanges between the proponents of 
FORTH and STRUBAL to get the flavor of discussion. 

By the end of 1978, it was apparent that small computers could have as great an effect on 
human society as printing has had. A tremendous base of knowledge for computers had been 
established. Industry gurus were losing sleep trying to predict where it was all going to lead. 

And where will it lead? 

Among the effects the microcomputer will have on our world will be a profound increase 
in the volume and quantity of communication. When small computers are linked by means of 
satellites to other computers as well as to large data bases, the world will see an information 
revolution before which the invention of printing will pale. That day has been brought closer 
by the readers and contributors of Dr Dobb’s. 


Tom Williams 
Editor, Volume III 



Contents 


VOLUME 3, NUMBER 1, 1978 


13 

14 

15 

16 
18 
20 
28 
48 


The Heath H-8 “Evaluation”: I Think We Blew It! 
Memory Test for 6502 Carl Moser 
Consarn That H-8! Craig A. Pearce 
Challenging Challenger’s ROMs Stephen P. Smith 
Is Your Assembly Language Program Well Structured? 
ISIS: Anatomy of a Real-World Operating System 
The SAM76 Language Ancelme Roichel 
An 8080 Disassembler & Support Software for SOL 


Jim C. Warren, Jr., Editor 


Webb Simmons 
Perry C. Hutchison 

Don Van Dyke 


VOLUME 3, NUMBER 2, 1978 


60 ET TU, KLATU? Stanford News Service 

61 Decoding Efficiency & Speed: Pros & Cons of Table Look-up H.T. Gordon 
64 MITS 4.0/4.1 BASIC Searcher/Patcher James Monagan 

66 A Simple Technique for Static Relocation of Absolute Machine Code 
Gary A. Kildall 

70 Relocation is Not Just Moving Programs Richard L. Roth 
78 Absolutely Dazzling Dazzleware Gordon French & Gregory Yob 
86 Dazzler Driver Subroutine and a “Chase” Phillip Simpson 

98 Z-80 RAM Tester John MacDougall 

99 Mini Editor for 8080 PILOT Tim Scully 

101 The Last Rehash of Beau Hex? letters in the unending(?) hex/octal debate 


VOLUME 3, NUMBER 3, 1978 


106 Renumbering and Appending BASIC Programs on the Apple-II Computer 

Steve Wozniak 

112 STRUBAL: A Structured BASIC Compiler Robert Grappel 

113 A Z-80 Tracer Arthur W. Cline 

115 A KIM Binary Calculator John Eaton 
118 Status of the UCSD PASCAL Project Kenneth Bowles 
122 ACT — An 8080 Macroprocessor — Part I Alex Cecil 
148 SAM 76 — Additional Comments Ancelme Roichel 






VOLUME 3, NUMBER 4, 1978 


152 List Processing Unravelled: Pointers, Chains, Rings and Trees J.M. Terry 

157 The Oznaki “Life” Harvey A. Cohen 

159 AIK Debugger for the Z-80 Les Hancock 

166 Exit This Reviewer Jef Raskin 

169 A Line-Oriented PILOT Editor David J. Morgan 

174 ACT—An 8080 Macroprocessor — Part II Alex Cecil 


VOLUME 3, NUMBER 5, 1978 


198 Programming Language Translation Techniques W. M. McKeeman 

211 Yet Another Body Ken Anderson 

215 FORTH for Microcomputers John James 

222 Resident Memory Test Systems Terry Ritter 

228 EDITH A: A Revision of the Fylstra KIM -1 Editor Program H.T. Gordon 
234 Proposed Standard for the S-100 Bus George Morrow and Howard Fullmer 


VOLUME 3, NUMBER 6, 1978 


244 Intelligent Terminal Implementation on the S-100 Bus Tim Pugh 
257 Autodump Richard Emerson 

263 High-Speed Cassette I/O for the KIM-1 Theodore E. Bridge 

267 The Zilog Z-8 U.R. Source 

270 LAZARUS Andrew Hertzfeld 

273 A Tiny BASIC Extensions Package Leor Zolman 


VOLUME 3, NUMBER 7, 1978 


290 A Compact 8080 Disassembler & Dumper Richard Greenlaw 

305 The Intel 8086 Mike Gabrielson 

308 A IK Utilities Package for the Z-80 Les Hancock 

313 A Shorter Printer Driver for PolyMorphic’s BASIC Richard B. Emerson 

317 Fast Cassette Interface for the 6502 Carl Moser 

320 A BASIC Renumbering Program John B. Trenholme 

328 Custom File Routines for ALS-8 Larry A. Marek 

332 Common PILOT: Progress Report Larry Kheriaty and George Gerhold 


VOLUME3, NUMBER 8, 1978 


338 

354 

358 

360 

364 

367 

372 

376 


EM8080: An 8080 Emulator for 6800 Systems Gary Gaugler 

The Last of the First Aubrey Dahl 

Lisp for the 6800 Fritz van der Wateren 

FORTH Dump Programs John James 

Making a New Case for the H-9 Terminal Howard L. Nurse 

A Programmable IC Tester for KIM Joel Swank 

Dumping Northstar Disk Files Titus Purdin 

Vocal Memory Dump Phil Mork 


i 











V0LUME3, NUMBER 9, 1978 


386 LEDIP: A KIM/6502 Line Editor Kiumi Akingbehin 

395 Quick and Dirty Routines for BASIC Dennis Allison 

398 The Digicast™ Project Jim Warren 

400 POW: An 8080‘Processor of Words’ Herman Watson 

412 Data-Boy™ Speech Processor James Anderson 

416 Whatis: An 8080 Expression Evaluator Mike Gabrielson 


VOLUME3, NUMBER 10, 1978 


429 A LISP interpreter for the 8080 Darrel Van Buer 

437 Curve-Fitting Using a Focal Interpreter on the KIM-1 Theodore E. Bridge 

440 Binary Tree Manipulation on the 8080 Mike Gabrielson 

443 Programming Languages and Standards David Chapman 

444 SAM-76 Language Update Ancelme Roichel 

447 The Heath H-8 System Tom Williams 

451 BASEX: A Fast, Compact Interactive Compiler Paul K. Warme 
457 Tiny GRAFIX for Tiny BASIC Joel Swank 
459 The STD Bus Keith Britton 

465 Copying a Diskette on Intel Double Density DOS Paul M. Julich 
474 Index to Volumes One, Two, and Three 




About 

People’s Computer Company 

People’s Computer Company was founded in 1972 to demystify computers by teaching 
people how to use them. It is still carrying on that crusade through magazines, books and 
informal classes. 

As one of PCC’s founders, Bob Albrecht explained in the first issue of the PCC newspaper, 
“Computers are mostly used against people instead of for people, used to control people in¬ 
stead of to free them. It’s time to change all that. We need a People’s Computer Company.” 

Since then, in its role as a non-profit, educational corporation, PCC has published a news¬ 
paper, three magazines, and several books on home/personal computing. The Personal Com¬ 
puter NETwork, (PCNET) joined People’s Computer Company in March, 1979. PCNET is a 
Bay Area, California group dedicated since 1977 to the development of personal computer- 
based telecommunications. Computertown, U.S.A.!, a computer literacy project joined People’s 
Computer Company in August, 1979. In the past PCC also operated a neighborhood computer 
center, and a mail-order bookstore. 

Today, the PCC magazines — Recreational Computing, Dr. Dobb’s Journal, and Computer 
Music Journal — have a combined circulation of about 28,000 (paid subscribers plus news¬ 
stand sales). 

People’s Computer Company sprang from the same roots as the Whole Earth Catalog. 

Both were offshoots of the Portola Institute of Menlo Park, an organization dedicated to invest¬ 
igating and promoting the idea of alternative technology. For the founders of PCC, that meant 
learning to use computers as a liberating force in society. 

In PCC’s view, familiarity with computers breeds confidence and personal power. “The com¬ 
puter-liberated kid grows up to be an adult unafraid to challenge his bills — or anything else 
in the world’s great electronic system,” says Albrecht. 

People’s Computer Company publishes three magazines for three distinct audiences. The 
oldest, Recreational Computing, is for the computer novice to the intermediate hobbyist. It 
started out as a newspaper called People’s Computer Company, evolved into People’s Com¬ 
puters magazine, and took its present name with the January-February 1979 issue. The maga¬ 
zine is published bimonthly. 

“It’s in the home—in a relaxed, recreational environment—that the real computer revolution 
is going to take place over the next few years,” said Albrecht. 

As the first publication in the personal computing field, Recreational Computing has 
spawned imitators. “But we feel we have a very special niche,” says publisher Willard Holden. 
“Recreational Computing takes risks that other publications don’t. We are willing to publish 
articles that may be off-beat and outrageous if we think they will get people excited about the 
possibilities of computers.” 

Dr. Dobb’s Journal, PCC’s second publication, had its beginning in January 1976 as a short¬ 
term mimeographed forum for the newly written Tiny Basic language. Reader response was so 
strong that the Journal went into steady publication. Most DDJ readers describe themselves as 
having from intermediate to extensive computer experience. 

Dr. Dobb’s Journal is a reference journal read worldwide. Ten percent of the circulation is 
outside the United States. The magazine contains sophisticated discussions of programming 
techniques and hardware modifications. About half of each issue is devoted to free software. 
DDJ appears ten times a year. 

Computer Music Journal, the third PCC publication, is at the forefront of new developments 
in the computer music world. During the past 20 years, there has been extensive research in 
applying computers to music. The results of this research are becoming more visible as digital 
techniques transform music production, music analysis, and music recording. 

Computer Music Journal, published since 1977, is a respected source for information in this 
field. The Journal is distributed quarterly to universities, research institutes, and individual 
subscribers in 27 countries. 

People’s Computer Company occupies the second floor of a small office building in down¬ 
town Menlo Park. The 30 staff members, more than half of whom are part-time, have pro¬ 
fessional interests in education, art, musical composition, computer science and journalism. 

People’s Computer Company 
Box E 

Menlo Park, CA 94025 




dr. dobbs journal of 


COMPUTER 


C 


alisthenics 


60 


rthodontia 


Running Light Without Overbyte 


Number 21 


Box E, Menlo Park, CA 94025 


Volume 3, Issue 1 


A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


Heath's H-8 

The Heath H-8 “Evaluation”: 1 Think We Blew It! — Jim C. Warren, Jr., Editor 3 

Consam That H-8! — Craig A. Pearce 5 

a tongue-in-cheek scolding of DDJ 


6502 Stuff 

Memory Test for 6502 - Carl Moser 4 

Challenging Challenger’s ROMs - Stephen P. Smith 6 

Software Design & Implementations 

Is Your Assembly Language Program Well Structured? — Webb Simmons 8 

ISIS: Anatomy of a Real-World Operating System — Perry C. Hutchison 10 

an "internal logic manual” for Intel's ISIS 

The SAM76 Language — Ancelme Roichel 18 

complete documentation of a powerful string & macro processor 
An 8080 Disassembler & Support Software for SOL — Don Van Dyke 


38 





© David Dameron 1979 


•5 





















THE HEATH H-8 “EVALUATION”: 

I THINK WE BLEW IT! 

Jim C. Warren, Jr., Editor, DDJ 

In issue 19 of Dr. Dobb’s, we published a rather negative 
evaluation (?) of Heath’s H-8, along with a detailed 
response from Heath. The evaluation was written by a 
person we know personally whose technical judgment has 
proven to be fair and accurate in the past. At his request, 
we withheld his identity from publication—an editorial 
policy that is quite common among periodicals ... at least, 
regarding “Letters to the Editor.” 

In retrospect, it is beginning to appear that we were 
wrong on several counts. 

(1) . If we were going to publish an article, giving it the 
strength of being a DDJ “evaluation”, then we should 
have identified the author. While it may be appropriate to 
withhold a writer’s identity when publishing a letter to 
the editor, we have concluded that authors of articles— 
and certainly of product evaluations—should be identified, 
and we will do so in the future. 

(2) . We have been receiving additional feedback from 
other H-8 consumers, and have found it to be explicitly 
contradictory to a number of complaints in the original 
article we published. We have been publishing and will 
continue to publish such follow-up information. 

(3) . We currently have, in-house, an H-8 kit shipped to 
us by Heath for evaluation. Tom Williams, our Associate 
Editor, is currently in the process of constructing it and 
has already found a number of points of disagreement 
with the original negative evaluation. As soon as he finishes 
the construction and testing of the kit, we will be 
publishing his evaluation of the kit, as an evaluation per¬ 
formed by a Dr. Dobb’s Editor, in-house. 

We would like to apologize to Heath and to our readers 
for having published what is beginning to appear to have 
been an inaccurate and poorly researched “evaluation” 
of the H-8. It is no more appropriate to publish an inaccu¬ 
rate negative article concerning a product, than it is to 
publish an inaccurate article that praises a product. Articles 
are written by individuals, and evaluations require judgment 
on the part of the individual doing the writing. In this 
case, it appears that the author of the article erred in 
significant aspects of his judgment, and that we erred in 
trusting his judgment. For this, we apologize. 


RS-232 ADAPTER FOR KIM 


News Release Received: 77 Dec 20 

The ADApter converts KIM’s 20 ma. current loop port to 
an RS-232 port. ADA does not affect the baud rate and uses 
standard power supplies. The unit comes complete with 
instructions, is assembled and tested, and measures 3” x 3 VJ’ 
x 1 ”. KIM is isolated from the RS-232 device by optoisolators. 

ADA sells for $24.50 with drilled, plated through solder 
pads for all connections, or for $29.50 with barrier strips and 
screw terminals. Connecticut Microcomputer, 150 Pocono Rd, 
Brookfield, CT 06804, (203) 775 -9659. 


UNSUPPORTED OPCODE PITFALLS 

Dear Jim, Received: 78 Jan 9 

Pardon my tardiness, but when I got around to the article 
on 650X Opcodes (August 1977) it set off a sensitive nerve. 
In my opinion, there are no words strong enough to convey 
an adequate warning against investing any significant time and 
effort in hardware or software that is either irreplaceable or 
not yours to use. 

Before you use unsupported “instructions” in an MPU, 
before you buy that music board with the secret, proprietary, 
irreplaceable kludge chip, before you buy that proprietary 
computer language, ask yourself what you will do if your 
marbles get taken away. Suppose the chip blows? They do, 
you know. Suppose your supplier goes out of business? 
Suppose he merely multiplies the annual support/royalty 
charges by ten? 

My advice is to do what knowledgeable people in the 
electronics industry have usually done: unless it’s in the 
nature of a throwaway, don’t even think about buying it 
or renting it or using it unless you have a clear alternative 
if your supplier starts to behave unacceptably, or ceases to 
exist. People who disobey that injunction have been badly 
burned in the past, and will be badly burned in the future. 

So have fun with the unsupported opcodes, marvel at 
the secret kludge chips, and read about the latest super-gizmo 
proprietary packages. But don’t tie yourself too heavily to 
any of them. 

Cordially yours, 730 Witte Hall 

Paul Schick Madison, Wise. 53706 



ERROR ON MOSTEK ERRATA 

Dear Mr. Warren: Received: 78 Jan 10 

I recently received the October 1977 issue of Dr. Dobb’s 
and have found a letter entitled “MOSTEK/Zilog Flag Flap” 
which is in error and could mislead your readers. 

MOSTEK is a fully licensed second source of the Z80 chip 
set (CPU, PIO, CTC, CMA and SIO) designed by Zilog. As 
such, MOSTEK fabricates the Z80chip setfrom masks designed 
by Zilog with no problems. 

Reader Caldwell’s confusion stems from an error in our first 
printing of the MOSTEK Z80 Programming Manual. An 
ERRATA sheet has been added to successive printings of the 
manual to correct the errors and available to anyone who 
contacts us regarding this matter. 

Both the MOSTEK and Zilog Z80-CPU devices set the 
carry flag when subtraction generates a borrow. This is also 
compatible with the operation of the 8080A as the 8080A 
instruction set is a subset of the Z80 instruction set. 

MOSTEK is concerned that Caldwell’s letter in your pub¬ 
lication will mislead your readers. Therefore, we encourage 
you to print this letter and the enclosed ERRATA sheet in 
your next issue. If any of your readers have questions regard¬ 
ing this matter, feel free to contact me or any of our Field 
Applications Engineers. 

Regards, MOSTEK Corporation 

James F. Vittera P.O. Box 169 

Applications Engineering Carrollton, TX 75006 


Number 21 


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


Page 3 


13 




MEMORY TEST FOR 6502 


Dear Mr. Warren: Received: 78 Jan 3 

Enclosed is a source listing of a program which tests RAM 
memory in 6502 based systems. I wrote this test after using 
other memory test programs which did not perform a 
complete test. The problem areas were untested chip selects, 
and address line inputs. This program written in my assembler’s 
source syntax (advertised in Vol.2 No. 8 of DDJ), performs 
an exhaustive test of a user specified range of memory. The 
I/O is arranged for 6502 TIM based systems but can be easily 
changed. 

The program performs two tests: 

Test 1: Tests all memory cells for storage retention, and 
shorted data and address lines. This is done by writing: 
00 11 ... FF 00 11 . .. FF continually throughout 

the memory range for the first pass. When this has been 
written it is checked to validate the data. On the next 
pass 01 02 ... FF 00 01 ... FF is written and check¬ 
ed. This continues for 256 (hex FF) passes until all possible 
combinations of bit patterns have been used. 

Test 2: Tests the RAM chip select inputs. This is the same as 
test 1 except data 00 01 ... F2 00 01 ... F2 is used. 

Before execution, enter the address of the start of the 
memory to be tested in 00C0 (lo) and 00C1 (hi), and the end 
of memory +1 in 00C2 (lo) and 00C3 (hi). 

Execution begins at 0000 with the first test. 

If an error occurs, it will be outputted in the following 
form: 


Address Test Pattern Error 
xxxx yy zz 

When test 1 runs to completion, a break will occur and 
register A will contain El (signifying end of test 1). To exe¬ 
cute test 2, simply continue execution (type G to TIM moni¬ 
tor). 

If errors occur, they will be of the same form as described 
above. When test 1 has mn to completion, a break will 
occur and register A will contain E2 signifying the end. To 
continue execution at test 1, simply type G to the TIM 
monitor. The address range entered in 00C0—00C3 is not 
altered by the memory test program. 

If errors occurred in test 2 but not in test 1, you can safely 
assume a chip select malfunction (defective or not connected). 
Usually a number of errors will occur in test 1 when the fault 
is a single defective address input, data input, or data output. 

If a continuous sequence of addresses with errors occur, the 
problem is likely to be an open data input, or stuck at ‘1’ or 
‘0’ data output. 

If every 2nd, 4th, 8th, 16th or some power of 2 address 
sequence with errors occur, check for defective address inputs. 

If you are checking say 2102’s (1 x IK) and are specifying 
a range of, say 4K of memory, and an error common to the 
whole range occurs, the problem is likely to be in the power 
leads, defective data or address buffers, stuck at ‘0’ address 
inputs, stuck at ‘0’ data inputs, or stuck at ‘0’ data outputs. 

In all of the above, you may have to examine the various 
memory error patterns for some similarity in order to isolate 
the defective component. This is especially true of the 1 x IK 
2102 memory chip where each chip is devoted to a particular 
data lead (D 0 — D 7 ). 

Finally, since this program has a copyright assigned, I 
waive this right for publication in DDJ only.. 

Sincerely, 3239 Linda Dr. 

Carl Moser Winston-Salem, NC 27106 


0901 
000? 
300 4 
0004 

000 s 
0006 


•COPYRIGHT 1977 nr CARL Mf)SER» 
• ALL RIGHTS RESERVED. 


MCS 653? MEMORY TEST 




0007 


PROGRAM 



0009 





0000 

:USER ENTERS MEMORY TO RE TESTED STARTING 



0010 

:ADDRESS IN START* AND END ADDRESS IN ENQ. 



0011 





001? 





9013 

;these storage variaries are external in zero page. 



0014 

START 

•OE «C0 USER ENTERS START OF mem. TO HE If 



0015 

END 

•DE SC2 USER ENTERS FNO OF mfm. TO RE TES 



0015 

AD0RS 

•OE SCI 



0017 

TEST*TYPF 

•DE SC6 



0019 

TESWATRN 

•DE SC7 



0010 





0 0 ? 0 





0 0 ? 1 

: ROM I/O CALLS 



09?? 

TRY! 

• DE 17?R1 OUTPUT A PACKED RYTE (TWO DIGIT' 



00?1 

SPACE? 

.DE S 7174 OUTPUT TWO SPACES 



0 0 ?4 

CRLF 

.DE S7?RA OUTPUT A CARRIAGE RETURN* LINE f 



0025 





00?6 





09?7 


• RA S0 



00?9 



0000 

4 ?04 

0020 

MFM.TFST 

LDX *3 ffl 

000? 

9EC640 

00.10 


six tes r *type test i 

000S 

?0 1 900 

0031 


JSR TEST*PGM 

000A 

4RE1 

303? 


LOA *F 1 

0001 

00 

0033 


RRK 

000R 

E4 

0 434 


NOP 

000C 

F4 

0935 


NOP 

0000 

EEC690 

0036 


INC TEST*TYPE TEST 2 

0010 

201900 

0937 


ISR TEST*PGM 

0013 

ARE? 

0039 


LOA «E? 

0015 

99 

0930 


RRK 

001R 

E4 

9940 


NO J 

0017 

E4 

004 1 


NOP 

001R 

4C0403 

0042 


JMP MEM* TES T 



034 3 



0 419 

?09 4 7 ? 

0044 

TEST*PGM 

JSR CRLF 

00 IE 

4 4 49 

0 44 5 


LOY *93 PATTERN REGISTER 

0 0 ? 0 

4?09 

9 44 f. 


LDX *33 

002? 

9FC700 

004 7 


ST* TEST*PATRN 

00?S 

4C?E09 

9049 


IMP N<*PASS 



0940 



0029 

EEC704 

0059 

NY*PATRN 

INC TEST*PATRN 

0 4 ?H 

0991 

0051 


RNF NX*PASS 

00?D 

60 

005? 


RTS 

04? E 

ACC70P 

0353 

N < • P A S S 

LOr TFST*PATRN 

0031 

?0450« 

. 0354 


ISR 1N1♦ADORS 

00 34 

09 

0055 

LOOP1 

TY A 

00 35 

9 1C4 

0056 


STA (ADDRS.Y) STORE PATTERN 

0037 

C1C4 

0957 


CMP ( ADDRS*Y) CHECK 

0039 

F 30 3 

0359 


RED N0*ERR1 

0939 

?09513 

0050 


JSR ERROR ADDRS* R ( A)• (ADORS.X) 

043E 

20SE49 

9063 

N0*ERR1 

JSR 1NC* A ODRSC 

0411 

F305 

0061 


RET CK*PA TRN 

4 04 3 

296190 

9 06? 


JSR INC*RY 

3 04 6 

4 C 34 0 9 

0063 


JMP LOOP 1 



0061 



0049 

4CC700 

0065 

CK*PATRN 

LOY TEST**MTRN 

994 C 

?04509 

0966 


ISR 1Nl♦ADDRS INITIALIZE ADDRS 

034E 

09 

0367 

LOOP? 

TYA 

0959 

C1C4 

00F9 


CMP (ADDRS.X) 

90S? 

F 9 4 3 

0060 


RED ND*ERR3 

0054 

?.MS30 

39 70 


JSR ERROR ADDRS* R(A)* (49DRS*X) 

0957 

?06 1(49 

00 7 1 

no* err ? 

JSR INC*RY 

0054 

? 0 6 F 0 '4 

917? 


JSR 1 NC* ADDRSC 

0050 

D0F0 

037.3 


RNF LOOP? 

005F 

F0C7 

0371 


RED NX*PATRN 



30 75 





3076 



9051 

C9 

0077 

1NC*RY 

1 NY 

405? 

4OC500 

9379 


LOA TF$T*TYPF 

4055 

F036 

0070 


RED E< 1 T1 

0057 

C0F 3 

9090 


CP Y *F1 RESET R(y ) TO CHECK CHIP SELECTS 

0051 

000? 

039 1 


RCC E<lTl 

4059 

4?i40 

009? 


LOY *00 

4060 

69 

0093 

E* i r i 

RTS 



0094 





0395 



04RE 

EFC490 

0096 

1NC* 40DHSC 

INC ADDRS 

09 7 1 

0 001 

0397 


HNE SKI«*m| 

49 7 1 

EEC509 

0991 


INC ADDRS**31 

03 75 

ADC ?09 

0390 

SK1P♦HI 

LOA ENO 

90 79 

CDC440 

3000 


CMP ADORS 

047C 

0006 

9901 


RN 6 EXIT? 

407E 

ADC 109 

000? 


LOA FND.S31 

399 1 

CDC590 

3001 


CMP 4D0RS*«91 

0394 

60 

0004 

E* 1 T? 

P T 5 



3006 





0006 





9007 

•OUTPUT ThF ERROR: ADDRESS* PATTERN* ERROR 

00RC 

49 

00OO 

ERROR 

PMA 

4095 

4OC500 

0000 


LDA A0DRS*«91 

3090 

?0917? 

0100 


JSR TR»T OUTPUT ADDRS h| 

0 99 C 

4 DC 4 3 4 

0101 


LOA ADDRS 

309E 

?3R17? 

0 10? 


ISR T B Y T OUTPUT ADDRS LO 

000? 

?0 7 4 7 

0133 


ISR SPACE? 

4915 

69 

0104 


PI A 

9005 

? 71=41 7? 

3195 


JSR TRYT OUTPUT PATTERN 

?0RR 

237471 

3106 


ISR SPACE? 

00OC 

A1C4 

3107 


L D A (ADDRS.X) 

P99E 

?09 1 7 ? 

9109 


JSR TRYT OUTPUT ERROR IN MPMORY 

0001 

?40A 7? 

31.10 


JSR CRLF 

(1414 

69 

0113 


RTS 



3111 





311? 





3111 

INITlALIZE 

ADDRS WITH START 

0045 

AOC400 

0114 

INI* 40DRS 

LPA START 

0049 

9OC400 

3115 


STA ADORS 

0049 

AQC100 

0116 


LOA START.H31 

40 4 E 

9 D C 5 0 9 

3117 


STA ADDRS**'* 1 

0091 

50 

0119 


RTS 


0119 
0 1 ?0 


Page 4 


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


Number 21 







CONSARN THAT H-8! 

Dear Sirs: Received: 78 Jan 12 

I truly enjoyed the article by . . . hmmm . . . let’s see . . . 
no name given, eh? Well, anyway, the article by (must be) 
Dr. Dobbs (or maybe Dr. Duds) himself on the great review of 
the Heath H8 microcomputer. Fantastic! What a swell job 
of reviewing. The author really got to the point. You tell ’em 
Doc. 

The H8 HAS to be the worst 8080A microcomputer out. 
Mine, running with 24K at the moment, actually runs correct¬ 
ly when switched on! No self respecting home computer 
should do that. It even had the audacity to come up running 
immediately after I completed building it! What will all the 
tinkerers do with a system that actually runs ? 

Unlike the original S-100 bus system I first built, the 
H8 can’t destroy memory contents when a reset is performed. 
The damn thing keeps preserving what is in RAM. Further¬ 
more, if you can believe it, this poor machine doesn’t even 
let the novice write his own bootstrap program to use the 
cassette interface .. . one is already in ROM ready to use for 
loading or dumping. Some spoil sports these Heath people 
are, aren’t they? 

That angle rack mounting is really bad. Here, the boards 
are rigidly secured on top, bottom and side, making this 
excuse for a computer simple to transport, rather than having 
the fun of stuffing newspaper or packing ‘pop-corn’ in so the 
boards don’t snap off like some S-100 Systems. Since the 
mounting bracket on each board also acts as a heat sink, the 
fact that they are attached to the computer main frame can 
dissipate the heat even better, and thus, you don’t have the 
fun of leaving the top off the computer like on other 
systems, nor the sheer pleasure of the fan constantly running 
in your ears, since none is needed. 

I was able to fix the problem of not enough stuff on the 
boards that Doc brings up too. (After all, what fun is having 
a circuit board made simple, with fewer parts to go wrong, 
when a jumbled up board, taking three times as long to build is 
much more impressive looking ... even if it doesn’t work.) 
I just glued extra ICs on the board indiscriminately to make 
things more complex! 

At least ol’ Doc, the author of this H8 review, had enough 
sense to leave off the metal clip supplied with the H8 (to be 
placed by the keys mounted on the circuit board) so that his 
board bends as the keys are hit. I, like a fool, followed the 
Heath directions and put the clip on, which totally avoided the 
problem of the bending board Doc points out in his article. 
As soon as I finish this letter, I intend to immediately run up 
and pull the clip off my machine so I can bend my front panel 
board too! 

Oh yes, and then there is that God awful OCTAL! My 
Lord, what a sin! It takes someone almost 10 minutes to get 
used to a new numbering system. I wish I were as lucky as 
Doc, and have 8 thumbs on each hand so I could use Hexadeci¬ 
mal too. 

The fact that you can monitor, both dynamically, as well 
as statically any register, memory location or I/O port via 
the front panel too is also a hardship. I’d much rather have 
a string of LED lights to view and interpret. Or better yet, 
no front panel at all, like the SOL or APPLE II. Where’s the 
challenge in seeing what you’re doing? 

I guess what’s really horrible, as Doc points out, is the fact 
that there is no compatibility with existing S-100 cards. 
No one is going to make H8 compatible cards (excusing the 
already announced Godbout 12K RAM card, or some other 
manufacturers who have also requested to manufacture H8 
compatible cards). I mean, outside of them, there’s only 
Heath. 


By all means, Heath has really gone too far with the H8. 
Swelled heads and too big for their britches, as Doc says. 
They actually had the nerve to offer the typical hobbyist and 
home user a microcomputer that actually works, has a 
functional and useful front panel, compatible software, 
memory boards that hold their contents rather than dropping 
bits, I/O boards that operate correctly the first time they are 
built, solid construction and a design that isn’t a rehash of all 
the other hardware on the market today. Damn innovaters... 
next thing you know, someone may offer documentation that 
isn’t 10 mimeographed sheets (like a lot of other systems) and 
give full support like the H8 documentation. 

Do your readers know that the Heath people are actually 
giving you software in the form of Basic, console debug, 
text editor and assembler with the computer to get the user 
going faster? Where’s that good old “We’ll get ’em on the 
accessories!” rule that has become a standard in the industry? 
The people at Heath even returned my phone calls on some 
questions I had about the system; with right answers even! 
Now what kind of computer manufacturer is that, that 
actually RETURNS the users’ calls, with correct answers to 
boot? No one else that I can think of. 

And, I can see Doc’s dislike of the fact that only the Heath 
part numbers are given on the schematics. Why make it easy 
for the non-technician to order parts through Heath when 
needed? Besides, I guess Doc has the same problem I have of 
not knowing how to use the cross reference table in the 
manual (each has one), which gives the user the standard, 
industrial part number. Hell, you have to know how to match 
up numbers to use a table like that! 

Finally, I have personally gained some special knowledge 
in writing styles. I am the author of the Microscene column in 
65-Notes, a newsletter put out by the HP-65 Users Club (not 
affiliated with Hewlett-Packard), which is read by some 1900 
members. When I ran a poor review of a micro, I was actually 
dumb enough to sign my name. I’ve learned now. This may 
well be my last time I’ll sign any of my work that might bring 
me criticism. 

Let’s hope that Heath can do better next time, in producing 
a piece of hardware that constantly requires revisions like the 
other micro manufacturers, (with their various patches and 
fixes). And, by all means, Mr. Warren, Jr., keep a high regard 
for the author of this fine review, ol Doc Duds. He’s really 
the best. 

Oh, one more thing, Mr. Warren ... if you should find this 
little note of some interest, please print it in the letters 
column, rather than give it to “Doc Duds”. At least those 
who subscribe to your magazine can read. 

Sincerely, 2529 S. Home Avenue 

Mr. Craig A. Pearce Berwyn, Illinois 60402 


Conclusion of "Memory Test for the 6502" 


14REI FILE: [ / = E*TFRN4l 3 


/ST4»T = (1«CH 
/TFSTMYPE = <*flC« 
/SP4CE?=7374 
TEST*PGM=a«nR 
L OOP 1 = f*P 34 
LOOP? = *)04F 
FX I T 1=20FD 
EX I 12 = 0084 
END*PG* = 0»R2 


/FND=0PC? 
/TFST*P4TR N=fl0C7 
/CPLF=7?8A 
NX*P4TRN = i*fl?R 
NO*F8R1=003F 
NO*FR9?=0057 
I *JC*4DDRSC = (?08E 
ERROP=0*85 


/4008S = f»«C4 
/rnrT=7?Rl 
VF M * TEST = 008 A 
NX»P4SS=002E 
CK*P4TRN=flfl49 
INORY=0Pfi1 
SKIP*HI=G37fi 
IM*400RS=85I4S 


Number 21 


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


Page 5 


15 



CHALLENGING CHALLENGER’S ROMS 

Dear Friends, Received: 77 Dec 28 

I have just become the proud owner of an Ohio Scientific 
Challenger with Basic in 8K of ROM and a monitor in V£K of 
PROM. While I am delighted with its performance, I’m not 
happy about the lack of documentation provided for the read 
only memory. I’d like to use the utility routines which must 
be buried there. 

I tried hand decoding memory dumps, but that’s a labor¬ 
ious task. Then it occured to me to let Basic do the work for 
me. Using the PEEK function, I wrote a disassembler to 
convert the stored bytes into MOS Technology cross assembler 
mnemonics and decimal operands. The monitor decoded 
easily, revealing a basket of I/O goodies. The Basic ROMs 
are yielding more slowly. They apparently contain a number 
of tables which must be picked around carefully. 

I’ve enclosed a copy of my program so that other 6502 
users can reap the same benefits. It’s written, of course, in 
OSI’s Microsoft Basic, but should be adaptable for PET 
and Apple. I haven’t time to pursue refinements such as hex 
conversion for addresses, recognition' of ASCII characters, 
or automatic skips around tables. If another reader makes 
these or other additions, I’d appreciate them sending me 
a copy of the program. 

Sincerely yours, P.O. Box 841 

Stephen P. Smith Parksley, VA 23421 


GOODIES FROM THE GOVERNMENT?? 

Dear Dr. Dobbs, Received: 77 Dec 29 

Your readers might be interested in a government sponsored 
software library. The National Aeronautics and Space Admin¬ 
istration (NASA) puts out a quarterly journal “Computer 
Program Abstracts” which can be ordered from the Superin¬ 
tendent of Documents, U.S. Government Printing Office, 
Washington DC, 20402 for $3.30/yr. 

Be aware that most of the programs are of little use to the 
average home computer freak. Not too many need a 4,062 
line FORTRAN IV program for $480 to “calculate flow fields 
in supersonic inlets”. But useful items do surface; like a 79 
line BASIC program for “organizing and managing a collection 
of articles dealing with a specific keyword or subject”; 
program and documentation for $25. The programs are writ¬ 
ten for everything from IBM 370’s to HP-25’s. Costs range 
from $15 to $2,500 with separate documentation running at 
5 to 10 percent of the program price. If the documentation 
meets the usual government specifications, it will be very 
complete. 

To sum up, the prices for this software are such that if you 
find what you need here and you have a market for its services, 
the government software would be a bargain. 

Ronald N. Orr 
1114 Harper Ave 
Redondo Beach, CA 90278 


LIST 

ID PRINT "DISASSEMBLER FOR MOS TECHNOLOGY 650X" 

20 PRINT "BY STEPHEN P. SMITH, PARKSLEY, VA 

21 PRINT "VERSION 1.0, DECEMBER 13,1977 

22 PRINT 

30 DIM Nl(56),A(296),LS(3),T$(5) 

40 DATA ADC,AND,ASL,BCC,BCS,8EQ,B1T,BM1,8NE,BPL,BKK,BVC,BVS,CLC,CLD 
50 DATA CLI,CLV,CMP,CPX,CPY,DEC,DEX,DEY,E0R,INC,INX,I NY,JMP,JSR,LDA 
60 DATA LDX,LDY,LSR,NOP,0RA,PHA,PHP,PLA,PLP,R0L,RTI,RTS,SBC,SEC ,SED 
70 0ATA SEI,STA,STX,STY,TAX,TAY,TSX,TXA,TXS,TYA,ILLEGAL 
80 FOR 1=1 TO 56 
90 READ NS(1) 

100 NEXT I 
110 LS(0)=" " 

120 LS(1)="#" 

130 LS(2)="<" 

140 L$<3)=" A" 

150 TS(0)=" " 

160 T$(I)=",X)" 

170 TS(2)="),Y" 

180 TSC3)=",X" 

190 T$(4)=",Y" 

200 TS(5)=")" 

201 REM 

202 REM EACH POSSIBLE V0RD IS ASSIGNED A FIVE DIGIT CODE 

203 REM THE FIRST TWO DIGITS GIVE THE APPLICABLE MNEMONIC 

204 REM THE THIRD GIVES THE TOTAL NUMBER OF BYTES IN THE INSTRUCTION 

205 REM THE FORTH INDICATES WHICH OF 4 LEADING FIGURES IS TO BE PRINTED 

207 REM THE FIFTH INDICATES WHICH OF 6 TRAILING FIGURES IS USED 

208 REM 

210 DATA 11100,35221,56100,56130,56100,35200, 3200,56100 
220 DATA 37100,35210, 3130,56130,56100,35300, 3300,96100 
230 DATA 13200,35222,56130,56100,56100,35203,56100,56100 
240 DATA 14100,35304, 3203,56100,56100,35303, 3303,56130 
250 DATA 29300, 2221,56100,56100, 7200, 2200,56100,56100 
260 DATA 39100, 2210,56100,56100, 7300, 2300,56100,56100 
270 DATA 8200, 2222,56130,56100,56100, 2203,56100,56100 
280 DATA 44100, 2304,56100,56100,56100, 2303,56100,56100 
290 DATA 41100,24221,56100,56100,56100,24200,33200,56100 
300 DATA 36100,24210,33130,56130,28300,24300,56100,56100 
310 DATA 12200,24222,56100,56100,56100,24203,33300,56100 
320 DATA 16100,24304,33203,56100,56100,24303,33300,56100 
330 DATA 42100, 1221,56100,56100,56100, 1200,56100,56100 

340 DATA 38100, 1210,56100,56100,28325, 1300,56100,56100 

350 DATA 13200, 1222,56100,56100,56100, 1203,56100,56100 

360 DATA 46100, 1304,56100,56100,56100, 1303,56100,56100 

370 DATA 56100,47221,56100,56100,49200,47200,48200,56100 


380 

DATA 

23100,47210,53100,56100,49303,47300,48300,56100 

7 65024, 

65047 


390 

DATA 

4200,47222,56100,56100,49200,47203,48204,56100 

65024 

LDA 

64512 

400 

DATA 

55100,47304,54100,56100,56100,47303,56100,56100 

65027 

LSR 

A 

410 

DATA 

32210,30221,31210,56100,32200,30200,31200,56100 

65028 

BCC 

-4 

420 

DATA 

51100,30210,50100,56100,32300,30300,31300,56100 

65030 

LDA 

64513 

430 

DATA 

5200,30222,56100,56100,32203,30203,31204,56100 

65033 

AND 

# 127 

440 

DATA 

17130,30304,52100,56100,32303,30303,31304,56100 

6503 5 

PHA 


4 50 

DATA 

20210,18221,56100,56100,20200,18200,21200,56100 

65036 

LDA 

64512 

460 

DATA 

27100,18210,22100,56100,20300,18300.21300,56100 

65039 

LSR 

A 

470 

DATA 

9200,18222,56100,56100,56100,13203,21203,56100 

65040 

LSR 

A 

480 

DATA 

15100,18304,56100,56100,56100,18303,21303,56100 

65041 

BCC 

-5 

490 

DATA 

19213,43221,56100,56100,19200,43200,25200,56100 

65043 

PLA 


500 

DATA 

26100,43210,34100,56100,19300,43300,25300,56100 

65044 

STA 

64513 

510 

DATA 

06200,43222,56100,56100,56100,43203,25203,56100 




520 

DATA 

45100,43304,56100,56100,56100,43302,25303,56100 




530 

FOR 

1=1 TO 256 

BREAK IN 

940 


540 

READ 

A (I) 

OK 




550 NEXT I 

560 PRINT "ENTER STARTING AND ENDING ADDRESSES" 

570 INPUT S,E 

580 REM BEGIN DISASSEMBLY 

600 I=PEEK(S) 

605 REM LOCATE AND DISMEMBER THE 5 DIGIT CODE 
610 C = A(1+1) 

620 M=INT(C/1000) 

630 IF M=56 THEN 1000 

631 IF M«1 THEN 1000 
640 8 = 1NT(C/100)-M*10 

650 P=1NT(C/10)-M*I00-8*10 

660 Q=C-M*I000-D*100-P*ID 

670 IF 8=1 THEN 800 

675 REM SECOND BYTE OF INSTRUCTION 

680 01=PEEK(S+1) 

690 IF B=2 THEN 800 

695 REM THIRD BYTE OF INSTRUCTION 

700 D2=PEEK (S+2) 

710 DI=D1+D2*256 

720 REM SPECIAL TREATMENT IF BRANCH 

800 IF M*4 THEN 900 

810 IF M*13 THEN 900 

820 IF DI«127 THEN 900 

830 D1=-<254-D1) 

900 PRINT S|TAB(10)|NS(M)|TAB(16)jLS(P); 

902 IF D1=-123456 THEN 908 
904 PRINT D1;T$(Q)| 

908 D1=-123456 

909 PRINT 

910 S=S+B 

911 REM NEXT INSTRUCTION 
920 IF S«E THEN 600 

930 PRINT TAB(30),"**♦*♦*****" 

940 STOP 

1000 PRINT "AT"|Sj" ";Ij" IS NOT A VALID OPCODE" 
1010 PRINT "TERMINATING DISASSEMBLY" 

1020 END 
OK 
RUN 

DISASSEMBLER FOR MOS TECHNOLOGY 650X 
BY STEPHEN P. SMITH, PARKSLEY, VA 
VERSION 1.0, DECEMBER 13,1977 

ENTER STARTING AND ENDING ADDRESSES 


********** 


Page 6 


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


Number 21 


16 



CONSUMER DO’s AND DON’T’s FROM A DEALER 

Dear Dr. Dobb’s, Received: 78 Jan 9 

I read with interest the article, “A Detailed Report on 
Product Delivery ”in the last issue (Volume 2 Issue 9) of DDJ. 
I thought that a few comments and suggestions from a com¬ 
puter dealer (we operate a retail computer outlet as part of 
our business in Northern Florida) may be of interest to you 
and your readers. 

1) If at all possible, purchase products directly from a 
local computer store in your area. Not only does this 
permit you to see the merchandise working before you 
buy it, but many times you can get it the very same 
day you decide you want it. Additionally, if you have 
problems, you will have somewhere to go. Unfortu¬ 
nately, many manufacturers give you the instant “well, 
you’d better send it back” routine (ie, 2—8 weeks 
delay) when you phone them. 

2) If at all possible, DO NOT send the full amount in 
advance for an item (ESPECIALLY for a new item)! 
In my opinion, the MOST that a firm should ask in 
advance is 25%. COD can be somewhat of a fail-safe 
device, but unfortunately, not all firms will ship on 
a COD basis. When a firm refuses to ship COD, it 
makes me wonder... however, a non-COD policy 
does not mean that a firm is not honest. CCD seems 
to be the best way to go when purchasing a newly 
introduced item from a new company. 

3) If it sounds too good to be true in the ad, it probably 
is (too good to be true). BEWARE!! Just becaase there 
is a photo of an item in an advertisement, that in no 
way means that that item is being produced or has 
ever even existed! The big ad does not make a firm 
reputable. 

4) When ordering by mail, request that the finn imme¬ 
diately confirm receipt of your order by mail (you 
might even include a postage-paid postcard for the 
company to return to you) and also request an expect¬ 
ed shipping date. This eliminates the “we never re¬ 
ceived your order routine” that could crop up on 
a long overdue shipment. You might also want to 
invest in a long distance phone call and inquire as to 
delivery times BEFORE you place an order and send 
money. 

5) If a firm is promising and not delivering (especially 
if they have your money) do not hesitate to bug 
and bother them with letters and phone calls. Many 
times it is the person who yells the longest and loudest 
that gets what he’s after. Do not hesitate to tell the 
overdue or non-producing firm that you ar; writing 
to several computer-related publications (ie, Dr. 
Dobb’s , Byte, Kilobaud, Interface Age, etc.) and 
advising them of your plight. It won’t make you a 
friend of the company you are dealing with, but then 
do you really want friends who take your money, 
promise, and not deliver? 

One final comment: I find unacceptable the statements in 
the above mentioned article concerning the supposition that 
it takes too much paperwork to notify customers of order 
confirmations and delays. As far as I am concerned, it is an 
OBLIGATION of a firm to notify customers of sny delay 
beyond a stated delivery date. That’s not a public relations 
add-on, it is just good business. 

Sincerely, 2062 Liberty Street 

Bobby Williams Jacksonville, FL 32206 


S-100 PRO & CON CENSUS 

Dr. Dobb’s, Received: 78 Jan 4 

Read with interest ‘The Heath H-8: Pro & Con’. The Con 
author’s first evaluation (?) point was that the H-8 is not S-100 
compatible. My first negative point would be that it is not 
Z-80 based. As far as the bus structure not being S-100, well 
that is still an open question. 

The Pro author’s comments about the S-100 are just as 
emotional as the Con author’s criticism of the H-8. And all 
along I thought this hobby was basically logical (l’s and 0’s 
and that sort of thing). Someone even told me that program¬ 
ming forces one to disciplined thinking. 

My main rebuttal to the Pro author is that “you will find 
that over 95% of them (S-100 boards) are memory cards of 
some configuration.” My count was in decimal—not octal or 
hex, so the following could be inaccurate. 

From R.E. Purser’s list of S-100 Bus Compatible Boards/ 
Systems, which has been reprinted in Interface Age and 
Creative Computing : 

Being late in the ‘eve, my count is: 


RAM memory boards 

56 

PROM memory boards 

33 

Total 

89 

Serial & Parallel I/O 


Boards 

32 

Total of both 

121 


95% of 200 (a rounded figure) is 190 memory boards. Now 
my count is not a “critical look”—just a midnight counting. 

Regarding compatibility of the S-100, the Pro author is 
right, there isn’t much beyond the basically defined pins. 
Since no one knows how much incompatibility exists, I 
decided to find out. 

The results of my labor should appear in a future issue of 
Kilobaud. I would have given it to y’all, but I had to recover 
my postage costs. 

Open question: If the majority of magazine issues are sold 
to subscribers, why are we the last to receive them (i.e. after 
the newstands)? Mailing in bulk by UPS to stores is no excuse. 
Give them to UPS a couple weeks after the subscription copies 
have been mailed. 

Pa y 

Bill Fuller 
1018F SE 8th St 
Grand Prairie, TX 75051 

Bill, your complaint is just, but we simply don’t have space 
to store the bulk issues. They do go out somewhat after the 
subscriptions are mailed but even at that we have no way of 
knowing how long the subscriber copies will spend in the Post 
Office’s aging bins before they ’re finally delivered. -TRW 


SOUTHERN CALIFORNIA DEALERS 
ASSOCIATION 

News Release Received: 78 Jan 3 

The Southern California Computer Dealers Association has 
been formed, as a non-profit corporation, covering the Santa 
Barbara to San Diego area. Membership is limited to bona- 
fide stores which sell microcomputers for personal, business, 
industrial, or educational use. 

Meetings will offer a forum for the exchange of views and 
information about the industry. The association is setting up 
committees to investigate further activities and objectives such 
as publicity for microcomputers, professional standards, and 
dealer-vendor relationships. 

For further information, contact Carl Burlin at (714)956- 
7968, or Glenn Dollar at (213) 360-2171. 

Page 7 


Number 21 


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


17 



Is your assembly language program 
well structured? 


by Webb Simmons 

1559 Alcala Place 

San Diego, CA 92111 

Reprinted with permission from: 

COMPUTE Newsletter, Vol 3,#10, pp 18-19 
National Semiconductor Corp. 

There are a few simple rules that can be applied to your 
assembly language program which will show whether your 
program satisfies the more important criteria to qualify it 
as well structured in the sense of the modem buzz words on 
the matter. This presentation is intended to be practical, 
whatever that means, rather than theoretical ; therefore, I 
can make, and get away with, all sorts of idiotic statements. 

The tools you will need are an extra program listing you 
can mark up and two colored pens or pencils, say red and 
green. These pens will be used to connect program branches, 
jumps, skips, and other transfers from the transfer instructions 
themselves to the points of reference, the destinations of the 
transfers. Here we must make a nice distinction between the 
direction of the transfers so thus the two colors, red and green. 

A forward reference is defined as a transfer from a lower 
counter location to a higher numbered location. And, of 
course, a backward reference is just the opposite, a jump or 
branch from a high program counter location to a lower 
numbered location. But before we start marking, a word must 
be said about subroutine jumps. Any subroutine call or sub¬ 
routine jump that always returns to the point at which called 
(to the next executable instruction after the call) need not 
be considered to be a branch or transfer for the purposes of 
our colored markings. Fundamentally speaking,- a normal 
subroutine call is merely a glorified, super macro instruction 
more so than a formal transfer of control in the sense that is 
important from a well structured standpoint. A subroutine 
with an abnormal return upon detected error conditions, etc., 
is not a normal subroutine so the jumps to it and its returns 
must be considered as transfers to be marked. 

The first step is to use the red pen to mark all backward 
references along the side of the program listing from the 
jump instruction itself to the place jumped to. It does not 
matter but I prefer to make all of my markings on the left 
side of the listing. You should be able to draw red connecting 
lines from each backward jump to its destination with no need 
for one red line to cross another. Regardless of which side of 
the listing you choose to draw on, you must consistently use 
but one side only, left side or right side but not both sides. 
If you cannot draw the red connecting lines for backwards 
references without crossing one red line with another, you 
are already down the tubes, your program is not well 
structured. 

After passing the first test of no crossed red lines we are 
ready to mark the forward references with green connecting 
lines. A green line may cross a red line only if it is outward 
bound. If your lines are on the left, a green line can cross a 
red line when going to the left but a green line cannot cross 
a red line when going to the right. Green lines can cross 
other green lines freely, there are no restrictions on green 
versus green. Under these conditions you must connect all 
forward transfer instructions with green lines to their desti¬ 
nations. If a green line must cross a red line while inbound, 
your program is not well structured. 


What do you do if your program fails these tests? Does 
your program produce the correct results? Is it efficient in 
memory space utilization? Does it execute rapidly? These 
factors are interesting, but no matter; you must shoot 
yourself! 

Since we don’t have multi-colored printing, we are using a 
solid line in place of a red line and a broken line in place of 
a green line. 


PAGE 


48 


0000 

MS= 

0 


49 


0001 

LS= 

1 


50 

0000 

00 

SORT : 

HALT 


51 

0001 

02 


CCL 


52 

0002 

C400 


LDI 

0 

53 

0004 

FA01 


CAD 

LSI2I 

54 

0006 

CA01 


ST 

LS(2I 

55 

0008 

C400 


LDI 

0 

56 

000A 

FAOO 


CAD 

MS(2) 

57 

OOOC 

CAOO 


ST 

MS(2) 

58 



. BOTH PARTS NOW TWO’S COMPLEMENTED 

59 

000E 

C400 


LDI 

0 

60 

0010 

01 


XAE 


61 

0011 

03 

LOOP : 

SCL 4 



62 

0012 

40 


LDE 



63 

0013 

F 201 


ADD 

LS(2) 


64 

0015 

CA01 


ST 

LSI2) 


65 

0017 

06 


CSA 



66 

0018 

940B 


JP 

NOCRY1 


67 

001A 

C200 


LD 

MSI2I 


68 

001C 

F400 


ADI 

0 


69 

001E 

CAOO 


ST 

MSI2) 


70 

0020 

06 


CSA 

1 


71 

0021 

D480 


ANI 

080 


72 

0023 

9C11 


JNZ 

EXIT- t-i 


73 

0025 

40 

NOCRY1: 

LDE 4- 1 • 


74 

0026 

F201 


ADD 

LS (2) i 


75 

0028 

CA01 


ST 

LSI2) 


76 

002A 

06 


CSA 

1 


77 

002B 

9410 


JP 

NOCR Y2-1-1 


78 

002D 

C200 


LD 

MS(2) 


79 

002F 

F400 


ADI 

0 


80 

0031 

CAOO 


ST 

MS(2) 1 


81 

0033 

06 


CSA 

! 


82 

0034 

9407 


JP 

NOCRY2 — t -i 1 


83 

0036 

C601 

EXIT : 

LD 

@1(2)4-1 • J 


84 

0038 

40 


LDE 



85 

0039 

CAOO 


ST 

MS(2) 


86 

003B 

9006 


JMP 

CONT-!--r - 


87 

003D 

40 

NOCRY2 

LDE -4-i-4-l 

i 

88 

003E 

F401 


ADI 

1 

i 

89 

0040 

01 


XAE 


i 

90 

0041 

90CE 


IMP 

LOOP 


91 

0043 

00 

CONT: 

HALT 

◄- 

J 

92 


0000 


. END 



Conclusion: This program is well structured. The only 
crossing of the single red (solid) line by a green (broken) line 
is outbound, thus O.K. 

Note: Lines placed on the right rather than my preferred 
left because of more space. 


Page 8 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


18 












1 


2 


3 


0001 

4 


0000 

5 


0001 

6 


0002 

7 


0003 

6 


0004 

9 


0005 

10 


0006 

11 


0007 

12 


0008 

13 


0009 

14 


0080 

15 


0010 

16 



17 



18 



19 

0001 

C470 

20 

0003 

35 

21 

0004 

C477 

22 

0006 

36 

23 

0007 

C47A 

24 

0009 

37 

25 

000A 

C46E 

26 

OOOC 

33 

27 

000D 

C400 

28 

000F 

CA02 

29 

0011 

CA03 

30 

0013 

CA08 

31 

0015 

CA09 

32 

0017 

C420 

33 



34 



35 



36 

0019 

01 

37 

001A 

C410 

38 

001C 

CA01 

39 



40 



41 



42 

001E 

C480 

43 

0020 

CAOO 

44 

0022 

C440 

45 

0024 

C980 

46 



47 



48 



49 

0026 

C11E 

50 

0028 

D40F 

51 

002A 

9C5D 

52 

002C 

BAOO 

53 

002E 

9CF6 

54 

0030 

BA01 

55 

0032 

9CE A 

56 

0034 

01 

57 

0035 

1C 

58 

0036 

9CE1 

59 

0038 

C900 

60 



61 



62 



63 

003A 

03 

64 

003B 

C4AA 

65 

003D 

8FOO 

66 

003F 

C202 

67 

0041 

ECOO 

68 

0043 

CA02 

69 

0045 

C203 

70 

0047 

ECOO 

71 

0049 

CA03 

72 

004 B 

cue 

73 

004 D 

D40F 

74 

004 F 

98E9 


Number 21 


. TITLE'CDB, REFLEX TEST - 

. -1 

CNTR1-00 
CNTR2-01 
CNTR3=02 
CNTR4=03 
DIG4=04 
DIG3=05 
DIG2=06 
DIG1=07 
DIG0=08 
DIG A=09 
COUNT1 -080 
COUNT2=010 

;START 

START: LDI 070 .SET PI 
XPAH 1 

LDI 077 ; SET P2 
XPAH 2 

LDI 07A ;SET P3 
XPAH 3 
LDI 06E 
XPAL 3 
LDI 0 

ST CNTR3I2) 

ST CNTR412) 

ST DIGOI2) 

ST DIGA12) 

LDI 020 ; SET FIRST DASH 
. DASH 

DASH: XAE < - 

LDI COUNT2 .SET CNTR 2 
ST CNTR2I2) 

; LOOP2 

LOOP2 LDI COUNT1 : SET CNTR 1 
ST CNTR 1(2) 

LDI 040 ; FIRST DASH 
ST -128(1) 

; LOOP 

LOOP: LD 01E(1) . GET KYBD <— 

ANI OF 

JNZ ERROR-- 

DLDCNTR112) . DEC CNTR 1 

JNZ LOOP - 

OLD CNTR212) : DEC CNTR 2 

JNZ LOOP2 - 

XAE ; NEXT DASH 
SR 

JNZ DASH - 

ST (1) ; BLANK DISPLY 


75 

76 

77 


CONVERT 


78 

0051 

C203 

CONVERT: LD 

79 

0053 

1C 

SR 

80 

0054 

1C 

SR 

81 

0055 

1C 

SR 

82 

0056 

1C 

SR 

83 

0057 

01 

XAE 

84 

0058 

C380 

LD -128(3) 

85 

005A 

CA04 

ST DIG4I2) 

86 

005C 

C203 

LD CNTR4I2) 

87 

005E 

D40F 

ANI OF 

88 

0060 

01 

XAE 

89 

0061 

C380 

LD -128(3) 

90 

0063 

CA05 

ST DIG3I2) 

91 

0065 

C202 

LD CNTR3I2) 

92 

0067 

1C 

SR 

93 

0068 

1C 

SR 

94 

0069 

1C 

SR 

95 

006A 

1C 

SR 

96 

006B 

01 

XAE 

97 

006C 

C380 

LD -128(3) 

98 

006E 

CA06 

ST DIG2I2) 

99 

0070 

C202 

LD CNTR3I2) 

100 

0072 

D40F 

ANI OF 

101 

0074 

01 

XAE 

102 

0075 

C380 

LD -128(3) 

103 

0077 

CA07 

ST DIG1I2) 

104 




105 



; DISPLY 

106 




107 

0079 

C404 

DISPLY: LDI 

108 

007B 

32 

XPAL 2 

109 

007C 

C420 

LDI 020 ;SET 

110 




111 



; LOOP1 

112 




113 

007 E 

01 

LOOP1 : XAE 

114 

007F 

C601 

LD @1(2) 

115 

0081 

C980 

ST -128(1) 

116 

0083 

01 

XAE 

117 

0084 

1C 

SR 

118 

0085 

9CF7 

JNZ LOOP1 

119 

0087 

90F0 

JMP DISPLY - 

120 




121 



; ERROR 

122 




123 

0089 

C479 

ERROR: LDI 

124 

008 B 

CA04 

ST DIG412) 

125 

008D 

C450 

LDI 050 

126 

008F 

CA05 

ST DIG3I2) 

127 

0091 

CA06 

ST DIG2I2) 

128 

0093 

CA08 

ST DIG0I2) 

129 

0095 

C45C 

LDI 05C 

130 

0097 

CA07 

ST DIG1(2) 

131 

0099 

C400 

LDI 0 

132 

009B 

CA09 

ST DIG A (2) 

133 

009D 

90DA 

JMP DISPLY - 

134 


0000 

. END 


GET MSD -1 


GET LSD +1 


GET LSD 


: SET P2 TO DIG 4 


SET TO LEFT DIGIT 


; SET ERROR MSG ■<— 


OOPS! 


; COUNT 

COUNT: SCL ; DEC INC CNTR 3 •* 
LDI 170 ; DELAY 
DLY 0 

LD CNTR3I2) 

DAI 0 

ST CNTR3I2) 

LD CNTR4I2) 

DAI p 

ST CNTR4I2) 

LD 01E(1) ;GET KTBD 
ANI OF ; MASK 4 MSB 
JZ COUNT - 


Conclusions: This program is not well structured because 
the green (broken) line from line 51 to line 123 must cross 
one red (solid) line while inbound (near line 123). 

The program would be well structured if the block from 
line 107 to line 119 were to be placed after line 133; however 
one would have to add the instruction “JMP DISPLY” after 
line 103 to replace the normal “FALL THROUGH” from line 
103 to line 107. After moving the block the instruction at line 
133 will not be needed because it will become a “fall through” 
and the red line will go away. 

Honesty compels the observation that the program will 
work the same after moving the block of code as discussed— 
but—it will look better from a “well structured” standpoint. 


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


Page 9 


19 














ISIS: Anatomy of a Real-World 

Operating System 


by Perry C. Hutchison 
Computer Science Department 
Iowa State University 
Ames, IA 50010 


Dear Jim: Received: 77 Dec 23 

I am enclosing a sort of “internal logic manual” for Intel’s 
ISIS system. This all started some months ago when I became 
the victim of a persistent “data CRC” error on the MDS which 
could not be reproduced on anything else. Several phone calls 
to Intel produced only the claim that, by the time the error 
message came out, the information as to what track and sector 
were involved was no longer available anywhere in the 
machine. This sounded rather preposterous, so I went 
a-hunting. About 2 weeks’ work, spread over a considerably 
longer period, yielded the discoveries contained in this write¬ 
up. Since I don’t suppose I am all that unique in needing to 
debug things in the context of ISIS, I decided to write it up 
for publication. It will probably be fairly interesting to 8080 
(and Z-80) hackers, even if they don’t have access to an MDS. 
The ISIS disk allocation and directory policies would make 
an excellent standard for floppy disk file systems. 

This article may also be useful as context for Max 
Agoston’s RIMOS (DDJ 9/77). 

Very truly yours, 

Perry C. Hutchison 


ISIS (Intel Systems Implementation Supervisor) is the 
floppy disk operating system developed by Intel Corporation 
for the Intellec MDS microcomputer system. ISIS was written 
entirely in PL/M, a dialect of PL/1 oriented to the 8080 micro¬ 
processor. The ISIS system is exceptionally well designed; it 
bears significant resemblance to Bell Labs’ UNIX operating 
system for the PDP-11. 

Intel has released neither the source code nor any internal 
documentation concerning ISIS. Since a knowledge of the 
internal workings of such systems is occasionally needed if 
they are to be utilized to the full extent of their capabilities, 
a study of the object code was undertaken. This document 
contains the principal findings of that study. It should be 
useful both as a reference for use by persons having occasion 
to deal with the internals of the ISIS system and as an educa¬ 
tional example of what really goes on in a small single-user 
operating system. Names used are taken from the published 
ISIS documentation where appropriate. 

The information contained herein has been derived from an 
examination of the object code of Version 1.2 of 32K ISIS, 
received in August, 1976. (The same disk also contains Version 
1.1 of ASM80, 1.3 of EDIT, 1.1 of UPM, and 2.0 ofICE80.) 
Except where a more general applicability is specifically 
stated, this information should not be expected to apply to 
any other version of ISIS. 

It is probable that, despite thorough checking, some errors 
will be found in this presentation. The author would 
appreciate being informed of them. 

Page 10 


Environment 

ISIS operates in the Intellec MDS microcomputer system, 
and uses the facilities of the MDS Monitor ROM (which 
occupies addresses F800H - FFFFH) to communicate with 
character-oriented peripheral devices (i.e. everything but the 
disk). Table I lists the entry points and functions of the 
principal Monitor routines. Parameters and returned values are 
handled as in PL/M — see the discussion below. (There are, 
of course, additional subroutines in the ROM, but an assembly 
listing of the ROM is included with the MDS and anyone 
interested in its internal workings can look it up. ISIS uses 
no Monitor entry points other than those listed in Table I.) 

A detailed description of the MDS disk controller is 
contained in the Intel MDS-DOS Hardware Reference Manual 
and will be only briefly summarized here. The controller 
occupies I/O ports 78H - 7FH, and is controlled principally 
by a program-generated “I/O Parameter Block” (IOPB) in 
memory. The address of the IOPB is supplied to the controller 
by outputting its low and high bytes to output ports 79H and 
7AH. The IOPB identifies the drive, the operation to be 
performed, the sector count, the track address, the starting 
sector address, and the starting memory address for reading 
or writing. The disk controller contains a DMA controller 
which is used for reading the IOPB as well as for transferring 
data. 

Organization 

ISIS consists of some 57 PL/M procedures, including 8 
which merely provide access to the Monitor ROM. The 
remaining 49, plus two compiler-generated subroutines, are 
listed in Table II; Figures 1 and 2 depict the caller-called 
relationships. (Many of the routines of Fig. 1 call one or 
more routines of Fig. 2, but the spaghetti effect would render 
a combined drawing incomprehensible.) The heavy lines in 
Fig. 1 lead to routines which directly correspond to and 
implement the various ISIS system calls. (The procedures 
ERROR and XEQIOPB are actually Fig. 2 routines, but the 
direct calls to them from ISIS are shown in Fig. 1 for com¬ 
pleteness.) 

Table II should be largely self-explanatory, with the 
exception of a few abbreviations and notational conventions. 
The second column contains the Entry Point address of the 
procedure. The columns labeled “T” signify the Type of the 
associated quantity: A (Address) denotes a 16-bit value, B 
(Byte) an 8-bit value, and L (Logical) a Byte value used in 
a True-False sense. (An odd value is taken as True, an even 
value as False.) The column labeled “ADDR” is used for 
two related purposes: in the case of procedures which have 
parameters, it gives the memory address at which each 
parameter is stored; in the case of non-parametric procedures 
it gives the address at which the first of that procedure’s 
local variables is stored. (Local variables of parametric pro¬ 
cedures are stored immediately following the last parameter.) 
A dash in this column signifies that the procedure has no local 
variables and, except in the case of the compiler-generated 
subroutines, no parameters. 

Number 21 


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


20 



The combining of ATTRIB and RENAME is a clutter-reducing notational convenience having no special 
significance. Both call the same three subroutines. 



Number 21 


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






When one procedure is entirely contained within another, 
the table entry for the inner procedure immediately follows 
that for the outer one and the inner name is indented two 
spaces. 

Data Structures 

One of the principal motivations for this study has been the 
desire to obtain information of diagnostic usefulness. To that 
end. Table III presents a list of memory addresses whose con¬ 
tents may assist in diagnosing troubles. In addition, parameter 
values in active procedures may be useful. A traceback of 
procedure calls is fairly easily obtained from the stack, since 
entries other than return addresses are rare. The locations of 
the parameters may then be found from Table II. 

The central in-memory data structure of ISIS is the File 
Structure, located in memory addresses 29E5 through 2B1B 
inclusive and summarized in Table IV. The File Structure 
consists of 18 tables, each containing 10 entries; each table 
has associated with it a “current pointer” which contains the 
address of the entry in that table which pertains to the current 
file (whose table index may, in turn, be found in 29E5). The 
first two entries (numbered 0 and 1) in each table always refer 
to the directories of disks 0 and 1; in a sense the directories are 
always open, although they do not always have buffers allo¬ 
cated. Entries 2 and 3 are the console files :CO: and :CI:. This 
leaves entries 4 through 9 for the six files which a user 
program may have open at any one time. Each open file 
corresponds to one entry in each table, but most of these 
entries are unused if the file is not on a disk. 

The parameter AFT which many of the ISIS procedures 
require is simply a number in the range of 0 to 9 identifying 
a set of entries in the tables of the File Structure. This differs 
from the AFTN supplied by the user (and returned by OPEN) 
in that AFT = AFTN + 2. 

The I.V. (Initial Value) shown in Table IV is the value 
which appears in the particular File Structure member for a 
disk file which has just been opened. 


Disk Layout 


known. Thus the first Linkage block of the directory itself is 
always assumed to be Track 1 Block 1, and the Data blocks of 
the Allocation Bit Map are assumed to be Track 2 Blocks 2 
and 3. The boot ROM expects to find the System Initialization 
Program starting at Track 0 Block 1 and occupying as much of 
Track 0 as may be needed; the System Initialization Program 
then assumes that the first Linkage block of the file ISIS.BIN 
(which contains the system proper) will be found at Track 2 
Block 4. 

Secret “XEQIOPB” System Call 

The XEQIOPB system call is not described in the published 
ISIS documentation. Its “command” value is 68 decimal 
(44 hex); the “parameter block” must contain the following 
3 words: 534BH, drive, .iopb (where drive is 0 or 1 and .iopb 
is the memory address of the IOPB to be executed). This is 
presumably intended to be used by programs like FORMAT 
which need to perform disk operations not needed by 
“normal” programs. The IOPB is to be set up as if it were to 
run on drive 0, regardless of which drive is specified; XEQIOPB 
takes care of inserting the drive identification in the proper 
places. Normal system handling of disk errors is provided. 
Note that this call bypasses all directory accessing, file map¬ 
ping, and protection flags, and must therefore be used only 
with extreme caution. One possible use would be in a program 
which does a sector-for-sector copy of a disk. This would be 
much faster than FORMAT $A since the normal disk alloca¬ 
tion mechanism involves considerable overhead. Such a 
program could even copy a non-ISIS disk, e.g., DEC RT11, 
CP/M, etc., if needed. 

Similar calls exist in Version 1.6 of 16K ISIS (the 534BH 
entry in the parameter block is not examined, but the drive 
and the IOPB address are still taken from the second and third 
words) and in Version 2.2 of ISIS-II (the parameter block 
contains only the drive and the IOPB adress — the 534BH is 
omitted); however since this is an unpublished feature, any 
program using it must be considered system-dependent. The 
possibility exists that such programs will not work with some 
future version of ISIS. 


The principles of the ISIS disk organization were rather 
well described by David Yulke in the December 1977 issue 
of Kilobaud (although he didn’t mention ISIS by name), 
but will be included here for completeness and to provide 
additional details. 

In ISIS, every disk sector falls into one of three groups: 
Data blocks, Linkage blocks, and Free blocks; this statement 
applies to system data as well as to user files. An ISIS file 
sonsists of Linkage blocks and Data blocks. Data blocks 
contain the bytes which compose the file, while Linkage 
blocks (Yulke calls them Map blocks) tell how the Data 
blocks are to be linked together. The first two bytes of a 
Linkage block contain the disk address of this file’s preceding 
Linkage block (zero if this is the first). All disk addresses 
in ISIS are stored as a Block Number and a Track Number. 
Tracks are numbered from 0 to 76 and the blocks of each 
track are numbered from 1 to 26. The next two bytes contain 
the disk address of the following Linkage block. The remaining 
124 bytes contain the disk addresses of up to 62 data blocks. 

Every ISIS-format disk contains four system files, 
collectively referred to as the Format files. These may be 
opened for input and read just like any other file, but may 
never be written into (except by special system routines). 
Tables VI and VII list the Format files and describe their 
contents. 

The system does not always bother to look the Format 
files up in the directory; it assumes that their locations are 

Page 12 


User-Program Use of ISIS Procedures 

A user program may occasionally need to perform a proces¬ 
sing task similar or identical to that performed by one of the 
ISIS procedures. In such a case, it may be desirable to call the 
system routine rather than having to write and debug code to 
perform the same function. In order to do this, a few details of 
the implementation of PL/M must be understood. 

Up to two parameters of a procedure are passed in via 
registers. (The first thing a parametric procedure does is to 
store the appropriate registers into the memory locations 
reserved for those parameters.) A procedure having one para¬ 
meter will expect the parameter to be in the C register (if a 
Byte) or in the BC register pair (if an Address). If there are 
two or more parameters, the last will be in the E (or DE) and 
the next-to-last will be in the C (or BC). The CALLER must 
store all other parameters into the proper memory locations 
before the procedure is entered. (This sounds messy, and it is. 
Newer PL/M compilers pass extra parameters on the stack, 
which is much nicer.) 

A procedure which returns a Byte value will return it in the 
A register; one which returns an Address will return the more- 
significant byte in the B register and the less-significant byte 
in the A. (Note: this does not apply to the compiler-generated 
MPY and DIVIDE routines — see Table II.) Except for such 
returned values, the contents of the registers upon return from 
a procedure cannot in general be depended upon. 

Number 21 


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


22 


The benefits of using a system routine must of course be 
weighed against the extreme system dependency which results: 
the routines will almost certainly be in different places in 
different versions of the system and there is no guarantee 
that, even after they have been found in a new version, their 
results will be the same as before. 

Conclusion 

Users of the ISIS operating system have heretofore been 
hampered by the lack of documentation on its internal opera¬ 
tion. While such documentation is not necessary most of the 
time, the need for it occasionally becomes critical. This presen¬ 
tation should partially fill that need for Intel customers while 
also assisting hobbyists in understanding how a first-rate 
operating system and file handler is organized. 



CP/M USERS’ GROUP 

Dear Jim: Received: 77 Dec 16 

Just a note to inform you that there exists a CP/M Users’ 
Group which is active both in user software exchange and also 
in group purchasing of proprietary software. Although desig¬ 
nated CP/M Users’ Group, we also naturally welcome users of 
IMSAI DOS-A and M-DOS and of the Cromemco CDOS, and 
soon expect to see a TDL FDOS which is similarly compatible 
with CP/M in terms of program load point, DOS call conven¬ 
tion and diskette allocation and directory format. 

Kindest regards, 345 E 86 Street 

Anthony R. Gold New York, Ny 10028 


NORTH STAR EXECUTIVE SOFTWARE 

News Release Received: 77 Sept 13 

XEK, a complete system executive package for North Star 
users, is now available from the Byte Shop of Westminster. 

The XEK package contains a disassembler capable of 
creating files that may be left in memory when changing from 
the disassembler to the executive package for re-assembly. 
The monitor software has the ability to accept input from 
cassette tapes and paper tape as either source or object files, 
as well as from the North Star diskette system. In addition, 
the assembler features a new auto-line editor for the creation 
of source files. This editor also extends to the modification of 
existing object files. 

Another feature is the XEK’s ability to handle up to six 
named files at once that may be consecutively assembled to 
form one object file. The assembler, monitor, and disassembler 
come with complete documentation, both on disk and as a 
manual. Total price, including first class postage, insurance 
and California resident’s sales tax, is $48.00. For further 
information and ordering, contact: The Byte Shop of West¬ 
minster, 14300 Beach Boulevard, Westminster, CA 92683, 
(714) 894-9131. 


rt <-> 
M 3 
«5 a 
x g 


t/i Q> 
C -h 
^ O 

3 52 

♦J G 
Q> O 

co. u 


V) 

*-> +J 
3 3 
CX CX 
*-> *-» 

3 3 


2 u 
8- *-» 
O 

«/> 

G ^ 
cl 
3 X 

*-> o 
a> 

CC nJ 


f-i o 
U 4-» 

3 X 
U X 

Vi -h 
G O 

u u 
3 ♦-» 
*-* G 

a> o 
a; u 


w to 
g a 
o s 


oort 
a d,s: 


17) • 

4-* O 
3 O 

CX-H 
«-» > 
g .s 


tc M 

•H T3 

X T3 
rt 

«/> 

£ f? 

3 O 


> 
17) O 
c T3 


a" 


> 4J nJ 


to 

H 

< 

H 

tO 


UJ 

H 

>- 


H 

3 

O 


Q >- 

t—t CC 

§£ 

O. UJ 


UJ 

p 


H 

3 

O 


H 

CO 

U 


a 

i 


Number 21 


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


Page 13 


23 


future 



Table II. Internal ISIS Procedures name- e.p. parameter t addr returns t purpose. calls 


C O O H 

= O' < f. 

uc wa 
w uj c: > 


h 

< u. ^ u 

u d u t- u u 

OCQQ W< UW 
JCUh Nh 

j j w q > m a: 

<uu kq: w 2 


U 3 CX CX rt 


O O O CJ O O 

3 U 3 E 5 E 


OS -J 

UJ < 

it fee 

HDDU 
U. CQ O < 
< • U • 


tu O r« -t o 
o a a q a 
u u u u u 

<N (N rvi rvi rj 


UJ <3 

£££§ 
HD D U< 
U. ffl o <U 
< • u • 2 



3 Q CO UJ U 

co ^ c. < u u u 

uj o*~<<u:Hu:l; 1 -co 

Ul>-<2^UHN2Hh 

c£Ouu:uj^uiuj>-<>-cs;ci 


u c: z 

CO O U. 2 ; 

O KH w 
-J es u; a. 
U UJ u o 


< o u. 

X 2 OS H 

a. 2 cs uj 

5 : cs uj o 


= CO 
U D cc 
aiiHu< 
ou. 

c: H c<H 
u u u uj u 
UJ o to to to 


—• O 

C C 3 O 

O 3 *J O 

•h to a 

U* 3 3 to 
3 U to 

U *“ H O 

U E a> H 

X O *J ~3 

a> 4-» c -o 

to -H « 
to X 

o <o td u 


UD P u 

o v c a 
H ^ a> > 


2 c uj uj 

fl> to cx 

& to < UJ 

n h 2r 
C cx -3 
•H O O 4-» 
D U U rl 
to 

to -h a> qc 
H 3 C 

^ U 0* H 

O to o *-> 
> < u u 


c» cr* di 
or 31 or 

fN CM (M CM 


31 < UJ 

U) UJ 31 

u u a 

cm cm cm 


OS H 

UJ uj »-• 

CQ UJ OS O 
A to UJ H 

3 < = a 
2 cas Z 


CQ 

CO 

J 

O' 

2 

< 

J 

o 

UJ 

u 

u 

Q 


Page 14 


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


Number 21 


24 




NAME- E.P. PARAMETER T ADDR RETURNS T PURPOSE. CALLS— NAME- E.P. PARAMETER T ADDR RETURNS T PURPOSE.. CALLS— 


> ea 
cc: uj < 

C Q H 

cc o H H 

h c: h huj uj 

cj uj u. cc co c/) 


— CQ 

e:zu< uj 

O U. cC H U H 

cc H < H g ^ 
CC UJ UJ UJ >- CC 

W U W w w 2 


u CO CQ 

O CQ O. 

-3 C. < UJ O 

J < u: t- H *-• 

<2. lu E— h o' 

uj 3c UJ UJ CC UJ 

o CC w W > X 


CQ O 2 < 

uj cc c wu: u 
UJHX<ZUJH 
cj uj a. uj uj uj uj 
u. (dt. cc c:w w 


CJ 

H *H 

a u. 

(/) u. «. 
o =) c 
£ta o 

5 -H 
C +-» • 

Sh -H .H ft) 
f O 1/1 t-H 

Jut VI o JQ 
^■h am 

J3 W U-H 

v> a) rt 

V» O s > 

0) U O eft 

H 


w ,* ft) • 

■o u au 

rt O O —i 

ft) H M -r4 

cc x> a 4-. 


e -h ^ <d 
o 4-* o x: 
u c o 

4J 3 T3 rt 
0) ft) 
Ifl C -H ^ 
U UJ 4-. 

ft) U. tf) V) 
*-> U_ -H -H 

U D 

Cl CQ eft 0 ) 

f>l t/l f-H 
CJ O -H 
x: u) v) 4 -t 
O C -H I 
•H 4 -t 
V) Ho 
U D 2 I 
« -< 2 T3 
ft) o C 
esc 4 h cj a> 


-a c 

ft) -H 

o i e 
u* ft) C • 
X C -H ft) 

X) -H w c 

I H ft) -H 


C 4t£ C 
O *■» ft) 
ft) U 

JZ u o u 

J ft) J 3 


V) u» o 

O CTJ U> 

U) o O • 
ft) O 1) < 
•-* —< f-< -S’ 
ft) »-h -H Q 
O eft -3 <N 


Q UJ O CM 
Q Q UJ UJ 

cj u u u 

CM CM CM fN 


UJ < 

u- H ^ 

. U- Z H 
h3 D U 
U. CQ O < 
< • u • 


CQ 

Z CL 
O UJ O Z 


h UJO f- , K, <2 OUJOZ UJ CJ X CC 

CnnWWhOHQSJQ<U^UhHUJ COOUZUJQ 

uczjHCH<uj<z^ujOHcya. ocj*uju< 
(-JOWQCxOauJUJujujrciujo j c: w cl < u 
CUUOujuJujJoaJaJo'inSSxc^ uwz o o-e: 


<u- Hu. a u = ca cj 

UD CiHtOU.D22CLhU< ui UJ 

O CC O UJ UJ <CQlLM<<c:UUh w 

J CJ cJ uj uj HhH3:^c:<hi: Hh 
—J j DC CC CC UJ UJ UJ UJ 2: CJ UJ U)>- cc cc 

<CJ UU.U. UOU cCcCW W WW X *2 


■o 3 /-N C ‘ 
ft) O UJ ft) T3 

u* U C. > C 

rt w -h eft • 

u C be 

ft) O « V) 

C -H ft) C 

ft) u» *-h be ’ 

be Cft CJ -H *H 

i u cq U-t in ■ 

U *H N-' V) 

ft) eft eft 

-« H N 

•H -H V) •• 

CLu» ^ C ft) 

E UJ ft) E 

0 3 0 a, eft 

V B (DC 


H l/l UJ 
f-i w 
V) ft) rH 

ft) 4 h UJ 
ft) 4 -t UJ 
U 3 CC 
U. 3 U. 


00 < CJ UJ 
Ul UJ UJ UJ 
Q Q Q Q 

CM CM fN tN 


Z H 

UJ 2 CC 

U. Uj UJ 


Number 21 


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


Page 15 


25 





name- e.p. parameter t addr returns t purpose. calls— Table III. ISIS Variables of Diagnostic Significance 


"2 i e 


rt rt 

o g 

$ 8. 
E 

3 4) 

O *-» 

UJ 

3 G 

G O 

a a 


to 

to 

£ 

a 


a 

a 

rsi 

i 

U 

s 


5 '3 

H 

G.2 


rt 

r-H 4) 
rt *-* 
u uj 
•H C 
tC. -H 


u c 
♦-* o 

•H 5! 


X) 4> 
4) X 

Q 4-» 


Cl *H iH 

x n 

ec H 4-» 


G UJ 
0 0—4 

-« X O 


3 O a 
h h y 
rt O O 
> M 


*J E 4> rt 


>9 9 


u ifl Ifl 
X 4> 

= UJ uj 
UJ 3 
Jui rt 
a o 
o 

— to *j 
u oi 

= U 5 


x ^ 

T3 'o' • O 
O H H W 
*-» .Q rt rt 
rt rt 3 uj 
G G G UJ 
O Cl i« (I 

c > s: e 
O o 

oc u o r 
41 k t 

r g rt cm 

4) I 2 
GC 3 G 
X O G O 
H C rt o£ 

’ — cc 

♦J UJ 

h: w: 
3-3 0 
UJ G Q 4) 

u eg i x 

cc x to *j 
r : a 

Z 4h 
”3 rt ' O 

G O 
3 X X *-» 
4-» G G 


cc o rt 

•H • 

4-» G U) 3 
—• O 4> 
3 4) -H *j 
w C il C 
41 C U -H 

— O 4) G 

- 0 3 3* 


G X 

o o 

4* rt 


3 O 4-< 

4) 3 . 

*-• G X 

a* g 
e 2 « 

4) C. 


G. C 


! 4> E 


> rt c 
« G. O G 
. tO O h 


G G O »-t 
4> 4) 

4-t tM 
4-4 IM 

55 


4> 00 —< 


£2 


g o, 
X X 
CO H 


o 3 
CO CQ 
CO CS| 


“ o 

y s 

< rt 


G U 
X-h 

X u. 

X 0 O 
G O a 
X 3 CM 
M C I 
3 h a 


I 4) 
X 


s. a - * 

X) G O 

• O X 

CM Cm G 


uj 


u o 

H l/| !0 w 
<4 C S3 X 
G -H (N 4) 
G rt l 
fl> U N 4> 
*J G o° E 

coon 

•-t t» cm G 


O 

S 

H 


G 5 

5 £ 


* c. 
zr uj 
O 4) 
CG G 
< 

UJ X 
to G 


(?3 

cb' 


3 & 3 


CX5 G 
o uj 
X nJ 


&,a 
rt o 


UDK7. UZt<UUJ 

OCQOUlUH<UUJy) 

jkc:u.w JZhNH 


88 


as 


CG 

1 

C£ 

UJ 


0 0 4) 
G. G —-« 

OX;-* 

CC X *G 


3 W h 

a: -h 

H 3 4-1 
4) 

UJ G 4> 
C to oc 
G O G 
3 3 rt 


CC X 
C r-. 
t-4 G 
z o 
g. 
in o 

- G 


UJ 

a g • 

3 4> uj 
G 4) 
UJ C H 
4-» -h a 

o o « 

to G. G 


rt h 

5.5 


•H .* 

^ o 

5 O 


«j O 
4-» 
CC UJ 
UJ 4> 


ZD o 

a u 


O 4) r 


•h 4i m 
G.E C 

o rt o 

U G U 


4) 

4J • 

u e: 
rt uj 

G U. 

rt u. 

x a 

U CO 

H E 
2 O 

a g 

o 4-1 


O 

G. 

O 4-. 


*-* E > 

-H o *H 

G G G 


> O. UJ 3 

•H O 4) c 

G 3 rt 


G. 3 O 

G- h G,< 

3 O rt O' 

m G > c 

I 4-J c < 

GN h o rt 1 


X G UJ 4-» 

o o m 

4) 4-* O 3 •-4 
3 G 3 C -4 

•—« -h o rt 
rt uj G. o 
> C -H UJ 


se 


o * 
G O 
G -H 
O 

u 44 


a uj o cm 
CM <N to PO 

a a a a 

CM CM CM CM 


rf o oo a 

3 3 3 3 

a a a a 

CM CM fN CM 


UJUJ 

aa 

CM CM 


CM CM 
CQ CQ 
CM CM 


3 tO vO 00 
tO tO to tO 
CQ CO CQ CQ 
CM CM cm (NJ 


UJ O h 
H a a x 

U* Q CQ CQ 

<5 • • 


Si 


D^ZZ 

a a x x 
a a cq a 


Ha 
Uj a 


H a 
u. a 

< • 


UJ CQ 


CC 

a u uj 
Q a uj uu 

o > lo a 
■jn x a 
d. c: ^ a 
o a {— . 


a 

H 

a 


a 

< 


H 

s 


cy 

a 

x 


o 

t-4 

X 


Page 16 


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


Number 21 


26 





addresses contents.-.-.—.-. Table V. ISIS Device Identification Codes 



hmqhohh q:q: hm a a. . 


CQ OHNNl-tlOvOMOOlOHOJ (O Tt 1/1 <5 N 


UJ 


b *-* 

Z tO 


C/5 

UJ 

C/5 I 
C/5 • 
UJ I 
ci < 
a H 
9< 


O 


I H f-l 


X5 


S; 

z 


g 3 

C/5 C/5 


s § 


a 

w 

b 

o 


Q 

00 

00 


U. _ M HH 


-O 

CC3 

H 


o 

to 

3 U 

U« *J 

o a> 

> ~t 

a> a> 
c "3 




C X ^ 
*-• V5 X I 


E 

3 

2 


efl 

K 

H 


8 8 


to oc 
to ca 
a> jc 
m c 


x, 

UJ 

w O 


la 


be to 

o c 

r-t U* 

3 


b 

o 

E 

O 

s 

£ 

2 

x 

o 

3 

u» 

■*—> 

C/3 


cz 


2 

H 


X 

cu 

o 


UJ 

^ o> 

(J M 
O 

—t *-» 
J3 rt 

I 

.* ♦-» 


to C 
o o 
U U 


D 10 

3 H 

E— *-» 


rt 

4-> 

c3 

•3 


O -H 

2 o 

H E 


O 

• 

0) o 

J3 —< 

sa 


C/5 

t • 

J«C Jrf 

o o 

c3 O 

u ^ 

t— J3 


2 5 


*-»*-» O 


*3 Q 9 

2g3 


c 

o 

CJ 

O) 

33 

U- 

C /3 


eccc 

8fc 


s a s 


« 

a 


a a a a a 


3 

a 


< 

o 

a 


8 

a 


X5 

cd 

H 


3 2 


CJ 

a 


i 


Q£ 

E 


UJ 

I 


Number 21 


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


Page 17 


27 










The SAM 76 


by Ancelme Roichel 
copyright 1977 

Pennington New Jersey, U.S.A. 
All Rights Reserved 


Language 


(T 

U 

U 

U 

U 

U 

{} 

1) 

U 

0 

U 


n 

n 

This text was formatted from a raw text file {} 

employing procedures which make use of the {) 

U 

<ncra> 21 {) 

0 

SAM76 language processor {} 

{) 

{} 

_II 


Typographical and code assignment table 




0 

1 

2 

3 

4 

5 

6 

7 

8 

9 

A 

B 

C 

D 

E 

F 



0 

0 

0 

0 

1 

1 

1 

1 

2 

2 

2 

2 

3 

3 

3 

3 



0 

2 

4 

6 

0 

2 

4 

6 

0 

2 

4 

6 

0 

2 

4 

6 

0 

00 




0 

@ 

P 

• 

P 




0 

@ 

P 

' 

P 

1 

01 



i 

1 

A 

Q 

a 

q 



; 

1 

A 

0 

a 

a 

2 

02 



11 

2 

B 

R 

b 

r 



" 

2 

B 

R 

b 

r 

3 

03 



It 

3 

C 

S 

c 

s 



It 

3 

C 

S 

c 

s 

4 

04 



$ 

4 

D 

T 

d 

t 



$ 

4 

D 

T 

d 

t 

5 

05 



% 

5 

E 

U 

e 

u 



% 

5 

E 

U 

e 

u 

6 

06 



& 

6 

F 

V 

f 

v 



& 

6 

F 

V 

f 

V 

7 

07 



1 

7 

G 

w 

g 

w 



1 

7 

G 

w 

g 

w 

8 

10 



( 

8 

H 

X 

h 

X 



( 

8 

H 

X 

h 

X 

9 

11 



) 

9 

I 

Y 

i 

y 



) 

9 

I 

Y 

i 

y 

A 

12 



* 

: 

J 

Z 

j 

z 



* 

: 

J 

Z 

j 

z 

B 

13 



+ 

t 

K 

( 

k 

{ 



+ 

f 

K 

[ 

k 

{ 

C 

14 



t 

< 

L 

\ 

1 

1 



f 

< 

L 

\ 

1 

1 

D 

15 



- 

= 

M 

} 

m 

} 



- 

= 

M 

] 

m 

} 

E 

16 



. 

> 

N 

“ 

n 

~ 



. 

> 

N 

“ 

n 

~ 

F 

17 



/ 

7> 

0 


o 




/ 

? 

0 


o 



The SAM 76 Language 


The SAM76 language combines into a single interpretive 
processor characteristics of two different string and 
general purpose macro generators and one (or more) infix 
operator mathematical systems. 

SAM76 was primarily inspired by the "M6 MACRO PROCESSOR" 
designed by M. D. Me Ilroy and R. Morris of the Bell 
Telephone Laboratories. A description authored by Andrew D. 
Hall is given in the Bell Lab. Computing Science Technical 
Report #2, and other places. 


The second source of inspiration came from the syntax of 
"GPM - a GENERAL PURPOSE MACRO GENERATOR" described by its 
author - C. Strachey. 

GPM syntax very significantly improves the interface 
between the user and the language by eliminating an 
awkwardness inherent in the design of M6. This awkwardness 
arises out of the fact that in the M6 language the 
specification for the action to be performed on the result 
of an expression evaluation is at the right hand end of the 
expression to be evaluated; this requirement causes the 
need for a unique pair of characters to be designated for 
the purposes of "quotation"; consequently when the writer 
of procedures in M6 is terminating the writing of an 
expression he must mentally reconstruct the sequence of 
alternations of "quoted", "active" and "neutral" 
expressions which may be nested one within the other. 

In GPM, where the nature of the expression is specified at 
the left end, only one character need be identified to 
serve to provide the right hand boundary for all three 
types. 

Ibis means that the user, when closing out his writings, 
need only supply enough such identical characters (plus a 
few for good measure) to enable correct action to 
subsequently take place. 

An universal lament of users of both M6 and GPM relates to 
the extremely unnatural method in which arithmetic 
expressions must be organized. The simplest arithmetic 
expression in normal "infix" notation becomes a tortuous 
involved nest of strange symbols when expressed in either 
M6 or GPM. A simple solution exists, is incorporated in 
SAM76 and forms the third element of the language. 

In addition inspiration for the selection and design of a 
number of the resident functions came from a variety of 
sources (see reference list). 

Acknowledgement is made of the contribution made by L. 
Peter Deutsch [U.C. Berkeley] who conceived of nesting an 
expression calling for input inside an expression which 
causes output [Ref. 3] thus: 

{OUTPUT,{INPUT}} 

Finally acknowlegement and great appreciation is expressed 
for: 

The help received from Neil Colvin [M.I.T.] who provided me 
with an 8080 simulator for the PDP-10 and who coded a 
preliminary version of the language to run in an 8080 based 
microprocessor system contributed also materially to the 
development of this language. 


Page 18 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


28 



Barry Lubowsky [Rider College] who allowed me to make use 
of a PDP-10 and who was most helpful with some system 
software problems. 

Roger Amidon [Delta Data Systems], whose actual 8080 based 
"ALTAIR" and "IMSAI" microcomputers were used to test and 
debug the software, was also most helpful in developing a 
family of "people" oriented mnemonics and functions 
particularly well suited for the "amateur" user. 

Other people who contributed to various details and who 
"people" tested the language are Carl Galletti [T.D.L.], 
Marty Nichols [Newsweek], and Tom Kirk [N.J. Bell]. 

References 

1. Strachey, C. - "A general purpose macrogenerator". 


Computer Journal, Vol. 
1196510001. 

8, No. 

3, Oct. 1965 p. 

225; 

2. Hall, Andrew D. 

- "The 

M6 macroprocessor", 

Bell 


Telephone Labs; Computer Science Report No. 2; 1971; 

3. Kagan, Claude A. R. - "A string language Processor for 
small machines", Proceedings of the ACM SIGPLAN Symposium 
on the Pedagogical Applications of small Computers, 
University of Kansas, Lawrence, Kansas 1197111181. 


II II This description of the SAM76 language 

I I Notice 11 is substantially the same that is 

IJ_JJ available from the IEEE Computer Society 

Repository, R 76-301 - August 1976. 


The three elements of SAM76 


The first element is designed around the 11 
characteristics described by STRACHEY in 11 GPM - S76 11 

his GPM (General Purpose Macro Generator) IJ_[I 

language. 

Strachey defined its general forms as follows: 

Active %function,arguments, . : 

Neutral %VAL,function,arguments, . . . : 

In order to avoid ambiguity and to provide consistency the 
above is changed for the purposes of SAM76 as follows: 


Active %function,arguments, . / 

Neutral ^function,arguments, . / 


Protected ! . . . protected string . . . / 

In addition changes and extensions are made to the language 
originally described by Strachey. The modified form 
incorporated in SAM76 is to be known as S76; this is a 
fully operational proper subset of SAM76. 

The syntax used in connection with the S76 system is to be 
referred to as the "S" syntax of SAM 76. 


The second element is substantially as 11 

described by Andy HALL for the M6 II M6 - M76 I I 

language attributed to Me ILRDY and IJ_[I 

MORRIS: 


Active ((function, arguments,.: 

Neutral #function,arguments, . ; 

Except for different function mnemonics no change was made 
in the syntax and notation of M6 for the purposes of SAM76. 

Number 21 Dr. Dobb's Journal of Computer Calisthenics 


In consequence routines and texts written for M6 processors 
distributed by the Bell Labs outside the Bell System should 
be compatible with SAM76. 

Compatibility with M6 is insured by enabling user to 
stipulate whether "resident" or "user defined" functions 
are to be first searched whenever an expression is to be 
evaluated. 

Expressions written using the M76 syntax will first cause a 
search of the user defined functions; if no user defined 
function of that name exists then a search is made of the 
resident functions. Expressions written using the S76 
syntax will first search the resident functions. 

Although there is syntactic compatibility with M6, the 
implementation in SAM76 is designated M76 because of the 
generally different complement of resident functions, and 
the significant enhancement of the scan algorithm. 

Hie syntactic form of expressions based on the M76 system 
is to be referred to as the "M" syntax. 


An infix operator system characterized in I I II 
general by the following example for a 11 A76 11 
simple arithmetic expression: IJ_j| 


Example [ 5 + 5 * (144/12) ] 

Hie syntax of the foregoing system is to be referred to as 
the "A" syntax. Hie evaluation rules and internal syntax 
may vary between systems for this sub system; a method of 
identification is provided within the framework of SAM76. 


Input - Activating - Scanning and Output 


I I The flow of characters, be they 

I I Input and 11 procedures (programs) or just plain text 

I I Output 11 between the SAM76 processor and either 

IJ_[I the user or other sources or destinations 

is under the control of two resident 

SAM76 functions: 

Input from user (or source) to SAM76 is under control of 
the "input string" function whose mnemonics are "IS"; this 
may be used in either the "S" or "M" syntax either as an 
active or neutral function thus: 


type 

active 

neutral 

S76 

%IS/ or 

&IS/ 

M76 

#IS: or 

IIS; 


Output from the SAM76 processor to the user (or other 
destination) is controlled by the resident "output string" 
function, mnemonic of which is "OS"; active or neutral use 


in both the "S" 

1 and "M" 

syntax 

is: 



type 

active 


neutral 



S76 

%OS/ 

or 

SOS/ 



M76 

#05: 

or 

IOS; 



Initially and 

whenever 

its task has been 

II 


completed, 

the 

5AM76 

processor 

1 1 

Hie 

automatically 

loads 

a 

"restart" 

II 

"restart" 

expression which is scanned and 

provides 

II 

expression 


the means for accepting input and 
delivering output; this expression is 
initially defined as the S76 expression: 


&os,%is//= 

Orthodontia, Box E, Menlo Park, CA 94025 Page 19 

29 











The initial or standardized condition 
makes use of the equal sign "=" to 
ACTIVATE the processor; this "activating" 
character may be changed by the user 
through execution of the appropriate 
SAM76 resident function. 


I Activating 
I the 
I processor 
I_ 


II II When expressions are nested one within 

II Scanning II the other, the SAM76 processor first 

IJ_[I executes the innermost, proceeding from 

left to right. 

Hie innermost in the "restart" expression is: 

%is/ 

and therefore input is sought; the user input is terminated 
with an activating character, the (=) will be shown to 
remind the user how to terminate his input. 

Once the input is terminated, it is in turn examined by the 
scanner for possible further execution until finally the 
outermost expression of the "restart" expression is 
encountered: 

&os, ... / 

where the series of periods represents the result of 
processing the user input and in fact will be the output 
that is to be given the user. 


i| Quoting or Protection 


Frequently the user may wish to incorporate in his text 
certain characters which have special meaning to the 
scanning system of SAM76. Typical of these are the 
characters used to indicate the start and end of 
expressions. These are known as "warning characters". 

For standardization purposes a processor for the SAM76 
language is initialized with the following assignment of 
"warning characters": 


Abbv. 

Char. 

Octal 

Purpose 

SA 

% 

45 

Begin S76 active expression 

SN 

& 

43 

Begin S76 neutral expression 

SP 

1 

41 

Begin S76 protected string 

SE 

/ 

52 

End S76 expr. or protected string 

MB 

# 

43 

Begin M76 expression 

MA 

: 

72 

End M76 active expression 

MN 

1 

73 

End M76 neutral expression 

AS 

r 

77 

Argument separator 

QC 

@ 

100 

Quote single character 

BQ 

< 

74 

Begin quoted string - Pair 1 

EQ 

> 

76 

End quoted string - Pair 1 

BP 

( 

50 

Begin protected string - Pair 2 

EP 

) 

51 

End protected string - Pair 2 

BA 

[ 

133 

Begin "A - syntax" expression 

EA 

1 

135 

End "A - syntax" expression 


Strings of symbols found between the above illustrated 
enclosures are said to be "quoted" or “protected" and are 
completely ignored during the scanning process. 

The two rules that follow are applied to the scanning 
process with respect to the use of "quoting characters". 


I I When an unprotected character designated as a 
II 2 II "quoting character" is encountered in the left 

IJ_[I to right scan of an expression, the other 

character of the pair is then defined as the 
character which will end the quoted string; this means that 
for the two initially designated pairs shown above, quoting 
or protection may also be achieved as follows: 

>....< or ) .... ( 


ll Tl In the process of finding the character which 
II 1 II is to terminate a particular quoted string any 

IJ_[I occurrence of the same character as that which 

identified the beginning of that quoted string 
must be balanced by a corresponding "end of quoted string" 
character. 

This is to be differentiated from the action which takes 
place in connection with the "protected string" of the "S" 
syntactic form: 

! . . . protected string . . . / 

In the foregoing a tally is made of "unquoted" warning 
characters in order to find the slant sign "/■ which 
matches the exclamation mark: 

The tally count is increased by a count of one - % & ! # 

The tally count is decreased by a count of one - / : ; 

It should, however, be noted that the "warning characters" 
(symbols used to delineate bounds of expressions) shown in 
the foregoing illustrations and examples are changeable by 
the user and are only representative of initial or 
standardized conditions. 

Any of the foregoing "warning characters" may be changed 
using the appropriate SAM76 resident function; the 
abbreviations listed earlier are used to identify the 
particular warning character it is desired to change. 


When an unprotected "character quoting 
symbol" is encountered, then the 
immediately following character is 
considered to be quoted. This is 
particularly useful when the user wishes 
to quote single characters, such a 
warning character, without having to 
maintain a balance of quoting character pairs. 

Initially the "character quoting symbol" is set to be the 
"coninercial at" ( @ ). 


I Quoting or |I 
I protecting 11 
I a single I| 
I character I I 


Using the SAM76 syntax, functions, and trace ii 


In both the "S" and "M" forms of SAM76, 
the equivalent of string quotes may be 
provided by any pair of characters 
designated for that purpose. Initially 
two such pairs are defined and consist of 
the following balanced pairs of 

enclosures: 


In the examples that follow the I ... I arrangement is used 
only to delineate output at the user terminal; if for 
instance the user wished to add two numbers making use of 
the "A" syntactic form, the following might be observed: 

[5+5 ]=|10| 


I 

I Quoting or 
I protecting 
I a string 


<....> or ( .... ) 

Page 20 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 21 

30 









Define Text with id number 


IT T| In the following example the M76 syntax 
I|M76 example I I is used to create a "macro" which when 
|J_|| invoked will square any desired number: 


♦DT,SQ,<#MU,ql,ql;>i- DT means Define Text 

MU means Multiply 
SQ is name given to text 

#PT,SQ,ql:= PT means Partition Text 

There are four possible actions which may ensue when the 
macro, or user defined function named SQ is to be invoked: 


|DT,t,s,dl| 

This function places in the "text area" the string denoted 
by "s" in the expression shown above; this text is given 
the name denoted by "t". An arbitrary identification 
decimal number denoted by "dl" may also be included as part 
of the "text" record. Previously defined text with same 
name is erased and replaced with this definition. 

Examples: 


1. #SQ,5:=|25| 

2. #FT,SQ,5:=1251 


value returned is 25 


M76 #DT,NAME,THE SKY IS BLUE: 


FT - Fetch Text, value 25 


S76 %DT,NAME,THE SKY IS BLUE/ 


3. #SQ,5;=1251 value returned is 25 

4. #FT,SQ,5;I#MU,5,5:I value is Text of SQ 


In the foregoing examples no id. number was desired, and 
consequently the default value of zero is stored as part of 
the record created by this function. 


IT TI The foregoing example is repeated below 

I IS76 example |I making use of the S76 syntax; however to 

|J_[I illustrate its use, the infix system is 

used for the actual multiply function: 

%DT,SQ,![ql * ql]//= ql is dummy variable 

%PT,SQ,ql/= ql becomes partition valu 

e 
1 


The four invocations of SQ are shown below: 


1. 

%SQ,5/=|251 

value 

is 

25 

2. 

%FT,SQ,5/=1251 

value 

is 

again 25 

3. 

&SQ,5/=1251 

value 

is 

still 25 

4. 

&FT,SQ,5/=I( 5*5]l 

value 

is 

now "text" of SQ 


I I In general the mnemonics used in SAM76 to 
I I Resident I I identify the resident functions are 
I I Functions I I composed of two alphabetic characters. 

IJ_[I This is not a restriction imposed on the 

language, and three or more alphabetic 
characters may be used to identify resident functions. In 
fact the user may wish to employ the "@F" ("wh@" (what) 
Functions) mnemonic to ascertain the mnemonics in actual 
being in his system. 

It should be remembered that when the sign serves the 
purpose of "quoting single character" then the expression 
to list the resident functions would be: 

M76 l@@F, ... : 

S76 %@@F, ... / 

where " ... " is the string of characters which will 
precede each resident function name in the result of 
executing this expression. 

Descriptions of the functions and examples in which either 
S76 or M76 syntax is applicable employ the I (Long Vertical 
Mark) character to bound the expression. In actual use the 
I is replaced by the appropriate pair of warning 
characters. 

In the case of "null" valued functions where the neutral 
form of the expression is to be illustrated, the \ 
"reverse slash" is used in lieu of the I. 


Texts in the "text area" may be examined 
without evaluation using the "vt" 
function. This examination will display 
location and value of any "partitions", 
"multi-partitions", and the text 
divider(s) when at a location other than 
the head (or extreme left) end of the text 


II 

1 1 

The "VT" 

II 

II 

1 1 

View Text 

II 

II 

1 1 

function 

II 

II 


Initial conventions for the display within a "text" of 
partitions, multi-partitions and text divider(s) are: 


[1], [2], ... (d) 


Partitions 


[#1], (#2), ... [#d] 


Multi-partitions 


n 


Text Divider 


When in the "Trace" condition, active II Tl 

expression about to be evaluated will be I I Trace 11 

shown bounded by the I, neutral IJ_[I 

expression by \, regardless of the syntax 
(M or S) of the expression. 


IT- 

I I "id" 

I I numbers 

II 


Tl 
11 
11 
II 


The M6 language provides a unique 
identification number for each of the 
resident functions of the language, and 
means for the user to assign a similar 
type of number to defined functions. This 
numbering concept is preserved in SAM76; numbers between 1 
and 99 inclusive are not assigned to any resident SAM76 
function unless its name and operation is absolutely 
identical to its M6 counterpart. This permits user defined 
functions to be written to mimic M6 functions if desired. A 
list of M6 functions and their assigned "id" numbers is 
given in an appendix. 


To illustrate, the M6 function "DEF" 
might be mimicked in the SAM76 system as 

II 

1 1 

User 

1 1 
II 

follows: 

II 

defined 

II 

la. %DT,DEF, !%NI,<&>,<%>/DTtnpl</>// 

II 

1 1 

function 

II 

II 


2. %MP,DEF,mpl/ 

examination of the defined text (or function) DEF can be 
made using the SAM76 "VT - View Text" resident function 
thus: 


3. %VT,DEF/= | %NI ,<&> ,<%>/DT(#l] </> I 


The formal description of the "DT" - "Define Text" function 
is given below to illustrate the manner of presenting SAM76 
resident functions. 


in the foregoing ”mpl" is a dummy for a "multi-partition" 
which will be created by the second expression and 
visualized by the VT function as [#1]. 


Number 21 


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


Page 21 


31 












The function "NI - Neutral Implied" is used to provide the 
expression using DT with either the active or neutral 
warning character as used with an expression containing 
"DEF" as its operative argument. 


Alternatively expression (la) could have been written in 
one of the following ways,with exactly the same end effect: 

lb. %DT,DEF,<%NI,@&,@%/DTtnpV>/ 

lc. #DT,DEF,<#NI,@%:OTnpl/>: 

l d. #DT,DEF,<#DTtnpl%NI,@:,@:/>: 

le. #DT,DEF,<#DTmpl#NI,<;>,<:>:>: 



Algorithms in the SAM 76 Language 


Tl 

II 

II 


ll TI In the algorithms described and 

I I introduction II illustrated in this section, use is made 

|J_U of the procedure named "print" to 

display the script of the functions, 
expressions, and other text strings. 

The "print" function is useful in that it augments the 
capability of the "vt - view text" function by prefixing 
each individual "text" displayed with its name bounded by 
angle brackets; assuming that texts have been created as 
shown: 

tr.—-. 

{} %dt,a,apple/= 

0 %dt,b,bottle/= 

{} %pt,b,t/= 

{} 


The use of "print" would cause the following display: 

< a > 

apple 

< b > 

bo[l][1]le 

The need and use of the "print" ll Tl 

expression was described earlier; the 11 print jI 

expression to accomplish this task uses |J_[I 

a multi partition value #2. 

Typical use to print out name and contents of the text area 
which in this example only contains the "print" expression 
would be: 

Tl.-. 

{} *print%lt,(,)//= 

{) < print > 

{} %ii,[1],,,!os, 

{} « [1] »/%vt,[l]/*os, 

{} /Iprint[#2]/// 

{) 


A simple way of doing some procedure 11 Tl 

"proc" some desired "n" number of times 11 do "n" Times I I 

is exemplified by the use of "ds - IJ_[I 

duplicate string" in the expression 
named "dnt": 

< dnt > 

%ds,[1],!%proc/// 


The simple recursive function named ll Tl 

"fac" generates the factorial of any 11 factorial 11 

number which replaces partition value 1 1 1 _[I 

in its use. 


< fac > 

%ig,l,[1],1,!%mu,[1],%fac,%su,[1],1///// 

TT.. 

{) %fac,5/=120 

U 


This recursive function named "exp" is 11 

used to generate the exponential of "m" 11 exponential 11 

to the "n"th. power; in use "m" replaces IJ_[I 

partition value 1, and "n" partition 
value 2. 

< exp > 

%ig,[2],,!%mu,[1],%exp,[1],%su,(2),1////,1/ 

n. 

{} %exp,3,7/=2187 

U 


The recursive expression named "mrn" 
extracts the "m"th. root of any number 
“n"; it should be noted that this 
function makes use of the expression 
named "exp", which generates an 
exponential. 


II II 

I I "m"th. I I 
I | root of "n" I I 


< mrn > 

%ig,%exp,[3],[2]/,[1], 
!%su,[3],l//, 

!%mrn,(1],[2],%ad,[3],1//// 

TT. 

0 %mrn,2187,7/=3 

{} 


Expression named "tensor" is used to ll Tl 

generate a list of successive numbers 11 tensor 11 

separated by the size of the list IJ_H 

is specified by the integer number which 
replaces partition value 1 in the expression. 

< tensor > 

%ig,[1],l,!%tensor,%su,[1],1//.[1]/,1/ 


A frequently needed capability is that 
of generating "roman" numbers, as for 
text section and chapter headings; when 
function "dtr" is invoked with a decimal 
number as its argument, the value 
returned is the same in roman notation. 

Thanks are extended to Jim Gimpel, of the Bell Telephone 
Laboratories for suggesting this as a most useful adjunct 
to the SAM76 language, as it is to the SNOBOL language. 


1 

1 

Decimal 

"Tl 

II 

1 

to 

II 

1 

1 

Roman 

II 

II 


Page 22 Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia. Box E, Menlo Park, CA 94025 


Number 21 


32 















<; atr > 

%dt,x, [l]/%roml/%y/%et,x,y,z/ 

< roml > 

%ig,%crd,x/,,!%rom2,*fc,x//%roml/// 

< rom2 > 

%dt,z,[l]/%pt,z%d//*dt,z,%z% r///%pt,y*u//*dt,y,%y% t//% z// 

< d > 

,0,1,2,3,4,5,6,7,8,9 

< r > 

,,I,II,III,IV,V,VI,VII,VIII,IX 

< u > 

,I,V,X,L,C,D,M 

< t > 

,X,L,C,D,M,*,§ 


< hanoi > 

%ii,[1),0,,!%hanoi,%su,[1],1/,[2],[4],[3]/! 

Move Ring [1] from [2] to [3]/ 

%hanoi,%su,[l],l/,[4],[3],[2]/// 

Given the need to move four rings from "hither" 4^®-yon", 
using "thither" as a way station, the monks needed only to 
follow the following sequence to do the task in a minimum 
length of time: 

tr. 

{} %hanoi,4,hither,thither,yon/= 


(} 

Move 

Ring 

1 

from 

hither 

to yon 

{} 

Move 

Ring 

2 

from 

hither 

to thither 

u 

Move 

Ring 

1 

from 

yon to 

thither 

{} 

Move 

Ring 

3 

from 

hither 

to yon 

{} 

Move 

Ring 

1 

from 

thither 

■ to hither 

{} 

Move 

Ring 

2 

from 

thither 

to yon 

{} 

Move 

Ring 

1 

from 

hither 

to yon 

{} 

Move 

Ring 

4 

from 

hither 

to thither 

{} 

Move 

Ring 

1 

from 

yon to 

thither 

{} 

Move 

Ring 

2 

from 

yon to hither 

{) 

Move 

Ring 

1 

from 

thither 

■ to hither 

{} 

Move 

Ring 

3 

from 

yon to 

thither 

(} 

Move 

Ring 

1 

from 

hither 

to yon 

(} 

Move 

Ring 

2 

from 

hither 

to thither 

{} 

Move 

Ring 

1 

from 

yon to 

thither 


{} 


The “hex" freak can fulfill his desires 
by defining the "htr" expression to 
achieve "hex to roman" conversion: 


II II 

I I hex to roman I I 

II II 


< htr > 

%dtr,%xd,[1]// 


The user often finds it necessary to I I 
derive a series of answers resulting 11 loop 

from the execution of some script for a IJ_[I 

range of numbers "nl" to "n2"; the 
script loop provides this capability by enabling the user 
to specify for partition 1 the name of the function, the 
lower of the two numbers "nl" as partition 2 and the higher 
number "n2" as partition 3. 

< loop > 

%zs,6,[2]/%zs,7,%su,[3],[2]//%zi,7/%lpl,[1]/ 

< lpl > 

%lp2,[1],%zq,6//%zi,6/%zd,7,,,l%lpl,[1]/// 

< lp2 > 

i 

/%ps,-4, ,[2]/ %[1],[2]/ 

For example the user wishes to ascertain the "roman" number 
equivalent of the decimal numbers from 105 to 116: 

TT.-. 

{} %loop,dtr,105,116/= 


n 

105 

CV 

u 

106 

CVI 

u 

107 

CVII 

u 

108 

CVIII 

u 

109 

CIX 

u 

110 

CX 

n 

111 

CXI 

u 

112 

CXI I 

u 

113 

CXI II 

o 

114 

CXIV 

(j 

115 

cxv 

0 

116 

CXVI 


U 


The expression named "hanoi" is a 
classical example of recursive 
capability; although the original is 
said to be based on monks moving rings 
between the three towers of Bhrama, the 
to be better known for this puzzle. 

The expression shown below was conceived by Dick Stone; it 
solves the problem, with a minimum number of moves: 


Often times it is desired to execute all II 

procedure on each and every one of some 11 repeat 11 

arbitrary number of "texts" in the IJ_[I 

storage area; as an example a script 
designed to provide a list of text names and the count of 
characters in each text will be illustrated; the key to 
this script was the use of "mt - multi part text"; it was 
used to create the multi partition value "#2" seen in the 
expression named "repeat". 

< repeat > 

%ii,[1],,,!%procl,[l]/%repeat[|2]/// 


< procl > 

%os, 

%ps,10, ,[l]/%ps,-5, ,%crd,[1]/// 

If, for instance, the only texts in the text area were 
"repeat" and "procl", then the use of repeat with an "It - 
list text function" would appear as follows: 

TT. 

{} %repeat%lt,(,)//= 

{} repeat 26 

{} procl 32 

{} 


The "skim" expression "skims off" the |1 Tl 

first appearance of each different 11 skim 11 

character of the string which is placed |J_[I 

as an argument to the expression; the 
result is returned as the value. 

< skim > 

%dt,,![l]//*rs,%i//%et,/ 

< i > 

%ig,%crd,/,,!%k,&fc,//// 

< k > 

% P t, ,[l]/%i,[l]/![l]/ 

A simple example of the use of "skim" follows; 

TT'... 

{} %skim,MISSISSIPPI/=MISP 

U 


ii-Tl 

11 hanoi 11 


name "hanoi" seems 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Page 23 











Increments in X and Y 


In his book "Algorithms in SNOGOL4" Jim Gimpel, the author, 
offers SKIM as an example of string manipulation; it is 
interesting to note the typing effort required for the same 
function in each language; it is assumed that a speed of 
ten words per minute (or one character per second) is 
reasonable for intellectual typing. At that rate the SAM76 
script would take approximately 100 seconds, while the 
SN0B0L4 example would require approximately 143 seconds to 
typo up* 


SAM 76 Language Functions 11 


The SAM76 language functions described in the following 
pages represent a first draft for test and evaluation 
purposes, and include all of the functions available in a 
processor for that language initially coded for the INTEL 
8080 and Zilog Z-80 microprocessors. 

In particular these functions properly represent the action 
expected for processors which have the <ncra> 
identification; see function [@n). 

Ttie references listed below should be used to provide 
information as to language syntax, method of use, and 
applications: 


1. "SAM76 - A language based on I I II 

"Strachey's GPM and Me Ilroy's M6", II References II 

by Claude A. R. Kagan, dated august |J_[I 

1976, and available as report R 

76-301 from the IEEE Computer Society, 5555 Naples Plaza, 
Long Beach, CA, 90803. 

2. "SAM76 Language Primer" to be published. 

3. Notes on loading and using SAM76, from the Amateur 
Computer Group of New Jersey. 

The author would greatly appreciate feedback, particularly 
if errors are found in this document, or if the definitions 
do not seem to correspond to the action encountered in a 
given processor. 


xnl,ynl, ... xn,yn 

con Condition 

EQ Equal 

GT Greater Than 

LT Less Than 

ZE Zero 

GE Greater than or Equal 

LE Less than or Equal 

UC Upper Case 

LC Lower Case 

When a radix greater than 10 is used upper case alphabetic 
symbols represent the ensuing integers starting with "A" 
being equivalent to 10 in base 10, "B" to 11, and so on. 
Lower case characters are used when the radix exceeds 36. 


II-- 

I I Function Definitions 

II _ 


238 - |@f,s0| wh@ are Functions 

The value of this function is a list of built-in functions 
available within the system. Each function mnemonic is 
preceded by the string of characters symbolized by "sO". It 
is advisable to use the "neutral" form of expression as 
shown below: 

&@@f, /={value will be list of functions) 

Note use of two since that symbol is a warning 
character it must be protected, and in the above example it 
is . used as the single character protector to protect 
itself. 


239 - I@nI wh@ is processor ser. Number 

The value returned through execution of this function is 
the version number of the processor being used. This number 
is tested by some of the functions - and may also be so 
tested by the user - to ascertain c xnpatibility between 
scripts and run time load modules that may be moved between 
systems and users. 


Ancelme Roichel 
Box 257 - RR1 
Pennington - N. J., 08534 


Notation used in list of functions 


# Preliminary definition - no ID number assigned 

I function,argl,arg2,...,argn| Active form of execution 
\function,argl,arg2,—,argn\ Neutral form of execution 

@ "at" (wh@ means "what") 


c2,cl, .. 

,. ,c 

Single characters 

s2,sl, .. 

.. ,s 

Character strings 

sO 


Prefixing character string 

t2,tl, .. 

.. ,t 

Names of Texts 

f2,fl, .. 

.. ,f 

Names of Files 

d2,dl, .. 

.. ,d 

Decimal Numbers 

n2,nl, ., 

.. ,n 

Numbers in current radix 

x2,xl, . 

.. ,X 

Binary numbers (octal/hex) 

vz 


Value if function fails 

vt 


Value if function True 

vf 


Value if function False 

vO 


Value if function zero 

v+ 


Value if function positive 

V- 


Value if function negative 

dev 


Device 

a2,al, . 

.. ,a 

Abbreviations 


237 - |@t| wh@ is processor Title 

The value of this function provides information as to the 
authorship of the processor being used; a typical example 
is: 

&@@t/=<ncra> indicating that the authors are: 
"Neil Colvin Claude Roichel Roger Amidon. 


159 - Iab,sl,s2,vt,vfI Alphabetic Branch 

This function compares the character strings denoted by 
"si" and "s2" in terms of their "ASCII" binary value; if 
the string "si" has a lesser value than the string "s2" 
then the value of the expression is the string denoted by 
"vt", else the value is the string denoted by "vf"; if the 
value strings are expected to contain executable or 
syntactically meaningful symbols they should be protected 
within the expression. 

128 - Iad,nl,n2,n3,...,n| Add 

The value of this expression is the arithmetic sum of the 
integer numbers denoted by "nl", "n2", ... "n". Each of the 
arguments is examined from right to left until a symbol not 
representing a valid number in the current number base is 
encountered; non numeric symbols prefixing the arguments 
are ignored with the exception of those in argument "nl" 
which is carried into the value string of the expression. 


Page 24 


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


Number 21 


34 



For example: 


148 - |cld,t| 


Characters Left of Divider 


%ad,dog5,cat6/={dogll) 

Negative numbers are indicated in the usual manner with a 
sign which must immediately precede the string of 
integers it applies to thus: 

%ad,dog-5,cat6/={dogl) 

Omitted arguments (such as adjacent commas) have the value 
of the "null string" and a numeric value of zero (0) as 
illustrated in the following example: 

%ad,dog,/={dog0} 


160 - Iai,s0,sl,s2,_,s| Alphabetic Insertion 

Hie value of this function is a character string in which 
the string denoted by "si" has been inserted ahead of the 
first of the subsequent argument string which has a greater 
alphabetic value; each of the strings which form the 
arguments of the expression are returned with a copy of the 
string symbolized by "sO" preceding it. 

187 - |and,xl,x2| And the bits 

The value of this function is the result of performing an 
anding of the two binary numbers represented in the current 
"X" base by "xl" and "x2". 


161 - |as,s0,sl,s2,...,s| Alphabetic Sort 

The value of this function is a character string in which 
the sequence of the strings denoted by "si", "s2", ... "s" 
is rearranged to be in proper alphabetic sequence; each of 
these strings is preceded by the string denoted by "sO” in 
the result: 

%as,(,),horse,cat,dog/=(,dog,cat,horse} 

Note the use of "(,)" for "sO"; this is typical of lists 
that the user may wish to use in a variety of functions 
which have arbitrary number of arguments. 

220 - |bf,f,vz| Bring File 

Execution of this function serves to bring from auxiliary 
storage the file whose name is denoted by "f"; if this file 
does not exist, then the value of the function becomes the 
string symbolized by "vz". 

113 - lca,s| Change Activator (current) 
\ca,s\ Change Activator (initial) 

The purpose of this function is to change the symbol which 
terminates input from its current value to that denoted by 
the first character of the string denoted by "s"; active 
form is used to change the operational activating character 
whereas the neutral form is used to change the initial 
table. 


195 - |cfc,dl,s| Change Fill Character schema 
\cfc,dl,s\ Change Fill Char, (initial) 

The purpose of this function is to enable the user to 
specify the number of that character which is the first one 
of the string denoted by "s" that will be automatically 
output at the beginning of each "new line"; usually these 
will be "nulls" but they may be any other character the 
user wishes to use. Active form of the expression changes 
the table in active use, while the neutral form changes the 
initial table; see [cnb]. 


193 - lcin,tl,dl,...,t,d| Change Id Number 
To be defined and coded. 

Number 21 


The value of this function is the (decimal base) number of 
characters located between the beginning of the "text" 
whose name is denoted by "t" and the current location of 
the internal "text divider" of said text. 


191 - |cll,d| Change Line Length (active) 
\cll,d\ Change Line Length (initial) 

The purpose of this function is to change the number of 
characters that the processor will output before 
automatically inserting a "new line" code; the desired 
value is the decimal number denoted by "d" in the 
expression; the active form changes the actively used 
constant, while the neutral form changes the initial 
condition table; see [cnb]. 


133 - |cnb,d| Change Number Base (active) 
\cnb,d\ Change Number Base (initial) 

The purpose of this function is to change the radix of the 
processor's arithmetic functions; this is always expressed 
as the decimal number symbolized by "d" in the expression; 
see [qnb]; active form of the expression changes the value 
of the radix used during the actual operations while the 
neutral form changes the initial table. Note that the 
neutral change can only be effective while the processor is 
in unprotected memory, and will have no effect if the 
processor is executed from read only or protected memory. 


266 - |cpc,tl,dl,...,t,dI Change Protection Class 
To be defined and coded. 

147 - |crd,tl Characters Right of Divider 

Hie value of this function is the (decimal base) number of 
characters located between the beginning of the "text" 
whose name is denoted by "t" and the current location of 
the internal "text divider" of said text. 


203 - |cro,sl| Change Rub Out char, schema 
\cro,sl\ Change Rub Out (initial) 

The purpose of this function is to permit the user to 
specify as the first character of the string denoted by 
"si" that symbol desired to serve the character delete 
function; in addition the user may specify the next two 
characters of that string to be output before and after, 
respectively, the deleted string of characters. The active 
form changes the user table, while the neutral form of this 
function changes the initial table; see [cnb). 


132- |ct,tl,t2,t3,...,t| Combine Texts (superseding) 
\ct,tl,t2,t3,...,t\ Combine Texts (save current) 

The purpose of this function is to create a text, whose 
name is denoted by "tl” which will contain the 
"concatenation" of the texts whose names are denoted by 
"t2", "t3", ... "t". 

The active form of the expression will also delete the 
current text named "tl" if any; the neutral form of the 
expression will not cause deletion of any pre-existing 
texts. 


250 - |cwc,sl| Change Warning Character 

\cwc, ... \ Change Warn. Char, (initial) 

The purpose of this function is to allow the user to select 
other symbols for syntactic purposes than those initially 
defined in the language; see [gwc]. The active form of this 
function changes the current user tables while the neutral 
form changes the initial table; see [cnb]. 

Page 25 


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


35 



261 - |cws,d| 
\cws,x\ 


Define Text (superseding) 
Define Text (save current) 


Change work Space 


This function allows a respecification of the upper limit 
of space required for function execution and text storage; 
the neutral form is used to allow a binary (hex, octal ... 
) number denoted by "x" to be entered; the active form uses 
the decimal nunber system instead; see [qws]. 


171 - |cx,sO,s| Character to "X" 

This function returns as a value a sequence of binary 
numbers, each preceded by the string denoted by "sO" which 
result from converting the character string denoted by "s"; 
the conversion is in the current specification for the "X" 
base; see [cxb, qxb, xc]. 


200 - |cxb,d| Change "X" Base (active) 
\cxb,d\ Change "X" Base (initial) 

Through use of this function, the user may change the 
specification of the radix (or base) for those functions 
which operate in the "X" base; "d" symbolizes the decimal 
value of the desired new radix, and this should normally be 
either "2" or "4" or "8" or "16"; active and neutral forms 
operate with respect to the "X" base in the same manner as 
described for the "cnb - change number base" function. 


103 - Idt,t,s,dl,d2| 

\dt,t,s,dl,d2\ 

This function is used to create a "text" whose name is 
denoted by "t", containing the string of characters 
symbolized by ”s"; arguments denoted by "dl”, "d2" are for 
undefined purposes. 

The active form of the expression serves also to erase the 
text whose name is "t" if currently in the text area; the 
neutral form will not cause any text deletion. 


173 - |dx,d,x| Decimal to "X" 

The value of this function is that number which results 
from converting the decimal number denoted by "d" to its 
equivalent in the current "X" base; the argument symbolized 
by "x" is undefined; see [xd, cxb, qxb]. 


206 - |ea,tl,t2,_,t| Erase All excepting 

This function is used to erase from the text area all 
defined texts; excepted from this erasure are the texts 
whose names are denoted by "tl", "t2", ... "t"; full 

erasure is accomplished as shown below: 

%ea/= 


259 - |da,s0| Date 

The value of this function is the current calendar date in 
the sequence of "day, month, and year"; each of these 
elements is preceded by the string of characters denoted by 
"sO”. 

The date may be either user entered (using the "sda" 
function) or may be automatically generated by a system 
clock or calendar; see [sda]. 


131 - |di,nl,n2,vz| Divide 

The value of this function is the integer result of 
dividing the number denoted by "nl", by the second number 
denoted by "n2"; if the result of the division would be 
indeterminate - "n2" = zero - then the value of the 

expression is that string denoted by "vz". 

Treatment of non numeric, signs, and null strings is 
identical to that described in the "ad" function. 


208 - |dq,s| Define Quote 

The purpose of this function is to enable the user to 
specify the character that is to be recognized by the scan 
algorithm as an unconditional protecting character. To be 
further defined. 


- ldr,t,a,o,v| Define Relationship 

To be defined and coded. 


164 - |ds,d,s| Duplicate String 

The value of this expression is a concatenation of that 
number of copies of the string "s" which is denoted by the 
decimal number "d". 

This function may be quite properly used to "DO" something 
a desired number of times as illustrated below: 

%ds,5,!%dt,x,%ad,3,%x/////= 

This example shows a most awkward way of creating a text 
named "x" which contains the product of 5 and 3. 


207 - |ed,t,dl,d2,vz| Extract "D" characters 

The value of this function is a string of characters 
extracted from the text whose name is denoted by "t"; the 
first character returned is that which is found distant to 
the right of the text divider by the number denoted by 
"dl”, and the number of characters returned is denoted by 
the number "d2". 

If there are absolutely no such characters available then 
the value of the expression is that string denoted by "vz" 
which is always treated actively; this is regardless of 
whether the original expression was used actively or 
neutrally. 


224 - |ef,fl,f2,...,f| Erase Files 

This null valued function is used to erase from auxiliary 
storage the files whose names are denoted by "fl", "f2", 
... ”f". 


151 - |ep,t,pl,p2,...,p| Erase Partitions 

This function serves to delete from the text named "t" any 
partitions that may be found in it to the right of the 
internal text divider. 

If arguments "pi", "p2", and so on are specified, then only 
those partitions with values denoted by these arguments are 
deleted. 


- ler, ... I 

To be defined and coded. 


Express Relationship 


104 - |et,tl,t2,...,t| Erase Text 

\et,tl,t2,...,t\ Erase all occurences of Text 

This function is used to erase from the text area texts 
whose names are denoted by the arguments of the expression; 
the active form of the expression erases only the latest 
version of the named texts, should more than one version 
exists in the text area. 


Page 26 


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


Number 21 



249 - |etb,s| 


Fetch "D" Matches 


Erase Trailing Blanks 

This function, which Neil Colvin insisted be made 
available, serves to delete from the character string 
symbolized by ”s" all blanks which immediately precede the 
occurence of "new line' 1 codes; particularly useful when 
reading punched cards with many trailing blank columns. 


112 - lex,f| Exit 

This function is used to exit from the processor back to a 
system monitor; if the expression contains any arguments, 
such as "f” then a file is created in auxiliary storage 
which contains all of the user work space including 
variables, working area and text area. 

This file is given the name denoted by "f", and may be 
reloaded on any other system and the action interrupted by 
the execution of this function is then resumed at the same 
point. 

Successful resumption of action is subject to compatibility 
as determined by verification of the system authorship and 
version number. 


226 - |fb,f,vt,vf| File Branch 

The value of this function is the string symbolized by "vt" 
if the file whose name is denoted by "f" is to be found in 
external storage; if not the value of this function is that 
string symbolized by ”vf". 


137 - lfc,t,vz| Fetch Character 

The value of this function is the character to be found 
immediately to the right of the internal text divider of 
the text whose name is denoted by "t"; if such a character 
exists then the text divider is advanced to point to the 
next available character - or alternatively to the end of 
the "text". 

If no character is available then the value of the 
expression is that string denoted by "vz" which is always 
treated actively. 

138 - |fdc,t,d,vz| Fetch "D" Characters 

The value of this function is that decimal number of 
characters denoted by "d" which is to be found to the right 
or left of the internal divider of the text whose name is 
denoted by "t"; a positive number specifies to the right, 
and a negative number to the left; the text divider is then 
relocated to point to the next character available if to 
the right, or to the first character returned in the value 
string if to the left. 

Should there be absolutely no characters (not even one) 
available for the value, then ”vz" represents the string 
which will be returned as the value of the expression, and 
this value is always treated actively. 


139 - |fde,t,d,vz| Fetch "D" Elements 

The value of this function is that string of characters to 
the right or left of the text divider of the text whose 
name is denoted by "t" which comprises the number of 
elements specified by the decimal number "d"; an element is 
that which is found between partitions. 

The divider is then moved either to the right or left to 
point either to the next character to be read (if to the 
right) or that character which corresponds to the first 
character of the value string (if to the left). 

If absolutely no characters are returned, then the divider 
is not moved and the value of the expression is that string 
symbolized by "vz" which is always treated actively. 


140 - |fdm,t,d,s,vz| 

The value of this function is a character string taken to 
the right of the text divider of the text whose name is 
denoted by "t"; the contents of the text "t" is scanned 
searching for occurences of the string denoted by "s"; when 
that number of occurences equal to the number ”d" is found 
then the divider is relocated to point to the next 
immediately following character, and the value string is 
that which lies between the old and the new divider 
locations. 

If the required number of matches is not found, then the 
divider is not moved, and the value of the expression is 
that string denoted by "vz", which is always treated 
actively. 

If the desired number is negative, then the action takes 
place to the left of the divider instead of to the right. 


141 - |fe,t,vz| Fetch Element 

The value of this function is that string of characters 
which is to be found immediately to the right of the 
current location of the divider in the text named "t" up to 
the next encountered partition - or end of text. 

The text divider is moved to point to the immediately 
available next character. 

If absolutely no characters are to be found, then the value 
is the string denoted by "vz", which is always treated 
actively. 


142 - |ff,t,d,vz| Fetch Field 

The value of this expression is that string of characters 
to be found to the right of the first occurence of a 
partition of value symbolized by "d" until the next 
partition is encountered, or to the end of the text named 
"t"; the divider is then moved to point to the next 
available character. 

If absolutely no characters are returned, then the divider 
is not moved, and the value of the expression is the string 
symbolized by "vz" which is always treated actively. 


143 - |fl,t,s,vz| Fetch Left match 

The text named "t" is searched to the left of its internal 
divider for a string identical to that denoted by "s"; if 
such a string is found then the divider is moved to point 
to the first character of that string and the value of the 
expression is that group of characters to be found between 
the new location of the divider and its old location. 

If no such matching string is found, then the divider is 
not moved, and the value of the expression is the string 
"vz" which is always treated actively. 


145 - |fp,t,xl,...,x| Fetch Partition 

The value of this function is the next partition to be 
found in the text whose name is denoted by "t"; the text 
divider is moved to point to the next ensuing character. 


144 - |fr,t,s,vz| Fetch Right match 

The text named "t" is examined starting at the current 
location of the text divider for a string identical to that 
denoted by "s"; if such a string is found, then the divider 
is moved to the next character which follows this string 
(or the end of the text) and the value returned is that 
string of characters which lies between the old and the new 
locations of the text divider. 


Number 21 


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


Page 27 



If no such match is found, then the value of the expression 
is the string denoted by "vz", always treated actively, and 
the divider is not moved. 


106 - Ift,t,sl,s2,...,sI Fetch Text 

Hie value of this function is the contents to be found in 
the text named "t" to the right of its internal text 
divider. 

Any partitions found in that portion of the text are 
replaced with the strings denoted "si", "s2", ... "s", in 
such a manner that partitions with value "1" are replaced 
by "si", value 2 with "s2" and so forth. 


115 - IicI Input Character 

Hie value of this function is one character the source of 
which is the currently selected input device; this may be 
absolutely any one single character in the system character 
set. 


116 - |id,d| Input "D" characters 

Hie value of this function is a stream of characters from 
the current selected input device; the action is terminated 
when that number symbolized by "d" has been received; in 
the case of certain sources, an End of File will also 
terminate. 


210 - |ftb,t,s,vz| Fetch To Break character 

Hie value of this function is a string of characters taken 
from the current location of the internal text divider of 
the text whose name is denoted by "t" to the first ensuing 
character in text "t" which is found in the string 
symbolized by "s"; the text divider is moved to the first 
character which follows that which terminated the scanning 
action. 

If no character is returned, then the divider is not moved 
and the value of the expression is that string symbolized 
by "vz" which is always treated actively. 


211 - |fts,t,s,vz| Fetch To Span character 

Hie value of this function is a string of characters taken 
from the current location of the internal text divider of 
the text whose name is denoted by "t" to the first ensuing 
character in text "t" which is not found in the string 
symbolized by "s"; the text divider is moved to point to 
the first character which follows that which terminated the 
scanning action. 

If no character is returned, then the divider is not moved 
and the value of the expression is that string symbolized 
by "vz" which is always treated actively. 


212 - |hc,s| How many Characters 

Hie value of this function is the actual number of 
characters comprising the string symbolized by "s". 


150 - |hm,t,s| How many Matches 

Hie value of this function is that number of occurences of 
the string of characters symbolized by "s" in the text 
whose name is denoted by "t". 


149 - |hp,t,d| How many Partitions 

The value of this function is the number of partitions to 
be found to the right of the text divider in the text whose 
name is "t"; if there is no explicit third argument, then 
the value represents the total number of partitions; if 
argument three is specified, then the value is that number 
of partitions whose value is eoual to the number symbolized 
by "d". 


114 - |ht,t| Hide Text 

\ht\ Hide all Texts 

Hie purpose of this function is to put a screen or fence in 
the text area such that only those texts created after that 
whose name is denoted by "t" are available. 

This fence is removed by execution of this function with no 
arguments; if it is desired to conceal all of the text 
area, the the neutral form is to be executed. 


153 - |idt,d| Input "D" Texts 

Hiis function serves to place into the text area "texts" 
which are loaded from various types of auxiliary storage 
media and created through use of the "output text" 
functions. 


136 - Iig,dl,d2,vt,vf| If Greater 

Hiis expression compares in an arithmetic sense the two 
strings denoted by "dl" and "d2"; if the value of "dl" is 
greater than that of "d2", then the value of the expression 
is that string symbolized by "vt", else the value is that 
string symbolized by "vf". 


135 - Iii,sl,s2,vt,vf| If Identical 

Strings symbolized by "si", and "s2" are compared, if found 
to be absolutely identical, then the value of the 
expression is that string symbolized by "vt"; if not 
identical the value is the string symbolized by "vf". 


117 - Iim,sl,s2,...,s| Input to Match 

Hie value of this expression is a stream of characters 
coming from the currently selected input device; 
termination of this stream occurs as soon as one of the 
strings symbolized by "si", "s2", ... "s" has been 
encountered; the value includes the string that caused 
termination. 


102 - |is,dev| Input String 

Hie value of this function is a stream of characters coming 
from the currently selected input device; termination 
occurs as soon as the currently specified "activating 
character" is encountered; this activating character does 
not become part of the value string of the function. 


152 - |it| Input Text 

Hie purpose of this function is to place in the text area 
one text loaded from some auxiliary storage media, which is 
in the format generated through use of tne "output text” 
functions. 


213 - |iw,nl Input Wait 

Hiis function sets up an internal timer which becomes 
effective for the next ensuing input function, such as 
"is", "ic", "idc", "im"; automatic termination of the input 
process takes place at the end of the specified time 
interval even though normal terminating conditions 
specified for these functions may not have been met. 

Hie duration of the time interval is specified by "n" which 
is in seconds. 


Page 28 


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


Number 21 


38 



- |lef,dev| 


Load External Function 


To be defined and coded. 


If that last previously executed implied "fetch" was 
active, then the value of this function is that string 
symbolized by "vf". 


216 - IIf,sO,dl.dl List Files 

The value of this function is a list of the names of the 
files in auxiliary storage; each file name is preceded by 
the string symbolized by ”s0”. 

Additional arguments are to be defined. 

- Hr, ... | List Relationship 

To be defined and coded. 


188 - |not,x| Not (complement) the bits 

The value of this function is the complement of the binary 
number (in the current "X" base) symbolized by "x". 


209 - |nu,sl,s2,...,sl Null 

The purpose of this function is to cause execution of the 
function whose name is denoted by "si", with appropriate 
arguments n s2", ... "s"; that function is executed but any 
resulting value string is suppressed. 


105 - IIt,s0,dl,d2,...,d| List Texts 

The value of this function is a list of the names of the 
texts to be found in the text area; each name is preceded 
by the string symbolized by "sO". 

Arguments symbolized by "dl", "d2", ... have not been 

defined. 


110 - lmc,d| Multi-partition Character 

The value of this function is the "multi-partition 
character" whose value is denoted by the decimal number 
"d". 


146 - |md,t,d| Move Divider to pos. "d" 

\md,t,d\ Move Divider "d" increments 

This function is used to move the text divider in the text 
whose name is denoted by "t". Active form serves to move 
the divider the number of positions from the left end of 
the text if "d" is positive, or from the right end if 
negative; the neutral form is used to advance or retreat 
the divider from its current location that number of 
positions specified by the number "d". 

It should be noted that these moves are positional and do 
not distinguish any difference between partitions and 
characters; this is the only function available to position 
the text divider other than immediately preceding a 
character. 

109 - |mt,t,sl,s2,...,s| Multi-part Text all matches 
\mt,t,sl,s2,...,s\ Multi-part Text next match 

This function serves to replace in the text whose name is 
denoted by "t" the strings symbolized by "si", "s2", "s" 
with multi-partitions of values respectively "1", "2", ...; 
the neutral form of this function only replaces the first 
occurence of these strings found in the text. 


130 - |mu,nl,n2,vz| Multiply 


246 - loj,s,sl,d,s2l Output Justified lines 

To be defined and coded. 


248 - |op,s,sl,d,s2| Output Paddded lines 


To be defined and coded. 


186 - |or,xl,x2| Or the bits 

The value of this function is the logical or of the two 
binary number strings "xl" and "x2" expressed in the 
current "X" base. 


101 - |os,s| Output String 

This function causes the selected output device to output 
the string of characters symbolized by "s". 


154 - |ot,tl,t2,...,tI Output Texts 

This function outputs to the selected channel, the texts 

whose names are denoted by "tl", "t2", _ "t", in a format 

which preserves all of the internal conditions of the text; 
this includes location of the internal text divider, and 
text partitions if any. 


108 - lpc,d| Partition Character 

The value of this function is a "partition character" of 
value symbolized by the decimal number "d". 


174 - Ipl,sl,s2,...,s| Plot 

This is a general purpose plotter or display control 
function; details may vary in its use as a function of the 
system in which it is used. Certain subfunctions as 
described below have been standardized: 


The value of this function is the arithmetic product of the 
numbers symbolized by "nl", and "n2". The same rules as to 
sign and non numeric matter apply for this function as they 
do for the "ad" function. 


Should there be an overflow condition arise as a result of 
the execution of this function, then the value of the 
expression is that string symbolized by "vz". 


Ill - |ni,vt,vf| Neutral Implied 

This function returns the string symbolized by "vt" if the 
last previously executed implied "fetch text" was neutral. 


Ipl,lf,s0l 
I pi,as,port,time I 
I pi,nm| 

|pl,vm| 

lpl,cal| 

|pl,tek| 

lpl,mq,x| 


List of Plotter subfunctions 
Assign output port and time delay 
Output plotter control information 
Return as value control information 
Set up for "Calcomp" plotter 
Set up for "Tektronix" display 
Rotate to quadrant "x" 


162 - Ips,d,sl,s2| Pad String 

The value of this function is the string "s2" to which is 
added either to its right or to its left enough 
duplications of string "si" so that the total size of the 
value string becomes equal to the number symbolized by "d"; 
positive values of "d" pad to its right, and negative 
values to its left. 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 


39 


107 - Ipt,t,sl,s2,...,sl Partition Text all matches 

\pt,t,sl,s2,...,s\ Partition Text next match 

The purpose of this function is to replace in the text 
whose name is denoted by "t" the strings symbolized by 
"si", "s2", ... "s” with partitions identified by numbers 

which correspond to the position of the strings in the 
expression; that is to say "si" is replaced by a partition 
value "1", "s2" by partition value "2" &c. 

In its active form, this function serves to replace all 
occurences of the desired strings; in its neutral form only 
the first occurence found is so replaced for each of the 
specified strings. 

Action takes place starting at the current location of the 
internal text divider which is not moved by this function. 

A particular example of interest might be: 

&pt,animal,dog,dog,dog,dog/= 

This example would in the text whose name was animal, 
replace the first match with "dog" with partition value 
"1", the second, "2", the third with ”3" and the fourth 
with "4". 

196 - Iqfc,s0| Query Fill Character schema 

The value of this function is the current specification for 
the optional fill character output immediately after each 
"new line"; the parameters are each preceded by the string 
symbolized by "sO"; see [cfc]. 


194 - Iqin,s0,tl,t2,...,t| Query Id Number 
To be defined and coded. 


197 - |qld,t| Query Left of Divider 

The value of this function is the (decimal base) number of 
positions - characters and partitions - located between the 
beginning of the "text” whose name is denoted by "t" and 
the current location of the internal "text divider" of said 
text. 


192 - Iqlll Query Line Length 

The value of this function is the current specification for 
the line length; this specification is changed through use 
of the "ell" function. 


134 - |qnb| Query Number Base 

The value of this function is the current value of the 
radix for arithmetic operations and functions. 


198 - Iqrd.tl Query Right of Divider 

The value of this function is the (decimal base) nun her of 
positions - characters and partitions - located between the 
beginning of the "text" whose name is denoted by "t" and 
the current location of the internal "text divider" of said 
text. 


204 - lqro| Query Rub Out char, schema 

The value of this function describes the current 
specification for the use of the "rub out"; see [cro]. 

205 - Iqtal Ouery Text Area used 

The value of this function is representative of the amount 
of space consumed in the text area by user defined texts. 


251 - Iqwc,a2,al,...,a| Query Warning Characters 

The value of this function is a list of the currently 
specified and functional warning characters of the 
language. 


262 - Iqwsl Query Work Space 
\qws\ 

The value of this function is the upper limit of the user 
work space; active form of this expression yields the value 
as a decimal number; neutral form yields the value in the 
current "X" base. 


201 - Iqxbl Query "X" Base 

The value of this function is the currently set radix for 
the functions which operate in a "binary" or "X" base. 


215 - Ira,d,sl,s2,s3,...,s| Return Argument 

The value of this function is that string symbolized by one 
of "si", "s2", "s3", ... "s" whose position corresponds to 
the value of the decimal number symbolized by "d". 


263 - |rcp,dl,d2,s| Return Character Picture 

To be coded. 


166 - |ri| Restart Initialized 

Execution of this function causes immediate termination of 
any unexecuted scripts, and causes return to the idling 
condition, reinitializing all normally changed user 
specifications. 


202 - Iqofl Query Over Flow conditions 

The value of this function are characters which may be used 
to identify the cause of an interrupt or overflow 
condition. 


167 - |qp,t| Query Partition 

The value of this function is the decimal identification of 
the next partition to be found in the text whose name is 
denoted by "t"; the text divider is not moved by this 
function. 


245 - Irj,s,sl,d,s2| Return Justified lines 

To be defined and coded. 

252 - |rn,n| Random Number 

The value of this function is a number ranging between 0 
and "n", randomly selected through a computational 
algorithm; see [srn]. 

189 - |rot,d,x| Rotate the bits 


267 - Igpc,s0,tl,t2,...,tl Query Protection Class 
To be defined and coded. 


me value of this function is that binary number which 
results from a rotation of the binary number "x" expressed 
ln current "X" base; the number of bits rotated is 
specified by the decimal number "d"; the direction is 


Page 30 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


40 


Set Time 


clockwise if the number is positive, and counterclockwise 
if negative. 

247 - |rp,s,sl,d,s2| Return Padded lines 

To be defined and coded and coded. 


165 - |rr,sl| Return to Restart 

This function causes immediate cessation of execution of, 
any unexecuted script, forces a return to the idling level 
of the processor and then returns the value of the string 
symbolized by "si"; if that string is an executable 
expression, then said expression is executed. 

163 - |rs,s| Reverse String 

The value of this function is the string of characters 
symbolized by "s” reversed, end for end. 


228 - |saf,dev| Select All File function dev. 

To be defined. 


158 - |sari "Auto Return" on line feed 
\sar\ no Auto Return on line feed 

Execution of this function serves to enable (if active) or 
disable (if neutral) the automatic generation of a 
"carriager return" code when a "new line" code is output. 


260 - Isda,da,mo,yrI Set Date 

This function enables the user to set into the system the 
current ( r any other) desired date. 


258 - Isti,tl,t2,t3l 

Through use of this function the correct current (or 
incorrect if desired) time of day is established in the 
system. 


129 - Isu,nl,n2,...,n| Subtract 

The value of this function is the result of subtracting the 
number symbolized by "n2" from that symbolized by "nl"; all 
rules indicated for sign and non numeric matter in the "ad” 
function apply. 


231 - Isw,sl,s2,s3,...,s| Switches 

Special system dependent function for user definition. 


232 - |sy,sl,s2,...,sl System functions 

Special system dependent function for user definition. 


127 - |tb,t,vt,vf| Text Branch 

If the text whose name is denoted by "t" is to be found in 
the text area, then the value of the function is that 
string symbolized by "vt", else the value is string 
symbolized by "vf". 


257 - |ti,sl,s2| Time 

The value of this function is the current time of day 
derived from a system clock, in the format HH MM SS, where 
HH represent Hours, MM represent Minutes and SS seconds; 
these elements are separated in the value string by the 
string symbolized by "si". 


199 - |sem,dev| Set "Echoplex" Mode active 
\sem,dev\ "Echoplex" Mode inactive 

This function enables character echo from the system if 
executed actively; if neutrally, then echo generation is 
suppressed. 


222 - |sf,f,tl,t2,...,tl Store File 

This function is used to place into auxiliary storage under 
the file name denoted "f", those texts whose names are 
denoted by "tl", "t2", ... "t"; on completion of this 

action, the named texts are erased from the text area. 

If no texts are named, then the assumption is made that the 
entire text area is to be placed into auxiliary storage. 


157 - |sfd,fun,dev| Specify Function Device 

To be defined and coded. 

190 - |sh,d,x| Shift the bits 

The value of this function is that binary number string 
which results from a logical shift to the right or left of 
the string whose binary value, expressed in the current "X" 
base is symbolized by "x"; the number of shifts is 
specified by the decimal number "d" and the direction by 
its sign, positive to the right and negative to the left. 


125 - |tm,d| Trace Mode activated 
\tm\ Trace Mode deactivated 

This function is used to enable step by step execution of 
the scripts and functions of the language; once activated 
each step is initiated by depression of the "new line" key 
("line feed") or a specified number of steps may be 
specified by the number symbolized by "d". 


124 - Itmal 
\tma\ 


Trace Mode All activated 
Trace Mode All deactivated 


Active execution enables full trace action; neutral 
execution allows display only of expressions about to be 
executed. 


168 - |tr,t,s| 


Trim 


This function is used to replace multiple adjacent 
occurences of the character symbolized by "s" with a single 
such occurence in the text named "t". 


218 - |uf,f,tl,t2,...,tl Update File 

This function combines the action of "erase file" and 
"store file" by first storing a file successfully before 
erasing the old file version. 


253 - |srn,n| Seed Random Number 

Through use of this function the attomatic generation of 
random numbers is initiated; the user seed number is 
symbolized by "n" in the above expression. 


169 - |ut,ccl User Trap active 
\ut\ User Trap inactive 

Activating of this trap through use of this function will 
cause an automatic execution of a text (or function) whose 
name is denoted by "cc"; this automatic execution takes 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Page 31 


41 



place whenever the user attempts to make use of system 
interrupt capabilities to escape out of executing "scripts" 
when it is desired that such escape be inhibited. 

118 - Ivt,tl,t2,...,tI View Texts 

This function enables examination of defined texts, 
indicating visually the location of internal text divider, 
partitions and their values, as well as multipartitions. 


181 - |wc,sl,s| Write Characters 

Ibis plotter or display function generates a graphic 
display from a font of vectors named "si"; the string 
symbolized by "s" is the text string to be plotted or 
displayed. 

175 - lwi,xnl,ynl| Write Initialize 

This null valued function serves to create a reference 

value for the current position of the display pointer; the 
"x" and "y" coordinates of this position are set equal to 
the decimal integer strings found in the second and third 
arguments respectively. 

179 - |wl| Width Left 

The value of this function is the incremental value of the 
width of a character being plotted to the left of its 
center of gravity. 

178 - |wrl Width Right 

The value of this function is the incremental value of the 
width of a character being plotted to the right of its 
center of gravity. 

180 - |ws,xnl,ynl,_,xn,ynl Write Straight Lines 

This function causes the generation of the appropriate 
control information to cause the display of one or more 
line segments starting at the current position of the 
display pointer. Successive points are referenced by 
consecutive incremental x and y argument pairs. The x and y 
components are expressed as decimal integer strings. The 
sign of the number indicates direction. 

Non numeric matter preceding the "x" value causes certain 
auxiliary functions to take place as follows: 

U "pen up" or invisible vector 

S Scale change for "x" and "y" 

A Absolute position vector pair 

I Incremental vector pair 

0 Ouadrant rotation 

0-3 clockwise, 4-7 counter clockwise 
W Character width information 

"x" left and "y" right of center 

tr.-.-.—----- 

{) %dt,rect,(,8,0,0,5,-8,0,0,-5)/= 

{) %ws%rect//= 

U 


176 - |wx| Write "X" displacement 

The value of this function is equal to the alqebraic 
difference between the initial value "X" of the display 
pointer position and the sum of any subsequent incremental 
displacement values. 

177 - |wy| Write "Y" displacement 

The value of this function is equal to the algebraic 
difference between the initial value "Y" of the display 
pointer position and the sum of any subsequent incremental 
displacement values. 


An effective way to return the display pointer to its 
original location is illustrated as follows: 

TT.. 

{} %ws,U%wx/,%wy// 

{) 


Assuming it is desired to draw a rectangle,8 units wide, 
and 5 units high: 

170 - Ixc,xl,x2,...,x| "X" to Character 

The value of this function is a string of characters whose 
value is represented by the numbers in "X" base symbolized 
by "xl", "x2", ... "x". 


271 - |xcf,s,x| experimental Change Function 

This function is used to assign a user defined machine 
adress symbolized by the "X" base number "x" for the built 
in function whose mnemonic is denoted by "s". 

172 - |xd,x| "X" to Decimal 

The value of this function is the decimal equivalent of the 
number in the current value of the "X" base symbolized by 
"x". 


255 - Ixi,port I experimental Input 

The value of this function is that number in the current 
"X" base which results from an attempted input from the 
port whose designation in the "X" base is symbolized by 
"port". 


123 - |xj,x| experimental Jump 

Execution of this function cause a jump to the memory 
location symbolized in the "X" base by "x"; a return from 
programs encountered at that location will cause normal 
reentry into the system scanner. 


256 - |xo,x,port I experimental Output 

Execution of this function enable output of the "X" base 
value of "x" to the port whose "X" base id is symbolized by 
"port". 


270 - |xqf,s| experimental Query Function 

The value of this function is the machine adress in "X" 
base radix of the entry point for the function whose 
mnemonic is denoted by the string "s". 


119 - |xr,x| examine Register 

The value of this function is the contents of the memory 
location symbolized in the current "X" base by "x". 


121 - |xrp,x| examine Register Pair 

The value of this function is the combined contents of the 
two memory locations, whose first location is symbolized in 
the current "X" base by "x". 


120 - |xw,xl,x2| experimental Write in reg. 

Use of this function causes writing the value "xl" into the 
memory location "x2"; both of these are in the current "X" 
base. 


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


Number 21 


42 






122 - |xwp,xl,x2| 


experimental Write reg. Pair 

Use of this function causes writing of the double word data 
symbolized in the "X" base by "xl" in the memory location 
whose first word is identified by "x2". 


126 - lyt,t,s,vt,vfI Ys There 

Ibis function searches the text whose name is denoted by 
"t" for an exact match with the string symbolized by "s“; 
if such a match is found, then the value of the expression 
is that string symbolized by "vt”, else it is that string 
symbolized by "vf". 


182 - |zd,r,v-,vO,v+| "Z" reg. Decrement and branch 

Execution of this function causes the contents of a special 
register identified by "r" to be decreased by a count of 
one.; if the resulting contents of that register are 
greater than zero, then the expression value is that string 
symbolized by "v+"; if egual to zero, then the value is 
symbolized by "vO", and if less than zero the value becomes 
the string symbolized by "v-". 


183 - Izi,r,v-,v0,v+| "Z" reg. Increment and branch 

The action of this function is identical to that described 
for "zd", except that the designated register "r" is 
increased by a count of one prior to testing. 


184 - |zq,r| "Z" reg. Query 

The value of this function is the current contents of the 
special register designated by "r"; execution of this 
function does not cause any change in said register. 


185 - lzs,r,n| "Z" reg. Set 

Ibis function is used to preset designated special register 
"r" to the number symbolized by "n". 


SAM 76 - Setting up the System 


Tl 
II 
11 


There are two versions available: II II 

11 Availability 11 


a. Z80 - little less than 8K 

Uses RSTO thru RST6 

b. 8080 - about 9 K 

Does not use any RST locations 

In addition the source code is available from a number of 
ACNJ members if special adressing reauirements are 
encountered or if it is desired to configurate a system 
with fewer functions, or different use of the PST 
locations. 

Except as indicated above both versions are virtually 
identical, and the information that follows applies to both 
of these versions; in consequence user defined texts and 
procedures may be successfully moved between systems using 
either of these two versions. 

Possible incompatibility may be ascertained through use of 
the SAM76 function which reveals the version number thus: 

tr.-. 

(} %P@n/=21 

{> 


reveals the version number of the "romable object code". 


a. Romable program loads at - 'h8000. 

b. "Once Only" start at “h8000 
initializes variables. 

c. Restarts may be made at 8003 or 0. 


2 

Memory 

utilization 


d. System and user variables start at ~h400 

e. Workspace is above ~h600. 


I/O specifications, and user options: II II 

11 System 11 

a. APPLE/ZAPPLE I/O Conventions apply. 11 Differences 11 

IJ_Li 

b. Normally initialized to seek and take 
available RAM. 

c. Special use of control codes is as follows: 

~C Return to Monitor 

*X Cancel current material typed in 

DEL Rubout (changeable by user) 

~N Shift Out to alternate character set 

“O Shift In back to regular character set. 


The Line Feed key is viewed by SAM76 as being equivalent to 
the "NULIN" code, as specified by ASCII; use of this key 
serves to go to the beginning of the next line - combining 
the functions of "Carriage Return and Line Feed". The 
Carriage Return serves only to return to the beginning of 
the same line; this permits underlining &c. 


Modifying SAM76 tables and options: 

There are two levels of modifications 
which the user may apply in the process 
of tailoring the SAM76 code to suit his 
system and needs: 

a. Permanent. 

b. Local or temporary. 

Ttie type of changes are identical but the location of the 
table to be changed and the time at which the table is to 
be changed are different. 

Effectively there is a main table of variables and options 
located in the "romable" or protected section of code; 
after having executed a "GO" to “h8000 this table is copied 
into the user work space starting at location "h40C. 

After this initial entry at "h8000 entry should be made 
only at "h8003 or at location 0 if the user wishes to 
preserve any changes made in the duplicate table at ~h40C 
either with monitor facilities or through the execution of 
SAM76 functions which are available to establish a variety 
of user options. 


4 

Fiddler's 

Guide 


Typical Permanent Changes: 

Normally changes in the table at “h800C 
should be limited to necessary 
respecification of I/O adresses, and in 
some special cases to the location of 
the beginning and or end of the user work 


5 

Useful 

Fiddles 


space. 


In addition the user may make permanent changes to such 
parameters as the maximum length of line, and the 
specification of the number of fill characters after each 
"carriage return/line feed". (Note Line Feed is the proper 
character used for this combined function). 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Page 33 


43 













Table 1 lists the primary portion of the table at "h800C 
with corresponding adresses of its duplicate at ”h40C. 

Table 2 lists locations that may be of interest to the user 
as candidates for permanent changes; since these locations 
may all be changed within the framework of the SAM76 
language, it is suggested that changes be made first in 
that manner, and that the modified duplicate table at "h40C 
be examined before making the desired changes in the 
permanent table. 


Caution should be exercised in changing 0P2 and TOPMAX so 
that TOPMAX be greater than 0R2 by at least “h400 bytes. 


I I 


TABLE 2 


(is continuation of TABLE 1) 



TABLE 1 


.SBTTL /Variables & once only code/ 
• PAGE 


;[VAR1] 
VAR1: 

• BLKB 

1 

[80/4-0C] 

JMP 

BOOT: 

. BLKW 

1 

[80/4-0D] 

Monitor Exit 

MSCI: 

.BLKB 

3 

[80/4-10] 

Console Input 

MSRI: 

.BLKB 

3 

[80/4-13] 

Channel 2 Input 

MSCO: 

■ BLKB 

3 

[80/4-16] 

Console Output 

MSPO: 

.BLKB 

3 

[80/4-19] 

Channel 2 Output 

MSLO: 

.BLKB 

3 

[80/4—1C] 

Channel 3 Output 

MSCSTS: 

• BLKB 

3 

[80/4—IF] 

Console Status 

MSCHK: 

.BLKB 

3 

[80/4-22] 

10 Check 

MSSET: 

.BLKB 

3 

[80/4-25] 

IO Set 

MSMCK: 

• BLKB 

3 

[80/4-28] 

Memory Check 

$232: 

• BLKB 

3 

[80/4-2B] 

%sy,xl,x2,.../ 

$231: 

• BLKB 

3 

[80/4-2E] 

%sw,x0,.../ 

. 

• BLKB 

3 

[80/4-31] 

spare 

OR2: 

.BLKW 

1 

[80/4-33] 

start active zone 

TOPMAX: 

.BLKW 

1 

[80/4-35] 

text area limit 

TOPLOC: 

• BLKW 

1 

[80/4-37] 

future3 

SPARE4: 

■ BLKW 

1 

[80/4-39] 

future4 


I 

Notes with reference to Table 1: 


a. The adresses indicated are those of the actual locations 
which would be changed as required to suit individual 
operating system requirements. 

b. If it is desired to disable any of the monitor functions 
which would be adressed via the vectors of Table 1, replace 
the JMP with a RET - (for instance one might wish to 
disable the automatic RAM grabber by putting a "RET" at 
"h8027" - If this is done it becomes necessary to actually 
stipulate the adress of the end of user workspace by 
entering said adress at ~h8037). 

c. $232, and $231 are locations of jump vectors for the 
SAM76 functions "sy" and "sw" respectively. These are 
intended for user applications; if not required it is wise 
to change the adresses for these functions at “h802B and 
*h802E respectively to the adress found at "h8031 - this 
causes the message <nav-xxx> to be returned should these 
two functions be tested. 

d. Location labelled "TOPMAX" is usually shown as 00-00; 
this in combination with the availability of the MEMCHECK 
function of the ZAPPLE monitor triggers the automatic 
determination of the upper limit of user work space. A non 
zero value at that location takes precedence and serves to 
restrict the user work space to that specified. 

e. Location labelled "OP2" defines the beginning of the 
user work space; this may be changed if the user wishes to 
have clear space for his own purposes at it's normally 
initialized value of 05FE. 


TIR: 

.BLKW 

1 

; 0 

TO: 

• BLKW 

1 

; TCO 

TI: 

• BLKW 

1 

; TCI 

TT: 

• BLKW 

1 

; TCT 

TR: 

■ BLKW 

1 

; TCR 

TE: 

.BLKW 

1 

; Till 

RIX: 

• BLKB 

1 

; N12 

BIX: 

.BLKB 

1 

; N10 

MCH: 

.BLKB 

1 

; "=" EQUAL 

TCE: 

• BLKW 

1 

; FNP1 

CE: 

.BLKW 

1 

; SCE 

TO2: 

• BLKW 

1 

; o 

TC3: 

• BLKW 

1 

; o 

TCECT: 

.BLKW 

1 

; 0 

TCEAN: 

■ BLKB 

1 

; 0 

ROBOT: 

.BLKB 

1 

; N177 

RUBOl: 

.BLKB 

1 

; N74 

RUB02: 

• BLKB 

1 

; N76 

NULCH: 

• BLKB 

1; 

null charact 

NULCT: 

.BLKB 

1; 

filler count 

PLIN: 

.BLKB 

1; 

line length 


Notes regarding changes in Table 2: 

a. PLIN contains the number of characters on a ling at 
which SAM76 is required to automatically generate a 
"NULINE" on the console device. This is usually initialized 
in the permanent table at 72 decimal (“h48), and is changed 
in the duplicate table by using the "ell - Change Line 
Length" function thus: 

TT. 

(} %cll,64/= 

U 


would set line length at decimal 64; the permanent table 
may be changed prior to being placed into protected memory 
using the neutral form of this function. 

b. NULCT, and NULCH locations are used to specify the 
number and the type of "null" character the user wishes to 
have automatically generated on the console device when a 
"NULIN" is output to it. This is usually initialized at 
zero count, and ASCII-0 for the character; to change this 
requires the use of the "cfc - Change Fill Character" 
function thus: 

TT.. 

{} %cfc,*,4/= 

U 


puts 4 asterisks at beginning of each new line; the neutral 
form of the function is used to change the permanent table. 

c. ROBOT, RUBOl, and RUB02 are used to specify the 
character to be used for character deletion purposes, and 
the symbols that are desired to surround the string of 
consecutively deleted characters; initially this is set to 
be the ASCII - DEL code and the surrounding symbols are the 
< and > brackets. Changing this makes use of the "cro - 
Change Rub Out" function thus: 

TT . 

{} %cro,$AB/= 

{} 


Page 34 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 


44 












sets $ to be the deleting character and the deleted string 
is bracketed by A and B; the neutral form of this function 
may be used to change the permanent table. 

d. MCH is the location of the character used to terminate 
entry; this character is known as the "Activator". 
Initially this is set to be the = sign, and is changed via 
use of the "ca - Change Activator" function thus: 


e. Three types of anomalies are flagged by output to the 
console: 


T Time out no tape or jammed tape 

M Memory error 

P Parity error in block 


TT.. 

ft ica,Z/= 

U 


changes activator to be "Z"; use the neutral form to change 
the permanent table. 

e. RIX and BIX are the current specifications for the 
arithmetic and logical or binary bases respectively. These 
locations are initialized to provide base 10 for arithmetic 
and base 16 or hex for logical functions. Within the 
framework of SAM76 they are changed using the "cnb - Change 
Number Base" and "cxb - Change X Base" functions; for 
example: 


f. For the afficionado format is described below: 

16 Bytes “h80 or "o200 

SOH "hi 

DEL “hFF or “o377 

1 byte Number of data bytes (0 means 256) 

2 bytes Load adress (Low then High) 

variable data bytes 

2 bytes Check Sum 


ii-ri 

I I LOADIT - loader 11 


TT.. 

{} %cnb,7/= 

U 


sets arithmetic base to be 7. 

tr.—. 

{} %cxb,8/= 

{} 


sets logical or binary base to octal. 

The neutral form of these functions may be used to change 
the permanent initialization table. 


SAM76 - Loading the object code tape 



The two versions are available in compressed binary form 
for which a special loader is required; this loader is 
usually to be found in normal hex loader format ahead of 
the binary. 

The normal procedure to load is as follows: 

a. Load the hex formatted loader; 

b. Ttie loader should be at “hlOOO to “h475; simply go to 
“hlOOO if using APPLE/ZAPPLE monitors, otherwise change the 
calls to F006 to reflect your own reader input routine 
before running. 

c. If using APPLE/ZAPPLE just do a G8000 to start SAM76, 
otherwise make the appropriate changes as required with 
reference to Table 1 first. 

If you are using a machine with output lights at port FF, 
then the progress of loading will be displayed. As each 
block is successfully loaded a check sum will appear for a 
few seconds then the adress of the new block being loaded 
will be displayed. If the check sum remains, an error is 
indicated and then it is necessary to stop the reader, back 
up the tape to the beginning of the previous block, start 
the reader and G400 again. 

d. Test SAM76 by getting a list of available built in 
functions by typing in the following: 

&@@f, /= 


-RADIX 8 ; added by editor 


.TITLE /loadit/ 

.IOC 002000 ; “hl000 

ZAPMON= 1 

ZAPPLE= 170000 ; *hF000 

SENSE= 377 ; “hFF 

;Control Codes 


OCDLE= 

20 

Data Link Escape 

CCENQ= 

5 

Enquiry 

CCEM= 

31 

End Message 

CCSOH= 

1 

Start of Header 

CCETB= 

27 

End of Tx Block 

CCACK= 

6 

Acknowledge 

CCNAK= 

25 

Neg. Acknowledge 

CCSTX= 

2 

Start Text 


•DEFINE SKIP2[R] = 


(.BYTE 

001I[[[R]&6]<31 

GETLDR: CALL 

GETBY 

CPI 

CCSOH 

JZ 

SOHFND 

GETLDX: CPI 

CCETB 

JZ 

RSEXIT 

CPI 

170 

JNZ 

GETLDR 

CALL 

GETAD 

PCHL 

;all done 

SOHFND: CALL 

GETBY 

CPI 

377 

JNZ 

GETLDX 

LDR377: CALL 

GETBY 

MOV 

C,A 

MVI 

E,0 

MOV 

D,E 

CALL 

GETAD 

LOAD: CALL 

GETBY 

RCVOK: MOV 

M,A 

MOV 

B,M 

CMP 

B 

JNZ 

MEMERP 

I NX 

H 

DCR 

C 

JNZ 

LOAD 


Number 21 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Page 35 


45 










CALL 


PARTST 


JMP CETLDR 


NIXNIX: MVI 

C,"?" 

SKIP2 

D 

MEMERR: MVI 

C,"M" 

SKIP2 

D 

PARERR: MVI 

C,"P" 

SKIP2 

D 

TIMERR: MVI 

C,"T" 

EREXIT: CALL 

CO 

RSEXIT: JMP 

RESTART 

GETAD: CALL 

GETBY 

MOV 

L,A 

CALL 

GETBY 

MOV 

CMA 

H,A 

OUT 

RET 

SENSE 

GETBY: CALL 

RI 

JC 

TIMERR 

PUSH 

PSW 

ADD 

E 

MOV 

E,A 

JNC 

GETBYR 

INR 

D 

GETBYR: POP 

RET 

PSW 

PARTST; POSH 

D 

CALL 

GETAD 

POP 

D 

MOV 

A,H 

CMP 

RNZ 

D 

MOV 

A,L 

CMP 

RET 

'E 


•END ;Pseudo op added by editor 



Quick Reference Information for the [j 
SAM 76 Language_ jj 


II I I An attempt was made, in the selection of 

I| Mnemonics I I the mnemonics of the resident functions, 

|J_[| to be consistent in the use and meaning 

of words or terms represented by the 
function names; generally, whenever reasonable, letters 
used in the function names may be expanded as follows: 


letter 

position 1 

positions 

2 and/or 3 

a 

alphabetic 

all 

activator 

b 

bring 

branch 

base 

c 

change 

character 

c3 

d 

define 

decimal 

divider 

e 

erase 

element 

e3 

f 

fetch 

file 

field, function 

g 

gi 

greater 

g3 

h 

how many 

h2 

h3 

i 

input, if 

identical 

initialize 

j 

jl 

jump 

j3 

k 

kl 

k2 

k3 

1 

list 

left 

length 

m 

ml 

match 

mode 

n 

neutral 

number 

n3 

0 

output 

o2 

o3 

P 

partition 

P2 

P3 

q 

query 

g2 

q3 

r 

return 

right 

register 

s 

set, select 

string 

space 

t 

trace 

text 

t3 

u 

update, user 

u2 

u3 

V 

view 

v2 

v3 

w 

write 

warning 

work 

X 

experimental 

"X" number 

base x3 

y 

yi 

y2 

y3 

z 

Zpecial 

z2 

z3 


In the above table only the more frequently or major terms 
are indicated; positions marked with a letter number pair 
are for possible reference. 

It should be noted that the meaning of the words used in 
the above table are consistent; that is to say that the 
same connotation may be applied - for instance "text" 
always means; "a named string of symbols to be found in the 
text area". 


11 Quick reference 

1 1 

resident function list 11 

II 

238 - I@f,sO1 

wh@ are Functions 

239 - l@n| 

wh@ is processor ser. Number 

237 - |@t| 

wh@ is processor Title 

159 - Iab,sl,s2,vt,vf1 

Alphabetic Branch 

128 - Iad,nl,n2,n3,...,n| 

Add 

160 - Iai,s0,sl,s2,...,s| 

Alphabetic Insertion 

187 - |and,xl,x2| 

And the bits 

161 - Ias,s0,sl,s2,...,s| 

Alphabetic Sort 

220 - |bf,f,vz| 

Bring File 

113 - |ca,s| 

Change Activator (current) 

\ca,s\ 

Change Activator (initial) 

195 - |cfc,dl,sl 

Change Fill Character schema 

\cfc,dl,s\ 

Change Fill Char, (initial) 

193 - lcin,tl,dl,...,t,d| 

Change Id Number 

148 - |cld,tl 

Characters Left of Divider 

191 - |ell,d| 

Change Line Length (active) 

\cll,d\ 

Change Line Length (initial) 

133 - |cnb,d| 

Change Number Base (active) 

\cnb,d\ 

Change Number Base (initial) 


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


Number 21 


46 


266 - lcpc,tl,dl,...,t,d| 

Change Protection Class 

147 - |crd,tI 

Characters Right of Divider 

203 - |cro,sll 

Change Rub Out char, schema 

\cro,sl\ 

Change Rub Out (initial) 

132 - Ict,tl,t2,t3,...,t| 

Combine Texts (superseding) 

\ct,tl,t2,t3,...,t\ 

Combine Texts (save current) 

250 - lcwc,sl| 

Change Warning Character 

\cwc, ... \ 

Change Warn. Char, (initial) 

261 - |cws,d| 

Change Work Space 

\cws,x\ 


171 - |cx,sO,s| 

Character to "X" 

200 - |cxb,d| 

Change "X" Base (active) 

\cxb,d\ 

Change "X" Base (initial) 

259 - Ida,s0| 

Date 

131 - |di ( nl,n2,vz| 

Divide 

208 - ldq,sl 

Define Quote 

- |dr,t,a,o,vl 

Define Relationship 

164 - |ds,d,s| 

Duplicate String 

103 - |dt,t,s,dl,d2| 

Define Text (superseding) 

\dt,t,s,dl,d2\ 

Define Text (save current) 

173 - |dx,d,x| 

Decimal to "X" 

206 - Iea,tl,t2,...,tl 

Erase fill excepting 

207 - |ed,t,dl,d2,vz| 

Extract "D" characters 

224 - |ef,fl,f2,...,f1 

Erase Files 

151 - |ep,t,pl,p2,...,p| 

Erase Partitions 

- ler, ... I 

Express Relationship 

104 - Iet,tl,t2,...,t| 

Erase Text 

\et,tl,t2.t\ 

Erase all occurences of Text 

249 - letb.sl 

Erase Trailing Blanks 

112 - |ex,f| 

Exit 

226 - |fb,f,vt,vfl 

File Branch 

137 - |fc,t,vz| 

Fetch Character 

138 - |fdc,t,d,vz| 

Fetch "D" Characters 

139 - |fde,t,d,vz| 

Fetch "D" Elements 

140 - |fdm,t,d,s,vz| 

Fetch "D" Matches 

141 - |fe,t,vz| 

Fetch Element 

142 - jff,t,d,vz| 

Fetch Field 

143 - |fl,t,s,vz| 

Fetch Left match 

145 - |fp,t,xl,...,x| 

Fetch Partition 

144 - |fr,t,s,vz| 

Fetch Right match 

106 - |ft,t,sl,s2,...,s| 

Fetch Text 

210 - |ftb,t,s,vzl 

Fetch To Break character 

211 - |fts,t,s,vz| 

Fetch To Span character 

212 - |hc,s| 

How many Characters 

150 - |hm,t,s| 

How many Matches 

149 - |hp,t,d| 

How many Partitions 

114 - |ht,t| 

Hide Text 

\ht\ 

Hide all Texts 

115 - licl 

Input Character 

116 - lid.dl 

Input "D" characters 

153 - lidt.dl 

Input "D” Texts 

136 - 1 ig,dl,d2,vt,vfI 

If Greater 

135 - 1ii,sl,s2,vt,vfI 

If Identical 

117 - Iim,sl,s2,...,s| 

Input to Match 

102 - I is,dev I 

Input String 

152 - |itl 

Input Text 

213 - |iw,n| 

Input Wait 

- lief,devI 

Load External Function 

216 - |If,s0,dl.d| 

List Files 

- Ur, ... I 

List Relationship 

105 - |lt,s0,dl,d2,...,d| 

List Texts 

110 - jmc,d| 

Multi-partition Character 

146 - |md,t,d| 

Move Divider to pos. "d" 

\md,t,d\ 

Move Divider "d" increments 

109 - |mt,t,sl,s2,...,s| 

Multi-part Text all matches 

\mt,t,sl,s2,...,s\ 

Multi-part Text next match 

130 - |mu,nl,n2,vz| 

Multiply 

111 - |ni,vt,vf| 

Neutral Implied 

188 - |not,xl 

Not (complement) the bits 

209 - |nu,sl,s2,...,s| 

Null 

246 - |oj,s,sl,d,s2| 

Output Justified lines 

248 - |op,s,sl,d,s2| 

Output Paddded lines 

186 - |or,xl,x2| 

Or the bits 

101 - |os,s| 

Output String 

154 - |ot,tl,t2,—,t| 

Output Texts 

108 - lpc,d| 

Partition Character 

174 - Ipl,sl,s2,...,s| 

Plot 

162 - |ps,d,sl,s2| 

Pad String 

107 - Ipt,t,sl,s2,...,sl 

Partition Text all matches 

\pt,t,sl,s2,...,s\ 

Partition Text next match 

196 - Iqfc.sOI 

Query Fill Character schema 


194 - Iain,s0,tl,t2,...,tl 

Query Id Number 

197 - Iqld.tl 

Query Left of Divider 

192 - Iqlll 

Query Line Length 

134 - jqnb| 

Query Number Base 

202 - laofl 

Query Over Flow conditions 

167 - |ap,t1 

Query Partition 

267 - Iapc,s0,tl,t2,...,t| 

Query Protection Class 

198 - |qrd,t| 

Query Right of Divider 

204 - Igroj 

Query Rub Out char, schema 

205 - Iqtal 

Query Text Area used 

251 - |qwc,a2,al,...,al 

Query Warning Characters 

262 - Iqwsl 

Query Work Space 

\aws\ 


201 - Iqxbl 

Ouery "X" Base 

215- Ira,d,sl,s2,s3,...,s| 

Return Argument 

263 - Ircp,dl,d2,s| 

Return Character Picture 

166 - | r i | 

Restart Initialized 

245 - |rj,s,sl,d,s2| 

Return Justified lines 

252 - |rn,n| 

Random Number 

189 - |rot,d,x| 

Rotate the bits 

247 - Irp,s,sl,d,s2| 

Return Padded lines 

165 - |rr,sl| 

Return to Restart 

163 - |rs,s| 

Reverse String 

228 - |saf,dev| 

Select All File function dev. 

158 - Isarl 

"Auto Return" on line feed 

\sar\ 

no Auto Return on line feed 

260 - lsda,da,mo,yrl 

Set Date 

199 - |sem,dev| 

Set "Echoplex" Mode active 

\sem,dev\ 

"Echoplex" Mode inactive 

222 - Isf,f,tl,t2,...,tl 

Store File 

157 - |sfd,fun,devl 

Specify Function Device 

190 - |sh,d,x| 

Shift the bits 

253 - |srn,n| 

Seed Random Number 

258 - |sti,tl,t2,t3| 

Set Time 

129 - |su,nl,n2,...,n| 

Subtract 

231 - Isw,sl,s2,s3,...,s| 

Switches 

232 - |sy,sl,s2,...,s| 

System functions 

127 - |tb,t,vt,vf| 

Text Branch 

257 - |ti,sl,s2l 

Time 

125 - Itm.dl 

Trace Mode activated 

\tm\ 

Trace Mode deactivated 

124 - Itmal 

Trace Mode All activated 

\tma\ 

Trace Mode All deactivated 

168 - |tr,t,s| 

Trim 

218 - |uf,f,tl,t2,...,tl 

Update File 

169 - |ut,cc| 

User Trap active 

\ut\ 

User Trap inactive 

118 - Ivt,tl,t2,...,tl 

View Texts 

181 - |wc,sl,s| 

Write Characters 

175 - |wi,xnl,ynl| 

Write Initialize 

179 - |wl| 

Width Left 

178 - Iwr| 

Width Right 

180 - |ws,xnl,ynl,...,xn,yn| 

Write Straight Lines 

176 - |wx| 

Write "X" displacement 

177 - |wy| 

write "Y" displacement 

170 - 1xc,xl,x2,...,x| 

"X" to Character 

271 - |xcf,s,x| 

experimental Change Function 

172 - |xd,x| 

"X" to Decimal 

255 - 1xi,port I 

experimental Input 

123 - 1xj,xI 

experimental Jump 

256 - |xo,x,port| 

experimental Output 

270 - |xqf,s| 

experimental Query Function 

119 - |xr,x| 

examine Register 

121 - |xrp,x| 

examine Register Pair 

120 - |xw,xl,x2| 

experimental Write in reg. 

122 - |xwp,xl,x2| 

experimental write reg. Pair 

126 - |yt,t,s,vt,vf| 

Ys There 

182 - |zd,r,v-,v0,v+| 

"Z" reg. Decrement and branch 

183 - |zi,r,v-,v0,v+| 

"Z" reg. Increment and branch 

184 - lzq,r| 

"Z" reg. Query 

185 - |zs,r,n| 

"Z" reg. Set 


Editorial Note: Object tapes for the 8080 and Z-80 versions of 
SAM 76 are available from Computer Mart of New Jersey, 
501 Rt. 27, Iselin, NJ 08830. Telephone: (201) 283-0600. 
Tentative price will be $6.00. Computer Mart of New Jersey 
will also be publishing a book containing all available docu¬ 
mentation on SAM 76. Available in early Spring, it will sell 
for $9.95. -TRW 


Number 21 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 37 


47 





An 8080 Disassembler and 
Support Software for SOL 


by Don Van Dyke 
1125 Lakehurst Rd. 

Livermore, CA 94550 

This is a guide for the use of the following disassembler. 
This disassembler performs most of the work of creating a file, 
but may require human help in the case of lookup tables. 

Requirements 

1. 4k of ram in the area from D000 to E000 (hex in the same 
area of ALS8 requires its scratchpad. 

2. ALS8 assembler with TXT-2 addition. The user must there¬ 
fore also have a VDM-1 or SOL video display. 

3. Enough ram to contain the disassembler, (2k) the created 
file, the object code and the ALS8 assembler, though oper¬ 
ation of this program does not require that ALS8 be in 
memory at the same time if the return point is modified. 

4. SOLOS or CUTER. This program calls the standard input 
routine and inputs from the current pseudo port. 

Instructions 

1. Load the object code to be disassembled into the portion of 
memory where it normally resides. 

2. Choose the correct version of the disassembler. Pick one 
that is located out of the way of the object code, and leave 
enough room for the ALS8 file. Remember that lk of 
object will usually create about Ilk of source. Load the 
program into memory. 

3. Execute the program at the proper location, depending on 
the version selected from the tape. Instructions will be dis¬ 
played on the screen. 

4. After a few seconds the disassembly will be completed, at 
which time it will jump to E060 (the standard ALS8 return 
point), and will display the message “READY”. 

5. Create a new file with the command: 

FILE /name/ location 

and perform an FCHK on it. You should then be able to 
list, edit, or assemble the file at any location by using the 
proper ALS8 commands. 

Helpful Hints 

1. In some cases, it may be necessary for the user to decide 
where data tables are located in the object program. Meth¬ 
ods for determining where these tables are located are 
provided in the program: 

a. The ASCII equivalent for each operation is provided in 
the comment field, if it is a letter, number, or punctua¬ 
tion symbol. This provides easy location of key words 
in tables, and the user should exercise caution when 
changing these areas. 

b. Whenever the file contains a line such as: 

0025 LC03BH DB OCBH 

this means the op found at that location contained an 
unused 8080 instruction, and is therefore part of a table 
of some kind. 


2. If the file contains any undefined symbol errors during 
assembly, this means a label is required in a table, where a 
two or three byte operation overlapped the op where the 
label was to be placed. This situation must be resolved by 
the user by the following method: 

a. Assemble the file, noting any undefined labels and write 
the labels down on paper. 

b. Use the TXT-2 video editor to add an ‘EQU’ pseudo 
statement immediately preceding the statement that 
required the label. An example is shown below. 

Suppose the disassembler creates a file as follows: 


0001 L0104FH 

LXI 

H, L029FH 

0002 

MOV 

A, M 

0003 

INX 

H 

- (etc.) 



0455 

LXI 

B, 04567H 


.... (etc.) 

Then during assembly, this is generated: 

017F21 00 00 U 0455 L0104FH LXI H, L029FH 

(the ‘U’ denotes and undefined symbol) 

Where L029FH should be on the SECOND BYTE of the 
statement: 

0455 LXI B, 04567H 

The user should add the following line to the file: 

»> 0000 L029FH EQU $ + 1 «< 

0455 LXI B, 04567H 

Note that this will assemble into the same thing, but will 
allow the use of the label. 

3. Notice that the line numbers generated are all 0000. This is 
not a problem since the RNUM function may be used to 
renumber the lines. Be sure to do this before using the line 
editor, but it is not required for the video editor. 

4. To insure compatability with assemblers, this program 
generates a ‘6’, instead of SP, PSW, or M. Also, three byte 
instructions contain the address in normal order, rather 
than the reverse INTOL standard. 

5. Since PCHL instructions can be hazardous in the case of 
modifying H&L, this program generates a warning when it 
encounters a PCHL op. The following message will appear in 
the comment field: 

******* <<<; WA rn IN G »>*♦***** 

Support Software 

This is a guide for the use of the support software for the 

accompanying disassembler. 

Requirements 

1. ALS8 assembler with TXT-2 addition. The user must 
therefore also have a VDM-1 or SOL video display. 


Page 38 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 21 



2. 12k of ram from D000 to FFFF (hex) (the standard ALS8 
configuration). 

3. SOLOS or CUTER. This program calls the standard input 
routine and inputs from the current pseudo port. 

Debug 

1. This program uses the current file pointers from ALS8 
and will help to restore crashed files. Although it cannot 
work miracles, in most instances it will restore the file 
to a point where the video editor can finish the job if 
necessary. 

2. It is recommended that DEBUG be loaded into memory 
and be made an ALS8 custom command - i.e.: 

CUSTE / DBUG /CBOO then when the file needs to be 
fixed, make it the current file using: FILE /name/ <cr>. 
Then type ‘DBUG’. After a few moments, ALS8 should 
respond with an FCHK and a ‘READY’. 

Adump 

1. This program works in conjunction with SOLOS or CUTER 
and will display the contents of memory in its ASCII 
equivalent. 


2. To use the program, load it into memory from the tape, 
then make it a custom command by typing: 

>CUST AD CBOO 

The program will now operate like a standard dump by 
typing this command: 

>AD (beginning address) (end address) 

Note that only characters inside the range from 10 to 7E 
(hex) will appear on the screen, and anything outside that 
range shows up as a 

Exam 

1. This program allows the user to examine the contents of 
memory, and is very useful in locating tables and text in 
memory when used in conjunction with ADUMP. 

2. To use this program, load it into memory and execute it at 
the beginning. What you will see is the first lk of memory. 
To advance to the next lk segment, press the up arrow 
(or ctrl-W), to back up to the previous lk segment, press 
the down arrow (or ctrl-Z). To advance 8k at once, press 
tab (or Ctrl-I). To exit to SOLOS or CUTER, press escape. 

ALS8, TXT-2, VDM-1, CUTS, SOL, SOLOS and CUTER are 
copyright by Processor Technology Corporation. 




"O a in in in o o w in o if) 10 o©inin©ooinio© in in . © © in o 

auooo o o o o © © © ©o © o© © ©o c© © o |© © © o 

ii.o<r<rn uj o) <r o <i « n <t ilun « thoaotc <tu n <i . m m m 

u.onnio ituco^trnisrt m o a a m m o* o m r i in m m n mm |rs rv m co 

t-. rj ^ n u. m m a -- th <r a <x > cs r< m u lu <t a m < ck ci a uj n 'Oa •> c-j m in m <£ a <i m ml a n m a a a a ri m a r i O' a rv rv rv rv is 

m n n ri ck a a u o h n u n c o w u u h n o n u l u n u n o ri u a u m uj m m rr cj ^ ci c-i rj u h h w n u o u u o © o o t 

ooooooooooooooooooon'Oi>'UiiOMTN<tQOi , i'(iMiiaiuau.f'in'0!Miijora)N«Hiijrt<r<r<r?tfoi)'4-ij|ii.i'in^ii)'CN«itiuaortNnM'OMii)'« 
o o o o o o © o o o © o o o o o o o © © © o o o ^ ^ ^ ^ c-i c-i n ri c-i ri n ri ci m m m m m m >r *t si - ) tiT li - ) m n n u " iit li - ) l"! u") >o c >o >c >c -c >c -o -o -c rv rs ps iv rs ?s n rs 

0000 ©© 0000000 © 00000 © 000000 © 0 © 0000 ©© 000 © 0 © 0 © 00 ©© 00 ©© 00©©©0000 0 0 000 ©© 000 © 00000000 © 0©00 
©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©ooooooo©©©©©©©©©©©©©©©©©©©©©©©©© 1 ©©©©©©©©©©©©©©©©©©©©© 


Number 21 


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


Page 39 


49 


ut 


wCi 

<r 



<r <r - 
* t- c 

*x 

u. a i 


in <r 
UJ 

_i in 

a, X 
r u 

m 2 
in 3 
<r 2 


u u o 
c c o 

3 _l _l _l 

: c z in in 

: JOOQ 


£ 2EU 
cuujrori 
2 u I 2 . 


J <X t- <C u. 2 X £ L 


<1 12 3 UJ ~ h- UJ 

ct: o in 

3 3 (- O ~ ►— UJ 


C 2 in _l 13 u 


in O U Cl 

UJ -J 0 3 

_i m 2 _j 2 

- fc LL O 


. <r o _j 3 co th 


3 Cl U 3 C 
3 2 M 2 3 1 
2 IJ 3 CC 2 l 


-J_]-J_J_IX_l_i UJHXHU. J3<r i<lH L-( LH l-H 
IX3XI3 2<r^i2I3232T3i-2i=iCLNLLMu.NCLNCLN 
Jtn_injXJUT!-2HE-!j£0T)JU£C(J£CUfl'U£CUfll 


■ ***** i 


o — 

rx 'v 


CM 

rx 


rn 

rx 


•o md o- o -• n « <r p < md &• c h n n ? n ; -o n 
rsrvrv'^cccooococDCOooDoocoo-CN^n-Ch omO* o- 


o c o c 


oooooooooo 


ccooocooooocc 


cocso-*r4'r«rijT'OrscoO'C*^rjfn«?ii-5'C'vcoc>-o — C4fn«riiT'Crso3CKO-*rjm^-i,T'Orvooi>*o^cim«rm'Orvooi>o^rgM<- 

o-occocccocoo — -'- 1 '— •—. h « n n n r< n n n r-j ri fi w n n n w m m n to to v ^ <r «r <r v c t <r ’nn in in in n 

^ h n f; r; rj cm cm cm ri cm cm c. cm c« cm r; -< cm r. m cm cj cm cj (\ a c; ci cm r-j *. cm n cm ci cm cm cm cm m cm cm cm cm cm cm cm cm cm cm cm cm cm 
ooocooooooooooccccoococoooooooccoocooocoooooooocoocoooooo 


UJ -- UI fx CM UC’UJmUJ'CO* •0 0' 
CM O Cl U U CJ U CM U r. o cm IJ CM 

<ruj<i'0uj<EUj<iuj*3:Lj<ruj«ic 
Uli.UlHLUa.UL.UL 

CM If) fx C(JUJ-Mf*3'03i£ 

O O O O O O -H • 


*n <x|ci n n <t ci n k, c n n ci <i « 

-h'O O -H C — O CM CM CM CJ CM U 


ufl<ICU<II> 
N a U C N 4 u 


ooooc ocooo 


ON’TOO 
m «r m *r <r 


'OliKIflN- 
m >c rs «t o 


o o 
o o o 


o c 

«T O 


ULUHU — -HU -H->'0-H0-H0 — 0 CM rM CM CJ CM U NaUuNSU CM CM CM CM Cl UJ CJ U U Q Cl M Cl M U CM NO U H 

u c cm mj o- cx <i cc ui iij uj ui Lj ulc -h r< m«r m •c'xciiiuu ciin in in in *crNC*cjQuujujujLJUj w ■— Mrrx<rciLj»-MMrfxc3uo cm in oc^uu 

-* cm cm cm cm cm cm cm cm Cm cj cm cm cm CM.m momm .'■:mfnnm'nfo«r'<r*rHr«rc-*r«r'rT«T'<rHr<r«r«T*T<ri,TLTiiTL‘!u~i")'<5'C'0'0'C'orvfN.rvrvrsrsrv 

ooooooeooocooooooooooooooo'o oooocoocoooooocooocoococoooooooooooooooococoooco 


’H —H CM 

<rcj<rcM<r*«ii=i<rcj<:*on'<im<rujCMm<rujcoujauicouooujcD 

CM CJ CJ Cl CM UJ CJ U U Q CJ n n M U Cl Ml U rt u. U II U 1 l U It u u. u 
■cuiHTNcou.o cm b) m > u u. o cm win'COO'Oiuui 

i.i i^ .n i-. rv tv tv fvfvfvCDCcjDcaoOCDfflCDCOQO 

ooooooooooo 


Cl 2 
2 UJ 
O CC 
U uC 


12 3 

in > 


CC <E 
<r in 
X Wi 

u u 


O Cm 

iXi O 

2 2 3 
O >- 

•-mu 


- cc 3 

J U 3 

3 in c 


U 2 H LO »■ 

UI UJ h- UJ 3 

12 CC in >- 2 


2 I X 
► c <r 
« M O 


X _| 3 •- 3 •- »-« H|- 

2<IuUJQ3iU3LJ 

•-ucccxmoccincc 


x o 2 in 

• * M J U 

: x <r o a. >- 


->X3»-*N‘- 
> 2 3 U 2 UJ 
>2UTCC 


in u 

) UJ MX 

: >- cc 


> o i cn i o ' 

• U2 Q LL i2 
: O •- O >- fx <X 3 


CC Ml 
3 - 

: u 2 : 


C u. 3 ) 
J 2 O 3 
) “) 2 *■ 


2 0 XU 


in uj 

> J- 
<1 2 


‘XXC 
3 Ui UJ 3 
2 2 2 <X 


3 0>-23X2mT 


lh O 
U MX 
3 in 
o cn 

CC UJ 
2 

in 


Cl CD 

2 in 

3 _! 


in in 
in uj 
< r cc 


M UI 3 

i 2 2 


- O •— Cl Ui ll 

i _! 222 X X IXXX 3 fi 

> 2 •- 3 0 c c m cm a ci a i ro i x z x z : 

■ o l z a o c at-ahu.ZLZ'jHrjH. 

iaoLcauSoaoaoHONriucMLr 


a x x 
: 2 u o 

M "H 3 U 

) u c c 


H JH JIJ J < 

XXXXUIMTNUC 

jkjjxjuti. 


<x * * * a c 

unsjrscoo'O-* cm mMTui^rv 
to O IS CO CO O- CJ> O' »■ CK tMJ- > 
ooooooooooooo 
ooooooooooooo 




* * * * 2 


2*»****u 


ooooooooooooo 


- CM N <f n M3 

o o o o o o 


O' o 
-H CM 

o o 


oooooooooiooooooocoooooooooooooooooooocooooocooooo 


a u. c a u 


nSOS>USjUiCD'Oi> 

n cj co cj r — • — - 

co CJ u. o - 
rv tv ix m 
o o o o 
o o o o 


3 3 0 3 3 
o o o o o 
ocooo 


a- <i <i i <1 a u. 

3 3 3 3 3 3 3 

c o o o o o o 

o o o c o o o 


n iv x x r. 0 u l -m rj ^ m> c m ui it h n ri n ri ri M 1 n <0 ms > u u u u u u u u L ri t* x 0- u k n ii) co a w o f i \ c u l. -i •? mi &• a . : d 
i^irt«iiii?!^i^SJSJ <:<I,I<I *' SfifiiIlSi ®l JS * i '' IiIi ** ilii:il5ifiiSiS * u uuuuuaaaaDaLLLLiJLLLUULLuo 

ooooooooovjtoooooov^ooooooooooooloooooooooooooooocoooooooooooooooooooooo-* 
^mxoOvmOO^OCOOOOOOCOOOOOOOOO. oooooooooooooooooooooooooooocooooooooooo 


ooooooooooocoo 


Page 40 


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


Number 21 


50 


I 


£ 03 L- 3 

5 z a e cr 


t it cj *- c cj 

cn z x o c ujc _i o 

UIGSOIiC _J If! y_I GuJl 

2 C Q • U O it 2 * V li. 03 ac U. ® 

i ifl rj j « o *r uj cct-oN'ixa^ 


JO t-i _i i- O UJO 

- _l UJt-Ul_ifVil_iI 

- u. uiixouz ► >- x co 

•ONcxiiar ct-GM 


H- O 03 CJ i X 
*-* _/ 1-* O UJi O 

ut-»-c3_j<rx i _ix 

03 03 3 Ld Z * >- X O 
Cuiiii:r<n-on 


r -i q t a co-5 O'O lu ox o 

«r z cm <r z n «r z ct • t-^u. _j z — _i 

X - 2 X - it X — lit £t - Z) - >- Z -< 3 Z 

0_JXi<r^_liXi<Xr-J_JiZi<XMuJCCiCLCt- X _i X CC 


(3 Ci _J 

■4fsiXx*-4«X<E— _;<i<x 

. z . i5-czc^a 


_i Ou 

22QzoiirNizozl2-iG^czc^azc3<iChruiGhazc-rjiG^a2««««Hiu 
■5wj«j:wUTjii:«u~x!,*i:u3J<icu3_!<rcccciruo3"iXir!£03j«ju)")xu5r(flj<icc£i:ij'uonx 


LLX_i*-<<r«rM 1 i:ci:ii:_i < iu.x_jt-icl<i*-»Ci:Li:ccct:t-<rsi^a.^^LHu. f -.fsiL-. 

XCJX©--i= l Z<X<I<I<XL-£CJX©i-|i=.Z<I<X<X<X2Z:>rXZ:>:exZ© 

•Gxinitflj^ccccii'utmxinrwJCiciiLCu-iETUTtTUTc 


o a _i c. 

Z©CE2Z©:E©t-CJI<IOZ 

■’riu'tiEtnxtnuuJj 


i>o- r in<rtis3Mj3 

~3<r<T«-<r»rM*r<r«r 

oooccococ© 


O' © — r-4 M V 111 -0 

<r in in it in in in 
oocooooo 


N X O O -1 CM r*3 
Ifl in 3 -O C >0 <1 

© © © © © © © 


<riiT'Orscooo»Hr-4ro^-in'OPscoi>>o»Hr-4M<T5T'orsooO'0’-tr-jr»3 l ^iiT'0( s 'CDO' 

■O'O'O'O-c-crvr'-r^h.rsr^rvrvNrNmaocDCOomcDcocoooO'O'O'ChO'O'O-O'O'O- 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOjOOOOOO 


o r i m <r 

o o o c o 

*r <r t <r <r 

o o o o o 


lil'ONCDO'O- 
O O O O O ^ ' 
<r *r <r <r -r <r < 

o o © © o o < 


HI MI O h « 

, H h h h rj fj rj 

• m <r «r m <r *r <r 

> © © o o o © © 


:'C3-«iL'.^li3N‘ 
'•'’^"ITn-TTTT - 

i c* ci ri ci r, r, ci ci r-i : 
5©oo©o©o©o< 


i ui m i3 i*3 n » n r-i m n in r-i m *t ao r-i u m in <r ro 1 *?• © o<jCMn^-o<rr3n 

) i *3 uj <ro«r<r©'C* , Lj <r o c m orouj <r o <r ro ©*<ruoo^-uj© 

i r-i ro CD n uj r-J « o o n n is rj uj rj <r >o u. u. u. q cvi w * n uj rj| <r *o u. u. ti. u. uj rj -o ro uj n «o ro uj 

jnuurmni , 3uonuiijrif3M' , )iijHHHur3uiijnMri"iu)HHri-Mtuouu.uouii. 

3ChuiL©MUTCDiii©on'ON<uu.r-i<ri;‘)'ors«Qo*-i*T'olo‘UUJiLO*-«r4^-NO'UUJ»Hfn'0 
3-o<3'Orsf^!\rsrvrxQococoa3a:cDOOO->i>o-i>chO<t«i<i<t|©©©©iXiJCia5iiiiiiiiiaiaiuuu 
i cm n ci ci cm cm r i r-i r-i r-4 cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm r-i n| ri r-i r-i rj cm r-i r-i cm r-i cm r-4 r-i r-. r-4 r-i 
>0©00©000©00©000©0000000©00 0©0©000©000©©0©0 


CO 05 1=1 © r-4 

CJ U CJ © Zi 

r-4 r-4 r-4 r-4 r-4 

o © o © © 


IfiNIUu-OC 
mmSCuLII 
cm r-i r-i ri r-i r-i c 
© © o © o o < 


oficz <r iJ <r Ci 


r -4 x 
r-i cj 

: <c u h- 

- - i=l <L 

i 1 X 1 ill © <i r ; 


X X iS | 2 X © h 

: o © x <x x I w x o -xfM<rx c 
I o - U •• L. | X © O - X » Ld 
>x.=.coaizxx-ixi=i<r©*zxc 


hX4N'-G£lNGGI 

iZuZILOtZGt. 

UHjimtMitrGij 


J4CHU1 JOG Jii C © X <X © _i XX — €^«©«X-< XX_i-iX~iX>-i-X<E2<I-<NI©.-*2©-4_lX -NXOHOJii.1 -«NX©~.©_iX — 

ix‘-xoioo<iONii=iOzc5o<t'Mzr©'-xQocizxN£z<c©z©z©f-L-cx4Xzox£ox©i:'Nxzzazc-a:z , NixzzozccxNix 

jx(fljiJ££unj£Hj£unrt-)rcn_ij£j-«uTCJ*3UE^£ME03a3'3jj''Sj"5i:j-juTUTHtC£uunu'’~c<rrcuTU 


.1 J£ - JEUT- 


I|3 -O N CD O- O H, ri T L3 -0 N 03 O O H r-4 f3 «r ll3 -0 MD > O -* r-i M IT L3 -0 MU O- O w C-i « «C ||3 -O N CD 0- O H r-4 f*5 <r u3 -C N CD > O H fi M ^ L3 -O N 33 > O H n n -C i,' -o n'cO 0- O H ri n «T L3 -0 MO 
^^!P^!0^^^^^^' c ' c ' 0 ' crxrsr ' rsrs,s - fvrs ' rs ' ,v ® c:0aDC0CC,CD::i:>CCC0a:,>!:> ' 0 ' Ch0 ' i> ' i>0,i:> ' >!::>::>ooo o©o©o-'^-’-i-''-i^--«-H-iririr4ririrjri ni ri .Mf^mrimmrom^M 
n r-4 r-j r-4 r-4 r-i cm a r-4 r-i r-i r-i ri r-i ri ri ri rj r-i r-i r-i r-i r-i r-i r-i ri r-i cm r-4 r-i r-i r-4 r-i r-i r-4 m r-i r-i n m n n n rj n r,« m co n tro n w n m m « ro « «3 n ^ ro -i n « ^ w « r, m n m ro n 

0©©000^©0000000©0000©©©©0©©0©©0©0©000©0©©0©©©0©00©0©©00©©0©0©©0©©0©0©0©0 0©©©0 0 0000©© 


i ui ii. O H « fl N c a L. O ri "1 u3 I * J h « -c N C u Li H ^ 1,1 CD <1 a y L H f-i nj-0 > 
)uuaacii5aac;05jiiJui5i'LUaii,iiLiLiLii.ii.iLOOooooooHHH l H-. 
| H H H H H H H rt rl W r. H « W H H H rt rt H rt rl C4 r-J ri n r-1 M M T-i C'l Ci f'i C-J r-| 
>00©0©©00©000000000000000 0 000©0©©00 0'00 


flQ^n J .©rirn>OiM <x 
h h ri :< r-i ci r -4 r -4 
r-i r- ( r -4 cm cm r i ri r-i r-i 
©o©©©©©©© 


Number 21 


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


Page 41 


51 


u 


Ui ! 


© cj z x cj 


u ' o U ' 

Z CJ £L Cl Cl 

> ' ' O ' ' ' < 


' u <r 

*- g ► 

o z x cn z x 


Cl CJ » C X 
JO' JL. 


► -I <1 _J CJ 3 


Z X z 

Z N Z 

c u a 

cj o o cj a 


05 CJ M 

CO >- 

: x a. j i a 


Z 05 a cj 

•> CD - * 

x <x <r g Ly 


x<ecx.j*iggcjqxxxxxxxxxxxxxx a. 


*-* x «x o x 


: <i ►- 

J N k- 3 
5 -! 05 Z 


«*-•*-* 
uZif 
_ <X CJ - 


x r> 3 :> x 
< z o *i o a z 
; *-* z u z z ^ 


^ -i x - coo 

3 _i u_ <X X il)Ju.5X5X5X5XMXHXHXXJX«5 
0<rCGCJN>3<I00ZC5Z0Z0Z3Z3Z3Z(JX;jG0 
ruu.-u^CL-ja.t-.z-SMZ-iHZ-Z'-x^yjzi 


© 0 - < 
o o * 
in in u 
o o < 


• in «0 fv 05 O' o 

, H H H W H n 

) in in in in in in 

>000000 


— n m <r in, 
CM CM CM CM CM| 
in in in m 1 


• 0 r'*© 0 ' 0 -* Tim*? in - 0 r'-© 0 'O-< CM fO*- m ' 0 f^© 0 'O-H CM f* 5 *rtj‘ 5 'OfN© 0 '©-t nm 

n n n n m w ^ m « n n m « « <r wt <r <r <r *r ^ <r ii 5 mi ijt ii 5 u 5 n in n iti -c < -c 

in in in ii -5 iii in li "5 iii in in in in m in in in in in in in in in in in in in in in in in in in in in in in in in 

00000000000000000000000000000000000000 


V n MD O- O - n « «r „5 -o N CC O' O H r -i M ^ 111 -0 N 05 O' O rt 1 

'O'C'C'O'O'CrvrNrNfs.r^isrvrNr^rvcccrcccxcDcccocDttcso'i 

in m ii; in in in in in in in in in in in in in in in in in in in in in in in in ml 

OOOOOOOOOOOOOOOOOOOOOOOOOOO Oi 


Ul«OUIMOOOOolaO'OI‘)<tM 1 
*? in o *? *r o in in in o t *r o m ci m r-j 


<Iw<Cri' 0 C'CliJ €-0 

nnunnmuiiU" 


CO<IDliJli.CUKICI^li5-OlDI>CUllJlL^OHfJ<ni5(D&'<I<I<I<I€QlijH<r-00,iSQOn^M>«UuljHVnOJ5' 

NNNNNQ)0DC0CDCDC0a3C0C0CD(Dt0a)|CM>CM>-a'0>lM5'0'(MMM>>!)'«<r<I«X<I<IlCiaOi£ianIiiCiiIifflUUUUU 

mmmmmmmmmmmmmmmmmmimmmmmmmmmmmmmmmmmmmmmmmmmnmmmmmmmm 

0000000000000000000000000000000000000000000000000000 


u-c-OM-OMij5<i<iQ<rnujQoo'MiijQHca«inQrsofOHnriMM"’'Cn>oi 
u. cj m rj m r -4 uj n m m cj m rx cj m m rj ix u uj m m u g cj g n r i rs r-j rs r-j h. cm m rj m i 

rjn , rm < or^© 0 'au 

.' UJ UJ UJ UJ 

m m m m 


<r-oo-iiiGoC'i«rr''.(>'<icjGu*-««rinco0'<xGuju.c*-><TincDO'UQO»H > ,,, , u , v ,. wv . 

CCCCCOnliffiilifliaiitiiSaiUUunnuUUUCiaCuCluwCiUl'aJliJIiJUluuluJUUIUJlil 


000000000 000000000000000 


ui u. *-• r-j m *o rx <r| 

luLuU.LU.u.u.ti .1 

mmmmmmmm 

ooooocoo* 


Lu Uj 
G 3 

z <1 
c cn 


►h as 
CD LLi<I 
O X _i 

Cl. H- _ 

*- >- aJ C 

0022 ) 


J 

a 


U O it 

3 <1 X 

-J _l CJ 

Sl. u. o z c 


jXGGGOUJZGZZ> 


_oic: 


r - - CXXXX _i < 

: ' cj x * g j n pi c ^ 3 o a - h- <z t- 

' * _ cc - - cccuusuou: • cd ► x 

.ZXXCDXXCJXZXXCJOOCGOGCGXXGXZCJC 


; _j g z 1 a g 


x 3 <r x 
Z O h- z 
- Z CD — 


X <X -< t 

CJ X G u. N : 

x _i _j u “5 £ 


TT n -O p ' X J- O - r 
ri CM rj .-.4 (M r-i r. m m r 

*r*T<r«r*r*T*r*r*r* 

oooooooooc 


r i /5 >o n m > o - r, 

; 15 15 M l', « <T <T «T 

r*r*r*r»r*r*r*T«r 

500000 0 00 


r *5 ^ in -c 

*T <r T *T 

*? *r «r «r 

OOOO 


laZulZOlT, UNUNONUN 
CD G 

Cl II II 

O 

G - M 

z 

u * # 

(S 05 


'X<rz>xv--x<ioxu. 


r 3 X u. <X ti 


x <r o x u. ► 


w'NCJNJ_;Z3ZGOZ3ZGOZX3ZOZXGZllN,XNJu_ k '3ZG!32Z 

fi-)0-5fl-ZHJZHZHJZHTrHtHTj«u-;0TUntHjZHD 


^ w iC^iC££iCXXN^JXXC 

G2<I«X<E2CJ2ZZi=i02Z»=i 

J-IirCCiCHQHW-JJtHHJ 


O' O " 

<r m ii 
*r *r * 

O O < 


m w <r in o 

1 in m m in 

r *r *r *r *r 

5 0 0 0 0 


- x cJo 

m mi >c 

r < 3 - *r|«r 

>o 6|0 


>*■ *-> CJ 

cc Ct a 

"1 r i ^ ^ l *' ) *0 ^ 23 *>• ° ^ r J m m *o rx co O' o 1+ nm <r m -c n ® o» o ** c-i m in •« rs © 
O-C-C^'O'O'C'C-OrvixrN-'.rvrvrs.NNNcOcCCDCCCCCOCCCOCOCO'O'O'O'O-O'O-O'O' 

ooooooooocoooooooooooooooooooooooooooo 


0- O H M n T !/5 -O N 

o>oooooooo 
in in in in in m in in 
000000000 


in in in m 

o 000 


ro "5 in 

o 00 


■**5 n) m. o 

o o o] UJ 


m 

o 


in 

o 


o 


nil ro rn n 

00 00c 


in m m in 

o 000 


U. N *4 O M- O' O 

"5 5 1500 © O 

■5 U r-j r*) X C C UJ <1 1/5 ii' iC fi 15 h h <! uj 

ci N r-J uj r-i k) a. cj u a n u m g cj - u. 

9-«au/ii.on<i(oiauaui«Nnvy5 
^iUjLijuijjU.U.U.U.^.LLU.U.00000 
r-j n r j n n n, r-j r j rj n rj n *i n 15 m 15 
000000000000000000 


o <r x) <r cj r j 

*- O *r O' «r o- 

■IN^ I5M c G <T G <1 G <1 G 

U N h fl U 15 >5UI5U«UI5 

NdBuwonn^m^ffNxacJu 

OOCOOr-^^-i-H--.^,-,-,-/-,^ 

OOOOOOOOOCOOOOOOOO 


<ri 00 

-o rj 


U CJ <X O « T N M H ^ 

CM <T O' Ci O'C’CJU'CCJ 


oI 

2 l 


15 5 M>> CG 
r j r j a c-t a a 

151515 15 15 15 
OOOOOO 


f*5 O >*5 
r-j m -■i 

Uj Ll —< 
rj rj m 
D 15 15 
OOO 


<E 


r-j 

m 

o 


Nf5 15 -C >5 O »5 15 <1 •O ib C ill 

n r-j cj w r-j n r-j u m ui 'i u u. 

m -o r' « cj g m u. ri ud ix O' cj 

M 5 Dnrofor* 5 f < 5 *n«r T<r*r«r 
>5l5'5f5l5t5l5 , 5r5'5f5'5« 
OOOOOOOOOOOOO 


— 1 o o uj <ro<r 

'CU'Or-j w O'©*? 

<iui<r'C?n<rN!om-^<x 

U u. U »1 fl “1 N M U -■ t*> 
UI--M'0©O'CJQUJ*-i^- 

*r m m in in in in in in c 'O 

' 5 t 5 f 5 5 l 5 ' 5 r 5 r 5 f 5 r 5'5 

ccoocoooooo 


m 

o 

© G 

fD -C 

^U.LU.Uai5l5ri4M5l5« 

N!><r«UGUJU.Or55li5'ON 
'C'O'C-O'O'C'C'Oixrxfxfxrsrx 
>5 5i5!5,5 p 5MI5l5l5f5l5'5l5 
COOOOOOOOOOCOO 


Page 42 


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


Number 21 


52 



I « 


) * u ui in 

5 - - - X 

: z x z <r <x x 


CQ u 

z i z x z : 


< X I _J X Z> _i 
• X !_• I'JC <1 

: x _i x r cj 


x :> o _j x : 
o x x o <r 2 c 
r »-• x r cj m ; 


ia.XLUXau<EC(L 


ja<xuooasct; 


< X t-H i- 
> 2 O LlJ 

: t-t z cc 


i Z> Li- U U. > U. _i Z> Li 

IQINZCCEN-ICIN 1 
jiun'tu-njr.: — 


n cd D- c w r-j m <: ii - ) <o n co o- o h (".j [<: -r iii >c n ® > o h r; ^ 'C n w i> o w ri n *r n >c >. co ^ o h r-j m 1 

fXIXfXCOXXXXXXXXXCXCxO'CxOCXCXCXCXi>OCCO©OOOCO~^—C-i “iri r-il 

••C'O'O'O'C'O'C'C'C'C'O'C'O'OJi'C'G'O'C-C'C'vorxrxrxrxrxfxrvrxixrvfxtxtxrxrxfxrxfxrxrxfs.fxfxrxl 

00000000000000000000000000000000 ©0000000000000o. 


- X X X X X 


CJ J> U U I- U X ^ X - 

ZGJTN'JSliJCU^ZU; 
Tr UTiiOCxOrHCc 


UaXAUL 


i U A X I 


■ X X _l 

s <x o u : 


J X I 

• ► c 

. X <X r-i 


M_iXG>Ou.OOXX: 

ox'j 00x0022: 

XJOXX-xxr-tMs 


<r ii* -o mb o o h rj fo t iii >o n co o> o r. : f n >c ■ ■ co i> o h to » n >c n cd O' 0 

rj r. a c-i a ci 

rx rs. ^ x. ix ix rx *x tx rv rx rs. x.. fv rx rx tx •, rx x. ix rs. <x rx r-> nnxxnnnnnnnn 
OOCOOOOOOOOOOOOOOO OOOOO OO OOOOOOO OOOOO 


in <r <r 

00 0 


in 

o 


LG *T 

o o 


in 

o 


LI 

O 


u © m to 

<3- *T <3 f 


X O 

<3- r-i 


c 


o Ci o ci 


ox o 

cm u_ 


-1 m 
o ^ 


o 

r-i 


-0W»-Iffl<IOO«’-ii£iw«O!CiHM5-C'0'C0> 

M r-4 LU r-i Ui rx r_j |X r -4 fx fx CJ r-4 N C-i !X a n r-i m 0 


uj ci ci in r-4 n r j n s u a u n a u o c: x 


<r •■. w5<IC-J.-A'0tM). 
Cj'iZi !X (Si CJ O UI CJ UJ Ci n Cl CJ 


<r Si <r =i m 

r-i a <r <r rj 


amt*)M'Oujuc»iiJUJXfnujiij 
<r o ci c-i - rx u. u ^ Xu. u rj r-.. u 


tM> o- »■ 1 u a o h f J ti -c n a 
rp 111 cf i pi m rn rfi 3 s ^ 3 * O' ^ O' O' 

<T<T'T'?'?<T<?<? r T<T*t<TT'r 

OOOOOOOOOOOOOO 


O' CJ a Ui LL 

Os O O' O O’ 

•3- <t <r <r -? 

OOOOO 


o 1 n t '• 
<XC<E<X<T<I 

<T<r*?<T<r<r 

000000 


rx ?v rx cc a, cj a; 
<X<I<E<I<X<X<X 
<r <r <r «r <r <? <r 
OOOOOOO 


ui u r -i to 

X C A A 
T <f <r <T 

0000 


<r \ a ui u. r-; cn x o- 

A A A A A A U U J U 

<T*T<TT<T<T<r^- r TT 

OOOOOO OOOO 


o 

<r 

o 


-< r-i in x o- <x a cj u 
a amAuaaaa 
*t <r<T<r<r<T*T<T<r 
OOOOOOOOO 


U O O 

a uj ui 
«r «r <r 

000 


o o r-4 in <o 

Ui Ui UJ LU Ui 

<r <r <r «r <r 

OOOOO 


rx x uj cj a ui 

Ui UJ lu Ui UJ UJ 

t *? <f <r <r *r 

OOOOOO 


UO X O'- <x 

U U u. u 

<T <r T <3 

OOOO 


U U C <H 

uuoo 
<3 *r ui in 
OOOO 



XM<EXMX^<Xhh; 

uzacjzugzg; 

wlJOTuEHXt 


• E> X X 1 -t _J u. I-. 5 
. UOXOXCC©: 
)~XTu.JCJ£lX‘ i 


: tx h x _i i _i x c 

: z x> 2 x cj x cj : 

i IE H 0 X 01 X ' 


>GHi£CC UliHH H > I- li H CC X U- <1 H- 

] 0 ZAA-I<IullUQ 01 iJZXUNZE |0 1 iJ 
[ECitltAiE^Ln^EAHjQlwIJA 


j HH x •-< *-< 

: o 2 o o 

j x >-< r x 


AXNH) 

UZZGi 
O *-« ~5 X ► 


r-j ?<i <r lp fx a? O' c <h rj rn <r ut -c rx x cs o cj ro <r ut -o rs x o- o •" ri r<i <r lt <c !x x 0- c r-4 ro <r ii"5 >o rx 00 os o <-< r-i tn <r ut >o fx 00 cx o <h rj n <r ut <o rx, x ex o -m r-4 tn <r LG <0 rx x cx o th ri tn <r ij - ) >o 
o. £»• a- O' o- o »■ o- o o o o o c o o o o h w h w h h 1 - h ts r-i m r-j ri ri r-i r-i r-j r-i r-i n tn m n pi n m « « « <r <r <r <r <r <r <r c <r <ni mi lii lii lii lii n n i3 >o <1 -o <1 -o >o >o >o -o <0 n n n n x x n 

illu'L'li*li3LTIill''C'0'<3'0'0'0'0'C'0'0'C'0'C'0-0'0'0'C-'0'-C'0'C!'C'C'0'Os3'0'0'C'0'0'0'0'0'0'0'0'0 - C'i3'0'0'0'0'0'0'0'0'0'0'<J'0'<J'0'0'0'0'0'0'0'<l'0'0'0'0'0’C'0'0'0'0'0'0'0’0'0 

000000000000000000000000000000 00000000000000000000000000000000000 o| 0000000000000000000 


«T lii 

o o 


<r <3 <3 <3- ui © 

O OOOOO 


in 

o 


in 

o 


in 

o 


sQ M >0 UJ O O 

-* *r r-i c-i r-i r-i 


O' iil U COQ 

Ui r-i rx r J r-i r-i 


•o a fx 0 <x 

-< o n- «r w 


u. o <1 u. rx o 

o m m <r o u. 


o <1 o rx 

nn-oo 


O UJ >o| 

y-t SO *0 


rx o <r o 

r-i o m 


x o o rx 

rx r-i r-i -<r 


a r-i <i q r-i is >o m sc m sd m c uj 
m o to m cj r-i tn r -4 w a to r-i —* u 


c <r uj r-i uj <1 n « ui 

UwU AUQNUA 


-c « « IT r-i -o n r i su r-i a tn 
^ r-i r< o u n r-i Ci uj r-i u cj 


rx'O'OUi-C'OuX'O 

3UiUUAU<rMii 


U' 0 UJC' 0 rx 0 'Cj-<<Q<ifntn'<r 0 ' 

HuuauvuMrtnuHUHU 


<I'C!<1Ui'0QMr-i'0M'0!<5('J0' 
N M N N !1 !<! W U M C i m r-i r-i u 


U CJ 


n m 
o o 


Ur-4M'CM><XuAUOr<K)'ONO'Ulii-irii1'C»'UAUO 

l o o o o o o o o o « h h w h h rt rt r-i r-i r-i r-i r-i r-i r-i r-i tn 
tn<T<r<r<r<r<T<T*3-<T<T«T<r*3-*3-*T<T<T*T*T<T<T<r<T<TX-<T 
000000000000000000000000000 


^ r-i iil N A A U U 
mfofnmrommm 
*TT*r<3-<r«r<T*T 
OOOOOOOC 


OWflMM-r-OACA 

<T-<r<r<T<f<T'<r<r<T<T 

'T'T<r<T<r»?-<r<r<r<j- 

0000000000 


u o »-< 
«t ut in 

<t <r <r 
OOO 


m «r iii so rx 

\n ui m ui in 

<r <r <r <r <r 

OOOOO 


CX 1 X 1 
lil UI 
«r <r 
o o 


uj o rt r-i 
Ul sO so so 


OOOO 


tn rx 


OOO 


<x cq'u 

<o <OI<C 

<r <r|<r 
o 00 


u o o o o 

>o rx rx rx tx 

<r <r <r <r <r 

OOOOO 


m ui -c x <e ixt cj u ^ rj <r 
txrxfxrxrxrxixrxcoxx 
<r<T<T<r<r<r<r<r<r3<r 
00000000000 


n x 
x x 

< 3 - < 3 - 

O O 


Number 21 


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


Page 43 


53 




i X >— X X 

. 'I 05 <t 3 

o r*5 w • o n ro ' ' 


o o r-j • oopi' 


wuuuuuuuuuauuuu 

o; xaa;o5»iasc^a4ii.ac.o5sajio‘*ia^aai»oTi2i 1 5i5xai*ii 1 c^iXi*f/)ii l aia4y5iaJ5ai05iii 1 iiiXi05iaiiiiii05iricaiiio:fliiBi3icni3iCQ 

*-• CwC<ruuw«uuC<iflwu<iHuw<iciaw<:aau'iflaM«Mua<rflflQCQuu<:i3Cia«aaa<iQOfi<iaafl«pM 

01 


iMIIiDXXl 

u<rQ3u<Iuu 


o T-t r-i ro u" < ‘v cc cp o — rj pn t n >c P' a: s> o -- rj n <r ut >o n cd 0 * o «h rj n *r iii >o rv oo i> o ^ rj r*i *r ut -o rs 03 a- o -h r-j r*i «r ut >o rx a) i> o ^ r-j to ^ bo, >o n 03 £► o rj m 

Pi PJ P< PJ Pi j Ti rj Ti Pi f*l « M M M ro rj « fO -T ? <r C T C C «T <T ill ul lil tl lil tl ill 1,1 111 L5 -0 -0 -O <1 -0 >0 -O -0 -0 <1 N N N N N N N N N MB CO CD CD CO col CO CD C0 CD 5- 0> O O 
CCCOCDCDCDCDCOCCCGCDCCCDCCCCCOCSCOCDCCiCDCDCDCOCOCOCOCCCOCOCOCDCDCCCOCDCOCOCOCOCOCOCDCOCOCOCOCOCOCDCDGDCDCOCDCOCOCOCOCOCDCOCOCDCDOOCOCOCOCOCOCOCCCDCC 

ooooooooooooooooooooooooooooooooocooooooooooooooooooooooooooooooooioooooooo 


I 


i - o uj fj h o -o n n o uj Pi o n h <r o -o h o uj Pi oo o -o ^ u. o Ijj pj n o n h n o il 1 -* pj o n h pi o i 
i®uc<rouo<rcaouiOi=iOuiocio«TOujc<rououi030*-030<ro©ouiooouio-<©Lio« 


oh.*, rO'0f''C00-uciLju.cNn<rL')C00'<i.xiujL.o^^in'0N«aiijCiO^rjn-or^cD0'Cj!: 


"jCMJ-aO'Ciuii.CHfn'i'flMcuuUu.'O'rbi'O'iaui: _ _ _ _ _ ___ 

,.u,UiiiUUiiiiiiJ^LiLii.LtHtLu.itiLiiOoooooooHHWH h - h w ^ h « pj n rli pkj r-i n rj cm pj w n n fi w h n w n m v ^ <t v Vi «r ^ t «r <t in' Li 

.1 Ul Ll Ul ul U* Ul i.! Ul Ul Ul Ul Ul l! Ul Ul Ll U1 HI Ul -<3 >C 'O 'O S3 O O ~0 -0 -O O -O C 'C ~C 'O S3 S3 S3 S3 -O S3 S3 S3 >0 O -O S3 S3 S) S) S3 -O 'O >0 *0 S) S3 S3 S) <3 -<3 >0 >0 S3 'O' S3 *0 S3 -<3 ss s> -o sj 

gooooooooooooooooooocooooooooooocooooocooooooocooooooooooooocooooooococooo 


3 U. UJ < 

« u. ic c 
<ICuC 
J * i . 


uj <r u_ 
C O “3 


CO (J 01 c 
Z O Ui 
H JO- 


- iZ 3 

3 3 a. UJ 05 01 

3 O >- I O O 

. 03 I— LL U_ 


i 3 01 III 01 

cl cc a h- 

C ll CJ 

2 CCilCuJ 
it lC G “1 

3 LU 3 a 

p- 3 2 0 
UJ CC 2 »-< 
liO" 2 U. 

3 2 2 O 
CD 2 M 
touHisa 

_ X CD 3 2 

ICuiSU 

05 iXi 




X X I, I X 
iXXXXXwl'OOO 
JCDOmOCDUCiQIUJU. 
• h n PI M M o o o' c o 


-CQ3U.U.U. ► 
© 03 3 3 3 5 

_ - UJ _J 3 3 3 l 

o o o' o o o o pi -i r; Pi o o o o o c o n o c cc a a c ■ 


U-iL£XiLiCG«u.<IilNa:u. 

2322X2CKrxr22X 

itHHiHtinixLnHT 


-h c-i m -r u3 -o p. co O' o cj ro <r ui -c rs. co 
'O-O'O'C'O'O'C'O'Orsrvr'rsrprvrsixrp 
i\rprNrsrvrprprvr^r^Psrprvrsiv»Nrprp 
oooooooooooooooooo 


3 3 3 3 3 « U 
lMfiS3CCaiiS3u;GaG32uC5 
luuwuuCLJUjuiUjJ 


G JIl J 
cu-u.cn 
3 3 3 2 
Ll_ iXi CQ •_ 


o u c 
3 O C 
* 3 . 
<1 K C 


a 


u 


. 05 I- 


i a: o _j 

5 U 3 O 3 U *- 

J003X20C.C01 
:33iC3 - Z32 
i Cl <1 UJ * Cl Ui G h 


0-OrtPJM<TlilX3NCD|0-0'-iriMVIil'OPGI)>OHriNl«yl'ON(I!!>0- 
NCDCDCDCDCDCDCDCDCDlCOCPCPCPCPCPO'O'O'CPO-OOOOOOOOOO'^-' 
!^^!^ rsrv|vrs - rs,SNrvr ' r ^ rvrNr ^ ,s ' N, ^ , ^ r ' sCDCOC3COC 3® | 23®rocDCDx 
000000000 0|00000©0000©0©0000000000 


«r -r *r *r •? -r in <r 


• til r-i <r «r r-i 


rO S3 CO CP <1 Ci 3 

o o o o o o o 
ui ui li ui ui m in 
© o o o o o o 


U.On<rii 5 ffi(PUUt 

in Hi n ui ui ui in ui ui u 

OOGOOOOOOC 


*?■ ui -0 rs 
cm cj cj cm 
iii iii ui in 
o o o o 


cd o co a cp ai 3 
pj m n cj a a u 

CD CP <1 l& CJ m 3 

r-j r-i r-j cj cj c-ji cj 
L l Ul Ul 111 111 111! LI 
0 0 0 0 0 0,0 


' Ul IN 
Ll % 


30—iCJ«r-XU33OCJr0«TUlfSCP0-0'0'0'D'<I 
cil*linni*)i-iin! , lin^<r-rT<T<rt'r<fT'rT<r 
in ui in ui ui ui ui ui ui ui ui ui ui ui in ui in ui ui in ui ui 
OOOOOOOOOOOOOOOOOOOOOO 


O > Ul L 
*3 I* 1 . T < 

O S3 D PI L 


rs rv 
Ul Ul 
o o 


Page 44 


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


Number 21 


54 





oxcni'i- x x x x m- it it i ^ ci u oa cx<rx<ri<xiCL o 

<r in x -• o i <r ci o - rx cn u z :> x x a x a x x x a o z a a: o z co z x c x 

XCiOi.UCLOCJOOItJCtUCC Ci »-i ZCOC<tCO«OCna)CO'C<I«XiIiO «CJOXCO 

O- r-i • OO-H O © ->-< ■ OHOOfl' COW' O O ' OOT-t' OfiHx O «T *-« ' O -O' CM ' O W c GD rt O O " ' OCS-^' C O- H • C © ' O O ' © © ^ o O — © CM -< • © “i 


CJ Li U O U O O O O I U L> CJ CJ CJ CJ U U U U 

Xfiiri£CCCnSAfi01CfiCC£^CSAlOCASU)fiiSAO^AASCf>CACCOCA|CUjA£CiSC^i3A>>iUiiiCiiXii£U)i9AiIi(niSAXO'!iXiAi£'RCiZiACOfii4i!£En3ACu;CaCi) 

Qu<raco<iciMM<iuCiuQui<iwaM<iuuo<:wwu<ioau<iiaQM<iua|w<iaciaaa<iuQCi<rui3u<iQuw<iQca<iawM<iQCiw<rjOuCQCQ<TaQ 


o- c h rj n c n -o ms > 

NCOCOCCCOCOCOCCCCCDCO 
D > ^ Q* O' O' O' O' ^ O' 
OCOOCOOOCCO 


o cm w ^ ld -c rx co o- o »-* ci w v in -o ix cd o- o cm w in -o rx. as o- o *-< r-i w *r in -c rx co o- o «-i r-i w <r in -o rx co o- o th c-i w «r in -o rx co o- © --i ci w -r in -o rx co o- 
o,j. O' o- O' o o i> o- o> o o o o o o o o o o h w h h h - h hIh h n m m ci n n r-i r-i m r-i « « m m "I n w k ■o m <r <r <r <r <r <r <r t <r t n iii fi n n n fi n nn 
O-O'O'O'O'O'O'O'O'O'OOOOCOOOOOOOOOCOOOOOCCOOOOOOCOCCCCOCCCOOCOOOOOCCOOOOOOOOOOOO 


iucujriW’ri 1 'icDi><riiiuciUJij.o^riw<ruT'OfxcoO'UCiUjij.r-iw«ruTCDO' , <:aiUjLi.CT-iriro'CixcDO'UCiLiJU.rjW'«»-iiDXO'*xiiiLiJLLO'-i«riiD'0'x<x*ucio--' 
iCCQUJUiUJuJUjUjUJuJUJUJUuu.u.L.u.Li.L.u.Li.u.u.u.L.u.u.oooooo|OCOO-4rH-t T H-4r-i.^TH^^^-Hr'irjc-4ricir'iriC'iciC'iwwwwwwwww,'nT'r 
)'0'0'0'C'0'0'0'0'0'0'0'0'G'0'0'0'0'0'e'C'0'0'0'0'0'0'0'0'OrxNNNXNlXNNNNrxi'''r'.rxKXIxr'.!'', rxNNlNf'f'. r''Nrxr''NXN|XN N!''.!''.f''Nr'.r'N f'. 
^OCOOOCOOOCOCOCOOOOOOOOOOOCOOOOOOOOOOOCOOOOOOOOOOOOOOOOOCOOOOOOOOOOOOOOOOO 


Ci W -OfXCi 

«r <y *r <r 

NN x fX LLl 
O O O O it 


5 Ci ^ - C W » 


COW' o c - 


O O CM ' C O CM ' 


i a a ci a c a x c a C ji i 


CJ Cjj 


01 fi is fi L0 C 


I 


T ID 'C N CO O' C h Ci 1*1 C III <1 N CO 0 C h C-i M ^ liT -C X CC O' C h C-i K ^ 11 -0 N CO O' O h M !<; ? tl "O N Cu O' O -4 Ci I*) V t' -C N CO O' C J f-j ^ ^ lil ‘ij [\ 0! O' O f i W *T LI •C N 03 O' C Ci 

»• 0 0 - 0 0 - O' c c o o c o o o c c h rt h rt H rt h h ri n m r-i N n n m r-i r-i w n n k n « w n w w ^ «r <r 7 ■? -r t « t -r lii mini in in m in li in in -o -o -g -o -g -<3 so g -c -o r-~ ?x r-. 
COCOCOOOCOCDO'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'OO'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O-O'O'O'O'O'O'O'O'O' 0-1 O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O-O'O'O' 

00000000000000000000000c.000000000000000000000000000000000 0|000 0 00000000000000000 

L) CJ U CJ i CD CD 


*T Ifi CO O' < 

in in if) in i; 

G G 'O -0 ' 

o o o o < 


i U U. O -rt T m 

: in li g g g g 
j g g g g -c g 
>000000 


g rx <c iii u 

G G <3 C G 

G G G G G 

o o o o o 


■CNN 
-o-o-o 
o o o 


cm w rx co O' <i 

X N N N f> N 
-0-0-0 G -0 o 

o o o o o o 


C, Li u. O 
rx rx rv CO 
•o -o -o -o 
coco 


t in -c 

CC CO CE 

© c © 


rx a; c 

CD CD C 
G -c -■ 


y 

> G -t col 

> fx O 'T 

o O' <r| 

4WW-WW'U'U-WU'U'U'V>U'U'iU>iM^'£^ <C|'* 

2GGGGGGGGGGGGGG CGGGGGGHG 
>00000000000000000 00 0 0*0 

I 

i 


LiLl.OW'TLD'CrxCO 

Cissccaaia 

GGGGOGGGG 

oooooooooo 


a c a. Ci 
-c -C -o -o 
o o o o 


W <? If) -0 O' C Ci 
'J U U U U J u 

g g g g g g -o 

o o o o o o o 


UL - cm m 

CJ O c Ci Cl Ci 

-0 -O -O -0 -o -o 

o o o o o o 


Number 21 


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


Page 45 


55 



* i—< x <r 


J o c 
x 2 l. 


<t c/3 : 

2 X . 


< IX . ' — * £ 


■ <x x g co £6 cn 
j x x cn x <r x c 
; x cn x >- f— >- : 


. o o w — r: «r ? 

J J J (J U C.' U I 
i X © O O TOC 


<x 2 c 

-J Q ! 

X X 2 2 2 

75 X X O C 

X X X £- H- 

x cj <r <r < 

x £- co cj u 

o u g c i 

<r uj 
G ££ I 

2 <r *- >- 2 

*-* X X LU 

2 U 2 O UJ 

2 0 2 0: 

w X UJ CJ 

CD I H- 2 7) 

UJ f- f* 


_j _j uj 2 <r u 


X I X X 

2 u. o <r o 

X t-H w o O O 

: o <i ouoco 

' X CD 2 G G G X 

C O <1 tw o o o o 


-J -J 

HDjHJ5iS:<auiXj:Nu.GGG3GGG 

U50€5«0 3GaZQ2J22000 OOOO 

1 2 2 'J 2 G 2 CD 2 75 O X w X ~3 ~5 UJ LU U X UJ X X 


_J _J 

<r >— i— ’—> *—< —i —j w w 

X G 3 X X <X 1 Ni 2 Cl ‘ 

XCC2J_IUCJ-<tCJ- 


Xr-^QXu. 
U X <E U 2 
X _! |=| X ~1 


HOOXXO>-tNu.333X 

(C0220u.220C3a 

JJ2hh2UGGUJUJuJIiI 


-0NG0'O-'rj^<fl/)'CNCD0'O'Hf'iM<Tli5 

ri n rujio ro n m « n m m n w ^ «r <f t -r 
oooooooooooooooooooo 
oooooooooooooooooooo 


O CJ _ 

o cn x 
DC CL CJ 

-ON® 
«r <r <r 
o o o 
o o o 


****** 2 t-i * * * - * * * Cl <r ooito 

-h c j f*5 in >o n a/ > o ^ r j n <r liD *c co O' o r j r*5 «r JG >o ix 03 o ^ r-J ro ^ tin -o rs cn ch o t-i n ro <r n >o ^ co o* o 

o o o o o o o o o - - h - d h n w - - m m fKi tr; m di m m m m n tin n m n ^ t f <r t <r -t t </ 

OOOOOOOOO© DOODOCOO ©OOOOOOCCOOOOOOOOCOOOOOOOOOOOOCO 

©oocoooooooooooooooooooooooooooooooooooooooooooooo 


o 

o 


o o 
g g 


CO o o o c 

u. o o u o 


o o o o 
o c o o 


o o 

r-j o 


u 

CJ 


o 

o 


o 

o 


<t X O' O O' O' <TCN 

Ci CM h M -i CJ wo 


UJCDOOO'U.UJl_Ci*TO'CjNiZi<X'OjJ 

U-cjoo'o — or'woorjwowfxo 


o 

© 


O' 

r*3 


o 

o 


o a uj 
x ro o 


■cujr''Q'0iwCi*5cj<xr-;~i 

ci^^roocjrso-rNO'Ciu 

x r-4 «r g co <r x x x © w <r 
W 04 04 04 04 04 04 0-4 04 03 fO 03 

oooooooooooo 
©o©©oooooooo 


MflNM 
04 O CJ U 

>- 

ii3-oo<ioaaacii3Qq 

mromrxm^3fxr*3fDf*3^c 

OOOOOOOOOOOX 

©oooooooooox 


xmr<3w,-ixx«'0X<rx<EX<rx<r 

Cu-iOrtUUUwLUkUdowU 


£0 

UJ 


O'iX'n £D o* £Ci w<rrso3rouujo4r*3 

w UJ CJ UJ O UJ 04 h N ri M Ml (J U 


OOOOOOOW 

oooooooo 
o o o o o o o o 
oooooooo 


M 111 CC C6 J rt T 
C O O C O — —I 

O O o o o o o 

o o o o o o o 


"0 CO CD Ci O 04 if) 
W w w w O. 04 04 
o c o o o o o 

o o o o o o o 


n cc a a c uj 

04 04 04 04 04 04 04 

o o o o o o o 

o o o o o o o 


w 04 03 -c 'O O. CD 
03 Xi !^3 CO 03 rO f*3 

o o o o o o o 

o o o o o o o 


O'O'UXXXOw 

rofororofoco'ro- 

oooooooo 

oooooooo 


ro 'O a- O' O' 0 - ci 

<T *T T <? *T <T <X 

O O O O O O UJ 

O O O O O O X 


cn cd 

CO X 
<X X 


2 C 2 2 


u cd : 
<r ' 
j x cn 


: o u 

- x <r 
— x 

- 2 <Z 
4 O X 


X 2 O O 2 


< X _i w I _1 

3 ► ► 2 * » 

. I S Jh ft u £ 


w _j x z> r>u o o x x xw r» w xr>- 
OXCJ0 0 2G3022200XNJCC 
2_iQ22-?22w-ii-irrcj-;Q2C 


J U LL H 1 i 


<ulXCOQ2DX. 


li 03 O 
cn c/3 cj 

CD CD <X UJ 


(-OXOO CD 
UJ H- UJ ii O <1 O 

cD052<r#ou.a 


XD>wCJwiXXXXO<rx<E 
Ni2CX2D»22 2 2G l -2X 
-)HtuniKH-!-£inx 


X X 

C l m W 

X X Ci o 

X O >0 o 

u o uj a 

I ItU JO o 


X N4 X X 3 a 
2 2 2 2 3 X 

UTHG UJ 


CD <T 
> O X 
X _4 O 
O O X 
2 CD X 
X O 
2 2 CJ 


2 2 G X 
X w 2 u: 
_l •- X X 
<iDca 
©ox 


X 2 X 

x cn 2 
h O C/3 O 

U X CJ 
CD O O V 

<r xx 


2 W ,x UJ 
DCONH 

x x O' x 


£5X2 
X X CD 
2 m w 
w X X 
f- w > 
XXX 

o o c 

X 2 CJ 


X C/3 X CD 


»- X 2 

CD 2 X 

CD X h O 

XXX CJ 

x <r x 
x x x x x 

X 03 X CJ X 

■C X X 

X x<li> 
H X CD X D> 

X X X t— X 
X £- X X O 

*- O X I- D> Cl 

X 2 C X O 

G C O CD cn 


X CD X W 2 X 3 ' 

X X O ► ► 0 3 

♦ G<xa,G<r£Dr«x< 


x >■ 
<t 

2 X 


XXX GXXX X 

xcnxxxxxxwocnwcjwt-i 

<X3<I0GC<I<X0G3X20X 

GXGXXUOU22XG-32G 


00 


H "i 1<) <r 111 ■fl N a 3 O rt r-i M ^ 1(3 \ 3 I), o -> r-1 13 <r a3 <! N (E o. o rt n v J M33 o. o 

OOOOOOOOCww —i w —< i —i —. —; w ' 4 ■'•■4 IN C-4 r-4 r-J ,'•< '•< Ci 04 M I3 !3 43 (3 f) !3 N M ^ 

OOOOOOOOOOOOOOOOOOOOOOOCOOOO OOOOOOOOOOOO 

oooooooooooooooooooooooooooooooooooooooo 


w r-4 m t m >c 

<r <r <r «r <r <r 
o o o o o o 
o o o o o o 


« 13 ? ii3 M3 MS l> O H ri f3 ^ Ii3 -O MS 0- O rt N 13 ^ Ii3 
O O O O O O O O O W w w w w w w w w w r-4 C4 r-4 r-4 r 4 r-4 
OOOOOOOOOOOOOOOOOOOO OOOOO 

ooooooooooooooooooooooooo 


o o 

X o 

O UX O 

O O W 


o 

o 


o 


o 

o 

CD 

r -4 


o 

o 

r-4 


O '0 o 

o x o 

X ID X 

O Q O 



r-4 ro <r 

U CJ CJ 

O' CO M3 O 
X X O w 


O O O O O O O O O r-4 ii3 

ooooooooooo 
© o o o o o o o o o o 
oo©oooooooo 


«rXK3*TX**3^-'D'DXX<XXXX<X 
f <r (J <r ? o r-4 w rv x cj r-4 n x cj 

m! Nffl 3 U a UJ u. O r-j <0 i'. 3 O- •! U 
OOOOOOOOwww—i—<ww—i 
OOOOOOOOOOOO OO 0-0 

ooooooooooooooo o 


Wliiuif-iM3f3f3<f «MI3U.a r-4 CJ f<3 

r 4 m x x m w r m x w rv o g <r * g w a 

>- 

liOHN3 -O G O' <r X X X O :'3 <T fcD CD O' G G X 

— r 'i r-j r -4 r -4 "i m r -4 r -4 r-j MWrtiDMttnwnc 

oooocoooooooooooooox 
oooooooooooo©OOOOOox 


a ill x w a x x x x x un x r -4 x x 
GXGXXGGGOr'GXXfDX 

OOOOOOOOOOON<TN!3Mlk.3;^t* i C“Oiu 
OOOOOOOOOOOOOOOOOOwwww-1 — w 
OOOOOOOOOOOOOOOOOOOOOOOOO 
OOOOOOOOOOOOOOOOOOOOOOOOO 


Page 46 


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


Number 21 


56 




dr dobbs journal of 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 22 February 1978 Volume 3, Issue 2 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


ET TU, KLATU?, Stanford News Service 4 

Quasar Industries’robot called “a fraud” by John McCarthy 

The Last Rehash of Beau Hex? letters in the unending/?) hex/octal debate 45 

6502 SOFTWARE 

Decoding Efficiency & Speed: Pros & Cons of Table Look-up, H.T. Gordon 5 

8080 & Z-80 SOFTWARE 

MITS 4.0/4.1 BASIC Searcher/Patcher, James Monagan 8 

Z-80 RAM Tester, John MacDougall 42 

Mini Editor for 8080 PILOT, Tim Scully 43 

CODE RELOCATION 

A Simple Technique for Static Relocation of Absolute Machine Code, Gary A. Kildall 10 

the creator of PL/M and CP/M tells how 

Relocation is Not Just Moving Programs, Richard L. Roth 14 

TV DAZZLER SOFTWARE 

PCC’s Dazzler Contest Winners (at long, long last), Robert B. Jacobsen, Exec. Dir., PCC 21 

Absolutely Dazzling Dazzleware, Gordon French & Gregory Yob 22 

Dazzler Driver Subroutine and a “Chase”, Phillip Simpson 30 







MORE GOOD ADVICE ON MAIL ORDERING 

Gentlemen: Received: 78 Jan 24 

In regard to your recent article on slow or non-existent 
delivery on the part of some merchandisers in the home com¬ 
puter field, I’ve devised some defensive techniques that work 
well. 

Always write a letter in advance asking if the product is 
available for immediate delivery provided that a certified 
check or money order is sent. 

If you receive no reply, don’t send in an order. If you are 
really anxious to purchase the product, you might try a 
follow-up letter just in case the first one got lost somewhere 
along the way. If you still hear nothing, forget it. 

Once you have received a letter indicating that the product 
is available, send in your order with certified check or money 
order. Keep a copy of the dated letter and also photocopy the 
check. In your cover letter clearly state that you wish ship¬ 
ment within 2 weeks (or whatever time you feel is reasonable). 
Otherwise you want your money refunded. 

If you do not receive the product on time, send a follow¬ 
up letter. Courteously remind the merchandiser that shipment 
by a certain date had been promised, and refer to your 
previous correspondence by date. Keep a copy of this letter 
also. 

If you do not receive a reply within two, weeks, send a not- 
so-courteous letter by certified mail, return receipt requested 
(costs about a dollar). Tell the supplier that you want an 
immediate refund or you will report the matter to the U.S. 
Postal Service, the Attorney General of your state, and to the 
magazine in which the advertisement appeared. Keep a number 
of copies of this letter, along with the signed delivery receipt. 

Wait another two weeks, and, if you still have not received 
the product or a refund, proceed to report the matter to the 
U.S. Postal Service, Attorney General, etc. Send copies of 
correspondence with the merchandiser. Send the merchandiser 
copies of your complaint letters. You might also send copies 
to the Better Business Bureau in the merchandiser’s home 
town. 

If the above sounds like it was written by a paranoid, I can 
only claim long and bitter experience. My method works so 
long as the supplier is not an out and out fraud. Before sending 
a really substantial check, I would ask the supplier for credit 
references, if I was at all dubious. 

It is also extremely effective to send complaints to the 
supplier’s bank (appears on the back of the cancelled check 
if deposited) and to credit rating bureaus, as well as the whole¬ 
salers he deals with, if known. These are effective measures in 
drastic cases. 

Sincerely, Berme Rd 

John D. Hirsch Kerhonkson, NY 12446 


RASKIN JOINS APPLE: LEAVES DR. DOBB'S 

Announcement Dated: 78 Jan 18 

Jef Raskin has been our itenerant product evaluator for 
some time. Part of the reason he could do that is that he was 
an independent (very) computer consultant. He has recently 
taken a position as Director of Publications with Apple Com¬ 
puters of Cupertino, California. As such, he can no longer be 
considered to be “independent.” Therefore, he will no longer 
be submitting “product evaluations” to DDJ. It is likely, 
however, that we will—from time to time—publish “product 
opinions” authored by Jef. 


O TEMPORA, O MORES! 

Vector Graphic Inc. 

790 Hampshire Road, A-B 
Westlake Village, CA 91361 

Dear Vector Received: 78 Jan 30 

You are without a doubt the most sneaky, conniving com¬ 
pany I have had to deal with in the microprocessor field. It is 
disgusting. 

My letter to you, written (and clearly dated!) 22 January, 
1978 (a Sunday) was not mailed until 23 January 1978. Yet 
you managed to somehow get ahold of it on the 24th and get 
your reply into my hands by 2 PM on the 25th, a gap of al¬ 
most 4 whole days! What’s more, the material promised by 
you did not arrive until the 26th, 2 whole days later, which 
was exactly as promised! 

Now my request was fairly reasonable and should have been 
simple to answer. But oh no! you have to set someone down 
who completely understood my request, have them answer my 
letter specifically point by point and then cause them to mail 
the answer without cramming the envelope with useless and 
unrequested literature. 

Well let me tell you people up there at Vector that while I 
may have appeared to be a mild mannered computer hobbyist 
working for a Great Metropolitan Newspaper, I am in fact, a 
systems analyst with more than 20 years experience in all as¬ 
pects of data processing... And I’m not going to stand still for 
conduct like yours! 

If I can write to MITS, Micropolis, Digital Group and Dyna- 
Byte and never receive any reply at all, and if IMSAI and Poly 
Morphic and Space Byte need from thirty to ninety days to 
get a bale of unwanted literature to me instead of an answer to 
a specific question, then the obvious question to me is 
WHAT’S WRONG WITH YOU PEOPLE UP THERE? 

Don’t you people realize that a response like I received is 
like waving a yellow flag in front of a gorilla? You may think 
you have the world by the toe-nails and can afford to trifle 
with guys like me but you’ve made a serious mistake this time. 
I’m really going to give you the business! 

A copy of this letter is going directly to Tom Williams at 
Dr. Dobb’s Journal. There is no doubt in my mind that Tom 
will publish the letter and let everyone know just what kind of 
shenanigans you guys are up to! 

Acryptically yours 
Robert S. Hoover 

First Heath returns phone calls, now Vector Graphic answers 
letters. What is this world coming to? -TRW 


SOLUS PREPARES SOFTWARE DIRECTORY 

News Release 78: Jan 29 

The SOL Users’ Society (SOLUS) is preparing a directory 
of programs that are tailored to run under the SOLOS and 
CUTER operating systems. The list will be published in the 
SOLUS Newsletter (at no charge to the software vendors). 

To qualify for listing in the directory, a program must be 
compatible with both SOLOS and CUTER and be available on 
CUTS format or Kansas City standard cassettes. It must be 
well-documented for the user, extensively tested and 
debugged, and supported by a warranty to repair or replace for 
at least 3 months. Programs written in higher-level languages 
will be accepted if the interpreter meets these specifications. 

Software vendors should send a brief description and order¬ 
ing information to SOLUS NEWS, Box 23471, San Jose, CA 
95153. 


Number 22 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 3 


59 


ET TU, KLATU? 

Stanford University News Release Received: 77 Nov 14 

A company which claims it is ready to manufacture and sell 
truly intelligent household androids, or robots, within the next 
two years—to the tune of $4,000 apiece—has the nation’s 
artificial intelligence experts up in arms. The experts 
unanimously state that the claims are fraudulent. The com¬ 
pany, Quasar Industries located in Rutherford, NJ, is currently 
touring shopping centers around the country with a model of 
an android which they claim comprehends 4,000 words of 
vocabulary and can vacuum, wash dishes, and teach the kids 
French. Crowds in the sundry department stores are dazzled, 
according to numerous press reports. This robot is a fake, 
according to scientists from Carnegie-Mellon University in 
Pittsburgh, PA. The scientists recently undetook a first-hand 
investigation of the matter and found the robot to be a 
“radio-controlled puppet.” 

Quasar Industries sees it differently. “We programmed the 
robot to approximate human behavior,” said Anthony 
Reichelt, president of the company. “The only limitations to 
what it can do is the boundary of imigination and the cost 
factor.” Quasar Industries has no relationship with a brand of 
television set formerly manufactured by Motorola and now 
made by a Japanese company. 

Numerous publications, including Newsweek, Parade, and 
Newsday, have in recent months printed articles about the 
robot—called Sam Strugglegear—in which the claims made by 
Quasar Industries are reported as fact. “It is a fraud that has 
gone on far too long,” says John McCarthy, director of 
Stanford University’s Artificial Intelligence Laboratory. 
McCarthy is one of the earliest pioneers in the field. The 
technology is nowhere near being able to manufacture a 
robot which can do all, let alone safely, what Strugglegear’s 
owners say it can do, McCarthy said in an interview. The 
company has some sort of expensive, remote-controlled 
gimmick, he said, which in no way possesses the sort of 
intelligence claimed for it. “The press has been extra¬ 
ordinarily irresponsible in not bothering to ask the opinion 
of artificial intelligence experts on the matter. They don’t 
have to believe us, but they should at least ask.” On Oct. 24, 
according to Carnegie-Mellon graduate students Brian Reid 
and Mark Gos, a well-known department store in the heart 
of Pittsburgh advertised the appearance of a “domestic 
robot.” “Knowing of CMU’s pioneering work, particularly 
in the field of speech recognition, various friends called 
CMU to ask how this robot might be so much better at 
speech recognition than our talented and dedicated research 
teams,” they wrote in a memorandum sent to colleagues at 
Stanford, MIT, and elsewhere. “Rising to the challenge, four 
courageous members of our department went downtown to 
investigate. They found a frightening sight: in the men’s 
department, among the three-piece suits, was a 5’ 2” image 
of an aerosol can on wheels, talking animatedly to the 
crowd.” 

Upon closer investigation, the CMU experts saw that the 
robot was surprisingly crude. “It didn’t seem able to tell that 
an object was blocking its path. Covering the faceplate did not 
change its behavior at all. Since the robot seemed able to 
navigate around the room without hitting anything, we found 
it quite curious that it had no detectable sensory reactions. 
Feeling more dubious, we began to look around the room for 
evidence of remote control. Lo and behold, about 10 feet 
from the robot, standing in the crowd, we found a man in a 
blue suit with his hand held contemplatively to his mouth. 
After watching for a while we noticed that whenever the robot 
was talking, the man in the blue suit could be seen muttering 
into his hand.” 

At a second store, “they found a furtive-looking and rather 
disagreeable person loitering in the back of the room. He was 

Page 4 


carrying an airline flight bag with his hand stuck down in the 
bag.” The investigators challenged the man, suspecting that he 
was controlling the movements of Sam Strugglegear. The man 
became “very excited and called for store officials to come get 
us away from him,” the CMU scientists said. Quasar Industries 
still maintains they will be ready to market a domestic robot 
within 18 to 22 months. It will, they said, be able to perform 
12 household tasks such as “serve your dinner, vacuum your 
rugs, babysit for your kids, and insult your enemies.” Such 
claims amuse, annoy, and sometimes downright anger artificial 
intelligence experts. 

Stanford graduate student Paul Martin, who is writing a 
thesis on the problems of machines understanding natural 
dialogue, believes much of the gullibility on behalf of the 
public, the press, and department store managers stems from 
recent technological innovations, such as hand-held calculators 
and space missions. But there is a huge difference, Martin said, 
between having a machine which can recognize separate, 
simple words (this is possible now) and one that can under¬ 
stand the flow of language as spoken naturally. “Everyone in 
the field would agree there are important scientific problems 
waiting to be solved before we can get to the real thing. On 
how long these problems will take to solve, you find a diver¬ 
sity of opinion. I tend to hedge by saying it will take between 
five and 500 years. If you ask me to center it, I would say 40 
years. The basic problems are how to make computers 
recognize patterns in a noisy environment and how to go 
about representing common sense knowledge about the world, 
how to put that in a computer. In fact, what common sense 
knowledge about the world is there? How can a machine be 
taught to solve problems? 

“One way these problems express themselves is in safety 
issues. A household robot has to be very reliable, mechanically 
and intellectually. It must distinguish between children and 
animals as objects. It cannot think the baby is part of a stack 
of pillows. It has to have a wide knowledge of different kinds 
of objects to be intelligent.” In response to a reporter’s ques¬ 
tion whether the robot could tell a cup from a saucer, Reichelt 
responded that it didn’t have to because it didn’t take them 
off the tray. McCarthy then argued that, in that case, the 
Quasar robot is too limited to be really useful. “Say it could 
carry a dinner tray from the kitchen to the dining room,” 

McCarthy said. “Someone in the kitchen would have to pre¬ 
pare the tray. The robot would be on a tread, according to the 
company. But it still couldn’t be done safely. It could trip 
on a rug. It could run over something. It could fall down the 
stairs.” 

Sam Strugglegear, also called KLATU in some news reports, 
is not yet out of the news. A few weeks ago, while performing 
at a shopping center in Philadelphia, the imitation robot 
reportedly frightened a 10-month-old child. The child’s « 

mother has filed suit for $100,000 in damages, saying that the 
robot “accosted, touched, assaulted, and terrorized” her child. 

The CMU scientists were reminded by these recent events 
of another famous “intelligent” robot build by Baron 
Wolfgang van Kempeler in 1769. This robot, known as “the 
Turk,” would trounce people at chess, all while rolling its eyes 
and nodding its head. Thousands of people, including Edgar 
Allen Poe and Napoleon, examined it thoroughly and could 
not figure out how it worked. It wasn’t until more than 70 
years later that the truth was discovered. The robot cleverly 
concealed a dwarf who was a talented chess player. Kempeler’s 
description of his own robot, circa 1771, the CMU investigat¬ 
ors said, is probably the best summary of Sam Strugglegear: 

“A mere bagatelle, not without merit in point of mechanism, 
but whose effects appear marvelous only from the boldness 
of conception and the clever choice of methods adopted for 
promoting the illusion.” 

Number 22 


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


60 


Decoding Efficiency & Speed; 

Pros & Cons of Table Look-Up 


BYH.T. GORDON 

College of Agricultural Sciences 
University of California 
Berkeley, CA 94720 

Dear Jim, Received: 78 Jan 15 

While some of your readers may have become as weary as 
lam with my repeated attacks on the 650X legality-bytecount 
problem, this is in a way a programming guinea-pig for 
working-out optimization principles, relevant to all problems. 
Even your non-650X readers may find something of value in 
the enclosed MS, as it touches on some universal problems: the 
chioce between decoding-logic or table-look-up programs, the 
extent to which subroutines should be designed to be non¬ 
destructive and purely-informative, and the uses of antibug¬ 
ging code. My ultimate goal is to develop scanning-debugging 
to a higher level. For this, the basic components of the 
debugger must be fast, efficient, and above al bug- free. 
Sincerely, 

H. T. Gordon 

The question of how to optimize a decoding subroutine, 
previously touched on in my notes in issues #17 and #19 
of DDJ (1977) using decoding of the number of bytes 
required by 650X opcodes as an example, is re-opened by 2 
new solutions: CNTBYT (written by Jim Butterfield and 
reproduced here with his permission) and BYTCNT (my 
own response to his challenge). Both optimize coding 
efficiency, and it is unlikely that a solution in fewer than 
28 bytes exists. Both sort the 151 legal opcodes into the 
same 6 groups as my earlier subroutine BYTNUM. However, 
CNTBYT classes illegals of type X 0 B as 3 byte codes while 
the others class them as 2 byte codes (which is how the 
650X control unit executes them, but this is immaterial 
since all routines class illegals of type X2 as 2 byte codes 
although most of them are not executable). 

The important differences are in structure and timing. 
CNTBYT uses an elegant and highly instructive linear sequence 
of bit-manipluations that cause each of 5 classes of opcodes 
in turn to become zero and exit, while the 6th class exits as 
non-zero. BYTCNT emulates BYTNUM by first sorting into 
subclasses X(0-7) and X(8-F) by a BIT test of bit 3, then 
shifts to destructive logic in each branch to attain higher 
code efficiency. Unlike BYTNUM, both new routines destroy 
the accumulator. 

All routines have different path lengths (measured in 
clock cycles from entry to exit, including the 6 cycles for the 
main program JSR and 6 cycles for the RTS) for each of the 
6 opcode classes. An index of relative speed (not weighted 
for difference in opcode usage frequency) is easily calculated 
by dividing 2 (N X T) by £ N, where N is the number of 
legal opcodes in a class and T the path length in cycles for 
that class. BYTNUM has the fastest index, 30.6 cycles (range 
28 to 37). BYTCNT is slower, 32.5 cycles (range 29 to 39). 
CNTBYT is slower still, 39.3 cycles (range 23 to 42). The 
delay is caused by its having to sort out 3 small classes (con¬ 
taining only 11 of the 151 opcodes) before it can work on the 
3 large ones. The lesson to be drawn from this is that linear- 
sequence logic is not inherently slower (as I implied in my 
previous DDJ notes) and might even be faster if its first 
stages could sift out the majority of the items being sorted. 


However, the range of sorting times is necessarily wider. 
One additional point: to make the 2 new routines fully equiva¬ 
lent to BYTNUM, one would have' to add a PHA to store and 
a PLA to restore the accumulator, at the cost of 2 more bytes 
and 7 more cycles. However, the main program might be 
able to restore the accumulator more efficiently. 

One interesting point about all these “decoding” routines 
is that, although their branch instructions subdivide opcodes 
into 6 classes, they return with 3 byte-count classes 
re-encoded (as 01, 02, and 03) in the X register, so that a 
little more decoding logic is required to use this information. 
A second point, that 1 have emphasized before but that 
deserves reiteration, is that they all produce additional 
information as an incidental effect. E.g., CNTBYT and 
BYTCNT cause only 1 byte opcodes to set the Z flag, i.e., 
this type is truly decoded. It would be easy to recode 
BYTNUM to have the same effect, by omitting its inner RTS 
and relocating its TRICK sequence outside the subroutine. 
This would save 1 byte and very slightly reduce its speed. 
CNTBYT returns with the carry flag always equal to bit 7 
of the opcode, and the sign flag always cleared. BYTCNT 
sets the carry flag equal to bit 4 for all 1 byte opcodes; it 
clears the carry for opcodes of type (0,1) (0,7) and sets it 
for all others. The BIT instruction in BYTCNT and BYTNUM 
sets the V flag equal to bit 6 for all opcodes; in BYTNUM it 
also causes all 1 -byte opcodes to return with the N flag equal 
to bit 7. 

I still prefer and recommend BYTNUM, although in my 
KIM system it takes 32 bytes (that would be 31 in the minor 
revision suggested above). In a well designed system, every 
one of the 256 possible bit patterns would be present in 
ROM (for use as numerical constants, BIT masks, etc.) and 
BYTNUM could be coded in 30 (or 29) bytes, a small price 
to pay for non-destructive logic and higher speed. 
Unfortunately (as I showed in a recent note in Kim User Notes) 
the KIM-ROM omits 81 of the possible patterns, including 
39 of the 151 legal opcodes. 

In the letter in which Jim Butterfield sent me his CNTBYT 
program, he also pointed out that a table-look-up operation 
would optimize timing. One way to do this is to move the 
opcode into an index register to get the content of a unique 
location in a 256 byte table. A content of 00 would identify 
an illegal (setting the Z flag), while contents of 01, 02, or 03 
would give the byte-count of a legal. A 7 byte program insert 
(XINFOA, cf. listing) would do the work of both BYTNUM 
and OPLEGL at a cost of (7+M) main program bytes and 
(10+N) cycles. The values of M and N depend on whether the 
opcode needs to be restored in the accumulator (if not, both 
are zero) and on the kind of coding the main program is using 
to pick up a sequence of opcode bytes (most likely the LDA 
(INDIRECT), Y instruction with M = 2 and N = 5). Since 
the existing (not optimized) decoding logic version of 
OPLEGL needs 66 subroutine bytes and has a speed index of 
37 cycles (range 24 to 63), the XINFOA insert would run 
more than 4 times faster than the OPLEGL + BYTNUM 
combination. To anyone enamored of speed (as I am) this 
is very attractive. An added superiority is that the main 
program can decide what to do with an illegal. If a program 
BREAK is desired, the branch offset ILLEG can be directed 
to the nearest 00 operand, otherwise to an illegality handling 
routine. One of several flaws in OPLEGL is that it forces a 


Number 22 


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


Page 5 

61 



BREAK for illegals. A well designed subroutine should return 
information and not make decisions. 

Nothing comes free, and the price of the XINFOA speed 
is a very long table, with every opcode a unique class, 
vulnerable to bugs if located in RAM. Ideally an info table 
like TAB256 should be in ROM, but it uses only the 2 low- 
order bits and one hesitates to waste 75% of the bits in an 
expensive ROM. The solution would be to encode other 
information in the high-order bits, and AND them out to 
retrieve the legality/bytecount data. The dilemma is: what 
other information? 

I briefly explored another approach, fully packing the 
infobit pairs of TAB256 into a 64 byte table. Retrieval needs 
a 36 byte program, too long for a main progarm insert, and 
with a speed index of 63 cycles when made into a subroutine. 
This is not good enough to be worth presenting here. 

A more promising use of info tabling is my new legality- 
testing subroutine, HYLEGL, that has many advantages 
when compared with OPLEGL. It needs only 64 bytes, saves 
and restores the accumulator, and returns with the carry 
flag set by illegals and cleared by legals. Its speed index is 
44 cycles (range 36 to 71). A revision of OPLEGL to make 
it fully equal to HYLEGL would be about 10 bytes longer 
and 2 cycles slower. 

HYLEGL is a “hybrid” operation that retains the decoding 
logic of OPLEGL for the 128 “odd-number” opcodes because 
this is both fast and efficient. For the 128 “evens” it encodes 
legality as single infobits packed in a 16 byte table, INFTAB, a 
1 bit meaning illegal and a 0 bit legal. A table-addressing index 
from 0 to F is generated by ANDing bits 4321 of the opcode, 
bit 0 (always 0 for evens) having been right-shifted out. The 
16 infobytes correspond to the original opcode sequence: 
X 0 0, X 0 2,. .. .X 0 E, X,0. .. .X,E. Since 7 of the infobytes 
contain no 1 bits, legality is proved by the setting of the Z 
flag at the load into the accumulator, so no retrieval is needed. 
For the remaining 9, the correct infobit is moved into the 
carry flag by a sequence of from 1 to 8 ASLs, controlled by 
analyzing the status of bits 765 of the original opcode (stored 
in the temporary zero-page location COPY). 

Since INFTAB contains 128 unique classes, it is as 
vulnerable to bugs as any other table in RAM. Since it is short, 
it is much easier to,check and also more likely to get itself 
fitted into a ROM. Decoding logic in RAM is of course not 
immune to bugs, but when a large class is involved the bug 
will show up very quickly. In a unique class, rarely use-tested 
(such as the illegals individually weeded out by OPLEGL) 
a bit-error bug may lurk for a long time before inflicting 
damage. Worse, the damage may be neither suspected nor 
detected; the output will look right but be wrong, and may 
even create a new hidden bug in other programs. 

HYLEGL highlights some “gray areas” of subroutine 
design, where programming philosophies differ. The X 
register is used in its table look-up segment, but the pre-call 
X content is saved and restored at a cost of 4 bytes and 6 
cycles. Its operations destroy the pre-call content of the 
accumulator, but this is saved and restored at a cost of 3 bytes 
and 7 cycles. It can be argued that only the main program 
really knows what needs to be saved and how and where to 
save it and when to restore it. By omitting the saves, HYLEGL 
would need only 57 bytes and 34 cycles, but greater pre¬ 
caution would be needed in the writing of the main program 
(perhaps not an evil). Should subroutines try to leave no 
traces of their work, other than the intended ones? Despite 
its saves, HYLEGL does leave traces, in the zero-page 
locations STORX and COPY and as incidental effects on the 
N, Z, and V flags. However, the PLP and PHP instructions 
of the 650X make status saving especially easy for the main 
program, and low zero-page locations are commonly viewed 


as temporary scratchpad area. My current view is that sub¬ 
routines should be written to save on-chip registers, since it 
is easy for a user to remove any save instructions he does 
not want. 

In order to make the high speed of the XINFOA/TAB256 
approach immediately available, I am adding to the package 
subroutine MKTABL, that uses HYLEGL and BYTNUM to 
construct a temporary TAB256 in a RAM page. MKTABL 
is long (52 bytes) because it has an unusually high content of 
antibugging code and also serves as a testing/debugging 
program for the legality/bytecount subroutines. A large table 
in RAM is not only insecure but hazardous to generate. The 
data generating routines may be yielding some incorrect 
values. The write operation may be overwriting a RAM page 
other than the intended one, or trying to write in nonexistent 
RAM (that in systems not fully address-decoded may prove 
to be existent RAM with valuable stuff in it) or in write- 
protected RAM or in ROM. 

Before calling MKTABL, a main program is expected to 
write into location BASEHI the number of the RAM page into 
which the table will be written. MKTABL compares this to 
the unique page number in its own coding; only if they are the 
same will table writing be permitted. It also sets the low base 
address for the table to 00, to ensure that the table will lie 
within the bounds of the one RAM page. This is part of the 
initial zeroing of 5 adjacent zero-page locations, that will 
contain useful information when MKTABL exits. The lowest 
one, COPY, is used by HYLEGL and will contain $FF at a 
correct exit; each run of HYLEGL stores the opcode it has 
worked on, unaltered except for the 72 “evens” that require 
infobit retrieval (that causes one ASL of COPY). 

The next higher location (LEGCNT) contains $97 at a 
correct exit, since this counter is incremented before each 
call to BYTNUM, of which there will be 151 if HYLEGL is 
working properly. The next location (CHKLO) is a 1 byte 
checksum that contains $41 at a correct exit. The next 
location (TABGEN) indirectly counts the number of table- 
writes, containing either 00 (if no table was written) or $FF. 
This is a bit trickier than a simple count. After each write, 
the current value of the opcode is moved from the Y index 
into the accumulator, destroying the infobyte content so that 
the subsequent reloading of the infobyte from the table 
location is a test that the correct value was indeed stored 

there. The actual content of TABGEN is the current opcode 
value, from Y, that if all is well is also the count of writes. 

Finally, the content of BASELO should always be 00, 
and BASEHI should contain the number of the unique permis¬ 
sible RAM page if the main program commanded a table- 
write, and some other number if not. A simple way to imple¬ 
ment a no-table command would be an LDY #$06 followed 
by a JSR SETEX to bypass the first MKTABL instruction, 
since SETEX would zero BASEHI. 

The terminal instructions of MKTABL control the 2 flags 
that will tell the main program what has happened. The BIT 
sets the V flag if a table has been written (TABGEN = $FF), 
and clears it if not. The crucial instructions compare the 
checksum in CHKLO with the correct value $41, setting the 
Z flag if all is well, clearing it if not. A great variety of errors, 
either in MKTABL itself or in the subroutines it calls, can 
cause a wrong checksum. Much information on the kind of 
error can be derived from the content of the 6 zero-page 
locations, of the accumulator (should be $41) and of the 
X and Y registers (both should be 00). If a table was written, 
very detailed information on operation will be found in the 
infobyte sequence. 

The antibugging logic in MKTABL, although far from a 
total bugproofing, is clearly costly in memory and time. 
Programs that aim to optimize timing, such as the XINFOA/ 


Page 6 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


62 



TAB256 combination, can tolerate little or none. (An example 
of very light antibugging would be addition of an AND #$03, 
at a cost of 2 bytes and 2 cycles, to erase the 6 high-order 
bits of the infobyte.) The major insurace against error for 
such programs is a thorough testing by an antibug test 
program, both before and after each use. In service programs 
resident in RAM, like MKTABL, error-proofing can be given 
priority. It may be desirable to trade off more memory to 
attain higher speed, but one should never trade off reliability! 
On this subject, the chapters on antibugging, testing, and 
debugging in E. Yourdon’s Techniques of Program Structure 
and Design (Prentice-Hall, 1975) make interesting reading. 

To sum up, tables can indeed play useful roles beyond 
their classic one of defining arbitrary relations and rules 
(such as the metalogical ASCII decision that $41 represents 
the letter A). These other roles have been obscured by the fact 
that it is simpler to implement a de novo calculation of a math 
function than a look-up in a gigantic table. With tables of 
more modest size, table look-up can (as Jim Butterfield 
suggested) maximize speed, at an acceptable (though relatively 
high) memory cost. When decoding logic proves to be very 
intricate (many small or unique classes) the use of tables may 
also be more code-efficient. Furthermore, programs may be 
easier to write because similar retrieval logic may be applicable 
to a variety of tables. There is probably some trade-off point 
(more that 35 bytes of decoding logic, more than 10 classes 
decoded?) where the entabling of pre-decoded information 
becomes an optimal solution of the dimensions of the table 
can be kept within reasonable bounds (no more than 32 
bytes?). 


0230 

2 

i 

8 

A 

B 

D 

F 

021+1 

3 

5 

7 

9 

A 

024B 


(coding Tor CNTBYT and BYTCNT) 


A2 01 

49 20 

F0 13 

29 9F 

F0 11 

0A 

49 12 

F0 0B 

CNTBYT 

29 1A 

49 02 

F0 06 

29 10 


D0 01 

E8 

THREE 

E8 

TWO 

60 

ONE 


LDX #$01 (initialize X) 
EOR #$20 (flip bit 5) 

BEQ THREE (only $20) 

AND #$9F (bits 5,6 out) 
BEQ ONE (only (0,4,6)0) 
ASL A (shift bit 7 out) 
EOR #$12 (flip bits 3,0)* 
BEQ TWO (only X Q 9) 

AND #$1A (bits 4,1 out)* 
EOR #$02 (flip bit 0)* 
BEQ ONE (X(8,A)> 

AND #$10 (all but flipped 
bit 3 out)* 
BNE TWO (resid. X(0-7)) 
INX (resid, X(9-F)) 
INX 
RTS 


* comment refers to original opcode bits 
before left-shift at 023A 


0230 

A2 

01 

BYTCNT 

LDX #$01 

2 

2C 

36 02 


BIT BYTCNT+6 (test bit 

5 

D0 

08 


BNE HALFOP (all X(8-F)! 

7 

C9 

20 


CMP #$20 

9 

F0 

0E 


BEQ THREE (only $20) 

B 

29 

9F 


AND #$9F (bits 5,6 oul 

D 

D0 

0B 


BNE TWO (all except 

(0,4,6)0) 

F 

29 

15 

HALFOP 

AND #$15 (retains only 
bits 0,2,4) 

0241 

C9 

01 


CMP #$01 

3 

F0 

05 


BEQ TWO (X (9,B)) 

AND #$05 (bit 4 out) 

5 

29 

05 


7 

F0 

02 


BEQ ONE (X(8,A) and 
(0,4,6)0) 

9 

E8 


THREE 

INX (resid. X(9-F)) 

A 

E8 


TWO 

INX 

024B 

60 


ONE 

RTS 


X1NF0A TAX 

LDA TAB256, X 
BEQ ILLEG 
TAX 


026E 

48 

HYLEGL PHA 

(save opcode in stack) 

F 

% 

10 

STA 

COPY (store work-copy) 

0271 

4a 


LSR 

A (bit 0 to carry) 

2 

90 

0A 

BCC 

TABLOP (do evens/table) 

k 

4A 


LSR 

A (bit 1 to carry) 

5 

B0 

05 

BCS 

ILLEX (all X(3,7,B,F)) 

7 

C9 

22 

CMP #$22 (LSRed $89) 

9 

F0 

01 

BEQ 

ILLEX ($89 illegal) 

B 

18 


CLC 

(legals clear carry) 

C 

68 

ILLEX PLA 

(restore opcode in A) 

D 

60 


RTS 


E 

86 

0F TABLOP STX 

STORX (save X register) 

0280 

29 

0F 

AND #$0F (bits 7,6,5 out) 

2 

AA 


TAX 

(4321 to X index) 

3 

BD 

9E 02 

LDA 

INFTAB,X (load infobyte) 

6 

F0 

12 

BEQ 

EXIT (all 0 bits, legal) 

8 

06 

10 

ASL 

COPY (bit 7 to carry) 

A 

B0 

04 

BCS 

STEPA (bit 7=1) 

C 

0A 


ASL 

A (leftshift infobyte) 

D 

0A 


ASL 

A 

E 

0A 


ASL 

A 

F 

0A 


ASL 

A 

0290 

24 

10 STEPA BIT 

COPY (bits 6,5 to N,V) 

2 

30 

02 

BMI 

STEPB (bit 6=1) 

4 

0A 


ASL 

A 

5 

0A 


ASL 

A 

6 

70 

01 STEPB BVS 

STEPC (bit 5=1) 

8 

0A 


ASL 

A 

9 

0A 

STEPC ASL 

A (infobit to carry) 

A 

A6 

0F 

EXIT LDX 

STORX (restore X) 

C 

68 


PLA 

(restore opcode) 

029D 

60 


RTS 



INFTAB table for even opcodes 

029E 10 DF 0D 00 00 00 01 00 
02A6 00 FF CF 00 00 OF DF 10 


(coding for MKTABL) 


02AF 

02B1 

3 


8 

9 

A 

D 

F 

02C1 

3 

6 

7 

9 

B 

D 

F 

02D0 

2 

k 

5 

7 

9 

A 

C 

E 

02E0 

02E2 


A0 05 
A2 00 
96 0F 
88 

D0 FB 

D8 

98 

20 6E 02 
A2 00 
B0 05 
E6 11 
20 10 02 
8a 

A2 XX 

e4 15 


D0 07 
91 14 
98 


ii 


65 

B1 
18 
65 12 
85 12 
c8 

D0 DD 


24 13 
A9 41 
c5 12 
60 


MKTABL LDY #$05 (zero 5 loci) 

SETEX LDX #$00 (notable entry) 
ZEROIT STX COPY-1, Y 
DEY 

BNE ZEROIT 

CLD (clear decimal mode) 
OPBYTE TYA (opcode from Y to A) 

JSR HYLEGL (test legality) 
LDX #$00 (rezeroes X) 

BCS MOVXA (illegal bypass) 
INC LEGCNT (count legals) 

JSR BYTNUM (bytecount to X) 
MOVXA TXA (bytecount from X to A) 
LDX #$XX (RAM table page #) 
CPX BASEHI (compare page # 
set by program) 
BNE NOTABL (nowrite if #) 

STA (BASELO),Y (write) 

TYA (opcode from Y to A) 

STA TABGEN (count writes) 

LDA (BASELO),Y (read table) 
NOTABL CLC (clear carry for add) 
ADC CHKLO (bytecount sum) 

STA CHKLO (store checksum) 
INY (next opcode ) 

BNE OPBYTE 

EXIT BIT TABGEN (sets V if table) 
LDA #$41 (valid checksum) 

CMP CHKLO (compare actual) 
RTS 


I 


Number 22 


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


Page 7 

63 




BASIC SEARCHER/PATCHER 

Dear Dr. Dobb’s: Received: 77 Dec 9 

The enclosed program should be of use to anyone seeking 
to modify MITS 4.0 or 4.1 BASIC. It should be used with 
an 8080 disassembler such as the one published in the March 
1977 issue of Dr. Dobb’s Journal. 

The program has two functions; viz., searching and 
patching. The code to be searched or patched may reside 
anywhere in memory or on the reserved areas of the disk. 
These areas comprise the first five tracks and are occupied 
by the bootstrap/loader (sectors # 0,2,4,6) and by BASIC 
itself (remaining 156 sectors). 

The search function accepts any non-empty string of 
characters or hexadecimal digits. A search is then performed 
over the specified address range. Wherever a matching string 
is found, the hex address is displayed or printed and the 
search continued. 

Two searching examples are given. In the first, the memory 


resident BASIC code is searched for all occurrences of the 
hex string ‘DB08’ (read disk status command). These indicate 
where the disk I/O routines are located. In the second 
example, a search is made through part of the BASIC code 
on the disk for the string “RANDOM”. This was found only 
once in the specified address range. 

The patch function accepts a starting address, which is then 
displayed together with the hexadecimal, decimal, and ASCII 
equivalents of its contents. If the byte is to be changed then 
a single character or two hex digits are entered. Otherwise 
only a carriage return is entered. The patching address is 
then incremented, decremented, or left unchanged, as selected. 

Two patching examples are shown. In the first, the string 
“RANDOM” beginning at address ‘069D’ is changed to 
“RANCID”. In the second, the command ‘DB08’ (IN 08) 
at ‘2E86’ is changed to D309’ (OUT 09). Since these changes 
were made only to memory, they are not permanent. 

James Monagan 806 Clark St. 

Iowa City, IA 52440 


10 PRINT"'PATCHER" 12/05/77 

20 PRINT"PATCHES ANV BYTE IN MEMORY OR ON THE DISK COPIES OF MITS 4 0 B 
ASIC AND BASIC BOOTSTRAP/LOADER " 

20 PRINT"ALSO SEARCHES THROUGH ANY OF THE ABOVE TO LOCATE A GIVEN ASCII 
OR BINARY STRING " 

40 CLEAR500 
50 TRK=-1 
60 ' 

70 PRINT . INPUT"1> SEARCH 2> PATCH"; FC: IFFCC1ORFO2THEN70 
80 PRINT:MEM=1 INPUT"1> MEMORY 2) BOOTSTRAP 3> BASIC"•MEM IFMEMCIORM 
EM>3THEN80 
90 IFFC=2THEN 980 
100 

110 SEARCH ROUTINES 

120 PRINT:INPUT"DO YOU WANT HARD COPV";ZZ* PRINT 
130 IF LEFT*<ZZ*. 1>-"V" THEN HDCPY=1ELSEHDCPV=0 
140 

150 GOSUB400 ' GET START ADDRESS 
160 PC=X 

170 PROMT*-"END"GOSUB420 GET END ADDRESS 

180 HLTADR-X 
190 GOSUB490 CHECK IT 
200 

210 PRINT 1-3:INPUT"±> CHARACTER- 2> HEX-STRING SEARCH 3> EXIT"; I IFI 
=3THEN70 

220 LINE INPUT"SEARCH STRING * "; SRCH* IFHDCPYTHENGOSUB65520 
230 PRINT PRINT"SEARCH STRING = ", IFI—2THENPRINT"HEX "; 

240 PRINT" •'"SRCH*" " 

250 PRINT"ADDRESS" 

260 IFI-2THENGOSUB870 CONVERT STRING IF HEX 

270 SLG»LEN<SRCH*>:IFSLG-0THEN G0SUB65525 GOTO210 INVALID STRING' 1 

280 BCX-1:SS-ASC <SRCH* > ' 1ST BYTE 1ST 

290 

300 SEARCH FOR STRING 

310 IFMEM=1THENX-PEEK(PC)ELSEGOSUB690 ' FETCH NEXT BYTE 
320 PC-PC+1 IFXOSSTHEN350 MATCH ? 

330 IFBCXCSLGTHEN BCX-BCX+1:SS»ASC<MID*<SRCH*>BCJO > GOTO360 C OMPARE F 
OLLOWING BYTE- IF ANV 

240 X=PC-SLG.GOSUB610:PRINT ' FOUND, PRINT ADDRESS 
350 IFBCX>1THENPC«PC-BCX+1 BCX-1 SS=ASC<SRCH*> 

360 IFPCCHLTADRTHEN310 
370 G0SUB65525 

380 PRINT"HALT ADDRESS REACHED’" GOTO70 
390 

400 GET HEX ADDRESS 
410 PROMT*-"START" 

420 SRCH*="" PPINTPROMPT*• INPUT" ADDRESS <HEX> = ",SRCH* 

430 IFLEN< SRCH* )O4THEN420 

440 GOSUB870 CONVERT TO BINARY 

450 I FLEN <. SRCH* > O2THEN420 

460 X=256*ASC<SRCH*>+ASC<MID*-!SRCH*, 2>> 

470 RETURN 
480 

490 CHECK HALT ADDRESS 

500 IF MEM-iAND HLTADR/65526• THEN HLTADR=65526’ 

510 IF MEM-2 AND HLTADR>512 THEN HLTADR-512 
520 IF MEM-2 AND HLTADR>22552 THEN HLTADR-22552 
530 RETURN 
540 

550 FETCH THE NEXT BYTE 

560 IFMEM-1THENX-PEEK v PC .* ELSEG0SUB690 

570 RETURN 

580 

590 PRINT X AS A 2-DIGIT HEX NUMBER 
600 PRINT RIGHT*'"00"+HE/» 2>; RETURN 

610 PRINT X AS A 4-DIGIT HEX NUMBER 
620 PRINTRIGHT*<"0000"+HEX*<X>, 4>> RETURN 

620 ' 

640 PRINT HEX, DECIMAL, & ASCII STRINGS 

650 PRINTTAB* 10 > GOSUB590 PRINT" " ; RI GHT * < " 0O0 "♦•MI D* ■' STP* < X >, 2 >, 3>> " 

660 IFX>32ANDXC91THENPRINTCHR*<X>; 

670 RETURN 
680 

690 FETCH BYTE FROM DISK BUFFER 

700 IFMEM-2THEN XPC-PCELSE XPC-PC+512 BOOTSTRAP S ON 1ST 4 SECTORS 
71G ADR-4+ <XPCAND127> TK*INT<XPC/4096> SC=2*< <XPC/128>AND31> IFSO30THEN 
SC-SC-31 


720 

730 GET TRACI IF NECESSARY 
740 IFTRK: -0THEN770 
750 TRK-0 SEC .*.'= 1 

760 IF'INP<8>AND64> :: 0THENWAIT8, 2, 2 0UT9-2 GOTO760 GET TRACK #0 
770 IFTRK-TKTHEN810 

780 WAITS, 2, 2 IFTRK: TKTHEN0UT9, 2 TRK-TRK 1ELSE0UT9,1 TR1=TRK+1 MOVE H 

EAD TOWARDS DESIRED TRACK 

790 SECZ—1 GOT0770 

800 GET SECTOR IF NECESSARY 

810 IFSECX-SCTHEN840ELSESEC ;.-SC ECNT-ld 

820 SEC'*-DSK I * • SECX ' TST*=DSK I » • SEC*; • READ SECTOR 

820 IFTST* :>SEC*THENECNT-ECNT 1 IFECNT: OTHENSSO ELSE G0SUB65525 PRINT"DI 

SK RE AC- ERROR" STOP 

840 X-ASC■MID*<SEC *.ADR > ; 

850 RETURN 
860 

870 CONVERT HEX STRING TO BINARY STRING 
880 J—1 S*-"" L-LEN<SRCH*> 

890 FORI-ITOL 

900 C*=MID*-SRCH*,I,1> IFC*«" "THEN950 
910 IFC*>-"0"ANDC*<*“9"THEND-ASC<C*>-ASC<"0" .• G0T0940 
920 IFC*>="A"ANDC*<="F"THEND—10+ASC<C* ASC - "A"> GOTO940 
920 S*="" 1=1. GOTO950 

94O J-CJ+1TAND1 IFJ=0THENT=DELSET-D+16*T S*=S*+CHR*-T> 

950 NEXT 

960 SRCH*—S* RETl IRN 

970 • 

988 PATCH ROUTINES 

990 GOSUB400 PC-X GET ADDRESS 

1000 PRINT PRINT"': OR X - ASCII XX = HE::. XXX = DECIMAL. RETURN = NO 
CHANGE" PRINT 

J010 IFMEM=2ANDPC>511 -OR - MEM-3ANDP023551 -THEN 380 

1020 CHNG-0 ADR-0 G0SUB560 SX-X ' FETCH BYTE 

1030 :=PC GOSUB610 PRINT" ", PRINT AC-DRESS 

1040 X—SX G0SUB650 PRINT TAB925 ' PRINT OLC- VALUE 

105O SRCH*-"" INPUTSRCH* L-LEN<SRCHi> PRINT NEW VALUE 

1060 IFL-0THEN 1140 JUMP IF NO CHANGE 

1O70 IFL-3ANDASC- SRCH*>=39THENSRCH*=MID*<SRCH*, 2, 1.- STRIP OFF QUOTES 
108O IFL-3THENIFSRC H*>="000"ANDSRCH*<="255"THENSRCH*=CHR*(VAL<SRCH* > ■ 
CONVERT DECIMAL 

109O IFL-2THENGOSUB870 CONVERT HEX 

11O0 I FLEN-. SRCH* ^ OITHENFR1 NT CHR*-7-"l BYTE AT A TIME" GOTO1O30 
1110 ' 

1120 MAKE PATCH 

1130 SX=ASCvSRCH*> IFMEM-1THENPOKEPC. SXELSEMID*<SEC*, ADR, l.'=SPCH* CHNG-1 
1140 FA=1 INPUT"PATCH 1> NEXT 2> THIS PREVIOUS BYTE 4> EXIT";FA 

IFFA :iORFA>4THEN1140 
1158 IFFA—2THEN1030 
1160 IFFA-4THENGOSUB1220:GOTO70 

1170 IFFA-1THENPC-PC+1.ADR-ADR+1ELSEPC-PC-1 ADR=ADR-1 
1180 IFMEM=1THEN1010 

1190 IFADR>—4ANDADR<—121THENGOSLIB840 SX=X GOTO103O 
1200 GOSUB1220 GOT01010 
1210 

1220 OUTPUT SECTOR IF CHANGES MADE 
1220 IFMEM-1ORCHNG-0THENRETURN 

1240 CS=0 FORADR-4T0131 CS=<CS+ASC:<MID*<SEC*, ADR> > >AND255 NEXT 
1250 MID*<SEC*, 133, 1>-CHR*'.'CS> UPDATE CHECKSUM 
1260 ECNT-10 

1270 DSKO* SEC*, SEC/i TST*=DSH*(SECX) WRITE SECTOR 

1280 IFTST*<>SEC*THEf4ECNT=ECNT-l:IFECNT>0THEN1270 ELSE G0SUB6552S PRINT- 
DISK WRITE ERROR" STOP 
1290 RETURN 

65509 

65510 SUBSTITUTE CENTRONIC PRINTER'S PORT * FOR CRT'S 

65520 IFTRMX-OANDINP< 33>-0THENTRMX-PEEK <4561> 0UT32,0.0UT34, 0 0UT33, 0 OU 
T35,255 OUT32.44 OUTS4,44 P0KE4561, 32:P0KE4562, 246 P0KE4563,0 P0KE4564 1 
94 P0KE4569, 35 

65521 RETURN 

65522 

65523 RESTORE THE CRT AS OUTPUT PORT 

65525 IFTRMX>0THENPOKE4561. TRMM P0KE4562, 230 P0KE4563, 2 P0KF4S64, 2©2 POK 
E4569, TRMX+1 OUTTRMX.3 OUTTRMX,17:OUTTRMX, 1 

65526 TRMX-0 RETURN 
OK 


Page 8 Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 

64 


FEBRUARY SHOW IN PHILLY 


News Release Received:77 Dec 28 

1978 Business and Personal Computer Sale & Exposition 
Location: City Line Holiday Inn, Philadelphia, Pa. 

Date: February 27th to March 1st, 1978 

Hours: 10:00 A.M. to 8:00 P.M. 

For further information contact: Produx 2000, Roosevelt 
Blvd and Mascher St, Philadelphia, PA 19120 (215) 722-4837 


GERMAN COMPUTER CLUB HOPES 

Received: 77 Oct 10 

“Call for interested individuals in (northern) Germany to 
form a Hobbyist Computer Club. Please contact Ilja Burkoff, 
Parkallee 105, D-28 Bremen. Tel: (0421) 34 71 79.” 


I 


V 




PAD HEP 

•hTCHES ANY BYTE IN MEMORY HR ON THE OISL COPIES OF HITS' 4 O BASIC AND 
BAS l f BOOTSTRAP. ’LOADEF 

AL 1 EARCHES THROUGH ANV OF THE ABOVE TO t.OCATE A GIVEN ASCII OR BINARY 
STRING 

1> SEARCH 2 • PATCH? 1 

l; MEMORY • BOOTSTRAP 3> BASIC? 1 

DO YOU WANT HARD COPY? N 

START ADDRESS (HEX') * ° 0000 
END Ml 'DRESS (HEX) = ? 5C00 

L fHARAC TER- 2> HEX-STRING SEARCH 3) EXIT? 2 
SEARCH STRING = DBAS 

SEARCH STRING = HEX DB0S 

ADDRESS 

2E86 

2E96 

2EFD 

2F08 

3030 

305? 

3652 

IB69 

3B8F 

"BC? 

HALT ADDRESS REACHED' 

I- SEARCH 2■ PATCH? 1 

1 ■ MEMORY 2^ BOOTSTRAP 3 ■ BASIC? 3 

DO YOU WANT HARD COPY' 1 N 

START ADDRESS (HEX- = n OOOO 
END ADDRESS (HEX> = ° 1O0O 

1 • CHARACTER- 2) HEX-STRING SEARCH 3> EXIT? 1 
SEARCH STRING = RANDOM 

SEARCH STRING = RANDOM' 

ADDRESS 

069D 

HALT ADDRESS REACHED' 

If SEARCH 2> PATCH? 2 

1) MEMORY 2> BOOTSTRAP 3) BASIC? 1 
START ADDRESS (HEX) = ? 069D 

X OR 'X' = ASCII, XX = HEX, XXX = DECIMAL, RETURN = NO CHANGE 


069 D 


52 

082 

R 

? 





PATCH 

1> 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT 0 

069E 


41 

©65 

A 

? 





PATCH 

1 • 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

*J69F 


4E 

078 

N 

? 





PATCH 

1) 

NEXT 

2) 

THIS 

3> 

PREVIOUS 

BYTE 

4) 

EXIT? 

O6A0 


44 

068 

D 

? C 





PATCH 

1> 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

06A1 


4F 

079 

O 

? I 





PATCH 

1) 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 

06A2 


4D 

077 

M 

? D 





PATCH 

1> 

NEXT 

2> 

THIS 

3) 

PREVIOUS 

BYTE 

4> 

EXIT? 

1> SEARCH 2) 

PATCH 0 2 






1) MEMORY 2) 

BOOTSTRAP 

3) 

BASIC? 1 




START 

ADDRESS 

(HEX > 

■ ? 

2E86 





X OR 

X' 

= ASCII, 

XX = 

HEX. 

XXX = DECIMAL- 

RETURN = N 

2E86 


DB 

219 


? D3 




PATCH 

1> 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4> 

EXIT? 

2ES7 


08 

008 


? 09 




PATCH 

1) 

NEXT 

2) 

THIS 

3) 

PREVIOUS 

BYTE 

4) 

EXIT? 




Number 22 


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


Page 9 




65 

















A Simple Technique for Static Relocation of 
Absolute Machine Code 


BY GARY AKILDALL 

Digital Research 
Pacific Grove, CA 93950 

One principal difficulty with newly evolving computer 
technology is that software generation tools generally lag 
corresponding hardware facilities, thus forcing the software 
engineer to resort to outmoded techniques to produce soft¬ 
ware systems. 

The purpose here is to present one area of difficulty—that 
of a static program relocation—and to offer a simple solution 
which can be applied to nearly any microcomputer software 
environment where relocation is not supported by the manu¬ 
facturer. 

The need for static relocation arises most often in a situa¬ 
tion where the software systems must be reconfigured in the 
field. For example, data entry equipment manufacturers often 
provide a range of optional peripherals which can be attached 
to user’s equipment as processing requirements change. Each 
peripheral usually requires a software “driver” which is device¬ 
specific, and interfaces the device to the operation environ¬ 
ment. 

A common approach to software reconfiguration is to 
arrange the individual translated peripheral drivers into distinct 
machine code modules which can be selectively brought 
together to form an integral system at the customer site. 
In order to perform the field reconfiguration, each module is 
translated so that it originates at location 0 in memory and, 
when it is brought together with other modules, it is placed 
at the next available memory location as the system is being 
constructed. All machine code elements which are location 
dependent must, of course, be altered to reflect the actual 
locations that the driver occupies. Generally, the elements 
which are affected are the addresses of branch destinations 
and data addresses. If the locations of the affected addresses 
in each module are known ahead of the system reconfigura¬ 
tion, the module can be placed anywhere in the final memory 
image. 

Simple Static Relocation 

The process of constructing an executable memory image 
from a set of relocatable modules, as described above, is 
called static relocation. Unfortunately, very few microcom¬ 
puter manufacturers produce the address information with 
their translator output which is required for the relocation 
process. The method described below, however, can be applied 
to the output of most manufacturers’ absolute translators to 
derive the necessary relocation information. In order to be 
specific, the Intel 8080 microcomputer is used in the 
discussion with the understanding that the concepts can be 
easily extended to differing architectures. 

The Intel 8080 microcomputer has a 64K (65536 bytes) 
memory space which can be thought of as 256 “pages” of 256 

Page 10 

66 


bytes per page. Data and instructions are intermixed in this 
memory space, and are addressed with a 16-bit address 
operand which can be divided into an 8-bit (high-order) page 
address (0-255), and an 8-bit (low-order) address within a 
page. Typical 8080 instructions which can use these address 
operands are shown in Figure 1, where PA denotes the page 
address, and AWP denotes the address within a page. In 
general, a machine code memory image consists of instruc¬ 
tions, instruction addresses, and data items. The instructions 
and data items are independent of the actual location at 
which the module finally resides. Further, only a subset of the 
instruction addresses are dependent upon the module location. 
That is, a load instruction may reference a buffer address 
which is fixed outside the relocatable module, in which case it 
does not change when the module is moved into position. If 
the address references a branch location or data item within 
the module, then the value of PA, AWP, or both, must be 
biased by fixed values, dependent upon the final position of 
the module in the resulting configuration. 


MVI A, 

PA 

Move immediate to A 

MVI C, 

AWP 

Move immediate to C 

LXI D, 

AWP 

PA 

Load DE with address 
Jump to address 

JMP 

AWP 

PA 


Figure 1. Typical 8080 Instructions 

A simpler form of relocation, called “page boundary 
relocation,” is usually sufficient for field reconfiguration. 
In this case, the module is relocated to a page boundary 
so that only the page address (PA) need be changed to perform 
the relocation, since the address within a page (AWP) remains 
constant. 

Page Boundary Relocation 

In its simplest form, page boundary relocation can be 
accomplished by constructing two parallel memory images 
for each module. The first, called the “relative-0” image is 
created by translating the module for execution at location 0. 
The second, called the “relative-1” image is produced by 
translating the module for execution at page 1 (address 256). 
The relative-0 and relative-1 memory images can then be 
compared to determine the high-order address elements which 
must change when the module is moved to its final page 
boundary location. Figures 2a and 2b show a simple program 
segment assembled as relative-0 and relative-1 images. The 
differences in the machine code images are circled, and are 
thus the high-order addresses which must be biased when the 
module is moved. Figure 2c shows the same program segment 
assembled at page 5. Note that if the circled address fields in 
the ralative-0 image are biased by an amount 5 (corresponding 
to page boundary 5), they result in the proper values for the 
relocated program. 


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


Number 22 


0000 


org 

OOOh 

.'relative 0 assembly; 

| jnn|aaaa 

|tt|dld2. . .dn|cc | 

OOOO 

3E00 

start : mvi 

a,d1 

shr8 page address to a 



0002 

OEOA 

mvi 

c.dl and Offh .address in page 

nn 

— record length 01 - FF 

0004 

110A00 

lx i 

d,d1 

;full address to d, e 

aaaa 

load address 0000-FFFF 

0007 

C30000 

jmp 

start 


tt 

— record type = 00 



; data area 



dl 

— data byte 1 

000A 


dl: ds 

2 

;two unfilled 

d2 

— data byte 2 

OOOC 

00 

db 

0 

;one filled element 



000D 


end 



dn 

— data byte nn 



Relative-0 



cc 

— checksum byte 



Hex 

File: 



JOA|OO0qoq3EOOOEOAllOAOOC3OOO0tC2 


Figure 3. Hex File Format 


dOlJOOOQ 


PQOOF3 


odooododoo 

Figure 2a. Relative-0 Assembly 


0100 



org 

100h 

.•relative 1 assembly 

0100 

3E01 

start: 

mvi 

a,d1 shr 8 page address to a 

0102 

OEOA 


mvi 

c,d1 and Offh;address in page 

0104 

110A01 


ixi 

d,d1 

;full address to d,e 

0107 

C30001 


jmp 

start 





data area 



01OA 


dl: 

ds 

2 

;two unfilled 

01OC 

00 


db 

0 

;one filled element 

010D 



end 





Relative-1 

Hex 

File: 


0A1010O00I3E010E0A110A01C30001JBE 


ON 


oiod 


00I00F2 


odooododoo 

Figure 2b. Relative-1 Assembly 


0500 



org 

500h 

;assembly at page 5 

0500 

3E05 

start: 

mvi 

a,d1 shr 8 page address t 

0502 

OEOA 


mvi 

c,d1 and Offh;address in p; 

0504 

110A05 


Ixi 

d.dl 

;full address to d,e 

0507 

C30005 


jmp 

start 




’ 

data area 





dl: 

ds 

2 

;two unfilled 

050C 

00 


db 

0 

;one filled element 

050D 



end 




An absolute loader reads each record of the hex file, and 
loads the byte values at the load address specified by LA for 
the next RL bytes, as shown in the algorithm of Figure 4. The 
notation used in this algorithm is that of Knuth [Kn.], where 
each step is labeled with a step name (Al. . . A16), followed 
by a comment describing the action of the step. The action 
itself is a series of assignments of expressions to variables, and 
conditional control transfers. The algorithm begins at step Al, 
and scans for the beginning colon for each record. When 
found, the algorithm reads the record length and, if zero, 
terminates the load operation. If the recrod length is not zero, 
the load address is read followed by the record type (which 
should be zero). The algorithm then loops between steps A6 
and A12, reading successive bytes to memory while computing 
the checksum. When the entire record has been loaded, the 
final checksum byte is added, which should result in a zero 
value. Upon completion of the algorithm of Figure 4, the 
entire hex file has been read and loaded to an absolute loca¬ 
tion in memory. 

The algorithm of Figure 5 is a simple extension of the pre¬ 
vious absolute loader, which reads two successive hex files. 
The first hex file is the relative-0 machine code, produced by 
translating the module for execution at location 0. The second 
hex file is the relative-1 machine code, resulting from the 
module translation when originated at location 256 (100 in 
hexadecimal). The first part of the algorithm, given by steps 
Al through A16 is similar to that of Figure 4, except that the 
data is loaded to address LA+PG*256 which effectively 
moves the module to the page boundary given by PG rather 
than absolute address LA. 


0A)0500)00I3E050E0A110A05C30005|AE 

OTO5OCO0OOEE 

dooloooobaoo 

Figure 2c. Assembly at Page 5 


The program which actually performs the relocation 
process is a simple modification of an absolute loader. The 
translator output for an 8080 microcomputer is a “hex 
format” file, containing a sequence of absolute records which 
give a load address and byte values to be stored starting at 
the load address. The exact format of each record, shown in 
Figure 3, begins with a colon (:) followed immediately by 
a two digit record length (RL) and 4-digit load address (LA). 
The 2-digit record type (RT) is always zero for absolute 
records, and is followed by RL pairs of hexadecimal digits to 
be placed at LA through LA+RL—1 in memory. The record 
terminates with a pair of checksum digits: if the byte values 
(hexadecimal digit pairs) are summed, starting immediately 
after the colon, and, continuing through the end of the record, 
including the checksum byte, then the sum should be zero 
when computed with an 8-bit counter. The checksum byte 
is included as an error detection mechanism. The last record 
of a hex file is denoted by a record length of 00. 


Note: nextchar reads the next ASCII character 
nextbyte reads the next pair of digits 
nextaddr reads the next pair of bytes 
CS is the checksum accumulator (8-bits) 
R L is the record length (8-bits) 

LA is the load address (16-bits) 

M[x] is memory location x (8-bits) 


Al 

[scan for :] 

if nextchar 4 go to Al 

A2 

[set checksum] 

CS : = 0 

A3 

[get length] 

R L : = nextbyte 

A4 

[last record?] 

if RL = 0 go to A16 

A5 

[set address] 

LA : = nextaddr 

A6 

[set type] 

RT : = nextbyte 

A7 

[load bytes] 

if RL = 0 go to Al3 

A8 

[get byte] 

b : = nextbyte 

A9 

[store byte] 

M [LA] : = b 

Al 0 

[checksum] 

CS : = CS + b 

All 

[next addr] 

LA : = LA + 1 

Al 2 [count length] 

RL : = RL - 1,go to A7 

A13 [checksum] 

CS : = CS + nextbyte 

A14 [total ok? ] 

if CS = 0 go to Al 

A15 [check error] 

halt, "checksum error" 

A16 [normal end] 

halt, "tape read ok" 


Figure 4. Absolute Loader Algorithm 


Number 22 


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


Page 11 

67 






Upon reaching step A16, the module has been loaded into 
memory at page PG but is translated for execution at loca¬ 
tion 0 and thus would (most likely) execute improperly, since 
the high order branch and data addresses must be biased by an 
amount PG. Thus, steps R1 through R19 read the relative-1 
hex file to determine the addresses which must change. These 
steps are similar to A1 through A16, except the input data is 
compared with memory for differences, rather than actually 
placed in memory. In step R5, the load address is read as 
before but, since the relative -1 machine code is biased by one 
page, the effective address must be reduced by 256 bytes. 
Step R9 compared the data loaded in the first phase with the 
data read in the second phase: if the data is the same, then the 
element is invariant in the relocation process. If the data dif¬ 
fers, then it must have been due to the difference in the 
relative-0 and the relative-1 memory images. Further, this 
difference must be exactly 1 since differences occur only in 
the high-order address fields; otherwise an error occurs, and 
the module cannot be relocated. When a relocatable element 
is found, the original value loaded and relocated in phase 1 
must be biased by an amount PG in step R11. Upon comple¬ 
tion of the second phase, the algorithm halts at step R19 with 
the high order addresses altered by the proper amount in the 
relocated module. Note that the algorithm given in Figure 5, 
when applied to the relative-0 file of Figure 2a, followed by 
the relative-1 file of Figure 2b, produces the relocated 
machine code of Figure 2c, when page boundaiy PG=5 is 
used. 


Note: nextchar, nextbyte, nextaddr, 

CS, RL, LA, and M are identical to 
Figure 4. PG is the page number 
where the relocated module will reside. 

A1 [scan for:] if nextchar+ go to A1 


A2 [set checksum] 

CS 

- 0 

A3 [get length] 

RL 

= nextbyte 

A4 [last record?] 

if RL 

= 0 go to A16 

A5 [set address] 

LA 

= nextaddr 

A6 [set type] 

RT 

= nextbyte 

A7 [load bytes] 

if RL 

= 0 go to A13 

A8 [get byte] 

b 

= nextbyte 

A9 [store byte] 

M [LA + PG * 256] :=b 

A10 [checksum] 

CS 

= CS + b 

All [nextaddr] 

LA 

= LA + 1 

A12 [count length] 

RL 

= R L — 1, go to A7 

A13 [checksum] 

CS 

= CS + nextbyte 

A14 [total ok? ] 

if CS 

= 0 go to A1 

A15 [check error] 

halt, 

'checksum error" 

A16 [end rel -0] 

go to Rl 

Rl [scan for :] 

if nextchar + ":" go to R1 

R2 [set checksum] 

CS 

= 0 

R3 [get length] 

RL 

= nextbyte 

R4 [last record?] 

if RL 

= 0 go to R19 

R5 [set address] 

LA 

= nextaddr + 256 x (PG 

R6 [set type] 

RT 

= nextbyte 

R7 [record done?] 

if RL 

= 0 go to R15 

R8 [compare data] 

b 

= nextbyte 

R9 [data same?] 

if b = 

M [LA] goto R12 

RIO [page diff 1?] 

if b + M [LA] + 1 go to R18 

R11 [relocate] 

M [LA] : = M [LA] + PG 

R12 [checksum] 

CS 

= CS + b 

R13 [next address] 

LA 

= LA + 1 

R14 [count length] 

RL 

= RL — 1, go to R7 

R15 [checksum] 

CS 

= CS + nextbyte 

R16 [total ok?] 

if CS 

= 0 go to Rl 

R17 [check error] 

halt, 

'checksum error" 

R18 [reloc error] 

halt. 

'relocation error" 

R19 [end rel -1 ] 

halt. 

'relocation done" 


Figure 5. Relocating Loader Algorithm 


The algorithm of Figure 5 can be easily translated to an 
appropriate assembly or high-level language program to 
perform this relocation process. 

The processing of Figure 5 can be used to produce a more 
compact form of the relocatable module by building a “bit 
vector” which tabulates the addresses which require relocation, 
rather than actually performing the relocation process. That is, 
in step R11 the address LA must be biased by an amount PG 
for proper execution when the module originates at address 
PG*256. Thus, on the first pass, the data can be read to 
memory and, upon completion of the pass, a bit vector is 
constructed which has one bit position for each address within 
the module. Before starting step Rl, the entire bit vector is 
zeroed to indicate that no addresses require relocation. As the 
second phase processing proceeds, each relocation address 
determined in step Rl 1 can be “marked” by setting the cor¬ 
responding position of the bit vector. Upon completion of the 
algorithm, the bit vector contains zeroes in the positions cor¬ 
responding to addresses which are invariant over the relocation, 
and ones in the positions which require biasing by an amount 
PG. The entire relocatable module can then be saved for later 
static relocation. 

Given that the relative-0 memory image has been saved 
along with the relocation bit vector, the page boundary 
relocation can be simply accomplished by reading the memory 
image to its relocated page address PG. The bit vector is then 
read and processed: for each bit position which is set, the 
value PG must be added to the corresponding element which 
was previously loaded. Note that this extension to the basic 
algorithm of Figure 5 is included only for compact represen¬ 
tation, and produces exactly the same memory image as the 
original algorithm. 

A Case In Point 

The following situation shows a case where page boundary 
relocation is useful. The CP/M operating system [Ki] is a 
simple small computer diskette based software system, which 
implements a file management and program loading facility for 
microcomputer development. The operating system is arranged 
as a set of modules which are loaded into memory when the 
computer system is started. User programs are then loaded 
into memory from the diskette and, because of memory con¬ 
straints, must overlay non-essential portions of the CP/M sys¬ 
tem to reclaim storage for program and data areas. In order to 
allow these areas of memory to be reclaimed, the CP/M system 
is loaded into the high addresses of the memory space, and the 
user programs are loaded into the low addresses. Thus, the user 
programs can overlay the high addresses of memory when 
necessary and, upon completion, cause the CP/M system to 
be brought back from the diskette for the next operation. 

Given that relocation is not supported by the manufacturer, 
this memory organization presents a fundamental difficulty: 
each CP/M operating system must be tied directly to the 
memory size. If the user of CP/M owns a computer system 
with 16K bytes of memory then a 16K version of CP/M must 
be supplied. If the user adds memory to enhance system 
capabilities, a different version of CP/M must be supplied to 
support the larger memory space. 

In order to overcome this difficulty, the CP/M system can 
be reconfigured in the field to accomodate the increased mem¬ 
ory using the page boundary relocation technique described 
above. In particular, each user receives a 16K version of CP/M 
(the smallest amount of memory which is useful for CP/M 
operation), along with a program which implements the recon¬ 
figuration. The user may optionally execute the program 
which rebuilds the CP/M system, according to the existing 
memory size, and places the relocated memory image back on 
the diskette, ready for subsequent loading. 


Page 12 

68 


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


Number 22 




FASTER DATA ENTRY FOR SC/MP 



The CP/M debugger program, called the Dynamic 
Debugging Tool (DDT), also resides in the upper portions of 
memory so that it can co-exist with the programs under test. 
Again, the area in which DDT is loaded depends upon the 
current memory configuration, and thus page boundary 
relocation is performed each time the DDT program is brought 
into memory. The increased elapsed time for relocation of 
DDT is negligible when compared to an absolute load, as long 
as the bit vector technique of the previous section is used. 

Restrictions 

It should be noted that the technique described here is 
by no means a complete linking loader: no address resolution 
is provided between modules, and no load-time address 
arithmetic is allowed. Sets of modules which co-exist in 
an integral system must communicate through instruction 
and data addresses. Using the technique presented here, the 
communication must be performed through dedicated 
absolute addresses for data items. Further, instruction addresses 
must be established through a “root module” which contains 
a jump vector with vector elements for each possible module 
which could be configured in a final system. 

Address arithmetic is often useful when combining modules. 
In the simple page boundary relocation described above, 
all address arithmetic must be performed at assembly or 
compile time, and must consist only of simple operations 
which involve a fixed positive or negative offset from a base 
address, or a shift or logical and operation which extracts the 
8-bit page address of a full 16-bit address. A relocation 
error will occur, for example, if an 8-bit immediate operand 
instruction is obtained from a 7-bit right shift rather than an 
8-bit right shift of an address quantity. 

In spite of these shortcomings, the technique has particular 
advantages in being independent of a manufacturer’s capa¬ 
bilities, whims, and fancies. All language processors must 
eventually produce an absolute memory image for execution 
on the target machine, and thus the relocation process 
presented here will continue to operate when new software 
tools are introduced. 

Acknowledgements 

The author would like to point out that the techniques 
presented here, although useful, are most likely not original 
or particularly inventive. In fact, at least one individual, 
Bruce VanNatta of IMS Associates, San Leandro, California, 
has independently applied the methods to produce relocatable 
PL/M programs. There are most certainly many other software 
designers who have approached the relocation problem in a 
similar fashion. 

References 

Kildall, G., Microcomputer Software Design: A Checkpoint. 
Proceedings of the Fall Joint Computer Conference, 1975. 

Knuth, D., The Art of Computer Programming. Volume I: Funda¬ 
mental Algorithms. Addison-Wesley, Reading, MA, 1975. 


Dear Dr. Dobbs, Received: 78 Jan IB 

Using the SC/MP kit (actually it is called Introkit this side 
of the Big Lake) with the keyboard addition I often cursed the 
program entry method as being somewhat slow. You have to 
press MEM, TERM, then enter your data, and finally press 
TERM again. That makes 5 keystrokes per byte where most 
systems only use 3, i.e. two for the hex digits and one carriage 
return. The enclosed program should solve this problem. All 
should be self-explanatory except for a few details: 

1. The initial data display is always 00, the following (after 
first TERM) shows true data read from memory. 

2. Assembler syntax is not standard but from a home¬ 
brewed ‘cross’ on an HP 9825A. The main difference is in 
hex notation — I use xxH where National uses X’ or leading 
zero. 

3. The program is relocatable as only PC-relative jumps are 
used (besides using SCMPKB which is assumed to start in 
0000 ). 

Best of all, 

Erik Skovgaard 
Nordlundsvej 10 
DK-2650 Hvidovre 
DENMARK 

***** FSTKEY SCMPKB FAST DATA ENTRY ROUTINE ***** 


$$$$ Track 1 File # 6 


1 

2 

3 

4 

5 

e 

7 

8 


ROUTINE FOP FAST ENTRY OF 
PROGRAMS USING SCMPKB SYSTEM 
JUST KEY IN BYTE AND PRESS TERM 
ADDRESS IS THEN AUTO INCREMENTED 
AFTER STOPINC THE BYTE. 

ABOFT KEY RETURNS CONTROL TO SCMPKB 
PROCRAM ENTRY ADDR IS CIVEN IN LOC 
CF15 (UPPER) AND 0F16 (LOWER) 


9 


10 

0F30 

C4 OF 


LDI 0FH 

;P2=0F00 

11 

OF 32 

36 


XPAH P2 


12 

OF 33 

C400 


LDI 0 


13 

OF 35 

32 


XPAL P2 


14 

OF 36 

C21 5 


LD 15H (2) 

;GET ADDRESS 

15 

OF 38 

CA0E 


ST 0EH (2) 


16 

OF 3A 

C216 


LD 16H(2) 


17 

0F3C 

CA0C 


ST 0CH(2) 


IP 

OF 3E 

C400 


LDI 0 

;CLEAR DATA 

19 

0F4 0 

CA0D 


SI CDH(2) 


20 

0F42 

900B 


JMP "GODIS" 


21 

OF 44 

C20D 

NUM: 

LD 0DH(2) 


22 

0F4 6 

IE 


RR 

;SHIFT DIGIT 

23 

0F47 

IE 


RR 


24 

OF 48 

IE 


RR 


25 

0F4 9 

IE 


RR 


26 

0F4A 

D4F0 


AN I F OH 

;AND APPEND 

27 

OF 4C 

58 


ORE 

;NEW DIGIT 

28 

0F4D 

CA0D 


ST 0DH (2) 

;SAVE RESULT 

29 

0F4F 

C401 

GODIS: 

LDI 1 


30 

OF 51 

37 


XPAH P3 

;P3*D1SP ROUTINE 

31 

OF 52 

C43F 


LDI 3FH 


32 

0F54 

33 


XPAL P3 


33 

0F55 

3F 


XPPC P 3 

;DISPLAY 

34 

0F56 

9 00 2 


JMP "CMD" 

;COMMAND RETURN 

35 

0F58 

9 0EA 


JMP "NUM" 

; NUMBER RETURN 

36 






37 




;COMMAND 

PROCESSING 

38 




;ANY CMD 

EXCEPT ABT IS OK. 

39 






40 

OF 5A 

C20E 

CMD: 

LD 0EH(2) 

;P3«NEW ADDR 

41 

0F5C 

37 


XPAH P3 


42 

OF 5D 

C20C 


LD 0CH(2) 


43 

0F5F 

33 


XPAL P3 


44 

0F60 

C2CD 


LD 0DH(2) 


45 

0F62 

CF01 


ST @1(3) 

;STORE BYTE, INCR 

46 

0F6 4 

C30 0 


LD 0(3) 

;READ NEXT BYTE 

47 

0F66 

CA0D 


ST 0DH (2) 


48 

0F68 

37 


XPAH P 3 

;STORE NEW ADDR 

49 

0F69 

CA0E 


ST 0EH(2) 


50 

0 F6B 

33 


XPAL P3 


51 

0F6C 

CA0C 


ST 0CH(2) 


52 

0F6E 

90DF 


JMP "GODIS" 

;DISP NEW VALUES 


NUM - 0F44 
GODIS = 0F4F 
CMD = 0F5A 


Number 22 


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


Page 13 


69 






Relocation Is Not Just Moving Programs 


BY RICHARD L. ROTH 

5 North Salem Rd. 

Ridgefield, CA 06877 
(203)438-3954 
© RLR 1977 

Once you start writing assembly language programs you will 
find every program requires certain functions. Some functions 
are so common, such as getting a character from the console 
terminal, that you can build them into a system monitor. This 
monitor can be put in PROM or loaded when you turn your 
machine on. But the large majority of common functions are 
only used for a class of programs. It’s wasteful to always have 
them around so you only have them in memory when you 
need them. During the stage of small programs and hand 
assembling, each time you want any of the common functions 
you must move it to the appropriate place and you must 
‘relocate’ all absolute addresses, usually jumps and data. But 
as programs get bigger and as the number and kind of common 
modules grow, it behooves one to let the'computer do the busy 
work of moving those modules. At the low level, if you separ¬ 
ate your code from data, you might find a relocator that can 
move absolute code-fine for a 10 or 256 byte program. Not 
so fine for 4000 bytes, esp., since you must watch carefully to 
see if all the constants that look like addresses are not 
changed. The next step up is to have an assembler do the dirty 
work and start each program with a common set of routines, 
in source. At around 6-8K of program code, even this becomes 
unmanageable since just handling a source file that is 60K or 
1000K can take 15 minutes just to read it off a floppy disk. 
Keeping track of a program becomes harder and harder as it 
gets bigger, a 2K program can have a 30 page listing if it’s 
well commented. The final answer is to produce an intermed¬ 
iate phase where the computer has converted all the code to 
internal form, i.e., the machine instructions are directly in hex 
or octal, but is still keeping track of jumps and other location 
dependent information. 

Relocation Schemes 

There are two general categories of relocation information: 
dynamic and static. Dynamic relocation refers to information 
still present at run-time which allows code to be moved. The 
relative jump that the Z-80, 6800 and 6502, as well as most 
large computers have is a good example. It runs the same no 
matter where it is in memory. Minicomputers like the PDP-11 
and NOVA have enough relative-type instructions that proper¬ 
ly written code can almost be moved between instructions and 
still run properly. Large computers use a base register which 
points to the start of the program and do all addressing relative 
to that. Unfortunately, most micro’s either are not this flexible 
or require very careful, expensive coding to do so. 
to keep the relocation information around until all the 
modules can be put together to form a final program. But in 
forming the final program, all addresses are resolved into ab¬ 
solute addresses. 

A Little Linking With Your Loader? 

The two things an advanced assembler/linker scheme must 
do are: move the code to the proper memory position, (reloca¬ 
tion) and allow modules to call each other by name, (linking). 
A primitive form of linking is done in most large absolute 

Page 14 


programs by providing branch vectors. By previous agreement, 
a set of jumps are set-up directly after each other, each jump 
going to some internal module start. So if a program knows 
where the jump vector is, it can get to any specific routine. A 
full linking loader actually keeps the symbolic name assigned 
to the routine or data location, and matches it with the 
module that references the name as an externally defined 
symbol. Some machines (such as 6502 and 6800) have a 
special section of memory treated differently, called page 
zero or base page. A good linker should help the programmer 
manage page zero, as usually it’s limited to 256 bytes or so, 
but is very important. 

The Process 

The final process consists of two or three steps. Each 
module is assembled into a ‘relocatable object’ module. Then 
all the object modules are combined by the linker into a single 
object module, which is still relocatable. Finally the loader 
converts the relocatable module into an executable load 
module. Very often the process is simplified by combining the 
linking and loading, so one program takes all the separate relo¬ 
catable object modules and produces an executable load 
module. 

In addition to the general simplification in managing smal¬ 
ler modules and the ability to just keep object modules for 
common functions, a whole new capability enters the picture. 
Any program which generates a similar object module can be 
accepted by the linker/loader. This means FORTRAN, 
Assembler, even BASIC modules can be combined into one 
program, providing the object form is correct. (NOTE-most 
BASIC’s in use today do not fit this scheme because they do 
not actually generate machine code. But if the BASIC inter¬ 
preter has a simplified loader built-in, it can use those other 
modules.) 


With Reference to a Relocatable Object Format 

I have now reviewed a dozen or so relocatable formats, in 
addition to implementing my own for a number of machines. 
Of those specifically for microcomputers, there are two roads 
of thought: binary and ASCII. The binary direction tends to 
be one of storage optimization, to the extreme of a pure bit 
stream. The ASCII direction relates to interchangeability and 
manageability, as ASCII is generally easier to move and 
manage than binary. This is partially due to the human read¬ 
ability. For 8080/Z-80 processors, the INTEL absolute hex 
format is often the starting point for building a full format. 

When I started writing my relocatable, linking assembler 
in early 1977, I reviewed all the available formats and decided 
on the ASCII direction because of manageability. As 1 devel¬ 
oped the scheme, I kept building with a key goal being human 
interaction. My format can be directly read, once the basic 
rules are learned. 

My orientation is 8080 byte machines with disk level cap¬ 
ability. Common address is a 16-bit value. 8-bit values gener¬ 
ally occur as parameters that may be handled on the source 
level by ‘Including’ a parameter file at assembly time. Module 
linkage is handled by allowing externals between modules. 
Again, 16-bit values are sufficient. It is occasionally desirable 
to add or subtract an offset from an external or do arithmetic 
with externals. However, most often these practices lead to 


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


Number 22 


70 



bad programs so 1 decided not to allow other than simple 
references. 

As I developed my capabilities, simple relocation was not 
enough. I needed the capability to separate code and data 
into separate segments, to ease writing PROM-able software. 
Hence to the normal relocatable segment (ROG), I added a 
RAM segment. At the same time, I added further capability 
to handle FORTRAN-like common blocks. 

With the assembler and linker as usable tools, I built up a 
library of often used functions. The most useful is a module 
that allows character I/O to be done with disk, console, print¬ 
er, reader, or punch. My selection of an ASCII format greatly 
simplified this library development. As to building a library, 
all that has to be done is to concatenate the appropriate 
individual modules into one file. 


RLR Relocatable Object Format Specification 
Rev 1.0 


Version 1.1 12/1/77 

This is the specification of a relocatable object format for 
micro-processors. It is copyright (RLR 1977), but released for 
general use providing that acknowledgement is made to the 
source and any modifications are specified and returned to the 
source for comment. 

RLR Standard Relocatable ASCII Format 

a) The ‘Assembler’ or ‘Compiler’ produces an ‘Object’ module 
of ASCII records. 

b) If the module contains relocating and/or linking informa¬ 
tion, it is a ‘Relocatable object’ module. 

c) The ‘Linking Loader’ produces an ASCII ‘Object’ module 
or a binary ‘Load’ module. 

d) An ‘Entry’ symbol is a symbol defined locally and known 
to other programs (alias public or internal symbol). 

e) An ‘External’ symbol is a symbol used locally, but defined 
in another program. 

0 A ‘Local’ symbol is only known within a program. 

g) An ‘Object’ module consists strictly of ASCII characters; 
parity may be supplied. Each record begins with a delimiter 
and ends with a return and line feed. The delimiter is 
*=’ (3DH), although data records of absolute data may 
begin with the Intel delimiter ‘: ’ (3AH). Numeric informa¬ 
tion is presented as hexidecimal ASCII with optional encod¬ 
ing. Once the encoding is removed, hex digits (0.. 9, A.. F) 
will remain. The encoding is used to specify relocatability 
or externality. 

h) A ‘Symbol’ is up to 6 printable characters, excluding ‘ * ’. 
Symbols with a length of less than 6 are right filled with 
‘ * ’. The system may recognize certain special symbols: 

‘STACK’ — top of program stack 

‘MEMORY’ — first location of free memory. 

‘ ? ’ — Blank common (for FORTRAN) 

i) All relocation is of 16-bit values, although optional formats 
provide use of high or low byte only. Relocation is handled 
by declaring program or data ‘Segments.’ A segment is an 
independently locatable section of data or code. Three 
standard segments are provided: ROG (for normal use or 
code), RAM (for data) or COM (for common data blocks, 
per FORTRAN). ROG and RAM segments are handled 
similarly as independent sections. COM is mapped so that 
all COM symbols in different modules refer to the same 
block of memory. Each segment allows for 64K addressabil¬ 
ity, unless an optional format is specified. 

j) ‘Mode encoded ASCII’ is used to indicate relocatability or 
externality of data. All encoded data are 16-bit values, 
most significant byte first. The first character is encoded 


based on the meaning of the data, the remaining 3 charac¬ 
ters are hex ASCII. All encoded data is converted into 
16-bit data by resolving the relocation or other meaning 
and then output as 2 absolute data bytes. If appropriate 
(i.e., 8080/Z-80 type processors) then data is output least 
significant byte first. If an optional format is specified, 
encoding may indicate only the high or low byte is to be 
output. Normally, a direct mapping may be made from 
2 bytes of input data, to 2 bytes of output data, 

k) An ‘Object file’ is a file consisting of one or more object 
modules. 


Record Formats 


character 


0 

1 . .2 
3. .6 
7. .8 
9.. N — 2 
N-1..N 

Record length: 

Normally contains number of data bytes in record. This 
implies length*2 characters of data. Symbols records specify 
length as number of symbols. Any record with length of zero 
is recognized as end of module record, regardless of record 
type. 

Record type: 

0 data record 

1 symbol record or end of file record 

2 name record 

3 library mark 

4 option record 

5 data count record 

6 fix-up record 
Checksum: 

The checksum is a total of all numeric data bytes in the 
record. Symbols are not added nor is the encoding informa¬ 
tion. The checksum number is the negative of the 8-bit total 
of all data bytes, discarding any carry. So that if all data 
including the checksum are added, the overall total should be 
zero. This is the standard Intel checksum. 


meaning 

record mark (‘: ’ or ‘ = ’) 

record length (0 if eof record) 

load address (may be mode encoded) 

record type 

data 

checksum 


Specific Record Types 

Data Record (type 0) 

0 ‘: * or ‘ = ’ 

1. . 2 record length (data bytes) if 0, eof record with 
load address meaning starting adr. 

3.. 6 load address, (MSBy first) can be mode encoded, 
relocatable 

7. . 8 ‘00’ (record type) 

9. . (8+len*2) data, can be mode encoded. Mode encoded 
data never folds over record boundary 
(9+2*len).. (10+2*len) checksum 

Symbol record (type 1) 

0 

1. . 2 number of symbols 

3. . 8 ‘000001’load adr & record type 

9. . (8+12*len) symbol entries (number specified) 

(9+12*len).. (10+12*len) checksum 

Each symbol entry is 12 characters: 

0. . 5 name (6 characters, right filled with ‘ * ’) 
6. . 9 value (LSBy first, absolute hex) 

10. . 11 type (absolute hex) 


Number 22 


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


Page 15 


71 



Symbol type bit assignment: 

(lsb) 

0 

mode (0-absolute, 1-relocatable) 

1 

defined (1—true) 

2. . 3 

scope (00B—local, IB—entry, 

10B—external, 1 IB—common) 

4 

equivalance (defined via EQU in asm 
program) 

5.. 6 

segment (00B—ROG, 0IB—COM, 

1 IB, system) 

7 

(msb) 

undefined 


Value’s meaning depends on symbol scope. If external, then 
the value is a serial number of the external. Serial numbers 
start at zero (0). This will be referenced when a data item is 
encloded as external. If common, then the value is the length 
of the common block which the symbol defines. Otherwise, 
local or entry, the value is the relative address of the symbol 
within the appropriate segment. 

Standard type bit settings: ([ ] indicates optional values) 
absolute symbol: [entry scope] + [equate] + [defined] 
relocatable symbol: [entry scope] + segment + relocatable 
+ [equate] +defined 
external symbol: external scope 
common symbol: common scope + defined 
Name Record (type 2) 

0. .2 ‘=04’ 

3. . 6 size of ROG segment (MSBy first, absolute hex) 

7.. 8 ‘02’ (record type) 

9. . 14 module name (right filled with ‘ * ’) 

15. .18 size of RAM segment 
19. .22 size of COM segment 
23. .24 checksum 

Module name is used for identification and selective load 
processing. If an unnamed module is selectively loaded or dup¬ 
licate names exist, the loader should indicate a state of 
confusion. 

Library Mark (type 3) 

0 . .2 ‘= 01 ’ 

3.. 6 function 

7.. 8 ‘03’ (record type) 

9. . 10 checksum 

The function indicates that all modules to follow in the 
current file are either to be forced loaded or selectively loaded. 
The loader starts loading a file in forced load mode. If 
switched to selective load mode, only modules that fill 
unresolved externals will be loaded. However, as the module 
name is used to catalog modules to be loaded, no duplicate 
module name must exist for any module that is considered 
for selective loading. The same file can switch between forced 
and selective load. 

Image Record Examples 

data: 

=NNAA AA00 < DD* > CK < CR/LF > 

N—number of data bytes 
A—load address 
D—data 
symbol: 

=NN000001 < SSSSSSWWTT*N > CK < CR/LF > 
N-number of symbols 
S-symbol name 
V—symbol value 
T-symbol type 


name: 

=04RRRR02NNNNNNSSSSCCCCCK 
R—ROG size 
N—name 
S—RAM size 
C—COM size 
library mark: 

=01000L03CK 

L—1 = selective load on 
0 = selective load off 
there are only 2 possibilities: 

=01000003FC -off 
=01000103FB -on 

Mode Encoded ASCII 

Mode encoded ASCII is a schema for using the rest of the 
information storage capacity of an ASCII character while stor¬ 
ing hexidecimal information. Normal hex coding uses ‘O’.. ‘9’, 
‘A’. . ‘F’ to represent the 16 hex digits. By selecting other 
character ranges of 16 characters, each range can be defined to 
have a specific meaning. The underlying character, after the 
encoding is removed, is the first digit of the value correspond¬ 
ing to the catagory the encoding specifics. The remaining char¬ 
acters of the value use the normal representation of hex data. 
For simplicity and human readability, all mode encoded val¬ 
ues are 16-bit (2 bytes, 4 characters) with most significant 
byte first. Also, no mode encoded data is to fold between two 
data records. To get a full range of relocation counters the full 
ASCII character set must be used. If only upper case charac¬ 
ters are used then ROG allows 64K and RAM allows 36K, but 
no COM is allowed. 

Encodings 

Externals: 

First character is next 3 characters are hex numbers 
from 000H.. FFFH. This allows a meximum of 4096 externals 
in any one module, but does not allow for arithmetic with 
externals. 

Relocatable values: 

First character is encoding value plus most significant digit 
of data value. Next 3 characters are low 3 hex digits of data 
value. 

relocation encoding value 

ROG ‘G’ (47H) 

RAM ‘W’ (57H) 

COM ‘g’ (67H) 

This table shows the first hex digit as encoded as each 
relocation type: 


Data 

Abs. Hex 

ROG 

RAM 

COM 

0 

'0' (30H) 

'G' (47H) 

•W' (57H) 

'g' (67H) 

1 

•V (31H) 

'H' (48HI 

'X' (58H) 

V (68H) 

2 

•2' (32H) 

T (49H) 

'Y' (59H) 

V (69H) 

3 

'3' (33H) 

•J’ (4AH) 

'Z' (5AH) 

'j' (6AH) 

4 

'4' (34H) 

'K' (4BH) 

' (' (5BH) 

'k' (6BH) 

5 

'5' (35H) 

'L' (4CH) 

'V (5CH) 

'1' (6CH) 

6 

•6' (36H) 

'M' (4DH) 

'] ' (5DH) 

•m' (6UH) 

7 

'7' (37H) 

'N' (4EH) 

(5EH) 

'n' (6EH) 

8 

'8' (38H) 

'O' 4F H) 

'-' (5FH) 

'o' (6FH) 

9 

'9' (39H) 

'P' (50H) 

A '(60H) 

'p'(70H) 

A 

'A' (41H) 

'Q' (51 H) 

'a' (61H) 

'q' (71 H) 

B 

'B' (42H) 

'RM52H) 

'b' (62H) 

V (72H) 

C 

•C' (43H) 

'S' (53H) 

'c' (63H) 

's' (73H) 

D 

■D' (44H) 

T’ (54H) 

'd' (64H) 

't* (74H) 

E 

'E' (45H) 

'U' (55H) 

'e' (65H) 

V (75H) 

F 

'F' (46H) 

'V' (56H) 

T (66H) 

V (76H) 


Page 16 


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


Number 22 


72 


Common Relocation Resolution 

ca) COM relocation is handled by a mapping process, where 
each module’s COM segment is distributed over the actual 

COM blocks for the whole program. This is distinctly dif¬ 
ferent from ROG or RAM segments where each byte 
allocated gets a different memory location. In common 
blocks, all block/segments with the same name get placed 
in the same memory location. 

cb) The only entry symbol related to a COM block, is the 
COM symbol. Its value is the length of the COM block. 
No other entry may exist for any COM block. 

cc) Since COM is a relocation type, program references may 
specify offsets into COM. Any symbols within COM are 
local symbols and are mapped at load time, as is any 
COM data. 

cd) Blank common, if it exists, must be the last common 
label in the symbol table. The predefined name ‘?*****’ 
is generated for blank common. 

ce) The COM size specified in the name record is the highest 
COM relocation value used in a program (including space 
reservation by DS). The size of blank common, if any, 
is determined by subtracting the cumulative size of all 
labeled common from the size in the name record. In 
other words, the size in the name record ‘hangs’ over the 
end of labeled common by the length of blank common. 
The actual value of the bcom symbol (*?*****’) is 
ignored. 

cf) Labeled common blocks must all be defined lengths and 
must be the same size in all modules. 

eg) Blank common may vary in size. The loader will allocate a 
block corresponding to the largest blank common block 
specified. 

ch) Common module relative is mapped from one relative seg¬ 
ment, in a module, to appropriate memory addresses 
based on order and size of common blocks. Each common 
relative reference is given a COM value based on the offset 
from the beginning of its common block and the total size 
of all preceding common blocks. At load time the process 
is reversed to yield an offset relative to the start of its 
common block. This offset is then added to the actual 
start of the block in memory. This way all references to 
any common block, even in different modules, get mapped 
into the same absolute memory address. 

ci) To resolve a common reference: first determine which 
common block it refers to then resolved value: = common 
block absolute start + (reference-reloc. com blk start) 

Example of COM mapping 


module 

symbol 

length 

COM rel absolute address 

module 1: 

COM1 

10H 

0 

1000H. .100FH 


COM2 

20H 

10H 

1010H. .102FH 


COM3 

15H 

30H 

1030H. .1044H 


(bcom) 

20H 

45H 

105CH. .107BH 


nsize 

65H 

(size 

in name record) 

module 2: 

COM2 

20H 

0 

1010H. .102FH 


COM4 

18H 

20H 

1045H. .105CH 


bcom 

12H 

38H 

105CH. . 106DH 


nsize 

4AH 




MEMORY —» 107CH (next available location) 


Notice both modules’ blank common are different sized. 
After all modules are loaded the largest blank common size 
is used. The next available byte is defined as ‘MEMORY’. 


Note the way COM2 has different common relative addresses 
in each module, yet both are mapped into the same absolute 
address. Also note the gap between COM3 and blank common 
where the loader allocated COM4. 

Optional Formats 

There are a number of features that might be nice in a 
relocatable format but are not included here. Some are 
necessary for machines other than the 8080 line, for which 
this format was designed Others are a convenience to 
programmers that lead toward bad programming practice 
(specifically externals plus offsets). To allow for future 
flexibility, it was decided to specify how such additions 
would be added to this format and a way of telling the loader 
to expect same, or screan foul. The ‘option select’ record is 
used to indicate target machine and active options. For one 
pass compilers and others, a general fix-up record is specified. 
These are suggested options and are not final, please contact 
the author with suggestions! 

The major deficiency of this format is that all relocatable 
and external data are assumed to be 16-bit values. The Z-80 
has an indexed mode which can benefit from 8-bit externals 
and machines like 6800 & 6502 require 8-bit values for 
indexing and page zero addressing. As such, three schemes are 
provided to handle these: using the fix-up record, using the 
high 32K of each relocation range encoding and adding an 
extra byte on 8-bit references. The most desirable is using 
the high 32K because the consistency of the format is 
maintained—each input byte translates to one output byte. 
However only 128 8-bit externals and a split page zero relative 
encoding result if more than 128 bytes relative are required. 
If a flag character is used (such as the on a 16-bit external) 
then no such problems occur, but the format becomes less 
humanly readable because the flag byte gets totally thrown 
away and not passed to the output. The fix-up scheme used 
on large computers totally destroys the primary goal that the 
relocatable format will be directly humanly readable, and one 
might as well use binary. 

Option select (type 4) 

0 . .2 ‘= 01 ’ 

3. .6 bits specification of options selected 

(lsb) 0—non 8080 machine (default is Z80 

and 8080) 

1— use of high encoding for 8-bit data 

(max 128 byte page zero relative) 

2— full high encoding (256 byte PO 

relative) 

3— fix-up record allowed 

4— record count record allowed 

5— flag scheme for 8-bit data allowed 

7. .8 ‘04’ (record type) 

9. .14 machine type (ASCII name, right filled with **’) 

8080, Z80,6800,6502, 8085 
if other use, standard name of machine 
15. .16 checksum 
Record count record (type 5) 

0 


1. .2 

number of counters 


3. .6 

overall checksum of all record checksums 

7. .8 

‘05’ (record type) 


9. .10 

number of type 0 records (data) 

11. .12 

>5 >» j >1 

(symbols+eof) 

13. .14 

2 

(name) 

15. .16 

3 

(library mark) 

17. .18 

4 

(option select) 

19. .20 

5 

(record count) 

21. .22 

6 

(fix-up) 

23. .24 

checksum 



Number 22 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 17 


73 


The record count record is allowed to add to the security of 
the system. It allows checking that no previous record has 
been lost because of errors. Each count is an 8-bit, carry 
ignored checksum of all previous record checksums. No 
attempt has been made at error recovery, just error detection. 
One implicit feature of this format is that intuitive error cor¬ 
rect can be made, if necessary, by the human operator. 

Fixup Records (type 6) 

0 

1. . 2 number of fixup items 

3.. 8 ‘000006’ (address and record type) 

(9+len*5). . (10+len*5) fixup items: 

< A AA A > < DDDD > < TT > 
where: A—fixup address 
D—data value 

T—fixup type: 0= 16-bit value 

1 = chain resolution 
2=8-bit (hi byte) 

3 = 8-bit (lo byte) 

Both address (A) and data (D) are encoded ASCII (MSBy 
first). The type indicates fixup required. A chain indicates the 
target address is to be filled in with the data vluae, but first the 
contents of that address are to be kept to point to the next 
address in the chain. A value of zero indicates the end of the 
chain. Otherwise, the data value is added to the current con¬ 


tents of the target location. This also allows arithmetic with 
externals, as the data value may be an external. On 8-bit data, 
the arithmetic is done with the 8-bit contents of the location 
and the requested byte is substituted in. 

Optional Encodings 

The high 32K of encoding is reassigned to 8-bit values, on 
the assumption that no modules that big will be generated. 
This is largely valid, however, it is conceivable that a relocatable 
object module produced by combining other smaller modules 
could get that big. 

Reassignments: 

O (4FH). . V (56H) - page Zero relocatable (00H. . 7FH) 
W (57H).. (5FH) - 1 byte externals (must be first in 

serial sequence too) 

o (6FH). . v(76H) - page Zero relocatable (80H. . 0FFH) 

If 2 byte values describing 8-bit data items are to be 
allowed, then the first character of the 4 character item is a 
flag. The remaining 3 then contain the hex value desired. 

Flags: 

‘! ’ (21H) — page Zero relocatable 
(22H) — 1 byte external (lo byte) 

‘ # ’ (23H) — 1 byte external (hi byte) 

‘$’ (24H) — 1 byte common segment reference 


F- F- 
*-« 
> X 


r x 
J 
C X 


2- CL 
X _J X 
J O u 

a 0* c 

•- X O 
x CL _J 


0) > C UJ 

z x cl 35 
x x f- z> 

■r- > (/• 

x Z C 
X X O 
actii 
o -• ui —« 
a > a 


ill O CO *-• 
1 Z ill u 
O - J) 
-• O F- C 
i.O Z -< 
x - _j a 
a x *-* uj 
u a a 
h ill C O 

o x cl o 
z o c z 

O aJ 

07 X 
■ Q a aJ 

x c a 

F- X O G 
~ X _J E 


UJ uJ 
E E 

O O 


O E 

O c 
X X 

X X 

o o 

lL X 

07 07 
07 07 

UJ UJ 07 
X X J 07 

a a c _j 
a a z c 
C C X z 
UI X 

a a - uj 

c c X r- 
OOaJx 
_! _J UJ 

O O O X 

z z o 

~ - X 
r- r- UJ UJ 

x x a j 
< r c e a 
i- »- 5 <r 

01 0 ) Z h 


x a 

O X 

o o 

UI u 
X UJ 


X 


X _J 
UJ _j C ' 

x o x 

UJ UJ UJ ( 


UJ UJ UJ C 

-I 


-I z 
z o 

07 O *-> 

z 


x a c 

UJ t 
h- c c 


X E O 

o c <r 

O X UJ 
uJ CD 
X O X 
X o 
C X X 


G Z X . 
_l uJ UJ « 

uj i f- : 

X H x 


a 

X z 

O X 
U D 


X « - O 

uj a a 

H- - 07 

x a: x 07 
uj o o uJ 

. o e a 
x o <i a 
c x x c 
E II II li 
II o UJ _J 
c ui a i 


<r o 
e <r ► 

X UJ > 
O L 


J > O O H (S 

a a x 

C Jhhh 
H Cl J x X x 
~ H ul UI UJ 


UJ 0) 
7 r- — 
: O O 
i <r x 
. X X 

: c 

: i _i 


j > 
:• 07 o 
j z x 
x i- 

E Z> 07 

j x a 
J X 
: > 
X <x 

j Z E 

F* F- 


a a 
c c 
O O 


r- X Eh 

x £ c; 

X “7 Z l 


-I 

C 

OX 


i <J J x 
. - X c 
: jo:r 


a o 

X X _J I 
Z Z I O 


a 

_j > 

I o 

0 7 T. 


> J c 
O I F- 

£ O) 07 


ooo 
o o o 


o o o o 
o o o o 
O O D O 
o o o o 


bbboooooooooooboooabboooobooo 

^ -v ^ o r. /-j r , n rt r\ n n 


OOOoOOOOOOOO 
o O O o o ooo O O OOGOOOOOC 
OOOoOOOOOOOOOOOOOOO 


O OOO OOOOOOOOOOOO 
D o :> O O O O G O o o o o o o o 

OOOOOOOOOoOOOOOOODOOw^vtwuuuuvi 
.-7 o.-7 -in.^oooo OOOOOOOOOOOOOOOOOOO 



Page 18 


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


Number 22 


74 


0014' i IGNORES ALL ERRORS UNLESS USER 




z . 

_i o o 
I ~ 


> H 
C Jj ii. 

W0« 


uj £ 
I > 

rh 


c c 

z 

• J Lit 


1ZU 
•- Cl 

a o 

0; r- o 
Ul H 

2 o 

— X 

o »-• 

Ul 

a 

a 


Z o. 
a r 

x 5 


_i _j 
a c 
<r >- 
h x 


> X 

Cu LU I 
ui h- 
CJ 2 ~ 

* «3 


<r 

' x 

O 01 

N 

II o 

A O 

x »- 

<i 

i > 
O X 


o x 
_j o 

LU 

X H 


O D 

a: z 

v C 


LU X 

> O 

c a 

01 


x x x 

I lU LU 
U I I 
DlOhO 


X x Ul 

I UJ X 

(J X C 


i a a o i a <x i q 


'># 


«■ cs $ 

O x _J + x «m 

' a a a ' a x ' _j 

OLUXCU.IOZ2CUJ 

n x o x x o x v x 
oi a: 


x i _i _i 
W o) _J _J 
j 3 C C (J 

x x o o i 


-i 

_J <T Cl 
c x o 



<SJ 


a 

a 

a 

a 


(J 

o 



a 

3 

> 

X Q 

UJ 

X 

x a x a 


O LU 


— M 

X z 

-j 

c 

_j <r x o 
c a x z x 

5 

a a q 3» x > 

I «I c o z o 

X X »- 
> o O UJ 

a 

UJ 

X u 

- (J 

X z 

D IX 


X (J O D X 

a 

oiao)ax>xa>> 

D<rocooo<roo 


X X 

Ll 

O 1 

o 

O _J (J “1 _J 

o 

u 

a a a x *-4 x 

r x x x 

X 

O 1 

O 1 

oi a o 

£ 

o “i a oi a 

i— 

a 

XOXOXXXDXX 

X X X X 


cc c 

UJ -< 
01 x 
D UJ 
X 
•. a 


~ M CO *0 O' 
*0 >0 *0 *1 *0 
o o o o o 
o o o o o 


8 s; 
\ \ \ > 
o a ll < 
"*) »o r 
o o o •: 
o o o < 


i o o o o in oo 

. N f-» N N 

>000000 
>000000 



oo a a *■* cj in 

N N 00 00 CO 

o o o o o o 
o o o o o o 


__ _ - - h 0> » Q U -« -« O' 

iilUOUQ«UJOv<r CluJQU 

\\\\\\\\\\ \\\\\\\\\\\\\\> 

Nr^0'OOaJ«^^^C4in<0 0'<ra>OQUJULiL^C<01' 
ccccccaiJJcaujjffljjuaaajaiaMajjcjL 
OOO000000000000000000000C 
OOOOOOOOOOOOOOOOOOOOOC 


c V -O N 

CJ O • J J o 
o o o o o 
o o o o o 


Z UJ - 

Ul > X 

x _| _J X t- X 
uJOL-Oul x Ul UJ 

X - Ul 01 X a I 

ociujocziaoacQ 


-J 01 -J X _J 
J>CUJJCNU)JO.> 
COh-XCXZDCOO 
OXOIQOO’jClUCLX 


U 00 

J X 


§3 

X X 


(J 

LU 

E 


x <X 
O H 

as 

. *« 
UJ 01 
UJ CC UJ 


38 

5d 


<r c 

a X N 
-J o cc 


UJ O x 
I - uJ 

o c c z 


J3CN 
C O X Z 
0X00 


UJ 5 

x 5 


3> x 

o z 

X >- 


X M 

o z 
a o 


A X 
V o 
-J cc 
C X 
H UJ 

o 

r- Z 
UJ 


CJ 


X _ . 

x D K- O 

uJ 01 x UJ 

X iU UJ CC 

O O <1 Z •- 

a 

i 


J C C N h 

c a x z ui 

O _J O O D 
X 


- o 
a ii ii 
uj 

a c c 
o 

O •* UJ 
Z UJ D 
UJ O _J 
_i <r 
JC> 
C 3* ll 

z 

X Q O 

x _| LU 
U O »- 
01 D 
X UJ -J 
OXO 
UJ II 01 
D O 01 
JOUC 

cjw- 

3* UJ 
X Z UJ 
x UJ 01 
uJ U X _J 
X - K UJ 


- ~ O ~ 


o 

o 

C ^ 00 x 

ci a o in 


U C* 01 o 


C- Cl 


sco oa 

ciusn" 


acsci 
o oi a o 


• o o a o 

« - - - CJ 

< o o o o 
I o o o o 


OOlc 

CJ CJ CJ 

o o o 
o o o 


sscaui 

rj CJ CJ CJ CJ 
O O O O O 

o o o o o 


CJ Cl 

o o 
o o 


C) «r c- tf) -0 
Cl Cl Cl Cl Cl 


^^0;CfflaUuuy'JiO-r<r<r r ccNM) 1 )- 1 )CJJiOOOHrc<r<rNCa)aJiJjJ- 
C1 Cl Cl Cl ^1 CO ?) M fo d M |V ' 0) «r «r t r c v v «r c r «r r «r r <r r r m D j3 l/l iO Jl if) if) u) u3 f) f> jl j3 >0 
OOOOOOOOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOOOOOO 

OOOOOOOOoOOOOOOOOOoOOOOOOOOOOOOOOOOOOOOOA^'-''-'^' 


^ ' <0 <0 <0 -O <0 <0 *0 

O O O O o o o 
o o o o o o o 


Number 22 


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


Page 19 


75 









AD INFINITUM IN THE GREAT SOFTWARE 
PIRACY DEBATE 


D Q CJ 

o ci a 

a o u 

•i U. cj 

a go 

J 01 o 

i q o 

I C Q 

a co o 

■- UJ 10 

0 u. u. 

U 05 O Oi 

L Q li- O 

I o o o 

a co u o 

- UNO 

a u. o o 

0 O' N O 

a cj o o 

0 -.NO 

a q o o 

a - n o 

l uj o o 

: — ci o 

I o o o 

S UJ w O 

r MOO 
0 Q Q O 

a r- U O 

I r M O 

a «r o O 

' O' O O' 

: oou 

I « Q N 

a won 

0 O O' "0 

0 <r (J 05 

J —• N CO 

l a co o 

I 01 -5 - 

a o a o 

E O' 05 - 

i' aan 
i n q u. o 

a «■ o co o 

« Cl !D N 'O U. 
r O CJ O U. 

a o o o o -< 

a o o o o o 

i) I/O <0 «-* o 

n a co q u. o 

I Cl Cl Cl Cl o 

a o o o o o 

j — Ul Ul — O 

- O O 


incooac 

I Ll — ID UJ O L 

i iO O O' Ll CD L 
.05-0 O' Q C 

: o o cd o o c 

- N C Cl — iD • 
' WMUQUJ' 

> o —* o —< a l 

) O -O V UJ iL L 
IhOW-OC 
) CD O U. O o c 
1 <E Q O' UJ C < 
) M O a M Cl c 
J O «r — «0 N - 
. C D r ill £ 

> O' O —• O *0 L 

> O CD UJ Cl Q C 

> d Cl U. UJ CJ c 
5 v O C C C 
j -< Cl O O' o c 
) Q a O CD c 

. — a o O' <z < 

. >i)h(DOQC 

> O Cl a O' N L 
) CD CJ CJ Ll -0 L 

i a o co o uj c 
)ONM5U.f 
li/lOOC'.C 

. o in cd ci a ? 

> + o c u. o i 
) M o a U. O L 
I O C c LlM C 
J CD CJ CJ U. (J C 
' Cl N O H M . 

) cj a cd o u .: 

> n co aoio* 
) a ci o oi o l 
i - - o o c * 

. -4) N O CD Cl < 
)OhOCINL 
lO-OOQrf 

i a o a 0"0 c 
i cj cd cj a a < 

1 O a iO Ll N ’ 
J O CJ UJ Ll C * 
■ nrinooc 
. CD —< a CD CD < 
) Cl O <T C Cl * 
) CO CD - CO a L 
I O' Cl O O' •*> c 
J N CJ CD Q ID « 
) —* N CO O UJ » 
I <0 a CJ CD Ll C 

) o O' uj a c c 

I CD N ID CJ O' U 

> a - o o o c 

> CJ -0 CD O CD C 
)-OflOC£ 
J O CD (J CD a c 
) a n a n u 

) CD O ffl CJ v C 

* o o o o o < 

> o o o o o c 

> a o c a >o u 

> — 05 ID N O' 0 

> o o o o o c 
i o cd a o cd c 

I UJ UJ UJ UJ U. J 


V o o 
O' O O' 

O CD O 

- a n 

WON 
co O' 'O 
«■ CJ 00 

— N — 

a n o 

0 . O - 

aan 

o OS - 
O Q CJ 
a Ll O 

o n o 

ITfS'JL 
UJ-OiL 
O O O - 
o o o o 
id m - o 
a q u. o 
o o o o 
anno 

M J - O 

-I - - o 

ll tl I II 


Received: 77 Nov 25 

Here’s my contribution to the Great Software Piracy 
Debate. The main facts are clear: software is very expensive to 
write, moderately expensive to market, but reasonably cheap 
to pirate. Good software is therefore rare and piracy common. 
Can this be corrected? I think so, by making piracy—or, more 
precisely, copying programs from a friend—profitable to the 
author of the program. Here’s how it might work. . . When 
you copy a program from a friend you send a small royalty 
($ 2 . 00 , say) to the program’s author, who included his name 
and address in the program itself. This royalty buys three 
things: ( 1 ) the right to use the program, ( 2 ) a complete set of 
documentation by return mail and updates later, and (3) 
the right to claim certain rewards from the author. 

The right to use a program would be valuable for a lot of 
us who want an alternative less expensive than the local 
computer store but less underhanded than piracy. 

The documentation would provide an extra incentive. 
Remember that printing is still much cheaper when you’re 
making a lot of copies. Of course, this would also be an 
incentive for good documentation, since the other kind 
wouldn’t sell. 

One reward which should be available is one for demon¬ 
strating and correcting a program bug (defined narrowly as 
a failure to meet the published specifications). Of course, only 
the first corrector (as determined by postmark) would win 
the reward. Other rewards might be for adapting the program 
to a new operating system or hardware configuration. 

I’m tired of reading complaints about software pirates 
and have tried to find a practical cure. Does anyone have 
a better idea? 


James R. Van Zandt 


— O -« H 
Cl O i E (J D oJ 
OlEOUI 05 X 


X 

U U U U H 0) 
—I —I —1 -J Z D 
X X X Cl' <L a. 


Z X 

a: uj <r 

3: aJ H UJ 

O > > _J 

JO 05 0 

II (J ll II 


E 

D E 

05 !D 
X Or 

X x O ^ 

i uj <r o w o <x 

U X ID . - X . 

Oh«aUQ(JiSuIEE 


_i _J — 

j ~ a > h- 

CCZOaOMUXQOUJ 
OOClCEEi-JCEJC 


CD 

£5 

_l CO 

<0 x 

J Q u 
C X UJ 

: z z o i 
« - X u o 
) CD UJ Ul 
« — H X CD 

: x x z 

) O UJ LLl 

X z 
) z x o z 
iCChD 
: X E 05 X 


UJ ID — <=' H 

- ID O' CO ^ £ 

o o o o £ 9, 

O O O O O 

CJ Cl * * * * 

X W Cl «■ * * 

r- 1- X x x — 

XXuJiU ^ 
UJuJXX 
Z Z CD CD a 


> 00 CJ O' £ 
) Oj C 5 Or O 
IOOOO H 

> o O O o o 

AS' 1 - ' Y 

* <r ui * * * 

j _ (V) X * r 

. X X x O D 


c uJ UJ uJ _J 0) 
ill iiiu: 
l CD O Q <J 


j 0 -. D M H M 

) o m o uj o 


I if) <0 W O' 0- £ 
IDDDaiDui 
> 000000 -' 
> 0000 - 00 -: 


fli HZ. 

<r .. x uj z 

t- O -• Ul _J D 

h J J x OW 

x UJ UJ C Ul X 

. UJ X X Z X CJ 


O » M N It O' O 
O «r N C O X v-< 

o o o o o o -« 
o o o o o o o 

V N N N s ' 1 - 

* > * * * ^ z 

* til —< CJ —• C uJ 
X H X X X r— _J 
I x uJ UJ UJ t~ O 
U Ul I I 1 X aJ 
CD Z CD CD r- UJ X 


> ^ O') O') *0 N 05 O' D' O' O' OJ Q Ll O « Cl 
. Ll ll : x Ll -_l X a. X X U. X a. a. O O O 
> 0000000000000 --'- 
>0000 00-0 000000000 



» o o o o 

1 c iD *<) N 
I Cl Cl Cl Cl 

. o o o o 


o o o o o 

05 o 

Cl Cl Cl Cl Cl 

o o o o o 


Page 20 


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


Number 22 



















BITS ON BOOKS AND A NIP AT NIBL 

Dr. Dobb’s Journal of Toothsome Topicalities and Unscrewed 
Inscrutabilities 

Dear Mr. Warren: Received: 78 Jan 30 

About a year ago John Craig mentioned in Kilobaud that 
he had lost his favorite reference book, which turned out to be 
a manual for the CDP (professional Certificate in Data Proces¬ 
sing). I found out from my favorite computer bookstore that 
there are three such books, and some students buy all three for 
fear of missing out on something; apparently they don’t under¬ 
stand the difference between representative questions and 
actual questions. If you have someone up there who has done 
the CDP recently you should have him review them. There are 
manuals from Anaheim Publishing, Arco, and Petrocelli- 
Charter. (The Petrocelli-Charter 2nd edition comes in two 
volumes, one for Petrocelli and one for Charter.) 

The bookstore, incidentally, is worth a mention. It is brand 
new (started last summer) and is an offshoot of a local 
computer store and electronics manufacturer, OpAmp Com¬ 
puters, in Hollywood. It’s called OpAmp-Technical, 
1033 N. Sycamore, Hollywood 90028. She has more computer 
books than Cal Tech, UCLA, USC, or Technical books in 
Westwood. ( She being Mrs. Lyn Karch, the daughter of the 
computer store owner; it’s her business, not his.) She also 
has books on engineering, math, general electronics, film 
making and such. 12 noon to 5:30, Mon. thru Sat. 

One book you should check out personally is: Micro¬ 
processor Programming for Computer Hobbyists, by Neill 
Graham, Tab book no. 952, paperback, $8.95. I almost fell 
for it. It purports to be a book about a high-level language 
that can be used as a substitute for machine language. The 
chapter organization follows the outline of a typical college 
text on programming, such as Ward Maurer’s or Donald 
Knuth’s. But there is no bridge between the “high-level 
language” and the machine language; at least, I couldn’t find 
one. And the “high-level language” is PL-I. 

You owe your readers an explanation and apology, even at 
this late date, for some of the obscurities in the source listing 
of NIBL. Particulary if the version in the collected Vol 1 is 
unchanged from that in the Nov/Dec 1976 issue of DDJ. 
Neither Mark Alexander (corrections in April) nor Jef Raskin 
(review in May) picked them up. At addresses 015E, 0303, 
04E2, 05D0, 05E7, 064D, 0772, and 0909 there are instruc¬ 
tions with the mnemonic JS and the hex code C4.1 have two 
SC/MP manuals (Technical Description, Sept. 1976; Micro¬ 
processor Applications, Oct. 1976). Neither one mentions a 
JS instruction. C4 is the hex code for Load Immediate. 
Further, there seems to be missing code, or kludges, or both, 
at each of the above addresses: four bytes at 015E, four bytes 
at 0303, five bytes at 04E2, five bytes at 05D0, four bytes at 
05E7, five bytes at 064D, five bytes at 0772, and minus one 
byte at 0909. Most of these are jumps at the ends of sub¬ 
routines. I strongly suspect that the program as published 
won’t run. 

I happen to be a Dijkstra freak. If NIBL is typical of 
commercial software, I have another excellent reason to 
remain one. 

If Mark Alexander is still in Silicon Gulch, and if he let the 
printout get away without checking it, you should have him 
make amends. In Principles of Compiler Design by Alfred V. 
Aho and Jeffrey D. Ullmann, there is a subset of PASCAL 
defined in modified BNF.# It’s Aho & Uhlmman’s idea of 
a term project for a college junior majoring in CompSci. 
An 8080 Tiny PASCAL interpreter done on National Semi¬ 
conductor’s in-house hardware should take somewhat less 
time than a term project. #in LALR grammar form, to boot. 

Has it occurred to you that “Dope Vector” would be an 


P.C.C.’s DAZZLER CONTEST WINNERS 

Far back in the misty past (1976) People’s Computer 
Company sponsored a software contest for a program resulting 
in a new and interesting display using the Cromemco TV 
Dazzler. Qosing date for entries was September 30, 1976. For 
reasons no one here seems to remember, the contest was a 
long time a-judging. All seven (yes, seven) entries eventually 
ran and it was decided to award a prize to each entry. 
Cromemco agreed to issue three additional $100 gift certificates 
and People’s Computer Company will be awarding two $50 
certificates. We will publish some of the programs in Dr. 
Dobb’s-m this issue we are presenting the first-prize line 
drawing software by Gordon French and Greg Yob. —TRW 


Cromemco 

2432 Charleston Road 
Mountain View, CA 94043 

Gentlemen: January 18, 1978 

I am pleased to inform you of the results of the PCC/Cromemco 
Dazzler contest, at long last. 

First prize of the $500 Cromemco certificate was won by 
Gordon French and Greg Yob (Box 354, Palo Alto, CA 94301) 
for their line drawing software. 

Second prize of the $250 Cromemco certificate was won by 
Barry Seip (Electrical Engineering Department, Stanford 
University) for his color-dot-bar generator. 

The three third prize winners of $100 Cromemco certificates 
were won by R. J. Gragg (250 Polaris Ave., Mountain View, 
CA 94043) for his memory tester; Dr. Kenneth B. Welles 
(Nela Park Bldg. 336, Cleveland, OH 44112) for his ASCII- 
3x5 & 5x7; and D. Kleinman and S. Grumette (921 North 
La Jolla Ave., Los Angeles, CA 90046) for their mandala 
program. 

People’s Computer Company will be giving fourth prizes 
to Robert Korody (3131 Homestead Rd. #18E, Santa Clara, 
CA 95050) and David Dameron (402 E. O’Keefe St., East 
Palo Alto, CA 94303) consisting of $50 in books and publica¬ 
tions. 

These prize winners will be listed in the next issue of our 
Dr. Dobb’s Journal. 

Thank you once again for your sponsorship of this contest. 
Best wishes for continued success at Cromemco. 

Sincerely yours, 

Robert B. Jacobsen 
Executive Director 
People’s Computer Co. 


ideal title for that service to physicians? 

And did The Dragon decide to become The Dragon 
Emeritus after Don Quixote Aho and Sancho Panza-Uhlmman 
did him in on the cover of Principles of Compiler Designl 
(No, because Addison-Wesley published it late last year; mine 
is apparently a review copy.) 

Watch those bits, 1046 S. Westlake, #1 

Mike Fern Los Angeles, CA 90006 


Number 22 


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


Page 21 


77 



ABSOLUTE!^ 




BY GORDON FRENCH AND GREGORY YOB 

Box 354 

Palo Alto, CA 94301 
326-4039, 325-4209 

A PHILOSOPHICAL RAMBLE 

Our software is a tool for others to use. Rather than make 
a program capable of some special effects and little else, we 
provide two essential tools which make the TV Dazzler a 
genuine graphics display rather than a somewhat quirky toy. 

Once having the tools, no dyed-in-the-wool hacker can 
resist using them. In that spirit we offer some demonstrations 
and hacks which evolved while we were making the programs. 
Bear in mind that our entry consists of the tools, and not the 
rather crude examples of how to use the tools. 

WHAT IS IT? 

The accompanying assembler source listing and assembled 
code in hex is our entry. It includes: 

1) Two routines which plot points: 

DAZL for 128 X 128 BW mode 
CAZL for 64 X 64 color mode 

2) A linedrawer which calls one of the above routines 

3) Miscellaneous routines: 

CLEAR initialize Dazzler and clear display 
DIAG diagonal line diagnostic test 

DRAW initialize line drawer 

Look at the code for the remarks which act as a guide to 
the operations performed. The dot drawers locate the 
quadrant, compute the displacement, locate the byte involved 
and mask to find the bits or nybble to plqt. The linedrawer 
recursively divides the line in halves until dot-level, then 
plots the line as points. 

THE GORY DETAILS 

A) Prerequisites 

The following material assumes that you know a few things: 

1) The TV Dazzler documentation 

2) 8080 Assembler 

3) BASIC 

4) How to load, map and access Processor Technology 
5K BASIC (software #2) available from PTC for $15.00 

B) Drawing dots 

1) Use of DAZL for 128 X 128 BW mode 
DAZL takes as input the cells: 

XVAL = X— co ordinate 
YVAL = Y—co ordinate 
ZVAL = color (0 is black, 1 is white) 

DAZL plots the dot of ‘color’ ZVAL at the location XVAL, 
YVAL on the display. 0, 0 is the lower left corner, and 
127, 127 the upper right comer. 

Warning: If XVAL or YVAL exceed 127, odd things can 
happen. This is usually wraparound, and occasionally things 
blow up!!! It is the driving program’s responsibility to 
check the values. 

Page 22 Dr. Dobb's Journal of Computer Calisthenics & 


2) Use of CAZL 64 X 64 BW or color mode 
This is very similar to DAZL: 

XVAL, YVAL = co -ordinates (0 to 63) 

ZVAL = color (low 4 bits 0 to 15) 

(grey or color depending on mode) 

To the user DAZL and CAZL are very similar. Internally 
they differ because different Dazzler modes change the 
addressing involved. Both routines execute in less than 110 
cycles which provides a maximum plotting rate of about 
4000 dots per second. If you use BASIC, the rates will be 
very much slower due to the BASIC overhead. Typical 
of these programs is 3-5 points per second. If the code is 
entered at ‘START’, a diagonal line will be drawn. This is 
a nice test that all is OK with the load. 

C) Drawing lines 

The linedrawer starts at ‘DINIT’. It draws a line starting 
at the coordinates in cells XZERO, YZERO to those of 
XONE, YONE. The linedrawer calls either CAZL or DAZL, 
so XVAL, etc. are also used. 

At present, the linedrawer calls DAZL. To call CAZL 
instead, change line #1480 to: 

Call CAZL 

(This is at ‘PLOT’ +2) 

These routines let you handle any dot or line graphics. The 
awkward co-ordinates of the raw Dazzler are tamed to a form 
you can use easily. 

D) Point plotting with BASIC 

Now the fun begins. The demo programs are set up for 
128 X 128 BW mode. By appropriate address changes, 
the other modes may be used. Be sure to change the scaling 
factors. If you do not have PTC 5K BASIC, use the facili¬ 
ties of your BASIC to set the values of the cells and call 
the routines. As PTC BASIC is available for a small charge, 
get a copy if you prefer. 

Program 1 

This draws a spiral with a sinewave superposed on it. This 
can make ‘doilies’ and crochet-like patterns. The assignment 
statements of the form: 

X = ARG (Y) 

Pass the 16 bit values of Y to the H and L registers prior 
to an assembler call. The program must then save these 
values in the appropriate cells. This is a little more 
indirect than Poke, etc. in MITS BASIC. 

C = CALL (Decimal address) 

Transfers control to the specified address which must 
be represented in decimal. 

Looking at Program 1, Line 20 clears H and L, and Line 
25 calls the initialization routine which turns the Dazzler 
on and clears the screen. This is called ‘to clear’. The space 
between 5K and about 16K is free for your use in BASIC. 
The loop in line 4000 moves the angle pointer ‘T’ from 0 to 
100 radians. Subroutine 9000 returns a radius ‘R’ with which 
the polar co-ordinate R, T is located. Subroutine 8000 trans¬ 
forms the R, T values to the X, Y co-ordinates used by the 

Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


78 


dot plotting routines. Lines 4030-4040 create the 16 bit 
value, P, which holds the co-ordinates in the form 
XZERO, YZERO. 4050-4060 pass the value and call DAZL. 

To play with this program, see line 9030 for a nice set of 
values. N1 and N2 should be small, around .1 to .01. N3 
should be more than 3. If N2 is zero, you get a simple spiral. 
If N1 is zero, a rosette-pattern is made. 

Program 2 

This makes circles on circles on circles. Lines 100, 110 
turn on Dazzler and clear screen. Subroutine 7000 passes 
the co-ordinates and draws the dot. 2040-2070 convert 
from -1 <X<1 to 0 < X< 127 co-ordinates. You may 
make a circle with the inputs: 

1 , 0,0 

1 ,0, 0 to the input requests. 

Imagine a wheel. On its rim, attach another wheel. On that 
wheel’s rim, attach yet another wheel. Now a bug lands on 
the third wheel. The path of that bug for a given combination 
of wheel sizes and spin rates is what this program draws. We 
call it the loop-the-loop program. This is fun to fiddle with. 
We suggest small numbers for starters. Note that this program 
will ‘fix’ the values so the picture does not run off screen and 
possibly crash. 

See line 1130. Changing ‘G’ will vary the density of the 
plot. High densities are usually less attractive to look at. We 
hope these rather esoteric hacks will give you some graphical 
joys. 


dots/second. This works out to around 20 lines/second. 
BASIC will make this slower. 

Subroutine 1000 starts things up. 

Subroutine 5000 sets up the endpoints and calls the line- 
drawer. 

Subroutine 6000 draws a frame. A simple modification 
changes these to make X and Y axes. 

Subroutine 7000 draws a square spiral starting from the 
center. 

Subroutine 9000 twiddles the endpoints. 

100-200 will draw lines from your input co-ordinates. 

To get here you must start the program from line 50, 
a modification will let you draw a line starting from the 
end of the preceding line: 

185 X0 = XI; Y0 = Y1 
190 GOTO 130 

If you run from line 10, the screen is cleared, the frame 
drawn, and the spiral made. This is repeated. (And may be 
hypnotizing.) 

CONCLUSION 

Here are some tools. Use them freely. If you study the line- 
drawer, you will note the use of recursion and stacks. This 
could be done in other possibly better ways, but the idea was 
a fine bit of fun!! As for the dot plotters, they are nearly 
optimal and stand as a challenge to the dedicated super-hacker. 
We mortals will potter about in BASIC.... 


E) Drawing lines with BASIC 
Program 3 

You may either see a repeating spiral or draw your own 
lines with this demonstration. The linedrawer is under 200 
cycles per dot, so the maximum rate comes to around 2000 


P.S. 1) Do an inchworm or a turtle. Have the BASIC program 
get the commands for up, down, right, left, etc... . 

2) We did not have a color monitor, so no color-oriented 
things here. Take a program like Mr. Yob’s Mandala (see 
PCC’s first games book) and have it output colors to 
the Dazzler instead of splats to the TTY. 



r' <r 
J <r <c. 
•< a: j o 
O i-. «S 
<r .rt (/: <x 
t- i — -- 
i/ .-i n 
Q_ 

I- r> ir u: 
•o 4h 

t r, t— v — 


• >• j. <t 

n n, _j — 
•c. t/i o - j 


. Cw U‘ C. tf TT 

*octo ft- u • 

. O ‘b. ft- G* c-f 

*• <*. 5 •* 1 e 


« — «t — 


>- - or o 
'.•“if* r. 

’ -> i *.> «: 


•x x < z r: n. a: a. 
v- u. — -> o > o 

C I J J fj ti) O CJ o 
1C U (U) fl.fi 40 J 


Ji <? 

C'. c: -i 

x n -x 'j 


' o / it: t» rv fv f - 

,r. O Z O 1 -> Z *J 

i > r o n -) t 


.j 


—■ «c 
f- o 
r: u 


• ts 

• <r 

• M 


- J !• 
X jJ 

_J -o v 


• t- 

• r' 

• o 


h- (5 rr 
>- o u 

O h- -)4?. 
Z. *-• >- UJ 

<r a o ui ui 

I Q O h Z it 

a x — u 

<£ <X. >- CO _J 01 

tr <t 

a. a ui uj -j 

=> 2 > O X X 

•i d 


j j _i _J j j 

— « «r « < < i*j 

• =» • > > > r> <r 

«T Nj OJ K .□•<>- E >- Q 


w <r n x <x n <r j 

!> E- O Q O Q H <1 

*•(/)*. j < n J < n u 


cs u c- tn r.t a o. ir t. um* u ft. tr «; tr " 

t£ tf r- h a .x cr o is. is, — — c tv ft. tr *3 u 

--- —• Oj CV 1- C O tv' O' tV O CVj c. 

r r r. fj c e % Cs. r. r - t_ <• * * c» s a. t -> 


IT 4 . X< e. IP G IT 6 IP F Ifi Ck ir t. M ft ir e» itt t 

e r- ir o) o w r. r —- o wtoKccu'tf'tf’ 

O’ Z. CV CM CV CO CV ft) ¥> ft) ftl ft) ft) ft, ft) ft) ft> ft) ft'. ft) 

ft. r • r . ft. a; e. ft* e; c" ts. tv to ft <s» e. <s ft c. ft ft 


»r u n ft- ft fti ft' 

'T N S’ >| <T T -c 


<r <r it 

< X <T <3 <r <T 


C V Cv v.. O O ' ► 
ft c. u. r. pi cv. <j 


•< (i -3 U Oft — 

« ft. ft P. ft. ft- P> 


— UJ O O C. Cl K) 

ft U U u. u. U. ft' 


t c o rr c f -pcco 

t-’ C C_ Ij. CV c ft. c c U C’ 


uj ft' :»• k — — u r- •one « i. r 
► n ir c-1.. — ft o — o — '' t.' 


- c ut c*> ft <x s c <t tr cv c 

c. c _ c' mo ft ft O) ft « a n o 


C. C G R t f- IT t ft ft ft ft ft <T' <r <r c> U* U. 0 If V rr 3 . U' — 0 O t. C C. CV C V v v a f * C" ft >T ft -X n 'J u ft'- i.v t. ft C.. t« CV ft ft; ft; ft ft. ft. lf> CL O' O C * IO <1 ft- <X < 

r ft tr p p ft r, e-ft'pcftftft«ce'» i ft f is — — — — — — or : c i> t’c r. Oj cv e c e o ft ft k. r r i*. ft k; ft k k ft ft p- »-ft <r v<7-<j-<7<7<T«r<r‘7<r'<Jirirtrtr'irL r 

O t «. tt. ^ f tv- ft ft • ft ft ft) ft) ft ft. ft ft- ft ft, ft. ft. ft. ft. ft ft ft ft ft. ft ft. ft. ft' ft ft ft- ft. ft, ft ft' ft ft. ft, ft. ft ft ft ft' ft ft ft ft. ft - , ft- ftl K ftl ftl ft) K. K, r. KV fti K. ftl ft - , ft 

ft? ft f. t f s t. c. t; f. c v^<rc<i<T<r<rc v <r <j si csr<r<rc<rc<T<rc«Jc <7 c<- c s s <t <r<j<7<7<r<r<j-sr<rsr«i«j s 


Page 23 


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


Number 22 


79 


















<T 

CO 


— __ O 

c. ot- 
«j rr cr 

C» U. c£ 


O x 
I- cr 
i«i «t 
u. X UI 


:r « k» 

U. « (i. 

lO L3 «v (U q 


—< r- <r •— 
Z O Q Z 
<i x -a <c 


C. If O 
K' K -1 <? <T 

r~ r- 
IS> 


o - 1H 
ft. ►- UI 

O t'J C' 


ui Cj .s no 


<r*-»'jouor> 

07 J JJ JOO^frhl 
J « l !». cr. i r _J <x o to ' 


tn fr 
••! rc n 

n ■"> <r 

•o x 


(— — u 

r- io rr 
O <t 1«J 
W RJT 

O ■7' -3 

3 —« -J 
*— «T —• 


JCJliJ 

_J cr 
o o <t 
u. ui 

uj •-• :j 

r _= x 

» •■*! f- 


•- z »■• 
cr “» vj 
n o :j 


u: c < 

«. UJu 


> > > 
ooo 

S’ •«: x 


<c f— i— 
U. => UJ 
X O ft 


• n 


o (V x 

»- o ♦ O rr k f- 

" o. (r ii >/i < ir w O —* 

• (iJ ■=> Z >- HI <U rp 7r Z 

n. (Eh aoo J • r~ — 

u. u x cn x >/) u — o. rj 


a 3 C Cl J J _J_I 

— _J -1 ~l JJJ'-'HJJf-Q 

x t. xirx<x<tr>m«-c<i.t,o 

_j_jrn_jtncjov'>oi3cr"- 


t. u cs u< t< u u ir <s if <5 tn c. u u c if^ d t. k>c u a u ^ c Cs- ‘X* <s u< * if< r u. C. U «* tn t. in ir 

if u cr r- t- cc n <r a\ rs i<- — — cu o if k> «r tr io cr- u. an or ft <r p r-cv cm if k <t <t tr it cr 

fv (». f. f- ^ f. f. f- r' a x ;f< x j o i> o » to a. x / x i ff o x> o c’» <r< <"*> ^ o. cr> a t*. n c cu tfc 

f r. h m ic ? *. i c r- *v- t ? r r r ts f i*’ Tj r- rv f ^ r- i f. i -s «?. is. •* e- *■ is- t*: «?> 


U't. IT h U,Mf G IT 5> tf' e, U C. IT f b C- U f 

ir mt aw; <* e is — — cv o 

- * fl\ ^ ff> j, ff I- IS f y, ft, r 4 t 

s * »v d r s — 


u/ cr r- r o 


cr rr {j o 
<r <r <r <t 
k . r nio 
<r r <r <r 


f* * f» K i» ►. r>> * k k r* K K r> K) r 


OK, Uj r u. S. « MJ R- IC b. f; C 1 

u. k e e. u c. h. *4 k: oj ?:• o u, 

ff' <rr a cv k u f: cr -*<rc> «t wocuiior.ra f ^ 

b • li • f»- O C' < C O K; CC W (« lc O y io c O G C f- *5f 

» Cl C* C Co C O l\. (V (• !»’. <3 U' U If- If vr (K O O O U O U* «T. C K If 1C M, a o U. C If MT M b t. — C. C C • 4\ c • t c 

r t.> r.» lhjuu c.' o o cw> o t* o o ir o u o o o c o r. ci o (f o o r n n u* g- g; hi u: hi u h h. h. h f- u h t 

D K. K: »•, K IO K • K, ro K . ► . K K h K) K Kl l> K IO K1 r, K) IT r f, m IO T « h. K' K 1 C K- d h K- fi r l» »• pjt 

cr <i<r'C<r<r<r<r<r<j<r<i<T-cr<r<<r<rs , <'^c<T<r<r<:<r«r<r<:<r<r<rvcr<ir<i<MT«r <: c <r <: <r <i c 


rr 

w H >- 

-I O <T 

M 3 ^ _J 

M l/> If'J Ol 

<r u. ~ < co 

o o >• > -. 

^ • .X) IV) 33 

O O (S Ili.>. 


7D ■=} 
2 O 

•-< 2 

M 

Z f— 

o < 

U Ui 


<t O to 

fS. 'C —. cx <t 

S- CC Cj <t — -t) 


— <X H Q. 

z zm:i/ r 

~ <X -3 X O ~i 


Z -J 

o <r 
—• > 
to X 


• a: c.’ cr '3 
I O M O 
i -I <r J x 
. a a o o 


WHO 
— O -I 
i a o 


I- CM 
»- < 

cr r -c- 
' J cX 

cr> •-« 
to x 
ui 

a <r 




_> >- 


nhX2 
! (I «X 

'-O z ^ 

j|li hX 

rr u. m 
I- O UI HI 

[<J U! < O 
u I t/1 
<T I- 1 - 

O 

O '-J • »- 
JHHO 

n? 7 
• a. «t 
s: i- 
co o to 
rr o z 
— o 

U. X o 


> t- 
>- to 

• I ul 

<X I— 


— rc. CM is. 

aJXhWCltviCV 
• cj<r • *.?S)<r» 

<C C l Q t <t CVi a (E .D 


XXX o 
J J J X 


>- \ -■ G Q J) 


ozzxoz.vx «*. 


• 31 :c o tfi 


I I - - 

— -J-i-J-iO'r «>o 
- xozirooszc<t<i;<i.zz(xo<i 
ui js<Krsuciircrirx"5«orc 


<t —* O Q 


> ►- - C XM 
O Z X Vi o z 

> <r _j q x -j 


^^cS)l^e fc ^^Glr. 8iouinsifiMi.s«,Gine. if\ g- m <s> in & ir i, m t m c ire is it. c ire s» ui ^ u'<h.u. v-u ^ u 

cot^r-trtticr^sc^—— cMCMfOK)^ , 5rircif'W’crr-t^crcof7‘^ir , cc;—^-(\)cv)K)K><T5rir'ifu> u? h h o tr (r> cr. c^ ts. — — p; w r- r> v ^ u' r ^ «?r r 
i')icK'K'K)K)io<T<f<T<j'JT<T<r'f<7<3 , <j ,< g < T<r<T < T<r‘3 - <T<7 , uir<if>if'uciruijXir'ir\b'i/ir ir\ u - ir\ u l. u - m? o cr u c w 'r ^ 'f 1 1 >c cfv^xi u. > 
n ??• « is r k> ts k; !■; es is is n «s «s. e c. k, ts i^. e? csi »s.' «s> Ci e to cs ® <s e? <s. ft. ^ e F f <v«> t f. r *S' ci f e r- it « si i" s e • 


C If Hlf‘ C U H lf‘ G ll ■S lf» fS If- <5 IT I*.. ITi G L G 111 G If IS tf’> C U ■ 
“ *-— CM CM K* K3 <T <T I/C IT \l> \C r- ME ai C (MS C5 P CJ 


rs k is r r i Mt « v j, 


K> K. 

-9- UI 


iS' is ir cr r cv 

<r mv <r & 


x u <■ 

s ^ -r 


Pv (T K Uj (S 

CS <T 5T «/ \C 


U G G IT- U? C- S k S 

k K S C\J <• (S) CM V IS' 


— IS l_l Li, 

Ci. c. r- (». 


cr tr <r t*. k »o 
o b i o <r q o 


<r — — er cifP. *-<no<r-ff' 
M K - k H 'J U CJ H fa - O IS» C- 


-* «r cp u. ii. a u ^ — u. /»• 

n p b' c:.- vi r- .v l* 1 — — — r. ts cr xr t» 


<r cc - <MT r 

r- t-i c.- 


<i<ioii;-*CM'fl'r'r't^t't^r-r'r^r-r-r~r^r~r't^r^f , ^r'p'<io'Sj — c <r p < o d vi r < <r s <r s s p n: <r if o c ui r, - (,»■ ■«? 

iriioif>irii^i^vtotou,u3U3c^ccv:uj»2)«^\^)cf>bCtr^wPc^«^u>t^r^i^^t-r^-r^r-f'CC'or'8cr cr c ir c tr. (?■ n. k or it & c c (T oc 

io K, r. n k. r Ki o rr ki r- io ir, k) io K) io G o io k ki r. K) n>) to k- i-, ci k k) r. r. o r, k> k: k; tn r) r, o k, o r r ro f. k i* r, k r, k- 

^r«iir^^^c^cr<Mr<crv^cr <r <r ^ sr <r <■ <r <r <r <i c' ^ -Cf 


t- a- ff> <t o cn ir m o !«• - o r, ir u u »z: 

<r o- rf o (Too' r*\ cr <r <r <r <I <r <r <r 

X- K K h'-K l*J l»J K’, K h IT 1^- K f- K 1 K !•', 

->r<r«7'crf'ff<T't’-<r<r'<r'cr-«r'C5rf 


Page 24 

80 


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


Number 22 












n. a. 

D <X 


<r _J J 

U4 <t 

> <c 
*. :< a 


o .a _i 

j jj 

r x <t 
_i c/i rj 


xr — k; x 


— — k; p} 


■ft! • — 


cv y 


' — V 
J O <£ 
' CL >7 


■ :*j — 

^ i- rn f- <r 

I —• < '7 ^ 

r 

»-• «r o c* o -* 
f; i a a a. a. 


^ y *i S' in <t 

- Cl <r »Qj3X<t •OX* XT 


*-*-:> -J '£.->x M) -i y r> xr > 

X. > O OC Z O Z O X Z. z o *. o 

-J S' V O' <f ^ ~ s: *r <1 — c; — v 


_i 

>• 

■ U. A 


i* 

*” <£ 


SO <r, 
O <r 

o o 


a: 

o </> « 

v e »Vi t 

V V A — I 

— — — JO' 

>•>->- 1/1 
<t 

«* <* v o n « 
z ■ 

cu» c. c* u < 

y y y. >- 

v a v o 

- Ul 2 
>• v V. f_) — < 

a. ■ 

o.- k< <r r* o 

•o '»J 1*1 O' _1 

wi t/> v> u. 

<r <x n 
o o o z >- 
<1 ai 


Vl <T til O 


0 '/) -J 
t C jJ 

JO Z t/> 

^ W O <t 


_J <* A. O i. 


p'- — c - n 

:-j a e> 0 ui 

</> to —• < qvi 

< -T -J _l < <t 

OIOOli. U. & I) o 


— <r «i x < «c r _i <r ►. a 

? u. a; r ?. r ar >. j < oati 

5 XO-J — V. C7->“30 _| O *> *"3 


■n f- 

<£ uu 


X il 
J cc 


t- o 
J 
— o 


* 
uJ <t 

o r 


x o >- 
I- H 
Z 7 Z 


Q, h« H 
=» O =5 
a. cl a. 


cc : j iv 

* uj z k .-q o 

• 10 o • • • 

xo x.x/xs:xs: 


o «- <*i 
71 CC V: 
« UJ < 
X > CJ 


Ci a 

x :> _i _i — t>x>»- 
t>OZOXXXOZOt*J 
f j-mv jw jfHror 


T 
Ul X 

a. 

o cr 

_i — 

cn < 


cn a. 
o n 

a — 


If. if- A. If* 6 * Ifi <V 
•Q-irinififf-r-tr 


ui ^ y . t if c» if* c. u' r u c. ui s it s u \ p. if^ m e: in t u■ it o it Ci tr* a. tr- u. ui m «. H , v» «. >» w ■ — - — -• 

® ^* «* «r. a. — — cv - — oc y kj <f v u'* if n> u> r- a: coff*pw 6 i-*—c , c^»OK)<r^»' 

<r <3 if if. ir if ir in it ir* if* ir in in to w. if if • in in u u* ^ «3 w v w ^ f f ^ if c *f *i> ififur-f*-r-t*-r'-r-r~r*--r'-t'-t^- 


C if <Vi If. C lf\ <9 IT O If. ©« If* C- U ■ ©» U'l «S U Ci. If > 6.‘ If* M 
A. —. —.*.«wiin«T<ru-*if\u?irJC*-r*'OCOl. £T. <t r 
- r-r-r-r-® 


if' -e ir* c if 

•q «r <3 <3 


*c *s < «r if' «r <r 

<r <r <r *j <r <7 <r 


IT IT IT 
<7 </ <t 


6 . o »o U. <f u 

e» u. 10 e e. r- 


u. 

r~ 


rr u. <z cc. r. u/ in 
o <r a k &. <7* o 


CV ISC' t. 

?v e- s b>' 


— if fit u p> x u 1 u. cv ci 1 10 p 
c- — p- <y «<tl mi <r u r- cv r- 


ui t«. w; <r K u w <r k c r </? <r ic 

cv < jr u. il <1 J' x o i' y u. u. o 


tx. If K) !»’ <1 01 — C K' — J 

<v <r cv ■q - cm cv cv r- C' r*- o 


a. a: J or OC 00 JT t* 

<r<rv<T«r<r<7<^ 

v<T<r<r<rc<?<r 


— c ir if if* u n « 
IT IT IT If U' If ir If 
<tsi 

w^«i<r^<rv 


ironu-u. is-cv 

if io«rif ir if if if 

qcq<r<rqq<r 


p. ^ iO if if if if if 
ifififififififif 

<j<rv<r<rq<T'i 

<7<TC<7<r<j<r5r 


if v" «f «r **■ if if <r 
if If if If If flf lf 

<Tcc<7«r<rcc 


tr « n ui u c. ► it 
If If If V Itfhhf 
^c<r<r«r<iX'3 
qqqirctMrc 


(J* c U! - <1 v 11 

r- r- oc cr R> x 
<7 <j <r «r <7 <7 <3 
c <r <7 <r <7 <r <j 


<7 *7 *7 itP X f*OU 

or cr ir or oc ro cr 00 a 

<T<7<7<7C<7<7<7<7 


c r, q if « if i£ if 

<r <r & <r <r <a tr <r 

V <7 <7 <7 <7 <J *3 <7 

q q q q q q q q 


«VG 

; f . ^ 

I «J. *X <3. 




•OJK <t >- ^ 
; »- *X 

: «o ^ a 00 o 
- r- .-3 r- 7 »-■ 

/. Z Y > i. > 
• c — o a o a 
j • —0 — 0 

J • o otl o 


V D C C 

'J <r <r ?' 

<r X tr <t 

• I— 1*1 •— fx’ ►-. I- 

; 1/1 7) q 10 <t w 

<r a. <t o. 

Z ^ uu z 

' o o 00 

j •' x rr>r - 


f>- Y> 
i—■ ■} n 00 . 1 - 

7 - O - n L3 

o n c> q o a 


ilf-O .i 

tc t a- 
C *•.%!« «j <r 
1 - 1 '* » M • 
)»/»*/}<■&>- «J 


-^«rz<r 

O • O » 

Ci yc ^1 >- o ai 


. c _j — c <x (j~i c t> n ■ 
: T xxdOClOOw-iOC.i 

I O w J J <■ J VO _J X _1 : 


*t j. .Li 

*> o o 
U X .c 

—• r.‘ a x n ii 

•t H O U. <t “v. 

a. CL t— C., h* 

It X Sj) tc. 

J n 

\ O — H- 

t <t 3 -u O ? 

l- a. O -XX 

r- c/ <r _j a t' 

<c m o I— H- 

' . _i v v* r 1.1 

- J \ 'll «j •=> X 

-OX o tf 


00 O 0 

■ 0 • • Q M 

. * 7 i u x _i n j) 


— j 

■ a — 7» T. h _l T . 

av or-z.xn._xic 
IQ J * V. 7 Jf/li 


u v >- 


on n 

<. <x 


i - Z 
1 o —• ' 
r t> i 




'•J «i J •- 

tc Z c.» c 

ft z »-• 

« /i M 


U‘ C 3 Vi _l 

• • JO 

c > >t r u. j 


p — — 0 r 


a c u‘ •. t 
rqq iol' if ifht a 


1 Cv 0 cv c - c\ c. o a <\ ;v cv c- 0 o’ ui. cv cv c« 


a o ■— -> x 7 - y- r> > r»r>.r 
O O z C ? S> O O O - 
ft O. _J I —• f 


t- U‘ »S If *\ L* •* U *> U. C 

r< i*. - - ci cv r k q q «' 

x: H K; Kx M fO K| Kx K. P f* 


uJ Q > 
Ul 'sJ 
< Q J- 

z n 

UQuJZ 

o * <r 
H C W X 
O *- 
«t • X • 


< -J C x r a. 


o <s cr •-* > x n tn 
z vz> OU.TD 
-a 0 •-< v v c <c a 


lf> Ml! & Ifi If* P" 
« — — <\ cv o k) q 
qqqqqqqq 


•r 

■q 


A 

t. 


IV u 

<7 PV 


- rt r — <t r <u. u <rr cl ui 

L\ *} C . *• «•- -4 I*. U i^U. q k. q u 


— C“ — 7T " U C r (T ?* 

c y i< <»* o c u o 


r- c 


► • c K f, c 
c f- c t r- sT 


1*. u. c 1' - 
r u p • r 


— cv cv* u. o ui cr ic m 
<r •* c i« r cv r o & a 


Cv c c c* c. C*l r. cf IT ' L 

UUL Ublcbtx Ii (1 U li 
KU, K C P K~P.K K"P P ►. 

qqqqqqqqqqqq 


u. L" p ^ u a c t_- c 1. c*. u 

UPAtqprpt. atp 
r q q q q q q s < q q q 

qqrqqqqqqqqq 


— c. tr v r* <r n u u u 1, u 


q qqqqqqqq q s q 
qqqqqqqqqqqq- 


«. u (• u- L b. 1* 1. u r — <3 

— — — — — — — — —c cc 

q < q q q q q c q q q q 

qqqqqqqqqqqq 


u v r 0 c <i a c, C - p -3 u‘ 
CfCOCOCCOPP P P 
qqqqqqqqqqqqq 
qqqqqqqqqqqqq 


j f <7 o Cv — cv q if- if r- 

p- pp P''<r^< 7 ^ , «r« , qr 

q qq qqqqqqqq 

q q q qqqqqqqq 


Number 22 


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


Page 25 


81 


COl'i&INED 7 ALU 













'JQ «J 

- <r x 
1 f- <t 


j 4 xjj jr 


T> O O d 

O O O D 

I— I- I- 

«r ^ a. — — 

x u- o x >- 


<t it) Q < X > 

ai< e nu j. 


—• r- x. r» —• t) r> v r» o :> r> *-• :> x > a 
>CZ0=»^>0I'0Q00=>0^10? 

t ?: m r »■ w f < *• r r >: *- r -a 


6-uMf M-F. U'SU l*. IT P b P. IP ft. •» ^ 

P P on cr cr CT P r —• ~ CY C\x x <7 <7 ir lf> vf 

— ~ —-tv <x* tv. CV. IV P C'J C 0. CV Cl IV CV. 

cv cv tv c cvi o o: o cm c\ o cv* c a cv a c o c 



• 


• 




_ 











• 

• 




























o 

o 

c 










• 





























or. 

X 

X 










• 





























o 

o 

o 










• 




Id 

























3 UI 

o 

o 










• 




u 

























»- 

u 

o 










• 




< 




l— 





















UJ < 
















a. 




M 











or. 










tn T 












• 








cr 











<r 










<t — 

X 

3 










• 




>- 

























a o 

o 

\ 










• 








o 











>- 










O tr. 

_» 

x; 










• 




-J 




< 













z 








O 

o 

_J 










• 




CL 




J 











.J 










t/i o 

CJ 

X 









— CM 

• 




(/) 




u_ 


• 




















c « 










• * 

• 










t 









*/) 










X 












• 




Q 




J 


z 











-J 








o x 

>- M 

N 









a: rr 

• 










o 






























o o 

• 




u_ 




«x 


>: 



















1- f- 











x»- 

• 




o 




r> 


r 

_J 








cr 


o 




<t 




V) « 











<r <t 

• 








** 


o 

<t 








fd 


u 




t ti 




LxJ 











o o 

• 




Q* 






o 

O’ 








_J 


cr 




cc 




a x 


U< 

'-xl 









• 




Q 




<c 


t 

X 














•X 




E rr 


1- 

1- 








o n « 

• 




O 















p; 










UJ 3 


<t 

<X IV 

■s 

—■ 

— £\l to P 

p} 

<T 

<1 

«: z a. 

• 




*t 




<c 


to 

k- 








< 






l«l 




P* O 

1 t 

T t 

z 

X 

>■ 

X 

>- x V- X 

>- 

> 

y 

—• ■— i- 

• 








o 


_l X 








o 


cr 




o 
















• 




1- 






X 

SI 














<r 
















• 




fT 






n 











b) 




cr 




X 












• 




cr 






o 






a g. 


X 


3 








(?: 












• 





<s 


T 



_J L- 



.1 J J H J 

<• X 

X. 

rr Ci 


< 


























<* 

IP 







<t 

<r 

«rri' 

lUf- r> 

<r p-j 


or 




t r 




cs. 












• 





ir 

:*J 

—J 

4T 


CC 

U i 



> 


“> f- cr _J Uj 

d ir co 


CO 








p. cv 




« 

«s 

c*. 

IV pv p. c. 

ts 

C4 

t 

l at; 

• 





<T 

O' 

*t 

VC 


z 

_l 



X 

>- 

o. WO 

u to 

p n «r 






•J} 
















• 










—• 

■r 










ul 




Z. 
















• 










J 

A 










z 




















• 










c 

-J 






























• 










_J 











J— 




<x 
















• 

<x 




=J 

—> 

rr> 

rr 


-J 

cr 

r/> 


y 

s~ 

J E J 

* r 

y 

V. -' 


m 




rr 




3 O) 

.Tl X 

X 


X 

u‘ 

m 

til oi a a 

ro 

tC 

.o 

x a, u 

• 

tl 



» 



rv O’ 


o 

r> 

i 


o 

O 

o o o o o 

o r> n 


o 




o 




o o 

o a 

a 


Q 

c 

o o n o n 

n 

o 

Cl 

n p a 

• 

tr 



Q 

f.' »d 

UJ 

UJ 


u 

<r 

<t 


o 

u o u o 

y o 

u u ui 


cr 
































or 













uJ 





















0. 





Id 

« 

tr 







n 


tr 




T. 




X 




o 

o 


hJ CxJ 

o 

U- 

— o 


<x 




O 





Y 

UJ o 







i.0 


►-« 








p- _J 

-J -J 

o 


cr 

rr 

t*j 

Ui O O P 

rr 


* 

«•> C" >- 


*■ 



L. 


'i 




<t 

• 

cr 







<r 


y 




_J 




O «t 

<t <r 

o 



UJ z 

T l* 3 T 

T 

c? 

o 

<r <r x 

• 

<t 



rv 

Oj tP 

IP > 




0. 







b") 


f- 








I— *> 

r> ? 

-j 


X 

X 

o o f- >»- K - 

H 

H 

?. 

1 JO 

• 

r. 



f- 

<r 

-J 

<t 

•T 











— 





• 

• 

• 


• 

ip x 

>- tv; 

p.) 


X >■ 

X 

>- x >- y 

>- 

X 

> 

tx. fx. ix. 

• • 

• 


• 

u; 

H 

<L 

tU 

ui 

• 

• 

• 

• 

• 






a 

• 

* 

• 

IT 

Cv 

u 

c. 

u < 

c:. 

ir &. 

U) M 

U'v 


s; 

»P r. 

u « b. 

U> 

Ci 

IP 

O. b S. 

U\ u 

b 

c. 

IP fS 

IP 

S 

If 

CS 

tr 

C 

u 

•j, 

U’ 

C- 

If 

e. tP <s 

IP c- 

IT 

u. U 

c> 

at 

t. 

iO P 

p- 

on 

rr 

O' 

«r. o: 

\ — 



cv o. 

X K *r <r ip. 

tr 

VC 

u? p r x 

o c 

O 





o 

0 

X 

X 

V 


u 

u 

VP 

VP P r n 

o o 

C7- 





o 

o. 

cv 

CV CV) cv. 

U r> 

K p, 

IT 


•D 

X 

r. 

P) X p' X 

X 

p 

»■ 

K; P, X 

r, x> 

X 


<1 

<r 



V 

<r 

<2 

<i 

V 

<3 

*3 

<T 


V V V 

1 *T 

V If L" 

L-'' IP 

ip 

o 

01 

o* 

o 

tv 

cv 

cv o. 

0 O 

O: 


O 

cv 

tv 

o’ tv- r. r 

c 

t' 

c 

r o fi 

0 o 

0 

cv 

c. 

c 

O’ 

pi 

o 

cv 

O 

O'. 

o 

o : 

o 

CV 

O' 

OOP 

0. CM C 

rj c 

O 

o 



. W [,' tf P P ' Q IP O' (x «J* 

<T «. ij IT U r- u -3 <T c 


0- c. T. — — 


— tv -e li vr p <i'r<r <r<r<T<r*t«oC'i»' 
U' L' (»' U* UJ l’ - U tx'Cx (.1* U. U. 1/ U It. h U It t«. U. U U U- U. U U U U. 
c<jv<r4<rc4<r<;'sc<ic<r<fl 


!S — C . »■. <T If • V, P- 0- O 

i> r •- r f. r m, t f to wo r k * ■*. sy if 

U ' b ' u u it ip 4i b ir ip tr u' u u if b u tr a 


1/ If U' 'I u b 


lx. lx U. U- U U- tx U U. It 

x r r p r “ • e " <s r 

if u b u if. if 


If b b If li 


v<rr'<rccr<!<T<T^«T<<:<<!C<rcc4r<rc^<JCCcc<j<rP<r^cr^<r^*i' 


*■3 o »o 
>- »-* ve¬ 


er f- <r *- I- **: 


•«j» _ 

o ■ o 


f- x v vr 

'll o 

^ f- f- a 

hxJ uJh 


4 4 0.- — 


t- «f- 

Hi L 

C9 • f 


—• it 

■V <T 


»xj x 

to <t 
3C r 


r 

o UJ 

i— t 


E X n E o Mm 

► • • #• » • < • 

i x ■ j _j ci x u f <* ui x •* o 


m r h o a. 

<t u < x e *. i- rx <r a o<xe ro 

• • • » • * ■? • • » •> * • • » • » • o. 

«<t jj .i j^tu aa *-• _i«xxc_)EQ x<r<.xo_JQxuio 


JHZUJQZU<j|Q.<UQ<:iJ!ilJirtUlIlQ *- 


X X 

*>x>—=»x>>n >rj>>o>«>y>wrn 
• O Z O :> O Z OOC)0-OOOOQO'>OZO.3r* 
:»y:EfHi;j:*nr <t f r <t s: r. r •- s o. o 


J> O Z O > li O 

*■ r « r e w >' 


X > 

z o 
— v 


t. r> : 
rs o < 
to f ^ 


« > x > a 
• o ^ o jL 

: > - ~ r *> 


— r'X>«r>x>>o r'D>>.'nr>-.r.>« 

^>0^.0>0^.00t_)P. OCjOOOO oz 

^ 5 — > * s nvcrrwn i « 


x x 
to 

o o x 

> x a 


U • • • li. **«*o • • • 

u' *» tc c. b"- r ir «u »p *: ui co u< p- u- (si u p it- r. m u> e. it. Pv ip p u. * u mi. e> tMi c- u 5. it mt s tf 1 ' c. it t. ii- f it p umt t bi u if t k Qm 5 if> ^ it mt t> o u. 

p —c\ r it i <r ctPir v m-p ir r t ff f. pt — — O' o or v <r it ir- w. u) r- f tr tr> <r <r P- p.. — — o ci k r <r c in i/ vc vc r- r~ x w o* o p -« wcr o <r<r ii'ir «ni> 

x x tr x x a? x oo to o, to je -x o’ to ou cr i « o c C' c C' J> J p <r crji c. tr j- o, iMMft c> 4 n u \ u &.• r. i: ^ ----- 

- - - - - - - - --— ---- - — — — — pic o- O 0 O CVO O O! O' O' O' O’ C 00 tV'C tv O Ol CM OCV CV O' O CVJO.CVO'C cv 


<T 

c 


P- V 0- 

Pi c X 


Cj 

e. 


•S3 

IS 


to — 

IS O’ 


<x 


ui u: ir f»i u.’ ic K: if «t r < t p 1 p 91 k t* i*j v *«"' u.’ ip tr 
f H' <r w ir. (v ir mt t mi itr~a it o s o «i t ft 


r*.’ >xi p vr l-j if r~ 
CO- 0‘ <4 Cv O' u 


5' If-’ O' U ll' If K, |.' K 
P i/ O L ■ 0. L o 


r» vr p ui u, \c p' uj <r ► <t •»■ o p c r t tj if k *-» »f ir 
0 «r r <r cu. c u r x u p v ir p c u cv c st ^ c: 


tr a a <r cr o u - u. p. — o. 

O' O' O (7 O' O' O' C «T <T <X 
vvv<)'Tv<rc<jt<r 
<r<r<-5r^<i<T<Tctr« 


u «pu. o <t cr p ui i> 
<r<r«<<r<t<X<i<r<i 

<i c <r <r <r ^ <t <r *r <t 


p.- — o c. o Cv * IT vf p 

cn o. cr it a or o.- n a c 

CC^C'JCCC^C 


» < r 0 C'.xiU t ok 

a, x cr a: ci <r ir c O C 

<3 c c c <: c < c t 
■c c <rc <tppp<?p 


^ u a nr I) ^ cr «. Q: O 

o c* c V’t; t f o o o 

^ c c c c c <r ^ c 


oi» c — t. ►. >r p o O' <t cj 

f.rjnrrnc'C'rnnr 

«r < c 


r.) Cj U. p —< K -q c <r 
r r c. u* ix i- u u* ir u: 
•x<^rc<r>j< r c-y<c 
<r <r c < <r «• <r <r <* <? 


Page 26 


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


Number 22 


82 










o 

< 


<t : d X 
'£. X N 


f— <t rv. 

•. * «T 

O o O Q : 


M n 

-T 

Q -*J 


<t rv .o' 


rxxxxxxxJSvo vo 

-T — COCVS(S«J®VOin to 

<. ® ® ® *■ — ao cv ^ tv * cv * 


> u •- o => o 

• s_ X Cj O 7 
I U J <t f -j 


. 1 : x.in 

.7 o x <i 

mx jn 


<r o o *- 

u 'p <7 

J a- t .r 


•X C ' 
. y a v. 
JO> 


«] <1 <t 

itror 

<£JO 


<r t <r 
7 cj . 
<r x ir 


f- -«J .0 h di' 


l— t-; _u •:? x co co ui a co co cd cc tn 3 to r» 
"lltown QOnOOQQO Q wow 


<r q. <r a. 
1- o »-* o 


t u> f. t' c. it ^ it* e. tr f u. P- u - <■> u r> u *■" m a c. if- c_ u' <u u u. 

/*. O' C f, c K) KP tr f l£ »i/ h h O’ O O'- C I* • •* ' —• — OI 0; F. 

r c cr- o j. cr o\ o o'* 0 * <r> c cr> <r\ o- rr c* (r & o &. •* | *. cv- * v % 

S', o o: c\’ c o o: o 1 o o cv o< cv (v c c\ oj cv c-.t c o' cv »•) f> f. to f 10 f. 


. c. u. a. 0 5- u' ; •/■■e. u. c: m ® m ® tn &. in <& m e tn c* in ® 

> <r c m u' u) u. 1 h p » rr tr /+• ®6i——•cvcv* toio <r «r m in vo 

' c f e 1, ^ ^ r c r t t — — — — — — — — ——— — — — 

, c/ o h r r r.' r. r. r. ► f *. nion tnnioior tn tow 10 to 


in in c* 

R (M? 
VO VO P 

o>— — 

m tn ® 
ff.p p 
to VO VO 
Cl. — — 


Pi Cm S. in S. 

— to in <T «T 

IS P P CD(^ 

— C\| CU (M (\l 

f . 6 in R R. C. IT IT 

incuot.cv^f-*T®P 
vo— in in m vo p <r 
— ® cc 5. «r e. *s cl 


r. e.voco<tiocccvptocx,«.vou.inocj 
vo vo cr o p cr cncrvopo.^w^copco 
c> is- ■>* <r to to to to to <r to cw m m if. Mv m 
ui fc;-«T<r<i , <T<T5p<T<r^-is«T^r«T<r'*T 


c.' c< r»i ' — — k. vi- p cr u> o c " ■ 

u. vo vo p PP PP P P p r p pni 

o', in u u > u. u iT> u' if mu u u u u » 

<rc<r<T<ic<j«rc<r<T<j<ic<j- 


3: y i) cr a ft 

l u in u if u 

<r <: <r vr <? c 


T 0 rr a. o o 


If ir u< in u 1 /. u L 
C'- ?, <i<rvr>r<iv: *r <1 - 


a 3^ O' 01 tC’b U. U. ■ — cv to <r If• VO P e~ P5 K - P' IS 

a a o' <rr\ O' O' 00 <<r<r<r<r<r<r<ie 

11' u if. u' it it it u u inininmminir. invoppcoa. 

<r^c<r<T<rc<rv <r<T < 7<r<T<r < T<r c <r <r <r <r 


O — to cr 

00 — l») W — <V K- 5f _J <X — CV to <T to 

CO K (/) W P’ P' P (»• tv> X u: > P P’ P P' K : 
J<<r<«<r<r«<tar;j<ic<c«r«r<t 
«r cc o o o o c o o 0 u on o o c o 


X >- 

>- >- _J 
« O O -I 

•-« r o < 

•x o *< crj ^ 

~ n x >- <? 

x u 

P ZOld 

lij alQ> • 

f/> a. <t pj • 


O _J -J.J 

o ■«* <r <t <1 

• r> r> 


o 

P- .X 


l«i X 
f- X 

— o 

=J w-J 
<3 X 
O 


O X 
U UI 


_J J ^ Ul 

<t VI o > 7 


-x v 'ax tx.>- a.>- n a. C. 0 _i <t — o 


— <r><ro<r<ro<r_j—. —. <r p- 1 

r> hocapnciH a _j 2 m u _j: 
5^ cn c j <1 w j < if. tj — <r -> x o ■ 


o ^ 

7 

73 « 
O O O 
: — a => 
U> P- 

-1 — X i 
V V) iJ • u 
•v! O CL a. 
< a. ~ — 

uJ • 

11 • U. 
«J Z. U. 
X J o o 
P- <t 
r> H •• 
7 >- 

a — '■v 

p j j j 
■ o < <r <t 
> 

X P-. NJ 


J* -J 
*X 3 

• fi: — 
O CD 


fv ta 
( *IU.*H 

p- o o 

>• t 


_i r n; 

PJ <4. 

woe 

<t t 

O X 

P- tv 
P o 
1/1 Q3 


a. •— x 
H tn 
'y> jj oc 
o cv 


n _j >- 
<x \ • 

3 P T J 

o» ui <r 

S) 7 7> 
alU«X 
XU. II 
POUIU 
3 V 

fo ui *« n 

P X w 
< p •• 

t.'* h: 
Cm • H 
JPPO 
3 Z 7 
• a. -r 

I- >7 t- 
(OOW 
X o z 
— o 

U. t u 


c 

.•> p- 
>- cr 
II UI 
«r P- 


- JP 
<T — 

II > 3 


o: Vi 7; 

— u. — 
lf» u. 


O Pm 

x _j «r 

J1SU 
X o 


r.) 


«t(T« C 
' X> • 
X X c 


— is. cv ca v- o o 

UIW <T O TW CM V \ M. S i 3 i 

• p. «i • •. p <x •• cr it a* • • o 

p.a <1 r 

o 7 
^ — UI 


1 XOO 'J Ci < 1 


< m r > *- r. m > m — n 

■x f joxzr.<O^N-x«x 
UK i-«t J r <tn jno k 


w. .— — u o 3> x > 

• o— K-Czacar. OZO'. 


ii' j r -t r x s <r >• o *r x a* o* *3 — c 


U C. Z 
i ft! 7 


Q • • 


r» « ^ii-.tii' f .u c. if. <s. u r. uv c. I', r- u> & u' e» if\ c» if ^ 10 51 in & in u ir c» if. 6 . in c. uve in is me u> e. u 

to to ^ «r tiv m vo vo p p ir t n in e» cj —— c c-. r o *r <r u iovcmcpp axtMTiNN--cvciir, tn^«rinif vovoppornr 

»fv in m it it inif in if mifinm. irvovo'ovovovovovovovovow'Ovovo'0'ovovovoppppppp'P'e'PPPPPP f ^'P r " 

cv, c\' cv n p' cv o* c • tv c. o cv cv cv cv cv 01 cv 01 cv a: cv o 01 cv 01 cv cv cv cv cv o o> ci c o. o: v o 0 o- cv 0 c> c»- o cv oj cv o: cv o 


_ m e. in u. m ex m e* m c. if 

vo vo p p- - -- 


(k If. Cv If. t. IT & If L If c . II - u CU U U V- a C-. U 

orrr’O'O'^ea — — cm cv to to <r ^ ir tr *0 vo r- p cr c 

p p p p 0.' tr xi x j.‘ a- u, vo a no a o', a w*' "• x m i 

CV O Oi O’ O' CV O’ O. O' CV O' C o* CV Oj CV O' o. c O. O' c 


<r v <r «y in 
■q <r q q q 


IT ?,• 

Ui 


<T C C' IT <T If CV IS 

<r f, <r f q e f 


ir 

<r 


— u. o c; c. o to 

f' U U U U u. t>. 


1 • o p <t rr c\ <r * o o 
e t> 9 t, itit 10 y r, u 


ere? <r u to f 
c. bJixciO 


<r — — t rr vo cv — <rvo<r — cr 
c: e — ui p -jJ o tv p uiu r l 


— <T VO U. U. t*. e CP U VO P P P CV'T — u o ^VC-P 

f p uj e. e <r < p u: — — — n e- f o q- !■ p '--J *s. 


u — «r m cc c> o u. ti w » if 0 <x c. 

CV O. Cl O Oi 

u ir tn if u i»‘ u u v . if ■ u • u ■ if' u 

<r <r<T<Tqvr<r<T<jq < rirc^c 


u’ e to f- K’ tj f o k. r to m n k 

O to to K- to to to to K.' F. F F< *r> F' 

if m u u u in *n u x» u in in if. in 


kj f n t; Ki r F/ vo o uQuif f vo 

to to F F F. F. F) F F F F. F «T «T 

if uv if• u. in in ir< if' in ir if> if> u u~ in 

<r<rc<r<rqq<r<r^<r'Cqq<r 


p t o u s e e. 5 r. s v f i>- o 
q <ut <mr ifinvnirininirin 

U li lf U t u.ll If ll'lf li’ll H U 


« n o i«i u. & - <pr> v p x a 6^ a 

u if m m m vo u ? u vote v- vo vj 10 v 

ir, u if u. u> m in u tn iT'm in u mu 

c q <r <r ^ ^ 


Number 22 


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


Page 27 

83 




U. <T trl UJ 9 sp U1 tv V£? — 
<sT«7srr^^CMPCsTCV 

B00CMB.inCM«Tf~CMO 

UJ O VD '.•! £M vf •— <7 UJ II 

cv,o<rcjoo<Tcv<rr~ tr» 

p- sr co cr> cd to to ^ cv 

f- <r b u f- cm o U' <sj c\j 

to so uj — <r cj u <r ui «' 

c\jOs(Mr-<Tc^ir.ucvu' 

B IO IO O CM IQ IO in CM 

o sj cv -t b o <r n ^ 

CMMC 5. < UJ U? «t W -*3 
PI <3 U M' IT MJ w 

c\i on to in to u oi io u. u. 
<tuu«rcnrif ip«i <r 

u <t <r b <i ir ui to to Cm 
tvusrt.r~oCMO!CM <r 

M vc vr — uj U) u. vc vc 
r-cD^(Vtr<r«-ir<T a 

k> u. <r m to to cm so bj **. 
CV<TU.sTCVOjs 7BB t- 

r- to b a - so so so w c«i ¥ - 

sr e; bj b in ^ tr> o- cv O' 

cm <r so cj so c on ui u. »" 

<r «r u o b B r- < tn m 

U vC tf it u> U) ¥ r ►-> U, 

ts h«r<rp P 1 c P ' i7> o 


tv r u; ■%» t> u «* O' <c cr 

tr n ij r j <r r- o B c* 

p. srev'Vwou.J'U.insj -i 

<S <i t> tuj & \ <r >r <? cm 

f; o r" — «r u. u. — a u . t* 

.?• X' a' u. v« 

b «t it*. <r <r o — w> flv cm rj 

•? to <z <r c . to m -r r. to oc 

\ M< 'j t ^ <r u. k - \ 

f ^Q«r-«u -><fuvji 
tv <T O n CT- <T 5 <T *0 <T 

r k <r t. if c>. in u. u p, 

B U -7 ^J<7C If) U. U t. 

(V cv C. R CD S CM t^ <t CM X, 

r. r tv 

ts — O »<r -P B CT. (TJ — 

r. b r> o cv — fjj — uj B 

— '*• b u» tv o~ t- — in u, <7 

1 ^ |f> t f <r tv — to «r <x B 

— t? -r nif o p ^ n k t. 

*S- -3 ♦QWr-lil'SC’X 

b o u c» e u> -ij < <t a 

<v e u<rPi k ppr u 

r. r «■ ir 'T- «-p a' <r V 

T B K* 5? *r! C U’ ^ f»J y V 

&9Vb Sli^kP “T CV. U 
B R- sr * e. sr o C'K-I, 


B 


> — Q 
l» <A ui 
/ — Q 


&> 


t— D- 

ui h e> 

o 

T 

CC ID O 

E 

UI 

— <0C 

a. 

rr 

b-JQ. 


M, • 

^ CD C\i 

in — ^ b. 

— p • <s 

■v ~ - -ts 

— ~ Z ^ 

• ^ _J 

O u j H ffl 


is e- 
e» c. cw 
ts (V 

it cr cl> <£ 

in 

h a cl Oo u; 

=J ZD • ♦ 

tt. W 1/1 Cl D 


DC<IOr D OOO" 
w <U O COOU-OUQO. 

ti II it 2 C H 

hOXO^(3MS5.ce,S 
CD « — CVJ K. <T 

*->m CvLTCV(VtSOtSCS.CVtS 
OJ CM <T in VC <T <r <7 <7 <T 


tr <r 
<r u 

II II 

X o 


in vd 

B B 
*T <T 


t- a. t- 

X o II 

UJ f— —* 
Z W p 

Pi IS IS 
MT R 
BBS, 

«r <r cp 


If, ? -7 

o —« vn 
U W w 

• • l- 

(t O' z 

II II •— 

•V tv II 

X >- o 

c B tr. 

— cv to 

IS c. tv 
CC CD OJ 


~ z t~ 
t- a. • 
z = — 
*-• z 

II UJ li 

W or. cr 

fs C 6 - 
<r m c 

B B B 
on 00 £71 


H O X. 
UJ 2 UJ 
DC UJ 0- 

BBC 
— CV to 
B B B 


U’ <r cr t u u n- <r> 

MiPGviPin^p 


B c u <r o u c K m rr.c 
B c: U C.' n. <7 r~ B <T U. t*J 


U U7 

x cr 


<r Kj D If) Hi P P c B 

PiP'cetreDPKP to <r 


<X S U) U u. 

u <r UP- cr <r 


<rc'&-<r\<7'C'O.0'(r ? c <r> cr C7< c* cr>c o- a tr 
iriohtt^<rciU'Ci'U.P - p k <7 in w p n cr 
<7 v <mi <r <r «r c <r <i <r u ir d u u> ii' ru u it 


s> 

w 

ts> 

CVJ 

B 

<r 

B 

CV 

in 

cr> 

cn 


m 

CVJ 

CVJ 

B 

<T 

Cm 

CVJ 

B B 

to cn 

CVJ cc 

tU — 


m ts b in 

in t*- b b 

<71 — OC 

— CVJ CVJ — 

IT in B B 

to £7) in UJ 

£7* C7N m D- 

— — CJ — 

B m B B 

9 . to <r m 

co £7i in r- 

— — CVJ —< 


Q io cjp- lOoBm — <rp <7Du.«7P'U.wrr<ir 

OQU7«kPiWIMrs 77P7 ^ — P-t-CM — 

PVD<7Q<I'-<I’IUJP'UStO<IDW»ODlfUn 
^P-irUPiP’PKkKkSOk^UP 1 7k7 

BUIiO(U«TR>ITBin -T U CM C\, io CVJ O’ IT — <TI0«T 
KD<7k<f UI <7 S <r O e CVJCMlkJCMB£rir> BXB 

--u-wQtiioMninicMnuuJcr. <tnowai- 

(CStOKlli.kMTS'fi-JWUlDlOOlOf'P tOCMCM 


B 

in 

CVi I 

B B 

CD £7. 

*7 so 

— B 


in 6*. 


r~ r- 

<7 ST 


U\ B 
B r> 
O '- CM 

— CVI 

B B 

kj er. 

r~ — 

— cv 


B t-» 

to £71 

f- — 

— cv 

in cr 

so W 

— B 

— CM 


u in 

CM — 

^ to 

B ~- 

B B 
O' <7 
<7 — 


lOIOCM*- CMtOCM — WOtJP k C 5 IP 'O r„ umt 
7001.0 00^0^1104)7 0, 0<TPKiP7 


ir. ir 

vc r 

in b 

OJ to 


m in b 

in. in a 

in P. r- 

C „ r ‘ e. 


CMSTQUJB UJ C. £7 P- CM UJ «t < CM B U. U UMl k‘< 4 J 

u. <t — to no B OJ B — O U. m CM CM B li^ B CV B B 

K) UJ 7 ; <r S 7 IOi£)Ms(E<CEP-Q-U’-G<Jli J C 

ui-j w u sr o id n — uj 10 r- v o Cw <r " b cm o 

IP a\ P-IP Q U. ifl 10 P OS Os <T\ BIOS—- £7\-«ino — 
VUP <7 U<rt-B-oop'ippr. ojkjiou 

o tou.o<tx£c — p-ctcmo — oBcr — cvu m 

ts. <7 < B to ST UJ B — <7 -- — Kj r & r O o Q (v, <r 


B P SIP 

to or to uj 

Os IO B CM 

ts> ;B —• ts: 


b b m in m b 

m — to or, 01 00 

CM CM VC VO CV £»> 

CV-— B B 


B 

in 

to 

B 


r m b if 
O'. CM B CD 

— e. e. t 

I 1 • 


5) ip in ir 

t- B CM — 
to <7 p 1 r. 
— — — CM 

I ! • l 


m ir> b tv 
to sc B oc 

— to <7 VC 


if b e ir x m 

— £7- — if £D CM 

cm m —• on b pc 
B C. B -- <v. — 


in 

tr. 


B IT, in B 
|o If • to r- 

CM O' VC — 
— Oi — o. 

B B in B If 
r, D- CM CM CM 
— CV£7v< , ~ 

— tr cv — cv 
I'll 


B m B B B 
r in —to os 
B £7V m to «7I 

— — — B B 


If' u 1/ 

«r so C. 

to cr p 

B 1 CM B 


m in m b m ir p . in e b b 

<7 OjODP P P~ CM f; in K — 

B or to to B — or to — inio 

B — — BB — — B — OB 


oj kj cr cm sTF.tsinu.BB oirno^s-in<7K, 
CV V B C’ <7 ^ C ST - K IE « O o U If F. D «7 <7 1C 

OD Q B CD O <tBU. UJ— BU-UimiOlf' — £7\<TCMO 

UlU? ST U OB «TUJ — t«-B IS. <7-7 <1 C. OB^TO 

c;. to — bcmb — <ru. — vrujiocvcMBin. «v o* o <7 

U ST — B to ST — o CM B Uj fxJ C B U P' C> U Of ST 

rcMOc — Bu>BBrou><r<ru-Cvn<rusT«.ifO 
«ro ^ cvi cc. id c f. Mu - - < pj to <r src^^ u. 


Vj o UI 10 O' d f ip OJ 
to o C sr U B O' to <7 
intO<T»OK. K sr «7 <7 
<r <r <r <r sr <r <7 <7 <7 


U—BtSB<a.sj- 

— oj Q B b b b rr 
sr * to ou m u> sj 

srsr S7<7 ST VI ST <7 


O — U. C C . <7 10 £M 
tSP BBCT, UiO-crsr 
in to iiipv si if m sr 

S7S7<TS7<7S7<TS7S7 


0<TUJBir «r CUB 
tO Cs BB — U-BO«B 
to k) to uj k, sr in if u' 

<7 S7 ST ST <T *T <7 *T *T 


If'CUCC 

O O B B 

to ro u u 

S7 S7 ST S7 


uj sr t^ ts 
e B U B 
U' if sr ir\ 
<T ST ST SJ- 


cr to u 

B B B B 

u. in if in 

<7 <7 s; s- 


e — u. u* 

U R U U 

sr if si 

ST ST ST ST 


(V D B. 9 ST B Cw vf. U. <T D- lf\ B If CD U . <X <T a’ Pi 

IS U F (J 7 FF UI 7 P <7 7 <7 n <7 <T <f k P fi P’ 

cm to — r ocr—truer, unto — toBK-sTKom 

P 7P,7tCI5,PMS.'E6K klfFt. C». PK <7 

Hi Uk - 7 IT7 7 ui U. If P t) 7 c - 7 7 r - u 

UJ to B tO K" 77F-7UIISOPIUK IO 7 P’ O B 


u. f- n — N K — V V> — O — <VI CL O B. — O f— UJ O 

j ch r •-> < 0 13 . a. a. a. ? < o. cs c a >- uinnporih 7 x x < cr tt t-_jf- 

R'U 7 -< 2 lD 000 CCCt- 0 <r<r-X Z f M If' Z Z O >- H h h « O ffH E 

CflU. 1 -HMO.a. C.C-£Laif)hJJJO^«l-77l' il -slJnU)UJUit-p-h7< 

oddc nncococ c c. o u u U u j jraanao. cr. tncntnu. 


U' O tr U O n UJ C — — — ..—.. ” ” .... 

C. WDUiO'OJirSUiDrOJtt'O-1 O' O' O' O O' O 9 O O' 9> 9 9 9 0. O' O' O O 990 

C.0.02X3<rU'02I3«rUJC <L R - P. r 7 If VC P B.' f 7 III U f U’ I., K - P f, 7 

/ 7 U- O I— I— J> P k Oh I* J 5> I io D t- io f' k. t> r t, io to n io r. io r; <i ^ ^ ^ ^ 

SSVVXVVfV^i-V-R V-VX-K 


Page 28 

84 


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


Number 22 






U! 

2 


<T 

©ft 

DC 

o 

o 


to 

cr 


u. 


>- 
s r- 

Q 
— UJ 

ft- o 
<r 
o 

CC _J 
Q 

o ac 
<r <t 
CC 
H*U 
CO O 

<x cc 

_JCX 


. — — w 


c * 

D. CC 

UHH I 

>- war : 

U! O, O- C 


G Z 2 2 2 


cr 


S S ( 
is S I 
V£ s t 


2 • * 
— C t I 
J » 1 

h K K • 
=5 K >- > 

• a. r t i 


o x 

• IS UJ 

■ O z 

lft t ■ 


ft -J — — i 


>■ roc 

C h- UJ O ( 
<i to cr 
UJ — (St 
cr j in — - 


2 Z 2 z : 
7~ I 

u i k cc a a; i 
a. a. a a a. i 

s s K k k i 


j «r ir in —-— • 


=3 C 
. in h 
j o o 

: ID id 


• u 

* UJ — 

; cr. — to 

u s u> 

tO >- Pi 

j ♦ t- 

: cr is — 

■ s <r X 

s uj ^ _i 

— j o _J 

o cr <r 

: o <i o 

her n H 

. o 2 UJ Cl O 

'Ofcicr 

IS. IS 
S K a -is• — 
- o «si cr. s is' 

■ — cv cr — — 


uj 4 ~ 
7 UJ- 
— lft VC? 

-J cv — 
• r-~ 

Dt S — 
<t X w 

2 O' ~ -J 
O' Q ID J 
zd cr <r 
H V <1 O 
U1 U’ il ii 

cr cr c© o 

g 5i s 

c cr IT. — 

is cr is 

— <7 IT lft 


w 

2 

Q ft- 
2 CV 
CD — 
O II 

cr — 
cc >- 
=j — 
to is 


~ <r is in ir> 

J 2 cr v ft ft- f~ 

| _j cr g — CCl C\i Cv, co cv 

*T=> SO - — =J — IS 

. o h r ii w ii n to ii •• 

II Ii! W S O 5 *-0 5 ft- 

c* it ir x c >c. >c ir >• x 


a. 

to <r <r 


re <r 
c if <r 
II c\j 

G- 

2 X 
<T - O 
•V I— 

a. ui <r g 

r> n s - g s 

«S l IS IS 

f— >- ii Ki ui cr 

2 U! •• I 

— trio-stv'scacn 
: — s :=> — vc? x ro r? 

) " "" to h- V II ex Ii to to 

. — — r o K UJ 5 o r, o o 

' X >- X to IV i X U. X o o 


«S is. 


is ir- 
> 


S S 
CV IS s 

l is IS 
m in cr. 

i 

<s ao cr. 

>-=>=) 

ii to to 
<s o o 

>- ID ID 


IS IS 

K IS IS ' 
4 is IS 
MT. CM 


II lO to 
KOO 
X ID o 


Cm CXI 

>- m 
n to 
•s o 
>- ID 


to X ex X 
CWOU' 
U 2 U 2 


cr « 
h- >- 
to II 
fr- — 

IS o X 
— 0—2 
cu ts, rr 

o x ZD 
f— T H V- 

O UJ — UJ 

id cr x cr 


& ts cr- ts cr s in s <r. u> r» r. ^ s <* c o 
cj K' <r c rs — n cv k- <r <r in vr r o r* o 
SSSCTSSSSSC SSSC CvG—c;. 

tr in L'' in vC' vfi. vr vo vn vc* vc? vn vn vc: vn vc. 


s s s s s s s r, e; ® g s e r. t s g k is e> 

r — p ^ s ir io h cr <r rs — o r<rmv^r-<rs — 

>. S s S S S S S S S S is S S s S S S CT| s s 

r'-r'~r-r-r~r—f'-f'-r'-r-cc'cococx.O'.DjiX'Ocx.cTicri 


OSj 

O 


o — 



Cv, 


l- »-* 


fN 



5- 


Qu 


r- 

u — Ci 
V (T X 


CP" J 
G Q 
<7 0 7 
< C 
h- Cr 


>- 

G 

<r 

W 

ft 


UJ C 

a. g — — 

CD ZD • Z' 

oh a c 

-J — r- • T r 

^ U t" * r C < - 

w x <r c <r ir x f . 

ft. h- > <7 4 — CT' 


— • C\ *7 !• * — 

r'G^ — c s <r s - — — — c 

— — C x < 1 ' 4 «IC< • t C.CUJ. o •— 

S'-o —"svvio • • • c. 'j n 

^ J J I- H- <T *— CV f • h h - C t/ f \ c 
O-J ; 3^ ? OR'tt 7 1''" 

ft. <r >: •- a ii n •• h h a n « •• <r a r 

<r o uj cr z <7 — c\ ► — cr z< — co f »• ii u 1 

ii ii o t h « < < <i o. a h t x r " C5 ct 

X 


h S p S Cv s 15 s c. s s s s s s s t 

itpgc -prsif'njhcr^K-KK-cG 

»-. s; — 6. s s s tv p ssse — — —— s 


i*’ t ; ~ 

o *-* 

r«- o i r 

U’ • * 

f- !»', 

to <r <r 


o g 'r 

h- • • ^ — 

f- »- «7 U 

t W W VC V»' c 

to 2 • • S 


CT 

S 

K 


ii o m x >- p vr> O'-' 

U t** IT b- ^ ^ *- L f ^ _J 2 

h- • • • • t— H eti (V U J J ^ 

— — 4 4 z 2 r* l- ft • 4 e. < r> 

u <x <. x x •— •— tv x o ci o <i o h • 

c ii ii •• •• ii ii o u* i— ii ii ii ii tu 

U >- > x >• g u cr 2 to g g x 2 ) a. 


s r. s s s c e s r r ts s s s s 
^ c x<7ir vnr-crrrs—c\K<r 
SC- SSP. SPSS — sssss 

r ft ft’ ft cv ft ftj ft. cv ft ft ft- r- ft- r- 


co 

U’ 


to 

<r 

7. 

K) 


to 

o 

2 

o 

s cc s 

4 . <r * 

s x e. 

— k> — 

ft- ft-: 


Number 22 


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


Page 29 


) • 

J 


85 




DAZZLER DRIVER 
Subroutines and a'Chase' 


BY PHILLIP SIMPSON 

1043 Shandwick Ct. 

San Jose, CA 95136 

Dear Jim and Tom: Received: 78 Jan 6 

After reading Joe Sanger’s article Video Chase for the 
8080/VDM (DDJ, May 1977), I began to wonder why all the 
software for video display devices is being written for VDM’s 
while I sit with my $200+ DAZZLER watching random color 
patterns. What happened to all those people who bought 
DAZZLER’s? Why aren’t they writing software for the rest 
of us? 

The solution was, of course, obvious... the reason I spent 
all that money on this funny looking box with the blinking 
lights was for the fun!? of programming. So I undertook to 
convert CHASE for the DAZZLER. This accomplished, I 
broke out the subroutines used to drive the DAZZLER, added 
a few more bells and whistles and created a DAZZLER 
DRIVER. What follows is a description of the driver and my 
adaptation of CHASE! I’ve also included some examples to 
show how it can be used for display of moving objects and 
alphanumerics. It can even be used by a BASIC program. 

One other note for those people who, like me, have a com¬ 
puter without a front panel. If your DAZZLER mysteriously 
turns off from time to time, check to see if you have imple¬ 
mented the power on clear line. In my case, the line was 
floating and random noise would turn off my display about 
every ten seconds. This can be fixed by putting a pullup 
resistor on pin 13 if IC 58. A simple solution but it took me 
almost twenty hours of trouble shooting to figure it out! 

Keep up the good work! 

Phillip Simpson 1043 Shandwick Ct. 

San Jose, CA 95136 

DAZZLER DRIVER 

The DAZZLER DRIVER subroutines form the basis for 
a comprehensive display driver for the DAZZLER video 
boards. The DAZZLER itself has been described in other pub¬ 
lications {Byte, June ’76, Popular Electronics, Feb. ’76) 
so I won’t go into any detail here. Below is a description of 
each subroutine, not necessarily in order: 

TRANS-Urn 1200 

This is the core of the driver package. It translates the X 
and Y coordinates into a memory address. It assumes the 
picture is in the 64 by 64 resolution mode. If the X and Y 
location is in the left half of the byte, the carry bit is set. 
This is a modification of a program that originally appeared 
in the December 1976 issue of Byte. In my version, X=0, 
Y=0 is in the lower left corner of the screen. 

ERASE’—Line 7620 

This routine will erase 256 bytes times the number in 
the A register starting at the memory location in H and L. 
CLEAR- Line 7700 

This clears 2K of memory starting at the location contained 
at ‘MEM’ (line 0222). All routines make reference to ‘MEM’ 
for the starting location of the picture. To move the picture 


to a different area of memory, just change the value stored 
at ‘MEM’. Remember, it’s least significant byte first then 
most significant byte. 

PLOTB-Une 8040 

This routine will plot one element on a 128 by 128 grid. 
X and Y are in B and C respectively. If the carry bit is set, 
a white element is plotted. If the carry is reset, a black element 
is plotted. My original version of this used bit rotation to get 
to the right bit within the eight bit byte. However, after seeing 
Lichen Wang’s solution to this problem ( DDJ , Vol. 2, No. 8), 
I adopted his method. 

PLOTG- Line 8300 

This is used in the 128 by 128 mode. It will plot a figure of 
size D by E on the screen with the lower left corner at the X 
and Y location in B and C respectively. The location of the 
figure to be plotted must be in H and L. The following 
example plots a flying saucer on the screen, then moves it 
from left to right. When it disappears off the right side it 
reappears on the left. Note that the figure of the flying saucer 
has black elements on the left edge (The routine plots X, Y; X, 
Y+l; X, Y+2. ...X, Y+n; X+l, Y; X+l, Y+l.... X+l, Y+n; 
etc.). This way it erases itself as it moves across the screen to 
the right. 


7039 


9618 

* FLYING SAUCER 

7030 


8815 

* 

7038 

C01978 

0100 

CALL CLEAR 

7033 

->E7F 

0105 

HVI a7FK 

7035 

B38F 

0110 

OUT 6FH 

7037 

816060 

1080 

LXI B/ 6868H 

703A 

11088E 

1685 

LX I Dr 6EG8H 

7C8D 

211D7C- 

1010 

LXI Hr LQC 

7C18 

E5 

1011 

LOUP PUSH H 

TCii 

05 

1012 

PUSH D 

7C12 

C5 

1013 

PUSH B 

7C13 

CD1F78 

1015 

CALL PLOTG 

7C16 

Cl 

1616 

POP B 

7C17 

Oi 

1617 

POP B 

7C1S 

El 

1818 

POP H 

7C19 

64 

1626 

I HR B 

TClfi 

C3187C 

1621 

JMP LOOP 

7C1D 

86 

1823 

LGC DB 83H 

7C1E 

0008 

1824 

DU 6836H 

7C20 

fffiin 

1825 

DU 1C88H 

7C22 

I43C 

1026 

DU 3C14H 

7C24 

3WC 

1827 

DU 3C36H 

7C26 

141C 

1028 

DU !Ci4H 

7028 

6808 

1629 

DU 0S08H 

TCZfl 

0600 

1030 

DU 8000H 

7819 


9808 

CLEAR EQU 7819H 

731F 


9810 PLOTG EQU 781FH 


Page 30 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 22 


86 




Figure 1 shows how the individual bits are plotted. 


BIT 0 
BIT 1 
BIT 2 
BIT 3 
BIT 4 
EIT 5 
BIT 6 
BIT 7 

00 00 06 08 1C 14 3C 36 3C 14 IC 06 08 00 00 
























X 












X 

X 

X 

X 

X 

X 

X 







X 

X 

X 


X 


X 


X 

X 

X 







X 

X 

X 

X 

X 

X 

X 











X 

X 

X 






































the game ‘board’ is 32 by 32. Each square is made up of four 
nybbles. For example, to put an ‘X’ at location 5, 5 load 5 
into both the B and C registers, 96 hex into D, 69 hex into E, 
then call PLOT. 

GET—Line 7210 

Get returns the value of the two bytes at the ‘board’ 
location in B and C. It is used by the COMP routine to see if 
the location contains a man, robot, or fence. 

COMP-Line 7505 

This tests for the presence of a figure at the X and Y ‘board’ 
location in B and C. The zero is set if the figure in D and E 
matches that at location B and C. 

Access From A BASIC Program 


HEX DATA 

Data is plotted most significant bit first. Grid can be any X and Y 
dimension but 8 bits high makes it easy. 

FIGURE 1 


PLTBY—lAne 8835 

This plots the nybble in register D (the four least significant 
bits) and the X and Y location in B and C. X and Y should be 
between 0 and 63. As with all of the routines, if the values 
exceed the limits the more significant bits are discarded. For 
example, 96 would be truncated to 32. 

PLOTW—Line 8545 

This is similar to PLOTG except that it plots one nybble at 
a time. Although it was designed to be used in the 64 by 64 
mode, it can be used in the 128 by 128 resolution mode. X 
and Y must still be less than 64 but the display will be a series 
of dots depending upon whether or not a bit is set. The 
following example plots the letter ‘A’ on the screen using 
PLOTW and the 128 by 128 mode. 


7C00 


0018 

+ PRINT AN "A" 

7C00 


8815 

* 

7C88 

CD1978 

8100 

CALL CLEAR 

7033 

-3E7F 

8105 

MV I A/7FH 

7035 

D38F 

0110 

OUT 0FH 

7037 

011D1D 

1800 

LX I B/1D1DH 

703A 

118403 

1885 

LXI D/0364H 

703D 

21167C 

1810 

LX I H/LOC 

7C10 

CD2578 

1815 

CALL PLOTW 

7C13 

C38966 

1821 

JMP 8 

7C16 

1758 

1824 

LOC DU 5317H 

7C18 

0389 

1025 

DU 0903H 

7C1A 

1558 

1826 

DU 5015H 

7819 


9880 

CLEAR EQU 7819H 

7o25 


9818 

PLOTW EQU 7325H 


Gf 77V—Line 6035 

In many games, it is necessary to see what is in a location 
on the board to see what action to take next. GETN returns 
the value of the nybble at location X and Y specified by B and 
C. The value is returned in the four least significant bits of the 
A register. 

PLOT -Line 7003 

This is the first of three routines devised for the game of 
CHASE! Although the DAZZLER is in the 128 by 128 mode, 


In order to access the routines from a BASIC program, first 
POKE the values needed for the various registers in the 
locations provided (lines 0200 to 0215). Then CALL the 
appropriate routine. 

BGETN -Line 2125 

This will get the nybble addressed by the X and Y bytes 
POKED into location BC and put it in location ACM. 
BPLTN-U ne 2310 

The nybbles stored in the least significant bits at DE are 
plotted at the X and Y location stored at BC. 

BPLTB—Line 2310 

The low order bit of the byte stored at ACM is plotted 
onto the screen at the X and Y location stored at BC. This is 
intended for use in the 128 by 128 mode. 

Here is an example of a program that takes the X and Y 
values and the color (Z) and plots it using the DAZZLER. 

LIST 

19 REM BfiSIC PROGRAM TO PLOT COLORS 

20 REM IN 64 BY 64 MODE. Z IS COLOR. 

30 REM Z IS IN THE RANGE 8 TO 15. 

46 REN 

108 COLL 38745 
105 OUT 15, 48 
288 INPUT "X=";X 
205 INPUT "V=";Y 
218 INPUT "Z= H ; Z 
309 POKE 38721/ X 
305 POKE 38728/V 
318 POKE 38722/ Z 
315 CALL 38766 
400 GOTO 288 

READY 


CHASE! 

The rules are the same as in Sanger’s version. However, 
scoring and comments are output to a teletype or TV Type¬ 
writer rather than displayed on the screen. Also, there is no 
compass rose displayed so you must remember the moves: 

T YU 
GH J 
BNM 

where H means no move. 

User supplied routines are: 

MONITOR 

Puts the address of your monitor at 7CCEH. This is where it 


Number 22 


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


Page 31 


87 




iXIO 

> ^ *» "l 

! '3D OD 03 


• O O O -J * 

’dd a! 2d 


i «3D IT> CO 
> UD MD r- 

»r -.i i-.'i fs-> 


LO 'oD .3? LO • 

r- r- rx> co * 

r -> ixi r<i rx* i 


i5co_j: 

: C£o>: 

: uj co cd , 

• 32 ccsr : 
o 


» CO LOCO I 

i CSC* CO xH ■ 
i 


ggg 


I- 1.0 C3i l 

XUJLOi 
[y zs. Co 

21—«UV 
t— UJ * 
UJ 2D O «, 
IDO' 

i— c*c cc i 


• *S> CO lO 
I CM CO ‘3D 

■ '** '3D co 

• xH CM ifvj 


CO LO 'S* ______ _ ______ r ___ 

•h ■h c\i c>j iX« fa fa fa ud '-jd r- c5 co co xH t-h cm cm r<i fa ^ fa fa gd 

CO £D CO CD CO CD CD '31' CD 'S' S' CO CO CD CD xH xH xH xH xH x-| -xH xH < x-l xH xH xH CM 

c\j <Sj <Sj >:\i c\i c>j cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm cm 


SI is * 

h— O ill I— h- 
j CftfiM \j\ 

li£!£R32 j£l 

< UJ UJ 

IUJGQ, >0 23 
JZUJEUJ^ 

) x ^ X X ZSL 
>— UJ !— H- f— 
J 33u— UJ UJ 

ZOZIhLL CD 
- Ce.‘ UJ K— CC CD ClD 

*■ *• fr # •* ■* *• 

i IO CO LO CO LO CO ‘3D 
) IO UD UD r - r- ClD ‘3D 


_ co o it 

X O Q d UJ 

_i££owE 


•3> ID '3 LO X LO X IT) X' 'S' l 

•r\j od r- 'i r -i *#■ u*i id '.£' CC' < 


co 

r- 

. <f X' 

j r-- cti r- r-- r-. r-- d r_i hb 
IrTNQS'QHQ-HUJ 


8$teC3i£3 


'3 ij,. 'O 


. UI 

! I U_ UJ 
• o Ct 


c3,jcc: 

•-0 x o *: 

' 'X x o£ 

1 1 — _ 1 x 

CCiXtiJ 2 - XXCCXCj COXCC^-XcXil 

1 £ 2? ~i £ Fb p 'i ^ S uj uj c£ co § i*\j 5' 

! >"• H~ * C2! 3 

uj u_ o co or *—• >- :> *—1 ct: cti z^- *—* z>- 11—1 : 

33 —* »~h z e: 2 o q -c n a: z q co Ci sr n < 

11 — 23 o_ <:c u a: s: 23 rc ^ ^ e i.n k: .x: *x •->: 

Cxi ,cr i 

J»L J|i. f Q.; 


‘3>3>*~»Z> 
) O O CO o 

: a: ■&. ui b: 


1 £ CO 

• COO ^• 
l OCl£ O 
: tea x 


LO CO S' 
'Ti • Ti ‘3D 

cr» a-. C2* 

CO CO xH 


U .»'S* U"!* «Si -3D U"i r>- 'S' IO 'S' b~ .S' U“> 'S> U" 'S' IO »3D U“« ( 

c\t 1 X 1 ix* rf .S' -3D co th r<* ^ cf to u*> 'ai* ••i!' r«- r- co od •: 

•-uj 'S' 'S' S' CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM < 


x-l xH x-l -cH «H rH xH xH tH xH xH xH 


• CO LO CO LO 
» CO CO x—I xH 

1 fa (■<1 r-*> ro 


•S' ‘S' 10 

cm ro r-D 

rv> 1 x 1 

xHx-l H 


gj-o X 

03 CU 

•C w ON 
1-. rn 
CT3 - X 

OX ^ 


ui- U 'ji.' :^i 1 \l IJ*I 


5 ™ 

D-INpH 

, S r 

» hk 

) u 


V N _ 

m o 

C/3 

5^13 

fad's 

oa w 

r~- 


'§0 

uj r-~ 


| § 



# * * -v # 

* 


I * X 

CO * UJ 

x i.n * ce; o 

a= * r- ce; 1 j] 

arr i t: ass 

_ 13 ^ xlD 

NO * C.J CO X 

r-j ce. *■ 's. o oc o 

X * CM I— OQL 

id * -rH UT U. U_ 

* 


X 

§ 

OOQQ © 

2233 Z 


Ci UJ ft ujO> 3 : ZZijj 

X I— Cl. Cl XI— I— XI— X 1— 1— h- 

§ t-£uS§Sdo!§a!£yS^& 

o 

r-- CLa.LL.LLiiixci.CLa.ij.Q,Q.a.LL 

eesessseeeSees 

"~vr o O O O O O ►*) *"^1 o 


S3 S3 
ouju uj 
iSoiif* S3 * 


CO CO CO 'Xj 'X' CO 'J’i Ci X Cl CO CO CO X 

r- r- r-r- r- r- r- r- r- r- r- r- r- r-_ 

O '3 S' X' X> rt r-H !'•■) tH CSS UJ UJ IN. CO T-- U. X T -- C 

llll I 3 §nS&§ 8 §S§ 8 B 8 


X* X 1 X> X> dx> X x 


Page 32 


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


Number 22 


88 






LTl 


O'l 


X X o 

az<£ coc£ 


xx: as: x _ cS e 

.. *. oo i” *1 co r~ ^ 

O UJ Q30UXUJ x X CO 
_ x x x x 

X_>X-J>-Di-x:>I»-C0XCL.>-Q£:0-:> CO X X Is- Cl. t— 

-~-■—■ ~d x o o :z o o x> x o cd o x 

— — * cx e: o. o i5L e ci- c«c 


Q£ O X O CD X O CD X CL. c_> r_j . 

KJCttEECtEECcOlXE' 


vll 
x + h- 
cri i— ;i- >~i 

UJ2WZ ,2h- 
X >—I 13 H x >-1 7r- 
'X Lfl CO LjJ 

a. co uj co :c x 

SuJ uj x o t— x 

oi i— i— >- io etc cd 
CD Z- Ci- !— X X X 
X X X X X r-j ►-< X 
X X 

EC X C3 X O X I— X 

oiujiot-ixti; 

Oh-Cth J«H 1.0 x 


X rH X 

h* Cl. 

X l-U X X CD X 

iflOO % CD o 

p aatfooi x cl. 

CO. 


is- x ru is- x. -H i— 


-* i —i L4--*■ uu. i -j i_u. c-i r— 

CL. C? r X O Q j; :■£ o S-= Cl. uJ 
1 C Cl o ll £ O sc OIC cc: 




o 

CD 


I—I 

CC h- 

O 4;- r~ 

I— Cb te . 

LD h- .J 
LU CM U ! 
y 

»—<> LU U*l 

i— to lu :c 
id *x t— 
o cc: !— 

cc: lu cu x 


*• ■*■ 


U") CD LD CD ID ‘xl 1 ID CD li .* X* LD CD LD X* (\> LD CD LD '3D LD CD *3? tH Tt* LD CD LTt* *3? uD 'Cx* LD X* LD LD 'ID* uD X' LD CD LD CD UD T *- X tH l-d *. u T -— i'j"i 0 'i 

CM 1*0 M rt in LD L0 LD r- CO CO ON ers OS CD CD* t-) -kH CM CD CD CD CD r-1 x-l CM CM IV* CD ^ *!D T-i r-J CM CM I -*;. r<* vf- Tf v*- u -, ,x» d* .'d 

CM £M CM CM CM CM CM CM CM CM CM CM CM CM CM CM T O CO CD O') I*'-') <*• *** •'*' Tt* ^ ^ uD UD IT!' l*D L“i LD LD LO LO L"!' L"!* LO '-O* ' 0* lD '-Oi >. 4:1 

r- r- r- r- r- r— r- r-~ r- r- r- r- r^. r- r - r ^ r— r*- r- r*~ r- r- r- r-- r- r- r>- r— r— r— r - r- r- r- r - r- r- r- r- r- r - r- r- r- rt. rt. rt. rD. r^L rZ rtl 


co 

r- 

rt 


CO 

r- 


CO 

r- 


co 




: ■UJ 

UD u? X r-H JO X ^ ?'< X X CT-I 
O Ci CD r _i X lO CD rL Cli O r_i 




X 

CD 

1.0 




U1 X 


x-i X 

ro .j 

x 

o Ck: lu 
z lu 

XXX 
d* o 
X* —I C J 


uD CD' LD r- x 
IT.' LD LD tO 
O? CO CO 
Cli Co 'jT' 'jZi 'j5 


feu 


t.l'l 


S O x 

= fel/l3 

1=1 X !.J*I H- 

uariuo 
21 1— x •—• 




uo 


X CD XX f 
-. X ’ 


co 

X 
x x 


ElOIO % . .... X F- .. X i~ 

XX XX XX X X X X X LlI X X X X 

— XX 


Slxxxx -—. — — 

x u'i co co x>x»x>>iiixa.ii>ci£iiw>Xii>CLCu— 

t— XXXXCtiOXCDCDXCDOXXCDOO-:OXXXOXOX>X 
OXXXX>CXXXXXXXXXXXXi-‘XCl.XXXKXXX 

I 


y 

21 CD 

_ m 

SXc0rHLLii= 

1 LU -kT fe l* 4 * 1 

l— |— O If- L2 *— 4 
LU I*“ •—* % 

x x i— x x x x 

X X 

F- LLl UOOK=(«« 
X X O X X X 
CD I— —IX X X DC X 


XXX 

^ XX 

_I U 1 U’I 

ID ID 
Cl. Cl. 



, CC» CO Oh 

'si.1 'sO to to 


>x* 

r- 

co 




K3sOlS2a:P2Li^K:!>!*«!i3SagR!SEl2K8SKc3aa 


X 

r- 

88 




rlUrlrl'HrlrlUrl'H f.J UD X C- uj CTi X X 'X X X X O xH 'X UD LO r - CO X. X X X X X -H C\l I'D i'O r-'i lO f 0 TO fO M TO M CO CO X t-. 

gglggglggggggggggggggggggggggggBSgggggggggggggggggN 


X 

XXX X H- 
X ^ -X -X 
MOOOiL 
X 

_I :>■ Z> X L> CL, 

X £? X X O X 
X X X X X ■-> 


I— I— I— X 

i—* X 

Xl X O o CO 
H- t— •—i CiJ 
QtCZt-rl 
XX >~ I X * 

a.r - 


x 


!5 


£ 


a = -iL 

X Xii£ 

X 

X>>IXCL 





U*l 

H- 

&xSe5 

S 

X 


I 


—. -- _J > X X X X X> |~« I— 
x&xoxxxxxxx 

_i M 3, t > »—■ rr- tk rv\ ck~ q «v 


UJ X 

uvZ2 


UlO^” X . 

X ** 2T fe X f- 

* ‘ ►-* O c<i LU 

_ CJ h~ CD 

5 2 : fe fe «? e~ " ^ w 

Cl. hh L— wm __h* C li 

I— CO CO UJ x-l 
HlUQir tl~ 

O i— *— CO CD LU CD D- U*i 

_I > Z O LU X Ul -.ID 

Ci. CO *-• -J CxL »— C*L' >C HI 



CC* 

r w 


CO X 

x r- 

•ru to 


X Oi 

r- r- 


ril Q iXl 


ci CD CO 

^ ^ ^ Xi fe L 1 * 


a* co co 

r- r- r- 

C0 Ll) ll. 

CD r*0 Cn CD 

ftgoLuNr-N r-- r- 
^inOr-C^iCDCDCDCDUJLJ 


r-r- (ccoulcd re*ro roro r-oooror-o^o r-co rod*u.u_' ul. u. u_ ll. u.Lo cm cd : j^ r - d io cjcj lucd tHxH x-i ^ tHxH ,h h 

^&5&se5E5E5gSSS^SSSS88SSSSSS88S88SS8e8p3$SSSS8SSS8388pS8SPS85pS9SSSS8SS 

r~ r-- fv- r- n r- r- r- r- r~ r- r- r- nnN-P- r- r- r- r~ r-r~ r- r- r- r- r- r- r- r- r- r- r-- r-- r~ r- r~ r- jc_ r- p- N- r- r-- r-- r-- r-- r-- r-- r~ 


Number 22 


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


Page 33 


89 




—* uJ CtL CE O rH 

cci —* o ►— o ►-* hr k — Or 

3 Si 8 coco Sob 8 s! 8 8 

Ci CO _J Q U-IODII 
aociuixju Ci 
JxjuiJ^|,nj^j ! xa, ; jac..gce;ci,La.Q; 


Cl. i-i CeC 

QO CO CC CCE CO ©OS 

CCiqm i-h p to *. 1 —i _I 

ci __hl u-ujci -jaru-x ui 


Ci l.il 

iii cq >-1 iccc 

:c -i: o a; P- iu 

| — 1 -l 1—4 ?JJ ' >' 


UUJ —MX —IUIJ.X >11 —I IL XUliJ —IXXi UJ '_' 

Cl CO Cl X _l X X _l X —I Ci'XCi XOX X Cl CM C'iJ X _J 

cijuiJWliiJWJiQ.Jft: Jcco.a.a.^ in c>x crixxo xac i— c>xr-c_i — 1 ~ cl 

xo iDipbEoSooxoNXzEoooNXIrzDxSji-o r-j ujjohxi uj u'i © us 

US DC I.i'l X c_i X X O CL r_i X Cl_1 Ci *“> US *—* X X O Cxi X U'I •—' Cl ■“> IX CO Ci O CfiXX U'I >—■ Cn XCCOOQ X 

_l I- 

© X I— Ci O 


Ci i—i 
► —I i*y i *H 

CmC CD »—« 

X _l X * 


c i— . 
hi >—* x x x P> 
I— co p <*; C.i 
o i1 j £s x c 
CD J« V- 
Cl uj X 

uj i u x r-j x 
x cic x <<■ •—i _j 
i— :o i- x ui 

O CO XI 

JWI- 2 U.O 
CL X X •—1 CO X 


s> S' in © uo S' uo S' in s> uo © dd © u-s © dd s> in © in © m © uo x s* in © uo s> in s> in s* in © uo s> in © in us r — © un © iio s> do s« 

o:> sis> x x c\j cm r^i f <i ititiraouwx x co co j> as © siriHri cm cm r-sos rt- t do uo ms us r- x co co as as asas co © x x c-j cuos 

Cxi I'OCO I'll CO CO CO CO CO CO CO Co CO CO CO C-J CO CO CO CJ c? 't'lt '»• If t)- «J- vf Tt ij- 4l- <1- <J- Tj- 'C If «t 'C O- -X -J- O- *f«t DO DO DO DO DO DO DO 

u.iCOlOCOCuCOCl'lDlCOiiOOic6COOCiiuCliOjCuCOOJtOCOCCiCOOjCDCl1 CO COUCOCOCOii CO CO S' CO CO CO CO COCO CO CO X Si CO CO 'CO 


OS CO 
X X 


CTi CTi CTi 

r- x x 


CTi CTi CTi CTi CTi 
x x x r- x 


§ £31B 8 8 8 § 2 § £ 3 ^ 118 § pi zd ft 8 2I $ 8 81 & 13 8 7J j§ £ 8 ft1 § 8 


■ itmq n >: 
«£= _j _ j Q' 

: cj «x en cn sz: 


> or* oj re ■«*- u“ r 

i xH tH tH xH rH 1 
I x-i xH xH xH »H ’ 
' 0C» CO CO CO CO < 


narix 

■ >—* I> Is- l—l ? 

IZOOZi 

: x S x x' 


' 'ii* IT!' CSi U“ •: 
i r <» i s -o xf xf i 


• <X» CO CC« CO CO 


b'efxpec =u3 e a 

«.« X :> > x 8 X X > X X ® «’ H C " J 8 

!§££S2&&ggg££3ggg88S8g 


I lU 1,1 I 

88 ,^o 

x O uj ui x 

X. X X 

jS t G 5 3*: X .8 

--- uj m xxx 
XX . P X 
U'I U'I Ci Cl CO 

-J CD S * 

O Ci^ LU O CO 
■^LuLU-^U. O UJC'iJ 
1X1OZC1O JCOtH 

#*■«•■«■***** 


:T. Cl, 

r- r- 

:X« *JD U. 


LL. U-. iJO T : Jjkt J II. 

r- 't <S' cd 'S* u. 

EJK:^£3&S!n§S^£aeaiiFea!2Syj®u!s^eJWS^KHiEaieSfcS8S8}3?938?S 


! Xl' -■■■- 

X uli X S X rx s£ ^ 

>—H 

UJ > *-h :••<: cl. ' Cl. 

u'i o >*}— sr :*c r-j :> 3 c 
.X sr si :< •— o cc: si *"> 
Cic: uj 

lli ic: - 


■:*. ^ cc 
cc o 

UJ 21 CD CU* U'I —I Q_ I> CJ Ct: V- 1— 

—I :.Ll 21 lC J > CC Q CD I— X “> I O 

CJ 2: *—• UJ CL S= CJ Q. 2£ U'I 0£0« 

-J 

# * # * * CJ ■■ 


a X 

UI 

O r_c 

dx"tS 


O X :>C O Zr- 

>— 1 '-.. cc; 

1 — cc. x co cc; 
1 —• rn 1 - c5 rp 
co 1 -. c i 
CO 3 . 

X C'J O 12 
•H UC i<i i-i 
X * !X CO 
O CO !— i— 

x C'j s; 2: i— 

x x x ►—1 Oi 


i3 x 

X CiClCD C'J -. 

x 

o xx x;>- 


XXXi X XXCTlfiZjig 

Cl ^ i tL C'J -. -. '-Cl X .< 

co X r-'i pi x lu 

> Cc; x x 


x X' x X o x s o S' ci: x goal x 
xclu-O-Xecciee u; x > i£ x x O *-• 

O' 

co :=- >• x x 

X >—I l-H UJ 1|J 

o c .1 o o ce: 


S' D*| S' DC' D“i S U-) CO D“.' S' X C'J C O 'J- DC' S' U'i *3D DC' © DO © D“' © in © IT' CC' DC' © ID © uC> CD DD P- © C'J ui © u"> CD D i © li i r- CD U jN- © C'J 

CM C'J C-J 10 r t uD uD ' O \0 cri CTi CTi 'Ji CTi CTi © © X X CM CM C O C-0 Tp ij- © © X X CD CD X f -0 X- CT rf in ID DC' ■ l' ' O r - f - CO CO CO CTi CTi® © © 

us 'x P lo 'X lo ui us x x x x x x x r - r ~ r~ r-- r- r- r- r- r ~ r ~ cr-i os ct-i CTi •:» © © © © © © © © CD CD cd cd © © © © © © © x x 

r-~ r~ x r- x x r~ x r- x x x x x x x x x x x x x x x x x x x co co co co © co co co co co os co co co os os os co os co co os 


co 

j\, 

CD CD -Jj b“ 

CSl Cu! S' Ll. 

'll* cc uli r-:» re gc «:g «2i ? e 

x in co cm x p p i'-o O 




vy L4- Uk.. ^ 

12!£G 6 


Page 34 

90 


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


Number 22 






csi co x> re Oi r- x o ® <ti co r- x c. rr r-- cj x co x in <o re bo o h tH co on x co -h co x ce. r--- c* «-h s> ijj h co cj u _ .< cr-i o m a-. 

'S> r- u_ o r-~ r- co th c o is r-- tM co n- co in **• c o o 'S' X Lft 'S> r - uj in uj s> r- 0 co s uj s> ro o ® r- co c r- cs? co o o r- ® uj r- 

s> xh re an r- ro no co 'x> u. in r- co t a-, co ■*- an uj co le x c-o c-o be u. u uj h h re cc co cc co co x co be uj x op, -S' be rr, co an co re 

s> cc o is rr uuir--ujinu.o co -e- o r- *r r- r- uj uj -a- r- cj o -*t gd ioooh co r- co uj in r- uj co re *r o co uj r-- cc r- o co 

'S> re co uj re oo x in as rr r- r- s> 05 co co co uj co r- be is *h co or r-- co -h co co re co s> cr-i u_ x ',0 an rr an co co s> an or cc co 10 re 

co o r»- 'S> o is C O -e- r-- dr rr co u_ r-- r-- 'S> r •- co r- 'S> o Cj is is -h or Ci p- co co r-- u. o -h -a uj is © r- ixoo- is co co cc co o 

co co x-t re cc mmr- '-o u. r-- co co co cc re -r r- o> an rH o- cj cm h co m cm co 10 * uj co u. u. u. co re u_ r- co co es -<H co -«h ue 

>S' r— uj o r- co r- 0 *r o siqujiciq re s o fo sj rs r- o re s> r- o r- o rs <s> u. o o r- re co rr uj -e- u. r» co cc cj o co uj o 

si rr re 00 co re co cd co co co <nn cj *x co o a: u. *o p- 05 n. co o <c n. o- o 00 co re co re i/e co an -h o ac uj -*h 0- co be *-i ai «-* •** 

S' re o ft ,35 o rs 'Sj co r-t ft rC co re -4 co s> & s> »r r- ucoo-r- re o r- re uqo o uj r- s> r- s, re co s> co <j cu r- o co 

co re co uj re co re co co co u_ r— co an co x r :c co S* r— cc r — o- o Jn n o- o o uj cc «i w u. ui u. <h co u. i-j ern *0 co co ue an co an an 

Q on ilcJ rt.vF o- fZ o r- rr ft r- C ‘ s> co -h re ino re o ci 101;-' c re -h u- v-i c? n to u. r- cc co lu o r- r- r- r- 

si S' re re an u. re co co r e o 1 i_ «r u. co co u* co cci be co o in r co cu in m co s> co u"' r-- be an co r-- re s> ir> co s> an an uj cc re co 

0 r- o o r-.c 3 oN.rn- in co s co u. co r -d 0 r- r- uj r - tS cb. uj r- o c. o o S re uj re cj r- r- in s> -e- Qj rH r- r - co o W cc 


S' 

S' 

CO 


8S£3KD?J3l5^ygatS2!(a88e3?SSWQifclQa£Jifcl3«SffiSS8eSR 


r- xr r-- *jd 
r o cd uj 


&£3Kiaia3;3a£38i 

co S' &:> S' co S' o? co 



CO 
Cl. 

f “1 

ro Sj 

:c‘ co, 

01 Cl 

'SZ i.i'i Ui U'l 
cl 'e o n Cj 


0 


co < 
co Ctcl l i_ 
cc; cd >- 
'bD -J co ^ 


UJ 

-JUJ 

iO 

u!i >— 

~ r > ;— o 

r-. -X *— 

I— UJ r- 

u: o or 
c!« h- ;.j 
O i .r> C-' •; 

uj ~J -•>; 
•. 1 * 11 — cc: Ci!» 
»•—4 C3 

:n _j -z -■<' IE 
Cl. < D*C *—' 


yxui'i cjs 
cc :£ .. . ij_ .. co o i— 
uj cc o3 Sj 

x Ca X X _i 


o d 2 : f 


> >—1 !> '-'"I U*l. J Cl 


X X' 

^ S' 1 £|£ r'i 

i»4*w *s • i— . L % 

j -.a CC S' r- cc 
-J 


>x x :c ' 

IL. 

cu crl CD cd ; 




: cc: 


. U» I L. 


I - J Cl. * u_ O r — 1 CD -> " ■ H '-C > i l. Cl. I— 

ci' <x o o o x fc* ^1 .^1 .j ~j cp: o o i.u 

cl. o x *-> x x SE; cn lc; cc: S ii cc c 5 x cu c 2 


.j 

Cl. 


Ll. 

UJ 

..J 


C»C 

:c 

I— 


x :c 

UJ LU 

CJ 

r-j r-j 

xx 

* * CawE 1 


•3D b"' *2D l/"' X' CD 0"' X* lO O LO 0 |j"i X* u“* r ~ CO CD , .’ -J lO X* bD X* UD CD b“.‘ X* u“* X' lO X' uD *2D C‘*J ( •'.* OD X' OD Ll“ 

[■— ['■- CO Oj X X' CD rH tH •' •] C>j O') , i r>/- xf ■’•J 1 u“» u“« 10 L“» •! O ‘.O T C-- X* X* H C -J C - *J C-O ' D r J~ 'J' T T lO OS iji X X 

Ct r .T Ct ‘--r Ct co co co co v'J CC' o? co co co co co co co •:«:» co co co co co co cr*. rri cr* cr . cr* cr* >y* cr* cr* cr , cr-. a-, or-, or*, cr-. x x 

'-O '-O sO uO Cl* Cw COCO u? X* CO CO Oj CO CC* CC* CO CC* CO CC* CC* OD <X> CO CO CO CO CO CO CO OD CO CO CO CO CO CO CO CO CTt CT» 


cr-. 




'.L 1 

r- 

•f 


•;c 

r- 

X 

■•H 


:c 

r- 

CD f •'* 

w. 


•~J '^u.' J-.H LL. '.-'J 

l:~i x x ‘-l' r - l • U~» lE. >-H x bu o. o X. r- r-- r - r-- r-~ l^j •.»:» rxi r- r-H tH a-. 
:.U J i •- LlJ u“i O lIj L' CEi L-i : - :lI O N- X X« X X ID r-- LlI X T-- O UJ O 



r -cg 
0*1 ^ 
k—< *.£» 

CD rr 

LU rr 
CO LO 


*r -*r -*r Ct_ 


S 

_j 


> si Cu 

I'Ll i—• b- 

Cr: S' U. -J 

ca ^rccaujcsniCL 


:c :c :c x „i 


X CO 






L‘l 

2 UJ 


'X 


u. x S' 

CO- - 


cr 
ca: 


U j i i' b ’ui o uj 


,^i 

:oiy.o 
1 d cc d So ■£ 


XX 

cbcSx 


:i- x 

CO LL. 

lX Ll. 

ao 


ll) x x :c 


, J X . J ►-' I.I'I I.I'I I.I'I ..j I.I'I . j n. Ci-IX 7 j X Cl C> >— 1 X O '''—_I -i- C> , X ;> ,-_n r_n rj O —' C=- K - J — 1 1 — Cl Cl X 

X ox c=- X' x x x x xC' o x or-j S 2 Soo.NCip>uixoo 2 w&b;a 2 $zQSi>[ijC' 0 o ro 

i.i'i x cTi x x x x S' x S' ll ci—iS | ->i?i>-"e£uS_U lEtx-jilJlcx '.n 2 x x x x x j£ i—".n x x x x £■ x 


CCJ 

X^i . 

X 

XiCJ 

X '.n — 


Z 3 . 

V- 


r-j 

cu 


.0 


CO 


.0 

•X 


U“ LO 'j!' LO X* lO -D C**J U“* *D u“* CD u“ OD L .* '7x' u"« vx* UD u“> X* C>J lO *D uD *D L~* CD u .* -3D cO CD U“» CD U“* '^D uD CD UD -HD u*.» 02* C\l U" *3D lO <:£* 

r o r f lo to * 0 *.o • l!' r- r - co co cri cr*» *;d x* hhoj c -j ro ro ro -rr 10 lo • £• ll* r- r^. co co cr-. cr* 00 h-h c-»j c- j ro co Fo rf ij“» 

L.D b“j U~J UD LO UD lO IT) U“.» U“» UD L.D LO u“. lO ' O '-O •.£. lO ' O '-il* *-0 ‘U' lO '-O -aD '-U LO ’ O *-D lO ' O '^l* 'aD v»D ‘-O T— i s — f — l N — T— i's_ r-— r— P— T — P-~ r— 

•X» CO CO *rO 'X* OD CO 'X* CO *X* 'X' CO CC* CO CO CO 'X* Oj CO Oj CO Cu CO CO CO CO CO CO CC* Cl* CO CC* CC* CO CO *X» CO CO CO ‘X* 'X* CO CC* OD CC* 'X* CO CO 


L0 CD LO 

to u:* 'L* 

r- r - r - 
OD 'X* *X« 


cr-» 

IL 


CTl 

CU © 


cri 

a: 


cr , a-, 

r%. r- 

ii_ tDi 0 CC C>J O : sZ* u C jl 0 N- <H 0 -i_ Ll. tH ll,. Ll. Li_ cu 

^ i3 S3Q8 s §2 u & 8 S a 0 re S § I Ce § S 8 »FE Si I rE fe fe bb bb S Ce £ 3 S ^ S Sdb<38 a ^ S 


cr. 

3 


cr-, cc 

C 5 * ‘d ^ 

*•! cu CD _ O 


CTl 


X 
rs- 
Ll. t— i 


*;r* 
r- 

Ll. Li_ 


•X-. 

r- 


Number 22 


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


Page 35 

91 





x 

£9 


UJ 

X 


a: 


s 


>—« Ci_ X. 

z> ^ 
e: x o 
i.n 

UJ ID *—4 
Cl. D*C 
►-« —J 

>.n th 
tiii^ 

x lo r- 
( jD cr. <Ti 

GD CD CD 
'.‘•0 CM CM 


h-CC 

3 s ! 

Gi 


_J 
—1. 
5- 


o 

8?, 

U Q. CJ X 
_J 

• ac _j a. eg o' 
xzarpzy 


x 

H— 

Cl 

22 
c££ 

|| 
X 

5 tH ' 
* i—co 


fe 

tH h~* 
LlC _ 

eg x 
SB S 
*“> © 


UJ 

Q 

X h- 
O ST O 

: 12 \! 8 ? 

o ©co 1ms 


►-*_I >~4 Cxi. _| £ 

ssssss 


-OCl 

!8! 


X UJ 

UJ CC 3 I- ,x I— 

© y > oct o 

. rs t-> a- >c x Ln _j 

yH'-ci >; .v a. ^ 5. 

to^sio CIU 

3 CO _J _) 

•J X UJ CD •—«_| •—■« CtC_I 

' c> u_ >c or ?< o ac 

*—• JrjJ 5 O 

U*! tH 


X LO XLO CD 
■«H rH CM CM l'0 

, , . . ■wH rH ’rH •*■*< . . 

CM CM CM CM CM CM CM CM CM CM CM 


CSS IQ 
© CO 


i in CO 
i ro m- 


in co 
n- in 


to 
cnii. 

l— C-J 

to 

■HOCC 

-Jo. © 

ce; u; r-j “ 


3 

oJcjcc 


5 

ac x 


ts. 


EC X 

^-fe© 

o o 

JJX 

UL Cl£ r-J J- O > ’-* CO > -H •-< >_I >—i Is-_I LO 

852?5S8§S3g5£g5g§53£ 


X 

cocccoq 

•-« CO Z> X >—* 


3 o x co x < 


tO 


©in©in©in©in©in©ino- 

tH x cm cm f -7 r -> Tt- rf LO lo to no to 
r<i r*o i'-o r<i co co ro co ro co co co co 
CM CM CM CM CM CM CM CM CM CM CM CM CM 


LO CO CM 

co r- x 

X CO ©CO 

CO liCpvt 

88888 


CO CO LO CO CM 00 CO LO CO CM CO 

r- r- co r- x r- r- co r- x r~- 

© © X CTj © CO © to x cr> © co © 

88888$ 888§8!S§u!ie8§ 88888g§ 


r- 

CD 

r- 

■*H Q cli ou 

Ll. GD ro o 


r- 

CM 

0*1 C-N- 

r '.i © M" 


o o ox 

r~ r- r- r%. 

uj o u_ ox to ai 

x ro O ro -.M CTj 

x ® r— i* co x £i lo x Ci x in 

8 OS u-j O x ■* C ' ^ M - - 


ix^cs: 


iisssicsfcSJEjeis®^"^®®# 


opppxxx^o^xirj.-?^pxco^.pxxp^ 


#*#*** 


o 

U'l 

X 


o 


X 

cl 


*:••»**** 

O lOOI/TNCO 
CM CM CM CM 

Sggg: 


o 5 

o ” 
Cn^x 
_xx 
X o 

| L-ll-l 

cdo'Ti 

x> 

X 

xxcn 

O *H h— 
(— O '-O 
Lo X 
**■*■* X 


X 

Q 

X 


r- 

r- 


9 

CM 


CM 


XX 
X ui 

R_ 

'7i x 
XX 

XX 
I— X 
Lo 


o 


U1 X 


X 

X 


X X 

CD 
, UJ 
—J I— 
-J»—« 


X 

xoxx 


_ O X 

SgjrfS 

^xo x —• i£r *—• e;i 


U3 _ 

X_lx 

>— X XX 

3552 


co a? 
CO cv 


in xi lo in g iQ 

CO n- M- CO G3 X 

i*Ti i^Ci »S) Cp -w—< -wH 

'S' So®® '35 


xuo 

88 

CC* C2' 


u"« r- 

CM CM 


q LO (S- G' 
r-? ro r<« T J" 
”*H *rH tH ’•■■U 
CS> 'ii CEi Cfci 


x! 

y— 
o 
XX 
u. 

I—« 

•!»• O 

tH to 

tcm- 


XIjI 
X X 


555i 


' X 

. h* 

: ui 


UJ 

LU 

cZ 

‘5 


X 

X 

XX 

xD 
OX 
)—■ 
J!/I 

^x 

CD 1.0 


12 

O 


CD CC -J 
K- 

* »-n 


_j r>j 

Cj 

-J 

_11— 

S x 
'O 


'33 in ‘-O 
in in m> 

■»tH tH *>h 
CD C5t' C3D 


CDUD 

CD 

<:d -:d 

CM CM 


GD -H 
•* H ■'H 
a:- ce* 

CM CM 


CM^ 


*—I IJJ 

O 3 r_i 

I— -. 3 1— X 

■<-i x cm i— x y i o x 

* O rM X'Q X X _J L/i 

CO X ^ ^ 

CM X C 


o 

8 


Ln 

XXXI 

xXX 
o 3 ; o 

x •—i O 


;=- x cti Ci x 

T-l 3 X 1.0 x X 

i_l |_ y-, IX X ►-< _J L-l X' X 

2^835p^353S5 
* *• S 


ro U“* '3D U*D GD lT» C3> CM LO GD LO 'S» U“J GD LO 

. * - ■ - • -- --‘ ^*i N N 

•S' <ZD <3D 
CM O'J CM 


g 

IX 


rsi oc 

* 

oin 
CO CO 
CD '33 
CM CM 


X X X Ki 

r. r- co x 

' M- CO X CO 

JSSS8 


X X LSI 

r- r - co 


X X X O; 

r- r- r- co 


xr- C£i 

r- x x 


X X X CM X X 

© xxx r- r-- 

XX© X tTipCCi Cl cc 

NOO X X Cp M- X CO 

XOCIX WifMSujSrlMOW 
~ - -I © C^I x X G X © O X CO CO o 


© © © © © © © © © © © © cm in co coxwH'tr^ r - r- ac ci © ro ini co co co x x x x x co in co x i x x x ^ in x x x m x 

gggggggggggggSfsgggggsgggggggggggggggggiggggftiggliii 


c~-, 

UJ 

uj 

CM 

«3D 

Ci 

o 

ro 

•Ti 

X 

tH 

X 

CTi 

cr. 

GD 

i 

CO 

ro 

N. 

cr. 

vH 

r*- 

H 

CM 

•3D 

CD 

CM 

CD 

r- 

CM 

GD 

CD 

<D 

r- 

GD 

r- 

r- 

O 

in 

CD 

cr-i 

cr, 

a-i 

CM 

LU 

lO 

«T» 

CD 

r- 

Oh 

CM 

•jD 

U_ 

Xi 

GD 

o 

rf 

CD 

r- 

H 

r- 

r- 

r- 

CM 

•H 

O 

r- 

GD 

C^l 

O 

ro 

UJ 

u. 

U- 

GD 

uo 

ro 

U. 

GD 

UJ 

•D 

•vf 

't* 

Cxi 

'Ti 

ori 

o 

CTi 

«x 

GD 

X 

X 

UJ 

CM 

GD 

CO 

Ci 

•uD 

r- 


•X 

•r 

ir 

GD 

r^. 

r- 

U- 

p % 

CD 

•3D 


GD 

tH 

CM 

X* 

r- 

CD 

UJ 

•3D 

CD 

CM 

•:c 

CM 

•3D 


cc 

•X 


•3D 

ID 

•siD 

X 

CTi 

LO 

cr. 

© 

UO 

UJ 

r- 


ro 

CM 

CM 

GD 

U_ 

•ID 

CM 

L L. 

•3D 

tH 

UJ 

•S» 

r- 

UJ 

r- 

© 

Cl 

r- 

GD 

r- 

r- 

cr> 

rr i 

•:s« 

CM 

eZi 

-•H 

CM 

LjJ 

I s — 

X 

L*> 

X 

CO 

CM 

or 

CO 

ac 

r^- 

CM 

•3D 

O 

CM 

‘3D 

CM 

o 

CD 

CM 

Ld 

U“.i 

r- 

X* 

u_ 

CD 

CO 

CM 

o 

r- 

X 

ClD 

cr-, 

r- 

X 

•J-. 

r-- 


Uj 

UJ 

8 

C. 

a-. 

r- 

X 

r- 

•X 

r- 

i 6 : 

X 

X* 

81 

CM 

ro 

o 

8 

r- 

lO 

X 

tH 

X 

r- 

ci 

c£c?i 

eg 

cr*. 

O 

8 

S3 

'X 

r*- 

x< 

X 

R 

•cH 

'3D 

FC 

X 

r- 

ro 

CM 

88 

m 

X 

555 

‘4D 

UJ 


it 

8 

S5ai5fe5 

r- 

uo 

tH 

o 

ss 

X 

X 

8 

ro 

CM 

5 

'DD 

GD 

CO 

© 

CO 

GD 

0? 

© 

CO 

© 

CO 

© 

X' 

© 

CO 

© 

o-, 

© 

co 

© 

CO 

Cft 

Ch 

x 

az 

CO 

m 

s 

Q 

o 

Q 


UJ 

X 

X© 


tH 

tH 

CM 

5S 

r- 


S 

S 


CTi 

r-- 

15 

gS 

r- 

15 

Cl 

r- 

F5 

Ci 

r- 

Ch 

r- 

15 

ChS 

r-x 

r— 

5 

55 


Page 36 

92 



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


Number 22 




UJ 


c£ 


cc si 

■ —J Z> Cfc! I>_I 

< 0 : 02 : 00 : 


•x a; 
^ _ic£ 




cc o 

si CO £ X C5 03 


o 

V- 

ty 


& 


* ^ 


10 

<T. 

ON 

•:m 


O IT* IS* 10 © 

CD CD rH tH •.'•'J 
CD CD «3D '3D CE* 

n iX» ro ro r>o 


OZQ 

je*- e 


to co in 
cm rere 
to cci © 
re re P) 


_i>cc:r j 
« o O as 
oc £ 0 ►-.• 


©in ©in 
*t «*• in in 

CO CO CD CO 

I --0 (■'’> re re 


© Cl. Cl. 1— 
£££& 


OO 
Cd >■ 

* * 


3 d O 

mud a. -'' oc ■■ 

X © _J © 

©I uS —I Is-1> •— 1 _ICL M •-« 

-iooxxoclncl 

_i£e: JCo.u(jcj(j 


o 


' §5' d' 


O CO 


x a: o-a 

r g' 3" g 


>piooxa:oiiNCLNiipsjcLNa.NiirgCLNa r NCLN 
o£ JECJuCLOCJCJCJOQOU CD CD CD CD CD CD O CD CD CD 


3^ 


■s in © in co T-t in © in © in © in © in ■© in © m © m coin 3 in © in © in © in © 

co '.ONNQaicst-iTH cm cm re re ■+ -m- m inso co r- r- co co as as © © th *-4 cm cm re 

3 CO 3 Cp .-4 .-4 .-4 ^■^▼4*4'H .-4 .-4 -H .^-4 tH »4 «-4 t-4 »4 --H .-4 -*-4 -«-4 CM CM CM CM CM CM CM 

re iv5 re re re re [vj re re re re re re re re re re re re re re re re re re re re re re re re re 


tn© 
re '+■ 

CM CM 

re re 


CC 

££ 

85 

© o c5 

US _J 

_J rj 
ui >c © as 

>—i_lO") 

■* 

cm in © in 
e- ^ in in 


l4J 

fv 


CD 

r- 

in 

vt- 


5fcWK!SfcWK!Sifc8asslsa8 



© CC' Cl 
© r- r - 

388 


r- r- r- r- r- r- r- r - r>- r- r- r- r- r- r- r - r- r- r- is- r- r- r - r-rs. r- r- r- r- r-- r- r- r- r- r- n. r- r- r- r- r - r - rs. r- r- r- r- r- r- r- 


o 


s 


a-6 

X UN CD 

ui^tDcc 

0 *i Q to C5 

i— Cn £ _! 

_J_J O UJ© 

_j is- > _n~ is c_i uj i— >—i cu i> i—i o 

OtCOOIUllOlMClll-EOClll-CL 

- u = £ui 2 e J' 


Cl °~~l— Cl. 

_© Q i 

m. .J 


UJ 

“3 

cn 

r> ♦ cd 

■—■ ww r— «_i uui i— l*_ O CD *— 

fi= «.n ‘XI CtC JC UN UN QC SC «7i UN c*i 


CD O 

ct X 


CD UJ 

a? x 

> 1-4 CD CD» 
nrocDH-a-ja 
cn 2 c UN UN CD CD c 


c^: 


5 CD 

?• r~i on 


ro 

4 - 


e: © © © © -jo 
occyi :£ © © _j 
i uj © x © JE 

•• ”?»• I'l I i*» i , 


_l_i_i ai; 


© 



n © in © in © in © in © 
’■-j- to in •.£> id r~ r**- co co cr, 
e-, ai as a-, ai'T, gs aS as as 

CM CM CM CM CM CM CM CM CM CM 


lOCO 
■rf r- 


r- 

* © S 

»-4 © © as cm as 
iHOum C'j o 


gj O -gj O tH ^o 

co 51 is- co co ul r- © cr, lu r- co as uj r- © u. a-, in in in Si ‘ii uj r- r- r- uj r- r- 

Komu. f -15 re © © re u. r- © re © re o cj © uj cm © P-ossirir 



uS _J 
I— UJ 

Dal 

tH CkJ tH 


tH lU CnI ro ^ L~.l LLi Ur 

_©©©UJO_ ._ __ . _ > o 


© 5? 

1 1 'ID' 

© ¥ . . 

^ i-* a, 1 —■ 

uc © © iz 1 

>Sl © © -. uc u. -. © _ j o o © 0 

_ © r-4 CCi xH >© '© © '-L UT lc 

© © © © © ui '-n © i • 

•-< © r-J hr Q 


o 


r -l CD © 


© 

© © 

© ©1 I-. I> © »-H 


© 

c .1 

© 


© © I—I 1— © 

^©-‘se© 

- us 


1 ] S a. S n cl ai ii o us u S u iri u in Q n ‘ji ct © ffi e; u 'i Ji o r© u r a. 'j"i o u £ £ u. o 1 j- 0 c. £ u cn s: u n >- 

♦ K- * ii! *■»•»■© * * 0 - * 



in © m © tin © in n- © 
© © th cm cm re re ri rf 
r^ is- iv- r - (v- r~ K n- rv- 
CM CM CM CM CM CM CM CM CM 


CO co 
asN. 
a,© 

L 0 © 


co 

J 


CO © © U_ © © CCj la_ CO Ll © O 

r~ is- r- r- r^- r- r- r- r- r- r- 

© r- co as co co © © © il © in 

I r. I r s r. 1 c s 1 r s .• *. 


© cm © cm © cm © re 
O CM O CM O CM O C'M O CM r© C< 


r© 1 © CO © © 

r- r- r- r- © 

f© © CO © © CO © 

r-s © re © .. m © © 

4 I 1 'L' © © hi: © © 

•© © sj- 1 © © ■+ 1 © © © 


a 8 s-o 


CO © 

r-r- 
re © 

©^ 

G CD 


r- co 
lo r- 

CD Q 

dlsavj, 
■H 1 © © '© O 


O O CJ CO © 

r- r- r- r- © 

co © cj © © © © 

m i-1 re © cm © co 

©©r-©©©©© ^ 

0 ©’* 0 ©U-'©£i v-l 


© © © © r e '© © © a, © © uj © © ll cm ■ 


© ’cf o © 

Io CQ X ® yj 'H Tj 
CD 


Number 22 


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


Page 37 


93 




-U 

•:c 

o 


as 


oidcnlco 

iLl _J 

ct; r> qd 
►hXO^ 1 

^ co 1 C ‘-n 


UJ 

H- 

H-* CD ID 

Cr‘ Cc. 

oji-S 
r-j ci. uj o 
cc: ►-> cD Cc: o 


3cn 


UJ 

pt! 


:c 


s 

585 

to Z3L 


o8 w 


Q CD O. CD 

V 5, *^1 


■CD 


uj ; 


O 

cc 


CD 

oc 


lO 

CD 


CD 

CD 

CD 




co 


CO 

CO 

CO 

Ck. 

CtC. 


Lt 

CXL 

c*: 


Ju. 

li Z 

ns f— 

~ir 

OC h~ CD 

act— cd 

pc! 

►—< 

UJ •—i 

3L*U! 

,—, 

CD UJ Uj CD 1_iJ O 



Cli 

—4 Cr: 


O CxL 

O Lr. 

►~t 

H— 



—l 

—1 

Cii 


Ci^ 

r~> 


5 

_1 




UJ 

cii _ 

. _. -Da 

X . J _l o C xi O UI o 

M? -j u. _j id UJ ;■ I 

o cc -. fie .. £r i— i/i 

uioa w “i dt! 

CC O _ _l _J Cl. 


O Ll_l Q Cl, 

ttSSS 

cccc 

_i_i_i 

: cic 'X —j —i_i 

1 2 t— x x x 
i ►—< lo o o 



ij_ 

i's- 

i.~» 


CJ W Ml IQ ax 
Cxi N. CrJ CJ| IL. &> o 


o 

,1 


Cl X CO U- UJ 

r- o r- r- r- 


r- 


—. UJ UJ o 

r- r- FZ r- 


£S8£88 as888838888888888838 


) rf r- X 

jg&ag 

r- r- r- r- r- 



8ft 8 


C5> CO Cl Cl 'Cl CO 
■j? r- r- r- ■& r_ 
■S' O r- Ml llI iXi 
'2. <§'Cy ft' ■£ 

? 1 sda?ld 


•o co o r- *x» cis cm co c> co 
th r- r- uii r s- r - r- r - r- 


r- cc* 

lO 


CD 

r- 


Ch 

vO 


oi co co ro co co r o co co cc* co ^ u. co ii- •• o ^ 

'*LJ ^ if.» •H tH y“i rlLjLij. , CC x-J Cp u_ C3 Li_ Cn <f* 

HiJ' r £'HuU'd^iilR lO '•J.* x-j L .• 4-j *H 111 Uj *.*'J LU T-i LI .1 Dj 

HUGH o O nH O O cji CjJ CM tH UJ O UJ CM <dJ CD CM -H UJ O 


£D U* 'A* 

r-.: t-, r- 
}-i J P> £> 

LJ .» U» 'Si 


vH Uj cm ul» CM tH cli lu x-J i^Ti 
LlI '7m O CM ‘CD tH CD Co Lot -U' 






tH 

- 

CM 

CO 

ro 

lO 

CO 

in 

Ul p 

K— CtC dl 

o 

. Cel O 

o 

Oi CD 

o 

cc: cd 

p 

cc: 





Page 38 


Dr. Dobb’s Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, CA 94025 


Number 22 


94 



•M 

Uj 

-il 'uJ 

i '.n o cv: 

i (J O 

; “ a ;-1 


I y*l U*l 

•( cl- 

_J 

: oc x _j 
■ isi—x 

i —. i.n (j 


oi ;j cj 
J x 


cd &! 

_J 


5ii^e5oSE“£L 

V V \ \ 's ■*. \ v 


-1 —J W4~ -• I _I -1 _| _J | I _I S \ -. S •. S S • 

__J —I Cl_ I— UJ —I_11—•_|_I •—«_| I _J X I it—I II— UJ 

■X' cc ar _j X' x x r-c x x x x x >' cc o cc a: x x cc uj El ns dk dk 3e ;e ue 3; 313 3t ■ 

c-i•-> o cri 'j joo J u j o j o iuuu_iuKixoooaaoaaooi 


•' •> X '• 

U.2 Ul 

r|i- y. | ^ 

**• ••• *!D ■*• 


: Z2 r£ CO Ll 3 

iOOCji-u d 


j£ sQ «! •- T » CJ U. T .J LO CO CT-. CJ Li. CM ID LO CO CO UJ xH rt f-__.. _ .__ ... . __ _ ____ _ w ____ 


CD UD CTi O U. C-J u7 CO CO O UJ ® f\l rf 1.0 OD X CJ UJ © C’J <t CO CO X £0 . 


Irll 

CD O 2i 
(■:< 2 

UJ 

Q-r-JCC 

CJ “> UJ 


•—1 r-j c-j ' 
XXX' 
UCtUJ, 


I LU& 
I O UC "* 
; x ci , 
1 01 cj _J 


: cc rr to 
r cd c-? d 
-e 

UJ 


-£Cc:uj 
rHoct:: 
cz 1 ll. 'X 

o i.n t 
x uj 
ET X X i 
O «—• I 


J vH uj CO Cp 

.' CO 

: o 0£ cm tie. to ct 
oc 1 — ai!— xi— •; 

1 Ul O UJ © LLl < 

j cj o os c ac c £ 

Ci X . J Ci —I i —1 —I £ 

J X —I I -J..J —I ..J 

£ UJ (CNXCNIIt-i: 
: -2 j . ji CJ X' _J CJ Cl£ -_l '£_' IX . 


CM iX 

to it. 


lt.i cE: 

CD!— 

CD 1— 

CO 1— 

CD r— 

O UJ 

O LU 

sa 

O ID 

CD d» 

Ct CD 

CD CJ 

d —1 

d —1 

CU_1 

d d 

—1 - J 

d —1 

—I _J 

d -.1 


1.0 

cc: 

LU 

...1 

iij 

cE 

xx 

X 

: 1 u :-c u_ 
' CD IX U- 
: 'X cc o 
i.n ~j 

. Ij“l 

: tLi o c»~ 
• nr. cd r —■' 

«,*i 


Cr. CD 
O — I 
—1 :< 

r-j cc nr 

•—;« CJ 


O Z£ X 

CO X II. 

Cl. 1.H K-4 

in o cu 

1^1 cj 


U“i i/*.i GD lO CC' CS* lO CS> C5D Li“ U" 'JD U“' CC* LT.« d' xH iO CI* LT* d' !j~< '.il» f - .;ri u“‘ •!£• U“!» d* lO d‘ L" O U“» CC* H '.'\i u“ d' u"> L»“' O IO LO d U~» d» LO 

d» rH .h Cvj c j c-j r<i -^r -j- to co »:o cri -:d cd to ir« r%* r- r- cc* o:* or-. cr*» o-i cr-, d» d* tH th .;->j c j r-t> rc* -*■ u“* u** u“» vc» vo cr> <s» c-j »x» ro ■»jr uo U“» 

c j c j <-j c j c-j c-j c-j c-j c-j CM oj cm cm i'-'j r *> r<i i-<» r-<i r-'« c-*'» c-o r<* .x» r-'i xr - r t- -c t- ‘t- rr vc to uo J •* t».»to or* u“« 

Tt ^x*- T*- x* 1 .* xf •«*- -.f r-j- Tf x*- ^ X-J- -vf '«*- x.r x-^- Tf xi- -«f -T* v xf xj- -rr ^ ^ '*■ vf x*J* xf ■*** xf rh •«*- xr 


uJ wL O II. uJ LiJ ID O u. ID lD CJ CD 

S: £: ^ ^ :5 vj yj ^ S ^ ^ :|i 

X X aulO cS TH ij 1^ f-^i 2S th Cj cil O 1 • ' 

u_ cj r-'.i x o o x x i_icj ® cj cj o x• 


r- co 

u*i r- 
a i r-D 

XI -v-l 

Cj -n-l ... OT'i 

X tH O X' 


I.J. LU Ll- IU 
r- r- r- r- 


Li_lU IX £U 
(■- ■ - r- i"-- 


r ■- Ijo cfj in x uo cj v~> u. 117 o u X; CO \t Li. 

£ s x Se s x a x a ys» a a «>1 .x a a x c; . ^ ^ tb 

C J O d' 1 CM O O CM O O CM O O CM d> O C- 1 d* U. CJ 1 • d* d' Ll. 


k ,J ^ d' 

*> n: k— r o < 

^'SxfSlx * r ;i 

}— J‘l O Cl. Ci ij‘i Cl. LU 
CD -Cj 

•X Cl. O X *-* Tsj . 
H-ET^DCLZrX 
IJV^CLZDOOHK 
•X 

* ->r Cl. 

CM LO * D d» iT» 'x:» U") d* l 
x^- x^f -rf- L" 'X' '•D r — t 

CT7 CT-, CT-. 'Ti CT-. »7i Cf-. CTi ( 

r-o r- o M r o r<* «* *:• r *? js*> r 


CD rH CD 1 
xj* cd {— DZi tr t 

2 $^S 2 siS£« 

l. Cl. di_Id —I» 


. *--* Cl. 
: cl. r-j sr 

: <_i —d —. 


> to d< LO 

• CD CTi • Ji 
i CT-* 'P^i cr-. 

• t o Fo r <> 


LO X «x : 
nr -Jo - 
•:c 
cl. 

d io<£» i 

O OH ’ 
CD CD CD * 
Tt xf -wf ' 


IU-.IL, *—• 

: o sr i --.' cd c 
• CL. O 7* */l *■ 
•X 
Cl 


' (jO'T x ? iO» L 
i CD CD d* d •: 

X*- Tf 'C^ Tf , 


@ 

. r- & x 

ouix ii. 

!s!hi sx 

I X X »• X X .H X o 

x a: xx 

I X Uicc I-I I 
■O.E'MOZQ-N'tl 
: —> —> 2 2 x U —> 2 1 
XX X 

Cl Ci_ Cl 

i lO d* u~j d* tT* O L“> CD l 
• di *7S CTS d* d* xH tH CM •! 

i CD CD d* x—I xH vH x~l x—^ i 
•xfxfxfxf-M--^f-x*-xf' 


LD d 

5 ^ 5 ==-; 

. :•- Jl 3 x co 

,a-ffl>> 
iscto Xi 
. i— e: a: 


I— LUi 

i—* X 

._l O i 

CL. CJ £ 

oi: 
_i < 

_11— oi < 

xxxi 

uceii 


> Lil Xi Ul' 

- r- co X'' 

I .H -H —I ■ 

- •*■ *r ■ 


CO lO £ 
(JI CTi (Jl > 


Ll_ £j O 

r- r- r- 


£JLU Lj_XxXXX 

r- r- r— r- r- 1- r- u- 


Number 22 


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


Page 39 

95 






.“I tH 


:c 

X tJ i 

re ssj 

>3'__ 

X I x sc 

.Vi yt* CO 

r o r- -h U"i U*i CM CM CM CM CM CM 

—, .~-s r-ij vd ^ 

;'3 CD r-t in '.o ^'i? 'i 1 S o 

'*] iS l ” J in d d x> ixi in co cci cii 
i>; .J 7C U. US '-‘1 o x> ra o *H o 
.;_. i_i in us Ci£ D- ct cu CU cu cu 

ij-i © o id x< id r- x> u~« id x> us. 

«s! in in iis> m id in iiD on in u~< in id 

cri as as iTi as or-i 5s os a. 5-. a. Os as 


r:> r- 




x 

Q X ?0 

X'Lu x -r 

•A' 'S'li ' •! 


iuX 


'- ■•• n *c CO ® S' ~i X ifi vo ID '3 
CO I— • • U. 10 LU IU (21 (21 •■£ 


X X 

XXlL'aJ lu CC X 

y? to ‘-I- 7t X, X t X r r fvj X 

— gi rH I. L_ ‘MJ > 4 lJ •i Li~ •-*-» Ch O _ 

(Ti os r— t-i _ i t o c-3 r ■- *+■ co t co 6s o 


© is? 


vH l 


X 

’i x x 

•± Q X id 
X ”• i—l CO 

Cur? ‘ J ' ‘ 


c- j ' c\i;d " -i co r- cJ ; f.; 

_ -- ,___. :::• as :d .21 sd rs> 10 sd 

UJ IU OS —I —I —1 C 2 > cjl 13 (21 Cxf ”i o X' I U CJ UJ '2b X' (2* 20 CJ 20 (5 1 

X '. 2 ‘ '—I I— (5 1 d> © IU UJ UJ UJ llJ CJ LU (21 IU UJ CJ UJ CJ CU UJ (5f IU 

•xi uj i— x xiu xiUJ iu iu i.u 'uj;u a u* lulu iu 

LU m( 3(-(JQI U'nHOJLi.CJ U.I (.KC li_ X 2H Cl.. 

:z is or iu us co co oh r-j sr :n us cs uj iti-zccci-ooou xi: 

Cl. US O U.I 1-1 Ci_ .-.O’— X> CC >X © O I—I O —■ I— X* ■—i I— US CC US 1 . J UJ CO 

us ci_ ju ;c x us :■< ru cu ct :>- x. i-.u o _i x „.i x us o .u us cu us uj u_ cj_ o o 


ID CO ID CD in X* iD 'S'»li"» 'SI 1 U“* '72' L~' iXi US' US' -X' 

C'J C •■> CO ^ <#• ID u5 X> CC' —I .—I ( J' (' US' in (Li 0S5 

ID ID D Ip US' US' uS' lO '.o 1 0 u'l 'X' '•£'' O ' £> '-O r- 

CO CO CO vO 'X' Cu 'X' CC' 'X' CO OS CO CO 0.1 Cu CO CO 


'••J US' CS» US' uS' X' tH X' u~' X* US' X' C-.J i'O US X' US' X' US' X' US' X' US' X' *X> US X* US X' US' X' US' X' 

SO-IH C-.J X' CD tH i—I C-.J c-.j CO CO CO CS' CO 't- -<J- UD IjS '.o (O r- I 4 -- CO (Cl 'Ji CD CD -rH CU '(C Tj- UD 

- r •- r-*- r — r — x* x< x* x> x> x* x> x> x« x* cd cd x* cd x< cd co cd x* x* xi C7i .A --i >-i —H .H --I .,-i 

:o c.o Xi co co os cr. cr-. as as as a-, a. as as as cr. cr. as cr. as cr. os cr-. S-. .rr-. os a. ci. as a. a. cr. cr. 


I— r-0 1.-0 lu Xi LU X 1 lC I.U X' Ll. X' i 0 XI 

CM US' CM (M lu- 0 !u. CM -'f ro ID CM 

X' 1-0 u_ X' US Si cr. ID. X' X' CM CM sj- CC 1 ll. 

M US' sj- ?M X' to U ' CM CM US' S> US' f0 lu 


UJ Lu US U- X* X' 
JO MluOJ 


:c _ 


5? 


& 


•?»c->■ o^rcvijpq uj ^ujt~ptti-' it.^:uj«coh-_ccuj2i2ru-2:3x:»- q-*Il3uj‘- nac 

I ^ I M-V pi> Sz O I?i a: > O Lu O o O 1/1 X > O - Lu cS 2 lU22 Lu 3 tn X 


o 

r.xxrxaDo: 

) a cj u o 

CM 


CD 


tH 


joScjOCioSciS 


a: 

UJ 



Q 


CO 




:zkzk: 


LU 


cd ir> «d m cd to «x« in <s» ur« cr* cd u~i »d in -d in *.d to cd in «x* ud o in o ud cd in cd in cd in cd in cs> in cd cd in cd in rr, m cd cd cd in cd in cd 

th cm cm ccj re* ^ lt« ur* r- r- o cd cm cm r o re* rt- •»** i/* 1 in \o r- cd g:« cm cm r-o ^ <x> cd tH t-i cm cm r <« in *X' ohh cm 


5 J ^ yH r~l rH tH CM CM CM CM Cm CM CM CM CM CM CM CM CM CM r-0 (■'* M r - <i i'<i M i N *C* O I s ? C O vf- 

'.U «.JJ U' *-u Cu Cu 'J,‘ I.JJ Cu UL' CO *X' CO 05 u-i CO CO CO CO 00 CC* CO CQ CO OCi CO COCOCOCOCOCOCOCuCO*X»CuCO 


C\J fv Ci* 1-1 CM 

,i -- rr lO L»D UD iT' U? 

Gj Cu CO CO CO CO CO CC* CO 00 Cu oi 


Ll H IX; to r-'X| CDcTj Ll. -H iX» LO r- CO X O llJ «X« CM Tt L£| o;i IX CJ tu O CM «f '-J CO X CJ UJ S' CM *X' CO X CJ UJ CD CM Vf ‘X* CO Ch COOlLrl 


Page 40 


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


Number 22 


96 




CC l 

r- 

ro 

Tp 

xH 

X 

't- 

lLLi 

tH 

r- 

X 

d. 

in 

UJ 

•X 


•7-i 

do 

'T 

o 

CE' 

'H 

xH 

r*. 


CD 

© 

r- 

10 

rj 

H 

cu 

r- 

CJ 

'•D 

r- 

CJ 

dS 

CO 

CJ 

CD 

O 

a*» 

CTl 

rri 

x 

CD 

•X 

cc 

CJ 

in 

rH 

X 

%Zj 

•X 

ch 

X 

da 

m 

X 

re» 

•X 

Ll. 

c-»j 

ID 

re» 

rH 

CD 

X 

rH 

ro 

rc« 

ix 

CJ 

© 

x 

rt 

cm 

CD 

r- 

O 

X 

Ll. 

CJ 

CJ 

r- 

re> 

r- 


O 

o:» 

d:t 

T - 1 

os 

LU 

.• *• 


C_a 

u-> 

-r 

Ch 

•:c 

CD 

U- 

c. 

UJ 

r-> 

o 

cc 


•D 

*■'^4 

nz* 

re» 

O 

T—1 

•X* 

r — 

CO 

u 

r— 

CJ 

Tp 

CJ 

Cxi 

CO 

r- 

CJ 

u_ 

•2D 

r__i 

•d 

ret 

re> 

r J 

CO 

CD 

CT. 

CJ1 

CO 

ro 

d 

UJ 

. j 


Oj 

CO 

X* 

X 

C J 

Li.. 

X 

cr-. 

•X* 

tH 

it_ 

cCj 

CD 

re* 


O 

rx 

ix 

un 

l' *1 

x 

CD 

»*,-*! 

r- 

r- 


•M 

CD 

r- 

o 

.j 

CJ 

X' 

r- 

rji 

r- 

1^1 

r *» 

rH 

in 

’•n* 


© 


CJ 

UJ 

•»S%* 

re* 

ID 

05 

cc 

l L 

cD 

cc 

U. 

UJ 

'j- 

Id 

CD 


iD 

X 

X 

© 

C 

O 

•j. 

■' 1 


cm* 

rH 

r- 

•!ji 

CJ 

CD 

r- 

Cxi 

U. 

r- 

CD 

r- 

CJ 

CJt 

r-~ 

UJ 

rx 

r-'» 

o 

8 

cr-. 

ro 

•X, 

ro 

u 

CJ 

UJ 

rx 

& 

ro 

Li 

8 

in 

X 

ID 

8 

S8 

8 

UJ 

Li- 


8 

ij 

s 

.x! 

yn 

iH 

d2 

UJ 

UJ 

X 

Ll. 

Q 

cj 


czj 

•n 

UJ 

CO 

ro 

•rS‘ 

•X 

re> 

Ul 

do 

o 

ret 

.dt 

cm 

X 

'* 

X 

LL. 

fx 

LO 

o 

rx 

in 

CJ 

X 

ix 

o 

O 

co 

CJ 

o 


■CJi 



•d 1 

ft 

vH 

T 

X 

X 

X 

P0 

ll. 

i- i 

CD 

x 

da 

in 

UJ 

cc« 

re« 

UJ 

r 

^r 

u_ 

.• •» 

dj 

id 

cj 

X 

Tp 


r- 

x 

CJ 

rx 

cZi 

tH 

r- 

o 

X 

px 

Q 

•s* 


'X 1 

CT| 

r.__ 

CD 

CJ 

r- 

•2D 

co 

•2? 

co 


co 

•2D 

co 


05 

© 

co 

•3? 

co 

CS» 

«*i*i 

'2! 

CO 

rt'i 

.... 


C«D 

•s* 

CM 

CM 

lO 

re* 

Tp 


in 

m 

X 

X 

rx 

ix 

CO 

CO 

ai 

•T'i 

•± 

X 

CD 

cc! 

•iji 

f •» 

d> 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

LiJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

UJ 

LD 

UJ 

LU 

LU 

LD 

LD 

UJ 

rx 

rx 

rx 

r- 

r\» 

rx 

rx 

r- 

rx 

r-._ 

p-- 

r •- 

px 

pX 

P-- 

P- 

r-- 

r- 

r- 

r- 

P- 

P- 

r- 


U- 

•H 

di 

ll. 

■X 

r%- 

r-i 

X 

LT.» 

•X' 


u 

X' 



'X* 

•:o 

tH 

xH 

x> 

-H 


•X' 

UPt 

IT* 

CM 

CM 


r» 

a. 

?j 

r- 

'••■J 

t 


•: • j 



•.-•j 

Ll. 

in 

rP 


•:-J 

-p 

C'J 

rP 

*fxl 

*P 

in 

*5* 

TP 

UP* 

■*p 

■H 



vdl 

•X. 

•Xi 

•d' 


■x* 

Ci‘ 

•-X* 

•Xi 

•T. 

CD 

tH 

r:-i 

up» 

■J-l 

•X' 

LU 

CO 

xH 

rji 

«i 

ISI 

CM 

•X' 

X 

•*P 


UJ 

Xi 

CO 

r- 

•:-j 

C'J 

C-J 

•>J 

in 


in 

•:-.j 


•: • j 

TT 


CM 

pP 

■^P 

CM 

CM 

CM 

CJ 

UP* 

ret 

PP 

ret 


X 

li. 

X 

xH 

X 

U“.t 

X' 

X 

ue« 

'r 


X 

X' 

XI 

CTi 


ret 

LL. 

•X» 

X 

re» 

cr. 

CT. 

X 

cr. 

CJ 

X 


r-'.' 

r- 

'.-.J 

O 

CJ 



c-*j 


T T 

ue> 

re« 

rP 


in 

pp 

LO 


CM 

■•P 

IO 

to 

IO 

•p- 

IO 

to 

Ll. 


LD 

ret 

cTj 

X' 

o 

CO 

•2? 

•X* 

•d* 

•X» 

CJ 

CTi 

•X' 

Up* 

U. 


rP 

r- 

in 

Ll 

n 

UP* 

xH 

re* 

X 

•x> 

CO 


1 *- 

•j: 

f__i 

CO 

Cxi 

yr 

ret 

•:m 


•;-j 

-+ 

C-J 




U*i 

b"i 

U“> 

UP* 

^P 

U-) 

tp 


n- 

u_ 

CM 

CJ 



H 

Ll— 

»et 

X. 

-■i- 

X' 

iC» 


X* 

in 


uP* 

u" 

cv 

U- 

CD 

•X 1 

•X* 

r- 

UP* 

CD 

CJ 

re* 

«x* 

•X* 

X 


•.IT 


f- 

•,e> 


UJ 

•. 'J 


•.•■j 

T- 

to 

r-c* 

L) .• 

•'t- 

u 

LL 

l v J 

*.-*J 

re* 

u.' 

pp 


M- 

ul* 

X' 

CJ 

re* 


dj 

•X. 

1' • ' 

dj 

LD 


m 

ret 

u_ 

X 

ret 

d» 

Li- 

C*»J 

'■p 

•X* 


UP* 

■T. 


CM 

CD 




X 

ret 


•d> 

•_U 

id 

o 


•.■•j 

-j- 

Li ^ 

Li— 

r T 





11 

CD 

PP 


UP« 

•a) 

uP* 

•f j 

IO 

Jm 

Pi 

u. 

lO 


X 

•:r 

•X 

•"Et 


•X 

dj 

i H 

•X 

•X» 

•Ti 


•Ji 


r-7 

CIi 

Li 

X 

X 

io 

CD 

|T, 

•p 


■X' 

TP' 

XI 

r- 

'.-.j 



•Ji 

CO 

'T 

’X 



T 

i •.« 

U1 

'.■•j 

irli 

•:-.j 

•r 

U ' 

X 

T 

i]*i 

to 

i’-.j 

CM CM 

•Pi 

in 

lT.i 




ro 


CD 

iH 

o:> 

•X 1 

CJ 

LD 

CO 

•X' 


in 

H 

C\J 

tH 

© 

'•D 

X 


X 

X 

dj 

•X 

•x> 

CO 

•ji 

o 

1- 

Cu' 

Q 

•,\1 


'j- 

C'J 

TT 

TP 

(M 

l>J 


pp 


If? 

PP 

© 

to 

u. 

rf 

^P 

Ll. 

CM 

n 

re> 

r- 

CO 

X' 

CO 

CE' 

CO 

•3T> 

CO 

CD 

CO 

dk' 

CO 

•!D 

CO 

cz* 

CO 

•ZD 

■:o 

<5 

05 

CD 

CO 

CE* 


CD 

CO 

•7S* 

ro 


o 

LD 

ID 

X 

X 

CD 

CD 

rH 

tH 

C'-J 

r-.i 

r? 

ret 


’T 

m 

O' 8 ' 

X« 

X 

r- 

r- 

CO 

to 

■T, 

CT. 

•X 

X 

a 

UJ 

IU 

LU 

UJ 

UJ 

X 

Ll. 

U- 

X 

X 

Lu 

X 

X 

X 

Lu 

ul 

Ll 

Lu 

'X 

u. 

Ll. 

u. 

u. 

U- 

u. 

Ll. 

X 

X 

P*» 

f'X. 

P‘- 


P-- 

r*- 

r- 

r-- 

r-'- 

r- 

; 

p-- 

p*- 

r-- 

r- 

r- 

X 

P*- 

r- 

r- 

r- 

r- 

r-- 

r- 

r- 

r. 

r- 

r- 


t 


C>! 

O 

CJ 

tH 


ID 

CS' 

UJ 

m 

p 

r- 

X 

lx 

X 


Xi 

r- 

Ci 

'•D 

X 

xH 

dj 

X 

X 

'X' 

CM 

CTi 

X 

di 

p 

n--, 

CTi 

X 

xH 

X 

dj 

X 

X 


IO 

•T. 


c-i 

rH 

ID 

X 

r-| 

'T 

r-s- 

iU* 

T—1 

r- 

X* 

0.1 

X 


r- 

X 

dj 

IX 

X 

c j rd 55 fx -h 

CJ 

05 

x» 

«7» 

tH 

rH 

r- 

tH 

Ll. 

•Ti 

CJ* 

•4.1 

CM 

r- 

F- 

CJ 

CJ 

LO 

Q 

p- 

CJ 

r- 

X 

a: 

rj 

cu 

CJ 

CD 

CS 1 

•X 1 

p- 

C3P 

UJ 

CJ 

•X* 

Q 

XI 

d5 

X* 

X 

X 

o 

•r-*j 

dj 

CTj 

X 

Lx X 

X 

CO 

rH 

X 

dj 

'•D 

•P. 

xH 

dj 

X 

xH 

iu 

xH 

d. 


*Jj 

•s* 

X 

m 

lO 

Xi 

CO 

ro 

X 

X* 

•'•■J 

r-"» 

Ul 

X 

X 

X 

X 

X 

X 

X 

X 

CTj 

L.t 

r- 

CC 

O 

X 

r- 

CJ 

* — 1 

OJ 

r- 

X 

dj 

r-- *25 

CM 

CM 

tH 

re* 

Cj 

TT 

'sO 

rH 

rx 

UP' 

xH 

CM 

tH 

CM 

xH 

i'j 

X 

•T-, 

•s* 

CD 

CJ 

r- 

CO 

r- 

CM 

CJ 

X 

r- 

CU 

r-- 

ro 

rH 

Ci 

rH 

X 

dj 

rd» 

X 

*25 

CM 

X 

CD 

•D 

Ul 


dj 

CJ 

CM 

da 

CD X 

X 

di 

dj 

cr* 

CO 

X 

rH 

da 

X 

X 

CD 

xH 

X 


d5 

xH 

CM 

CM 

05 

CJ 

aa 

o 

X 

•d* 

ro 

•T. 

CJ 

ro 

X 

CD 

X 

X 

X 

r•** 

r-'* 

r- 

o 

X 

X 

•dt 

r- 

CE* 

X 

r- 

rdt 

r- 

tH 

*:m 

r- 

cofi 

rx 

CJ 

tP 

o 

r- 

Tp 

xH 

r-- 

U*j 

r_J 

az 

XI 

ll 

X 

r-- 

X 

X 

X 

CJ 

X* 

X* 

CD 

ro 

ro 

CJ 

«!D 

IX 

CM 

r- 

X 

r- 

IX 

X 

CJ 

X 

ID 

ID 

dj 

*X 

CO 

CM 

X 


X 

Ll. 

X 

da 

da 

•d-t 

CM da 

da 

CO 

Tt* 

r- 

da 

xH 

da 

X 

X 

X 


•55 

ID 

X* 

Li 1 

Li.. 

X 


dj 

•55 

^p 

da 

X 


•dj 

ID 




X 

in 

Cli 

CM 

Ul 

CJ 

cr -1 

-P 

P*- 

O 

r- 

wJl 

cD 

•d 1 

Ll. 

r- 

•:-j 

rj 

r*- 

xH 

cm r - 

X 

dj 

PP 

re. 

■d' 

xH 

r- 

LO 

1 ^1 

r- 

•:*j 

r-- 

CM 

l*x 

up* 

•X 

i'- i 

X'* 


O 

•!D 

O 

IX 

X’ 1 

r- 

Ll 

ro 

CJ 

CM 

CM 

CM 

CD 

X 

r- 

r- 

.*, j 

LD 

l'M 

CO 

.-•5 

dj 


X 

Cli 

r- 


X 

•ro 

*d* 

x. CJ 


da 

?•• 

X 

da 

‘P* 

• M 

X 

X 


LT* 


da 


C^j 

cc* 

Cit* 

x-J 

cr. 

■p 



-p 

X 


X 


da 


X 

<o 

CM 

X 

OC* 

,• •, 

•dt 

It- 

c£ 

pp 

vj 

CJ 

rd 

wJ 

1 - 

iu 

d> 

r- 

*.M 

o 

r- x 

< J 

IX 

«d» 

r- 

X* 

rd 

X 

*-J 

IX 

xH 

X 

•d* 

P- 

X* 

X* 

X 

•:u 

o-. 

o 

x« 

s* 

.v* 

a> 

r- 

Cli 

r- 

r ‘i 

|X 

o 

fx 

X* 

X 

ro 

tH 

fO 

Tv- 

't 

cZj 
i •— 

8 

X 

X 

Q 

o 

r- 

IS 

fc' 

8 

X 

*:j 

8 

cr. 

XI 

da 

O 

X 

fx 

88 

da 

rx 

CJ 

Ll 

IX 

ret 

tH 

•5‘ 

8 

X 

CJ 

8 

re* 

tH 

8 

X 

da 

o 

c«i» 

Co 

da 

r_i 

uP* 

CM 

8 

CJ 

fx 

8 

8 

8 

ID 

'P 

CJ 

ro 

X 

8 

8 

|X 

•ID 

r^. 

LU 

8 

8 

xU 

CJ 

ro 

CD 

X 

r- 

CM 

X 

8 

X 

X 

8 

dj 

■’P 

dj 

r*- 

8 

X 

tH 

ro 

CJ 

X 

•X 

CJ 

cr, 

rd' 

t-*! 

LU 

8 

rd‘ 

r-~ 

888 

88 

X 

X 

8 

8 

8 

CO 

r-- 

ro 

tH 

dj 

CJ 

CM 

T-i 

X' 

X 

in 

Cu 

CM 

o 

in 

X 

8 

da 

>'-J 

X 

rx 

O'. 

'U 

CT, 

CJ 

Ch 

CJ 

in 

CD 

xH 

x-l 

X 

r-- 

ft 

LU 

X 

ro 

X 

-cH 

•X 

CJ 

CD 

8 

X 

rx 

UJ 
■ — 1 

cr 

ro 

X' 

IX 

CD 

o 

8 

X 

X 

«x« 

dj 

CD 

ip^i 

CJ 

LU 

8 

8 

8 

i — i 

X 

| 

CE« 

X 

X 

CM 

888 

X 

r- 

8ft 

tH 

T 

dj 

T' - - 

re« 

rH 

8 

r ■— 
»n 

CO 

pp 

ro 

rj 

ft 

o 

CM 

CTi 

ID 

•vD 

N 

eft 

8 

8 

8 

3 

8 

d> 

r- 

*D0 

ro 

ft 

8 

E 

dj 

xH 

CD 

8 

X 

rx 

o 

CM 

X 

r-- 

ro 

o 

X 

tH 

X 

tH 

CO 

rs» 

CO 

CD 

05 

l*\» 

C»5 

CD 

or* 

•25 

CO 

•?»' 

CO 

CD 

CO 3* 


«s» 

X 

•3» 

CO 

CD 

CO 

CD 

•:o 

^7* 

•:o 

•s* 

05 

•35 

•X 

CD 

05 

•35 

05 

aw 

‘rt 1 

05 

X* 

w 

r«5 

CO 

r»5 

CO 

•25 

05 

•25 

CO 

*25 

05 

ro 

(Tl 

Ch 

X 

az 

I'Ll 

lJ 

r j 

r, 

a, 

p 

UJ 

U.I 

X 

u_ CD 

a 

vi 

rH 

'■M 

CM 

r--» 

ro 

PP 

X- 

U~* 

to 

' L* 

*sD 

!'*- 


05 

CO 

Ch 

•Ti 

X X 

OJ 

CO 

|- ‘i 

i J 

dj 

CJ 

UJ 

LU 

LL 

X 

X* 

•S 

tH 

rH 


r, t 

j 

r 

CJ 

CJ 

O 

r i 

CJ 

CJ 

r .j 

r j 

l_J 

CJ 

uo 

o 

o 

dj 

dj 

dj 

Cl 

Ch 

dj 

dj 

dj 

•~J 

X 

di 

X 

dj 

X 

o 

Ci 

c 

CJ 

dj 

X 

dj 

id. 

•dj 

LJ 

dj 

dj 

dj 

id 

CD 

UJ 

UJ 

UJ 

UJ 

r._ 

P-- 

r- 

r- 

r*- 

r*- 

f's- 

r- 

r*- 

r-- 

r<- 

r- 

r-- 

r- 

r- r-- 

r-- 

r. 

r- 

r- 

r- 

r- 

r-- 

r- 

r- 

p- 

p- 

Ps_ 

rx 

fv. 

p- 

fx 

r*— 

r*- 

r-- 

r-- 

r- 

r- 

p- 

p-- 

P-- 

r-~ 

r- 

r- 

p- 

P-. 

P- 

p- 

r- 

r- 

r-- 



X 

r- 

CJ 

X 

rH 

CD 

ft 

ft 

S 

X* 

rri 

di 

X 

X 

r- 

X 

X 

rH 

tH 

8 

8^ 

CM 

CJ 


ro 

rH 

CD 

CJ 

CM 

Cl 

X* 


Cpj 

X 

CO 

rH 

in 

X 

DJ 


CD 


OJ 

X 

CD 

CJ 

•25 

X* 

X« 

ro 

rx 

u. 

u. 

TP 

ro 


C-.J 

•35 

ro 

o 

CM 

r- 

rH 

•45 

CE. 

<Xi 

o 

CO 

II, 

rH 

in 


ro 

05 

CD 

CJ 

ro 

CO 

•2D 

ai 

i j 

r- 

X 

r- 

X 

rH 

X 


X 

r-'t 

da 

X 

X 

X 

X 

•Pa 

Tt' 

•;r: 

da 

da 

X 

05 



rx 

•S* 

rj 

rx 

•!D 

X 

•2D 

‘vO 

•2j 

re* 

o 

X 

ro 

r- 

lL 



da 

X 


CD 

rH 

ro 

rH 

CM 

CM 

LO 

da 

ft5 

da 

CC* 


X 

o 

r- 

X 

X 

ro 

X 

rH 

rH 

CJ 

Cli 

X' 

r- 

X 

1 


CM 

r- 


da 

Ch 

X* 

k*- 

UPt 

CO 

da 

Ch 

CJ 

nr. 




ro 

LU 

O'. 

o 

CO 

rx 


X 

pp 


CO 

•S* 

on 

•dt 

X 

rH 

X 

CD 

u. 


X 

X 

a-. 

X 

•dr 

rH 

Tp 

rH 

CM 

CM 

'sO 

dj 

X 

p<i 

u. 

CJ 

p- 

CM 

tH 

r.i 


tH 

X* 

rH 

H 

CJ 

CP. 

CJ 

‘S' 

•S' 

X 

ro 

rH 

ro 

X 

r- 

^888^18 

LU 

C 

X 

TP 

8 

cr. 

X 



■"D 

05 

CD 

05 

CD 

CO 

<25 

■--•j 

CD 

05 

X* 

05 

X 

00 

X 


X 

CD 

rH 

rH 

r'-j 

CM 

ro 

ro 

rP 

Tp 

•jpt 

in 

'•iD 

'45 

r-~ 


CD 

CD 

CD 

CD 

CD 

CD 

CD 

CD 

X 

CD 

CD 

X 

X 

05 

CD 

A 

p- 


rx 

r- 

P-- 

P-- 

r- 

P- 

rx 

P-- 

P- 

r- 

! - 

IX 

1^- 


$88 

X 

05 

8 

8 

CJ 

CJ 

dj 

CJ 

X 

IX 

8 

dj 

CJ 

7B 

X 

rH 

8 

<o 

CD 

X 

tH 

8 

CTi 

DO 

LD 

r- 

'45 

'45 

X 

CD 

CM 

X 

X 

•o 

X 

CD 

rH 

rji 

CO 

XIX 

tH 

TP 

CM 

Ch 

IX 

dj 

CM 

P-- 

X 

LU 

Tp 

CD 

rH 

rj 

rH 

CM CM 

X 

X 

da 

O'. 

•01 

di 

X 

dj 

dj 

CJ 

U. 

rH 

X 

Ch 

rH 

HO 

ro 

tH 

o 

•D 

Oi 

CJ 

p- 

X 

o 

I s - 

rH 

tH 

IX 

X 

in 

COda 

r- 

•45 

X 

rH 

CM 

Ll 

X 

CM 

X 

X* 

*45 

X 

X 

CD 

X 

"■r ro 

TP 

X 

TP 

tH 

o 

r- 

dj 

CM 

r- 

ro 

X 

r- 

da 

LO 

Ur 


r- 

o 

X 

m 

UP* 

r— 

•^ 

X 



.* • 


CM 

•x> 

X' 

rH X 

X 

r- 

rH 

Ci 

rH 

X 

o 

t- 

X 

X* 

r- 

DJ 

CJ 

r- 

X 

CD^I 

lL 

CJ 

X 

X 

-H 

CM 

u- 

X 

CM 

CJ 

X* 

C£ 

X 


."•'.I 

P-U. 

IX 

1-0 

X 

rd 

dj 

fM 

rx 

X 

CM 

IX 

ro 

Ct 

p- 

x« 

X 

rx 

dt CO 
xrx 

to 8 

o 

r- 

cr. 

0-1 

CO 

rx 

X 

rx 

a, 

CD 

8 

8 

s 

8 

CJ 

r-- 

re* 

rH 

da 

CJ 

X' 

88 

8ft 

CJ 

re« 

2 

82ft 

X 

r-- 

LJ 

8 

IX 

TP 

X 

CM 

8ft 

05 

•S' O? 

CD 

05 

X 

•55 

X 

CO 

5 s 

X 

X 

05 

CD 

CO 

CD 

X 

rx 

CO CO 

ch 

Ch 

X 

X 

CO 

CO 

o 

CJ 

X 

dj 

X 

X 

X 

X 

Cli 

UJOJ 

UJ 

CD 

CD 

CD 

CC .i 

CD 

X 

CD 

X 

X 

CD 

CD 

CD 

CD 

p- 

r-r- 

r- 

P-- 

r-- 

r- 

r-- 

r- 

pv. 

N 

p- 

!X 

rx 


P-- 

p- 


fj 

X CM 

CO 

X 

X 

CJ 


r- 

r- 

r- 

in 

CJ 

S' 

CJt 

X 

!t2 

r- 

Ll CJ 

r- 

O 

X 

rH 

CM 

<25 

rH 

rH 

TP 

fx 

© 

CJ 

X 

CC 

rj 

azco 

da 

CO 

IX 

X 

in 

r- 

X 

X 

CM 

CJ 

tH 

-x 

c2a 

CJ 

ro 

da r- 

X 

IX 

ro 

da 

X 

■25 

r- 

r- 

CJ 

X 

r-j 


r- 

CJ 

o 

coco 

CJ 

0 s . 

o 

0*1 

in 

r- 

dj 

CJ 

un 

dj 

d. 

LU 

•r-j 

Tp 

CJ 

IX rH 

CJ 

CJ 

rH 

fX 

da 

•25 

CM 

OJ 

© 

CJ 

TP 

X 

X 

un 

r- 

X da 

X 

X 

Ul 

05 

in 

X 

da 

r- 

r- 

Oi 

TP 

rH 

o 

X 

Tp 

CM CJ 

Tp 

rx 

CO 

X 

CJ 

rx 

CM 

r- 

r- 

CJ 

Tp 

X 

CJ 

Li¬ 

X 

da ‘35 

X 

*n 

CO 


ch 

05 da 

IX 

IX 

rH 

X 

•:o 

UP* 

da 

rH 

o*S 

Tp 

X 

r- 

ro 

CJ 

CD CM 

rH 

rH 

i* *i 

r- 

rx 

un 

iX 

X' 

X X 

rH 

CM 

cc» 

TP 

IL 

X 

iX 

X 

X 

xH 

U - ' 

-j 

X 

OP 

X 

Tp© 

rH 

CM 

X 

S' 

ro 

o 

rH 

r- 

r- 

dj 

X 

© 

Li¬ 

Lh 

£J 

X rH 

X 

CT. 

r-- 

X 

•25 

Ll 

IX 

CJ 

•d' 

r-j 

az 

da 

da 

CJ 

«. 

• •- 

tH -*h 

r -~ 

X 

PO 

dj 

X 

r- 

rH 

nj 

<fM 

X 

c-o 

CJ 

r-^ 

ij 

X* 

XX 

X 

CD 

TP 

CTi 

IX 

H 

X 

r- 

r- 

•'—!• 

UP' 

© 

© 

•5*1 

ro 

UJN 

X 

X 

s> 

r-- 

I'O 

X 

•r 

p'- 

K. 

r- 

X 

i-*Pi 

a: 

Lpt 

8 

CO CD 
QrH 

CO 

rH 

X 

CM 

8 

X 

ro 

CO 

ro 

? 

X 

Tp 

ft 

CO 

UP' 

•25 

X 

CO 

X 

•25 

r 

CO 

rx 

© 

co 

CJ 

O CJ 

r i 

i* j 

o 

CJ 

CJ 

(j 

CJ 

CJ 

CJ 

CJ 

C j 

CJ 

tj 

o 

r- 

r-r- 

Id 

IX 

r- 

IX 

r-- 

r-« 

IX 

rx 

rx 

Px 

r- 

rx 

r-- 

r-. 


Number 22 


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


Page 41 


97 





Z-80 RAM TESTER 


Dear Dr. Dobb’s: Received: 77 Dec 7 

In the August issue of DDJ you carried an article by Jim 
Butterfield which listed a RAM test program for the 6502. 
This article in turn referenced an algorithm described by 
Knaizuk and Hartmann in the IEEE Transactions on Compu¬ 
ters (April 1977). Enclosed for your perusal is an assembly list¬ 
ing for the Z-80 version of this program. Some frills have been 
added for those lucky people who have the TDL “ZAPPLE” 
Monitor. These allow the user to specify the start and stop 
addresses and print out the location of the error byte. 

I have found this test program to be exceptionally good as 
well as fast. It even found a pattern sensitive 2102 that I had 
saved for the occasion from a previous hair tearing session. 
Keep up the good work! 


John MacDougall 


110 North Gordon Way 
Los Altos CA 94022 





o 

+ 








a 



X 

Q 


z 



•H 

tq 







c 

X 



a 

H 


>4 

H 

i j 


>4 

a 

u 


o 

X 










o 

a 



tH 

z: 


X 

X 

a 


X 

t—* 

< 


£ 

o 


C 

X 






a 


a 

c? 


>4 

a 


O 

a 

z 


o 

c/J 




o 

a 

CO 

o 




a 

a 

H 

43 

<c 

z 


a 

?: 


j: 

z 



£ 

1—1 

H 


z 

<c 

tH 

C) 

z 




o 

(H 

>4 

ttl 


H 



a 


a 




a 

r-5 

Z 


H 

£ 

>4 

X 

1—1 




a 

>4 

a 


X 

H 


X 

a 


£ 


rH 

a 

£ 

a 

H 




a 


£ 

X 



a 

a 


to 

o 

CO 


o 

X 



X 


tH 


X 

X 


z 

z 


H) 


o 



o 


X 

c 

M 

a 


-3 

£ 


X 

o 

X 

>4 

X 


X 


CJ 

O 

X 


X 

a 

X 


a 

X 

o 

o 

c/J 

C—< 



o 


tH 

X 

X 

a 

IH 

C3 



a 


o 

tH 

o 


a 


z 

o 


•«H 

V 



£ 

o 


rH 


a 


rH 

a 

o 


a 

o 

z 

X 



o 


a 

O 

rH 

43 

H 

X 





< 

F—4 


X 

-£ 


tH 

a 

L3 

z 

IH 

*=c 

z 


<=c 



<c 

£ 

m 

X 

CJ 


a 

a 



z 

H 

o 


a 



a 

rH 

£ 

H 

c/> 

r 



X 

£ 


o 


X 


o 

o 


r d 

a 

z 


d 

a 

X 

X 

z 

O 


c/J 

o 


Q 


a 


a 

o 

H 



a 

a 

<C 

X 

O 

rH 

<c 

X 

IH 

o 

a 

a 

O 

o 

\ 

X 

t—< 

Z 

z 

t—• 


a 

rH 

C/J 

H 


a 

a 

a 


o 

X 

£ 



tH 




H 

X 


c/J 

a 

X 

rH 

X 

H 



a 


o 

o 

X 

X 


X 


X 

a 

rH 

c) 

a 

X 


C ) 

Q 




z: 

a 


(D 

tH 

<£ 

c- 



£ 

£ 

tH 


X 

£ 

> 

z 

o 

a 

d 

.s 

H 

< 

IH 

H 

H 

o 

a 

o 

a 

a 

a 

O 

o 

o 

C3 

O 

a 

o 

o 

o 

=c 

(J 

a 

< 

•a 

O 

C/J 

o 

a 

a 

a 

£ 

a 

o 

a 

o 

X 

II 

H 

H 

u 

o 

•VJ 

tH 

X 

o 

a 

£ 

X 

o 


Z 

a 

a 

o 

o 

X 


'O OBJ) O 

in a z: =c < z. o 

X H H O H - O tH - 

o a £ (D C/J a O £ < 


: c a 

. -H J S> i 

: -*-> <c o 
> 3 o s 
o 
g 


T3 

O *“ Q o m H 
on c* vOOOOQre 

O O =T lA Z z H Q < J 

~ x - x x h h <d o ih z 

2 ifljj<i;aojQos 2 : l a, to d 


x x J ni a: o Q 

a) < a j h 

£:>£0 £ozo< , -3 £ c o a a a 

0£T£01 l Ua < 'jQ h J'HJJJ Z 

43 

3 •• 

•• O O 

Q G H 

O -O OQ Q 

Z 3 < Z 

»-« X •/) H d 

£ a • - co 


O O t- m C\l X X q 

O O O O X a 

3 C- d O CT> X d vO O out] ? <- o o o 

J 4 in (\1 b CM lQ o «- C- q O O 0 CJ 


- - 

Q J O 
CM (M O 
O O 
O O q 
lO 

=t, C 3 ON 

on c\j -d CJ 


•o 'fl q x cm in >n c- o <x o a x o «— in o < o x cm .o 

in in in in in in in in n n -o o ~o o 0.0 o h e b 

ooo oooooo ooooooooooo oooo 

ooo ooooooooooooooooo oooo 


C *H b0 
0) L C 
-*-> 3 -H 


< 4-3 0) 

: w c to 

> tD o c - 

4-3 (DO) 

■» "O CD C 

. (D (D £2 o 

) G a 

• H Cm (D Ci_i 

> -H > O 

-C C0 

. * CO £ to 

I 4-3 (D 

^ c to H 

I 3 - CO 
W to O S- 

> a> o -h 

1 G Ou 4-3 <D 

. „ cd -C 

0 Cl) to o 4-3 

-G » O 
4-3 O rH 
O <D 
bO rH E 
G <D rH -H 

£ n) *3 
4-3 

o rH to 
CD -G -H *H 

■C D D £ 

O -H C ^ 

5 3 

TO 4J 

C t) jj <a! 
fti CD 

43 (U 

c (fl . 
O CD t3 
•H Q. (D CD 
" c t, 

B k D II) 
O > 

O CO o o 

I -H 4_3 o 


: x a o 
o o h * 

1 OJ B M 

> b0 * 

, L 3cc 

> o O o 

> o 

to (0 H 

it) £ td 

c c 00 
. o c .« 
i o c 
J CD O 

< to 3 

> O I CM 
I CM I O 


OH a 
H X Q 
<C O 

O H Z ZJ 

O '/> M - 

X r x- 

x a a x 
x x 

-2000 

O H t-* 5 i 

2 to to H 


o ^ o x 
Muza- 

X O H C*» 

J 2 Q 
O 33 z i 
x q =c 
h 2 H a 

x! d H H I 

X S ^ i—4 *3) «aj 

O 

2 r i< (b Z a] J 

i- Ct, o x a. 

H D Jd d 2 

a H H t I O 

CO !0 9) O Z O 


H Q O M 

h d d 2 ;* 

X (H E 2 

>4 CO O ^ CO 

O CD H H O CO 

a z a 

z h ^ x 

^ - Cx, U 'd C 

O CO <C z H O 
Z O d S O X 'H 
O- X .£ x3 4-3 

O - • Cd Z (0 

X CO H xj CO > O 

d d d X d O O O 

N>hO<^2HH 


G X X d 

O =Z O 3 

ClHZ Z ' 

•H CO M c- a ■ 

E £ a H < 


X H x 

xx cm a x 
x- <£ a o a o 

X H Z * O - 
O CO -d C X <£ 


a a a 

a a X I—I =£ ,_! 

-t: c a h 

-> co CO £ CO £ 


XXX 
X X o 
< a a a o 

o co co o 


a a a 
=» a a a > 

o =c < o 

s o o o s . 


a o h x 

a o x 

o o o x a to 

< o x o o <* z 


x c 

<Z OJ < rH X X CD 

x x a x a o £ a 

Oaaooaaa 


Cm o Cm o 

X H «“ Q_ JH 

3 co a H 3 cO 

4JctoifiH iJcj;< ao 

w ^ ^ i 2 n ^ «oa - 

co £ o a to u o z < 

CD (D 

5 C 

•H .H 

43 43 

2-3 -3 2 s 3 a a 

P oa>a.z>. 

G<£0<££ o X X o 
ao£oa 0 o£oa£i 

3 3 


I H CD lQ CO X •• 

: X X .. x *H X H 

i <c a a a c a a 

I H q 5 iO E-« H O 

■ co • a • • - a a 


o 

- m . - * 

^ ^ 2 ° cm a x ao 

X CM O CM mm 4- (MO 

a-o o ooo oo 

(MXOi^nCMOX ooo •— o O X *- 

o in o x x o a 

a a cm a d cm a x 3'3aoixt^ o cd <c a x) 

o a cm dmmm.=j-c_>ooc'tMcQCMonxocn«— 

22^22- d ’“° ri ^‘ c ' <c 3 d X O CM 111 E <C a 
x2222 0r_,— ,-r " r-r-r ' r_( A J CMCM<MC\JCM 

22222°°°oooooooooooo 

OOOOOOOOOOOOOOOOOOOO 


O X 

X 

a «- a o 

o ^ o •- 


O O ifl OO 

o o o 

Q t*- -a o 3> x H o 

O 4- X CM b CM b O 


a a a a o o 

CM CM CM CM m m 
oooooo 
oooooo 


cm in so 
mmmm 
oooo 
oooo 


a a x «- m =t in o 
mmmd-^ d- a a 
oooooooo 
oooooooo 


Page 42 


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


Number 22 


98 










MINI-EDITOR FOR 8080 PILOT 


O 

-O 

O 

O 


Cx3 D 
m C\J 
O O 
O O 


<X 

•il 


Q 

o 

Z 

r-i 

s 


E-* 

cc 

<c 

H 

CO 


O t* 
cn LH 

g O 
O o 


o o 
o o 


o 



*2 r-t 


H 


IO X) J (\| 
f'o o m 
o o o o 
o o o o 


f H Cl. 
^ -J O 
OH dh 
Q C -s co 


o 

J3 

£ 


O O o o 
o o o o 


o 

QC H 
O CO 

_ -z < 

O M fcH 
S (O 


il, Cl, a. 


I 

b0 

C 


X 

<D 


Q C- Ci, i] a Cd C 

(\J CQ Cl, Cl, O CQ CM 

C\l Cl, Cl, C *-of Ox O 
m (\J Cl 4- Cl, E O 

c\j o' ci, o co cu a 

O t- Cl. O r- O CM 

a o *- u cq jo <c 

on o a vO i. *- m 

O Cl. jo ca o m a 

o «- o «- o a 

O Q Q < in vO oo 

mumcL.CL.O'- 

onoox>*-a^r 

in O Cl. «- vO CX 3 Cl, 

Q a O in Q Cl, o 

amoaocM*- 

o q < »- m oun 
O O O VO O ^ r x. 

a o o .a so c- *- o> 

(MOODOO-OO 

CMCMa«-C^OQO 
iM m i, ^ C- CM O O 

^■Qooao«—o 
(aooocMOOon 

r i, C*. Q u O' a ^ CQ 

a a- cm n c- ci. Cl, in 

Q Cl, < Q in C' OQ 

c_> cl, on o o a- t- a 

CM a •- Cl, O O a- O 

O on Cl, x. rvj o o o 

aojoaooma 

OOCMiOOUCM 


o 

o 

o 

o 


o 

o 

o 


o o o o o 
cm on =r m o 
o o o o o 
o o o o o 


Tim Scully is a friend and business associate who is an 
inmate at a Federal penitentiary. Despite that, he’s busier and 
more productive than most prople I know. Tim has been 
designing biofeedback equipment and doing biofeedback 
research for many years. He is now working on a doctorate in 
psychology; his dissertation project involves researching and 
developing bio feedback systems and techniques for use in drug 
rehabilitation. He is also publishing articles on biofeedback 
and microcomputers in People’s Computers and, as you see 
here, writing articles in other areas as well. 

With permission from prison officials, Tim has begun devel¬ 
oping a microcomputer-based system which will allow a 
cerebral palsy patient to communicate. A knee switch on the 
wheel-chair system will enable the patient to construct 
messages which will be displayed on a CR T. He plans to make 
his work available to the public. 

In addition, Tim is teaching a computer class to fellow 
inmates, using the computer system belonging to the cerebral 
palsy patient. Tim is hopeful of eventually obtaining a 
computer system for the prison, despite the fact that prison 
resources are scarce and he cannot solicit donations. But 
while donations can’t be solicited they can be accepted so long 
as no strings are attached. Contact me for more information 
if you have equipment to donate to Tim. 

Phyllis Cole 

Editor, People’s Computers 

Box E 

Menlo Park, CA 94025 

Tim Scully Received: 77 Oct 23 

I have a Poly System 4 with 8K of RAM (from 2000H— 
3FFFH). A few weeks ago I decided to get PILOT running 
on this system, and translated Dr. John A. Starkweather’s 
8080 PILOT 1.1 (from May 1977 Dr. Dobb’s) so that it would 
live comfortably in Poly’s memory, starting at 2000H. After 
writing a few simple PILOT programs, the need for an editor 
was clear. Being short on memory, I didn’t have room for an 
elaborate editor program, I wanted to squeeze a mini-editor 
into the space between a jump to the start of PILOT at 2000H 
and the actual start of PILOT at 2100H. 

The program listed below was hand assembled because Poly 
has neither an assembler nor a printer. The program uses 
several subroutines from the Polymorphics 4.0 monitor ROM, 
and these are the only labeled calls in the program listing. If 
you have another hardware configuration, you will want to 
replace these calls with some of your own. Here’s a brief 
description of what each one does, in case you don’t have the 
Poly monitor. 

WHO — fetches a character from the keyboard and returns 
it in A. 

WH1 — prints the character in A on the TV screen, recog¬ 
nizes a carriage return as carriage retum/line feed, recognizes 
CTL Z as a jump to monitor command (so I modified PILOT 
to use CTL B where Dr. Starkweather used CTL Z), and recog¬ 
nize CTL L as a command to erase a line (so I modified PILOT 
to use CTL L where Dr. Starkweather used CTL U). 

DEOUT — prints the contents of DE as a four digit hex 
number. 

MOVE — moves — BC bytes from an area starting at (HL) 
to the area starting at (DE) . . . only useful for moving from 
higher addresses to lower addresses. 

The mini-editor displays one line of your PILOT program at 
a time, beginning with the first line. At the beginning of each 
line it displays the memory address (in hex) of the first char¬ 
acter in the line (you can easily delete this feature if you don’t 
need it). The mini-editor is designed to drive a video display, 


Number 22 


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


Page 43 


99 


3-WAY BASIC MARRIAGE 


Received: 77 Nov 18 

I have been most pleasantly surprised by DDJCC&O after 
many rip offs and disappointments (i.e. Logic Press). I would 
gladly pay twice your subscription rates. You are truly doing 
an outstanding job of providing a needed service for the 
private computer user. 

I have adapted the LLL BASIC which was printed in 
DDJCC&O for my home made 8080 system and of course 
the first thing off I want more goodies. It seems to me that 
the Extended Accuracy Arithmetic package by Dinely in 
Vol. 2 No. 3 of DDJCC&O would be a useful addition to 
the BASIC interpreter. If there is any one else of like mind, 
I’d appreciate the chance to correspond with them. Another 
major feature which I am now adapting for my system is 
Dr. Starkweather’s 8080 PILOT. I plan to combine the LLL 
BASIC with PILOT using the source line editor in LLL BASIC 
to edit PILOT statements. Dr. Starkweather’s 8080 code 
for PILOT is beautifullly organized and commented and his 
“Guide to Pilot 8080” is also an exemplary job. 

If you are interested, I can send a souce listing of my 
results of the marriage of those 3 contributions from 
DDJCC&O. 

Yours Truly, 

B. Reeves 2-18 Patpong Road 

Bangkok 5 
Thailand 

Many thanks for the compliments! And yes indeed to that 
offer. We’d be most pleased... sounds like a “marriage made 
in Heaven ”-TR W 


but could easily work with a printer if you don’t mind using 
up some paper. 

Because of the small memory space available in my system 
for this editor, it does not use a cursor to indicate where 
insertions or deletions are to be made. Instead, if insertion is 
requested, a character will be inserted just before the first 
character presently being displayed. If deletion (rubout) is 
requested, the first character on the display will be deleted. 
The spacing feature of the program allows part of a line to be 
displayed so that insertions and deletions can be made in the 
middle of a line. When first called, the editor will display the 
first line of your program. The editor commands are listed 
below. 

Carriage return — displays the next line 

Line feed — backs up the display the previous line if you 
are looking at a complete line. If you are looking at part of 
a line, it backs you up to the beginning and shows you all of 
it (useful for seeing the results of insertions/deletions). 

Space — skips the first character of the previously displayed 
line and displays the remainder of the line, useful for editing 
in the middle of a line. 

CTL B — returns to PILOT if you called the mini-editor 
from PILOT. 

CTL D — inserts a space just in front of the first character 
on the display. 

CTL E — inserts a carriage return just in front of the first 
character presently on display. 

Any other control code - will be ignored (except CTL Z 
if you are using the Poly monitor ROM). 

Any other non-control character — will be inserted just in 
front of the first character presently on display. 

RUBOUT — deletes the first character on display. 


203E 

23 

I NX H 

move ahead one character 

203F 

C31820 

JMP 2018H 

display the remaining line 

20b 2 

FE7F 

CPI 7FH 

check for 'rubout' 

20bb 

C26220 

JNZ 2062H 

if not rubout, keep looking 

20h7 

2ao:-:20 

LHLD 200EH 

fetch starting address 

20b A 

E5 

PUSH H 

copy HL 

20b B 

D1 

POP D 

into DE 

20b C 

010000 

LXI B,0 

initialize PC for use as counter 

20b? 

3501 

KVI A,1 

set up to check for end-of-program flag 

2051 

2B 

BCX H 


2052 

23 

I NX H 


2053 

OB 

DCX B 

count one character 

205b 

BE 

CMP M 

check for end flag 

2055 

C25220 

JNZ 2052H 

if not end, keep counting 

2056 

2A0E20 

LHLD 200EH 

fetch starting address 

205B 

23 

I NX H 

skip the character to be rubbed out 

205c 

CD0001 

CALL MOVE 

move the rest of the program dov.n one byte 

205F 

031*20 

JKP 201BH 

display remainder of line (after rubout) 

2062 

FEOD 

CPI ODH 

check for carriage return 

206b 

CA1620 

JZ 2018H 

carriage return displays next line 

2067 

FEOA 

CPI OAH 

check for line feed 

2069 

C27*20 

JNZ 207BH 

if not, keep looking 

206C 

2AOE20 

LHLD 200EH 

fetch start of line 

206F 

2B 

DCX H 

line feed '-acks up a line 

2070 

2B 

DCX H 

back up 

2071 

7E 

MOV A,M 

fetch character 

2072 

FEOD 

CPI ODH 

look for carriage return 

207b 

C27020 

JNZ 2070H 

and keep hacking up until you find one 

2077 

23 

I NX H 

move ahead to start of line 

2078 

C31820 

JKP 2018H 

and display it 

207P 

FE02 

CPI 2 

look for (TIL B 

207D 

C8 

RZ 

CTL B returns us to PILOT 

2075 

FEOb 

CPI u 

check for CTL D 

2060 

CAB320 

JZ 20B3H 

CTL D inserts a space 

2083 

FE05 

CPI 5 

check for CTL E 

2085 

CAP620 

JZ 20E&H 

CTL E inserts a carriage return 

2086 

FE1F 

CPI 1FH 

skip any other control codes 

208 A 

DA 33 20 

JC 2033H 

bv fetching another keypress 

208D 

2A0E20 

IH ID 200EH 

fetch starting address 

2090 

F5 

PUSH PSW 

otherwise, save character so we can insert 

2091 

3501 

KVI A,1 

set up to look for end-of-program flag 

2093 

010000 

LXI B,0 

initialize 3C for use as counter 

2096 

2B 

DCX H 


2097 

23 

I NX H 


2096 

OB 

DCX B 

count one character 

2099 

PE 

CMP K 

check for end flag 

209A 

C29720 

JNZ 2097H 

if not end, keep counting 

209D 

5b 

MOV D,H 


209E 

5D 

MOV E,L 

copy HL into LE 

209F 

13 

I NX D 

move program 

20A0 

7E 

MOV A,M 

up one character 

20A1 

12 

STAX D 

; to make room for 

20A2 

IB 

DCX D 

; insertion 

20A3 

2P 

DCX H 

; 

20Ab 

OC 

TNR C 

; count one character 

20 A 5 

C29D20 

JNZ 209DH 

;keep on if not last character 

20A8 

ob 

I'JR B 

20A9 

C29D20 

JNZ 209DH 


20AC 

FI 

POP PSV 

;fetch back the character 

20AD 

12 

STAX D 

;and insert it 

20AS 

23 

I NX H 


2 OAF 

23 

I NX H 

space ahead 

20B0 

C31&20 

JKP 2016H 

;and display the remaining line 

20B3 

3520 

MVI A,' ' 

;insert space 

20B5 

C36D20 

JMP 208DH 


20R8 

3E0D 

MVI A,ODH 

;insert carriage return 

20HA 

C3&D20 

JMP 206DH 





listing for 

mini-editor 

2010 

210030 

LXI H,3000H 

start of program storage 

2013 

3'EOC 

MVT A,0CH 


2015 

CD2bOC 

CALL VJH1 

clear TV screen 

2016 

220E20 

SHLD 200EH 

store starting address 

201P 

2 tr )E20 

LHLD 200EH 

fetch starting address 

201E 

E? 

XCHG 

move address to DE 

201F 

CDD103 

CALL DEO’JT 

print DE as b hex digits 

2022 

E? 

XCHG 

restore address to HL 

2023 

3520 

MVI A,' • 


2025 

CD2b0C 

CALL Vfril 

print a space 

2028 

7E 

MOV A ,M 

fetch character from memory 

2029 

CD2b0r 

CALL VJH1 

print it 

202C 

72 

MOV A,M 

fetch it again 

202D 

23 

I NX H 

set up for next character 

202E 

FEOD 

CPI ODH 

check for carriage return = end of line 

2030 

C22820 

JNZ 2026H 

if not end of line, print more 

2033 

CD?' V )C 

CALL WHO 

fetch keyboard input 

2036 

} 520 

CPI ' ' 

check for space 

2036 

02b220 

JNZ 20b2H 

if not, keep looking 

203P 

2■0S20 

IP!LL 200EH 

fetch starting address 


Page 44 


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


Number 22 


100 






THE LAST REHASH OF BEAU HEX? 

Some letters on the subject 

Dear Dr. Dobb: Received: 78 Jan 24 

I have been noticing for some time, a gradual trend toward 
pseudo-religious fanaticism in many phases of computer 
related activity. We are condemned to everlasting failure if we 
don’t organize our programs like bands of angels. Some other 
fate awaits if we don’t throw away our flowchart templates 
and take up weiner diagrams, whatever they are. 

Those of us who know from long experience, that older and 
other methods work well when employed by competent 
people, have tended to dismiss these cults as the products of 
people who sought to cure their basic inability to organize 
their work logically as they went along, and then found that 
they could make (lots of) money by selling their ideas to the 
ignorant. We recognized them as rather childish simplifica¬ 
tions of the situation, shrugged our shoulders and went on 
about our business. 

The letter from Mark J. Nitzberg, in issue 2/9, reveals that 
this may have been a mistake. We have a young person of 
unknown experience level, who raves over the virtues of 
hexidecimal notation, and condemns octal, both with religious 
fervor, and with arguments which have nothing to do with the 
problem at hand. 

I think his letter has gotten me in a violent enough mood to 
respond in kind, and I have prepared a counter argument in 
the form of an open letter to Mark: 

James C. Matthews 

Dear Mark, 

I read your letter endorsing the use of hex. It seems that 
you are quite comfortable with this notation. Probably you 
can even do hex arithmetic in your head. However, there are 
two errors in your assumption that we must all abandon octal 
or suffer some everlasting (but undefined) torment: 1. The 
fact that you find hex easy to work with does not mean that 
all of us are equally able to manipulate large-base numbers, 
and; 2. You don’t understand the purpose behind the intro¬ 
duction of either the octal or hex formats. I shall try to 
explain these points, along with some other areas about which 
you seem a little fuzzy. 

First off, storage space, and the waste or conservation 
thereof, has nothing to do with either form of notation. Very 
little, if any, data is ever stored in either. The beast can count 
neither to 8 nor to 16, but only to 2. Everything is stored and 
acted upon in binary. If we really wanted to save paper and 
keystrokes, the thing to do is develop a printable set of 256 
distinct characters. Then a simple 8-key pad would suffice 
for data entry. (Don’t laugh-many users of ARPANET’S 
DNLS have become surprisingly proficient at entering ASCII 
data with the mouse buttons and fingerboard. They use the 
normal keyboard for initial entry, but only for very long 
changes while editing.) Of course, we would need to memorize 
the entire set of 256 characters, and do the binary-to- 
octabinary (seems like a good name for our new notation, we 
can say OB for short) in our heads, but then that’s a small 
price to pay for all the paper we would save. 

Octal appeared very early on the computer scene. The 
human brain seems to have something against long strings of 
repetitive characters. Binary, having only 2 character variations, 
reaches the rejection point very quickly. The limit seems to 
be about 6 bits, because most people who work with Baudot 
teletype soon learn to read the 5-unit code from punched 
tape, but very few ever learn more than a few characters of 
7-unit ASCII. (I do know this may seem to go against what I 
said about the DNLS users, but in that case it is broken into 
a 4-unit string for the left hand and a 3-unit for the right.) 


In any event, when memories were slow, and word lengths 
were growing by leaps and bounds to minimize the number of 
required accesses, people soon found that they could not deal 
effectively in the language the Machine was compelled to 
speak. People were used to dealing in decimal representation 
of numbers, and octal was the nearest subset of decimal that 
used an even binary set. Octal, therefore is purely a matter of 
convenience for the human in dealing with the blinkey beast. 

The development of hex is a compromise. Since most 
applications of computers require some nibbling at, if not 
actual crunching of decimal numbers, most machines become 
proficient, via hardware instructions, at either XS3 or BCD 
arithmetic. (You mention the 8080’s DAA as though it had 
something to do with hex. It doesn’t, it’s for BCD.) The 
great sages in their ivory towers, who spew forth nionitors and 
operating systems, discovered that ASCII is effectively a super¬ 
set of BCD, and they could save a few bytes of code in their 
creations by dragging the humans across the boundary of 
decimal to something easier to do on latter-day machines. 
And what it was, was hexidecimal. Hex was rather well 
accepted for several reasons: a. It came with the machine. If 
you wanted to talk to it, you learned hex. b. Doing arithmetic 
with alpha characters mixed freely with numbers enhances the 
mystique of the profession. While most octal users, in my 
experience, do simple arithmetic in their heads, most hex 
users seem to do their’s on paper. This is almost certain to 
awe the onlookers. 

You are totally wrong about any advantage of hex in mem¬ 
orizing the 8080 instruction set. In hex, there is no visible 
relationship of families of instructions, and you must 
memorize the entire set of over 200 instructions separately. In 
octal, the relationships are easily seen, and there are only 
about 20 basic instructions and variant rules to memorize. This 
is a clear 10-to-l advantage for octal in that most precious of 
all storage units, your one and only brain. 

You also seem to fail to understand the logic behind the 
“amazingly unorthodox” split octal representation used when 
8-bit machines have 16-bit addressing capability. This again is 
simply a concession to the human, allowing him to see the 
contents of each of the registers holding the 16-bit number, 
separately, as they really exist internally, and as they must be 
acted upon, in most cases. 

And finally, some philosophy. You did not have to compile 
that letter. Most people who become addicted to bit-flipping 
will be exposed to all manner of number representations, and 
hopefully, will be able to choose one that is right for them. I 
don’t have to write this, but I am a technical atheist, and take 
pleasure in espousing things looked down upon by those who 
allow some religious fervor to override their logic and 
condemn things without good reason. I don’t believe that any 
Supreme Being gives a hang how we structure our programs, 
draw our flowcharts, or represent our numbers. God, and the 
religious orders which help to channel some of our energies in 
search of truth and goodness, have far greater concerns in 
getting us to live with one and another, and with and upon this 
poor old Earth. You are wasting the energy and enthusiasm of 
your youth in pursuit of some rather nebulous dragons. Please 
try to find a channel that will have more lasting and meaning¬ 
ful results than trying to teach people to count on all 16 
fingers when they have only ten. 

Very sincerely, 2028 Merrily Dr. 

James C. Matthews Montgomery, AL 36111 

Dear Sir, Received: 78 Jan 16 

I am new to computing, so was unaware of the octal/hex 
controversy. Needless to say, I prefer octal, since there is less 
to leam. What hex proponent can state that hex never led him 
into error? (more) 


Number 22 


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


Page 45 


101 


SWTPC CT-1024 AUTOMATIC SCROLL 

Dear Mr. Warren, Received 77 Dec 12 

Having implemented the modifications suggested by Mr. R. 
Lynn Smith in the February 77 issue (pp. 25-27), I found it 
desirable to keep full control over the cursor (using the 
SWTPC Cursor Control board and Screen Read board) rather 
than have a cursor stuck at the last line of the screen. 

This can be achieved in a very simple fashion, as described 
next. The purpose is keeping all standard behaviour and all op¬ 
tions normally functioning, except when a line feed is issued 
with the cursor in the last line. In this case the text must be 
scrolled up, and the new line “cleared”. The solution given can 
be used independently of whether or not the 64 char/line 
option of Mr. Smith is implemented. It requires only 2 more 
IC’s: a 7420 quad NAND and a 74193 counter. 

The present situation (with or without 64 char/line) is 
shown in Fig. la, and the required modification in Fig. lb. 
When the cursor line counter (1C34) decimal value is 0-14, the 
behaviour is as if nothing had changed. When count 15 is 
reached, further “up” counting is inhibited. Instead, the next 
“count up” pulses increment the 74193 counter whose con¬ 
tents are added to the address portion A5-A8 (addressing the 
memory), thus causing scroll-up. This counter/adder configu¬ 
ration (74193 and 74283) can be built on a 1” by 2” PC card 
attached to the memory board, thus requiring only one “ex¬ 
ternal” connection. 

Software aspects. In order to maintain modularity and flex¬ 
ibility, a difference is made between “line feed” and “cursor 
down” when the cursor is in the last line. The first causes 
scroll-up, the second causes cursor wrap-around to the first 
line. Thus, programs that consider the CT-1024 as teletype re¬ 
placement always use “line feed”. Programs considering the 
complete screen field as basic output record format use all nor¬ 
mal cursor positioning commands (up, down, left, right) etc.. 
Note also that IC34 has still its preset capabilities available for 
those wishing to use direct cursor positioning. 

I hope that these suggestions will be helpful to some 
readers. 

Sincerely yours, 

R.T. Boute Francis Wellesplein 1 

Bell Telephone juClub B-2000 Anterwerpen (Belgium) 


4 MHZ Z-80 A BOARD BY NORTH STAR 

News Release Received: 77 Dec 20 

North Star Computers, Inc, announces a 4MHZ Z-80A 
processor board (ZPB) for use in S-100 bus computers. The 
Zilog Z-80 A executes compatible software more than twice as 
fast as the 8080. The North Star ZPB will operate in systems 
with or without front panels. It includes space for IK of 2708 
EPROM. 

Other features include auto-jump startup and vectored 
interrupts. Available as a kit for just $199 or $259 fully assem¬ 
bled. EPROM option costs are $49 for kit and $69 assembled. 
For additional information write: North Star Computers, Inc, 
2547 Ninth St, Berkeley, CA 94710, (415) 548-0858. 

Machines know nothing of the controversy; they work in 
binary. Octal and hex are merely convenient ways of restating 
binary for the sake of humans. A manufacturer wishing to 
please everyone, could issue two sets of manuals, one set in 
octal, and the other in hex. (Or could they?) 

The new fact seems important to me, that innovative manu¬ 
facturers aiming at mass markets (“home computing”) have 
stayed with octal. I mean Heath and Radio Shack. 

Yours &c;. &c., P.O. Box 1818 

Joe Schram Washington, DC 20013 


COMMUNICATIONS APPLICATION 
FOR THE HANDICAPPED 

Tim Scully, who has been designing biofeedback equipment 
and doing biofeedback research for years, is currently an inmate 
at a Federal penitentiary where he is working on his doctorate 
in psychology; his dissertation project involves researching 
and developing biofeedback systems and techniques for use 
in drug rehabilitation. 

With permission from prison officials, Tim has developed 
a Poly-88 based system which allows a cerebral palsy patient 
to communicate. A knee switch on the wheelchair enables the 
patient to construct messages which are displayed on a CRT. 
A complete description of the system including the assembly 
code listing has been published in Volme 6, No. 5 of People’s 
Computers (March/April issue). 

Tim is hopeful of eventually obtaining a computer system, 
despite the fact that prison resources are scarce and he cannot 
solicit donations. But while donations can’t be solicited , they 
can be accepted so long as no strings are attached. 

For further information contact: 

Phyllis Cole 

Editor, People’s Computers 

Box E 

Menlo Park, CA 94025 


Fin- 1» 

Present situation 


r 

1 cursor up * 





IC34 3 

4 2 

5 6 

7 


|(J3 pin 5) 

|count down 


| count up 



! line feed 



1 (IC30 pin 6) 

1 cursor down 

^ 1 


74193 


| (J3 pin 3) 

1 MAIN BOARD 

1 

J 



Page 46 


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


Number 22 


102 




















dr. dobbs journal of 

COMPUTER 
C 

Running Light Without Overbyte 

Number 23 _ March 1978 Volume 3, Issue 3 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


Status of the USCD PASCAL Project — Kenneth Bowles 

Report on efforts to implement PASCAL on various processors 

SAM 76 — Additional Comments — Ancelme Roichel 
Addenda to the documentation published by Dr. Dobb’s 

SOFTWARE 

For 6502’s 

Renumbering and Appending BASIC Programs on the Apple-II Computer — Steve Wozniak 
Apple’s R & D Head tells how 

A KIM Binary Calculator — John Eaton 

How to solve those problems you never had until you had a computer 
For 6800’s 

STRUBAL: A Structured BASIC Compiler — Robert Grappel 
For Z-80’s 

A Z-80 Tracer — Arthur W. Cline 
For 8080’s 

ACT — An 8080 Macroprocessor — Alex Cecil 
PL/M Listing with documentation 


alisthenics 


60 


rthodontia 


16 

46 

4 

13 

10 
11 

20 





© David Dameron 1979 


LEST WE FORGET.. . 

Technology often has a way of absorbing us in its intricacies 
to the extent that we can lose sight of the implications of what 
we are doing. It is for this reason that we have decided to 
interrupt our “bit fiddling" for a brief moment and refer to 
the ad which appears on the inside back cover of this issue. 

It is certainly not the policy of Dr. Dobb’s to preach on 
controversial issues. But we who are interested in reason and 
“artificial intelligence”-still an extension of human intelli¬ 
gence-should stop to consider that there exists on this planet 
another race of intelligent beings which is being systematically 
hunted to extinction. 

There are, of course, innumerable other causes we could 
choose to comment on, but the slaughter of whales has 
symbolic value. It asks a question of technological society 
that strikes at the relationship of technology and industry 
to intelligent life. We at People’s Computer Company wish to 
express the hope that the machines we play with be used to 
aid and increase living intellect and not to destroy it. 

Tom Williams 


KAPIAR ERRATA 

Dear Tom, Received: 78 Jan 23 

Here is an errata sheet for some of the goofs in my docu¬ 
mentation. (Sorry ’bout that...) 

p. 31, column 1, line 8 from bottom: insert ‘macro’ before the 
right paren; 

p. 32, column 2, line 9: ‘a@b@DEBLANK(b)’ should have 
been ‘a@DEBLANK(b)’; 
p. 32, column 2, line 12: ‘in’ should be ‘is’; 
p. 32, column 2, middle: ‘b@@a’ should be ‘b@ @a’; 
p. 33, column 2, line 26: ‘<parm 1>, . . .’ should have been 
‘<parm 1>",. ..’; 

p. 34, column 1, line 22 from bottom: ‘pairs of a’ should have 
been ‘pairs or a’; 

Finally, all the examples of ‘&’ as a continuation character 
were too long to fit the DDJ 2 column/page format, so the 
lines (as printed) are broken without continuation character, 
and continuation character ‘&’ is not followed by a new line as 
intended in the example. 

Cordially, 24225 Summerhill Ave. 

Steve Newberry Los Altos, CA 94022 


OTTAWA MICROCOMPUTING 

Dear Dr. Dobbs, Received: 78 Feb 6 

There is a club called “The Ottawa Computing Group” 
which is very active locally. Although electronic components 
are more expensive here (import duty, etc.), I would estimate 
there to be well in excess of 250 microcomputers operational. 
Interest is very high. Being the personal owner of an 
RCA COSMAC, I am disappointed that the use of this process¬ 
or is so low. There has been very little mention of this 
processor in Dr. Dobb’s which I hope will be rectified in the 
future. Perhaps an article by yourselves discussing a few of the 
nice features of the CDO1802 over other available processors 
might help stimulate more interest. In my estimation, the 
1802 is a superior MPU but few people realize that fact. 

Keep up the good work and keep those issues coming. 

Yours truly, 

D. C. Underwood 

Thanks for the encouragement and yes, we’d love to 
publish items of interest on the CDP1802 if folks out there 
would care to send us something. -TRW 


6502 DISASSEMBLER FIX 

Dear Dr. Dobb, Received: 78 Feb 22 

Since my Basic language disassembler for 6502 appeared in 
your Volume 3, Issue 1 as “Challenging Challenger ROMs”, 
I have discovered an omission. I somehow left out the ROR 
and ROL instructions. Apparently they don’t occur in the 
ROM areas I was examining at the time. The ROL mnemonic 
was in my data list although the decoding scheme I used would 
flag it as an illegal opcode. ROR is missing entirely. A proper 
fix would insert ROR after ROL in line 60 and completely 
rearrange the table in lines 210 to 520. This simpler fix also 
works. Just change the following lines. 

70 DATA SEI,STA,STX,STY,TAX,TAY,TSX,TXA,TXS,TYA,ROR 
230 DATA 10200,35222,56100,56100,56100,35203,3203,56100 
250 DATA 29300,2221,56100,56100,7200,2200,40200,56100 
260 DATA 39100,2210,40130,56100,7300,2300,40300,56100 
270 DATA 8200,2222,56100,56100,56100,2203,40203,56100 
280 DATA 44100,2304,56100,56100,56100,2303,40303,56100 
340 DATA 38100,1210,56130,56100,28325,1300,56300,56100 
350 DATA 13200,1222,56100,56100,56100,1203,56203,56100 
360 DATA 46100,1304,56100,56100.56100,1303,56303,56100 

Add 

611 IF C=56100 OR C 1100 THEN 1000 
Delete 630 and 631 

I’m enjoying the controversy you have generated over the 
Heathkit systems. Although I don’t use their computers, I 
did order some cassettes from the, believing that I could be 
certain of getting quality suitable for saving programs. The 
result has been disappointing. Although my Challenger uses 
the Kansas City format for recording (like Heath), all the 
Heath tapes consistently aquire a few errors in recording, 
and one is totally unusable. I don’t have these problems with 
other cassettes, and my recorder is the identical GE model 
sold by Heath. Buyer beware. 

Sincerely yours, P.O. Box 831 

Stephen P. Smith Parksley, VA 23421 


BEYOND THE 8080 

Received: 78 Feb 10 

Certainly. Am glad to tell you why I do not wish to 
resubscribe to your Journal. After two years of subscription, 
I find that the same people who started the Journal and 
writing for it still are doing so, still talking about 8080 mater¬ 
ials, little being written or published about 6502 or others. To 
check this imbalance, just take any five issues, as example, 
inventory those issues for content — by microprocessor type — 
and see for yourself. In other words, it appears to me that the 
“world” has passed you by. You are “out of step”. True, you 
have a market, but you are missing the far bigger and more 
diversified market that is there and needing your kind of help. 

If you change, I change. Until then, good luck. You had a 
a good idea! 

C. E. Brown 
Rt. 1 Box 159 B1 
White Stone, VA 22578 

Fact is, we probably are behind the times out here in 8080 
Land. But we’d be more than happy to publish stuff on 
6502’s and others if folks would write it up and send it to us. 
Dr. Dobb’s exists to help pass software around to the eager 
hands of users. _ jp \y 


Number 23 


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


Page 3 

105 



RENUMBERING &/\PPENDING gASIC PROGRAMS ON 

THE APPLE-II (COMPUTER 


BY STEVE WOZNIAK 

Apple Computer 

20863 Stevens Creek Blvd, B32 

Cupertino, CA 95014 

The laws of entropy insure that the line numbers of a de¬ 
bugged and operational BASIC program give the appearance 
of having been selected by a KENO machine. In fact, while 
several texts detail how the boundary conditions of a KENO 
game lead to predictable outcomes, finished programs seldom 
exhibit this property. Many a time I have spent an extra hour 
retyping a finished program while spacing the line numbers 
evenly just to make it “look good”. 

Another difficulty which I have experienced is joining 
two BASIC programs into a single, lafger one. This ‘append’ 
operation is easier to accomplish by hand than renumbering. 
The sophistocated user can examine the BASIC memory map 
and perform some manual manipulations to join the programs 
providing that the line numbers do not overlap. Still, the 
manual append operation is highly prone to error. 

The APPLE-II BASIC user now has a solution to these 
needs in the form of a hand- or tape-loadable program 
RENUM/APPEND, described herein. The CALL command 
is used to activate one of three machine level programs. The 
renumber operation (RENUM) requires user specification of 
the origiinal line number range over which renumbering is to 
occur, the new initial line number to be applied to the range, 
and the new line number increment to use. The example below 
specifies that lines 200 to 340 be renumbered starting with 
100 and spaced by 10’s. 

RANGE BEGIN 200 

RANGE END 340 

NEW BEGIN 100 

NEW INCREMENT 10 

A second RENUM entry renumbers the entire program, 
relieving the user of the need to specify the range begin and 
end parameters. The append operation (APPEND) reads the 
second user (BASIC) program off tape with the first in mem¬ 
ory. 

Renumber and append error conditions (memory full and 
line number overlap) are detected just as in BASIC. In case of 
error the user is notified and no program alteration occurs. 


Using RENUM/APPEND 


1. Load RENUM/APPEND (* 300.3D4 R) 

Note that the high-order bytes of page 3 are not loaded, 
preventing inadvertant alteration of the interrupt and user 
function (Y c ) vectors. The ‘ ’ is generated by the 
MONITOR, not the user. 

2. Load a BASIC program. 

3. To renumber entire program: 

POKE 2, START L User must supply low and high 
POKE 3, START H bytes of new STARTing line 


POKE 4, INCRL 
POKE 5, INCRH 

CALL 768 


number. 

User must supply low and high 
bytes of new line number 
INCRement. 

(does not alter locations 2-5) 


Note: START L is equivalent to START MOD 256 
START H is equivalent to START / 256 

4. To renumber a range of the program 
POKE 2, START L 
POKE 3, START H 


POKE4, INCRL 
POKE 5, INCRH 

User must supply low 
and high bytes of re¬ 
number range start¬ 
ing line number. 

User must supply low 
and high bytes of 
renumber range ending 
line number. 

(does not alter loca¬ 
tions 2-9) 

5. To append program #2 (larger line numbers) to program 
# 1 (smaller line numbers): 

(a) Load program # 2 

(b) CALL 956 

Be sure you are running the tape of program # 1 as this 
command will load it. 

(c) If you get a memory full error then use the command 
CALL 973 to recover the original program. 


POKE 6, RANGE START L 
POKE 7, RANGE START H 


POKE 8, RANGE END L 
POKE 9, RANGE END H 


CALL 776 


Errors 

1. If not enough free memory exists to contain the line num¬ 
ber table during pass 1 or RENUM then the message 
‘(beep) *** MEM FULL ERR’ is displayed and no renum¬ 
bering occurs. The same message is displayed if not enough 
free memory exists to hold the product of an APPEND. In 
the case of APPEND, the user will have to type the BASIC 
command CALL 973 to recover his original program. The 
user can free additional memory by eliminating all active 
BASIC variables with the CLR command. 

2. If renumbering results in a line number overlap (detected 
during pass 1 of RENUM) then the message ‘(beep) *** 
RANGE ERR’ is displayed and no renumbering occurs. 
This error may mean that one or more parameters were not 
specified or were incorrectly specified. 

Cautions 

1. When appending a program, always load the one with 
greater line numbers first. 

2. The user must be aware that branch target expressions may 
not be renumbered. For example, the statement GOTO 
ALPHA will not be modified by RENUM. The statement 
GOTO 100 + ALPHA will be modified only to reflect the 
new line number assigned to the old line 100. 

APPLE-II BASIC STRUCTURE 

An understanding of the internal representation of a 
BASIC program is necessary in order to develop RENUMBER 
and APPEND algorithms. Figure 1 illustrates the significant 
pointers for a program in memory. Variable and symbol table 
assignment begins at the location whose address is contained in 


Page 4 

106 


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


Number 23 


ihe pointer LOMEM ($4A and S4B where ‘S’ stands for hex). 
This is $800 (2048) on the APPLE-II unless changed by the 
user with the LOMEM: command. A second pointer, PV 
(Variable Pointer, at $CC and SCD) contains the address of the 
location immediately following the last location allocated to 
variables. PV is equal to LOMEM if no variables are actively 
assigned as is the case after a NEW, CLR, or LOMEM: com¬ 
mand. As variables are assigned, PV increases. 

Figure 1 - MEMORY MAP 


LOMEM (start of variables) 
($4A,4B) 


BASIC 

VARIABLES 


PV (Variable Pointer, end of variables) 
($CC,CD) 


constants are in this form including line number references 
such as 500 in the statement GOTO 500. Constants are always 
followed by a token. Although one or both bytes of a constant 
may be positive (less than $80) they are not tokens. 

Variable names are stored as consecutive ASCII characters 
with the high order bit set. The first character is between $C1 
and $DA (ASCII ‘A’ — ‘Z’), distinguishing names from 
constants. All names are terminated by a token which is recog¬ 
nizable by a clear high-order bit. The ‘S’ in string names 
such as A$ is treated as a token. 

String constants are stored as a token of value $28 followed 
by ASCII text (with high-order bits set) followed by a token 
of value $29. REM statements begin with the REM token 
($5D) followed by ASCII text (with high-order bits set) 
followed by the ‘end-of-line’ token. 


Figure 3 - ITEMS 


BASIC 

PROGRAM 


V -*-PP (Program Pointer, start of program) 

($CA,CB) 

first line 



HIMEM (end of program) 
($4C,4D) 


The BASIC program is stored beginning with the lowest 
numbered line at the location whose address is contained in 
the pointer PP (Program Pointer, at $CA and $CB). The 
pointer HIMEM ($4C and $4D) contains the address of the 
location immediately following the last byte of the last line of 
the program. This is normally the top of memory unless 
changed by the user with the HIMEM: command. As the pro¬ 
gram grows, PP decreases. PP is equal to HIMEM if there is no 
program in memory. Adequate checks in the BASIC insure 
that PV never exceeds PP. This is essence says that variables 
and program are not permitted to overlap. 

Lines of a BASIC program are not stored as they were ori¬ 
ginally entered (in ASCII) on the APPLE-II due to a pre- 
translation stage. Internally each line begins with a length 
byte which may serve as a link to the next line. The length 
byte is immediately followed by a two-byte line number 
stored in binary, low-order byte first. Line numbers range 
from 0 to 32767. The line number is followed by ‘items’ of 
various types, the final of which is an ‘end-of-line’ token 
($01). Refer to Figure 2. 

Figure 2 - LINE REPRESENTATION 


high 


f $01 I 


length line number items 

byte 


'end-of-line' 
token 


Single bytes of value less than $80 (128) are ‘tokens’ gen¬ 
erated by the translator. Each token stands for a fixed unit of 
text as required by the syntax of the language BASIC. Some 
stand for keywords such as PRINT or THEN while others 
stand for punctuation or operators such as *,’ or *+’. 

Integer constants are stored as three consecutive bytes. The 
first contains $B0-$B9 (ASCII ‘0’-‘9’) signifying that the 
next two contain a binary constant stored low-order byte 
first. The line number itself is not preceeded by $B0-$B9. All 


Constant: 


low 


high 


$B0-$B9 value 


positive 

token 


Name 


(ABC) : 


$C1 


$C2 | | $C3 | 

negative 
ASCII 



positive 

token 


String 

Constant 

("123"): | $28 |[ 

$B1 1 | $B2 | | $B3 | 

| $29 

quote 

token 

negative 

ASCII 

quote 

token 

REM: 

I $5D | 

i 1 1 i r 

1 | $01 1 



REM 

negative 

’end-of-1ine' 



token 

ASCII 

token 



Tokens: $00-$7F 

GO TO - $5F 
GOSUB - $5C 
THEN In - $24 
LIST - $74 
LIST , - $75 
STR CON - $28 
REM - $5D 
EOL - $01 


(tokens used by RENUMBER) 


Renumber — Theory of Operation 

Because of the rigid internal representation of APPLE-II 
BASIC programs (insured by the translator syntax check), 
writing a renumber program was a somewhat easier task than 
it would have been on many smaller BASIC’s. Fortunately 
all constants in APPLE-II BASIC (including line number 
references) are preconverted to binary. 

The normal renumber subroutine entry point is RENUM 
($308). The RENX entry ($300) conveniently sets the 
renumber range for the user such that the entire program will 
be renumbered. RENUM extensively uses SWEET16, the 
code-saving 16-bit interpretive machine built into the 
APPLE-II (Byte Magazine, Nov. 1977). Occasional 6502 code 
is interspersed throughout RENUM for even greater code 
efficiency. 

RENUM scans the entire program from beginning to end 
twice. During pass 1 a line number table is built containing 
all line numbers of the program found to be within the re¬ 
number range. This table begins at the address specified 


Number 23 


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


Page 5 

107 







by the BASIC variable pointer, PV, and is limited in length 
by the program pointer, PP. Each entry is two bytes long. 
A memory full error occurs if not enough free memory is 
available for the table. 

As line numbers are entered in the table corresponding 
new line numbers are generated and both new and old are 
displayed. Should the new line numbers result in an ‘out of 
ascending sequence’ condition, then a range error occurs 
and renumbering is terminated. It is assumed that the line 
numbers of the original program are in ascending sequence. 

The purpose of pass 2 is to scan the entire BASIC program 
while updating all references of line numbers found in the 
table to new assignments. Aside from the line numbers them¬ 
selves, the line number references sought are identified as 
constants immediately preceded by one of the following 
tokens: 

GOTO 
GOSUB 
THEN lno 
LIST 
LIST , 

No other statement normally permitted within an APPLE-II 
BASIC program may contain a line number reference. No 
errors will occur during pass 2. Exceptions such as empty line 
number table and null program are properly considered by 
both passes of RENUM. 


Append — Theory of Operation 

When APPEND is called, the user program with larger line 
numbers will be in memory and the one with smaller line 
numbers will be read off tape. The current program resides 
between two pointers, PP and HIMEM. HIMEM is preserved 
and set to the value contained in PP. This ‘hides’ the original 
program and prepares to load a new one immediately above 
it in memory. 

The BASIC load subroutine is called and a normal memory 
full error condition will result if not enough free memory is 
available to contain both programs. If this error occurs then 
the original program will still be hidden. Fortunately, it can 
be recovered by calling the tail end of APPEND at $3CD 
which simply restores HIMEM. If the load is successful then 
HIMEM is restored to its original value and both programs 
will be joined. No line number overlap check is performed. 


Original Program After Load HIMEM Restored 



PP-— 

PP-#- 




Prog ft 1 

Prog ft 

PP—— 

HIMEM-#- 




Prog ft 2 

Prog ft2 

Prog ft: 



(hidden) 


HIMEM—► 


HIMEM- 



P 


W 

•J 

a 

s 

< 

X 

w 

os 

w 

CQ 

2 

W 

os 


















o 









P 





















r- 









C/3 





O 

>0 




HD 


O 























iH 

in 


vO 


in 


in 














o 




O 

O 




r-H 

CM 

nO 

in 


CM 

yO 

CM 

lO 








2 

o 








P 

in 


'O 


1 


in 

CM 

vO 


in 


in 








to 

O' 








in 

CM 

y£) 

in 


o o 

Q 

CM 


in 

Q 

CM 

Q 

CM 








X 









o 


in 

CM 

rO 

o m 

O 


Q 

CM 

o 


o 








o 


* 








rH >, 

Q 

CM 


in 

r—1 H O 

2 

X 

o 


2 

X 

2 

X 






o 

vO 


o 








rH ,Q 

o 


Q 

CM 

r-H 



2 

s 











mm 

to 

CO 





*-» 



1 

2 

X 

o 


If) P 

O 

o 



o 

o 

O 

o 








r> 

mm 




II 


—A 

_ 

O T3 



2 

X 

CD cd >» 

m 

in 

o 

o 

o 

o 

— 

— 







CQ 

a 






f— 



O CD 

o 

o 



c .Q 

— 


— 

— 

— 

— 

— 

— 






o 

D 

H 

p 





2 


o 

rH O 

— 

— 

in 

in 

•H +J 









'O 





H 

in 


in 2 

2 

2 

2 

2 or. 


X 

H 

cd 





h k T3 

* 

* 

* 

* 

* 




r- O 

O 

o 

o 

o 

o 

o 

a 

*-• to 

(0 

to 

(0 

to o 

OS 

(0 

O 

w a 

* 

* 

* 

* 

ctf CD 

OJ 

n 


in 

v£> 


CO 

O' 

in 

yO 


CO 

O' 

CD 

CD 


j s 

as 

or. 

or 

a? u. 

a 

2 

CD 

CD C/3 

CM 

CD 

<T 

in 

^ P O 









mm 

mm 

mm 

mm 

—. 












C 





<d w a 
& a 

to 

X 

a 

to 

X 

to 

X 

to 

X 

to 

X 

to 

X 

a 

J A 
J 1 

A 

1 

A 

1 

A 

1 

A 

1 

H — 

in 

CM 

CD 

4 

50 

09 

70 

80 

00 

06 

o 

o 

CM 

O 

CD 

•H O 
r-H rH 

a 

to 

X 

to 

X 

a 

E O C/3 

o 

o 

o 

o 

O 

o 

o 

o 

< o n 

r^- 

O' 

o 

M 



mm 


mm 


— CM 

CM 

CM 

CM 


o 

o 

o 

o 

P P 

a 

CL 

a 

a 

a 

a 

0. 

a 

o o 

o 

o 

o 

mm 

J 











U 

a 

a 

a 

a 

c 

A 


A 

A 

A 

A 

A 

A 

A — 

mm 

mm 


mm 

A 











CD 

A 

A 

A 

A 

CD 






























OS 

























e 






p 

C 

CD 

PS 


u 

o 


2 O 
10 - 
X - 
n h ' 
O O O' 

o — to o 


II — 


m tc »-• h 

O n H H 2 H O 

pm inX2222X-fXH 

oot*. — fototouitooxtoo 
oidh joiSficJgu.a.zcj 

I— — (\]ro<ronr'-oooooo 
to o o o o — o — w m 

— — — — — — CMCMCMCM 

J 

A 


Page 6 


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


Number 23 


108 







>CALL 76B APPLE-1 I SASIC RENUMBER/APPEND SUBROUTINES 


CO 

l«J 

2 

f- 

p 

o 

x 

CD 

p 

CO 

Q 

2 

x 

0. 

0. 

<t 

V 

x 

W 

00 

S 

p 

2 

s 


»- 


y 





• 

CO 









CD 

uj 


• 







o 

• 





y 


m 


• 



X 







• 



2 

© 


y 



• 





n 





CD 




X 

• 


o 

y 






X 



<T 

2 


Id 



/-V 




to 

2 







»» 


U) 

X 

• 

X 

2 

• 





o 



X 



a 



r 


• 

• 

to 

Id 

• 




O 


— 


H 

UJ 

X 

X 


X 





H 




X 


2 



© 


X 

X 

<t 


X 




X 


X 


2 

H 

us 

Id 

X 

o 

• 




<t 

• 


£ 


• 


• 


X 


Id 

id 


X 

X 








*■* 

2 

y 


X 

X 

X 




J 

© 


p 

£ 

H 


y 


a 


a 

D 

• • 

J 

a 



• 

yC 


<o 


o 


2 

J 


X 

tn 

• 


• 

p 

2 


2 

D 

X 

J 

-4 




2 

2 

• o 

CD 

2 



UJ 

— 


—• 


a 

o 

*-« 

J 

J 

Id 

p 

y 

• 

X 

£ 

-J 

• 

UJ 

2 


CD 

X 


X 


M 

*—i 

O 2 

<E 




a 



> 



0. 

O 

p 

<t 


CO 

X 

X 

CQ 

p 


X 

X 

UJ 

y 

H 


• 

o 

• 



2 J 

H 




o 

10 

• 

CO 

• 

X 


X 

u. 


Id 


H 

X 

D 

u 

J 

L> 


X 

10 


J 

CD 


© 

o 

ID 

J 


o 



£ 


X 


X 

id 

o 



*-• 

O 

a 

2 

D 

to 

u 

< 

2 

X 



O 


X 

o 

U) 

o 

O 

> 

O 

o 

• 

• 


X 

x 

X 

UJ 

X 

o 

X 

£ 

u 

2 

< 

UJ 

to 


<* 


H 

o 

X 

Id 

2 

X 

X 

2 

X 

X 

X 

> Id 

2 

X 

• 

• 

O 

X 

Q 

UJ 

Q 

*■« 

X 

< 

Id 

Id 

<c 

o 



y 


y 



o 

-J 

J 

J 


X 


a. 

X 

UJ 2 

J 

X 

o 

<t 

2 

Q 

X 

a 

X 

X 

CL 

> 

£ 

Q 

X 

-J 


y 

D 

*> 

•-» 

o 

o 


ro 


m 

X 


X 



2 • 



• 

0 

~J 

r 

o 

or 

o 








—* 

UJ 

O 


2 

2 

*> 

o 

« 

•— 

<t 

o 


o 

•- 

o 


CVJ 

cvj 




o 

1 

o 

1 

o 

o 

o 

L> 

O 

o 

o 

H 

X 


y 

•-< 

J 

J 

2 

y 


y 

H 

£ 

H 


to 

X 



*-« 

M 

H 

i 

M 

i 



»-• 


*-• 

M 

*■* 


fd 


X 

Cd 




J 


CO 


<t 

Id 

< 

to 

•J 

f- o 

CO 

to 

M 

H 

CO 

> 

X 

> 

X 

to 

CO 

CO 

CO 

CO 

CO 

CO 

UJ 

X 

<c 

UJ 

> 

5 » 

> 


o 

to 

o 

X 

£ 

X 

CO 

<c 

X — 

CO 

to 

o 

o 

2 

o 


o 



<t 

« 


<t 

<C 

<t 

> 

<t 

X 

Sc 

Id 

UJ 

o 

M 

2 

<r 

2 

o 


L> 

< 


X X 

<r 

<t 

to 

CO 

O 

J 


-J 


m 

ra 

rn 

aj 

(TJ 

© 

CO 

CO 

u 

o 

CO 

2 

2 

j 

X 

-J 

0 . 

J 

CO 

X 

CO 

X 


2 X 

X 

X 

< 

<r 

o 


o 

* 









* * * 

* 

* 











to 



















a 








• 

* 






CD 

aj 

CD 

X 

O Id Q 

1- 



























o 

* 

to 





tO 

00 

O 

Q 

co cr uj 

<t 

















<t 


UJ 



ro 




_) 

^ 2 

« 

UJ 


<0 


o 

< O n 

CO 

td 

O 

oda 



















* 

0. 

CO 


* 

CVJ 



o 

y j 

K < 


♦ 

« 

h 

<r 

o — 



<T 

O O UJ 

UJ 

td 

X 

XXX 

a 

o — 

tO w 

CVJ 

ro 


to o 

K- 

CD 

to O 

CK 

<x 

co o 



o 


o 

—t 

♦ 

CO < 

UJ 


w 

to 



f- 

VO X 

* 





























* 

<t 

2 

X 


% 

yC 


z o; 

- td 

* 

o 



























• 

* 

nj q 

*-« 

UJ 

J 

c 



UJ UJ 

\ t~ 

* 

UJ 

K) Is) 

N) 

KJ 

KJ 

KJ KJ p 

r> 

D 

r> 

p p p 


KJ KJ 

KJ 

KJ 

KJ 

KJ KJ 

KJ 

KJ 

KJ KJ 

KJ 

KJ 

KJ KJ 

K) 

KJ 

KJ 

KJ 

KJ 


♦ 








CQ 

- D 

* 


X X 

X 

X 

X 

x x a 

a 

Cf 

c? 

a cn a 

H 

X X 

X 

X 

X 

X X 

X 

X 

X X 

X 

X 

x a 

0. 

X 

X 

X 

X 

•J 

X 

* 


D 

O 

p 


X 

C3 

id 

2 

X £ 

2 D 

— X 
£ 

* 

* 

CVJ 

Id UJ UJ 

Id 

UJ 

UJ Id Id 

UJ 

UJ 

id 

Id Id tu 

Id 

Id X 

X 

X 

X 

X X 

X 

X 

X X 

X 

X 

X X 

X 

X 

X 

X 

X 

X 

* 

» X 

X 


M 

o 

m 

UJ 

UJ 2 

o 

* 




























< 

* 

UJ'UJ 

CD 

Id 2 

2 



X UJ 

o 

* 




























• 

* 

J <D 

r» 

X 

M 


UJ 

UJ 

X 


♦ 





























* 

'X 2 

to 




o 

© 

Id 

KJ UJ 

* 

~J 





.J 


X 



J 


X 



H — 








CVJ 




w 

* 

X D 




> 

2 

2 

CO X 

o 3 

* 

H 





•J 


X 



H 

> o 



X x 




X 

X 

00 


X 




J 


<* 2 



UJ 

UJ 

< 

<C 

D O 

> x 

* 

H 




£ 

D 

o 

Id 


i- 

H 

02^ 


H Q 

£ 



Q 

Q 

2 2 

a 

a 




f- 


id 



2 

2 

X 

X 

X 

X 

* 

m 


-J 

X 

UJ 

X 

Id 

© 

Q 

«Oph 

m 

J 

_4 

o 

*-4 

CO 2 


CO £ O 

2 

2 

-J J 

2 

2 

o 

4 

X 

00 


X 








<t 

* 

n 

J X 

— 


£dJ£ 

a 

7 


— OP 

p o > 

> 

J 

X 

J J J X 

Id X 

to 

o > > 


© 

X 

X 

a 

H 











* 

CO 

o o 

-• 

— 

00 

X > UJ 

X 

< 

o 

r» or o 

CO 

UlilUZ 

2 

flO IQ 

CD 

O 

£ (_> X 

X 

X X 

co 

X x 

X 

o 




* 



* 


« 

# * 

* # < 

# 


X X 

X 

X 

X 

X X £ 

X 

X 

J 1/1 U L) 


<t 2 

2 

-J 

J 

f- H 

1- 

to 

X CO 

X 

X 

2 2 

H 

x u 

o 

£ 


o-cjn^m^Kcooo 

— CO © 

<T 

to 



CD 

<> 

O 

— CM 

© 


tn »o mo 

o 

o 

— CM 

CD 

<y 

to 

'O 


CO 

CK O 

— CM 

© 

«T 

in 

tO 

r- 

CD 


CVJ CVJ CM 

CM 

CM 

CM 

CM 

CM 

CM 

© 

© © 

© 

© 

© © © © 

© 


* 


<r 

<* 

<y 

cr 

<7 

<T lO 

co in 

m 

in 

in 

in 

m 

in 


2 

b) 

X o 
H in 


O 

h 
















O 

© 

X 

in 





00 


o 


<r 















© 


p 





II 


00 

M 


o: 
















ra 

X 






f“* 




© 















O 

D 

h- 

h 





2 

H 

o 


o 















H 

CO 


CO 

£ 

£ £ 

£ 

£ X 


X 

f- 

w 

X 















O 

O 

X 

M 

X 


X 

X o 

X 

X 

o 

J 

X 





O 

in 

o 

in 

o 

m 

O 

in 

O 


O 

© 

»— • 

_J 

or. 

X 

X X 

X 

2 

© 

a 






© 

© 

<T 


m 

in 

O 

nD 















X 

o 

m 

O 

in 

A 

A 

A 

A 

A 

A 

A 

A 

A 

h 

o 

in 

o 

in 

o 

in o 

in 


o 

in 

o 

< 

<r 

— 

— 

CM 

CM 

1 

i 

1 

1 

1 

1 

1 

1 

1 

CO 

00 


CM 

CM 

© 

© c 

<T 

in in 

o 

o 


X 

2 

A 

A 

A 

A 

o 

o 

O 

O 

o 

o 

O 

o 

o 

M 











w 

M 

1 

1 

1 

1 

m 

vO 

r» 

00 

o 

o 

00 

CM 

© 

J 












© 

— 

CM 

© 

<T 

— 

— 

— 

— 

— 

CM 

CM 

CM 

CM 

A 












Q 



W 

a 

a 

< 


x 

o 

x 

X 

f— 


X 


X 


<t 


H 


£ 


o 


X 

£ 

X 

<t 

X 

X 

© 

£ 

o 

<c 

X 

o 

X 

£ 

J 

<t 

< 

X 

2 

© 


o 

© 

X 

»—< 

X 

X 


o 

© 


*-« 

Id 

X 

X 

f— 

H 


£ s E 'O ££££££ 

X ro X in U1 X X X X Id 

XXX o x x x x x x 


f- O O O J 

CO O O O J 

— — c\» © <t 

J o 

A A 


h- o o o o o o 
CO — CVJ CD O O O 
*-* — CVJ rD 

J 

A 


Number 23 


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


Page 7 


109 













2 

« 

ft) 




• 

•« 


O 

Ul B 




o 



l) 

10 

X 

in 

r 



• ft 

to 


2 

m 3 




to 


10 

U 

to 



X o 

2 


J to 

< 10 

X 

® > 


X 


in 

X 


in 

2 • 



Ul J 


• 

CO 2 

H 

H 

2 O 




X 


CJ 

< 

— ft) 



o y 


— 

H — 

H 


— J 

• 

• 



H 

to 

X 

X 



2 IJ 

ft) 

2 

2 

O O 

> 


O' 

X 



to 



to 



— 2 


J 

N 2 

2 2 


H Ul 

O' 

X 


J 

o 

<r 

• 

r in 




H 

> 

<* 

J 

o 

X 2 

fj 

Ul 


J 

2 

i? 

Ul 

« 



UJ o 

X 

U 

X O 

X 

2 

Ul 




D • 



X o. 

CJ 

• 

J H 

U) 

2 

Q in 

2 — 

J 

2 v 

(J 

Ul 

2 

X 2 

R 

2 

2 

(J 

H • 

o 

X 

2 


M 

• o 



to 

o 

X 

X 

V 

Ul 


Q U) 

H X 

2 

<r — 


O 

Ul 

CJ X ft) 

• Q 

X O 

2 


p 

X D 


X 

H 

2 2 

cn uj 

J 

H 2 

X 

H 

J 2 J X Q 

2 J 


2 U J (T o: w I U 2 
- 2 t n • X • X ..J2 

-52 J 

araJOuiHOHO-:* 
2 (.) J J X 2 2 2 2 X Id 

<2— — <f 2 

» 5- x ft; x x 

I ~ _ 0. X — 


3 « O 2 £ O 
• O LI D J 

O 2 J 2 O 
« — or u 

« — 0. X 0. u u 

) O I- — 2 > 


n>o CD s Jod 
H Q < O Q to 
h 2 O J U CO 

0 2 JhOOX 

2 u) o C x 

jxr.HXwjo 
h J X o <t d u 

u. iu o y 

- 2 j x 


— h h x <f 

CJ <X 0 2 

CJ * Q 

d <d io or 

CO - D f J O 


• 2 < co Ul 

•2 CJ 2 2 % 

' (J X * O 2 

It- o o o Jo 

— I- - JO 

a. « 

> o * ■ — or 

' — o a * a h 

) to CJ to — to 

<c X x x 

ca o — to 


- o 5 

2 2 2 O — 

J — J J to 

^ > > in 

IJ IJ IJ U) <t 

2 2 2 2 0- 


J — — 

D 2 2 

L. J J K 

x :» ?• x 

(J (J U) Ul 
2 2 2 0: 


Q JXo2X2XXtro 
HQHr'X2HZHZ2X2 
w<tw 2 uaiXTC*)M ocn 


5 0 ftl W X H ftl % « 

' «* x x a x x :» — — o — 

s%Q Q 2 2 H Q O 2 222 

3<2IM2C5JW2 J J J — 2 
'ruui2(3i>:Q 

:xxioxdjffliDioid tijuiui 
30XXQX»0HHZ2#2Z2 


ft) N M 

X X a 

Q — Q 2 O 


ftl X Ql X O 
2XQOXQ20IO Uh 

OQ 2 WQ 2 OW 0 to to 


•— Q 

h ^ ? K 9 HO Q 0) Q CO K) 0. QhhUQX- KUKUKQ K ft! Hft! 

!jioto C ^?\m :2C ^Jrt C t , ^^ t ^ a ' C ^2 , "9 :DC>C1 “ >2oQt ” ultl,0:Qo * :Qa:2D -3 uD S oQ0 ' Mtl J(XtJ2O 

JtOtOJoCD — JlOJiOJlOOJ<tlOjtnn3JtOCDajlOlOtOOJQCQJoCQumQJCQQJoCQtOOCna3Q 

a. 


(T) IO 

D to «t 

IO <t C\J 


°‘5£!5!£2~-~- ,/>,or '“* >0 ' 0 "" <v,n ** n,0 ** eo<>0 — Ck,f ' , **o<OH» 0‘0 — ftir>fl>m»ftr**ccoo — fti«o.e 
, — ronooco'^^^^^^^^inintOiomtntomiOiO'OvO'O'O'OOO'O'O'Or'^f^^r^K^r-r^^.oocotDQOM 


UNBIQ-WOUOUUON 

n«tooQoo«jo^(jQo 


o<ym>or'~®<CQuiXft)ro<r 

tototoiotototntoiAtO'O^o 

ortoonononoonn 

OOOOOOOOOOOOO 


% cno, ° ° Ob. ft) O CJ OX X b. to X — 

J. 2 2 £ 5? £ rt £ S !C! 2 T. ° “2 08 s n m o r-r~ o r. m o K o <o r- w <m <t oi i~ r- v> c- I~ m « o o ■o eo q 

“ ""CMQOlJifinftinW" (M^OOIDIOOCDOUWN-- ^ i. n <f ft n i. ^ i*i i. ty q fi » q ft n i. 

'^^ t £9H!Er" CV, C?^' 0 ' 0 r ***00'<®OUlU.OCJr)«rt005 O <t CO Q LI h. - (\l 4 V) « » (M ffi Q O ^ n J) 

*C Kr-NN^NSf-tOBOCOfflCO cotooocococooaoooo.oooo<t<t<t<t 

r* ooooSooooooo — S3 2 2 2 2 S3 S3 2 (2 2 C? 2 2 2 •? 2 *2 «2 «2 <!> <? o w <•> r> n r> r> o <*> n n n 


14 


a 

< 

X 

H 

2 


bl 

H 

2 

J 

H 

H 

a 

7. 


bl 


2 

O CD 


< • 


UJ 

i 



— 

H H 

2 

0*2 

cr: 

a 


bl 


o 

PTR 

AND 

— 

0. w UJ 

D h- X 

a 

o • 

a 
• <x 

hi 

2 

CO 

2 

A X 

O X 

X 

z 

> 


< o • ~ ?. e 

tTQh* UJ Cl) cr 

o CL UJ CJ X x o 

it D2 X-OOl*. 

O O H H 

X or. o h o w 

O O UJ 2 I- UJ 

-*u.&!rot:ujv)cr 

h U] x 

CO 2 - O 

HJOOHOOH 

M W U) M « <t 

oQwwiiiwwc: 

3 J<0<t«0 
o CD CQ IO CQ CD lO 


E 

(J co 

2 CO 

K z <t 

H • ft. 

X X R 

O a bl 

012 2 

0-0 x O 

X J X Q Q 

ft. CO 0. 2 

H 0 2 

O Q tr Ul 

— 02 ft. X 

CO H <t H 

< U. 

03 — 


• * AO 

(J * l u 
J # • Q 

: o 

1 <* J o 2 

: • H Q 2 — 

• O O J 

— o o ~ 

• a 2 a — 

: j cm j — 

► o o o ft: 

i f“ O ifl % 

H >0 HO 

i o 2 or 

o Q • — w 

. a * or 

• < ♦ o. 


CO o to o — — 
<t O - O J X X 
0 0^0222 
«a to <r j j j 


« X > — XX 

i H O O * 2 ot * Q o 


X X 
Q X X Q 
2 O Q 2 a 


O o H ♦ 2 

(jOHUHXJhlDtOJ 
XJQ<D®D--QO — > 
OOXtAOtAO — — d(C>W 
KCa tUt,UdEO.uW2 


- O Q 

I O or CO X 2 « H Q HQ. ft. X XX O OKOXO»JQz4XX<tX*X<XXKX 

fJXU)3HHOHt0U)QHU)OHHOHHOHHQft.OH02Xo0QHOX2ft.22HHQOt0Ot0Ot0Oat0t0tnQ 

JO"ft»OtOt/>aX-5tOJt/ltOft.t/>tOJtOiOft.«OinJOCOtoJ — uUJiwjolDUffllDWXJJ’JJ-Jj^JJTJlJ 

X 

a 


cooanoQOQo 


MMMNNMMM 

aQ.CLa.o.a.a.a 

UUUUKOUlbJU) 


OJ 

X 2 

Q 2 O 

3 JO 2 O 
D If S P) (J W (C 
CtlJhlJ-XMO 
HOWCCHJW 


oo-wncrin'OH 

Ift'ftvO'ftO'O'fi'O'O 


m ® x 

D 2 

x M a 

i 

as 

d-BOO-N 

X x >o r*- 
<t - 


o-wo<TifioMDOO-wn«rft-fir>©0'0- 
o^tnvo^tcoo — «Mrj«rtnor*eoao — wr)«rioo^wo*OOoooooooo — — — — — — — — — — MtM 

r^r^r^r~^r'^coeooocoeoeo®eococooo<>0'<AOc>OtOa — — — — — — — — — — — — — — — — — — — w— — 


S u. h.OO Ul b. b. Ultlt 

— O O' O Ul O ® <t <M O — OC0 QQ(i)QN«Q)|i|O 

w ® <7 o <T n CM O O OO — <tuifflu — — — ®® 

• OOOOCOOWWWO'OtOtO — flt>O»H0>Ott>r><«OHr»<<*»<<*)M«CMH«Oi0'6O»O0'Otf>*>OOOtt 

X (Mfflnr)ltO(M-«£)n-OOP)MnOUOnNQOOOIMQOM<0«QOQOONO<<W<N<W<<NWOIN 

< 

o on<nn«oNBtauiiton«nflBMD»<t(DODLio-wn<f^MO(MCDQijocj( , )««ioDQONinN»uLN 

to oooooooooo------«------NNN«oifliWNNN(MWNnr)nnnrtnn<f^ccMtrMin 

•• noooncoortooonoooooMoortooonofooonOfooooowoooortnwnoortoooo 

CA OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Page 8 

110 


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


Number 23 










o 


o 

<T 


IV 

4 


10 

U) 

2 


D 

O 

x 

ra 

o 

10 


O 

>o 

o 

CM 

lO 

o 


o 

n 

o 

eo 

<o 

o 


o 

2 

K 

0. 

< 

V 

X 

(0 

£Q in 
r o> 
o — 

2 O 

y o 

o 
o — 
— o 


to r- 
J O 
0. O 
ft. 

< 


o 

in 

o 


in 
< 

o 


CM 

O 


00 

<T 

o 


«o 

o 


n 

o 

cm 

o 


n 

n 

© 


o o 

O ID 

o o 


o 

00 


O M <0 9 N N 

<T O O OJ r> <y 


© 


O O 


O O O O 


o — r> 

0 0-7 

o- 

o o o 


o — <o m 

•o r*- co — 

o o o o 


— — <•> M CM 

o o o r» o 

cm o — o — 

o o o o o 


«o — — cm m> r- 
«o io w w w m 

o o o o o o 


co o to oj m — 

— © O' M 00 00 

— o o — — — 

O O O O o o 


Or^coMc'ono — c'jr-or-c'jocvjco — 

r^oooco — —<rr-r>-r^oo,r-r--ono>owoococo<roo 

_ — — — --— oo — — oocm — o — — ooo — — — 

oooooooooooooooooooooooooo 


<o — r-OJM — or>oooo«of~<roo 

OOCMOO — COOOCOO — — — COCMOO 
— — — OCM — OO — O — — — — — — — 

ooooooooooooooooo 


in cm o 

o - o 

CM CM CM 

o o o 

MO O 

o — o 

CM CM CM 

o o o 


r*» o cm o 

00 O CD CM 

O CM — — 

o o o o 


r- M) 

o m 


o o 


00 — CM O OO *0 «© 

oo o r- o o o 
O O CM — — o o 
o o o o o o o 


</nm to 
O' m m oo 

O — — — 

o o o o 


«T hO-rf)CMO 

oocoot'-'or* 
— O O OJ — — o 
o o o o o o o 


oo M CO <c CM O 
CO in CD M 00 to 
o — o — o — 
o o o o o o 


» m n 
m m o 

o o o 


!^m5^^mSRy!? 0 ' u ? C5D ‘ ,r,lt ® u,uw ® u ’* t:jwr, ' Wuu '0 < ^ cl<> ^ NU “ 0r ''OQ®U(DO<coO'UiTiDO'^/)'oajinQ^inc\J 
JOfOOOOOOfOujOOQCDMOeOOOOO'OmOOOOOOrom'O'O — «00 — OOOOOO — — 0*0000m0000‘000000000c*t0p' 

J2!!? 0 92C2 oQQor,00<noo00f,,0000 ooor)ooc->or>oinoooooooootjor)Of>>oooroo»oooooooroon 

• OOOOOOOU.U.OOOOOOOOU.UJOOOOOOOOOOOOOOUIOOOOOOOOOUJOOOOOOOOOU.OOOOOOOOO 


a 


Q ^ CM f- 2 JO— » XXX 

20 mm H O Z > D 22202 — CM OQQO 

WHOtff-HHOUIOWZZH^OQU.atil — JJjJ in in UI222 XJ 

O0.XXX22DO2»-ZUJU)CnXJ<fzSQ>>>»Q<fflO<(ncnJQoOOJXJ — — t 
OaXIIOOOcOOMtH«220li)UOUlliJ(illiJJ - — — WCCQ.CKO’ltrbOO — — * 
<4OOOOUl)OQ(3XXMjjDj££i;2Z2ZO0.EU>.2ui.(l.Q.Q.|li0.P.Lfi;(Cli;i£( 


- cm H 

0 2 XXX U1 

X cnoZQQQH H 

pXXeooo<tO'0—222 t/ >* <* 

■^-:XXXXO.K-JJJ.JJu<Moa 
•;h>mai®cDn x oan. 
.f- O D O 


o 

J 


o cr. 

»- o 

O u. 

o 

X 

in o 
— o 


u. 

•n * 

-* o 


2 J 
M 

X 2 
O 10 

I- X 


o 

2 

J 

cr 

o 

u. 

X 

o 

o 

J 


o 

2 

J 


2 


a 


J 

o 

w 


»- n 

in o- 



u. <r 
- z 
z 
o o 


h 
u) in 
Q — 
o J 
z 


x 
t- o 

U) 

cn 


o 

2 

J 


X X 
o o 
U. f 0 
X 

u o 

o 

O td 
Z H 

X Q 
<t 0. 
Id D 
J 


E 

U] 


o 

in 

«f 

CQ 

»- 

X 

bl 

2 

X 

o 

to 

X 

o 


H 2 2 H ^ h ^ W Z 
02UWZ 0<*tn<nZ0©U) 
-OXXO OCM — — OOOH 
Cuhhu <ta.JJO<tZ — 


cc i-ce a h co z o 

UNuawOMUD2DHX 

q is i/iu ui QfflininfQininm 


2 2 
O O 
o o 


in o mo 0 o-cMnMin'Of'B 

CO CO CO CO CO OO'O'OO'O'O'OO' 


o o 

o o 


u. <r O' <t M — — 

O CM O CQ r- o Q 


Q <0 Q Q O O'OQQO'OO — 

u.o — oo u.o — ajoajoo 


o 

r 

in 


Cd 

0. 

< 


to o* : 


z z 

Si! 2 


a 


XX 2 


O I- 

t— o 
in m 
to 


o 2 

J ^ 
O D 
►“ 
to 

cr. 


o X 

— * o 

in c_> X Z 

<f — X O w 

m > o in r 

in in • x 

- a 

l X t— 0. 

ojcnuiot- 

J *j in D. in 


■» O' ( 

O' X < 
cr u c 
o in i 


H o 

Id Q 

in j 


o o 
Q M> X Z x 
< - U U] o 
o>w i in 
• J in • x • 

a 

azxxa Q 2 in 

t-t-wwoot-f-f- 

in IT 1-3 0.J ifl C K 


t- Q 
2 
ft) 10 
D 0. 

in a 

< 


> — cMDMin'OP-eoO'O — (\i n 
>000000000 — — — — — . 
icmcmcmcmcmcmcmcmcmcmcmcmcmcm: 


) o 
. o 


o 

o 


«t 

o 


joocooo ooooocoooc 
J — OO — 'OP^OCMCMUCMr-O. 



<0^000 U.OCtlin<OCOO><( 
<tm® ®m®oo 
orjrjno cnr>nnoor>r> 
ooooo oooooooo 


r> uh.NncMDO"tQo-(\in<t # 

in 'TjnOOOOOOOOOQQQQO* 

- oooooocoooonrjmoo* 

O' OOOOOOOOOOOOOOO * 


Number 23 


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


Page 9 

111 







STRUBAL: A STRUCTURED BASIC COMPILER 

Gentlepeople: Received: 78 Jan 25 

This letter was inspired by the letter of Neils Laughlin in 
your issue No. 19 page 19. Mr. Laughlin is describing a pro¬ 
posed structured language for microcomputer use. I agree that 
the structures proposed by Djikstra and others (DO WHILE, 
IF-THEN-ELSE, etc.) are good for writing readable programs, 
yet I look at the sample listing on page 20 and it is far from 
readable. It took several minutes of reading to figure out what 
the program was doing. I feel that computer languages should 
not demand such effort from the reader. To show what I feel 
a good microcomputer language should look like, I enclosed a 
listing of the same program, coded in my partner (Jack 
Hemenway) and my new language: STRUBAL. (STRUctured 
BAsic Language™) This langauge is implemented as a full 
compiler which runs on 6800 processors with 16K of memory. 
The compiler is written in 6800 assembler language and is pre¬ 
sently running on a SWTP system with ICOM floppies, 
although STRUBAL has also run from a dual cassette system. 
The compiler runs in three passes. Pass one converts the source 
language input file into an equivalent assembly-language out¬ 
put file. Passes two and three are an extended 6800 assembler. 
The use of assembly langauge as the intermediate file allows 
the programmer to easily read the intermediate file, to opti¬ 
mize it if desired, and to intersperse his own assembly-language 
statements wherever desired. This “inline” or “crutch-code” 
facility gives the programmer great power. STRUBAL itself is 
a very powerful langauge. There are three data types sup¬ 
ported: integer (16-bit), floating-point (10 digit BCD), and 
character string (bytes). Full math support is provided in 
several run-time packages, (trigonometry, logarithms, etc.) 
String functions in the language include string comparisons, 
string concatenation, variable-length strings, string-to-value and 
value-to-string conversion, etc. STRUBAL code is fully relocat¬ 
able and separately compiled program modules may be linked 
to form a single program. Common data areas, external refer¬ 
ences, etc. are all handled by a relocating loader which is part 
of the system. Subroutine calls with named parameters are 
supported. Sequential and random disk file access is sup¬ 
ported. (Tapes have only sequential files, obviously.) 
STRUBAL has all of the structured-programming forms 
(WHILE, IF-THEN-ELSE, CASE, etc.), plus other forms taken 
from BASIC and FORTRAN. (IF-statement, GOTO, GOSUB, 
FOR-NEXT, CALL, etc.) PEEK and POKE are provided, as is 
a function to return the address of a variable or label. Any 
data type may be an array of one or two dimensions. Exten¬ 
sive I/O format capability is provided for either console or disk 
(tape) file I/O. No line numbers are used, since a full editor is 
available to build source files and only those lines requiring 
transfer labels need have labels—and the labels are alphanu¬ 
meric names, not hard-to-follow numbers. 

That was a quick survey of STRUBAL. It is a fast compiler 
... the sample program was fully compiled (3 passes) in less 
than four minutes. The assembler part of the package can as¬ 
semble the entire compiler in about 12 minutes, (on floppies) 
Much of this speed comes from a hash-coded symbol table and 
a binary-searched keyword table. Keywords are searched on 
their first three characters, symbols are searched on the first 
six characters. 

Let me make a few notes on the STRUBAL program listing. 
All lines with an asterisk in the first column are comments and 
will also appear in the assembly intermediate file. All 
STRUBAL functions are indicated by a dot. .RAND returns a 
pseudo-random 16-bit value. Slashes in I/O statements gene¬ 
rate carriage retum/linefeeds. A percent sign indicates string 
I/O. STRUBAL does not require the indentation for blocks; it 
was done for readability. The top line is the command to the 


MACROFLOPPY tm AT S695 

News Release Received: 78 Jan 5 

A new series of fully packaged and assembled disk drives 
priced as low as $695 — including software, S-100 compatible 
controller and 143,000 byte capacity — has been announced 
by Micropolis Corporation. Developed for the retail microcom¬ 
puter market, the new MacroFloppy tm series initially includes 
two versions: 

Model 1041 packages a drive, enclosure, cabling and con¬ 
nectors, disk operating system and disk extended BASIC at a 
suggested retail price of $695. It is intended for integration 
into any 8080A or Z-80 microcomputer chassis. 

Model 1042, suggested retail of $795, adds a power supply 
and DC regulators for desktop use. 

Delivery is 30 days on both models, and they are factory 
warranted for 90 days. 

Both systems come with complete file protect and built in 
ROM bootstrap. MacroFloppys are hard-sectored into 16 
sectors each 256 bytes long; total tracks per surface is 35. 
Both offer transfer rates of 250K bits/second at an average 
rotational latency time of 100 msec. Access time track to 
track is 30 msec, and recording density 5162 bits per inch. 

The disk operating system offered with each MacroFloppy 
subsystem is a complete package including assembler, file 
management routines and utilities to support 8080A and 
Z-80 programs. MacroFloppy DOS will function in micro¬ 
computer systems with at least 16K of main memory. The 
company’s disk extended BASIC requires 24K of main 
storage. Contact Micropolis Corporation, 7959 Deering Ave, 
Canoga Park, CA 91304, (213) 703 -1121. 


ICOM disk system to print the file “&GUSS” from disk one. 

Since STRUBAL is a full compiler, all debugging tools used 
in assembler programming can be used with it. STRUBAL 
assumes some system monitor (like MIKBUG), but any reason¬ 
able monitor can be patched in. It is fully debugged and opera¬ 
tional now. 

Enough sales-pitch for now. We hope to market STRUBAL 
soon, and will be selling full source listings. STRUBAL is a lot 
more complex than a “tiny BASIC”, but I feel it returns a lot 
of power for the investment. 

Sincerely yours, 

Robert D. Grappel 
148 Wood Street 
Lexington, MA 02173 


PRINT,AGUSS*1 

* NUMBER-GUESS PROGRAM IN STRUBAL LANGUAGE 

* ILLUSTRATES STRUCTURED-PROGRAMMING 

* NOTEi RNDNO LIMITED TO RANGE I-IOO 

* 

INI EGER RNDNO.NGUESS,GUESS 
DSiRING YES.GSTAT 

* 

SIRING YES='Y' 

SIRING GSTAT-YES 

* 

rtHILE GSiAf .EQ. YES 

fiNDNO*. ABS I.RANDI I ) )/22H 
NGUESS*I 
GUESS*-I 

WHILE GUESS .NE. RNDNO 

INPUT /."GUESS*".GUESS,/ 

IF GUESS.LT. RNDNO PRINT ' TfX) LOW"./ 

IF GUESS.EG.RNDNO PRINT /,'O.K. IN ".NOUFSS./ 
IF GUESS.GT.RwDNO PRINT " TfX) HIGH',/ 
NGUESS*NGUESS+I 

BLOCK 

* 

INPIU /."PLAY AGAIN? (Y OR N)".%GSTAT 

BLOCK 

* 

STOP 

END 


Page 10 

112 


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


Number 23 



A Z~80 Tracer 


Dear Dr. Dobbs, Received: 78 Feb 12 

Here is a program which I think will be of some value to 
your readers! Since you have never to my knowledge 
published a Z-80 program, I thought that I might as well 
get things off the ground. 

This program is a valuable debugging tool. It will move a 
breakpoint through the object program while executing it. 
The breakpoint is a restart 070 8 that jumps to a register dump 
routine. The dump routine will jump to TRACER after 
displaying the registers. TRACER will then restore the object 
program op code at the location of the breakpoint. It will 
then calcluate the location of the next op code to be executed, 
load the first two bytes into the Tracer program, insert a 
restart at that location, then restore all the prime registers. It 
will then return to the object program where it was 
interrupted and execute the restored op code. 

The TRACER program uses the DIGITAL GROUP Z-80 
operating system register dump routine, but can be used with 
any routine to display any type of data desired. The routine 
must push all prime registers into the stack located at 
002000 8 (the stack cannot be used by the object program). 
The TRACER program starts at 006110 8 . Then after storing 
the stack pointer it will jump to the dump routine at 006134 g . 
The dump routine must jump back into TRACER at 006154 8 . 
All inputs and outputs are done in the dump routine. 

To use TRACER, load a 377 8 (restart jump to 006110 8 ) 
at the location where debugging is to begin. Then load B1&B2 
in TRACER with the first two bytes of the op code. When the 
object program is executed the registers will be displayed 
(or any data desired) when the restart is encountered. 

All addressing is in split octal mode. This program will 
only work on a Z-80 system but will trace 8080 programs 
since it is a subset of the Z-80 language. 

Sincerely, USAFSS, Box 18627 

Arthur W. Cline San Antonio, TX 78243 

(512)925-2380 


006110 355 163 166 006 

006114 355 163 151 006 

006120 042 132 006 

006123 341 

006124 053 

006125 061 000 002 

006130 345 

006131 041 *** *** 

006134 303 000 003 

006137 041 022 000 

006142 071 

006143 371 

006144 341 

006145 321 

006146 301 

006147 361 

006150 061 *** *** 

006153 311 

006154 026 377 

006156 052 314 007 

006161 355 163 316 007 

006165 061 *** *** 

006170 175 

006171 137 

006172 376 375 

006174 312 352 006 

006177 376 335 

006201 312 352 006 


PREDUMP LD(006166),SP 
LD(00615l),SP 
ID(006132),HL 
POP HL 
DEC. HL 

RETURN LD SP,(002000) 
PUSH HL 
LD HL,****** 
JP (LUMP) 

LD HL,000022 
ADD HL,SP 
LD SP,HL 
POP HL 
POP DE 
POP BC 
POP AP 
LD SP,****** 
RET 

START LD D,377 

LD HL,(b2,bl) 
LD (sp),SP 
LD SP,****** 

LD A,L 
LD E,A 
CP 375 
JP Z,(IX) 

CP 335 
JP Z,(IX) 


006204 376 313 
006206 312 024 007 
006211 376 355 
006213 174 
006214 312 334 006 
006217 376 351 
006221 312 131 007 
006224 001 012 000 
006225 000 
006230 041 322 007 
006233 355 261 
006235 257 
006236 271 
006237 173 
006240 302 244 007 
006243 173 
006244 001 011 000 
006247 355 261 
006251 257 
006252 271 
006253 302 014 007 
006256 173 
006257 001 023 000 
0Q6262 355 261 
006264 257 
006265 271 
006266 302 024 007 
006271 173 
006272 001 023 000 
006275 355 261 
006277 257 
006300 271 
006301 302 210 007 
006304 173 
006305 001 007 000 
006310 355 261 
006312 257 
006313 271 
006314 302 112 007 
006317 173 
006320 001 007 000 
006323 355 261 
006325 257 
006326 271 
006327 302 162 007 
006332 030 101 
006334 001 012 000 
006337 041 075 010 
006342 355 261 
006344 257 
006345 271 
006346 040 031 
006350 030 052 
006352 174 
006353 001 031 000 
006356 041 031 010 
006361 355 261 
006363 257 
006364 271 
006365 040 025 
006367 173 
006370 001 013 000 
006373 355 261 
006375 257 
006376 271 
006377 040 023 
007001 341 
007002 053 
007003 345 
007004 173 
007005 167 
007006 043 
007007 043 
007010 043 
007011 043 
007012 030 137 
007014 341 
007015 053 
007016 345 
007017 173 
007020 167 


CP 313 

JP Z,(2BYTE) 

CP 355 
LD A,H 

JP Z, (ESCAPE) 

CP 351 

JP Z,(JP(HL)) 

LD BC,000012 
NOP 

LD HL,007322 
CPIR 
XOR A 
CP C 
LD A,E 

JP NZ,(RETTST) 
LD A,E 

LD BC,000011 
CPIR 
XOR A 
CP CL 

JP NZ,(3BXTE) 

LD A,E 
LD BC,000023 
CPIR 
XOR A 
CP C 

JP NZ,(2BYTE) 

LD A,E 
LD BC,000023 
CPIR 
XOR A 
CP c 

JP NZ, (CALLTST) 
LD A,E 
LD BC,000007 
CPIR 
XOR A. 

CP C 

JP NZ,(RSI) 

LD A,E 

LD BC,000007 
CPIR 
XOR A 
CP C 

JP NZ,(JRTST) 
JR(IBXTE) 

ESCAPE LD BC,000012 
LD HL 010075 
CPIR 
XOR A 
CP G 

JR NZ,(4BXIE) 

JR (2BYTE) 

IX LD A,H 

LD BC,000031 
LD HL,010031 
CPIR 
XOR A 
CP C 

JR NZ,(3BXTE) 

LD A,E 
LD BC,000013 
CPIR 
XOR A 
CP C 

JR NZ,(2BYTE) 
4BYTE POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD (HL),A 
INC HL 
INC HL 
INC HL 
INC HL 
JR(PREEND) 

3BXIE POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD(HL) ,A 


Number 23 


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


Page 11 

113 



007021 043 



INC HL 

007163 

061 

374 

001 


007022 

030 

005 


JR 005 

007166 

062 

172 

007 


007024 

341 


2BYTE 

POP HL 

007171 





007025 

053 



DEC. HL 

007172 

##* 

006 



007026 

345 



PUSH HL 

007174 

355 

173 

166 

006 

007027 

173 



LD A,E 

007200 

030 

222 



007030 

167 



LD (HL),A 

007202 

355 

173 

166 

006 

007031 

043 



INC HL 

007206 

030 

254 



007032 

043 



INC HL 

007210 

173 




007033 

030 

116 


JR (007153) 

007211 

061 

374 

001 


007035 

341 


1BYTE 

POP HL 

007214 

062 

223 

007 


007036 

053 



DEC HL 

007217 

361 




007037 

345 



PUSH HL 

007220 

061 

377 

377 


007040 

173 



LD A,E 

007223 

*** 

235 

007 


007041 167 



LD (HL),A 

007226 

355 

173 

166 

006 

007042 

043 



INC HL 

007232 

303 

014 

007 


007043 

030 

106 


JR (007153) 

007235 

355 

173 

166 

006 

007045 

341 


CALL 

POP HL 

007241 

303 

045 

007 


007046 

053 



DEC HL 

007244 

061 

374 

001 


007047 

345 



PUSH HL 

007247 

062 

256 

007 


007050 

173 



LD A ,E 

007252 

361 




007051 167 



LD (HL),A 

007253 

061 

320 

007 


007052 

043 



INC HL 

007256 

*** 




007053 136 



LD E,(HL) 

007257 

355 

173 

166 

006 

007054 

043 



INC. HI 

007263 

303 

035 

006 


007055 

126 



LD D,(HL) 

007266 

355 

173 

166 

006 

007056 

353 



EX DE.HL 

007272 

3Q3 

143 

007 


007057 

176 



LD A,(HL) 

00727/5- 355 

173 

316 007 

007060 

066 

377 


LD (HL),377 

007301 

043 




007062 

030 

071 


JR(007155) 

007302 

176 




007064 

341 


JR 

POP HL 

007303 

062 

315 

007 


007065 

053 



DEC HL 

007306 303 

137 

006 


007066 

345 



PUSH HL 

007311 000 




007067 

173 



LD A,E 

007312 

000 




007070 

167 



LD (HL),A 

007313 

000 




007071 

043 



INC. HL 

007314 

**# 




007072 

176 



LD A,(HL) 

007315 

*** 




007073 

270 



CP B 

007316 

**# 




007074 

372 

103 007 


JP M,007103 

007317 

**# 




007077 

043 



INC HI 

007320 266 




007100 

205 



ADD L 

007321 007 




007101 

030 

004 


JR (007107) 






007103 

057 



CPL 







007104 107 
007105 175 
007106 220 
007107 157 
007110 030 
007112 341 
007113 053 
007114 345 
007115 173 
007116 167 
007117 356 
007121 074 
007122 157 
007123 046 
007125 371 
007126 341 
007127 030 
007131 341 
007132 053 
007133 345- 
007134 173 
007135 167 
007136/ 052 
007141 030 
007143 341 
007144 053 
007145 345 
007146 173 
007147 167 
007150 341 
007151 341 
007152 000 
007153 176 
007154 162 
007/155 062 
007160 030 
007162 173 


041 

307 

000 

022 


366 001 
010 


CALMS! 


RETTST 


END. 


314 007 
113 


LD B,A 
LD A,L 
SUB B 
LD L.JL 
JR (007153) 
RST POP HI 
DEC- HL 
PUSH HI 
LD A,E 
LH (HL) f A 
XOR 307 
INC A 
LD L,A 
LD H,000 
LD SP,HL 
POP HL 
JR (007153) 
JP(HL) POP HL 
DEC HL 
PUSH HL 
LD A,E 
LD (HL),A 
LD HL,(001366) 
JR(007153) 

RET POP HL 
DEG HL 
PUSH HL 
LD A,E 
LD (HL),A 
POP HL 
POP HL 
NOP 

LD A,(HL) 

LD (HL),D 
LD (007314),A 
JR (END) 

JRTST LD A..E 


co 

a 

E-t 


HCVJCVjr^rOrnrO^rriO 
ir\C H cm c^O 
O O O H rH H pH pH pH O 


HHH rnroH H H f^ino 
pH rnvo 

ooooornnrnnno 


■^■lAOHCMrn^iA^-VO'-O^DVOVOVOVOVOkOvr) 

VOVOVO^OVOVOVOVOVOOpHCNJrO-^-mC^OpHCNJ 

OOpHpHpHpHHpHHHHpHpHpHHpHC\JC\JC\J 

H 

rn 

o 

o 

rH 

o 


t'-K^N^^OOOOOOOO 
H (\J r^H-in^) OOJ^^LA^Oh-O 

rnrnrnrOrnrnOOOOOOOO 


C\JOsJC\JC\JCMC\JC\JC\JrnH-H-H-H-H-^-H-H-ir> 

OrHCsJro^mVOC^OOpHOsjrO-^-irvVOC^-pH 


vovovovovovovovororo^vovovovovpvovB 
OH C\J r^(\J r^OH (\J 

OOOOOOOO^^f^^^ronrOrOrO 


OOOOOOOOpHOpHHpHHOJCMCVJCNJO 

OpHCsjroH-in'Oc^HOOcvj^i-vo^irv'sdc^O 

rnrnr0rnrnrnn-»r0rnOOOOOOOOOO 

C\J 

CO 

rO 

O 

O 


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

114 


LD SP,001374 
LD (00717/2),A 
POP AP 
JR*(007202) 

LD SP, (006166) 
JR (2BYTE) 

LD SP,(006166) 
JR (JR) 

LD A,E 

LD SP,001374 
LD(007223),A 
POP AP 
LD SP,377377 
***007235 
LD SP,(006166) 
JP (3BYTE) 

LD SP,(006166) 
JP (CALL) 

LD SP,001374 
LD (007256),A 
POP AP 
LD SP,007320 
RET * 

LD SP,(006166) 
JP (lBYTE) 

LD SP,(006166) 
JP (RET) 

LD SP, (007/316) 
INC HL 
LD A,(HI) 
LD(007315),A 
JP (RETURN) 

NOP 

NOP 

NOP 

B1 

B2 

SP L 
SP H 

DUMMY SP L 
DUMMY SP H 



(0(0(0(0(00 
<~OH- lP»^D 
C\J C\J CVJ CM CM O 



Number 23 



A KIM Binary Calculator 




BY JOHN EATON 

1126 N 2nd 
Vincennes, Ind. 47591 
Copyright 1977 


Binary math has always been a stumbling block for anyone 
attempting to study the inner workings of a computer. No 
matter how often you work problems in binary, octal or 
hexadecimal, you can never work as efficiently as you can in 
decimal. Most of us when confronted with a problem involving 
other number systems will have to reach for a pencil and paper 
in order to obtain a result. 

But now there is an easier way to solve binary math 
problems. With this software your KIM-1 or other 6502 
system can do all the work and give you the result in a form 
that you can understand. The program is a machine language 
routine that will fit in less than IK of memory. It communi¬ 
cates with the user through any ASCII I/O device. 

The program will work with binary numbers up to 16 
bits. They can be inputted to the program in decimal, hexa¬ 
decimal, octal, binary or as an ASCII literal character. The user 
may specify whether the results are displayed in decimal, 
hexadecimal, octal or binary. With these features the program 
is able to convert numbers between different bases. 

Several logic functions are available. The program will 
take any two 16 bit numbers and perform the operations 
of AND, OR, NOR, EOR and NAND. You may also perform 
the arithmetic operations of addition and subtraction. The 
inverse and two’s complement of any 16 bit number can be 
found. 

There are two rotate commands available. The rotate 
commands treat two 16 bit numbers as a single 32 bit number 
and can shift it left or right up to 16 bits. 

Using the Routines 

The program requires a MOS 6502 based system and must 
have a rotate right instruction. If you have one of the earlier 
processors then you will have to modify the code around 
address 327E to perform eight ROL’s for each ROR. The pro¬ 
gram is assembled starting at address 3000 but is small enough 
that it will fit in a KIM-1 without any additional memory. 
The starting addresses for the user’s I/O routines go in the 
first 9 bytes. You will need a single character input routine, 
single character output routine and a routine that performs 
a carriage return and linefeed. 

Start the program at address 3010. It should respond with 
a carriage return and linefeed. The first thing that you should 
do is set the display mode. Type either DEC, HEX, OCT, or 
BIN depending on what mode you want the result to be 
displayed in. The mode that you type will remain in effect 
until you specify a new one. The program will respond by 
displaying the current value of its display register. 

The ENT command is used to enter numbers into the 
display register. Type ENT and a space followed by a number. 
If the number is other than a decimal number, it must be 
preceded by a % for binary, @ for octal, $ for hex and “ for an 
ASCII literal. ASCII literals must end with a ”, The number 
must be an integer and may be preceded by a ” if the two’s 


complement of the number is wanted. Once a number is 
displayed by the program you can use it in various ways. If 
you type INV or TSC then the inverse or two’s complement of 
the number is displayed. 

Several operations require the use of a second number to 
produce a result. Logical functions are available by typing 
AND, OR, EOR, NAND or NOR. Each of these commands 
must be followed by a space and a second number. The 
number can be in the same format as in the ENT command. 
The result of the operation will be displayed. The commands 
ADD and SUB may be used in a similar manner for integer 
arithmetic. 

The rotate commands require a special format. To use them 
type ROL or ROR followed by an integer number in paren¬ 
thesis. This number specifies the number of bits that are to 
be shifted. The parenthesis must be immediately followed 
by a 16 bit number that is to be shifted into the display 
to replace the bits that are shifted out. 

The program does all binary/decimal conversions with 
counting loops. It’s very easy to write but extremely slow. 
The worst case time for any conversion is 5 seconds so if 
you want fast results use a non-decimal display mode. 

Isn’t it nice to now have a computer that can solve prob¬ 
lems that you never would have to solve if you didn’t have 
a computer? 


0000 



DISL 


Display 

0001 



jISH 


register 

0002 



JECL 


dec/bin conversion 

0003 



bECH 


register 

0004 



BUFL 


Buffer 3 Bytes 

0005 



BUFH 



0006 



BUF0 



0007 



P0IN 


input line pointer 

0008 



MODE 


display mode 

0009 



SHIFT 


ft of bits per char 

000A 



MASK 



000B 



SIGN 



oooc 



VEB 



000D 



VEB+1 



n 00E 



VEB+2 



0010 



LR 


line register 32 bytes 

3000 6C 

00 

00 

INPUT 

JMP CHAIN 

user input routine 

3003 6c 

00 

00 

0TPUT 

JMP CHAR0T 

user output routine 

3006 6C 

00 

00 

GRIP 

JMP CARLF 

user carret/lf routine 

3009 EA 




NOP 


300A 20 

03 

30 

OUT 

J SR OTFUT 

display number 

300D 68 



DISPLA 

PLA 

300E DO 

FA 



BNE OUT 

characters on stack 

3010 A9 

01 


START 

LD Arir 01 

Start program here****** 

3012 85 

o? 



STA POIN 


3016 20 

06 

30 


JSR CRLF 


3017 C6 

07 


BACK 

DEC POIN 


3019 20 

00 

30 

LOOP 

JSR INPUT 

fetch character in Accum 

301C C9 

08 



CMP#08 

backspace? 

301E F0 

F7 



BEQ BACK 

yes 

3020 A6 

07 



LbX POIN 


3022 95 

10 



STA LR,X 

save character in pg 0 

3026 e6 

07 



INC POIN 

3026 C9 

ou 



CMPtfOD 

carriage return? 

3028 DO 

EF 



BNE LOOP 

302A 20 

06 

30 


JSR CRLF 


302b )& 




CL!) 


302E A0 

04 



LDY#06 


3030 20 

95 

30 


J SR LOAD 

load number into buffer 

3033 20 

D7 

30 


JSR OP 

perform operation 

3036 A2 

01 



LDXjYOI 

3038 35 

00 


MOVE 

LbA JlSL.X 

move display register 

303A 95 

04 



STA BUFL,X 

into buffer and invert 

303 c 69 FF 



E0rl#FF 

into dec/bin conversion 

303E 95 

02 



STA DECL.X 

register 

3060 CA 




7 EX 

3061 10 

F5 



BPL MOVE 


3063 A9 

00 



L /MOO 


3065 85 

06 



STA BUFD 


304? 48 




PHA 

end of stack storage 


Number 23 


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


Page 13 

115 




3048 A6 

08 



LjX MOjE 

display mode 

3103 

20 

58 31 

SUB 

JSR TSCB 

304A DO 

27 



BNE DIS1 

non decimal 

3106 

A9 

75 

ADD 

LDA# 7 5 

304C F8 




SEj 


3108 

DO 

19 


BNE EXEC 

304D 20 

D9 

31 


J SR SET9 

Buffer=999999 

310A 

A9 

31 

NAD 

LDA#31 

3050 38 



DEC1 

SEC 

add 1 to buffer 

310C 

48 



PHA 

3051 A0 

02 



LDY#02 


31OD 

A9 

13 


LDA#13 

3053 A2 

00 



LDX#00 


310F 

48 



PHA 

3055 85 

04 


DEC2 

LDA BUFL.X 


3110 

A9 

35 

AND 

lda#35 

3057 69 

00 



ADC#00 


3112 

DO 

OF 


BNE EXEC 

3059 95 

04 



STA BUFL.X 


3114 

20 

DD 31 

INV 

JSR SETF 

305B E8 




I NX 


3117 

A9 

55 

EOR 

LDA#55 

305c 88 




DEY 


3119 

DO 

08 


BNE EXEC 

305D 10 

F6 



BPL DEC2 


311B 

A9 

31 

NOR 

LDA#31 

305F E6 

02 



INC DECL 

add 1 to JECL 

311D 

48 



PHA 

3061 DO 

ED 



BNE DEC1 


311E 

A9 

13 


LDA#13 

3063 E6 

03 


DEC 3 

INC DECH 


3120 

48 



PHA 

3065 F0 

06 



BEQ DEC4 

finished counting 

3121 

A9 

15 

ORR 

LDA#15 

306? 20 

6A 

32 


J SR ADD256 

add 256 to buffer 

3123 

85 

oc 

EXEC 

STA VEB 

306A 4C 

63 

30 


JMP DEC3 


3125 

A9 

00 


LDA#00 







3127 

85 

OD 


STA VEB+1 

306D A0 

14 


DEC4 

LDY#14 

lenght* 20 bits 

3129 

A9 

60 


lda#6o 

306F A2 

04 



LDX#04 

bits/char* 4 

312B 

85 

OE 


STA VEB+2 

3071 DO 

03 



BNE DIS2 

unconditional branch 

312D 

18 



CLC 







312E 

A2 

00 


LDX#00 

3073 BC 

65 

32 

DIS1 

LDY TAB2-1.X 

fetch lenght 

3130 

AO 

01 


LDY#01 

3076 86 

09 


DIS2 

STX SHIFT 


3132 

B5 

04 

EXEC1 

LDA BUFL.X 

3078 D8 




CLD 


3134 

20 

OC 00 


JSR VEB 

3079 A6 

09 


DIS3 

LDX SHIFT 

fetch LSD and save on stack 

3137 

95 

00 


STA DISL.X 

307B A9 

80 



LDA#80 


3139 

E8 



I NX 

307D 20 

7E 

32 

DIS4 

JSR ROTATE 


313A 

88 



DEY 

3080 88 




DEY 


313B 

10 

F5 


BPL EXEC1 

3081 30 
3083 CA 

8A 



BMI DISPLA 
nFY 

display all characters 

313D 

60 



RTS 

3084 DO 

F7 



BNE DIS4 


313E 

A5 

04 

ENT 

LDA BUFL 

3086 4A 



DIS5 

LSR A 

char in A,shift to lo end 

3140 

85 

00 


STA DISL 

3087 DO 

FD 



BCC DIS5 


3142 

A5 

05 


LDA BUFH 

3089 C9 

OA 



CMP#0A 

convert to ASCII 

3144 

85 

01 


STA DISH 

308B 90 

02 



BCC DIS6 


3146 

60 



RTS 

308D 69 

06 



ADC#06 







308F 69 

30 


DIS6 

ADC#30 


3147 

A9 

01 

BIN 

LDA#01 

3091 48 




PHA 

save char on stack 

3149 

DO 

OA 


BNE MOD 

3092 4C 

79 

30 


JMP DIS3 


314B 

AQ 

03 

OCT 

LDA#03 







314d 

DO 

06 


BNE MOD 

3095 A2 

04 


LOAD 

LDX# 04 

number load routine 

314f 

A9 

04 

HEX 

LDA#04 

3097 B9 

10 

00 

L0AD1 

LDA LR,Y 

Y points to start 

3151 

DO 

02 


BNE MOD 

309A DD 

D2 

30 


CMP LOAD8,X 

match to 












3153 

A9 

00 

DEC 

LDA#00 

309D FO 

15 



BEQ L0AD4 

match found 

3155 

85 

08 

MOD 

STA MODE 

309F CA 




DEX 


3157 

60 



RTS 

30A0 DO 

F5 



BNE LOAD1 







30A2 A2 

04 



LDX#04 

decimal input 

3158 

A2 

04 

TSCB 

LuX#04 

30A4 20 

97 

31 


JSR LOADT 

input number 

315A 

DO 

02 


BNE TSC1 

30A7 20 

E6 

31 


JSR DECHEX 

convert to hex 

315C 

A2 

00 

TSC 

LDX#00 

30AA A5 

OB 


L0AD2 

LDA SIGN 

complement if "-" 

315E 

38 


T JC 1 

SEC 

30AC C9 

21: 



CMP#"-" 


315? 

98 



TYA 

30AE DO 

03 



BNE LOAD3 


3160 

48 



PHA 

30B0 20 

58 

31 


JSR TSCB 


3161 

AO 

01 


LDY#01 

30B3 60 



LOAD 3 

RTS 


3163 

B5 

00 

TSC 2 

LDA DISL.X 

30B4 EO 

02 


LOAD4 

CPX#02 

test for ASCII literal 

3165 

49 

FF 


EOR#FF 

30B6 DO 

14 



BNE L0AD7 


3167 

69 

00 


ADC#00 

30B8 C8 



LOAD 5 

I NY 

ASCII section 

3169 

95 

00 


STA DISL.X 

30B9 A2 

07 



LDX#07 


316B 

E8 



I NX 

30BB B9 

10 

00 


LDA LR,Y 


316c 

88 



DEY 

30BE C9 

22 



CMP#""" 

last character 

3160 

10 

F4 


BPL TSC2 

30C0 FO 

FI 



BEQ LOAD3 


316f 

68 



PLA 

30C2 OA 



L0AD6 

ASL A 

shift char into buff 

3170 

A8 



TAY 

30C3 26 

04 



ROL BUFL 


3171 

60 



RTS 

30C5 26 

05 



ROL BUFH 







30C7 CA 




DEX 


3172 

20 

58 31 

ROR 

JSR TSCB 

30C8 10 

P ! 8 



BPL LOAD6 


3175 

A9 

IF 


LDA# IF 

30CA 30 

EC 



BMI LOAD5 


3177 

25 

04 


AND BUFL 

30CC C8 



LOAD 7 

I NY 

hex.oct and bin 

3179 

85 

04 


STA BUFL 

30CD 20 

97 

31 


JSR LOADT 


317B 

C6 

04 

ROL 

DEC BUFL 

30D0 4C 

AA 

30 


JMP L0AD2 


317D 

A9 

3F 


LDA# 3F 

30D3 25 

22 

4o 

LOAD8+1 

.BYTE 


317? 

25 

04 


AND BUFL 

30D6 24 




.BYTE $ 


3181 

48 



PHA 







3182 

C8 



INY 

30D7 98 



OP 

TYA 

look up command and 

3183 

20 

95 30 


JSR LOAD 

30C8 48 




PHA 

perform 

3186 

68 



PLA 

30D9 AO 

00 



LDY#00 


3187 

AS 



TAY 

30CB A2 

00 



LDX#00 


3188 

A5 

01 

R0L1 

LDA DISH 

3ODD 20 

FO 

30 


JSR 0P1 

match 1st letter 

318A 

OA 



ASL A 

30E0 20 

FO 

30 


JSR 0P1 

match 2nd letter 

318B 

26 

04 


ROL BUFL 

30E3 20 

FO 

30 


JSR 0P1 

match 3rd letter 

3180 

26 

05 


ROL BUFH 

30S6 68 




PLA 


318f 

26 

00 


ROL DISL 

30E? A8 




TAY 


3191 

26 

01 


ROL DISH 

30E8 A9 

31 



LDA#31 

address hi byte 

3193 

88 



DEY 

30EA 48 




PHA 


3194 

10 

F2 


BPL R0L1 

30EB B3 

16 

32 


LDA TABl.X 

address lo byte-1 

3196 

60 



RTS 

30EE 43 




PHA 







30EF 60 




KTS 

jump to operation 

3197 

B9 

10 00 

LOADT 

LDA LR, Y 

30F0 BD 

16 

32 

0P1 

LDA TABl.X 

search table for match 

319A 

85 

OB 


STA SIGN 

30F3 39 

10 

00 


CMP Lh,Y 


319C 

C9 

2D 


CMP#"-" 

30F6 FO 

08 



BEQ 0P2 

match found 

319E 

DO 

01 


BNE LOADT1 

30.-8 E8 




I NX 

next entry 

31A0 

C8 



INY 

30.-9 E8 




I NX 


31A1 

86 

09 

LOADT1 

STX SHIFT 

30rA E8 




I NX 


31A3 

BD 

DO 31 


LDA L0ADT5.X 

30FB E8 




I NX 


31A6 

85 

OA 


STA MASK 

30FC C9 

FF 



CMP#FF 

end of table? 

31A8 

20 

D5'31 


JSR SETZ 

30FE DO 

FO 



BNE 0P1 


31AB 

BQ 

10 00 

L0ADT2 

LDA LR, Y 

3100 E8 



0P2 

I NX 


31AE 

C9 

30 


CMP#30 

3101 C8 




I NY 


31B0 

90 

IE 


BCC LOADT5 

3102 60 




RTS 


31B2 

09 

3A 


CMP#3A 


routines that perform 
operations 


INV address-1 


INV address-1 


two's comp of buff 
two's comp of display 


invert byte 
add 1 


rotate right by rotating 
left 32-n times 


set C to bit 7 of DISH 

shift registers left 
Y times 


Load routine for all 

but ASCII 

test for negative 


# of bits per char 


buff=000000 
ending character 


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

116 


Number 23 


TINY BASIC FOR COSMAC 

Dear Sir: 

I have read letters in vour magazine (and others) seeking a 
source of basic for the RCA COSMAC CDP 1802 microproces¬ 
sor. Infinite Incorporated offers tiny basic 3K on paper tape, 
listing or cassette tape. Their address is: Infinite Incorporated, 
1924 Waverley Place, Melbourne, FL 32901. 

Yours truly, 

Dana S. Majors 28 La Cienega Way 

Yuba City, CA 95991 


WHIZ’ LOADER/DUMPER 

news release Received: 77 Dec 12 

Shifting Sands Microcomputer Products Corporation has 
begun shipping WHIZ, a software program for recording and 
loading MC6800 based programs on the SWTPC M68 
computer with MIKBUG and the SWTPC AC-30 cassette 
interface. WHIZ operates at nine times the standard MIKBUG 
format 300 baud speed and three times that of the binary 
format. This higher speed capability is provided without any 
modifications to the standard computer or AC-30. Load a 
IK program in 14 seconds, 4K in 48 seconds, and 8K BASIC 
in 85 seconds. WHIZ includes an interactive front-end which 
allows the specification of a header and program start address 
to be placed on tape for read-back later. For $15.95, WHIZ is 
supplied on Kansas City standard cassette in MIKBUG format 
and includes a built-in relocater to place your own copy of 
WHIZ in RAM memory wherever you wish. WHIZ is 
optionally available in 2708 EPROM from Shifting Sands 
Microcomputer Products Corporation, Box 441, Fairborn, OH 
45324. 


DATAFORCE MAINTENANCE SERVICE 
FOR COMPUTER VENDORS 

News Release Received: 77 Sept 1 

A national service organization is seeking the business of 
independent vendors of small business computers including 
computer stores. The general trouble shooting of machines 
in this market has been generally viewed as unprofitable and 
the major drawback to handling the bottom end of small 
computer lines. But the Dataforce Service Company is now 
offering to perform warranty or out of warranty work and 
field service for vendors of small computers and computer 
kits anywhere in the United States. 

Dataforce has 115 service locations in the country and 
is expanding with the goal of having a service outlet within 
50 miles of every computer sold. 

A central diagnostic center is at Dataforce’s headquarters, 
2807-F Oregon Court, Torrance, CA 90503. It opens at 
5 a.m. for trouble calls from the East Coast and reamins 
open until 5 p.m., Monday through Friday. The company 
stresses its desire to help first time computer users with the 
simple problems arising from unfamiliarity with their equip¬ 
ment as well as the sophisticated user who needs a highly 
skilled diagnosis of a computer problem. 

Dataforce is first contacted by calling its Torrance diag¬ 
nostic center. In California the number is (213) 328-2950. 
Outside the state, call (800) 421-1858. A technician qualifies 
the nature of the problem and takes the necessary steps to 
resolve it. When on-site assistance is needed, Dataforce 
dispatches parts and test equipment from the closest service 
organization to the trouble. 

The company is wholly owned by Randal Data Systems, 
Inc., but operates independently. It was created to meet 
the requirements of Randal distributors, outlets for the 
company’s Link 100, Link 200, and Link 500 series, small 
business computers._ 


31B4 90 06 


BCC L0ADT3 

number 

3207 

A5 

02 



LDA dECL move into buffer 

31B6 C9 4? 


CMP*4? 

ending character 

3209 

85 

04 



STA BUFL 

31B8 B0 16 


BCS L0ADT5 


320B 

A5 

03 



LDA DECH 

31BA E9 06 


SBC#06 


320D 

85 

05 



STA BUFH 

31BC 25 0A 

L0ADT3 

AND MASK 

clear unneeded bits 

320F 

A9 

00 



LDA#00 

31BE A6 09 

31C0 06 04 


LDX SHIFT 


3211 

85 

06 



STA BUF0 

L0ADT4 

ASL BUFL 

shift buffer X times 

3213 

68 




PLA 

31C2 26 05 


R0L BUFH 


3214 

A8 




TAY 

31C4 26 06 


R0L BUF0 


3215 

60 




RTS 

31C6 CA 


DEX 








31C? DO F? 


BNE L0ADT4 


3216 

41 

44 

44 

05 

TAB1 consists of 3 ASCII chars and the 

31C9 05 04 


ORA BUFL 

combine new character 

321A 

41 

4E 

44 

OF 

lo byte-1 of the operations add¬ 

31CB 85 04 


STA BUFL 


321E 

42 

49 

4E 

46 

ress. Hi byte * 31. 

31CD C8 


INY 


3222 

44 

45 

43 

52 

31CE DO DB 


BNE L0ADT2 

unconditional 

3226 

45 

4E 

54 

3D 


31D0 60 

L0ADT5 

RTS 


322A 

45 

4f 

52 

16 


31D1 01 00 0? 


.BYTE 01,00,0? 


322E 

48 

45 

58 

4E 


31D4 OF 


.BYTE OF 


3232 

49 

4E 

56 

13 






3236 

4E 

41 

44 

09 


31D5 A9 00 

SETZ 

LDAtfOO 


323A 

4E 

4F 

52 

1A 


31D? F9 06 


BEQ SET 


323E 

4f 

43 

54 

4a 


31D9 A9 99 

SET9 

LDA#99 


3242 

4F 

4f 

52 

20 


31DB DO 02 


BNE SET 


3246 

52 

4C 

7A 


31DD A9 FF 

SETF 

LDA#FF 


324a 

52 

4f 

52 

71 


3IDF 85 04 

SET 

STA BUFL 


324E 

53 

55 

42 

02 


31E1 85 05 


STA BUFH 


3252 

54 

53 

43 

5B 


31E3 85 06 


STA BUF0 


3256 

FF 

FF 

FF 

3c 


31E5 60 


RTS 


325A 

FF 

FF 

FF 

3c 






325E 

FF 

FF 

FF 

3C 


31E6 98 

DECHEX 

TYA 

decimal to binary conv 

3262 

FF 

FF 

FF 

30 


31E7 48 


PHA 

3266 

10 

10 

12 

10 

TAB2+1 consists of lenghts for non dec dis 

31E8 F8 


SED 







31E9 A9 FF 


LDA^FF 


32 6A 

18 



ADD256 

CLC add 256 to buffer 

31EB 85 02 


STA DECL 


326B 

A5 

04 



LDA BUFL 

31ED 85 03 


STA DECH 


326d 

69 

56 



adc^56 

31EF E6 02 

DH1 

INC DECL 


326F 

85 

04 



STA BUFL 

31F1 DO 02 


BNE DH2 


3271 

A5 

05 



LDA BUFH 

31F3 E6 03 


INC DECH 


3273 

69 

02 



ADC#02 

31F5 A2 00 

DH2 

LDX^OO 


3275 

85 

05 



STA BUFH 

31F? A0 02 


LDY#02 


3277 

A5 

06 



LDA BUF0 

31F9 18 


CLC 


3279 

69 

00 



ADC#00 

31FA B5 04 

DH3 

LDA BUFL.X 


327B 

85 

06 



STA BUF0 

31FC E9 00 


SBCffOO 


327D 

60 




RTS 

31FE 95 04 


STA BUFL.X 








3200 E8 


I NX 


327E 

46 

06 


ROTATE 

LSR BUF0 perform rotate rights 

3201 88 


DEY 


3280 

66 

3 



R0R BUFH 

3202 10 F6 


BPL DH3 

keep looping until 

3282 

66 



R0R BUFL 

3204 B0 E9 


BCS DH1 

buffer is 0000 

3284 

6A 




R0R A 

3206 D8 


CLD 


3285 

60 




RTS 

Number 23 


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


117 





Status of the UCSD PASCAL Project 


BY KENNETH L. BOWLES 

Director IIS 

This is a brief report on the current status of the UCSD 
PASCAL project intended to answer the questions of the 
hundreds of people who have been writing to us or calling by 
telephone. It is our intention eventually to reach a steady state 
in which we can afford to have full time help capable of 
responding to such inquiries. For the present, we have to 
apologize once again to those who may have been kept too 
long waiting for replies. 

Kenneth L. Bowles 
Institute for Information Systems 
University of California, San Diego 
La Jolla, CA 92093 (714) 452-4526 

Nature of the Project 

The project is one of the principal activities of the Institute 
for Information Systems (IIS). Like other “Organized Research 
Units”, IIS is operated primarily to provide resources and 
activities within which students and faculty can conduct 
research and development projects. Within the range of such 
activities, projects may support instruction and other public 
services though the more usual activities of an ORU involve 
only basic research. 

Under the IIS we have developed a major software system 
for stand-alone microcomputers based on the PASCAL 
language. The initial reason for developing the system was to 
support instruction activities at UCSD. However, the system 
is designed for general purpose use, particularly for the devel¬ 
opment of interactive software, and for software development 
in general. The system has matured sufficiently that we are 
distributing copies to outside users at a $200 fee which pays 
for some of the student part-time assistants who provide 
support to users and maintain the software. Under prevailing 
University policies, we are not attempting to recover capital 
costs from the fees paid by users of our software package. 
However, a number of interested industrial firms have provided 
assistance to further the project through unrestricted grants 
to the Regents of the University of California marked for use 
by our project. These grants are our principal source of oper¬ 
ating funds at the present time. 

Since the PASCAL based software system was developed 
with the intent of supporting long term instructional projects, 
we have placed very high emphasis on machine independence. 
We expect the repertoire of instructional software developed 
to use the underlying system to grow very large. The develop¬ 
ment costs for the instructional software will eventually dwarf 
the costs of the hardware on which it operates. Since the 
industry is introducing new microcomputer designs at a rapid 
rate, we wanted to be able to move the entire software reper¬ 
toire to new machines with a minimum of effort. As will be 
detailed in later sections of this note, our system is now 
running on 5 dis-similar processors, with more planned in the 
relatively near future. We are using the Digital Equipment 
LSI-11 for teaching. Versions for the 8080 and Z80 micro¬ 
processors are operational and will be ready to distribute on 
or about 1 January, 1978. 

We intend to continue promoting the use of our PASCAL- 
based system on as many popular microprocessors as practical 
for two reasons. First, this should provide IIS with a source of 
continuing income to pay for student projects. Second, 
PASCAL with extensions is a superior language for system 


programming, and we believe that it is in the public interest to 
assist in the current effort of many people and institutions to 
promote wider use of PASCAL in place of some of the earlier 
high level languages. Though PASCAL may have some short¬ 
comings for specific applications when compared to specific 
proprietary languages, we regard it as by far the best general 
purpose language now in the public domain. 

Our current Research and Development interests include: 

a. Methods of making large software systems like ours 
more readily transportable to new processor architectures. 

b. The use of microcomputers as intelligent communica¬ 
tions devices to assist humans to work together even when 
located thousands of miles apart. This interest will eventual¬ 
ly involve us in a variety of complex software issues. In the 
near term it will provide us with an efficient method of 
supporting users of our software system who are remote 
from UCSD. 

c. Joint use of microcomputers and Keller’s Personalized 
System of Instruction (PSI) as a means of offering high 
quality college level mass education at lower costs per 
enrolled student than associated with conventional methods. 
A published introductory textbook on problem solving 
using PASCAL, and a library of automated quizzes and 
record keeping software to go with the textbook, are 
available to others as a first step in this direction. 

d. Exploration of possibilities and software problems 
associated with new hardware devices or architectures 
adaptable to the purposes already described. Examples 
include video disks, low cost X-Y input devices, and low 
cost strategies for interconnecting many semi-independent 
microcomputers. 

Partly as a matter of self preservation, we have become 
interested in the problem of standards for the PASCAL 
language. The United States Defense Department and many 
large industrial corporations have recently decided to use 
PASCAL as a base language which they would extend, and 
possibly alter, to create system implementation langauges. 
Although almost every organization has chosen to extend or 
alter in slightly different ways, we have found that the intent 
portrayed in most instances is very similar. In our own imple¬ 
mentation, we too found it necessary to extend PASCAL, and 
in very minor ways to alter the base language as described in 
Niklaus Wirth’s widely read “Report”on the langauge (see 
Jensen, K. and N. Wirth, PASCAL User Manual and Report, 
Springer Verlag, 1975). We, and many others in the PASCAL 
User Group, are very much concerned that all this extension 
and alteration activity will result in PASCAL going the way of 
BASIC for which hundreds of dialects are in common use. We 
believe that a chance still exists to gain consensus on a 
substantial family of PASCAL extensions for system program¬ 
ming, provided that this can be brought about within the next 
6 to 12 months. Unless someone does so before us, we intend 
to convene a summer workshop for representatives of some of 
the major using organizations in the hope that such a consensus 
can be reached. 

Another ancillary activity of the project has been continuing 
search for low cost microcomputer hardware of high quality 
for use in educational institutions — particularly ours. We have 
been advising and collaborating with EDUCOM regarding 
establishment of quantity purchase discounts for stand-alone 
microcomputers. The first microcomputer to be included in 


Page 16 

118 


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


Number 23 



the EDUCOM discount program is the Terak Corporation 
8510A, which is based on the Digital Equipment LSI-11. 
For the current market, the Terak unit’s price of $5500 to 
EDUCOM member institutions is highly competitive. Never¬ 
theless, the rate of new announcements from the industry 
continues very high, and we believe that it is all but 
impossible to predict what hardware will provide the best 
cost/performance tradeoff for as long as even one year in 
advance. Of necessity, our search has concentrated on stand¬ 
alone microcomputers with graphic display capabilities, and 
with enough main memory and secondary storage to handle 
the extensive software and course materials with which we 
are working. We welcome inputs on this subject from other 
institutions, or from any vendor, and endeavor to keep 
EDUCOM informed of opportunities that seem advantageous. 
In addition to educational and communications applications, 
we are interested in word processing and business applications 
of the same machines. 

The following sections of this status report contain brief 
detailed summaries covering most of the topics just 
enumerated. If we haven’t answered your questions yet, please 
try again with a phone call or letter. For those who already 
have our software system in use, we will soon be providing 
an automatic Tele-Mail facility on a dial-in basis. This should 
improve dramatically our ability to keep you informed and to 
respond when software difficulties arise. 

The PASCAL based Software System 

Thus far, users who have received our first released system 
have copies of version 1.3, which was completed in mid August 
this year. We have ourselves been using version I.3c since early 
October. By the end of the December academic break, we 
hope to have a version 1.4 available for distribution. The most 
significant generally useful addition since the 1.3 release has 
been the screen-oriented editor. A major package for prepara¬ 
tion of CAI programs, following the general philosophy of the 
University of California Irvine Physics Computer Develop¬ 
ment Project (PCDP), has been placed in operation on the 
Terak 8510A microcomputer. Except for some graphics 
materials within this package, it can be used on a wide variety 
of CRT screen display devices. Software more specifically 
oriented to the Terak machine is also available, and includes 
a character set editor (for the soft character generator), and 
a bookkeeping package for keeping track of student progress 
in a large Keller Plan (TPSI) class. 

The software system is currently executed in a pseudo 
machine interpreter, which emulates a hypothetical real 
machine designed to handle PASCAL constructs efficiently. 
Our pseudo machine is similar in concept to the P-machine 
distributed by Wirth’s group at Zurich, but we have made 
extensive changes to compress the PASCAL object code into 
a much smaller space than possible with the Zurich interpreter. 
The interpreter, and run-time support routines, currently 
occupy about 8K bytes of main memory. The interpreter is 
in the native machine language of the host machine, and thus 
far has been coded by hand using the host’s assembly language. 
All other code in the system is written in extended PASCAL. 

While the interpreted object code runs roughly five times 
slower than native code for the host machine, several factors 
allow our large system programs to run substantially faster 
than this would indicate. The strategy of code compression 
makes it possible to run relatively large programs without time 
consuming overlays. For example, the complete compiler 
occupies 20K bytes in a single overlay. Since the system is 
designed for frequent compile/go cycles associated with 
instruction, we have added several built-in procedures and 
functions to handle low level operations needed frequently 
by the compiler. As a result, the compiler translates PASCAL 


source code at about 650 lines per minute on an LSI-11 with 
its clock set to 2.2 MHz. On a 4 MHz Z80, the compile speed 
will be slightly faster than this. 

Interpreter based versions of our system are now running 
on 5 distinct processors, and two others are close to comple¬ 
tion. Those operating include DEC PDP-1 l’s ranging from the 
LSI-11 to the 11/45, using either floppy disks or RK05 disks 
for secondary storage. Versions for the 8080 and Z80 are 
operating in our laboratory, but more of that later. Sperry 
Univac Minicomputer Operations at Irvine is using the system 
on the V-75 and related machines. Another group at UCSD 
has the system running on the Nanodata QM-1. With support 
from General Automation, a version is close to completion on 
the GA-440 family of machines. National Semiconductor 
has an implementation nearly completed on the PACE micro¬ 
computer. 

The principal modules of the system as it will be distributed 
in the 1.4 release include the following: 

PASCAL compiler 

File manager (capabilities similar to DEC’S PIP) 

Screen oriented editor (cursor positioning, immediate 
updates) 

Line oriented editor (similar to DEC’S RT-11 Editor) 
Debugger (single line execution, reference to variable 
contents) 

SETUP program (adapt system to most ASCII terminals) 
BASIC compiler (ANSI standard plus strings) 

Operating System and user command interpreter 
PASCAL pseudo machine interpreter 
Linker program (for linking independently compiled 
program segments) 

Desk Calculator utility program 

Users of the Terak 8510A may, on request, also receive 
copies of the CAI package, and automated quizzes for the 
introductory textbook, as well as the bookkeeping package. 

Documents describing all of the above are available, and 
part of the release, but not all documents can be considered 
complete at this time. We distribute source and object code 
files on separate floppy disks formatted to be compatible with 
the IBM 3740 standard, with 512 byte blocks laid out in alter¬ 
nate 128 bytes sectors according to DEC’S standard. We have 
occasionally sent copies recorded directly on disk packs for 
the RK05 drives. All other media are painful or impossible 
for us to handle, and no promises are made to use them. Those 
who order the full $200 release package will be sent both the 
documents, and printed lisitings of the source programs. 
Copies of the descriptive documents, amounting to 
approximately 150 pages, may be ordered at $10 each (checks 
payable to the “Regents of the University of California”) to 
cover printing and handling costs. 

Minimum Configuration 

In order to use the compiler, you need a total of at least 
48K bytes of main memory, including the 8K bytes assigned 
to the interpreter. We use 56K bytes. Ideally, the interpreter 
should be completed re-entrant and thus it should be possible 
to operate the interpreter from Read Only Memory. To date, 
the ideal has not quite been achieved, as none of our sponsors 
has yet insisted on that feature. 

At present, the system we use with students contains 
several built-in functions not needed for system development. 
The aggregate size of these functions is large enough to prevent 
compiling the compiler itself, or the operating system, even on 
a 56K byte system. Accordingly, we currently have two ver¬ 
sions of the system, one for students, and one for system 
development. Within the next few months, we plan to add a 
means of configuring general purpose libraries for the system, 
and by that means expect to be able to return to a single 


Number 23 


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


Page 17 

119 



version for all purposes. That single version should be practical 
to use in less than 48K bytes for some purposes. 

If you intend to compile on one microcomputer, and to 
execute object routines on others, the others can get by with 
as little as 16K bytes of main memory if the operating system 
is not used. The resident portion of the operating system 
occupies about 8K bytes itself. This will undoubtedly be 
reduced as part of the libraries project. 

The system is designed to be used with standard IBM 
compatible floppy disks. Clearly it can be used with other 
varieties of floppy disks, or with other secondary storage 
media, with appropriate I/O drivers. The I/O drivers have 
proven to be one of our principal bottlenecks, and we make no 
promises in advance about supporting other devices. For 
DEC PDP-11 machines, the floppy disk drivers are assumed to 
be compatible with the RX-11, or with the Terak 8510A 
drives. Hard disks are assumed to be compatible with the 
RK05. 

The system is normally supplied with the assumption that 
the user has a simple line-oriented ASCII terminal. The 
SETUP program can be used to configure control codes for 
more appropriate use of most CRT terminals. Copies of the 
system supplied to users of the Terak 8510A make fairly 
extensive use of the special graphics and character generator 
facilities of that machine. 

8080 and Z80 Versions 

The Z80 version is now running on the Tektronix 8002 
Microprocessor Development Aid system, for which Tektronix 
has supplied substantial support to the project. The 8080 
version uses virtually the same source code as is used on the 
Z80, with conditional assembly altering certain passages in the 
source to substitute for a few of the extended Z80 instructions 
that proved useful. 

Release of the 8080/Z80 version of the system of other 
machines has been held up primarily because of the awkward¬ 
ness of handling I/O. We currently have a Zilog Development 
System, a Processor Technology SOL system, and a Computer 
Power and Light COMPAL-80 system. The floppy disk pro¬ 
visions for each of these machines is non-standard. As a result, 
we have been forced to down-load programs via serial inter¬ 
faces to get from the LSI-11 host machines used for develop¬ 
ment over to the new 8080 or Z80 based host. This has proven 
to be a very time consuming process, and a serious bottleneck 
in our work. Moreover, we are somewhat amazed to find that 
the assembly of large programs on these machines runs almost 
a factor of ten slower than compilation of PASCAL programs 
that carry out similar tasks! Clearly, something has to give if 
we are to reach the objective of distributing PASCAL systems 
for more than a few 8080 and Z80 based machines. 

The solution to this problem that we now plan to use is 
based on the extensive market penetration of an operating 
system called CP/M, which is a product of Digital Research 
Inc. We have talked with many OEM and hobbyist users of the 
8080 and Z80 who wanted to know when we would have the 
PASCAL system operating under CP/M. We then learned that 
CP/M is distributed in a package which assumes that most 
users will write their own I/O drivers. In effect, CP/M estab¬ 
lishes a quasi standard for the interface between an 8080/Z80 
operating system and its I/O drivers. With thousands of copies 
working in the field, CP/M seems to be far ahead of the field 
in this area. Accordingly, we have decided to release the UCSD 
PASCAL System for 8080 and Z80 users in a form that will 
work with I/O drivers and bootstrap loaders developed for use 
with CP/M. This does not mean that our package will run 
under CP/M. However, if CP/M runs on your machine it should 
be relatively easy to install the PASCAL system on that 
machine. We have been in contact with Digital Research on 


this concept, and they have offered to cooperate. If you do 
not have CP/M for your machine, the implementation package 
may be obtained from Digital Research Inc., Box 579, Pacific 
Grove, CA 93950 for $70. Since CP/M has been implemented 
on a very wide variety of 8080 and Z80 based machines, there 
is a high probability that CP/M I/O drivers are already available 
from Digital Research or someone else for your machine. 

Alteration of our present interpreter to match the CP/M 
I/O calling conventions has proven to be very simple, at least 
on paper. We expect that some implementors of CP/M will 
have installed standard console input routines which auto¬ 
matically echo to the standard console printer or display 
device. This will necessitate a change, since our system uses 
both echoing and non-echoing console input. At this writing, 
the exact method to be used is under discussion. Barring some 
unforseen calamity, copies of our system designed to run with 
CP/M I/O drivers should be ready for distribution by early 
January, 1978. The distribution medium will be IBM compa¬ 
tible floppy disks formatted in a manner yet to be finally 
specified. We will undertake to transform the system for other 
media and other formats, in general, only if a copy of the 
necessary hardware is available in our laboratory, and only if 
funds are available to pay for the extra conversion work. 

For many of the 8080 based machines we have seen, the 
most practical way to install our system will be to use 48K 
bytes of RAM augmented with 8K bytes of ROM for the 
interpreter. Any additional RAM or ROM required by the 
host processor system will also be needed. 

PASCAL Extensions and Alterations 

We have attempted to implement faithfully as much as 
possible of PASCAL as defined in Jensen & Wirth’s User 
Manual and Report. The principal extensions to PASCAL 
embodied in our system are related to STRING variables, 
Turtle Graphics, handling of disk files, Segment (overlay) 
Procedures, and several functions for support of the system 
itself. Alterations include a prohibition against passing pro¬ 
cedure, the addition of EXIT (<procedurename>) to effect 
a normal exit from the procedure named in the parameter, and 
a change in READ applying to the interactive INPUT and 
KEYBOARD files. Further details than given in this section 
are given in our system release documents. 

Type STRING is a pre-declared record containing a 
character count followed by a packed array of characters. 
Built-in procedures and functions include LENGTH, 
POS(ition), INSERT, DELETE, COPY (i.e. extract), 
CONCATenate, SCAN, FILLCHAR, MOVERIGHT, and 
MOVELEFT. The last four of these also operate on conven¬ 
tional packed arrays of characters. 

Turtle Graphics describes a technique originated by 
Seymour Papert of MIT in which one can either MOVE a 
cursor (called the “turtle”) an arbitrary number of screen 
units in the current pointing direction, or TURN an arbitrary 
number of degrees at the current position. A PENCOLOR 
procedure allows the line drawn by a MOVE to be either 
WHITE, BLACK, or NONE. 

The disk file extensions allow working with fixed length 
logical records corresponding to any legal <type>, which 
might typically be a RECORD data structure. GET and PUT 
operate normally through a window variable of the same 
<type>. OPENNEW creates a new file, OPENOLD opens a 
pre-existing file, and CLOSE allows saving or purging a file. 
SEEK (which will be distributed with the 1.4 system for the 
first time) allows random access to logical records within a file. 

SEGMENT Procedures are separately compiled and then 
linked into the host program using the LINKER. A Segment 
procedure is only loaded into main memory when it is 
entered for the first time, and its memory space is deallocated 


Page 18 

120 


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


Number 23 



upon exit from the first invocation. 

READ(INPUT , X) is defined by Wirth as X: =INPUTt; 
GET(INPUT); which we find to be extremely awkward for 
interactive use. Our solution is to place the implied GET 
before the implied assignment in the case of interactive files 
of type TEXT. READ operates as defined in Wirth’s Report 
for other TEXT files. 

PACKED records on our system which fit within 16 bit 
fields are automatically packed and unpacked without 
explicit action by the programmer. 

Introductory PASCAL Course and Textbook 

Many of those inquiring about our system have heard about 
it through having seen the textbook “Microcomputer Problem 
Solving Using PASCAL” by the author of this note, published 
this fall by Springer Verlag. If you haven’t seen a copy, they 
may be obtained from Springer at 175 Fifth Ave., New York 
City, NY 10010. 

The book is the basis for teaching the large attendance 
introductory computer science course at UCSD. This course 
comes close to matching the specifications for course CS1 in 
the recently published curriculum recommendations from 
ACM’s SIGCSE. The approach is non-numerical as far as 
practical, as a tactic to reach the many students who come to 
us with inadequate preparation in high school mathematics. 
The problem solving and programming approach taught is 
the same as we would teach even if all the problem sets were 
mathematics oriented. Because many problem examples and 
illustrations use our string and graphics extensions to PASCAL, 
the textbook currently assumes that the student will have 
access to a computer which mns under the UCSD PASCAL 
system. We will be glad to discuss the possibility of conversion 
to other software systems, but have very limited resources to 
apply to such conversions. There are several stand-alone 
microcomputers now being sold in large quantities on which 
our system would run, given a small conversion effort, and we 
would welcome support funds to pay for such conversions. 

Software in the form of automated quizzes is available with 
our system release for those who may wish to teach using the 
textbook. Each chapter in the book has a list of study goals 
for the students to achieve. Wherever appropriate, the quizzes 
test for mastery of the topics enumerated in the goals lists. 
The quiz programs have been implemented using a set of 
CAI primitive routines patterned after the well known 
DIALOG CAI system developed at U.C. Irvine by Alfred Bork 
and his colleagues. 

The introductory course is taught using Keller’s Personal¬ 
ized System of Instruction (PSI). PSI has been found to be a 
more successful method of instruction than any other method 
commonly used in universities and colleges. This success is 
achieved, almost completely without conventional lectures, by 
using experienced students as Learning Assistants called 
“proctors”. The characteristics of this method make us believe 
that it is possible to offer this course, or others constructed 
along the same lines, on a packaged basis for use at other 
institutions. A separate paper describing this possibility in 
detail called “Microcomputer Based Mass Education” is 
available from the writer of this status report. 

Tele-Mail User Support Facility 

We have reached the point where it will be possible for us 
to begin operating a dial-in computer “mailbox” by early in 
the winter quarter. We have been using the Terak 8510A 
machines occasionally as intelligent terminals for exchanging 
messages via the large B6700 computer operated by the 
campus computer center. Our own Tele-Mail facility will use 
its own single telephone number reachable directly from the 


national dialed telephone network, or internally via the 
California state government telephone network. Mail sub¬ 
scribers to our software release will be notified when this 
mailbox facility is ready to be used. 

The mailbox will be operated primarily to serve users of 
our software system. It will provide notices of recent bug 
corrections, down-loading of program files (either source or 
object) where appropriate, notices on new additions to the 
software and new machines on which implementations have 
been completed, and other useful information from us to the 
users. It will also serve as a means for us to collect messages 
from specific users, and to answer them expeditiously, without 
the hassle of both parties having to be at their telephones at 
the same time. 

Through the use of block transfer software, the mailbox 
will make relatively efficient use of the dialed telephone net¬ 
work. We would like to begin immediately by offering a dial- 
in port at 1200 bits per second. However, the present state of 
confusion in the industry at that speed (which is the fastest 
one can use with acoustic couplers) leads us to move 
cautiously. We can and will install a port at 300 bits per 
second using the standard Bell 103A equivalent conventions. 
The system will answer an incoming call from an ordinary 
terminal by providing a brief summary of recent developments. 
It will otherwise expect a “handshake” from a special file 
transfer program that we will provide to users of our software 
package. This program will be the means of interchange based 
on efficient transfer of messages in the form of complete files. 
If you wish to send an ordinary text massage to us, you will 
prepare the message using either of the editors built into the 
system. Only after the massage is complete will you need to 
make the telephone connection. 

Forthcoming Improvements 

As mentioned earlier, our next significant improvement in 
the software will be a more flexible system allowing libraries 
of programs. One of the main reasons for doing this will be to 
allow the software to be configured to make efficient use of 
main memory in cases where the user does not need all of the 
built-in facilities. For example, we have no need for turtle 
graphics when compiling large system programs. 

One of the long awaited features of the new library system 
will be an arrangement allowing mixture of PASCAL proce¬ 
dures with Assembly language routines and/or procedures 
compiled directly to the native code of the host machine. 
The necessary assemblers and code generation will come some¬ 
what after the library system is operational. If all goes well, 
the library system should be ready to distribute during the 
winter quarter of 1978. The assemblers and native code 
versions of the compiler will come somewhat later as time for 
the necessary work permits. 

Many people have asked whether we have in mind exten¬ 
sions to support Concurrent PASCAL, or similar facilities to 
allow independent processes running concurrently. This is 
something we would like to do eventually, but our current 
resources do not allow making definite plans in this area. 


ADCIS MET IN DALLAS 

News Release Received: 78 Jan 9 

The 1978 Winter Meeting of the Association for the Devel¬ 
opment of Computer-based Instructional Systems (ADCIS) 
was held in Dallas, Texas, March 1-4, 1978. For further 
information, contact the conference host, Carol Luce, Educa¬ 
tional Service Center, Region 100,400, East Spring Valley Rd, 
Richardson, TX 75080, (214) 231-6301. 


Number 23 


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


Page 19 

121 



ACT 

An 8080 Macroprocessor 


BY ALEX CECIL 

Lawrence Livermore Laboratory 

ACT is a macro text interpreter which runs under the CP/M 
operating system on an Intel 8080 compatable microcomputer. 
More than 16K bytes of RAM are needed. ACT uses the same 
algorithm as TRAC [2] (“TRAC” is a registered trademark of 
Rockford Research Institute) and a set of primitive functions 
which are similar to those in the TRIX interpreter [ 1 ]. ACT 
also uses the special characters @ (J } in place of TRAC’s 
#(,). ACT has been used to control jobs on a large time shar¬ 
ing system and to format diskette files; it is generally too slow 
for efficient human interaction. 

Logically (but not necessarily psychologically), the syntax 
is very simple. Program and data are character strings which 
are handled by the same rules. There are three structures: 

M 

@ (op Iarg 1 I arg2 |... | argn j 
(® @{op | arg 1 | arg2 |.. . | argn } 

The first is a literal quote; the contents are passed on as the 
value. The second performs the indicated operation on the 
argument strings and immediately rescans the resulting value. 
The last form performs the operation and passes the value to 
the next higher level function. Any op or argument may have 
any of the three forms. For more information on the scanning 
algorithm see any of the published descriptions of TRAC. 

There is a version of ACT which uses upper case letters for 
the command names and the special characters A [.,] ' instead 
of @{| } . Also, the meta-character is the exclaim (!). 

Execute line 

act 

act < file-name > 

act < file -name > < options > 

If a file name is given, then the ACT macros in the file are 
read first; < file-name > has the general form “d:x.y”. The 
string @ in is initialized to the characters between “act” and 
the return. 

As a special case, <options> may be the three characters 
nh, where A is the caret (or up arrow), and hh is a hex page 
number. Free storage is allocated from the end of the inter¬ 
preter up to, but not including, page hh or FBASE if A hh is 
not given. 

Non-disk I/O and debug 

@ {re|prompt] “read string” 

Value is a line of input from the console (via CP/M call 
#10), or the next string from the input file. Line-feed, 
return, and tab characters from the input file are ignored; a 
string is terminated by the meta-character (~) or by the 
end-of-file. Comments on the input file are enclosed 
within matching left quotes ( N ). Input files generally do 
not end with the meta-character. 


@(ps | a | a |.. .^ “print string” 

Each argument (after the “ps”) is printed on a separate line; 
but there is no CR-LF after the last argument. 

<® (so | message] “send to Octopus” 

The message is sent over the selected Octopus channel. 
Usually the message does not end with an Octopus end- 
message character. The echo is lost. (Note: “Octopus” is 
the name of the LLL time sharing system. The so and ro 
functions talk to Octopus over a serial interface as an ordin¬ 
ary terminal. Separate documentation illustrates how this 
hardware dependent function can be patched for different 
I/O ports.) 

@ (ro | x | s 111 eom] “read Octopus” 

If the Octopus time-out is greater than zero, then a mes¬ 
sage terminator is sent. This terminator either causes a 
previous “so” message to be delivered or a log-out in case 
there was no previous “so” and the terminator is a 
control-D. Octopus output is then collected in the string 
@ro until the string X is encountered or until the time-out 
interval passes since the last character. The value is s if x 
was found, otherwise f. If s and f are omitted, the value is 
null. (Note this inconsistency with the functions gc and in.) 
A null x will always fail to match. 

A non-null last argument (eom) will change the Octopus 
message terminator. The argument eom must be the two 
hex characters which correspond to the terminator. The 
terminator is initially a control-D. 

@ fio | x | x |...] “input-output parameters” 

Each argument x is a letter (o, t, m) followed by an 
associated parameter: 

oa selects Octopus channel a. (initial value) 
ob selects Octopus channel b. 

tn sets the Octopus time-out to n seconds. E. g. 1120. 
me redefines the meta-character to be the character c. 
p print: terminal output is thru CP/M, “fw” applies, 
d display: direct output, “fw” does not apply. 

Note: This option is hardware dependent. 

@ {fw |n ] “form width” 

The “print string” function will start a new line after n 
characters. The initial form width is 80. However, this does 
not apply if an @ {io | p ] is in effect. 

@{tn] “trace on” 

Turn the trace mode on and save the previous mode. Note: 
An @ {io|dj is implicitly given so that the output will 
wrap around; see the fw function above. 

@ (tf ] “trace off’ 

Restore the previous trace mode, up to eight levels. 

(® { nb J “number of blocks” 

Value is the number of sixteen word free storage blocks. 
@{fs|n|m] “free storage” 

Free storage is augmented by the memory locations n up 
to but not including m; n and m are decimal and must be 
multiples of 16. 

@[vn] “version number” 

Value is the ACT version number. 


Page 20 

122 


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


Number 23 



Disc I/O 


The file name has the general form “d:x.y”. If d is omitted, 
the system drive is selected; lower case characters in the 
name are mapped to upper case. The number of the next 
record to read or write is set to n. (Records are numbered 
sequentially starting at zero; each record consists of 128 
characters.) If the open fails the value is f; otherwise the 
value is s. 

Since only one file can be open at a time, the record 
number of the current file may need to be saved by @ [rn}. 
Also, a currently opened output file must be closed before 
another open. 

@{mf| file-name Is |f J “make file” 

If the named file can be created, the value is s; otherwise 
the value is f. The current record number is set to zero. 

@ [cf | s | f ] “close file” 

The currently opened file is closed. The value is f if there is 
a close error, otherwise s. 

@ [df [ “destroy file” 

The current file is destroyed. 

@ (rn [ “record number” 

The value is the record number of the next record to read 
or write. This number applies to the currently opened file. 
@ { wf | string-name | x | s | f ^ “write file” 

Characters from the named string, starting with the first, 
are written to the currently opened file. If x is null, then 
the last partial record is not written; instead, the form 
pointer of the named string is left positioned at the remain¬ 
der. For example, the output for the next write could be 
constructed by: . -i 

@ { ns | name | @@ [in |name | <more output> j . 

If x is non-null, then the first character of x is used to 
pad out the remainder of the record and the record is writ¬ 
ten. An entire record of pad characters is written if the 
previous output ended on a record boundary. 

The value is f if there is a write error, otherwise s. 

@ (rf | string-name | m | s | f J “read file” 

The next m records are read from the currently opened 
file and appended to the named string. The value is f if the 
physical end of file is reached, otherwise s. 

@frdj “read dialect” 

The value is the text from the currently open file. The file 
is read starting with the record set by the open file. The 
input is processed in the same manner as described for the 
rs function. Thus, one program can load another in the 
same way as is done when a file name is put on the execute 
line after “act”. Warning: No of or mf commands can be 
executed until the file has been read. 

Control and delay 

<®[eq|a|b|s|b|s|...|b|s] or @ [eq|a|b|s|b|s|... 

1 f [“equal” 

The value is the first s for which the preceding b is equal 
to a, where “equal” means string equality. If the last argu¬ 
ment is not one of a “b-s” pair, then it provides an “else” 
value. . 

@[ge|n|m|s|f] “greater than or equal to” 

The value is s if n is numerically greater than or equal to m, 
otherwise the value is f. 

@ [nt | name | s | f} “null test” 

The value is s if the named string is null, otherwise the value 
isf. 

@ (ex 1 x J “exit” 

Clear the active and neutral strings; then set the active 
string to x. 


@ (st | “stop” 

Return to CP/M. 

@[zz|n[ “sleep” 

Sleep for n/10 seconds. 

String ops and hex-to-characters 

@ {ns | name j value | name | value |. .. ] “name string” 

Create one or more strings with the given values. 

@ [as | name | x | name | x |...] “append string” 

Append the string x to the named string. 

@ [ss |name | arg | arg |...]• “segment strong” 

Create arguments in the named string. 

@ Id |name | arg | arg |... J or @ [name | arg| arg | . . .} “call” 
Return the named string, starting at the first character, with 
the actual arguments substituted for those corresponding 
substrings which were matched by a previous “segment 
string”. 

@ [gc | name | n | s | f ) “get characters” (4 or more arguments) 
Move the form pointer over n characters, or to the end of 
the form if there are fewer than n characters remaining. The 
characters passed over are put into the string “@gc”. 
Return s if there are n characters after the form pointer in 
the named string, otherwise return f. 

@ j gc | name | n } “get characters” (3 arguments) 

Like gc with 4 or more arguments except that the value of 
@gc is also the value of this function. 

@ [gc | name] 

Return the total number of characters in the named form. 

@ [in | name | p | s | f J “initial” (4 or more arguments) 

Starting at the form pointer, search for the substring p. 
The characters which are passed over in the search, up to 
but not including p, are put into the string “@in”. If p is 
found return s, otherwise return f. The form pointer is left 
positioned after s, or at the end of the form. Null p always 
fails. 

@[ in | name | p j “initial” (3 arguments) 

Like in with 4 or more arguments except that the value of 
@in is also the value of this function. 

@[ in | name [ “initial” (2 arguments) 

Return the characters from the form pointer to the end of 
the form; also set @in to this value. The form pointer is left 
past the end of the form. 

@ [cr | name j “call restore” 

Move the form pointer of the named string to the beginning 
of the string. 

@ [dd | name | name |... J “delete definitions” 

Delete the named strings. 

@ fpk|hex ] “pack” 

Return the characters whose hex values are given. 


@[uk|xj “unpack 
Return the hex 


Arithmetic 


form of the string x. 


@[ad|n |n|..“add” 

Return the sum of the arguments. Numbers are represented 
by signed decimal integers whose magnitude is less than 
32768 

@{su|n|m[ “subtract” 

Return n-m. 

@ [ml | n | n |.. .] “multiply” 

Return the product of the arguments. 

@[dv|n|m] “divide” 

Return n/m. 

@\md|n|m[ “mod” 

Return n mod m. 


Number 23 


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


Page 21 

123 


Special Strings 


@ cb “console break” 

The value of this string is the last console break character. 

@ im “idle macro” 

This macro is loaded whenever the active string is empty. 
The initial value of @im is @ £ps| @ ^ rs | .11 , but @im may 
be changed at any time. 

Console “break” 

The last character of any console input, other than for the 
@ rs function, is saved in the string @cb. Moreover, if the 
input character is an ESC, then you will be prompted to type 
one of the letters t, n or i which will turn the trace on (t), 
turn the trace off (n), or reload the idle macro (i). Console 
input will stop output, or cause an immediate return from the 
zz or ro functions. 

Generating a COM File with a Preloaded ACT Program 

A COM file containing the ACT interpreter and a preloaded 
macro file may be created as follows, assuming a 32K system. 

1. Append something like the following to your macro file 
@fnsl@im|J 

@ [fs 126368129184} 

@fns|@im|(@[ps|@\rs|. 

@s start"! 

]) 

@ st 

where “start” is the name of your top level macro. Note 
that the fs function adds 6700 hex up to 7200 hex to the 
free storage list after the program is started (step 4). Free 
storage normally extends to FBASE which is 7200 hex in 
a 32K system. 

2. Load your program by typing 

act macro-file *6 7 

where ” is the caret, or up arrow. Free storage will 
extend up to 6700 hex; if your program needs more space, 
then you need more than 32K to make a COM file. TTie st 
function at the end of your file will return control to CP/M. 


3. Make a COM file with the SAVE command 

save 103 code.com 

4. Run the code by typing either of the following 

code 

code options 

The options will be in the string @in. 

Error Messages 

DISK EOF: The rs function is trying to read beyond the end 
of file. 

FREE STORAGE IS EMPTY: The combined storage required 
for named strings, string names, and active and neutral 
strings has exceeded the allocated memory. At this point, 
the active and neutral strings are cleared and control given 
to the @im macro. The second time this happens, control 
returns to CP/M. 

NS STACK OVERFLOW: The number of unprocessed 

arguments exceeds 250. The level of nesting or the number 
of arguments is excessive. For example, the number of 
arguments for a ns should not get much over 200. 

References 

1. Moll, H., "TRIX — An interactive, interpretive language for manipu¬ 
lating strings of characters." Lawrence Livermore Lab Report 
UCID-30100. 

2. Moors, C. N., "TRAC, a Procedure describing Language for the 
Reactive Typewriter." Comm. ACM9, 3 (March, 1966) 

3. Moors, C. N., "TRAC, A Text Handling Language." Proc. ACM 
20th Nat. Conf., Cleveland, August, 1965. 

4. Wegner, Peter, Programming Languages, Information Structures, 
and Machine Organization. McGraw-Hill Book Co., 1968. 


Note: Since the listing of ACT is quite long, we are publishing 
the PL/M listing only in this issue. In the next issue we will 
print the symbol table and assembler listing along with a table 
referencing selected line numbers from the PL/M version 
to the assembler listing - TR W. 


4 


8080 PLM1 VERS 3.0 

00001 1 /* STANDARD LANGUAGE EXTENSIONS. 6/16/75 */ 

00002 1 DECLARE 

00003 1 TRUE LITERALLY 'OFFH', 

00004 1 FALSE LITERALLY 'O', 

00005 1 FOREVER LITERALLY 'WHILE TRUE', 

00006 1 FOR LITERALLY 'DO', 

00007 1 ENDFOR LITERALLY 'END;', 

00008 1 FI LITERALLY 'END:' 

00009 1 SELECT LITERALLY 'DO CASE', 

00010 1 OF LITERALLY ';', 

00011 1 ENDSELECT LITERALLY 'END;', 

00012 1 FUNCTION LITERALLY 'PROCEDURE', 

00013 1 ENDFUNCTI ON LITERALLY 'END', 

00014 1 ENDPROCEDURE LITERALLY 'END'. 

00015 1 ENDDO LITERALLY 'END; 1 , 

00016 1 BEGIN LITERALLY 'DO;'; 

00017 1 

00018 1 100H: START: 

00019 1 /* ACT VERSION 31 10/17/77 */ 

00020 1 /* DON'T FORGET TO CHANGE PFSVN */ 

00021 1 

00022 1 /* TO CHANGE TO UPPER CASE FOR TTY MOD33: 

00023 1 1. CHANGE SPECIAL ACT CHARACTERS, 

00024 1 2. CHANGE ALPHABET (LITSA ETC.), 

00025 1 3. CHANGE PFSLIST. 

00026 1 4. CHANGE METASCHAR TO APOSTROPHE. 

00027 1 */ 

00028 1 

00029 1 



Page 22 

124 


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


Number 23 


i 





00030 1 

00031 1 

00032 1 

00033 1 

00034 1 

00035 1 

00036 1 

00037 1 

00038 1 

00039 1 

00040 1 

00041 1 

00042 1 

00043 1 

00044 1 

00045 1 

00046 1 

00047 1 

00048 1 

00049 1 

00050 1 

00051 1 

00052 1 

00053 1 

00054 1 

00055 1 

00056 1 

00057 1 

00058 1 

00059 1 

00060 1 
00061 1 
00062 1 
00063 1 

00064 1 

00065 1 

00066 1 
00067 1 

00068 1 
00069 1 

00070 1 

00071 1 

00072 1 

00073 1 

00074 1 

00075 1 

00076 1 

00077 1 

00078 1 

00079 1 

00080 1 
00081 1 
00082 1 
00083 1 

00084 1 

00085 1 

00086 1 
00087 1 

00088 1 
00089 1 

00090 1 

00091 1 

00092 1 

00093 1 

00094 1 

00095 1 

00096 1 

00097 1 

00098 1 

00099 1 

00100 1 
00101 1 
00102 1 
00103 1 

00104 1 

00105 1 

00106 1 
00107 1 

00108 1 
00109 1 

00110 1 
00111 1 
00112 1 


Number 23 


/*** SPECIAL CHARACTERS ***/ 

DECLARE /* CONTROL CHARACTERS */ 

NUL LITERALLY '00H', 

SOH LITERALLY '01H', /* CONTROL-A */ 

ETX LITERALLY '03H', /* CONTROL-C */ 

EOT LITERALLY '04H', /* CONTROL-D */ 

ENQ LITERALLY '05H', /* C0NTR0L-E #/ 

BEL LITERALLY '07H', 

HT LITERALLY '09H', 

LF LITERALLY 'OAH', 

VT LITERALLY 'OBH', 

CR LITERALLY 'ODH', 

50 LITERALLY 'OEH', /* CONTROL N */ 

51 LITERALLY 'OFH', /* CONTROL 0 */ 

DC3 LITERALLY '13H', 

NAK LITERALLY '15H', /* CONTROL-U */ 

SYN LITERALLY '16H', 

ETB LITERALLY '17H', /* CONTROL-W */ 

CAN LITERALLY '18H', /* CONTROL-X */ 

EM LITERALLY '19H', /* CONTROL-Y */ 

SUB LITERALLY '1 AH', /* CONTROL-Z */ 

ESC LITERALLY '1BH', 

DEL LITERALLY '7FH', 

PHI LITERALLY '80H', /* MARKS AN UNUSED CHAR. POSITION */ 

NIL LITERALLY '81H'; /* MARKS THE END OF A STRING, SEE NILNIL IN FSSGET */ 

DECLARE /* SPECIAL ACT CHARACTERS */ 

FUNSCH LITERALLY '40H', /* 'AT' CHARACTER (OR UP-ARROW) */ 

LEFTSDELIM LITERALLY '7BH', /* LEFT BRACE (OR SQUARE BRACKET) */ 

ARGSDELIM LITERALLY '7CH', /* BAR (OR COMMA) */ 

RIGHTSDELIM LITERALLY '7DH', /* RIGHT BRACE (OR SQUARE BRACKET) */ 

COMMSDELIM LITERALLY '60H'; /* GRAVE ACCENT (OR APOSTROPHE) */ 

DECLARE /* ALPHABET (EITHER LOWER OR UPPER CASE) */ 

LITSA LITERALLY '61H', 

L1T$B LITERALLY '62H', 

LITSC LITERALLY '63H', 

LITSD LITERALLY '64H', 

LITSE LITERALLY '65H', 

LIT*F LITERALLY '66H', 

LITSG LITERALLY '67H', 

LITSH LITERALLY '68H', 

LIT#I LITERALLY '69H', 

LIT#J LITERALLY '6AH', 

LITSK LITERALLY '6BH', 

LITSL LITERALLY '6CH', 

LIT$M LITERALLY '6DH', 

LIT*N LITERALLY '6EH', 

LIT#0 LITERALLY '6FH', 

LITSP LITERALLY '70H' , 

LITSQ LITERALLY '71H', 

LIT$R LITERALLY '72H', 

LITSS LITERALLY '73H', 

LIT#T LITERALLY '74H', 

LITSU LITERALLY '75H', 

LIT$V LITERALLY '76H', 

LIT$W LITERALLY '77H'. 

LIT$X LITERALLY '78H', 

LITSY LITERALLY '79H', 

LITSZ LITERALLY '7AH'; 


/*** DATA WHICH MUST BE LOCATED MOD 16 ***/ 

DECLARE /* THIS MUST BE THE FIRST NON-LITERAL DECLARE */ 

ATSGC DATA (0,0,FUNSCH,LIT$G,LITSC,NIL,0,0,0,0), /* 106-10F */ 

AT#IN DATA (0,0,FUNSCH,LITSI,LITSN,NIL). /* 110-115 */ 

AT$R0 DATA (0,0,FUNSCH,LITSR,LITSO,NIL,0,0,0,0), /* 116-11F */ 

ATSCB DATA (0,0,FUNSCH,LITSC,LITSB,NIL); /* 120-125 */ 


/#** BASIC I/O, SYSTEM CALLS ***/ 

DECLARE /* I/O READY TESTS FOR CONSOLE */ 

/* 'IN' REFERS TO TERM INAL-TO-OCTOPUS DIRECTION */ 
/* 'OUT' REFERS TO OCTOPUS-TO-TERMINAL DIRECTION */ 
CPMSPRINTSFLAG BYTE INITIAL (TRUE), 

TERMSSTATUS LITERALLY '1', /* HARDWARE */ 
TERMSDATA LITERALLY 'O' /* HARDWARE */ 

TERMSINSREADY LITERALLY 'M0N2(11,0)', 

TERMSOUTSREADY LITERALLY 'ROR(M0N2(11,0),2)'j 





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


Page 23 


125 



00113 1 DECLARE 

00114 1 (CONSWIDTH, CONSCOLUMN) BYTE INITIAL <80.0), 

00115 1 CONSIN BYTE INITIAL (TRUE), /* CONSOLE INPUT (DISK INPUT IF FALSE) */ 

00116 1 CONBUF(82) BYTE INITIAL (80,0,1). 

00117 1 OCTOSTIMEOUT ADDRESS INITIAL (120), 

00118 1 TFCBSPTR ADDRESS INITIAL (5CH), /* TRANSIENT FILE CONTROL BLOCK */ 

00119 1 TFCB BASED TFCBSPTR BYTE, 

00120 1 TBUFFSPTR ADDRESS INITIAL (80H), /* TRANSIENT FILE BUFFER */ 

00121 1 TBUFF BASED TBUFFSPTR BYTE, 

00122 1 TBUFFSINDEX BYTE INITIAL (128), 

00123 1 ENDSOFSFILE LITERALLY 'SUB', 

00124 1 0CTOSE0M BYTE INITIAL (EOT), 

00125 1 METASCHAR BYTE INITIAL (7EH), /* TILDA OR EXCLAIM */ 

00126 1 PRELOADED BYTE INITIAL (FALSE), 

00127 1 (DEFAULTSDRIVE,PREVIOUSSDRIVE,CURRENTSDR IVE) BYTE; 

00128 1 

00129 1 DECLARE /* SOME GENERAL PURPOSE TEMPS */ 

00130 1 TEMPSPTR ADDRESS, 

00131 1 DUMMY BYTE, 

00132 1 I TEMP BYTE; 

00133 1 

00134 1 

00135 1 /*** BASIC I/O ***/ 

00136 1 

00137 1 DECLARE 

00138 1 BDOS LITERALLY '5H' , 

00139 1 FBASEA ADDRESS INITIAL (6H), 

00140 1 FBASE BASED FBASEA ADDRESS, 

00141 1 EXIT LITERALLY 'CALL M0N1(0,0)'; 

00142 1 

00143 1 M0N1: PROCEDURE(F,A); 

00144 2 DECLARE F BYTE, A ADDRESS; 

00145 2 GO TO BDOS: 

00146 2 ENDPROCEDURE M0N1; 

00147 1 

00148 1 M0N2: FUNCTI ON(F,A) BYTE: 

00149 2 DECLARE F BYTE, A ADDRESS; 

00150 2 GO TO BDOS; 

00151 2 ENDFUNCTION M0N2; 

00152 1 

00153 1 CRLF: PROCEDURE; 

00154 2 CALL M0N1(2,CR); 

00155 2 CALL M0N1(2,LF); 

00156 2 C0N$C0LUMN=0; 

00157 2 ENDPROCEDURE CRLF; 

00158 1 

00159 1 PRINTSCH: PROCEDURE(CH); 

00160 2 DECLARE CH BYTE; 

00161 2 CALL M0N1(2,CH); 

00162 2 IF CH = CR THEN DO; C0N$C0LUMN=0; FI 

00163 2 /* NOTE... SHOULD HANDLE NON-GRAPHIC CHARACTERS */ 

00164 2 IF (CONSCOLUMN:=CONSCOLUMN+1) = CONSWIDTH THEN DO; 

00165 2 CALL CRLF; 

00166 3 FI 

00167 2 ENDPROCEDURE PRINTSCH; 

00168 1 

00169 1 DISPLAYSCH: PROCEDURE(CH); 

00170 2 /* SEND A CHAR TO TERMINAL. NOTE: HARDWARE DEPENDENT */ 

00171 2 DECLARE CH BYTE; 

00172 2 DO WHILE ROR(INPUT(TERMSSTATUS),2); ENDDO 

00173 2 OUTPUTCTERMSDATA)=NOT CH; 

00174 2 END DISPLAYSCH; 

00175 1 

00176 1 READSCH: FUNCTION BYTE; 

00177 2 RETURN M0N2(1,0): 

00178 2 ENDFUNCTI ON READSCH; 

00179 1 

00180 1 CONSBREAK: FUNCTION BYTE; 

00181 2 RETURN M0N2(11,0); 

00182 2 ENDFUNCTION CONSBREAK; 

00183 1 

00184 1 PRINTSMESS: PROCEDURE(MESSSPTR); 

00185 2 DECLARE MESSSPTR ADDRESS; 

00186 2 CALL M0N1(9,MESSSPTR); 

00187 2 CALL CRLF: 

00188 2 ENDPROCEDURE PRINTSMESS; 

00189 1 

00190 1 SELECTSDRIVE: PROCEDURE; 

00191 2 IF TFCB(0) = 0 THEN DO; 

00192 2 CURRENTSDR IVE=DEFAULTSDR IVE; 

00193 3 END: ELSE DO; 

00194 2 CURRENTSDRIVE=(TFCB(0) AND 7)-1; 

00195 3 TFCB(0)=0; 

00196 3 FI 

00197 2 IF PREVIOUSSDRIVE <> CURRENTSDRIVE THEN DO; 

00198 2 PREVIOUSSDRIVE = CURRENTSDR IVE; 

00199 3 CALL M0N1(14,CURRENTSDRIVE); 

00200 3 FI 

00201 2 ENDPROCEDURE SELECTSDRIVE; 

00202 1 



Page 24 

126 


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


Number 23 



00203 1 

00204 2 

00205 2 

00206 2 
00207 2 

00208 2 
00209 1 

00210 1 
00211 2 
00212 2 
00213 2 

00214 2 

00215 2 

00216 1 
00217 1 

00218 2 
00219 2 

00220 2 
00221 2 
00222 3 

00223 3 

00224 3 

00225 3 

00226 2 
00227 1 

00228 1 
00229 1 

00230 1 

00231 1 

00232 1 

00233 1 

00234 1 

00235 1 

00236 1 

00237 1 

00238 1 

00239 1 

00240 1 

00241 1 

00242 1 

00243 2 

00244 2 

00245 2 

00246 2 

00247 1 

00248 1 

00249 2 

00250 2 

00251 2 

00252 2 

00253 2 

00254 2 

00255 3 

00256 2 

00257 3 

00258 2 

00259 1 

00260 1 
00261 2 
00262 2 
00263 2 

00264 2 

00265 3 

00266 4 

00267 4 

00268 3 

00269 2 

00270 2 

00271 1 

00272 1 

00273 1 

00274 1 

00275 1 

00276 1 

00277 1 

00278 1 

00279 1 

00280 1 
00281 1 
00282 1 
00283 1 

00284 1 


Number 23 


UPPERSCASE: FUNCTION(CH) BYTE: 

/* MAP A CHARACTER TO UPPER CASE */ 

DECLARE CH BYTE; 

IF CH < 61H OR CH > 7AH THEN DO; RETURN CH; FI 
RETURN CH-20H; 

ENDFUNCTION UPPERSCASE; 

WAITSMS: PROCEDURE(N); 

/* N MILLI-SECOND DELAY (APPROXIMATE) */ 
DECLARE (I,N) ADDRESS; 

I =0; 

DO WHILE I < N: CALL TIME<7); 1=1+1; ENDDO 
ENDPROCEDURE WAITSMS; 

WAITSTENTH: PROCEDURE(N)J 
/* N SECOND DELAY */ 

DECLARE (I,N) ADDRESS; 

FOR 1=1 TO N: 

IF CONSBREAK THEN DO; RETURN; FI 
CALL TIME(255); 

CALL TIME(255); 

CALL TI ME(135); 

ENDDO 

ENDPROCEDURE WAITSTENTH; 


/*** OCTOPUS I/O PRIMITIVES ***/ 

DECLARE 

/* 'IN' REFERS TO TERM INAL-TO-OCTOPUS DIRECTION */ 

/* 'OUT' REFERS TO OCTOPUS-TO-TERMINAL DIRECTION */ 

OCTOSCHANNELSA BYTE INITIAL (TRUE), 

OCTOSASSTATUS LITERALLY '5', 

OCTOSASDATA LITERALLY '4' , 

OCTOSBSSTATUS LITERALLY '7' , 

OCTOSBSDATA LITERALLY '6', 

OCTOSOUTSREADY LITERALLY 'OCTOSSTATUS' 

OCTOSINSREADY LITERALLY 'ROR(OCTOSSTATUS,2)'; 

OCTOSSTATUS: FUNCTION BYTE; 

/* RETURN THE TRUE (NOT COMPLEMENTED) OCTOPUS STATUS FOR THE SELECTED PORT */ 
IF OCTOSCHANNELSA THEN RETURN NOT INPUT(OCTOSASSTATUS); 

RETURN NOT INPUT(OCTOSBSSTATUS); 

ENDFUNCTION OCTOSSTATUS; 

SENDSCH: PROCEDURE(CH); 

/* SEND A CHARACTER TO THE SELECTED OCTOPUS PORT */ 

DECLARE CH BYTE; 

DO WHILE NOT OCTOSINSREADY; ENDDO 
IF OCTOSCHANNELSA THEN DO; 

OUTPUT!OCTOSASDATA)»NOT CH; 

END: ELSE DO; 

OUTPUT(OCTOSBSDATA)=NOT CH; 

FI 

ENDPROCEDURE SENDSCH; 

RECEIVESCH: FUNCTION BYTE; 

/* GET A CHARACTER FORM THE SELECTED OCTOPUS CHANNEL */ 

DECLARE I ADDRESS; 

FOR 1=0 TO 65000; 

IF OCTOSOUTSREADY THEN DO; 

IF OCTOSCHANNELSA THEN RETURN (NOT INPUT(OCTOSASDATA)) AND 7FH; 

RETURN (NOT INPUT(OCTOSBSDATA)) AND 7FH; 

FI 

ENDFOR 
RETURN OFFH; 

ENDFUNCTION RECEIVESCH; 


/*** BLOCK AND FREE STORAGE GLOBALS ***/ 

DECLARE 

FSSFIRSTSPTR ADDRESS, /* FREE STORAGE HEAD */ 

BLOCKSLENGTH LITERALLY '16' 

BLOCKSLAST LITERALLY '15' 

PTRSMASK LITERALLY 'O^FFOH', 

NOTSPTRSMASK LITERALLY 'OFH', 

(FIRSTSGETASFLAG,FIRSTSGETBSFLAG,FIRSTSPUTASFLAG) BYTE, 

(GETSCHASCHSPTR,PUTSCHASCHSPTR,PUTSCHASCURRENTSBLOCKSPTR) ADDRESS; 



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


Page 25 

127 



/*** 0LOBALS FOR SCAN ALGORITHM ***/ 


00285 1 

00286 1 
00287 1 

00288 1 
00289 1 

00290 1 

00291 1 

00292 1 

00293 1 

00294 1 

00295 1 

00296 1 

00297 1 

00298 1 

00299 1 

00300 1 

00301 1 

00302 1 

00303 1 

00304 1 

00305 1 

00306 1 

00307 1 

00308 1 

00309 1 

00310 1 

00311 1 

00312 1 

00313 1 

00314 1 

00315 1 

00316 1 

00317 1 

00318 1 

00319 1 

00320 1 

00321 1 

00322 1 

00323 1 

00324 1 

00325 1 

00326 1 

00327 1 

00328 1 

00329 1 

00330 1 

00331 1 

00332 2 

00333 2 

00334 2 

00335 2 

00336 2 

00337 2 

00338 2 

00339 2 

00340 1 

00341 1 

00342 2 

00343 2 

00344 2 

00345 2 

00346 2 

00347 2 

00348 2 

00349 2 

00350 2 

00351 2 

00352 2 

00353 2 

00354 2 

00355 3 

00356 3 

00357 4 

00358 4 

00359 3 

00360 4 

00361 3 

00362 2 

00363 3 

00364 3 

00365 3 

00366 3 

00367 3 

00368 3 

00369 3 

00370 3 

00371 3 

00372 3 

00373 3 

00374 2 

00375 1 


Page 26 

128 


DECLARE 

NSSSTACK(255) ADDRESS INITIAL (11B.1B), /* NEUTRAL STACK, 8-BIT INDEX */ 

NS$STACK$INDEX BYTE, /* INDEX OF CURRENTLY 'OPEN' ARGUMENT */ 

NS9SAVESINDEX BYTE, /* INDEX OF FIRST ARGUMENT OF CURRENT FUNCTION #/ 
NSSCHSPTR ADDRESS, /* NEXT NEUTRAL CHARACTER ADDRESS */ 

NSSCH BASED NSSCHSPTR BYTE, 


NSSARGSBREAK BYTE, 
NSSARGSFLAG LITERALLY 

NSSBEGINSENDSBIT LITERALLY 
NSSFUNSBIT LITERALLY 

NSSACTIVESBIT LITERALLY 

NSSNULLSBEGINSEND LITERALLY 
NSSFUNSMARKER LITERALLY 


/* LAST FOUR BITS OF NS STACK ENTRY */ 
/* MARKS LIMITS OF NEUTRAL STACK */ 

/* MARKS FIRST ARG OF FUNCTION */ 

/* MARKS ACTIVE FUNCTION */ 


NSSLIMITSMARKER 


'OOOOB', 

'0001B', 

'001 OB', 

'01OOB', 

'1001B'. 

'ROR(LOW(NSSSTACKt NSSSTACK*INDEX)),1) 
/* NS BEG IN-FUNCTI ON TEST »/ 

LITERALLY 'LOW ( NSSSTACK(NSSSTACKSINDEX))', 

/* NS BEGIN-END TEST */ 


NSSACTIVESFLAG BYTE, 

ASSBLOCKSPTR ADDRESS INITIAL(O), /* CURRENT BLOCK IN ACTIVE STRING */ 
ASSBLOCK BASED ASSBLOCKSPTR ADDRESS, 

ASSCHSPTR ADDRESS, /* ADDRESS OF NEXT ACTIVE STRING CHARACTER */ 

ASSCH BASED ASSCHSPTR BYTE, 

(SSSCHASPTR,SSSCHBSPTR,SSSCHCSPTR) ADDRESS, /* SUBSTRING SEARCH PTRS */ 
SSSMASK LITERALLY '11000000B', 

SSSCHA BASED SSSCHASPTR BYTE, 

MOVESPTR LITERALLY 'TRUE', /* FLAGS FOR ASSNEXTSCH CALL */ 

DONTSMOVESPTR LITERALLY 'FALSE' 

TRACESFLAG BYTE, /* 8 BIT 'STACK'. LOW ORDER BIT IS CURRENT */ 

(NAMESPTR,ARGSPTR) ADDRESS, /* GENERAL USE IN PF'S AND TRACE */ 

NEXTSARG LITERALLY 'WHILE NOT LOW(ARGSPTR:=NEXT$NS)', /* IN PF'S */ 

VALUESPTR ADDRESS, /* USED BY PF'S TO RETURN THEIR VALUE */ 

VALUESCH BASED VALUESPTR BYTE, 

(SSPTR,FSPTR) ADDRESS, /* USED BY PF'S FOR SUCCESS AND FAIL VALUES */ 
NULLSSTRINGSPTR ADDRESS, /* ORED WITH NSSBEGINSENDSBIT IN NS STACK */ 
DEADSSTART BYTE INITIAL (TRUE), 

NOSEXSVALUE BYTE INITIAL (TRUE); 


/*** FREE STORAGE AND OTHER BLOCK STRUCTURE UTILITIES ***/ 

FSSFREE: PROCEDURE(FREESTHISSPTR); 

/* ADD THE INDICATED BLOCK TO THE FREE STORAGE LIST */ 

DECLARE 

FREESTHISSPTR ADDRESS, 

FREESTHIS BASED FREESTHISSPTR ADDRESS; 

FREESTHIS=FSSFIRSTSPTR; 

FSSFIRST$PTR=FREESTHISSPTR; 

ENDPROCEDURE FSSFREE; 

FSSGET: FUNCTION ADDRESS: 

/* ALLOCATE A BLOCK FROM FREE STORAGE, RETURN ITS ADDRESS */ 

/* SET 'NEXT' FIELD TO END-CHAIN (ZERO HIGH BYTE) */ 

/* AND FILL WITH NILS */ 

DECLARE 

FSSFIRST BASED FSSFIRSTSPTR ADDRESS, 

GOTSPTR ADDRESS. 

GOT BASED GOTSPTR ADDRESS, 

GOTC BASED GOTSPTR BYTE, 

FIRSTSEMPTY BYTE INITIAL (TRUE), 

NILNIL LITERALLY '8181H'; 

IF HIGH(FSSFIRSTSPTR) = 0 THEN DO; 

CALL PRINT$MESS(.'FREE STORAGE IS EMPTY S'); 

IF FIRSTSEMPTY THEN DO; 

FIRST$EMPTY=FALSE; 

GO TO START; 

END; ELSE DO; 

EX I T; 

FI 

END; ELSE DO; 

G0T$PTR=FSSFIRSTSPTR; 

FSSFIRST$PTR=FS$FIRST; 

GOT = 0; 

GOT(1)=NILNIL; 

GOT(2)=NILNIL; 

GOT(3)=NILNIL; 

GOT(4)=NILNIL; 

GOT(5)=NILNIL; 

GOT(6)= NILNIL; 

GOT(7)= NILNIL; 

RETURN GOTSPTR; 

FI 

ENDFUNCTI ON FSSGET; 



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


Number 23 



00376 1 

00377 2 

00378 2 

00379 2 

00380 2 

00381 2 

00362 2 

00383 3 

00384 2 

00385 1 

00386 1 

00387 2 

00388 2 

00369 2 

00390 2 

00391 2 

00392 2 

00393 3 

00394 3 

00395 3 

00396 3 

00397 2 

00398 1 

00399 1 

00400 2 

00401 2 

00402 2 

00403 2 

00404 2 

00405 2 

00406 2 

00407 2 

00408 2 

00409 2 

00410 2 

00411 3 

00412 2 

00413 2 

00414 2 

00415 2 

00416 3 

00417 2 

00418 2 

00419 2 

00420 2 

00421 3 

00422 3 

00423 2 

00424 2 

00425 1 

00426 1 

00427 2 

00428 2 

00429 2 

00430 2 

00431 2 

00432 2 

00433 2 

00434 2 

00435 2 

00436 2 

00437 2 

00438 3 

00439 3 

00440 3 

00441 2 

00442 2 

00443 3 

00444 3 

00445 3 

00446 2 

00447 2 

00448 1 

00449 1 

00450 2 

00451 2 

00452 2 

00453 2 

00454 2 

00455 2 

00456 2 

00457 2 

00458 2 

00459 2 

00460 3 

00461 3 

00462 3 

00463 2 

00464 2 

00465 3 

00466 3 

00467 2 

00468 2 

00469 1 


FSSINIT: PROCEDURE(MINSADDRESS,MAXSADDRESS); 

/* CREATE FREE STORAGE LIST */ 

/# MAXSADDRESS MUST BE A MULTIPLE OF BLOCKSLENGTH */ 

DECLARE (MINSADDRESS, MAXSADDRESS,BLKSPTR) ADDRESS; 

FOR BLK$PTR=MINSADDRESS TO MAX$ADDRESS-BLOCKSLENGTH BY BLOCKSIFNOTH; 

CALL FSSFREE(BLKSPTR); 

ENDFOR 

ENDPROCEDURE FSSINIT; 

FREESCHAIN: PROCEDURE(BLOCKSPTR) ; 

/# FREE ALL BLOCKS IN A CHAIN STARTING WITH BLOCKSPTR */ 

DECLARE (BLOCKSPTR,BLOCK BASED BLOCKSPTR,NEXTSPTR) ADDRESS; 

IF (BLOCKSPTR:=BLOCK$PTR AND PTRSMASK) = NULLSSTRINGSPTR THEN DO; RETURN; FI 
DO FOREVER; 

IF HIGH(BLOCKSPTR) 3 0 THEN DO; RETURN; FI 
NEXTSPTR 3 BLOCK; 

CALL FSSFREE(BLOCKSPTR); 

BLOCKSPTR=NEXTSPTR; 

ENDDO; 

ENDPROCEDURE FREESCHAIN; 

APPENDSCH: FUNCTI ON(CH,BLOCKSPTR) ADDRESS; 

/* STARTING WITH BLOCKSPTR (<>0), SEARCH FOR THE LAST BLOCK */ 

/* APPEND CH AND RETURN THE NEXT CHARACTER ADDRESS */ 

DECLARE 

CH BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR,CHSPTR) ADDRESS, 

BLOCKC BASED CHSPTR BYTE; 

IF HIGH(BLOCKSPTR) = 0 THEN DO; RETURN 0; FI 

DO WHILE HIGH(BLOCK) > 0; 

BLOCKSPTR=BLOCK; 

ENDDO 

CHSPTR 3 BLOCKSPTR+2; 

DO WHILE BLOCKC <> NIL; 

CHSPTR 3 CHSPTR +1; 

ENDDO 

BLOCKC=CH' 

IF (LOW(CHSPTR:=CHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 

BLOCK,CHSPTR 3 FSSGET; 

CHSPTR=CHSPTR+2; 

FI 

RETURN CHSPTR; 

ENDFUNCTI ON APPENDSCH; 

GETSCHA: FUNCTI ON(INITIALSBLOCKSPTR) BYTE; 

/.* RETURNS THE NEXT 8-BIT CHARACTER FROM CHAIN 'A' */ 

/* TO INITIALIZE FOR A NEW CHAIN. SET FIRSTSGETASFLAG TO TRUE */ 

/* CALLER MUST TEST FOR STRING TERMINAL */ 

/* GETSCHASPTR POINTS TO THE LAST RETURNED CHARACTER */ 

DECLARE 

(INITIALSBLOCKSPTR.CURRENTSBLOCKSPTR) ADDRESS, 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS, 

(CH BASED GETSCHASCHSPTR,NEWSCHAIN) BYTE; 

IF FIRSTSGETASFLAG THEN DO; 

FIRSTSGETASFLAG 3 FALSE; 

CURRENTSBLOCKSPTR=INITIALSBLOCKSPTR; 

GETSCHASCHSPTR 3 CURRENTSBLOCKSPTR+1; 

FI 

IF (LOW(GETSCHASCHSPTR:=GETSCHASCHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
CURRENT$BLOCK$PTR=GETSCHA$CH$PTR-BLOCKSLENGTH; 

CURRENTSBLOCKSPTR=CURRENT$BLOCK; 

GETSCHA$CHSPTR=CURRENTSBL0CKSPTR+2; 

FI 

RETURN CH; 

ENDFUNCTI ON GETSCHA; 

GETSCHB: FUNCTI ON(INITIALSBLOCKSPTR) BYTE: 

/* RETURNS THE NEXT 8-BIT CHARACTER FROM CHAIN 'B' */ 

/* TO INITIALIZE FOR A NEW CHAIN, SET FIRSTSGETBSFLAG TO TRUE */ 

/* CALLER MUST TEST FOR STRING TERMINAL */ 

DECLARE 

(I NIT IALSBLOCKSPTR,CURRENTSBLOCKSPTR,CHSPTR) ADDRESS, 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS, 

(CH BASED CHSPTR,NEWSCHAIN) BYTE; 

IF FIRSTSGETBSFLAG THEN DO; 

FIRSTSGETBSFLAG=FALSE; 

CURRENTSBLOCKSPTR 3 INITIALSBLOCKSPTR; 

CH$PTR=CURRENT$BLOCKSPTR+1; 

FI 

IF (LOW(CHSPTR:=CHSPTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
CURRENTSBLOCKSPTR=CURRENTSBLOCK; 

CHSPTR 3 CURRENTSBLOCKSPTR+2; 

FI 

RETURN CH; 

ENDFUNCT1 ON GETSCHB; 


Number 23 


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


Page 27 

129 



00470 

00471 

00472 

00473 

00474 

00475 

00476 

00477 

00478 

00479 

00480 

00481 

00482 

00483 

00484 

00485 

00486 

00487 

00488 

00489 

00490 

00491 

00492 

00493 

00494 

00495 

00496 

00497 

00498 

00499 

00500 

00501 

00502 

00503 

00504 

00505 

00506 

00507 

00508 

00509 

0051 0 

0051 1 

0051 2 

0051 3 

0051 4 

0051 5 

0051 6 

0051 7 

0051 8 

0051 9 

00520 

00521 

00522 

00523 

00524 

00525 

00526 

00527 

00528 

00529 

00530 

00531 

00532 

00533 

00534 

00535 

00536 

00537 

00538 

00539 

00540 

00541 

00542 

00543 

00544 

00545 

00546 

00547 

00548 

00549 

00550 

00551 

00552 

00553 

00554 

00555 

00556 

00557 

00558 

00559 

00560 

00561 

00562 

00563 

00564 

00565 

Page 28 

130 


1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

3 

3 

2 

2 

2 

3 

3 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

4 
3 
2 
1 
1 

2 

2 

2 

2 

2 

2 

3 

3 

3 

3 

2 

2 

3 

3 

3 

3 

2 

2 

2 

2 

3 

2 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

2 

2 

1 

1 

2 

2 

2 

2 

2 

2 

2 

2 

3 

4 

5 

4 

5 
4 
3 
2 


PUTSCHA: PROCEDURE(INITIALSBLOCKSPTR,CHA); 

/* PUT CHA INTO THE CHAIN 'A' */ 

/* TO INITIALIZE FOR A NEW CHAIN, SET FIRSTSPUTASFLAG TO TRUE */ 

/* AND SET INITlALSBLOCKSPTR TO FSSGET */ 

/* PUTSCHASCHSPTR POINTES TO THE NEXT CHAR TO BE STORED */ 

DECLARE 

INITIALSBLOCKSPTR ADDRESS, 

CURRENTSBLOCK BASED PUTSCHASCURRENTSBLOCKSPTR ADDRESS, 

(CH BASED PUTSCHASCHSPTR,NEWSCHAIN,CHA) BYTE; 

IF FIRSTSPUTASFLAG THEN DO; 

FIRSTSPUTASFLAG=FALSE: 

PUTSCHASCURRENTSBLOCKSPTR*INITIALSBLOCKSPTR; 
PUTSCHASCHSPTR=PUTSCHASCURRENTSBL0CKSPTR+2; 

FI 

CH = CHA * 

IF~(L0W(PUTSCHASCHSPTR:=PUT*CHASCHSPTR+1) AND NOTSPTRSMASK) * 0 THEN DO; 
CURRENTSBLOCK.PUTSCHASCURRENTSBLOCKSPTR=FSSQET; 

PUTSCHASCHSPTR*PUTSCHASCURRENTSBLOCKSPTR+2; 

FI 

ENDPROCEDURE PUTSCHA; 

COPYSVALUE: PROCEDURE(SOURCESPTR.SINKSPTR); 

/* SOURCESPTR IS THE ADDRESS OF THE SOURCE CHAIN */ 

/* SINKSPTR IS THE ADDRESS OF AN EMPTY BLOCK */ 

/* ONLY 7-BIT CHARACTERS ARE COPIED */ 

/* NOTE: PFSIN USES THE FINAL VALUE OF GETSCHASCHSPTR */ 

DECLARE 

(SOURCESPTR,SINKSPTR) ADDRESS, 

CH BYTE; 

FIRSTSGETASFLAG.FIRSTSPUTASFLAG=TRUE; 

DO WHILE (CH:=GET$CHA(SOURCESPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

CALL PUTSCHAtSINKSPTR,CH); 

FI 

ENDDO 

ENDPROCEDURE COPYSVALUE; 

STRINGSEQUALITY: FUNCTION(PTA,PTB) BYTE: 

/* TRUE IF STRINGS CONTAIN THE SAME SEQUENCE OF 7-BIT CHARACTERS */ 
DECLARE 

(PTA,PTB) ADDRESS, 

(CHA,CHB) BYTE; 

NEXTA: FUNCTION BYTE; 

DO WHILE ((CHA:=GETSCHA(PTA)) <> NIL) AND R0L(CHA,1); 

ENDDO 

RETURN CHA; 

ENDFUNCTI ON NEXTA; 

NEXTB: FUNCTION BYTE; 

DO WHILE ((CHB:=GETSCHB(PTB)) <> NIL) AND R0L(CHB,1); 

ENDDO 

RETURN CHB; 

ENDFUNCTION NEXTB; 

FIRSTSGETASFLAG,FIRSTSGETBSFLAG=TRUE; 

DO WHILE NEXTA = NEXTB: 

IF CHA = NIL THEN DO; RETURN TRUE; FI 
ENDDO 

RETURN FALSE; 

ENDFUNCTI ON STRINGSEQUALITY; 

NULLSTEST: FUNCTI ON(BLOCKSPTR) BYTE; 

/* 'TRUE' IF THERE ARE NO 7-BIT CHARACTERS BEFORE THE NIL */ 

DECLARE 

BLOCKSPTR ADDRESS, 

CH BYTE; 

IF HIGH(BLOCKSPTR) = 0 THEN DO; RETURN TRUE; FI 
FIRSTSGETASFLAG=TRUE; 

DO WHILE (CH:=GETSCHA(BLOCKSPTR AND PTRSMASK)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; RETURN FALSE; FI 
ENDDO 

RETURN TRUE; 

ENDFUNCTI ON NULLSTEST; 

PR 1NTSSTRING: PROCEDURE(BLOCKSPTR); 

/# PRINT ALL 7-BIT CHARACTERS IN THE STRING */ 

DECLARE 

BLOCKSPTR ADDRESS, 

CH BYTE; 

FIRSTSGETASFLAG = TRUE: 

DO WHILE (CH:=GET$CHA(BLOCKSPTR AND PTRSMASK)X>NIL AND NOT TERMS INSRFADY; 
IF NOT ROL(CH,1) THEN DO; 

IF CPMSPRINTSFLAG THEN DO; 

CALL PR INTSCH(CH); 

END; ELSE DO; 

CALL DI SPLAYSCH(CH); 

FI 

FI 

ENDDO 

ENDPROCEDURE PR INTSSTRING; 


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


Number 23 



00566 1 

00567 1 

00568 1 

00569 1 

00570 1 

00571 2 

00572 2 

00573 2 

00574 1 

00575 1 

00576 2 

00577 2 

00578 2 

00579 2 

00500 2 

00581 2 

00582 2 

00583 3 

00584 2 

00585 1 

00586 1 

00587 2 

00588 2 

00589 2 

00590 2 

00591 2 

00592 2 

00593 2 

00594 2 

00595 2 

00596 2 

00597 3 

00598 3 

00599 3 

00600 3 

00601 4 

00602 4 

00603 5 

00604 5 

00605 4 

00606 3 

00607 3 

00608 4 

00609 4 

00610 4 

00611 3 

00612 3 

00613 2 

00614 2 

00615 2 

00616 3 

00617 2 

00618 3 

00619 3 

00620 3 

00621 2 
00622 2 
00623 2 

00624 2 

00625 2 

00626 2 
00627 3 

00628 4 

00629 5 

00630 5 

00631 5 

00632 4 

00633 3 

00634 2 

00635 2 

00636 1 

00637 1 

00638 1 

00639 1 

00640 1 

00641 1 

00642 1 

00643 1 

00644 1 

00645 1 

00646 1 

00647 1 

00648 1 

00649 1 

00650 1 

00651 1 

00652 1 

00653 1 

00654 1 

00655 1 

00656 1 

00657 1 

00658 1 


/*** OCTOPUS I/O UTILITIES ***/ 

CLEAR$OCTO$0UTPUT: PROCEDURE; 

CALL WAITSTENTH C 2); 

DO WHILE 0CTOSOUTSREADY; DUMMY=RECEIVESCH; CALL WAIT$TENTH(2); ENDDO 
ENDPROCEDURE CLEARSOCTOSOUTPUT; 

SENDSSTRING: PROCEDURE(BLOCKSPTR); 

/« SEND A MESSAGE TO OCTOPUS. (USUALLY WITHOUT END-OF-LINE CHARACTER) */ 
/* IGNORE THE ECHO */ 

DECLARE BLOCKSPTR ADDRESS, CH BYTE; 

CALL CLEARSOCTOSOUTPUT; 

FIRST$GETA$FLAG=TRUE; 

DO WHILE (CH:--GETSCHA(BLOCKSPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; CALL SENDSCH(CH); FI 
ENDDO 

ENDPROCEDURE SENDSSTRING; 

RECEIVESSTRING: FUNCTION(ENDSMESSAGESPTR) BYTE; 

/* RECEIVE AN OCTOPUS MESSAGE. VALUESPTR WILL ADDRESS IT */ 

/* VALUE IS FALSE IF TIME-OUT BEFORE END-MESSAGE IS RECOGNIZED */ 

/* DOES NOT SEND EOT IF ZERO DELAY */ 

/* NOTE: GET A LOG-OFF IF NULL MESSAGE AND DELAY > 0 */ 

DECLARE 

(ENDSMESSAGESPTR,RESTARTSPTR,COUNT,COUNTSMAX,I) ADDRESS, 

CHA BYTE, 

CYCLES*PERSSECOND LITERALLY '5000'; /* DEPENDENT ON HARDWARE TIMING */ 


MATCHSEND: FUNCTION BYTE; 

FIRSTSGETBSFLAG=TRUE; 

GETSCHASCHSPTR=RESTARTSPTR; 

DO WHILE (CHA:*GETSCHA(0)) = GETSCHB(ENDSMESSAGESPTR); 

IF CHA = NIL THEN DO; RETURN TRUE; FI 

IF OCTOSOUTSREADY THEN DO; /* DON*T LOSE HIGH BAUD INPUT */ 
COUNT=COUNT$MAX; 

CALL PUTSCHA(0,RECEIVESCH); 

FI 

ENDDO 

IF CHA <> NIL THEN DO; 

GET$CHASCHSPTR=RESTART$PTR; 

DUMMY = GETSCHA(0) ; 

RESTART$PTR*GETSCHASCHSPTR; 

FI 

RETURN FALSE; 

ENDFUNCTI ON MATCHSEND; 


IF OCTOSTIMEOUT = 0 THEN DO; 

C0UNT$MAX=2; 

END: ELSE DO; 

COUNTSMAX=OCTOSTIMEOUT+1; 
CALL CLEARSOCTOSOUTPUT; 
CALL SENDSCH(OCTOSEOM); 


RESTARTSPTR=(VALUESPTR:=FSSGET) +1 ; 

FIRSTSPUTASFLAG=TRUE; 

COUNT = COUNTSMAX; 

DO WHILE (COUNT:=COUNT-1) <> 0 AND NOT CONSBREAK; 
FOR 1=0 TO CYCLESSPERSSECOND; 

IF OCTOSOUTSREADY THEN DO; 

COUNT=COUNTSMAX; 

CALL PUTSCHACVALUESPTR,RECEIVESCH); 

IF MATCHSEND THEN DO; RETURN TRUE; FI 
FI 

ENDFOR 

ENDDO 

RETURN FALSE; 

ENDFUNCTI ON RECEIVESSTRING; 


/*** SYMBOL TABLE ROUTINES ***/ 


/* A HASH TABLE, WHICH IS AN ARRAY OF 32 CHAIN POINTERS, IS USED. */ 
/* EACH ENTRY IS A BLOCK WITH THE FOLLOWING FIELDS: (NO. BYTES IN FIELD) */ 
/* NEXT(2) , CH-PTR(2), VALUE(2), NAME(2), NAME-TEXT(8) */ 

/* STSFIND DOES A LOOKUP AND SETS STSENTRYSPTR AND HASHSINDEX . */ 
/* STSDELETE DELETES THE PREVIOUSLY FOUND ENTRY AT STSENTRYSPTR. */ 
/* STSCREATE CREATES AN ENTRY AT HASHSINDEX. */ 
/* STSADDSVALUE FILLS IN THE VALUE PTR FOR THE ENTRY AT STSENTRYSPTR */ 


DECLARE /* SYMBOL TABLE STUFF */ 

HASHSTABLE(32) ADDRESS, /*ADDRESS OF FIRST IN CHAIN OF EQUAL HASH ENTRIES*/ 
HASHSINDEX BYTE. /* INDEX INTO HASHSTABLE, SET BY STSFIND */ 

STSENTRYSPTR ADDRESS. /* ADDRESS OF AN ENTRY (BLOCK) */ 

STSENTRY BASED STSENTRYSPTR ADDRESS, 

STSPREVIOUSSPTR ADDRESS, /* ADDRESS OF CHAIN POINTER TO CURRENT STSENTRY */ 
STSPREVIOUS BASED STSPREVIOUSSPTR ADDRESS, /* HASH INDEX OF PREVIOUS BLOCK */ 
STSCHSPTRSINDEX LITERALLY '1', /* STSENTRY(1) IS LAST CH PTR (FORM PTR)*/ 

STSVALUESINDEX LITERALLY '2', /* STSENTRY(2) IS THE VALUE POINTER */ 

STSNAMESINDEX LITERALLY '3', /* STSENTRY(3) IS PTR TO REST OF NAME */ 

STSNAMESOFFSET LITERALLY '6'; /* STSENTRYSPTR+6 IS START OF NAME BLOCK */ 


Number 23 


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


Page 29 

131 




00659 1 

00660 1 
00661 2 
00662 2 
00663 1 

00664 1 

00665 2 

00666 2 
00667 2 

00666 2 
00669 2 

00670 2 

00671 2 

00672 2 

00673 2 

00674 2 

00675 3 

00676 2 

00677 2 

00678 2 

00679 3 

00680 2 
00681 2 
00682 2 
00683 3 

00684 3 

00685 2 

00686 2 
00687 1 

00668 1 
00689 2 

00690 2 

00691 2 

00692 2 

00693 2 

00694 2 

00695 2 

00696 1 

00697 1 

00698 2 

00699 2 

00700 2 

00701 2 

00702 2 

00703 2 

00704 2 

00705 2 

00706 2 

00707 2 

00708 2 

00709 1 

00710 1 

00711 2 

00712 2 

00713 2 

00714 2 

00715 2 

00716 2 

00717 2 

00718 2 

00719 1 

00720 1 

00721 2 

00722 2 

00723 2 

00724 2 

00725 2 

00726 2 

00727 2 

00728 2 

00729 2 

00730 2 

00731 2 

00732 2 

00733 2 

00734 2 

00735 2 

00736 2 

00737 2 

00738 2 

00739 3 

00740 2 

00741 2 

00742 1 

00743 1 


Page 30 

132 


STSINIT: PROCEDURE: 

FOR HASHSINDEX=0 TO LASTCHASHSTABLE); HASHSTABLECHASHSINDEX)=0; ENDFOR 
ENDPROCEDURE STSINIT; 

STSFIND: FUNCTI ON(NAMESPTR) BYTE: 

/* IF FOUND. VALUE IS TRUE AND STSENTRYSPTR, STSPREVIOUSSPTR ARE SET */ 

/* IN ANY CASE, HASHSINDEX IS SET */ 

DECLARE 

NAMESPTR ADDRESS, 

(HASH,CH) BYTE, 

HASHSMASK LITERALLY '1111 IB’; /* FOR 32 HASH CHAINS */ 

HASH=0; FIRSTSGETASFLAG=TRUE; 

DO WHILE (CH:=GET$CHA(NAMESPTR)) <> NIL; 

HASH=HASH+CH; 

ENDDO; 

IF HIGHCSTSENTRYSPTR:=HASHSTABLE(HASHSINDEX:=HASH AND HASHSMASK))=0 THEN DO; 

RETURN FALSE; 

FI 

STSPREVI0US$PTR=.HASHSTABLE(HASHSINDEX); 

DO WHILE NOT STRINGSEQUALITY(NAMESPTR,STSENTRYSPTR+STSNAMESOFFSET); 

STSPREVIOUSSPTR=STSENTRYSPTR; 

IF HIGH(STSENTRYSPTR:=STSENTRY) = 0 THEN DO; RETURN FALSE; F! 

ENDDO 

RETURN TRUE; 

ENDFUNCTI ON STSFIND; 

STSDELETE: PROCEDURE; 

/* DELETE THE SYMBOL TABLE ENTRY AT STSENTRYSPTR */ 

/* BUT FIRST FREE THE NAME AND VALUE CHAINS */ 

CALL FREESCHAIN(ST$ENTRY(STSNAMES INDEX)); 

CALL FREESCHAIN(STSENTRY(STSVALUESINDEX)); 

STSPREVIOUS=STSENTRY; 

CALL FSSFREE(STSENTRYSPTR); 

ENDPROCEDURE STSDELETE; 

STSCREATE: PROCEDURE(NAMESPTR); 

/* CREATE AN ENTRY AT HASHS!NDEX, LEAVE STSENTRYSPTR SET */ 

/* VALUE PTR TO BE FILLED IN LATER BY STSADDSVALUE */ 

DECLARE NAMESPTR ADDRESS; 

ST$ENTRY$PTR=FSSGET; 

STSENTRY=HASH$TABLE(HASHSINDEX); 

HASHSTABLE(HASHSINDEX)=STSENTRY*PTR; 

STSENTRY(STSNAMESINDEX)=0; 

CALL COPY$VALUE(NAME$PTR,STSENTRYSPTR + STSNAMESOFFSET) ; 

STSENTRY(STSVALUESINDEX)=0; 

ENDPROCEDURE STSCREATE; 

STSADDSVALUE: PROCEDURE(STSVALUESPTR); 

/* FILL IN THE VALUE PTR IN ENTRY AT STSENTRYSPTR */ 

/* ALSO RESET FORMPTR */ 

DECLARE STSVALUESPTR ADDRESS; 

CALL FREESCHAIN(STSENTRY(STSVALUESINDEX)); 

STSENTRY(STSVALUESINDEX)=ST$VALUE$PTR; 

STSENTRY(STSCHSPTRSINDEX)=ST$VALUE$PTR+1; 

ENDPROCEDURE STSADDSVALUE; 

STSREINIT: PROCEDURE: 

/* DEFINE THE IDLE MACRO SIM = S(PS,S(RS,.)) #/ 

DECLARE IM DATA 

(FUNSCH,LEFTSDELIM,LITSP,LITSS,ARGSDELIM, 

FUNSCH,LEFTSDELIM,LITSR,LITSS,ARGSDELIM,'.',RIGHTSDELIM,RIGHTSDELIM); 

FIRSTSPUT ASFLAG = TRUE; 

CALL PUTSCHA(TEMPSPTR:=FSSGET,FUNSCH); 

CALL PUTSCHA(0,LITSI); 

CALL PUTSCHACO,LITSM); 

DUMMY=ST$FIND(TEMPSPTR); 

CALL STSCREATE!TEMPSPTR); 

CALL FSSFREE(TEMPSPTR); 

FIRSTSPUTA$FLAG=TRUE; 

TEMPSPTR=FS$GET; 

FOR ITEMP=0 TO LAST(IM); 

CALL PUTSCHA(TEMPSPTR, IM(I TEMP)); 

ENDFOR 

CALL STSADDSVALUE(TEMPSPTR); 

ENDPROCEDURE STSREINIT; 



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


Number 23 


00744 1 

00745 1 

00746 1 

00747 2 

00748 2 

00749 2 

00750 2 

00751 2 

00752 1 

00753 1 

00754 2 

00755 2 

00756 1 

00757 1 

00758 1 

00759 1 

00760 1 

00761 2 

00762 2 

00763 3 

00764 4 

00765 4 

00766 4 

00767 3 

00768 3 

00769 2 

00770 1 

00771 1 

00772 2 

00773 2 

00774 2 

00775 1 

00776 1 

00777 2 

00778 2 

00779 1 

00780 1 

00781 2 

00782 2 

00783 2 

00784 2 

00785 2 

00786 2 

00787 2 

00788 2 

00789 2 

00790 2 

00791 2 

00792 3 

00793 2 

00794 3 

00795 2 

00796 3 

00797 2 

00798 2 

00799 1 

00800 1 
00801 1 
00802 1 
00803 1 

00804 2 

00805 2 

00806 2 
00807 2 

00808 2 
00809 2 

00810 2 
00811 2 
00812 2 
00813 2 

00814 2 

00815 3 

00816 3 

00817 4 

00818 3 

00819 2 

00820 3 

00821 3 

00822 2 
00823 2 

00824 2 

00825 2 

00826 2 
00827 2 

00828 3 

00829 2 

00830 2 

00831 1 


/#** GENERAL UTILITIES FOR SCAN AND PRIMITIVE FUNCTIONS ***/ 

THISSNS: FUNCTION ADDRESS; 

DECLARE THIS ADDRESS; 

TH1S=NSSSTACK(NSSSTACKStNDEX); 

NSSSTACKSINDEX=NSSSTACKS INDEX+1; 

RETURN THIS; 

ENDFUNCTI ON THISSNS; 

NEXTSNS: FUNCTION ADDRESS; 

RETURN NSSSTACK(NSSSTACKSINDEX:=NSSSTACKSINDEX+1); 

ENDFUNCTI ON NEXTSNS; 


/*#* DEBUG AIDS *#*/ 

TRACESPRINT: PROCEDURE; 

DO FOREVER; 

IF (VALUESPTR:=THIS$NS) THEN DO; 

CALL CRLF; 

NSSSTACKSINDEX = NS$SAVES INDEX; 

RETURN; 

FI 

CALL PR INTSSTRING(VALUESPTR); CALL PR INTSCH(5CH); 

ENDDO 

ENDPROCEDURE TRACESPRINT; 

TURNSTRACESON! PROCEDURE; 

TRACE$FLAG=SHL(TRACESFLAG,1) OR 1; 

CPMSPRINT$FLAG=TRUE; 

ENDPROCEDURE TURNSTRACESON; 

TURNSTRACESOFF: PROCEDURE; 

TRACESFLAG=SHR(TRACESFLAG,1); 

ENDPROCEDURE TURNSTRACESOFF; 

PROCESSSCONSBREAK: PROCEDURE; 

DECLARE CH BYTE; 

IF NOT STSFINDC.ATSCB) THEN DO; CALL STSCREATE(.ATSCB); FI 
FIRSTSPUTASFLAG=TRUE; 

CALL PUTSCHAIVALUESPTR:=FSSGET,CH:=READSCH); 

CALL STSADDSVALUEIVALUESPTR); 

IF CH <> ESC THEN DO; RETURN: FI 
CALL PR INTSMESS(, ' TNI: S*); 

IF C CH:=READ$CH) = LITST THEN DO; /* 'T */ 

CALL TURNSTRACESON; 

END; ELSE IF CH = LITSN THEN DO; /* 'N' */ 

CALL TURNSTRACESOFF; 

END: ELSE IF CH = LITSI THEN DO; /* 'I' */ 

GO TO START; 

FI 

CALL CRLF; 

ENDPROCEDURE PROCESSSCONSBREAK; 


/*** UTILITIES FOR SCAN ALGORITHM ***/ 
ASSNSSINIT: PROCEDURE: 

/* LOAD THE IDLE MACRO; RESET THE NEUTRAL STRING */ 
DECLARE 

CLSIM DATA 

(FUNSCH,LEFTSDELIM,FUNSCHj L l T$ I , LITSM,RIGHTSDELIM), 


/* RELEASE ACTIVE STRING BLOCKS, THEN SET ACTIVE TO S(SIM) */ 

CALL FREESCHAIN(ASSBLOCKSPTR); 

AS$BLOCK$PTR=FS$GET; 

IF NOSEXSVALUE THEN DO: 

FIRSTSPUTASFLAG=TRUE; 

FOR 1=0 TO LASTCCLSIM); 

CALL PUTSCHA(ASSBLOCKSPTR,CL$IM<I)); 

ENDFOR 

END: ELSE DO; 

CALL COPYSVALUE(VALUE$PTR,ASSBLOCKSPTR); 

NOSEXSVALUE=TRUE; 

FI 

AS$CH#PTR=ASSBLOCKSPTR+2; 

/* RESET NEUTRAL STACK TO EMPTY RELEASING THE ASSOCIATED BLOCKS */ 
NSSSTACKSINDEX=0; 

DO NEXTSARG; 

CALL FREESCHAIN(ARGSPTR); 

ENDDO 

NSSSTACKSINDEX=0; 

ENDPROCEDURE ASSNSSINIT; 


Number 23 


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


Page 31 

133 



00832 1 

00833 2 

00834 2 

00835 2 

00836 2 

00837 2 

00838 1 

00839 1 

00840 2 

00841 2 

00842 2 

00843 2 

00844 2 

00845 2 

00846 2 

00847 2 

00848 2 

00849 3 

00850 3 

00851 4 

00852 4 

00853 5 

00854 4 

00855 3 

00856 3 

00857 2 

00858 2 

00859 2 

00860 2 
00861 2 
00862 3 

00863 3 

00864 2 

00865 2 

00866 1 
00867 1 

00868 2 
00869 2 

00870 2 

00871 2 

00872 2 

00873 2 

00874 2 

00875 2 

00876 2 

00877 3 

00878 3 

00879 2 

00880 1 
00881 1 
00882 2 
00883 2 

00884 2 

00885 2 

00886 2 
00887 2 

00888 2 
00889 2 

00890 3 

00891 3 

00892 2 

00893 3 

00894 3 

00895 4 

00896 4 

00897 4 

00898 3 

00899 2 

00900 1 

00901 1 

00902 2 

00903 2 

00904 2 

00905 2 

00906 2 

00907 2 

00908 3 

00909 4 

00910 4 

00911 3 

00912 5 

00913 5 

00914 4 

00915 4 

00916 3 

00917 3 

00918 2 

00919 1 


AS*FREE$BL0CK: PROCEDURE; 

TEMPSPTR=ASSBLOCKSPTR; 

ASSBLOCKSPTR=ASSBLOCK; 

CALL FSSFREE(TEMPSPTR); 

ASSCHSPTR*ASSBLOCKSPTR+2; 

ENDPROCEDURE ASSFREESBLOCK; 

ASSNEXTSCH: FUNCTI ON(MOVESPTRSFLAO) BYTE: 

/* RETURN THE NEXT 7-BIT CHARACTER FROM THE ACTIVE STRING */ 

/* ASSCHSPTR IS THE ADDRESS OF THE NEXT CHAR TO BE RETURNED */ 

/* OR JUST OFF THE END OF A BLOCK */ 

/* PAST CHARACTERS ARE REPLACED WITH 'PHI' (8-BIT NULL)*/ 

DECLARE 

(MOVESPTRSFLAG,CH) BYTE, 

OLDSBLOCKSPTR ADDRESS; 

NEXT: FUNCTION BYTE: 

IF (LOW(ASSCHSPTR) AND NOTSPTRSMASK) * 0 THEN DO; 

CALL ASSFREESBLOCK: 

IF HIGH(ASSBLOCKSPTR) = 0 THEN DO; 

GO TO START; 

FI 

FI 

RETURN ASSCH; 

ENDFUNCTI ON NEXT; 

/* SKIP ANY 8-BIT CHARACTERS */ 

DO WHILE ROL(CH:=NEXT,1); ASSCHSPTR=ASSCHSPTR+1; ENDDO 
IF MOVESPTRSFLAG THEN DO; 

AS$CH=PHI; 

ASSCHSPTR = ASSCHSPTR+1; 

FI 

PFTIIRN PH * 

ENDFUNCTI6n ASSNEXTSCH; 

STARTSNEXTSARGUMENT: PROCEDURE(FLAGS); 

/* INITIALIZE THE NEXT NEUTRAL STRING STACK ENTRY TO THE NULL STRING */ 
/* ALSO SET FLAGS WHICH INDICATE ACTIVE OR NEUTRAL MODE */ 

DECLARE FLAGS BYTE; 

NSSSTACK(NSSSTACKSINDEX:=NSSSTACKSINDEX+1),NS$CH$PTR=FS$GET OR FLAGS; 
NSSCHSPTR*(NSSCHSPTR AND PTR$MASK)+2; 

NSSARGSBREAK=FALSE; 

IF NSSSTACKSINDEX=LAST(NSSSTACK)-4 THEN DO; 

CALL M0N1(9,.'NS STACK OVERFLOW S'); 

GO TO BDOS; 

FI 

ENDPROCEDURE STARTSNEXTSARGUMENT; 

NSSADDSCH: PROCEDURE(CH): 

/* APPEND CH TO THE ACTIVE STRING. IF NSSARGSBREAK IS FALSE, THEN */ 

/* NSSCHSPTR IS THE ADDRESS OF THE NEXT CHARACTER TO BE ADDED */ 

DECLARE 

CH BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR) ADDRESS; 

IF NSSARGSBREAK THEN DO: 

NSSCHSPTR=APPENDSCH(CH,NSSSTACK(NSSSTACKSINDEX) AND PTRSMASK); 
NSSARG$BREAK=FALSE; 

END; ELSE DO; 

NS$CH= CH * 

IF(LOW(NSSCHSPTR:=NSSCH$PTR+1) AND NOTSPTRSMASK) = 0 THEN DO; 
BLOCK$PTR = NSSCHSPTR-BLOCKSLENGTH; 

BLOCK,NS$CHSPTR=FSSGET; 

NSSCHSPTR = NSSCHSPTR + 2; 

FI 

FI 

ENDPROCEDURE NSSADDSCH; 

PROCESSSQUOTEDSSTRING: PROCEDURE: 

DECLARE (DEL IMSLEVEL,LASTSDELIMSWASSLEFT,CH) BYTE; 


DEL IMSLEVEL*0: 

LASTSDELIMSWASSLEFT=TRUE; 

DO FOREVER; 

IF (CH:=ASSNEXTSCH(MOVESPTR)) = LEFTSDELIM THEN DO: 

IF LASTSDELIMSWASSLEFT THEN DO; DEL IMSLEVEL*DELIMSLEVEL+1 ; FI 
LASTSDELIMSWASSLEFT* TRUE: 

END: ELSE IF CH = RIGHTSDELIM THEN DO: 

IF LASTSDELIMSWASSLEFT THEN DO; LASTSDELIMSWASSLEFT=FALSE; 
END; ELSE DO; DELIMSLEVEL=DELIMSLEVEL-1 ; 

IF DEL IMSLEVEL = 0 THEN DO; RETURN; FI 
FI 

CALL NSSADDSCH(CH); 

ENDDO 

ENDPROCEDURE PROCESSSQUOTEDSSTRING; 



Page 32 

134 


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


Number 23 



00920 

1 

00921 

2 

00922 

2 

00320 

2 

00924 

2 

00925 

2 

00326 

2 

00927 

3 

00928 

3 

00929 

4 

00930 

4 

00931 

3 

00932 

4 

00933 

4 

00934 

3 

00935 

2 

00936 

3 

00937 

3 

00938 

2 

00939 

3 

00940 

2 

00941 

1 

00942 

1 

00943 

1 

00944 

1 

00945 

1 

00946 

2 

00947 

2 

00948 

2 

00949 

2 

00950 

2 

00951 

2 

00952 

2 

00953 

2 

00954 

2 

00955 

2 

00956 

3 

00957 

3 

00958 

2 

00959 

3 

00960 

3 

00961 

2 

00962 

2 

00963 

2 

00964 

3 

00965 

3 

00966 

3 

00967 

2 

00968 

2 

00969 

2 

00970 

2 

00971 

2 

00972 

2 

00973 

3 

00974 

2 

00975 

1 

00976 

1 

00977 

2 

00978 

2 

00979 

2 

00980 

2 

00981 

2 

00982 

2 

00983 

2 

00984 

2 

00985 

3 

00986 

4 

00987 

3 

00988 

4 

00989 

3 

00990 

2 

00991 

2 

00992 

2 

00993 

1 

00994 

1 

00995 

2 

00996 

2 

00997 

2 

00998 

2 

00999 

2 

01000 

1 

01001 

1 

01 002 

2 

01 003 

2 

01 004 

2 

01 005 

2 

01 006 

1 


Number 23 


PROCESSSBEG!NSFUNCTION: PROCEDURE; 

DECLARE 

BLOCKSPTR ADDRESSj 

(BLOCK BASED BLOCKSPTR,CH) BYTE; 

IF (CH:=AS$NEXT$CHCDONTSMOVESPTR)) = FUNSCH THEN DO; 

DUMMY = ASSNEXT®CH(MOVESPTR); 

IF (CH:=AS$NEXTSCH(DONTSMOVESPTR)) = LEFTSDELIM THEN DO; /* NEUTRAL */ 
DUMMY =ASSNEXTSCH(MOVESPTR); 

CALL STARTSNEXTSARGUMENT(NSSFUNSBIT); 

END; ELSE DO; /* NOT A FUNCTION, JUST TWO FUN CHARACTERS */ 

CALL NSSADDSCH(FUNSCH); 

CALL NSSADDSCH(FUNSCH); 

END^ELSE IF CH = LEFTSDELIM THEN DO; /* ACTIVE FUNCTION CALL */ 
6uMMY=ASSNEXTSCH(MOVESPTR); 

CALL STARTSNEXTSARGUMENTCNSSFUNSBIT OR NSSACTIVESBIT); 

END: ELSE DO; /* NOT A FUNCTION, JUST ONE FUN CHARACTER */ 

CALL NS$ADDSCH(FUNSCH); 

FI 

ENDPROCEDURE PROCESSSBEGINSFUNCTI ON; 


/*** UTILITIES FOR PRIMITIVE FUNCTIONS ***/ 

BINARYSTOSSTRING: PROCEDURE!N); 

/« NOTE: VALUESPTR IS USED BY PROCESSSENDSFUNCTI ON */ 
DECLARE 

N ADDRESS, 

D(6) BYTE, 

(I,K,NEGATIVE) BYTE; 

NEGATIVE=FALSE; 

I = -1 ; 

IF ROLCHIGH(N),1) THEN DO; 

NEGATIVE=TRUE; 

N=-N: 

END; ELSE IF N = 0 THEN DO; 

I =0; 

D ( 0) = ' 0' ; 


DO WHILE N > 0; 

1=1+1; 

D ( I ) = (N MOD 10) + '0'; 

N=N/10; 

ENDDO 

IF NEGATIVE THEN DO; 1=1+1; D(I)='-'; FI 

VALUE$PTR=FS$GET; 

FIRSTSPUTASFLAG=TRUE; 

FOR K=0 TO I; 

CALL PUT$CHA(VALUESPTR,D(I-K)); 

ENDFOR 

ENDPROCEDURE BINARYSTOSSTRING; 

STRINGSTOSBINARY: FUNCTI ONCBLOCKSPTR) ADDRESS; 

DECLARE 

(BLOCKSPTR,N) ADDRESS, 

(CH,NEGATIVE) BYTE; 

N,NEGATIVE=0; 

FIRST$GETA$FLAG=TRUE; 

DO WHILE (CH:=GET$CHA(BLOCKSPTR AND PTRSMASK)) <> NIL; 

IF CH = 'THEN DO; 

NEGATIVE=TRUE; 

END; ELSE IF (CH:=CH-'0') < 10 THEN DO; 

N=SHL(N,3)+N+N+CH; 

FI 

ENDDO 

IF NEGATIVE THEN DO; RETURN -N; FI 
RETURN N; 

ENDFUNCTI ON STRINGSTOSBtNARY; 

CHSTOSHEX: FUNCTION(CH) BYTE; 

DECLARE CH BYTE; 

IF CH <= '9' THEN DO; RETURN CH-'O'; FI 

IF CH < 47H THEN DO; RETURN CH-37H; FI /* CH-'A'+IO */ 
RETURN CH-57H; /* LOWER CASE A-F */ 

ENDFUNCTI ON CHSTOSHEX; 

HEXSTOSCH: FUNCTI ON(HALFSBYTE) BYTE; 

DECLARE HALFSBYTE BYTE; 

IF HALFSBYTE < 10 THEN DO; RETURN HALFSBYTE+'O'; FI 
RETURN HALFSBYTE+57H; /* 57H = 'A'-10 (LOWER CASE A-F) */ 
ENDFUNCTI ON HEXSTOSCH; 



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


Page 33 

135 



01007 1 

01008 2 
01009 2 

01010 2 
01011 2 
01012 2 
01013 2 

01014 2 

01015 1 

01016 1 
01017 2 

01018 2 
01019 2 

01020 2 
01021 2 
01022 2 
01023 2 

01024 2 

01025 2 

01026 2 
01027 3 

01028 3 

01029 3 

01030 3 

01031 4 

01032 5 

01033 4 

01034 4 

01035 4 

01036 5 

01037 4 

01038 4 

01039 3 

01040 2 

01041 2 

01042 3 

01043 3 

01044 3 

01045 3 

01046 4 

01047 4 

01048 5 

01049 4 

01050 5 

01051 4 

01052 3 

01053 2 

01054 2 

01055 2 

01056 2 

01057 2 

01058 3 

01059 3 

01060 4 

01061 4 

01062 4 

01063 3 

01064 3 

01065 3 

01066 3 

01067 2 

01068 1 
01069 1 

01070 1 

01071 1 

01072 1 

01073 1 

01074 1 

01075 1 

01076 2 

01077 2 

01078 2 

01079 2 

01080 2 
01081 3 

01082 3 

01083 4 

01084 4 

01085 3 

01086 4 

01087 4 

01088 3 

01089 2 

01090 1 


Page 34 

136 


NUMBERSOFSARGS: FUNCTION BYTE: 

/* COUNT THE NUMBER OF ARGS FOR THE CURRENT FUNCTION */ 

DECLARE N BYTE; 

N= 1 ; 

DO NEXTSARG' N=N+1; ENDDO 
NSSSTACKSINDEX = NSSSAVESINDEX; 

RETURN N: 

ENDFUNCTI ON NUMBERSOFSARGS; 

SSSMATCH: FUNCTION BYTE; 

/* SUBSTRING MATCH TEST FOR SS, IN */ 

/* IMPLICIT INPUT: SSSCHASPTR (START SEARCH HERE), ARGSPTR (SUBSTRING) */ 
/* IMPLICIT OUTPUT: SSSCHBSPTR, SSSCHCSPTR (BOUNDS OF MATCHED SUBSTRING) */ 
/* SSSCHBSPTR IS THE CHAR BEFORE THE FIRST MATCHED CHARACTER */ 

/* SSSCHCSPTR IS THE LAST CHARACTER OF THE MATCH */ 

DECLARE 

(CHA.CHB) BYTE, 

RESTARTSPTR ADDRESS; 

MATCHSHERE: FUNCTION BYTE; 

FIRST$GETB$FLAG=TRUE; 

DO FOREVER; 

/* GET NEXT 7-BIT CHAR FROM SUBSTRING. IF NIL THEN HAVE MATCHED */ 

DO WHILE R0L(CHB:=GETSCHB(ARGSPTR>,1); 

IF CHB = NIL THEN DO; RETURN TRUE; FI 
ENDDO 

/* GET NEXT 7-BIT CHAR FROM STRING. FAIL IF FIND 8-BIT <> PHI */ 

DO WHILE ROLtCHA:=GET*CHA(0),1); 

IF CHA <> PHI THEN DO; RETURN FALSE; FI 
ENDDO 

IF CHA <> CHB THEN DO; RETURN FALSE; FI 
ENDDO 

ENDFUNCTION MATCHSHERE; 

NEXTSSTART: FUNCTION BYTE: 

GETSCHASCHSPTR=RESTARTSPTR; 

DUMMY = GETSCHA(0); 

DO FOREVER: 

RESTARTSPTR=GETSCHASCHSPTR: 

IF ROL(CHA:=GETSCHA(0).1) THEN DO; 

IF CHA = NIL THEN DO; RETURN FALSE; FI 
END; ELSE DO: 

RETURN TRUE; 

FI 

ENDDO 

ENDFUNCTION NEXTSSTART; 

RESTART$PTR=SS$CHASPTR; 

IF NULLSTEST(ARGSPTR) THEN DO; RETURN FALSE; FI 
DO FOREVER; 

GETSCHASCHSPTR=RESTARTSPTR; 

IF MATCHSHERE THEN DO; 

SSSCHBSPTR=RESTARTSPTR; 

SSSCHCSPTR 3 GETSCHASCHSPTR; 

RETURN TRUE; 

FI 

IF CHA = NIL THEN DO; RETURN FALSE; FI 
/* RESTART AT THE NEXT 7-BIT CHAR */ 

IF NOT NEXTSSTART THEN DO; RETURN FALSE; FI 
ENDDO 

ENDFUNCTI ON SSSMATCH; 


/*** PRIMITIVE FUNCTIONS AND PROCESSSENDSFUNCTI ON ***/ 

/* FUNCTIONS ARE ENTERED WITH NSSSTACKSINDEX CORRESPONDING TO FIRST ARGUMENT */ 
/* VALUESPTR IS PRESET TO NULLSSTRINGSPTR FOR DEFAULT VALUE */ 

PFSNS: PROCEDURE; 

/* 'NAME STRING' S(NS,NAME,VALUE.NAME,VALUE,...) */ 

/* REUSES ANY EXISTING SYMBOL TABLE ENtRIES */ 

DO NEXTSARG; „ 

IF NOT st$FIND(ARGSPTR) THEN DO; CALL STSCREATE(ARGSPTR); FI 
IF (ARGSPTR:=NEXTSNS) THEN DO; 

CALL STSADDSVALUE(FSSGET); /* SUPPLY NULL VALUE IF NO ARGUMENT */ 
RETURN; 

END: ELSE DO; 

6ALL STSADDSVALUECARGSPTR); 

NSSSTACK(NSSSTACKSINDEX)=NULLSSTRINGSPTR; /*S0 WON'T FREE VALUE*/ 

FI 

ENDDO 

ENDPROCEDURE PFSNS; 



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


Number 23 





01091 
01092 
01093 
01094 
01095 
01096 
01097 
0109S 
01099 
01100 
01 1 01 
01102 
01103 
01104 
01 105 
01 1 06 
01107 
01 1 08 
01109 
01 1 1 o 
01111 
01112 
01113 
01114 
01115 
01116 
01117 
01118 
01119 
01120 
01 121 
01 122 
01 123 
01 124 
01125 
01 126 
01 127 
01 128 
01 1 29 
01 1 30 
01 1 31 
01 1 32 
01 1 33 
01 134 
01 135 
01136 
01 137 
01 138 
01 1 39 
01 1 40 
01 1 41 
01 1 42 
01 1 43 
01 1 44 
01 1 45 
01 146 
01 1 47 
01 148 
01 149 
01 150 
01 151 
01 152 
01 153 
01 154 
01 1 55 
01 1 56 
01 1 57 
01 1 58 
01 1 59 
01 1 60 
01 1 61 
01 1 62 
01 1 63 
01 1 64 
01 1 65 
01 1 66 
01 1 67 
01 1 68 
01 1 69 
01 1 70 
01 1 71 
01 1 72 
01 1 73 
01 174 
01 1 75 
01 1 76 
01 1 77 
01 1 78 
01 1 79 
01 1 80 
01181 
01 1 82 
01 1 83 


1 

2 

2 

2 

2 

2 

3 

4 
4 
3 
3 
3 
3 
3 

3 

4 

4 

4 

4 

5 
4 
3 
2 
1 
1 
1 
2 
2 
2 
2 
2 
3 
3 
3 
3 
3 
3 
3 
3 
3 

3 

4 
4 
3 
2 
2 
2 
2 
2 
3 
3 

3 

4 
4 
4 
4 
4 

4 

5 
5 
4 
4 
3 
2 
1 
1 

2 

2 

2 

2 

2 

2 

2 

2 

2 

3 

3 

3 

3 

2 

2 

2 

3 

3 

3 

3 

3 

3 

3 

4 
3 
3 
2 


PFSAS: PROCEDURE; 

/* 'APPEND TO STRING' 
DECLARE CH BYTE; 


S(AS,NAME.SUFFIX,NAME,SUFFIX,...) */ 


DO NEXTSARG; 

IF NOT STSFIND(ARGSPTR) THEN DO; 

CALL ST$CREATE(ARGSPTR): 

CALL STSADDSVALUE C FSSGET); 

FI 

IF LOWCARGSPTR:=NEXTSNS) THEN DO; RETURN; FI 
FIRST$GETA$FLAG=TRUE; 

IF (CHI=GET$CHA(ARGSPTR)) <> NIL THEN DO: 

PUTSCHASCHSPTR=APPENDSCH(CH,STSENTRY(STSVALUESINDEX)); 

PUTSCHASCURRENT$BLOCKSPTR=PUTSCHASCHSPTR AND PTRSMASK; 

FIRSTSPUTASFLA0=FALSE; 

DO WHILE (CH:=GETSCHA(0)) <> NIL; 

CALL PUTSCHA(0,CH); 

ENDDO 

FI 

ENDDO 

ENDPROCEDURE PFSAS; 

PFSSS: PROCEDURE; 

/* 'SEGMENT STRING' S(SS,NAME,ARG,ARG,...) */ 

/* NO MORE THAN 64 ARGS */ 

DECLARE (ARGSNUMBER,MORESFILL) BYTE; 

PUTSCHASSS: PROCEDURE(CHA); 

/* SPECIAL PUTSCHA FOR SEGMENT STRING */ 

DECLARE 

(CH BASED PUTSCHASCHSPTR,CHA) BYTE, 

CURRENTSBLOCKSPTR ADDRESS. 

CURRENTSBLOCK BASED CURRENTSBLOCKSPTR ADDRESS; 

CH=CHA; 

IF (LOW(PUTSCHASCHSPTR:=PUTSCHA$CHSPTR+1) AND NOTSPTRSMASK) 

= 0 THEN DO; 

CURRENTSBLOCKSPTR = PUTSCHASCHSPTR-BLOCKSLENGTH; 
PUT$CHASCHSPTR=CURRENTSBL0CK+2; 

FI 

ENDPROCEDURE PUTSCHASSS; 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 
ARG$NUMBER=-1; 

DO NEXTSARG; 

ARGSNUMBER = ARGSNUMBER+1 ; 

SSSCHASPTR = STSENTRY(STSVALUESINDEX) +1 ; 

DO WHILE SSSMATCH; 

GET$CHASCHSPTR=SSSCHBSPTR; 

DUMMY = GETSCHA(0) ; 

PUTSCHASCHSPTR=GETSCHASCHSPTR; 

MORESFILL=(PUTSCHASCHSPTR <> SSSCHCSPTR); 

CALL PUTSCHASSS(SSSMASK OR ARGSNUMBER); /* INSERT SEG. NUM. 

DO WHILE MORESFILL; 

MORESFILL=(PUTSCHASCHSPTR <> SSSCHCSPTR); 

CALL PUTSCHASSS(PH I); 

ENDDO 

SSSCHASPTR=SSSCHCSPTR; 

ENDDO 

ENDDO 

ENDPROCEDURE PFSSS; 

PFSGC: PROCEDURE; 

/* 'GET CHARACTERS' $(GC,NAME,N,S,F) */ 

/* IF ONLY TWO ARGS, VALUE IS LENGTH OF THE NAMED STRING */ 

/* IF NO FORM CALLED NAME, THEN VALUE IS NULL */ 

DECLARE 

(GCSPTR,NSPTR.N,MARKSPTR,FORMSPTR, 

CURRENTSCHSPTR,BACKUPSTO) ADDRESS, 

(CH,NEGSCOUNTSFAILED) BYTE; 


ANOTHERSCH: FUNCTION BYTE; 

IF N = 0 THEN DO; RETURN FALSE; FI 
IF (CH:=GETSCHA(0)) <> NIL THEN DO; 
RETURN FALSE: 

ENDFUNCTI ON ANOTHERSCH; 


RETURN TRUE; FI 


GCSLENGTH: FUNCTION ADDRESS; 

DECLARE M ADDRESS; 

M = 0: 

FIRSTSGETASFLAG=TRUE; 

TEMPSPTR=STSENTRY(STSVALUESINDEX); 

DO WHILE (CH:=GETSCHA(TEMPSPTR)) <> NIL AND 
GETSCHASCHSPTR <> MARKSPTR; 

IF NOT ROL(CH,1) THEN DO; M=M+1; FI 
ENDDO 
RETURN M; 

ENDFUNCTI ON GCSLENGTH; 


Number 23 


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


*/ 


Page 35 

137 


01184 2 

01185 2 

01186 2 
01187 2 

01188 2 
01189 2 

01190 2 

01191 2 

01192 2 

01193 2 

01194 2 

01195 3 

01196 3 

01197 3 

01198 2 

01199 2 

01200 2 
01201 2 
01202 2 
01203 2 

01204 2 

01205 2 

01206 3 

01207 4 

01208 4 

01209 4 

01210 3 

01211 2 
01212 2 
01213 2 

01214 2 

01215 2 

01216 2 
01217 3 

01218 2 
01219 1 

01220 1 
01221 2 
01222 2 
01223 2 

01224 2 

01225 2 

01226 2 
01227 2 

01228 2 
01229 2 

01230 2 

01231 2 

01232 2 

01233 2 

01234 2 

01235 2 

01236 2 

01237 2 

01238 2 

01239 2 

01240 3 

01241 3 

01242 4 

01243 3 

01244 3 

01245 2 

01246 3 

01247 3 

01248 3 

01249 4 

01250 5 

01251 5 

01252 4 

01253 3 

01254 2 

01255 2 

01256 2 

01257 3 

01258 2 

01259 1 

01260 1 
01261 2 
01262 2 
01263 2 

01264 2 

01265 1 


IF NOT STSFIND(.ATSGC) THEN DO: CALL STSCREATE(.AT*GC); FI 
CALL ST$AD0$VALUE!GCSPTR:=FS$GET); 

NAME$PTR=NEXT$NS; 

N$PTR=NEXT$NS; 

SSPTR=NEXT$NS; 

F$PTR=NEXTSNS; 

IF NOT STSFIND(NAMESPTR) THEN DO; RETURN; FI 

IF LOW(NSPTR) THEN DO; /* RETURN STRING LENGTH IF NO THIRD ARGUMENT */ 
MARK$PTR=0; 

CALL BINARVSTOSSTRING(GCSLENGTH); 

RETURN; 

FI 

N=STRINGSTOSBI NARY(NSPTR); 

NEGSCOUNTSFAI LED=>FALSE; 

GETSCHASCHSPTR, FORMSPTR=STSENTRY(STSCHSPTRSINDEX); 

/* NEGATIVE COUNT NOT IMPLEMENTED */ 

FIRSTSPUTASFLAG-TRUE; 

DO WHILE ANOTHERSCH; 

IF NOT ROL(CH,1) THEN DO; 

N = n-1 * 

FORMSl^TR 3 GETSCHASCHSPTR; 

CALL PUTSCHACGCSPTR,CH); 


FI 

ENDDO 

STSENTRY(STSCHSPTRSINDEX)=FORMSPTR; 

VALUESPTR®SSPTR; 

IF N <> 0 OR NEGSCOUNTSFAI LED THEN DO; VALUESPTR = FSPTR: FI 
IF LOW(SSPTR) THEN DO; /* RETURN SGC IF NO S OR F ARGS */ 

CALL COPYSVALUECGCSPTR,VALUESPTR:=FSSGET); 

FI 

ENDPROCEDURE PFSGC; 

PFSIN! PROCEDURE; 

/* 'INITIAL' S(IN,NAME,SUBSTRING,S,F) SIN SET TO 'VALUE' */ 

/* ADD... IF SUBSTRING IS NULL, THEN LOOK FOR THE NEXT NON-NULL SEGMENT */ 
DECLARE INSPTR ADDRESS, CH BYTE; 

NAMESPTR=NEXTSNS; 

ARGSPTR=NEXTSNS; /* USED BY SSSMATCH */ 

SSPTR=NEXTSNS; 

FSPTR,VALUESPTR=NEXTSNS; 

IF NOT STSFIND(.ATS IN) THEN DO; CALL STSCREATE(.ATS 1N); FI 
CALL STSADDSVALUE(INSPTR:=FSSGET); 

IF NOT STSFIND(NAMESPTR) THEN DO; RETURN; FI 
SSSCHASPTR=STSENTRY(STSCHSPTRSINDEX); 

FIRSTSGETASFLAG® FALSE; 

FIRSTSPUTASFLAG®TRUE; 

IF SSSMATCH THEN DO: 

GETSCHASCHSPTR®SSSCHASPTR; 

DO WHILE GETSCHASCHSPTR <> SSSCHBSPTR: 

IF NOT ROL(CH:=GETSCHA(0),1) THEN DO; CALL PUTSCHAIINSPTR,CH); FI 
ENDDO 

VALUESPTR=SSPTR; 

END: ELSE DO; 

GETSCHASCHSPTR.SSSCHCSPTR=SSSCHASPTR; 

FIRSTSPUTASFLAG=TRUE; 

DO WHILE (CH:=GETSCHACO)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

SSSCHC$PTR=GETSCHASCHSPTR,• 

CALL PUTSCHA(INSPTR, CH); 

ENDDO 


FI 

STSENTRY(STSCHSPTRSINDEX)=SSSCHCSPTR; 

IF LOW(SSPTR) THEN DO: /* RETURN SIN IF NO S OR F ARGS */ 
CALL COPYSVALUE(INSPTR,VALUESPTR:=FS$GET); 

FI 

ENDPROCEDURE PFSIN; 


PFSCR: PROCEDURE; 

/* 'CALL RESTORE' S(CR,NAME) */ 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 

InDPROCEDURE C PFSCR?‘ NDEX ’ =ST$EN tRY ‘STSVALUESINDEX)♦1 ; 



138 


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


Number 23 


01266 1 
01267 2 

01268 2 
01269 2 

01270 2 

01271 2 

01272 2 

01273 2 

01274 2 

01275 3 

01276 3 

01277 4 

01278 4 

01279 3 

01280 4 

01281 4 

01282 3 

01283 2 

01284 1 

01285 1 

01286 2 
01287 2 

01288 2 
01289 2 

01290 2 

01291 2 

01292 2 

01293 1 

01294 1 

01295 2 

01296 2 

01297 2 

01298 2 

01299 2 

01300 2 

01301 2 

01302 3 

01303 4 

01304 3 

01305 2 

01306 1 

01307 1 

01308 2 

01309 2 

01310 2 

01311 2 

01312 2 

01313 2 

01314 2 

01315 2 

01316 2 

01317 2 

01318 2 

01319 £*" 

01320 2 

01321 2 

01322 3 

01323 4 

01324 3 

01325 4 

01326 5 

01327 5 

01328 5 

01329 6 

01330 5 

01331 4 

01332 3 

01333 2 

01334 1 

01335 1 

01336 2 

01337 2 

01338 2 

01339 2 

01340 2 

01341 1 

01342 1 

01343 2 

01344 2 

01345 2 

01346 2 

01347 2 

01348 3 

01349 3 

01350 3 

01351 2 

01352 1 

01353 1 

01354 2 

01355 2 

01356 2 

01357 1 


Number 23 


PFSEQ: PROCEDURE; 

/* 'EQUAL' $(EQ,A, 6,0, B,C,...,B,C) */ 

/* OR $(EQ,A, B,C, B,C,...,B) */ 

DECLARE 

CARGA,ARGB,ARGC) ADDRESS; 

ARGA=NEXTSNS; 

DO FOREVER; 

IF L0W(ARGB:=NEXT$NS) THEN DO; RETURN; FI 
IF LOWCARGC:=NEXT$NS) THEN DO; 

VALUE$PTR=ARGB; 

RETURN; 

END; ELSE IF STRINGSEQUALITY(ARGA,ARGB) THEN DO; 

VALUESPTR=ARGC; 

RETURN; 

FI 

ENDDO 

ENDPROCEDURE PFSEQ; 

PFSGE! PROCEDURE; 

/* 'GREATER THAN OR EQUAL TO' $(GE,N,M,S,F) */ 

/* '+8000H' IS TO MAP SIGNED HALF-RANGE ONTO FULL-RANGE INTEGERS */ 

IF STRINGSTOSBI NARY(NEXTSNS)+8000H >= STR1NGSTOSBI NARY(NEXTSNS) +8000H 
THEN DO; VALUESPTR^NEXTSNS; RETURN; FI 
VALUE$PTR=NEXTSNS; 

VALUE$PTR=NEXTSNS: 

ENDPROCEDURE PFSGE; 

PFSNT: PROCEDURE; 

/* 'NULL TEST' S(NT,NAME,S,F) */ 

NAMESPTR=NEXTSNS AND PTRSMASK; 

SSPTR,VALUESPTR=NEXTSNS; 

FSPTR=NEXTSNS; 

IF STSFIND(NAMESPTR) THEN DO; 

IF NOT NULL$TEST(STSENTRY(STSVALUESINDEX)) THEN DO; 

- VALUESPTR = FSPTR; 

FI 

FI 

ENDPROCEDURE PFSNT; 

PFSCL: PROCEDURE(STACKSOFFSET); 

/* 'CALL' S(CL,NAME,ARG,ARG,...) OR S(NAME,ARG,ARG,...) */ 

DECLARE 

STACKSOFFSET BYTE, /* 0 IF FIRST ARG IS 'CL' -1 OTHERWISE */ 
LASTSARGSNUMBER BYTE. /* ARG(1ARG(LASTSARGSNUMBER) */ 

(CH,CHB,SEGSNUMBER) BYTE; 

LASTSARG$NUMBER=NUMBER$OFSARGS-STACKSOFFSET-2; 

NSSSTACKSINDEX=NSSSTACKSINDEX+STACKSOFFSET; 

IF NOT STSFIND(NEXTSNS AND PTRSMASK) THEN DO; RETURN; FI 
VALUESPTR= FSSGET; 

FIRSTSGETASFLAG,FIRSTSPUTASFLAG=TRUE; 

TEMPSPTR=STSENTRY(STSVALUESINDEX); 

DO WHILE (CH:=GETSCHA(TEMPSPTR)) <> NIL; 

IF NOT ROL(CH,1) THEN DO; 

CALL PUTSCHA(VALUESPTR.CH); 

END; ELSE IF R0L(CH,2) THEN DO; 

IF (SEGSNUMBER:=(CH XOR SS$MASK)+1) <= LASTSARGSNUMBER THEN DO; 
TEMPSPTR=NS$STACK(NSSSTACKSINDEX+SEGSNUMBER); 

FIRST$GETB$FLAG=TRUE; 

DO WHILE (CHB:=GETSCHB(TEMPSPTR)) <> NIL; 

IF NOT ROL(CHB,1) THEN DO; CALL PUTSCHA(VALUESPTR,CHB); FI 
ENDDO 
FI 
FI 

ENDDO 

ENDPROCEDURE PFSCL; 

PFSEX: PROCEDURE: 

/* 'EXIT' S(EX,DO-THIS) */ 

VALUESPTR=NEXTSNS; 

NOSEXSVALUE=NULL$TEST(VALUESPTR); 

GO TO START; 

ENDPROCEDURE PFSEX; 

PFSPS: PROCEDURE; 

/* 'PRINT STRING' $(PS,ARG,ARG,...) */ 

DECLARE NOTSFIRST BYTE; 

NOTSF1RST = FALSE; 

DO NEXTSARG; 

IF NOTSFIRST THEN DO; CALL CRLF; FI 
NOTSFIRST = TRUE; 

CALL PRINTSSTRING(ARGSPTR); 

ENDDO 

ENDPROCEDURE PFSPS; 

PFSFW: PROCEDURE; 

/* 'FORM WIDTH $(FW,CH-PER-LINE) */ 

C0NSW1DTH = STRINGSTOSBI NARY(NEXTSNS); 

ENDPROCEDURE PFSFW; 



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


01358 1 

01359 2 

01360 2 

01361 2 

01362 2 

01363 2 

01364 2 

01365 2 

01366 3 

01367 3 

01368 4 

01369 4 

01370 5 

01371 5 

01372 5 

01373 4 

01374 3 

01375 3 

01376 3 

01377 2 

01378 2 

01379 2 

01380 2 

01381 2 

01382 3 

01383 4 

01384 3 

01385 3 

01386 3 

01387 3 

01388 3 

01389 4 

01390 3 

01391 2 

01392 3 

01393 3 

01394 4 

01395 4 

01396 4 

01397 4 

01398 5 

01399 4 

01400 5 

01401 4 

01402 3 

01403 2 

01404 1 

01405 1 

01406 2 

01407 2 

01408 2 

01409 2 

01410 2 

01411 2 

01412 2 

01413 2 

01414 2 

01415 2 

01416 3 

01417 3 

01418 3 

01419 3 

01420 2 

01421 1 

01422 1 

01423 2 

01424 2 

01425 2 

01426 2 

01427 2 

01428 2 

01429 2 

01430 2 

01431 3 

01432 3 

01433 2 

01434 1 

01435 1 

01436 2 

01437 2 

01438 2 


PF$RS: PROCEDURE; 

/* 'READ STRING' SCRS.PROMPT) */ 

/* INPUT FROM CONSOLE OR DISK */ 

DECLARE 

(K.CH) BYTE, 

NOTSCOMMENT BYTE; 

NEXTSCHAR: PROCEDURE; 

IF TBUFFSINDEX = 128 THEN DO; 

TBUFFSINDEX=0; 

IF M0N2( 20, .TFCB) <> 0 THEN DO; 

CALL PRINT$MESS(.'DISK EOF $'); 
CH=END$OF$FILE; 

RETURN; 

FI 


FI 

CH = TBUFF(TBUFFSINDEX); 

TBUFFSINDEX=TBUFFSINDEX+1; 

ENDPROCEDURE NEXTSCHAR; 

VALUESPTR=FS$GET; 

FIRSTSPUTASFLAG=TRUE; 

IF CONS IN THEN DO; 

IF NOT LOWCARGSPTR:=NEXTSNS) THEN DO; 

CALL PRINTSSTRINGCARGSPTR); 

FI 

CALL MON1(10,.CONBUF); 

CALL CRLF; 

K= 1 ; 

DO WHILE K <= CONBUF Cl); 

CALL PUTSCHACVALUESPTR,CONBUF(K:= K+1)); 

ENDDO 

END: ELSE DO; /* DISK INPUT. */ 

NOTSCOMMENT=TRUE; 

DO FOREVER; 

CALL NEXTSCHAR; 

IF CH = METASCHAR THEN DO; RETURN; FI 

IF CH = ENDSOFSFILE THEN DO; C0NS1N=TRUE; RETURN; FI 

IF CH = COMMSDELIM THEN DO: 

NOTSCOMMENT = NOT NOTSCOMMENT; 

END; ELSE IF CH >= ' ' AND NOTSCOMMENT THEN DO; 

CALL PUTSCHACVALUESPTR,CH); 

ENDDO 



FI 

ENDPROCEDURE PFSRS; 

PFSPK: PROCEDURE; 

/* 'PACK' HEX-TO-ASCII $(PK,HEX-STRING) #/ 

/* ALSO CALLED FROM PFSRO */ 

DECLARE (CHA,CHB) BYTE; 

VALUESPTRaFSSGET; 

TEMPSPTR=NEXT$NS; 

FIRSTSGETASFLAG,FIRSTSPUTASFLAG^TRUE; 

DO FOREVER; 

/* NOTE: ASSUMES NO 8-BIT CHARACTERS OTHER THAN NIL */ 
CHA*GETSCHA(TEMPSPTR) ; 

CHB=GET$CHACO); 

IF CHA = NIL OR CHB = NIL THEN DO: RETURN; FI 

CALL PUTSCHA(VALUESPTR,SHL(CHSTOSHEX(CHA) , 4) OR CHSTOSHEX(CHB)) 
ENDDO 

ENDPROCEDURE PFSPK; 

PFSUK: PROCEDURE; 

/* 'UNPACK' ASCI I-TO-HEX S(UK,CH-STRING) «/ 

DECLARE CH BYTE; 

IF LOWCARGSPTR:=NEXTSNS) THEN DO; RETURN; FI 
FIRSTSGETASFLAG,FIRSTSPUTASFLAG=TRUE; 

VALUESPTR=FSSGET; 

DO WHILE (CH:=GETSCHA(ARGSPTR)) <> NIL: 

CALL PUTSCHA(VALUESPTR,HEXSTOSCH(ROL(CH,4) AND OFH)); 

CALL PUTSCHA(0,HEXSTOSCH(CH AND OFH)); 

ENDDO 

ENDPROCEDURE PFSUK; 

PFSSO: PROCEDURE; 

/* 'SEND TO OCTOPUS' SCSO,MESSAGE) «/ 

CALL SENDSSTRING(NEXTSNS AND PTRSMASK); 

ENDPROCEDURE PFSSO; 



Page 38 


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


01439 1 

01440 1 

01441 2 

01442 2 

01443 2 

01444 2 

01445 2 

01446 2 

01447 2 

01448 2 

01449 2 

01450 2 

01451 2 

01452 2 

01453 2 

01454 3 

01455 2 

01456 2 

01457 2 

01458 2 

01459 3 

01460 3 

01461 2 

01462 3 

01463 3 

01464 2 

01465 1 

01466 1 

01467 2 

01468 2 

01469 2 

01470 3 

01471 2 

01472 1 

01473 1 

01474 2 

01475 2 

01476 2 

01477 2 

01478 2 

01479 2 

01480 2 

01481 3 

01482 2 

01483 2 

01484 1 

01485 1 

01486 2 

01487 2 

01488 2 

01489 2 

01490 2 

01491 2 

01492 2 

01493 1 

01494 1 

01495 2 

01496 2 

01497 2 

01498 2 

01499 2 

01500 2 

01501 2 

01502 3 

01503 2 

01504 2 

01505 1 

01506 1 

01507 2 

01508 2 

01509 2 

01510 2 

01511 2 

01512 2 

01513 2 

01514 1 

01515 1 

01516 2 

01517 2 

01518 2 

01519 2 

01520 1 


Number 23 


PFSRO: PROCEDURE: 

/* 'RECEIVE FROM OCTOPUS' $CRO,END-SENT INEL,S.F,EOM) */ 

/* VALUESPTR IS SET IN RECEIVESSTRING AND TRANSFERRED TO $R0 */ 
DECLARE ENDSPTR ADDRESS; 

IF NOT STSF1NDC.ATSRO) THEN DO; CALL STSCREATE(.ATSRO); FI 
ENDSPTR=NEXTSNS; 

S$PTR=NEXT$NS; 

FSPTR=NEXT$NS; 

/* SET NEW OCTOPUS MESSAGE TERMINATOR, IF GIVEN */ 

CALL PFSPK: 

FIRSTSGETASFLAG=TRUE; 

IF (I TEMP:=GET$CHA(VALUESPTR)) <> NIL THEN DO; 

OCTO$EOM=I TEMP; 

FI 

CALL FREESCHAIN(VALUESPTR); 

IF RECEIVESSTRING(ENDSPTR) THEN DO; 

CALL STSADDSVALUECVALUESPTR); 

VALUESPTR=S$PTR; 

END; ELSE DO; 

CALL STSADDSVALUE(VALUESPTR); 

VALUESPTR=FSPTR; 

FI 

ENDPROCEDURE PFSRO; 

PFSDD: PROCEDURE: 

/* 'DELETE DEFINITION' S(DD,NAME,NAME,...) */ 

DO NEXTSARG; 

IF STSFIND(ARGSPTR) THEN DO; CALL STSDELETE; FI 
ENDDO 

ENDPROCEDURE PFSDD; 

PFSAD: PROCEDURE; 

/* 'ADD' SCAD,N,N, N, . . . ) */ 

/* ZERO OR MORE NUMERICAL ARGUMENTS */ 

DECLARE SUM ADDRESS; 

SUM=0; 

DO NEXTSARG: 

SUM = SUM+STRINGSTOSBI NARY(ARGSPTR); 

ENDDO 

CALL BINARYSTOSSTRING(SUM); 

ENDPROCEDURE PFSAD; 

PFSSU: PROCEDURE; 

/* 'SUBTRACT' S(SU,N,M) */ 

/* MUST HAVE EXACTELY TWO NUMERICAL ARGUMENTS */ 

CALL BINARYSTOSSTRINGC 

STRINGSTOSBI NARY(NEXTSNS)- 
STRINGSTOSBI NARY C NEXTSNS)); 

ENDPROCEDURE PFSSU; 

PFSML: PROCEDURE; 

/* 'MULTIPLY' SCML.N.N.N,...) */ 

/* ZERO OR MORE NUMERICAL ARGUMENTS */ 

DECLARE PRODUCT ADDRESS; 

PRODUCTSi■ 

DO NEXTSARG: 

PRODUCT“PRODUCT*STRINGSTOSBI NARY(ARGSPTR); 

ENDDO 

CALL BINARYSTOSSTRINGC PRODUCT); 

ENDPROCEDURE PFSML; 

PFSMD: PROCEDURE: 

/* 'MOD' $CMD,N,M) */ 

/* MUST HAVE EXACTELY TWO NUMERICAL ARGUMENTS */ 

CALL BINARYSTOSSTRINGC 

STRINGSTOSBI NARY(NEXTSNS) MOD 
STRINGSTOSBI NARY(NEXTSNS)); 

ENDPROCEDURE PFSMD; 

PFSZZ: PROCEDURE; 

/* 'SLEEP' SCZZ.TENTH SEC) */ 

DECLARE N ADDRESS; 

CALL WAITSTENTHCSTRINGSTOSBI NARY(NEXTSNS)); 

ENDPROCEDURE PFSZZ; 





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



Page 39 


141 


01521 1 PFSIO: PROCEDURE; 

01522 2 /* 'INPUT-OUTPUT' PARAMETERS S(10,'0'OCTO,'T'TIMEOUT,'M'META) */ 

01523 2 DECLARE CH BYTE; 

01524 2 

01525 2 DO NEXTSARG: 

01526 2 FIRST$GETA$FLAG=TRUE; 

01527 3 IF (CH:=GET$CHA(ARGSPTR)) = LIT$0 THEN DO; /* 0: SET OCTO CHANNEL */ 

01528 3 OCTOSCHANNELSA=(GETSCHA(0) = LITSA); 

01529 4 END; ELSE IF CH = LITST THEN DO; /* T: SET OCTO TIMEOUT */ 

01530 3 OCTOSTIMEOUT = STRINGSTOSBI NARY(ARGSPTR); 

01531 4 END; ELSE IF CH = LITSM THEN DO; /* M: SET META-CHARACTER */ 

01532 3 META$CHAR=GET$CHAC0); 

01533 4 END; ELSE IF CH = LITSP THEN DO; /* P: SET PRINT VIA CP/M */ 

01534 3 CPMSPRINT$FLAG=TRUE; 

01535 4 END; ELSE IF CH = LITSO THEN DO; /* D: SET PRINT DIRECT (HARDWARE) */ 

01536 3 CPMSPRINT$FLAG=FALSE; 

01537 4 FI 

01538 3 ENDDO 

01539 2 ENDPROCEDURE PFSIO; 

01540 1 

01541 1 PFSDV: PROCEDURE; 

01542 2 /* 'DIVIDE' S(DV,N,M) */ 

01543 2 /* MUST HAVE EXACTLY TWO NUMERICAL ARGUMENTS */ 

01544 2 

01545 2 CALL BINARYSTOSSTRING( 

01546 2 STRINGSTOSBI NARY(NEXTSNS)/ 

01547 2 STRINGSTOSBI NARY(NEXTSNS)); 

01548 2 ENDPROCEDURE PFSDV; 

01549 1 

01550 1 PFSNB: PROCEDURE; 

01551 2 /* 'NUMBER OF (FREE STORAGE) BLOCKS' $(NB) */ 

01552 2 DECLARE 

01553 2 (BLOCK BASED TEMPSPTR,N) ADDRESS; 

01554 2 

01555 2 TEMP$PTR=FS$FIRSTSPTR; 

01556 2 N=0; 

01557 2 DO WHILE HIGH(TEMPSPTR) > 0; 

01558 2 N=N+1; 

01559 3 TEMP$PTR=BLOCK; 

01560 3 ENDDO 

01561 2 CALL BINARYSTOSSTRING(N); 

01562 2 ENDPROCEDURE PFSNB; 

01563 1 

01564 1 PFSFS: PROCEDURE; 

01565 2 /* 'FREE STORAGE' S(FS,FIRST ADDRESS,LAST ADDRESS) */ 

01566 2 CALL FSSINIT(STRINGSTOSBI NARY(NEXTSNS),STRINGSTOSBI NARY(NEXTSNS)); 

01567 2 ENDPROCEDURE PFSFS; 

01568 1 

01569 1 PFSVN: PROCEDURE; 

01570 2 /* 'VERSION NUMBER' $(VN) */ 

01571 2 VALUESPTR = FSSGET j 

01572 2 FIRSTSPUTASFLAG=TRUE; 

01573 2 CALL PUTSCHA(VALUESPTR,'3'); 

01574 2 CALL PUTSCHA(0,'1'); 

01575 2 CALL PUTSCHA(0,LITSA); 

01576 2 ENDPROCEDURE PFSVN; 

01577 1 

01578 1 

01579 1 



Pa 9 e 40 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 23 

142 



k 


w 


01580 1 

01581 1 

01582 1 

01583 1 

01584 1 

01585 2 

01586 2 

01587 2 

01588 2 

01589 2 

01590 2 

01591 2 

01592 2 

01593 3 

01594 4 

01595 4 

01596 3 

01597 4 

01598 3 

01599 4 

01600 4 

01601 4 

01602 3 

01603 2 

01604 2 

01605 1 

01606 1 
01607 2 

01608 2 
01609 2 

01610 2 
01611 2 
01612 2 
01613 1 

01614 1 

01615 2 

01616 2 
01617 2 

01618 1 
01619 1 

01620 2 
01621 2 
01622 2 
01623 2 

01624 2 

01625 2 

01626 3 

01627 2 

01628 1 
01629 1 

01630 2 

01631 2 

01632 2 

01633 2 

01634 2 

01635 2 

01636 3 

01637 2 

01638 1 

01639 1 

01640 2 

01641 2 

01642 2 

01643 2 

01644 3 

01645 2 

01646 1 

01647 1 

01648 2 

01649 2 

01650 2 

01651 1 

01652 1 

01653 2 

01654 2 

01655 2 

01656 2 

01657 3 

01658 3 

01659 3 

01660 3 

01661 4 

01662 4 

01663 4 

01664 3 

01665 2 

01666 2 
01667 2 

01668 2 
01669 2 

01670 2 

01671 3 

01672 2 


/*** DISK I/O FUNCTIONS ***/ 

/* SEE 'BASIC I/O' ON PAGE 2 FOR GLOBALS */ 

SETSFILESNAME: PROCEDURE!FILESNAMESPTR); 

/* EXPAND D : X . Y FORMAT TO ELEVEN CHAR FILE NAME AND SELECT DRIVE */ 
DECLARE FILESNAMESPTR ADDRESS, (I,CH,DRIVE) BYTE; 

TFCB(0)= 0; 

FOR 1=1 TO 11: TFCB CI ) =' '; ENDFOR 
I,DRIVE=0; FIRST$GETA$FLAG=TRUE; 

DO WHILE tI<11) AND ((CH:=GET$CHA(FILESNAMESPTR)) <> NIL); 

IF CH = ':' THEN DO; 

TFCB(0)=DRIVE; 

1=0; 

END; ELSE IF CH = THEN DO; 

I =8; 

END; ELSE DO; 

i = I+1 ; 

TFCB(I)=UPPERSCASE!CH); 

DRIVE=CH; 

FI 

ENDDO 

CALL SELECTSDRIVE; 

ENDPROCEDURE SETSFILESNAME; 

SETSFILE$RECORD: PROCEDURECRECORDSNO); 

/* SET EXTENT AND NR FIELDS IN TFCB */ 

DECLARE RECORDSNO ADDRESS; 

TFCB!12)=SHR(RECORDSNO,7); 

TFCB(32)=RECORDSNO AND 7FH; /* SEE 'RANDOM ACCESS' IN CP/M MANUAL */ 
ENDPROCEDURE SETSFILESRECORD; 

PFSRN: PROCEDURE; 

/* 'RECORD NUMBER' $(RN) */ 

CALL BINARYSTOSSTRING(SHL!TFCB!12),7) OR TFCB<32)); 

ENDPROCEDURE PFSRN; 

PFSOF: PROCEDURE; 

/* 'OPEN FILE' S(OF,FILE-NAME,NEXT-RECORD-NUMBER,S,F) */ 

CALL SETSFILESNAME(NEXTSNS); 

CALL SETSFILESRECORD(STRINGSTOSBI NARY(NEXTSNS)); 

VALUESPTR=NEXTSNS; 

IF M0N2(15,.TFCB) = 255 THEN DO; /* OPEN AND TEST FOR ERROR */ 
VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSOF; 

PFSMF: PROCEDURE; 

/* 'MAKE FILE' $(MF,FILE-NAME,S,F) */ 

CALL SETSFILESNAME(NEXTSNS); 

CALL SETSFILESRECORD!0); 

VALUESPTR 3 NEXTSNS; 

IF M0N2(22,,TFCB) = 255 THEN DO; 

VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSMF; 

PFSCF: PROCEDURE; 

/« 'CLOSE FILE' S(CF,S,F) */ 

VALUESPTR=NEXT*NS; 

IF M0N2!16,,TFCB) = 255 THEN DO; 

VALUESPTR=NEXTSNS; 

FI 

ENDPROCEDURE PFSCF; 

PFSDF: PROCEDURE; 

/* 'DESTROY FILE' S(DF) */ 

CALL M0N1(19,.TFCB); 

ENDPROCEDURE; 

PFSWF: PROCEDURE; 

/* 'WRITE FILE' S(WF,SOURCE-NAME,PAD-CH EMPTY FLAG,S,F) */ 

DECLARE (CH,I,WRITESSTATUS) BYTE; 

STUFFSCH: PROCEDURE; 

IF WRITESSTATUS <> 0 THEN DO; RETURN; FI 
TBUFF(TBUFFSINDEX)= CH; 

IF (TBUFFSINDEX:=TBUFFSINDEX+1) = 128 THEN DO; 

WRITESSTATUS=M0N2C21,.TFCB); 

TBUFFSINDEX=0; 

STSENTRY(STSCHSPTRSINDEX)=GETSCHASCHSPTR; /* SET FORM PTR */ 

FI 

ENDPROCEDURE STUFFSCH; 

WRITESSTATUS.TBUFFSINDEX=0: 

IF NOT STSFIND(NEXTSNS) THEN DO; RETURN; FI 
GET$CHA$CHSPTR = STSENTRY CSTSVALUESINDEX)+1; 

DO WHILE (CH:=GETSCHA(0)) <> NIL; 

CALL STUFFSCH; 

ENDDO 



Number 23 


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


Page 41 

143 


01673 2 

01674 2 

01675 2 

01676 3 

01677 2 

01678 2 

01679 2 

01680 1 
01681 1 
01682 2 
01683 2 

01684 2 

01685 2 

01686 2 
01687 3 

01688 3 

01669 2 

01690 2 

01691 2 

01692 2 

01693 2 

01694 3 

01695 3 

01696 4 

01697 4 

01698 3 

01699 3 

01700 3 

01701 3 

01702 3 

01703 4 

01704 3 

01705 2 

01706 1 

01707 1 

01708 2 

01709 2 

01710 2 

01711 2 

01712 2 

01713 2 

01714 2 

01715 1 

01716 1 


FIRSTSGETBSFLAG=TRUE; 

IF (CH:=GET$CHB(NEXTSNS AND PTR$MASK)) <> NIL THEN DO: 

F[ FOR 1=0 TO 127; CALL STUFFSCH; ENDFOR /* GUARANTEE A WRITE WITH PAD CH */ 
VALUESPTR=NEXTSNS; 

IF WRITESSTATUS <> 0 THEN DO; VALUESPTR=NEXTSNS; FI 
ENDPROCEDURE PFSWF; 

PFSRF: PROCEDURE; 

/* 'READ FILE' S (RF,SINK-NAME,RECORD-COUNTjS,F) (F=EOF) */ 

DECLARE RC ADDRESS; 

IF NOT STSFIND(ARGSPTR:=NEXT$NS) THEN DO; 

CALL STSCREATEtARGSPTR): 

CALL STSADDSVALUE(FSSGET); 

FI 

RC = STRINGSTOSBI NARY(NEXTSNS); 

VALUESPTR=NEXTSNS; 

DO WHILE RC > 0; 

RC = RC"1 * 

IF M0N2C20,,TFCB) <> 0 THEN DO; 

VALUESPTR=NEXTSNS; 

RETURN; 

FI 

PUTSCHA$CH$PTR = APPEND$CH(TBUFF,STSENTRY(STSVALUES INDEX)) ; 

PUTSCHASCURRENTSBLOCKSPTR=PUTSCHASCHSPTR AND PTRSMASK; 

FIRSTSPUT ASFLAG = FALSE; 

FOR TBUFFSINDEX=1 TO 127; 

CALL PUTSCHA(0,TBUFF(TBUFFSINDEX)); 

ENDFOR 

ENDDO 

ENDPROCEDURE PFSRF; 

PFSRD: PROCEDURE; 

/* 'READ DIALECT' $(RD) */ 

/* EACH RD WILL GO TO THE NEXT META CHARACTER - */ 

/* OK IF NO INTERVENING MF OR OF. */ 

CONS IN = FALSE; 

TBUFFSINDEX=128; 

CALL PFSRS; 

ENDPROCEDURE PFSRD; 



Page 42 

144 


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


Number 23 


/*** PROCESS FUNCTION CALL ***/ 


01717 1 

01718 1 

01719 1 

01720 2 

01721 2 

01722 2 

01723 2 

01724 2 

01725 2 

01726 2 

01727 2 

01728 3 

01729 3 

01730 3 

01731 3 

01732 3 

01733 3 

01734 3 

01735 3 

01736 3 

01737 3 

01738 3 

01739 3 

01740 3 

01741 3 

01742 3 

01743 3 

01744 3 

01745 3 

01746 3 

01747 3 

01748 3 

01749 3 

01750 3 

01751 3 

01752 3 

01753 3 

01754 3 

01755 3 

01756 3 

01757 3 

01758 3 

01759 3 

01760 3 

01761 3 

01762 3 

01763 3 

01764 3 

01765 3 

01766 3 

01767 3 

01768 3 

01769 3 

01770 3 

01771 3 

01772 3 

01773 3 

01774 3 

01775 3 

01776 3 

01777 4 

01778 3 

01779 3 

01780 2 

01781 2 

01782 2 

01783 2 

01784 3 

01785 2 

01786 2 


PROCESSSENDSFUNCTI0N: PROCEDURE; 

DECLARE 

NAMESPTR ADDRESS, 

NAME BASED NAMESPTR ADDRESS, /* HOLDS THE FIRST TWO CHARS OF NAME */ 
NAMESCH BASED NAMESPTR BYTE, 

(BLOCKSPTR,BLOCK BASED BLOCKSPTR) ADDRESS, 

(CH,FIRSTSCH,SECONDSCH) BYTE; 


PFSINDEX: FUNCTION(CHCH) BYTE: 

/* INDEX OF THE PRIMITIVE FUNCTION WHOSE TWO CHAR NAME IS CHCH */ 
/* NOTE... NAME LIST HAS SECOND CHARACTER FIRST, LIKE ADDRESS */ 
DECLARE 
CHCH ADDRESS, 

I BYTE, 

PFSLI ST(40) ADDRESS INITIAL! /* ORDERED BY FREQUENCY */ 

736EH, /* NS */ 

7165H, /* EQ */ 

6E69H, /* IN */ 

746EH, /* NT */ 

6567H, /* GE */ 


7263H, /* CR */ 
6367H, /* GC */ 
7373H, /* SS */ 
6B70H, /* PK */ 
6461H, /* AD */ 
7361H, /* AS */ 
6464H, /* DD */ 
7573H, /* SU */ 
6C6DH, /* ML */ 
7664H, /* DV */ 
6672H, /* RF */ 
6677H, /* WF */ 
666FH, /* OF */ 
6663H, /* CF */ 
6E72H, /* RN */ 
666DH, /* MF */ 
6664H, /* DF */ 
6472H, /* RD */ 
646DH, /* MD */ 
6B75H, /* UK */ 
7370H, /* PS */ 
6F73H, /* SO */ 
6F72H, /* RO */ 
6F69H, /* 10 */ 
7865H, /* EX */ 
626EH, /* NB */ 
6E74H, /* TN */ 
6674H, /* TF */ 
7766H, /* FW */ 
6E76H, /* VN */ 
6C63H, /* CL */ 
7372H, /* RS */ 
7A7AH, /* ZZ */ 
7366H. /* FS */ 
7473H); /* ST */ 



FOR 1=0 TO LAST(PFSLIST); 

IF CHCH = PFSLISTCI) THEN DO; RETURN I; FI 
ENDFOR; 

RETURN LENGTH(PFSLI ST); /* NO MATCH */ 
ENDFUNCTION PFSINDEX; 


NSSSTACK(NSSSTACKSINDEX*1)“NULLSSTRINGSPTR OR NSSNULLSBEGINSEND; 

DO WHILE NOT NSSFUNSMARKER; /* FIND THE BEGINNING OF THE CURRENT FUNCTION*/ 
NSSSTACKSINDEX=NSSSTACKSINDEX-1; 

ENDDO; 




Number 23 


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


Page 43 

145 



01787 2 

01788 2 

01789 3 

01790 2 

01791 3 

01792 3 

01793 3 

01794 3 

01795 3 

01796 3 

01797 3 

01798 3 

01799 3 

01800 3 

01801 3 

01802 3 

01803 4 

01804 3 

01805 4 

01806 5 

01807 5 

01808 5 

01809 5 

01810 5 

01811 5 

01812 5 

01813 5 

01814 5 

01815 5 

01816 5 

01817 5 

01818 5 

01819 5 

01820 5 

01821 5 

01822 5 

01823 5 

01824 5 

01825 5 

01826 5 

01827 5 

01828 5 

01829 5 

01830 5 

01831 5 

01832 5 

01833 5 

01834 5 

01835 5 

01836 5 

01837 5 

01838 5 

01839 5 

01840 5 

01841 5 

01842 5 

01843 5 

01844 5 

01845 5 

01846 5 

01847 4 

01848 3 

01849 3 

01850 3 

01851 3 

01852 3 

01853 3 

01854 3 

01855 3 

01856 4 

01857 5 

01858 4 

01859 4 

01860 4 

01861 3 

01862 3 

01863 3 

01864 3 

01865 4 

01866 3 

01867 4 

01868 3 


IF NSSLIMlTSMARKER THEN DO; /* NO 'BEGIN' FOR THIS 'END' */ 

GO TO START ; 

“ H ° SE NA " E 15 * T "S.ST.CK..NDEX •/ 

IF TRACESFLAG THEN DO: CALL TRACESPRINT; FI 

/* NAME IS TAKEN FROM THE FIRST TWO BYTES */ 

/* OF THE FIRST ARGUMENT, REGARDLESS OF THE CONTENTS */ 
NAMESPTR=NSSSTACK(NSSSTAfcKSINDEX) AND PTRSMASK; 

VALUE$PTR=NULLSSTRINGSPTR: 

/* TEST FOR TWO CHAR FUNCTION NAME AND FIRST CHAR A-Z */ 

FIRST$CH=NAMESCH(2): SECONDSCH = NAMESCH(3); 

IF SECONDSCH = NIL OR NAMESCH(4) <> NIL OR 

FIRSTSCH < LITSA OR FIRSTSCH > LITSZ THEN DO; /* NOT A PF */ 
CALL PFSCL(- 1); 

END: ELSE DO: 

SELECT PFSINDEX!NAME(1)) OF 
CALL PFSNS; 

CALL PFSEQ; 

CALL PFSIN; 

CALL PFSNT; 

CALL PFSGE; 

CALL PFSCR; 

CALL PFSGC; V s 

CALL PFSSS; - 

CALL PFSPK; 

CALL PFSAD; > N. 

CALL PFSAS; -> _ _ ) 

CALL PFSDD; 

CALL PFSSU; \ --- -7 /- 

CALL PFSML; ^ 

CALL PFSDV; 

CALL PFSRF; 

CALL PFSWF; 

CALL PFSOF; 

CALL PFSCF; 

CALL PFSRN; 

CALL PFSMF; --5\ 

CALL PFSDF; v \ 

CALL PFSRD; 

CALL PFSMD; ) 

CALL PFSUK; _ m y 

CALL PFSPS; /V ^-- 

CALL PFSSO; \^y - ^ 

CALL PFSRO; ^ 

CALL PFS10; 

CALL PFSEX; 

CALL PFSNB; 

CALL TURNSTRACESON: 

CALL TURNSTRACESOFF; 

CALL PFSFW; 

CALL PFSVN; 

CALL PFSCL(0) ; 

CALL PFSRS; 

CALL PFSZZ; 

CALL PFSFS; 

BEGIN PRELOADED=TRUE; EXIT; END; /* ST */ 

CALL PFSCL!-1); /* NO MATCH, ASSUME 'CL' */ 

ENDSELECT 

FI 

VALUESPTR=VALUESPTR AND PTRSMASK; 

/* RELEASE ARGUMENTS FOR THE FUNCTION WHICH WAS JUST DONE */ 

/* AND LEAVE NULL PTR + NS-END FLAGS IN PLACE OF THESE ARGS */ 

/* BUT DON'T RELEASE AN ARG IF IT IS THE VALUE */ 

NSSSTACKSINDEX = NSSSAVES INDEX; 

DO WHILE NOT NSSLIMITSMARKER; 

IF VALUESPTR <> (ARGSPTR:=NSSSTACK(NSSSTACKSINDEX)) THEN DO; 

CALL FREESCHAIN(ARGSPTR); 

FI 

NSSSTACK(NSSSTACKSINDEX)=NULL$STRINGSPTR OR NSSNULLSBEGINSEND; 
NSSSTACKSINDEX=NSSSTACKSINDEX+1; 

ENDDO 


/* SEE IF THIS ASSBLOCK CAN BE RELEASED */ 

IF (LOW(ASSCHSPTR) AND NOTSPTRSMASK) = 0 THEN DO; 

CALL ASSFREESBLOCK; 

END; ELSE IF (ASSCH = NIL) AND (HIGH(ASSBLOCK) > 0) THEN DO; 

CALL ASSFREESBLOCK; 

FI 



Page 44 

146 


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


Number 23 




01869 3 

01870 3 

01871 3 

01872 3 

01873 3 

01874 4 

01875 3 

01876 4 

01877 5 

01878 5 

01879 6 

01880 5 

01881 5 

01882 5 

01883 5 

01884 4 

01885 5 

01886 5 

01887 6 

01888 5 

01889 5 

01890 4 

01891 3 

01892 2 

01893 1 

01894 1 

01895 1 

01896 1 

01897 1 

01898 1 

01899 1 

01900 2 

01901 2 

01902 2 

01903 2 

01904 2 

01905 2 

01906 3 

01907 2 

01908 1 

01909 1 

01910 2 

01911 2 

01912 1 

01913 1 

01914 1 

01915 2 

01916 2 

01917 2 

01918 2 

01919 2 

01920 2 

01921 3 

01922 2 

01923 2 

01924 2 

01925 2 

01926 2 

01927 2 

01928 3 

01929 2 

01930 2 

01931 2 

01932 3 

01933 3 

01934 4 

01935 4 

01936 4 

01937 3 

01938 2 

01939 1 

01940 2 


/* PROCESS THE VALUE CHAIN */ 

NSSSTACKSINDEX = NSSSAVESINDEX-1; 

NS$ARG$BREAK=TRUE; 

IF VALUE$CH( 2) = NIL THEN DO: 

CALL FREESCHAIN(VALUESPTR); 

END: ELSE DO: 

IF NSSACTIVESFLAG>0 THEN DO; /*LINK VALUE CHAIN TO HEAD OF ACTIVE*/ 
BLOCKSPTR=VALUESPTR: 

DO WHILE HIGH(BLOCK) > 0; /* FIND END OF VALUE CHAIN */ 

BLOCK$PTR=BLOCK; 

ENDDO 

BLOCK=AS$BLOCK$PTR; 

AS$BLOCKSPTR=VALUESPTR; 

ASSCHSPTR=AS$BL0CK$PTR+2; 

END: ELSE DO: /* ADD VALUE TO END OF CURRENT (NEUTRAL) ARGUMENT */ 
FIRST$GETA$FLAG=TRUE: 

DO WHILE (CH:=GET$CHA(VALUESPTR)) <> NIL; 

CALL NSSADDSCH(CH); 

ENDDO 

CALL FREESCHAIN(VALUESPTR); 

FI 

FI 

FI 

ENDPROCEDURE PROCESSSENDSFUNCTI ON; 


/*** INITIALIZATION AND SCAN LOOP ***/ 

DECLARE CH BYTE; 

PRESETSATIN: PROCEDURE: 

IF NOT STSFIND(.ATS IN) THEN DO; CALL STSCREATE(.ATS IN); FI 
CALL STSADDSVALUE(VALUESPTR:=FSSGET); 

FIRST$PUTASFLAG=TRUE; 

ITEMP=2; 

DO WHILE I TEMP <= TBUFF(O); 

CALL PUTSCHA(VALUESPTR,TBUFF((I TEMP:=ITEMP+1)-1))J 
ENDDO 

ENDPROCEDURE PRESETSATIN; 

PRrQrTtnpiuPQ 1 PRflf'Fni irf ■ 

DEFAULTSDRiVE.PREVIOU&SDRIVE,CURRENTSDRIVE=M0N2(25,0); 

ENDPROCEDURE PRESETSDRIVES; 

IF DEADSSTART THEN DO; 

DEADSSTART=FALSE; 

TRACESFLAG=0; 

ASSBL0CKSPTR=0; 

FSSFIRSTSPTR=0; 

TEMPSPTR=FBASE; 

IF TFCB(17) = 5EH THEN DO; /* 'ACT FILE HH' HH=HEX PAGE NO. BEYOND FS */ 
TEMP$PTR=256*(DOUBLE(SHL(CHSTO$HEX(TFCB(18)),4) OR CHSTOSHEX(TFCB(19)))); 
FI 

CALL FSSINIT(.MEMORY,TEMPSPTR); 

CALL STS I NIT; 

CALL STSREINIT; 

NULLSSTRINGSPTR=FS$GET; 

FOR NSSSTACKSINDEX=1 TO LAST(NSSSTACK); 

NSSSTACK(NSSSTACKS INDEX)=NULLSSTRINGSPTR OR NSSNULLSBEGINSEND; 

ENDFOR 

CALL PRESETSDRIVES; 

IF TFCB(1) <> ' ' THEN DO; /* DISK INPUT */ 

CALL PRESETSATIN: 

IF M0N2(15,.TFCB) <> 255 THEN DO; 

CALL SELECTSDRIVE; 

CONS IN = FALSE; 

TFCB(32)=0; 

FI 

FI 

END; ELSE IF PRELOADED THEN DO; 

PRELOADED = FALSE; 

CALL PRESETSDRIVES; 


01941 2 CALL PRESETSATIN; 

01942 2 CONS IN=TRUE; 

01943 2 FI 

01944 1 

01945 1 CALL ASSNSSINIT; 

01946 1 

01947 1 DO FOREVER; 

01948 1 IF (CH:=ASSNEXTSCH(MOVESPTR)) = LEFTSDELIM THEN DO; 

01949 2 CALL PROCESSSQUOTEDSSTRING; 

01950 3 END; ELSE IF CH = ARGSDELIM THEN DO: 

01951 2 CALL STARTSNEXTSARGUMENT(NSSARGSFLAG); 

01952 3 END; ELSE IF CH = FUNSCH THEN DO; 

01953 2 CALL PROCESSSBEGINSFUNCTI ON; 

01954 3 END: ELSE IF CH = RIGHTSDELIM THEN DO; 

01955 2 CALL PROCESSSENDSFUNCTI ON; 

01956 3 END: ELSE DO: 

01957 2 CALL NSSADDSCH(CH); 

01958 3 FI 

01959 2 ENDDO 

01960 1 EOF 

NO PROGRAM ERRORS 



Number 23 


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


Page 45 

147 



SAM 76 — Additional comments 


Dear Jim: 

I just got around to reading your issue 10, volume 2, and 
was pleased to see the article by Frits Van Der Wateren 
which describes an implementation of Strachey's GPM for the 
6 800. 


The first purpose of this letter is to | | || 

point out to the relatively uninitiated | j GP1 - SAM76 | | 

that the SAM76 language, described in ||_[| 

your first issue of volume 3 has its 

roots in GP1, and that the structure and philosophy are 

virtually identical between the two languages. 


II II The main difference between the two 

II Mimicking || languages is the scope of available 

|J_II resident functions, as well ascertain 

features of SAM76 whuch enable precise 
user definition in the SAM76 language of functions which 
might a Isa be defined in terms of assembly language 
instructions - in other words "exact mimicking capability". 

This feature is important to permit portability or 
transferability of user programs or, as I prefer to call 
them, scripts. Should some user script make use of a 
function not resident in some one else’s SAM76 interpreter, 
it is relatively simple to create a user defined function 
identical in its functioning to the resident function 

originally used- 


II 11 A version of the SAM76 language coded for 

| |SAM76 - 6800 | j the 6800 is in process of development by 

11_LI the "notorious" Wayne Loufbrow youngster; 

it is expected that this version will be 
functionally identical to the 80 80/Z80 implementation, thus 
permitting absolute transferability of user scripts. 


The second purpose of this letter is to 
respond to some queries from users as to 
the problem of formatting user script for 
appearance and legibility, and yet not 
cause these formatting characters to 
become part of the evaluation process. 


| Addendum to | 

| SAM 76 | 

| description |! 

J_1 


Because of the celerity with which you published the 
description of the SAM76 language, I was not able to make 
the appropriate addition which responds to thus problem; 
thus addition is described below, as it will appear in the 
forthcoming "SAM76 language Handbook" • 

The table under the heading "Quoting or Protection" on page 
20 should t>e ammended by the addition of the "IC" warning 
character as illustrated by the excerpt shown below. 


AS 

1 

77 

Argument separator 

QC 

0 

100 

Quote 

single character 

IC 


140 

Ignore 

single character 

The 

following 

specification 

for thu. s warning 


should be concatenated, with scissors and glue, at the end 
of the SAM76 language description just ahead of the birds on 
page 22 of your magazine. 



SIERRA DIGITAL’S PDP8 X8 
CROSS ASSEMBLER SERIES 

News Release Received: 77 Dec 30 

Sierra Digital Systems has announced the addition of four new 
microprocessor cross-assemblers to its X8 cross-assembler series for the 
Digital Equipment Corporation PDP8 mincomputer. The X8 series 
cross-assemblers now cover the Z80, 1802, SC/MP and 8048 micro¬ 
processors in addition to the previous 6502, 6800, 8080, F8 and 2650 
version. 

By using an X8 series cross-assembler, assembly language programs 
are converted into object code which may t>e loaded into a microproces¬ 
sor system, or put into ROM of PROM memory. X8 cross-assemblers 
feature a Universal Assembler Format of common assembler directives 
and techniques. This standardization of features combined with a 
quantity discount schedule makes the series especially attractive to 
users of more than one microprocessor type. New special package offers 
at very substantial discounts are available to Educational Institutions 
for microprocessor course development. 

Sierra Digital's X8 cross-assemblers run in 8K words of memory 
under the OS/8 operating system. The X8 assemblers are written in 
PDP8 assembly language to provide very fast operation and minimum 
memory requirements. Pseudo-ops and runtime options provide for 
conditional assembly and extensive listing control. Generated object 
code may be output in the microprocessor's standard loader format, or 
BNPF for ROM generation. 

Each cross-assembler is priced at $400 and distributed in PDP8 
binary format on paper tape, Dectape, or Dec floppy diskette. Source 
files are also available for an additional $250. Sierra Digital Systems 
is located at 13905 Rancheros Drive, Reno, Nevada 89511, 
(702) 329 -9548. 


II II 

Ignoring 11 

I | next character | j 

II _LI 

circumstances these 
expressions, and be 
deleted in the scanner. 


Oftentimes the user wishes to arrange 
his script for convenient legibility 
using "nulin", "tabs" or other 
characters; this is strictly for 
formatting purposes. Under normal 
characters will be part of the 
returned in the value string unless 


Oie way of achieving this is to place these characters in 
unused arguments of primitives such as the third argument of 
an "os" expression. This could be a problem if at some later 
time the additional unused arguments acquire a purpose. 

Under initialized conditions the . character is used to 

signify that the immediately next ensuing character is to hie 
deleted in the scanner. 


Another bright youngster, Karl Nicholas, 
pointed out to me that expression "k" 
under < sham > on page 23 was 

unnecessarily complicated, and suggested 
the following simplification which after 
being checked out showed the correctness of hiis observation: 

< k > 

%pt,, (l)/%i/!lll/ 


Final 

| | erratum | | 

II_LI 


| | Closing | | 

I | comments | | 

II _LI 


Plaudits and bouquets to your staff wlio 
did a great job of laying out in an 
esthetic and artistic manner the rather 
complicated material you received from 
me- 


I hope that the growing body of users of the SAM76 language 
will contribute algorithms and scripts to your pages, and in 
that manner provide an escape from the "liasic" syndrome- 

Cordially, 

Ancelme Roichel 


148 


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


Number 23 














Dr. Dobbs louRNALof 

COMPUTER 

(Calisthenics f) Orthodontia 

Running Light Without Overbyte 

Number 24 April 1978 Volume 3, Issue 4 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 

List Processing Unravelled: Pointers, Chains, Rings and Trees J. M. Terry 4 


Exit This Reviewer Jef Raskin 19 

DDJ’s Reviewer puts his mouth where his money is 

SOFTWARE 

The Oznaki “Life” Harvey A. Cohen 10 

An interactive version for the Poly 88 

AIK Debugger for the Z-80 Les Hancock 12 

A Line-Oriented PILOT Editor David J. Morgan 22 

ACT: An 8080 Macroprocessor Alex Cecil 27 


Assembly listing ofPL/M version published in previous DDJ 





© David Dameron 1979 










UNIX FOR THE 8080 


Dear Jim, Received: 78 Feb 17 

I’ve been bitten by the bug. The computer bug, that is. Two 
years ago I literally stumbled into a computer for the first 
time. And —BAAM!! Now I own one. And it’s continually 
expanding, taking big bytes out of my wallet. 

I’ve always wanted a computer that would do what the 
11/70’s would do: control everything, and be easy and fun to 
use. Until recently I couldn’t have begun to do that. But after 
a summer with an 11/70 and Bell Lab’s Unix, I might just be 
able to. 

Exactly what I want my IMSAI to do is tough to say, but 
here goes: EVERYTHING. More precisely, I want it to sup¬ 
port several terminals on a time sharing basis, and time share 
with the same benefits Unix provides. The computer should be 
able to perform processes without my supervision, and poll 
many inputs and take actions on its own when required. I plan 
to someday have it running my house, from the toaster to the 
alarm clock to the security devices. Sounds incredible, but 
when completed, it should be fantastic. 

Anyone who has worked on Unix knows sort of what I 
have to do. But for those who don’t, a short explanation. 
Everything the computer has to do will be kept on floppy disk 
and accessible by the computer. The two terminals (soon 
three) will interrupt the computer for input, and when a line is 
complete, it will be put into the process table. When the com¬ 
puter comes to this command, it will load it from the disk, and 
enter it again into the process table to be executed in due 
time. (The terminal is then free to be used again, and can have 
more than one process running under its name at any one 
time.) Each process in the table will be given equal amounts of 
the computer’s time, say 1/10 second apiece. When a process 
is complete, it will jump to a routine and have its name re¬ 
moved from the table. In between processes, the computer will 
poll predefined input ports to see if anything has come up and 
needs to be dealt with, like a burglar, or a process that has 
been ‘sleeping’ for a while and needs to be awakened. Each 
process would have its own stack and storage area for its regis¬ 
ters when another process is being executed. Also included in 
the shell (a Unix word meaning the part of the computer pro¬ 
gram that oversees all of these actions, and regulates time) 
would be such luxuries as piping, terminal to terminal conver¬ 
sation, and the old late night weapons, enable and disable 
(terminals); However, it is important to remember that the 
program will not have any assemblers, editors, or languages in 
it. Everything will be kept on disk and only loaded when 
needed. This allows for great flexibility, as the control for any 
piece of hardware can be loaded on the disk, and not take up 
valuable RAM. 

This version of Unix will give my micro (and yours too!) 
part of the power that minis and macros have, and make it 
much more useful around the house. Aside from the questions 
I’m about to ask, the only major problem will be the organiza¬ 
tion. It will be very easy to get tied up in jumps and loops and 
calls. It will have to be very efficient on both RAM and operat¬ 
ing time (its going to run slow anyway.) If I take my time 
about it and think it through completely before I begin to 
write, it shouldn’t be very difficult. 

There are some problems I can already forsee; 

1) The 8080 has eight interrupts (or restarts) at its disposal. 

I would like more. Anybody know how? 

2) In order to conserve RAM, each program on disk will 
have to be entirely relocatable. The best method I have 
thought of yet is to insert before each addressing com¬ 
mand one of the unused hex bytes. While loading, when 
the computer comes across this byte, it will adjust the 
following address by the amount the new SA is apart 


from the base SA, and leave out the flagging command 
when it loads it into RAM. If someone has a better idea, 
let me know. 

3) As the operating system stands now, every process will 
be given equal time. Is it worthwhile to set up a priority 
system so that important software can run faster than 
other software? 

4) Should I use the Z80 instead of the 8080? The Z80 
would clear up some relative addressing problems, but 
leaves no unused commands to use as a flag in the relo¬ 
cate operation. Anybody who can convince me in either 
direction wins my thanks. 

5) What should I call it? Unix for the 8080? Trivial question. 

6) And finally, is anybody interested in such a program? 
Anybody want to make a few suggestions? 

In case you’re interested in what kind of system I have, it 
consists of an IMSAI 8080, 32K RAM, IMSAI PIC board 
w/programmable interrupts, IMSAI MIO board, two Poly¬ 
morphic video displays w/keyboards, a Peripheral Vision 
Floppy Disk & interface, a high speed dot matrix printer, 
Cromemco’s analog I/O w/ two joysticks, an optical papertape 
reader, and lots of software (tank game, Star Wars game, HAM 
interface, theatrical lighting control, etc. all of my own 
writing). 

I plan to spend this next summer writing Unix for the 8080 
and associated programs. I’d like to hear from anybody on this 
program, especially anyone from the Delaware area (where I 
live), or the Northwest Connecticut area where I go to school. 

Keep up the good work at DDJ, 

Pierre duPont 
Salisbury School 
Salisbury, CT 06068 

We’re interested in such a program and we’ll be happy to 
publish suggestions and ideas pertinent to your project... 
and maybe you ’ll send us the results. Happy coding! -TRW 



STAR WHA-A-A-T? 

Gentlemen: Received: 78 March 9 

Long, long ago in a galaxy far, far away, there was bom a 
new product line of computers. The company was an estab¬ 
lished retail outlet starting amidst strong competition, but this 
line had an edge over most others: it was prebuilt and tested. 

This company has had its complement of renegades. Unfor¬ 
tunately the renegades occupied the big offices with the long 
titles on the doors. These outcasts secreted away documents 
on a space satellite. What documents you ask? All documents 
on Hardware and Software. Yes friends, it is indeed a crime. 
And what’s worse - the satellite came crashing down to Earth! 
Already the renegades are being hunted down by the DETH 
STAR. (Documentation in Entirety, Truth, 7/onesty), con¬ 
trolled by General Competishun. This Texas based, handy 
dandy radio hut had better get off its AScii before Darth 
Vector points his blinking cursor and erases you. 

Signed, 4730 Cloister Ave. NW 

Jeffrey Greek Canton, Ohio 44709 

O. B. 1 

(Overwrought and befuddled) 


Number 24 


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


Page 3 

151 



POINTERS, CHAINS, RINGS &TREES 



BY J. M. TERRY 

P. 0. Box 3945 
Lubbock, TX 79412 

There is more to learning programming than the memoriza¬ 
tion of instruction sets or statement types. A distinction is 
often made between two different sorts of skill acquisition, 
“horizontal” and “vertical”. For instance, learning BASIC 
as a first language is “vertical”. After that, it takes a “horizon¬ 
tal” effort for the programmer to leam how expressions are 
written in FORTRAN. It takes a different kind of effort 
to leam the use of the ALLOCATE and FREE statements 
in PL/1 because there are no equivalent statements in BASIC. 
When we acquire new concepts, a “vertical” effort is needed. 
Most of the following concepts are beyond BASIC. The 
steps aren’t difficult, but are definitely “vertical”. 

Sooner or later, we are going to need powerful, elegant 
ways to handle records. Those of us interested in robotics, 
languages, and various other Artifical Intelligence (AI) appli¬ 
cations will want to connect information in complicated ways. 
Systems buffs will want to manipulate individual programs 
(tasks) as objects. Business software certainly can make use 
of efficient record handling. 

Pointers 

From assembler language on up, data items are associated 
with names. For instance, when a variable is assigned a value, 
that value is put in the location with that name. Thus, 

LETS= 12 

in BASIC means that the place named “S” is to contain “12”. 
When the program is loaded, the variable’s name is equivalent 
to its address. If, in this BASIC, variables are eight bytes long, 
then the eight bytes representing “S” are “pointed to” by 
some address. Individual instructions may use different con¬ 
ventions for arriving at it, but all instructions referring to “S” 
must reference this address. Notice that two bytes is always 
the maximum needed to point anywhere inside the addressing 
range of a 64K MPU. So, “S” is the same as some two-byte 
address. If “SOCIAL_SECURITY” had been used instead of 
“S”, its equivalent address would still be two bytes. 

Consider this array: 

DIM ALPHA(5) 

This defines five strings of eight bytes each in our BASIC. We 
want to sort them using a bubble-sort. If the first of a pair 
of values is larger than file second, we save the first, move the 
second to the first’s position, and put the saved value in the 
second position, thus swapping the values. In this way, we pass 
through all four pairs repeatedly until none are swapped. 
The smaller values will “bubble” up to their proper places. 
Notice that every time we swap a pair we must move eight 
bytes three times. Now, suppose that we had the addresses 
of the eight-byte strings in another array. We might construct 
an assembler program which referenced the strings using 
this address array. We could perform the sort on the address 
array. Each ‘swap’ would involve just two bytes for each of 
the three moves, instead of eight bytes for each move (Fig. 1). 

There are many other powerful uses of pointers, but these 
will do for what follows. 


Fig. 1: Sorting Using Record Addresses 



APPRfSS KFCa/tOS 

TABLE 


A. Jones’ record should come before Smith's. 



B. Move'Addrl'to C. Move'Addr2' D. Restore current 

SAVE to previous pointer from 

pointer SAVE 



E. Pointers to the records are now in the correct order. The records 
themselves have not been moved. 

-> 

rOUJTE/t 

• ..->■ 

Move o fee avow 

Memory Management 

There are many times when it is desirable to postpone 
defining the location of data in memory. Suppose you want 
to write a general routine for updating personnel records, but 
each job description uses a different format and size, because 
each involves different details. You have hopes of using 
some of the memory for interactive programs. If you allow for 
the largest record all the time, it may mean that certain 
programs will have to stay on peripherals to be loaded when 
needed, slowing the system. You would like a better way. 

If your operating system has a memory-manager, then all 
you have to do is wait until the storage to hold a record is 
needed. When it learns the size needed, your program can 
pass this information to the memory-manager. A pointer 
will be returned indicating where the allocation of memory 
begins. There is a second, complementary function of the 
memory-manager: he must be able to free memory as well 
as allocate it, or, sooner or later, he will run out. 

Memory-managers are used whenever allocation is post¬ 
poned until the program is actually executing. In addition 
to its importance in processing of variable-length records, 
this is desirable or necessary for recursive programs, inter¬ 
active interpreters, loaders, and lists. A list, by the way, is 
a data set whose size can change during program execution. 


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


Number 24 


V 


152 




Chains 


When we interact with our systems through terminals, we 
say we are processing in real-time. This is contrasted with 
batch processing, in which a procedure is first defined com¬ 
pletely, then executed. Systems with which people interact 
have fewer uses for which memory can be defined when they 
are loaded than batch programs do. An interactive program 
may not leam what memory it needs until some point in the 
interaction with the user. 

In many systems it is better to process requests on a “first 
come, first served” basis. When a terminal interrupts an 
ongoing task, its request is not processed immediately. Instead, 
a very short routine is invoked which saves the request. The 
processor then returns to the interrupted task. When this task 
is finished, the next request is begun. These requests are being 
stored in a First-In-First-Out (FIFO) queue. The “enqueuing” 
algorithm allocates enough space for the request and its para¬ 
meters (Fig. 2a). The pointer to the new allocation is stored 
in the FORWARD field of the element pointed to by 
LATEST. This stored pointer links the allocation. Then the 
new allocation’s pointer is stored in LATEST to make finding 
the end easier. 

When the current task is finished, it is time to de-queue a 
request. CURRENT points to the information for the request 
just finished. The FORWARD field of the element that 
CURRENT points to indicates the information for the next 
request. We are through with the current element. We move its 
FORWARD field to SAVE. The contents of CURRENT are 
passed to the memory-manager in a free-memory call. SAVE 
is moved to CURRENT. This pointer is passed to the request 
handler, which begins the task specified in the data element 
pointed to (Fig. 2b). 

If we didn’t compare CURRENT and LATEST, we wouldn’t 
know if FORWARD contained a pointer or meaningless 
garbage. Besides, how do we know if the queue is empty? A 
null value for pointers simplifies everything. This could be 
anything, but “0000” (hexadecimal) or some address in ROM 
might do for an MPU system. It is easy to remember that 
zeroes are null, and since low memory often is reserved for 
interrupts, it isn’t likely that the ability to allocate from that 
address will ever be missed. Whenever an element is added to 
the end of a chain, its FORWARD pointer should be set to 
NULL. The handling routines can easily tell when a list is 
empty or when an end is reached by testing for NULL. 


Fig. 2: FIFO Queue Manager 



chained requests 


newly allocated 
and initialized 
request element 


A. Enqueue —Immediate request handling —create new request 
element and store request in it. 



B. De-queue—Move 
pointer to new 
element into 
FORWARD field of 
latest element, then 
to LATEST pointer 


The list described in Figs. 2a and 2b is called a one-way 
linked list, or a one-way chain. The links are the FORWARD 
fields. We used LAST to point to the latest entry, but that 
is not strictly necessary. As long as we know where the chain 
starts, we can advance, link by link, until a NULL indicates 
the end. 

Often we will want to insert or delete in the middle of 
a chain. For instance, we may be using a chain to hold data 
we wish to keep in alphabetical order. To search, we follow 
the chain out link by link, comparing the key field of each 
element with the name to be added (Fig. 3a). The pointer 
returned with the allocation for the new element must be 
stored in the element preceding the inserted element. We don’t 
know which element that will be until we find a key field 
with a higher sort value (that is, a key later in the alphabet) 
than the name to be inserted. Therefore, we must save a 
pointer to the last element every time we advance another 
element. If each element contains a BACKWARD pointer, 
search and insertion is simplified (Fig. 3b). This structure is 
called a two-way linked list, or two-way chain, naturally 
enough. 


Fig. 3a: Insertions 




-> 

[ F-ert 

9 




* 

% 

c 

• 

1 



rC<**K 


'a//. 


OCO-Tl c 


A. Insertions in a 
one-way chain 


Number 24 


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


Page 5 

153 













Deletions are similar to insertions, only backwards. Pointers 
are altered to point around the deleted element. A pointer to 
the deletion must be passed to the memory-manager in order 
to free it; otherwise that allocation can’t be used again (Fig. 
4a, 4b). 


g ACXWAtP '• 





■ Fe>A wA HO 
BAc wuSA/eO 



Fo#iaja4 P 

FctwAAD - 

•&ACK hjAXP 

'~-8AtKU>AAP 

Zta. to. 

£ 


I SAVt 

SAVt 

POlUTtft 

TO 

A4/4/\M<Sfye’> 


FOFWAAO 

BACFiaJAAP 

$e/e t(<f 
Sara. 


pR ft sesvict) 


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


Number 24 





































Rings 


There are times it is more convenient not to have an end in 
a chain. If the (null) last element of a chain is linked to the 
first, a circular list, or ring, results. Suppose you are designing 
an operating system to support up to sixteen terminals for 
computer-assisted instruction (CAI) applications. You need 
information on each user currently logged on the system. 
You want your monitor to poll each terminal in turn, but 
only if it is logged on. Simply let the user data reside in a 
circular list. Each LOGON procedure will insert an element 
describing terminal and user, and each LOGOFF will delete 
the proper element. When a user surrenders MPU control, 
polling will proceed in one direction. The CURRENT pointer 
is the only pointer needed by the polling routine. It always 
points to the data for the next terminal to be handled. 

Two-way circular lists are especially nice in FIFO queue 
management. Instead of chaining device requests and holding 
two pointers (or searching out to the chain end to make 
additions to a chain), we may build a ring from a fixed 
CURRENT element in one direction (Fig. 5). When the 
CURRENT element is deleted, the next element appears from 
the other direction. 

Fig. 5: 2-way FIFO Ring 




1 sA/e 


C. Current request 

processing is finished 



D. Next request is selected; 
request just finished is 
then freed 


Trees 

If an element contains more than one link (not counting 
backward pointers), a tree structure results. The tree’s data 
elements are called nodes. The starting node is called the 
root-node (see Fig. 6). In moving within a tree, down means 
moving away from the root-node towards peripheral nodes, 
and up means moving towards the root-node. This is, perhaps 
unfortunately, exactly the opposite of nature’s convention. 


A. Ring before 
interrupt 

poiMteA limk 
pa-ta A 



B. New request 
enqueued 


Fig. 6 



Number 24 


Or. Oobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 

155 























However, as in real trees, the most peripheral nodes are called 
leaves or leaf nodes. A “family tree”, such as you might have 
in an old family bible, has this structure. The leaves are the 
latest generation. Not surprisingly, the higher nodes of a tree 
are called parents and are said to have children or descendant 
nodes. A subtree refers to some parent node and its 
descendants. 

Moving down a tree involves making decisions; moving up 
simply means remembering where you came from. CAI 
routines often use trees. A node representing a question and 
its answers is linked to other nodes. The choosing of one of 
the answers causes a particular descendant question to be 
referenced. Another subtree from this node is selected in the 
same way. This continues until the user reaches a leafnode. 
Different students might be asked entirely different questions, 
except for the first root-node question, of course. 

Storage and retrieval using a tree can be very fast, especially 
for large data bases. This is because fewer tests are required 
in searching. If every node has no more than two descendants, 
a single test may narrow the search to half of the remaining 
nodes. Trees are useful for managing symbol tables, efficient 
use of diskette storage, and maintaining ordered data which 
is constantly being changed. The many uses of trees really 
deserve separate elaboration. 

Other Stuff 

It is often better for list elements to contain a pointer to 
data instead of the data itself. If the data to be linked is 
already in memory, just allocate enough space for linkage 
pointers and a data-pointer, insert this element in the list, 
and store the address of the data in the data-pointer. This has 
the advantage of allowing several lists to reference the same 
data, thus saving the duplication of data and conserving 
memory. Carrying this idea one step further, each link may 
contain a key. Several different sorts of key can be referenced 
in several lists. Suppose an art store wishes to be able to 
reference a customer file by customer name and account 
number, and also wants to be able to keep track of which 
customer had purchased any particular work of art. Lists for 
names, ID’s, and sold artworks could be maintained in order 
to reference pointers to information on the customer they 
match. Such a referencing scheme for JOHN DOE, whose 
ID is 99M999, and who is the owner of two works catalogued 
P801 and Q003, is shown in Fig. 7. The lists from which the 
links came could be chains, trees, rings, or compounds of these. 

Fig. 7 



Multiple References to the Same Data 
Using Several Lists 


It may not be easy to apply all of these ideas immediately 
in your own systems. However, even if you are just learning 
BASIC, take heart! There are a few tricks that will carry over. 
Remember the bubble-sort? A one-dimensional array (a 
vector) can be used to store index values to another array 
which contains the records to be sorted. Swap the indices 
in the first array instead of moving the data. After the sort, 
the first item will be in some position in the data array, and 
that position will be indicated by the first element of the 
first, index, array. Similarly, the second element in the index 
array will indicate the position of the second item in the sort 
sequence, and so on (Fig. 8). 

Fig. 8 


A _ 


51AITH 



z - 

- 

JO/dE S 

3- 


ta yl&R 

4 " 

--^ 

4 BEL 




1 — 

4" 

v 77 

5>A1 IT hi 




'JPAJE 5 

3 — 

1 - 

A 

T AY LC? K 


3- 


ABEL 


At=tek soar 


Sorting Using Subscripts 

Now, with all of these new tools, you should be just about 
ready to start designing that great new system that’s been in 
the back of your mind all these months. 

Happy linking! 


MAILING LIST PACKAGE FOR NORTHSTAR 

News Release Received: 78 Feb 22 

The Comprehensive Mailing List Program Package #ML- 
1NS, is a modular program set which enables the user to start 

and effectively maintain one or more mailing lists. Operations 
include: Add, Delete, Search, Sort, Auto-Sort, and Sequential 
Printout. Features include: user-selectable defaults for ease 
of entry, user-selectable number of labels across page for 
different printers and label sheets, and user-selectable 3 or 4 
line address for each independent entry. The program set is 
written for convenience and ease of use. Available with 
complete documentation and North Star diskette (SWTPC 
version available soon) for only $25 PPD. Documentation 
package only is $4.50 PPD, fully refundable with order for 
diskette. Order from: Williams Radio and tv, inc., computer 

Division, 2062 Liberty Street, P. 0. Box 3314, Jacksonville, 
FL 32206;(904)358-3707. 


Page 8 

156 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 24 









»*#**#**»»»»»»»##*#»»**#####»##»###*#*#########*»»»»»»»»»»»»»»»»»»»»»*##»»******»»*************»»****»******»******»»' 


THE OZNAKI "LIFE" 


An interactive version of LIFE for the POLY-88 VDM 
INTRODUCING THE NAKI CONCEPT FOR TV GRAPHICS 


BY HARVEY A. COHEN 

OZNAKI Project 
La Trobe University 
Bundoora 3083 
Australia 

Here is a version of Conway’s classic (i.e. 1969) game of 
LIFE that has fairly advanced interactive facilities — one can 
play God with aplomb - yet the program is less than 200 deci¬ 
mal bytes long, and when running uses only a few bytes for a 
stack and the IK of memory in a Polymorphic Systems VDM. 
(I eliminated the need for a IK next generation store by 
“marking” the screen itself — indicating which live cells will die 
in the next generation, and which dead cells will become alive 
— without interfering with the neighbour count algorithm.) 

The key idea in running the LIFE is that there is a little 
screen creature — a NAKI — which can be commanded to move 
about seeding or unseeding the screen. A more sophisticated 
NAKI might drag a picture (e.g. a rocket ship) about the 
screen, but that’s not called for here. 

When this game is started the player is presented with a 
clear TV screen. On pressing the E key, a NAKI appears on the 
upper-left hand corner of die screen. The NAKI can be driven 
about (and off) the screen using the commands: 

N NORTH! 

S SOUTH! 

E EAST! 

W WEST! 

The NAKI will populate (“seed”) the screen cell it current¬ 
ly occupies in obedience to the commands 

L LIFE Deposit an asterisk 

K KILL Blank cell 

Just what’s underneath the NAKI is not visible until the 
NAKI moves on, or LIFE is started. The whole screen can be 
cleared with the C command. When you are satisfied with the 
way you have populated the world, you may grant it LIFE — 
an autonomous existence determined by savage laws — by key¬ 
ing in the command G. 

G GO 

If you want to “single -step” — instead of G use the com¬ 
mand H: 

H GO ONE GENERATION THEN HALT 

The pattern is steady for about two seconds, then the cells 
are marked for change. A dead cell in which life is to appear 
in the next generation is marked by a solid blob. While a living 
cell that is going to die is marked with a three-pronged graphic 
character. (The display of the marked generation could be 
eliminated by removing the corresponding CALL DELAY 
in the program.) About 2 seconds later, the next genera¬ 
tion appears. Here is what happens to a set of traffic lights. 





■ 

1 

iii 



i 

< 


■ 


Even though the Birth-Death agony sequence was started 
on the G command, the display will halt on the next genera¬ 
tion by making ANY keystroke; once the display halts, this 
keystroke is obeyed if it is a valid NAKI or LIFE command. 
Elsewise, once the display has halted, the NAKI is sitting just 
off the screen, and may be brought back onto the screen to 
reseed or kill at your whim. 

For those who haven’t met LIFE before, the following 
details may be useful. Each of the 1024 cells (character posi¬ 
tions) on the screen has 8 neighbours. Cells with 2 live neigh¬ 
bours are stable, whilst if a cell has exactly 3 live neighbours it 
will hold life in the next generation. Elsewise the next genera¬ 
tion in that cell is dead. These are the usual rules for LIFE, as 
per Marvin Gardner’s articles in the Scientific American in 
October 1970, and February 1971. Gardner’s articles include 
pictures of the evolution of several interesting LIFE “worlds”, 
including gliders and glider guns, pulsars and pentadecathlons, 
and a host of stable patterns. In this implementation the 
screen is large enough to display a glider gun, but the gliders 
ejected bunch up and destroy each other on the screen bound¬ 
ary. Conway’s LIFE is played on an infinite lattice. In this 
LIFE, off screen neighbours are always dead, and there is a 
crude wrap-around on the screen sides. 

Note that this program will not corrupt any location in 
memory other than the actual program storage space, less 
than 10 bytes of stack, and the VDM of course. 

The program can be adapted to use the Processor Technol¬ 
ogy VDM, at the price of a modest increase in length, which is 
then needed to properly count off-screen neighbours as dead. 
A non-interactive version of LIFE on the P.T. VDM, written 
by Marvin Wizenread, was printed in DDJ November 1976. 
Unfortunately, Wizenread’s program, if unaltered, will corrupt 
any memory within 10K or the top of the VDM. 

I wrote this version of LIFE to provide a demonstration 
piece that proves that pretty interesting things could be done 
in tomorrow’s schools using 2 chip microcomputers. The 2 
chips of this mythical computer would be a CPU with IK 
RAM and IK PROM like the Intel MCS-80, and a video chip. 

Number 24 


l 


Page 10 


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


157 






OZNAKI PROJECT CROSS ASSEMBLER OUTPUT 
INTERACTIVE LIKE ON P0LY80 
LIFE P8« 18-AUG-77 13133 

SYMBOL TABLE 


A 

7 

ALIVEC 

AA 

8 

0 

BLANK 

3003 

C 

1 

Cl 

306C 

CLEAR 

3000 

D 

2 

DEADC 

7F 

delay 

30AS 

deloop 

30A8 

DHARK 

308D 

EAST 

309B 

H 

4 

KBUPF 

C0C 

KILL 

309F 

LIFE 

304 A 

LIVE 

30A2 

LIVEMA 

80 

LMARK 

3092 

M 

8 

NARK 

3088 

NO 

304 A 

NORTH 

3097 

ONECCN 

30B1 

RE AD In 

3013 

READY 

300C 

SOUTH 

3099 

VDH 

F800 

VDNU 

F8 

NEST 

309D 

NHB 

C20 


s m re o> 
SflN<KU s SKU 
u cm kJ ea lj 

U. 3* "1 ® JO 


t- <n to e> 


- r\ m o < o u. <s — 

3 S3 X> CO CO ® CC » Oi 

raa 333333 

m m io m o n 


CM ^ «f» <0 
o» o» Ol » 
a a a a 
nmno 


moo < b u o ui u. —• cm ■> 
» » » o» o> o* » aa<<4 
aaaasaa 3 a a ia a 
m n m m m m m nimnnc 


IO«KOOi<!DUU.B'i«nOKC 3 

< < < <<<4<4IHI011CQ])00 

aaaaaaasaaaaaaaa 

nimnnmn'iini'iiniiinnmnin 


M 1C Q 
< « bJ 
ui u n 
kk a 


a or 
o u 
<o t 


z o s 

►4 X ® 4 

o s u. s < 


3 *4 
M I U 

♦ 30 
X X < 

c ou 
> > o 


uuunu 
or ar ® 
o o o or 

0 00410 

< _j < x »- 


4 X 

o o 


X X 
*- ui o 

a*-z 

X Cl 
Z ■< W 


(TOO 
< *- »- 
z co co 
uuu 
-or a- 


X o 

♦ owes 

CO X X Z UJ 

407WMQ 

UJ Z *1 X X o 


3c M« Oc 
1 O UJ 4 JC UJ 1C i 
CO * ill X * 


arxrxToroxirxxr 


x x 
< «, 
9K0X4 


< ►- U -I 3 

j< x > jI i a 
o ui uj - i-i *-« »o—o 
r7aox<<jic« > ul 


>- z u. 

■* < u. 

3 0 3 


uun ■ 
-IX ■ 3 
*-<ux r 
►4 uj o o o 


LJ u 

>• o 

>-«<»-t*-4*-»>4Q.f 
3UiX»>OX i 
< o _i x r o o - 


m a 

L Z O 

JT 1 


a o o x a > 

1 4 Cl C O . 
4 O <«"•<►■ 


3 OO O O X O X O X 13 »-« 1-4 IM » « j B X > 4 UI O > M NO _ 
-'CiUCUOUC.' <.'U/’G.'N< oUOaaiLClL —■ < 

I04Q4Q404Ha4UUI <30 •40X000X03—0 


OKu-ffiosnu. 
U.U.MVBO jJU. 

amxu.su® ® s 
au.<pM®foio 


<M «4 -4 


-susnninsNamauaosBSKs- 
Nonnion^inininMOMnMinMOMin'j 
JUNLOUlCUOU'xUNUSU-UKl 
.. — • — • — L JU.5ll.4U su mu- 


l3iU.3U.Ju 


muressores 
niMEnn\u.n 
CM U. UI O 


snciKOPoQ am 
33303333 — — 

333 3 3 333 33 

oimnomonn com 


Oi4OUHO0OBO3ftlinK4OU.4»iOBi4 4lllOOU. 
rt-^rtNiuNMucunininooinoMM^ < < -mmmi ^ 
333 3 33333333 3 33333333333 3 33 
nnn , n>Tnpnnninin'ininni l ino»inininnrvnnn 


us — NinvinoNOo < iuu.sm4 ® ci 
'IB.TClClCl.'lClO.TinOOBOCOOOC 
33333333333 3 3333 3 333 
nnnmnnninn'iinnninnininininn 


O O w U. <M IT *0 O X) U 

OOdCNSNN re K 

33333333 3 3 

oominooinin o in 


Number 24 


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


Page 11 


158 











A IK DEBUGGER for the Z-80 


BY LES HANCOCK 

305 Lexington Ave 7-C 
New York, NY 10016 

The IK Debugger is really a 0. 951 17188K debugger. This 
version is assembled to start at 074061 octal. That puts it at 
the top of 16K, up out of the way of most programs. The code 
must be assembled to end at a page boundary (***/377 octal, 
**FF hex). The debugger is meant to run on a Digital Group 
Z-80 system with ZE audio ROM, TVC-64 video interface and 
TVC-64 monitor. 

This debugger provides the following features: 

• Display the contents of every Z-80 register as it was 
at the moment the debugger was invoked. 

• Display the current contents of any memory location, 
using extended addressing, register indirect addressing 
or indexed addressing. 

• Change the contents of any register buffer. 

• Change the contents of any memory location in RAM, 
using the three addressing modes mentioned above. 

• Load the Z-80 registers from register buffers and 
jump to any address, with or without enabling inter¬ 
rupts and with or without setting a breakpoint. 

• Load the Z-80 registers from register buffers and 
jump to the most recently set breakpoint, with or 
without enabling interrupts and with or without 
setting a new breakpoint. 

• Jump to Op Sys program/dump, with automatic 
return to the debugger. 

• Swap contents of register buffers with Z-80 alternate 
registers. 

• Display any 8-bit value in binary notation. 

• Give the two’s complement of any 8-bit value. 

• Add or subtract two 16-bit values in split octal or 
hex. 

• Display or set mode (hex or octal). 

• Clear TV screen. 

This is a simple debugger, and using it should be fairly 
straight-forward even for new programmers. Get an assemb¬ 
ly listing of the code to be debugged so you’ll know the 
address of every instruction. Load TVC-64 Op Sys, debugger 
and target program. Create a new Op Sys option to jump to 
the debugger, then use execute and breakpoint commands to 
run your program piecemeal. Whenever it reaches a breakpoint 
the program will return to the debugger; try the various dis¬ 
play commands to see exactly what’s been happening in the 
CPU and in memory. You may want to load new values, then 
jump back into the target code. You always have access to the 
system program/dump (via the ? command) to do extensive 
reprogramming or to display large blocks of contiguous 
memory. 

When you jump to the debugger it resets the stack point, 
disables interrupts, and inserts the debugger’s start address at 
001025—001026. (This last step vectors RST 070 back to the 
debugger.) Then it loads a set of buffers with the contents of 
the Z-80 registers, removes any breakpoints that may have 
been set, and waits for input. If you want to re-enable inter¬ 
rupts, use the XI and ZI commands; if you want to keep the 
stack pointer at its original value, use SP = nn. (This paragraph 
may not make sense first time around. Reread it after looking 
over the list of commands.) 


The input prompt is a six-space indentation, a la APL. You 
can type in up to 20 characters per line, including blanks and 
the carriage return. (Blanks are ignored when a command is 
decoded.) Use the RUB key to erase typos. If necessary, rub 
right back to the beginning of the line — you can’t go past it. 

The error message is a question mark. 

A few words of caution are in order at this point. When you 
look at the load commands you’ll see that there’s a big differ¬ 
ence between changing the contents of register buffers and the 
contents of memory. If you give the command A = 015, what 
you’re doing is loading 015 into a buffer, which will in turn be 
loaded into Z-80 register A when you give an execute 
command. But if you say (001001) = 015, you really and 
immediately put the value 015 into memory location 001001. 
Think twice. 

When you set a breakpoint at a certain address, the debug¬ 
ger copies the byte it finds there into a buffer and replaces it 
with 377, which is the RST 070 instruction. This restart is 
vectored back to the debugger, which will take out the 377 
and restore the original byte. Be sure that the breakpoint 
address you give points to the first byte of an executable 
instruction in the target program, or that program will surely 
bomb. If it does, for this or any other reason, then control 
won’t return to the debugger, and you must remember that 
the instruction at the breakpoint address is RST 070 and not 
the original article. 

The Z (or ZI) command allows you to jump to the most 
recently set breakpoint, which means the last breakpoint set 
since you loaded the debugger. Be aware of that, and of the 
fact that if you jump to a breakpoint and set a new breakpoint 
at the same address, you’ll bounce right back. 

The debugger prefers to work in octal. You can switch it to 
hex with the M command, but it will reset itself to octal mode 
when you come back from a breakpoint. If you enter a hex 
value in octal mode, you’ll get an error message; but an octal 
number may be accepted when you’re working in hex, with 
incorrect results. 

1K Debugger Summary 

Conventions : 

Punctuation marks, math symbols and capital letters must 
be typed at the keyboard just as they appear here. 

Lower-case n stands for any 8-bit value, nn for any 16-bit 
value, d for any 8-bit two’s-complement displacement. When 
the debugger is in octal mode these values will be given in octal 
notation, when in hex in hex. 

Brackets indicate a choice. For example, {± ) means that 
you may enter either a plus sign or a minus sign. (But you 
must use one or the other.) 

Square brackets enclose optional entries. For instance, 
H [L] means that you may enter either HL or just H. 

Input : 

The debugger prompts for input by indenting six spaces. 
The rubout character (377) backspaces the cursor and erases 
the previous entry. You can type in up to 20 characters per 
line, including blanks and carriage return. When a command is 
decoded the blanks are ignored. The 21st character creates an 
error condition, and all input is scrubbed. 


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


Number 24 

159 


COMMANDS 


Register indirect addressing 


1. SCREEN CLEAR COMMAND 


2. MODE COMMANDS 


2.1 Display Mode 


2.2 Set Mode 


Clears TV screen. 


Returns H if mode is hex, 0 if 
mode is octal 


0 sets octal mode, H sets hex 


HL Returns the value currently 

BC stored at memory address speci- 

( DE ) _ n fiedby the contents of the 16-bit 

SP register buffer 

.C Indexed addressing 

IX 1 Returns the value stored at 

( IY | + memory address specified by 

contents of the 16-bit buffer, 
offset by the two’s -complement 
displacement d. The plus sign 
may be any nonblank character. 


5. LOAD COMMANDS 


3. ARITHMETIC COMMANDS 


3.1 Binary Display 


3.2 Two’s Complements 


Displays n in binary notation 


Returns the two’s complement 
(NEG) 


3.3 Addition and Subtraction 


5.1 Load 8-bit Register 


Loads the value n into the speci¬ 
fied register buffer. 


5.2 Load 16-bit Registers 


Loads the value nn into the 
specified 16-bit register 
buffer 


± nn, nn 


Using reverse Polish notation, 
finds the sum of two 16-bit 
values or the difference between 
them. The comma may be any 
non-blank character. Note: octal 
arithmetic is done in split octal, 
where 000377 + 000001 = 
001000 


4. DISPLAY COMMANDS 


4.1 8-bit Register Display 


Returns the value currently 
stored in the specified register 
buffer. Command 3.1 may be 
used to interpret F 


4.2 16-bit Register Display 


H [L 
B C] 

D [E 
S[P] 

IX 

IY 

4.3 Memory Display 


Returns the value currently 
stored in the specified 16-bit 
register buffer. Note that L, C 
and E can’t be displayed as 
single registers 


4.3.A Extended addressing 


Returns the value currently 
stored at memory address nn 


5.3 Load Memory 

5.3.A Extended addressing 

(nn) = n Loads the 8-bit value into 
memory at the address 
specified by the 16-bit value 

5.3 .B Register indirect addressing 


Loads the 8-bit value into 
memory at the address 
specified by the contents of the 
of the 16-bit register buffer 


Indexed addressing 


+ d ) = n 


Loads the 8 -bit value into mem- 
moiy at the address specified by 
contents of the 16-bit buffer, 
offset by the two’s-complement 
displacement d. The plus sign 
may be any nonblank character. 


6. EXECUTE COMMANDS 


6.1 Execute from a Given Address 

X [ I ] nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address nn. If the 
command is XI, interrupts are 
enabled 


Number 24 


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


Page 13 



6.2 Execute from Last Breakpoint 


Z [ I ] Loads the Z- 80 registers from 

the debugger’s register buffers 
and jumps to the most recently 
set breakpoint. If no breakpoint 
has been set, control passes back 
to the debugger. If the command 
is ZI, interrupts are enabled 

7. BREAKPOINT COMMANDS 

7.1 Set Breakpoint and Execute from a Given Address 

X [ I ] nn, nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address specified 
by the first 16-bit value, with 
breakpoint set at address speci¬ 
fied by the second 16-bit value. 
If the command is XI, interrupts 
are enabled 

7.2 Set New Breakpoint and Execute from Last Breakpoint 

Z [I] , nn Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to the most recently 
set breakpoint, with a new 
breakpoint set at address speci¬ 
fied by the 16-bit value. If the 
commands are ZI. Interrupts are 
enabled 

7.3 Display Last Breakpoint 

E Displays the most recently set 

breakpoint, the one to which Z 
or ZI will jump 


8. DUMP COMMAND 

? Loads the Z-80 registers from 

the debugger’s register buffers 
and jumps to address 003000. 
All the usual monitor program/ 
dump functions are available, 
but the command R will return 
control to the debugger and not 
to the monitor 

9. REGISTER SWAP COMMAND 

& Loads the Z-80 registers from 

the debugger’s register buffers, 
then swaps them with alternate 
registers and returns control to 
the debugger 


FOOTNOTES TO THE CODE 

1: Line 180. The TVC-64 monitor vectors RST 070 to the 
address contained at 001025 — 001026. We want that to 
be the debugger’s start address—in this recension, 074061. 



2: Line 270. The byte at 001247 is a mode code. If it’s 
ASCII ‘H’, the current mode is hex; if not, octal. 
Subroutines NUMOUT and FINDMO, and the mode-set-or- 
display routine SHOWMO, make use of this Digital Group 
convention. 

3: Line 370. When the debugger is initialized, FLAG and 
FLAG + 1 contain a jump instruction as shown. As soon as 
you set a breakpoint, that instruction is replaced by a NOP 
and a load-HL-immediate. ZBP and ZBP + 1 always 
contain the address of the last breakpoint set. (It’s 
initialized to the program’s start address.) BPBUF contains 
the byte located at (ZBP). When you come back from a 
breakpoint HL is loaded with the breakpoint address, A 
is loaded with the byte to be replaced in the target code, 
the byte is put back where it belongs, and the instructions 
at FLAG and FLAG +1 are reset to JR NN0. 

4: Lines 430, 1070. Users of TVC-64 return from the system 
dump by jumping to the address at 003376 — 003377. 
This is normally 005000, the monitor’s entry point. The 
debug command *?’ will substitute the address NN0. So you 
can go straight into the excellent system dump, use all 
its features, then return to the debugger without disturbing 
the contents of the register buffers. 

5: Line 3290. This subroutine was cribbed from Dave Bryant’s 
PHIMON listing, published by the Digital Group. (PHIMON 
is DGI’s Phi-Deck monitor.) I changed the code to work 
with TVC-64, but the hardware is a mystery to me, so 
I’ve left out comments. (This is another way of saying that 
I don’t know how the subroutine works.) 

The TVC-64 support routines used by the IK Debugger are 
as follows: 

TV—prints ASCII byte in the accumulator on TV screen 
SPACE—prints one blank space 
ERASE—clears TV 

KEYBD—gets a byte from the keyboard 
NUMOUT—prints the value in register E as two hex digits 
or three octal digits, depending on what’s in 001247. (See 
note #2.) 


Page 14 


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


Number 24 

161 


Q. -u X <D X 
•X Dn Qj -u 0) 

•Q X) .q a .q 


a i 

■r-,Tj q fc< 

TJ -C X Q) 

C O O Q, 3 Cn 

-x -x >tj *j 0< 

. CM3 

S O i 0) X 45 

Ofi *J 0) 

fa v .. tj -t> 

a: a, q> fa q _ 

6 c 2 nj 'x 

0) a x fa o <x 

X T> 44 fa U) 

O 3 X X «* 

X**O«0fl)X- 

tn X X q -u u 

QJ X <fl x *J 

« «M O 3 'X (ft -X 

in X Cjuj tn 
<D 3 I <U 0) O lo 

X) m x x -u n 


q J< Q) -u fa i 

•x C x O H I 

a t C u X; 

■X -X X 

XJ O ITS O fX 

S k “ V 


w x «i to 

0) QJ QJ tfl QJ tfl 

Jx q fa fa lx H : 


3 

Z A 
X CD u 
Z M Z UL 

o ‘Ha: 

UA JUI. 


XL 

I X- UJ A 
10.0.0 Z N 
• X Q£ X- A ~ 
oxL' - - : 

I 3 Z UJ N 3 
Z X l 


t *. « Z W ~ © N <£ ~ ' 10 3 3 3 

30 u o <r o o. z n in uj a. u. in a >o a n a o> o. 

o cd cn uj z o x z ro z x x <t z « z u. zo: z *x 

IZIO 'X'OC' * 3 *■ O ' * 3 »■ CM ' - - A ' - - Q - » ■> Q % * f- %X' 

U.X«NJZU.NJZOCNJZHNXUJXX - 3 
IZCQUJ' N ' N' Z X ~ X ~ o - ZX'-'O « 0) ' Z Ik' Z X U. ' Z X U. - ZHOH ' N> 


> ^^ IL ^ ll '^ &i ^ <k - £aa ^ LLa:Qfl ^ Q ^ aa ‘ & - a - a -^ lk -KQQflQ&-&-O.QQLl(XLLO:QI>:La:QO!LQ:aLLL3^0LLLLQ 

IUUTUTUlUT(JTJJUTUTJJUJUJTUTCJTUlJJJJTUTJJTIilliJTinjTUTJ”)(JTJTUTLULUTUTJ 


O O O O O O «X 

o x cm w v in in 
n n n n n n n 
o o o o o o o 


S59?2?9°5!22.9 0 ?2 0000000000000000000 oooooooooooooooooooooooooooooooooo 

XXNNNNSrnmSi5S!Smmm^^J!C^^?^ OHNr),rin ' OPsCDI> ' OHNM ^ in ' flNII,l> ' OHP,Mtln,ON ® (>,OHMn ^ ln, <I N ®'>'0^ 

©©0©00000000©0©00000©00000T-t*-»»H»H*H*-«*-»»HiX»H»-«»x»x»x»x«H*M»x»x*x»H»x»x»H»H»x»x»H,x. I H,x»H»H»x,H,x,-i,-iT*,HT-i»x 


o >o rx n 
-< <r o »x 

o own 
O'Oinru 

CMOhOI 

OOMMt 

Hioinot 

-O-O-OM 
PM CM CM CM C 

IX IX IN IX f 

o o o o < 


on <r 

ON N 

o o o 

in <r >o < 

'X t (N M 

ro o h in x i 

ino in in >o pm ' 

in ro ix h x x r 

O O I*) M 10 IO I 

n^r'O'O'O'or-jiONc 

NNNNNNOOO' 

PMCMCMCMPMPirororor 

<r'»r<r<r<r<r«r<j-<r< 

NNNNNNNNNf 

ooooooooot 


NNN <r>0N'O <T CM CM W -0 m 

NNN NNNN NOONNN 

ooo oooo oooooo 

<r<rincM'0NCM* > <r«-'0'0ino*- -o 'OCMioonownn 

(MMxinxxMHinonooiMin o on cm n >oinroNH 

MNnHrmnoHMHNMOH *x HomnncMioNo 

'OPM'OPM'OCM'OOCMCMinrO'OOCMVininin'OrO'OCM'OCM'OO 

NHNHNHN<nn<rHON<nnnHt«ixooNHNHNT 

MnNnnMMOooMMMOOHnHnoMnnnMMO 

fMNHVMjxninoi'i'OHninoH^inoNinNCMtNx 

HHHM(MiMnnn'r<r<rninin'0'0'C'ONNNNooo« 


M'O^n'O iniO'0'0 
ONNON NNNN 
OOOOO OOOO 

o^O'O'O'omo^-'O 
lOONNtt ninot 
lonxncMCMooncM 


fMNH^-oxninow'OxninoH^inocMinNCMtNx 

HHHNCMiMnniottTininin'O'O'O'ONNNNoooH 

rororororororororororororororotorororororororoooo© 

o-;*<r<r<r<r4r<r<r4r<r<r<r<r<r<r<r<j-«-<r4r**-inininin 

NNNNNNNNNNNNNNNNNNNNNNNNNNN 

ooooooooooooooooooooooooooo 


otp-O'O'OinoTM) OHinoO'OnNNNn«o>OHM)intrxOHHCMn 

ooNN^tninot NOo-oinooinncMOOCMxMJtcMtntnt'O 

OMhWCMCMOOWCM OnONOnONOnOMOMOMHlDnOMOIM 

H(MHCMro-o!MH(MnHOM>ooHO'OoxO'OOHO'Ooinnin' 00 'OOH 

tt^^oNOttonHONttnNttnNttWNtNHNNinNinv 

oooorororooororoororooooroooorooooroororororoorooo 

ID'Dx^NCMtNCMinOxCMinNxt'OOCMinNxrO-OOCMt'OxmnNxn 
HHCMrMtMnnnwinmninin'O'O'ONNNNoooHHXHCMCNCMCMnn 
0000000000000 000000000 <x*H«x^«x«x«x«x*x<x*x«x«x 

ininininininininininintf}ininininininrcininininininin«inininbnninintt 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

ooooooooooooooooooooooooooooooooooo 


QJ JD >X UJ H 

X X q <g ^x 

o u m 

to C X JI QJ 

0 X) 4J -U 

. 3- > 

X X X C C 

to to to to *X 

QJ -U -U -U 

to q q q to 

(Q M ■», 4J 

, X X X X QJ 

fa fa fa fa e> 


'O CM O “O O 

■ <r n n o in 
ro ro ro »x cm 

■ o o o n h 

OOOOO 

■OOOOO 


3 3 3 3 3 U. 

•aocoo 3 

lu u uj lu u a 


0) X ~ 

- - in 

~ ~ cm 

U. X- U. K O 

3 cn 3 CD x 


1 U. U. U. U. U. 

• 3 3 3 3 3 

* h a o: a aaa 

> - XH » £t J |l N A 

<X~<T'-'X'-'~~ 


U. lOIO'' 

3 O •■ O M) 

a <x «r ~ m n 
Q. ‘HCDOIOLI 
A^OQIOIOW 

o ~ 3 * 3 - o « 

Z X- 'I Jli. JOL 

zcn<r^x — x^uj 


A X- <X 

A Z Z X - A 

WOHH Z ~ GO 

O ZCM - >- m * 3 ro 


uj o cn 

« Z CJ N - 
► H QJ N N 


XXX 

cn a. cd o. cn 

QQt-tAAQ30Q30Q3QQi 

JjajJJLa.Ju.ij_lu_13. 


uj u 3 a <r 

cn a o a o 

<t <z r >- 3 PM 

CC Z> (L 3 UJ X- X- 

UJXCDZZ1MMHD CO 

• -rxPMrOO-IO'ONAOOOOOOOOOOOOOOO 

iwroroioioroioiO'ryD'ONCDD'OxcMioirin'ONCO 

i ^ ’X »x th tX tx tx ^x »h »h pM C^‘4 CM CM CM P*J CM CM 

• OOOOOOOOOOOOOOOOOOOOOOO 


‘W » JIIIHNI » * X UJ ^ in - a x _> 

A JAIZIMZvQOlia _JQIOZ_JN_JAAr-CJ'-'l- 

-J -J -I 3 3 3 

3 3 A 3 UUU33 3 

AtXAACCLCCAAAA <1 C£ L Oi Z CC Z Z « « ^ A <1 

3(J33UU"133Q3 U3U3>-h-Q > -)»-iUU33U 


OOOOOOOO^PMIOOOOOOOOOO^CMrOO-OOOOOOOOOOOOOOOOOOOOOOOO 
?2i2! n,, ' in ' 0 ' 0 ' < >' ON ® | > , O r, ^ ,, ’tiniflioinin'ONfflo>OHPMio^in'ONAi>'OHMio , ryi'ONCDO> 
CMiorororororoiororoiorororo^ro-^-^'^-o’^'O'O'^-o-^’^ro'ioioioiombTUTininin'n'O'O'O'O * * * - * 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO© 


'O 'O 'O -n 
OOOOO 


*x -o *f x 

ON N N O 

ro o ooo 


•o <o >0 >0 

OOOOO 

O-O-O-O-O- 

N N N N N 
OOOOO 


ro ^ o x in in o m nnnion , o n ro ro 

'O'O N'OPmo* in^- m x ^ pm >0 10 o in o cm 

»x o pm o o ro pm ro cm ro pm th pm ^ ro cm^^ 

in»xiopM'xcMin»xCMin^xCMin'OCMincMincM*-*CMinin 

in'O'Oo-o-o-ro^-o-No-o-'ON'Oin'Oin'Oo-o-iniio 

rooroooororooroiooroooroorooroororo 

HHHXHxxHxinOxtrNPM^inOtMIO'ONH^MJxrO'ONPM'ONPM 
-O'O'O'D'O'O'O-D'O-ONNNNOOOxxHHHNPMPMIOIOIOrOl'triilin 
OOOOOOOOOOOOOO HXHHHHXHHHHHHHXHrlHH 


n t vinroo 

N »x N O O © 

O OOOOO 

o- tr OCMO'O'O 

hnio ioinoN» 
o o ro o ^ o ro ro 

OxCMNxCMxCMin 

lO'ON'OtM’ttrx 

ooo«xooooro 


•ON^-NinwcM >o 

O O (MN H H H *■ 

oroororocMO o 


N CM N in ro *x PM "O PM 

oo-Nth 5r ro n h is 

ro o ro o ro roroo ro 


u m m m m i\ u u u h h h h h n rj n n id n “ " id uj 

OOOOOOOOOOOOOvHvXT-tTXiXiHiXiXiHiHiXiXiXfXfX^^^T-t 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


oxiMNxCMxcMin 'Oin>OHin'OON'OOMiTO'00vo<i-trininoMn 

N'GN'O^^^ Vx OxOtHNt'ONOO^MNtnilininOHxn-OH 

ooo^ooooro onoonno«xoCM^nonooooonnorHro 

pMPMV'OxcMinon'OxHHHHn'OOM'OoiMMin'ONCMV'OOxrovinomn'O 

inininin-o>o>oNNNoooooooHHHCMCMN(MtM(MroroMv<rM i «r^inininin 

’X »x »x »x »x »x »x t-< CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM PM PI PM PM PM PM P J PM PM CM PM PM CM 

NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 

OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Number 24 


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


Page 15 




« to -f TJ • 

« « m c tj 

l) M m q 

l-i w. o -i 

Ta tj o O 

T3 T3 CQ 

<0 <0 M &> 

_ O O QJ 

■O U *J v. 

«j id x q 

• * TD 0) O Qj ' 

«J C « -u C . 

I T3 QJ to -H 

c -u o 0 ) a -u 

-h x i -u e 3 


q 4J *J ' 

i a-" 1 

U 0) Qj T3 

<l) M o c m 

■U M S: m O O 

to 0) *~i *• *-f 

'2 ^ O O D, o, O 
t» <*h -*j to o "o -u 

Qj3qu-~ioqq. 
^ ■ft •n m ‘B N HJ ••-< 


4J 3 o q 

y x 6 q rv. o u 
tn <a -c u -U o 

q to -u \ *j • 

O X O O X U 

■u 0) QJ &> QJ 

q X O q u -q Qj 
*H O ■*-* •-* *• Is 

q <j 4 j wiJO- 
O' -~i QJ to QJ Qj 4J 

H Q 15 H X 15 to ' 


00 3 3 

- Z 2 

Z Cl <X X < 


In 3 >03 rx 3 003 

Hfi v* iZl ■>-! iXl H IXl 

2 I ic z n ce zqk z cn u. 

- - Q ' - Q % * Q v .. .. Q 


X. ~ ~ 

3 _J _J 

Z X X 

-X V w 


X 

O CJ U 

' * - Si. -‘O' - -Q' 51-' X' 5-a: » X i £ oot « ® « « ® q 5 i Ji-hhiimxur!<ri3 

XNJ2fiNJ2QNJ2WNJ2ldX ►>■ ►CCJXJUJUJ »j »CJJ fc O ‘ *• _J 3 - _J _J CJ Z Ci •. _j »■ UJ UJ UJ —< •- UJ ® u£ *■ *-3 •. <v 

% 2 X *-* ' zx»-*' ZX>H' ZX H(5» M' NUJXXXOZUXOBXfDNU U^KflUZICQH Z UXC6OOOWN2v0.«LJ2«iUI 

i-i 

-i _i_ix x 1111 I 


3r<r-'»- uj 

UJ _l _l U3-H03Q J- 

o: i x x z ~ ll » 3 

►i w vhh(-nwxui''«i'0 cj 
a -_i - uj uj uj h - uj co it •- »-3 - ct. uj 


-J _j _j u cn a. cj u: cj d tn n 

QCIi.CCQIl'Q.CI'fiiZ^Q.ltCQ.KQCaQ'Q^CaZQDOaLIZliJQOAKQQJOK 

3U3_J303_l3U03U33-J3-IUU_J«_| < l.tL_/U3Z-ix“T3«5°3 


OC CJ 

UJ Q Z 

t- _| i-t 

cn 


-J -I -I 
Q <t <1 <1 
_l U U U 


HACOLQi 
U 3 (J _J 3 _l . 


> O O O O < 
■OOO'OhC 

> O O »H sH . 
I CM CM CN CM C 


h N I*) O O 

O O O- O T-. 

m m m mj mj 
CM CM CM CM CN 


o o o o 
Niotn 
■O'O'O'O 
CN CN CN CN 


© o o o o o 

■OMDO>OH 

m> >o >o m> rx rx 
CN CN CN CN CN CN 


o o o o h cm n 
cn ro m- in m in in 
rx x. rx rx rx rx ix 
CN CN CM CN CN CN CN 


r HvoinoNCNinn'O^in'OinninH 
* M-CN^OfS^OONOOOrsrNCNOO 
> HHiOONHnONHlQOMOMOM 

JNOIO'OOHO'OOHO'OOHOMJOrt 

-Hr<)HNwnMr<rnNVfnNv<r 

iHOMnooowooonooonoo 

lOHrxONWNHM'OOCJtNHMn 

sixrxrxrxoooo^.n^cNCNCNCNnron 

innnnoooooooooooooo 

TinUTU’JUT'O'O'O'O'O'O'O'O'O'O'O'O'O'O 

•vrxrsrxrxrxrxrxrxrxrxrxrxrxrxrxrxrxrx 

>000000000000000000 


r* m> m> rx rx 

rx rx rx rx rx 

o 0000 

WO-OHN tow 

•oNMononinoincMH 

OhMOMOCMCMOCNhO 

oifl'OO'OOOHOHnio. 

MnNinMnn^mcHH. 

onnoroooooown- 

oMinrx^nmrxcNM-rxcMi 

<rv^^wininin'0'0'0M 

oooooooooooo* 

'OMJOM3M)M)M>M3M)M)M)M3- 

rxrxrxrxfxfxrxrxrxrvrsrsi 

oooooooooooo< 


O O O M- 
O O o 
OCNOH 


oo^OHinio<on'Oio^’<>'OOinNMnoNHioHO 

intotMVHHHtootONMnHininnHn^on 

OOOOOMM*iO^r0MOnOM»HCMf*)O^OnMO 

MinMNtNCNin'ONOHnt'OOtNM’r-OOHCNWt'O'fl' 

ninin'O'O'OVVVVOOOOOHHHHHCNCNCNNCNNNC 

'O'O'O'O'O'O'O'O'O'O'O'C'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O' 

^ l ^!^!^^ ,srs ' r ' rsfs,s ‘ ,srsrsr ^ rsrsrs ' rsrxrvrs ' rs 'f N 'f^rxf s r 

OOOOOOOOOOOOOOOOOOOOOOOOOOOC 


<r <r m- in rx <r r-i -o in in 

(N CN (N h o H o OrxCM 

HHHNOO CM t-i © m 


> >o in in in 
r o ^ 

> h M M M 


3 M> M3 M3 >0 
v rx rx rx rx 
>0000 


*o o in cm 
rx in ^ o 
moiqo 


•O'O'O'O 
rx rx rx rx 
0000 


m n cn rx in mj r 

5 O H I*) H O < 

> no h n o r 

h cn in >o rx cm * 
■) in m in in >o > 

^ H H H »H 1 

O'O'O'OO'O' 
s rx rx rx rx rx r 

> o o o o o < 


m- tx rx rx 
m> mj m> mi 

H H H H 

>0 >0 M3 >0 
rx rx rx rx 
0000 


I ~i --i 6l l, U -H 

1 <tj xj \ o i q 

*j 1 •* O u -1 • 

1 cj aj u u h] 

1 0 Qj *j qj *j 

O x, U c • 

. *J *J X) ' HJ -H • 

iQjqstoOQX- 
; 13 ■-! J5 X i J Q, I 


q xj x, 
•u -h 1 x, 
Qj u vo 3 


U. U. U. U. U. XU. 

o r <Z CC ~ b- 3 3 03 -H 3 CM3 1-3 

X 3 - K CC J3fi ® Ch *-.« 1 X 1 ^ CD < 1 * 

W2 ^ Cl UJIOh XO>-Q ZXQ ZQQ ZNQ XCO 

•- ' ► x j tin - '-r <o - z - z ' - »Z' - -z> - -Z' - - 

UJ I NUJIAhN - 3 - 0C_|i-<_|i-ilrx|_JHHCSM_Ji-iflCilxl_Ji-iU3NJ 

O ' ZZ~a.CNZUJZ®UJXU.XU.' Z X U. ' ZXU.' ZXU.' ZX 

-J -J -J 

-l-I -I 

<xa.C£€QCuCLGc:Q^QQ:Qa:i=iixcLC£QQ:Q.iXQa:a.iXQGe:a.Q.Q 

CJU->CJ_J-)CJ-3_IU_|-3_J-)_/-3CJ-)_J-)CJ-).J-3CJ-3_J->U-)_l 


o x •• r~ _j 3 a 

x z ~ a. x o 03 

CNi-incnocN x_j h r rj cm in 

- uj »-i - Cl - j UJ I j Cl a: - _] - 3 _j U. - ix: 
AOriNJAXZvXJiLAXUJZXJaUl 

_l N -J N _J N 

_j z (j-j u z a _i u z 
a^a.onaz^MUJ'Do.azaciinMA 
JUUTflJHUJBQTjHJUaajT 


cn ro uj cl 

- ' M3 Z X >- 

cl - ^ ^ lc oc 

cn « 1 — a _j n. o 


cn jzq 
3 a <z o cl cc 

u. J <J u Cl (J ~1 


■C. Z » * * li. _J UJ -J * -M- -M- UJ UJ * * * CC 3 

-*CNmp00000000000©000000000000000000»-iCNro00000000000000000000«-«CNm000000^CNm00©0000 
•H^HCMn^in'ONfflo-OHCMrM'in'ONCDO'OHNnvin'ONcoo-OHNCMNCJMirin'ONajO'OHnnvin'OMDO'OHrKJCNfjMvin'ONOoajcDmo'OHWMvin 
^M-^vM-^M-^^^M-inininininininininin'O'OM)'OM3-n'O'O'O'orxrxrxrxrxrxrxrvrxrxrvrxrxa3ajo3C000CD03a3C0a3(>'O'C>'O'O'C>'i>'O'C>'C>'O'(>'C>'O'(>'' ,, “' ,v ^^^^' i ' 


O' o o 0 0 o o 

*-> CM C4 CI CN (N CN 


mj rx >0 

rx ix rx 

o 00 


in ix —* m m •oininoo^n 

cn n o - o -< m OMiininmvr 

HNOO NCM h hOhCNOCNO 

in •oomMQ'O o-cin-oono no 
h-oon t mhom vn vn 
ronoro^nno-iMoooooo 

•fl'O'O'OHninoHt'OOHfoonino 

MnnrovM-M-inininin'O'O'O'Oixrxrxo 

ItHiHCM 

mmminin^JininininiiTinininininininin 

NNNXNNXNNNXNXXNNNNX 

OOOOOOOOOOOOOOOOOOO 


oino(N»in<iHninnoi 

^orxmooNCNOorx~«( 

noNonoNonoNoi 

'OO^O'OO^O'OO^O' 

r\^r^rnfX5j-«rnrx«r5j-nr 

mooonooonooor 

CNM , '0*HroinrxcN*-'Ooroi 

oooHHHHfjrgrjnnr 

CNCMCNCNCNCNCNCNCNCMCNCMC 

ininininuTUTinininininini 

rxrxrxrxrxrvrxr^rxr^rxrxr 

oooooooooooo< 


cq m- in rx rx cm 
O CN ^ 1-* M3 O 
OhNOMO 


>inM300MjroinixnoroM3MM3inrooM30 
> ix in cn o <r ^ 0 yj cn o o <r ro ij-j cm o ro 
>ronoooom^HOOMoo-irooooo 


h X C-J X x H 

M3 rx rx rx o o 
o cn ro o ro CN 

h mi in m) in n 

M) N h O h O 

0 o n o m ro 


in n *r n h ih h 
vr o n x <r in cn 
n o h n n cn o 

in M) in o in M) o 
N O H N X X n 

nononno 


iiTXC'nninininxN'r'OorjM'OxofjnxortirinxrtMnnnMiownoinrQnninxNvMJO 
nnvrvr»vr«MrinininM)M)MiM)M)XxxxooooOHHHHHHrK<(NnnnnnnnvMMrin 
r-j cn C'l r-i cn cn cn cn cn cn cn cn cn cm cn cm cn cn cn cn r*> m to m t*j m i*> ro r*) ro ro ro to 10 r*j ro ro ro m ro r*j 10 ro r*j ro 
in yj in in in in in ut ut in in y-> in ut in in in ut ut in in yT in yT yi yi in yT yT yT in ui in y-) y-j in in in in in yj in in in in 
rxr-''rxrv(xrxrxrxrNf\rx(xrxrxixrvrxrxrxr'*rxrxrxfxrxrxrxrxrxixrxixrxfxixrxrxixrxrxixrxrxrxix 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


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


Number 24 

163 



0 O <N 

U U ~f -U -s 

■u -U O 0) U, 

» in o « bi 

HJ 4J 

C C -U V pH 0 

0 0 <u - **s c : 

t, tt » o <u +-> 

a; -u is is 3 

a w 5) o fl 

0) Q) .£} N 4J N — 

t> b> W) 

m m ^ 0) 

to to h a: 


■C Q) U 

*J is (\. «j qi 

O X *1 U 

<0 U Q> T3 Cn 


*■ T3 ^ -u 
8 8-8 


TJ <0 ID *j 'H Hi b 

is +j -c oi m c 
'aisoxj.qao:* 


c i» « *j o <3 

O C -1 t) 8 *J c 

*J O -C C Qj c -~l 

to O u H C 'S J3 


r o i 

3 r x 

Z Q UJ 

*- -I 2 Z 

LU<IUH- 

O^UIlN 


OCI-J 

o - ui <r 
ro o o :> 


o <r k j n 

n - Ui c o u 

OUOODOUOA 


I I 

cn cn cl cl r- 

33QQu.OAOUJ 

Clu.JJUQ.JQ.CC 


CNro©ooo©oo©o*-«cNro< 

NNooo>OHNn^m-oo«o>or 

roMroM^ww^<r^<r<r* 

nonmonioromoMioionr 


:«J <c« _j _j 

» -J OCJQ -J -J CJ U CJ A Q J J u u 0. I- _J CJ CJ U CJ 

!«CCfl:Q:2Q««JJJ2QQ<I<I2aQ > OliJ«JJJJ( 

.UnQCQC^JUUQCQCQC^^JUCJC^UQ.QCUQCQ'^IC. 


>0000»-*(NM^ , 0000000000000000000000OOOOOOO 

JC'!ro^ininininin'*OPNOO<>*o*HCNro* , in''OrNa)ch©*4CNro^in , oiN©o*©«HCMro^ 

uninmninininininininin-O'O'O'O'O'O'O'O'O'ONNNNNNNNNMDajiDfflCQ 

irororororororororororororororororororororororororororororororororororororo 


Z <1 3 O *-• 

«h-_JX CN Z rN O CL >- O 

► u <x uj a in - o >o u .cl v ► v 

ao^za a ri u o C'i lu >-h <x r-j 

UJ u. 

-J -J _j y- u. 

j j j q o. h a a r— >-3 a 
o<i<r«aoujQ.cc33UJ aa uao. 
juuu«ro.ccuno(occ a ju 

<t K 
ct: 3 

UJ l-O. 

<1 A UJ Z 

x r cd •-* r- 

U 3 UJ 

I Z * * * » CD 

oooooooooooo^(Mn<roo© 

in'ONOO-OHNIOVin'O'O'O-O'ONCDO' 

OAAAOQ<IMMMMS^(HSQ-0>Q>0>I)> 

rmemmoioioioioioioioioroioionio 


^'OfN^-rs^'fN^'TH 

wnoocvmHMM 


OM^^ONMO 

-OHinoNoon 

m wnowonn 

■ONMO'OO'ONh 

NNHIDMONNH 

rororooroorororo 


<r o *• rs 

cm rs inn 

«-< CO fO © 

in in in in © r 

HHOnin. 

ro ro ro ro o < 


o © 
© cm rs 

ro *-< ro 


CM cm n © 
rs o o >o 

CM O © CM 


ininininin > 0'0'0'0'0'0rNrsrN^nv(Noo©OT-4iH*H*HiH«HiHi-iCMCMCM 

nnnnnnnnnnnrofmnnnooooooooooooooo 

'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'orNfNiNrsrNrsrNrNrNrNrNfNrNrNrN 

rsrNrNrNrxrNrNrNrvfNrsrsrNrsrNfNrNrNrNrNr^rNrNrNrNrsfNfNrsrNrNiN 

000©©©©0©©©000©©©©©©©©©0©00©©000 


rsrNM)rNioinrNfNrs>o^rsio»n'0»H«o^^inrNrNrNrNNininin©^^'0©'0'0^ 

^ l ^^-^^HOoosro-H^-.trorNo-H-H©©ooo^--<-.oo^NrNCMrjTH 

ooMHioiooooioNHioioiiNionionooooHioioncMioiorooioioio 

2SCi5!f2 on, ' ,n,0O,H(V,,no(NM ^'0 r>s ‘^M^inMjrNCMin©^cMninfN^n^-^ 

toMronn^'v^-^-^-inininin'0'0'0>0'0'OrNrsrNrNrNrNo©»-«^»H»H^H»-iCMCMCMCM 

00000000000000000000000000*-i»-<*-s»h»h.h»-<*h»h»h»h.-s 

rNrvisrNiNiNrs.i\rN|VviNiNrsvrNrNrsrNrNrNrNrs.iNfv.rvrsrvN.rNrNrNfNrNrNrNfNrNrNrN 

rsrviNrNrv.fNrvfNrNNN.rNrvrNrvrsrNrviNr'.rNr'.fNrNrNiNr'.rNrNrsrNfNrNrNfNfNrNrs 

0©©©©00©©©00©©©0©©0©©©©©©©©0©0©©©©©0©© 


N N N N N 
fN fN rs fN PS 

© © o © o 


c l§ “-il 

01 3 c O. <« 4J J 
•C -t-i 

■U *J *. 'O +J - 

i OX* H j) ' 
I «. 4J 0) O bn 

: u c c *j -H t 


<0 T3 >Si 
j -c c 

: -u »o ts 

) -*J u $ 

i, <U Q) fn 

; 0s 42 at 
j 0) <+s *j 

j -u 3 --s Q) 

( S iJ 


» u q> 5 

tJ QJ -H 

i e n, u 

: hj 0s (o «j; 


■u T> u. a: 
h c t 

i 'Q tJ 
O, U 

ss 


A -J •> O I 

•* I ~ O - 

»-r r - z r - - u. u ~ 

0.3 3 CL 03 3 IN «■* _| 3 - a 

OCZ Z r CD Z Z INO-IA — OXT 

i- x o x o: 3 i- > ►xcxoanAvQ. j . j 

Z UJ - UJ - UJ - N UJ - UJ - - - N - A X _l U. 
w Z A Z (J « O > ZZAZ_IXCJ~<I~~X~ 


uj ro « <r 

u <r A A 

« - *4 

0. UJ - 3 N N 

cnaci-ujzuz 


Q.U. CL UJ 

r 3 o. z 

3 A *-s 

~i CL * * * _J 


OOOOOOOOOOOOOOOOOOOOOHW 
'0N0J0>owNn^in'0MD0>OHMnvin<i>0'0 
iNfNiNfNoommcDooiiicriajcDCDo*0'i>o*o*0'0*o*o* 
CM CM CM CM CM CM CM CM CM CM CM CM CM (N CM CM CN CN CM CN CN CN CN 


roooooooooooooooooooooooo«M(Nioooo«Hro*-oooooo*-4CNi*)ooooooooo*-4 

*oNO<^o»-tCNW^in'ONa>©*©^CNr»)^'in'ors.coO'0*o*0'©~«CNCNCNCNm<rm'OfNcocooooo©‘©»-»CNm<rin'OfNiN 

(MHMhOoooooooooHHHHrtHHHHHHHHNNCNr'iNNNNCNtNNCMf'iCMNCMnnnnnnnnn 

CNCNCNCNnMnnnronnwnronnnronronwmmronnromnnmnnrnrornnnnnnnnnromnnmrn 


* 0 ^- *r n <t * <r 

m *h ^ o cn in m th ^ 

*HO © H H m o o o 


in in rN in 

H rt O H 

w ro ^ n 


>o *o *o *o 
rs in in rv 
© © o © 


in in in >o o in rs 
-< in *-• rN <r ^s o 

HlOfOIOOlOH 

* c-j >o *■« n in © 

O O © H H H f'J 
CM CM CM CM CM CM CM 
"O *0 -O >0 >0 >0 >0 
rN in rs rN tN in in 
© © © © o © © 


in in o >o cm >o 

*-• ut <r rs 

ro ^ y* © © i-< 

sr in *o © ro 

rg cm cm cm ro ro 

CN CN CM CM CM CN 

*0 *0 *0 *0 *o *o 

rs in in jn rs in 

o © © © © o 


CN *4 CM 

*o >o <r <r 

© ^ © © 

^ rs o ro *o *o 

ro ro <r <r <r 

CM C J CM CM CM CM 

*0 *0 *0 >0 *0 *0 
fN IN fN IN IN rs 

© O © O o o 


in >o m *-i -h 

<r rN in >o <r 

ro o ro ro © 


NOhOO 

ro o © © in 

ro © © © cm 

>o ro >o ro in ^ 

rs CM fN cm 

o ro o ro ro ro 


© >o «-» cm o rs 

rN rs o in rN ro 

ro ro © ro ro ro 

in^'cminoincN*-* 

HCNNHnvrjOH 

roooroooororo 


ro ro o roo ro ro o o o o ro ro©ro o ro o ro ro ro roooroooororo 

'0'0©CM^-'OrNo^cMro'r'orNocMroin*oo»-tro^-'orNiNrNNCM'rininininrN^iroin©^sH^^i5rrN^^iniN©ro^- 
'rtininininin'0'0'0-0'0'0>0NNNNNoooooooooHHHHHHHri(Mf-jnnnnnnnM'<r<rviniiiyT 
r-JCMCMCMCMCMCMCMCM cm cm cj CMCMCMCMCMCMCjrororororororororororororororororororororororororororororororororo 
'O'C'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'OMJ'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O 
NfsNNNNNrLNNNNNNNNNNNNNNNINr^NNNrNNNr'NNNNNNINININrNrNNINNINNNNNN 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Number 24 

164 


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


Page 17 




2 ' ' UJ 2 Ci 

OONH u 1-1 oo 

<r u <r a 

- •• o - z> n. - o - cc a: o- 

u«o«t-tn<r«i»u uj hh 

u. 

_i _j m u. 

■J -J 2 3 

ccoccQ^coiQii a cn in 

T JTJUUJQ J1 Q Q 

»- 
3 

U. U. U. 

UJ CM 2 3 3 

2 h- uh iXi 1 X 1 

2 2 ^ 2 

<X O * * * A m 

oooooooooo*-«cmmoo 

HfJM^in'ONDBO'OOOOHN 

'O'O'O'O'O-O'O'O'Oi^rsrsfsr^rv 

'r<r<r<r^r*r<r<r<r»T<r<r<r<r’r 


'On>o^'Hin>omjTinnov' 0 'Oor)Hn©N*r<rfjvN 

OUTM'OUTinMNMNrOfJ'OfJOin'OOHNwCJNVf'IN 

h ri rj n o h ri rj f'j n o o h rj ruj n n to o h h n n n 
cm ^■<r«r<rinininuoinm' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 r , sfsr^rsr > sr^ 

© r\r\rsrsi\Nrsrsrvrvrsf\rvrvrvrvrvr\iNrvi\i\rvrsrv. 

©oooooooo©oooooo©oooooo©oo 

t r £ 

2 *- Q O 23302U. 

OO X 32 KHU.IlU.h22 © 2 h 3 

2 <t H- UJ Q CL CM O O O 0 1333 V JQHI-t-<[tt 

O J0X2bl2HnIiijH>.22iBiSaiUJ«HUJX<02 
2U.22<IZU.>-ZlflK2>-HfllXHm25I02t<lH 

ooonoooo^MinNNfjN’OO-ON^VHn^Nir 
n n n h Mn h n r-j <o f j o in r j >o <o n o iii h rm n h in 

n o h n m o h h nn n o o h h cm cm ri n n o h h m n n 

© ^■<r<r<ruTUTioininin'0'0'0'0'0'0'0'O'0rvfvrsisrv.rs 
©rsrsrsr^rsfsNNNrsrsNrsrs.r^Nrvr , srvrsrsrvNrsr , v 
© 00©©000©0©©000000©00000©© 

UJ X OZKU) h 

W Q (J 2 23 UJHH 3 U. 

(J CC O UJ >- <X U.U.UJC 2 AUI(nQ 3 

« NOt-UK 0 . ^ in LH(J 3322 X 2 QO 20 J 
iLhZ 2 UJUlNHrtiLKHX 3 W 0 aiaHMUi 303 Hil. 

nmzuaizxzjuzxuixocQjiLZZCi-aiai 


V 'l -V 'J -v UJUJUIUJUIUlUIMJ'g'O'O'O'OSJ-OIMNMVMN 

© rsrvrvisNrsNr^rvrsr^rsrsrsf^fsisrvrsNNisrvNfv 
O 0©©©0000©0©©00©00©©©0©©0© 

a 3 CL H 

<x 2 3 <1 2 U 

O I- a 3 wIl1lU.2 0'ChCD CM 

J H 2 2OOK^IDt0UJC333UhXZHhh 

>h2UJO<T-flyHu.KHHOIOi5iS«<IXUJOX33 
HU131flUZZtnZJIiJZZLinjLNu'ifi2Z2ZOO 


o n h w o in © in 
©>o©'Orsrs in cm 
© cm o cm m m mom 

O'OO-oininHO'OM 

r^rvMr^»H*HisM©© 

OOOOMM^HOOM 

•oon^'OH«rinNH«r<r'r'rN 

rjMMMM<rccvininininiiiN 

MMMMMMMMMMMMMMM 

f\rv.rs.f\rvrsrvNr\r\r s sr\rvrxr\ 

rvrsrsrvrvrsrsrsrsr^rvrsrs.rsN 

©00000©0©00©©00 


'OO^HiniO'O^WinONHN^O^OVH-ONHINH 
uTinoiniN'Oino^roMM'OMMini^oMO'OMoo 
UNhNNMOhNNMMOOhNWNMMOOhNM 
o -H<r^-^-^‘inininininin«O' 0 ' 0 ' 0 ' 0 ' 0 ' 0 '<jr < sr^r^r'.r^ 

O ONNNNNNNNNNNNNNNNNNNNNNh 
O 0©©©00©0©000000000000©0C 


X X K O 
cn u uj cl r 

KhU.U.u.iCIIK3W 

Q(L33IUJXh03 


mwvuu U- LL -»v uj rj ILru.U.U.XLLILJU, 

2<r >u.roujino 2 n h n Qa.332u_jxi-or 
>-ac ujAKi-zini(hHa.uH>-zxiiiCD3«cLJZi- 
tnuj ^Ni(n«z(flziLJozxH#>-i-)a^zHmii 




<rin»-iOfsrsMMr^^orv 

MhCIhOhOh^Oh^ 

hCMOMOMOMCMCMMCM 


cm n cm rs in 
0 rs rs cm 
© M M O M 


in'OOMninw 
hMTNhNh 
M M O M M M M 


in'OO'OO-OOMCMM'O^H'OO-Oin'OM 

HNWMiTMi-JO'OONVMnNHOO 

MMOMOMOMOMOOCMOOMOM 

imfiNHMinNH^Nfj^NONVNH- 


<r <r -o in in 

o © rs CM 

Oh O M 

W in N in >0 M 
»h m m ^ 0 0 

M M uj M O M 


*r <r ^ 
’H CM -H uH 

O *-* O o 


M li") CM ■uj 
in © OO 

CM O © 


<o >o cm in 

O OMM 

’H O M 


m v •<) o o <j <h m in <0 n h m tkj n iii n h m iiT i\ u «r n n n 0 n v n h <r v »r <r n h n n nh n cn n m 
MMMMMM< r<r^^'<TiniiTiiTiniiTinin'0'0'0'0r v srvr s soo©’-i^H’-<»-<C'jr‘'jr'irjCMrjMMMM^'<r^r , T<T 

r r r r r r ^ r r r r r r r r H r H H H rt H h n n n n n rKKKj ri n r * rj r * 01 ^ ri ^ 

rsrsisrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsfsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrs 

rsrsfsfsrsisrsrsrsrsrsfsrsrsrsrsrsfsfsrsrsrsKrsrsrsrsrsfsrsrsrsfsrsrsrsrsrsrsisrsrsrsrsrsrsrs 

©©©0©00©0000000000000000©©©©00©00©00000©©00©000 

Page 18 I 


MnNmiTMnNMH-coMnoH^ijmin'flM 

(MHMHHOHHio-OMniiTinMHMHMHOO 

-hMjhMM*-*M-iMMMOCMM©O^M»hM©M 


in >0 N N 
-« O O ^ 
M O O »H 


•ONNM'OeiNin'ONONVinNHlMM'ONN^NNNNCNI^in 
^■vinii‘)in'0'0'0'0'0isr^r^.rsrso©©©©'»-i»Huj»H^»j(MCMCM 
CMCMCMCMCMCMCMCMCMCMCMCMCM CM MMMMMMMMMMMMMMM 
fsrsps.rsrsrsrsfsrsrsrsfsNfsrsrvrsrsrsrsrsrsrsrsrsrsp\rvrs 
rsrsrxrsrsfsrvrsisrsrsrsrsrsrsfsrsrsrsrstsrsrsrsrsrsrsrsrs 
©00©©©0000©0©00©©000©©©000©0© 


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


Number 24 




EXIT THIS REVIEWER 

Jef Raskin 

Director of Communications, 

Apple Computer Co. Received: 78 Jan 19 

1 have accepted employment with APPLE Computers, Inc. 
It is a case of putting their money where my mouth is, and 
now I will have a chance to apply my criticism from inside 
a company. Since I will be Director of Publications there you 
will know who to blame if, in a year’s time, their manuals 
aren’t up to snuff. Some other reviewer will have to judge 
if I’ve succeeded. 

This (except for a few that are in the works and may 
appear in print after this one) is my last review. I will probably 
continue to write opinion articles, but will no longer cling 
to the mantle of objectivity. At the end of this article I will 
have a few words to say about my new employer’s products. 

But on to a review. A reader called and asked me about 
Electronic System’s kits. He pointed out that the company 
looked fishy, having a Santa Clara phone number and a P.O. 
Box in Burlingame (Box 212, Burlingame, CA 94010). No 
street address is given. Burlingame is in San Mateo County. 
I told the reader that I would find out what was going on. 
I called them up, and after evading the answering service to 
talk to the real wheels, found out that the separation was due 
to their desire to keep a continuity of address for their 
customers after they had moved. Fair enough. They use a 
box rather than a street address to prevent their being ripped 
off (which apparently has happened once). They went a 
bit further and agreed to send Dr. Dobb’s a small kit for 
review. Any company brave enough to do that can’t be all bad. 

Their catalog is labeled: “Hobby Computer Kits”, but 
should be subtitled: “mostly for those with a strong electronic 
bent”. These kits are not for beginners, nor are they intended 
to be. In fact, Electronic Systems prefers to just sell boards 
for most of their kits. You can scrounge up the parts, follow 
their schematic, and modify away to your heart’s content. 
The kit I got was their RF Modulator. It’s $13.50 with built 
in power supply and regulator (to run off a 12VAC center 
tapped transformer, 8 volt unregulated supply, or it can run 
from a regulated 5 volt supply) and with the parts supplied. 
Almost. The obvious unit for comparison is the Pixieverter. 
The Pixieverter (which works fine) requires —6 volts which I 
find sometimes hard to come by in my TTL breadboarding. 
So I appreciate Electronic System’s choice of operating 
voltage. It also makes their unit a very good buy for the 
money. 

There are no “put square peg 1 into square hole 1... ” 
type instructions. Just a schematic and in this case, a slightly 
off-register but clearly silkscreened parts placement on the 
printed circuit board. Layout was clean and professional. 
I discovered that C7, a 3Pf capacitor was missing from their 
parts list in the catalog, on the package, and was missing 
from the kit too. Consistent, at least. Unfortunately, the 
schematic and the circuit do require C7. I didn’t have any 
in my parts box so I just twisted a 3/8 inch pair of solid 
insulated wires together to make a capacitor (what Hams calls 
a “gimmick”). 3 Pf isn’t much capacitance, and any two 
conductors in the same room together have some capacitance 
between them. 

You have to wind a coil yourself. There is a note telling 
you how to do this: 

COIL —3 3/4 turns of 22 AWG wire wound on a no. 2 pencil. 

I quote this exactly. If you can’t recognize a piece of 22 AWG 
wire you shouldn’t be building this kit. It just refers to the 
gauge of the wire. You also should know that this wire gauge 
is not too critical. If you get a finer gauge, the coil will be 
rather unsturdy, but will work. A little heavier wire is OK 


too. The kicker is the specification of a no. 2 pencil. Since 
the pencil does not become part of the circuit (it is just the 
form for the coil—although they doen’t say so) it is unclear 
just what difference the hardness of the lead makes. What they 
meant was to use a standard 5/16 inch thick pencil as a form 
for winding the coil. A 5/16 dowel will work. Again, this kit 
is meant for people who will automatically figure this out 
for themselves. No hint is given as to how to read the values 
of the components given with the kit. The components seem 
to be of acceptable quality. The capacitors that were supposed 
to be Silver Mica were indeed of that type. 

While I do think that Electronic Systems could be a bit 
more careful in their documentation, I believe that there is 
a place in this world for kits such as these, where one can 
substitute knowledge and experience for money. These kits are 
inexpensive, and in this reviewer’s opinion, a good value. 
Those who are not in a position to figure out sparse 
instructions will have to pay more elsewhere. Many of their 
kits seem fascinating, and there are a number that seem 
downright handy. They have a UART and baud rate generator 
kit for $35.00 (board and schematic only $12.00), a modem 
kit for $27.50, a very appealing RS-232 to and from TTL con¬ 
verter kit for $7.00, and some others. Write for their catalog. 

Electronic Systems also offers a memory board and their 
TIDMA—which is a Tape Interface Direct Memory Access 
board—which only comes assembled and tested. It sounds 
fascinating , but you will have to write to them for details. 
Their catalog contains schematics, and is quite educational 
if you know which squiggle means what. 

I promised a few words about my new employer’s 
computer. The APPLE: it is a very neatly packaged 11 pound 
computer that is unusually complete. It uses a home TV 
(preferably color) for output. It comes with built-in speaker 
and joysticks and the associated interfaces, and with a built-in 
cassette interface. The keyboard is built in as well—and it is 
a pretty good keyboard (compared to the PET it is an 
excellent keyboard). BASIC is in ROM and comes up at the 
press of (three) buttons. The APPLE is fun. But it is not, as it 
stands, too serious. You can’t (from within BASIC) store data, 
but only programs on the cassette. The screen is upper case 
only, so you can’t do text editing. The BASIC is integer only, 
so you can’t do business or most scientific applications— 
although APPLE does provide a floating point BASIC on 
cassette. It is called “APPLESOFT” as it was written by 
Microsoft which has provided so much of the personal 
computer software. Both APPLE BASICs provide color 
graphics in an easy to use form, which is one of the chief 
charms of the machine. It is probably the best computer 
around to use to teach programming in BASIC. 

The hardware is especially good, it is a very reliable 
machine, as I have learned in some 12,000 miles of traveling 
with one in its optional leatherette (i.e. plastic) carrying 
bag. The switching power supply is both light in weight and 
more than adequate, and I have had no overheating problems 
at all. You can’t even warm your hands with it in a cold 
hotel room. Unlike the PET which limits you to a measly 
8K, the APPLE II has room for 48K of RAM inside the 
little box, and upping the memory merely requires changing 
three jumper blocks and slipping the appropriate chips into the 
sea of sockets provided. An 8K APPLE costs $995 compared 
to the $795 PET, but the PET does contain its own cassette 
recorder and video display. My thoughts on the PET were 
published in the September/October (1977) issue of Personal 
Computing. The APPLE II is a lot classier. 

The existing APPLE II documentation is very poor. But 
this is what I am trying to change, as I said. I think the APPLE 
has a lot of potential, otherwise I wouldn’t have gone to work 
for the company. It’s not on the S-100 bus (it’s not 8080 or 


Number 24 

166 


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


Page 19 



8080 QUICKSORT 

by Mike Gabrielson 
P.O. Box 2692 
Stanford, CA 94305 


1 

d 

3 




* QUICKSORT 

- *1*6 

GAPWIELSO* - 12/1/77 




* ACCEPTS! 

A = ADDRESS (iF FIRST RECORD TO SORT 

5 






Hi s ADDRESS OF LAST »E10WD TO SOwT 

7 




* UUlCK 

IS A 

RECUR 

SIvE ROUT INF. . . . 

9 





PRUCEDURE QUICK (DE, hl) 

1 0 





IF DE 

>: ML 

Then WETURN 

1 1 





else 

PARTITION TP FIND K 

Id 





QUICK 

(K + l » 

HL) 

13 





QUICK 

(DE, 

K-l) 

1 m 





RE f uR 

* 


16 




* partitioning swaps data and produces an addkess k. 

1 7 




* DE < = 

K <s 

hl, SuCw That ALL DATA TO ThE LEFT OF K 

16 




* IS LESS Than ThE 

0 A1 A AT K, AND DATA TO THE WIGHT 

1* 




* IS GREATt* 

. THIS IS DE SCRIBED IN VOLUME 3 OF knjIh 

20 




* ThC ROUTINE IS CODED FOP SORTING ONE bYTE RECORDS, 

21 




* BUT 

HE SI 

x comments indicate rhat to change to sow 

2d 




• RECORDS OF 

OTHER 

LENGTHS. 

dl 








2u 

ouuo 

4 

C03200 

QUICK 

CALL 

UE_HL 


2b 

UUU3 


do 


RM 



do 

OOOM 


05 


PUSH 

WO 


21 

0005 


E5 


*>uSh 

Rh 


db 

U006 

N 

CD3POO 

LOOP 

CALL 

DE_hl 


2 9 

OOOv 

w 

DA 1F 00 


OL 

RIGHT 


30 

O00C 

N 

CJ5D0U 


CALL 

SwAP 


31 

OOOF 


13 

LEFT 

INCP 

WO 

1 - make DE POINT 

$ 2 

0010 

K 

C D 320 0 


CALL 

DE.hl 

TO NEXT RECORD 

33 

UUl 3 

ft 

CA2600 


9E 

FARTED 


3* 

Ud 1 6 

W 

CD 3800 


CALL 

OE_hl 


3b 

U 0 1 9 

N 

uAOF 00 


6 L 

LtFT 


3e 

ouic 

N 

CD3800 


CALL 

Swap 


37 

UU1F 


2H 

RIGHT 

DE CP 

RH 

2 - make HL POINT 

3b 

002u 

W 

CD320 u 


CALL 

DE_hl 

TO PREVIOUS RECORD 

39 

0U2 4 

K 

C20600 


«NE 

LOUP 


MU 

uu2b 


E3 

PARTED 

*ThL 



Ml 

U027 


1 4 


INCP 

RD 

3 - MAKE 0E POINT 

M 2 

0028 

W 

COO 00 0 


CALL 

QUICK 

TO NEXT RECORD 

m3 

0028 


tl 


POP 

NH 


UM 

002 C 


26 


UECP 

Rh 

M - MAKE HL POINT 

Mb 

U02U 


Dl 


POP 

RD 

TO PREVIOUS RECORD 

46 

002t 

R 

CD0000 


CA(.L 

QUICK 


iil 

0031 


C 9 


Rt 1 



MV 

0032 


7A 

Ct.HL 

LH 

W A , RD 

COMPARE DE TO HL 

50 

0033 


bC 


CR 

R A , w H 


51 

0 0 3m 


Cf» 


RNfc 



5 2 

00 35 


7o 


LR 

nA,RE 


53 

003b 


bO 


CR 

ra,«l 


5m 

0u 3 7 


C 9 


RE T 



55 




* 




5b 

0U3t* 


1 A 

DE__HL 

L 6 A 

hO 

5 - COpPAWE kE CURDS 

57 

0039 


bt 


C 

nA 

POTNTFD Tu bY DE# hl 

5b 

00 3* 


C9 


WE 1 



5V 




• 




60 

0U3B 


1A 

Swap 

Lb A 

wo 

6 - SWAP RECORDS 

bl 

U03C 


Mb 


Lb 

Mb 

POINTED TO ttY OE# hl 

b 2 

0030 


77 


STb 

W A 


63 

0U 3E 


7H 


LR 

H A,RH 


6M 

O03F 


12 


ST A 

WD 


65 

U 0 4 0 


C 9 


WET 



#>b 




• 




67 





EnD 




Z-80 based so it wouldn’t be anyway) and there aren’t a lot 
of accessories available for it yet. On the other hand, it comes 
with more built in than any S-100 computer, e.g. color 
graphics a la Cromemco’s dazzler, A/D to run joysticks (and 
it comes with two single axis sticks), cassette interface, BASIC 
in ROM, programmable louspeaker output, keyboard, room 
for memory expansion without buying boards, etc. So it’s a 
toss-up in that regard. I am not getting rid of my S-100 
computer. 

I expect APPLE to come out with RS-232 interface, 
upper and lower case display, floppy disk interface, and all 
the other goodies that I can put in my Poly-88 (which, dear 
fans, still runs great). 

I would like to thank the hundred or so readers who 
sent in helpful letters spurring me on to write more reivews, 
and the three or four who gave me hard, but useful criticism. 
Thanks to Jim Warren for putting up with me, and to the 
neat people at People’s Computer Company who publish 
this Journal. And a big thank you, and my admiration to 
the many manufacturers who sent us equipment for scrutiny* 
and hope that the new reviewers) get as much cooperation 
as I did. 


ELECTRIC PENCIL WORD PROCESSOR FOR 
NORTH STAR DISK 

News Release Received: 77 Dec 28 

The Electric Pencil character-oriented word processing 
software allows text to be entered and manipulated at any 
location as a continuous string of characters. Lines are format¬ 
ted automatically. Features include cursor controls, global 
search and replace functions, bi-directional scrolling, right and 
left justification, wrap around text as well as character, line 
or block insert and delete. Page formatting is at the control 
of the user. The Electric Pencil has its own DOS. Storage and 
retrieval of text is simple and automatic. Six versions are 
available for North Star including SOL-20, VDM-1 or VTI 
videos, standard printer (TTY, etc.) or Diablo HyTerm. 
Minimum system hardware for 8080 or Z-80 micro is 12K 
of memory, printer plus interface, video monitor plus VDM-1 
or VTI interface, North Star Disk and/or Tarbell or CUTS 
cassette interface and recorder. Available from local dealers 
or from Michael Shrayer; 3901 Los Feliz Blvd.; Los Angeles, 
CA 90027. 



PERCOM CIS-30+ CASSETTE 
INTERFACE TO MITS 680B 


News Release Received: 78 Jan 13 

Percom Data Company released technical memos describing 
how to use their standard CIS-30+ interfacing unit with the 
MITS 680b computer. Long used with the SWTP 6800, the 
CIS-30+ interfaces two cassette recorders and a data terminal 
to 6800-based microcomputers. 

The CIS-30+ provides user-selected cassette data rates of 
30, 60, or 120 bytes per second, and data terminal rates of 
300, 600, or 1200 baud. The two cassette interfacing circuits 
are independent and operations such as cross filing therefore 
are possible. Optional program control of recorders is available. 

Cassette data recording is KC-Standard/Bi-Phase-M 
(double frequency). The data terminal communication mode is 
full duplex. 

The MITS 680b PROM monitor may be used for loading 
and running programs, except for flipping the tape switch to 
ON for program loading. 

The CIS-30+ sells for $79.95 in kit form, and $99.95 
assembled and tested. An instruction manual is included. For 
MITS 680b applications, users should request PERCOM Tech 
Memo TM-CIS-30-09, “Using the PERCOM CIS-30+ with the 
MITS 680b Computer.” 

Optional accessories include an IC socket kit ($4.95), a 
Remote Control Kit (for program control of recorders) 
($14.95), and a test cassette with operating software ($4.95). 

Contact PERCOM Data Company, 318 Barnes, Garland, 
Texas 75042; (214) 276-1968. 


Page 20 


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


Number 24 

167 





SMAL/80 BUBBLESORT 


SMAL/80 MACRO-ASSEMBLY LANGUAGE 
FOR 8080 AND 8085 

News Release Received: 78 Feb 6 

CHROMOD Associates has announced the development of 
SMAL/80, a compiled, structured, macro-assembly language 
for 8080 and 8085 microprocessors that requires 7K of 
memory. 

SMAL/80 statements are written in a symbolic notation 
resembling PASCAL and PL/M that simplifies the writing of 
assembly language programs. SMAL/80 also incorporates the 
basic structured-programming constructs, the DO-END, 
IF-THEN-ELSE, and LOOP-REPEAT, which may be com¬ 
bined with and/or nested within each other without limit to 
form complex statements. The code produced by the compiler 
is as efficient as that written in a traditional assembly language 
by a skilled programmer. 

The SMAL/80 package includes a 2K macro preprocessor 
written in SMAL/80 that extends the usefulness of the lan¬ 
guage. The macro preprocessor permits conditional expansion 
of statements, unlimited nesting of macros, and has a natural 
notation. 

Also included in the SMAL/80 package is a translator pro¬ 
gram that allows one to convert any 8080 or 8085 program 
written in standard Intel mnemonics into SMAL/80, but with¬ 
out the constructs. 

SMAL/80 is a revision of SMAL, and 8080 language 
developed by Dr Charles Popper at Bell Labs. The original 
SMAL was implemented via a SNOBAL preprocessor running 
on an IBM 370/168. SMAL/80, also developed by Dr Popper, 
has been redesigned and can now be compiled directly on any 
8080, 8085, or Z-80 machine. 

SMAL/80 is being offered initially in CP/M and ISIS I disk 
formats. Price, including documentation, is $75. In the near 
future, a Z-80 version of SMAL/80 in the same disk formats 
will also be offered, as will various relocatable tape cassette 
formats that incorporate linking loaders. 

Write CHROMOD Associates, P.O. Box 3169, Grand Central 
Station, New York, N.Y. 10017. 


STANDARD BUBBLESORT 


SI7E: 

E0U 

255 

;max size of ARRAY 

LOOP1: 

MVI 

D,0 

;reset "switched" flaa for 




;i teration 


LDA 

N 



MOV 

B.A 

;number of list elements 


LXI 

H,ARRAY 


LOOP2: 

DCP 

B 



J7 

NEXT1 

;no more pairs left 


MOV 

A.M 

;first element of pair 


I MX 

H 



CMP 

M 



OP 

LOOP 2 



MOV 

C,M 

;do an interchange 


MOV 

M,A 



DCX 

H 



MOV 

M,C 



I NX 

H 



MVI 

D.l 

;set the "switched" flag 


JMP 

L00P2 


NEXT1: 

MOV 

A,D 



ORA 

A 



JNZ 

L00P1 



HLT 



N: 

DB 

SIZE 


ARRAY: 

DS 

SIZE 


END 





SIZE EQU 255 
LOOP; 

0 = 0 /* reset 

A = M(N); 

B = A 

HL = ARRAY; 

LOOP; 

IF —B ZERO 
BREAK; 

A = M(HL) 

++HL; 

IF A : M(HL) NEG 
THEN DO 

C = M(HL); 

M(HL) = A; 

-HL; 

M(HL) = C; 

++HL; 

D = 1 
END; 

REPEAT; 

REPEAT WHILE [A = D; A = A 

N: BYTE SIZE; 

ARRAY: RESERVE SIZE; 

END PROGRAM; 


/* max size of ARRAY */> 

"switched" flag for this loop 
iteration */; 

/* number of list elements */; 

/* if no more pairs left */ 
/* first element of pair */; 

/* an interchange */; 

/* set the "switched" flag */; 
A] NOT ZERO; 



ADAPTER DOUBLES DECWRITER SPEED 


News Release Received: 78 Jan 23 

The Larks Accellewriter™ adapts any LA36 DECwriter to 
operate at 600 baud. The adapter converts the standard 110/ 
150/300 baud DECwriter to 110/300/600 baud. It changes the 
internal timing of the DECwriter and causes it to print at 60 
characters-per-second. Installation typically takes less than 
one hour and requires the removal of two integrated circuits 
from the logic board of the DECwriter. These are replaced 
with low-profile IC sockets. The Accelewriter is then installed 
in the board in place of the two original IC’s, and the logic 
board is reinstalled in the DECwriter. 

The DECwriter can be reconverted to its original electronic 
configuration by unplugging the adapter and installing IC’s of 
the original types in the sockets. This takes less than one 
minute and requires no tools. The Accelewriter causes no per¬ 
manent modifications to the DECwriter and does not interfere 
with the installation of standard DEC™ option boards. Price 
is $95 and delivery is from two to four weeks. Installation is 
available in selected areas. Contact Larks Electronics and Data, 
Box 22, Skokie, IL 60077; (302) 677-6080. 


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

168 


Page 21 



A Line-Oriented PILOT Editor 


BY DAVID J. MORGAN 

University of Texas at Dallas 
P.0. Box 688 
Richardson, TX 75080 

Dear DDJ: 

I have written a line oriented editor for Dr. Starkweather’s 
PILOT ('DDJ, April, May, 1977). My program takes an 
additional 629 bytes of memory and provides nine editor com¬ 
mands. 

The attached program listing shows the assembled output 
and assumes that the PILOT source program (as shown in the 
May, 1977 DDJ,/ has been assembled with it. User documen¬ 
tation, in the format of the April, 1977 DDJ PILOT documen¬ 
tation, describes the operation of the editor. Thus, the routine 
can be implemented by assembling my code at the end of 
Starkweather’s and filing the documentation in place. 

Interfacing to PILOT is easy due to the modularity and 
well planned design of the original program. The steps are 
as follows: 

1. Since we are extending PILOT we must change PBUFB 
which indicates where the user program area starts. 
Change the following line (originally the sixth line of the 
program on p. 18 of DDJ, May, 1977): 

PBUFB EQU 1000H 
to: PBUFB EQU 11A7H 

2. Change the JMP in the vectors (so that when the user 
enters edit mode the machine does not jump to the 
monitor) from: 

0112 C360E0 EDIT: JMP MNTR 

to: 0112 C3EA0E EDIT: JMP EDTR 

3. Similarly, change the following: 

0309 C360E0 JMP MNTR 

to: 0309 C3EA0E JMP EDTR 

My routines call Starkweather’s I/O (DSPLY, CHI, KEYIN, 
CHO) and his block transfer routine (BLKTFR). I also pickup 
the EBUFF address (the entry buffer address) and PBUFE 
(End of user program area) as set by the programmer (p. 18, 
DDJ, May, 1977, 7th line). Any alterations made to any of 
these routines or addresses should be transparent to my 
program. That is, it should run anyway. 

I also have implemented the PILOT command LOAD: for 
loading a PILOT program from an iCOM disk (and construct¬ 
ed with iCOM BUILD or EDIT commands) running with 
FDOS-II and a TIME: command for use with a Comptek (now 
Canada) CL2400 real time clock. I’ll be glad to send these 
routines to anyone who wants a copy. I’ll also send the editor 
routine on a diskette if you send me one to write on (iCOM 
compatible) but I guess I can’t include all of PILOT on disk 
because of the copyright. 

Sincerely, 

David J. Morgan 
Assistant Professor 

P.S. Please mention that Binary Systems, Inc. of Richardson, 
Texas (The Micro Store) was good enough to let me use their 
machine and a new ribbon to produce a hardcopy output. 
They are pretty good people. 


After invoking the PILOT EDIT: command the system will 
respond: 

PILOT EDITOR READY 

If there is no current user program in memory the system will 
then display: 

PGM SPACE EMPTY -ENTERT OR ‘E’ 
indicating that the user must either insert text or exit from the 
editor. The system will then prompt the user with an asterisk 
(*). After the prompt is displayed, any of the following editor 
commands may be entered. 

B Backup the line pointer. This routine backs up the inter¬ 
nal pointer to the previous line of text and then displays 
that line. The previous line of text is then made the 
current line. If this command is invoked when the 
current line is the first line of the program (and hence no 
backup is allowed) the message: 

-START OF FILE - 

is displayed and the current line is left at the first line of 
the program. 

C Display the “current” line of text. When the editor is 
entered from PILOT and a program is in memory, the 
current line is automatically set to the first line of the 
program. 

D Delete the current line of text. The current line is re¬ 
moved from the program and all following lines are 
moved up. If there are no lines left to delete, the 
message: 

PGM SPACE EMPTY-ENTER ‘I’ OR ‘E’ 
is displayed indicating that a program line must be 
entered or the user must exit the editor function. 

If the delete is allowed, the next sequential line 
becomes the current line unless there are no more lines 
in the file. If no more lines exist in the file the last line 
(before the deletes started) is made the current line. 

E End of editing. Returns to PILOT mainline. 

I Insert a new line of text. After this command is entered 
the editor will respond with an equal sign prompt ( = ). 
The user may then enter a new program line. The new 
line will be terminated by a carriage return. 

The insertion is made immediately after the current 
line and the new line, once entered, becomes the current 
line. If there is no space available to insert the line the 
following appears: 

- PROGRAM SPACE FULL- 
The insert will not take place but no other action will be 
taken and the editor will prompt for a new command. 

N Display the next fine of text. The routine advances the 
internal pointer to the next line of text and then dis¬ 
plays that line. The next line is then the current line. 
The search for end of line is always to the carriage return 
character (0D hex). If there are no more lines in the pro¬ 
gram to display, the message 

-END OF PROGRAM - 

appears and the current line is left at the last line of the 
program. 


Page 22 


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


Number 24 

169 





P Prints the entire program on the console device. This 
routine will print the entire program exactly as a regular 
PILOT command of DP: would. 

R Reset the line pointer to the beginning of the program. 
The first line of the program in memory becomes the 
current line. 

Z Reset the line pointer to the end (last line) of the pro¬ 
gram. The last line in the user program is made the 
current line. 

NOTES: It is imperative that all programs end with a carriage 
return and a ctl/a (01 hex) character for the proper operation 
of the editor. When entering programs in PILOT this will auto¬ 
matically happen if the terminator character (ctl/z) is not 
typed until the last program line is ended with a carriage 
return. If you are entering programs in the editor, it will auto¬ 
matically take care of this operation. 



16K RAM BY NORTH STAR 

News Release Received: 77 Dec 20 

North Star Computers, Inc, announces a new, 16K RAM 
board for S-100 bus computer systems. 

North Star’s 16K RAM is designed for use in both 8080 and 
Z-80 computer systems. It will operate at full speed (zero wait 
states) even at 4MHZ. 

The low-power board uses 200 ns dynamic RAM chips and 
the on-board memory refresh is invisible to the processor. 
Bank switching capability is provided and the addressing of 
the board is switch-selectable in two 8K sections. 

Another feature of the board is the availability of a parity 
check option. The North Star 16K RAM board is offered in 
kit form at $299 and fully assembled at $459. The parity 
option costs $38 in kit and $59 assembled. For further 
information, contact: North Star Computers, inc, 2547 Ninth 
St, Berkeley, CA 94710, (415) 549-0858. 


s 


m 


x t- 


>- cj i 


i z <r i 


CL CC -- 

•- l- O U -C 

LL J U <X 

r <x x 

a ZUIUlHh I— LUh u c 

lu h3doi/i >■ inazo 
io_i« a. ® a: hh z <x o 
o om wo o o <t x 

i h r uj h w i- h u. z x w uj 

j io « in Ht-ouia: 

J H H H Z H ouuio 

IO 2 Z <XZUJZ U X O U x 

atS H H I- H hllJH ho 

Ch OCtUJ 0<XOUJXOOUJi20 
- --H 0.Q.U) 0. W Cl O U ^ O O il m 

T .► .* .» ... .. .. .. <. .. .. .► 


O W Z »H CJ 


! X h u a; I 

: o cc o i 

: a w o o > 

j w w H 

3 <X UI W Z CL 
UUIhOC 
1 H O * UJ 

Ui CC « O 

a cl r o uj 


r >- h o h o 

cu _j uiima 

uju.hZu.zo. x x 

- W •- >-< 

i Ci i j i j i <r o 


I* O H H 
ClUmG 

x o uj ui 


«■ o 


j x x u h r 

.OOhZhO 
) (J U ‘HdO. 
i O O I J UJ ' 


UJ UJ oc z z> 
►H o O 

CC H CC u. <x 

O o H H 

U. X U. _J W CC 


h oc H 
(J « W 
UJ UJ 
Cl -I O 

iouo 


U I CJ 
UJ Cl UJ 
I Z I 
CJ UJ CJ 


z z cc a 

►1 <x z 

x 

o cc a z <r r 
zuizour 

<Z K <X U I O 

z r au 

X UJ X CC UJ 
O I O O UI0C 
(J H CJ H U.O 
►H H 
CC X UJ Q UJh 

o o x uj za 

U. CC H HHUJ 
U. UJ -J 

Z H O h- 
c n uj «x ouj 
c o co au 


o >- x x 

0-1 O LlO 

OC CL W u _JU 

- CD X Ci CC Ci 

I Cl U UI OUJ 


X <x 
<r cc 
cc o 

O O l 

o cc : 
cc a. ► 


CC ' CC - X ' O' CC ' 
JuClOZUIACOJm 
UI' O' Z ' O' O' 


CO 

t— JC V 

UI 1-0 -J 

in ' (O' cnui cl 

* Z OC UJ N C *• CO 

HH ' CC - -IXO 


H JHJH 

x<xxxxxxoa. 

> JO J(0 JCDJXO 


J JO. 

n <x <r x 

-> O O 1 • 


hh _J _J _J —I Cl 

X<X<t«XXXOi 
• jooojana 


Cl — — — 


I-H Cl O. 

CL N CL N O X 
OT070.1- 


hjj<[ _i<r h 

X <t <r H <EO UJ 
• J OO to OJ cc . 


rH Q O H-l »H »-l U.U.U.UJ 

-H o O -I -I -I oooo 

0> ON HH UIM'OO 

n v o in <i in <i o oin -o u. 

h o h n h n h ui u <r o o m 

NONNNNNNU. OOOO 


<XQOM'00>OU.O 
UJUJU.U.U.U.U. U.O 
UJ UI UJ UI UI UI UI UJ U. 

ooooooooo 


r-j in id o 
oooo 
u. u. u. u. 
oooo 


omoovou-in 
n <r v cm in 'O <r <r 
u.ouu.OHUjQHin».uooo 
oooooHO«»<rn»rjN-o 
niM'iinHNONoo^npioo 
ritn voiniL«io(Mir)«n'ON 
HQooHfinomnoonO'fioo 
rjooo(NCNomin<rincN«r«-in'0O 

ujh» NcoooNau.nMiiu.nv 
OHHHHrtriMrutNi*)nnn<r<r 
LU.U.U.U.U.U.U.U.U.U.U.U.U.U.U.U. 

ooooooooooooooooo 


lit N C O Ll O 


—' O Q HOH 

Hi O O O ^ 

O O' UJ U. * u. 

CO VO u v 

HQorto« o- 
NOO noM o 

m -o O' o u. cn m 
in in in m in >o o 
U. U.U. U.U. u. u 
o o o o o o o 


-I O O O U. U Ll U. t-1-hO 
^O-^hhOOOOhh^O 
in < o c uj * m m in co v u. o> o n « « uj uj a- 
cninb vavui vcv cvuinoinwoov 
ui<xuj<xuj<xuj<tuj<xuj<xuj<xuj<iw <r - o o- 

U.OUOLlOU.OIlOUOLlOU.OU.OMOO 

'Ooooooriinrscou.H^V'OO'iXiUJOfO'OO' 
O^O'ONNNNNNNOOmCDCOIXIOOO'O-O'O' 
U.I 1 .U.U.U.U.U.U.U.I 1 .U.U.U.U.U.U.U. Ll U IlLl 
OOOOOOOOOOOOOOOOOOOOO 


Number 24 

170 


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


Page 23 














3 H 
3 3 
Z x 


V u 
1 UJ 
z l 
o u 


CL X UJ OC 


H A < 

3 z : 

O UJ L 


iC UJ fi A 
A it Z Z 
A UJ UJ O UJ 

c x c 

►— H 3 4— 

4- « li. ZUJ 

UJ A 

UJaun-U.Ai£ 

1 W >- h Z iX Z 
: <r z z a uj 3 h 
j in h w Z u 

uj u UJ UJ 
■ AhK>UJ>l-> 

JZ3UJ<TI<TUJ<E 

) < u. Q U1 U Ifl Q (/) 


O (fi 
K 0C 
H 
A Cl 

a 

<x z 
u 
U. M 


AO 

zcn 

UJ UJ 


z UJ 

O 4- 

Q >- 


O 3 ~ CL 

z <r 3 o 
Z O X 
X h Z 


o 

cn 

>- >- r > 

c c in . 

Z UJ z o 

o ► o - 

H« JHI 


m A Z UJ 


OC A 
A A 
A <1 


4— 3 h ^ 3 3 K 

uj uj 3 <r o «i uj uj 

(3 (fits in AW 2 0 


z z 4- o z z 


: uj a z uj uj 

I 3 K U 3 I- 3 

i o uj uj w <r uj <r 

. I I O 2 (J) O W 


ii UJ IT h C zr C X 

(fi CL O - - 3 - - UJ 

AHUJCt h u u x u 


4- I- h Zh X 

in cn c cn u *-< z <r r 

z ^z-z- u - UJ 

h I A A O h r HtuiuUI- 


X Q£ 4- 
3 U- C 4- 
® K A U 
3 Z 0- Z 


U X W 

z z r z 

H H UJ H 

3 X 3 4- 3 


W 4- X 

ZiCOL 
0U30U.U 
H 4- O X C 
> U Z A 
4— A Z (Z 
Z Z U 3 Z 

HhUUJhUI- 
O UJ M I 3 H 3 
a. cd z u iz z o 


Cl T. XL 
- - 3 

X C X O L 


CO A 

C 

3 X 

Ll O 

r a 
to z 

CL UJ 


UJ C X 4- H h 

z i- a 

a uj ce in >-> 

UJ X Z Z O UJ iZh 

x c h o x a o ► 


CJ) UJ A 
K I- A 3 3 C 
UJ UJ Z J <T O 

CO CO <1 Cl (Si J 


4 3h 3 

o o uj <r 

Jttncn 


' z x 
ii h c 

- o >- z 

- X UJ X - - 

uuzuacux 


c a. 


X IZ 
3 X 
ill-rt 

Ul z o 


M rj h pi 


_J A ID A A ID X AO 3 

N30.UH_JCL3H3X33il.33I X X C h 30.3 <1 3 3 I H _| 

zoxzxcxi3ouxoxoxunuuao.no XO AOXUXC 
3XU33U33XXX3XUX3X3AA3U3X 3Z**. 3X3X3 U 


A AAA 
3X333H 
X Z X X X 3 
- 3 H Ul 3 UJ o: • 


H3XHNXI- 

x o z a. z u uj 

- 3 X H U -) A iZ • 


h_jjcAiZ3hIh_jhCI— 

3CCA3ZOXUXC3HUJA 

-XUU3OHX3X3UXU10:A 


ro n O' 

CM AAPH 
U N A A CM 

N C A U X 
P4 Cl CM CJ P-4 
O O O O O 


00 A O' V O' ■ 


V N A < 
A n C L 
u u cm r 

ri in ao 
hmm 
o o o 


A A UJ 
m nn 
o o o 


o in *■ 

■ • j c n n h 

bU N U N 

ibPjn«iniiiD>uAijjii'H v inco 
nfl-^-vwwTT^inin in in 
ooooooooooooo oo 


H u 
o o 

A *■ 

o- m 


O' U A O h ^ 

inin moo >o 
o o o o o o 


4 S3 O 

) a in 

4CP4D- 
J CM P4 U 


N C A l 
-O S3 -O ' 

o o o < 


C ON 
h UJ 4*3 UJ P-4 A O' 
P-4 N P 4 X O P 4 U 

in cd 0 * c u x o 

N N N N N N 00 

O O O O O O O 


A U 

O © 

a *r in 
ro«o 

UJ A A 
O U U 


x 0 - x z li¬ 
en uj uj u o 

o u h u ui 

CMHOOU 

ii") t ui p-4 <r 

h h u o r-4 n in u a 

H O O m W W V + o 

N AO-h A N O 40 in A 

•« c O' in o p- 4 n c- in re 

couu.Hja^aujpJO'Au.AH'OA 
no'nTPJuiPJUMHuriw^^pj 

JO'UAUJU.PJn-OO'AUAHinO'AH^-'OOOO' 
immmpn(nfv.iviv.r>.iVft.ft.«T<T/T .ti » .r. ,r. iTi 


l- 

l 


XH 

O H 

LL X 


3X0 
0 3 0 
X H H 


3 in 

C 3 

in x 


X 3 
3 

Z 

o o 

z 

H 3 

X X 


3 C (XI X 

X 3 3 0 

X X A X h 


3 X U 4 
O U < 
Ul- Z 


h z cn 4 - c (f) 


Z U Z H 3300 U C 4- 1- X 
O I- h >- 3 4- X H in 

X HZ 3AU.3U.OH3Z3X 30 
<D 033 O hOOOh^WUIX'i- 

x a cn x i—i—3 3 x UH3 3 
C» X XC 33- HXCZCZXH 
331— - 3 3X3031- - 3OA30J3A>- 

IXOOU ZHHXCn0003 O 3 X A A 

hczw zen zuxhc 

h- K H 3 - 3 Ah 111 H 

U.X3 33300XXZ3X 3 

h h CD OOAZZhhCXH O 


3 U 
C h 

cn z 


A A 
Z A 
3 C 


X 3 3 X 

C I- X Z 3 

H > X 3 U Z 

cn a h c 

Z A 3 

H H 3 U 3 

333HOC 

co o cn z o cn 


H 3 
I X X 
J X z 


3 C X A - 


3 X L 
o o 
U X c 


A A CZ C3U3: 

©czoxoHcn c 

C H A 3 O 

HH HAAAZ3HK 

33 O 3 3 A Z h C L 

coco cococnccxcncnc 


X 3 

1 3 Z X i 

: u c i- x i 

J X X A < 

JO z >- o 

H o x O X I- C 

: 3 h o >• o y 

■ Z H X 3 X A 

4 H H OC A3 2 

13 O A X Z C 

A I- Z I- U C 
J 3 A C 3 O X 3 C 

i 3 C U Z O X 

z h cn u c 


I- 3 H 

u a cn 

H 2 X Z 

X 3 X 3 


J C Z 4— X 


3COXZC3ZU3 


3 3X3 U U A 3 

3 3 3 X Z ZCXX 

H H A H HH H Z *—* — 

• ZUZXZA3X3A ZC A X A - 


Z X I h 

h - A > 

3 C O I i 


Cl h C 
H ' O > X 
X - X 3 X 
Z U U Z U A < 


Z 3 X 3 Z C O 
CJ X 3 O U - - 
U 3 U Z U 3 A C 


A CO A 
h 3 X hji- 
X X U X X 3 

- 3 cn x 3 cn x • 


X A A 3 X 

___I3HNXNCXC3X33X3CXXHN4- 

XOOXZZXZOXUCOXZXZI-XI-XUXCXOHZZXZL 
3XXU3HU3X3XU I U 1 U T im W 3 A Ul U T X W h h u 1 ii 


3 3HXN31- 
X O X Z Z X 3 

- 3 x u h -j cn x • 


3H_|_JCAXC33 I C 3 h A 
C3CCA3ZI-CX I AOOC 
>uxgu3H)Hinucn'*3XXA 


3 H D X 
X X O X U 
cn 3 X U 3 


© H 
© H 

H PI 
o in 

H Cl A 
P 4 PJ 3 


rs o 
c in 

-• P-4 O' 

P-4 P-4 U 


00 A 3 

c c c 

XXX 
O © © 


J X U P-4 U A P-4 X C A A l 


J P-4 O- P-4 P-4 fO P-4 C A P4 A M 3 P-4 t*) n 3 P-4 O' 


P4no-AUMAUO-p-4 30N3UAUtOUHpjp-4CMUUNHp-4HXUU 

i^inoNC 


© A H S3 

in o x a 

C 3 3 PI P-4 P-4 O' 

P-4 Mi PI U P-4 U 

3 H PI T in CD A 

3 X X X X X X 

X X X X X X X 

© © © O O O © 


O O © 


X A U H 
© O O © 

3 A <r n <r coino- 

3r)C<K ANA 

A 3 A A C O U P-4 A P-4 

uouumo'foroup-i 

UXh^-NCAUXCM 

XXOOOOOOOh 

XX0©00©©00 


in co O' a 


UXPIMT 

h h n ci ci 

o © © © © 


Page 24 


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


Number 24 


171 
















TSC 6800 TEXT PROCESSOR 


iZ Z 
<r 3 

t- o 
W u 


z z 
u u 

<x HH 
A Z 


_l CD Ci 
JXI Jh 

<iuuiuu)iocna 

UuXUlCCuuuu 


r t-htn 
O CO U X 
UZZli. 
a hh o 


5 


i d 
a m 
o a. . 


w-ou-a ucmau. u. h no- cj in © a a 

H H H H V V V -9 H H I n V <T H H IN H o 

~ — nu.nnaU'OO? unu.mo <r -« o h a h 

~ — *r v in * o ci in c i in h h h n- o n t n n t t 

Ui CM QOOCMQW^rsO'QO'OM’CMO'-HC-OM-O'U.LJ 

— in ci cunm ci ci*rv*ro*ciinininociinvirir* 

a ai tn ciO' anONaiijtfiujncNOno.OHaaujo.n'm.HQ w 

uh u ecu fcMMTfcnT»»mirti()»fcTPirc»»T»»o o 

'Oo-<iMUJU.ocMM'CDOovfMoiii.nrvO'Q'-iinthoujC'j'0«iijrc‘OrMiso 

HHH-HHHinininini0'0'O.O'0'0NrsMNa>iDa)(Xia>0.0'0'0'<E«<l<lo 


News Release Received: 77 Dec 15 

Technical Systems Consultants, Inc. is pleased to announce 
the availability of the TSC Text Processing System. This pro¬ 
gram allows the use of over 50 special text formatting com¬ 
mands. The commands included will support multiple spacing, 
left margin control, indenting, the ability to save contiguous 
space, save contiguous text, paging, right hand justification, 
left hand justification, left and right justification, centering, 
no-fill modes, page numbering, the printing of left hand, 
right hand, or centered titles, and line length control. 

Also included are capabilities for macro definition to define 
and build special formatting commands, number registers 
which can be used like variables in a program, conditional com¬ 
mand execution, setable macro execution points (to execute a 
macro at a pre-defined line number), text diversion for later 
use (such as footnote processing), the ability to prompt a 
terminal for text during the formatting process, and a feature 
which allows sending informative strings to the terminal. 

The TSC Text Processor will also output numbers in either 
Arabic, capital Roman numerals, or small Romal numerals. 
Tab columns may be defined as well as the tab character and 
the tab fill character. Environment switching is permitted for 
easy parameter changing and a loop command is available for 
repeated formatting jobs such as form letters. 

TSC recommends the TSC Text Editing System to be used 
in conjunction with the processor. These two packages will 
give the user all the powers of the most complete word proces¬ 
sing system. As with all TSC software, the complete commented 
assembler language source listing is provided as well as a very 
extensive user’s manual which includes an “Introduction to 
Text Processing”. Price of the SL68-29 Manual and Source 
Listing is $32, with cassette $38, and $40 with paper tape. 
Contact Technical Systems Consultants, Box 2574, 
W Lafayette, IN 47906. 


-J Z 
O 
H 

z u. 


iZ UJ 
=3 Z 
U HH 


J H >- Z O X 


UZUJ Ui o z 
f-KKUJOiZKZ hh 

Uu:uiXMOuj<xo4r 

CD<XCDUZXCDXCDQ. 


z 3 k o a 

H « CC UJ HZ 

o cn CL CD z « 


t- UJ h- I- O 

O O A <3 O <1 

cc z a: cl z x z 

) UJ O HH l-U 

) N U. N li. <X 

HH 3 HH CD A ► 

u. o cn cn i 

: hh z _j h z x i- c 

: o hh o 

J Ui H t- Z t: 

j ui OUJ 1 L occ c : 
j cn cd to hh a u. u h 


Z D 
3 <X Z 

o cn a 


z z z 

U <X H H 

HH UI iZ 

z cd a. 


0C U. I- z 

*- <t o o 

Z I z o z 

UJ CJ iZ H- HH 

iZ IZUli. c 

cc cc «x hh a. cd 

3 0 XU. 3 <X 

U U HH 2 

li. Z O Z UI 

h- HH u H UJ 0 3 
UJZHUJlUO<X<X 
cDcnztocncDAcn 


cc cc 
: cc «x 

< 3 X 
u u 


H- 3 y 
UI C L 

cd cn c 


UJ iZ 

i— Cl. 

Z A 

iZ I- 3 Z UlO iZ 

U O O UI iZ H A 

Z U O A 

CC CC X z <x 

CC O U UI o u 

H-u.HHiuui<ctn 

a. ►— xa « 

z z z o 
u.uozucnzui 

X UJ O UJ 0 3 

3IOhhXOhh<I 
AOCDZOAZtn 


Z H h- - A 


N U. > 
H- 0_l 

x uj a. 


l-<XI—>-K 

cc a cn j o 

XilZiZ 


_l cn C O I Z <E -H 2 I o z JQJXJ 


H -H H cn V h I- 

o z z x j cc cn 

z o _i o cn a. z i 

hh c h <r h cn u i 

_ICXA«-^AXAA' 


K iZ > 
O A J 
ZCii 

hh z cn 

X -J A A 


cn >- 
x -I 

CC Cl. 


cn a cn 

Z X X <z z 

HH - A Z HH 

_JXX<XOAX_J 


z x x cn i in z 

HH - AC •! HH 

JCIOJAO JX _J 


A _l A A 
JJJXJh 

x <r x z i uj 
cn o _j hh cn iz • 


JAllN3hhNhhJll 

X3XZOu.ZX<tXA 

-_JCnU3X03_l03A 


X J J Jh 
UXCCliJ 
AinuuiZ- 


HH J li. h 

x <r o uj 

‘ _j o u. iZ * 


-JXX3hhNX_I»- 

XOOOllZZIUJ 

H_lAAX03HHcnZ> 


A CD A A 

JI J3XHNXHNX _J 
XOXOZiZZZClZOI 
•_IX_IXHHU3HHU3Acn 


A 


cn 


A 


O A O A in * UJ 
uj uj n n uj uj n h a n 
hU.CNUrsU.UNUU 

uu.HmO'OoabiH 

AAUUUUUUUA 

oooooooooo 


HAH 
•H O -H 

O 0> N 


N- IS <C A UJ 

A A A A A UJ 
O O O O O O 


<T O -O A 
W N <T N 

~H -H HO A HM Oin HHfl 

*h h-h HHOHinnrjv h h o 

N A h ACMMOAfl-OUA N UI D> 

in o oou.tH(Nin?<ro m h? 

C is u r-J A UI N A I*) A *HU-&'AANAA0' 
no' a umi. un u un v <t t n r j nuuu 

Nin'0IS«AAOW«00'A-Hina>AUU.Nin 

UJUU 1 UJUUJUJU.U.U.U.U.OOOOOOHH 

OOOOOOOOOOOO-l'H-H^’HTHrH-H 


*H A 

o 
rs O' 


ui o n in 

CAAUJiurinriff. 
N N N IS li. U N N U 


in iii o n o n in 

<C A 4 UJ m UJ PI IO UJ f I A n 

N UJ M N n U. O H U. U N N 


Number 24 

172 


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


Page 25 














NEW GRAPHICS BOARD FOR SOL 


News Release Received: 77 Nov 15 

KEA Micro Design of Toronto has annouced the availability 
of GraphicAdd, a piggyback board for use in SOL computers 
and VDM -1 Video Display Modules. GraphicAdd gives graphics 
capability to these units (128H by 48V) and includes a SOL 
ready-to-load software package. 

Tlie GraphicAdd board mounts directly on the VDM and 
SOL main boards. It works by replacing half of the inverse 
video character set by bit-mapped graphic cells. Thus alpha- 
numerics and graphics can be mixed on the same line. Mode 
control options include fixed graphics, switch-selectable 
graphics, or programmable graphics mode. 

The software package contains a Graphics Driver, BASIC 
Links, LIFE, and demonstration programs. The Graphics 
Driver maps screen memory locations to H and V coordinates 
with subroutines to designate black or white cells. BASIC 
Links provide parameter passing to permit X, Y plotting 
directly from BASIC. 

GraphicAdd comes in kit form with all parts including 
sockets and IC’s. Fully documented hardware and software 
manuals (with all source listings) are included. Introductory 
price for the GraphicAdd kit is $50. It is available from SOL 
dealers or directly from Micro-Ware Limited, 27 Firstbrooke 
Rd., Toronto, Ont., Canada, M4E 2L2.. 



DALLAS MICROCOMPUTER EXPOSITION 

News Release Received: 78 Feb 22 

The International Microcomputer Exposition will be held in 
the Dallas, Texas Convention Center Sept. 29 through Oct. 1. 
Co-sponsored by several groups, including the American 
Association of Microprocessors, the Exposition will be 
directed toward all levels of technology from the professional 
engineer to the beginning computer hobbyist. In addition to 
the seminars, a panel of experts will be available to answer 
questions. Advance registrations indicate attendance in excess 
of 15,000 to view some 250 exhibits. Further information is 
available from Beverly Tanner;(214) 271-9311. 



EPA’s LOW COST MINIPRINTER 

news release Received: 78 Jan 3 

San Diego—Electronic Product Associates, Inc. announces 
the availability of the MP-44 MINIPRINTER. It is a simple 
and inexpensive 5x7 dot matrix printer for microcomputer 
systems. Electrosensitive paper is used to make copies at 
speeds up to 88 characters per second with 44 characters per 
line. Software control allows expansion of character size for 
emphasis. Black characters are printed on aluminized paper 6 
centimeters (2 3/8 inches) wide. 

An enclosure 4 l /i by 8 3/4 inches houses the printer and 
paper supply mounted on an interface board with all neces¬ 
sary components for connection to any microcomputer with 
TTL logic levels. The microcomputer controls the motor 
and print electrodes by an eight bit parallel output word, 
and senses timing signals on two input lines. A power supply 
of 40 volts dc at one amp must be provided to the interface 
board. 

Low cost is achieved by using the microcomputer for 
software control of all writing and timing functions. The soft¬ 
ware is explained in a stmctured form which can be easily 
implemented in any computer language, and examples of 
complete assembly language coding are provided for micro¬ 
computers using the 6800 and the 8080 microprocessors. 
Coding for the 6800 allows the printer to be operated imme¬ 
diately from the EPA Micro-68 I/O bus. Cost of this MP-44 
MINIPRINTER is $257.00 and is available from stock. For 
additional information please contact: EPA, 1157 Vega Street, 
San Diego, CA 92110 (714) 276 -8911. 


MUG MEETING IN SAN FRANCISCO 

News Release Received: 78 Feb 23 

MUMPS Users’ Group (MUG), San Francisco, California, 
June 7-9, 1978 Jack Tar Hotel. Conference includes all-day 
tutorials on programming in MUMPS, ambulatory care informa¬ 
tion systems, and technical aspects of ANSI-Stanford MUMPS. 
Formal presentations of medical and non-medical application; 
panel and discussions on applications on computers in medi¬ 
cine. Conference is the same week as NCC in Anaheim, Calif¬ 
ornia. Information: Ms. Pat Zimmerman, Department of 
Biometry, Weam Research Building, University Hospitals, 
Cleveland, Ohio 44106. 


Page 26 


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


Number 24 

173 













In the last issue of Dr. Dobb’s we published the documentation and PL/M source listing 
for the ACT 8080 Macroprocessor by Alex Cecil of Lawrence Livermore Laboratory. 
Here now is the symbol table and the assembler listing. The table preceding the assembler 
listing references selected line numbers in the PL/M version to the assembler listing. -TRW 


BY ALEX CECIL 

Lawrence Livermore Laboratory 


An 8080 Macroprocessor 


S00986 

18 

S00806 

PFRN 

S00984 

5E 

S00805 

12 

S00983 

17 

S00803 

RECORDNO 

S00981 

25 

S00802 

SETFILERECORD 

S00979 

PRESETDRIVES 

S00800 

8 

S00974 

PRESETATIN 

S00796 

» • t 

S00973 

CH 

S00791 

DRIVE 

S00903 

7473 

S00790 

CH 

S00902 

7366 

S00789 

I 

S00901 

7A7A 

S00787 

FILENAMEPTR 

S00900 

7372 

S00786 

SETFILENAME 

S00899 

6C63 

S00785 

' 1 ' 

S00898 

6E76 

S00784 

'3' 

S00897 

7766 

S00782 

PFVN 

S00896 

6674 

S00780 

PFFS 

S00895 

6E74 

S00777 

N 

S00894 

626E 

S00776 

BLOCK 

S00893 

7865 

S00774 

PFNB 

S00892 

6F69 

S00772 

PFDV 

S00891 

6F72 

S00770 

64 

S00890 

6F73 

S00759 

CH 

S00889 

7370 

S00757 

PFIO 

S00888 

6B75 

S00756 

N 

S00887 

6460 

S00754 

PFZZ 

S00886 

6472 

S00752 

PFMD 

S00885 

6664 

S00749 

PRODUCT 

S00884 

666D 

S00747 

PFML 

S00883 

6E72 

S00745 

PFSU 

S00882 

6663 

S00742 

SUM 

S00881 

666F 

S00740 

PFAD 

S00880 

6677 

S00735 

PFDD 

S00879 

6672 

S00730 

ENDPTR 

S00878 

7664 

S00728 

PFRO 

S00877 

6C6D 

S00726 

PFSO 

S00876 

7573 

S00722 

CH 

S00875 

6464 

S00720 

PFUK 

S00874 

7361 

S00716 

CHB 

S00873 

6461 

S00715 

CHA 

S00872 

6B70 

S00713 

PFPK 

S00871 

7373 

S00711 

* t 

S00870 

6367 

S00708 

60 

S00869 

7263 

S00698 

1A 

S00868 

6567 

S00696 

'DISK EOF S' 

S00867 

746E 

S00694 

20 

S00866 

6E69 

S00691 

NEXTCHAR 

S00865 

71 65 

S00690 

NOTCOMMENT 

S00864 

736E 

S00689 

CH 

S00863 

PFLIST 

S00688 

K 

S00862 

I 

S00686 

PFRS 

S00860 

CHCH 

S00684 

PFFW 

S00859 

PFINDEX 

S00680 

NOTFIRST 

S00858 

SECONDCH 

S00678 

PFPS 

S00857 

FIRSTCH 

S00676 

PFEX 

S00856 

CH 

S00665 

SEGNUMBER 

S00855 

BLOCK 

S00664 

CHB 

S00854 

BLOCKPTR 

S00663 

CH 

S00853 

NAMECH 

S00662 

LASTARGNUMBER 

S00852 

NAME 

S00660 

STACKOFFSET 

S00851 

NAMEPTR 

S00659 

PFCL 

S00849 

PROCESSENDFUNCTI ON 

S00655 

PFNT 

S00847 

PFRD 

S00653 

8000 

S00840 

RC 

S00651 

PFGE 

S00838 

PFRF 

S00644 

ARGC 

S00830 

21 

S00643 

ARGB 

S00826 

STUFFCH 

S00642 

ARGA 

S00825 

WRITESTATUS 

S00640 

PFEQ 

S00824 

I 

S00637 

PFCR 

S00823 

CH 

S00625 

CH 

S00821 

PFWF 

S00624 

I NPTR 

S00820 

19 

S00622 

PFI N 

S00818 

PFDF 

S00610 

M 

S00815 

PFCF 

S00608 

GCLENGTH 

S00813 

22 

S00604 

ANOTHERCH 

S0081 1 

PFMF 

S00603 

NEGCOUNTFAILED 

S00808 

PFOF 

S00602 

CH 


S00601 BACKUPTO 
S00600 CURRENTCHPTR 
S00599 FORMPTR 
S00598 MARKPTR 
S00597 N 
S00596 NPTR 
S00595 GCPTR 
S00593 PFGC 
S00590 11000000 
S00583 CURRENTBLOCK 
S00582 CURRENTBLOCKPTR 
S00581 CH 
S00579 CHA 
S00578 PUTCHASS 
S00577 MOREFILL 
S00576 ARGNUMBER 
S00574 PFSS 
S00566 CH 
S00564 PFAS 
S00557 PFNS 
S00544 NEXTSTART 
S00533 MATCHHERE 
S00532 RESTARTPTR 
S00531 CHB 
S00530 CHA 
S00528 SSMATCH 
S00525 N 

S00523 NUMBEROFARGS 
S00520 HALFBYTE 
S00519 HEXTOCH 
S00518 57 
S00517 37 
S00515 47 
S00513 '9' 

S00511 CH 

S00510 CHTOHEX 

S00503 NEGATIVE 

S00502 CH 

S00501 N 

S00499 BLOCKPTR 

S00498 STRINGTOBINARY 

S00495 

S00491 '0' 

S00487 NEGATIVE 
S00486 K 
S00485 I 
S00484 D 
S00482 N 

S00481 BINARYTOSTRING 

S00474 CH 

S00473 BLOCK 

S00472 BLOCKPTR 

S00470 PROCESSBEGINFUNCTION 

S00460 CH 

S00459 LASTDELIMWASLEFT 

S00458 DELIMLEVEL 

S00456 PROCESSQUOTEDSTRING 

S00452 BLOCK 

S00451 BLOCKPTR 

S00449 CH 

S00448 NSADDCH 

S00446 'NS STACK OVERFLOW S' 
S00443 FLAGS 

S00442 STARTNEXTARGUMENT 
S00435 NEXT 
S00434 OLDBLOCKPTR 
S00433 CH 

S00431 MOVEPTRFLAG 
S00430 ASNEXTCH 
S00428 ASFREEBLOCK 
S00421 I 
S00420 CLIM 
S00417 ASNSINIT 
S00411 74 

S00409 ' T N I: S' 


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

174 


Page 27 



S00407 IB 
S00405 CH 

S00403 PROCESSCONBREAK 
S00401 TURNTRACEOFF 

S00333 TURNTRACESN 
S00394 TRACEPRINT 
S00392 NEXTNS 
S00391 THIS 
S00389 THISNS 
S00386 60 
S00385 7D 
S00384 '.' 

S00383 7C 
S00382 73 
S00381 70 
S00380 7B 
S00379 IM 
S00376 STREINIT 
S00374 STVALUEPTR 
S00373 STADDVALUE 
S00371 NAMEPTR 
S00370 STCREATE 
S00368 STDELETE 
S00363 11111 
S00360 CH 
S00359 HASH 
S00357 NAMEPTR 
S00356 STFIND 
S00352 STINIT 
S00331 STPREVIOUS 
S00350 STPREVIOUSPTR 
S00349 STENTRY 
S00348 STENTRYPTR 
S00347 HASH INDEX 
S00346 HASHTABLE 
S00342 5000 
S00330 MATCHEND 
S00329 CHA 
S00328 I 
S00327 COUNTMAX 
S00326 COUNT 
S00325 RESTARTPTR 
S00323 ENDMESSAGEPTR 
S00322 RECEIVESTRING 
S00318 CH 
S00316 BLOCKPTR 
S00315 SENDSTRING 
S00311 CLEAROCTOOUTPUT 
S00305 CH 
S00303 BLOCKPTR 
S00302 PRINTSTRING 
S00297 CH 
S00295 BLOCKPTR 
S00294 NULLTEST 
S00287 NEXTB 
S00283 NEXTA 
S00282 CHB 
S00281 CHA 
S00279 PTB 
S00278 PTA 

S00277 STRINGEQUALITY 
S00273 CH 
S00271 SINKPTR 
S00270 SOURCEPTR 
S00269 COPYVALUE 
S00266 NEWCHAIN 
S00265 CH 

S00264 CURRENTBLOCK 
S00262 CHA 

S00261 1NITIALBLOCKPTR 

S00260 PUTCHA 
S00257 NEWCHAIN 
S00256 CH 

S00255 CURRENTBLOCK 
S00254 CHPTR 
S00253 CURRENTBLOCKPTR 
S00251 INITIALBLOCKPTR 
S00250 GETCHB 
S00247 NEWCHAIN 
S00246 CH 

S00245 CURRENTBLOCK 
S00244 CURRENTBLOCKPTR 
S00242 INITIALBLOCKPTR 
S00241 GETCHA 
S00239 OF 
S00233 BLOCKC 
S00232 CHPTR 
S00231 BLOCK 
S00229 BLOCKPTR 
S00228 CH 


Page 28 Dr. Dobb's Journal 


S00227 APPENDCH 
S00222 OFFFO 
S00221 NEXTPTR 
S00220 BLOCK 
SO0218 BLOCKPTR 
S00217 FREECHAIN 
S00213 16 
S00211 BLKPTR 
S00209 MAXADDRESS 
S00208 MINADDRESS 
S00207 FSINIT 
S00206 8181 

S00201 'FREE STORAGE IS EMPTY 

S00199 FIRSTEMPTY 

S00198 GOTC 

S00197 GOT 

S00196 GOTPTR 

S00195 FSFIRST 

S00193 FSGET 

S00192 FREETHIS 

S00190 FREETHISPTR 

S00189 FSFREE 

S00188 NOEXVALUE 

S00187 DEADSTART 

S00186 NULLSTRINGPTR 

S00185 FPTR 

S00184 SPTR 

S00183 VALUECH 

S00182 VALUEPTR 

S00181 ARGPTR 

S00180 NAMEPTR 

S00179 TRACEFLAG 

S00178 SSCHA 

S00177 SSCHCPTR 

S00176 SSCHBPTR 

S00175 SSCHAPTR 

S00174 ASCH 

S00173 ASCHPTR 

S00172 ASBLOCK 

S00171 ASBLOCKPTR 

S00170 NSACT IVEFLAG 

S00169 NSARGBREAK 

S00168 NSCH 

S00167 NSCHPTR 

S00166 NSSAVEINDEX 

S00165 NSSTACKINDEX 

S00164 11 

S00163 NSSTACK 

S00I62 PUTCHACURRENTBLOCKPTR 
S00161 PUTCHACHPTR 
S00160 GETCHACHPTR 
S00159 FIRSTPUTAFLAG 
S00158 FIRSTGETBFLAG 
S00157 FIRSTGETAFLAG 
S00156 FSFIRSTPTR 
S00155 7F 
S00151 65000 
S00149 I 

S00147 RECEIVECH 
S00141 CH 
S00140 SENDCH 
S00137 OCTOSTATUS 
S00136 OCTOCHANNELA 
S00135 135 
S00131 I 
S00129 N 

S00128 WAITTENTH 
S00125 I 
S00123 N 
S00122 WAITMS 
S00121 20 
S00119 7A 
S00118 61 
S00116 CH 
S00115 UPPERCASE 
S00114 14 
S00112 7 

S00108 SELECTOR IVE 
S00107 9 
S00105 MESSPTR 
S00104 PRINTMESS 
S00103 11 
S00101 CONBREAK 
S00099 READCH 
S00095 CH 
S00094 DISPLAYCH 
S00090 CH 
S00089 PRINTCH 
S00088 OA 
S00087 OD 


Computer Calisthenics & Orthodontia, Box E, 



S00086 2 

S00084 CRLF 

S00082 A 

S00081 F 

S00080 M0N2 

S00079 5 

S00077 A 

S00076 F 

S00075 MON 1 

S00074 FBASE 

S00073 6 

S00072 FBASEA 

S00071 I TEMP 

S00070 DUMMY 

S000S9 TEMPPTR 

S00068 CURRENTDRIVE 

S00067 PREVIOUSDRIVE 

S00066 DEFAULTDRIVE 

S00065 PRELOADED 

S00064 7E 

S00063 METACHAR 

S00062 04 

S00061 OCTOEOM 

S00060 TBUFFINDEX 

S00059 TBUFF 

S00058 80 

S00057 TBUFFPTR 

S00056 TFCB 

S00055 5C 

S00054 TFCBPTR 

S00053 120 

S00052 OCTOTIMEOUT 

S00051 1 

S00050 CONBUF 

S00049 CON IN 

S00048 80 

S00047 CONCOLUMN 

S00046 CONWIDTH 

S00045 OFF 

S00044 CPMPRINTFLAG 

S00043 62 

S00042 ATCB 

S00040 6F 

S00039 72 

S00038 ATRO 

S00036 6E 

S00035 69 

S00034 AT IN 

S00032 81 

S00031 63 

S00030 67 

S00029 40 

S00028 0 

S00027 ATGC 

S00025 START 

S00024 100 

S00022 DEC 

S00021 DOUBLE 

S00020 MOVE 

S00019 LAST 

S00018 LENGTH 

S00017 OUTPUT 

S00016 INPUT 

S00015 LOW 

S00014 HIGH 

S00013 TIME 

S00012 SCR 

S00011 SCL 

S00010 SHR 

S00009 SHL 

S00008 ROR 

S00007 ROL 

S00006 STACKPTR 

S00005 MEMORY 

S00004 PARITY 

S00003 SIGN 

S00002 ZERO 

S00001 CARRY 

8080 PLM2 VERS 3.0 


Menlo Park, CA 94025 Number 24 

175 


1=0000030 
100=0004460 
151=0004760 
161=0005420 
167=0005720 
175=000617Q 
186=0006620 
194 = 00071 IQ 
200=0007560 
212=0010150 
221=001126Q 
227=0012230 
253=0012610 
259=0013040 
268=001375Q 
340=0014440 
358=0015420 
366=0016200 
372=0017300 
383=0020460 
392 = 00211 IQ 
398=0021670 
411=0022360 
417=0023010 
424=0023660 
441=0024270 
447=0025240 
463=0025650 
476=0026500 
487=0027200 
498=0030010 
508=0030620 
524=0031650 
537=0032440 
546=0033340 
560=0034530 
572=0035030 
582=0035670 
598=0036240 
604=0037430 
610=0040050 
617=0040550 
624=004115Q 
630=0042660 
662=0043640 
675=0044300 
681=0045120 
692=0046200 
702=0046750 
708=0050220 
718 = 00511 IQ 
730=0051730 
737=0052520 
748=0053530 
762=0054210 
768=0054610 
775=0055030 
785=0055410 
791=0056600 
797=0057210 
813=0057550 
819=0060430 
827=0061210 
835=0061620 
850=0062360 
859=0062740 
865=0063430 
876=0064640 
889=0065560 
895=0066530 
906=0067230 
912=0067740 
918=0070220 
929=0070750 
935=0071340 
947=0071740 
958=0072640 
965=0074340 
971=0075260 
982=0076150 
988=0077500 
996=0100140 
1004=0100570 
1027=0101320 
1035=0102120 
1044=010256Q 
1052=0103320 
1061=010440Q 
1067=0104710 
1084=0105610 
1095=010626Q 
1 102 = 0107130 
1 108 = 011006Q 


18=0004030 
144=0004560 
154=0005070 
162=0005500 
168=0005730 
177=0006300 
187=0006650 
195=0007200 
201=0007570 
214=0010230 
222=001136Q 
244=0012330 
254=0012660 
263=0013140 
269=0014020 
353=001453Q 
359=001553Q 
367=0016340 
373=0017430 
384=0020510 
393=0021270 
402=0021770 
412=0022470 
419 = 00231 IQ 
431=0023740 
442=0024470 
453=0025320 
464=0026050 
481=0026600 
488=0027350 
503=0030060 
512=0030740 
525=0031670 
541=0032510 
551=0033420 
561=0034560 
573=0035270 
583=0036020 
599=0036400 
605=0037460 
611=0040200 
618=0040620 
625=0041220 
631=0043000 
663=0043650 
676=0044340 
682=0045400 
693=0046360 
703=0047030 
709=0050270 
719=005116Q 
731=0052040 
738=0052750 
749=0053550 
763=0054330 
769=0054640 
777 = 00551 IQ 
786=0056010 
792=0056630 
798=0057220 
814=0057640 
820=0060600 
828=0061300 
836=0062010 
851=0062410 
860 = 00631 7Q 
870=0063470 
877=0065230 
890=0065770 
896=0066640 
907=0067300 
913=0070040 
919=0070230 
930=0071060 
936=0071410 
953=0072000 
959=0072700 
966=0074550 
972=0075440 
983=0076210 
989=0077520 
997=0100230 
1005=0100630 
1028=0101370 
1036=0102220 
1045=0102620 
1055=0103460 
1062=0104430 
1079=0104740 
1085=0105700 
1096=0106410 
1 103 = 0107100 
1109=0110320 


96=0004060 
145=0004610 
155=0005200 
163=0005600 
171=0005770 
178=0006310 
188=0006660 
196=0007240 
205=0007630 
215=001072Q 
223=001150Q 
245=0012370 
255=0012710 
264=001333Q 
270=001405Q 
354=001461Q 
361=001556Q 
368=001650Q 
374=0017440 
385=0020520 
394=0021320 
407=0022040 
413=0022570 
420=0023260 
436=0024040 
443=0024630 
458=0025420 
465=002613Q 
483=0026620 
489=0027400 
504=0030340 
517=0030770 
529*003174Q 
542=0032620 
556=0033470 
562=0034650 
574=0035300 
584=0036050 
600=0036720 
606=0037540 
612=0040220 
619=0040670 
626=0042000 
632=0043130 
667=0043730 
677=0044400 
683=0045520 
694=0046440 
704=0047200 
713=0050350 
724=0051210 
732=0052150 
739=0053170 
750=0053700 
764=0054360 
770=0054650 
778=0055120 
787=0056120 
793=0056740 
807=0057250 
815=0057710 
821=0060640 
829=0061330 
837*00621 IQ 
852=0062560 
861=0063250 
872=0063540 
878=0065260 
891=0066040 
897=0067100 
908=0067410 
914=0070030 
925=0070300 
931=00711 IQ 
937*0071550 
954*0072030 
960=0072740 
967=0074660 
973=0075710 
984=0076570 
990=0077550 
998=0100350 
1011=0100700 
1030=010150Q 
1037=010225Q 
1046*0102760 
1056*0103650 
1063=0104510 
1080=0105070 
1086=0106040 
1097=0106550 
1104=0107150 
1 110 = 0110420 


97=0004200 
146=0004620 
157=0005250 
164=0005650 
172=0006010 
181=0006420 
191=0006720 
197=0007310 
206=0007660 
216=0010730 
224=0011650 
246=0012430 
256=0012760 
265=0013420 
333=0014130 
355=001522Q 
363=001570Q 
369=001664Q 
379=001756Q 
388=0020600 
395=0021500 
408=0022160 
414=0022610 
421=0023310 
438=0024060 
444=0024770 
460=0025440 
466=0026310 
484=0026760 
490=0027640 
505=0030430 
518=0031310 
530=0032200 
543=0032670 
557=0034220 
564=0034700 
578=0035360 
585=0036060 
601=0037060 
607=0037570 
614=0040370 
620=0040750 
627=0042270 
633=0043200 
672=0043760 
678=0044730 
684=0045770 
695=0046630 
705=0047420 
715=0050450 
725=0051360 
733=0052310 
740=0053260 
751=0053760 
765=0054440 
772=0054720 
779=0055130 
788=0056200 
794=0056770 
808=0057330 
816=0060070 
822=0060740 
830=0061370 
838=006214Q 
853=0062640 
862=0063320 
873=0064050 
879=0065270 
892=0066120 
898=0067120 
909=0067510 
915=0070140 
926=0070410 
932=0071160 
938=0071600 
955=0072220 
962=0073060 
968=0075100 
974=0076000 
985=0076650 
991=0077770 
999=0100410 
1012=010115Q 
1031=0101610 
1038=0102320 
1047=0103160 
1058=0104010 
1064=0104560 
1 081=010534Q 
1087=0106170 
1098=0106660 
1 105 = 0107370 
1 1 11=011045Q 


98=0004260 
149=0004720 
158=0005260 
165=0005720 
173=0006070 
182=0006430 
192=0006770 
198=0007420 
207=0010030 
219=001101Q 
225=0012020 
250=0012470 
257=001301Q 
266=0013550 
338=001427Q 
356=0015320 
364=0015760 
370=001700Q 
381=0017700 
390=0020720 
396=0021630 
409=0022240 
415=0022720 
422=0023550 
439=0024200 
445=0025150 
461=0025560 
467=0026330 
485=0027060 
491=0027660 
506=0030560 
519=0031330 
531=0032340 
544=0033200 
558=0034340 
565=0034710 
579=0035410 
591=0036140 
602=003715Q 
608=0037720 
615=0040420 
622=0041000 
628=0042360 
634=0043220 
673=0044030 
679=0044750 
685=0046020 
696=0046640 
706=0047650 
716=0050530 
728=005143Q 
734=0052420 
741=0053360 
754=0054030 
766=0054450 
773=0054740 
783=0055210 
789=0056240 
795=005710Q 
811=0057440 
817=0060310 
625=0060760 
831=0061400 
844=0062200 
855=0062700 
863=0063340 
874=0064430 
884=0065330 
893=0066220 
899=0067130 
910=0067550 
916 = 00701 IQ 
927=0070460 
933=0071230 
939=007165Q 
956=0072260 
963=0073110 
969=007513Q 
975=0076010 
986=0076700 
992=0100050 
1002=0100450 
1013=0101220 
1032=0101720 
1039=0102330 
1048=0103260 
1059=0104100 
1065=0104610 
1082=0105510 
1088=0106220 
1099=0106750 
1 106 = 0107620 
1 112 = 011050Q 


99=0004400 
150=0004750 
160=0005320 
166=0005750 
174=0006140 
185=0006510 
193=0007060 
199=0007450 
208=0010070 
220=001107Q 
226=0012220 
252=0012520 
258=0013030 
267=001363Q 
339=001443Q 
357=001534Q 
365=001604Q 
371=0017140 
382=0020370 
391=002114Q 
397=002166Q 
410=0022320 
416=0022740 
423=0023570 
440=0024250 
446=002517Q 
462=0025630 
468=0026400 
486=0027100 
492=0027670 
507=0030610 
523=003144Q 
532=0032360 
545=0033310 
559=0034440 
571=0035000 
581=0035450 
597=0036170 
603=0037300 
609=0040010 
616=0040520 
623=004113Q 
629=0042510 
661=0043270 
674=0044250 
680=0045100 
691=0046120 
700=0046720 
707=0050120 
717=0050630 
729=005162Q 
736=0052470 
742=0053370 
755=0054160 
767=0054540 
774=0054750 
784=0055340 
790=0056440 
796=005716Q 
812=0057470 
818=0060400 
826=006103Q 
634=006154Q 
849=0062230 
656=0062710 
664=0063360 
675=0064450 
688=0065430 
894=0066370 
905=0067200 
911=0067660 
917=0070170 
928=0070700 
934=0071260 
940=0071660 
957=0072370 
964=0073150 
970=0075210 
977=0076070 
987=0077040 
995 = 01001 IQ 
1003=0100500 
1014=0101270 
1034=0102010 
1043=0102470 
1049=0103310 
1060=0104240 
1066=0104700 
1083=0105600 
1089=0106230 
1 101 =0107000 
1 107 = 011002Q 
1113=0110510 


Number 24 

176 


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


Page 29 



1123=011054Q 
1133=011 141Q 
1139=011203Q 
1145=011266Q 
1151=011401Q 
1168=011470Q 
1179=0116000 
1186=011667Q 
1192=011733Q 
1199=0120030 
1205=0120550 
1212=0121350 
1218=0122620 
1230=012326Q 

1236=0124230 

1242=0125350 
1248=0126240 
1255=012707Q 
1264=013002Q 
1276=0130500 
1282=0131270 
1292=0132330 
1300=0133100 
1314=0133720 
1320=0134640 
1326=0136130 
1333=0137020 
1347=0137570 
1355=0140140 
1369=0140640 
1376=0141420 
1383=0142150 
1389=0142760 
1396=0143410 
1403=014412Q 
1415=0144550 
1421=014560Q 
1431=0146640 
1439=0147300 
1450=015004Q 
1457=0150640 
1463=0151430 
1479 = 01521 IQ 
1490=0152730 
1502=015466Q 
1513=015566Q 
1526=0156210 
1532=015731Q 
1538=016003Q 
1556=0160730 
1562=016156Q 
1572=0162300 
1586=0163010 
1594=0164330 
1600=0165000 
1608=0165250 
1617=0166520 
1625=0167300 
1633=016760Q 
1641=017030Q 
1649=0171000 
1660=0171550 
1667=0172310 
1674=0173240 
1680=0174340 
1691=0175050 
1697=0176040 
1703=0177140 
1714=0177440 
1777=0200240 
1784=0201250 
1792=0202070 
1799=0202770 
1805=0204230 
1811=0204720 
1817=0205360 
1823=0206020 
1829=0206460 
1835=0207120 
1841=0207600 
1847=021173Q 
1857 = 02131 IQ 
1864=0213700 
1872=0214400 
1878=0215340 
1884=0216150 
1892=021665Q 
1905=021747Q 
1912=0220210 
1919=0220640 
1925=0222240 
1931=0223300 
1937=0223750 
1943=0224250 
1952=0224670 
1958=0225260 


1124=0110600 
1134=011143Q 
1140=0112100 
1146=011314Q 
1152=0114140 
1169=011472Q 
1180=0116200 
1187=011672Q 
1193=0117510 
1200=0120110 
1206=012066Q 
1213=0121500 
1225=0122650 
1231=012354Q 
1237=0124300 
1243=0125400 
1249=0126330 
1256=0127160 
1265=013007Q 
1277=0130630 
1283=0131300 
1293=0132420 
1301=0133240 
1315=0133770 
1321=0135140 
1327=0136210 
1337=0137050 
1348=0137720 
1356=0140200 
1370=014110Q 
1378=0141450 
1384=0142200 
1390=0143010 
1397=0143470 
1410=0144150 
1416=0144610 
1426=0145630 
1432=0147060 
1445=0147360 
1451=0150070 
1458=0150700 
1464=0151440 
1480=0152270 
1491=0152770 
1503=0154770 
1514=0155670 
1527=0156260 
1533=0157400 
1539=0160040 
1557=0161030 
1563=0161570 
1573=0162350 
1589=0163060 
1595=0164400 
1601=016502Q 
1610=0165350 
1618=016653Q 
1626=0167330 
1634=0167630 
1642=017036Q 
1650=0171070 
1661=0171710 
1668=017253Q 
1675=0173520 
1685=017437Q 
1692=0175160 
1698=0176100 
1704=0177230 
1715=0177450 
1778=0200320 
1785=020127Q 
1793=0202250 
1800=0203230 
1806=0204340 
1812=0205000 
1818=0205440 
1824=0206100 
1830=0206540 
1836=0207200 
1842=0207660 
1848=0212070 
1858=021325Q 
1865=0213730 
1873=0214610 
1879=021540Q 
1885=0216220 
1900=0216730 
1906=0217730 
1913=0220310 
1920=022107Q 
1926=0222270 
1932=0223330 
1938=0224000 
1945=0224300 
1953=0225000 
1959=0225310 


1129=011064Q 
1135=011144Q 
1141=011226Q 
1147*011333Q 
1153*0114170 
1175=0115020 
1181*0116230 
1188*011700Q 
1194*0117560 
1201*0120150 
1207=0120730 
1214*0121630 
1226*0122730 
1232*0123710 
1238*0124340 
1244=0125520 
1250=0126470 
1257=0127420 
1272*0130120 
1278*0130640 
1288*0131330 
1296=0132450 
1302=0133470 
1316*0134070 
1322*0135230 
1328*0136470 
1338*0137130 
1349=0137670 
1357-014025Q 
1371-014115Q 
1379*0141530 
1385-0142270 
1392=0143060 
1398=014352Q 
1411*0144230 
1417*0144700 
1427*0145760 
1433*01471 IQ 
1446=0147510 
1452*0150140 
1459=0151010 
1468=0151470 
1481=0152510 
1492=0153340 
1504*015510Q 
1518*0155720 
1528=015650Q 
1534=015755Q 
1546=016007Q 
1558=0161170 
1566=0161620 
1574=0162500 
1590=0163440 
1596=0164510 
1602=0165100 
1611=0165610 
1621*0166560 
1627=0167410 
1635=0170130 
1643=0170600 
1651=0171100 
1662=0171750 
1669=0172670 
1676=0174000 
1686=017456Q 
1693=0175410 
1699=0176270 
1705=0177260 
1730=0177500 
1779=0200350 
1787=0201430 
1794=0202350 
1801=0203530 
1807=0204420 
1813=0205060 
1819=0205520 
1825=0206160 
1831*0206620 
1837=0207260 
1843=0207740 
1853=0212130 
1859=0213410 
1866*0214310 
1874*0214720 
1 880 = 021551Q 
1886=0216440 
1901=021706Q 
1907=021776Q 
1915=0220330 
1921=022174Q 
1927=0222520 
1933=0223540 
1939=0224100 
1948=0224350 
1954=0225030 


1130=0110740 
1136=011147Q 
1142=011237Q 
1148=011343Q 
1154=011420Q 
1176=0115070 
1182=0116310 
1189=0117030 
1195=0117650 
1202=0120250 
1208=0120750 
1215=0122250 
1227=0122760 
1233=0124020 
1239=0124430 
1245=0125550 
1251=0126630 
1258=0127430 
1273=0130200 
1279=0131070 
1289=0131620 
1297=0132530 
1303=0133620 
1317=0134330 
1323=0135400 
1329=0136730 
1339=0137220 
1350=0140050 
1366=0140300 
1372=014116Q 
1380=0141600 
1386=0142320 
1393 = 01431 IQ 
1399=0143710 
1412=0144260 
1418=0145210 
1428=0145730 
1434=0147120 
1447=014754Q 
1453=0150360 
1460=0151140 
1469=0151620 
1482=0152560 
1493=0153350 
1505=0155110 
1519=0156020 
1529=0156610 
1535=0157620 
1547=0160130 
1559=0161240 
1567=0162160 
1575=0162610 
1591=0163520 
1597=0164540 
1603=016513Q 
1612=0166070 
1622=0166620 
1628=0167420 
1636=0170160 
1644=0170630 
1657=017113Q 
1663=0172100 
1670 = 01731 IQ 
1677=0174030 
1687=0174670 
1694=0175460 
1700=0176470 
1706=0177270 
1731=0177560 
1781=0200420 
1788=0201510 
1796=0202320 
1802=0203760 
1808=0204500 
1814=0205140 
1820=0205600 
1826=0206240 
1832=0206700 
1838=0207340 
1844=0210020 
1854=0212200 
1860=0213530 
1867=0214340 
1875=0214750 
1881=0215650 
1887=0216500 
1902=0217230 
1908=0217770 
1916=0220370 
1922=0222020 
1928=0222770 
1934=0223570 
1940=0224120 
1949=0224460 
1955=0225140 


1131=011101Q 
1137=011161Q 
1143=0112530 
1149=011362Q 
1166=011423Q 
1177=0115210 
1184=0116370 
1190=0117140 
1196=011774Q 
1203=0120330 
1209=0121240 
1216=0122350 
1228=0123070 
1234=0124100 
1240=0124570 
1246=0125710 
1252=0126660 
1262=0127460 
1274=0130230 
1280=0131230 
1290=0132170 
1298=0132640 
1305=0133630 
1318=0134410 
1324=0135520 
1330=0136760 
1340=0137340 
1351=0140100 
1367=0140410 
1374=0141310 
1381=0141700 
1387=0142370 
1394=0143210 
1400=0144060 
1413=0144340 
1419=0145540 
1429=0146070 
1437=014715Q 
1448=0147650 
1454=0150420 
1461=0151170 
1470=0152000 
1483=0152670 
1500=0153450 
1511=0155140 
1520=0156030 
1530=0157010 
1536=0157730 
1548=0160570 
1560=0161340 
1568=0162170 
1576=0162720 
1592=0164170 
1598=0164570 
1604=0165160 
1613=0166130 
1623=0166750 
1631=0167450 
1637=0170240 
1645=0170710 
1658=0171250 
1664=0172230 
1671=0173140 
1678=0174110 
1688=0174760 
1695=0175720 
1701=0176530 
1712=0177340 
1775=0177620 
1782=0200660 
1789=0201570 
1797=0202560 
1803=0204040 
1809=0204560 
1815=0205220 
1821=0205660 
1827=0206320 
1833=0206760 
1839=0207420 
1845=0210230 
1855=0212430 
1861=0213550 
1870=0214310 
1876=0215050 
1882=0216000 
1888=0216530 
1903=0217300 
1910=0220100 
1917=0220460 
1923=0222160 
1929=0223130 
1935=0223640 
1941=0224150 
1950=0224510 
1956=0225170 


1132=011115Q 
1138*011165Q 
1144=011262Q 
1150=0113760 
1167=011445Q 
1178=0115460 
1185=0116520 
1191=0117250 
1197=0117750 
1204=0120410 
1210=0121270 
1217=0122610 
1229=0123200 
1235=0124150 
1241=012501Q 
1247=0125770 
1254=0126740 
1263=0127600 
1275=0130360 
1281=0131240 
1291=0132220 
1299=0133020 
1309=0133670 
1319=0134460 
1325=0135710 
1332=0137010 
1346=0137410 
1352 = 01401 10 
1368=0140430 
1375=0141350 
1382=0142060 
1388=0142530 
1395=0143250 
1401=01441 IQ 
1414=0144440 
1420=0145570 
1430=0146370 
1438=0147270 
1449=014776Q 
1455=0150530 
1462=0151300 
1471=0152010 
1484=0152700 
1 501=0153630 
1512=0155200 
1525=0156060 
1531=0157120 
1537=0160000 
1 549 = 0160600 
1561=0161450 
1571=0162220 
1577=016273Q 
1593=0164250 
1599=016462Q 
1605=016517Q 
1616=0166230 
1624=016700Q 
1632=0167510 
1638=0170250 
1646=0170720 
1659=0171350 
1665=0172240 
1672=0173170 
1679=0174330 
1690=0175010 
1696=0175750 
1702=0176740 
1713=0177410 
1776=0177730 
1783=0201200 
1791=0201650 
1798=0202640 
1804=0204070 
1610=0204640 
1816=0205300 
1822=0205740 
1828=0206400 
1834=0207040 
1840=0207500 
1846=0210340 
1856=0213010 
1863=0213630 
1871=0214360 
1877=0215200 
1883=0216100 
1889=0216640 
1904=0217340 
1911=0220140 
1918=0220560 
1924=0222210 
1930=0223160 
1936=0223740 
1942=0224200 
1951=0224620 
1957=0225220 

Number 24 


Page 30 



S00001 22744Q S00002 22744Q S00003 22744Q S00004 22744Q 
S00005 25000Q S00006 22744Q S00023 22744Q S00044 22744Q 
S00046 22745Q S00047 22746Q S00049 22747Q S00030 22750Q 
S00052 23072Q S00054 23074Q S00057 23076Q S00060 23101Q 
S00061 23102Q S00063 23103Q S00065 23104Q S00066 23105Q 
S00067 23106Q S00068 23107Q S00069 23110Q S00070 23112Q 
S00071 23113Q S00072 23114Q S00076 23117Q S00077 23120Q 
S00081 23123Q S00082 23124Q S00090 23126Q S00095 23127Q 
S00105 23130Q S00116 23133Q S00123 23134Q S00125 23136Q 
S00129 23140Q S00131 23142Q S00136 23144Q S00141 23145Q 
S00149 23146Q S00156 23150Q S00137 23153Q S00158 23154Q 
S00159 23155Q S00160 23156Q S00161 23160Q S00162 23162Q 
S00163 23164Q S00165 24162Q S00166 24163Q S00167 24164Q 
S00169 24166Q S00170 24167Q S00171 24170Q S00173 24172Q 
S00175 24174Q S00176 24176Q S00177 24200Q S00179 24203Q 
S00180 24204Q S00181 24206Q S00182 2421OQ S00184 24212Q 
S00185 24214Q S00186 24216Q S00187 24220Q S00188 24221Q 
S00190 24222Q S00196 24224Q S00199 24227Q S00208 24230Q 
S00209 24232Q S00211 24234Q S00218 24236Q S00221 24240Q 
S00228 24243Q S00229 24244Q S00232 24246Q S00242 24250Q 
S00244 24252Q S00247 24255Q S00251 24256Q S00253 24260Q 
S00254 24262Q S00257 24265Q S00261 24266Q S00262 24270Q 
S00266 24271Q S00270 24272Q S00271 24274Q S00273 24277Q 
S00278 24300Q S00279 24302Q S00281 24304Q S00282 24305Q 
S00295 24306Q S00297 2431 IQ S00303 24312Q S00305 24315Q 
S00316 24316Q S00318 24321Q S00323 24322Q S00325 24324Q 
S00326 24326Q S00327 24330Q S00328 24332Q S00329 24335Q 
S00346 24336Q S00347 24437Q S00348 24440Q S00350 24442Q 
S00357 24444Q S00359 24446Q S00360 24447Q S00371 24450Q 
S00374 24452Q S00391 24454Q S00405 24456Q S00421 24457Q 
S00431 24460Q S00433 24461Q S00434 24462Q S00443 24464Q 
S00449 24465Q S00451 24466Q S00458 24471Q S00459 24472Q 
S00460 24473Q S00472 24474Q S00474 24477Q S00482 24500Q 
S00484 24503Q S00485 2451 IQ S00486 24512Q S00487 24513Q 
S00499 24514Q S00501 24516Q S00502 24521Q S00503 24522Q 
S00511 24523Q S00520 24524Q S00525 24525Q S00530 24526Q 
S00531 24527Q S00532 24530Q S00566 24532Q S00576 24533Q 
S00577 24534Q S00579 24535Q S00582 24536Q S00595 24540Q 
S00596 24542Q S00597 24544Q S00598 24546Q S00599 24550Q 
S00600 24552Q S00601 24554Q S00602 24556Q S00603 24557Q 
S00610 24560Q S00624 24562Q S00625 24565Q S00642 24566Q 
S00643 24570Q S00644 24572Q S00660 24574Q S00662 24575Q 
S00663 24576Q S00664 24577Q S00665 24600Q S00680 24601Q 
S00688 24602Q S00689 24603Q S00690 24604Q S00715 24605Q 
S00716 24606Q S00722 24607Q S00730 2461OQ S00742 24612Q 
S00749 24614Q S00756 24616Q S00759 24621Q S00777 24622Q 
S00787 24624Q S00789 24627Q S00790 24630Q S00791 24631Q 
S00803 24632Q S00823 24635Q S00824 24636Q S00825 24637Q 
S00840 24640Q S00851 24642Q S00854 24644Q S00856 24647Q 
S00857 24650Q S00858 24651Q S00860 24652Q S00862 24655Q 
S00863 24656Q S00973 24777Q SOI 004 22743Q SOI 005 22742Q 
SOI 006 22740Q SOI 008 22736Q SOI 010 22734Q SOI Oil 22732Q 
SOI 013 22730Q S01014 22726Q S01015 22724Q S01016 22722Q 
SOI 017 22720Q SOI 018 22716Q SOI 019 22714Q SOI 021 22712Q 


STACK SIZE = 18 

BYTES 







000400Q 

LX I SP 

22712Q 

JMP 

22021 Q 





000406Q 

000Q 

OOOQ 100Q 

147Q 143C 

1 201Q i 

OOOQ OOOQ 

OOOQ OOOQ 



000420Q 

OOOQ 

OOOQ 1OOQ 

151Q 156C 

1 201 Q 





000426Q 

OOOQ 

OOOQ 1OOQ 

162Q 157C 

1 201Q i 

OOOQ OOOQ 

OOOQ OOOQ 



000440Q 

OOOQ 

OOOQ 1OOQ 

143Q 142C 

1 201 Q 





000446Q 

LX I H 

23117Q 

MOV MC 


INR L 


MOV ME 


000454Q 

I NX H 


MOV MD 


JMP 

5Q 

RET 


000462Q 

LX! H 

23123Q 

MOV MC 


INR L 


MOV ME 


000470Q 

I NX H 


MOV MD 


JMP 

3Q 

RET 


000476Q 

MOV Cl 

2Q 

MOV El 

15Q 

MOV D1 

OQ 

CALL 

446Q 

000507Q 

MOV Cl 

2Q 

MOV El 

1 2Q 

MOV Dl 

OQ 

CALL 

446Q 

000520Q 

LX I H 

22746Q 

MOV MI 

OQ 

RET 


LXI H 

23126Q 

000531Q 

MOV MC 


MOV Cl 

2Q 

MOV EM 


MOV Di 

OQ 

000537Q 

CALL 

446Q 

LX I H 

23126Q 

MOV AM 


sub r 

1 5Q 

000550Q 

JNZ 

5600 

DCR H 


MOV LI 

346Q 

MOV MI 

OQ 

000560Q 

LX I H 

22746Q 

INR M 


MOV AM 


DCR L 


000566Q 

SUB M 


CZ 

476Q 

RET 


LXI H 

23127Q 

000576Q 

MOV MC 


IN 

IQ 

RRC 


RRC 


000603Q 

RRC 


JC 

577Q 

LXI H 

23127Q 

MOV AM 


000613Q 

CMA 


OUT 

OQ 

RET 


MOV Cl 

IQ 

000621Q 

MOV El 

OQ 

MOV DI 

OQ 

CALL 

462Q 

RET 


000631Q 

MOV Cl 

13Q 

MOV El 

OQ 

MOV Dl 

OQ 

CALL 

462Q 

000642Q 

RET 


LX I H 

23130Q 

MOV MC 


1 NX H 


000650Q 

MOV MB 


MOV Cl 

1 IQ 

DCR L 


MOV EM 


000655Q 

I NR L 


MOV DM 


CALL 

446Q 

CALL 

476Q 

000665Q 

RET 


LHLD 

23074Q 

MOV AM 


SUB 1 

OQ 

000674Q 

JNZ 

71 IQ 

LX I H 

23105Q 

MOV CM 


MOV LI 

107Q 

000705Q 

MOV MC 


JMP 

731Q 

LHLD 

23074Q 

MOV AM 


000715Q 

ANA I 

7Q 

DCR A 


LXI H 

23107Q 

MOV MA 


000724Q 

LHLD 

23074Q 

MOV MI 

OQ 

LXI H 

23106Q 

MOV AM 


000735Q 

I NR L 


SUB M 


JZ 

756Q 

MOV CM 


000743Q 

DCR L 


MOV MC 


MOV Cl 

16Q 

INR L 


000750Q 

MOV EM 


MOV DI 

OQ 

CALL 

446Q 

RET 


000757Q 

LX 1 H 

23133Q 

MOV MC 


MOV AM 


SUB I 

1 41Q 

000766Q 

SBC A 


MOV CA 


MOV AI 

1 72Q 

SUB M 


000773Q 

SBC A 


ORA C 


RRC 


JNC 

1003Q 

001001Q 

MOV AM 


RET 


MOV AM 


SUB 1 

40Q 

001006Q 

RET 


LX I H 

23134Q 

MOV MC 


I NX H 



Number 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 31 


178 



001014Q 

MOV 

MB 


INR 

L 


MOV 

Ml 

OQ 

I NX 

H 


001021Q 

MOV 

MI 

00 

LX I 

H 

23136Q 

MOV 

AM 

I NR 

L 


001030Q 

MOV 

BM 


MOV 

LI 

134Q 

SUB 

M 


I NR 

L 


001035Q 

MOV 

CA 


MOV 

AB 


SBC 

M 


JNC 


1072Q 

001043Q 

MOV 

AI 

7Q 

MOV 

B1 

140 

MOV 

CB 


DCR 

C 

001051Q 

JNZ 


10500 

DCR 

A 


JNZ 


1047Q 

LHLD 

231360 

001063Q 

I NX 

H 


SHLD 

23136Q 

JMP 


1023Q 

RET 



001073Q 

LX I 

H 

23140Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


001101Q 

1 NR 

L 


MOV 

MI 

10 

I NX 

H 


MOV 

MI 

OQ 

001107Q 

LX I 

H 

231400 

MOV 

AM 


INR 

L 


MOV 

BM 


001115Q 

I NR 

L 


SUB 

M 


INR 

L 


MOV 

CA 


001121Q 

MOV 

AB 


SBC 

M 


JC 


1222Q 

CALL 

631 Q 

001131Q 

RRC 



RC 



MOV 

AI 

377Q 

MOV 

B1 

14Q 

001137Q 

MOV 

CB 


DCR 

C 


JNZ 


1 1 40Q 

DCR 

A 


001145Q 

JNZ 


11370 

MOV 

AI 

377Q 

MOV 

B1 

14Q 

MOV 

CB 


001155Q 

DCR 

C 


JNZ 


1 155Q 

DCR 

A 


JNZ 


1154Q 

001165Q 

MOV 

A I 

207Q 

MOV 

BI 

14Q 

MOV 

CB 


DCR 

C 


001173Q 

JNZ 


1 1 72Q 

DCR 

A 


JNZ 


11710 

LX I 

H 

23142Q 

0012050 

MOV 

CM 


1 NR 

L 


MOV 

BM 


LX I 

H 

IQ 

001213Q 

DAD 

B 


SHLD 

231420 

JMP 


1 1 07Q 

RET 

001223Q 

LX I 

H 

23144Q 

MOV 

AM 


RRC 



JNC 


1237Q 

001233Q 

IN 


5Q 

CMA 



RET 



I N 


7Q 

001241Q 

CMA 



RET 



LX I 

H 

231450 

MOV 

MC 

001247Q 

CALL 

1223Q 

RRC 



RRC 

CMA 


001235Q 

RRC 



JC 


1247Q 

MOV 

AM 


RRC 



0012630 

JNC 


1276Q 

INR 

L 


MOV 

AM 


CMA 



001271Q 

OUT 


4Q 

JMP 


1303Q 

INR 

L 


MOV 

AM 


001300Q 

CMA 



OUT 


6Q 

RET 



LX I 

H 

23146Q 

001307Q 

MOV 

Ml 

00 

I NX 

H 


MOV 

Ml 

OQ 

MOV 

A I 

3500 

0013160 

MOV 

BI 

375Q 

LX 1 

H 

23146Q 

SUB 

M 


INR 

L 


001325Q 

MOV 

CA 


MOV 

AB 


SBC 

M 


JC 


1402Q 

001333Q 

CALL 

1223Q 

RRC 



JNC 


1363Q 

MOV 

AM 

001343Q 

RRC 



JNC 


1 3350 

IN 


4Q 

CMA 


001352Q 

ANA 

I 

1770 

RET 



IN 


6Q 

CMA 



001360Q 

ANA 

I 

1 77Q 

RET 



MOV 

LI 

1 460 

MOV 

CM 


001366Q 

I NR 

L 


MOV 

BM 


LX I 

H 

IQ 

DAD 

B 


001374Q 

SHLD 

231460 

JMP 


1314Q 

MOV 

A I 

377Q 

RET 


001405Q 

LX I 

H 

24222Q 

MOV 

MC 


I NX 

H 

MOV 

MB 


001413Q 

LX I 

H 

23150Q 

MOV 

CM 


INR 

L 


MOV 

BM 


001421Q 

LHLD 

242220 

MOV 

MC 


I NX 

H 


MOV 

MB 


001427Q 

LX I 

H 

24222Q 

MOV 

CM 


INR 

L 


MOV 

BM 


001435Q 

LX I 

H 

23150Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


001443Q 

RET 



LX I 

H 

23150Q 

MOV 

CM 


INR 

L 


001451Q 

MOV 

BM 


MOV 

CB 


MOV 

AC 


SUB 

1 

OQ 

0014560 

JNZ 


15560 

JMP 


1314Q 






001464Q 

106Q 

122Q 1 050 

105Q 

040Q 123Q 

1 24Q 117Q 

122Q 1 01Q 

1070 105Q 0400 

001502Q 

1 23Q l 

040Q 105Q 

1 15Q 

120Q 124Q 

1 31Q 040Q 

040Q 044Q 




001514Q 

LX 1 

B 

1464Q 

CALL 

643Q 

LX I 

H 

24227Q 

MOV 

AM 


001526Q 

RRC 



JNC 


1542Q 

MOV 

MI 

OQ 

LX I 

SP 

22712Q 

001537Q 

JMP 


403Q 

MOV 

Cl 

OQ 

MOV 

El 

00 

MOV 

DI 

OQ 

001550Q 

CALL 

446Q 

JMP 


1743Q 

DCR 

L 


MOV 

CM 

001560Q 

I NR 

L 


MOV 

BM 


LX I 

H 

24224Q 

MOV 

MC 


001566Q 

1 NX 

H 


MOV 

MB 


LHLD 

23150Q 

MOV 

AM 


001574Q 

I NX 

H 


MOV 

BM 


LX 1 

H 

23150Q 

MOV 

MA 


0016020 

I NX 

H 


MOV 

MB 


LHLD 

24224Q 

MOV 

Ml 

OQ 

00161 IQ 

1 NX 

H 


MOV 

Ml 

OQ 

DCX 

H 


1 NX 

H 

001616Q 

1 NX 

H 


MOV 

Ml 

201Q 

I NX 

H 


MOV 

Ml 

201Q 

001624Q 

LX I 

B 

4Q 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

20 IQ 

001635Q 

I NX 

H 


MOV 

MI 

201Q 

LX I 

B 

6Q 

LHLD 

24224Q 

001646Q 

DAD 

B 


MOV 

MI 

2010 

I NX 

H 


MOV 

MI 

2010 

001654Q 

LX I 

B 

100 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

201Q 

0016650 

I NX 

H 


MOV 

MI 

201 Q 

LX I 

B 

12Q 

LHLD 

24224Q 

0016760 

DAD 

B 


MOV 

MI 

201Q 

I NX 

H 


MOV 

MI 

201 Q 

001704Q 

LX I 

B 

14Q 

LHLD 

24224Q 

DAD 

B 


MOV 

MI 

201 Q 

001715Q 

I NX 

H 


MOV 

Ml 

201Q 

LX I 

B 

16Q 

LHLD 

24224Q 

001726Q 

DAD 

B 


MOV 

MI 

201 Q 

I NX 

H 


MOV 

Ml 

201 Q 

001734Q 

LX I 

H 

242240 

MOV 

AM 


INR 

L 


MOV 

BM 

001742Q 

RET 



RET 



LX I 

H 

24230Q 

MOV 

MC 


001750Q 

I NX 

H 


MOV 

MB 


INR 

L 


MOV 

ME 


001754Q 

I NX 

H 


MOV 

MD 


MOV 

LI 

230Q 

MOV 

CM 


001761Q 

I NR 

L 


MOV 

BM 


MOV 

LI 

234Q 

MOV 

MC 


001766Q 

I NX 

H 


MOV 

MB 


LX I 

H 

24232Q 

MOV 

AM 


001774Q 

I NR 

L 


MOV 

BM 


SUB 

I 

20Q 

MOV 

CA 


002001Q 

MOV 

AB 


SBC 

I 

OQ 

MOV 

BA 


MOV 

AC 


002006Q 

1 NR 

L 


SUB 

M 


INR 

L 


MOV 

CA 


002012Q 

MOV 

AB 


SBC 

M 


JC 


205 IQ 

JMP 

2037Q 

002022Q 

LX I 

B 

20Q 

LHLD 

24234Q 

DAD 

B 


SHLD 

24234Q 

002034Q 

JMP 


1770Q 

DCR 

L 


MOV 

CM 


INR 

L 

002042Q 

MOV 

BM 


CALL 

1403Q 

JMP 


20220 

RET 



002052Q 

LX I 

H 

242360 

MOV 

MC 


I NX 

H 


MOV 

MB 


002060Q 

DCR 

L 


MOV 

AM 


INR 

L 


MOV 

BM 


002064Q 

ANA 

I 

360Q 

MOV 

CA 


MOV 

AB 


ANA 

I 

377Q 

002072Q 

DCR 

L 


MOV 

MC 


1 NX 

H 


MOV 

MA 

0020760 

MOV 

BA 


MOV 

AC 


MOV 

LI 

2160 

SUB 

M 


002103Q 

INR 

L 


MOV 

CA 


MOV 

AB 


SBC 

M 


002107Q 

ORA 

C 


RZ 



LX 1 

H 

24236Q 

MOV 

CM 


002115Q 

INR 

L 


MOV 

BM 


MOV 

CB 


MOV 

AC 


002121Q 

SUB 

I 

OQ 

RZ 



LHLD 

24236Q 

MOV 

AM 


002130Q 

1 NX 

H 


MOV 

BM 


LX 1 

H 

24240Q 

MOV 

MA 


002136Q 

I NX 

H 


MOV 

MB 


MOV 

LI 

236Q 

MOV 

CM 


002143Q 

I NR 

L 


MOV 

BM 


CALL 

1 405Q 

LX I 

H 

24240Q 

0021530 

MOV 

CM 


INR 

L 


MOV 

BM 


MOV 

LI 

236Q 

002160Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


JMP 

21110 

0021660 

RET 



LX I 

H 

24243Q 

MOV 

MC 


INR 

L 


Page 32 


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


Number 24 

179 



Number 24 


002174Q 

MOV 

ME 


I NX H 


MOV 

MD 


DCR L 


002200Q 

MOV 

CM 


INR L 


MOV 

BM 


MOV CB 


002204Q 

MOV 

AC 


SUB 1 

OQ 

JNZ 


221 6Q 

XRA A 


002213Q 

MOV 

B 1 

00 

RET 


LHLD 

24244Q 

MOV AM 


002222Q 

I NX 

H 


MOV BM 


MOV 

CB 


XRA A 


002226Q 

SUB 

C 


JNC 

2247Q 

DCX 

H 


MOV AM 


002234Q 

I NX 

H 


MOV BM 


LX I 

H 

24244Q 

MOV MA 


002242Q 

I NX 

H 


MOV MB 


JMP 


2216Q 

LX I B 

2Q 

0022520 

LHLD 

24244Q 

DAD B 


SHLD 

24246Q 

LHLD 

24246Q 

002264Q 

MOV 

AM 


SUB I 

201Q 

JZ 


2301 Q 

I NX H 


002273Q 

SHLD 

24246Q 

JMP 

226 IQ 

LX I 

H 

24243Q 

MOV CM 


002305Q 

LHLD 

24246Q 

MOV MC 


I NX 

H 


SHLD 

24246Q 

002315Q 

XCHO 


MOV AE 


ANA 

I 

17Q 

SUB I 

OQ 

002323Q 

JNZ 


2357Q 

CALL 

1 444Q 

LHLD 

24244Q 

MOV MA 


002335Q 

I NX 

H 


MOV MB 


LX I 

H 

24246Q 

MOV MA 


002343Q 

I NX 

H 


MOV MB 


LX I 

B 

2Q 

LHLD 

24246Q 

002353Q 

DAD 

B 


SHLD 

24246Q 

LX I 

H 

24246Q 

MOV AM 


002363Q 

I NR 

L 


MOV BM 


RET 



LX I H 

24250Q 

002371Q 

MOV 

MC 


I NX H 


MOV 

MB 


LX I H 

23153Q 

002377Q 

MOV 

AM 


RRC 


JNC 


2427Q 

MOV MI 

OQ 

002406Q 

LX! 

H 

24250Q 

MOV CM 


INR 

L 


MOV BM 


002414Q 

INR 

L 


MOV MC 


I NX 

H 


MOV MB 


002420Q 

LHLD 

24252Q 

I NX H 


SHLD 

23156Q 

LHLD 

23156Q 

002432Q 

I NX 

H 


SHLD 

23156Q 

XCHG 


MOV AE 


002440Q 

ANA 

I 

17Q 

SUB 1 

OQ 

JNZ 


251 7Q 

LX I H 

23156Q 

002452Q 

MOV 

AM 


INR L 


MOV 

BM 


SUB I 

20Q 

002457Q 

MOV 

CA 


MOV AB 


SBC 

I 

OQ 

LX I H 

24252Q 

002466Q 

MOV 

MC 


I NX H 


MOV 

MA 


LHLD 

24252Q 

002474Q 

MOV 

AM 


I NX H 


MOV 

BM 


LX I H 

24252Q 

002502Q 

MOV 

MA 


I NX H 


MOV 

MB 


LX I B 

2Q 

002510Q 

LHLD 

24252Q 

DAD B 


SHLD 

23156Q 

LHLD 

23156Q 

002522Q 

MOV 

AM 


RET 


LX I 

H 

24256Q 

MOV MC 


002530Q 

I NX 

H 


MOV MB 


LX I 

H 

23154Q 

MOV AM 


002536Q 

RRC 



JNC 

2565Q 

MOV 

MI 

OQ 

LX I H 

24256Q 

002547Q 

MOV 

CM 


INR L 


MOV 

BM 


INR L 


002553Q 

MOV 

MC 


I NX H 


MOV 

MB 


LHLD 

24260Q 

002561Q 

I NX 

H 


SHLD 

24262Q 

LHLD 

24262Q 

I NX H 


002571Q 

SHLD 

24262Q 

XCHG 


MOV 

AE 


ANA I 

17Q 

002600Q 

SUB 

I 

OQ 

JNZ 

2633Q 

LHLD 

24260Q 

MOV AM 


00261 IQ 

1 NX 

H 


MOV BM 


LX I 

H 

24260Q 

MOV MA 


002617Q 

I NX 

H 


MOV MB 


LX I 

B 

2Q 

LHLD 

24260Q 

002627Q 

DAD 

B 


SHLD 

24262Q 

LHLD 

242620 

MOV AM 


002637Q 

RET 



LX I H 

24266Q 

MOV 

MC 


I NX H 


002645Q 

MOV 

MB 


INR L 


MOV 

ME 


LX I H 

23155Q 

002653Q 

MOV 

AM 


RRC 


JNC 


271 OQ 

MOV MI 

OQ 

002662Q 

LX! 

H 

24266Q 

MOV CM 


INR 

L 


MOV BM 


002670Q 

LX! 

H 

23162Q 

MOV MC 


I NX 

H 


MOV MB 


002676Q 

LX! 

B 

20 

LHLD 

23162Q 

DAD 

B 


SHLD 

23160Q 

002710Q 

LX I 

H 

24270Q 

MOV CM 


LHLD 

23160Q 

MOV MC 


002720Q 

I NX 

H 


SHLD 

23160Q 

XCHG 


MOV AE 


002726Q 

ANA 

I 

17Q 

SUB I 

OQ 

JNZ 


2766Q 

CALL 

1444Q 

002740Q 

LHLD 

23162Q 

MOV MA 


I NX 

H 


MOV MB 


002746Q 

LX! 

H 

23162Q 

MOV MA 


I NX 

H 


MOV MB 


002754Q 

LX 1 

B 

2Q 

LHLD 

23162Q 

DAD 

B 


SHLD 

23160Q 

002766Q 

RET 



LX I H 

24272Q 

MOV 

MC 


I NX H 


002774Q 

MOV 

MB 


INR L 


MOV 

ME 


I NX H 


003000Q 

MOV 

MD 


LX I H 

23153Q 

MOV 

MI 

377Q 

MOV LI 

1 55Q 

003010Q 

MOV 

MI 

377Q 

LX I H 

24272Q 

MOV 

CM 


I NR L 


003017Q 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

24277Q 

MOV MA 


003027Q 

SUB 

I 

201Q 

JZ 

3061 Q 

MOV 

AM 


RLC 


003036Q 

CMA 



RRC 


JNC 


301 2Q 

MOV LI 

274Q 

003045Q 

MOV 

CM 


INR L 


MOV 

BM 


MOV LI 

277Q 

003052Q 

MOV 

EM 


CALL 

2640Q 

JMP 


301 2Q 

RET 


003062Q 

LX I 

H 

24300Q 

MOV MC 


I NX 

H 


MOV MB 


003070Q 

INR 

L 


MOV ME 


I NX 

H 


MOV MD 


003074Q 

JMP 


3167Q 

LX I H 

24300Q 

MOV 

CM 


I NR L 


003104Q 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

24304Q 

MOV MA 


003114Q 

SUB 

I 

201 Q 

ADD I 

377Q 

SBC 

A 


MOV CA 


003122Q 

MOV 

AM 


RLC 


ANA 

C 


RRC 


003126Q 

JC 


3077Q 

MOV AM 


RET 



LX I H 

24302Q 

003136Q 

MOV 

CM 


INR L 


MOV 

BM 


CALL 

2524Q 

0031440 

LX I 

H 

24305Q 

MOV MA 


SUB 

I 

201 Q 

ADD I 

377Q 

003154Q 

SBC 

A 


MOV CA 


MOV 

AM 


RLC 


003160Q 

ANA 

C 


RRC 


JC 


3133Q 

MOV AM 


003166Q 

RET 



LX I H 

23153Q 

MOV 

MI 

377Q 

I NR L 


003175Q 

MOV 

Ml 

377Q 

CALL 

3077Q 

LX I 

H 

22743Q 

MOV MA 


003206Q 

CALL 

31 33Q 

LX I H 

22743Q 

SUB 

M 


JNZ 

3234Q 

003220Q 

LX I 

H 

24304Q 

MOV AM 


SUB 

I 

201 Q 

JNZ 

31 77Q 

003231Q 

MOV 

A! 

377Q 

RET 


XRA 

A 


RET 


003236Q 

LX! 

H 

24306Q 

MOV MC 


I NX 

H 


MOV MB 


003244Q 

DCR 

L 


MOV CM 


INR 

L 


MOV BM 


003250Q 

MOV 

CB 


MOV AC 


SUB 

I 

OQ 

JNZ 

3262Q 

003257Q 

MOV 

AI 

377Q 

RET 


LX I 

H 

23153Q 

MOV MI 

377Q 

003267Q 

LX! 

H 

24306Q 

MOV AM 


INR 

L 


MOV BM 


003275Q 

ANA 

I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

003303Q 

MOV 

BA 


CALL 

2366Q 

LX I 

H 

2431 IQ 

MOV MA 


003313Q 

SUB 

I 

201 Q 

JZ 

3331 Q 

MOV 

AM 


RLC 


003322Q 

CMA 



RRC 


JNC 


3267Q 

XRA A 


003330Q 

RET 



MOV AI 

377Q 

RET 



LX I H 

24312Q 

003337Q 

MOV 

MC 


I NX H 


MOV 

MB 


LX I H 

23153Q 

003345Q 

MOV 

MI 

377Q 

LX I H 

24312Q 

MOV 

AM 


INR L 


003354Q 

MOV 

BM 


ANA I 

360Q 

MOV 

CA 


MOV AB 


003361Q 

ANA 

I 

377Q 

MOV BA 


CALL 

2366Q 

LX I H 

24315Q 

003372Q 

MOV 

MA 


SUB I 

201 Q 

ADD 

I 

377Q 

SBC A 



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


Page 33 


180 




003400Q 

MOV CA 


PUSH B 


MOV Cl 

1 3Q 

MOV El 

OQ 

003406Q 

MOV Dl 

OQ 

CALL 

462Q 

CMA 


POP D 


003415Q 

ANA E 


RRC 


JNC 

3470Q 

LX I H 

24315Q 

003425Q 

MOV AM 


RLC 


CMA 


RRC 


003431Q 

JNC 

3347Q 

LX I H 

22744Q 

MOV AM 


RRC 


003441Q 

JNC 

3456Q 

LX I H 

24315Q 

MOV CM 


CALL 

5260 

003453Q 

JMP 

3465Q 

LX I H 

24315Q 

MOV CM 


CALL 

573Q 

003465Q 

JMP 

3347Q 

RET 


MOV Cl 

2Q 

MOV BI 

OQ 

003475Q 

CALL 

1073Q 

CALL 

1 223Q 

RRC 


JNC 

3527Q 

003507Q 

CALL 

1304Q 

MOV LI 

11 2Q 

MOV MA 


MOV Cl 

2Q 

003517Q 

MOV BI 

OQ 

CALL 

1073Q 

JMP 

3500Q 

RET 


003530Q 

LX I H 

24316Q 

MOV MC 


I NX H 


MOV MB 


003P36Q 

CALL 

3471 Q 

MOV LI 

153Q 

MOV MI 

377Q 

LX I H 

24316Q 

003550Q 

MOV CM 


INR L 


MOV BM 


CALL 

23660 

003556Q 

LX I H 

243210 

MOV MA 


SUB I 

201 Q 

JZ 

3605Q 

003567Q 

MOV AM 


RLC 


CMA 


RRC 


003573Q 

JNC 

35450 

MOV CM 


CALL 

1243Q 

JMP 

35f»5Q 

003G05Q 

RET 


LX I H 

24322Q 

MOV MC 


I NX H 


003613Q 

MOV MB 


JMP 

4022Q 

LX I H 

23154Q 

MOV MI 

377Q 

003624Q 

LX I H 

243240 

MOV CM 


INR L 


MOV BM 


003632Q 

LX I H 

23156Q 

MOV MC 


I NX H 


MOV MB 


003640Q 

MOV Cl 

OQ 

MOV BI 

00 

CALL 

2366Q 

LX I H 

24335Q 

003652Q 

MOV MA 


MOV CA 


PUSH B 


MOV LI 

322Q 

003657Q 

MOV CM 


INR L 


MOV BM 


CALL 

2524Q 

003665Q 

POP D 


SUB E 


JNZ 

3746Q 

LX I H 

24335Q 

003675Q 

MOV AM 


SUB I 

201 Q 

JNZ 

37060 

MOV A1 

377Q 

003705Q 

RET 


CALL 

1 223Q 

RRC 


JNC 

3640Q 

003715Q 

LX I H 

24330Q 

MOV CM 


I NR L 


MOV BM 


003723Q 

MOV LI 

326Q 

MOV MC 


I NX H 


MOV MB 


003730Q 

CALL 

1304Q 

MOV EA 


MOV Cl 

OQ 

MOV BI 

OQ 

003740Q 

CALL 

2640Q 

JMP 

36400 

LX I H 

24335Q 

MOV AM 


003752Q 

SUB I 

201 Q 

JZ 

4020Q 

MOV LI 

324Q 

MOV CM 


003762Q 

INR L 


MOV BM 


LX I H 

231560 

MOV MC 


003770Q 

1 NX H 


MOV MB 


MOV Cl 

OQ 

MOV B1 

OQ 

003776Q 

CALL 

2366Q 

LX I H 

23112Q 

MOV MA 


MOV LI 

1 56Q 

004007Q 

MOV CM 


INR L 


MOV BM 


LX 1 H 

24324Q 

0040150 

MOV MC 


I NX H 


MOV MB 


XRA A 


004021Q 

RET 


LX I H 

230720 

MOV AM 


I NR L 


0040270 

MOV BM 


SUB 1 

OQ 

MOV CA 


MOV AB 


004034Q 

SBC I 

OQ 

ORA C 


JNZ 

40550 

LX I H 

24330Q 

004045Q 

MOV Ml 

2Q 

I NX H 


MOV Ml 

OQ 

JMP 

4075Q 

004055Q 

LHLD 

23072Q 

1 NX H 


SHLD 

24330Q 

CALL 

347 IQ 

004067Q 

MOV LI 

102Q 

MOV CM 


CALL 

1243Q 

CALL 

1 444Q 

004100Q 

LX 1 H 

242100 

MOV MA 


I NX H 


MOV MB 


004106Q 

MOV CA 


MOV LC 


MOV HB 


I NX H 


004112Q 

SHLD 

24324Q 

LX I H 

231550 

MOV MI 

377Q 

LX I H 

24330Q 

0041250 

MOV CM 


INR L 


MOV BM 


MOV LI 

326Q 

004132Q 

MOV MC 


I NX H 


MOV MB 


LHLD 

24326Q 

004140Q 

DCX H 


SHLD 

243260 

XCHG 


MOV AE 


004146Q 

SUB 1 

00 

MOV EA 


MOV AD 


SBC I 

OQ 

0041540 

ORA E 


ADD I 

377Q 

SBC A 


LX 1 H 

22742Q 

0041630 

MOV MA 


CALL 

631 Q 

CMA 


LX I H 

22742Q 

004173Q 

ANA M 


RRC 


JNC 

4320Q 

LX I H 

24332Q 

0042030 

MOV Ml 

00 

I NX H 


MOV Ml 

00 

MOV A1 

21 OQ 

004212Q 

MOV B1 

230 

LX I H 

24332Q 

SUB M 


INR L 


004221Q 

MOV CA 


MOV AB 


SBC M 


JC 

41350 

0042270 

CALL 

1223Q 

RRC 


JNC 

4300Q 

LX I H 

24330Q 

004241Q 

MOV CM 


INR L 


MOV BM 


MOV LI 

326Q 

004246Q 

MOV MC 


I NX H 


MOV MB 


CALL 

1 304Q 

0042540 

MOV EA 


LX I H 

2421OQ 

MOV CM 


INR L 


004262Q 

MOV BM 


CALL 

2640Q 

CALL 

361 7Q 

RRC 


0042720 

JNC 

43000 

MOV AI 

3770 

RET 


LX I H 

24332Q 

0043030 

MOV CM 


INR L 


MOV BM 


LX I H 

IQ 

00431 IQ 

DAD B 


SHLD 

24332Q 

JMP 

42100 

XRA A 


004321Q 

RET 


LX I H 

24437Q 

MOV MI 

OQ 

MOV AI 

37Q 

0043310 

LX 1 H 

24437Q 

SUB M 


JC 

4364Q 

MOV CM 


004341Q 

MOV BI 

OQ 

DCR H 


MOV LI 

336Q 

DAD B 


004347Q 

DAD B 


MOV MI 

00 

I NX H 


MOV MI 

OQ 

004355Q 

LX I H 

24437Q 

INR M 


JNZ 

4327Q 

RET 


004365Q 

LX I H 

244440 

MOV MC 


I NX H 


MOV MB 


004373Q 

INR L 


MOV Ml 

OQ 

LX I H 

23153Q 

MOV MI 

377Q 

004403Q 

LX I H 

24444Q 

MOV CM 


INR L 


MOV BM 


00441 IQ 

CALL 

2366Q 

LX I H 

24447Q 

MOV MA 


SUB I 

20 IQ 

004422Q 

JZ 

4434Q 

MOV AM 


DCR L 


ADD M 


004430Q 

MOV MA 


JMP 

4403Q 

DCR L 


MOV AM 


004436Q 

ANA I 

37Q 

MOV LI 

370 

MOV MA 


MOV CA 


004444Q 

MOV B1 

00 

DCR H 


MOV LI 

3360 

DAD B 


004452Q 

DAD B 


MOV AM 


I NX H 


MOV BM 


004456Q 

LX 1 H 

24440Q 

MOV MA 


I NX H 


MOV MB 


004464Q 

MOV CB 


MOV AC 


SUB I 

OQ 

JNZ 

4475Q 

004473Q 

XRA A 


RET 


MOV LI 

37Q 

MOV CM 


004500Q 

MOV B1 

OQ 

DCR H 


MOV LI 

336Q 

DAD B 


004506Q 

DAD B 


SHLD 

24442Q 

LX I B 

60 

LHLD 

244400 

004520Q 

DAD B 


XCHG 


LX I H 

24444Q 

MOV CM 


004526Q 

INR L 


MOV BM 


CALL 

30620 

CMA 


004534Q 

RRC 


JNC 

4577Q 

LX! H 

244400 

MOV CM 


004544Q 

INR L 


MOV BM 


INR L 


MOV MC 


004550Q 

I NX H 


MOV MB 


LHLD 

24440Q 

MOV AM 


004556Q 

I NX H 


MOV BM 


LX I H 

24440Q 

MOV MA 


004564Q 

I NX H 


MOV MB 


MOV CB 


MOV AC 


004570Q 

SUB I 

OQ 

JNZ 

451 2Q 

XRA A 


RET 


004577Q 

MOV At 

3770 

RET 


LX I B 

60 

LHLD 

24440Q 

004610Q 

DAD B 


MOV AM 


I NX H 


MOV BM 


004614Q 

MOV CA 


CALL 

2052Q 

LX I B 

4Q 

LHLD 

24440Q 


Number 24 

181 


Page 34 


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



004626Q 

DAD 

B 


MOV AM 


1 NX H 


MOV BM 


004632Q 

MOV 

CA 


CALL 

2052Q 

LHLD 

24440Q 

MOV AM 


004642Q 

1 NX 

H 


MOV BM 


LHLD 

24442Q 

MOV MA 


004650Q 

I NX 

H 


MOV MB 


LX I H 

244400 

MOV CM 


004656Q 

I NR 

L 


MOV BM 


CALL 

1 405Q 

RET 


004664Q 

LX 1 

H 

244500 

MOV MC 


I NX H 


MOV MB 


004672Q 

CALL 

1444Q 

LX 1 H 

24440Q 

MOV MA 


1 NX H 


004702Q 

MOV 

MB 


MOV LI 

370 

MOV CM 


MOV BI 

OQ 

004710Q 

DCR 

H 


MOV LI 

336Q 

DAD B 


DAD B 


0047150 

MOV 

AM 


1 NX H 


MOV BM 


LHLD 

24440Q 

004723Q 

MOV 

MA 


I NX H 


MOV MB 


LX I H 

24437Q 

004731Q 

MOV 

CM 


MOV B1 

OQ 

DCR H 


MOV LI 

336Q 

004737Q 

DAD 

B 


DAD B 


XCHG 


LX I H 

244400 

004745Q 

MOV 

CM 


INR L 


MOV BM 


MOV AC 


004751Q 

STAX D 


1 NX D 


MOV AB 


STAX D 


004755Q 

LX I 

B 

6Q 

LHLD 

24440Q 

DAD B 


MOV MI 

00 

004766Q 

I NX 

H 


MOV Ml 

OQ 

LX I B 

60 

LHLD 

24440Q 

004777Q 

DAD 

B 


XCHG 


LX I H 

244500 

MOV CM 


005005Q 

INR 

L 


MOV BM 


CALL 

2767Q 

LX I B 

4Q 

005015Q 

LHLD 

24440Q 

DAD B 


MOV Ml 

OQ 

I NX H 


005024Q 

MOV 

Ml 

OQ 

RET 


LX I H 

24452Q 

MOV MC 


005033Q 

I NX 

H 


MOV MB 


LX I B 

4Q 

LHLD 

24440Q 

005043Q 

DAD 

B 


MOV AM 


I NX H 


MOV BM 


005047Q 

MOV 

CA 


CALL 

2052Q 

LX I B 

4Q 

LHLD 

24440Q 

005061Q 

DAD 

B 


XCHG 


LX I H 

24452Q 

MOV CM 


005067Q 

INR 

L 


MOV BM 


MOV AC 


STAX D 


005073Q 

I NX 

D 


MOV AB 


STAX D 


LHLD 

24440Q 

005101Q 

I NX 

H 


I NX H 


PUSH H 


LHLD 

24452Q 

005107Q 

I NX 

H 


XCHG 


POP H 


MOV ME 


005113Q 

I NX 

H 


MOV MD 


RET 


JMP 

5136Q 

005121Q 

100Q 

1 73Q 160Q 

163Q 174Q 100Q 

1 73Q 162Q 

163Q 174Q 

056Q 175Q 175Q 

005136Q 

LX I 

H 

23155Q 

MOV MI 

377Q 

CALL 

1444Q 

LX 1 H 

2311OQ 

005151Q 

MOV 

MA 


I NX H 


MOV MB 


MOV El 

1 000 

005156Q 

MOV 

CA 


CALL 

2640Q 

MOV Cl 

00 

MOV BI 

OQ 

005166Q 

MOV 

El 

1 51 Q 

CALL 

26400 

MOV Cl 

OQ 

MOV BI 

OQ 

005177Q 

MOV 

El 

155Q 

CALL 

26400 

LX I H 

23110Q 

MOV CM 


00521OQ 

I NR 

L 


MOV BM 


CALL 

4365Q 

LX I H 

23112Q 

005220Q 

MOV 

MA 


MOV LI 

11 OQ 

MOV CM 


INR L 


005225Q 

MOV 

BM 


CALL 

46640 

LX I H 

23110Q 

MOV CM 


005235Q 

INR 

L 


MOV BM 


CALL 

1405Q 

LX I H 

23155Q 

005245Q 

MOV 

MI 

377Q 

CALL 

1 4440 

LX I H 

2311OQ 

MOV MA 


005256Q 

I NX 

H 


MOV MB 


MOV LI 

1 130 

MOV MI 

OQ 

005264Q 

MOV 

A I 

14Q 

LX 1 H 

23113Q 

SUB M 


JC 

5326Q 

005275Q 

MOV 

CM 


MOV Bl 

OQ 

LX I H 

51 21 Q 

DAD B 


0053040 

MOV 

AM 


MOV EA 


LX I H 

2311OQ 

MOV CM 


005312Q 

I NR 

L 


MOV BM 


CALL 

2640Q 

LX I H 

23113Q 

005322Q 

I NR 

M 


JNZ 

5264Q 

MOV LI 

1 1 OQ 

MOV CM 


005331Q 

I NR 

L 


MOV BM 


CALL 

5027Q 

RET 


005337Q 

LX I 

H 

24162Q 

MOV CM 


MOV Bl 

OQ 

LX I H 

23164Q 

005350Q 

DAD 

B 


DAD B 


MOV AM 


I NX H 


005354Q 

MOV 

BM 


LX I H 

244540 

MOV MA 


I NX H 


005362Q 

MOV 

MB 


DCR H 


MOV LI 

1 62Q 

INR M 


005367Q 

I NR 

H 


MOV LI 

54Q 

MOV AM 


INR L 


005374Q 

MOV 

BM 


RET 


LX 1 H 

24162Q 

INR M 


005402Q 

MOV 

CM 


MOV BI 

OQ 

LX I H 

23164Q 

DAD B 


00541 IQ 

DAD 

B 


MOV AM 


I NX H 


MOV BM 


005415Q 

RET 



CALL 

5337Q 

DCR H 


MOV LI 

21 OQ 

005424Q 

MOV 

MA 


1 NX H 


MOV MB 


RRC 


005430Q 

JNC 


54450 

CALL 

476Q 

LX 1 H 

24163Q 

MOV CM 


005442Q 

DCR 

L 


MOV MC 


RET 


DCR L 


005446Q 

MOV 

CM 


INR L 


MOV BM 


CALL 

3334Q 

005454Q 

MOV 

Cl 

1340 

CALL 

5260 

JMP 

54160 

RET 


005465Q 

LX I 

H 

24203Q 

MOV AM 


ADD A 


ORA 1 

IQ 

005474Q 

MOV 

MA 


LX 1 H 

22744Q 

MOV MI 

3770 

RET 


005503Q 

LX I 

H 

24203Q 

MOV AM 


ORA A 


RAR 


00551 IQ 

MOV 

MA 


RET 


LX I B 

440Q 

CALL 

4365Q 

005521Q 

CMA 



RRC 


JNC 

5534Q 

LX I B 

440Q 

005531Q 

CALL 

46640 

LX I H 

23155Q 

MOV MI 

377Q 

CALL 

1444Q 

005544Q 

LX I 

H 

242100 

MOV MA 


I NX H 


MOV MB 


005552Q 

LX I 

H 

22740Q 

MOV MA 


INR L 


MOV MB 


005560Q 

CALL 

61 7Q 

LX I H 

244560 

MOV MA 


MOV EA 


005570Q 

LX I 

H 

22740Q 

MOV CM 


INR L 


MOV BM 


005576Q 

CALL 

2640Q 

LX I H 

242100 

MOV CM 


INR L 


005606Q 

MOV 

BM 


CALL 

5027Q 

LX 1 H 

24456Q 

MOV AM 


005616Q 

SUB 

I 

33Q 

RNZ 


JMP 

56360 



0056240 

0400 124Q 040Q 

116Q 040Q 

11 IQ 072Q 040Q 

0400 044Q 



005636Q 

LX I 

B 

56240 

CALL 

6430 

CALL 

61 7Q 

LX I H 

244560 

005652Q 

MOV 

MA 


SUB 1 

164Q 

JNZ 

5666Q 

CALL 

54650 

005663Q 

JMP 


57160 

MOV AM 


SUB I 

156Q 

JNZ 

5702Q 

0056740 

CALL 

5503Q 

JMP 

571 6Q 

MOV AM 


SUB I 

1 51 Q 

005705Q 

JNZ 


57160 

LX I SP 

22712Q 

JMP 

403Q 

CALL 

476Q 

005721Q 

RET 



JMP 

57330 





005725Q 

100Q 173Q 100Q 

1 51Q 155Q 

1 75Q 





005733Q 

LX I 

H 

24170Q 

MOV CM 


INR L 


MOV BM 


005741Q 

CALL 

2052Q 

CALL 

1 444Q 

LX I H 

24170Q 

MOV MA 


005753Q 

I NX 

H 


MOV MB 


MOV LI 

221 Q 

MOV AM 


005760Q 

RRC 



JNC 

6043Q 

LX I H 

23155Q 

MOV MI 

377Q 

005771 Q 

LX I 

H 

24457Q 

MOV MI 

OQ 

MOV AI 

5Q 

LX 1 H 

24457Q 

006003Q 

SUB 

M 


JC 

6064Q 

MOV CM 


MOV Bl 

OQ 

006012Q 

LX I 

H 

5725Q 

DAD B 


MOV AM 


MOV EA 


006020Q 

LX I 

H 

24170Q 

MOV CM 


INR L 


MOV BM 


006026Q 

CALL 

2640Q 

LX I H 

244570 

INR M 


JNZ 

5776Q 

006040Q 

JMP 


6064Q 

MOV LI 

21 00 

MOV CM 


INR L 


006047Q 

MOV 

BM 


MOV LI 

1700 

MOV EM 


INR L 



Number 24 

182 


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


Page 35 



006054Q 

MOV DM 


CALL 

2767Q 

MOV LI 

221 Q 

MOV MI 

377Q 

006064Q 

LX I B 

2Q 

LHLD 

24170Q 

DAD B 


SHLD 

24172Q 

006076Q 

LX I H 

24162Q 

MOV Ml 

OQ 

CALL 

5376Q 

LX I H 

24206Q 

00611 IQ 

MOV MA 


I NX H 


MOV MB 


CMA 


006115Q 

RRC 


JNC 

6133Q 

DCR L 


MOV CM 


006123Q 

I NR L 


MOV BM 


CALL 

2052Q 

JMP 

61 03Q 

006133Q 

MOV LI 

1 62Q 

MOV MI 

OQ 

RET 


LX I H 

24170Q 

006143Q 

MOV CM 


INR L 


MOV BM 


LX I H 

2311OQ 

006151Q 

MOV MC 


I NX H 


MOV MB 


LHLD 

24170Q 

006157Q 

MOV AM 


1 NX H 


MOV BM 


LX I H 

24170Q 

006165Q 

MOV MA 


I NX H 


MOV MB 


LX I H 

2311OQ 

006173Q 

MOV CM 


INR L 


MOV BM 


CALL 

1 405Q 

006201Q 

LX 1 B 

2Q 

LHLD 

24170Q 

DAD B 


SHLD 

24172Q 

006213Q 

RET 


LX I H 

24460Q 

MOV MC 


JMP 

6271 Q 

006223Q 

LX I H 

24172Q 

MOV AM 


ANA I 

1 7Q 

SUB I 

OQ 

006233Q 

JNZ 

6264Q 

CALL 

6140Q 

LX 1 H 

24170Q 

MOV CM 


006245Q 

INR L 


MOV BM 


MOV CB 


MOV AC 


006251Q 

SUB I 

OQ 

JNZ 

6264Q 

LX I SP 

22712Q 

JMP 

403Q 

006264Q 

LHLD 

24172Q 

MOV AM 


RET 


CALL 

6223Q 

006274Q 

LX I H 

24461Q 

MOV MA 


RLC 


RRC 


006302Q 

JNC 

631 7Q 

LHLD 

24172Q 

I NX H 


SHLD 

24172Q 

006314Q 

JMP 

6271 Q 

DCR L 


MOV AM 


RRC 


006322Q 

JNC 

6336Q 

LHLD 

24172Q 

MOV MI 

200Q 

I NX H 


006333Q 

SHLD 

24172Q 

LX I H 

24461 Q 

MOV AM 


RET 


006343Q 

LX 1 H 

24464Q 

MOV MC 


DCR H 


MOV LI 

1 62Q 

006352Q 

INR M 


MOV CM 


MOV B1 

OQ 

LX I H 

23164Q 

006361Q 

DAD B 


DAD B 


XCHQ 


LX I H 

22736Q 

006367Q 

MOV ME 


INR L 


MOV MD 


CALL 

1444Q 

006375Q 

LX I H 

24464Q 

ORA M 


MOV CA 


MOV AB 


006403Q 

ORA I 

OQ 

LHLD 

22736Q 

MOV MC 


1 NX H 


006412Q 

MOV MA 


LX I H 

24164Q 

MOV MC 


I NX H 


006420Q 

MOV MA 


DCR L 


MOV AM 


I NR L 


006424Q 

MOV BM 


ANA I 

360Q 

MOV CA 


MOV AB 


006431Q 

ANA I 

377Q 

MOV BA 


LX I D 

2Q 

MOV LC 


006440Q 

MOV HB 


DAD D 


SHLD 

24164Q 

LX I H 

24166Q 

006450Q 

MOV MI 

OQ 

MOV A1 

376Q 

SUB I 

4Q 

MOV LI 

1 62Q 

006460Q 

SUB M 


JNZ 

6526Q 

JMP 

651 3Q 



006467Q 

1 1 6Q 

123Q 040Q 

123Q 124Q 101Q 

1 03Q 113Q 

040Q 117Q 

126Q 105Q 122Q 

006505Q 

1 1 4Q 

1 17Q 127Q 

040Q 040Q 044Q 





006513Q 

MOV Cl 

1 IQ 

LX I D 

6467Q 

CALL 

446Q 

JMP 

5Q 

006526Q 

RET 


LX I H 

24465Q 

MOV MC 


DCR H 


006534Q 

MOV LI 

1 66Q 

MOV AM 


RRC 


JNC 

6612Q 

006543Q 

MOV LI 

1 62Q 

MOV CM 


MOV BI 

OQ 

LX I H 

23164Q 

006553Q 

DAD B 


DAD B 


MOV AM 


I NX H 


006557Q 

MOV BM 


ANA I 

360Q 

MOV CA 


MOV AB 


006564Q 

ANA I 

377Q 

MOV EC 


MOV DA 


LX I H 

24465Q 

006573Q 

MOV CM 


CALL 

2167Q 

MOV LI 

1 64Q 

MOV MA 


006602Q 

I NX H 


MOV MB 


INR L 


MOV MI 

OQ 

006607Q 

JMP 

6712Q 

INR H 


MOV LI 

65Q 

MOV CM 


006616Q 

LHLD 

24164Q 

MOV MC 


I NX H 


SHLD 

24164Q 

006626Q 

XCHG 


MOV AE 


ANA I 

17Q 

SUB 1 

OQ 

006634Q 

JNZ 

6712Q 

LX I H 

24164Q 

MOV AM 


INR L 


006644Q 

MOV BM 


SUB I 

20Q 

MOV CA 


MOV AB 


006651Q 

SBC 1 

OQ 

INR H 


MOV LI 

66Q 

MOV MC 


006657Q 

I NX H 


MOV MA 


CALL 

1 444Q 

LHLD 

24466Q 

006667Q 

MOV MA 


I NX H 


MOV MB 


LX I H 

24164Q 

006675Q 

MOV MA 


I NX H 


MOV MB 


LX I B 

2Q 

006703Q 

LHLD 

24164Q 

DAD B 


SHLD 

24164Q 

RET 


006713Q 

LX I H 

24471Q 

MOV Ml 

OQ 

INR L 


MOV MI 

377Q 

006723Q 

MOV Cl 

377Q 

CALL 

621 4Q 

LX I H 

24473Q 

MOV MA 


006734Q 

SUB I 

1 73Q 

JNZ 

6760Q 

DCR L 


MOV AM 


006743Q 

RRC 


JNC 

6751 Q 

DCR L 


INR M 


006751Q 

MOV LI 

72Q 

MOV MI 

377Q 

JMP 

701 IQ 

MOV AM 


006761Q 

SUB I 

1 75Q 

JNZ 

701 IQ 

DCR L 


MOV AM 


006770Q 

RRC 


JNC 

7001 Q 

MOV MI 

OQ 

JMP 

7003Q 

007001 Q 

DCR L 


DCR M 


MOV LI 

71 Q 

MOV AM 


007006Q 

SUB I 

OQ 

RZ 


MOV LI 

73Q 

MOV CM 


007014Q 

CALL 

6527Q 

JMP 

6723Q 

RET 


MOV Cl 

OQ 

007025Q 

CALL 

621 4Q 

LX I H 

24477Q 

MOV MA 


SUB I 

1 OOQ 

007036Q 

JNZ 

71 26Q 

MOV Cl 

377Q 

CALL 

621 4Q 

LX I H 

23112Q 

007051Q 

MOV MA 


MOV Cl 

OQ 

CALL 

621 4Q 

LX I H 

24477Q 

007062Q 

MOV MA 


SUB I 

1 73Q 

JNZ 

71 1 IQ 

MOV Cl 

377Q 

007072Q 

CALL 

621 4Q 

LX I H 

23112Q 

MOV MA 


MOV Cl 

2Q 

007103Q 

CALL 

6343Q 

JMP 

7165Q 

MOV Cl 

1 OOQ 

CALL 

6527Q 

007116Q 

MOV Cl 

1 OOQ 

CALL 

6527Q 

JMP 

71 65Q 

MOV AM 


007127Q 

SUB I 

1 73Q 

JNZ 

7160Q 

MOV Cl 

377Q 

CALL 

621 4Q 

007141Q 

LX I H 

23112Q 

MOV MA 


MOV AI 

2Q 

ORA I 

4Q 

007151Q 

MOV CA 


CALL 

6343Q 

JMP 

71 65Q 

MOV Cl 

1 OOQ 

007162Q 

CALL 

6527Q 

RET 


LX I H 

24500Q 

MOV MC 


007172Q 

1 NX H 


MOV MB 


MOV LI 

1 1 3Q 

MOV MI 

OQ 

007200Q 

MOV Cl 

OQ 

DCR C 


MOV LI 

1 1 IQ 

MOV MC 


007206Q 

MOV LI 

1 OOQ 

MOV CM 


INR L 


MOV BM 


007213Q 

MOV CB 


MOV AC 


RLC 


RRC 


007217Q 

JNC 

7246Q 

MOV LI 

113Q 

MOV MI 

377Q 

XRA A 


007227Q 

MOV LI 

1 OOQ 

SUB M 


INR L 


MOV CA 


007234Q 

MOV A1 

OQ 

SBC M 


DCR L 


MOV MC 


007241 Q 

I NX H 


MOV MA 


JMP 

7274Q 

DCR L 


007247Q 

MOV AM 


INR L 


MOV BM 


SUB I 

OQ 

007254Q 

MOV CA 


MOV AB 


SBC I 

OQ 

ORA C 


007261Q 

JNZ 

7274Q 

MOV LI 

11 IQ 

MOV MI 

OQ 

MOV LI 

1 03Q 

007272Q 

MOV Ml 

60Q 

XRA A 


LX I H 

24500Q 

SUB M 


007301Q 

INR L 


MOV CA 


MOV AI 

OQ 

SBC M 


007306Q 

JNC 

7466Q 

MOV LI 

11 IQ 

INR M 


MOV CM 


007315Q 

MOV B1 

OQ 

MOV LI 

103Q 

DAD B 


XCHG 



Page 36 


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


Number 24 

183 



007323Q 

LX I 

H 

227340 

MOV 

ME 


INR 

L 


MOV 

MD 


007331Q 

MOV 

El 

120 

MOV 

D1 

00 

LX I 

H 

24500Q 

MOV 

CM 


007341Q 

I NR 

L 


MOV 

BM 


JMP 


7423Q 

MOV 

AD 


007347Q 

CMA 



MOV 

DA 


MOV 

AE 


CMA 



0073530 

MOV 

EA 


I NX 

D 


LX I 

H 

00 

MOV 

A 1 

21 Q 

007362Q 

PUSH H 


DAD 

D 


JNC 


73700 

XTHL 


007370Q 

POP 

H 


PUSH A 


MOV 

AC 


RAL 



007374Q 

MOV 

CA 


MOV 

AB 


RAL 



MOV 

BA 


007400Q 

MOV 

AL 


RAL 



MOV 

LA 


MOV 

AH 


007404Q 

RAL 



MOV 

HA 


POP 

A 


DCR 

A 


007410Q 

JNZ 


7362Q 

ORA 

A 


MOV 

AH 


RAR 



007416Q 

MOV 

DA 


MOV 

AL 


RAR 



MOV 

EA 


007422Q 

RET 



CALL 

7346Q 

LX I 

B 

60Q 

XCHG 


007432Q 

DAD 

B 


XCHG 


LHLD 

22734Q 

MOV 

ME 


007440Q 

MOV 

El 

12Q 

MOV 

D1 

00 

LX I 

H 

24500Q 

MOV 

CM 


007450Q 

I NR 

L 


MOV 

BM 


CALL 

7346Q 

LX I 

H 

245000 

007460Q 

MOV 

MC 


1 NX 

H 


MOV 

MB 


JMP 


7274Q 

007466Q 

MOV 

LI 

1 1 30 

MOV 

AM 


RRC 



JNC 


751 OQ 

0074750 

MOV 

LI 

1 1 IQ 

INR 

M 


MOV 

CM 


MOV 

B I 

OQ 

007503Q 

MOV 

LI 

1030 

DAD 

B 


MOV 

MI 

55Q 

CALL 

1 444Q 

007513Q 

LX I 

H 

24210Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


0075210 

LX I 

H 

23155Q 

MOV 

MI 

3770 

LX 1 

H 

245120 

MOV 

MI 

OQ 

007533Q 

LX 1 

H 

2451 IQ 

MOV 

AM 


INR 

L 


SUB 

M 


007541 Q 

JC 


7600Q 

DCR 

L 


MOV 

AM 


1 NR 

L 


007547Q 

SUB 

M 


MOV 

CA 


MOV 

BI 

OQ 

MOV 

LI 

1 03Q 

007555Q 

DAD 

B 


MOV 

AM 


MOV 

EA 


LX I 

H 

2421OQ 

007563Q 

MOV 

CM 


INR 

L 


MOV 

BM 


CALL 

2640Q 

007571Q 

LX I 

H 

24512Q 

INR 

M 


JNZ 


7533Q 

RET 



007601Q 

LX I 

H 

24514Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


007607Q 

I NR 

L 


MOV 

Ml 

OQ 

I NX 

H 


MOV 

Ml 

OQ 

007615Q 

MOV 

LI 

1 22Q 

MOV 

Ml 

OQ 

LX I 

H 

23153Q 

MOV 

Ml 

377Q 

007626Q 

LX I 

H 

24514Q 

MOV 

AM 


INR 

L 


MOV 

BM 


007634Q 

ANA 

I 

360Q 

MOV 

CA 


MOV 

AB 


ANA 

1 

377Q 

007642Q 

MOV 

BA 


CALL 

2366Q 

LX I 

H 

24521 Q 

MOV 

MA 


0076520 

SUB 

I 

201 Q 

JZ 


77550 

MOV 

AM 


SUB 

1 

55Q 

007662Q 

JNZ 


7673Q 

I NR 

L 


MOV 

MI 

377Q 

JMP 


7626Q 

0076730 

MOV 

AM 


SUB 

I 

60Q 

MOV 

MA 


SUB 

1 

1 2Q 

007701Q 

JNC 


77520 

MOV 

Cl 

3Q 

MOV 

LI 

1160 

MOV 

EM 


0077110 

I NR 

L 


MOV 

DM 


MOV 

AE 


ADD 

A 


0077150 

MOV 

EA 


MOV 

AD 


RAL 



MOV 

DA 


007721Q 

DCR 

C 


JNZ 


771 30 

LHLD 

245160 

DAD 

D 


007731Q 

XCH0 


LHLD 

24516Q 

DAD 

D 


XCHG 


007737Q 

LX I 

H 

24521Q 

MOV 

CM 


MOV 

B I 

OQ 

XCHG 


007746Q 

DAD 

B 


SHLD 

24516Q 

JMP 


7626Q 

I NR 

L 


007756Q 

MOV 

AM 


RRC 



JNC 


7777Q 

XRA 

A 


0077640 

MOV 

LI 

1 16Q 

SUB 

M 


I NR 

L 


MOV 

CA 


0077710 

MOV 

AI 

OQ 

SBC 

M 


MOV 

BA 


MOV 

AC 


007776Q 

RET 



MOV 

LI 

1160 

MOV 

AM 


I NR 

L 


010003Q 

MOV 

BM 


RET 



LX I 

H 

24523Q 

MOV 

MC 


01001 IQ 

MOV 

A 1 

71 Q 

SUB 

M 


JC 


10023Q 

MOV 

AM 


010020Q 

SUB 

I 

60Q 

RET 



MOV 

AM 


SUB 

I 

1 07Q 

010026Q 

JNC 


10035Q 

MOV 

AM 


SUB 

1 

67Q 

RET 



010035Q 

MOV 

AM 


SUB 

I 

127Q 

RET 



LX I 

H 

24524Q 

010044Q 

MOV 

MC 


MOV 

AM 


SUB 

1 

1 2Q 

JNC 


10057Q 

010053Q 

MOV 

AM 


ADD 

1 

60Q 

RET 



MOV 

AM 


010060Q 

ADD 

1 

1 27Q 

RET 



LX I 

H 

24525Q 

MOV 

MI 

IQ 

010070Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX 

H 


010100Q 

MOV 

MB 


CMA 



RRC 



JNC 


10115Q 

010106Q 

I NR 

H 


MOV 

LI 

1250 

INR 

M 


JMP 


10070Q 

010115Q 

MOV 

LI 

1 63Q 

MOV 

CM 


DCR 

L 


MOV 

MC 


010122Q 

1 NR 

H 


MOV 

LI 

125Q 

MOV 

AM 


RET 



010127Q 

JMP 


10332Q 

LX I 

H 

23154Q 

MOV 

MI 

377Q 

LX I 

H 

24206Q 

010142Q 

MOV 

CM 


INR 

L 


MOV 

BM 


CALL 

2524Q 

010150Q 

LX I 

H 

24527Q 

MOV 

MA 


RLC 



RRC 



010156Q 

JNC 


10172Q 

MOV 

AM 


SUB 

I 

201 Q 

JNZ 


10137Q 

0101670 

MOV 

A 1 

377Q 

RET 



MOV 

Cl 

OQ 

MOV 

B I 

OQ 

010176Q 

CALL 

23660 

LX I 

H 

24526Q 

MOV 

MA 


RLC 



010206Q 

RRC 



JNC 


10222Q 

MOV 

AM 


SUB 

I 

200Q 

010215Q 

JZ 


10172Q 

XRA 

A 


RET 



MOV 

AM 


010223Q 

I NR 

L 


SUB 

M 


JZ 


10137Q 

XRA 

A 


0102310 

RET 



RET 



LX I 

H 

24530Q 

MOV 

CM 


010237Q 

I NR 

L 


MOV 

BM 


LX I 

H 

23156Q 

MOV 

MC 


010245Q 

1 NX 

H 


MOV 

MB 


MOV 

Cl 

OQ 

MOV 

BI 

OQ 

010253Q 

CALL 

2366Q 

LX I 

H 

231120 

MOV 

MA 


LX 1 

H 

23156Q 

0102650 

MOV 

CM 


I NR 

L 


MOV 

BM 


LX I 

H 

24530Q 

010273Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


MOV 

Cl 

OQ 

010300Q 

MOV 

B1 

00 

CALL 

2366Q 

LX 1 

H 

24526Q 

MOV 

MA 


01031 IQ 

RLC 



RRC 



JNC 


10326Q 

MOV 

AM 


010317Q 

SUB 

I 

201 Q 

JNZ 


1 0262Q 

XRA 

A 


RET 



010326Q 

MOV 

AI 

377Q 

RET 



RET 



LX I 

H 

24174Q 

010335Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


1 NR 

H 


010341Q 

MOV 

LI 

1 30Q 

MOV 

MC 


I NX 

H 


MOV 

MB 


010346Q 

DCR 

H 


MOV 

LI 

206Q 

MOV 

CM 


INR 

L 


010353Q 

MOV 

BM 


CALL 

3236Q 

RRC 



JNC 


1 0365Q 

010363Q 

XRA 

A 


RET 



LX I 

H 

24530Q 

MOV 

CM 


010371Q 

I NR 

L 


MOV 

BM 


LX I 

H 

23156Q 

MOV 

MC 


010377Q 

I NX 

H 


MOV 

MB 


CALL 

10132Q 

RRC 



010405Q 

JNC 


10443Q 

LX I 

H 

24530Q 

MOV 

CM 


I NR 

L 


010415Q 

MOV 

BM 


DCR 

H 


MOV 

LI 

1 76Q 

MOV 

MC 


010422Q 

I NX 

H 


MOV 

MB 


LX I 

H 

23156Q 

MOV 

CM 


010430Q 

I NR 

L 


MOV 

BM 


LX I 

H 

24200Q 

MOV 

MC 


010436Q 

I NX 

H 


MOV 

MB 


MOV 

AI 

377Q 

RET 



010443Q 

LX I 

H 

24526Q 

MOV 

AM 


SUB 

I 

201 Q 

JNZ 


10456Q 

010454Q 

XRA 

A 


RET 



CALL 

1 02330 

CMA 




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

184 


Page 37 



010462Q 

RRC 


JNC 


10365Q 

XRA A 


RET 



010470Q 

RET 


CALL 

5376Q 

LX I H 

24206Q 

MOV 

MA 


010500Q 

I NX H 


MOV 

MB 


CMA 


RRC 



010504Q 

JNC 

10622Q 

DCR 

L 


MOV CM 


I NR 

L 


01 0512Q 

MOV BM 


CALL 

4365Q 

CMA 


RRC 



010520Q 

JNC 

10534Q 

LX I 

H 

24206Q 

MOV CM 


INR 

L 


010530Q 

MOV BM 


CALL 

4664Q 

CALL 

5376Q 

LX I 

H 

24206Q 

010542Q 

MOV MA 


I NX 

H 


MOV MB 


RRC 



010546Q 

JNC 

10561Q 

CALL 

1444Q 

MOV CA 


CALL 

5027Q 

010560Q 

RET 


DCR 

L 


MOV CM 


I NR 

L 


010564Q 

MOV BM 


CALL 

5027Q 

LX I H 

24162Q 

MOV 

CM 


010574Q 

MOV BI 

OQ 

LX I 

H 

23164Q 

DAD B 


DAD 

B 


010603Q 

XCHG 


LX I 

H 

24216Q 

MOV CM 


I NR 

L 


01061 IQ 

MOV BM 


MOV 

AC 


STAX D 


I NX 

D 


010615Q 

MOV AB 


STAX D 


JMP 

10471Q 

RET 



010623Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


I NX 

H 


010633Q 

MOV MB 


CMA 



RRC 


JNC 


11Q50Q 

010641Q 

DCR L 


MOV 

CM 


INR L 


MOV 

BM 


010645Q 

CALL 

4365Q 

CMA 



RRC 


JNC 


10675Q 

010655Q 

LX I H 

24206Q 

MOV 

CM 


INR L 


MOV 

BM 


010663Q 

CALL 

4664Q 

CALL 

1 444Q 

MOV CA 


CALL 

5027Q 

010675Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


I NX 

H 


010705Q 

MOV MB 


RRC 



RC 


LX I 

H 

23153Q 

010713Q 

MOV MI 

377Q 

LX I 

H 

24206Q 

MOV CM 


I NR 

L 


010722Q 

MOV BM 


CALL 

2366Q 

LX I H 

24532Q 

MOV 

MA 


010732Q 

SUB I 

201 Q 

JZ 


10623Q 

LX I B 

4Q 

LHLD 

24440Q 

010745Q 

DAD B 


MOV 

AM 


I NX H 


MOV 

BM 


010751Q 

MOV EA 


MOV 

DB 


LX I H 

24532Q 

MOV 

CM 


010757Q 

CALL 

21 67Q 

LX I 

H 

23160Q 

MOV MA 


I NX 

H 


010767Q 

MOV MB 


DCR 

L 


MOV AM 


I NR 

L 


010773Q 

MOV BM 


ANA 

I 

360Q 

MOV CA 


MOV 

AB 


011000Q 

ANA I 

377Q 

1 NR 

L 


MOV MC 


I NX 

H 


011005Q 

MOV MA 


MOV 

LI 

155Q 

MOV MI 

OQ 

MOV 

Cl 

OQ 

01 1 014Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

24532Q 

MOV 

MA 


011025Q 

SUB I 

201 Q 

JZ 


11045Q 

MOV Cl 

OQ 

MOV 

B I 

OQ 

011036Q 

MOV EM 


CALL 

2640Q 

JMP 

11012Q 

JMP 


10623Q 

01 1050Q 

RET 


JMP 


11144Q 

LX I H 

24535Q 

MOV 

MC 


011060Q 

LHLD 

23160Q 

MOV 

MC 


I NX H 


SHLD 

23160Q 

011070Q 

XCHG 


MOV 

AE 


ANA I 

1 7Q 

SUB 

I 

OQ 

01 1076Q 

JNZ 

11143Q 

LX I 

H 

23160Q 

MOV AM 


INR 

L 


011106Q 

MOV BM 


SUB 

I 

20Q 

MOV CA 


MOV 

AB 


01 1113Q 

SBC I 

OQ 

LX I 

H 

24536Q 

MOV MC 


I NX 

H 


011122Q 

MOV MA 


LHLD 

24536Q 

MOV AM 


I NX 

H 


011130Q 

MOV BM 


MOV 

CA 


LX I D 

2Q 

MOV 

LC 


011136Q 

MOV HB 


DAD 

D 


SHLD 

23160Q 

RET 



011144Q 

CALL 

5376Q 

MOV 

CA 


CALL 

4365Q 

CMA 



011154Q 

RRC 


RC 



MOV Cl 

OQ 

DCR 

C 


011161Q 

LX I H 

24533Q 

MOV 

MC 


CALL 

5376Q 

LX I 

H 

24206Q 

011173Q 

MOV MA 


I NX 

H 


MOV MB 


CMA 



011177Q 

RRC 


JNC 


11417Q 

INR H 


MOV 

LI 

1 33Q 

011206Q 

I NR M 


LX 1 

B 

4Q 

LHLD 

24440Q 

DAD 

B 


011216Q 

MOV AM 


I NX 

H 


MOV BM 


MOV 

CA 


011222Q 

MOV LC 


MOV 

HB 


I NX H 


SHLD 

24174Q 

011230Q 

CALL 

10127Q 

RRC 



JNC 

11165Q 

LX I 

H 

24176Q 

011242Q 

MOV CM 


INR 

L 


MOV BM 


LX I 

H 

23156Q 

011250Q 

MOV MC 


I NX 

H 


MOV MB 


MOV 

Cl 

OQ 

011255Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

23112Q 

MOV 

MA 


011266Q 

MOV LI 

156Q 

MOV 

CM 


INR L 


MOV 

BM 


011273Q 

I NR L 


MOV 

MC 


I NX H 


MOV 

MB 


011277Q 

DCR L 


MOV 

AM 


INR L 


MOV 

BM 


011303Q 

LX 1 H 

24200Q 

SUB 

M 


INR L 


MOV 

CA 


01131 IQ 

MOV AB 


SBC 

M 


ORA C 


ADD 

I 

377Q 

011316Q 

SBC A 


INR 

H 


MOV LI 

1 34Q 

MOV 

MA 


011323Q 

DCR L 


MOV 

AM 


ORA I 

300Q 

MOV 

CA 


011330Q 

CALL 

11034Q 

LX I 

H 

24534Q 

MOV AM 


RRC 



011340Q 

JNC 

1 1401Q 

LX I 

H 

23160Q 

MOV AM 


I NR 

L 


011350Q 

MOV BM 


LX I 

H 

24200Q 

SUB M 


I NR 

L 


011356Q 

MOV CA 


MOV 

AB 


SBC M 


ORA 

C 


011362Q 

ADD I 

377Q 

SBC 

A 


INR H 


MOV 

LI 

1 34Q 

011370Q 

MOV MA 


MOV 

Cl 

200Q 

CALL 

1 1054Q 

JMP 


11333Q 

011401Q 

DCR H 


MOV 

LI 

200Q 

MOV CM 


1 NR 

L 


011406Q 

MOV BM 


MOV 

LI 

1740 

MOV MC 


I NX 

H 


011413Q 

MOV MB 


JMP 


1 1230Q 

RET 


JMP 


1 1 631Q 

011423Q 

LX I H 

24544Q 

MOV 

AM 


INR L 


MOV 

BM 


011431Q 

SUB I 

OQ 

MOV 

CA 


MOV AB 


SBC 

I 

OQ 

011437Q 

ORA C 


JNZ 


1 1445Q 

XRA A 


RET 



011445Q 

MOV Cl 

OQ 

MOV 

BI 

OQ 

CALL 

2366Q 

LX I 

H 

24556Q 

011457Q 

MOV MA 


SUB 

I 

201 Q 

JZ 

1 1470Q 

MOV 

AI 

377Q 

011467Q 

RET 


XRA 

A 


RET 


LX I 

H 

24560Q 

011475Q 

MOV MI 

OQ 

I NX 

H 


MOV MI 

OQ 

LX I 

H 

23153Q 

011505Q 

MOV MI 

377Q 

LX I 

B 

4Q 

LHLD 

24440Q 

DAD 

B 


011516Q 

MOV AM 


I NX 

H 


MOV BM 


LX I 

H 

2311OQ 

011524Q 

MOV MA 


I NX 

H 


MOV MB 


LX I 

H 

2311OQ 

011532Q 

MOV CM 


INR 

L 


MOV BM 


CALL 

2366Q 

011540Q 

LX I H 

24556Q 

MOV 

MA 


SUB I 

201 Q 

ADD 

1 

377Q 

011550Q 

SBC A 


MOV 

HI 

46Q 

MOV CA 


MOV 

AM 


011555Q 

INR L 


MOV 

DM 


LX I H 

24546Q 

SUB 

M 


011563Q 

INR L 


MOV 

EA 


MOV AD 


SBC 

M 


011567Q 

ORA E 


ADD 

I 

377Q 

SBC A 


ANA 

C 


011574Q 

RRC 


JNC 


1 1623Q 

MOV LI 

1 56Q 

MOV 

AM 


011603Q 

RLC 


CMA 



RRC 


JNC 


1 1 527Q 

01161 IQ 

LHLD 

24560Q 

I NX 

H 


SHLD 

24560Q 

JMP 


1 1 527Q 

011623Q 

MOV LI 

1 60Q 

MOV 

AM 


INR L 


MOV 

BM 


011630Q 

RET 


LX I 

B 

406Q 

CALL 

4365Q 

CMA 




Page 38 


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


Number 24 

185 



Number 24 

186 


011640Q 

RRC 


JNC 


11652Q 

LX I B 

406Q 

CALL 

4664Q 

011652Q 

CALL 

1444Q 

LX I 

H 

24340Q 

MOV MA 


I NX H 


011662Q 

MOV MB 


MOV 

CA 


CALL 

5027Q 

CALL 

3376Q 

011672Q 

LX 1 H 

24204Q 

MOV 

MA 


I NX H 


MOV MB 


011700Q 

CALL 

3376Q 

LX I 

H 

24542Q 

MOV MA 


I NX H 


011710Q 

MOV MB 


CALL 

5376Q 

LX I H 

24212Q 

MOV MA 


011720Q 

I NX H 


MOV 

MB 


CALL 

5376Q 

LX I H 

24214Q 

011730Q 

MOV MA 


I NX 

H 


MOV MB 


MOV LI 

204Q 

011733Q 

MOV CM 


INR 

L 


MOV BM 


CALL 

4365Q 

011743Q 

CMA 


RRC 



RC 


LX I H 

24542Q 

01 1751Q 

MOV AM 


RRC 



JNC 

11775Q 

MOV LI 

146Q 

01 1760Q 

MOV MI 

OQ 

I NX 

H 


MOV MI 

OQ 

CALL 

11472Q 

01 1770Q 

MOV CA 


CALL 

7166Q 

RET 


MOV CM 


011776Q 

INR L 


MOV 

BM 


CALL 

7601 Q 

LX I H 

24544Q 

012006Q 

MOV MA 


I NX 

H 


MOV MB 


MOV LI 

1 57Q 

012013Q 

MOV MI 

OQ 

LHLD 

24440Q 

I NX H 


1 NX H 


012022Q 

MOV AM 


I NX 

H 


MOV BM 


LX I H 

23156Q 

012030Q 

MOV MA 


I NX 

H 


MOV MB 


LX I H 

24550Q 

012036Q 

MOV MA 


I NX 

H 


MOV MB 


LX I H 

23155Q 

012044Q 

MOV MI 

377Q 

CALL 

11423Q 

RRC 


JNC 

12127Q 

012055Q 

MOV LI 

1 56Q 

MOV 

AM 


RLC 


CMA 


012062Q 

RRC 


JNC 


12046Q 

LHLD 

24544Q 

DCX H 


012072Q 

SHLD 

24544Q 

LX I 

H 

23156Q 

MOV CM 


INR L 


012102Q 

MOV BM 


LX I 

H 

24550Q 

MOV MC 


I NX H 


012110Q 

MOV MB 


MOV 

LI 

140Q 

MOV CM 


INR L 


012115Q 

MOV BM 


MOV 

LI 

156Q 

MOV EM 


CALL 

2640Q 

012124Q 

JMP 

12046Q 

LHLD 

24440Q 

I NX H 


I NX H 


012134Q 

XCHG 


LX I 

H 

24550Q 

MOV CM 


INR L 


012142Q 

MOV BM 


MOV 

AC 


STAX D 


I NX D 


012146Q 

MOV AB 


STAX 

; D 


DCR H 


MOV LI 

21 2Q 

012153Q 

MOV CM 


INR 

L 


MOV BM 


MOV LI 

21 OQ 

012160Q 

MOV MC 


I NX 

H 


MOV MB 


INR H 


012164Q 

MOV LI 

1 44Q 

MOV 

AM 


INR L 


MOV BM 


01 2171Q 

SUB I 

OQ 

MOV 

CA 


MOV AB 


SBC I 

OQ 

012177Q 

ORA C 


ADD 

I 

377Q 

SBC A 


MOV LI 

1 57Q 

012205Q 

ORA M 


RRC 



JNC 

12225Q 

DCR H 


012213Q 

MOV LI 

21 4Q 

MOV 

CM 


INR L 


MOV BM 


012220Q 

MOV LI 

21 OQ 

MOV 

MC 


I NX H 


MOV MB 


012225Q 

LX I H 

24212Q 

MOV 

AM 


RRC 


JNC 

1 2261Q 

012235Q 

CALL 

1 444Q 

LX I 

H 

2421OQ 

MOV MA 


I NX H 


012245Q 

MOV MB 


MOV 

EA 


MOV DB 


INR H 


012251Q 

MOV LI 

1 40Q 

MOV 

CM 


INR L 


MOV BM 


012256Q 

CALL 

2767Q 

RET 



CALL 

5376Q 

LX I H 

24204Q 

012270Q 

MOV MA 


I NX 

H 


MOV MB 


CALL 

5376Q 

012276Q 

LX I H 

24206Q 

MOV 

MA 


I NX H 


MOV MB 


012304Q 

CALL 

5376Q 

LX I 

H 

24212Q 

MOV MA 


I NX H 


012314Q 

MOV MB 


CALL 

5376Q 

LX I H 

24214Q 

MOV MA 


012324Q 

I NX H 


MOV 

MB 


MOV LI 

21 OQ 

MOV MA 


012331Q 

I NX H 


MOV 

MB 


LX I B 

420Q 

CALL 

4365Q 

012341Q 

CMA 


RRC 



JNC 

12354Q 

LX I B 

420Q 

012351Q 

CALL 

4664Q 

CALL 

1444Q 

LX I H 

24562Q 

MOV MA 


012363Q 

I NX H 


MOV 

MB 


MOV CA 


CALL 

5027Q 

012371Q 

LX I H 

24204Q 

MOV 

CM 


INR L 


MOV BM 


012377Q 

CALL 

4365Q 

CMA 



RRC 


RC 


012405Q 

LHLD 

24440Q 

I NX 

H 


I NX H 


MOV AM 


012413Q 

I NX H 


MOV 

BM 


LX I H 

24174Q 

MOV MA 


012421Q 

I NX H 


MOV 

MB 


LX I H 

23153Q 

MOV MI 

OQ 

012430Q 

MOV LI 

1 55Q 

MOV 

MI 

377Q 

CALL 

10127Q 

RRC 


012440Q 

JNC 

1 2555Q 

LX I 

H 

24174Q 

MOV CM 


INR L 


012450Q 

MOV BM 


LX I 

H 

23156Q 

MOV MC 


I NX H 


012456Q 

MOV MB 


LX I 

H 

23156Q 

MOV AM 


I NR L 


012464Q 

MOV BM 


LX I 

H 

24176Q 

SUB M 


INR L 


012472Q 

MOV CA 


MOV 

AB 


SBC M 


ORA C 


012476Q 

JZ 

1 2540Q 

MOV 

Cl 

OQ 

MOV BI 

OQ 

CALL 

2366Q 

01251OQ 

LX I H 

24565Q 

MOV 

MA 


RLC 


CMA 


012516Q 

RRC 


JNC 


12457Q 

MOV LI 

1 62Q 

MOV CM 


012525Q 

INR L 


MOV 

BM 


MOV LI 

1 65Q 

MOV EM 


012532Q 

CALL 

2640Q 

JMP 


1 2457Q 

MOV LI 

21 2Q 

MOV CM 


012543Q 

INR L 


MOV 

BM 


MOV LI 

21 OQ 

MOV MC 


012550Q 

I NX H 


MOV 

MB 


JMP 

12666Q 

LX I H 

24174Q 

012560Q 

MOV CM 


I NR 

L 


MOV BM 


LX I H 

23156Q 

012566Q 

MOV MC 


I NX 

H 


MOV MB 


LX I H 

24200Q 

012574Q 

MOV MC 


I NX 

H 


MOV MB 


LX I H 

23155Q 

012C02Q 

MOV MI 

377Q 

MOV 

Cl 

OQ 

MOV B I 

OQ 

CALL 

2366Q 

012613Q 

LX I H 

24565Q 

MOV 

MA 


SUB I 

201Q 

JZ 

12666Q 

012624Q 

MOV AM 


RLC 



CMA 


RRC 


012630Q 

JNC 

1 2604Q 

LX I 

H 

23156Q 

MOV CM 


INR L 


012640Q 

MOV BM 


LX I 

H 

24200Q 

MOV MC 


I NX H 


012646Q 

MOV MB 


INR 

H 


MOV LI 

1 62Q 

MOV CM 


012653Q 

INR L 


MOV 

BM 


MOV LI 

1 65Q 

MOV EM 


012660Q 

CALL 

2640Q 

JMP 


12604Q 

LHLD 

24440Q 

I NX H 


012672Q 

I NX H 


XCHG 


LX I H 

24200Q 

MOV CM 


0127000 

INR L 


MOV 

BM 


MOV AC 


STAX D 


012704Q 

I NX D 


MOV 

AB 


STAX D 


MOV LI 

21 2Q 

01271 IQ 

MOV AM 


RRC 



JNC 

12742Q 

CALL 

1 444Q 

012721Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 


MOV MB 


012727Q 

MOV EA 


MOV 

DB 


INR H 


MOV LI 

1 62Q 

012734Q 

MOV CM 


I NR 

L 


MOV BM 


CALL 

2767Q 

012742Q 

RET 


CALL 

5376Q 

MOV CA 


CALL 

4365Q 

012752Q 

CMA 


RRC 



RC 


LHLD 

24440Q 

012760Q 

I NX H 


I NX 

H 


PUSH H 


LX I B 

4Q 

012768Q 

LHLD 

244400 

DAD 

B 


MOV AM 


1 NX H 


0127740 

MOV SM 


MOV 

CA 


MOV LC 


MOV HB 


0130000 

1 NX H 


XCHG 


POP H 


MOV ME 



Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, 

Menlo Park, 

CA 94025 



Page 39 



Page 40 


013004Q 

I NX 

H 


MOV MD 


RET 



CALL 

5376Q 

G13012Q 

LX 1 

H 

24566Q 

MOV MA 


I NX 

H 


MOV 

MB 

013020Q 

CALL 

5376Q 

LX I H 

24570Q 

MOV 

MA 


I NX 

H 


01 303CIQ 

MOV 

MB 


RRC 


RC 



CALL 

5376Q 

013036Q 

LX I 

H 

24572Q 

MOV MA 


I NX 

H 


MOV 

MB 

013044Q 

RRC 



JNC 

130670 

MOV 

LI 

1 70Q 

MOV 

CM 


01 3053Q 

I NR 

L 


MOV BM 


DCR 

H 

MOV 

LI 

21 OQ 

0 13060Q 

MOV 

MC 


I NX H 


MOV 

MB 


RET 

01 3064Q 

JMP 


13020Q 

MOV LI 

166Q 

MOV 

CM 


I NR 

L 


0 ; 3073Q 

MOV 

BM 


I NR L 


MOV 

EM 


I NR 

L 


oi3077Q 

MOV 

DM 


CALL 

30620 

RRC 



JNC 


131240 

Ol3107Q 

LX I 

H 

24572Q 

MOV CM 


I NR 

L 


MOV 

BM 

013115Q 

DCR 

H 


MOV LI 

2100 

MOV 

MC 


I NX 

H 


013122Q 

MOV 

MB 


RET 


JMP 


13020Q 

RET 



013130Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV 

CA 


013140Q 

LX I 

H 

1000000 

DAD B 


XCHG 


LX I 

H 

22732Q 

013150Q 

MOV 

ME 


I NR L 


MOV 

MD 


CALI 

5376Q 

013156Q 

MOV 

CA 


CALL 

76010 

MOV 

CA 


LX I 

'h 

100000Q 

0131660 

DAD 

B 


XCHG 


LX I 

H 

22732Q 

MOV 

AM 

013174Q 

I NR 

L 


MOV BM 


SUB 

E 


MOV 

CA 


013200Q 

MOV 

AB 


SBC D 


JC 


13217Q 

CALL 

5376Q 

01321OQ 

LX 1 

H 

2421OQ 

MOV MA 


I NX 

H 


MOV 

MB 

013216Q 

RET 



CALL 

5376Q 

LX I 

H 

242100 

MOV 

MA 


0132260 

1 NX 

H 


MOV MB 


CALL 

5376Q 

LX I 

H 

2421OQ 

013236Q 

MOV 

MA 


I NX H 


MOV 

MB 


RET 

0132420 

CALL 

53760 

ANA I 

360Q 

MOV 

CA 


MOV 

AB 


0132510 

ANA 

I 

377Q 

LX I H 

24204Q 

MOV 

MC 


I NX 

H 


013260Q 

MOV 

MA 


CALL 

5376Q 

LX I 

H 

24212Q 

MOV 

MA 


0132700 

I NX 

H 


MOV MB 


MOV 

LI 

2.1 OQ 

MOV 

MA 


013275Q 

I NX 

H 


MOV MB 


CALL 

53760 

LX I 

H 

242140 

0133050 

MOV 

MA 


I NX H 


MOV 

MB 


MOV 

LI 

2040 

013312Q 

MOV 

CM 


I NR L 


MOV 

BM 


CALL 

4365Q 

013320Q 

RRC 



JNC 

13362Q 

LX I 

B 

4Q 

LHLD 

24440Q 

013332Q 

DAD 

B 


MOV AM 


1 NX 

H 


MOV 

BM 


0133360 

MOV 

CA 


CALL 

32360 

CMA 



RRC 


013344Q 

JNC 


13362Q 

LX I H 

242140 

MOV 

CM 


I NR 

L 


013354Q 

MOV 

BM 


MOV LI 

21 OQ 

MOV 

MC 


I NX 

H 


013361Q 

MOV 

MB 


RET 


LX I 

H 

245740 

MOV 

MC 


013367Q 

CALL 

10063Q 

MOV LI 

1 74Q 

SUB 

M 


SUB 

I 

2Q 

013377Q 

1 NR 

L 


MOV MA 


DCR 

L 


MOV 

AM 

013403Q 

DCR 

H 


MOV LI 

162Q 

ADD 

M 


MOV 

MA 


01341OQ 

CALL 

5376Q 

ANA I 

3600 

MOV 

CA 


MOV 

AB 


013417Q 

ANA 

I 

3770 

MOV BA 


CALL 

4365Q 

CMA 



0134260 

RRC 



RC 


CALL 

14440 

LX I 

H 

24210Q 

013436Q 

MOV 

MA 


I NX H 


MOV 

MB 


LXl 

H 

23153Q 

0134440 

MOV 

MI 

377Q 

MOV LI 

155Q 

MOV 

MI 

3770 

LX I 

B 

4Q 

013455Q 

LHLD 

24440Q 

DAD B 


MOV 

AM 


I NX 

H 

013463Q 

MOV 

BM 


LX I H 

2311OQ 

MOV 

MA 


I NX 

H 


013471Q 

MOV 

MB 


LX I H 

231100 

MOV 

CM 


I NR 

L 


0134770 

MOV 

BM 


CALL 

2366Q 

LX I 

H 

245760 

MOV 

MA 


013507Q 

SUB 

I 

201Q 

JZ 

1370 IQ 

MOV 

AM 


RLC 


013516Q 

CMA 



RRC 


JNC 


13543Q 

DCR 

H 


0135240 

MOV 

LI 

21 OQ 

MOV CM 


I NR 

L 


MOV 

BM 


013531Q 

I NR 

H 


MOV LI 

176Q 

MOV 

EM 


CALL 

2640Q 

013540Q 

JMP 


13472Q 

MOV AM 


RLC 



RLC 


013546Q 

RRC 



JNC 

13676Q 

MOV 

AM 


XRA 

I 

300Q 

013555Q 

I NR 

A 


MOV LI 

200Q 

MOV 

MA 


MOV 

LI 

1 75Q 

013563Q 

MOV 

CA 


MOV AM 


SUB 

C 


JC 


13676Q 

013571Q 

MOV 

LI 

200Q 

MOV AM 


DCR 

H 


MOV 

LI 

1 62Q 

013577Q 

ADD 

M 


MOV CA 


MOV 

B I 

OQ 

LX I 

H 

23164Q 

013606Q 

DAD 

B 


DAD B 


MOV 

AM 


I NX 

H 

0136120 

MOV 

BM 


LX I H 

23110Q 

MOV 

MA 


I NX 

H 


013620Q 

MOV 

MB 


MOV LI 

154Q 

MOV 

MI 

377Q 

LX I 

H 

2311OQ 

013630Q 

MOV 

CM 


I NR L 


MOV 

BM 


CALL 

2524Q 

013636Q 

LX I 

H 

24577Q 

MOV MA 


SUB 

I 

201 Q 

JZ 


13676Q 

013647Q 

MOV 

AM 


RLC 


CMA 



RRC 


013653Q 

JNC 


13625Q 

DCR H 


MOV 

LI 

21 OQ 

MOV 

CM 


013662Q 

I NR 

L 


MOV BM 


I NR 

H 


MOV 

LI 

1 77Q 

013667Q 

MOV 

EM 


CALL 

2640Q 

JMP 


13625Q 

JMP 

134720 

013701Q 

RET 



CALL 

5376Q 

LX I 

H 

2421OQ 

MOV 

MA 

01371 IQ 

1 NX 

H 


MOV MB 


DCR 

L 


MOV 

CM 


013715Q 

I NR 

L 


MOV BM 


CALL 

3236Q 

LX I 

H 

24221Q 

013725Q 

MOV 

MA 


LX I SP 

22712Q 

JMP 


403Q 

LX I 

H 

24601Q 

013737Q 

MOV 

MI 

OQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 

013750Q 

I NX 

H 


MOV MB 


CMA 



RRC 


013754Q 

JNC 


1 401OQ 

I NR H 


MOV 

LI 

201 Q 

MOV 

AM 


013763Q 

RRC 



CC 

4760 

LX I 

H 

24601Q 

MOV 

Ml 

377Q 

0137740 

DCR 

H 


MOV LI 

206Q 

MOV 

CM 


I NR 

L 

01400 IQ 

MOV 

BM 


CALL 

3334Q 

JMP 


137410 

RET 



01401 IQ 

CALL 

53760 

MOV CA 


CALL 

7601 Q 

LX I 

H 

22745Q 

014023Q 

MOV 

MA 


RET 


JMP 


14142Q 

LX I 

H 

231010 

014033Q 

MOV 

AM 


SUB I 

200Q 

JNZ 


14116Q 

MOV 

MI 

OQ 

014043Q 

MOV 

LI 

74Q 

MOV CM 


I NR 

L 


MOV 

BM 

014050Q 

MOV 

EC 


MOV DB 


MOV 

Cl 

240 

CALL 

462Q 

014057Q 

SUB 

I 

OQ 

JZ 

141160 

JMP 


14102Q 



014067Q 

104Q 11 IQ 123Q 

113Q 040Q 105Q 117Q 106Q 

040Q 040Q 

044Q 


014102Q 

LX 1 

B 

14067Q 

CALL 

6430 

LX I 

H 

24603Q 

MOV 

MI 

320 

014115Q 

RET 



LX I H 

23101Q 

MOV 

CM 


MOV 

B I 

00 

014124Q 

LHLD 

23076Q 

DAD B 


MOV 

AM 


LX I 

H 

24603Q 

014134Q 

MOV 

MA 


LX I H 

23101Q 

I NR 

M 


RET 

014142Q 

CALL 

1444Q 

LX I H 

242100 

MOV 

MA 


I NX 

H 


0141520 

MOV 

MB 


LX I H 

23155Q 

MOV 

MI 

377Q 

DCR 

H 


01 4161Q 

MOV 

LI 

347Q 

MOV AM 


RRC 



JNC 

1 4301 Q 

0141 700 

CALL 

5376Q 

LX I H 

242060 

MOV 

MA 


I NX 

H 


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

187 



Number 24 

188 


014200Q 

MOV 

MB 


CMA 



RRC 



JNC 

14215Q 

014206Q 

DCR 

L 


MOV 

CM 


I NR 

L 


MOV BM 


014212Q 

CALL 

3334Q 

LX I 

B 

22750Q 

MOV 

EC 


MOV DB 


014222Q 

MOV 

Cl 

12Q 

CALL 

446Q 

CALL 

476Q 

LX I H 

24602Q 

014235Q 

MOV 

MI 

10 

LX I 

H 

22750Q 

I NX 

H 


MOV AM 


014244Q 

LX I 

H 

24602Q 

SUB 

M 


JC 


1441 IQ 

I NR M 


014254Q 

MOV 

CM 


MOV 

BI 

OQ 

LX I 

H 

22750Q 

DAD B 


014263Q 

MOV 

AM 


MOV 

EA 


LX I 

H 

2421OQ 

MOV CM 


014271Q 

I NR 

L 


MOV 

BM 


CALL 

2640Q 

JMP 

14237Q 

014301Q 

LX! 

H 

24604Q 

MOV 

MI 

377Q 

CALL 

14030Q 

LX I H 

24603Q 

014314Q 

MOV 

AM 


LX I 

H 

23103Q 

SUB 

M 


RZ 

014322Q 

LX I 

H 

246030 

MOV 

AM 


SUB 

I 

32Q 

JNZ 

1 4341Q 

014333Q 

LX I 

H 

22747Q 

MOV 

MI 

377Q 

RET 



MOV AM 

014342Q 

SUB 

I 

1 40Q 

JNZ 


14356Q 

I NR 

L 


MOV AM 


014351Q 

CMA 



MOV 

MA 


JMP 


14306Q 

MOV AM 


014357Q 

SUB 

I 

40Q 

SBC 

A 


CMA 



I NR L 


014364Q 

ANA 

M 


RRC 



JNC 


14406Q 

DCR H 


014372Q 

MOV 

LI 

21 OQ 

MOV 

CM 


I NR 

L 


MOV BM 


014377Q 

1 NR 

H 


MOV 

LI 

203Q 

MOV 

EM 


CALL 

2640Q 

014406Q 

JMP 


14306Q 

RET 



CALL 

1444Q 

LX I H 

2421OQ 

014420Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


CALL 

5376Q 

0144260 

LX! 

H 

2311OQ 

MOV 

MA 


I NX 

H 


MOV MB 

014434Q 

MOV 

LI 

1 53Q 

MOV 

MI 

377Q 

MOV 

LI 

155Q 

MOV MI 

377Q 

0144440 

LX! 

H 

231100 

MOV 

CM 


I NR 

L 


MOV BM 


014452Q 

CALL 

2366Q 

LX I 

H 

24605Q 

MOV 

MA 


MOV Cl 

OQ 

0144S3G 

MOV 

B I 

OQ 

CALL 

2366Q 

LX I 

H 

24606Q 

MOV MA 

0144740 

DCR 

L 


MOV 

AM 


SUB 

I 

201 Q 

SUB I 

IQ 

014502Q 

SBC 

A 


I NR 

L 


MOV 

CA 


MOV AM 

014506Q 

SUB 

I 

201 Q 

SUB 

I 

IQ 

SBC 

A 


ORA C 


014514Q 

RRC 



RC 



DCR 

L 


MOV CM 


014520Q 

CALL 

10005Q 

ADD 

A 


ADD 

A 


ADD A 


014526Q 

ADD 

A 


MOV 

CA 


PUSH B 


LX I H 

24606Q 

014534Q 

MOV 

CM 


CALL 

10005Q 

POP 

D 


ORA E 

014542Q 

MOV 

EA 


LX I 

H 

24210Q 

MOV 

CM 


I NR L 


014550Q 

MOV 

BM 


CALL 

2640Q 

JMP 


14444Q 

RET 


014560Q 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX H 


014570Q 

MOV 

MB 


RRC 



RC 



LX I H 

23153Q 

014576Q 

MOV 

MI 

377Q 

MOV 

LI 

155Q 

MOV 

MI 

377Q 

CALL 

1444Q 

014607Q 

LX I 

H 

2421OQ 

MOV 

MA 


I NX 

H 


MOV MB 

014615Q 

LX! 

H 

24206Q 

MOV 

CM 


I NR 

L 


MOV BM 


014623Q 

CALL 

2366Q 

LX I 

H 

24607Q 

MOV 

MA 


SUB I 

201 Q 

014634Q 

JZ 


1471 IQ 

MOV 

AM 


RLC 



RLC 

014642Q 

RLC 



RLC 



ANA 

I 

17Q 

MOV CA 


014647Q 

CALL 

1 0041 Q 

MOV 

EA 


LX I 

H 

2421OQ 

MOV CM 


014657Q 

I NR 

L 


MOV 

BM 


CALL 

2640Q 

LX I H 

24607Q 

014667Q 

MOV 

AM 


ANA 

I 

1 7Q 

MOV 

CA 


CALL 

1 0041 Q 

014676Q 

MOV 

EA 


MOV 

Cl 

OQ 

MOV 

BI 

OQ 

CALL 

2640Q 

014706Q 

JMP 


14615Q 

RET 



CALL 

5376Q 

ANA I 

360Q 

014717Q 

MOV 

CA 


MOV 

AB 


ANA 

I 

377Q 

MOV BA 


014724Q 

CALL 

3530Q 

RET 



LX I 

B 

426Q 

CALL 

4365Q 

014736Q 

CMA 



RRC 



JNC 


14751Q 

LX I B 

426Q 

014746Q 

CALL 

4664Q 

CALL 

5376Q 

LX I 

H 

2461OQ 

MOV MA 

014760Q 

I NX 

H 


MOV 

MB 


CALL 

5376Q 

LX I H 

24212Q 

014770Q 

MOV 

MA 


I NX 

H 


MOV 

MB 


CALL 

5376Q 

014776Q 

LX! 

H 

24214Q 

MOV 

MA 


1 NX 

H 


MOV MB 


015004Q 

CALL 

14412Q 

LX I 

H 

23153Q 

MOV 

MI 

377Q 

LX I H 

2421OQ 

015017Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

2366Q 

015O25Q 

LX 1 

H 

23113Q 

MOV 

MA 


SUB 

I 

201 Q 

JZ 

1 5042Q 

015036Q 

MOV 

CM 


MOV 

LI 

1 02Q 

MOV 

MC 


LX I H 

2421OQ 

015045Q 

MOV 

CM 


1 NR 

L 


MOV 

BM 


CALL 

2052Q 

015053Q 

LX! 

H 

2461OQ 

MOV 

CM 


I NR 

L 


MOV BM 

015061Q 

CALL 

3606Q 

RRC 



JNC 


15117Q 

LX I H 

2421OQ 

015073Q 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

5027Q 

015101Q 

LX I 

H 

24212Q 

MOV 

CM 


I NR 

L 


MOV BM 

015107Q 

MOV 

LI 

21 OQ 

MOV 

MC 


I NX 

H 


MOV MB 


0151140 

JMP 


15143Q 

LX I 

H 

2421OQ 

MOV 

CM 


I NR L 


015124Q 

MOV 

BM 


CALL 

5027Q 

LX I 

H 

24214Q 

MOV CM 


015134Q 

I NR 

L 


MOV 

BM 


MOV 

LI 

21 OQ 

MOV MC 


01 5141Q 

I NX 

H 


MOV 

MB 


RET 



CALL 

5376Q 

01 5147Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX 

H 


MOV MB 

01 51550 

CMA 



RRC 



JNC 


15200Q 

DCR L 


01 51630 

MOV 

CM 


I NR 

L 


MOV 

BM 


CALL 

4365Q 

01 51 71 Q 

RRC 



CC 


4602Q 

JMP 


15144Q 

RET 

0152010 

LX! 

H 

24612Q 

MOV 

MI 

OQ 

I NX 

H 

MOV MI 

OQ 

01521 IQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV 

MA 


I NX H 

015221Q 

MOV 

MB 


CMA 



RRC 


JNC 

15256Q 

01 5227Q 

DCR 

L 


MOV 

CM 


I NR 

L 


MOV BM 

0152330 

CALL 

7601 Q 

MOV 

CA 


LX I 

H 

246120 

MOV EM 


015243Q 

1 NR 

L 


MOV 

DM 


MOV 

LC 

MOV HB 


015247Q 

DAD 

D 


SHLD 

24612Q 

JMP 


1521 IQ 

I NR H 


0152570 

MOV 

LI 

21 2Q 

MOV 

CM 


I NR 

L 

MOV BM 


0152640 

CALL 

7166Q 

RET 



CALL 

5376Q 

MOV CA 


015274Q 

CALL 

7601 Q 

LX! 

H 

22730Q 

MOV 

MA 

I NR L 


015304Q 

MOV 

MB 


CALL 

5376Q 

MOV 

CA 


CALL 

7601Q 

015314Q 

LX! 

H 

22730Q 

MOV 

CA 


MOV 

AM 


I NR L 

015322Q 

MOV 

DM 


SUB 

C 


MOV 

EA 


MOV AD 


015326Q 

SBC 

B 


MOV 

CE 


MOV 

BA 


CALL 

71 66Q 

0153340 

RET 



LX I 

H 

24614Q 

MOV 

MI 

IQ 

I NX H 

0153430 

MOV 

MI 

OQ 

CALL 

5376Q 

LX I 

H 

24206Q 

MOV MA 


015354Q 

I NX 

H 


MOV 

MB 


CMA 



RRC 


015360Q 

JNC 


15477Q 

DCR 

L 


MOV 

CM 


I NR L 


015366Q 

MOV 

BM 


CALL 

7601 Q 

MOV 

CA 


LX I H 

22726Q 

015376Q 

MOV 

MC 


I NR 

L 


MOV 

MB 


LX I H 

22726Q 


Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, 

Box E, 

Menlo Park, 

CA 94025 



Page 41 



Page 42 


015404Q 

MOV EM 


INR L 


MOV DM 


LX I H 

24614Q 

015412Q 

MOV CM 


INR L 


MOV BM 


JMP 

15463Q 

015420Q 

MOV AC 


SUB E 


MOV AB 


SBC D 


015424Q 

JP 

15434Q 

MOV HB 


MOV LC 


XCHG 


015432Q 

MOV BH 


MOV CL 


LX I H 

OQ 

XCHG 


015440Q 

MOV AB 


ORA C 


RZ 


XCHG 


015444Q 

MOV AB 


RAR 


MOV BA 


MOV AC 


015450Q 

RAR 


MOV CA 


JNC 

15456Q 

DAD D 


015456Q 

XCHG 


DAD H 


JMP 

15440Q 

CALL 

15420Q 

015466Q 

LX I H 

24614Q 

MOV ME 


I NX H 


MOV MD 


015474Q 

JMP 

15345Q 

INR H 


MOV LI 

21 4Q 

MOV CM 


015503Q 

I NR L 


MOV BM 


CALL 

7166Q 

RET 


01551 IQ 

CALL 

5376Q 

MOV CA 


CALL 

7601Q 

LX I H 

22724Q 

015523Q 

MOV MA 


INR L 


MOV MB 


CALL 

5376Q 

015531Q 

MOV CA 


CALL 

760 IQ 

MOV CA 


LX I H 

22722Q 

015541Q 

MOV MC 


INR L 


MOV MB 


LX I H 

22722Q 

015547Q 

MOV EM 


INR L 


MOV DM 


INR L 


015553Q 

MOV CM 


INR L 


MOV BM 


CALL 

7346Q 

015561Q 

MOV CE 


MOV BD 


CALL 

71 660 

RET 


015567Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV CA 


015577Q 

CALL 

1 073Q 

RET 


CALL 

5376Q 

LX I H 

24206Q 

01561 IQ 

MOV MA 


I NX H 


MOV MB 


CMA 


015615Q 

RRC 


JNC 

16003Q 

LX I H 

23153Q 

MOV MI 

377Q 

015626Q 

LX I H 

24206Q 

MOV CM 


INR L 


MOV BM 


015634Q 

CALL 

2366Q 

LX I H 

24621 Q 

MOV MA 


SUB I 

1 57Q 

015645Q 

JNZ 

15673Q 

MOV Cl 

OQ 

MOV B1 

OQ 

CALL 

2366Q 

015657Q 

SUB 1 

1 41Q 

SUB I 

IQ 

SBC A 


LX 1 H 

23144Q 

015667Q 

MOV MA 


JMP 

15603Q 

MOV AM 


SUB I 

1 64Q 

015676Q 

JNZ 

15723Q 

DCR H 


MOV LI 

206Q 

MOV CM 


015705Q 

I NR L 


MOV BM 


CALL 

7601 Q 

LX I H 

23072Q 

015715Q 

MOV MA 


I NX H 


MOV MB 


JMP 

16000Q 

015723Q 

MOV AM 


SUB I 

155Q 

JNZ 

15747Q 

MOV Cl 

OQ 

015733Q 

MOV BI 

OQ 

CALL 

2366Q 

LX I H 

23103Q 

MOV MA 


015744Q 

JMP 

16000Q 

MOV AM 


SUB I 

160Q 

JNZ 

15765Q 

015755Q 

LX I H 

22744Q 

MOV Ml 

377Q 

JMP 

16000Q 

MOV AM 


015766Q 

SUB I 

1 44Q 

JNZ 

16000Q 

LX I H 

22744Q 

MOV MI 

OQ 

016000Q 

JMP 

15603Q 

RET 


CALL 

5376Q 

MOV CA 


01601OQ 

CALL 

7601 Q 

LX I H 

22720Q 

MOV MA 


INR L 


016020Q 

MOV MB 


CALL 

5376Q 

MOV CA 


CALL 

7601Q 

016030Q 

MOV CA 


LX I H 

22716Q 

MOV MC 


INR L 


016036Q 

MOV MB 


LX I H 

22716Q 

MOV EM 


INR L 


016044Q 

MOV DM 


INR L 


MOV CM 


INR L 


016050Q 

MOV BM 


CALL 

7346Q 

CALL 

7166Q 

RET 


016060Q 

LX I H 

23150Q 

MOV CM 


INR L 


MOV BM 


016066Q 

MOV LI 

1 1 OQ 

MOV MC 


I NX H 


MOV MB 


016073Q 

LX I H 

24622Q 

MOV MI 

OQ 

I NX H 


MOV MI 

OQ 

016103Q 

LX I H 

2311OQ 

MOV CM 


INR L 


MOV BM 


01611 IQ 

MOV CB 


XRA A 


SUB C 


JNC 

16145Q 

01 6117Q 

LHLD 

24622Q 

1 NX H 


SHLD 

24622Q 

LHLD 

2311OQ 

01 6131Q 

MOV AM 


1 NX H 


MOV BM 


LX I H 

2311OQ 

016137Q 

MOV MA 


I NX H 


MOV MB 


JMP 

16103Q 

016145Q 

LX I H 

24622Q 

MOV CM 


INR L 


MOV BM 


016153Q 

CALL 

7166Q 

RET 


CALL 

5376Q 

MOV CA 


016163Q 

CALL 

7601 Q 

LX I H 

22714Q 

MOV MA 


I NR L 


016173Q 

MOV MB 


CALL 

5376Q 

MOV CA 


CALL 

760 IQ 

016203Q 

MOV EA 


MOV DB 


LX I H 

22714Q 

MOV CM 


01621 IQ 

INR L 


MOV BM 


CALL 

1744Q 

RET 


016217Q 

CALL 

1 444Q 

LX I H 

2421OQ 

MOV MA 


I NX H 


016227Q 

MOV MB 


LX I H 

23155Q 

MOV MI 

377Q 

LX I H 

2421OQ 

016240Q 

MOV CM 


INR L 


MOV BM 


MOV El 

63Q 

016245Q 

CALL 

2640Q 

MOV Cl 

OQ 

MOV BI 

OQ 

MOV El 

61 Q 

016256Q 

CALL 

2640Q 

MOV Cl 

OQ 

MOV B1 

OQ 

MOV El 

1 41Q 

016267Q 

CALL 

2640Q 

RET 


LX I H 

24624Q 

MOV MC 


0162770 

I NX H 


MOV MB 


LHLD 

23074Q 

MOV MI 

OQ 

016306Q 

LX 1 H 

24627Q 

MOV MI 

IQ 

MOV AI 

13Q 

LX I H 

24627Q 

016320Q 

SUB M 


JC 

1 6344Q 

MOV CM 


MOV B1 

OQ 

016327Q 

LHLD 

23074Q 

DAD B 


MOV MI 

40Q 

LX I H 

24627Q 

016340Q 

INR M 


JNZ 

16313Q 

MOV MI 

OQ 

MOV LI 

231 Q 

016350Q 

MOV Ml 

OQ 

LX I H 

23153Q 

MOV MI 

377Q 

LX I H 

24627Q 

016362Q 

MOV AM 


SUB I 

1 3Q 

SBC A 


MOV CA 


016367Q 

PUSH B 


MOV LI 

224Q 

MOV CM 


I NR L 


016374Q 

MOV BM 


CALL 

2366Q 

LX 1 H 

24630Q 

MOV MA 


016404Q 

SUB I 

20 IQ 

POP D 


ADD I 

377Q 

SBC A 


016412Q 

ANA E 


RRC 


JNC 

16513Q 

MOV AM 


016420Q 

SUB I 

72Q 

JNZ 

16443Q 

INR L 


MOV CM 


016427Q 

LHLD 

23074Q 

MOV MC 


LX I H 

24627Q 

MOV MI 

OQ 

016440Q 

JMP 

1 6357Q 

MOV AM 


SUB I 

56Q 

JNZ 

1 6457Q 

016451Q 

DCR L 


MOV MI 

1 OQ 

JMP 

1651OQ 

DCR L 


016460Q 

INR M 


MOV CM 


MOV BI 

OQ 

LHLD 

23074Q 

016467Q 

DAD B 


PUSH H 


LX I H 

24630Q 

MOV CM 


016475Q 

CALL 

757Q 

POP H 


MOV MA 


LX I H 

24630Q 

016505Q 

MOV CM 


INR L 


MOV MC 


JMP 

16357Q 

016513Q 

CALL 

666Q 

RET 


LX I H 

24632Q 

MOV MC 


016523Q 

1 NX H 


MOV MB 


LX 1 B 

1 4Q 

LHLD 

23074Q 

016533Q 

DAD B 


XCHG 


MOV Cl 

7Q 

PUSH D 


016540Q 

LX 1 H 

24632Q 

MOV EM 


INR L 


MOV DM 


016546Q 

MOV AD 


ORA A 


RAR 


MOV DA 


016552Q 

MOV AE 


RAR 


MOV EA 


DCR C 


016556Q 

JNZ 

16546Q 

POP H 


MOV ME 


LX I B 

40Q 

016566Q 

LHLD 

23074Q 

DAD B 


XCHG 


LX I H 

24632Q 

016576Q 

MOV AM 


INR L 


MOV BM 


ANA I 

1 77Q 

016603Q 

MOV CA 


MOV AB 


ANA I 

OQ 

MOV BA 



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


Number 24 

189 



01661OQ 

MOV AC 


STAX D 


RET 



LX 1 B 

14Q 

016616Q 

LHLD 

23074Q 

DAD B 


MOV 

AM 


MOV El 

7Q 

016625Q 

ADD A 


DCR E 


JNZ 


16625Q 

LX I D 

40Q 

016635Q 

LHLD 

23074Q 

DAD D 


MOV 

CA 


MOV AM 


016643Q 

ORA C 


MOV CA 


MOV 

BI 

OQ 

CALL 

7166Q 

0165520 

RET 


CALL 

5376Q 

MOV 

CA 


CALL 

16273Q 

016662Q 

CALL 

5376Q 

MOV CA 


CALL 

7601 Q 

MOV CA 


016672Q 

CALL 

16517Q 

CALL 

5376Q 

LX I 

H 

2421OQ 

MOV MA 


016704Q 

I NX H 


MOV MB 


LX I 

H 

23074Q 

MOV CM 


016712Q 

I NR L 


MOV BM 


MOV 

EC 


MOV DB 


016716Q 

MOV Cl 

17Q 

CALL 

462Q 

SUB 

I 

377Q 

JNZ 

16741Q 

016730Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 


016740Q 

MOV MB 


RET 


CALL 

5376Q 

MOV CA 


016746Q 

CALL 

16273Q 

MOV Cl 

OQ 

MOV 

BI 

OQ 

CALL 

16517Q 

016760Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

016770Q 

MOV MB 


LX I H 

23074Q 

MOV 

CM 


INR L 


016776Q 

MOV BM 


MOV EC 


MOV 

DB 


MOV Cl 

26Q 

017003Q 

CALL 

462Q 

SUB I 

377Q 

JNZ 


17024Q 

CALL 

5376Q 

017016Q 

LX I H 

2421OQ 

MOV MA 


1 NX 

H 


MOV MB 

017024Q 

RET 


CALL 

5376Q 

LX I 

H 

2421OQ 

MOV MA 


0170340 

I NX H 


MOV MB 


LX I 

H 

23074Q 

MOV CM 


017042Q 

I NR L 


MOV BM 


MOV 

EC 


MOV DB 


017046Q 

MOV Cl 

20Q 

CALL 

462Q 

SUB 

I 

377Q 

JNZ 

1 7071Q 

017060Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

017070Q 

MOV MB 


RET 


LX I 

H 

23074Q 

MOV CM 


017076Q 

INR L 


MOV BM 


MOV 

EC 


MOV DB 


017102Q 

MOV Cl 

23Q 

CALL 

446Q 

RET 



JMP 

17224Q 

0171130 

LX 1 H 

24637Q 

MOV AM 


SUB 

I 

OQ 

RNZ 

017122Q 

LX I H 

23101Q 

MOV CM 


MOV 

B I 

OQ 

LHLD 

23076Q 

0171330 

DAD B 


XCHG 


LX I 

H 

24635Q 

MOV CM 

01 7141Q 

MOV AC 


STAX D 


LX I 

H 

23101Q 

I NR M 


017147Q 

MOV AM 


SUB 1 

200Q 

JNZ 


17223Q 

MOV LI 

74Q 

017157Q 

MOV CM 


INR L 


MOV 

BM 


MOV EC 

017163Q 

MOV DB 


MOV Cl 

25Q 

CALL 

462Q 

LX I H 

24637Q 

017174Q 

MOV MA 


LX I H 

23101Q 

MOV 

MI 

OQ 

LHLD 

24440Q 

017205Q 

I NX H 


I NX H 


XCHG 


LX I H 

23156Q 

017213Q 

MOV CM 


INR L 


MOV 

BM 


MOV AC 

017217Q 

STAX D 


I NX D 


MOV 

AB 


STAX D 


017223Q 

RET 


LX I H 

24637Q 

MOV 

MI 

OQ 

LX I H 

23101Q 

017234Q 

MOV Ml 

OQ 

CALL 

5376Q 

MOV 

CA 


CALL 

4365Q 

017245Q 

CMA 


RRC 


RC 



LX 1 B 

4Q 

0172530 

LHLD 

24440Q 

DAD B 


MOV 

AM 


I NX H 

017261Q 

MOV BM 


MOV CA 


MOV 

LC 


MOV HB 


017265Q 

1 NX H 


SHLD 

23156Q 

MOV 

Cl 

OQ 

MOV BI 

OQ 

017275Q 

CALL 

2366Q 

LX I H 

24635Q 

MOV 

MA 


SUB 1 

201 Q 

017306Q 

JZ 

17317Q 

CALL 

17113Q 

JMP 


1 7271Q 

LX I H 

23154Q 

017322Q 

MOV MI 

377Q 

CALL 

5376Q 

ANA 

I 

360Q 

MOV CA 

017332Q 

MOV AB 


ANA 1 

377Q 

MOV 

BA 


CALL 

2524Q 

017341Q 

LX I H 

24635Q 

MOV MA 


SUB 

I 

201 Q 

JZ 

17400Q 

017352Q 

INR L 


MOV MI 

OQ 

MOV 

AI 

1 77Q 

LX 1 H 

24636Q 

017362Q 

SUB M 


JC 

17400Q 

CALL 

17113Q 

LX I H 

24636Q 

017374Q 

INR M 


JNZ 

17355Q 

CALL 

5376Q 

LX I H 

2421OQ 

0174060 

MOV MA 


I NX H 


MOV 

MB 


INR H 

017412Q 

MOV LI 

237Q 

MOV AM 


SUB 

I 

OQ 

JZ 

17433Q 

017422Q 

CALL 

5376Q 

LX I H 

2421OQ 

MOV 

MA 


I NX H 

017432Q 

MOV MB 


RET 


CALL 

3376Q 

LX I H 

24206Q 

017442Q 

MOV MA 


I NX H 


MOV 

MB 


MOV CA 

017446Q 

CALL 

4365Q 

CMA 


RRC 



JNC 

17476Q 

017456Q 

LX 1 H 

24206Q 

MOV CM 


INR 

L 


MOV BM 

017464Q 

CALL 

4664Q 

CALL 

1444Q 

MOV 

CA 


CALL 

5027Q 

0174760 

CALL 

5376Q 

MOV CA 


CALL 

760 IQ 

LX I H 

24640Q 

0175100 

MOV MA 


I NX H 


MOV 

MB 

CALL 

5376Q 

0175160 

LX I H 

2421OQ 

MOV MA 


I NX 

H 


MOV MB 

017524Q 

XRA A 


LX I H 

24640Q 

SUB 

M 


INR L 


017532Q 

MOV CA 


MOV AI 

OQ 

SBC 

M 


JNC 

17726Q 

017541Q 

LHLD 

24640Q 

DCX H 


SHLD 

24640Q 

LX 1 H 

23074Q 

01 7553Q 

MOV CM 


INR L 


MOV 

BM 


MOV EC 

017557Q 

MOV DB 


MOV Cl 

24Q 

CALL 

462Q 

SUB I 

OQ 

017567Q 

JZ 

17604Q 

CALL 

5376Q 

LX 1 

H 

2421OQ 

MOV MA 

017601Q 

I NX H 


MOV MB 


RET 



LHLD 

23076Q 

017607Q 

MOV AM 


LX I D 

4Q 

LHLD 

24440Q 

DAD D 


017617Q 

MOV CA 


MOV AM 


I NX 

H 


MOV DM 


017623Q 

MOV EA 


CALL 

2167Q 

LX I 

H 

23160Q 

MOV MA 


017633Q 

I NX H 


MOV MB 


DCR 

L 


MOV AM 


017637Q 

INR L 


MOV BM 


ANA 

I 

360Q 

MOV CA 


017644Q 

MOV AB 


ANA I 

377Q 

INR 

L 


MOV MC 


017651Q 

I NX H 


MOV MA 


MOV 

LI 

1 55Q 

MOV MI 

OQ 

017657Q 

MOV LI 

1 01Q 

MOV MI 

IQ 

MOV 

AI 

1 77Q 

LX I H 

23101Q 

017670Q 

SUB M 


JC 

17524Q 

MOV 

CM 


MOV BI 

OQ 

017677Q 

LHLD 

23076Q 

DAD B 


MOV 

AM 


MOV EA 


017705Q 

MOV Cl 

OQ 

MOV BI 

OQ 

CALL 

2640Q 

LX I H 

23101Q 

017717Q 

INR M 


JNZ 

17663Q 

JMP 


17524Q 

RET 


017727Q 

LX I H 

22747Q 

MOV MI 

OQ 

INR 

H 


MOV LI 

1 01 Q 

017737Q 

MOV MI 

200Q 

CALL 

14025Q 

RET 



JMP 

20035Q 

017750Q 

LX 1 H 

24652Q 

MOV MC 


I NX 

H 


MOV MB 

017756Q 

MOV LI 

255Q 

MOV MI 

OQ 

MOV 

A I 

47Q 

LX I H 

24655Q 

017767Q 

SUB M 


JC 

20032Q 

MOV 

CM 


MOV BI 

OQ 

017776Q 

INR L 


DAD B 


DAD 

B 


MOV AM 


020002Q 

I NX H 


MOV BM 


LX I 

H 

24652Q 

SUB M 


020010Q 

INR L 


MOV CA 


MOV 

AB 


SBC M 


020014Q 

ORA C 


JNZ 

20024Q 

MOV 

LI 

255Q 

MOV AM 


020023Q 

RET 


MOV LI 

255Q 

I NR 

M 


JNZ 

17762Q 

020032Q 

MOV A1 

50Q 

RET 


LX I 

H 

24162Q 

MOV CM 


020041Q 

INR C 


MOV BI 

OQ 

LX I 

H 

23164Q 

DAD B 



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

190 


Page 43 



Page 44 


020050Q 

DAD B 


XCHG 


LX 1 

H 

24216Q 

MOV AM 


020056Q 

INR L 


MOV BM 


ORA 

I 

1 IQ 

MOV CA 


020063Q 

MOV AB 


ORA I 

OQ 

MOV 

BA 


MOV AC 


020070Q 

STAX D 


1 NX D 


MOV 

AB 


STAX D 


020074Q 

LX I H 

24162Q 

MOV CM 


MOV 

BI 

OQ 

LX I H 

23164Q 

020105Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


02011 IQ 

MOV BM 


RRC 


CMA 



RRC 


020115Q 

JNC 

20127Q 

LX I H 

24162Q 

DCR 

M 


JMP 

20074Q 

020127Q 

LX 1 H 

24162Q 

MOV CM 


MOV 

B I 

OQ 

LX I H 

23164Q 

020140Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


020144Q 

MOV BM 


RRC 


JNC 


20157Q 

LX I SP 

22712Q 

020154Q 

JMP 

403Q 

LX I H 

241620 

MOV 

CM 


1 NR L 


020164Q 

MOV MC 


DCR L 


MOV 

CM 


MOV B1 

OQ 

020171Q 

LX I H 

23164Q 

DAD B 


DAD 

B 


MOV AM 


020177Q 

I NX H 


MOV BM 


ANA 

I 

4Q 

MOV CA 


020204Q 

MOV AB 


ANA I 

OQ 

LX 1 

H 

24167Q 

MOV MC 


020213Q 

CALL 

631 Q 

RRC 


CC 


551 3Q 

LX 1 H 

24203Q 

020225Q 

MOV AM 


RRC 


CC 


5416Q 

LX I H 

24162Q 

020235Q 

MOV CM 


MOV B! 

OQ 

LX I 

H 

23164Q 

DAD B 


020244Q 

DAD B 


MOV AM 


I NX 

H 


MOV BM 


020250Q 

ANA I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

020256Q 

LX 1 H 

24642Q 

MOV MC 


1 NX 

H 


MOV MA 


020264Q 

DCR H 


MOV LI 

21 6Q 

MOV 

CM 


I NR L 


020271Q 

MOV BM 


MOV LI 

21 OQ 

MOV 

MC 


I NX H 


020276Q 

MOV MB 


LX I B 

2Q 

LHLD 

24642Q 

DAD B 


020306Q 

MOV AM 


LX I H 

24650Q 

MOV 

MA 


LX 1 B 

3Q 

020316Q 

LHLD 

24642Q 

DAD B 


MOV 

AM 


LX I H 

24651Q 

020326Q 

MOV MA 


SUB I 

201 Q 

SUB 

1 

IQ 

SBC A 


020334Q 

LX I D 

4Q 

LHLD 

24642Q 

DAD 

D 


MOV CA 


020344Q 

MOV AM 


SUB I 

201 Q 

ADD 

1 

377Q 

SBC A 


020352Q 

ORA C 


LX I H 

24650Q 

MOV 

EA 


MOV AM 


020360Q 

SUB I 

1 41Q 

SBC A 


ORA 

E 


MOV CA 


020365Q 

MOV A1 

1 72Q 

SUB M 


SBC 

A 


ORA C 


020372Q 

RRC 


JNC 

20407Q 

MOV 

Cl 

OQ 

DCR C 


020401Q 

CALL 

13363Q 

JMP 

21173Q 

LHLD 

246420 

I NX H 


020413Q 

1 NX H 


MOV AM 


I NX 

H 


MOV BM 


020417Q 

MOV CA 


CALL 

17750Q 

MOV 

LA 


MOV HI 

OQ 

020426Q 

JMP 

21037Q 

CALL 

10471Q 

JMP 


21173Q 

CALL 

13007Q 

020442Q 

JMP 

21173Q 

CALL 

12262Q 

JMP 


21173Q 

CALL 

13242Q 

020456Q 

JMP 

21173Q 

CALL 

13130Q 

JMP 


21173Q 

CALL 

12743Q 

020472Q 

JMP 

211730 

CALL 

11420Q 

JMP 


21173Q 

CALL 

1 1051Q 

020506Q 

JMP 

21173Q 

CALL 

144120 

JMP 


21173Q 

CALL 

1 5201Q 

020522Q 

JMP 

21173Q 

CALL 

10623Q 

JMP 


21173Q 

CALL 

15144Q 

020536Q 

JMP 

21173Q 

CALL 

15270Q 

JMP 


21173Q 

CALL 

15335Q 

020552Q 

JMP 

21173Q 

CALL 

16004Q 

JMP 


21173Q 

CALL 

17434Q 

020566Q 

JMP 

21173Q 

CALL 

1711OQ 

JMP 


21173Q 

CALL 

16653Q 

020602Q 

JMP 

21173Q 

CALL 

17025Q 

JMP 


21173Q 

CALL 

16613Q 

020616Q 

JMP 

21173Q 

CALL 

16742Q 

JMP 


21173Q 

CALL 

17072Q 

020632Q 

JMP 

21173Q 

CALL 

17727Q 

JMP 


21173Q 

CALL 

1 551 1 Q 

020646Q 

JMP 

21173Q 

CALL 

14560Q 

JMP 


21173Q 

CALL 

13734Q 

020662Q 

JMP 

21 173Q 

CALL 

14712Q 

JMP 


21173Q 

CALL 

14730Q 

020676Q 

JMP 

21173Q 

CALL 

15603Q 

JMP 


21173Q 

CALL 

13702Q 

020712Q 

JMP 

21173Q 

CALL 

16060Q 

JMP 


21173Q 

CALL 

5465Q 

020726Q 

JMP 

21173Q 

CALL 

5503Q 

JMP 


21173Q 

CALL 

1 401 IQ 

020742Q 

JMP 

21173Q 

CALL 

16217Q 

JMP 


21173Q 

MOV Cl 

OQ 

020755Q 

CALL 

13363Q 

JMP 

21173Q 

CALL 

14025Q 

JMP 

21173Q 

020771Q 

CALL 

15567Q 

JMP 

21173Q 

CALL 

16157Q 

JMP 

21173Q 

0210050 

LX I H 

23104Q 

MOV Ml 

377Q 

MOV 

Cl 

OQ 

MOV El 

OQ 

021016Q 

MOV D1 

OQ 

CALL 

446Q 

JMP 


21173Q 

MOV Cl 

OQ 

021030Q 

DCR C 


CALL 

13363Q 

JMP 


21173Q 

DAD H 


021040Q 

LX I B 

21051Q 

DAD B 


MOV 

EM 


I NX H 


021046Q 

MOV DM 


XCHG 


PCHL 




021051Q 

031Q 041Q 037Q 

04IQ 045Q 

041Q 053Q 0410 

061Q 041Q 

067Q 041Q 075Q 

021067Q 

103Q 041Q 11 IQ 

041Q 117Q 

041Q 125Q 041Q 

133Q 04IQ 

141Q 041Q 147Q 

021105Q 

155Q 041Q 163Q 

041Q 171Q 

041Q 177Q 041Q 

205Q 041Q 

213Q 04IQ 22IQ 

021123Q 

227Q 041Q 235Q 

041Q 243Q 

041Q 251Q 041Q 

257Q 041Q 

265Q 04IQ 273Q 

021141Q 

301Q 041Q 307Q 

04IQ 3150 

041Q 323Q 04IQ 

331Q 041Q 

337Q 04IQ 345Q 

021157Q 

353Q 04IQ 363Q 

041Q 371Q 

041Q 377Q 041Q 

005Q 042Q 

026Q Od2Q 

021173Q 

LX I H 

2421OQ 

MOV AM 


INR 

L 


MOV BM 


021201Q 

ANA I 

360Q 

MOV CA 


MOV 

AB 


ANA I 

377Q 

021207Q 

DCR L 


MOV MC 


I NX 

H 


MOV MA 


021213Q 

MOV LI 

1 63Q 

MOV CM 


DCR 

L 


MOV MC 


021220Q 

LX I H 

24162Q 

MOV CM 


MOV 

B I 

OQ 

LX I H 

23164Q 

021231Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


021235Q 

MOV BM 


CMA 


RRC 



JNC 

21 355Q 

021243Q 

LX I H 

24162Q 

MOV CM 


MOV 

B1 

OQ 

LX I H 

23164Q 

021254Q 

DAD B 


DAD B 


MOV 

AM 


I NX H 


0212600 

MOV BM 


LX I H 

24206Q 

MOV 

MA 


I NX H 


021266Q 

MOV MB 


INR L 


SUB 

M 


I NR L 


021272Q 

MOV CA 


MOV AB 


SBC 

M 


ORA C 


021276Q 

JZ 

2131 IQ 

MOV LI 

206Q 

MOV 

CM 


I NR L 


021305Q 

MOV BM 


CALL 

2052Q 

LX 1 

H 

24162Q 

MOV CM 


021315Q 

MOV B1 

OQ 

LX I H 

23164Q 

DAD 

B 


DAD B 


021324Q 

XCH0 


LX I H 

24216Q 

MOV 

AM 


I NR L 


021332Q 

MOV BM 


ORA I 

1 IQ 

MOV 

CA 


MOV AB 


021337Q 

ORA I 

OQ 

MOV BA 


MOV 

AC 


STAX D 


021344Q 

I NX D 


MOV AB 


STAX 

; D 


MOV LI 

1 62Q 

021351Q 

INR M 


JMP 

21220Q 

LX I 

H 

24172Q 

MOV AM 


021361Q 

ANA I 

17Q 

SUB I 

OQ 

JNZ 


21376Q 

CALL 

61 40Q 

021373Q 

JMP 

21431Q 

LHLD 

24172Q 

MOV 

AM 


SUB I 

201 Q 

021404Q 

SUB 1 

IQ 

SBC A 


LHLD 

24170Q 

MOV CA 


021413Q 

MOV AM 


1 NX H 


MOV 

DM 


MOV ED 


021417Q 

PUSH B 


XRA A 


SUB 

E 


POP D 


021423Q 

SBC A 


ANA E 


RRC 



CC 

6140Q 


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


Number 24 


191 



021431Q 

LX I H 

24163Q 

MOV CM 


DCR C 


DCR 

L 


021437Q 

MOV MC 


MOV LI 

166Q 

MOV MI 

377Q 

LX I 

B 

2Q 

021447Q 

LHLD 

2421OQ 

DAD B 


MOV AM 


SUB 

1 

201Q 

021456Q 

JNZ 

21475Q 

LX I H 

24210Q 

MOV CM 


INR 

L 

021466Q 

MOV BM 


CALL 

2052Q 

JMP 

21664Q 

XRA 

A 


021476Q 

LX I H 

24167Q 

SUB M 


JNC 

21615Q 

MOV 

LI 

21 OQ 

021507Q 

MOV CM 


INR L 


MOV BM 


I NR 

H 


021S13Q 

MOV LI 

2440 

MOV MC 


I NX H 


MOV 

MB 


021520Q 

LHLD 

24644Q 

MOV AM 


I NX H 


MOV 

BM 


021526Q 

MOV CB 


XRA A 


SUB C 


JNC 


21551Q 

021534Q 

DCX H 


MOV AM 


I NX H 


MOV 

BM 


021540Q 

LX I H 

24644Q 

MOV MA 


I NX H 


MOV 

MB 


021546Q 

JMP 

21520Q 

LX I H 

24170Q 

MOV CM 


INR 

L 


0215560 

MOV BM 


LHLD 

24644Q 

MOV MC 


I NX 

H 


021564Q 

MOV MB 


LX I H 

24210Q 

MOV CM 


INR 

L 


021572Q 

MOV BM 


MOV LI 

170Q 

MOV MC 


I NX 

H 


021577Q 

MOV MB 


LX I B 

2Q 

LHLD 

24170Q 

DAD 

B 


021607Q 

SHLD 

24172Q 

JMP 

21664Q 

LX I H 

23153Q 

MOV 

MI 

377Q 

021622Q 

LX I H 

2421OQ 

MOV CM 


INR L 


MOV 

BM 

021630Q 

CALL 

2366Q 

LX I H 

24647Q 

MOV MA 


SUB 

I 

201 Q 

021641Q 

JZ 

21653Q 

MOV CM 


CALL 

6527Q 

JMP 


21622Q 

021653Q 

DCR H 


MOV LI 

21 OQ 

MOV CM 


I NR 

L 


021660Q 

MOV BM 


CALL 

2052Q 

RET 


LX I 

B 

420Q 

021670Q 

CALL 

4365Q 

CMA 


RRC 


JNC 


21706Q 

021700Q 

LX I B 

420Q 

CALL 

4664Q 

CALL 

1444Q 

LX I 

H 

2421OQ 

021714Q 

MOV MA 


I NX H 


MOV MB 


MOV 

CA 


021720Q 

CALL 

5027Q 

LX I H 

23155Q 

MOV MI 

377Q 

MOV 

LI 

1 1 3Q 

021732Q 

MOV MI 

2Q 

LHLD 

23076Q 

MOV AM 


LX 1 

H 

23113Q 

021743Q 

SUB M 


JC 

21776Q 

INR M 


MOV 

CM 


021751Q 

DCR C 


MOV BI 

OQ 

LHLD 

23076Q 

DAD 

B 


021760Q 

MOV AM 


MOV EA 


LX I H 

2421OQ 

MOV 

CM 


021766Q 

I NR L 


MOV BM 


CALL 

2640Q 

JMP 


21734Q 

021776Q 

RET 


MOV Cl 

31 Q 

MOV El 

OQ 

MOV 

DI 

OQ 

022005Q 

CALL 

462Q 

LX I H 

23105Q 

MOV MA 


INR 

L 


022015Q 

MOV MA 


INR L 


MOV MA 


RET 



022021Q 

LX I H 

242200 

MOV AM 


RRC 


JNC 


22400Q 

022031Q 

MOV MI 

OQ 

MOV LI 

203Q 

MOV MI 

OQ 

MOV 

LI 

1 70Q 

022041Q 

MOV Ml 

OQ 

I NX H 


MOV MI 

OQ 

LX I 

H 

23150Q 

022051Q 

MOV MI 

OQ 

I NX H 


MOV MI 

OQ 

LHLD 

23114Q 

022061Q 

MOV AM 


I NX H 


MOV BM 


LX I 

H 

2311OQ 

022067Q 

MOV MA 


I NX H 


MOV MB 


LX I 

B 

21 Q 

022075Q 

LHLD 

23074Q 

DAD B 


MOV AM 


SUB 

I 

1 36Q 

022104Q 

JNZ 

22202Q 

LX I B 

22Q 

LHLD 

23074Q 

DAD 

B 


022116Q 

MOV AM 


MOV CA 


CALL 

10005Q 

ADD 

A 


0221240 

ADD A 


ADD A 


ADD A 


LX I 

D 

23Q 

022132Q 

LHLD 

23074Q 

DAD D 


MOV CA 


MOV 

AM 


022140Q 

PUSH B 


MOV CA 


CALL 

10005Q 

POP 

D 


0221460 

ORA E 


MOV BI 

OQ 

MOV CA 


LX I 

H 

22712Q 

022155Q 

MOV MC 


INR L 


MOV MB 


LX I 

H 

22712Q 

022163Q 

MOV EM 


INR L 


MOV DM 


LX I 

B 

4000 

022171Q 

CALL 

15420Q 

LX I H 

23110Q 

MOV ME 


I NX 

H 


022201 Q 

MOV MD 


LX I B 

25000Q 

LX I H 

23110Q 

MOV 

EM 


02221 IQ 

INR L 


MOV DM 


CALL 

1744Q 

CALL 

4322Q 

022221Q 

CALL 

51 16Q 

CALL 

1444Q 

LX I H 

24216Q 

MOV 

MA 


022233Q 

I NX H 


MOV MB 


MOV LI 

1 62Q 

MOV 

MI 

IQ 

022241Q 

MOV AI 

376Q 

LX I H 

24162Q 

SUB M 


JC 


22313Q 

022252Q 

MOV CM 


MOV BI 

OQ 

LX I H 

23164Q 

DAD 

B 


022261Q 

DAD B 


XCHG 


LX I H 

24216Q 

MOV 

AM 


022267Q 

INR L 


MOV BM 


ORA I 

1 IQ 

MOV 

CA 


022274Q 

MOV AB 


ORA I 

OQ 

MOV BA 


MOV 

AC 


022301Q 

STAX D 


I NX D 


MOV AB 


STAX D 


022305Q 

MOV LI 

1 62Q 

INR M 


JNZ 

22241 Q 

CALL 

21777Q 

022316Q 

LHLD 

23074Q 

I NX H 


MOV AM 


SUB 

I 

40Q 

022325Q 

JZ 

22425Q 

CALL 

21665Q 

MOV LI 

74Q 

MOV 

CM 


022336Q 

INR L 


MOV BM 


MOV EC 


MOV 

DB 


022342Q 

MOV Cl 

17Q 

CALL 

462Q 

SUB I 

377Q 

JZ 


22375Q 

022354Q 

CALL 

666Q 

LX I H 

22747Q 

MOV MI 

OQ 

LX I 

B 

40Q 

022367Q 

LHLD 

23074Q 

DAD B 


MOV Ml 

OQ 

JMP 


22425Q 

022400Q 

LX I H 

23104Q 

MOV AM 


RRC 


JNC 


22425Q 

02241OQ 

MOV Ml 

OQ 

CALL 

21777Q 

CALL 

21665Q 

DCR 

H 


022421Q 

MOV LI 

347Q 

MOV MI 

377Q 

CALL 

5722Q 

MOV 

Cl 

377Q 

022432Q 

CALL 

621 4Q 

LX I H 

24777Q 

MOV MA 


SUB 

I 

1 73Q 

022443Q 

JNZ 

22454Q 

CALL 

671 3Q 

JMP 

22430Q 

MOV 

AM 

022455Q 

SUB I 

1 74Q 

JNZ 

22472Q 

MOV Cl 

OQ 

CALL 

6343Q 

022467Q 

JMP 

22526Q 

MOV AM 


SUB I 

1 OOQ 

JNZ 


22506Q 

022500Q 

CALL 

7023Q 

JMP 

22526Q 

MOV AM 


SUB 

I 

1 75Q 

02251 IQ 

JNZ 

22522Q 

CALL 

17745Q 

JMP 

22526Q 

MOV 

CM 

022523Q 

CALL 

6527Q 

JMP 

22430Q 

El 


HLT 




022533Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 



Number 24 

192 


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


Page 45 



OSI’s WORD PROCESSOR 


News Release Received: 78 Jan 3 

Ohio Scientific announces its new Word Processor OS-WP1. 
The OS-WP1 is a text editor which operates at both the 
character and line levels. It has internal GET and PUT file 
commands which transfer individual files from memory to 
disk. The OS-WP1 has a full set of printer control commands 
which can be used with virtually any impact or matrix com¬ 
puter printer or word processing printer. The formatted out¬ 
put mode allows the user to perform left and right justification 
of text without line numbers at a designated width of from 
20 to 70 characters. 

The OS-WP1 is ideal for writing letters, manuals, reports, 
and all normal everyday business forms. It can be used directly 
with the Lear Siegler ADM-3A or with the Hazeltine 1500 
and is adaptable to virtually any other conventaional CRT 
terminal via documentation provided. 

The complete Word Processor package, two diskettes and 
a manual is now available for only $79.00 for use on any 
disk-based Ohio Scientific computer system. Available from 
Ohio Scientific, Hiram, OH 44234 

TANDY COMPUTERS 1978 CATALOG 

News Release Received: 78 March 20 

A microcomputer mail-order catalog has just been issued 
by Tandy Computers, the newly created retail division of 
Tandy Corporation, parent company of Radio Shack. 

The 52-page 4-color catalog details a full line of popular 
brand microcomputers and accessories, software packages, 
parts and literature currently in stock. Kits and fully 
assembled micromputer systems listed in the catalog range in 
price from several hundred dollars to more than $20,000. 

Among the nationally known brands carried are Radio 
Shack’s TRS-80, the IMSAI 8080, Vector 1 and 1+, Xitan, 
Equinox 100, Polymorphic System 8813, and many others 
offering beginners, hobbyists, educators and business users 
a wide selection from which to choose. 

In addition, the store carries a complete selection of micro¬ 
processor mainframes, peripherals, software, printed circuit 
accessories and discrete parts and literature. The new store 
also offers programming assistance and on-premises computer 
service. Copies of the new Tandy Computers 1978 Catalog 
are available by telephoning toll-free 1-800-433-1679, or 
by writing to: Tandy Computers, Dept. R7, P.O. Box 2932, 
Fort Worth, Texas 76101 



PERCOM’s MINIFLOPPY FOR SS-50 BUS 

news release Received: 77 Dec 12 

PerCom Data Company has introduced the LFD-400, a 
minifloppy disk system for the SS-50 bus. A complete 1 -drive 
LFD-400 system includes a controller PC board, PROMware 
disk operating system, disk drive and drive power supply, 
interconnecting cable, two minidiskettes, an operator’s 
manual, and an enclosure to house the drive and drive power 
supply. 

The controller board includes special low-voltage-drop 
regulators, a proprietary “bit shifting” compensation circuit, 
an inactivity time-out circuit to increase drive motor life, 
and provision for 3 K byte of PROM. The controller PROM 
may be used completely independently of the disk and 
operating system. 

The LFD-400 PROMware DOS, miniDOS tm , allows SS-50 
bus owners to use their existing software with simple patches. 
The miniDOS tm program includes load and save routines, and 
is contained in a 2708 EPROM, and therefore is ready on 
power-up. 

For more information, contact PerCom Data Company, 
Inc., 318 Barnes, Garland, TX 75042 (214) 276-1968. 



k 


022731Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOO 377Q 120Q OOOQ 

022747Q 377Q 120Q OOOQ 001Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

022765Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023055Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 170Q 

023073Q OOOQ 134Q OOOQ 200Q OOOQ OOOQ 200Q 004Q 176Q OOOQ OOOQ OOOQ OOOQ OOOQ 

02311 IQ OOOQ OOOQ OOOQ 006Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023127Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 377Q 

023145Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023163Q OOOQ 003Q OOOQ 001Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

023201Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024207Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 377Q 377Q OOOQ OOOQ OOOQ 

024225Q OOOQ OOOQ 377Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024243Q OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ OOOQ 

024655Q OOOQ 156Q 163Q 145Q 161Q 151Q 156Q 156Q 164Q 147Q 145Q 143Q 162Q 147Q 

024673Q 143Q 163Q 163Q 160Q 153Q 141Q 144Q 141Q 163Q 144Q 144Q 163Q 165Q 155Q 

02471 IQ 154Q 144Q 166Q 162Q 146Q 167Q 146Q 157Q 146Q 143Q 146Q 162Q 156Q 155Q 

024727Q 146Q 144Q 146Q 162Q 144Q 155Q 144Q 165Q 153Q 160Q 1630 163Q 157Q 162Q 

024745Q 157Q 151Q 157Q 145Q 170Q 156Q 142Q 164Q 156Q 164Q 146Q 146Q 167Q 166Q 

024763Q I860 143Q 154Q 162Q 163Q 172Q 172Q 146Q 163Q 163Q 164Q 

NO PROGRAM ERRORS 

Page 46 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 24 


193 






Dr. DoBB'S ToURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 25 May 1978 Volume 3, Issue 5 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


SOFTWARE 

Programming Language Translation Techniques W.M.McKeeman 4 

Yet Another Body Ken Anderson 17 

Some additions to Lichen Wang’s Robot Control Language 

FORTH for Microcomputers John James 21 

Description of a stack-oriented language 

Resident Memory Test Systems Terry Ritter 28 

Discussion with an example for the M6800 

EDITHA: A Revision of the Fylstra KIM-1 Editor Program H. T. Gordon 34 


HARDWARE 

Proposed Standard for the S-100 Bus George Morrow and Howard Fullmer 

Preliminary Specs from the IEEE Microprocessor Standards Committee 


40 








© David Dameron 1979 




DISASSEMBLER FOR Z80 

News Release Received: 78 Apr 2 

alphaBIT Microsystems announces the UN-Z80 disassem¬ 
bler, output compatible with the TDL Z80 assembly language. 
Features: (1) module to be disassembled can be anywhere in 
the memory space in one or multiple extents. (2) program, 
byte or word format can be specified for each extent. (3) labels 
for forward and backward references are automatically 
resolved. (4) display or printer output will generate addresses, 
object and source. (5) optionally, source code may be gener¬ 
ated and stored on disk or tape, for subsequent input to an 
assembler, Note: All I/O for UN-Z80 is byte oriented. User is 
responsible for providing the necessary interface routines for 
I/O, which is facilitated by JUMP vectors. 

Price: $35.00 on North Star format floppy diskette or 
CUTER format tape cassette. Specify load address of 100H or 
2A00H. Inquire about other media. $5.00 additional for any 
other load address. $2.00 for documentation only, applicable 
to purchase within 21 days. California residents add 6% or 
6.5% sales tax. Contact alphaBIT Microsystems, Box 1107, 
2000 Center Street, Berkeley, CA 94704. 


6800 INDUSTRIAL BASIC 

News Release Received: 78 April 4 

Wintek 4K BASIC is a 6800 BASIC interpreter optimized 
for industrial applications. Control of interrupts, direct mem¬ 
ory read and write, assembly language subroutine, and flexible 
input/output are oriented toward process control and monitor¬ 
ing. 4K BASIC retains many of the features of an interactive 
high level language, including advanced control structures 
including FOR. . . NEXT, IF. . .THEN. . . ELSE, and ON. .. 
GOTO/ON... GOSUB. 

The interpreter may reside in RAM or in PROM. If the 
BASIC program is also stored in PROM, the interpreter will 
immediately enter the “RUN” mode, allowing unattended 
operation in dedicated applications. 4K BASIC is available on 
cassette ($95) or in PROM on a WINCE ROM Module ($299). 
The source listing ($95) and an OEM license ($2,000) are also 
available. WINTEK Corporation, 902 North Ninth Street, 
Lafayette, IN 47904; (317) 742-6802. 


SOLOS TO NORTHSTAR DOS 

News Release Received: 78 March 15 

Microcomputer Resources, Inc. announces a software pack¬ 
age that ties Processor Technology’s SOLOS operating system 
to North Star DOS and BASIC. It allows the use of the CUTS 
tape port for archive storage of data. The VDMhas start-stop 
and speed control which allow changes in speed while the com¬ 
puter is using it. All three I/O ports are supported through 
BASIC, and may be accessed by the *#’ operator. The tape 
routines are accessed as I/O devices. The cursor control keys 
on the SOL are interfaced to North Star BASIC, allowing most 
edits in the line editor without the use of control keys. The 
user may change from the VDM to any of the SOLOS output 
drivers while running the DOS. Additionally, the package 
allows the user to list the directory of a disk while in BASIC. 
Documentation for the software is included on the disk. It 
includes several example programs written in BASIC, and data 
files that explain how to operate the system. This package sells 
for $10.00 for the diskette and program, and $2.00 to cover 
shipping and handling. Microcomputer Resrouces, Inc., 3000 
Medical Park Drive, Suite 107, Tampa, FL 33612; (813) 977- 
5940. 


MORE AD INFINITUM 

Received: 78 March 20 

In the spirit of James R. Van Zandt’s “practical cure” 
for the software piracy problem, let me propose also that 
anyone needing transportation borrow Mr. Van Zandt’s 
car and send a small rental ($2.00, say) to the car’s owner, 
whose name and address is on the registration certificate. 
This rental buys three things: (1) the right to use the car, 
(2) a full tank of gasoline, and (3) the right to claim certain 
rewards from the owner. 

The right to use the car would be valuable for a lot of 
us who want an alternative less expensive than the local car 
dealer but less underhanded than stealing. 

Notice that I recommend that you borrow Mr. Van Zandt’s 
car, not mine. If very many people follow his suggestions with 
my software, I will not be able to afford to maintain my car 
in operable condition, much less fill it with gasoline. And just 
as Mr. Van Zandt is not likely to spend very much of his 
money (the fruits of his labors) on buying cars for others to 
borrow, so I and others in the software business are unlikely to 
spend much labor on making software for others to copy. 

Yes, I do have a better Idea: when a good program hits 
the market (your local computer store or the mail order ads), 
buy it. The author has already decided how much he needs 
to make on each copy to recover his investment. But if he 
sells more than he anticipated, he will be strongly motivated 
to write more (and hopefully better) software. 

It is my opinion that not only is Mr. Van Zandt’s suggestion 
economically unviable, but to suggest it is irresponsible. Such 
suggestions can only encourage good programmers like Bill 
Gates to withhold their products from hobbyists altogether. 
Let us rather encourage programmers to offer low-priced 
software by enlarging their market. 

Tom Pittman 



Number 25 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 3 


197 



PROGRAMMING LANGUAGE 
TRANSLATION TECHNIQUES 


BY WILLIAM M. McKEEMAN - 

Department of Information Science 
U C Santa Cruz 
Santa Cruz, CA 95064 

The problem of writing a programming language translator 
consists of setting the design objective, selecting the tech¬ 
niques to be used, assembling the tools, carrying out the imple¬ 
mentation, and finally “proving” the result. Properly done, the 
result is an understandable program that can be easily changed, 
is relatively machine independent, and is free of features 
annoying to its eventual users. In practice this is a big, but 
achievable order. 

In the following pages the reader will find illustrations of 
various principles, techniques and tools useful to the translator 
writer. The presentation is tutorial, suppressing some impor¬ 
tant details in the cause of brevity. Further information, 
including a comprehensive list of references, can be found in 
Gries [71] and McClure [72]. 

Some important attributes of a translator are listed in 
Table 1.1. Much of the initial planning of an implementation 
is concerned with choosing among them. The contents of the 
table are too much to assimilate all at once, thus the initial 
sections of this paper present two translators, illustrating two 
recognition algorithms and a simple code generation scheme. 
The paper then proceeds to elaborate upon the theme, work¬ 
ing up to an organization subsuming most practical translators. 

Table 1.1 

Translator Attributes 

The compiler is written in: 

(a) assembly language, or 

(bl systems programming language, or 

(cl general purpose language. 

The recognition algorithm is: 

(a) table-driven, bottom up, or 

(b) recursive, top-down. 

There are simplifications and optimizations on the: 

(a) token string, and/or 

(b) computation tree, and/or 

(c) language-directed code, and/or 

(d) machine code. 

The main measures of efficiency are: 

(a) overall size of the translator, and 

(b) minimum memory in which the translator can be run, and 
(cl translator speed, and 

(d) ease of writing, and 

(e) ease of changing the translator, and 

(f) speed of generated code, and 

(g) density of generated code. 


The mutually self-describing grammars in Table 1.2 illus¬ 
trate a grammatical notation combining the familiar context- 
free constructs with regular expression operators. Quoting the 
literals [Rohl 67] allows grammatical description down to the 
character level if desired. The classes LETTER and CHARAC¬ 
TER must be extended to reflect the actual available charac¬ 
ter sets. 


Table 1.2 

Mutually Self-describing Grammars 

GOAL = TOKEN _LIST; 

TOKEN_LIST = | TLI | TLN 1 TLL | TLS; 

TLI-( | TLN | TLL | TLS) IDENTIFIER; 

TLN = (TLI | TLL | TLS) NUMBER; 

TLL=(TLI | TLN | TLS) LITERAL; 
TLS=TOKEN_LIST SEPARATOR; 

IDENTIFIER 12 LETTER+ ; 

LETTER = 'A' | 'B' \ 'C' | *D' | 'E' | 'F' | 'G' | 'H' | T 
| 'J' | 'K' | 'L' | 'M' I 'N' | 'O' | 'P' | 'Q' | 'R' 

| 'S' | T' | 'U' | -V’ | 'W' | 'X' | 'Y' | 'Z' | ; 

NUMBER-DIG IT+: 

DIGIT = ‘0' | '1' | *2' | '3' | '4' | '5' | '6' 1 '7' | '8' | '9' ; 
LITERAL-'"' CHARACTER + 

CHARACTER-LETTER | DIGIT | SEPARATOR |. 

SEPARATOR- '-' |';' | T| ||'(' |')' |' 

GOAL-RULE +; 

RULE-IDENTIFIER ' = ' FORM ';'; 
FORM-DEFINITION ( *|' DEFINITION) *; 
DEFINITION-CLASS ('-'CLASS)*; 
CLASS=(PRIMARY (I '*' |'+' | NUMBER ))*; 
PRIMARY-IDENTIFIER | LITERAL | '(' FORM ')'; 


Page 4 

198 


Dr. Dobb's Journal of Computer Calisthenics 8t Orthodontia, Box E, Menlo Park, CA 94025 


Number 25 









The first grammar (a lexical grammar) describes both 
grammars as strings of symbols where the actual detail of the 
internal structure of the symbols and separators is given. 
Because two identifiers together look like one, a TLI (token 
list followed by an identifier) may never be followed by 
another identifier. Similar comments apply to quoted items 
and numeric items. The second grammar (a grammar-grammar) 
describes both grammars as sequences of rules where the 
symbol (‘ I ’) separates alternatives. Within a definition we may 
take the difference between two phrase classes (‘—’) or repeat 
them (**’. *+’. INTEGER). We will use this notation exten¬ 
sively in the following pages. 

A translator accepts a source text convenient for program¬ 
ming and transforms it into a target code suitable for execut¬ 
ing. To understand the translation process, one must first have 
a good grasp of the meaning of a source text and a target code. 
For example, the source text 
A = — A+5* B/(B —1); 

might be translated in the following zero-address target code: 

LIT A; 

LIT A; 

LOAD; 

NEG; 

LIT 5; 

LIT B; 

LOAD; 

MUL; 

LIT B; 

LOAD; 

LIT 1; 

NEG; 

ADD; 

DIV; 

ADD; 

STORE; 

Table 1.5 

Table 1.3 is a grammar for assignment statements. Given 
that the variables must contain integers, such statements have 
well defined meanings. We presume that the reader is familiar 
enough with Algol or PL/1 to be able to follow such examples 
as well as simple programs. 

Table 1.3 

A S' ;:rce Language Grammar 

ASSIGNMENT = VARIABLE ' = ’ EXPRESSION ; 

EXPRESSION = C!'-')TERM ( f ' + ' | 1 - ’)T1-RM) * ; 

TERM = PRIMARY (('*'|'/') PRIMARY)* ; 

PRIMARY = CONSTANT j VARIA3I.E | '(' EXPRESSION ; 
VARIABLE = IDENTIFIER ; 


Note: CONSTANT and IDENTIFIER are processed in the scanner, 
making their definition here irrelevant. 


Table 1.4 is a grammar for the zero-address target code in 
the example above. Even though the meaning of the target 
code is probably obvious to our readers, we will use a few 
words to describe it. 

There is an evaluation stack into which values can be 
pushed. Furthermore, the top values (hence the last ones 
pushed into the stack) are available to be used in computa¬ 
tions. The LIT instruction pushes one value onto the stack. 
The value is either an address (e.g., the address of the variable 
A in LIT A) or a constant (e.g., the value 5 in LIT 5). The 
LOAD instruction assumes the top value on the stack is an 
address. The address is removed from the stack and the value 
found in the indicated cell in memory is pushed onto the stack 
in its place. The STORE instuction must be supplied with two 
items at the stack top. One is the address of a cell in memory. 
The other is a value to be stored into the indicated cell (the 
address is below the value in the stack). After the instruction 
has completed its action, both address and value are removed 
from the stack. The remainder of the instructions are arith¬ 
metic operations. NEG changes the sign of the top value on 
the stack and leaves it where it found it. ADD, MUL and DIV 
operate on the two top elements on the stack, removing them 
and then placing the result back on the stack. 

For both the top-down and bottom-up translators, the 
example above will be worked in detail. 

The step-by-step execution of the example zero-address 
target code is depicted in Figure 1.1. 


Table 1.4 

A Target Language Grammar 
ASSIGNMENT = VARIABLE EXPRESSION 'STORE' ; 

EXPRESSION = 'LIT' CONSTANT | VARIABLE 'LOAD' 

| EXPRESSION 'NEG' 

| EXPRESSION EXPRESSION ('ADD'|'MUL' | ' DIV') ; 
VARIABLE = 'LIT' IDENTIFIER ; 

Note: Both IDENTIFIER and CONSTANT are represented by bit 
patterns in the machine code. The first is to be interpreted as the 
address of the variable and the second as the value of the corresponding 
constant in the source language. 


Successive stack configurations during execution of the code in Table 1.5. 


Note: M(A) = 7, M(B) = 6. 


ill ill HI II 11 


LIT A LIT A LOAD NEG LIT 5 LIT I 


1 -1 

6 B 6 6 6 5 

5 30 30 30 , 30 30 30 

[ij HI 11 11 HI 111 111 

LOAD MUL LIT B LOAD LIT 1 NEG ADD 


ill 11 U 

DIV ADD STORE 


Number 25 


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


Page 5 

199 




2. A Top-down Translator 

The recursive recognition technique is one of those ideas 
that is so simple that nobody ever bothers to write much 
about it. It is, however, often the easiest method of writing 
good translators. The prerequisites are a syntactic definition of 
the source language (which then becomes the translator writ¬ 
er’s flow chart) and a recursive language in which to write 
(e.g., assembler, PL/360, Algol and PL/1 but not Fortran or 
XPL). A partial narration of the program carrying out the 
translation depicted in Table 1.5 follows. Refer to Figure 2.1 
and Table 2.1. 

Initially (line 85), token is undefined and is then set to 
‘A’ by the first call of scan (line 87). Then assignment is called, 
immediately calls variable (line 16) which checks to make sure 
an identifier has been found (line 77) (notice that we hid this 
decision inside the undefined function identifier to avoid 
unnecessary detail). Since ‘A’ is an identifier, the test is passed 
and the pair ‘LIT’ ‘A’ is emitted, and ‘A’ is discarded by a 
second call of scan (line 81), leaving *=’ in token. Returning 
from variable to assignment (line 16) the *=’ is noted, then 
discarded and replaced by the next token The right-hand 
side of the assignment is then processed with a call to expres¬ 
sion. Table 2.1 gives a complete summary of the remaining 
actions; the reader is encouraged to complete the simulation 
of the recursive translator. 

The success of the recursive technique is due to several 
circumstances. First, the mapping from a syntactic descrip¬ 
tion to a recognizer (Table 1.3 to Figure 2.1) is so simple that 
an experienced programmer can do it as fast as he can write, 
although Frank DeRemer points out that the simplicity rapidly 
disappears if good diagnostics and error recovery are required. 
Second, the programmer can insert his generator code between 
any two statements of the recognizer. This implies that when¬ 
ever any structure entity of the source language has been 
recognized, the programmer has a convenient opportunity to 
attach an interpretation to it. Third, because the local variables 
of recursive procedures are in fact in a run-time stack, the pro¬ 
grammer may associate temporary information with any 
source language construct (see the variables t in procedures 
expression and term, lines 24 to 42) without laboriously build¬ 
ing stack data structures in his translator. One must reflect on 
the pervasive nature of stacks in translators to appreciate the 
value of getting them for “free”. Perhaps the most important 
advantage of the recursive technique, aside from its simplicity, 
is the fact that it can handle complex languages without catas¬ 
trophic costs in size or speed. 

The recursive technique is of no particular help beyond the 
production of a language-directed code (e.g., zero-address 
code for assignments). Since the great bulk of the work in 
writing a compiler for the average modern computer comes in 
turning the language-directed code into good machine 
language, the helpful properties detailed above can look rather 
irrelevant to a hard-pressed implementor. 

In addition to the need for a recursive language in which to 
write, the recursive technique has one serious disadvantage. 
The generator and parser are thoroughly mixed together, pre¬ 
venting the programmer from treating them separately for pur¬ 
poses of documentation, maintenance, memory management, 
testing, and so forth. In particular, it is hot unusual to find 
target code dependencies in the source language recognizer, 
which prevent the recognizer from being machine independent. 

Figure 2.1 

A Simple Recursive Translator for Assignments into Zero-address Code 

1 translate: 

2 procedure; 

3 /* scan and emit are left undefined in this 


4 example to avoid irrelevant detail */ 

5 scan: 

6 procedure returns (character varying); 

7 /* produces the next token each time called *, 

8 end scan; 

9 declare token character varying; 

10 emit: 

11 procedure (op character varying); 

12 /* assembles zero-address code */ 

13 end emit; 

14 assignment: 

15 procedure; 

16 call variable; 

17 if token = '=' then token = scan; 

18 else call error; 

19 call expression; 

20 call emit ('STORE'); 

21 end assignment; 

22 expression: 

23 procedure; 

24 declare t character (1); 

25 /* check for unary minus */ 

26 if token = '-' then 

27 do; 

28 token = scan; 

29 call term; 

30 call emit ('NEG'); 

31 end; 

32 else call term; 

33 do while token = '-’ I token = '+'; 

34 t=token;token =scan; 

35 call term; 

36 if t = '-' then call emit ('NEG') ; 

37 call emit ('ADD'); 

38 end; 

39 end expression; 

40 term: 

41 procedure; 

42 declare t character (1) ; 

43 call primary; 

44 do while token = '*' I token = 7'; 

45 t = token;token = scan; 

46 call primary; 

47 if t = '*'then call emit ('MUL'); 

48 else call emit ('DIV'); 

49 end; 

50 end term; 

51 primary: 

52 procedure; 

53 /* check for a constant */ 

54 if constant (token) then 

55 do; 

56 call emit ('LIT') ; 

57 call emit (token) ; 

58 token = scan; 

59 end; 

60 /* check for parenthesized expression */ 

61 else if token = '(' then 

62 do; 

63 token - scan; 

64 call expression; 

65 if token = ')' then token = scan; 

66 else call error; 

67 end; 

68 /* assume that it is a variable */ 

69 else 

70 do; 

71 call variable; 

72 call emit ('LOAD'); 


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

200 


Number 25 



73 end; 

74 end primary; 

75 variable: 

76 procedure; 

77 if identifier (token) then 

78 do; 

79 call emit ('LIT'); 

80 call emit (token); 

81 token = scan; 

82 end; 

83 else call error; 

84 end varaible; 

85 /* main body of translator */ 

86 /* get initial token value */ 

87 token = scan; 

88 call assignment; 

89 end translate; 


44 

45 

46 
54 
61 

71 
77 
80 

81 

72 

47 


* B/(B-1) 

B /(B-1) 


B /(B-1) 

/ (B-1) 

/ (B-1) 

/ (B-1) 


LIT B 

LOAD 

MUL 


Table 2.1 

Summary of the Actions of the Top-down Translator 


Active line 
in the 
top-down 
recognizer 

start 

87 

88 
16 
77 
80 

81 

17 

19 

26 

28 

43 

54 

61 

69 

71 

77 

80 


Value 

of 

token 


undefined 

A 


Source text 
remaining 


A= -A + 5*B/(B-1) 
= -A+5* B/(B-1) 

= -A+5* B/(B-1) 
-A + 5*B/(B-1) 

A + 5* B/(B-1) 

+5* B/(B-1) 


Target code 
produced 


LIT A 


44 

45 

46 
54 
61 

63 

64 
26 

32 

43 
54 
61 

71 
77 
80 

81 

72 

44 

33 

34 

35 
43 
54 

57 

58 


B-1) 


- 1 ) 


- 1 ) 

1 ) 

1 ) 


LIT B 


LOAD 


LIT 1 



A 

+5 *B/ (B-1) 

LIT A 

44 


81 

+ 

5* B/(B-1) 

LOAD 

36 

) 

NEG 

72 

+ 

5*B/(B-1) 


37 

) 

ADD 

44 




33 


30 




65 



+ 

5* B/IB-1) 

NEG 

47 


33 




48 


34 

5 

* B/(B -1) 


44 

DIV 

35 




36 


43 




37 


54 





ADD 

57 




33 



5 

*B/(B-1) 

LIT 5 

20 



58 


STORE 


89 


Number 25 


Dr. Oobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Page 7 

201 


3. A Bottom-Up Translator 

The actions of a bottom-up translator separate into the 
actions that produce the canonical parse and those which the 
synthesizer takes when acting on the canonical parse. Because 
the canonical parse is most easily understood in relation to a 
context-free grammar, Table 3.1 is substituted for Table 1.3 
without changing the source language. The procedure synthe¬ 
size (Figure 3.1, line 47), called with the sequence of rule 
numbers in the left-hand column of Table 3.2, will produce 
the sequential language-directed code in the right-hand 
column of Table 3.2. 

The remainder of Figure 3.1 is a source language indepen¬ 
dent parsing algorithm driven by the mixed LR(0), LR(1) 
recognition tables in Table 3.3. The tables are interrogated in 
parse (line 100) where state_type is set to the values 0 
through 3 corresponding to the tabulated entries blank, S, SR 
and R which in turn stand for syntax error, stack the present 
state and apply rule N, and apply rule N. 

Table 3.1 

Context-free Grammar for the Assignment Source Language 
rule number rule 

1 ASSIGNMENT=VARIABLE '=' EXPRESSION ; 

2 EXPRESSION=TERM 

3 | TERM 

4 | EXPRESSION ' + ' TERM 

5 | EXPRESSION'-'TERM; 

6 TERM = PRIMARY 

7 | TERM ""PRIMARY 

8 | TERM 7'PRIMARY; 

9 PRIMARY=CONSTANT 

10 | VARIABLE 

11 I'C EXPRESSION ')’ ; 

12 VARIABLE = IDENTIFIER; 

Figure 3.1 

A Bottom-up Translator 

1 translate: 

2 procedure; 

3 /* auxiliary procedures V 

4 /* token handlers */ 

5 scan: 

6 procedure returns (character varying); 

7 /* produces next token each time it is called */ 

8 end scan; 

9 /* global residence of the current token */ 

10 declare token character varying; 

11 unscan: 

12 procedurels character varying); 

13 /* reverses the effect of scan */ 

14 end unscan; 

15 /* stack handlers */ 

16 /* global residence of last token stacked or uncovered */ 

17 declare top _of —token —Stack character varying; 

18 /* global residence of last state stacked or uncovered */ 

19 declare top_of—state-stack fixed; 

20 push: 

21 procedurels fixed, t character varying); 

22 /* push s onto the state stack and t onto the 

23 token stack, s and t are resident in 

24 top_of—state—stack and top_of_token —stack */ 

25 end push; 

26 pop: 

27 procedure!n fixed); 

28 /* discards n items from each stack, placing 

29 newly uncovered values in top—variables */ 

Page 8 

202 


30 end pop; 

31 /* LR table access */ 

32 table: 

33 procedurels fixed, t character varying) 

34 returnsla fixed, n fixed); 

35 /* two-valued procedure returning values found; 

36 in Table 3.3 */ 

37 end table; 

38 left_part: 

39 procedurelp fixed) returnslt character varying); 

40 /* t is the left part of rule p in Jable 3.1 */ 

41 end left—part; 

42 length: 

43 procedurelp fixed) returnslk fixed); 

44 /* k is the number of items on the right side 

45 of rule p in Table 3.1 */ 

46 end length; 

47 synthesize: 

48 procedurelp fixed); 

49 emit: 

50 procedurelop character varying); 

51 /* assembles one item of zero-address code */ 

52 end emit; 

53 /* switch on rule number */ 

54 do case p; 

55 /* no rule number zero */ 

56 

57 /* ASSIGNMENT- VARIABLE '=' EXPRESSION 'J.' •/ 

58 do; 

59 call emit('STORE') ; 

60 return from translate; 

61 end; 

62 /« EXPRESSION = TERM */ 

63 

64 /* EXPRESSION = '-'TERM */ 

65 call emit('NEG'); 

66 /* EXPRESSION" EXPRESSION '+’ TERM */ 

67 call emit('ADD'); 

68 /* EXPRESSION EXPRESSION '-' TERM */ 

69 do; 

70 call emit('NEG'); 

71 call emit('ADD'); 

72 end; 

73 /* TERM = PRIMARY */ 

74 ; 

75 /* TERM = TERM '+' PRIMARY */ 

76 call emit('MUL') ; 

77 /* TERM = TERM T PRIMARY */ 

78 call emit('DIV') ; 

79 /* PRIMARY = CONSTANT */ 

80 do; 

81 call emit('LIT'); 

82 call emitltop—of—token—stack); 

83 end; 

84 /* PRIMARY = VARIABLE */ 

85 call emit('LOAD'); 

86 /* PRIMARY = '(' EXPRESSION ')' */ 

87 

89 do; 

90 call emit!'LIT') ; 

91 call emit (top_of—token—stack); 

92 end; 

93 end; 

94 end synthesize; 

95 parse: 

96 procedure; 

97 declare (state—type, N) fixed; 

98 do forever; 

99 /• get the values from Table 3.3 */ 

Number 25 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 



100 

state-type, N = table!top_of_state_stack, token); 

118 

call synthesize(N); 

101 

do case state—type; 

119 

call pop(length(N)); 

102 

/* syntax error */ 

120 

call unscan(token) ; 

103 

call error; 

121 

token = left—part(n); 

104 

/* stack */ 

122 

end; 

105 

do; 

123 

end; 

106 

call pushln, token); 

124 

end; 

107 

token = scan; 

125 

end parse; 

108 

end; 

126 

/* main body of translate */ 

109 

/* stack and reduce, LR(O) case */ 

127 

/* initialize read-only syntax tables */ 

110 

do; 

128 

call initialize—tables; 

111 

call push(0, token); 

129 

/* initialize the stacks */ 

112 

call synthesize(N); 

130 

call push(1,' '); 

113 

call popOength(N)); 

131 

/* read the first token of the source text */ 

114 

token = left—part(N); 

132 

token = scan; 

115 

end; 

133 

call parse; 

116 

/* reduce, LR(1) case */ 

134 

end translate; 

117 

do; 




Table 3.2 

Association of the Canonical Parse and Code Generation 


rule applied emitted code 

partially parsed text 
A=-A+5*B/(B-1)| 

12 VARIABLE=IDENTIFIER LIT A 

VARIABLE “-A+5* B/ (B—1) 

12 VAR I ABLE “IDENTIFIER LIT A 

VARIABLE = -VARIABLE+5*B/(B-lU 

10 PRIMARY “VARIABLE LOAD 

VARIABLE “-PRIMARY+5* B/(B-1) 

6 TERM “PRIMARY 

VARIABLE “-TERM +5* B/<B-1) J_ 

3 EXPRESSION “-TERM NEG 

VARIABLE “EXPRESSION+5 *B/<B—1) 

9 PRIMARY “CONSTANT LIT 5 

VARIABLE “EXPRESSION +PRIMARY * B/(B-1) J_ 

6 TERM “PRIMARY 

VARIABLE = EXPRESSION + TERM* B/IB-1) J_ 

12 VARIABLE “IDENTIFIER LIT B 

VAR IABLE = EXPR ESSION +TERM* VARIABLE/(B-1(J_ 

10 PRIMARY “VAR I ABLE LOAD 

VARIABLE = EXPRESSION+TERM*PRIMARY/ (B-1) J_ 

7 TERM “TERM‘PRIMARY MUL 

VARIABLE = EXPRESSION + TERM/ (B-1)| 

12 VARIABLE “IDENTIFIER LIT B 

VARIABLE = EXPRESSION + TERM/ (VARIABLE-1) J_ 

10 PRIMARY “VARIABLE LOAD 


VARIABLE = EXPRESSION + TERM/ (PRIMARY-1) 

6 TERM “PRIMARY 

VARIABLE“EXPRESSION+TERM/ (TERM-lH 
2 EXPRESSION “TERM 

VARIABLE “EXPRESSION+TERM/ (EXPRESSION-lH 
9 PRIMARY “CONSTANT LIT 1 

VARIABLE “EXPRESSION + TERM/ (EXPRESSION-PRIMARY)]^ 

6 TERM“PRIMARY 

VARIABLE “EXPRESSION+TERM/ (EXPRESSION-TERM) J_ 

5 EXPRESSION “EXPRESSION-TERM NEG ADD 

VAR I ABLE “EXPRESSION+TERM/ (EXPRESSION) | 

11 PRIMARY = (EXPRESSION) 

VAR I ABLE “EXPRESSION + TERM/ PRIMARY 
8 TERM “TERM/PRIMARY DIV 

VARIABLE = EXPRESSION+TERM| 

4 EXPRESSION “EXPRESSION + TERM ADD 

VARIABLE = EXPRESSION| 

1 ASSIGNMENT “VAR I ABLE “EXPRESSION]^ STORE 

ASSIGNMENT 


Number 25 


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


Page 9 

203 


Translation starts on line 126 where the syntax tables are 
initialized, the initial state is stacked and the initial value of 
token is scanned. The recognizer is called and the loop on line 
98 is entered. The variables state_type and N are assigned the 
values 2 (i.e., entry SR) and 12 (the intersection of row 
IDENTIFIER and column 1 of Table 3.3). The case statement 
selects the stack-and-reduce case (line 109) where a dummy- 
state (0) and the identifier ‘A’ are stacked. Synthesize is called 
with parameter 12 (line 112) (line 54) selects the last case (line 
88) causing ‘LIT’ ‘A’ to be emitted. Returning to the parser 
(line 113) one item is popped off each stack, leaving the initial 
state (1) exposed. Token is set to VARIABLE. Execution 
continutes on line 100 where state-type and N assume new 
values 1 and 15, respectively. 

There are programs that produce syntax tables similar to 
Table 3.3 from input similar to Tables 3.1 or 1.3. How it is 
done is an interesting subject but of no direct concern to the 
translator implementor who need only write the procedure 
synthesize. There are, however, fewer opportunities to attach 
interpretations to the parsing actions since synthesize is called 
only from SR and R decision and not S decision. And, except 
for the state and token stack, the programmer must build his 
own data structures. 


Tabic 3.3 

Syntax Tables for Mixed l.R(O) and LR(1) Parsing Algorithm 


state 

12345 6 789 10_11_12 13 14 15 


SR R R R R 

1 2 3 4 5 


S S S S S S S 
C 3 3 3 3 3 3 3 


SR R R R R 

) . 

s 

= ... 2 

S S R R R R 

♦ ..4_4_2_3_4_5_ 

S S SSRRRR 

55 662345 


S S S S 
7 7 7 7 


S S S S 

/ 8 8 8 8 


ASSIGNMENT 

EXPRESSION 


S S 

9 10 


S S S S S 

TERM 

11 11 13 12 14 


SR SR SR SR SR SR SR 

PRIMARY 

6 6 6 6 6 7 8 


SR SR SR SR SR SR SR 

CONSTANT 

9 9 9 9 9 9 9 


S SR SR SR SR SR SR SR 

VARIABLE 

IS 10 10 10 10 10 10 10 


SR SR SR SR SR SR SR SR 

IDENTIFIER 1 

12 12 12 12 12 12 12 12 


Tabic 3.3 is equivalent to LALR(l) parsing tables [UcRcmcr b9] 


4. An Elaborate Compiler 

A compiler accepts source text records and produces 
records full of machine code ready for execution. During the 
process the program may assume several intermediate forms, 
including: 

records 

string of characters 

string of tokens 

phrase-structure tree 

computation tree 

language -specific sequential code 

machine-specific sequential code 

records 

The design of a translator depends heavily on which of the 
above forms are to be used. Generally speaking, the more com¬ 
plex the source text, the higher the payoff in making the com¬ 
piler more elaborate. Once the sequence of intermediate forms 
has been chosen, getting from one form to another represents 
the major implementation problem. Performing transforma¬ 
tions on the intermediate forms to simplify the remaining 
tasks or improve the quality of the resulting machine code 
may be a subsidiary task. The overall data flow for an 
elaborate compiler is given in Figure 4.1. The remainder of this 
article is devoted to explaining the meaning of the various 
algorithms and data structures depicted in the figure. 

5. Transformation on the Token String 

The problem of translating a very complex language (e.g., 
the IBM PL/1) can be simplified by passing repeatedly over 
the token string, each time producing an equivalent token 
string with fewer primitive concepts. The final set of primitives 
is usually taken to include GOTO, IF, assignments and other 
things that map directly onto a conventional instruction set. 

Table 5.1 displays three successive equivalence transforma¬ 
tions on a PL/1 program. Initially there is an array assignment 
which implies a loop (stage 2). The translator has had to create 
some new identifiers which are started with *$’ to avoid con¬ 
fusion. The control expressions of the do-loop are evaluated 
only once implying that the head of the loop contains only 
simple variables (stage 3). The loop itself can then be factored 
into IF and GOTO constructs (stage 4). The advantages are the 
already mentioned reduction in overall translator complexity 
and also the fragmentation of the translator to aid in making 
each piece small enough to permit running in a small memory. 
It has some utility in documenting the meaning of language 
constructs where the transformations are simple enough to be 
easily understood. 

The technique has some disadvantages. It can be slow since 
repeated passes over the token string are required. Clever 
methods of speeding things up may cancel the gain in simpli¬ 
city that led to its use in the first place. There is also a lack of 
theory governing the transformations, leaving a potentially 
confusing series of ad-hoc algorithms. Finally, the transforma¬ 
tions may obscure relations that would have been useful to the 
generators. For instance, the fact that the example in Table 5.1 
can be accomplished with a single memory to memory block 
transfer instruction will never be recovered from the Simpli¬ 
fied” form at stage 4. 


Page 10 

204 


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


Number 25 


















records 


character string 


token string 


simplified 
token string 

phrase- 
structure tree 


simplified 
computation tree 

language-specific 
sequential code 


optimized 
language-specific 
sequential code 

machine specific 
sequential code 

optimized 
machine code 

records 


source text 

_ 1 _ 


input record handler 






phases 


-M. 


parser 




phases 


generator 


phases 


emitter 


phases 




output record handler 


executable program 


translator control information 
program listing 

lexical error messages 
string table 


equivalence transformations 
on the token string 


syntax error messages 
symbol table 

undefined symbol messages 

equivalence transformations 
on the tree 


semantic error messages 


equivalence transformations 
on the language-specific code 


equivalence transformations 
on the machine code 


assembly listing 


Figure 4.1 

An Elaborate Compiler 


DECLARE (A, B) (20) FIXED; 

A=B; 

DECLARE (A, B) (20) FIXED; 
DECLARE SI1 FIXED; 

DO $11 = LBOUND(A) TO HBOUND(A); 

A($I1) = B($I1); 

END; 

DECLARE'(A,B"J (20) FIXED; 
DECLARE ($11. $12. $13. $14) FIXED; 
$l2 = LBOUND(A); 

$13=1 

$l4=HBOUND(A); 

DO $11 =$12 BY $13 TO $14; 

A($I1) = B($I1); 

END; 

DECLARE _ (A, B) (20) FIXED; 
DECLARE ($11. $12, $13, $14) FIXED; 
$12 = LBOUND(A); 

$13=1; 

$l4=HBOUND(A); 

$11 =$ 12 ; 


1 = 1 ; 

DO FOREVER; 

IF I > HBOUND(A, 1) THEN RETURN; 
A(I, J) = B(I, J) + (I + 1) *3/J; 

1 = 1 + 1 ; 

END 


Figure 6.1 
A Source Text 


$15 = IF $11 > $12 THEN GO TO $16; 
A($I1) = B($I1); 

$I1=$I1 + 1; 

GO TO $15; 

$16: 


Table 5.1 

Successive Transformations of a PL/I Program Fragment 


Number 25 


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


Page 11 

205 


















Figure 6.2 

Phrase-structure Tree for Text in Figure 6.1 


STATEMENT LIST 


GROUP 

T 

GROUP HEAD STATEMENT LIST ENDING 


STATEMENT' STATEMENT 

A 

ASSIGNMENT ; 

VARIABLE = EXPRESSION 

/ / 

^ID ^TERM DCT FOREVER ; STATEMENT STATEMENT ST^fEMENT END 

I PRIMARY IF CLAUSE STATEMENT ASSIGNMENT'; ASSIGNMENT'; 

A /\ /A 

^CONSTANT IF CONDITION THEN RETURN ;yy \ VARIABLE = ^EXPRESSION 

1 EXPRESS iSN^EX^RESS ION VARIABLE = EXPRESSION ID EXPRESSION^TERM 

/ / ' 

TERM TERM IDT ( SUBSCRIPTS ) 

PRIMARY PRIMARY A EXPRESSION , EXPRESSION 

/ I \ \ 

VARIABLE FUNCTION TERM TERM 

I \ | 

ID ID ( PARAMETERS ) PRIMARY PRIMARY 


I / ^ 

I HBOUND EXPRESSION--, EXPRESSION 

/ / 

TERM TERM 

/ / 

PRIMARY PRIMARY 

/ / 

VARIABLE CONSTANT 

/ / 


I 


VARIABLE 



TERM 

PRIMARY 

I 

VARIABLE 


PRIMARY 

I 

CONSTANT 

I 

1 


ID 

I 

I 


ID 

/ 


VARIABLE EXPRESSION + TERM 

/ I / 

ID ID TERM TERM / PRIMARY 

I i / \ 

I J PRIMARY TERM * PRIMARY VARIABLE 

/ / \ \ 

VAR IAB LE ^PRIMARY^CONSTANT ID 

ID ( SUBSCRIPTS ) ( EXPRESSION ) 3 J 


/ 

B EXPRESSION', EXPRESSION EXPRESSION + TERM 


/ 

TERM 

/ 

PRIMARY 

/ 

VARIABLE 

/ 

ID 


I 


TERM 

! 

PRIMARY 

I 

VARIABLE 

I 

ID 

I 

J 



\ 


PRIMARY 

\ 

CONSTANT 

\ 

1 


Page 12 
206 


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


Number 25 




6. Transformation on the Computation Tree 


Figure 6.3 


For a given program (Figure 6.1) the recognizer can auto¬ 
matically compute the phrase-Structure tree (Figure 6.2), Computation Tree from Figure 6.2 

which can then be reduced to a computation tree by renaming 



that call for no operation. The computation tree (Figure 
6.3) then constitutes a data structure with an interpretation 
that is invariant under certain transformations. Both reducing 
the number of primitives (simplification) and improving the 
code efficiency (optimization) are useful goals. In the 
example, the concepts of pre-evaluating constant 
subexpressions and linearizing integer multiplication are 
illustrated. The reader should be aware that there are many 
other useful transformations. Frank DeRemer calls the tree 
in Figure 6.3 the abstract syntax tree. The transformation 
from phase-structure tree to abstract syntax tree can be 
formalized to the point of allowing the compiler writer to 
specify it in tabular form, thus avoiding the rather messy 
task of manipulating the tree directly. 

The loop has an induction variable (I) which is stepped 
by a constant amount (1). This fact, discovered by examina¬ 
tion of the computation tree, allows multiplication by a 
constant (or unchanging variable) to be turned into addition. 
The generally slower execution time of multiplication together 
with common subscript algorithms which imply a fixed-point 
multiplication means that there is considerable to be gained. 
Figures 6.4 through 6.13 depict subsequent stages of the 
computation tree as the various phases of the transformations 
are carried out. Each figure should be compared with an earlier 
figure (usually Figure 6.3) to get a before/after view of the 
transformation being illustrated. 

In Figure 6.4, the array A, having declared elsewhere to 
have an upper bound of 8, yields a constant for the function 
HBOUND. In Figure 6.5, the double subscripts are turned 
into simple single subscripts with polynomial values. The 
multiplication of an induction variable is linearized by creating 
a new induction variable ($12) which is stepped by the multi¬ 
plier (Figure 6.7). Then addition of constants are twice pushed 
off onto the new induction variable (Figures 6.8 and 6.9). 
Then the use of the variable I directly after it has been set to 
a constant value allows some pre-evaluation (Figure 6.10). 
Finally, the remaining multiplication by a constant is pushed 
out to the leaves of the computation tree (Figure 6.11) so that 
it too can be linearized (Figure 6.12). The resulting tree is 
displayed in Figure 6.13. 

Tree transformations consume more computational 
Resources than most other phases of translation both because 
the tree occupies a lot of memory and also following the 
link takes a lot of time. Thus the implementor must be careful 
in deciding which transformations are economically justified. 
Tree transformations are easier to carry out when the source 
language does not include a GO TO construct to break up 
sequences of code, thereby making difficult the detection 
of induction variables and the like. 


B I J 


J 


ADD 3 

/\ 

I 1 


Figure 6.4 


Pre-evaluating Constant Subexpressions 

/ 


GT 



I 8 


Figure 6.5 

Replacing Double Subscripts with a Single Polynomial 



Sl|B^ J 
MUL 8 

A 

t 8 



Figure 6.6 


Combining Common Subexpressions 



Number 25 


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


Page 13 

207 



Figure 6.7 

Linearizing an Integer Multiplication 


PEAT 


Figure 6.10 

Pre-evaluating Constant Subexpressions 



STORE 


SEQ 


IF STORE STORE STORE STORE 



SJQ 


REPEAT 






STORE 

r\ 

$11 ADD 
0 J 


ST£RE 
$11 J 



Figure 6.8 

Removing Linear Terms from a Loop 


Figure 6.11 

Pre-multiplying by a Constant 


DlV 

/\ 

A^D J 



MUL 3 

A 

I 3 


IF STORE STORE STORE STORE 

/\ 

$11 ADD 

/\ 

$12 J 


SEQ 


STORE STORE 

A /\ 

$12 ADD 

/X 

^UB J 
MUL 8 
I 8 



-42- 


Figure 6.12 

Linearizing an Integer Multiplication 



Figure 6.9 

Combining Variables with a Common Value 


Figure 6.13 

Computation Tree After Simplification and Optimization 



STORE' STORE 

A N 

ii $n j 


REPEAT 


and delete STORE 

$U / ^Al2 



IF STORE STORE 

A\ A /\ /\ 

GT RETURN SUBS ADD I ADD $11 ADD 

A A T\ A 

I 8 A $11 SUBS DIV I 1 

N W 

B $11 $13 J 


STORE 

/\ 

$13 ADD 

l\ /\ 

$11 8 $13 3 


Page 14 

208 


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


Number 25 






7. Transformations on Lanuguage-Specific 

Sequential Code 

The computation tree yields the language-specific sequential 
code partly by resort to zero-address code (a left-to-right 
sweep of the tree) and partly by insertion of transfer 
instructions where implied by the tree (IF, THEN, ELSE, 
loop, procedure calls, etc.). The transfers can either be conven¬ 
tional branches or more restricted transfers corresponding to 
CASE, CALL, RETURN, REPEAT, etc. Such a code for the 
tree in Figure 6.13 is given in Figure 7.1. 

Most of the transformations that can be carried out on the 
computation tree can also be carried out on the language- 
specific sequential code [Allen 71, Cocke & Schwartz 70]. In 
addition, the branching structure itself is open to some optimi¬ 
zations (e.g. if the destination of a branch instruction is an 
unconditional branch, the first branch can be reformulated to 
go directly to its ultimate destination). 

8. Transformations on Machine Code 

The translator emits machine code by passing over the 
language-specific code with a simulated language-specific 
machine which, instead of evaluating, emits code (Table 8.1). 
Figure 8.1 displays several stages of the stack during the 
execution of such an algorithm [McKeeman et al 70]. 

Table 8.1 

Source Text and Language-specific Code 
X=X+1; If X < 3 THEN GO TO L; 

LIT X; LIT X; LOAD; LIT 1; ADD; STORE; 

LIT X; LOAD; LIT 3; LT; LIT $L1; BRANCH_FALSE; 
LIT L; BRANCH; $L1: ... 

Most computers have peculiarities that are utilized by 
assembly language programmers but are not directly available 
to the compiler, partly because the opportunities to make use 
of them do not become apparent until after the machine code 
itself has been emitted, and partly because they are special 
to the target machine in question [McKeeman 65]. Table 8.2 
shows a typical situation of this kind. At stage 1 we have a 
good machine code for the two statements. Because addition 
is commutative, the addresses of a pair, LOAD ADD, can be 
interchanged (stage 2) which permits the slow LOAD = 1 to be 
replaced with a fast load immediate LI 1 and also saves the cell 


containing the constant 1 (stage 3). In any pair, STORE X 
LOAD X, the LOAD can be dropped if it is not the destination 
of a branch (stage 4). Any pair of branches, where the first 
is a conditional skip and the second is unconditional can be 
reduced to a single conditional branch (stage 5). Finally, on 
a machine with an add-one-to-memory instruction, the 
sequence LI 1, ADD X, STORE X can be combined into one 
instruction (stage 6). 


Table 8.2 

Transformations on Machine Code 


LOAD X 
ADD =1 
STORE \ 

Stage 1 LOAD X 

LT - 5 

BRANCH 1 A! Si: $L1 
BRANCH' 1. 

$L1: 


LOAD =1 
ADD X 
STORE X 

Stage 2 LOAD X 

LT =3 

BRANCIM AI SH $L1 
BRANCH 1. 

$ LI: 


Figure 7.1 

Sequential Form of Figure 6.13 

LIT 1; LIT 1; STORE; LIT $11; LIT J; LOAD; STORE; LIT $13; 

LIT 6; STORE; LIT $14; CALL... 

$14: LIT I; LOAD; LIT 8; GT; LIT $15; BRANCM_FALSE; RETURN; 
$15: LIT A; LIT $11; LOAD; ADD; LIT B; LIT $11; LOAD; ADD; 
LOAD; LIT $13; LOAD; LIT J; LOAD; DIV; ADD; STORE; LIT I; 

LIT I; LOAD; LIT 1; ADD; STORE; LIT $11; LIT $11; LOAD; 

LIT 8; ADD; STORE; LIT $13; LIT $13; LOAD; LIT 3; ADD; STORE; 
LIT $14; REPEAT; 





Figure 

8.1 




An 

Eir.i 11 c r 

Turning Zeiv-aildress Code into S 

ingle-address 

Code 


Stack 


LlJ 

i x 1 

LlJ 

111 

1 , 

| X | 1 X 



Zcro-Addrcss 

LIT X 


LIT X 

LOAD LIT 1 

ADD 

STORE 


Single-address 




LOAD X 

ADD =1 

STORE 

X 

Stack 

Zero-address 

LIT X 

kJ 

Lid 

LOAD 

ill 

LIT 3 LT 

i 1 ,L1 

1 0 j i a 

LIT $L1" 

1 

BRANCH 

FALSE 

Single-address 



LOAD X 

LT =3 


BRANCH^ 

FALSE SL1 

Stack 

Zero-address 

LIT L 

Ll) 

u 

BRANCH 

$L1: 




Single-address 



BRANQI L 

$ Ll: 




Note: ° represents a value 

in the accumulator 





Stage 3 


Stage 4 


Stage 5 


Stage 6 


LI 1 
ADD X 
STORE X 
LOAD X 
LT =3 

BRANCIIJ-ALSE $L1 
BRANCH I. 

$L1: 


LI 1 
ADD X 
STORE X 
LT =3 

BRANCH_FAI.SE $L1 

BRANCH L 

$L1: 


LI 1 
ADD X 
STORE X 
LT =3 

BRANQI TRUE 


INDEX X 
LT =3 

BRANQI TRUE L 


Number 25 


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


Page 15 


209 









Innumerable ingenuities can be applied. Since the savings 
can be dramatic (as in the example), the technique is useful 
and popular. Nothing makes the hero-author of a compiler 
happier than producing really subtle correct code, beating 
the assembly programmer at his own game. One must, 
however, guard against introducing errors into the code as 
a result of not carefully considering the conditions under 
which the transformations leave the program invariant. 

9. Fragmentation Planes in the Translator 

There are many reasons to want to break a compiler into 
pieces. The ability to run the translator in a small memory 
is one which the computer salesman and computer purchaser 
feel is important. The problem of managing large 
programming projects has demanded a task organization 
which results in many small well-defined subtasks. Further, 
there seems to be a definite limit on how complex a task can 
be attempted without incurring exponentially growing delays 
and costs. There even seems to be a critical size beyond which 
repairing an error introduces on the average of more than one 
error. And, finally, no matter how well a system seems to 
perform, it is good engineering practice to know how well and 
under what range of conditions the system will perform. Such 
knowledge comes from understanding; understanding comes 
from not having to consider something complex all in one 
mental step. 

There are some principles that guide the choice of natural 
boundaries between program modules. A boundary is good if 
there are a few references across it into other modules and 
those references are relatively infrequently exercised. A 
boundary is good if the information flow through it can be 
simply described. A module is good if its function can be 
simply described. A data flow is good if it can be totally 
produced before any of it is consumed (meaning no feedback 
is needed across the boundary). A set of modules is good if 
execution activity can be isolated in small subsets (working 
sets) over substantial spans of time. And such a set is well- 
designed if particular dependencies are isolated in small 
subsets (e.g. target language does not appear until the very 


MIND’S EYE SOFTWARE 

News Release Received: 78 April 5 

Mind’s Eye Personal Software produces and distributes soft¬ 
ware for the personal and hobbyist computer user. Initially, 
this consists of cassette tapes for the Commodore PET Person¬ 
al Computer. 

Mind’s Eye will sell tapes either on a direct mail-order 
basis, or at a quantity discount rate for resale by other vendors. 
The direct mail price will be approximately 10% less than the 
suggested retail price for the other vendors. 

A Catalog will be available soon which will list and describe 
the programs available from Mind’s Eye. We hope, as we grow, 
to offer an extremely large variety of programs for your 
perusal. The Catalog will also contain many other things of 
interest, such as royalty policies, expected programming stan¬ 
dards, and a section of advertisements by vendors of PET 
related hardware. 

To attract a variety of programs and to assure their quality, 
royalties in the range of 10-20% of the RETAIL price of the 
software will be offered. Submitted programs will be checked 
and “editorial” suggestions made to the authors to maintain a 
high level of reliability and creativity. Authors who are willing 
to make suggested changes will receive higher royalties as a 
result. 

As this is a Personal software company, please do not hesi¬ 
tate to send programs which you feel may be of limited 


last stages in Figure 4.1). It is also of value if one module 
can be changed without involving the processing of many 
other modules. We can suppress detail by considering a subset 
of the modules as a single module where the internal data 
transactions and control transfers are ignored. The boundary 
around such a supermodule is good if the resulting module 
obeys the rules above. 

The techniques of engineering programs are being 
developed. One of them is modular programming which, 
when applied to translators, depends upon the organization 
of the translator (e.g. Table 4.1) and upon the application of 
the principles above. The time should soon come when 
translators are well-engineered as a rule, not as an exception. 


REFERENCES 

Allen, Frances E„ "A Basis for Program Optimization,” Computer 
Software, IFIP (1971), page 64. 

Cocke, J. and Schwartz J.T., "Programming Languages and their 
Compilers (preliminary notes)", Courant Institute of Mathematical 
Sciences, N.Y.U., N.Y. (April 1970). 

DeRemer, F.L., Practical Translators for LR(k) Languages, Ph.D. 
dissertation, M.l.T. (September 1969). 

Dijkstra, E.W., Notes on Structured Programming, Report 241, 
Technische, Hogeschool Eindhoven (1969). 

Gries, D., Compiler Construction for Digital Computers, John Wiley 
& Sons (1971). 

Lehman, M. & Belady, L., "Programming System Dynamics..." 
IBM Research RC3546 (September 17, 1971). 

McClure, R.M., "An Appraisal of Compiler Technology," Proc. SJCC 
(1972) page 1-9. 

McKeeman, W.M., Horning, JJ. & Wortman, D.B., A Compiler 
Generator, Prentice Hall (1970). 

McKeeman, W.M., "Peephole Optimization," Comm. ACM 8, 7 page 
443 (July 1965). 

Parnas, D.L., "Information Distribution Aspects of Design Method¬ 
ology," Computer Software, IFIP (1971) page 26. 

Rohl, J.S., "A Note on Backus-Naur Form," Computer Journal, 
Vol. 10, pages 336-337 (1967-68). 


interest. Mind’s Eye has carefully considered the problem of 
low-volume sales of individual programs, and has designed its 
facilities to be capable of handling low-volume programs 
profitably. 

Mind’s Eye is especially interested in programs which 
1) solve a particular problem that you have had, 2) educational 
items, including ones which are “trivial”, 3) programs depen¬ 
dent on the PET operating system, 4) machine language 
programs, 5) useful utilities, and naturally, 6) games and 
amusements. Contact P.O. Box 354, Palo Alto, CA 94301; 
(415)326-4039. 


FLOPPY CONTROLLER USES 
NEW MOTOROLA CHIP 

News Release Received: 78 Mar 13 

WINTER Corp. has incorporated the new Motorola MCM 
6843 floppy disk controller IC into a low cost floppy disk 
controller. The 4 Vt” x 6'A” module interfaces to any full size 
or mini floppy disk drive. The module supports both hard 
and soft sectoring, IBM 3740 or user programmable read/write 
format, automatic CRC generation/checking, and 
programmable step and setting times. $199.00 unit price. 
WINTER Corp., 902 N. 9th Street, Lafayette, IN 47904; 
(317) 742-6802. 


Page 16 

210 


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


Number 25 


SOME ADDITIONS TO LICHEN WANG'S ROBOT CONTROL LANGUAGE 


BY KEN ANDERSON 

KEA Microdesign 
P.O. Box 6531 Stn. A 
Toronto, Canada M5W/X4 


Dear Jim: Received: 78 Mar 24 

Enclosed is a program listing of ‘Yet Another Body’ for 
Lichen Wang’s Tiny Robot Language. In this body, the 
VDM/Sol display is shared to map robot movement during 
the ‘Body Mode’ as well as display mind contents during the 
‘Mind Mode’. Please note that a graphics density of 128 x 48 
cells is accomplished on the VDM/Sol display by addition of a 
‘GraphicAdd’ piggyback board. This program is easily convert¬ 
ed for Poly/SSM type displays by modification of the cell 
mask table (see listing). 

Ken Anderson 

For a full description of the TINMAN language, also known 
as WSFN, and 8080 source listing, see DDJ Volume 2, Issue 8, 
pp. 8-19 ‘An Interactive Programming Language for Control 
of Robots’. Hardware requirements are a Sol or VDM display 
equipped with GraphicAdd graphics board, an ASCII key¬ 
board and an 8080 system with 8K of RAM at 0-1FFF. On 
initial startup of WSFN, the computer asks ‘Are my graphics 
software-selectable?’ Keying ‘Y’ will enable the GraphicAdd 
graphics for this and subsequent re-entries to WSFN. Then the 
‘Mind Mode’ is entered. If valid mind contents exist at 1C00 
in RAM (see the Mind, below), the mind is displayed—if not, 
then the mind is first brainwashed. This feature allows 
previous ‘memories’ to be reloaded from mass storage before 
re-entry to WSFN. 

The Mind 

This is functionally identical to Lichen Wang’s description. 
However, this mind is located in RAM at 1C00-1FFF. After 
every keypress, the ‘Mind Mode’ is entered, and the VDM is 
updated with the latest mind contents. Thus, during all mind 
operations, the display appears as described in DDJ. A few 
more commands have been added for convenience: 

ESC (IB hex) Exits to Monitor 
CTL B (02 hex) Brainwashes the mind for a fresh start 
; is translated to + to save wear on the shift key 

*- (01 hex) back-arrow backs up cursor to correct typos 
NOTE—does not move over brackets. 

Yet Another Body 

The graphics capability of 128 x 48 bit-mapped cells is 
used for tracing robot movement. The display is arranged to 



Sol with GraphicAdd demonstrating ROBOT program. A mix of Body 
and Mind modes was arranged by: Z to initialize movement 

then b to dump Mind on display 
then E to map movement without 
first clearing display (i.e.. Mind) 


‘wrap-around’ movements that go beyond screen limits. 

‘Body Mode’ is entered whenever a body command is exe¬ 
cuted. This mode is maintained until the next keypress, which 
returns to ‘Mind Mode’. 

Body commands are identical to those previously described 
in DDJ. 

One additional command is: 

S Switch trace—the trace is left as per definition W or B 
until it crosses over itself—then the intersection is switched 
B/W or W/B. This command allows complicated patterns to 
develop without eventual ‘white-out’ of the display. 


Number 25 


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


Page 17 












Robot Command Summary 


MIND 


N 

Face North (up) 



W 

Leave White trace 

(space) 

No operation 

B 

Leave Black trace 

+ (or;) 

Increment accumulator 

S 

Switch trace state on overlaps 

— 

Decrement accumulator 

C 

Clear screen (to B or W) 

A 

Current value of accumulator 



T <then><else> 

Test if A>0 : then <then> 

Examples: 



if A = 0 : then <else> 

1. Windmill 


? <then><else> 

Randomly choose <then> or <else> 

DX (CA 

. -8 (HNARP +)) 

D <char><commands>Define <character> to 

DP (... 

..) where P is a curve 


be <commands> 

X 

draws a windmill 


NOTE: recursive macros are allowed! 



n <command> 

repeat <command> n times 

2. Spiral 



where n = integer or A: current value 

DGF 

step length 



DM (HN 23 F CA(AG —2R)) 

EDITING 


A- 

zero accumulator 



50+ 

set A = 50 

DEL 

Erase line 

M 

draws a spiral 

<-(or CTL A) 

Erase character, but not brackets 



CTLB 

Brainwash mind 

3. Hilbert Curve 

ESC 

Escape to monitor 

DUT (- 

V G 6R U 2R G U G 6R V +) 6R 



DVT (- 

U 2R G V G 6R V 2R G U +) 2R 

BODY 


DG4F 




DZ (HN 23F 2R 63F C F 2R U) 

F 

Move Forward one grid cell 

A- 


H 

Go Home to center screen 

5+ 

set A = 5 

R 

Rotate 45 degrees clockwise 

Z 

draw curve 





ooooooooooooo 

-iMr\<iiAvor'coa'0'HN'^ 
000000000—1—1^ — 
ooooooooooooo 


oooooooooooo 

<riA'or^coo'a'’Ni^<iio 

—• •—I —1 •—ICSICSJCNO'JCSICN 

oooooooooooo 


ooooooooooooo 
vOI^Q^O — CN'^<J'A-i)^aD 

ooooooooooooo 


oooooooooooo 

o\o-<(M^<iir\\or^covo 

^<j<r<r<r<j<r<r<r<j<rLT' 

oooooooooooo 


ooooooooooooo 

HNr\<riAvor'COO'OH(Mn 

lAiAiAiAiAiAiAiAiTi'il'fl'O'O 

OOOOOOOOOOOOO 



a C <CO CD CNl CD CSI CD <N| —1 CSI O f'N 

O CJ C_> C_J — O —1 O U.OOOOO 

O CJ CD CJ (N f'N -t U UL. < O' U- U. sO CJs CO <T CMOCvJCMf^»tMOr r \r^if^ 

O C_) O — OOO U. U. CJ U. Q CJ CD <T Q O' r*-\ OljOOOOOOOO 

HLJUJN'OnUUCN^ — Li_ KS O — QO —' Q Q O C r^\ <T ^<[D-i[0<uj' , "OUNQNO'NCDI N U^< 

N^U-U^NMi-UU l^<QU ^ C_) O CSI CJ U CJ U CJ — <ri'-HO<rLO^O<J<J^OsOO<JrliAOir\N 

OOK\'?'00'CQCJQL.NiAiAiriir»Q^vJ\fJ(^^M^'0lsQKMnoiamu-'CDuC00'0'0N^CJQL.ONl , i/\'0Q^inULJU.'HN<JiMsC0<<£< 
OOOOOOOOOO — — — — —iOOOOONNi/'in'/\SMMMMJ'a'<<<(jLHJtJU'/'iAiA'C'0'fl'0'C'0'0'0'0'0'0SNNMsr'M— I— 
0<<<<<<<<<<<<<<OQQOOQQOOOOOOOOOOOQQOUOaONNNNNNNNNMNNNN(MNNNNNNNN 
ocjc_)Ljcjc_)CJCJcjcjc_)c_)CJc_)C_)oooaooooooooooooooooooooooaooooooooooooooooaoooo 


Page 18 

212 


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


Number 25 




d 

o 


CO 

in 


X 

eta 

Q 

O 


UJ 

QC 

(_) 

in 


cr 

c_) 

to 


- o 

X d I 2 Q X 


x—*xrsixxh- 
2 >• X 2 X X X 
Miuncuict; 


Q- Q 
N U 2 
cr —. 
•- X 
uj ~ 

in in t— 

UJ UJ UJ 

a: >- in 


- - ^ < < x 


XX • C_) 


< o d ► 
: •- x : 
inz ► 


O P" H-. 


x in 


a_ — 

C 2 

CC □ O 


X 


in . 


Q- •— C_> d 
x a: m u m > 

in uj y in 1 
■t s in - a. in 
-in -in d *-< 


2 d 2 ; 


O 5 


in 2 

d — 
3 d 


3 in x ( 

J -— or 1 — t— 

: o in □ ; 
: in uj m c 
XX -c 


< in >- z : 

: in in o: m 

- C_) d o d 
: 1 — 1 H- I 1 — c 
: 1 > uj u 1 

) o_ cd x a: : 

d 1 

. cc in o in < 
h o uj i-h >-* : 

)inir<i-« 

: u u > m < 

) X 2 C 

: cd uj d 2 c 


- x j— o c in - uj 

jo a- mhh iqc x 

3 in in >-2 - in a - x 

:xcx - •-< d a t— oinot 


'<< MNHH -H JCXNQ. 

jQocrvja.2:>'XQ:xx<iox2x 

iooooxoo_ixc-x xqcp-) 


j u_ x in 2 -h 




vc 

cc 3 
o cc 
- o 

x m x 


x Q 

—> d in *-> x o_ *— 

XXXOUI 

cc x in a_1 in a_ cc 



xxxxxxxxxxxxxxxxx 


Ni , N-3iri'flNa)0'0-HNi^^ir\yoMoO'OHNi , i>jin'Or^ 
' - - - ■ inmm'C'OvO'Ovovo'O'O'O'or'r'r^i^i^r'r^N 


-XI CD CM 


xxjxxxxxxxxxxxxxxxxxxx 
His^<nnx^co^OHMr<jin c cd c 
CDCQCOCDC 0 ajDCDCC 0 '^O' 0 ' 0 \C'CMM>^CQ 


o a o o 

N 1 ^ <J lA 

OOOO 
CM CM CM CM 


oooooaooo 

XMDD'QHNn<f 
oooa—(—1—•—1—i 
CMCMCMCMCMCMCMCMCM 


CM 

O 


r*' 

o 


K-\ 

O 


X 

X 


CM 

X 


CM 

X 


X 

X 


X u 
CM X 


d r-, uLom co cm 

U. X U h- U CM CQ 


<J (Ml X U U_ d 

cd m in u h l co i*' 


X CM M3 CM 

OX X d 


U_ CM VO CM 
X CD CD d 


r*"\ X X CM •—1 —1 O' 
N m CD L) Q U (J 


COX'OCDm'OxCMr^XCMO' 

OlMuJUDuLUDminu 


< I s ij u im uj in 

f'n CO X X X K 3 Q 


•—> d on o m x p^\ 
HCMHMDUU 


icuNinniMHin 

ummujcMCMuju 


CDUJlMiTiHCM-iO' 

u m n uj cm cm uj o 


U. Q (M m nO I s x 
O Q Q a Q Q Q 
CM CM CM CM CM CM CM 
X X X X X X X 


O'. O' O' S' S' cc u 

x o a x x a Q 

CM CM CM CM CM CM CM 
X X X X X X X 


uj u 1-1 m n x 
qOuuuju 

CM CM CM CM CM CM 
X X X X X X 


O' CQ X X X X X 
1 . 1 1 ■ 1 1. 1 1 ■ 1 1. 1 1.1 1 ■ 1 
CM CM CM CM CM CM CM 
X X X X X X X 


u.u_u_u_u.u.cMf^'nxmou.u.cMir\'nr'XosooooOLi.cMi-nvooN<mamm 

XXXXXXXXXXX XXX X X XXXXXXXOXX —M •—1 •—i •—t 1 —( •—1 1 —( r—t 
iMCMCMCMCMCMNCMCMCMCMNCMiMinininininininmminr. inrinin^mmininm 
XXOOXXXXXXXXXOXXXXXXXXXXXXOXXOXXXXX 


X X 


r-i CM 
CM CM 


X X 


cACDO'ddddCDX 
CM CM CM CM CM CM CM CM CM 
innnnninrNinn 
xxxxxxxxx 


xxdxxxxx 


<r m 

X C. X o 


d X 

J CSI O d - 


d o 

<-1 - - X 

cc x -j o : 


x o x o < a a 


ID—<>—!•—lXQ_(MIQ_P 
CM X X > > 2 X 2 X L 
era_ixx—*oxo.c 


muiMi 

>m x x x : 
ecu a_1 r 


< < o: < 1 
cm o: *— 2 1— 1 
qc x in •—1 in i 


x Q —1 _j 

in_j>x_i>>-m—1>> 

IMXXXQdXCJXdXX 

QC Q- ix<toxxinoxx 


—JQ_>— >—INICHMIEI 
XXUJQ-2 X C_ 2 2 l 
innicunQucH! 


CL I- Q CD 

X X 2 - 
X X — 

c cr x o 


O-JQQ X X U_ X X— —. CM 

***000 * * * X * * * 2 * * * CE X X 

IXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXX 
'i/N'Or'COff'X'iCMin'Cir\'OMDo\Xi-iiMin<jinvOMDO'OHNin<fin'OMDinxHNnvrinioi^caiJ'Q^cMfn<riruor'iao'QHr-' —■ - — - - -- ■— ■— - • -- - ~ - — ~ 

)'0'0'0'0'or'-r^r^.r-r-r^r'-r^r^''-cocQ3oc3oa3a3cococDc»0'0'0'0'0'0'0'a'0'C'XxxxxxxxxX'— — — 1 — 1 — — 1 — 1 . 

1 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX—I —1 — —< —. — —1—IH-< r-* ^ . 


o 

o 


CM 

X 


XXX r-H 

X Q CM CO 


X M 3 
<* M 3 


<J <J UJ CM < 

CD CD U_ X CD 


CDiniHUJ'OinuCMHD' 
O UJ CM KN 1 *"' CM CD O Uj O 


cd in in h m 

O UJ a CM o 


CO U_ CM X CM O' 
X <t 1^1 f'N O 


coincxmQu. xunor^-O'C'-j—lO'ujcMQujaxo' 

UUCMMOX'JMMJ'O'ONUU'U.Uinii.Linu 


< MO n in 
maxuCi 


d c d <c d x o 

1— r- 1-. r'- r-^ 

CM CM CM CM CM CM CM 
X X O O X X X 


u_ -h <r m co 

C'' CD CO CD CO CO 
CM CM CM CM CM CM 
X X X X X X 


O' d C d d CD X 
CD CD CD X X X X 
CM CM CM CM CM CM CM 
X X X X X X X 


q x m m m n <j 
X O' O' O' O' O' O' 
CM CM CM CM CM CM CM 
X X X X X X X 


lT\ X O' X O O 
O' O' O' O' O' O' 
CM CM CM CM CM CM 
X X X X X X 


QQUU.CMn 
O' ff> O' O' < < 
CM CM CM CM CM CM 
X X X X X X 


■o co O' d x uj 
d d d d d d d 
CM CM CM CM CM CM CM 
X X X X X X X 


L.(Mn<J'DO'doDl _I X X X X 

dmxmxxxxxxxaxaxx 

CM CM CM CM CM CM CM CM CM CM CM CM CM C J CM CM 

xxxxxxxxxxaxcxxx 


U_XXXCMP'''<fJ'i 

JDCDCDCDXXXX 

CM CM CM CM CM CM CM CM 

xxxxaxxx 


M 3 O' X X X 

X X X X X 

CM CM CM CM CM 

X X X X X 


Number 25 


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


Page 19 


213 


Uj u y uj < o: _i 

> uun u Z o Q- 


—I z z 

CO — •— 

< x p— o 

in i— X o. 

OGQ Ul 

a. z a; > oi 
in ui ce l_j 

— —) X •— cr 

Q in z o 

U < U Q 

U1U2 < 

- < Z Ifl 

in /— o o 
u in < _i z 
inuco- 
x x cd in x 


_iino 

CJ O O 
cr cr cr 
u<< 
in o o 

CD CD 
_!>->- 
O U id 
in y y 


cr o 

< (_i 

x o x 

CJ - UJ 

O < O £ 


O < X CO O X U O hcd M • 


O O j 

CL Q a o 

in u in in 


cjxocjoxxocj: 


—i x a 

o o o x x x x 

oqiuuu<u 

3 UUUUUy U.L 

NOnO—I.-IOOOOO 


<<Q-<<<a-a_a_p— I— X 
3 Q QC O I— 0C ►— OOOU Q-CQCDCDCDCDCDCDCD 
3_jozinxina-Q-a_crin<ooaooooo 
*-> cr. 


*£ •— CJ 00000300000 

LkJ ^^*^^2SCD2XiiSXXiXiXQ:incDCDCDCDCJCyoC3C500'0000 
"OOCjr-jinarOOOOOOOOOOOOOOOOOOOoOOOOOUJUJUJLLJUujLJuiUJUJlLj 


CD 


• in 

X X > 


ooooooooooaoaoooooooaoocooc 

HNK\<lft\OMSO'OHNr^<fiA^MOO'0'HN^< m NO r 
0'0'0'0'(7'CT'0'0'0'0000000000<—<■—<■—<-^<- ~-< —■< - 
NNNNNCMNNIN^^r^r^KNKM^^r^f^l^l^KM^f l<M< 


< u z o in • 

*— ui x >< in<t : 

ininxs-OQQXii 


• cr cr : 
: c_i cj £ 
i in in : 


) o o o 

)HNI^ 

J CSJ CM CM 

\ m m 


ooooooooooooooooooooooooooo 

<JiANOr'-cOONO-HCMPn<inNOf'sC3CyNO—PCMPAsTiAvOrscOCTNO 
CMCMCMCMCMCMPnmPnpnpnpnpnPnpnfn<T<T<T<r<J<J<J<T<J<TiAin 

-- ----- - 


'-< «•-< i>» i-M r", m m r-A r~\ m m pa pa <j <j . 3 - 


0000 

CM PA <J lA 
in in in in 
pa pa m pa 


O O O O ( 
VO MO OM 
in in in lA ' 
in in pa pa r 


) o o o o o 

< CM PA <J lA NO 
) NO VO NO 'O 'O 
' PA fA PA rA PA 


U 0-1 VO 

I s O Q N 


<Qya-<NA<T 

CTNONON<<<<< 

lAlAIAlAIA'ArA'A 

00000000 


lA CO Us <C CD l—J 
<C<T<<C<C< 
fA PA PA IA PA PA 

a o o o o o 


u u Q U U. 
< < < < < 
PA PA PA PA PA 

o a o o o 


0000c 000 


f" < 
CD CD 
PA PA 

o o 


O U- O —< CSI PA 
CD CD CJ CJ CJ CJ 
PA PA PA PA PA PA 

000000 


PA CM PA PA 

0000 

u_o\r^pA cm o on rs —< co pa pavonnoiAia<3niao 
CD Q U CD iA CM in <T <T <T <J 1 A<J 1 A 1 ACSI<J<J 1 A<T<TCSI 

2NQ<NffvHiAQONOCMAQU.<rHi/\IA(JIAriUU. 
3C_)C_)CJPAO<f<J<CSIiAiA<JiACSI<TiA<T<IiA<J<J<T<TPA OOOO 

<rr^<oo-MPAiAr^ONCDOu.ocM<NOco<c_)UJocM<jvo<c_)OuJu.ooooooooooo 

CJCJCJCJOOOOOOOOQUJUJUJUJUJUJUJUJU-Li_U_U.U_U.U.U.U.OOOOOOOOOOO 

PA PA PA PA PA PA PA PA PA PA PA PA PA pa PA PA PA PA PA PA PA PA PA PA PA CD CD CD CD CQ U (J CJ CJ CJ CJ CJ CJ CJ C_) CJ 


ooooooooooooooooooooooooo- 


cr a. 

O o 

C_l 1C 


o uj 

CD PSI 

o —> 


CC O Z 
O CC UJ 

000 
000 
0 < 


> cr 
o o 
X z 


p— > p— cr in 

Ul < UJ o < 

o in in x X 


1 in <000- 


< rsi —1 < x < —< p-i p— < : 
.iix-uQQ.Na.Nui—; 
;nzinojununcri/)i 


—I X < X 

x - U. - •> 

O < Ul 1 _I < c 


CDCJOCJCJ<_lXXXXXXXCD QUQ 


X X O CJ O Q 

ininJXJ>QH>>QH(iuQQ>j-.iijuj»<mM. 
jrMOOXCJXOOZOOO >ZZOOOX>OOOxX 
ccro-ca-ixji<<xx<li/n<<zinzinina. 


*- XX 

x o < 00 

- - •> 00 

I CD U m Q O Q 


ominw<ii:[DuQ>>>HQQQQQQ>a:M>Qi>ci:>jrtH>Q<MH 
- '^^*' , ^^’0z0OOO><<<<<<O<>-O<C_)O<O<X>.o<0ZQ. 

inr-)<XXXXOOOOOOXCrxXOxXcrx-“-_ 


««<PUJ uidCU. if o o 

ooooooooooooooooooooooooooooooooocoooooooooooooooo 

i^vO|sOOvOH(NPA^<AiONCOOvOHNPA<T<AvONCOOvOH(MPA<fiAvOrsaOvOH(S|A<JiAvOMIlOvO-iNPA<J 

<-^<MCMCMCMCMCMCN|CMCMCMmfAPnmmfnpnPnmm<J<T<J < <J <J <T <<3 JlAlAiAiAJ'iAJViAiAiAvflvfWlJUd 

M CM CM CM CM M CM CM CM CM CM CM CM A CNCMCNCMCMCN 


-.-,-,-,^ 1 N i N i N W(N|(SINNCNINAAIAAn 
CM CM CM CM CM CM CM CM CM CM CSI CS| CM CM CM CM CM CM CM CM 


DOOOOOOOOOOC 


si sj si muiui uv u^ lA lAiAiAiA'O'tJ'O'O'O'O'OvOvO'OlsNI— fs |— 
CMrCMCMCMCMCMCMCMNCMNCMCMCMN--....... -- 


.-.i_<wi_.._»<_p<_ii_«i_ii_»i_(i_i<_»v_>i_iOOOOOOOOOOOOOO 
CMPA4mvO|sfflONO-<NlA<IiAvOrsCOffvO'- ~ 


wu. w-iCMIASfiAvOMDOvQ 
_ _ _ _ _ _ . AISA|S|S|S|S|S|SCOCOCOCO(IICOCDCOCDCOO' 
CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM 


<1 PA PA A* CM UJ PA PA lA 


CM UJ CJ U. CJ PA <—I <- 

U.CMPA<J <T <J<T'O^E3UQUQ'niACOO'<[D(jQUJLCMin^jr'(D<a]CJuaun<i/i\ju'UJUUUJ'l 
CMPArAPAPAPAPAPAPAPAPAPAPA<J-0 < <T <J <f <J <J<J -O-OiAiAiAlAiAiAlAlAiAiT 'flvO'O'O'O'fl'fl'O'O'JS 
PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA PA tA PA rA PA PA PA PA PA PA K PA PA PA PA PA PA PA IA PA PA — 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOC P—if— 11 —i i—i r-yr-v r-i i— 11—1 r— > 


IN i-i ru- IN UJ PI n in -I b. M -in -i It Q CO vO O' O' I 
O' QCOCD'OCMHO'(MjOCMOO'QCO<fl"OIMCMN 


< ui < O' cm pa ov co in in < cd < O pa vo u. cj cm 

CIU.UCJHHUCJUOCMUJCMIsCOUJ'OfsCO 

U. CM PA vQ f*— CO < £□ CJ Q U O PA <J lA vQ O' CO LI Q Ul ■—I CM IA MB O' tf ff | I*) I ■ I 
■ • s, s s, s. s. s. s. s, >,<JiAiAlAiAiAlAlAir\iAir'0'0'0'0'0'0'fl'0'0'0NNNNNNNNNNN 

IA PA PA PA PA PA PA PA IA IA PA PA PA IA PA PA PA PA IA PA PA |f PA PA PA PA PA PA PA PApAPApAIApAPAIAPA PA PA PA PA PA 

OOOOOOOOOOO 


n co co co 

PA PA PA PA 

OOOO 


A<fiANcoa'<a 

PAPAPAPAPAPAPAPA 

oooooooa 


cjOui—< m<jiA'jco 
COCDCOO'O'O'O'O'O' 
PA PA PA PA PA PA PA PA PA 
OOOOOOOOO 


Page 20 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 25 

214 






FORTH 


for Microcomputers 



BY JOHN S. JAMES 

1090 Miller Ave. 

Berkeley, CA 94708 

Forth is a unique threaded language ideally suited for 
microcomputers. Programs are incredibly compact; e.g. in 5K 
to 6K bytes you can get the interactive Forth compiler, 
running stand-alone as its own operating system including I/O 
drivers and other run-time routines, plus an assembler written 
in Forth (in case you want to optimize time-critical programs), 
virtual memory software, and a text editor. Not only does all 
this fit into 5K to 6K bytes (of which 4K are written in Forth), 
but it runs in the same space (plus IK buffer), with no 
additional symbol table area, overlays, swapping, or use of any 
other software. 

And while Forth gives all the convenience of interactive 
interpreters, it is very fast. For most applications, the run¬ 
time overhead is 20 to 30% for minis and 70 to 100% for 
micros (compared to 1000% or more which is common for 
interpreters). Number-crunching applications may take 
longer. And when Forth isn’t fast enough, the system’s own 
assembler can be used to re-code inner loops. 

But the best news of all is that software development times 
are cut by half or more over assembly programming. The pro¬ 
gramming is entirely structured (there is no GOTO), and the 
resulting code is re-entrant and can be designed for PROM. 

Forth has been implemented on many microcomputers. A 
recommended configuration is 16K bytes and a terminal; a 
floppy is a good idea for storing source programs (and virtual 
memory for programs and data is supported). Forth works 
well with a CRT, so hard copy is less necessary. 

Forth has existed for several years, and is used commercially 
in a number of installations, but until recently it has been 
priced far out of reach of hobbyists, and even most computer 
experts have never heard of it. However, the language is in the 
public domain, and today low-cost versions are just becoming 
available. Also there is a new Forth Interest Group (787 Old 
County Rd, San Carlos, CA 94070), dedicated to letting the 
serious hobbyist and the professional know about Forth and 
how they can get it. 

How it Works-Overview 

Forth is very different from any other language in common 
use. Perhaps the nearest is Lisp, which it resembles in one way 
only: both are tree-structured languages which implement 
themselves. Forth is an extensible, interactive language. 

Forth starts with about 40 primitives, or operations defined 
in machine language. New operations are defined in terms of 
these. (So far this is like the virtual-machine systems often 
used for implementing transportable languages—e.g. 
Tiny BASIC, or P-code for Pascal. But in Forth, as soon as a 
new operation is defined, it can be used in further definitions 
or executed immediately, exactly as if it were a primitive). 


There are no argument lists in Forth; instead, all routines 
(operations) communicate through a stack. The programmer is 
allowed to define variables, but in Forth, variables themselves 
are operations which place addresses (or other values) onto the 
stack—and which may use the full power of Forth or of 
machine language to compute these addresses. This means that 
users can create their own variable types. 

Forth comes with about 140 routines already defined 
(including the 40 primitives mentioned above). Programming 
consists of defining new routines in terms of previously-defined 
ones, until finally one of them is the whole program which is 
desired. It then is executed by typing its name. Incidently, the 
programmer does not need to know about all 140 operations, 
because some of them are used mainly by the system. After 
all, these 140 implement the compiler, text editor, assembler, 
stand-alone operating system and run-time software, etc. 

Execution is fast because at run time all definitions are 
stored as strings of addresses; and it takes as little as two 
instruction executions (e.g. on the PDP-11) to go from one 
primitive to the next. Higher levels of nesting take a little 
longer, but are done less often. 

Debugging is exceptionally convenient because of the 
modularity of programs. Almost any routine can be executed 
by typing test-data arguments (which places their addresses or 
values onto the stack), then typing the name; no driver 
program is required. In practice, most Forth routines are very 
short, no more than five lines of source code, often one line. 
Each routine is checked out independently, then saved in an 
application-oriented library for future use. 

Blanks are the standard delimiters, so any string of non- 
blank characters can be an operation name. Examples of actual 
names are ‘ASSEMBLER’, ‘ELSE’, *!’, *(\ **’, ‘1 + ’. Even 
numbers can be defined as operations. In one practical joke, 
‘0’ was defined as seventeen. Operation names can be encryp¬ 
ted with embedded non-printing characters. 

Example: A Small Program 

Forth uses postfix notation like the Hewlett-Packard stack 
calculators. This means that operands are written first, 
followed by operators. E.g. ‘(A + B) * C’ in regular (infix) 
notation becomes ‘A B + C * ’ in postfix. This expression is 
executed as follows: place A onto the stack; place B onto the 
stack; add the two values on top of the stack, destroying both 
of them and placing their sum on the stack; place C onto the 
stack; multiply the top two values on the stack, replacing them 
by their product. Notice that there are no parentheses in post¬ 
fix. Also, Forth follows the convention of leaving the operands 
in the same order as in the infix expression; this makes it easy 
to remember the order of arguments for non-commutative 
operations like subtraction. Another Forth convention is that 
all operations should destroy all of their arguments on the stack. 


Number 25 


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


Page 21 

215 


Now let’s look at a complete Forth program. Assume that 
the system is in the machine, but not any user programming. 
The task is to write a routine to evaluate the polynomial 
5X 2 -7X -10. The user types 

: POLY DUP DUP * 5 * SWAP 7 * -10 - ; 

This is the complete program. Let’s follow how it works in 
detail. 

The colon ‘’ is one of the Forth operations called defining 
words. A defining word takes the next word in the input 
stream (here ‘POLY’), and prepares an entry for it in the 
dictionary of Forth definitions. As explained later, the 
dictionary is the most central concept in Forth. In fact, in the 
entire Forth system, including compiler, text editor, operating 
system, etc. and also the user’s application software, less than 
50 bytes of code are not part of the dictionary. 

Besides opening a dictionary entry, the colon also places 
the system into compile mode, so that operations which 
follow are compiled into the definitions, instead of being 
executed immediately. It is, however, possible to have special 
immediate operations within definitions, when compile-time 
execution is desired. The system stays in compile mode until 
the definition is terminated by a semicolon. Notice that blanks 
must be used as delimiters for colon, semicolon, and all other 
operations. 

‘DUP’ is an operation to duplicate the top of the stack, 
i.e. to push a copy of the top item onto the stack. ‘SWAP’ 
reverses the top two items on the stack, **’ and ’ are 
multiply and subtract. 

For this illustration, assume that ‘POLY’ is executed with 
the argument ‘6’ on the stack. First the ‘6’ is duplicated twice, 
leaving three copies of ‘6’ on the stack. Then multiplication 
is executed, leaving the stack as follows: 

36 

6 

And ‘5*’ pushes ‘5’ and multiplies, leaving 5X 2 (180) on top 
of the stack, with the copy of X beneath. 

‘SWAP 7*-’ brings the copy of X to the top of the stack, 
multiplies by 7, and subtracts. ‘10 -’ completes the poly¬ 
nomial. 

To test the program, the user could type: 

3 POLY. 

where V is the command to print the value of top of the stack 
(the V could have been included in the definition of ‘POLY’). 
The system responds: 

14 OK 

where ‘OK’ is the prompt meaning that the system is finished 
and waiting for the next input. (The underline means it was 
typed by the system.) 

The user may do some further testing: 

75 POLY . 27590 OK 
90 POLY . - 25676 OK 

Notice the overflow on the last example; the width of the 
stack is always 16 bits in standard Forth, although double 
precision or floating point can be implemented, using more 
than one stack entry to represent a number. 

It is important to test that the routine doesn’t leave any¬ 
thing extra on the stack, because stack overflow is not checked 
during execution and can be hard to diagnose. The instruction, 
‘S, pushes the absolute machine address of the top of the stack 
onto the stack. This address should be the same after a test of 
an operation as before (provided that arguments are supplied 
and results printed by the test). E.g. to test ‘POLY’: 

‘S . 174 OK 
8 POLY . 254 OK 
‘S . 174 OK 


Example: Number Bases 

Any number base can be used: ‘DECIMAL’, ‘HEX’, 
‘OCTAL’, ‘BINARY’, ‘5 BASE’, ‘17 BASE’, etc. For bases 
above 16, letters after ‘F’ in the alphabet will be used as num¬ 
bers. The base can be changed at any time. Only the terminal 
I/O is affected—all internal work is in binary, so there is little 
cost for arbitrary number bases. E.g. 

DECIMAL 666 23 BASE ! . DECIMAL 15M OK 
This code means: make sure the system is in decimal; enter 
decimal 666, then 23, onto the stack; enter the address of the 
system’s variable ‘BASE’ onto the stack; store (the *!’ opera¬ 
tion) 23 into ‘BASE’, which sets the base to 23 and destroys 
the address of ‘BASE’ and the number ‘23’ on the stack; print 
666 in base 23 (15M); and restore the base to decimal, for the 
sake of future definitions or data entry. By convention, the 
standard base is decimal. 

Example: Scaling 

Software floating point has seldom been implemented in 
microcomputer Forth until recently, and still is not available 
on most systems (it is more common on larger Forth versions 
for minicomputers). Instead, Forth has used some tricks for 
getting around the need for floating point, such as a special 
scaling operation ‘/*MOD’ (multiply and then divide, leaving 
quotient and remainder), which keeps a 24-bit intermediate 
result (instead of keeping only 16 bits as would happen if reg¬ 
ular multiply and divide operations were used). So powerful 
are these special operations that Forth without floating point 
has been used for such applications as non-linear least squares, 
Fourier transforms, and numerical integration. 

For this example, we want a program to multiply a number 
by 3.14159. The challenge is that we are working in fixed 
point, using 16-bit signed numbers with maximum value of 
32,767. Also, the division operation in this version of Forth 
only allows divisors up to 128. 

Although it doesn’t make much difference in this short 
example, the Forth programmer is strongly advised to start 
with a top-down approach, taking the whole task and break¬ 
ing it into operations which could implement the entire job 
in a couple lines of code, then breaking down these operations, 
etc. The alternative is to start out defining operations which 
seem to be relevant to the applications, but may not turn out 
to be useful. Don’t be tempted down the wrong path by the 
fact that the lower-level operations must be typed in first. 

In this case we can break up the task of scaling by a six-digit 
number (which would not even fit into a word) into three 
scalings by two digits each. We notice that divisions are by 
100, which is allowed, and that no intermediate results on the 
stack will be any larger than the answer, avoiding overflow 
problems. The final program becomes: 

: FIRSTSCALE 31 10 */ ; 

: NEXTSCALE 41 100 */ 10/; 

: LASTSCALE 59 100 */ 100 / 10 / ; 

: PI DUP FIRSTSCALE OVER NEXTSCALE + 

SWAP LASTSCALE + ; 

Now the user can type: 

10000 PI . 31415 OK 
or use PI in other definitions. 

The ‘OVER’ operation copies the second element on the 
stack without destroying it and pushes the copy onto the 
stack. The scaling operation ‘*/’ is like ‘*/MOD’, except that 
only the quotient, not the remainder, is returned. 


Page 22 

216 


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


Number 25 




The reader can follow through this example. Typing, e.g., 
‘10000 PIfirst pushes 10000 onto the stack, then executes 
‘PI’. ‘PI’ duplicats the stack, then executes ‘FIRSTSCALE’, 
which pushes 31, then 10, then executes the scaling operation 
which multiplies 10000 by 31 (keeping 24 bits for the result), 
then divides by 10, returning a 16-bit result. Now the stack is: 
31000 
10000 

and execution continues with ‘OVER’, ‘NEXTSCALE’, *+’, etc; 

For efficiency, this example could be improved by first 
translating 3.14159 to octal or hex, then using Forth’s assemb¬ 
ler to write a divide-by-shifting routine, as the standard divide 
software is not smart enough to recognize that a divisor is a 
power of two. However, run-time speed would not be much 
improved by defining this program in one operation instead of 
four, because linkage between routines is very fast. The over¬ 
head in number-crunching applications is due more to stack 
manipulation than to linkage. And when time is critical, the 
Forth assembler is convenient. 

Example: Complete Session 

The ‘PI’ example illustrated some practical advantages of 
Forth for software development. It is no surprise that this pro¬ 
gram worked on the first try. Testing was immediate. The 
operation is now available for any further use, simply by writ¬ 
ing its name. This routine takes about 75 bytes of object 
code; the compactness would be more impressive it it were 
part of an applications package in which references to ‘PI’, 
which take two bytes, were used a few times. 

The following listing shows the same example, but in a 
complete terminal session including use of the editor. This ses¬ 
sion starts after the Forth system has been loaded. Loading the 
system takes about 30 seconds on the 6502; this includes com¬ 
pilation of all but the first 2K bytes, which must be pre¬ 
compiled because it includes operations necessary for the sys¬ 
tem to perform compilation. The rest of the system code is 
left in source form, to allow user modifications. Because com¬ 
pilation is fast, there is no need to store object code on disk, 
hence no need for relocation. While overlays can be defined, 
Forth is so compact that they are seldom needed. 

42 LI SI 

5LK *_ 42_ 

Q 

jL 

3- 

3 

.2 

_a 

_2 

m 

11 

JiL 

Ui 

}JL 

2-5- 

OK 


EDI lOh £& 

0 P ( n UL 71 PLY BY : • 1 41 59 ) Q& 

1 P : FI hSI SCALE 31 10 ; Q£L 

2 P : NEXTSCALE 41 IOO */ 10/1 QH 

3 P : LASTSCALE 59 1 00 */ 100 / 10 / I OK. 

4 P s PI DUP FI kSl SCALE OVER NEXTSCALE ♦ SWAP LASTSCALE ♦ I OK 
42 LOAD £& 

10000 PI . 3141 5 _0K 
•S'. 176 OK 
A 5 PI . 1_4U OK 
*S . 176 OjL 

The user listed a disk screen (here number 42) to confirm 
that it was empty. Then the word ‘EDITOR’ invoked the 
editor vocabulary. This does not load the editor, which is com- 

Number 25 


pact enough to normally reside in RAM (though it can be 
loaded when used, if memory is tight). Instead, ‘EDITOR’ 
caused the editor operations to be recognized. 

The program is typed using the editor’s ‘P’ command, 
which places the new line being typed into the line number 
given, destroying whatever may have been in that line before. 
There are several other editor commands not shown here. This 
is a line editor, and cannot modify within a line. A more 
sophisticated string editor has been developed. 

‘42 LOAD’ causes the disk screen to be input just as if the 
information had been typed; this causes the compilation to be 
performed. Some tests of ‘PI’ are shown. The answer is correct 
(though not rounded in the last place); and the operation does 
not leave anything extra on the stack, or take anything away 
except its argument. 

Example: Using the Assembler 

To invoke the assembler, begin a definition with ‘CODE’ 
instead of *:’. The manufacturer’s mnemonics are available, 
plus ‘IF,’, ‘ELSE,’, and ‘THEN,’ for conditional branching, 
and ‘BEGIN,’ ‘END,’ for conditional looping. These struc¬ 
tured primitives can be nested to at least 16 levels, because a 
stack is used at assembly time. The assembly instructions 
must be entered in postfix: operand, mode indicator if any, 
then op code. Incidently this entire assembler as implemented 
in Forth takes only a few hundred bytes, mostly for storing 
the manufacturer’s mnemonics. 

An example of a code definition (for the 6502) is: 

CODE DIV256 0 ,X LDA, 1 ,X STA, 

0<IF, FF # LDA, ELSE, 00 # LDA, THEN, 

0 ,X STA, NEXT JMP, 

The operation ‘DIV256’ is here defined as a fast divide by 
256. It is used to same way as any other operation; it is trans¬ 
parent to the user whether a routine is implemented in Forth 
or in code. For examples of use, see below. 

Note that the op codes and some other names end in 
commas. In this version of Forth, it is conventional that oper¬ 
ation names which actually place information into the code 
stream end with commas; these operations serve as the end of 
a phrase. The other names and numbers place values onto the 
stack, which the comman operations will use. For example, 
‘0<’ places a value (an op code) that sets up what ‘IF,’ will 
test for. 

Though not used in this example, the full power of Forth is 
available at assembly time for computing address displace¬ 
ments. Use of the assembler does not enter into any special 
assembly or compile mode (it does invoke the assembler 
vocabulary so that assembly mnemonics are recognized). 
Therefore, all Forth operations are available for execution as 
normal. 

The assembler’s conditionals (e.g. ‘IF,’) are simply Forth 
operations which are executed when typed, like any others. 
They are like macros, placing one or more machine-language 
instructions into the dictionary where the definition is being 
entered. Sometimes a forward branch is required (e.g. by 
‘IF,’), and of course the address to branch to is unknown at 
the time. The macro simply leaves an empty space for an 
address or a byte count, and also puts the address of that 
empty space onto the stack. Later, the operation which marks 
the branch-to point simply takes that address off the stack, 
and patches in the final offset or address required. Incidently, 
the advanced programmer can deliberately produce non- 
structured control, by manipulating the stack during assembly. 

Though not shown here, the assembler also has a ‘BEGIN,’ 

... ‘END,’ looping structure, which repeats until the value on 
top of the stack becomes non -zero (true). 

The following session entered and tested the definition of 
‘DIV256’. 

Page 23 


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


217 



EDI 1 OH 

0 P t ASSEMBLER EXAMPLE ) 2K 

1 P HEX 

2 P CODE DIV2S6 0 .X LDA. I .X S1A. OK 

3 P 0< 1 F» FF * LDA. ELSE. 00 # LDA. 1HEN. OK 

4 P 0 .X STA NEXT Ji-iP. U!S. 

FLUSH QjS 

43 LOAD Sl£ 1 
EDI TOR OJl 
SCR 7 42 2K. 

4 P 0 .X STA, NEXT JMP. OX 
FLUSH Q£ 

43 LOAD 01 

77 DI V2S6 • Si 2B 

300 D1V2 56 • j).OK 

DECIMAL OK 

77 Dl V 256 . Dl V T_ 

77 Dl V256 . 0. .OK 
400 DI V2 56 . J_OIS 
10000 DIV2 56 T 22 Oa 

- 300 DI V2 56 . -2 OK 

- 3 Dl V2S6 • ij. 0£ 

-2 56 Dl V2S6 . - I OK 
-257 DI V/f? 56 . ^2 pi 


This session has some errors; e.g. in the sixth line, ‘STA’ has 
the comma omitted. The error message ‘STA ?’ was printed in 
the eighth line. In the seventeenth line, mistyping the opera¬ 
tion name caused ‘DIV’ to be unrecognized. Notice that ‘HEX’ 
stayed in effect after the code entry, until the ‘DECIMAL’ 
operation in line 16. Also, all quotients are truncated down¬ 
ward, even negative quotients, e.g. ‘-3 DIV256 . -1 OK ’ 
‘FLUSH’ writes the updated buffers to disk, making sure tKat 
the copy of the program is actually saved. ‘SCR .’ places the 
address of the system’s variable ‘SCR’, which holds the 
number of the disk screen being worked on, onto the stack, 
then *?’ takes the address off the top of the stack, and prints 
the quantity at that address. 

Example, LIFE 

The following Life program was contributed by Dave 
Boulton, of Quesnoy Corp. Object code is 475 bytes; Forth 
works better for larger programs where application-oriented 
libraries can be developed. This program took an hour and a 
half to write and five minutes to debug. It runs slowly, and 
could be speeded up by re-coding the two levels of inner loop 
in assembly. 


100 

0 

1 

2 

4 

5 

6 

7 

8 
9 

10 

11 

12 

13 

14 

15 


LIST 101 LIST 

( TEL GAME OF LIFE ) FORTE DEFINITIONS FORGET TASK : TASK 
81 CONSTANT XLEN 25 CONSTANT YLEN 
XLEN 1 - YLEN 1 - ARRAY UNIVERSE 

: CEECK DU? 3 = IF DROP 2+ 

ELSE 2 = NOT 

IF 4 + THEN THFN J 

: CLEAR YLEN 0 DO XLEN 0 DO 0 I J UNIVERSE Cl LOOP LOOP 
: SET SWAP UNIVERSE 1 SWAP C! J 

: RESET SWAP UNIVERSE 0 SWAP Cl ] 

: DISPLAY HOMEUP XLEN 0 DO [ _] LOOP CR 

YLEN 0 DO XLEN 0 DO 

I J UNIVERSE CO IF [ *] ELSE SPACE THEN 
LOOP CR LOOP ; 

101 LOAD 


9 


I 


0 ( LIFE CONTINUED ) 


1 

: GENERATE 

YLEN 0 

DO XLEN 0 

DO 

0 



2 


J 2 

+ YLEN MIN 

J 1 

- 0 MAX DO 


3 


J 2 

+ XLEN MIN 

J 1 

- 0 MAX DO 


4 


I 

J UNIVERSE 

CO 

1 AND 

+ 


5 


LOOP 

LOOP 





6 


I J UNIVERSE CO 1 

AND 

SWAP 

OVER - 


7 

8 
o 


CHECK I 

J UNIVERSE 

Cl 

LOOP 

LOOP 

• 

9 

: NORMALIZE 

YLEN 0 

DO XLEN 0 

DO 




10 


I J 

UNIVERSE DUP CO 

DUP 

3 > 


11 


IF 

DROP 0 ELSE DUP 1 > 



12 




IF 

DROP 1 

THEN 

THEN 

13 


LOOP LOOP ; 





14 

: SIZE 1+ 

81 MIN 

['] XLEN 1 

1+ 

25 MI 

N ['] 

YLEN 


15 : GENERATIONS 0 DO DISPLAY GENERATE NORMALIZE LOOP 


SWAP C! 


DISPLAY 


» 


24 


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


Number 25 






. 


Instead of giving a total explanation of this program, which 
would expand this article into a language manual, we will 
sketch how it works and browse some of the mysteries. 

The program is on two screens, numbers 100 and 101. The 
first line lists them both. Each screen has line numbers 0 
through 15. By convention, line 0 contains a comment describ¬ 
ing the screen. 

Forth comments are enclosed in parentheses. The left 
parenthesis must be surrounded by blanks. The right paren¬ 
thesis need not be preceded by a blank, though by convention 
it usually is. The reason for this asymmetry is that the left 
parenthesis is a Forth operation which causes an arbitrary 
character string to be skipped until a right parenthesis, which 
is a delimiter, if found. 

The ‘GENERATIONS’ definition, screen 101 line 15, is the 
main loop of the program. It contains a ‘DO’.. . ‘LOOP’. ‘DO’ 
takes two arguments from the stack, the initial value from the 
top, and a termination value below it. Looping stops one short 
of the termination value; e.g. ‘15 0 DO ... LOOP’ loops 15 
times, with the index going from 0 through 14. Arbitrary com¬ 
putation of looping parameters is of course allowed, since ‘DO’ 
doesn’t care how its arguments got on the stack. 

It may seem strange to have the loop termination value 
before the initialization, the reverse order from BASIC and 
others. But this way you can say, e.g., ‘15 GENERATIONS’, 
which puts 15 on the stack and executes ‘GENERATIONS’, 
which puts 0 on the stack and executes ‘DO’. We more often 
want to pass a termination value than an initialization value to 
a routine. 

The Forth operation ‘I’ places onto the stack the current 
value of the index of the innermost ‘DO’ loop. This leads to a 
very strange fact in lines 2 and 3 of screen 101: ‘J’ refers to 
different ‘DO’ loops in the two lines, because the ‘DO’ at the 
end of line 2 has changed the level of nesting. 

‘XLEN 1-YLEN 1-ARRAY UNIVERSE’ creates an array 
named ‘UNIVERSE’, or dimensions 80 by 24 because XLEN 
and YLEN were created with values 81 and 25 in the preced¬ 
ing line. Notice that these statements are outside of any colon 
definition; they are executed immediately when typed, at 
“compile time” (although it is “run time” for the ‘CONSTANT’ 
and ‘ARRAY’ defining words). In Forth, compile time and run 
time are definitely separated yet very much interspersed). 

‘I J UNIVERSE C@’ places the values of ‘I’ and ‘J’ on the 
stack, then executes ‘UNIVERSE’, which is an 80 by 24 byte 
array, but is also an operation. ‘UNIVERSE’ takes two index 
values from the stack, and returns the address of the selected 
byte. Then ‘C@’ takes whatever address is on top of the stack, 
and replaces it by the value of the byte at that address (in the 
low-order eight bits of the 16-bit top of the stack). Hence 
constructions like: 

I J UNIVERSE C@ 1 AND + 

which takes the I, J byte, logically ANDs it’s value with 1, and 
adds the result to the top of the stack. That is, it increments a 
counter (on the stack) if the addressed byte has a ‘1’ in its low- 
order bit. This statement is counting how many are alive in the 
three by three square surrounding the character in question. 
The character itself is counted, though it should not be, so it 
is subtracted out by line six of screen 101. 

Line 14, screen 101, is an optional operation to allow the 
size of the array to be changed—but never to go over 80 by 
24. The operation ‘ [’] ’ gets the address of whatever follows it 
(in this case the constant ‘XLEN’ or ‘YLEN’). Later, *!’ stores 
the second item on the stack into the address on top of the 
stack. In other words, this line changes the values of 
“constants” ‘XLEN’ and ‘YLEN’. Operations like *[’]’ are 
mainly intended for use in implementing the Forth system, 
but they are available to the applications programmer. 


Incidently, the ‘ARRAY 1 operation (which created 
‘UNIVERSE’) was itself defined by the programmer in two 
lines of code not shown here. ‘ARRAY’ is an example of a 
user-defined variabletype. The full power of Forth is 
available to specify what happens at compile time (e.g. allo¬ 
cate space for the variable, if a static variable is wanted), and 
at run time (e.g. compute an address in the array, given sub¬ 
scripts). 

One more operation which should be explained is 
‘IF’... ‘ELSE’... ‘THEN’, e.g. in line 13 of screen 100, 

I J UNIVERSE C@ IF [ *] ELSE SPACE THEN 
The ‘IF’ operation takes one argument off the stack. If it is 
non-zero (true), the phrase after the ‘IF’ is executed; it it is 
zero (false), the phrase after the ‘ELSE’ is executed, if there is 
an ‘ELSE’ phrase. In either case, control resumes after the 
‘THEN’. This line takes a character from the array, and if it 
is non-zero prints an asterisk (left bracket introduces a literal 
string to be printed, and seeks a right bracket as delimiter), or 
if the character is zero prints a space. 

Forth isn’t difficult—as this condensed description may 
make it seem. Just unusual. 

How it Works—Internals 

We don’t know of any implementation documents. This 
section is a sketch in that direction. 

The basic structure of Forth is simple. The difficult part of 
the language design is the selection of operations such that the 
language is able to implement itself gracefully. And the coding 
of the Forth system operations can be very dense. At this 
point we are concerned with the structure of the system, not 
the semantics of the particular operations. For a fuller descrip¬ 
tion of the language itself, see the Decus manual (reference 
in bibliography), which to our knowledge is the most complete 
documentation readily available today. For a fuller description 
of the internals and implementation, check future publications 
of the Forth Interest Group, 787 Old County Rd., San Carlos, 
CA 94070. 

The central structure of Forth is the dictionary. Every oper¬ 
ation, primitive or defined, has an entry in the dictionary. All 
applications software, and virtually all of the Forth system, 
consist of dictionary entries. Of the 5K to 6K bytes of a 
typical microcomputer Forth system, only about 50 bytes are 
not part of a dictionary entry. 

All dictionary entries have the same format. In most Forth 
systems, the first four bytes identify the word; the total length 
of the word, and the first three characrers, are saved. Opera¬ 
tion names may have any length; but if they have the first 
three characters and length the same, they will not be distin¬ 
guished. This system works quite well, and confusion is rare. 

Besides the length, the first byte also has a precedence bit , 
which tells whether the operation is immediate or not. Immed¬ 
iate operations are executed even when the system is in com¬ 
pile mode, and usually act as compiler directives or macros. 
Compile mode is set by the colon, and cleared by the semicolon. 

The next two bytes have the link address. This is simply a 
pointer to the previous dictionary entry. Its purpose is to 
allow the dictionary to be searched, at compile time. 

The next two bytes are the code address. This address is 
fundamental. It always points to machine code. In a code 
operation (either a primitive, or a user-defined assembler 
routine) it points to the code which implements the operation; 
this code begins immediately after the code pointer. In a colon 
definition (i.e. a standard Forth statement), it points to code 
which controls nesting at run time, described below. In a 
variable, the situation is more complicated. In this case, the 
code address points to code in the dictionary entry of a 


Number 25 


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


Page 25 

219 


defining word—a kind of operation which (a) when used at 
compile time makes a new entry in the dictionary, and 
(b) contains code which is unique to that particular class or 
type of variable, and which is executed at run time. 

The eight bytes described above form the header of the 
dictionary entry which defines any Forth operation—code 
routine, colon definition, or variable. The body of the diction¬ 
ary entry consists either of machine language, a list of 
addresses of previously-defined operations (which may have 
literals interspersed, each preceded by the address of a literal¬ 
handling routine), or the value or address of the variable, 
array, etc., respectively. 

Now we know what the dictionary looks like, for it is 
nothing more than a string of these dictionary entries. And 
the dictionary makes up virtually all of Forth —the compiler, 
assembler, operating system, and all application software 
written by the user. Only about 50 bytes of code are outside 
of the dictionary. This little bit of code, known as the inner 
interpreter, is the heart of the system. 

At run time, all operation names have been replaced by the 
addresses of their dictionary entries, so the inner interpreter 
works with addresses only, and never has to search the 
dictionary. The inner interpreter uses a pointer, ‘F, to the next 
address in a definition to be executed. If possible, T will be 
kept in a register, because the inner interpreter must be ultra 
fast. 

Consider a particular dictionary entry for a Forth defini¬ 
tion, and assume that one of the operation addresses in its 
body is just finished being executed. T now points to that 
address in the dictionary entry. 

If the routine which is finishing is a code routine (primitive 
or user-defined), it will end with a machine-language branch 
to the location ‘NEXT’ in the inner interpreter. There, code 
will increment the ‘I’ pointer by two, leaving it pointing to the 
dictionary entry of the next operation to be executed. By an 
indirect fetch from T, the code address of this new entry is 
moved into another pointer called ‘W\ Then the inner inter¬ 
preter branches indirectly to *W’; i.e., it branches to the code 
address of the next routine to be executed; the code address 
always points to machine code. This linkage process takes as 
little as two instructions on minis and eight or so instructions 
on eight-bit micros. 

This is the linkage from one code routine to another. If 
the new routine is not code but is a Forth definition instead, 
then the code address in its dictionary header points to code 
which handles the nesting by pushing ‘I’ onto the return stack, 
then setting T from ‘W’ to point to the address just before the 
body of the Forth definition, then branching to ‘NEXT’. 
Similarly, when the Forth definition ends, the semicolon 
operation points to code which pops the return stack into T 
(removing the last level of nesting), then branches to ‘NEXT’. 
There is also some auxiliary code for performing stack opera¬ 
tions and then falling directly through into ‘NEXT’, for 
efficiency. 

This completes the description of the inner interpreter and 
of the nested execution of Forth operations. This linkage 
happens at all times—compilation, assembly, editing, or 
execution of applications software. In fact there is no funda¬ 
mental distinction between these times, as the whole Forth 
system, including the user’s application software, is one unit. 

Miscellaneous Features 

Multitasking 

Forth is well suited to multitasking, which has been imple¬ 
mented on minis (though not as of now on micros). E.g. a 
Nova 2 (35K words) has handled up to 32 terminal users 
simultaneously. To switch users, only four pointers have to be 
changed. Each user has a private vocabulary, in addition to the 


common vocabulary. Communication between users is accom¬ 
plished by simply leaving messages in agreed-upon places. 

Also on minis, a data base management system has been 
implemented as a Forth superset. 

Disk Managem en t 

Virtual-memory software is standard for both micros and 
minis. Data is read and written in 128-byte blocks. The editor 
addresses 8-block (IK) units, which are called screens because 
they fill 16 lines of 64 characters each on a CRT. (A CRT used 
on a Forth system should be able to display 16 lines of 64 
characters.) 

The system should have memory room for at least 8 block 
buffers, so that a whole screen can be displayed; the same buf¬ 
fers are also used for applications and disk I/O. Programs 
request blocks by number, without regard to whether they are 
in memory or must be brought in from disk; the system checks 
whether the block is in a buffer already, reads it from the disk 
if not, and returns the memory address of the block on the 
stack. Programs can use the ‘UPDATE’ command to mark a 
block as changed; it will be written to disk before that buffer 
is re-used. ‘FLUSH’ will write all updated buffers which are 
currently in memory. 

The system treats input identically, whether it comes from 
the disk or is typed in. This allows use of ‘load screens’, which 
contain commands to load other screens, so that the system 
and/or applications programs can be loaded automatically. 

Dictionary Management 

Forth is hard to categorize as interpreter, assembler or 
compiler, and some have even questioned whether it is a lan¬ 
guage. Whenever a character string is typed into Forth, it is 
first looked up in the dictionary. Only the first three charac¬ 
ters (five in some Forth versions) and total name length are 
used for the match. If the name is not in the dictionary, the 
system tries to make a number out of it, using the number 
base which is currently in effect; if that cannot be done, an 
error message is issued. Forth operations must be defined 
before they are used. 

It is OK to re-define a name which is already in the diction¬ 
ary. Later uses of the name refer to the new definition, but 
earlier uses continue to refer to the old one (these earlier 
references have already been compiled). This means that there 
is no worry about accidently re-using a name, unless the old 
meaning must be used again the same program. Therefore the 
programmer can freely make use of temporary names in build¬ 
ing up the definitions of new operations, without worrying 
about later conflicts. 

For convenience, it is possible to ‘JOIN’ non-adjacent 
definitions, taking all intermediate definitions out of the 
dictionary search path. 

There is also a ‘FORGET’ command, to wipe out the most 
recent dictionary entries. It is used to clear away recent 
scratch work. Care is advised. Forth allows you to ‘FORGET’ 
the entire system. 

But the most powerful form of dictionary management is 
the use of vocabularies. Each vocabulary is a separate linked 
list of dictionary entries. Vocabularies are used to control the 
order of dictionary search. There is an ‘ASSEMBLER’ vocab¬ 
ulary which contains the op codes, etc; and ‘EDITOR’ 
vocabulary contains text editor commands. Also, users may 
define their own application vocabularies. All vocabularies 
link into the ‘FORTH’ vocabulary, which is the root of the 
vocabulary tree. In other words, if an operation name is 
not found in whichever special vocabulary is in effect, the 
‘FORTH’ vocabulary will be searched. Users can define 
sub-vocabularies which similarly link into each other. 

Vocabularies are implemented by the link pointers in the 
dictionary entries. In addition, each vocabulary has a diction- 


Page 26 

220 


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


Number 25 



ary entry in its root vocabulary; this entry associates the 
vocabulary’s names with a pointer to its last dictionary 
entry. 

At any time, two vocabularies are in effect: ‘CONTEXT’ 
and ‘CURRENT’. ‘CONTEXT’ works as described above, 
determining the path of dictionary search. ‘CURRENT’ tells 
which vocabulary new definitions will be linked into. If 
all this gets confusing, keep in mind that in any Forth system 
there is only one dictionary, but there may be many vocab¬ 
ularies. Further discussion of vocabularies is beyond the scope 
of this article. 

Microcode 

There is much interest in microcode implementation of 
Forth. One approach is to microcode only the inner inter¬ 
preter. At most this could double the speed on micros and less 
on minis, so it would probably be more practical to use a 
faster chip instead. 

The other approach is to microcode all 40 or so of the 
primitives, plus a few other operations for completeness (as 
there would be no “machine language” to drop out of “Forth” 
into). Such a machine would be many times faster. While work 
is proceeding, we don’t know of anyone who has done it yet. 

Transportability 

Forth is easy to move to new machines, because only IK 
bytes must be re-written. An experienced implementer can do 
it in a few weeks. Some care must be used when transporting 
higher-level definitions to machines of a different architecture 
—e.g. when going between high-order vs. low-order byte first, 
character arrays may need attention. 

Cross-compilation is possible, but complicated because 
Forth operations need two definitions, a separate one for the 
target machine. 

Complex vocabulary manipulations are used to keep the 
two sets of definitions separate. Cross-compilation is common¬ 
ly used when the target machine is the same chip, but to run 
without a terminal and perhaps from ROM, e.g. for control 
applications. In this case the purpose is to compress the pro¬ 
gram by eliminating those primitives and definitions which are 
only used by the compiler, and to shorten the remaining 
definitions by removing the name characters and the link 
pointer (which are only needed during compilation). 

History and Availability 

Forth was developed by Charles H. Moore around 1970, at 
the National Radio Astronomy Observatory, and to our know¬ 
ledge was first described in publication in 1973 1 . Later Mr. 
Moore left the NRAO and is now marketing the language 
through Forth, Inc., 815 Manhattan Ave., Manhattan Beach, 
CA 90266. The price is $10,000 for the larger, minicomputer 
timesharing version, including on-site training. The micro¬ 
computer version is $2,500, sent by mail and including tele¬ 
phone consulting. A “primer” is available separately at 
nominal cost. As of May 1977, Forth Inc. offered implementa¬ 
tions on the COSMAC, 8080, 6800, Z-80, and LSI-11. 

A version of Forth for the PDP-11 is available through DEC 
Users’ Society, 126 Parker St., Maynard, MA 01754. Distribu¬ 
tion charge is $60 for tape, or $23 for floppy. It runs under 
RT-11 or stand-along, and needs 8K. PDP-11 Forth is DECUS 
No.11-232. 

The DECUS manual is sold separately, for $2. This is the 
only manual we know which is readily available to the public 
at this time. 

Also on the 11, Doug Faunt, PO 60116, Sunnyvale, CA 
94088, or phone (415) 494-7030, will soon be publishing 
the LSI-11 Newsletter, can supply a DECUS floppy version in 
exchange for a floppy and return envelope. 


For CP/M, a Forth version called STOIC is available from 
the CP/M Users Group, 164 W. 83rd St., New York, NY 
10024. STOIC is Vol. #23, and the distribution charge is $8. 
Documentation is on the floppy. 

The STOIC system takes about 13K for its basic definition 
and assembler; why is it so much larger than other systems? 
Several K are used for buffers to interface CP/M; and the first 
five characters of each name, instead of three, are saved in 
each dictionary definition. Also there are many more opera¬ 
tions than in the smaller system, such as a more complete 
signed and unsigned arithmetic. STOIC also has additional 
packages for vector and matrix operations, double precision, 
and floating point. 

Forth versions are running at various universities and 
research institutions; Rather and Moore 7 list three where it is 
available. Also, University of Rochester and University of 
Arizona have implementations on Varian 620-1, CDC 6600, 
PDP-11, and IBM370. We don’t know about distribution 
arrangements. 

For the Z-80, the Digital Group, PO 6528, Denver, CO 
80206, has announced CONVERS, its version of Forth, to sell 
for $26, with the manual selling separately for $10, creditable 
toward purchase. However, the product is not yet out. 

For the Alpha Micro, a version is being developed by Alpha 
Micro Systems, 17875 N. Sky Park, Suite N, Irvine, CA 92714. 

Programma Consultants, 3400 Wilshire Blvd., Los Angeles, 
CA 90010, is developing Forth versions for the 6800, 6502 
machines (Apple, PET, OSI), and other micros. These are 
intended to run without floppies. 

A newly formed Forth Interest Group, 787 Old County 
Rd., San Carlos, CA 94070, is an information clearinghouse on 
the language; it does not have a version for distribution at this 
time. 

Summary 

Only recently have sophisticated programming languages 
become available for home computers and small development 
systems. There are others besides Forth, such as Pascal, or C. 
Probably each has certain applications which it can do best. 
Forth is very different from anything else. It is remarkable 
that so rich a language, which is also a stand-alone operating 
system, can be implemented with 6K bytes. 

Software development times can be greatly reduced, espec¬ 
ially for large projects. Rather and Moore 7 give as example a 
radiotelescope control and data analysis system, including 
on-line interactive graphics, which they claim would typically 
be estimated at six man years and with 64K of memory 
required. It was implemented in Forth in 24 man weeks and 
16K. 

1. Moore, C.H., and E.D. Rather, "The FORTH program for spectral 
line observing," Proc. IEEE, vol. 61, September, 1973, pp. 1346- 
1349. 

2. —, "FORTH: A new way to program a minicomputer," Astron. 
Astrophys. Suppl. 15 1974, pp. 497-511. 

3. DECUS, Forth Programming System for the PDP-11 , DECUS No. 
11-232, September 1975. (Note also manual for the PDP-10.) 

4. Stein, P., "The FORTH dimension: Mini language has many faces," 
Computer Decisions, November, 1975, pp. 10. 

5. Rather, E.D., and C.H. Moore, "FORTH high-level programming 
technique on microprocessors." Presented at Electro/76 Professional 
Program (paper 23/4), Boston, MA, 11-14 May 1976. 

6. Sinclair, W.S., "Forth: A Stack Oriented Language," Interface Age, 
September 1976. 

7. —, "The FORTH approach to operating systems," A CM '76 Proc., 
pp. 233-240, October 1976. 

8. Forth, Inc., Microforth Primer, December 1976. 

9. —, "The use of 'FORTH' in process control." Presented at Inter¬ 
national '77 Mini-Micro Computer Conference, Geneva, 26 May 
1977. 


Number 25 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Page 27 

221 



RESIDENT MEMORY TEST 


With An Example For The 6800 


BY TERRY RITTER 

Motorola, Inc. 

3501 Ed Bluestein Blvd. 
Austin, TX 78721 
© 1978, Motorola, Inc. 
Reprinted with permission 



A memory test package can be a very useful utility for a 
microcomputer system. Not only can it provide periodic 
checks of memory functionality, but it can also give day-to- 
day checks of the system after re-configuration. Getting a 
moderately-complex program to actually execute says a great 
deal about the correctness of the entire computer. Testing the 
area which is supposedly RAM isolates address-decode and 
board-contact problems which could otherwise inhibit opera¬ 
tions. A small and fast memory test package can confirm the 
correctness of a dynamically-changing system to a high degree 
of probability. 

A resident memory test system must usually assume some 
degree of RAM correctness in order to execute the program 
(even if executed from ROM, the program will probably need 
temporary storage, and will inevitably use subroutines). 
Further, since RAM is being tested under the control of an 
instruction sequence also derived from memory, the test pro¬ 
gram cannot check access times. Dynamic RAM refresh prob¬ 
lems are especially difficult to check, since all memory acces¬ 
ses should be halted while stored charge is given the oppor¬ 
tunity to leak from inside dynamic nodes. At room tempera¬ 
ture, this may need to be a minute or so, making the resulting 
test very long. Nor do most systems even consider temperature 
or operating voltages which will define the limits of valid mem¬ 
ory operation. A resident memory test is functional only, and 
valid only at one point in time. 

Nevertheless, it is possible to make a reasonably fast and 
effective memory test system. At the very least, each memory 
bit must be written to a ‘1’ and recovered as a ‘1’, and written 
to a ‘0’ then recovered as a ‘O’. This is possible using a simple 
“write $FF, check, write $00, check” sequence, but this 
sequence will not detect changes in other address locations 
which are caused by these operations. A better method is to 
store a pattern over the entire test area then recheck every 
location after each write to a particular cell, but this is clearly 


an N 2 algorithm, in terms of time. 

Another test method is to place a known sequence of bytes 
in the test area, then recover this data and compare it to the 
internally-generated sequence. Two passes of a known pattern 
can check each bit in memory. But if the pattern has a length 
divisible by 2—and is shorter than the tested area—the same 
byte values could appear in similar areas within, say, two dif¬ 
ferent pages. Now, if an address-decoding fault causes a single 
memory block to be enabled for multiple address blocks, and 
similar data is stored in each address block, the error will not 
be apparent (since the second write pass in the enabled block 
writes the same data as the first pass, it may be considered not 
to have occurred). A testing improvement results by 
generating a sequence whose length is relatively-prime to the 
minimum enable-block size (say, IK). Now, the same byte 
value cannot appear at a similar location on different multiply- 
decoded pages, and the error of multiple address decoding will 
be detected. 

Once an acceptable test algorithm has been found it is 
necessary to consider the operator interface. It is clearly neces¬ 
sary to be able to define the test area, and any error displays 
should include both the error address and indicate the bit-in- 
error. The program must be operator interruptable, both to 
halt a long error listing, and to re-specify the test area. The 
operator should be able to command a return to the overall 
calling system. The program could be made to verify its 
integrity before beginning. And, if the package is position- 
independent, the program could be made to move to a new 
location to test the area where it was originally located. 

Most of these principles are included in the program 
MTEST9. Written as an example of a standard-product ROM, 
it can be used with different hardware designs having ROM, 
RAM, and I/O at arbitrary locations. The sample output 
shows execution of various options, as well as the ramifica¬ 
tions of some different types of inappropriate commands. 


Page 28 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 25 

222 



— 3 3 r< 3 3 3 3 

b- o C» C* O O O O o 

— LJ LJ UJ LJ LJ LJ LJ LJ 


3 x z 
Cl - Ll 
<_> in 


I K 
- Z - 

: oo o © 


•1 Oj >—■ j • 


* — X l- Ul 

O Ct LI Z 111 

I X X 3 i 

•3 CL Ui 

u) * in uj 

o a it ^ 
- \ X Cl 

O !2 Z I Cl 

II — OX 


O n 
n Uj 
O _l 


© I d *- i— 

ii I I u hi 

X c> Cl o 


I I I u u 

X U O — -I o 

<_> z z z z iu 

C> — — — — Oj 


•a -a i a i <i x x 

u a ii a- a. n n n 

fljiiiajixi&jiiiiiiaj 

_i_J_ 

a ia. ioiii 

— x u z - a i3 

©ZljZZZZLJ 

e — o —-co 

>>>>>>>> 

ii-i-i-i-j-i-i-i- 

lii CD (it ID CO ( .0 ID <X> 


Ul UJ 

uj r 
e — 


x in - 

»- _j u- 

• 3 c 

• 3 CO 


x u. a >. ■ 

•— -i <-> a 
aituL 
a u <i in 


o uj 

z i 

ui 

a o o _i 
u x »- OJ 
oli ai 
4 it Z > 

in z - • i 

E Z E X X h- 

O LI l- — x 

it x <r x w ^ q 

L I u i? 

U — X X * 

li It 1 U. UJ 111 L 

x <r :c x _i 

x x k i- d 

U U ll iL (L 9 u 

lu Ul 

Cl Q > > Cl Ci O 

Z Z 7. Z Z Z L. 

ul lit O O LlI LJ LJ 

i/' in o o in ui in 


- i- ui 
iJiiiiit'iL.'io 
U .< •< N 9 I- h J Ul •! 
J-J-UUIJ-l-XXddd 
3 3 i t 3 3 a cj o uj v> 
c o u o o o a. u. u n & 


•I T X 'I X X X 1 XXX 
ll i ll: L ui L Hit ii it 0. 

ill iXJ Oj i»j 01 lU 01 Oj ill 01 01 

U JlZN’t'l* r- J 
I- J- :< X I- F- X X d 0. d 

j j uj m j I i u ii m i/i 

c» o x i :• o cl a o. d d 

>,->>>>>>:>>> 
»— i— t->—i— »—»— i— i— t— 

•10 CC> CO <0 10 CO 'O 10 lO 'O (O 


Cl X 

X 13 

z o 

- X 


z a 
- z 

d X 
U Cl 


X X 

ct ct 

Oj OLI 


Z Cl 

- z 

d X 
Cl d 
> > 


- cn e 

_J UJ o 
x in d 

- in Cl 
h- UJ 

- d _l 

z a _i 
-ox 

X E 


* X 

o z 

X d 


E O 
UJ X o 
»- I- E 

in in > 


d O 3 
UJ X X 


tt * * « 


O CO Cl 
XX —J 
J— Cl o 

cn o 

X CL 
z a_ - 
o uj 
uj * *- 
in oi o 
Ul oc ct 
J- CL *- O 
3 d m u 
_J 3 

O <L X <c 
cn i ci u 

m j x d 

X X ^ X 


L- X X Q X (5 
in — — — - oi 
uiinuoci-Ljii - 

F- I X X E * X ‘ ff> 


Xd3>-XXZClX 
LlJQClCliri-li ui 
JO J J J(L l-_J 


* e 0i e 

co oo co g cn © co ui 


E C» 

O Cl 
Cl UJ 
Z I— 

X Z Ul 

0 : - z 

i d - 
O Cl J 


d cl ci m cn d . 


I <_! Cl 

L Cl Cl 


UJ c 
o uj < ft a 

Z T OX 

-- u. a 

i- Cl O X Z 

ii O — 

X Cl • Cl 'J 

I- u. O Z LJ 

01 UJ Z UJ Oj 


d Ci 
X X 
X X 

U O 


u> g g eg oj © 


t* n n in f- o ji 


u o : 
c> x v 
ci - ; 


l O J "J O lO O I 

> o a © o © o o ■: 

j iu UJ U UJ Ul UJ LJ l 

00 J- 

3 ZOO 

I 01 Cl 'J 3 X X 

[ I- — LJ X O Cl <5 

■ 3 X UJ J O Z UJ 

I O E 01 L.' LJ (Cl 


I I 
o o 
3 3 
Z © 


L L L li '• 0j O 111 

N 0j O UJ U li li U. 

© fit © © © © © © 

S il C> £' i Cl O Ci 


Q li h C> NCl I- Li 
•fftADOUfOa 
© 0J 0J ll 0J 01 0J — 
CiC’ OCiCiCiCiCi 


— 01 X ill U1 

g «j cn m x 

oj oj oj oj eg 

O Ci Ci C) & 


■Si U UJ OO 01 

X X X 00 u 

0J 0J 0J 0J 0J 

© © © © © 


o 

0J 

& 


in cxi 

0J — 


01 

oj g- ui ui 

till — 

U W U U T- C 01 N 

00UIU.U.U.N 


co *t *t oj eg o u 

O Ci C Si S Ci L 

Cl Cl c> c- c> c- u. 

Ci Ci C> Ci Ci Ci !L 


UJ3QjO>ajl'- 
II L. Ii li It U. 


u u. u. u. u u 


ui co xi cn Ui <ji uj ui 


UJ Ul CH UJ f Si CO Ui CD CO cn cn 


UJ 

C0 

N li UJ O UJ 9 U. 0J 
01 U) O — CO 01 »-01 


•s> c> 
o «• 


c. Ci 


01 ‘A CD <_i H 0J in aj 
Cl Ci Ci Ci Ci — — — 
99999999 
•SCiCiCiCiCiCiCi 


oi uj t- •» r- 

— ^ oj eg oj 

■t g- -t g *t 

C> Si Ci c* c> 


x a c- oi uj cn 
eg oj oi cn oi oi 
g g g -t g^ 
Cl Ci ® Cl Ci Cl 


U lL 
01 01 


eg ui x 

g g g g 
g g g- g 
Ci Cl C- Ci 


O’! Ul 

ui in 

g g 

Ci Ci 


0 - o m g> — eg oi g in 

NNScOKiftiCJaiai 
C- C* C> C’ C> C» C? C* Ci 

o Cl c« & c* c- c* o c» 

5i£>C05i®&S® 


■o a» 

<r.< oo 


c. c> 


— eg oi g ui u> 
cn cn u> O' IT> Jr 
Ci Ci C> O Ci c> 
® O O ® £' ® 

Ci Ci Ci O Ci c> 


r-~ jo ui Ci — 

u> cn j) c> ci 

©ClClT-- 
Cl C> Ci C* Ci 

Cl Ci Cl C> Cl 


Ul Ui 
O Ci 


oomes — ojoiguiUin-oCiiTiCi—g ui 
— oj oj eg oj eg eg oj eg oj eg ci oi oi oi 


N oo lii ci — (g oi 9 uj ui 0 - 
Oj C* - ! i t i g g g g g g g g 


oo J: c> — OJ oi 
g g Ui Ui Ui ui 


®®®S®G®SOC‘®® 


Ci Ci s> 
O Cl Cl 


Ci 

Cl 


G> C> Ci C> C* C« © C> Ci 
©©©©Ci©©©© 


Ci © © © © © Ci © 
©©©©©©©© 


© : 

a eg c 


«j + 

r> — Cl Cl 

G HI u. IL 

— UJ — H- 
Ci \ \ 
-■ «> «1 
L> U l 0- N 




U Ul E 
J- O X 
in u. cl 


cn i- 3 
uj uj o • 
i—jinr 
LliO 
> - <t Cl 
d a 

o -3 c> u. 

E Z O 
uj in 

e — in it 

UJ — 
l- ‘ Ui 
in o 3 d 
x N UJ 

li-QCi 

X 3 X 3 

UJ 

in z ■ z 


Ui ► 


i- »- v l/i n x 

x uj uj o i 

O £1 Ll 1 h O l 

O O C*. ll ~ 3 1 

3 U. O UJ LJ C 

u in x t 

h U l UJ Ll 111 Ll I 

in u ai cl — z - 

d Ui CL 

— Ui (ll * X ^ 
U Ul ll 1- E C 


X 3 Z 3 — . 


uj cn 
Ul u. 

- o 


, i r 

3. • i- . 

O X Ul - < 

U UJ 

•- cn i 

I- Cl U'l L . 

U- 13 UJ O J 

X I- ll o 


3 © 

Ul Z iu 

l/i — Oi 


• *3 z oi : 

: • x — h- : 

b- o in * 

i in ui — L.' • 

: uj ci a. i- t 

: x o e I 


•ujou-xd — du. 

d i o o i- © 

ia> •- ct — u. x 

IQ_I V d ct > 

j — a ui 


i X 3 C 
> Z 0 ( 

d cn i 


: cn 


J— Ul <3 

in ►- z 
ci l- e - 
UJ Ul 3 
I- UJ Ui 3 
U I- J- X 
X E Ct o 
X 

J- Z K- III 

zuini 

- I UJ J- • 
Cl i- Ci i 


cn ui i z i 


UJ Ui 
it ui 
Ll a. 


exx- 

J J- u t 

ioicn 


ujucicidt o a 


j — o d i 
z - Ui 

c O oj ui ui i 


i- j- > uj d 

E 0 3 0 1 

l- O O C 

3 UJ UJ C 

O Ci Ul i 


j a E 
£ Cl UJ 

-iini 

: x — o 

- o 3 

- d o 

j Ci UJ Cl 
C 2 J< I 
i :• uj j— 


3 o z i ■ 
3 X 3 

x uj x 


Cl UJ Cl ^ X 
Z 3 UJ 

x o :> 3 

UJ o o 


pi a X LL > 


I X UJ 3 I- O : 


J UJ — 

I Cl o 
• Uj Cl X 
Z E J 


3 o d i- ac i 

U Ll X Ll E I » 

in z it rg u. > z 


c uj in 

Z Z X 3 

X O 3 

Cl I — 

* J- 0 3 

: 3 UJ d Z 

l CL OJ UJ - I 


3 3 
3 O 

— o 

3 UJ 


J 15 X 

— in . 

JLIU. 

: z in in • _ _ _ 

-03inoi5U)33 — X 3 

o a. i _ 


: o o ci i- * 

n x z © 

c ui — a. uj < 

cn cn i 


C 3 UJ X Ui o 
3 — Ul 3 Z d 
• Z Ul 3 Cl O 
J X X 3 X‘ 


— d X — l 


I O O UJ 3 3 


Cl 3 UJ X O 

a o a. o x ii 

X 3 U« O l 

3 X ll ' 

UJ X Ui O 

I- X •• 

3 3 J- I N 

O 01 Cl 


E d U 3 

- O it 3 




Z Hi X 01 3 O — li : 

ui cl x x z m — u. i 

it 3 I- Cl X Ul J- II — 

UJ UJ X UJ UJ o o 

UL-3QKOZZ l 

uujj- 3 z — in •; 

— Uj Ci-IX*- l-d 

© X Z 3 >■ Z UJ I 

> in x uj o 3 hi i— 

3 3 • J- it 3 E Ul 

•ZCi_I01>- X UJ E 

EO O+ilil-ZdX 

UJ ' d I- 3d — d 

©Quji-uiuja.uj3X 

I/IUJI-ZUOI-I-OIL 

>Ui-0l-03XU 

enZOQOEEOUJdX 


***♦.< 


d X 

o x : 
u. o * 


3 UJ _ 
i Ll CL UJ 

i U. O X O X 

3 Z <3 X UJ 

d d X Ul IL d 

■ O O O UJ Ul X 


z-- - o 

UJ O O O O O 2 
UJ Ui Ui Ul Cl Ui I- 

d x x x j a ui 


3 3 3 3 3 3 2* 

o o o o o o o 

Ul UJ UJ ill LJ UJ UJ 


id© u- x o a 

— 3 3 O X X 

iddi-uidi- 

« e o o o uj in ui 


g ui 

Ll. U 

o o 


>©©©9Cigoj — 
I g (J - © © © © 

, Ii Ii III Vi U Hi K 


>3 333333 

> o o o o o © o 

J UJ HI Ll LJ U Ll IU 


i © X oj qq © g 

■ © © — — oj eg 

• © © © © © © 

. © © © © © c» 


g ui 
u. u. 
o o 


© © © © Oj g 0J — 
ojgoj »-©©©© 
© © © © © £> © © 
©©©©©©©© 


— 01 g Ui Ui i ' 
«• © © © © © 
© © © © © © 
© © © © © © 
©©©©©© 


ai © — eg Oi -r ui ui r~ mi in © — eg cn g iri ‘ 2 i n oo c> © — oj oi g ui uj h- «o m © t- ig oi g in ui h- a® ai © ■»- eg (*■, r. «o cn c> r- eg 
— — — — — — — — ^ — oj eg eg eg eg oj oj eg eg eg eo co oi oi o"i oi oi oienoigggggg g ggginuiininininuiuiuiujui 
©©©©©© ©©©©©©© ©©©©©©©© ©©©©©©©©©©©©©©©©©©©c>©©©©©©©©©©© 

© c> © Z> C- -I’ © © © 3 © © © © © © © © © © © © © © © © © © © © © c> o © © © © © © © © © © © © © © © © © 

©©©©©©©©©€•©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©©© 


0« a© IT) © »- (g 01 g Ui 
Ul 10 Ul N r- N N N N 
©©©©©©©©© 
©©©©©©©©© 
©©©©©©©©© 


Number 25 


□ r. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 


Page 29 


223 







W 
O Ll 

z — 
_1 
Q 0. 
UJ Z 
UJ ~ 


z u. : 

2 ) _) c 

T- o CL X P 

cl '.o o u » : 

Cl # >C Cl * < 


Z lii 
Ul -> 
CL CL Z J 
O O <1 
CL CL Z > 
CL CL O 
UJ Ll it Z 

lL O 

Z lL Cl 

- o o z 
<r <r 

Cl Z U CL 
Z O CL I 

o *-* o 

O h UJ Cl 
ltd DD 


j <r z 
• o — e> 
: c cl in 

- CL Z 
: i- 

. z cn cl 

— L) 

> CL I- Cl 

i cl " <r 


J Z CL I- 
: o u <i 

Cl 00 

; z i- 
> ‘UJ z 
: co z — 
: uj uj o 
J v CL CL 


c <r cl 

J T. J Cl 
. UJ lL I 


<1 CL l 

a o 

Cl cl I 


_i o <r o 

d E > Ct Q 


Z~Cfl — h- 
UJ CL UJ CL UJ 
Z CL Cl CL (3 


cl in — cn — ou 
co in - cl - cl - 

* .L T- CL <S> Cl a 


z <r 

•a I 

UJ o 


in i 
in z 
uj — 

CL i 
Ll Q 1- 
_!©*-© 
iz -a oo a 


UJ 

I U I < 
O <1 o 

1 t* h Cl I- in l 

to * © m r> v < 

• I- # o # ■:> fi ; 


10 CM U'i Cm CM 


x oq <r 

CL — O O 
CL O O 
uj <e a 


0 . 0 * * * l 


- uj o a 
■ z z UJ 

- 00 ~ _J 


CL CL i 

cn in • 

CO Hi l 


J tr'i fiCi CL it CL . 

i cn ci o'i o cn : 

J J _l fci UJ CO C 


oo o o oo 

0 <J O (J 
U_ Ll L L 


oo n in r- co n o'i co co uj co c>j co in n t r- o 


‘ *1 O’ -I Cm -I 


ClClClCluJCLClCLCL 


in CvJ CM C'J *t P: in CM - 


in o'i oo — cl u: — in 

i <i i _i m <r -d d cn <t in u uj _j 
cn a cn (/- i lj Ci cl a oo ci oo uj :x z 

Cl. -j Cl-IUOO_JOO_l_l_J_JClOOOCL 


0 CL h- 

(0 W If) fJ 


CM (0 

C l— l— 0 . 

to cvj to cvj <o c*j co uj to in 


<S> If) t- co cr> 

O Cl <1 Cl 

) — ci uj 1T1 uj ci — t- cvj — co — <j> in lo 

- © in in © in oo © © co © © © id co uj co m 


i © Cm © uj 


ai oo ci u. c»j rt 

lL u. lL u. © © 

r* rt <* in in 

© © © © © © 

to r*» « cr» o 

to co co co *r •* 

C'J C'J cu CM C'J C'J 

© © © © © © 

© © © © © © 


f'- CTl 00 C' 'l — CO N <1 Cl II C'J rt N <T» 00 Cl II 

©©©©©^-t-^^ — ^ CM CM CM CM CM CM CM 

in ifi u*i in uj in uo in in u") m in in in in in iri in 

©©©©©©©©o©©©©©©©©© 


1- CO 00 N 
co CO n in 
in in if) in 

(Si © © © 


■* <r oo o a il © cu co 

U'< U'i U’l If) U”i Ifi (!'• Uj co 

U') U'i U'i Ifi Ifi Ifi Uj Uj U'I 

©©©©©©©©© 


CO rt U1 Ul N 00 (X) © T- C'J CO >t Ul CO !•' <1 IT) O T< w n U Ifi III N «j (T) C> T* (U CO CO !•- 70 CTl © ■-> C'J (0 *T Ifi Ijj r~ ti 

rt rt rt rt *t »t «t in in in in in in in m in in to ui u) u> co tu to tu cn u> r-» r- n r* i - r- r- oo *;• a «o oj oi «j © 

(M CM C'J CM CM C'J C'J C'J C'J C'J C'J CM CM CM CM CM CM CM CM CM CM CM CM CM CM M C'J CM C'J CM CM CM C'J CM C'J C'J CM CM C'J CM CM C'J CM CM 

© © © © O' © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © © ©• 

©©©&©«>©©©©©©©©©©©©©©©©© ©©©©©©©©©©©©©© ©£>©©©©© 


<f ll' Hi I 
ID 10 CO «• 

u'i u'i in in 

© © © © 


Di U li. n 10 CO OU 00 
(ilfidiNNSNN 
U'i Ifi in U'i uj U'I U'I U'I 
©©©©©©©© 


N f- 

u j in 

© © 


© — CM 10 rt U'i CO f» od CTl © t-i i;m Ci * ifi UJ N oO CT) © 

CTl iT> O’i CT) CD CTl CT) CD CT* CT) © © © © © © © © © © -r* 

CM C'J C'J CM C'J C'J C'J CM CM CM CO CO CO CO CO CO CO CO CO CO CO 

© © © © © © © © © © © © © ©©©©©©©© 

©©©©©©&©©©©©© 3) © © © © © © © 


u cn © 
z in m 

UJ I UJ 


I U'i 

o a 

Ci iL 
D 

UJ CL 

in UJ 

CL I 


Z CL 

a cl 

CL UJ 

a > 


a — 
- z 
o — 
<r > 


<i u 
o Cl 

o ‘ • 


z uj <r 
■2 U'i a 
CL Z Cl 


z z 
i U CL 
I CL Cl 


y. x 

Ul UJ 
Q Z C 


uj o <r 
— Ul C _! 
• (OXlL 


: a a ; 

uj o 

> UJ U! ■ 

i in ao 


<r — 
: o l- 
- Z (Cl 


UJOdX 


ci co <r cm 

z x + h It O h 

2 - co ui u. r u'i 

CL © fti ‘K-UJUJt- 


Ifl O.Ul Ci 


h- Z UJ Z UJ Uj 

Z CL d U I IL IlI 

D Cl r (Ij U U'i # I- 


cn cl 

o z> 

ZlL f ‘ 

Ul - <3 Cl 
I EL d Ifi 
I— O d O i— 


Cl X CL 

u. <r i/ i 

U) 01 


CL CL 
a u'i 
a oo 
<r _j 


_i <t <r -a cl 

<i Cl i- »- _i 

— _j cn cn o 


: -1 d in il) 1 (l C* c* i Cl l- 

) O U! UJ ftj ill <»j Z Ul ftJ Z J 

I J J .J -J J U U 01 _l !_| 01 


UJ Cl' © CL <T 

U'i L 1 ul d l/J d CL Ul 

tr 01 Cu © |jl V- L Z 

dJJJJlflUiU 


O X Cl < 

co a u i <i <r 

Ul 00 Ul Ct 


oi o oo o oo 
Ci •_> o o u 
IlIlIlIlIl 


UJ CO CM CO (Jj CO 


in ai uo uj co r t r> co 


O'I f- U'I to U'I 0J CO 


CTl f- Ifj © 00 


00 © © 

m- <r -a 

© U U_ © l 

© U_ U'I © l 


in ui 

•t ’t 

© © 


M f* d U l 

(Il (Il CU (jO c 

•* ' 

© © © © < 


IT) m Q II 

n t~ r~ c- 
'J ^ 4 
© © © © 


10 U’I 

«0 oo '>0 

tT M- 
© © © 


r- O'i •_> ui © 
CO 00 «j flO CTj 
rfrT'T't’t 
© © © © © 


CM t Up 0 1 I Cl 11 - CO if oj -I 

CTi (J' (Tl CTl (D CTl ffi I <r <E -I •! 

rt- *t rj- rf M- rt -t rt M rt 

© © © © © © © © © © © © 


o u co m oo -i o 

•ll <3. 00 00 00 01 00 

rt rj -t 't *t «.*• rt 

© © © © © © © 


UJ CM Ifi N 
OO L> O L> 
't rt rt *t 
© © © © 


CT‘ 00 t_« Q Ul 

O U U Ul II 

rt »t rt rt rt 

© © © © © 




I 00 ff) © T- C'J co ’j U'I 'll I - ii CTl © T- CM 1.0 t Uj UJ N oo ffi © T- CM CO rt U'i Ul N ul Ul © t- CM CO rt U'i 'll r- © . 

i oj al oj O'i CTl CTi CTl CTl (Tl CT) CO (Tl CTl © © © © © © © © © © •— t» — t- t- -r- t- -r* CM CM C'J C'J CM CM CM CM CO ( 

i •< T- t- t 1 r" - - - - n - r* OJ C'l W C'J CM C'J C'J C'J C'J C'J CM C'J C'J CM CM C'J CM CM CM C'J CM CM CM Cm CM CM CM CM CM I 

• © © © © © © © © © © ©©©©©© © © © © © © © © © © ©©©©©© © © © © © © © © © © ■ 

'©©©©©&© © ©©©©©©©© © © © © © © © © © I?. © © © © © © © © © © © © © © © ^, , 


Page 30 


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


Number 25 


224 



z x 
— Id 
<1 I 


^ X * 
+ UJ Id 
X I > 
w I O 
•• Z E 
~ o 

Cl X Z O' 
Z W in 
a (x 
cn id o 

Id (f’i I I- 
O Id t- 
<3 Ct O J 

ino o 
in ci -cl 
id © in t- 
e z z 

X It o 
Q UJ => O 
Z X K 
id uj in 
© ct cl 
m id 

h- in cl u. 
Z 1- U 1ft 
— o z 


Id ISi 
Z K 
03 CL 


Z X 

- UJ 

© x 


a a 

Cl Id 
E 03 
U _J 


O'! X Ct o'. O' 

x <i in j in id in 

in Id ftj 3 co z t— 

0_I _l CL _J OJ CL 


r z 
o o 
a z • 

II CL 

in u 
in z 

in CL u. 

III D II 


_l Q 
O Z 
u © 


>- z : 
3 o a i 

Q. Z Z 


X X 
Id Id ( 
X X I 


_l X X 
3 Id Id 
EXT 


aoci o © o 


O 03 ■.< 13 

o o o o 

II IL IL iL 


x cj n I N I 
*-©xx©-©_ixx©ct 
zz - * z z z in - - z o 


in cl cl in cl cl a 

xincain-im~CLCLain~ cl & on a a. cn 
inoaci03303E_i_i(t03Ein£ti-(LrK 
a.Jjja.juooMjttiiBocfia)U(£ 


z o 
o 

“ X 


O z 

*- h- — X — 

I O') *3 K o I 
Id Id Id Z Z Id 

> I— ►- > 3 <X CL 

O E Id O O Ct 
E I 13 E O iIj 


w a e >- is 

Id 13 15 + + » - UJ 

I— Id CL X 3 *• O 03 

r3m * - * i e 3 ^ 

x in >- in 

<TZ3j-a<r<rid3CL 
IdlflCiODl-UJZjr 
J0L_IJJCnjO3CL“> 


I E — 

I © 
H E 
: Cl 
) <1 O 


. Id CL 
C IL E 
) ^ 3 


: n z 

i CL 
. in 3 

z K 

J Ct Id 

: 3 ct 

J Id ll 


'ft — 

CVJ f- 


M ********* 


id cti co kd o co 


(flnwniiinnaiNnpKOMninnw-t 


maicjj'taimiricocxiai 


* o 
n *t 


m m »cm-. 


& oj — 

Q -r- 

s ci o s ci a 

^ «i o - o y 


N CD 
U. U. 

in in 


> - cvj coin 

i Cl O'! CT) CD CT) 

> co co co co cn 


co s «o cn 
m m m cn 
co co co ci 
© © © © 


© cm m c 
© © © < 
Uj Uj (LI I 
© © © < 

V- CVJ CO 
© © © 

TJ 


in UJ N 
© © © © 
V 

© © © © 


«t 

© © © © 
© © © © 


* * * 
© © © 
© © © 


L--^*u>cncauj©(vjTtioa»oaciii_'~<oin 

~*NCMCViN(VJNCOCOCOCOCOCOCnCO*** 

IftlfiCOlftlftlftlfllftCftlftUjlftlftlftCOUjU)©) 

©©©©©©©©©©©©©©©&©© 

« m © h Nco^incDNoo(n©'r<cvjcoT»'inu)NoO(n©'— 
»- , *-CVIPJN(VI(VJ(VJCVJC'JPJCVI(OCOCOCOCOCOCOCOCOCO't *t 

©©©©©©©©©©©©©©©©£>Q©©©©©© 

©®©®®®©®©©©c®®®©&©©©©©©© 


mauuw’tuMtiau 

**«*inininininin 

IftlOCOUJUjCDUJUJUJUj 

©©©©©©©©©© 

co^-ina)Noo(r>©»-cvico^in 

^'t^«t5tTt^inininininin 

©©©©©©©©©©©©© 

®®®®®®®®®©©®® 


u. CVJ 

in id 

Uj Uj 

© © 

N SO 01 © ~ rrlTlUiNcO 

in in in in tu id id id id id 

>» -f 1 « 'J Tf >» Tf 

© © © © © © © © © © 

© © © © © © © © © © 


CL > 
Id O 
> E 


I UJ 
> 
X o 

© Cl 
-J 
O 3 
J- O 
Z Z 

1 — 
in in 


Id o 
© u. 
© - 
CL 03 
w in » 
• Ct 3 


Ct if* 
oa in _j 
Cl Oj 3 


- O Ci - 

Ct Z Z Cl 

a uj uj a 

(3I3EI3 
Ul Id 13 Id X 

03 a. Cl <Vj O 


X Ct X X 

a in -a cl © 

td 03 UJ E _l 

j J j u m 


in in 

Id Id 

J- Id Cl 

EX — 

h- cn 

Ll Z 

© UJ “ 

in 

h- o o 

Ct _J z 

a u — 

i- z J- 

in id in 

Id 

Ct X 

u - 

cl in 3 
‘ t ‘ 
KUO 

in <r © uj 

y M3 l 
j— in u i o 
E I fti E 


XXX 

•1 <1 (L in 
UI id E -J 
J J u 03 


o zat- 

z x <r o iu 

Ul O O Cl O 


x >: cl- 

cl - a h i a 

e *x Li m u. 

u m j j m 


O 03 
U U 
II U. 


ci cl w in 
z <i v 

UJ O E Ct 
03 © K 


<3 X Z Cl 

Z E O 
- O E Z 
13 Ct UJ UJ 
Id II X 


cn i 


i in . 


© o 
Id Z 
03 UJ 


cn l 
uj in 3 
13 UJ Cl Z 
Ct - 
o Cl Cl 13 
Z O Z Ul 
Ul *3 <3 03 
13 


a — 
K <3 

cn uj 


> K 

a uj 
in o 


•3 in x 
- z - 

03 — <VJ 


I Ct <3 
in tf i uj 

Cl 03 _j 


O u 
Z Z CL 

— Xld- 

L. X I 13 03 


It Cl 03 O 3 

cn Cl 3 3 3 

03 _J in 03 Ci. 


03 UJ 

u 

O <1 


cn ct 
K 3 
Ll O 


K C^ Z > 

Id U. Id O 

> - Z <3 U 

<1 X O (3 UJ 

cn in •• •• a © it 


XX -r* cl 


x a 3 3 u Id 3 

in a in o uj z 3 

Cl J J (t © 03 Cl 


J CO 

: in ct 
i z Id 

1 ct iL 

c 3 in 
K Z 
: Id a 
j ct Ct 


E > © © © 

- O I— Ci z 

# e x in a. x — 


© o in x cl in ct 

cl uj i © cn u cn 

E 03 in UJ 03 3 03 

U -1 ft_13 0_I 


in co cn N- co ai in n co n co cn co co 


« ***** Cu 


iftNinc-inmcooo 


W N ML N n N 


********- — 


CVJ N Id III CO ID CO 


03 *i flC' 
U"> IT* U J 
© © © 


«j © Cl — CO 

flti 03 CO CT> CD 

in in in in in 

© © © © © 


— CVJ ri Ift r- 00 CTi © — ig CO rt ifj 

■r- — — — T-,- — CVJOJCUCVJCVICU 

CO CO CO CO CO CO CO CO CO CO CO pj CO 

©©c© ©©©©©©©&© 
©©©©©©©©<■©©©© 


U"l ffl U LJ 
J) ff) (Ti (Ti 

ifi in u'i in 


r» u ffi © 
CVI Csl (VJ CO 
CO CO CO CO 
© © © © 
© © © © 


© fu rt o.l 0: 

© © © -I © 

in ifi in u*i in 

© © © © © 

Cm co o ID (L 

co co co ri cj 

C-J CO (0 CO CO 

© Cl © © © 

© © © © & 


id in 
© u 
if j in 
© © 

© T. 

*t «* 

CO CO 
© © 


lftaj©Old©CU*fr 
U O O O O Cl Ci ill 

ifj in lt ■ ifi if. ifi uo u-i 

©©©©©©©© 


Ift 00 © U UJ iL ^ 

Q Q Q Q a Q Ul 

in in in in in in uo 

©©©©©©© 


co^uiicin.ooiTi©^(Mco*3i/iccii'-«3ffiT-(vjco^tifiiftr-.floin©'r- 

't^'t^'t^^inifiininifiininininifiioiouiiftiftaiiniftiftNN 

CO CO CO CO (0 CO CO CO CO CO CO Ci CO CO CO Cl CO Ci CO Cl CO Cl CO Cl Cj CO CO CO 

©©©©©©©©©©©©©©©©©®®®®®®®®®Q® 

©©©©©©©©©©©©©© ©©©©©©Q®©®©&®& 


Cl UO ai 03 U. CVJ rf 

Id UJ Ul UJ Ul U. Il 

in uo uo uo lo m uo 

©©©©©©© 

tO-»UOILN*iri&T-C'JD 9 lDlLN 
NC-NN-N-Nh-oOcOflOoOoOoOoOoO 
CO (0 CO CO CO Cl CO CJ Cj CO CO CO CO Cj CO 
©©©©©©©©©©©©©©© 
©©©©©©©©©©©©©©© 


Number 25 


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


Page 31 

225 




z — o 
o — in 
o <i 

Id 00 

_j <r z 

ki a 

IiOI 


I Old — 

a u_ cl a 

— u. a a 

cl o _i <r 


© ao x 

u_ cn - w 

» » * z r~ 

♦ * # o # 


<1 <r <r <i 
Ci a a. oo a in 

ZOCJCt- 

<r <r cj oo <i a; 


N N N fl N ^ 


CVJ X 
I- - X 
D w Id 


oo a — 
Id Z — 
O Id U 
a oo oo 


X X X X X : 


o'; cl oo <r 

: i a: in j it o: 

l GO GO 03 D (tj 03 

i a. oo _j a. oo _i 


00 00 oo U Q 

K — CL Cl 
Z 00 

- - T- O 


<r a 

Id CL Z t- 

I- *1 O 00 

<1 Z CO 

i- u t- in o: tt 

O 00 — Z Id UJ 

z <r z > 

— Id © i— i— o 
lOI-ZlilOU 
h- <1 Id Id Id Z Id 

OO 00 13 OO I— <1 CL 


OO X »- + -r- X 

i- - x d x a * 

z <i * o - cl <r 


Cl 00 Ct 00 

Z <T UO I— J J 

r* W Cl 03 ICl (L I> 

a 0 _I _l I— OCi Cl 


XXX X Cl * 


Q <1 
0. /- 
<1 - 
Q Ci 
* * CL Cl 


00 <t 


00 


CL I- — CL 
II Z UJ 
•— I— > 
Id O Z O 
> (L — CJ 


00 


(L l 
Cl CL 


NicinMOinMc 


n xr ro od m ffj 


CL <1 CL 
(J Q - 

: t— cl x 


CL OO X 00 

o z a a: j 

in id in j 

l- CL _J 03 CL 


in cr> n <i 


o oo 
a id oo 
0. <J 

oo a - 
a. <i 
Id oo o 
z o 
o oo a 


Id Id I- 
CJ CJ <J 
<E a Id 
(L CL CL 
O'! OO OJ 
CL IL CL 


X X X X X 


I- — CJ -I 

z Z U .1 

d <r — 

o <i i- z 
o I- D , CL 

a Z Id CL => 

I- C “ Z Ol¬ 
id O it O O Id 
00 _J CL Q _J CL 


Cl 03 

03 <1 t»0 <_i Id GO 
aciooidZi- 
j j j a oo cl 


o o a 
<i a id 
CL a. Cl 
00 O O Id 
X CL Hi CL 

cvj cvj cn w co * 


(J • _l 

o © o 
•a it 
<i u. 

ZUlL 

— O — 

<r 

CL CL 

<r a <r 3 

Z JI - PO 

O O U Id Z 

a a 

UO Ll CL o z 

z u. o r — 


Cr. Lt LJ u I 
_l CO Z I— 
(J 00 OC CL 


X X X X X - 


m rt to oo <r u 
o cj o o cj cj 

Ui CXl CO CXI CO 'JO 
Ci © O S Q fii 

N CO (D © r- w 

** * * in tro i/o 
in in i/o uo in in 
©©©&©© 
© © © <s> © © 


QiLT-ninco«o u. 

uoaaaQCaa a 

( 0 ( 0 ( 0 ( 010 ( 0 ( 0(0 uo 

©©©©©©©© © 

’tinuor-oocns)-r-Mc r J^inuoNoo»-(Vin»tinuo 
inirjinirjininuououoaicocDuouocoNNNNNN 
uo in itj in in m in in m tn in in in in in in in in in in in 
© © © & © ©©©©©©©©©©©©©©©© 
©©©©©©©©©©©©©©©©©©OCiSi 


— co in oo a o 

Id Id Id id Id id 

CO UO CO CO CO CO 

Ci Ci & © © i 

«o(ne>T-cypoitin 

NNoCioCioOcOoOflO 

ininininuoininuo 

©©©&©©©& 

©©©©©©©© 


Id © * UO oD <1 


f- oo cn © t * cj 
« o oo co cn cro in 
uo uo in in in in 
© © © © © © 
©©©©©© 


01 0 ) 
in in 
© © 


Id © CVJ UO UO ao 

lL © © © © © 

Ci N N N N N 
©©©©©© 


CTi 'I CJ Id 
© © © © 
n r- n [■- 
© © © © 


N«m©»*N(n^inu)N«o(?i©T-N m men © © t- w n ^ in 

ITl(n(n©&&©©&©©©&T-r-^r-r.T-^T<lMWWW(lJ(-J 
inuOUOUOUOUOUOUOCIiUOUOUOUOUl CO 'JO CO CO 'Ji CO CD <Xj CO UO CO CO UO 

© © © © © © © © ©©©©©©©©©© © © c* © © © © © © 
©©©©©©©©©©©©©©©©©©©© © ©©©©©© 


CL O 

a z 

Z CJ 
CJ id 


O Z l- 
ctl J id 
<1 II CL 


Z Z © Z li- Z _J 

UOW«)UWNOI-r>3 

D _J - x z JUJ - 

izo-d# — <r*z#'d© 


zuioi3<iinocittiiLiuain 
inai-y. odDczwrziui- 

CLJUOldJJUJCEinOOQJCL 


uo cro z 

<L _J CL ■— 

<i -i - <r 

z u. r © 

o CL id r 

<lu.lt 

Z Z IL <1 

Id (J — UO iL 

Z Id 00 

Ol-l— J 

Id _J IL D 

z o a _j >- 

i- i- o z 

u y in in z 

If i GO Z Id 03 D 

- id h- IL <r u. 

II 

ZD IL 

(J - (J 

U D Z 0. 

inwzuwin - 

Id x j x - © 

# o ii o o d r 

oo 

03 (J OO 

Cl Id O Cl O Cl CL 

zzaridiLZ 
O 03 (J OO I- 


r u 
cl <r <r 
«i uo 


a a 
<i a 
— - z 

u (J CJ 


<r cl id uo 

a z. z »- 

J O 03 IL 


z <r <r 

uo CJ i- 
Q- _j uo 


X uo 
cl y- — 
o o a 


•»- U_ Q_ 
>- IL D 
03 + O iL 


“ a o z 
> q <r — 

— Id 

ci oo on 


X - X 
X © X 
X T- X 

X X © 
X X © 
X X © 


© <1 CJ - 


z z - x a 

CL - Z Z h- 

uj o x u. a 

*- oo (j - a 

_l X 

<1 Id <t U CL <1 

> — ldO — 

<1 O Z O CJ 

n I/J <1 u J <1 


OO D D 

D D 

‘ N in O T- Q c 

> Id CJ I— <1 U <1 ( 

I Q I- D -• I- — l 

• © d o undo: 

'IOuUu*Ou( 


UO 03 CL cn 

:hOLiiacici<iinj 
! irt Ii 1 E 111 ill Z UI U- 03 © 
I I- OO © il J <1 40 m J CL 


<r a c a 
IL Cl CL CL 

cn uo g o in 
_i _j _j _i 


UO 10 10 N W (0 N OJ UO OJ C*0 rt *± 


XXX— xxxxx 

in CVJ O- N O' N 


XXX**: 


> D D 

I o © 

i n po uo in n oj n cn n 


XXX****: 


ni/oNinft3i©©oj'<tcxico<r<j 
UOClOUOUOUOUONNNNNNN 
CO CO UO CO UO UO UO UO 'Ji 'JO CO UO CO 
©©©©©©©©©©©©© 

mo»*ftjn^iouiMCi(n®f 

UNNNNNNNNNNoOcJ 

©©©©©©©©©©©*©© 

©©©©©©©©©©©©© 


a u. 
n n- 
co co 
© © 


i- cn in n 

a3 «0 a3 03 
ui CO Ui CO 
© © © © 


cn rt uo co n od ao 

co 00 aO 03 o3 <0 aO 
^ ^ ^ "t 

©©©©©©© 
©©©©©©© 


q © cn in 

03 03 00 OO 

CO CO (JO CO 

© © © © 

m ^ i/o co p* oo tr> 

on 0i oo ao 0) 0) 0i 

^ Tt * ^ Tt 

©©©©©©© 
©©©©©©© 


co co <r 
00 00 00 
CO CO CO 


a u. w 
oo ao a 
co co co 


CtONyfO^NNSbO 

ao co cvi co cn id o m <i cn 


*co«<icju.rvit(O0>o 

<r<ra<i<r<rQ3iLiQ3Q3oa 
uo CO '.0 CO UO 'jl CO CO CO CO 'J| 
o ai oi w oi qi ©©©©’©©©©©©'© 

'-(vjcn^uocoNco0)®T-cvicn^-Nco0i©T-(vi(nTfiricor-'ao0)6>'r-cvjc , o 

©®®©©®©®©T- — — ^-cucvjrviccjMcucunjcvicvjcncncncn 

uoininuoinuouoininininuoininuiinuoininininuououoinininuoininifj 
©©©©©©©©©©©©©© ® © ® © ©©©©©©’ ©©©©©©© 
®®®©©©©®®®®©®©iS<S>iS>iS>©©©®©©©©©0©©® 


Id U. © — 

03 03 (J CJ 

CO (0 CO CO 

® ® © © 

in<ONaCi 0 )® — (VJtnTtUOCO 

in in uo ui in uo uo uo uo uo uo uo 

© ® © © © s © © © © © ® 

©® ©©©©©©©©©© 


Page 32 


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


Number 25 


226 



00 


. a y- 

O — i/\ 

CO <E o UJ 
</* E • H- 

id cu r 

13 13 •» o 
3 3 0 w 
OS OS © l/> CL 

XXCC'DD 

UJ UJ UJ Q J 

h- t- /\ r ll 


x x > 
x x > 
x x > 
x x >• 
x x > 

XX > 
XX > 
X X > 
XX > 
XX >: 
X X > 
X X > 
XX > 
X X > 
X X > 
X X > 
XX > 
XX > 
XX > 
X X > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX > 
XX) 
XX > 
XX > 
X X > 
XX) 
XX > 
XX > 
XX > 
XX > 
XX > 
X X > 
XX > 
XX > 
XX > 
XX) 
XX > 
XX) 

EfOUJOJ XX) 
o H O x X > 

E 'XI — m|XX> 

□o ll viy x x > 

PCC‘ 30 XX) 

Zm 'X' lit O XX > 

•ro os ujo o x x :> 
ix r- > o x x :> 

I .. on.. OJ X X > 

or z: xx) 

O- .. K— .. XX > 

30 cs 13« x x :> 

uixi zzujz xx 

I/M UJ DOS UJ XX > 
0. ■=• XX) 




y E = 


XX 
XX 
XX 
XX 
XX 
XX 
XX 
XX 
XX 
XX 
XX 
X X 
XX 
XX 
XX 
XX 
XX 
XX 


© «— © 


J 


©-*© 

O O 00^4 

|i.OQ O O O — 

□ 

(too- o o 

ft; 

UJO-«o -.©© 
I 

Zl —oo © O O 

Iooo ooo 

K 

►_o O O OO—i 


© 


--ft 


o VI 

oo 


DO 

fio 

ro 

<xoj 


E ~ LL 

DO 

OO 

E © © © © © 
<Z © © o o © 

a. ooo o 
| .. o o o o 

or 


313 MMMU 

uj uj r r r r 

I/'OS UJ UJ UJ UJ 


ooo oo o 

to® o o o o o 

a 

do o o o o o 

UJ 

fto o o o o o 
ooo 00-0 

ooo o o o 
CO 
CO 

UJ 

LtO -4 eg o — CO 
l—<•_ 1 O o ooo 

1=10 o o o o © 

IOOOX (JUUX 




— 


o X 
O' X 
O X 

•M X 


> OJ O' X 
:• * X 

J .. O- X 



a x i 
bj : 
E I 


X 3 

cor 

<r z (i 


X -J 

<r _i 
uj <i 
z i 

v > us 


ot iL u. 
<a <t u. 
3 3“ 
U U 


. X z 
. uj a: 
I- 3 


IUZZO 

> “ “ o 

<1 O a: UJ 

cn a. a. a: 


U » — (VI a x 

<i >- i 3 a u 

“ q u + o “ 

o <r z in z u 3 


<i <r <i <r a a 

(Ll-J(LI«I»-ltUaUJ<IbJ 

zvuLBJuwsaviuozQU 

3i-aj_ia._jo_ias_ios_i_i 


3 3“ 

u u 

z z 


co (vj as us us r« n n <j n md 


<l in 
it JZ 
OVIK 
U_ Z 3 


o as uj z®asosc3<iasii-as u. 

Z ‘X O * Z * Z * Z - Z N Oft 

“<ru o#— *“•—#— #* 


: as as as as as as u 

HLOIlVUIOIL-VSiSMOV) 

r jeji JI3DZI-KI- 
(oasuasuaiuKiKiaitOK 


■ x x in o x 


« K « X » • 


Ct “ 

Cl & Z 
<1 UJ 
(O Cl UJ 


a. e 

E E 'J 

O O CL 
Cl O ■_ 




+ os a: as 
x - Ul ' 
•> © > M 


N E 
CL CL 
UJ UJ 
> > 


<l cn 

Cl - 

a. 3 


Ntocvjpscvjcnc>jcocvicvj> 


x us x a i x u‘. 3 x a. 

<r 3 <r ll cl (LtscuoavK as 

U'C'lUJ —JOE —I UJ Z UJ UJ OS U. I— 

jo— iL_>ujuas_i“as3_ii-CL 


STj US CTj eg ui US Ci US fvl CO 0< OS 'jj - 


o as 

o o 

u. u. 


> ■>* as a a> 


It U) S (T) (J 1U 


— (vj to ao as 

(VJ (Vi w fvj (VI (VI 

NNNNNN 

® ® © -S» 
USS«0(T)O“('J( r l'»USUSN«S 

(u (vi (vi (vi as ps ps ro n ps cs (o n 

Ui US 'JS ‘jS UI UI CXi ‘X US VO U> 'JS us 

•S €> ® © < O C> ■S* © <3 O 


(vi cn 
r- n 
© © 


«t t 

u> us 
© © 
© © 


* *t 
CD UI U) 
© © © 
© © © 


US N aS ff) i 

t t t t L 

Ul Ul US UI c 

© © © © < 

© © © © < 


as as o 

© © © 

— cvi cn «t us 

us in us us us 

ui ui us CD us 

© © © © © 

© © © © © 


U. - CO iri 
cn ^ 
NNNN 
© © © © 

us r- « as 
in us us us 

Ui CD US CO 
© © © © 
© © © © 


r- in 

(•> N 


© T- 

CD CD 
CO CO 
© © 


as Ci i 

^ T* ' 

r 


(vi as ’ 

CD CD C 
CD CD C 
© © < 


- as in ul¬ 
us in in [f i 
a- r~ r- r- 
© © © © 


<c u © ■n u"i »•- in as a ui © 

US US (D UI cO CO CD 10 CO CO N 

n n i-- r-. r - r- n n n n s 

©©©©©©©©©©© 


US oCi (T) & ig as *t in f"» cO fft © “ (VI i r i rf US CD l-“ gS iTi © —• (VI 

US Ui Ui I- N f- N r- N N N I- oj «S <Cl uS aj uO D «J aj aS a> at <Ti 

CD Ul U- *X CD CO CD CD CD CD Ul CD CD CO Ul CO CD CD CD CO CO CO CO CD CD 

© © © © <S> © <c» o © © © © © © © © © © © © © © © © 

©©©©©©©OO©©©©© ©©©©©©©©©©© 


t N Hi 
N f- N 
f- I- l « 
© © © 

as * us 
jj os ai 

CD Ui Ui 
© © © 


a as 
N uD 
O' N 
© © 

N «S 

ai a> 
CD us 
© © 
© © 


© © 
© © 


Number 25 


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


Page 33 


227 


TOTAL ERRORS 00000 
TOTAL WARNINGS 00000 







S 8 EDITHA 


A REVISION OF THE FYLSTRA KIM-1 EDITOR PROGRAM 


BY H.T. GORDON 

College of Natural Resources 
University of California 
Berkeley, CA 94720 

Dear Jim, Tom, etal., Received: 78 April 3 

I am herewith submitting an extensive recoding and 
enhancement of the editor section of Dan Fylstra’s SWEETS 
program for the KIM-1, published in (and copyrighted by) 
BYTE. It poses several dilemmas of general interest. First, the 
problem of program names. SWEETS is Fylstra’s acronym for 
2 main programs, that share some subroutines. The entry label 
for the editor (the only one I have worked on) is CMD. I have 
given the more descriptive name EDITHA to my revision, on 
the grounds that its coding is mostly quite different and that it 
includes some major innovations (address information and 
modification capability, greater error-protection, and a richer 
command structure with modes not found in CMD). It is 
clearly an enhancement of the kind that Fylstra himself antici¬ 
pated would grow out of CMD. I hesitated before adopting the 
name EDITHA, since renaming can easily become an idiotic 
game, involving personal vanity, causing confusion, and even 
trying to disguise software theft. I have restained many of 
Fylstra’s names in EDITHA whenever my recoding did not 
involve a major functional alteration, both as a courtesy to the 
originator of the basic concept and as an aid to comprehension 
by users. One of his subroutines (DETLN1) is an inefficient 
way of determining the bytecount of a 6502 opcode. In 
EDITHA I have replaced DTELN1 logic by the decoding logic 
of my subroutine BYTCNT (published in DDJ # 22), with 
minor retailoring to fit the special context. / re-use the name 
BYTCNT for this trivial modification, because I think it is 
better to extend the meaning of a subroutine name to include 
minor variations, instead of endlessly coining new names. 
There are, alas, no rules defining how great a dissimilarity is 
needed to justify a new name. 

The second dilemma is the perennial one of software 
ownership. I assert copyright (qualified by a special non- 
monopolistic free-diffusion clause) for all components of 
EDITHA not either previously in the public domain or copy¬ 
righted by someone else. Exactly what these are is a moot 
question. Very little of the original CMD coding is left intact 
in EDITHA. None of the alterations is anything but junction¬ 
al (i.e., there is no intent to evade existing copyright by mere 
recoding). None is copied from any work I have had access to 
(although since there are relatively few ways of doing some¬ 
thing efficiently, it is not impossible that some coding is an 
independent recreation of already existing logic). Here is the 
qualifying clause: The intent of my copyright is to remove all 
impediments to free diffusion, including (to whatever extent 
my copyright gives me leverage to do so) impediments that 
others may wish to impose on enhanced or different imple- 

Page 34 


mentations, including systems other than the KIM-1. I ther- 
fore authorize any and all uses (including copying in any form, 
publication in whole or in part, and commercialization) if (and 
only if) all software associated with the EDITHA coding is 
declared to be equally available for totally unrestricted use. 
What I am trying to ensure is not only that my copyright will 
be no bar to progress but that it shall serve as an aid to it. 
Perhaps this is Utopian, but there’s no harm in trying! It 
would be a tragicomedy if micro software had to be diffused 
underground, in the style of Russian samizdats, as a response 
to the censorship aspects of copyrighting. 

The third dilemma is: where should revision of a program 
published in BYTE be published? First, let me say that I con¬ 
sider BYTE a valuable journal. I have had a note (on 6502 
opcodes) published in it, and a second one (on a pseudoran¬ 
dom number generator, 8080-coded) is accepted and will 
(eventually!) get published. There are some advantages (a 
small remuneration, glossy paper, and a very large readership) 
and some disadvantages (among them are: loss of all rights to 
your work, and often long publication delay, and no indica¬ 
tion of the date of receipt of articles). On the whole, my 
relationship with DDJ has been a more humanly satisfying 
one. Friends have told me its title is zany (but to me it’s 
whimsical -1 reserve zany [and its synonyms j jor a world with 
tens of thousands of megatons of hydrogen bombs poised for 
launching). But publication is prompt, always includes date of 
receipt ( a fine ethical touch), and the author retains the rights 
to his work. These small-is-beautiful qualities compensate for 
inexpensive paper and no remuneration! 

Sincerely, 

H. T. Gordon 

The SWEETS machine-language editor program CMD, 
created by Dan Fylstra (Feb. 1978 BYTE) is a major enhance¬ 
ment of the KIM-1 SBC. However, it has some coding inef¬ 
ficiencies, logic errors, and other limitations. The major ones 
are its inability to allow manipulation of addresses (only pro¬ 
gram instructions can be seen in the KIM display, and the lack 
of adequate safeguards against user errors. It is all too easy to 
ignore the CMD error-warning and cause disastrous upmoves 
or downmoves of immense blocks of RAM, including the CMD 
program itself. My revision gradually became a major overhaul, 
involving drastic alteration of both the main program (whose 
entry point I have renamed EDITHA) and the subroutines. 

Insofar as possible, EDITHA (version 1.0, intended for the 
basic KIM-1) is located in the same memory areas used by 
CMD. This conforms with Fylstra’s intent of leaving a large 
block of RAM free for new program construction under editor 
control. However, the enhancements provided by EDITHA 
increase its length to 478 bytes (71 more than CMD), and its 
subroutine READIN had to be located in 0200-0234. This 
leaves only the 459 locations from 0235-03FF free. 

Number 25 


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


228 




The revision relocates the original CMD pointers in zero- 
page: MOV AD (to DE-DF), BEGAD (to E0-E1), CURAD 
(to E2-E3), END AD (to E4-E5), and adds a new one, LIMAD 
(at E6-E7). This allows operation of a new guard subroutine, 
INLIMT, that protects memory locations outside preset pro¬ 
gram limits from being moved or overwritten. BEGAD is 
redefined as one location below the program start (lowest) 
address. LIMAD must be set 2 locations below the highest 
address that the program can enter. BEGAD and all lower 
memory locations, and LIMAD+3 and all higher memory 
locations, cannot be altered or moved by EDITHA. The guard 
subroutine blocks the action of the DA (delete instruction) 
key unless BEGAD < CURAD < ENDAD. In addition, it 
blocks the AD (add instruction) key unless ENDAD < LIMAD. 
When these conditions are not met, the only effect of pressing 
either key is to display CURAD in the usual KIM address dis¬ 
play, and EE in the data display. CURAD is the address of the 
instruction currently displayed, that EDITHA is refusing to 
add to or delete. The same message will be displayed if any 
hex key is pressed when EDITHA is in the command-entry 
mode, but in this case the EE does not signify that CURAD is 
out-of-bounds but that hex keys cannot be interpreted and 
are being rejected. 

Although EDITHA has instructions that allow the user to 
alter BEGAD or LIMAD, they are normally fixed and define 
the program limits. As in CMD, CURAD is advanced to the 
next higher instruction when the + key is pressed. However, 
while the + key is depressed, EDITHA displays the address of 
the next instruction (that appears when the key is released). 
If this address is within limits, 03 appears in the data display, 
but if it is out-of-bounds, EE is displayed. 

During program writing, CURAD does not change, but 
ENDAD moves upward when AD is used to insert an instruc¬ 
tion and downward when DA is used to delete the instruction 
currently in CURAD. If deletions exceed insertions, ENDAD 
may move below CURAD, and thereby block the action of the 
AD and DA keys. This is no problem, since the user can press 
a hex key to see where CURAD is and then use the pointer¬ 
resetting instruction to set ENDAD to a higher location. In 
fact, it is sometimes useful to set ENDAD to the program start 
address, so that the user can explore anywhere in memory 
with no risk of altering programs by accidental pressing of the 
AD or DA keys. 

The operational changes in the + and DA key actions are 
achieved by quite trivial modification of the original (much 
less informative) CMD error-message, together with continual 
supervision by the guard subroutine. Users may notice one 
more trivial change: one-byte displays by EDITHA are of 
normal brightness, while those by CMD are extremely bright. 
CMD refreshes one-byte displays 3 times as often as 3-byte 
ones; this may or may not shorten the life of the LEDs, but 
I found it unpleasant. Therefore EDITHA inserts a very brief 
dark period in every refresh of a one-byte display. Both CMD 
and EDITHA display two-bytes at about 1.5 times normal 
brightness. 

Implementation of Complex Commands in 
the AD and GO Operations. 

Unlike the + and DA operations, which are simple com¬ 
mands executed by pressing one command key, the AD and 
GO operations require complex commands. Both call sub¬ 
routine READIN, since the user is expected to key in more 
information. Although much more complex than its equiva¬ 
lent in CMD (subroutine RDBYTE), READIN also calls sub¬ 
routine SCAN1 twice. Unlike RDBYTE (that always error- 
exits if a command key is pressed), the first call to SCAN1 by 
READIN will accept either a hex or a command key, the lat¬ 


ter causing a return for interpretation by the calling routine. 
If the first key is hex, the second call to SCAN1 ignores all 
command keys but returns when a hex key is pressed, insert¬ 
ing the completed byte in the leftmost display (all others 
blank). ADKEY logic interprets this as an opcode; if it is a 
one-byte opcode, it is inserted in the program and the oper¬ 
ation is over. If it is a two- or three-byte opcode, READIN is 
again called so the user can complete the instruction. At this 
point, it is possible to press a command key and cause a 
return. In version 1.0, EDITHA interprets such command- 
hex-command instructions as errors, simply wiping them out 
as if they had never been keyed-in at all. In an expanded 
version, however, more complex interpreting logic could open 
a cornucopia (or a Pandora’s box?) of special commands. Very 
few of these possibilities are realized in version 1.0. One reason 
is the memory limitations of the basic KIM-1. Another is that 
I am not sure how powerful a machine-language editor ought 
to become,or what operations will prove to be the most useful. 

The AD Key Operations 

Pressing the AD key has no detectable effect if CURAD is 
within limits and the instruction currently in the display is 
one-byte. If it is two- or three-byte, it is left-shifted so that 
only the previously rightmost byte appears in the leftmost 
display (all others blank). When the opcode is keyed-in, it 
replaces the displayed byte. If it is a one-byte opcode the 
instruction is complete and written into the program (and 
being displayed by the program-scanning subroutines). Pres¬ 
sing a hex key will cause the usual error-display of CURAD. 
If the opcode is incorrect, it can be deleted by pressing the 
DA key. 

If the opcode requires 1 or 2 operand bytes, pressing any 
command key will cause an error wipe-out (a quick way to 
erase a wrong opcode). If a hex key is pressed, nothing will 
happen until a second hex key is pressed. If the opcode was 
two-byte, the second keyed-in byte will appear in the 
middle display (normal order, an indication that the whole 
instruction has been written into the program). It can be 
deleted by the DA key. However, keying in the first operand 
of a three-byte opcode will cause the opcode to shift to the 
middle display and the operand to appear in the leftmost 
one (reverse order, instruction not yet completed). Again, 
pressing a command key will cause a wipeout. Keying in the 
third byte (second operand) will cause display in normal order 
(instruction written-in, deletable by DA). 

A peculiar “double-command” operation is also possible, 
executed if the AD key is pressed twice (pressing AD, then any 
other command key, has the same effect but the AD-AD is 
safer). The effect is to insert the single-byte in the display 
(following the first AD) in the program, “completing” the 
instruction. The AD-AD operation is useful only if the instruc¬ 
tion in the display before the first AD was a one-byte opcode. 
It allows duplication of this opcode, a convenient way to enter 
a string of one-byte opcodes (00, 0A, 4A, EA, etc.). The 
AD-AD was not a planned feature of EDITHA, but an 
accidental consequence of the planned GO-AD (to be 
discussed in the next section), retained because its implemen¬ 
tation requires very little interpreting logic. 

The GO Key Operations 

These represent by far the most complex EDITHA enhance¬ 
ments, that still are only a minute fraction of a legion of pos¬ 
sibilities. The only “double-command” is the GO-AD (the 
other 3 possible ones are interpreted as errors). This sequence 
of 2 command keyings resets CURAD to the program start 
(one location higher than BEGAD). (Note that, although the 
command keys are read by the KIM monitor subroutine 


Number 25 


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


Page 35 

229 



GETKEY as hex numbers from $10 to $13, the RE AD IN 
decoder subtracts 4 from these values and returns command 
codes from $0C to $0F to the GOKEY routine.) 

All other GO operations require keying-in 4 hex bytes for 
completion, the first 3 appearing in the display one after 
another, in reverse order. Wipeout can be caused by pressing 
any command key following entry of any byte into the dis¬ 
play. The terminator byte (not displayed) is the command 
code that will cause execution of a special operation. Since all 
non-interpreted command codes cause an error-message, it is 
useful to keep the final key of this code depressed so that it 
can be seen displayed. If there is no error-message, the com¬ 
mand has been executed. Error-messages are always XX 04 EE, 
where XX is the command code that could not be executed 
(except for codes 04 and 08, where XX is 00). The following 
is a list of the 5 valid command modes, with their codes: 

Mode I, code 00 

This is the ERASE command, that restores the original status 
before the GO key was pressed. Although the “wipeout” 
feature of command keys (a later development) makes it 
unnecessary, it might be useful in later versions. 

Mode II, codes 01 to 03 

These are IDPR (insert data into program) commands, 01 
inserting only the first keyed-in byte (rightmost in the dis¬ 
play), 02 the first and second, 03 all three. Before completion, 
display is in reverse order. When the command is completed, 
the inserted bytes will be displayed in normal order (as with 
the AD operation) but interpreted as data. Thus the sequence 
of keyings: GO-08-18-28-03, that is displayed as 28 18 08 
before the command code is entered, will be displayed as 
08 18 28 afterward. This sequence would need 3 separate 
entries in the AD operation, since all the entries are one-byte 
opcodes. Also, the entire sequence can be deleted by pres¬ 
sing the DA key once (if there has been an error). 

In both CMD and EDITHA, to add a new program or data 
sequence following the one in the display, one must first press 
the + key to advance CURAD. This is necessary to allow the 
user to see in the display exactly what he has entered. In the 
EDITHA IDPR Mode II, all bytes that will be entered (and 
with codes 02 and 01, some that will not be) are visible in the 
display before the command is keyed-in, although in reverse 
order. Some users may wish to implement an automatic 
advance, so that more data can be entered by the Mode II GO 
without having to press the + key. This can be done by replac¬ 
ing the BEQ DACMD at 017B by a BEQ STPKEY (F0 37). 
The disadvantage is that one will not see displayed what has 
been entered, and not have a second chance to delete an erron¬ 
eous entry. 

Mode III, codes 05 to 07 and 09 to 0B 
These are program SEARCH commands, with some kinship to 
the GO operation in CMD. There is unnecessary redundancy 
here (05 = 09, 06 = 0A, 07 = 0B) that saves a little GOKEY 
interpreting logic, but could be eliminated in expanded 
versions if codes 09 to 0B can be given another useful inter¬ 
pretation. One major difference from the search GO in CMD is 
that searching is done in the range from the current CURAD 
(the address of the instruction that was in the display before 
the GO) upward in memory to ENDAD. To search the entire 
program, one must first reset CURAD to the program start by 
a GO-AD. The reason for this modification is that the same 
instruction may recur several times in a program, and the GO 
logic in CMD can only find the first occurrence. When using the 
EDITHA search GO, the user should keep the final command 
key depressed. If a match is found, the display will show the 
address of this instruction that will be displayed when the key 
is released (while the data display will show the number of 


bytes that were searched for). If this is not the one wanted, 
press the + key and redo the search GO to find the next 
identical instruction, higher in the program. If there is no 
match, the operation will display the ENDAD address,with EE 
in the data display. 

The second major difference from CMD is that EDITHA 
can search for only the opcode (code 05), for the opcode and 
one following byte (code 06, identical with the CMD search 
GO), or for the opcode and two following bytes (code 07). 
E.g., the key sequence GO-85-FB-60-07 requires that an 85 
FB 60 sequence exist in the program. This happens to be the 
terminal program sequence in the KIM monitor ROM. An 
interesting test of searching speed is possible if one sets 
BEGAD to 03 FF, CURAD to 1FD4, and ENDAD and LIMAD 
both to 1FD5. When EDITHA is entered (set address to 019A 
and press GO) it will display the RTS ($60 at 1FD4. A 
GO-AD sends it to 0400, and 0404 is displayed (although of 
course there is nothing there in the basic KIM). The GO-85- 
FB-60-70 keying sequence will darken the display for less 
than a second, then (with the final key still depressed) display 
IF D2 03. This is the addresss of the last 85 FB instruction in 
the ROM, that appears when the 7 key is released. Nearly 7K 
of (mostly non-existent!) memory has been subjected to a 
complex search in a reasonably short time. If one uses the 06 
command code to search for only 85 FB, one can find 5 recur¬ 
rences of it lower in the KIM ROM than the terminal one. 

Mode IV, code OC 

This works exactly like the GO-AD double-command. It was 
the awkwardness of resetting CURAD to the program start in 
this way (or in another way possible with Mode V) that led me 
to develop the GO-AD. In the original CMD design (largely 
retained in this pioneer version of EDITHA), keyings are 
recognized in 2 different ways. CMD calls the program-scanning 
routines that maintain display of the instruction at CURAD 
and detect a depressed key, which causes a return for interpre¬ 
tation by CMD logic. Hex keys are rejected (an EE EE EE 
error-message being displayed while they are depressed), while 
each of the 4 command keys causes control to shift to a 
special routine. With more elaborate logic, one could interpret 
double-commands here (or even, if one were ambitious, triple¬ 
commands). It would be a cleaner way than that in version 
1.0, which re-uses the scaffolding of a primitive approach to 
implement a more sophisticated one (just to avoid one more 
reconstruction job). 

The second kind of key-recognition in CMD is done by the 
GOKEY and ADKEY routines, via subroutine RDBYTE, 
which error-exits if a command key is pressed but accepts 
keyed-in hex bytes. My decision to implement double com¬ 
mands here was based on the fact that I had already included 
a lot of command-code interpreting logic and it was very 
simple just to modify READIN slightly. When I started out to 
revise CMD, I did not have a clear idea of how it worked and 
never dreamed that it would go so far! The structural flaws in 
EDITHA (1.0) are the result of its just growing like Topsy, 
with its growth halted when it started getting too big for the 
basic KIM-1. 

Mode V, even-numbered codes from $10 to $8E 
These are IDZP (insert data into zero-page) commands (64 in 
all), that write the first 2 keyed-in data bytes into contiguous 
zero-page locations specified by the command code. E.g., the 
keying sequence GO-12-34-10-10 will cause $34 to be writ¬ 
ten in location 0010 and $12 in location 0011. Before the 
keying-in of the command code 10, the first 3 bytes are dis¬ 
played as 10 34 12 (reverse order); this is wiped out by the 
command code, since nothing is entered into the program. 
Since the effect is not visible and one has to be extra careful 
with zero-page, the third keyed-in (and so displayed) byte 


Page 36 

230 


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


Number 25 



J 


must be identical with the final command code that causes 
execution. If it is not, an error message is displayed while the 
final command key is depressed to indicate a total wipeout. 

Because important subroutines are located in zero page 
(0080 to 00D4), command codes 80 to 8E skip these loca¬ 
tions and write into locations 00D8 to 00E7. E.g., the 
sequence GO-1C-00-8A-8A resets CURAD to address 1C00 
in the KIM ROM, causing display of the instruction there. 
This program can then be scanned by the + key, since 
EDITHA does not object to its user going anywhere in mem¬ 
ory just to look at it. Before wandering around in memory, 
ENDAD should be reset to the program-start address (easily 
checked by a GO-AD), using the 8C (reset ENDAD) command 
code, to “disconnect” the AD and DA keys. Codes 8E (reset 
LIMAD), 88 (reset BEGAD), and 86 (reset MOV AD) will be 
less often needed, and the 3 lower pointers (80, 82, 84) are 
available for future enhancements. 

Some General Commands on the Listing 

Since EDITHA interacts with molasses-slow human opera¬ 
tors, it is not designed for speed but emphasizes coding 
efficiency, error-protection, and convenience. One major sub¬ 
routine (ASCNIT, 0100 to 01 IE) is not listed because its 
coding is basically identical with that of the Fylstra-BYTE 
copyrighted CMD (located in the original at 0103 to 0121) 
except that the downward relocation in EDITHA requires 
that the 3JSRs to SCAN3 be coded as 20 IF 01 instead of the 
original 20 22 01. The relocation is functional, since the 
JSR DETLEN that is the first instruction of the CMD sub¬ 
routine SCAN is now the second instruction in EDITHA (at 
019B), so that the third one (JSR SCANIT, labeled DACMD) 
can be branched to to cause a display not interpreted as an 
instruction. My omission of SCANIT may strike some readers 
as ridiculous, but the intent is to avert the wrath of whatever 


gods EDITHA may offend! It also underscores the reasons for 
the free-diffusion conditions (spelled out in my covering 
letter) attached to my own copyright. 

Listings therefore start at 01 IF (SCAN3), that is signifi¬ 
cantly modified in order to reduce the brightness of single- 
byte displays (the JSR ONE just kills a little time). To be 
punctilious, I note that the terminal coding of the EDITHA 
subroutine MVDOWN (00C9-00D4) is identical with that of 
the CMD subroutine ADVAND. It seems to me that the logic 
of adding an 8-bit number to a 16-bit number is so commonly 
used that it is in the public domain. 

Since keying in 478 program bytes into a KIM is a head¬ 
ache, I am willing to tape EDITHA for KIM users who would 
like to try it out if (1) they mail a blank cassette to me, with 
a stamped self-addressed envelope that I can return it in, and 
(2) they agree to inform me of any flaws they may discover in 
operation (after checking the RAM to make sure the listing is 
correct). Regrettably, I can not be responsible for any failures 
of the U.S. Postal Service, and this approach will not be usable 
by users outside the USA. The taping will be in the standard 
KIM format (slow but sure) in 2 sections: 0080-0235 (index 
01) and 1780-17E3 (index 02). I am not eager to do this 
hundreds of times, but fortunately this is an unlikely event! 

Comment on Enhancements 

As I have indicated, EDITHA has many possibilities for 
restructurings and new operations, and everyone is free to do 
whatever he or she likes. It is quite possible that someone has 
already written something as good as or better than EDITHA. 
More likely, every further revision will have some fine ideas of 
its own that ought to be in the ultimate version(s). Perhaps 
DDJ can serve as a clearinghouse for pooling these ideas, and 
thus hasten development of a super-version (that will merit a 
super-name!). 


ta 


P M 
>> 

JO Tk-— 
< t>» 

HCi cj 
•H M 
ft ® 

O 0473 
Sh M 
M 9 
P 03 E 

03—M 
® -p 
-p W- 
OT — 2 

w o 

EhMEhI 
£h O 2 
«=fc20 


fc Q 

rH 

s 


< 

o 

'hfc^fcpH 

co 



rH 



M 

§ 

§ 

sz; 

o 


O 

o 

Eh 

O 

CO 

CO 

O 

CO 





o 

ta 


-- rx O' 

P c~ .—- 73 

Si t>> 9'-' 9 ^ 

bO ^ d 73 ® P 

3 fflrl OP ID S-> 

O PH!) !»M S Xt 

03 D»> 03 Q .JO O 4 -<H d 

n-H o E p 3 
03 73 +3 O d o 

® 43 3 K O O <Vh 

+3 ® Si ® ® O 

>» MO C fl 

JO — 43 



.—. 




— ® ® 

-P 


p 

--- 


C- O. 

Eh tCM 



03 — d 

>H 


73 O 

r-x p ® XI r' 

ctf U 


®H ft 


3 ^. 

d 

C-* O M d P 

-P O 

B n 

p 2 a 

o 

■P 

cd K 

XI Q 0 3 

03 43 

aJ C 

t»»q hh 

p 

•H 

E ISI 

dSDtJO 

•H 

u 3 

JO o 

c 

X 

E Q 

a) <Jia l 

O TJ 

b 0 O 

o p-> 

•H 

<D 

O M 

E ® ® 

-P © 

O 

-d- ® 



o 

E o p »3 a 



Q.J3 

o 


EUs II 


W 

2 ISl 
M 

X=tfc 


Q Eh 

Bas 
ogo 
— MO 



43 

a) 

E 

O 

c 


fti <! k c 

W Q Q 
Q < M << 


>H >H WK X C < K OT 

a &4S=COQQEHOEH 

OOhi 4 ijnbK 


939 s5 


o m m p co 1 


si ia 


O' C '~&4 


COHfOW O' rH CO 

pqeatao'tac'-j-CM 
_d-tatata cm O' q ia ia 

^OPCM <d <JOO CUvO 


rH <*VLT\CO «! O pt, CM 
M CM CM CM CM CM CM CM rb 
r~i r~i r-^ HHHHH 

taraca ea ea ea ea ea ea 


atK koto 

^ 2 W 2 WOTOTOO 
-ThhCOffl 

E-i 

S 

S5 
O 

o 

caN 
ea M 


W 

o 

K 

Si 

OT 


Eh 

u 

OT 

W 

Eh 


ta 

ia 


10 tacM p''£> 

1 w h 


weai 


ta 



o 

o 43 


0 

60 


Si Si 


o 
-te-M 
=tfc « 

K OT 

£ & 
o m 



CM 

ia 


ir\f"\*a q c'-o' 
K C'-aOCO w sO 


vo ta h oraao c eaea<& ts.es. ea 
C.jJPQQQOOQ&.CMCMCQO' 


c^um— O' o w fc cacM-d-r~ <: o 
r-\ ro rb (A nx ox ox _d-_dCd-pd-d- -d- 
rlHHrHHHH HrIHHHrl 

eatataeataeaeataeaeaeaeata 


-d-<ea 

eawa 

K 

eaiA 

o <4 oQ <o ea q 
taeaux iacoj- 

tA 

M CM 

cm'O ta 

<aJcO CM 

co ta 
■d K 

O' ea 
O CQ 

O' eaea <d ea<aea 

O O' QcO Q CM ra 

WiacM 

-d-lAMN 

UX'O 

CO <• 

o wtacM cauxcd 

XAMX 

UMA 

in iavO vo no xO vo 

rH rH rH 

M M 

M M 

M M M M M M M 


ta ia 

eaea 

eaeaeaeaeataea 



Eh 03 

O &> K m K 2 ft) 
SOO O M C 

Q K X K Q > 
-«e-2K — k a q 
w CQ <3 

£3 O W < W K OT 
SOS^SOTO 
0 camEHCQ bm 


JO CO ® » 

ta ft k 03 
d o o ® 

•rl •> 43 K 1 >» 

d_d" ra — 
pea—W 
®— OT 
ft X — W 
— K W O 
OQ K 
<AK ZpJ-o! 
KM W 
X^OT 

Q O’ ^ OT 
ZWHwO 
<; CQ OT O CO 


O 

« 


oxfc CQ_d-#4 
ea-d-WeacQ 

cMaiAcaea 
CM K co o CQ 


<< o pqeacM 
vO 'O 'O c r— 

M M M M M 

iaraea*ara 


Number 25 


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


Page 37 


231 



'"'A 
A CSP 
d-'-'CS X 
aX © 

COOT 
•H CO •» 

•JQ 
t» X <4 
© © X i 
41 si p 

I •*<{ 
■PHp 
<D rl <JP 
bOol I O 

M £ ©H 05 
P W-HO 
<4 0 — 05 
WO 05 
05 < W 


d 

O 

^ JJ 
43 P 

d tj 
• a © 
c 

•H O 
-P 

© 

43 41 

•H O 
d a) 
I* 33 


£h Eh 
M M 

£8 


CM 

CS 

CSCS 


IS. 

CMCS-4 
W W CQ 


© 
43 
® P 
O d 
© S 
a 

OT o 
43 
D. 

d m 
® 


C 

P 

® 43 
43 .H 

t>> 

33 ® 

43 

P 
d d 


-—' <p 

C 43 
® t>> 

<-.43 Xl'-' 
0.43 d 
d-H 43 ® 
41 d XH 
O S ® P 
■h C © 
0 . 1 -t o 


-h 


d 43 

X 5 

p * 


© to 

0 ^ 

A ©CS O 


ax> 

•H 

K A 


0 


© « 1 k 


—=tfc 

— * 

d cs— d 


(25 

p 

d 

d II Eh d 


Js CO 

>H 3 

O PA 


0 w 

^ pH 

<M <d 05 ® 


P EH 

cstwp 

— P O d 


& h. 

. 2° 

— Eh — 

M 




CO 


ffi G^X P 05 C? 
co W W P co W 
>-3 m p m t-s m 

Eh 

(X. 

W 

o 

o 

<4 


05 X >h <4 <4 >HX W to 

copggEnSS^^ 


toHpn« 


« 

cs 

cs 


Cd 

o 

Eh 

CO 

IS 

cs 


1-00 CSCA OJ 
i WCSW w 


e'¬ 

en 


cscsccsescs 
cm W o p cm W 


(OvOOCMDW 

QppqpQ 

HnHnrlrl 

CSCSCSCStSCS 


CS M3 CSCA HCO <4 cscs 
oj <<<!CQO'oopvO 


cs o-\tr\o- <4 o p pqcs 

wWWWWWWWW 

r—I p p p r—I H I—t p p 

CS cs csts cs cs cs cs cs 


® 

43 

t»» 

x> 


p 

-4 

w 

05 

® 

d 

P 

43 

d 

o 

d 

XI 

d 

OT 

d 

o 

Ch 

bO 

c 

P 

■a 

o 

o 


o >»-' 
43 cd cs 
P cs 

x a 

OT II 

43 p 
© TJ 5 
OT—- O 

— c 

CO 

W XI 
P Eh — 
>H 

=«fc cq 

X X X 
P EH W 
P CO P 

55 

M 

p 

si 

05 


to X 
® 

-X'——- ® 
>• 43 d 
'-'A >»P o 
X OT ® 43 

d 3d ® ot 


o 

o d 

<4 ® 


x> 

p 

to 

d 


CQ *H 
© <M X 
> © 
© TJ XJ 
co aj 


© -P a5 
d d o o 
a) 

- « d O 

n o 43 43 
— © © ® a p 

d — to— d d 

OT d 

X—- d 
P IS Eh W A 

p 55 p W P ® 

55 <4 H54d 
HDWWH — 

X co=*fcco X=te 


X 05 Oh O X O CO 
Eh CO S O P P EH 
co a> o m p co k 


s > 


<4 -4 <4 *4 



a. op 
S pcaPS 
WfePPWP 
Eh <4 -4 Eh55 

S O-60-W P 
C0=tfc05 C5X 


PPPP^KPM^XCXtHWKXXWcO^Ppp 
m m rn m c-t m r 'i nr. c-i ^ rrs c-t r\. c-i p 1 


cocOcOcOFhcOSoKQEhSz; 

C<:cccoh>oPOPcOH 


QlztcOEcdlaEc^SSSS 


« 

CO 


Ox 

M 

« 

co 

CL, 

o 


s 

ca 


cs 

mocsiAnj- 

HtSPCSWCS 


cs 

CA OCSCA OP O' 
WCSP W WWW 


cs 

cs 

I CA-4-CO 

Icsoo W I 


PCS 

ww 


OJ P 
W cs 


P CO 

cs w 

OJ p <4 PCSO'CSP O' cs <4 <4 «4 <; vocs O' cs CAP caco j-cscs p -d"Cs cs -koco vpcs 
<! co ocoojo 0 '«; wp cscs cscs co nop cs<|0'|iq^pw®HP®^H co p 

PpfCAA-<| O WCSCM cO-d-lAvO b-O' O W CSCM J^O ^-CAP W>SW4S(M d-CAt^ 
CSCSCSCSCSCSCSCSP P PHPPPPPP(MOJMN(M(\l(\|M COCA <aSco CO CO m 
PCMCM0JCMCMC\1CMPCMPCM<MCMCMPPC\|C\|C\JC\)CMPPC\|CMCMCM P rPC.p. ic.41 
CS CSCS CSCS cs CSCS CSCS cscs cscs CSCS cscs CSCS cs cs cs CSCCS CS cs cs CS p p p 




O'- 


,—. 1 —. 


p 


OT 0- .— 


XI 

s 

O, ® .—■ © 

*» 


C-* 

O A © A 


°l 

T) 

P--' A © 


0 

^ © 

d d A © -a 

© 

a| 

-P fi 

O s P TJ 

> 


•H U 

P X to 

0 

TJ 

X *H 


o 

® p 
d 

O X 
43 o 
OT —■ 


® ® cd 
43 p 
*p Oh 
O d OT 

d s p 

-T3 


CO !Z! 

W EH p P P 
W H C EH S 
EhSI>hu 
>H M P W C 

P P <1 S P 


43 

<lH 

® 


A 

OT 

d 



W 

fc 15 Eh 

co O 3 

K P 
»KO 
=tfc W P 



OT 

® 


•P 



a 

© TJ 


— >> 



0 ^ 

TJ © 

d 

© ^ 


^0 

•H © 

O |>> 

O 

TJ 


h-hCS 

-p a 

O aJ = 

d 

O © 

rH rH 

top 

© 0 

CU rH 

d 

B TJ 

/a /A 

®-60- 

rH -“-TJ 

0 a 

© 

O 


41 

© © 

© 

rH O 

II II 

II 

TJ £ © 

p *H 

d 

<4 a 


X 

, O 

X TJ 

3 

E O 


© to 

>H TJ 

© 



© © 

XJ © 

W -P 

d ® = 

A 

O -P 


41 


p 

0 

© © 


to 

c W d 

0 — 

d 

TJ bO 

+ O 

§3 

Q 0 3 

p 0 


'— 

W CJ 

0 

—^ p 



d 

aJ >5 Eh 
® W p 
P P a 

o H 5 

— WO 
P CO 


CM W tHCSP >H 
P X W P <C W 

P 5 > S3 

-60-Eh O-60-p P 


P <tf 

P W P 
W Eh C 
> P > 
O p P 
S W <5 


cd © -—- 

43 OOP d 

cd h—' © ® o 

'd - 33 ot xJ 43 

S boo p 

w d o p © ot -a 

Wpp £ Bp © 


tO>H OT 
© OT 

P to © 
a © d 

OT P X) 
p a.’a 
TJ m © 



n to to o 
ra © © 43 
®P^ 
da 41 
'am©o 
n p p © 

© TJ P jo 

ItrjMfi.© 

" 2hB 
h x « p 

o P x P 

ip n jq w 


c- cs 
W ^cs 
o P 

P O 
© X 43 
43 © 

P OT 
d «43 
JO® 
- d OT 


CO 

Eh P Eh 
P C 55 

s > 5 

p p 0 

P < o 


C « O « Cf 
EH CO O CO W 
MbWrjffl 

NOP 

0Hcoaw«coppoxc<i<:c 
SoStztcoocoap i| Q Eh P Eh 
OWOWWPQ alB^H JtOiJtO 

CLD 

JSR 

JSR 

Oh Cf CO Oh O O’ 

S W 0 S 0 w 
0 « m 0 m m 

Q5 CO O 
CO O 0 

bnffl 

JSR 

LDX 

LDA 

BCS 

tH>HX<405Wc3^(i|oX 

pIhEhEhcoSw^oEh 

3wnMbWfflr,®M 



HICMD 

NOaDD 

EDITHA 

DACMD 

GCMD 


>H P 

W <4 

s > 

Oh a 

Eh 5 

CO 

ERROR 

INFORM 

ERR1 

ADKEY 

C P 

P CS 



csp 

cscs 


C^ 

p 

P- 

P 

W p- 

H P 

co W O CS W 
W P CAW P 


WCOCQJ- P CM CO CAP <4 cs 
ao caW ca <A csca WStWcs 

cscs 

COCS 

cm W t^cs 0 w 

P CS -4 P CSP 

CM CO (A 

CQ WCS 

Q CM cACM 
CO W WCS 

WCA<|CQWCQW(!l,vO<; 

WWWWPWOqwS 

CACSCSCSCS 
CO OJ O' CM W 


CA CSCAtS «© cs <5 CS CA 4 1ACACACA 
O « O Q4WCSP® 4 <JCA-aJ O' 

CO cscs 

P CM CM 

O'CSCS O'cscs 
0 w m 0 caw 

CSCSCS 
CM 0Q O' 

CSsO 1ACS 
CM <4 <4 m 

ca«4vo CACscscsts^tsvO 
<4 COCO co CM p W cm OHOO 

-4-A O' CQ W 
c-— c-— c— t— c— 

p p p p p 

cscscs cscs 

cs 

CD 

p 

cs 

P fAlA 0- O' <j| O P W P OJ^tvO CO 
COOOCOCOCOCOCOCOCO O' O'O' O' O' 

P PPPPPPPPPPPPP 

cs cs cs cs cs cs cs cs cs cs cscs cs cs 

<4 « W 

O' O' O' 

p p p 

cscscs 

P rACAf— O' CQ 
■© ■© Hi *© <3 <4 
rH rH H H H H 

<4 m cq 
p p p 
cscscs 

J-P-CAffl 

m m cq cq 

p p p p 
CSCS cscs 

QWP CACACO <4 O W p 

mcQoooooooQ 

PPPPPPPpPrH 
CS CSCS CS CS CS CS CS CS CS 


Page 38 

232 


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


Number 25 




is.rvi'-'c- 

H TSlrH 

(\l m c\J 

II 

®f-a m 3a 

-P -P 

03 03 tfl-H .p 
•H .p 0 X> -rl 
•H ® X> 
x! XIH fi 
■P -H >> 

bO-P « a) H 
3 m 3S». -P 0 

® ®Tk ® n 

H -P X 


® 

C! 

cm 3a o 

x! oj a 

-p x> 
bO 03 bO' 
C! -p C 

® -H CD 
rH a rH 

•i 0 • 

03 -h 3a 

® aj II 
>».p 
® Eh 
Eh X -H 


W &•'— 

W O' rH rH 

« O HOIAW 


o ® x 

o to ® 
-P .p ® aj H 
•H *H 43 rH 
X X >>-P ® 

® ® X tI O 

mcM ® ® o 
> > -p 
a a a! al 

43 43 n oi C 

® ® CO Eh -P 
Wg ® 
X 

o 

03 O 




>H 2 *H Eh WPh CtfQ W 
qOQHgSWfcg' 


§ 

XI 

Eh 

g 


EH 

£5 

O 

£ 

m 


isflpaegg 

|OCQ<!DQI—IHC0C0D3 
. WOH 

IN 

a o 

i H 


X> 

®r^ 

«o 

2 


•HW 

S II 

032 

•PS 


rH-P 
rH C3 
•H 0 

sea 
® 2 
m X 
•h o 

a ® 

-PTJ 


§ 

s 



S3 

O > 

wo 
P 2 


•h E 
* ® a) 
> X 
03 O to 

tH E o 

X! Eh 
•P Q. 


P 

2 > w > 

> tao Eh O 
O S^S. 
s=fc^pa —o 



CO 


X SX <y< WOWX^<<H<IXWiH><OWO<JiO<lOOC0 
QSH^gWWHQQQEEaQPHOgHlQqEOSE 
aHfflHBQQwaaaMonacjcQmoa^toBHK 


c <xx <y<* 

9 " 


Px 

o 

O 


o 

w 

Q 


Eh 

M 

re 

g 

2 


O' 


TSlCVJHrHCOtStpqtx, mtr\rHUMAOJ 

3a wisicDTaojTa.O'tar-itsitsna.ta 


CO 2 

W(9 


<K» H 3 a 0 3 a 0 ' 3 a 0 ' 3 a 0 ' 0 'ta 0 ' 3 a® ®J-_ 4 - 3 a 
2 P32CMPOWCMPCMOWC\jWO O®® M3 


\A 

tst 


Oj W 
aq 


W3aW® WtMOferqt H- 

PtaPWPWWPWWW 


p±®-3-CM\A 

w war -- 


I raw 


lAW-d- 

W Q W 

\AU\M3® 3a23a'£> 2 M3 3arH_4-r-l-4-3a J--4-3a3a® 3_r\U\lntaM3 3a 

2 co <$ w woo Qooco<*m<i;o'WQ2uo'QrH<<;^ocoo'W'X> 


3a oj^t^o O'® p w rH oqu\o-cx m qpqwHn 

CO COCO CO COCO COCO 0'0'0'0'0'0'0'0'0'2 «: 


J-vOCQ 

2 2 2 


2«QW§ni <r»XAt^O' WOWrl o^lAt— O' 2 o Wtacj-0- 

2 22 2m«ninmn«mnouoouooDoqq 





© 

X 





*—^ 


4-i — 

o 

© 

r—^ 


X! 

0] 


— ctf 

r- X 

d — 

X 


bO-^ 

M 


P w ctf 

-P X 

c u 

o 

C“ 

—-H X 

o 


•H 

•H ® 

•H © 

X 


ax!® 

© 

s 

X TO O 

X 

-P *H 

X 

O -P 

bO H 

si 

>H 

© *H rH 

® « 

C rH 

® 

•H 

XPH 

o 



II 

O erf 


<D X 

a ® ® 

T3 

£ 

U 'O -P 

X n 

O O 

•* 

-P © 

03 O 


•rH 

O Crf TO 

O XI 


p» 

© 

x> ® 



^ © 

X cd 

•» O 

X 

rH ^ 

a x o 

OJ 

•H 

U *H -P 

X 

TSt-P 

X 

© O 

<D^ -P 


xsix 

© si — 

® Oh 

'ti. 

3 

T3 d 

E 


9k « 

1'——' 

■-- 

— a 

o 

--— 


® 

Eh + 


O p 3 
I H *P 

i cr, ® 

u 

O 


>H CO 
Eh Eh 


£_ . 
HBK 


M 

O 


t—C 

W 

co^j-ta 

O® M3 




OBOEh 0=ffcCQ 
0 2 0 2 
o9 q - 


S + Eh + > + Eh >< - 
“ “_4n — > S co ti > 

0 o m w w o 

2 P Eh CQ 2 


« 
M « 
XI W 


2 co 


o 

S5 

2 

> 

Q 

2 


XJ M 
WXI 
K !z; 
CX xi 


3 

% 

w 

Eh 


Eh 

H 3 Eh 

2 4J ® 
M ® ® 
XI Eh rH 

S'— O 
M 


CO O CO 
Eh XI EH 
« O K 

EH X 

II 

2 « 

IH W 

XJ 


CM CO CM CM (HVJ-rH 

w w Wta waw 


W w co ta W'OtA 
Qtata w Qtata 


03 

w 


2 Eh 
M W 

9g 


a p q co 2 2 

2 2 2 w > > 

> a > EH ota o 

o a o >h 2 2 

2 0 2 CQ'-=jfc»^ 


Q+ &h+ + Ohi_, _. . 

o2W S 2 WO —r 


Eh + 


-BW^W 


co 

o 

o 

-p < 

C 

X 

3 

-P 

® 

X 


X 

o 

M 
M3 W 
S 
^fcM 


K O >H |k| X >1 <>H 
COOEQEQQQ..„ 
bmcOXcO japcOH 

pH Ph 

t> O 

W O 

> XI 

O Ph 

2 O 

X- 

t—I 

coxMMWcowaw 
O'CM Q w P W Q 3a Q 


2XWoxw>h>ho<;o2cooop><w 

EhSSSPhSQPhOXPQEhOWWEhQS 

cOMOHOinPOCOEHCOcOcqpcOcxXlCC) 

0 EH w 

S W eh 


a 

o 


M3 

tarn 


co3xv3x\3A3aM3c\i\Aao\A3a3a3x\\A3a3a2 23a3aoota 

rH M3 CO 0'W2m2QO'PmpO'WOOQMDHM3 


CM W-3-Q W3X\b~- cOH-r^lXc 

isiqwwqww wW3aw 

3 a3aja3 M3 _ 3 -rH 3a rHco taM3p±3a j-j-ta 2 ixuA3aM3co3a oj § 

(MO'CO«jco<!m20'WPWWQ2o O'® w® m o 2 Q 


O'2 O QW5C(M4®®20Q&HH<H3U3XO'BOQ|i ( 3aH 
cococo ®® O'O'O'O'O'O'O'O'O'2 2 2 2 2 2 2 2 2 m m 
c c c c^~t" c c^~*c— c^-c"— r— C' c^-— c—— c^-— c s --c''-c^--r^-c—c^-c'— 


CM IA t—O' m Q W rH ®3X\M3® <| O W 3a CM _43X\ p— O' 03 Q W fc H 

mmmmmmmooooooooppQppppppPM 
c— c— c— c— X'— r— r— r— x- t— c— c— c— x- c^- c— c— rxc^-cX-rX-t^-c^t— 

i —I H r—Ir—I i I i—I i—I rl —lr—I i—Ir—li—I H I—Ir—I i—!r—I i—li—I rl i—I I—If—I rl rl 


Number 25 


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


Page 39 

233 



PRELIMINARY SUBJECT TO REVISION 


IEEE COMPUTER SOCIETY MICROPROCESSOR STANDARDS COMMITTEE 

PROPOSED STANDARD for the S-100 BUS 

PRELIMINARY SPECIFICATION 


BY GEORGE MORROW 

Thinker Toys 
1201 -10th Street 
Berkeley, CA 94707 
(415)527-7548 

and 

HOWARD FULLMER 

Parasitic Engineering Inc. 

P.O. Box 6314 
Albany, CA 94706 
(415) 547-6612 

The following is a preliminary specification for the comput¬ 
er bus commonly known as the S-100 Bus. This bus was first 
introduced by MITS Inc. with their Altair kit. It has since 
spread throughout the electronics industry and beyond. Today 
over a hundred manufacturers make products which claim to 
be compatible with the S-100 bus even though, until now, no 
complete specification has been available. 

This document is a specification for both timing and signal 
discipline. Signal discipline is described using the Bus Master/ 
Bus Slave language long associated with Digital Equipment’s 
PDP 11. This point of view facilitated the development of a 
simple and highly realizable DMA protocol, the extended 
addressing capabilities, and the 16 bit wide data path 
proposals. These extensions to the original Altair bus represent 
a significant advance in the state of the art of small computers. 
These advances are a direct result of a continuing dialogue 
with a large number of interested people who have contributed 
their thoughts and ideas to the standards committee. 

S-100 Bus Signal Definitions 

Bus Signal Notes 

1. There are three types of signals on the S-100 bus. M stands 
for Bus Master. Signals designated by M are those which a 
Bus Master must generate. The Bus Master currently 
controlling the bus has the responsibility for faithfully 
generating all signals of type M during the duration of its 
control of the bus. 

S stands for Bus Slave. A Bus Slave need generate only 
that subset of type S signals which are necessary to com¬ 
municate with Bus Masters which have the ability to 
address the slave. 

B stands for Bus. Any bus signal which is not of type M 
or S is by default type B. This is not to say that some Bus 
Master is not in fact generating one or more type B signals. 
Rather a type B signal is one that (a) not all Bus Masters are 
required to generate, and (b) not any Bus Slave is required 
to generate. 

A Bus Master is, by definition, a bus device which gener¬ 
ates at least all of the type M signals. A Bus Slave is a bus 
device which generates some subset of type S signals. A 
Bus Master may also be a bus slave and vice-versa. Memory 
devices are almost always Bus Slaves while DMA devices 


are usually both a Bus Master (data transfers) and a Bus 
Slave (accepting commands). Central Processing Units are 
usually Bus Masters. 

2. The 8 status signals are: SME MR, S INP, SMI, SOUT, 
SHLTA, SSTACK (not specified), SWO, and SINT A. 

3. The 6 command/control sig nals are: PHLDA, PSYNC, 
PDBIN, PINTE (not specified), PWR, and PWA1T. 

4. The 16 address signals are: A15, A14, A13, A12, A11, A10, 
A9, A8, A7, A6, A5, A4, A3, A2, Al, and AO. 

5. Data output is specified relative to a Bus Master. By defini¬ 
tion, data which is transmitted by a Bus Master is always 
data output and occurs on the DO bus. 

6. Data input is specified relative to a Bus Master. By definition, 
data which is received by a Bus Master is always data input 
and occurs on the DI bus. 

7. A bus cycle is a collection of bus states (BS a ). A bus cycle 
always starts with a BS! state which is followed by a BS 2 
state. After BS 2 comes an indeterminate number of B^ 
states. A bus cycle may have zero BS^y states or it may have 
an arbitrarily large number of BS W states. BS 3 is the bus 
state which follows BS W (or BS 2 if there are no BS W states 
present). BS 3 is followed by zero to three BS, states. A BS 3 
or BS; state terminates a bus cycle. 

8. The DO bus is the followingset of signals: D07, D06, D05, 
D04, D03, D02, DOl, DOO. 

9. The DI bus is the following set of signals: D17,D16,D15, 
D14, D13, D12, Dll,DIO. 

10. These signals should be generated by an open collector bus 
driver capable of sinking at least 20 ma. at no more than 
.5 volts. 

11. During the last half of bus state 1 and the first half of bus 
state 2, the DO lines are used to furnish extended address¬ 
ing to slaves that can utilize this information. 

For 16 bit masters and slaves, the DI and DO lines gang 
together to form a 16 bit bidirectional data bus with the DO 
lines forming the low order byte while the DI lines accomo¬ 
date the high order byte. The con figuration of t he DI a nd DO 
buses is governed by the signals SXTRQ and SXTN. When 
both these signals are low, the DI and DO lines become bidirec¬ 
tional. Otherwise, DI carries the data to the current master 
while DO carries data to the addressed slave. 

Signal Characteristics 

Bus drivers must sink at least 24 ma. at no more than 
.5 volts. Except for open collector drivers, they must source at 
least 2 ma. at no less than 2.4 volts. 

Bus receivers must have diode clamps to prevent excessive 
negative excursions. Any bus signal less than 0.8 volts must 
be recognized as a logic zero and any signal more than 2 volts 
must be interpreted as a logic one. 

Receivers are to source no more than 0.8 ma. at .5 volts and 
are to sink no more than 80 jua. at 2.4 volts. The capacitance 
load of an input from the bus must not exceed 25 pf. 

Bus State Comments 

BSi is the initial bus state of a bus cycle. The address lines 
are in a state of flux during through most of BS t and PSYNC 
is active starting with the second half of BSi. 


Page 40 

234 


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


Number 25 



.PRELIMINARY SUBJECT TO REVISION 


BS 2 is the second bus state when address data, status, and 
ready signals become stable. 

BS W states occur as needed to synchronize a Bus Master 
with a Bus Slave which has brought one of the ready lines 
false. 

BS 3 is the data transfer state when a Bus Master transfers 
data to a slave or vice-versa. 

BSj is a state during which the bus is idle. 


Timing Notes 

All timing references in the timing diagrams are specified 
at the midpoint of the rising or falling edge of the signal. Rise 
and fall times are not to exceed 50 ns. 

All signals referred to in the timing diagrams are S-100 Bus 
signals with the excep tions i n note 6. 

1. The falling edge of PWR must occur within the area shown. 
The rising edge must occur within a similar area of the next 
Bus State. 

2. BS^ is either BS 2 or BS™,- 

3. Addresses, Data, and Status signals must remain stable 
during BSyy. 

4. The interrupt lines must be stable for the period shown in 
the Bus State preceding BS! of an op-code fetch. The pro¬ 
posal is that when an interrupt line is true, it remains true 
until the CPU responds. Normally, this response would be 
an I/O instruction that addresses the interrupting device. 

5. The rising edge of PWAIT must occur within the area 
shown. The falling edge must occur within a similar area 
following the rising edge of the logical AND of PRDY and 
XRDY. 


6. Signals prefixed by “DMA” refer to internal logic of the 
new Bus Master. These signals control the buffers of this 
Bus Master which drive the Command and Control, Status, 
Address, and Data output Bus lines. The timing diagram 
depicts logic levels which are high when these buffers are 
disabled. 

7. BSo is either BS 3 or BSj. 

8. BS!?, is either BSj or BS! . 

9. Extended address bits A16 through A23 are multiplexed on 
the DO lines. They must occur as shown within 250 ns after 
the rising edge of 0 2 during BSi. During a write, data must 
appear on these lines 100 ns before PWR is active. The PWR 
signal can be asserted as soon as 5 ns after the rising edge of 
02 during BS 2 . Therefore, under worst case conditions, the 
extended addresses are on the bus for 155 ns. Masters can 
generate PWR later as shown. This would allow the exten¬ 
ded addresses to be on the bus longer. However, slaves 
should be designed to correctly respond in the worst case 
situation. 

10. To avoid conflict on the DO lines during a 16 bit read, as 
in the situation described in note 9 above, the extended 
addresses must be removed from the DO lines before the 
rising edge of PDBIN. 


Direct Memory Access (DMA) Requirements 


A DMA cycle is a special case of a Bus Master taking over 
the Bus to execute a memory read or write cycle. A DMA 
device is required to generate all type M (Bus Master) signals 
on the Bus. 


Th e Bus Ex change 

PHOLD is the signal used by one Bus Master t o reques t that 
another Bus Master give up control of the Bus. PHOLD must 
not be asserted true unless PHLDA is false and PRIORITY (if 
implemented) is true. 

One Bus Master (CPU) relinquishes control of the Bus to 
another (DMA) as shown in the Bus Exchange Timing diagram. 


The DMA device mu st control t he CPU’s bu s dri vers throu gh 
the use of ADD DSB, DO DSB, STAT DSB and C/C DSB. It 
must also control its own bus drivers through the use of sig¬ 
nals similar to those shown in note 6. 

The CPU (current master) and the DMA device (new 
Master) must both drive the Command and Control signals for 
at least 200 ns at two different periods as shown in the Bus 
Exchange timing diagram. During these two times, the 
Command and Control signals for at least 200 ns at two differ¬ 
ent periods as shown in the Bus Exchange timing diagram. 
During these two times, the Command and Control signals 
are required to have the following levels: 

1. PSYNC = 0 

2. PWAIT = 0 

3. PHLDA = 1 
4 PDBIN = 0 
5. PWR = 1 

The DMA cycle timing sequence which follows is a sugges¬ 
ted implementation that meets all the requirements of the 
generalized Bus Exchange timing. The sequ ence is c ontrolled 
by the edges of 0 2 . At some previous time, PHOLD was asser¬ 
ted according to the limitations described in the first para¬ 
graph of this section. PHLDA is asserted true by the CPU 
during BS 3 of the last CPU bus cycle. The bus exchange begins 
on the falling edge of 0 2 while PHLDA is true (labeled 1 on 
the timing diagram). The DMA bus cycle then pro ceeds as 
described in the following section. At edge 8 of 0 2 , PHOLD 
is driven false by the DMA device and henceforth die CPU is 
again in control of the bus. 

Proposed DMA Cycle Sequence 
02 edge: 

1. CPU Address and Data bus drivers turned off. DMA 
Command and Control drivers turned on. The CPU and 
DMA Command and Control signals must match values 
described in the previous section. 

2. CPU Status and Command and Control drivers turned 
off. DMA Address, Data output and Status drivers 
turned on. PSYNC = 1. 

3. No change. 

4. PSYNC = 0. PDBIN = 1 if memory read, or PWR = 0 if 
memory write. 

5. No change. 

6 . PDBIN = 0 and PWR = 1. 

7. CPU Command and control drivers turned on. DMA 
Address and Data output drivers turned off. 

8. CPU Address, Data output, and Status drivers turned on. 
DMA Status and Command and Control drivers turned 
off. PHCFLD = 1. 

Acknowledgement 

We would like to thank the other members of the Micro¬ 
processor Standards Committee for their support and invalu¬ 
able comments. Special thanks to Robert Stewart who is chair¬ 
man of the Committee. His leadership and organizational 
skills have been a great aid to all of us. 

We would also like to extend our thanks to Kells Elmquist 
and Steve Edleman of Ithaca Audio. Both of these gentlemen 
flew out to the Second Computer Faire to discuss their ideas 
about S-100 bus extensions with us. Several of their ideas 
were truly inspirational. Their intellectual prodding was the 
force which created the extended addressing and the bi-direc¬ 
tional data bus proposals. Kells Elmquist is responsible for 
another proposal which we will term “logical daisy chaining”. 
This will be incorporated into the standard soon and will 
make possible a significant advance in interrupt structures 
within the present S-100 bus. 


Number 25 


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


Page 41 

235 





u'' r»» oocaO'— cmca-tla so r-» co o> o — cm ca -y la vo r*» co <t\ o 

CM CM CM CM CM CA CA CA CA CA CA CA CA CA CA -T -X -T -X -X -X -X -X -3" LA 









Page 42 

236 


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


Number 25 














PRELIMINARY SUBJECT TO REVISION 




*-'cn > — 


- 6 . 


U H « wo 


O i/i *-> 


TD CLCO -O a 


U OQ U CJ O 

C 3 

o—o ai cr m 

x >* x x o x 

*- x- *-> t- i- *-« 


-T •— — • 


i 


C — 

o o c o 

■d >>m l 

— u a 

S- 

m u- ki 

c w — o 

(71 O O 3 

— i*_ H_ C- 

l/l O 

c >• u 
w O — 

3 — O *-* 

*-* 4~> W Q. 
<0 U <0 3 


* O 
l- > 
O <D 

i/) l/l 

C 

O fD 


I — o 
* X *-■ 
) 3 si 


6 o 


l/l l/l — 


■ — — — t— O I 


I C( - « 


0O — — 


< 

l— 

< 


Ju 




2 l 


**- 3 i/l l- — 


3 O — C 
O ~ O *0 
> X 


E 2- 


c c *- 


dj l/l •-< 

*-* «- c »0 

COX W 

— > — Cl 


— 3 
- X o 
o «-> — 


o z 

— > H- 

41 O X 

C — l/l 

C7> i/i 

— (71 

l/l o c 


cm — 


ci hi a *-> 


c it *-* 


ji tro¬ 


ll — 
i/i x 
— ai 


6 

cc — 

:* — 


l/l 

3 l/l l/l 

e — 

<u >* o o 

x — *-* c 

U ■o - ifl o 

— C I- >* Q. 

X O (0 l/l 

2 E *-> 

m — oi c 

— o I- c o 

ro o Q. — l- 

c — a n- 

Oi > I Cl 

— O l <DO 

i/l "O 1- 

i/l w «TJ 

i/i O O i/i 5 

3 > > X) 

X a ro O I- 

— — O <0 

< i/t i/l X X 


o — o 
— X c 
(71 •<-< 


*->3 0 — 


X O *-» 3 


fo- 

cc 

►— 

X 


Number 25 


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


Page 43 


237 



















































TSA APPLICATIONS AND 
DEVELOPMENT TOOLS 

News Release Received: 78 March 10 

Now available, a full complement of Z80/8080/8085 soft¬ 
ware devlopment tools. These are disk based, and oriented 
towards the popular CP/M Operating System (TM Digital 
Research). System development tools include a relocatable 
linking macro assembler with linking loader, cross-reference 
generator, and full library of modules. With the assembler is 
included a symbolic debugger allowing user defined symbols. 
Higher level language support is provided by interface with 
Micro-Soft FORTRAN. 

For advanced systems, TSA/OS is an upward compatable 
CP/M-like operating system providing CRT screen control, 
automatic library search, an extended batch mode with 
turn-key system capability, as well as an advanced configura¬ 
tion scheme. 

TSA Software has available a set of applications packages. 
The TSA Database System uses a mixture of assembly code 
and Fortran. The system uses table driven screen and record 
formats; and has a mini-compiler to optimize record search 
capability. The TSA Word Processor uses a normal terminal to 
provide natural text editing with advanced formatting features, 
including proportional printing. Full use of disk file's is provid¬ 
ed, as well as file merging for mailing list and similar uses. 

The product line is S-100 oriented, but is flexible for all 
other main frames, as all special functions are handled through 
the operating system. Package prices: $100 and up, dealer and 
OEM inquiries invited. TSA Software, 5 North Salem Rd., 
Ridgefield, CT 06877; (203) 438-3954. 


THE SOFTWARE EXCHANGE 

New Publication Received: 78 April 4 

The Software Exchange is a new publication devoted to the 
exchange of ready to use software for business and the home. 
The Software Exchange provides classified listings for comput¬ 
er software. You will be able to match your application and 
computer to those listed. Each program will have a description 
of its operation, hardware requirements, and where the pro¬ 
vided materials can be obtained. If you have a special program 
you need, you can place a Software Search in The Software 
Exchange. It is very likely that someone has the software you 
are looking for. 

In addition, all advertising will be devoted exclusively to 
software services available to micro and minicomputer users. 
The Software Exchange is a bi-monthly publication available 
soon at computer stores for $1.50 per issue, and by subscrip¬ 
tion for $8 per year (six issues). Box 55056, Valencia, CA 
91355. 


CORRECTION 

Gentlemen: Received: 78 March 28 

With regard to your reproduction of the Stanford 
University News Release, I wish to correct one of your 
references. The “memorandum” from CMU about the robot 
was written by Mark Fox (not Mark Gos) and Brian Reid. 

Sincerely, Graduate Student 

Mark Sherman CMU Dept, of Computer Science 


Page 46 

240 


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


Number 25 















Dr. DoBB'S JoURNALof 

COMPUTER 

(Calisthenics f) Orthodontia 

Running Light Without Overbyte 


Number 26 June/July 1978 

Volume 3, Issue 6 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


SOFTWARE 

Intelligent Terminal Implementation on the S-100 Bus Tim Pugh 

Disk file transfer under CP/M using the IDS 88-Modem Board 


4 

Autodump Richard Emerson 

A memory dumper for Poly-88 tape system 


18 

High Speed Cassette I/O for the KIM -1 Theodore E. Bridge 


24 

LAZARUS Andrew Hertzfeld 

A program to resurrect BASIC programs on the Apple-II 


31 

A Tiny BASIC Extensions Package Leor Zolman 


34 

HARDWARE 

TheZilogZ-8 U.R. Source 

A PEEK at the new single-chip microcomputer from Zilog 


28 





© David Dameron 1979 



MORE ON UNIX 


AND MORE. . . 


Dear Dr. Dobb, Received: 78 May 22 

In the April 1978 issue of DDJ, page 3, Pierre duPont wrote 
that he is planning to write an operating system similar to 
UNIX for his 8080. Enclosed is a copy of a letter I sent to Mr. 
duPont. 

Jim Howell 555 Candlestick Way 

San Jose, CA 95127 

Pierre duPont 
Salisbury School 
Salisbury, CT 06068 

Dear Pierre, 

Your letter in DDJ attracted my interest. I have used UNIX 
for about 2 months and I really like it. Before you start 
writing your “UNIX”, you may want to read “The UNIX 
Time-Sharing System” in the July 1974 issue of Communica¬ 
tions of the ACM (vol 17, #7), pages 365-375. This article, 
which is part of the documentation for users of UNIX, gives a 
description of the structure of UNIX and describes some of 
the capabilities of the “shell” program. I can send you a copy 
of this article if you need it. 

As for some of your questions: (1) 8080 interrupts. To get 
more than 8 interrupts for the 8080, the hardware must 
arrange to supply a CALL instruction, rather than a restart, 
for at least some devices when acknowledging an interrupt. 
Intel has a chip in the 8080 family (I don’t know the number) 
which can do most of this for you. Each I/O device can gener¬ 
ate a call to a different location, thus allowing as many inter¬ 
rupts as you want. The Intel chip handles 8 devices, I think. 

(2) One way to store relocatable programs is to have, as 
part of the program, one or more (or maybe none?) records in 
the file, which are a list of the locations within the program 
which need relocating. These records must be distinguishable, 
of course, from program records. One problem with using an 
unused opcode is that any code may appear as an operand of 
an immediate instruction or in an area containing constants 
or tables. 

(4) 8080 vs Z-80. Advantage of using the Z-80: the 
mrogram(s) comprising your “UNIX” may be smaller than with 
tfi. 8080. Advantages of using the 8080: the program would 
be distributable to more people, (assuming you plan to 
distribute it): and the 8080 is what you have now. The disk 
would appear to be the limiting factor in the speed of the sys¬ 
tem, so that the faster speed of the Z-80 relative to the 8080 
is probably not an important consideration. The lack of 
unused opcodes for the Z-80 is not a problem if you use a 
relocation scheme such as in (2). These are the major consider¬ 
ations as I see them. I hope this helps you make your decision. 

(6) I am interested in your “UND(” (or whatever you end 
up calling it), but mainly from the standpoint of keeping up 
with developments in the computer hobbyist area. My system 
is the COSMAC ELF II (using the RCA 1802) and my choice 
for a bigger system would be one using the 6800, such as 
SWTPC or MSI. 

Good luck and keep us informed (thru DDJ). 

Sincerely, 

Jim Howell 


Dear Sirs: Received: 78 May 19 

The purpose of this letter is to introduce UNIX for the 
8080 microprocessor. The system is called CHAOS, an acro¬ 
nym for Clairemont //igh A LTAIR Operating System. 

CHAOS is currently in operation at Clairemont High, and 
offers the user the following capabilities: 

* A maximum of nine timeshared processes. A process 
may be an interactive user, lineprinter controller, and 
executing command, minicomputer translator, etc. 

* A choice of three computer programming languages: 

BASIC —MITS Disk Extended Version 4.1 (modified 
for CHAOS). 

8080 Assembly —relocation table allows patching of 
relative addresses, and placement of 
the program anywhere in memory. 
Shell — operating system command lines that are 
contained in a file and may reference para¬ 
meters in the calling command line via a 
macro structure. 

PASCAL—hopefully will soon become the fourth 
language supported by CHAOS. 

* User-maintained system. All updating and expanding is 
easily accomplished due to the power of CHAOS. 

* A complete accounting system that allows program/ 
file sharing, access rights control and unlimited sub¬ 
accounts. CHAOS supports six file types: 8080 Machine 
Language, BASIC program, sequential data, Shell com¬ 
mand line, random data and directory. Access rights 
include read, write, ownership and execute. 

* Interfacing with the Hewlett-Packard 2000 Access Sys¬ 
tem BASIC minicomputer and a text editor, assembler 
and loader on that system. 

* Storage of programs and data on a maximum of eight 
floppy disk drives and one cassette tape drive. 

* Mechanisms within the Kernel (timeshare controller) 
to handle semaphore requests and job queuing. 

* Program nesting, recursion and inter-language calls via 
the CHAOS file module and stack schemes. 

Our current hardware configuration includes: 

IMSAI 8080 microprocessor 
64 K RAM 

Memory Switching Device for CHAOS 
2KPROM 

6 serial input/output ports 

Three parallel plus one serial input/output port 

Disk Controller 

Cassette Interface 

4 Video Terminals 

1 Printer/Terminal 
Diablo Lineprinter 

2 MITS Floppy Disk Drives 
Cassette Player/Recorder 

I would welcome any inquiries regarding CHAOS, and 
would be interested in learning about other like operating 
systems for the 8080 microprocessor. 

Sincerely, 3632 Governor Drive 

Mary Elizabeth Kroening San Diego, CA 92122 

Aha, do I sense the beginnings of a dialogue? -TRW 


Number 26 


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


Page 3 


243 


Intelligent Terminal Implementation 
for the S-100 Bus 

DISK FILE TRANSFER UNDER CP/M USING THE IDS 88-MODEM BOARD 


BY TIM PUGH 

9655-M Homestead Court 
Laurel, MD 20810 
(301) 776-5253 

There is now available a board for the S-100 BUS which, 
when coupled with appropriate software, can add a powerful 
new dimension to your system. The board I refer to is an 
Originate/Answer Modem board and is being produced by at 
least two manufacturers: D C Hayes Assoc, of Atlanta, GA and 
International Data Systems (IDS) of Falls Church, VA. With 
an Originate/Answer Modem you can implement the following 
functions: 

1. Intelligent Terminal 

2. Remote Console 

3. PCNET Node 

There are undoubtedly other functions which can be imple¬ 
mented but these three are fairly clearly defined. 

The first of these functions (Intelligent Terminal) is imple¬ 
mented to a significant extent by the program which accom¬ 
panies this article. The basic purpose of this function is to 
allow you to communicate with a large “Time Sharing Com¬ 
puter” (TSC) and effectively use the various components of 
your “Personal Computer” (PC) in carrying on this communi¬ 
cation. For example, you may wish to use your video terminal 
for some of the communications and then switch to a printing 
terminal or hard copy device at the appropriate time. Also, 
you may wish to transfer data between the PC’s floppy disk 
and the TSC. 

This last activity is truly significant if you are taking pro¬ 
gramming courses or are a professional programmer whose 
company computer allows Demand Mode access; i.e., access via 
a terminal. It has been my experience that access to TSC sys¬ 
tems in either a school or professional environment is seldom 
available during “prime time”; i.e., the hours of 8:00 AM to 
5:00 PM. Thus, one must either enter his programs via cards— 
not a very exciting prospect—or do most of his work during 
“odd hours” when the available terminal lines are not heavily 
utilized. However, given the ability to transfer files between 
the TSC and the PC one can prepare his source input at his 
convenience using the text editor of his PC system. The source 
statements are stored on a floppy disk and later transferred to 
the TSC. Thus, the TSC is needed only for compilation and 
execution. Subsequent corrections to the source “deck” can 
be performed on the PC system. I find that most of the time 
I spend on a computer is used in editing source statements 
and comparatively little in compilation and execution. This 
means that only a small portion of one’s work need be 
performed at “odd hours” and this can be performed in the 
comfort of one’s home. 


The second function (Remote Console) is my next project 
and should not be nearly so difficult as the first. With such a 
capability a businessman who has a computer system at his 
place of business need only purchase an additional terminal 
and acoustic coupler to bring the capabilities of that system 
into his home. Or the professional; e.g., engineer or program¬ 
mer, can have access to his home system from his place of 
work. Or the person who wants to demonstrate the capabilities 
of a computer system to a potential customer can do so with¬ 
out having to carry the entire system with him. 

The third function (PCNET Node) will allow both mes¬ 
sages and program files to be transferred between two or more 
PC’s or between a PC and a data facility whose communication 
protocol is compatible with that of the PCNET. This capability 
opens up all sorts of possibilities. The correspondence I have 
received to date indicates that the protocols for this network 
will be ready for general distribution in the first half of this 
year, with prototype PCNET software available in the second 
half of this year. On March 5th of this year a demonstration of 
existing PCNET software was given when an 8080 system in 
Sunnyvale, CA sent messages to a PET in San Jose, CA. Noise 
was injected on the phone lines and the two systems success¬ 
fully detected bad “packets” and retransmitted good ones. 
Additional information concerning this can be had by contac¬ 
ting: 

PCNET Committee 
701 Welch Road, Suite 226 
Palo Alto, CA 94304 
(415) 328-2411 

It is quite probable that given these functions and the 
ever increasing power of PC systems and software, many 
professionals will be able to perform a good deal of their 
work in the convenience of their home augmented by confer¬ 
ences between coworkers at their place of employment. 

Modem Selection 

In choosing a modem I was very concerned that it have a 
stable frequency source and good filtering characteristics. 
About 18 months ago I built the Pennywhistle modem (acous¬ 
tic coupler) kit. It used a 555 timer IC with a two stage filter 
and phase locked loop. While this modem would work (after 
a rather tedious allignment) with one TSC, it was not reliable 
when interfacing with a second and would not function at all 
with a third. All three of these TSC’s were within a radius of 
20 miles of my terminal. I understand that certain design 
improvements have been made in the Pennywhistle since then. 

With regard to choosing between an acoustic coupler and 
one of the S-100 BUS Originate/Answer Modem cards, the 
function of “Intelligent Terminal” can be performed by either. 


Page 4 

244 


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


Number 26 




I have used an Anderson Jacobson AD 342A Originate/Answer 
Acoustic Coupler with great success in this application. 
However, acoustic couplers can neither provide auto answer 
nor automatic dialing; this precludes the Remote Console 
function and places considerable limitations on the PCNET 
function. 

Having decided on an S-100 BUS card implementation over 
the acoustic coupler approach I then made a comparison 
between the IDS and D C Hayes boards. The following differ¬ 
ences seemed significant to me: 

1. Hayes — Uses the Motorola MC14412 Modem chip. 

IDS — Uses the Motorola MC6860L Modem chip. 

2. Hayes - Has a 6-pole filter in the receive channel and 

no filtering in the transmit channel. 

IDS — Has an 8-pole filter in the receive channel and 
a second 8 -pole filter in the transmit channel. 

3. Hayes — Has two software selectable BAUD rates, 110 

and 300. 

IDS — Has a BAUD rate which is variable under pro¬ 
gram control from 66 to 600 BAUD. 

4. Hayes - Does not provide dial-tone detection. 

IDS — Detects dial tone and sets a corresponding 
status bit. 

5. Hayes — Requires host processor to perform dial 

pulsing. 

IDS — Provides auto-dialing in hardware. 

6. Hayes — Requires CBT be supplied with internal power 

source. 

IDS — Supplies current source for CBT thus allowing 
the less expensive model CBT to be used. 

7. Hayes - Has no published receiver sensitivity. 

IDS — Provides communication down to —58 dBm. 

8. Hayes — Claims to provide for direct connection to 

telephone lines. 

IDS — Requires a coupler (CBT or CBS). 

9. Hayes — Assembled & tested $279.95 

Kit (not available) - 

IDS - Assembled & tested $395.00 

Kit $245.00 

The difference between the two modem chips is consider¬ 
able. In essence, the MCI4412 does not perform the “super¬ 
visory” functions that are provided by the MC6860. For 
example, the 6860 in answer mode detects the ring, causes the 
phone to go off hook (i.e. answers the phone) places the 
carrier on the line and detects the remote tone (if present). All 
this must be done under software control on the 14412. There 
are many other individual points of difference. The interested 
individual should get spec sheets on each to make a proper 
comparison. 

A Motorola application note entitled “Low-speed Modem 
System Design Using the MC6860” states on page 13 that “A 
complete full duplex system will most likely require operation 
with input signals down to —50 dBm at the line input. This 
requires a receive filter network having at least 8 poles... and 
a local transmit filter having 4 poles to provide 25 dB local 
transmit signal harmonic rejection.” Notice that the IDS unit 
has 8 poles in both transmit and receive. The fact that there is 
no transmit filter in the Hayes unit probably precludes success¬ 
ful full-duplex operation. While full duplex is not required for 
the Intelligent Terminal function, I do believe it is necessary 
for the Remote Console function. The console (LS Dumb 
Terminal) I am using to generate this article is operating in full 


duplex. Were it not, I would have difficulty using my TDL 
Z-TEL text editor. When I enter an ESC character to 
terminate a string, it echoes a $. When I enter other control 
characters; e.g., control Y, it echoes Y. In half duplex this 
would not occur. 

The —50 dBm receive level spec mentioned by Motorola 
agrees with the specs for both the Anderson Jacobson AD 
342A Acoustic Coupler mentioned earlier and the BELL 103/ 
113 Modem. On page 3 of a report by VADIC entitled 
“Telecommunications From The Terminal User’s Viewpoint” 
the statement is made that “to enable 98% of all calls to be 
received, a modem would have to be capable of demodulating 
signals as weak as —50 dBm.” Note however, that the IDS unit 
exceeds this by 8 dBm — a further indication of superior 
design. 

The reason for having two 8-pole filters in the IDS unit 
rather than 8 for TX and 4 for RX is that the filters are not 
actually identified with TX and RX but with high band and 
low band. The originator of the call always transmits on the 
low band—1270 Hz Mark and 1070 Hz space—while the 
device which answers transmits on the high band—2225 Hz 
Mark and 2025 Hz space. Thus, each filter is designed for 
optimum performance for its particular band. In the Hayes 
unit there is but one filter and it is always in the receive chan¬ 
nel. Thus, it must function as a high band filter for originate 
mode and a low band filter on answerback by component 
switching. This results in less than optimum performance (even 
for 6-poles) on either band. To get some quantitative feel for 
the difference in the two filter designs, the IDS unit employs 
a total of 32 Op Amps in its filter and detector circuit as com¬ 
pared with 8 Op Amps in the Hayes unit. As you can see, 
— 58 dBm is not easily achieved. 

The two apparent advantages the Hayes unit has over the 
IDS unit is ability to connect directly into the phone line and 
price. Needless to say, price is an important consideration. It 
must be weighed against the probability of success each unit 
is likely to have in error free communications. This is especial¬ 
ly true in long distance communication-meaning any distance 
requiring more than one telephone switching station to be 
involved in the connection. Also, considerable variation in 
local communications can result from differences in line loss 
and line noise. This variation probably accounts for the mixed 
results I described earlier for the Pennywhistle when trying to 
communicate with three different TSCs. In the final analysis, 
specifications are only indicators and it is the actual perform¬ 
ance of a unit that counts. Unfortunately I have not had the 
opportunity to make any “A B comparisons” between the two 
units. I can only say that I have been using the IDS unit suc¬ 
cessfully for the past three months in communicating with the 
same three TSCs mentioned earlier. I have operated with these 
TSCs at 110, 150 and 300 BAUD. On April 24 I communi¬ 
cated for the first time with another IDS 88-Modem. The 
transmission was error free at 300 and 450 BAUD. It was 
readable but not reliable at 500 BAUD; i.e., about 85% error 
free. This test was run between Laurel, MD and a location near 
Dulles Airport in Virginia; a distance of about 35 air miles and 
undoubtedly involved two switching stations. The direct con¬ 
nection feature of the Hayes unit is discussed in the section on 
Telco Interface which follows. 

If you choose to get the IDS kit as I did, be advised that 
this is a rather difficult kit to build and should not be under¬ 
taken by someone who has not built several others in advance 


Number 26 


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


Page 5 

245 



of it. This does not imply a poor quality board. It is due to the 
high component density required to put everything on one 
board. The major difficulty is due to close component place¬ 
ment-raising the possibility of solder bridges—and the fact 
that most passive components, i.e., resistors, diodes, etc., are 
mounted vertically. In addition, there are several signal level 
adjustments which must be made: TX Carrier Level, Dial 
Tone Detector Gain, Low & High Band Filter Gain, and 
Threshold Detector Sensitivity. But do not despair, IDS will 
accept your completed kit and both make the necessary 
adjustments and check the board out for proper operation. 
Theoretically, this service is free provided no repairs are neces¬ 
sary. In my case, I was charged just over $30.00 for certain 
discrepancies. This is still cheaper than the assembled Hayes 
unit ($275 vs $280). I strongly advise letting IDS do the 
gain adjustments. When connected up to a data coupler— 
the gadget that interconnects y6ur modem board to the tele¬ 
phone lines—if your signal level is too high, it is attenuated to 
the proper level by the coupler. So what, you say. The prob¬ 
lem is that the received signal will be attenuated by an equal 
amount. 

For further information on the IDS 88-Modem contact: 

International Data Systems, Inc 

400 North Washington St. 

Suite 200 

Falls Church, VA 22046 

(703)536-7373 

Telco Interface & Protocol 

Once you have the IDS 88-Modem board up and running, 
it is necessary to interface it to the telephone system. The 
conventional way to do this is to install a data coupler be¬ 
tween the modem board and the telephone line. The data 
coupler—also known as a Data Access Arrangement (DAA)— 
comes in two forms: CBT and CBS. The CBT uses DC current 
loop control while the CBS uses RS232 voltage levels for the 
same purpose. The CBT is less expensive than the CBS but re¬ 
quires an external power source. This source is supplied by the 
88-Modem board. Also, the CBT can be purchased for 
$125.00 from IDS. Whether you buy the device or rent it from 
Telco ($4.00 to $5.50 per month) the CBT is usually recom¬ 
mended unless a CBS device is already in place. 

The reason the data coupler is necessary is that it provides 
for ring detection (necessary for auto-answer) and off hook 
control (the equivalent of picking up the handset) in addition 
to DC isolation, impedance matching and surge protection. As 
of June 1, 1977, non-Bell modems may be directly connected 
to the phone line without a requirement for a Telco- 
provided DAA. However, in order to do this and still provide 
for auto answer capability the system must, at a minimum, pro¬ 
vide for ring detection (the IDS unit provides this while Hayes 
does not). Additionally, proper impedance matching and 
signal level requirements must be met. If this is done then the 
manufacturer must get his device approved and certified. Any 
manufacturer who has done so is given an FCC authorization 
code and REN number. Since D C Hayes does not give this in¬ 
formation and since both the telephone company and FCC 
regulations prohibit direct connection of an unapproved de¬ 
vice, I would be very cautious about this. Note also that the 
DAA not only protects the switched network from the 
modem, it also provides protection to the user from electrical 


surges that routinely occur on the telephone lines due to 
lightning. Direct connection does not offer this protection and 
resulting risk is high that the modem board and/or the compu¬ 
ter of which it is a part will be damaged. 

I can’t give you much help when it comes to CBT installa¬ 
tion as I rent mine and it was installed by Telco. As I had no 
one to advise me in this regard, I decided to play it safe. 
Telco will want to know what options you want installed with 
your CBT. The suggested options are given in the manual 
which accompanies the IDS modem. Associated with the op¬ 
tions list are some symbols which have meaning only to 
Telco but using these symbols for brevity I would say that 
options “F-12” and “7.3” are of questionable value and that 
“G-14” should actually read l ‘G-13”. If you are timid, as I 
was, and want Telco to install the coupler, I believe they will 
do the installation even if you purchase the CBT from IDS. 


In the Automatic Answer mode the combination of soft¬ 
ware and modem hardware must supply the logic necessary to 
answer a call. In support of this the following sequence of 
events take place: 

1. Idle The system has been initialized and awaits 

call. 

2. Rl-on The telephone rings. 

3. OH-on The modem commands the CBT to go “off 

hook”. 

4. DA-on The modem places the CBT in the data 

mode. 

5. Delay 1 to 3 second delay before CCT. This allows 

the automatic billing equipment to register 
the call. 

6. CCT-on Indication that the connection has been 

established. 

Normal data communications is performed. 
Terminate the call and break the connection. 
Leave data mode. 


7. 

8 . 
9. 

10 . 


OH-off 

DA-off 

CCT-off 


To originate a call automatically the CBT must be com¬ 
manded to go “off hook”, detect dial tone and generate the 
dial pulses corresponding to the phone number being dialed. 
When the dial tone is detected, the DA lead must be turned off 
and after CCT goes off, the OH lead is pulsed to produce the 
dialing function. Thus, the following sequence of events occur 
when in Originate Mode: 

1. Idle The system has been initialized in prepara¬ 
tion for this mode. 

OH-on Go “off hook”. 

DA-on Enter data mode. 

CCT-on Indicates connection has been established. 
**** Wait until dial tone has been detected by 
modem. 

Data mode must be off to enable dialing. 


2 . 

3. 

4. 

5. 

6 . 

7. 

8. 
9. 


DA-off 
CCT-off 

OH-pulsed (perform dialing operation). 


DA-on Prepare for normal data transfer (DAta 

mode). 

10. CCT-on Indicates connection for normal data trans¬ 

fer has been established. 

11. **** Normal data interchange. 

12. OH-off Terminate communications. 

13. DA-off Discontinue data mode. 

14. CCT-off (the phone has been hung up and idle state 

restored). 


Page 6 

246 


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


Number 26 



88-Modem Block Diagram 


The normal dial pulse rate is lOpps but the pulse rate is var¬ 
iable under software control. I have been successfully employ¬ 
ing a dial pulse rate of 20pps. This is almost as fast as “touch 
tone” dialing and at this rate the average 7 digit number can 
be dialed in under three seconds. 

88-Modem Board Function & Interface 

The 88-Modem board can be broken down into 5 major 
functions as depicted in the block diagram of the device. The 
UART function is provided by a General Instruments AY-3- 
1014/1015 UART chip. The MODEM function is provided by 
the Motorola MC6860L chip. The DIALER function consists 
primarily of four 74192 DECADE UP/DOWN COUNTERS. 
The remainder of the functions employ a variety of devices. 

The 88-Modem requires 4 consecutive I/O port addresses. 
Following the suggestion of the manufacturer, I have assigned 
them the values of 0C0H thru 0C3H. They may be changed by 
using the DIP switch provided on the board. Due primarily to 
the sophistication of the MC6860L most of the TELCO inter¬ 
face activity described earlier is handled automatically by the 
hardware. 

The following sequence illustrates the principal steps re¬ 
quired to initiate, perform, and terminate the Answer Mode: 

1. Send a mode command to the UART establishing the 
number of data bits, stop bits (1 or 2), and parity (even 
or odd). 

2. Load the BAUD rate value (8 bits) into the Rate Gen¬ 
erator. 

3. Send a mode command to the MODEM; i.e., DTR, 
<300 BAUD, BRK-REL, ESD, ELS (mnemonics ex¬ 
plained below). 

4. Send a second mode command to MODEM as in 3. 
which removes BRK-REL. 

5. Read 88-Modem status and test for Clear to Send 
(CTS); i.e., the phone rang & the remote carrier was 
detected. 

6. Commence normal communications. 

7. Test status for loss of CTS and test data for control-D. 

8. If 7. then terminate by resetting DTR in MODEM con¬ 
trol byte. 

Steps 1. thru 4. above can be considered initialization. Once 
this is done, the hardware takes over. Referring to the block 
diagram, the Answer sequence is initiated by the presence of 
RI (Ring Indicator) at the MODEM input. The MODEM acti¬ 
vates the “Ans Ph” (Answer the Phone) which sends OH (Off 
Hook command) to the CBT. Since we are not in Dial Mode 
(DMD), the presence of “Ans Ph” also generates DA (DAta 
mode). The MODEM then places a 2225Hz tone on the TX 
line. It then awaits a 1270Hz tone from the RX line combined 
with THD (ThresHold Detect). If this condition continues for 
the prescribed time, CTS (Clear To Send) is set in the status 
byte which carries us through step 5. above. 

In step 6., data is transmitted to the remote device by 
loading a data byte into the UART. The byte is shifted serially 
into the MODEM over the TX line at the prescribed BAUD 
rate. The MODEM then employs “Frequency Shift Keying” 
(FSK) to impress the serial data stream onto the carrier; i.e., 
a binary 1 is transmitted as a 2225Hz tone for the duration of 
a bit time while a binary 0 appears as a 2025Hz tone for one 
bit time. 



The resetting of DTR (Data Terminal Ready) in step 8. 
causes “Ans Ph” to go to zero and results in the loss of OH 
(Off Hook command) thus, “hanging up the phone”. A test 
for control-D is performed in step 7 since this character typed 
either remotely or at the local console signifies that communi¬ 
cations are to be terminated. 

In step 3. certain mnemonics were used which will now be 
defined. “<300 BAUD” instructs the MODEM that the baud 
rate will not exceed 300. “BRK-REL” resets the BREAK de¬ 
tect flip-flop. This is a pulsed signal and must therefore be 
removed in step 4. “ESD” (Enable Space Disconnect) condi¬ 
tions the MODEM to “hang up” if it detects a constant space 
tone in excess of a predefined period. “ELS” (Enable Long 
Space) is the opposite of “ESS” (Enable Short Space) and 
establishes the space duration at which disconnect occurs. 
SS=0.3 seconds and LS=1.5 seconds. 

The Originate Mode is implemented using the following 
sequence: 

1. Load the DIAL rate (20pps) into the Rate Generator. 

2. Set the MODEM to Originate mode; i.e., DTR, OH, 
BRK-REL. 

3. Test status for Dial Tone Detect (DTD). 

4. If DTD then load first BCD digit to be dialed into 
DIALER. 

5. Test status for Dialer BusY (DBY). 

6. If not DBY then load next digit, etc. 

7. Load the UART mode—number data bits, etc. 

9. Load BAUD rate into Rate Generator. 

10. Test status for CTS; i.e., carrier detect. 

11. Change MODEM mode from Originate to normal; i.e., 
remove OH and allow space disconnect. 

12. Commence normal communications. 

13. Test status for loss of CTS and test data for control-D. 

14. If 13. then terminate by resetting DTR. 

In step 11. the OH bit in the Modem control word was reset. 
This does not mean that the connection is broken. Actually, 


Number 26 


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


Page 7 

247 







IDS refers to this bit as SH (switch hook). I call it OH because 
when set it forces an off hook conditions. However, the hard¬ 
ware will maintain the OH line going to the CBT in the true 
state provided either that this bit is set or if SH coming from 
the CBT is true. In the Originate Mode the frequencies used 
for transmission of data are channeled through the low band 
fdter and are 1270 Hz for a mark (binary 1) and 1070 Hz for a 
space (binary 0). The received data is channeled through the 
high band filter with 2225 Hz for a mark and 2025 Hz for a 
space. This is just the reverse of the Answer Mode. 

Program Functions 

As previously stated, the program supplied with this article 
performs the Intelligent Console function. As such, it is 
designed to establish communications with a large scale com¬ 
puter which allows terminal access. In support of this it pro¬ 
vides for both “manual” and “automatic” dialing of the 
remote facility and accomodates operator selection of one of 
6 baud rates. Manual dialing means entering the phone number 
via the console keyboard while automatic dialing means that 
certain alpha characters correspond to special phone numbers. 
When a predefined alpha character is entered in place of the 
first digit of a phone number, it is replaced by the associated 
phone number sequence. 

Once communication with the TSC has been established the 
system enters the CHARACTER TX/RX mode. As the name 
implies, it provides for single character—versus line or block- 
transfers between the PC and TSC. From this mode one can 
enter either the FILE TX or the FILE RX modes. These 
modes provide for the transfer of disk files between the PC 
and TSC. 

The Intelligent Console function requires only Originate 
Mode operation. In order to check out the Answer Mode and 
supply a limited version of the Remote Console function the 
program can be placed in the answer mode. Again the BAUD 
rate can be selected from the 6 predefined values. When the 
phone rings, the system answers by placing a 2225 Hz tone on 
the line and awaits receipt of a 1270 Hz tone in reply. If not 
received within a specified period, it hangs up. If the tone is 
detected it sends a sign-on message and enters the CHARAC¬ 
TER TX/RX mode. This allows for communications between 
the console operator and someone at a conventional terminal; 
e.g., a teletype unit. It also provides for file transfers to be 
initiated either remotely or at the system console. 

Since it is possible to initiate file transfers remotely, one 
can load the appropriate floppy disk, set up the system for 
Answer mode and retrieve the file at a remote system with the 
PC unattended. The details of system operation are given at 
the beginning of the program listing. 

System Requirements 

The program is designed to run under CP/M and except for 
the I/O peculiar to the 88-Modem board, uses CP/M supplied 
functions to perform conventional I/O. In order to operate at 
a given BAUD rate it is necessary that the console device be 
capable of a least twice that BAUD rate. Thus, if a 30cps print¬ 
ing terminal is used it is necessary to operate at 150 BAUD 
or less. Unfortunately, this also applies to an on-line printer 
even if the console is a high speed video display. 


A second limitation occurs in file transfers. The data is read 
or written to the disk in 128 character blocks. This means that 
by the time the next record is transferred to the disk, the head 
has unloaded—mine unloads after 8 revolutions without 
access. Since it takes about 30ms to load the head and 
additional time for sector seek, two or three characters can be 
lost per record when operating at 300 BAUD. At 110 BAUD 
this problem does not exist. One solution to this problem is to 
use double buffering coupled with interrupt processing. I have 
purchased and assembled an IMSAI PIC-8 board for this pur¬ 
pose but have not yet had time to write the necessary 
software. Another approach is to have the TSC cooperate by 
interrupting data transfer on command from the PC and then 
continuing when commanded. Unfortunately, many TSCs are 
not easily made to cooperate in this manner. Of couse, if you 
are communicating with another PC there is no problem in 
establishing the necessary protocols to accomplish this. 

While on the subject of floppy disk drives, I do not know 
how well the file transfer will perform at 300 BAUD even 
given double buffering with interrupt processing if the disk 
controller does not have a DMA interface. With DMA, the 
controller is given the buffer address and number of bytes 
to transfer and it uses cycle steal to effect the memory to 
disk transfer. The CPU is allowed to handle other processing 
chores as necessary. Without DMA, the CPU must control 
the transfer of every data byte between the memory and 
disk controller. This may load the CPU to the point that it 
can’t handle both disk and modem transfers without losing 
data at the higher BAUD rates. I have a Digital Systems floppy 
disk system with DMA controller and have been very pleased 
with its performance. I have successfully run it under CP/M at 
4MHz in an IMSAI chassis using a Cromemco Z-80 processor 
and Industrial Microsystems Memory boards. The disk control¬ 
ler is available with “dual density”. This means it is both hard¬ 
ware and software switchable between single and double den¬ 
sity. The system uses Shugart 800 drives. Further information 
on this system may be had by contacting: 

Digital Systems 
6017 Margarido Drive 
Oakland, CA 94618 
(415) 428-0950 

Another potential problem has to do with transmitting a 
file to a TSC. Depending on the front end (communications) 
processor, it may or may not be able to take data continuous¬ 
ly. All systems seem to take a single line, but since they are 
timeshared they may not be able to get back in time to catch 
the next line. To help correct this problem I have inserted a 
“handshake” routine. This is designed to wait for acknowledg¬ 
ment of a given line before transmission of the next line. The 
current implementation looks for an ETX character before 
transmitting the next line. In order to determine the appro¬ 
priate handshake character for a particular TSC a subroutine 
called SHOW can be used. The normal CHARACTER TX/RX 
routine screens out all but a select group of control characters. 
If it is desired to display any received control characters (other 
than CR and LF) then the “SHOW” subroutine can be patched 
in. At location 0B62, replace “CALL TCHAR” with “CALL 
SHOW”. SHOW begins at location 08A8. Handshaking is only 
employed in the FILE TX routine, and only there if specifical¬ 
ly requested by the operator during system initialization (see 
operating instructions). 


Pass 8 Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 Number 26 

248 



Perhaps after citing all these potential problems I should be 
specific about what I have been able to do with my system. 

1. CHARACTER TX/RX MODE — I have communicated 
in both originate and answer modes without error at 
110, 150, 300 BAUD. I have communicated at 450 
BAUD in answer mode without error. 

2. FILE TX — I have transmitted files in both originate 
and answer modes without error at 110 and 300 
BAUD. The 300 BAUD rate was performed without 
handshake to one TSC and with handshake to another 
TSC. 

3. FILE RX — I have received files in both originate and 
answer modes without error at 110 BAUD. The trans¬ 
fer is also error free at 300 BAUD but characters (2 or 
3) are dropped during the disk writing operation due to 
head loading delay cited earlier. 

4. REMOTE CONSOLE - I have set up a file and put the 
system in answer mode and then left it unattended. I 
then called the system, got the sign-on message and 
initiated a file transmission both at 110 and 300 
BAUD. 

Thus, it takes a while to learn the “personality” of each dif¬ 
ferent TSC but the system definitely functions. 

There is one routine in the program that is system depend¬ 
ent. It is the DELAY subroutine which begins at location 
07DA. It outputs null characters to a 300 BAUD printer as a 
measure of delay time. This can easily be replaces by an equi¬ 


valent timing loop. As I recall, it is only used to time the dura¬ 
tion of a transmitted BREAK. Thus, the program will probab¬ 
ly work in all other respects as is. 

One area of the program you will want to change is the pre¬ 
defined phone numbers. These are found beginning at location 
016E. A rotary dialer is supported for the first 4 phone num¬ 
bers as detailed in the operating instructions. The last two 
numbers are good for checkout purposes. They are the TELCO 
time and weather service numbers. Entering a “W” in place of 
the first digit to be dialed generates the weather service num¬ 
ber while a “Z” gets you the time service. 

For those of you who may be new to CP/M there is a users’ 
group headed up by Anthony Gold which is very active and 
currently has 25 single density floppies full of software. This 
software is available to all members ($4.00 annual member¬ 
ship fee) for only $8.00 per diskette. I intend to make the 
source for this program available to the group in the near fu¬ 
ture. Additional information can be had by contacting: 

CP/M Users’ Group 
164 West 83rd Street 
New York, NY 10024 

I assume you will want to customize this program to suit 
your own needs and I believe what has gone before will be of 
help in doing so. If you are in the Baltimore-Washington area 
and need some help in checking out transmission at BAUD 
rates above 300 or would be interested in forming an informa¬ 
tion exchange group please give me a call. 


3 as 

X X> X 

Ul O m s; 

t- 'M n X 

W (V 3 

UJ • lO X 


x x c— 
'3 -C- 

3 X _1 
a. I ui« 
in x «— 
x n 3 o 

Ht)<rn 

HO\J« 


■*< Q ul 
f- 3 : 
NUl L 


-u jj 
3 < as 
Ul X 
J K D 

jaju 
3 = 


Ul CO 
>-t vi 
U. 3 

V| 

3 < 


3 Hi 

x 

< 3 


CO CO UJ 00 X f-i I 


Z < 3 

3 3" 

U H 


CO X CO 

COKH 

•X H* 3 


UJ UJ 
_J l_> 
VI U1 
U. OS 


> X 
MlOH 

UZH 
3 X o 


< 3 3 u. as h i 


uj o 

U. X 
00 a. 

x uj 
X X 
t- f- 


UJ 3 
3 -1 
X 3 
3 3 
X 
uj cO 
f- 

X UJ 


ZXld 
< UJ 
as a. - 


ul cO X 
a. < z « 
3 ^ x 

Ul ; 

* 3 H a 
3 Z —J ► 

U. VI < J 
■X U 
X < b 
f-i X • 3 
H CO : li 
< 3 X 
S Z r - 
X 

X X - 
UJ 

t- UJ 
CO H t 
x X : 

CO H v 
H« c 
UHL 
X .2 t 


CO OS 

X 3 -* 
UJ Hi 3 
X X _J 


X X 
= CO 

e co i 

uj 3 
3 8- Z • 

= X X V. 

-t os X X 

C Hi 

d 3 O z 

-• 3 Z UJ 

E X 

d X a _d 

z x ui 

-• -o X • J S 

a H« uj « 

U. 3 vi co s 


3 Hi UJ c 
_l 3 X 
j a. i-i ci 
3 z x a 


CUJU I *—« 
d CO UJ rd Z Hi 

-• H* X 3 3 

C CO UJ H UJ 

d H 3 lO IO x 

c\j t-n 
■i UJ f J CM < Q 
3 Q Z <M 
3 H -UJ 
sixujilio 
a x z x 

-» X x Hi 3 co 

- uj 3 M co 

t u. X uj 

S CO U1N r 

d Z CO H« X 

u X Hi < _l 

o -I X o X 

U. < Ul l— 3 

u VI -« Z O 3 

0 Uj i- —I 

3 3 


-J UJ UJ 
o X x 
CO X Hi 


3 UJ c 
E UJ X UJ . 
ChHQ: 


O 3 H HO.: 


UJ 3 3 U 
X Z UJ V 
Hi X Hi 2 


3 3 a. 

X o V< 
UJ X UJ 


! 3 CO a. 

CO Z X 
. CO X X 


-* X 3 X 
CO -J Z X 
Z 3 3 3 
X z z a. uj 
H H CO O 
K Q QC Ul H 
3 x as ;» 
u. 3 Hi UJ 
O CO UJ 3 
= c_> X x 
- ' VI Hi UJ 

u. H. 
U. o 


a. X X X a. 3 H< : 

X _l a. x 

*H Z _J -CO X rd - 

3 3 -I 3 < vi vi 
X Ul 3 CO _J 
CO - 3 X : 

vt X “Z UJ X H 

X as UJ x _j Hi 

Z UJ UJ H < UJ VI 

3 H* =» H* z Hi z ► 
VI 3 UJ < 

CO X 3 Z 
co as 3 3 


( JlOr> 
• UJ X UJ 
I > CO Ul 
: vi as 
« H* til 3 
c X 

> Z Hi UJ 


3 o X 
o Hi 
X ro 


X H« >< UJ 3 3 


3ZUJU13. 
-• X Hi X Ul 
CO Hi Z X 

a x x 3 

dOrtZHUI 
- 3 H< X 

a uj ui 3 f— 
JHI3UI 
e < H« ul h« 3 


3 


co uj 3 
uj ■* c 
NCOzli 


<_JUJUJXHi3* 
X 3 3 -4 Hi X Hi 

Hi OS VI o z UJ 

H* > CO 3 -I OS 
_J Z uj z Ul X 
<33330=3- 
X 3 3 H uj H* - 

as uj ^ H C. 
O 3 H« -1 O X 
Z UJ 3 < X uj uj i 
Z X 3 O. X Hi f 


a. X U. < Z 3 < U. ► 


= _l -I X U 
-I _l < OS 3 
vi Z H* L 


: z uj x x H* 


-* o O x UJ 

ce as x ui 3 

- uj a. a. vi x 

- x as co 

< H< uj uj as cO 

JHIX4UJ 
E Ul H* H« 3 X 


— H* 3 CO X h 
X Z H" ■ 
u ul 3 

h X H co : 
M Ul 

a < co 

• Ul 3 3 


3 uj as _ 
3 X 3 C 
H. a. o 


- X co V 
■4 X VI « 

e 3 x ; 

H 3 H * 


3 _1 3 X 


H I 


_ UI Ul CO 
uJ -I >-• x _i x as 

X < u. • M Ul Hi Ul 

H* •—i 3 cO CO Q CO Hi 

~ ' * as 3 

UJ < 


3 


O Ul 3 
HU1H 
a- 3 


3 UJ 
-J M ► 
uj 3 x 
Z CO Ul c 
3 Z Hi 
Hi 3 z c 
3 ui : 


3 H* a. XHffl 


3 X c, 
■Si UJ X - 
Hi 3 


Hi Uj 3 : 
H« Z C 

-uj VI : 

3 3 _J 


3 UJ 3 
Ul UJ 
-J X _l 
Ul X 
CO CO Z t 
< 3 • 
CO X H 


uj uj x 3 
X Hi x c-i 
Hi X Hi 


< 3 • 
z z 

HUH 
3 X 3 


- X = 


3 < Ul uj 
u 3 3 

S X 3 z 


Ul VI 3 

x Ul 
H* Hi f- 


X 3 X 
H* 

3 X 


3 Z X 3 > 

U. Z < 3 Ul 

•-« 3 3 Z < 3 


3 s 
h 3 lO ; 


ui UJ 
CO Hi CO : 

1 X 3 UJ Ci 
a uj uj x ti 
S Hi _1 Hi C. 
-I 3 UJ « 
u < co 3 o 

os H ci 
J X Hi U 
: x iiJ 3 i 
- 3 CO UJ : 
z 

a as Ul 3 Li 

< Ul x H 1 
X Hi CO b 

a H« co 
c 3 a; < u 
d 3 a 

-« U. (O t 

J • as 

< - ul uj a 
c •* 3 X C 
t -3 X i- 

2 rsl 3 3 a 


: x 3 z o 

» : coo: 

J < X - 


' O CO «- 
3 a. - i— 
a. X - 
3 3 CO O 
E CO -J •— 


(jJ UJ - 
E Hi X O 
d 3 H* O 

X 

- as 3 U. 
Q X UJ 3 
X 3 


-• Ul 3 Z 

< x x x 
h na x 


i x uj 
* H» _J 

1 VI '4 

> CO X - 


1 M • = X 3 

1 X '*1 X Z OS 

H* 3 < a. 


X X 
X X 
< ui 


t UJ z 
-l O 
) X 3 


- 3 3 UI 
Z os X 
S Ul 3 
3 3 Z 

u or < 

uj as 3 


: X uj 3 

C X Ul Hi UJ < 

> as as z X X 

\ Ul Hi X 

J x ui ui 
<HXX -X 

> H« X 3 

■ OS ui Ul 

j Ul X 3 as _j 

: [-• H ul us o 

3 vi h* uj X 

J < ■* M u. z 

: as vi x 3 

' < X X Z 3 

X Z X X 
1 3 3 Z us 
S = •—, < Hi • 

S H« US = 

Ul < f-i UJ u, 


X 3 • 
3 3 X 
a. Hi ui 


JO.UJX j 


: uj uj os 

< 3 X M 3 


3 < VI Ul X 
3 H 38 x Hi 


Z H X X Ul 
< 3 3 3 OS 
3 os z X 3 


X < X 3 
: 3 3 x vi z 

> UJ 3 vi 

) 3 X UJ OS : 

< 3 < —l ui a 
J _l OS UJ H Hi 0 
ca.4ixu.zc 
3 X uj < 
j X X uj 

: VI VI X Z Hi a 

4 ui 3 X C 


m = a. 
o= 3 

Hi X X 
z a. 

uj 3 a. 
z < 

'ul VI 

c H* as us 
< UJ 3 
VI Hi U. 

as z 
a. uj us 


4 Hi X 3 < Ul 
J X 3 3 X VI 
>4 U, X Hi u. 

: x vi 

J 3 X 'ul 3 

i UJ UJ H Z Ul 

. X X x 3 a. 


3 uj 
Hi _1 H 
<3 0. 
us X X 
UJ z 3 
a. 3 os 
3 3 a. 


Number 26 


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


Page 9 

249 





x 5-h -i -a 

3 VS a. -o 
2 HX E 

x q < 


« ys -/I 

C d 3 
s x ac 


Si 3 « 
VS 3 ?■ 
4 -a: < 


3 H C 
3 4 
H X - 
3 1 = - 
O 3 f. 
3 3 ; 


: 3 * x 
i j 3 J 
« X t_> H 
) -^ 'J '/J 

J d J 

j -vs 3 


sauiH) 


X U] !ij z V) z 


JOW 
3 vs o 
VS z f— 
3 z o 4 

JHOUf- 
O VS 
X 

3 3 -* 

J 

O x _j 


uJUlH 

J _» *—• t_> 

J O O 4 
1 SI < X 
) Z 3 = 4 

: 3 4 x 

s o x o 


f- x 
o z 
4 o 

X O 


J Z H :» 
►H 3 Z 4 

x o o 

Z O 4 
3 3= H 
O J I < 

x a as 
3 x x ~ 


I H ~X 
Ld — —' 
Tt VS - 
NUJO J 

4 X F-« X 
VS JU 

3 vs j vs 

>< ‘J H 

3 vs vs 3 


a as 

-J J H J X 
—I —1 ■•<•—< O 
HHSJU.U 


X X 3 Z 

J C_) C_) C_ 

V) X X J 3 
3 4 4 _i 4 
-1 d d 3 US 
O VS VS 3 X 


o -ia> 

It; j d | jj 

O JJZHVJ 
UHHOUVS 
td X x us -j 

3 J J X 
j 'j q 

h vs c/s < vs 3 

4 >—«—* 

3 3 3 x x 

TZ 'x X 4 

UJ 'J H H E 
y H X H H q 
t -* 4 4 z z 
H U) Z Ul 4l H 
x xj 3 3 y 
I U X H H V) 


int^ , xs'T>«- 


77077^07777 

J J1 'J 'J 'J LJ 'J J J J d 


HZZ0exH-4HO3-< 
j o o q u '/s a y q b vs 
vsoo*x_io/Sooz 

J3xaxx07I30 

-ZOSZZZZ-t-tZZO 


ooooooooo as o o o o o 

777777707 777700 

3 d d d d d d d Ld Id d d d Id Id 

q VS J 3 4 ^ d d -J _1 4 

4 d Ld d Z H VS VS (-* X _1 d X 
OXV5j-/)XtdH H <X < < 0O 3 
JXXJOUUJ3 3 d Z 3 • J «— 

’ vs /la. jxx u 3 z sc a 3 3 3 

• q q q o o 7) vs q * z o x _j _i vs • 


o ~ 

o 
3 X 


as u, a 
H X 

X HH 

4 3 z z 
*—< H 3 3 
C/S *-H 
X VS VS 
X s z z 

4 Z OS SC 
JldHH 


XXX 
vs o as 
as (O 73 
o as o 
o "s as as 


o 3 as as 
7 777 
'd td d'd 


o m/sBxi 

• 3 3 o o 

i 3 as x x 

•- --33 Id Hr- ■ 


3 -0 33 - 

so ro a 


X 3 a : 
x x a. > 

3 4 X 


d d d d 


_j as 
_j 3 
3 to 


d X 

as 4 
3 as 


o 3 

t-H X 

VS 4 


H X 3 Ld 


J M O X 
H x'd d 
d X z 


CM lf» "VJ 
3 — q\ — - -o 
X + + + ♦ ♦ ♦ 
o X X X X X X 

x o o o o o o 


3 3 3 3 3X3 
7 707000 
d d dd d d d 


Z Z • X O X 
3 d Ld ’d X Z 
X X X X X X X 
o o o o o o o 


H XX 


id • 


H H 
J X X 
J 4 4 


OHC 
3 J 
SOTS 

: z z c. 

J d Ld < 


> d < 3 Q (-> 

L O (—* 'd —I d d 3 Z 
*« Z d < 'd 3 D *H 
I 3- as Ld O Ld < 

VS rd m i—• |—< t—, 

JJHJHZSJU. 

JOXZXXX^-»d< 

)OHdD<JTT 
3 X X _l 3» Cd O X X 


u<xuaiiiidOiH->« jizo x3a 


X X E X X X 

3 — CM- 

3 o as 

0 3 0 


xxxxxxx-nxxxxx x 

CO ^03 Or^XO>»< 003 d Ld 3 

030003 3 300303 •- 

00 0 3000 330030 O 


X X X X E X 

~ \j O :r _n 

0 0 0 3 0 


333333333333333 3 

7000700070000000 

d d d d d d Id d d Ld d d 'd d d d 


3 3 3 3 3 3 
7 0 70 77 
td d d d td d 


_ixxx:— oz_j d — -\j -t ^ 

3 O H DZ a IU ^'d HJ S o h 300004 

- Z X X td Ld Ld < X X X 3 > Ld O XX ••• q as 33 3 Z 




II 


II 


II II II II II II II II II II II 


o>- , M^7in>x) T'-t a 
30303033303 
30030033333 
30303000300 


03 d Ld O'-'VJ O =T 
0333— 

3 333 33333 
333330030 


X O f- X O' 4 


Oinoo 

3 0X0 
0 3 0 0 
3 3 3 3 


0 0 3X 0X0 

r> x x o q o 

3 3 3 3 0 3 3 

3 3 3 3 0 3 3 


O-^^SiXO^BJXXOOJtd O — M X 4 X 
3033033333.3 33333 — 

3000303030003003 333333 

3330303300033 3 33 3333 3 3 


• O 3 td 
q 4 'd X Ld 
U X O X 
H* 4 X O F- 


X t-« a 
Jh t 

m r 


4 H 4 X c 
S X z > = ► 
J H 7 < h : 
3 H O Z 4 


X i-l 
'd 

X X 


JHOi 
» Ld X : 


X X o 
J X o •- 
) US O Q 3 


JJ O i 
3 

O td Li 

x 3 : 

3 t 
X X 
H X 

o 

td o 

3 

3 td 
U. X 


e z x ■» 

3 H < & 

7 = - 

< O X 


0 3 = 

3 O L5 

X X z 

X M C 

-HX^ti 

X 3 4 a 

5 X h x a 

5 Z O X - 

4 4 I t 
3Xo-3 = 
J H* 4 Z >- 
- X 4 

< td O X 3 


X M 
>-> X X 

X Ld 'J 


4 4 X ; 

x X H - 

td f— t 




■^3 3 = >-i 


e x = 

< ■» 

C X < 


x Cd o f- 

3 X 

td O C 


O M 


SOH4 
- Ld O X r 
H C3 


i O td 4 4 
d X (J *-i 
7 td 4 F- 


7 > 3 4 3 

C td X Z O O 

7 Q 3 4 3 X 

4 H 

C td td id 4 X 

J H> X O X .3 

7 0 HOh 

3tU>HO 
3 X td 3 4 

J X H Q 4 X 

C 4 

-• Ld X Id Ld Z 

XUJHHO 
“F— 8-* O 4 


O X 3 4 F-* td 


C X = HZ 

- X x O O X 

O < H Z 3 

E O = H 

-I O X td 
4 td -j td oe 


td = 
td 3 
td 3 

Ld O 


H Z 

o o 

3 O 


o a 

X « 
H X 


3 3 td ^ 


X X X X 
O — CM rr, 
O O O O 
O O O O 


0 3 0 0 
7 77 7 
3 td td td 


3 — CM O 

X X X X 
td td td td 
3 3 3 3 
0 0 3 0 
-X X X X • 


3- _J 
H X 
X 4 


— i—I td 


td 3 H 
sz>zu 
XOBHUSQ 
X X X td X 
OX* U Ld 

X td td td o z 
>*HO 
» x X o H 
ItdH LkJ X 
1 Jh 4 4 4 3 
S 4 X H td td 4 
J I 4 4 X -J *—l 
=3X3X03 


: X X X X X X 
J 4 0O o o o o 
S O O — cm 4 -0 
J O O O O O O 


30000000 
77777777 
td Ld td td Ld td td td 


td4HxX^:X3 
X3Xtd> X H H 
-H X 3 X O X O 3 


as x o x 
H o H o 
X H X H 


d 3 d 3 


4 4 4 4 
■- H H H 
4 4 4 4 
3 3 3 3 


X X X X 
4 4 0 0 
CM O CM O 
O O O O 


o o o o 
7777 
d Ld td Ld 


H vH — f\J 
O O Z Z 
X X H H 
• 4 4 X X ■ 


H td id 
> O _| X 
J US Ld 


O H 
3 3 X Z 
O O H O 
X X Z O 3 
H H O 3 
Z Z O Ld X 
O O H 4 
O O H 4 Z 
*—i X "d 

a 3 3 
3 .3 *-« 3 H 
as O 3 4 X 

XX -I o 

X 3 X 
X X Ld -v x 
3 3 3 3 3 
Q340H 
O O *-i 4 Z 
X X 3 X -i 


X X X X X 
— — A1 4 X 

3 P7 o as o 
o o as o o 


0 0 0 3 0 
7 7 777 
3 3 3 3 Id 


O 4 

3 3 3 3 Z 

3 3 3 3 3 

X X X X H 

X X 3 3 Z 

-X X 3 X >-l • 


-US — 


X3W! 

O X x c 
3X0 

3 0 0 
H O O 

4 07 on 
Z II II 
H V V 
3 - * 


3 O f— L 
0 0 4- 
mriz 
A /\ H ' 


X X X X X X X 
ornama34 
0 4 4 0-000 

o o o o o o o 


0 3 0 0 0 0 0 
7777777 
3 3 3 td 3 Id 3 


3 3 X 3 X 

>-l"*3 3 3X'*; 

X o X 3 X 3 X 

O 3 3 X X H X 

X X X X X X X 

-X X X X X X X • 


'VS vs 

X X 
X X 


d d 

Hi— 333333 
44003000 
XX444444 
X X X X X X 

3 3 

44030300 
-I — O O 0 0 3 
3 3 — — -0400 


XXXEXXXX 
0 4 3 < 34 X 34 
0 - 0-0 OCV-ICM — — 
03000000 


03 0 00000 
7 7777777 
3 d 3 3 3 3 3 3 


— -VJOOOOOO 
dd — — -7400 
HH333333 
44000000 
XX 444444 
• 3 3XXXXXX ■ 


X 3 3 C 
J X 3 H : 
: o o z a 


J 7 q 

* Z Q 
3 3 3 3 


H OS X 
i-l 4 X 
Z 3 O 
M M C/S 


<-> H3 S3 

3 Q X X 

O • 0 3 x 

VS Z X X 3 3 X 

C/)KO X X 

►-» O vs 3 4 3 

H 3 *-i 0 3 

X 3 X X Z 'VS 4 

3 05 H H *H 3 X 


O — CM -O 

O O O O 
0 3 0 0 
O O O O 


— CM 4 COO O O O 
3000— (\J4CO 
OOOOOOOO 

oooooooo 


4 4 O O 
CM O CM 3 
O O O O 
3 0 0 0 


— — rvj 4 ts 
0-0000 
o o o o o 
0 0 0 3 0 


O CO X m X 3 4 
0 4 4-0-000 

o o o o o o o 
o o o o o o o 


-o 4 id ts 4 -\l i, 4 
OO-OO-OAJ - — 
3 0000003 
33 3 33333 


Page 10 

250 


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


Number 26 

























M U - (A. 


- - ac 


- O Z < L 

-jJH. 

- - z x 

luUX 

juiDz 

-H LU - 
lb 111 Z 'i] . 
.J a X x 
U c 
Z Z X X C 
C_> U < 

-»-» t/) a: • 

- z < 

z z x z ; 

O < 3 .- 


X u-4 o b-l 

:h o h -j r 
xx o z x 
x z z 
13 3 Z O < 


XXX 
- 1-1 -- 

- -X H 
ac ac x o 
O O -x 

- -Z H 
- - uoj 
~ ^ -.3 
0 3- I 
OOU 2 
< < 3 X 
J1 03 OH 

x x 

3 0 X 
o o ac < 
fOOUO 


-a - j > u u ■ 

- a. vh -_j </» 

J LU - X ' J - *—t - 


0= —1 —J'3 —1 
O - -Z •>:■ 
- Z X ► 

- o—io 


^ X 


-l U lb j as *h f j _J 


- - LU 
X f- 
: O < 
J X U 


x O C 

U H f" 
-CO 
• 9J> 


) u r - 

< x i 

> X Z : 
* X < • 


U 3 (_> 
VO z - 
o tu - 

JHQJH J 

“ O X _1 


1*H!00 Jl_i; 


Lx LU X U S 


- —1—10- U U 33 33 33 


X - j 

3 X ” 
iu a 
- aa c. 


j -i x 

-co o x 

-<XlO 
J Z X M 
- =3 X CO 


• —1 —1—1 
LU LU 'U 
21 33 33 


- — H 'J J ' 

XOUhZ- 

o c u <c —• 
H -1 _1 X S ' 
j O XU O 
u lu o a _i 

X LU 3X- 
O-tXUCO" 
■« a < h« a ix : 

X -x 

Z CO X < u 

y> i i x 
h a a h h 
a -z o o 
- < << x x 
-x a j o 
LU x 


LU u _1 _1 LU a 


X X 
o o 


X • 


X L 


cm "A9 

J j -3 

X X X 

■err 

UNS'UjI 
Lf 33 T 7 

a 3>bb 
9999 
M — CAPA 
!3 » S T 
n ■-- < r- 
? naa : 

9 < < < 

0X0— = 


X 

r 

— «M 9 

=r n cm 

O 73 < 
9 3 0 
CM 33 < 

n o o 


o r- x> 
o o j 
x x x 


•a o 

X X 
X E 
i (3 33 <31 
9 9 n 
Ol o < 
>n 9 o 
0333 < 

993 

9 n < 

9 9 O 


■ o o b o cm o o 


3 — cm a 9 n o 

03 — — — — — — — 


» ^39 

X 03 x 

9 9 9 


•j aua a 
x x x x x 

E E E E E 
CM X X X X 
99999 

-CMXX- 
7 J3 33 1(3 9 
X CM 03 03 30 
9-C39 9 9 
n .r\ 9 9 o 
r> 9- 9- 9- M 
r— c— >- r- o 
O O 3 O CM 


>- -O 03 3 


X X 3 — 


— 73 
9- 9 
CM C_) 
9- 9 
3 n 
AJ 9 
3 X 

M n 


x — 

9 CO 
X X 
9 CM 
CM O 

n cm 

o — 


a 3 
x o 

E E 
r> 3 03 
CA AJ 9 
9 3 9 
oaiirt 
X 3 03 
CM M 9 
3 3 — 
<M CM 9 
9 -X T- 

-O — n 


X 

E 

3 3 
CM CM 
9 3 3 
AJ CM AJ 

9: «< 3 
3 3 M 
< < 3 

a a m 
3X3 
3 X CM 


Huaib<vi 


1 O X 

> O 3 

> -X 

: o x < 


X “« X <C (-• 


I z 

3 
X o 
< Q X 
X z O (-• 
as -X 3 
O X X 


3 
CO (- 
X X 


) *£ X 
1 h UlX 
X X H 


(-• Z 
O 3 
«S U 


x n n 

9 9 9 

n o 3 

9 9 9 

< 03 03 
3 9 9 

< O X 


in x 9 

9 9 n 

coo 9 

n 9 n 
< o x 
3 9 CM 
' X 3 
r CM 


003— a <M 4 Q N < X 33'”0 U O "M < X nXXCMXCOX-c 
03XOXXOC09 X X < X O X 3 — 9 O OX U 3 * 

* .X .X X .70 9 9 »=*■ =*=**» =•■ =» ^ ~ - - - - - - 


XX— 0X3— aCM<XN<X03- OOX"M<XnXXCMXCOX9XU3Xt— 
— Xn>-03X3XXOr09 X«<XCJX3 — 9 X XX U3 — XXX03XXX 
OX-OX-OX X -0X999999999 n nn An -An X X X X XXX-ox 

333330303000X033333333330333333303 


— XX 03 C O U 


x n 

3 3 

X X n- 33 

3 0X0 


— n 9 cm 

3 3 3 CX 

X X U 3 — <X 
3 U lb O lb O 

X X X 3 X X 
AJ CM CM CM CM CM 
r- c— :»• c— 
3 3 3 3 0 3 


cm 9 n r— x 


CM — 03 

<x o x 

3 X -x 03 

O X o o 

03 o X — 
X XX 9 
c-— t— r— r-— 
cx cx ax co 


►H X 
E Z 
z u 


3 E X E 
3 X Z 3 
z z a. -4 
3 < 3 

Z Z X -u 
-n t— x x 
o o 
Z 3 z 3 
x Z < Z 
X X O X 


Z Z {- 
X 3 c = 
X lu Z 


Z X. XX 
«r<X33t— 
X O J 3 O *H 
X y) -H z -U z 
O X X 3 z 3 




3333303333 


3333333333 
3333333330 
X X X X X U X X X X 


z a z z o j 

x «— < E x v> y> y) yi /> x 

a x o u o x x J z 3 --3 • 


xr~xoc-=zao3xx x 

3333303333 3 

0333300333 3 


f-A 00 

O 3 
lu X 
3 3 


3 3 
3 3 
u X 


E X 

o n 
o 3 


— z 


< o 


x o 


aj 


X z 
X *-H 
Z 3 
<* X 

z z 
o o 

«< < 


X X 

o a 
3 3 

e r 

E E 
X X 
3 3 
3 3 


—• 3 < ’ J O J 'J 
yixx<zx<o 
3 X J ~t X — 

X Z X X X X -- 
XX <3 
ZXZXM3Q- 
X X C << 3 E X 
Ih 3 X >-4 X 

oiBwaxzib 


i i 


: x 


z < 3 O < 3* X 
<HZHH«Z 
X C <X 3 3 Z *H 
O 3 X < Z < X 


X X H 
NU< 
►H Q 

CO X 
3 X 
os X 

X fr-« o 
x z co 


3 X 

z e a y> y) y> yj /3 yi y) y> x a x 

33333333303333 


.Z X •• J 3 _ 

ZXXr-«:-»Z3XX- 
O X 3 Z X -X 3 X x a 
<C 00 3UXXHH’/K 
XEEX3V)33za 
XEEOXX<Z<- 


x a n 

•X — — 

=» 3 3 


O n 3 3 
cn 9 A X 
3 3 3 3 
3 3 3 3 
< < < < 

X X X X - 


O X z X 
I 3 O (— 

I CO X X 
■ *-o O O • 


13 3 3 3 3 

) 3 3 3 3 X 

: «s: c < ■=£ x 

1 X X X X o 

X 

> O 3 O O X 

13 A 3 3 X 

- -09 n x x 


IZ >s 
X 3 z 
x x >x a 
x x y> u 


X E E « 
3 3 h-« U 
O X f-i 3 


X E M Z 
iz X X X X 
X z z z z 
X 3 O 3 3 
E X X X X 
3 X X X X 


----ca--- 
'/»*/» </► • - 
— — — a on cm r 

!M o o o n — *■ 

X) >M 9 9 CM CM f 

• 9 n n n n — *■ 

39999 -O 9 -i 

Ennnn t —90 

999 9C/1C X3C 
X---- 3--- 


X X 3 

XXX 
(-•XX 
X - <c 
z x - 
I X X 
3 “X 
3 Z (-• 

«e o 


-z onx 4 
: -c 3 
> 3 3c 


i x x x <x 
: X 3 m - - 
i 1 < - - 

• 3 X X X X 
> 7Z x X X X 
C <X 3 -H - - 


X < 
X 1-t 
-3 


Z - 3 X 
x z r- o : 
00 --- 


33-A.Q39nOXX)<Cao3 

33 3 M "M -A.'A'A'A'ACA-AOA -O 

33333333303333 


3 3 3 3 

x x r— x 
0077 


■O CM 9 = 
CAiACAO 
9 n n a 
rAPAc-A -c 
9 9 9 = 
CA PA CA n 

n n n j 

"A PA CA P 


CA PA PA 
090 
PA A PA 


3 X — — 9 O* 3 

J 9 9 9 9 9 -M 

3 <X OC CM OOA — 
J39.A9-M9 9 
) < a - o a 
J 3 'M 9 CM AJ 9 3 
3<XX3CM3< 
J 3 9 9 -M A n 3 
e 3 9 A » PA PA 3 
- o n 9 9 9 ^ a 


AJ M 
-X 3 
3 \l 


CM 9 
< 2% 
3 9 
X 9 
3 9 

a r- 

o 3 


0 3 3 3 3 3 3 


30000003 


c—a — nAaxoo 309 
=CLJ03— AAOcX'XXX 
r- T- r— ,-\j P\J -VJ -LJ AJ cm AJ PM CM 
333333033330 


Number 26 


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


Page 11 


251 





















x 

3 


a o 
a c 

C 'C 

ja c 


a 3 
i. a 
f- x 



u 

-0 X _l 

K/lHHJlINf-. 

Mo:>:»<30za 
• -a. t. X o X a -s x 


UJ 

o 


o c » » x •» x » 

t/lKMQ ouou ; 
•OKI X X X X - 


w 3 


-J 00 x X 

—• X Z 30 OX H 

x z x a <\j n u. x 

< X O-J O 3 MM 

•-juuxtowQioto za 
a — a X > *s X 3 x o 3 O o 
o - » “3 * -a « -a a - 
xcxaxoaxoaxoa 


o uj 
X =» 

-Ox - 


X x 
x o a 
c a a 
x x o 
o - - 
(— o a 


MM -X 
o x a 
o o o u 
a a - 
x o x - 


X UJ 
X ■> 
-U <t 

i- yj 


e */j a a a x ox 

t t oxo'*-i»X'*3oc:« 

--a oaxa-WHii. »a «*-» 

ja'j.o'u.a.oa.oxMoaa.aor>i 


UJ < 

a x 
coo 


-J z a o 

h uj n uj o o 
x a. o a O x y> 
O X O n Z X X 
uj - - a a a. - - 
yjoau.'Njooa 


X M U 
o ZU 

a -» x 


tO>xx4>xox< : 
•“Xaaoxaoxao- 


xcc^»c:»x<axx<=«x 

_iooxox_io_i_i_ioo-9 


uj a a x _i x a a 

CM-«_j-«_ia_jA.>-ta_i*-«;»a.<:»_ja. 
X > u < »cocOza<z o O x o c X 
•“X-ioxoa.ox<a.o<xxoxo-9 


'non < 

o o a a 

m ui uj a *- in m o* 
oo—ooooo 


'Xaau.fNjrr,^-!^- 
a a a a uj uj uj u 
r—- f-~-c— p— t-— r-— 
O'OO'OO^OO 


a 

a 


p- -a p- a a p-a m m n aj y\ 
a o =r p-ujt— a — niooo 


— o r— o o — o — — 

o o o o o 0 0 0 3 

aaaxrTv^Lncanujij. 

o 'n^uioooo»09» 

ui — —aa—auj — a< — 
''A ai — o o — o o — o -a aj 


3SS P- — O — — 5SSi 

ooo o oooaoooo 

a o o uj r\i < a n uj x n o a — 

nao-ocro^-aa-a o u .o r\ 

— a a uj a a — ac--a a 

— o o -a o a — o "A \j — ooo 


a o a t*- o o a 

o o o o x x 3 

T»on*-n o — -no a — 

aaooo o a — u. — m 

a — a a o n a — o n a o m — o x a -a 

o*-o oou.ou.uju.oa^'x.x^-oo 


*J'< a o a a x o — aj n 

UJ U] UJ 111 U) Ul'il U] x x X X 
P— p— P— P— P— P— M P— P— p— p— p— 

oooooooooo a a 


o a a a — pa a y\ a a •- » 
xxxxoooooo — — 
p-p-p-*—-o-oaooooooo aa 
ooooaaoooaoo 


s< ao r\ias< ao a o o> o 

— — — AjAjrM.Aj.M \J a a a a a 

ooooaaaaooo o a a 
ooaoooooaooooo 


x — » p- a* o oo — a^->-o\<aoao 
a » ^ =r » ^ ^ nnnninnnnnin o 
o a ao oaaaaaaaa a ao a a 
000000000000003000 


o o a a 

o o o o 

x o nxo^M 
o r> o x -- o a 
a — aa-vja — 

o—oxoa— 

a n o a a o m 
ooo o o p- p- 
a o a a o o o 
o o o o o o o 


a c t'- x 
Mao 
o y> _i x 


O Ifl < H 
•-« Z > 

a o < - 


< X - 

x a < 
o a x 


s a as xx 

c a <* a x < x «x 

- _ * a x c o x a x 

-O -O -O -OX -O -O 

CCMCMCMCMa C M C M 


HIUJ< ** C &OIC 

a x a m a m x o - x 
oovjAjxyjaa -o 
uJoxoaoxaacM 


U H Old M 

o x a x a 
hi/)uiau< 
x < a a a ^ 
< - O -03 

a < x < r a 


j x a x x 

j a a a — — x a 
) a o a x a. p- a 
*0X000X0 

: x x x z z o x 


a 


t\j 


a a x a uj x x a r < 
a a a x a n <z a x a -r 
cyjaoaa — ao-nao 
xoxxo -axxo* 
Mxxxxxaaxoxt- 


a *h a *h 


a x a •—< a x 

c c ^ < x 

o x o x o -> 


•h a *-i a f— 
> c > c a 

x o x o x 


S —1 X i-H •—* —4 —< X 

c<cOzxoaax 

SOXCO-9C<-j 


►H »H m a J J H N H a H 

aza<r>j<<zz>ca 

•-<Ooaoo<-sxox 


a —t M C r-»M 

a»o>oa oa 
•- x o x o a ox 


aCMCMXXMMf- 

aaoaooozou 
•-a oaozzcoa 


XC(-<CM-<aC>-lMX 

Maoaxo>cazox 
•-a oaooxoaco-s 


S N P~ p~ C 

a o o o o 

O AJ oc\jaOAjp-r\jx 
OZAIJ O? 0»M 

aaaauaaam 
'OO -no <^o rnuo 

-Tsaao^AiriJOCQ 

r— >- r— r~- p— 
oaooooooo 


a <m < aj 
o=ro=r 
a a a a o' 
mornoo 

o <\j in p- < 
o o o o o 
p~ p- p*» p~ p— 

o o o a o 


=r x c a p- a aj 
p- oop-a"A^r 
>n x x x x a—naco'OPA 
x — — — — oxaaaooo 

-noaaaoro^r-oxjxau. 

O O O O OP— p~p-p-p-.p-.p-p~. 
p— mp— p—p—p—p— p— p—p—p—p—p— 

ooaooooooaooo 


p— p— p— p— p— p» 

o o o o o o 

X ro X X O <M oarvi 
0 0-»<\l rnOcOf\j» 
o"Aa<aaoAjao7' 
aaooooao^oo 

ryj3'Ojiox(V»p-3»u 
JOOOOOOOOOO'O'CT'O'O' 
P— P— P— P— P— P~ p— p— p— p— p— 
00030000000 


» 3» A| 'A 
AJ O O O O O 

a m a m c "A cr< 
'Aa 'Aa rn a o 

a x — .*a n -o < 
<»*c c < *< 

p- p- p- p- p- p-p- 
a O O O 3 3 0 


— — o o 
o o o o 

3fM» ■AOOP-m 
AJOfA 000X0 

<^<fAooomo\ 

-AarAOooaQo 

aaanincoiaax 
cc&am&cacQaj 
p— p-p-p-p— p-p-p-p- 
000003000 




T (AU.< J .'A'A- 

a o o a 'A x o n 
B^-moacO'ArA 
oa a o o "Aa a a 

vn x -jn x a o •'Ain p— 


Page 12 


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


Number 26 


252 







a 

z 


'J H 
CO X X 

•c z a 

• O 

= Z Z 
_J O 
_J Z X 


o ^ c 

M O X 
o < o 
u M 
x CO o 
M M 

a h 

= O M 


=3 CM 

X — X 
U'J X 
C (/)'/) K 

— z X O UJ 

«a * 


3 PO 


m o 
z o m 
\ o.a. 
a. 

o •< < 
o o 
t< < 
OHh 
« to CO 


X 9 

x — xx*- x 

OU X O • J < 

X V) C/J X X C/5 X x 

r^irojuoiu 

x - . -awx 


u-o *- ayQu.QiMauau.auaii.ii.H 


z>x«<xxz>x<r-»x<or 

“JX-'O-SO-jXXU-dXXUX-j 


_j uj x — 

mV) X - 

U. O X O 'J 

. J O CO X V) C/5 

■< O X O in * r 3 

v) « - a m - -a 

HU3U.IM 


o a x 


o x M 

o V) 
uj o < - 

rM -dhtt. 
m X CO CO V) 


Z m Q _| M 

M X < X X 

•-_i a to a 


u. JUJU, 
uj < o 

x _j m o a 

<OIUI 
X M U 

COQXXU, 
I I X UJ 

a o ■< ■» uj 

ZhhtOZ 
< a O Z M 
X < Z < _l 

M f—• t—• M H 
UJ X UJ UJ ’X 
cO CO CO CO CO 
J uj :d uj UJ 


UJ O'JOQ X X — 3 

u!a_j_i_ia_j.jxoca 
<axxx<<zazco:o 
xMMcoaa:»zo-*roiJ 
co x o z x -x -x - -a- 
<x<K<j«<n<t’j3u.: 


<<<<<<M<M<MMX3 

ZMMMMM»M-»MC»><<: 

XCOcOcOcOcOZcOZCOZ-JO'd 


a co 
x o f- 
- 3 : 


I CO f- 
a uj 

Z X K 


- - a o x -* z o 


4 M N M « 

: x z > f. 

: o -» x c, 


-*M_JXMMIN|- 

»X<Z<XZ7 

E JUTXO-Jl 


p.. trj 

a f- 
uj cj 
a < 

Z X 

a < 

X X 


3 H U X ul 

2 ^ x rax 

COM— a-O* - CMXO-J 

- a co < « a -o 9- < -xx 

uu.axou.x - a < Z O 


-» —I -J X _J 

—• -I CO M M < _| 

<<<MX o x o ;* m < 
JUUTXUdUlIiOU 


.n a — 
o o a 
a uj x uj 
a u. o x 

< a u. o 
a a a — 

y> C71 C7N 

a a a a 


90 3> 
a a o a 
a :n — m - 

■vj a < a--- .w 

• a m x AJ uj 


o a — o o 


903* 9- a x 

-< aaa aa a 

T3(Maj>U.ftt)TNU ft — 
~ an o a a X a o a n 
... >.« — q -ox — a — o 


a a 
a a 

a c_> n x 
— n a x 


a 
a a 
<n avn 
a x a 


u o a 


- c_> o a — a 'j 


-\jnr-<aar\iinr-^*aa'vj n x 
— — — — — cmajcmajcmajooooo 
7'7'aaO'3\7'7'aC^a'aa3'7'7' 
aaaaaaaaaaaaa aaa 


a u — 9- o n n\u u. 

n-0 9999999 

aaaaaaoaa 


o — — — — — — — — — — a 

o aa aoaaa a o aa 

o xx p-x<ao9-na9';y.>-n 

a r\j <M noo~o-o-o-o9-oa<a 

— <r>PVJ — X'MAIPVJCMAJXCMXAIX- a 
c\jpnrNjpn<'n"npo-n o*j'o-*j'oo--a 

- j o 7> 


opo9c-<*Xjj*-»N< a 
nnn nn no o o ooo 


a t*- cy» «- 9 a o> 

a a o a a a o 

— r>9--u.»Q' J .t>-0'Oinf\j 
oaa — n9-cr\xpooxoa 
uaj<auiryui-yuj.-3m 
aoxoaxaco-oa-oo 


a\ naNji a 

a a a a a a 

cm nj t> m n x < — r> a- 

=r a a 3 a — < a a -o 

x \j x - a a < x a n x 

x a a - a o a a a x u. 


aui-’o«co<aii.'M9f.< a x ai T'-<aaAino 

w wi-i-i-i- ss»aflas)co»o' 0 'j> 3 N 31 c iac^txxxx 

3'7'3>(7\3\013''7'3'TNT»7»5N.'7\J»3»0< CTi 7> Js J'7'>3»7\3\7\7i 

aaaaoaaaaaaaaaoaa aaaaaaaaooaaa aaa aaaaaaaa 


— r- 
a a a 
a x 9 a 
o o x o 
< j aj a 

a -o n a 

x a a a 
a x x a 

T> :r\ 7\ :t> 

a a a a 


UJ M 
M O 
a c 

< X 


:x X 

« a 

• o 


a z j- 
< m a 
V) a. «s 
•/) z 

X X <£ 

rax 
<c o 


X -x << 

x a x 
<c a 


X X 
X <£ 
C M 


CO X <C 

r a r 
c a 


XXX 

a. x 3» 
>- a x 


x x 

X X X 
X x -» 

>- a x 

i-* a z 


x x > 
•-ax 

{-OX 


X o 
x X 
O (- 


a * o c 
a o x c 
x X {— Z U 


a x 

us a a -o 
x x u. o 
m - -a 
a a a u. o 


x ct* x x t— x 

z a a x aa , < 

xxcocoxxxfco x 
'x-»rax-«ro *o 
x - - a z - -p o z 
— aaau.aoaU.x- 


xx «x 

<s *c X X «* < 

X X - ’X U. X =» 

u o x o x t— a 
j m a (— - coomx. 

x 


i - X •* X - X 
x -a x x -a 
X < {- X M < H 


x «* v: Jo x 

xxx aaa <c x 

•— x a co x x co v) x z 

xaxanvc^raza a 

- - an < - - ao x a 

<aaxrvjroaxxM<x 


. < a 

j x a 


XXX 

I- a a 
x a a 
x < f- 


a f— x 

xxx x 

x a * a 

- * z a a -o x 

xaxrxaa xx 


JXX<<{- 
*< o r z m x 
a x -j >< a x 


z3»x<xr>jxz-»'xzr»>«: a: a r 
• -rxoaza-urxaa rxax-s 


o ox _j x x 

-n M M M M xco — _jq— i ■—i 1 X 

tox->ixp>jxaxaaa><o<<-»«<ru 
•-a -> a -» a a a -» *-x r a x a r a z 


<JMP4MMXXX<<M 

c<xzx<azxMx 

Joaar_jax-sx-/)x 


< z < MQXC»X<M!N|XX 

•zM<x<aaoaxzar 

: mo xaxxxxazx-j 


n o t> a a a 

— p- r— >- >- x> 

ox o x x » 
a a a a a a 


oa o=rao no 

aa a aaa aa 

9-ana <-ao»<n9 )>< n 
— n a a aa>a^a<axa 
x — a x x x c\j x — a x x — -» • 

a — a x a 'x a a — a a a' 


— xoa\Xax — xoa«ax>- 9 n 

OSOOcO O O 7171 > JMJ < < 

xxxxxx oxxxxooxxx 
aaaaaoaaaaaaaa aa 


<-vja-vjaax-vj xrsj Xcnrvj 

3939 MBS 9 AJ 9 o rvj =r 

xi<x<»j<x< nxa—axa ^ 

x a x a x a x a 'x pn a x a po a o 

txau.iM9p-3» aaxAjxxxa 

<<<<xxxx aaaaaaaa 

xxoxxxxx xxxxxxxx 

aaaaaaaa aaaoaaaa 


a a o 9 - a a a 

a a a a a a a 

o o n x n t> a n — o 

'-noxxiaao n c— 

a «— a x "vj x »- a •- x x rvi 

a •— o x a a — axa<xa 

OX— 9 O 3> aj " M n 3 

ooaaaaaaxxxxx 
xoo oxxxxxoxxo 
aaaaaaaaaaaaa 


■o a x a x a 

pp» a x 30 xx 

n < x x o cm — — m <ja — 

x x n — x x cm — x ■— x x o x 

< a x x — cm nxT>< axa — 

xxxxxx x x x x x x a a 

XXXXXX XXXO 0-0 7171 

a a a a a a aaar> aaaa 


n p- 
a a 

Tl o\ 

a a 


Number 26 


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


Page 13 

253 










'X X JS 

•JHCQ X 

< z x h 

-J H 3 Z 

a O z 


H < 

< > Z 
H < O 
V) a 
< 

t-«J c—« t— 

-1 ■< C/1 

Q Q !J 
C/1 H 
z UJ 
O -1 - 

uoto 

5 </l UJ 


X H - Z Z X Z < 

-c/ia«*< J)Oi/)H : 
< a z - oxo.Ho.axx* 


z a x 

a O < Cl. 

HfflCM U. 

KU'J U. 

t CO H Z K V) V) li. 

J 3 z < z X a 3 : 

- a < o - -a - 

iix'-uaii.aaaa< 

c/l 


Jc CO 

<5 -jj 

■4) >- 


z a z 
*-t a O 

JHI 


Z CO Z 'X H 


HOX 
til H a; 
c/1 c/1 H 


>- o 
z < 
< H 
H CO 


H 3 
UJ H 
CO CO 
til U1 


O' Q 

> a o o. o. 

C CO H 3 Z - 3 

> 3 H tOXH 

C'J<<tflXXO. - CO 


z o 

cO - 
o. < 


«M X CM 

+ til + 

O-J z _1 

ja o as 

t4.HO.XH* 
H Z O O. Z 
O Q H -X 
< to X < « 


'll Cl. 

X X 
33 3 
O O o 


HZ' 
O cO (- 
ZO.C/ 


a z 
—1 < 
a x 
h o 
o z 

1U.4IH 


X f- 
X - 
O 3 
Z CO 

Z X 

o a 


a c_> 
ui 

X H 


H H 

til 'il 

CO cO 


X 3 -Il X 

a -I CO -J o 
CO (4. a H X til x 

aoazxc/irz 
a -a < -xQ - 

^.4 1£(J 


' 5 X X _J -1 X X 

XC»*-« M tOlO JHJHXO. 3 C 0 H- 

ooa.rxo.M 03 < 3 <azx o : 
xxoxoxn.o.oo.cja.t-1-^a.o.x : 


J JZHH JHlOXX : 
<<3:»x<<o30E 

ooax_lo_|o.a.ai 


> Z o m o c. 


a. a < < z -X z HH r 
j x axiNiozoa .1 
>XS-*_ 40 -sZ>-«ZO- 


* X _i a. H _1 
» H X X X X 
: co co x _i co 


< < z 
Z H O 
X CO z 


o _i z 

z X --H < —1 O H H _ 

s :» h < > x « 

TZtSlUHX Jl 


► X<^H-<>H«<> 
E JUXCOUttOOX 


a a 
— o 
X a a < 

til HU, U 

t— x O' x 

XO O X 
< < < < 

0 0X0 


(MOO 3- 

ix < in n a — 
Ij. u w u o u 

til O co? 'ACO 
•O r— H t— H r— 
<<<<<< 
o o o o o o 


iku a iij 

t— r- r» r- 

< < < X 

o o o o 


CM < IT* a 
O O O O' 
in ui ui a a 

Ul O •— o C_) 

•- (AJ 3 O O' 
cOtO *0 3) 9 

< < < < X 

o o o o o 


co O a 
OOU. 

OM^tflll, 

o mo a 

a — o— n— oix — < m a < a a o 

o-uouuosauutjuouiii 


H- X H H- < X 

o o o o o o 
a o' x cm o oo a 
-u «— < aj m 3 ^ a 
< to a < a q o - 


uui'-7'-coj\4auii.ocno(j'u a»- ^Nxiauauio 
xx) 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 ' 0 '<<< < < < sK a xxxxxxxo 

<<<<<<<<<<<<<<<< *t x xxxxxxxx 

oooooooooooooooo©o oooooooo 


a 
o 
a cm 

■ — • • . m 

"l < P- < — m — u cm 
m X O a AJ a a O 

rsaaoauio 


-a — — 

5 0 0 0 
3 (M til X 
} 0OvO 43 


o o c 

U. < oo C 

(i. ro<o c 
muicMCMo.- 
U.oOrnrMOCMtM<oOti.O 


(J "O *- CM U, CM •- r 


on o- vO O' 

uouu 

X < X X 

O O o o 


UUIM 

o o a 

< X X 

o o o 


tflOC 

a a c 

X X - 

o o c 


o o 
•—ax 
o CM < 
ui cm a 
on mo 


m o 
o o 
O' o >r» 
O f- o 


tAH< a j 

Ul Cil til (Il Li 
<•<<<* 

O O O O C 


-f> O — C— — H- 

o o o o o o 

o'aiau.ua-aao' 
o x o a mo'mcM<o 
uir-aui.-Mauicsjatii 

o—ommommoo 

=r oo'U'j’-? ootu 
U.U.U.U.U.OOOOO 
<<<<<XXXXX 

oooooooooo 


c- z 
co UJ 
CO H 

ui o 


< H 
—« UJ 

a o 


< H 
M O 

a < 


Z X 

CO C— 
z o 


X H _1 t 

o a < : 

< O X X > ^ 

<uiaxa<x^ 


> a u. o u. ui a 


a < < < 


cm ui o 

ui 


. a h z > 

* c x o 

* = a o 


ui cy h on a tii 
a co x < x x 
o a ui z ui h x 
< x a a a ui x 
a - o -o co - 


Ul X Ul Z x co z < 


: a z x : 

- O ‘ * c 
c x o a l 


O H 
H CO *- 
o a 


•*< z z 
a h a o z 

Z CO H H - 

o x a a o 


r o co o 

x o Ul 
-a co 
a ti. 


z »-• o h o i ui J 


X CM Ul Ul CM rj 


a a h 
- o o 
< x z - 


a h 
ax c 

o *♦ f- 

t t— a a 

> o z z < 

. < o o = 


o x 
o u. 
z u. 


: - a 
> •• •-« 
i - a 


a h m 
< a a a x 


Z X < O < X X 

n co on « « • «. 

<zo aaxaaxa 


■«x>>-t'-ia>< 
: o o > x < o h 
e a x x a a x co 


xxaoxoo- 


at—• h-hhx'—«h>—«{■ 
> o > o I > 3 >: 

zxaxou.xox: 


a < 
■/an 
. x < a 


H H< « 

> o a c 
r a a : 


. z J t-t 
) x < z o 
. -» o o - 


a x 

Hjx*-»ox-«--«a=»x> 

<xozao>x<020 

jcoo.<zxxaax>-«x 


i •• 

i o 

• -a 


< UJ 

Z X 

• a 


CM O O O' 

o o o a 

o' x _n •— no- < u. -j . 
o x* o o o o r» vT> j 


O' *- < 

o o o 

' AJ U. X O- 

sr a u. ■ 


m?o>to< 3 u'i. 

ooooooooo 

O' O' O' O' O' O' O' O' O' 

ooooooooo 


c\i ss<ui>-? axxaoAirs 
aaaaaa x x x x a a u. u. u. 

O' O' O' O' O' O' O'O'O'O'O'O'O'O'O' 

ooooooooaoaaooo 


O tM ? ^ 

a c_> mca 
a m a m 
-n a ma 


amama- 

maonao*- 

3!M»9fl<t 

o o o o o o : 
<<<<<<. 
o o o o o a ; 


H- < H- 

o o o 
a o' o 
— — Ai 

a < a 
o o o 


aj a a 
nco*- 
a £> m 
o x o 


o m x o' o a 


aj o 
o a 
o'» m 
a a o 
a — a 
o-o 

— no 

CM M AJ 
XXX 

a a a 


AJ AJ < T( 

a om rt 
a m< 

~n a m x l 

O'Qaa*- 
aj aj Ai m CV 

< < < < 4 

a a o o c 


< H- 

O O 

mvo a 
in aj o 
- m a a 
. o o a 


O O' < 

_ m a- m_ 

< a < a < 

o ■ ~ ■ ~ 


m aj x 
mx m 
I*. m .a m 
a a a Q o o o 


o <m m c- < a a 

3-33333^ 

<<<<<<< 

o o o o o o a 


ax m o o 

am a a o 

— AjnxH-ao'-o'amx 
aj aj a x o tn *— aj *— n aj in 

mvo O' < o a a a m 3 mx 
nn nnnnnxxxxx 
<<<<<<<<<<<< 
ooaaaaaooooo 


Page 14 

254 


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


Number 26 







3 

O 

O 


—‘ o *-«•-« X 
12X«>* 
« O O. 

^ X o 

• - .. •- as • - 


X < < 3 Ci 

. 'J x u. 3 E ; 
) X H ■/) ix - : 
) < O UHUli 


J < X X a. 
>< — OHOX3 
) 2 'x O O x x ; 


! X'J -OH L) < CQ • Q 
)i->l*.HU.ZT -M -O 
.UJhXHHUOl<l: 


O -S x ■« to o z 

:<UCQ^*3*-3 LUO 

- a. X X -yj c 7) D X 'X t 

Jjl7)xl JHU 


o aa _j ox ■» — 

r < x c/> x - 

<t'jhx<oxc [ Ha 


: « < x x .-« _ 
• X X 3 < rg :» « 
) •»< y) o -a x c. 


to _J X _J 

• "I HNhOJHHWj: 
>a.('ga.z<oo<»33< ; 
.o-so-3_i_ixoxoa.c_>c 


< X -I 

:zi-i:4303XNa 

e->yiTaxoa. oo-s_i 


x ^ a. < < < < MH 

-= f- T T as 3 as x > 
~«-/)-axxy)_iO-3X 


3 3 --3 

<>j < >- -\J 3 

O f^3J O O 

X O O' u 

o o o o o 

x) n x Q x 

0X30-3 


X X n Q Q 
3 0 0 0 3 


'J^3 l AJ3'»- 
> 3 3 o 3X o 
J J < X o < o 
)u.o3uioa 

■> O X X O X CM 
j 'X :u u x X X 
J X X X X X X 
>003033 


X — o 

3 3 3 

=r — o o in 
o 3 3 -» 3 
x < < •j cm 

X o c3 u. o 

» -0 0*0 ij 
X X X X X 
X X X X X 
0 0 3 0 0 


> JO 7\ 0X0' 

>03 33 — ' 

> o o o o o ; 

>30 3 3 3: 


>o — t— o — X 

>0 3 0 O O O O 

>-7\ rvj 3 o — cm r— -o 3 -Q 

>3 3- no no CM O =T 3 AJ 3 3 

ex CM < t— 3 X 3 3 3 — » X> O -M -M TO 

> X O v >»onOQoOOO->-XonOO 

>3 CM 3 O "T\ O X O — » 3 O t— O X 
* CM CM MlMMCVIM-O-OcorOOnO-O-OO 
>00 OOOOOOOOOOOOOO 
>30 00000030 0 00000 


O O — — X —— o 

O 3030 030 

x — <33 3 x 3 t— x x 

< 0 3 3 3 -03 no 3 O 3 

n 3 — 3 X < < o aj 3 xcm<mm o 

X o X -5 X O no 3 "Ou < 3 3 33 O o 

M'OO'^TNXX — 3) 3 330X33 

»»»»»»»/> n ft 3 ia r* 3 o o 

O O O O O O O ’3 O O O O O O O O 

000 0 333000 300000 


C v " C** N W H “ 
s or or X X a 
M-ZCEzaviVia 


O C3H O 

to y> Z < 3 (O 

tOih-ZOH 
•a*W* *3 3 

3 X —' O < O X X 


C3 O X =T 

x r 0 0 3 

XXX X CO X 

— X03X03X05 
z ZMOr-a: • -a: 
<<<XXO<OOX 


> O as o 

X < X 

x XXX 

.3X003= 

> OHH O : 

X O X X X U 


: x xxx <—• • • x 

:3X3X(3033-XCMXi->0 
>OOX -33-/) 0X0X03 
<Xt-iM<XZXc3‘-.OasXz< 


-* X * J 3 _J -H 

X<0<PM><X 

JOXO-aXOO 


M < < X —« H H _J f 

zz<-.xzzngr»x<- 

">XX-»*H<->XX03 


X X X 

—t XX<< X H NJH J 

5XrsJZO<3Xr>lOXZ=»<l 
-<<3-«XOX0-aXO3XO^ 


—1 I-. X X -H —( HM < < X X J X >-H rH >-i —< 

J>OX3XMXiNlX-ZXf-*ZO<r>J<XfMXrMXn>lXr' 
3X:0-aXO-aO->03XX -9X0-9 0 0-5030-30- 


O O — 3 X -n 3 O 3 X 3Q 

^030 003030 O O 

-irv^aj 0M30»3\3n 3 AJ — 3 ^ — — 3 

DOOCM 3 3 O » — DN3 — 3 3 3 AJ 3 O 3 

U3XCMU.CMc33JO<X— 3 — 30<XJ<333 

3 O X O < <3 o 3X0 3 — o AJOXO>-XOOAJO 

euu. -? j)5oaau.i\j» n < 3oajx»o»oox 

- — — AICMCMAJA4AJAJ-0 3 3 -3 3 :T Z =T :T =r :T Z 

0X00X03000X00 X 30X00X000 

3000000000030 O 333333333 


o — a 

O 0 0 3 

3AIO- AJO n 


0X0— AJO r\ 3 3<AJ3 — '—< — O J U, AJ CM ? O OAJ 

O 3 3N O 3-3 -O 3-03rT03>-30T« -O - >3 3\ 3 3 

3 O < O .3 3 <■— < — UAJX3-Q 0<X33 — X<X< J X X M3 

3X0 3X0 300 XX 030 3 X O 3 3 O XX O X Ox O < 3 O 

0<0x— M I'D JNO 3XAJ=Tn-3\OX0.AJr»O3033CM 30 T> 
3 3 .3 30 3 O O 3 0 0 O'— r— C— *-Nt—0"0'C'0'OOJ53'3'7'J.> 

oooo aaoooaooaooooooooooooooooo 

0033300 03300 3 0 0300003303003330 


OOO O O O O O 

X — O-TXAJM — X 31 3 00 — 3 
— 3 M — O — 0X33000X03 
3 < 3X<U<X<X<X<3X 
O O O X 0X0X0X0X03 X 

OX M 3 C- < O X — -3- O 3V3J U 3 
9>-7N<<<<<<Q3>aXOOO 
D-anooonxoo.ooeQOja 

33 0 333033300300 


Number 26 


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


Page 15 


255 







DOUBLE-HEADED DRIVE FOR $755 


* (-• 3 

ox x 

> H U. < O H 
U U 3 - - - 

Kunuiara<« 

c/l 


«* 5 'J < 

r- to X 

3<lODU 


a. 3 je x 
■3 _J QC 3 

x aj x x 
'jj w I f- r o 
z r X *: x a: 
<*: x o a: 3 * 
x-o-o- 
<c x: <c x o 


oo oo 

X O Q 

-a ; 

3 X C 


Hi c/1 C/5 -A O 
00 f— f— - - 

x o o 3 x 


■ “ f- MO X x ZUH 


xxxo^xcc^oc^a 

“5 _IXX_IOXXUO“ 


ljHMHHXXN*N<<N«<<Na,Q 

><zz^x03*zoz3a=Z3aszxz 

:u<nr jaxOTaT.JO-jjDnu 


C/l X 

I o 

I f- 


c_> 

o 

O' 

< 

rn 

o 


-- o 

3 3 

3 3 3 < 

"O 3 X> — 

< X -O i— ET' -U 

(O f\ ■- fM •- ri 


O' n a 
3 3 3 


a o •- 
3 -O^ 
3 3 a 
0 3 0 


<A o 
3 3 

«- aj x <A ct\ *- LA 
30300^0 

uj ro lij ro y r- a 

A 3 A 3 3 O 


aj o aj a 
ros? O 

3 3 AJ O 
O'jIO I- 


X 3 

X 3 

X X 

X ? 

*- a xi «- "vi n 

3 3 t- a o — 


3«- r* — 

3 3 O O 

o -a: «a 

x -a 

•AJ «< --aj < f- AJ A 

o axo -a 3 oo 


c o\ 

3 3 

*< 


O' O X 3 AJ A O O Tl'J X 
*” »- >- AJ AJ AJ AJ AJ AJ AJ AJ 
3 3333333333 

3 0330330333 


AJ 3- sO A5 < O X 
•n "O-O ro-o'O-o 
3 3 3 3 3 3 3 
0333330 


AJJA C O X 3*-AJ -A OJ\oa3fO»t'4 

=r =r a- a a a a a a a a o 
3333333333333333333 
0330303333333300030 


News Release Received: 78 May 10 

Pertec Computer Corporation’s Pertec Division announces 
the FD650, a standard-sized (8-inch), double-headed flexible 
disk drive capable of recording and reading data on both sides 
of an IBM (or equivalent) Diskette 2 or 2D. The new drive also 
features double density recording to offer an immediately 
addressable unformatted storage capacity of 1.6 Megabytes. 
The FD650 is media compatible with IBM Diskettes 2 and 2D 
and electronically compatible with the current proposed 
ANSI standard. It will be incorporated into several MITS/ 
Altair and iCOM systems manufactured and marketed by 
Pertec Computer Corporation’s Microsystems Division. 

The new two-sided diskette drive is capable of double- 
density operation using MFM encoding. Each drive is equipped 
with a door lock, and the drive has die-cast construction. All 
electronics are on a single printed circuit board. Track-to- 
track access time is 3 msec. The user can daisy chain up to 
eight drives. Head positioning is achieved by a steel band 
attached to the head carriage and to a drive pulley on the shaft 
of a four-phase 1.8° permanent magnet stepper motor. Each 
step of the motor causes the head to move one track. 

The FD650 is priced at $755 is single quantities. OEM 
quantity discounts are available. Contact PCC, Pertec Division, 
9600 Irondale Avenue, Chatsworth, CA 91311; (213) 822- 
9222, Neil McElwee. 


GO X 3 00 00 


= CO 

H Z 
X —I 


X 3 
X 
3 

X X 


= f- 

x O 

3 X 


. O - X 

< U C/l CO 

1 XXX 
> X X f— X 


O X O -Z 


X t— •— X as ♦ X 

>-.(-• X f-- 3 t— X X X ♦ X CQ x 

<t >< U << < Z < X 3 >1 X X + X CJ oo X 

ai na ju ♦ o x o x 
XX 71 X X •/) Q X 3 MX - XXX* t - - 3 < 
OMXOMHE'SMrXHXXMMOH ♦ U3XX« 


3 O 

: x — x 

• <_> 3 X 

.astOcOf- 
. -% X 3 3 

) - “3 < 

1 U Q X X 


3 X H- 

O 3 D e 
X .X o c. 


; 3 E- X 3 
-33X3 
) X X X X 


> X c 
u : 

X X 3 


> f— 'X 
< 3 X a 
: x x t 


- * x ~ 

> 71 O Cl 

: x H c 


XXX«*XXX'X1*Q 

: 7) 3 COM -TlOTlMX 


» 3 X •- X 3 :» ICO X 
3 O X X -3 U M 3 
xxHx«:xxxQ^a3 


xx x xxm >-< e>j *-< x ->j a* _ 
*<xx-<r>ix<zcgz:x-s^3zx- 
33X33 - 33s<3'-»33X3 3-aC, 


>»-l3-93-33-93 - >3-»X3X 


XX X X X X 
a,_ja_xoOxa-I—<oOxxx-<^« 

a -'»“’-»:x3X33:X3XcjXD 


50 X 

x xe-xxx«*:«< 

NszN>Dl < X H 

3--— 


■» X 3 X CO 


t- 3 ^ 3 3 3 3 3 3 A-3 

33 3333 3 3 33 3 3 

<3 X =T O AJ AJ X ■— 033 /I Q 3»- 

33 -->COnO OOOOAJ O 3 O A 

3 'A o<-ootKadAio Atroq-o 

3 0 3 3 3 3 'X O 3 X 3 3 3 o 3 3 3 


3 3 3 
3 0 3 
AA O JA O 
•- JA O 3 
x — a 3 

3 •- 3 3 


*- =r o 

3 3 3 

O O' X JA 
3 3 3 3 
AJ X *- 3 
3 O •“ O 


3 AJ A 
3 3 3 
X O AJ 
3X3 


3 3 3 3 3 

*-«tO 3 3 <- O =Z 
3 «S X 3 X < 3 3 
0330X333 


0 3 3 

3 3 3 

f— 1 A O 3 X 
O •- X 3 •- 3 X 
X X < 'X < 'X < 
3 x O X O X O 


U,3'Oq» 

A1 <« 

X X < A 
X 3 X 3 X 


c— x> o 

o o o 

AJ <*, O' 

=r x < 

3--33 

3X33 


AJ C ■X AJ 
X 3 =r 
A 3 — 3 X A3' 
X 3 X 3 3X0! 


-O'- 3 3 3 

3 3 3 3 O 

<3 a i- < r- cr. 

X 3 «C33333< 

3<A-<X3«ZX33 
33X33X3^33 


A X J]J -- J n- AU J 3 3 A OCAOX 
OO O O — OO X) O O C O 

33 333333333333333 

33 OOOOOOOODOOOOOO 


AJ ? N O d i- 3 O 
J'7'7'0'5 \ON<j:C< 
333333333 
333333333 


3>XO 0 3002 
XXXXX 
333 33333 

033 33333 


3 3 AJ A — O' 3 X «— 

X 3 3 333333 

333 333333 

333 333333 


AO-OBOOr-J'ATJ 
3 3 3 3 3 X X X X X 
3333333333 
0333033333 


XOX3'AAOON«<30 — ^-3XX3X AJAX 
X X X X X X X X X X 3 3 O 3 3 O O O r—r—T— 
333333303333333333 333 

333333303033333303 030 


Page 16 

256 


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


Number 26 





AUTODUMP: A MEMORY DUMPER 
FOR POLY88 TAPE SYSTEM 


BY RICHARD B. EMERSON 

158 E. Butler Ave. 

Ambler, PA 19002 
© 1978 

There comes a point in every programmer’s life when it 
seems to be a good idea to store the contents of memory on a 
permanent medium like tape. This usually comes about two 
seconds after said programmer realizes that a particularly 
brilliant piece of code has just been clobbered by a stray glitch 
in memory. By then it is too late, but for those who plan 
ahead there is hope and AUTODUMP. This program of 1047 
bytes will dump the contents of a POLY88 onto tape in either 
BYTE or POLYPHASE mode. That, in itself is not much, but 
AUTODUMP will also write a banner or comment record 
block of 255 characters and automatic execution of a program 
dumped by AUTODUMP. If you are sufficiently impressed 
with your handiwork, you can command AUTODUMP to 
produce up to 255 copies of that file. All. that is required of 
your system is that the POLY88 USART kit be installed on 
the CPU card. There are three monitor subroutine references 
and four memory references related to the monitor. Each one 
will be explained in the following paragraphs. 

The accompanying source listing has arbitrarily assembled 
to begin at 6000H but there is no limitation on where it can 
begin. The absolute references are all outside of the program 
and the various constants do not take advantage of page 
boundaries or any similar technique. The data area at the start 
is preceded by a “JMP” only to make sure that the data is not 
accidentally erased. The actual program starts at the label 
ENTER. If you wish to load AUTODUMP first and examine 
its workings later, be sure you read the following paragraph! 
There are some very interesting features in the program and it 
would be a shame to miss them. 


Operation 

As stated above, AUTODUMP will dump files in either 
BYTE or POLYPHASE mode. On beginning execution, the 
first message is: 

TAPE MODE: 

Type either P or B depending on the desired mode. Do not 
forget to connect the correct output lead to your tape record¬ 
er as this is CRUCIAL! With the mode selected the next 
message will be: 

TAPE NAME: 

Type in the file name that you want. All characters are legal 
except <RUBOUT> (A note about notation: <CHAR> 


denotes an ASCII symbol. Resist the urge to type the eight 
characters mentioned above to clear a letter.) It is suggested 
that names be limited to alpha-numeric characters. If a wrong 
character is typed in, typing <RUBOUT> will not appear in 
the file name as it does with some POLY88 routines. With the 
name loaded the next message will be: 

START ADDR: 

AUTODUMP is asking for a hex address that marks the 
start of the area to be dumped. Typing any character other 
than 0 through 9, A through F, or a carriage return, <CR>, 
will cause the question to be repeated. If you realize that the 
address typed was wrong, typing any invalid character will re¬ 
start the request in progress. This rule applied to all hexadeci¬ 
mal entries in AUTODUMP. With the starting address loaded 
the next question will be: 

END ADDR: 

The address that marks the end of the dump area has been 
requested. It is suggested that, if the area ends at FF42, that 
the entry should be FF43. As you will see from the code, the 
area need not be on a page boundary. With the dump area de¬ 
fined, AUTODUMP will now want to know where the data is 
to go upon reloading. This address is requested with the mes¬ 
sage: 

LOAD ADDR: 

The address may be the same as the address for START 
ADDR or it may be completely different. Bear in mind, how¬ 
ever, that AUTODUMP does not perform code relocation but 
merely tells the tape loader routines where the data is to be 
loaded. If you assemble a program at 8800H and reload it at 
2000H, it will not run unless the address references were based 
on 2000H. The final address requested is the place where pro¬ 
gram execution is to begin and the message is: 

EXEC ADDR: 

This address may be any address in your system, it does not 
have to be within the dumped file. Thus you could load data 
and then go execute a program that will munch on the data or 
you can execute the data that has been loaded. Naturally it is 
also possible to begin execution anywhere in the dumped area. 
If you do not want the file to auto-execute, enter any address 
or type <CR>. Omitting the banner record will keep the file 
from causing automatic execution. With the execution address 
entered, the next question will be: 

NO. COPIES 

IN HEX: 


Page 18 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 26 




Type any valid hex number and you will get that many 
copies of the dump, each with the banner or comment that 
will be typed in, each will start at the same place, and each will 
end at the same place. No additional type-ins will be needed 
save that of starting the next copy. The banner or comment re¬ 
cord serves two purposes, first it allows a file to identify itself 
and second, it serves as a flag for auto-execution. If there are 
no characters in the banner table, at the end of the dump the 
file is closed without an auto-execute record block. The ban¬ 
ner is requested with: 

COMMENT CCTRL/D TO END>: 

Avoid typing in control <CTRL/*> characters as they can 
confuse the POLY88. <RUBOUT> erases characters but 
each <RUBOUT> counts as a character so it is better to erase 
the banner when more than one <RUBOUT> is needed. 
Typing <CTRL/X> will clear the banner table and also clear 
the screen. If your keyboard cannot produce lower case let¬ 
ters, don’t despair. AUTODUMP looks for a character that is 
reserved as the “flip” character. This character tells the banner 
routine to flip from UPPER CASE to lower case. Note, how¬ 
ever, that you must “flip” back to upper case before typing 
<CR> or <RUBOUT>. Clearing the screen with 
<CTRL/X> also resets the “flip” flag. You may flip from one 
mode to the other as often as you wish; use of the “flip” char¬ 
acter does not take up banner space. When the banner is typed 
in, type <CTRL/D> and you will get: 

READY TAPE, AND PRESS ANY LETTER: 

AUTODUMP starts dumping only when you give it the go- 
ahead. It does not start before the banner is finished unless 
you have typed more than 255 characters. If you find AUTO¬ 
DUMP has begun before you are ready, press RESET on the 
POLY88 and then <CTRL/Z> to enter the front panel mode. 
From there just type <SP Jaddr> where addr is the starting 
address for AUTODUMP. You will have to re-enter the ad¬ 
dresses and so on, but at least you won’t be waiting for 10K of 
core to dump out in BYTE mode! It is possible to dump dif¬ 
ferent files without reloading or restarting AUTODUMP. When 
the last copy of the current file has been written out and its 
execution address listed, AUTODUMP will clear itself and say: 

TAPE MODE: 

This is where you came in. If you want to, go play with 
AUTODUMP and then come back to see how it works. 


Description 

In effect AUTODUMP is an oversized “block move” com¬ 
mand except that the receiving area of the move is a tape and 
not a location in the memory of the POLY88. Additionally 
provisions are made for breaking the transfer up into 256 byte 
blocks to allow restarting a file in the middle of a read. The 
USART is driven much the way that it is in BPRINT, PolyMor- 
phic’s printer driver for BASIC, except that there is no large 
buffer. The USART generates an interrupt and AUTODUMP 
makes sure that data is ready when the USART asks for it. 

The monitor references appear at the beginning of the list¬ 
ing. SETUP is a routine that initializes the USART with the 
data that follows “CALL SETUP”. Notice how the manipula¬ 
tion of the stack saves much time and confusion. HEXC is a 
routine that accepts hex characters 0 through F and converts 


them to a hex address that is put in the HL register. B contains 
the number of characters in HL. If there are less than four 
characters the leftmost bits are set to zeroes. 

Any non -hex character causes a return from HEXC and the 
last four valid characters are in HL. DEOUT outputs the con¬ 
tents of the DE register as a two byte hex address. TBUFF is 
a two byte area that holds a status flag and data for the 
USART when it is in the tape mode. SRA4 is part of the inter¬ 
rupt vector table and it points to a routine that will service the 
interrupting device. WormHole 0 is the keyboard driver and 
puts data from the keyboard into the A register. WormHole 1 
is the entry to the CRT driver and puts the contents of the A 
register onto the CRT. 

The data area of AUTODUMP consists of two areas, the 
record header text and scratch space including the banner 
table. The order of the header area must not be modified or 
the POLY88 monitor will not be able to read the tape. This is 
because the data stored here is copied directly by use of the 
HL register. The scratch space is not restricted and may be 
placed anywhere that has enough space. The jump over the 
data area helps to define the data space and is there for psy¬ 
chological reasons more than anything else. If you need the 
three bytes, take it out and start execution at ENTER’s 
address. 

ENTER puts the address of TISRinto the Interrupt Service 
Routine Address table so that when the USART causes an 
interrupt the CPU will know where to go. After TISR is set up 
the screen is cleared and the mode request is displayed. SHOW 
is a simple routine that takes data from a table and ships it to 
the CRT via WH1. This wormhole takes the contents of the A 
register and puts it into the memory dedicated to the display. 
This process will continue until a 00 byte is seen. There is no 
limit on the string’s length or content except that the string 
will end with a zero byte. The string is selected by putting the 
proper address in the HL register. WHO is used to get the type- 
in and that character is returned in the A register. Bad data is 
ignored and good data is displayed or “echoed”. 

With the mode selected, SETUP is called. This routine takes 
the bytes that follow the call and outputs them into the 
USART command register. SETUP pops the contents of the 
stack into the HL register. Since this is the address of the call 
plus two bytes, HL now points at the first byte after the 
operand of the call. If “CALL SETUP” is at address 6000, 
starting at that address memory will look like this: 

C3 AD 02 05 

When the call is executed the stack will contain 6003 which 
is the first byte after SETUP’S address. If “POP H” is executed 
HL will contain 6003 and a “MOV A,M” will put 05 into the 
A register. The question is then how to get back to where the 
“CALL” originated. As SETUP goes along it keeps sending out 
data and increasing HL by one until it hits a zero byte. This is 
the signal that there is no more data. All that is left is to put 
the HL register into the program counter with a “PCHL” in¬ 
struction and the program comes back to the byte after the 
last byte of data! Thank some unknown wizard at PolyMor- 
phic for writing that gem. 

Even though the USART had data put into it, it still will 
not run and it is just as well because there is still more work to 
be done. The file must have a name and a size. The name is a 
fairly straight-forward process. The area where it is to go is set 
to spaces and then data is filled in, letter by letter. It is 


Number 26 

258 


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



RUBOUT’s job to back up over any character that is to be 
erased but not to go past the start of FILENM. When there is 
no room for more letters or when a <CR> is typed the file 
name is complete and the starting addrsss is requested. 

All addresses are brought in by HEXC, a monitor subrou¬ 
tine that puts a valid address in the HL register, the number of 
digits typed in are in the C register and the last character seen 
is in the B register. HEXC also displays the data as it comes in. 
A check is made in AUTODUMP to make sure that HEXC 
ended with a <CR>. Anything else is invalid and the address is 
requested again. This allows errors to be corrected without re¬ 
starting AUTODUMP. Once the starting and ending addresses 
have been entered the length of the file is computed by sub¬ 
tracting the ending address from the starting address. This 
takes place shortly after GETEND and the start of the subtrac¬ 
tion is “MOV A,L”. Ordinarily the carry flag would have to be 
cleared before the subtraction can start but the “JNZ 
GETEND” instruction insures that the carry flag is cleared to 
zero. The program can only transfer here when CPI ODH sets 
the zero flag and at the same time clears the carry flag. This 
may seem a trivial thing but it is important to know that this 
little trick saves two bytes of code. It would otherwise take 
“STC” (SeT Carry) and “CMC” (CoMpliment Carry) com¬ 
mands to clear the carry flag. With the subtraction completed 
the length of the file is set. By figuring the length it is possible 
to test for the end of the dump without having to test two 
address bytes. When FILESZ is less than 100H the last block 
has been written and the dump is over. 

After all of the file size data has been collected the load 
point and execution address are requested, then it’s time to de¬ 
cide how many copies are to be made. Each item is a simple 
type-in and their values are not really used until the file is re¬ 
loaded. For that reason discussion about them will be delayed 
until the tape writing begins. What remains, then, is the ban¬ 
ner. If a simple <CR> is typed in, a one byte long banner is 
created and the whole matter is ignored. On the other hand, 
if data is typed in, it will be displayed when the file is re¬ 
loaded. Remember that short files read in with POLYPHASE 
do not take long to load and the banner may not be displayed 
for long. 

Each byte typed in belongs to one of three classes. The 
most common class is a simple display character. It is placed in 
the table after being ORed with the B register. If B has a 20H 
in it, the character becomes a lower case letter, otherwise it 
remains as it was. The next possible class is the “flip” charac¬ 
ter and it may be any character you wish, excluding CTRL 
characters. Its function is to change B from 00H to 20H or 
vice versa and this “flips” letters from upper to lower case. 
Because the “flip” character is not stored, it is possible to 
“flip” as often as one wishes. Note, however, that some char¬ 
acters like <CR> do not survive being “flipped”. The final 
item that may be entered is <CTRL/X>. This is the character 
that causes the screen and banner table to be cleared and 
allows new data to be entered. This does not clear the ad¬ 
dresses or number of copies counter. It does mean that 255 
characters are again free and that all old data was removed. 
The <CTRL/X> is the best way to correct the banner because 
<RUBOUT> does not remove data, it only covers it up and 
takes up banner space as well. 

With the banner loaded the program waits for a type-in 
that indicates the tape is ready. This allows time to change 


cassettes and check the recorder. On receiving the type-in the 
size of the banner is checked. If it is one byte long the pro¬ 
gram goes on to dump data; if not, the banner is dumped to 
tape. The dump procedure is similar for the banner and data 
records. Each record contains 16 <SYNC> characters, a 
<SOH> (Start Of Header), the file’s name, the number of 
bytes in the data area, two zero bytes if the record is a com¬ 
ment otherwise the starting address for loading the data, 01 
for a comment or 00 for a core image, the checksum for the 
header, the data or banner, and the data’s checksum. 

The program transfers to DUMP and it displays the address 
being dumped out. The inter-record gap is generated by GAP 
while SYNC outputs the <SYNC>’s. These characters are used 
to ensure that the USART knows how fast the data is moving 
so that the USART can either say it “knows” what the data 
rate is or that something is wrong. Notice that there is no 
“OUT” instruction in SYNC, the data is actually sent out by a 
call to TAPOT. We will discuss it after the header has been de¬ 
scribed. After completing SYNC, a <SOH> is sent to indicate 
that the data that follows is the header proper. The A register 
is given the number of characters to be output from the header 
and HL is set to point at the beginning of the header data, 
FILENM. Since the header will be concluded with a check¬ 
sum, CHKSM1 is called. Notice that all of the data for the 
header is grouped together in the constant area at the be¬ 
ginning of the program. 

Checksumming allows the verification of data and, al¬ 
though far from perfect, gives some measure of assurance that 
what is received is what was sent. The method used here is 
based on modulus 256 arithmetic. The data ranges from 00 to 
FF (0 to 255) and if each byte is added to the sum of all the 
previous bytes we have the basis of the checksum. Naturally 
the sum will go back to zero if 1 is added to FF, but for the 
present scheme that is acceptable. When the last item has been 
processed, the l’s complement is found and 1 added to that to 
give the 2’s complement of the checksum. To verify that all 
has gone well, take the sum of the data and add the check¬ 
sum to the summed data. The correct answer is zero and 
anything else is a sign that something is wrong. Look at 
CHKSM1 and CHKSM2 and you will see the steps described 
above. Keep in mind that the C register keeps track of the 
number of bytes yet to be written. When C finally equals zero, 
program flow falls through to do the complement and on to 
TAPOT which writes the checksum onto the tape. 

TAPOT saves HL, looks at TBUFF, and saves PSW. TBUFF 
is a two byte area that holds a status byte and a data byte. 
When TISR services the USART, it will set TBUFF to zero in¬ 
dicating that putting data into TBUFF+1 will not damage any 
existing data. The three instructions “TAPOT 1 MOV 
A,M/ORA A/JNZ TAPOT 1” may seem to be a closed loop 
but HL is pointing at TBUFF. TISR can put a zero into 
TBUFF so it is possible to exit the loop. At this point there 
are probably readers who are trying to figure out how the 
program gets to TISR. Up at the very beginning of AUTO¬ 
DUMP, at label ENTER, the address for TISR was stored in 
SRA4. When the USART generates an interrupt, the CPU will 
“CALL” the address at SRA4 effectively calling TISR. 

TISR clears TBUFF and then puts TBUFF+1 into A. With 
the data in A, an “OUT 0” sends the data off to the USART 
and the tape. The stack is restored and control returns to 
where the CPU was when it saw the interrupt. With TBUFF set 


Page 20 


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


Number 26 

259 



to zero, the data is loaded into TBUFF+1, TBUFF is set to 
one, the data pointer is restored to HL, and control is returned 
from TAPOT. 

With the header written out, the data itself must be 
dumped out to tape. The process is controlled by DMPFULL 
and DMPPART. A check of the data block’s length is made. If 
the block is 100 hex bytes long, DMPFULL causes the bytes 
to be output along with a checksum. This process continues 
until the size of the remaining data is under 100 hex bytes. At 
that time there is a “JMP” to DMPPART. Notice that the pro¬ 
gram falls directly through from DMPPART to TAPOT1. At 
the end of TAPOT1 the “RET” causes a return to the “MVI 
A,2” after the “CALL” to DMPFULL. Here the banner size 
is checked. A one byte banner causes a simple end of file re¬ 
cord to be written. A longer banner causes the execution ad¬ 
dress to be put into an Auto-Execute record. If the number of 
copies requested is zero the program goes back to ENTER. If 
not, the counters are reset to their values at the start of the 
dump and the program goes to NXTCPY. 

That’s all there is to AUTODUMP. It is a program that 
scans memory in 255 byte chunks which can be passed to 
tape. Now that you know how the files are written, why not 
try to write files in other formats? Since you know how the 
files are constructed it should be easier to write a program to 
read those files. There is no reason why your POLY88 can’t 
read other tape formats. 


MICROSOFT’S COBOL-80 

News Release Received: 78 April 13 

Microsoft is the first COBOL for 8080/Z-80/8085 micro¬ 
processor systems. COBOL-80 conforms to the 1974 ANSI 
standard, thus giving users immediate access to programs 
already written in COBOL. All Level 1 features and the most 
useful Level 2 options for the “Nucleus” and for Sequential, 
Relative and Indexed file handling facilities are included. 
Additionally, Level 1 Table Handling, Library and Inter- 
Program Communication facilities are provided. Of the 
advanced Level 2 features, Microsoft has included the verbs 
STRING, UNSTRING, COMPUTE, SEARCH and PERFORM 
(varying/until), along with condition specification by way of 
condition-names, compound conditions and abbreviated 
conditions. COBOL-80 allows a packed decimal data represen¬ 
tation to conserve memory on floppy disks. 

The COBOL-80 system consists of two packages: a com¬ 
piler for translating source code into relocatable object code, 
and a runtime system containing standard routines needed by 
the object code at execution time. The whole system may be 
run in less than 32K bytes. Rate of compilation is 250 lines 
per minute. Complete documentation is supplied with the 
system or may be purchased separately for $20. COBOL-80 
is available off the shelf to run under the CP/M and ISIS-11 
operating systems for $750 per copy. Microsoft, 300 San 
Mateo, NE, Suite 819, Albuquerque, NM 87108; (505) 262- 
1486. 


















z 



UJ 




























X 











z 



u 







z 











l-l 


X 








X 













X X 

UJ 


















CL 


uJ X 

X 







CO 







~l 






J X UJ 

z 



M 



Pi 

LL 







z 




P 


- X _! 

X 






UJ 

z 








UJ ^ 



UJ UJ 

UJ Z 

co a. m h 




LU 



LL 

I 


X 





UJ 

_J © 



A CO 

© E- 

-J LL 

UJ 


x 


X 


£ 

(J 


Pi UJ 


UJ Cl 




© uJ 



□ .. 

□ Z 

X U i-i 

J 


n 


CO 

~i 



z y- 


lL X 

CO © 



Z uJ 




X © 

a □ u a 



*—• 


UJ u lO 

Pi 



LL •— 


lU X- 

CO UJ 



►— LL 





CL E- X 

Ul 


y— 

□ 

LL 

UJ UJ LL 




r-t 


I Pi 

ul Cl 







UJ Cl 

LL A U *-• 



•z 

LL 


U LL \ 

X UJ 



X LL 



ll X 


□ 

Z X 



_l 

E- Zt 

x a j; z 

□ CO 


o 

Ll 

UJliMHiL 

X Pi 

LU 


U 3 


X U Pi 



LL 

ll Cl 

UJ 


□ ® 

> E- 

Cl u! ul CJ Z' 

E- CL 


□ 



_' l-l 

ll 

lL 


l— 


i- a □ z 

© © 



co a 

_l 

X 

Cl * 

© UJ 

uJ CJ Ul Z ZE- 

Z 


-1 



Pi Z Pi □ 

□ 

UJ 


Z LD 



z 


UJ 

LL 

© 


X 

CO 

© Z □ E- © X 

UJ CO X CL 


UJ 

LL LL 

X 

Pi 

u. y- 

I 

Pi 

LL X 


LU 1- CO 

UJ 


U' 

□ v 

•I 

z 

Cl ' £i 

CL ... 

X « E- > > UJ 

X e- CJ z 


LL 

Z Z 


«5 uJ >■ y— 

□ 


Z 

(J —' 


XhD CO X 

LL © 


M 


1— 

in 

□ Ul 

□ 

X> © E- Cl E- 

Z X Al 



co x 

•I 

X UJ LL 

UJ 

CO 

LL 

•>> UJ 


X X UJ '_' 

UJ 



X I 


Z 

Ll o 

LL 

Xr J X e- 

X l-l CO E- CJ 


sit 

—• (J 

CO P O 

1- _J 

►— 

LL 

Pi 


□ uj uJ LL i- 

© a 


LL 


E- Ul 



UJ 

X X Z Zt UJ 

□ 3 



CO X 


Zt y- 

LL •— 

•—< 

UJ X 

CO 


X X Pi Z 

Z y- 


UJ 

r-t 

X UJ UJ © 

> 

E- I 

X E- 

A3 □ ZZUJCLd □ E- 



z 

i — Zt • *■ 

Z u 

u 

Pi <J 

CO LU 


X UJ Pi ll 

a 

CO 


LL 3 

uj © co a 

CL 

LL •■£> 

Z CL 

Cl □ e X u UJ Z 

J E- Pi -1 

A. 

□ 

UJ LU 

Pi 

z □ •=• — 

y— 


X E- 

Ul LL 


CL □ Z (J 

_J C) 

LU 


CO 

E- □ X X 


Z aJ 

X Z o 

□ u UJ - XX 

•- _l 3 □ CL 


N I 


y- ll 

CO U. 

.. LU 

X' z 

LL >• 


□ X CO 

UJ 


y— 

•-« E- 

x □ 


CO —' 


(J W ♦ E 

U. X u CL CL 

CJ 

E- 


CO CO UJ LU 

□ 

2- X 

X LL 

Pi h- 


Ll '£' ID 

z* y— 

LL 

Cl 

i- Cl 

□ LL UJ 

.. 

Cl X' » 

UJ Cl X> I 

J UJ □ A □ 

.»• 3 CL Z V © 


cj 

_J CO 

> 

LU _l _J 

CO 

u z 

l_jl 

Pi 


LL LL X (-0 

x > a 

Z 

O 

y- h* co e- 

Cl 

\ X 

CL \ UJ 

I Cl E Cl ^ © E- 

E- Z X 3 

II 

LU 

z E- 

z 

i- □ O 

UJ X 

¥—i x 

Pi CO 

Z Pi 


Cl O -• CO 

*—• © 

Ll 

CO 

l- 

C O Ul > 


>-• LL O 

■I H LL 

CO 1 

CO E- X CJ II CL 

LL 

— LL 

—1 ' I I 

X t— 

Pi 

Cl 

Cl 


UJ X f- UJ 

r— 



ll Cl 

t— Ul LL © 




Cl y- v _J *h v y- 

UJ LL CJ 


LL 

r- UJ Cl 

LL > X X 

l£l 

D Ul □ Ul 

Pi □ 


LL UJ LL LL 

LL U 

u 


Ul z 



□ ” ” 

a ” 

Z UJ X 1 CJ X 

3 Ul □ CL *• 

CL 

□ 

*-« i_i 

vt 

1- LL LL LL 

U X 

X _J 

N 

Z u 


U r-J Z* Z Pi 

•I □ □ 

1— 

CO UJ 

HGE e- 

© 

X E- I 

k x y- i 

UJ CO UJ t— II •_> e-i 

•3 CJ E X Z ' 0 

X 

•J 

X •_< 

I—I 

Zt u □ o 

UJ UJ 


LU -• 

a UJ 


X' — UJ y- Pi 

►— 


UJ 

X _J 

□ Ul UJ UJ 

•I 

UJ ■=• 

UJ (J UJ © 

_l UJ CO 3 _l II U □ UJ u Ul U I UJ 

X 



Pi 

□ CO 3 3 

Pi _l 

I- Ll 

LL CO 

-J Cl 


Pi CO Pi '. 0 Z 

co t: 

j; 

l£| 

*-• '_' 

CL CL Zi CO 

© 

UJ CO 't 

Z' UJ CO 

J Cl X' f -- CL I u H Cl LL Z Z> UJ O > 

CJ 

E- 


•» 



□ ... 






... 

... 



... 






_' 





X 



z 








X 

X 

X 

X 


Cl (O 








LU 






I- 


z 

•I 

X E- 



Z LU 

X X 




□ 



Cl 




a. 


X 


•I 

z 

X Ul CL X 

UJ E- 


m ij 

I 

X X X X 

LL 

Pi 



Z 




CO 

I 

E- 

q 

a. o 

X Cl © 

3 X J I -1 E- 

_J 3 


Z 

Pi Z 

«■* 

CO X o •T 

UJ 





X 




’t '_' 

© 3 UJ 

X 


X X' » 

X CO 1- © U X 

3 — a 


X UJ 

Z Z 

Pi 

■=• — CU OJ 

I- 

1 



y— 

© 



1- 

•I o 

-h X □ © E- 

N E- 

hET 

E he I 

© CJ © IL 0J XX 

□ u co © - I © 

X 

h- LL 

OJ CO 

CO 

O 

X 




X 

© 




LL e. 

I - I I « > 

Cl UJ X uJ If' 

LU I UJ •■£' 

,. Ul • » « z * 

I e. . I I U 3 

A 

—• LU 

©■ © 

® 

® ® o © 

UJ cu 

Z 00 cu — 

CU -H 

UJ 

— ^ 0J cu cu 

cu cu 

T-t 

I CO z 

3 X CO 3 • © 

\ in 

3 (,/i c 

III 3 CO © 

X CL CJ X X X (J X X 

CO X CJ 3 3 N CL 

© 

3 Ll 
LU 





UJ 

LL 



y- 













t LL 





Z 



CL 













CU LL 





►— 



LU 

L-l 





© 

_l _J _J 


_l -J 

-J -J 

A 

_l _J -I 


> □ 

Xi 3 

X< 

Zt X' Zt Zt 

Cl 

X 



z 






_l r-< _l _l »-« 

N _l _l 

Cl _J _J 

hJhmhXClN'1 

_J i-i i-i _J _J •— 

i—' 

E- 

G c; 

U O li G 0 

X CO 

UJ CO 

CO CO 

CO CO 

UJ i/t 1,0 CO ', ' ' 

co co 

i/t 

X I > 

Z X Z Z Cl f J Cl X 

•I Z © 

X Z Z © 

X X > X > CJ O X X Z X > 'I LL CL r J 

Cl 

X £ 

UJ UJ 

Ul LU UJ UJ UJ 

J Pi 

E- Pi Pi Pi 

Pi Pi 

X 

© © © Pi © 

© © © 

_J CO X 

U JOOOI 

O “) 

O CJ A 

-i O O A 

J CO X J X © © -} J CJ J x Lt CJ O 

CJ 

3 5 





LL 



u. 













Pi X 




M 

UJ X 


ll ll 

□ 

_J © © CL 

Li LL □ 







CL 



□ 

LL 

e- 

Ll 

1- CO 

Pi X 

X' N > 


© N © © >_• 

© 


Cl 


A 




X J 

X 


1— © 

—1 (J 

X 

Ll *t 

LL LU 

Z UJ 

X co co y- 

Pi 

y- n/t z z co 

Z CO 


Ul 


X 



UJ 

X u 

X 


• 

E- X 

□ 

X* z ® — 

Z _J 

LU _J 


M 

7~ 

LL LL l _l LL L-l 

© X 

LL 

►— 


E- 



y- 

E- X 

y- 


z 

UJ UJ 

UJ 

Pi Cl X I 

I- •-• 

X — 

LU _l 

a uj 

UJ 

X X X y— Ul 

□ uj a 



Ul 



5- 

UJ Z 

UJ 


" ” 

CO X 

Pi 

y- (/> 3 3 

». C O Ll 

... u. 

LL Pi 

_J CL 

... 

© © UJ CO z 

_i _i 

o 

.. uj 


z> 



© 

l£i 2 

ID 



A Z ^ CO Z> O t 

z z © o ^ cu cu 
>\j co ' v > i_> i_j i_i o 


'■£' 

u 


!_j lli 

® 

0J O 0*1 CO OJ © O «-< I_I OJ © 

•£' © O v£l *.£i © -£l •.£• rf- •£> rf 

•V -it CJ U CO •=• CO © © ■=• *T X •£■ CO © X 

U — O oj ‘it •£' OJ rt \r, CO OJ X 'X UJ If' Oj -r 'X 

«-• OJ UJ A «-i A A UJ 'I LU OJ A © If' *•£' l v i m A •£' 

OJ CU CO (j OJ CJ CJ U CJ Ll. CJ © lu Q i_'i © 


•=• o © 


© '.£| -.£) 
© 1=1 CO 

o o o o 

*-< OJ LU 
0J OJ © OJ 


CO 

‘■it 


CO CO © LjO CO 

X> ‘it ‘ it '£' © © ■.£' 

CO Pi CO If.' 'X' © "t U Ll © 

•XI r - • £' © © OJ CU N *T o 

©acu^©-hujaaujxuj 

OJ © O CU OJ © O O U O' li. 


© 'l‘ !f' Pi u. 

‘■St ' it 'it 'it ' it 


•XI 


'■it 


U- OJ If! l- 'X Pi O CO l it CO 'X Pi © CO N •! © © CO f •- CO Pi LU O CO Ifi 'it N 'I Pi CO IO 00 A A © 

—• oj oj cu oj cu co co co co co co -r rt xt ifi 10 in to to in ■.£■ -xi -it x« x> x« x» r- n nnn r- co 


'■it X' X' X' X' Xi X' ' it X' X' X' X' • £' X' X' ••£' X' X' X' X' X' •■£' X' X' X X' X' '-it X' X' 'it X' X' X' X' X* X' • £' X' X X X X X X 


Number 26 
260 


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



CL 

a. u) 

x z 
i □ 


“* uJ i 
lit ► 
□ . 


uJ 

Z Q. 

Z UJ 

□ Z 

'£• □ a. 

x j.r i 

_J UJ X '! 

x lit i— : 

□ X 

UJ E uJ UJ 


X X 
•_> *X 


J 1=1 -I 
i X 4- 
■ UJ 

lit > X 
M LL UJ 

: □ x x x •. 

>UJIZ. 


X 

1=1 UJ X' 
N X 


J ~ X Z 

: " 3 

: co o» 


I □ M w it J 
i □ : 

1 11 LL X Z L 


Cl 
k- ► 

a •. 


X uJ 
I 

□ a 


• x UJ 

11— i=i 
X D 


Ltlhll Z X 
X X* Z X 1=1 




uJ ■_> 

co lit 

a 


UJ X' X* Ul UJ Z UJ □ X' 


t- i=i UJ UJ Cl UJ X 

x- x jijoi 

... .x* 4- — 


O *-< X 


UJ 

:> h- 
X UJ 







> 




z 


1=1 




□ 






X 

I 

lit 





O 

X 




CO 

O 

4— 

•=• 

X 


X 


X 


N 

X 

4- 



a 

>-< 

O 

> 

>■ 

a 

r— 

CO 

® 

X 1=4 

1=1 

X 




N 



jL 

Cl X 


If .' 

lit 

=4 

O' 

a a 

'j- 

co ir> 

X 

X 

X 

•X 

X 

•:u 

4- 

□ 

1=1 

X 



X 

X 



X 

0 1 



lit 

X >» 

N 

□ 4- 

a 

4- 

X 

X 1=1 

•—1 

X X Lt 

LL 

X 

1=1 

X 

CO 

4=1 1=1 X 


X 

z 

>-< 

X 

f— 

X 

z 


III I 

= 4- 

X x X 

4- 

X 


X 

•=• X 

— a — 

X 

X 


«-« 4- 

X 

a 



1=1 

Cl X 


X x Ct 


r 

lit 

Z »£■ 

X X 

O O' 



a 

_i 

N Lt 

■=• □ X 

X 

• r. 

CJ 

4=4 

— O 

As X 4— 

X 


X 


CO X 

** Cm X 

z 


lit 

K 

M 

v 1=1 

X 



'HZh 
D j UJ 
illMill' 


f J 


lit M A I ( 

x r© □ . •=• 

« J X CU i 


: x x z z x i 


> Lt 4 
' X I- 4 

I Lt I .' 0 


« X X Ul J X Cm 1=1 x Z Ul J I 


I i—i lit I- CL •=• Z > UJ 

• = u Cl (j •=• X' 0. _l 

i x ' 1 x co •=■ z. u •-« 

I M W Ul M l J h It E 

' □ □ • w . Ul X • * 

.JJIIIitZIX 


ui to 

O' i=i 

CO □ 


x q z x M a x x x x z >=• 


- — ••• *- a - - — — 11 x-J■ ‘0 e z i/) x co z v) _j >_i i x •..••.i _i I.i x co o< i»—< » _i (I _j >: i _j co _j co j x □ i a x co o Jmm jh- —, 


x 

□ 


CU •: 

• UJ f - 
■ UJ *t 


—* *r ' 

•‘•J CU >' 

.-.j ,-.j .■ 


J •=■ • 
> r - Q co <_■ i'u • 
'» r- oj •=•, 

i ■=• «-• oj u' •£■ r-- 


< - u. — oj • 

• -ill o •=• — . 
J X OJ UJ OJ i 


I OJ 0'< 

I OJ OJ I 

I 'XI •£. ' 


X I 

OJ Cu • 


■ ’t ’f "t rt 

I OJ OJ OJ OJ 
> •£• •■£• '£' •£• 


UJ -« *T •£• ' 
t If' If' If' l 
•‘•J OJ OJ OJ > 


=•*-'*-' OJ *-« OJ *-• O O i'O •-< «-• <-« O <-• O »-« O O CU •=• CU O CO r-t *-> o 

Jl> •£' •£' ••£* ’ ll' ■£■ •■£> •■£• •£' ■£' •£• •£' •£' •£■ ■•£' •£' •■£> •£' •£• •£' •=• •■£> •£• •£• X* <£i ■ £' • £■ ••£' •£> 

2 2 ^g jj 2s§J8222Sfe2 2 2£22222S°g * x*<* oj^ 

•J X CU 1=1 UJ OJ X UJ X UJ -‘'J X OJ UJ OJ 1= — IT- X X OJ X OJ — OJ — CU CO ^ UJ i y'l Lt i'O Cl I ^ CU ^ 1 

o '.'J CU 'X' CO CO CO X O CO* CO OJ 0J CO CO O CU CO O OJ CU CU CU CU OJ CU OJ (J CU f - <£t CJ CO X CO o CU CU CU CU 0 

ti rt r. x >_■ u. oj t r . ij. i_i u. -'u *t r - x i= uj —■ t r. x i= •=• co •£« <j> >_■ u. ■=■'-< ^ uo •£> a- uno co u 

11 • £■ •£■ '.£i *.£i ■•£' '.£i r. r . r. r . r. r . o:> co co co co co o- >? ■ >? • >?• >7- x x x x x x u a a a a n n m o 6 ( 

'J*0j "J >'0 '"'J OJ OJ |'|J OJ I'U OJ 0J CU 0J -'0 OJ CU OJ 0J OJ CU CU OJ OJ <'|J OJ OJ OJ CU >'|J CU CU OJ CU OJ CU OJ CU 0J CU 0 
£' •£' • £• •£' •£• •£• •£' • £• •■£' l< •£' •£■ •■£• •£• '-£i •£< • £• •£' •£' •£> ■-£' •£' • £' •■£• •-£' •£' •£' • £' •■£• •£' • £• • £' '■£> •£' •■£> •■£< •£• •£' ••£' ■£' U 


UJ Z 
Lt X 
=. uJ 
=i _J 
X — 

X □ 

lit Lt 

X X 
I- X 

</> u 


Lt 

z 

X 


•_> CJ 

» LLl 
o X Lt 


; x i 

i — c 
i a l 


X i/ t 

</> 

. >- uJ 

I lit Lt 

- X =4 
• H- =» 

L ) X 

] 

■ ►- X 
>/> uJ 
J X 


=i N X 

L=l •—< Ltl 

X </> t- 


: CO 


U. 

x 

X 

O lit 


uJ X Lt 
wQi-UJw 
X I- X' 1=4 

Cl □ X 

*- —I Z h- L-) 

Lt X □ <!' '/> 

X 1 J 4- X UJ it 

»- X X — Lt X ' 

W « □ - M =1 I 

K P X O CJ . 

> X CluJX 


H- X < 


. CO 


■ l- X 
I UJ X c 

i X' CJ I 


' X I. 
J l 0 uJ l 

. co i ; 


Lt □ 

. CJ ►— X' CO 

1 CO X CO 

X 4- — UJ Lt 

I Ul X 1=4 Lt X 

- _J <-« I 1=4 X 

:• □ a m j i 

: a a. _i x 


CO LL UJ 

co a x 

UJ CJ 


t— C O □ X 
X aJ i- a LL 

ox ox 


X UJ 

X z 

□ □ 

o o 

J 

: a. □ 




-J X 
4X1 X 

X 

»— o 

Z X 
O X 

*— CO 
• CO II Ltj CO 

: co 


x x 

) X X 


XXX' CL 
■ 4- X » X. X 4- x . x 

1 x x a x x x x 1 □ □ 

> X' O' X CO X Z l£i '_' X _l 


CO 4 


»- 4- X 

X <- X 0- X 

Z A. Z /S X y\ 

O 1=4 O' X 4=1 

. X 


X A. o CO _J X X X □ X X X 
J •—* *—1 Lt L_l Lt O X *-4 □ X' O' X' X 

.xx O' > o x ;i x o x x o< =4 

4— V' x X •» LM 4— v XX •* X •» 4=4 
4- X CO 4- X 4- Z CO 4-4- > .1 il 

CO UJ X II X X CO j 1 II UJ > X X 

X X 4=1 X O' 4— 


xxxxaxx x 


O Z O X Z X X 
X V VOX 0 a. X 

X □ X □ CO X LM 

X II X II I X CO 

O Oi v X v X 

X »X X X 

4- X CO X - II X II X 

X X X I □ X X 

O' O > X X O X O' 


X O O' XXX 


-S 

D X i 
X X 

«:• x ■: 


' X X 3 O 

• X X O X 1=4 

A »- » I X » 

:• co x co i x 


X 4- X XI 

I—4 LLj » »• • 

•=• O' X X X X 


r J X 4— 4—4 4—4 X 4— O' 1=4 4-" 

CO 1=4 □ 4=1 o O X 4=1 > 

X 0 □ 3 0 _J X CO X 3 X X X 3 O 

'ixzxox«XKaaxa x 4=4 x 4- x x 

' *-• X » X X ' 4=4 X □ □ .IX »I=4X X . X X » 

4 X X X X CO I X '=• O' X X X • ' X X •=■ 'O X X CO X X 


I -Q4— 4- X Z 19 —< 

XX^^Xx □ XX X x 

O z J X CO 1=4 X O' ® X 

11 - j a. o □ h « a o o x i o* •=• - oj .1 x 

4-4 X . O . I . . m . I X CD I . x . . 4- 

O' X X 00 O' X X « 3 ^ w H O' X 3 X Z X O' O' 


O' x _ _ __ 

n oxoxxi x xxgxxi«ox'i'ioxxaoaoSlo^iX'X'ioxrxxxocxoxzxv.r.inx^o2xx>xx>.rxr4x r -i i ' i ^x^§oo ^ 

' « L_I • . Vi X O *0 e- '_' 1 CO X X O' Z O • Z CO Z Z • ■ Z CO CO X O' O' Z O' “ ( :• CO X O' Z O' —■ CO X O' O' Z O' “• Z CO X O' Z X CO Z O' O' “ O' 1 E IJ E Z cl O “J 


X 

H- 

X 



Page 22 


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










r- □ 

x c— 
x □ 


I -J uJ 
X 

x a 


it X a. UJ 

■r tu t- cx. 

x r □ 
o uj r t- 
x a x ai </) 

•x > h- □ x LU 

X -X MKLL 


t- UJ LL X I— ‘ 
X > i- — X , 
X X UJ — □ UJ 


X CO IX ■_< X in 


CL tt X I I I ' ' i 


_l H H : 

x :■ uj ' 

□ X 


■ □ □ a. n x cj x x : 


-I X X _J X 

' _j y- uj • :• > _i x x i j a. k uj 

'iuJhjDiXitiaiuht 

Ct X X *-H □ l LL LL i 


CO If 

• iL x ■. 


rf If' if if if if if' if' 


t-i rf 

•=• OJ 

UJ Cm iT. 


If If' <■£> 

•£' •£' '£' 


•=• UJ X 
ll‘.i rf CO 
— •=• U*' 
OJ rf 


rf — X 

rf *r co 

UJ •=• OJ 

OJ in 


u-. — >r 
rf *t co 
CO •=' OJ 
OJ U*< 


</) 

X 


' rf OJ 
■ O .X 
OJ 0"i 


:• uj cm co r - oj «- >t. 
:• r- >_■ oj cm i_i 


• *t If CO O' x l 


• i> '1. 'll ai • 


• rf •=' rf •=• 1-4 CO rf *f •=• If rf •=• o rf O y. •=• rf ■=■ UJ CO U"' UJ CO 

• OJ rf O If I OJ rt O U'l If' rf '=' rf OJ rf •=• rt OJ rf '=' rt OJ rf ■=■ rf rf rf rf If 

I If' U. lm If' «■* •=• l-( OJ rt i_i ■-• rf •=• |Z| rf rt •=' Cm CO rf O t=4 •=• O' O' If ' 

• rf rf OJ rf rf OJ If rf CO O OJ rf OJ O rf rf CU ■=' rf rf CO O OJ rf rf rf ■ 


U. L 

l=i rf rf O 0- h rf (J rf U0 L) If) O 

rt U~> If i rf OJ CO rf |fi CO rf rf rf rf rf 

X UJ CO X Ll rf O |f) O u* UJ CO <=■ rf O 

rf rf rf OJ rf rf O rf CO rf rf If CO CO If) CO 

co y« co rf uj cp co 0 * ■=• *-• o co O ' rf ir 

rf rf CO rf If rf O Iff |fi |f. rf If If If If) CO 

> )-4 Cm CO If' 'I P rf h O O CO UJ If CO •: 

> rf CO U" 1 OJ rf CO rf rf CO CO If' rf rf If < 


!' f-- tt w n|fi O'* Cm X 

. r - r _ r -. co co co co co c 
• CO CO CO CO CO CO CO CO CO c 


■0 '£• ■•£' •■£' ••£' •£' • 


• D • !' ' ll '.£) • !' ' 


I a . Cm CO f •- Cm Ll CO t - CO O '=' rf 0’.' CJ ® CO N CO X CO f -- Cm U. 0'' N 

i Cm Cu i j u U M m P M LU UJ UJ UJ Ll U. U. Ll Ll O O •=• ^ 

' CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO rf rf rf rf rf rf 

I 'Ll 'Ll • O 'll 'Ll ' Ll 'O ' 0 'Ll •£' •■£' '•£' 'Ll '-L' ' Ll 'O •■£• ' 0 ' 0 'Ll '-L' '0 ' 0 '.£> '.£) '■£' 


I X □ 

; uj i- 

I LL X 
I UJ h- 
X iJ X 

i )“• >y> 


H UJ l U >/.i t- Cx. Cx. 

I— ■■ X Ll )— UJ 

> LLl X OJ X LL LL f J 

Cm iXi I i/f Z) X 

CJ LL D X' Cm • ' a 


)- X 
< X t- 
Cm X 


. x uj i : 

: uj > h ii i. 

' _j □ uj __i : 

i x x- x i 


—' LU _L H rl Q. UJ K I- □ U. □ I h 

I X X + X X X X J— XX)— X 

. h '_"j □ h i uj □ h - ,=. X' >- — 

1 _• X J X II J □ X x — X Cm x 

I □ M X Cm 'I' I |_I I ' X " I' P « h ll 


□ 
X X 
X X 


I— LJ r— im i/f Cl 

n x x a »- □ -• i > x 

-iXhKUHXHih r- -f 'n X i- _ 

x 'j xx xx x x co x u. 

XXX • f— X X D (• h i- ll r-. iX X'»— 

1 Li; X X X X X X X X Z> *■ lD _1 Cm X 

X □ r-i <..■ ) i_i >-h t— i_i Cl X X' i-4 Cm u. •-< X CO X X 

)- a x )— x a x x x x □ i— x x x ■ • x 

x u-i xx x x □ t- j xx o x x •:> a z< 

' X LM » X X ' I I— 71 > h- r Cm r (- I “i X X 

i- a x □ > xx x •'!—<!- x i— u. a »- 

1 X I— I O C □ H X u. r-Ofl u. Cm X i— • ■') 

iwl □ □ X O )— X X . □ ll h- )— x 

I X r 1-4 1,0 |_. W h X □ J r II x U I- j x X CO r- )- x 


□ X Cj □ 

£. t- XX Cm h- 

•- t- C O XX h- I . 0 

□ XX XX XXX 

X CO X m. O '— 1 1 •> X 


co >r 

X X 
X X 


X X 

X 3 I- 

□ _ X 

X L-4 3' 

•X X □ 

CO X X 

,r • r 


X CO I J 

□ X X 


X X 
□ X 
• J X 


X CO z> CO 
X CO 

•x a □ x 


XXX 
□ - Cm 
»- □ X efr 


i CCi iX X X i 


H X 

□ CO 

> X X c 

:• X X 


IIXIIJ-IXZIXI 


I H h o I i 


X X X X X in i_' X h- Q CO 


H x X X N 
□ X 1-1 CO CO . 


» X r. r X X 
X I— X X Cm 


X CJ X X X C 


X > X X * 

'_' □ t- x : 


X 

• CO X N x 




' x '=' ? 9 z ^ -'CDll iiaboraxMii-wZ'DDDD 

' 1-1 ■' *. U m 1 X J X X □ ' h X X P m x I o x CO X □ X X X X 


Cm in _j _j z. _J 

1-MhJIJjMMXXt N hm JCt N 
— UJ > X- X O X X X •_) □ X X > > X X 
UlitXD J X J UJ M X □ x E '_' 1=1 “• 

J- 
X 


_ j _ - J X 
> x > X X 1=1 
I u E J o -J 


J J m X 'I J J 
X X X X X -I X 
_J __l —• X )•_' |_| 


• L' x UJ CO If •: 

•=• rf r _ oj u. •: 


OJ rf 1 / 

M U L 

OJ 


'J OJ OJ OJ OJ OJ OJ I'lJ OJ OJ 
V 'V '•£' •£' ••£' *•£' • £■ ■ £' '£' • £' 


CO rf 
UJ UJ 
•■•J OJ 


• cu co — r --1 
i i_i cu x r •- - 


OJ ■=• Cm U'i L 
' ’-i "-t Cm O'* UJ CO X Cm Cm Cm * 
iOU.ll CO Cm nj LJ C 


OJ OJ OJ I'lJ OJ 


UJ UJ X X 

OJ OJ OJ '-.J 

'•£. ' Ll '.£i ' £i '.£i • 


OJ CO rf l 
XXXI 
OJ oj nj 


'•£' • £• • £' ■ £' 


'.'J 00 UJ CO aj o AJ CO 

•£) •-£• 'JJ *.£i '£i '-£i *.£i .f, 

f- O ui no r. rt DO LU If CO X .Vi CiJ Cm U* y. 

H -r UJ UJ CO •=• X '=' =' Cm '=' Cm ■=■ X X 

Cm i_i f - CO UJ UJ M M CO UJ Q UJ n p ii I P n rf X m O 

CO h- Cm •_) •=• 00 X' •=• O CO O CO CO O CO .'.j j Cm >r 


• rt if I '.£• CO IwliJ *-< rf r - CO C 


'•£' ••£' • £• • £• ••£' ••£' 


'I w X r< rf y.i CO X Cm X OJ UO . 

OJ CO CO CO CO CO CO CO 00 ' 

CO CO CO CO CO CO CO CO CO CO CO CO ' 

’•£> •£' • £' •■£' '•£' • £' ••£' •■£' • £' '.£i •.£• ■ 


Number 26 

262 


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


Page 23 







HIGH SPEED CASSETTE I/O 

FOR THE KIM-1 


I 


BY THEODORE E. BRIDGE 

54 Williamsburg Dr. 
Springfield, MA 01108 


This high speed cassette tape handler will load or dump at 
12 times the speed of KIM-1 or twice the speed of the 
MICRO-ADE 1 Editor-Assembler. It replaces and overlays the 
editor routines CREAD and CWRITE at the end of the third 
4K block of memory (2EA9-3000). 

If you are not now using the MICRO-ADE 1 Editor- 
Assembler, you should consider it. I think it is well worth the 
$25 I paid for it. 

Stand-alone operation is permitted with this high speed 
tape handler. You may call it from any program as follows: 

20 A9 2E JMS CREAD Cassette Read 

20 54 2F JMS CWRITE Cassette Write 

If your program is to call CWRITE, be sure it first loads the 
starting and ending addresses as given on page 47 of the 
KIM -1 User Manual. This is just as if you were dumping with 
KIM-1 before starting at 1800. 

You can use these high speed routines to dump from the 
keypad. Load the addresses as with KIM-1, but instead of 
starting at address 1800, start at address 2F54. You can also 
load from keypad control. Instead of starting at 1873 with 
KIM -1, start at 2EA9. This loader will save starting and ending 
addresses ready for you to copy the file on cassette by starting 
at 2F54. 

Trade-offs 

You pay a price for the increased speed. When you use the 
MICRO-ADE editor, with its HYPERTAPE 2 tape dump, you 
need a better cassette recorder than you would with KIM-1. 
I have had good results with my Realistic 3 seventy dollar 
recorder. 

When you try to double the speed using these routines, you 
lose compatibility with KIM-1 and you lose the search capa¬ 
bility of the monitor. You always load the next program on 
the tape rather than hunt for the (ID) you want. You need a 
meter on your recorder so that you can position the read head 
just in front of the program you want to load. Also, you must 
keep a journal showing the cassette number and the meter 
reading for all data you record on tape. You really ought to do 
this anyway. 


Loss of the search capability is not altogether a disadvan¬ 
tage. If you have only one copy of a program on tape, a blip 
on the tape may prevent your loading with the MICRO-ADE 
loader. But with this high speed loader, even if you flag a 
checksum error, most of the program will probably load 
properly. I have found it helpful. Either way, you really need 
two cassette recorders: one for input, and another for output. 

You pay yet another price when you use these high speed 
routines during an assembly. When you load the object tape, 
it will reside at address 0200 where it was assembled instead of 
at the ORG address where it belongs. After loading, you must 
use the BLOCK MOVE command to put it in its proper loca¬ 
tion. After all units of your program have been properly 
relocated, you must perform a SAVE operation to get a usable 
object tape. 

Apart from making a quicker compilation when using these 
routines (even after relocating as described above), you can 
also recover more quickly from checksum errors encountered 
while reading the source tape during compilation. I have found 
them very convenient for general housekeeping as well as for 
compilation. 

Description 

These routines are similar to the MICRO-ADE HYPER¬ 
TAPE 2 routines that they replace. They simply gulp the entire 
8 bit byte at once instead of taking it in two nybbles. Thus, 
they go twice as fast. The CREAD routine cannot look for an 
end-of-data symbol (“/” = 2F) to terminate the load as this 
might appear anywhere in the data being loaded. Instead, it 
reads the start and end addresses at the beginning of the tape. 
It terminates the load when the loading address (VEB + 1,2) 
equals or exceeds the end address. At the end, the display is 
lit; so that you can see if a checksum error has occurred; and if 
you have the right ID. 

Since we are not loading ASCII characters, we lose the 
validity check on each character as is made in the HYPERTAPE 
program. We must depend on the checksum error to flag all 
errors. This has not been a problem for me. Actually, I think 
it is easier to recover from a checksum error when using these 


Pa 9 e 24 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 26 


263 





high speed routines than when using the HYPERTAPE 
routines. 

At the end of a tape load, this high speed loader will halt 
with the LED display showing: 

00F9 (ID) if there was no checksum error, and 
17F9 (ID) if there was a checksum error. 

You look to see if the ID is the one you want. If you depress 
(C = Continue) you will return to the calling program. If you 
depress (B = Bad tape) you will read the next program on tape. 
Of course, you can rewind to try again on the same data if you 
wish. The VU-TAPE 2 featured by Jim Butterfield is incorpor¬ 
ated in this high speed loader. With it you can see the loader 
lock on to the sync pulses when it starts to load. 

At the end of a tape dump, you will halt with the LED 
display lit. If you depress (C = Continue), you will return to 
the calling program. If you depress (B = Begin) you will load 
the next program on the input tape. If you depress (RS, AD, 
2F54, GO), you will dump another copy of the data to the 
output cassette. 

Remote program control of the cassette recorders is 
provided for in these high speed routines. I use the HELP 
RELAY PACKAGE 4 . Application pin 11 activates the input 
cassette, and pin 12 activates the output cassette. If you are 
not now using automatic tape control, you should consider it. 
Later, we will describe two patches: one to permit manual 
tape control, and another to slow down the speed if your 
cassette recorder can’t handle the high speed tapes. 

Tape problems are not to be taken lightly. I have adopted 
the following procedures to try to minimize these problems. 

1. Always rewind before ejecting a tape. 

2. Stop the recorder before removing remote control plug. 

3. Use short tapes. Short tapes can be obtained from 
PYRAMID DATA SYSTEMS 5 - five 10 minute tapes for 
$3.00, or five 20 minute tapes for $3.25. 

4. You need a medium quality cassette recorder. Robert 
Tripp 4 reports good success with Panasonic RQ212 DAS, 
and Radio Shack Realistic CTR 39 model 14-819. 

To load these high speed routines from cassette, you use 
the KIM-1 tape loader at 1873. Therefore, you must keep a 
copy on cassette in HYPERTAPE or KIM-1 format. I can 
furnish such a cassette for $4.00 or a paper tape for $2.00. 

Patches 

This patch for the Micro-Ade Assembler-Editor will link 
with the high speed routines: 

2E97 4C A9 2E JMPCREAD 

2E9A 4C 4F 2F JMPCWRITE 

This manual control patch will permit you to operate 
without relays for program control of the cassette recorder: 
2EA9 A9 1C LDAIM $1C 

2EAB 85 FB STAPOINTH 

2EAD 85 FA EA STA POINTL 

2EBO 20 24 2F JSR DISP 

On entering CREAD, this patch will display 1C1CXX on 
the LEDS to remind you to start the input cassette immediate¬ 


ly after you depress C to continue with the reading of the 
tape. 

At the end of the load, the CREAD routine will display: 
00F9 (ID) on the LEDs if there was no checksum error, and 
17F9 (ID) if there was a checksum error. At this time, you 
must remember to stop the input cassette before depressing C 
to continue, or B to reread the tape. 

On entering CWRITE, this patch will display OCOCXX to 
remind you to start the output cassette and to wait a few 
seconds before depressing C to continue with the dump: 

2F56 85 FB STA POINTH 

2F58 85 FA EA STA POINTL 

2F5B 20 24 2F JSR DISP 


Before leaving the CWRITE routine, this patch will display 
COFF on the LEDs to remind you to turn off the output 
cassette beofre depressing C to return to the calling program: 


2FA4 A9 CO 
2FA6 85 FB 
2FA8 A9 FF 
2FAA 85 FA 
2FAC 4C 24 2F 


LDAIM $CO 
STA POINTH 
LDAIM $FF 
STA POINTL 
JMP DISP 


A patch to lower the recording speed is given at the end of 
the listing. This patch is necessary only if your cassette record¬ 
er cannot handle the higher speed. 


Conclusion 


I think it is very worthwhile to speed up the tape opera¬ 
tions by use of these routines. I recently wrote a program to 
compare the dental record of a corpse with up to 60,000 
missing person records to seek a match. In writing this 
program, I was very conscious of the need for faster cassette 
reading. With these routines, it would take 4 hours to read 
60,000 records. With HYPERTAPE it would take eight hours. 
With the KIM-1 loader it would take 48 hours. 

In writing a program like this HIGH SPEED I/O, with only 
two overlays, the assembler reads the source tape twice to 
edit and twice to compile. Also it spends the same time to 
save a corrected copy, being equivalent to six reads. If we 
make ten corrections during the debugging, we would spend 
one hour for I/O using HYPERTAPE. 

Furthermore, it is very convenient to use these routines 
Stand-Alone. It is nice to do a little housekeeping without 
needing to fire up the teletype and the Assembler-Editor. 


Notes 

1. MICRO-ADE^^ for the 6502 —Assembler, Disassembler, Editor, 
by Peter F. Jennings. Micro-Ware Ltd., 27 Firstbrooke Road, 
Toronto, Ontario, Canada, M4E 2L2. 

2. The First Book of KIM, Hayden Book Co., Essex St., Rochelle Park, 
N.J. 07662. Cat. 5119-0. $9.00. 

3. Realistic^^ CTR-39, Model 14-819 by Radio Shack. 

4. HELP RELAY PACKAGE, the Computerist, P.O. Box 3, S. Chelms¬ 
ford, MA 01824. 

5. Pyramid Data Systems, 6 Terrace Ave., New Egypt, N.J. 08533. 


Number 26 

264 


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



Ul 

to 

V) 

Ul 

x 

Q 

Q 

X 


h 

P 


P 

Ul 

> 

x 

t— 

U) 

tO 


V) 

* 

u 

Ul 

X 

O H 


§ 

o " 5 

H Ul p 
X O 
Q o 2 

Q H 4-4 

X V) 


X 

Q 

Q Ul 
P to 


J w 
k— 


Ul 

H P 

£5 

H X 


H U 
>< W 
Ul X 
2 O 

H H 


0. 

< 

H 

« 2 
Ul 4-4 
0. * 

>* 

X 

x o 

2 o H Ul 
O H 
C X % H 
u, o s u 
o vi 


2 

H 

ft. 


2 

O 


_ 

II H 





uJ 

X 


Q 01 n vi 

< 

o 


Ul 





2 



x < 

o x 

X X 

X 

CM C/1 






X 


H H CO O 

X 

X 

u 

V) 



ul 

Ul 

O 

u 


X V) 

> 

CD 0 

Ul 

H X 



u> 

X 

t- 

X 


<C X H Z 

X 

< & 2 

X 

UH O 


>* 

2 

x 


X 


Q *-i p-* O 

X X 

X O O H 

o 

w 

Q 

Ul 

•-« 

H 

k— 

o 


< X X 

<X D 

X H D 


X 

2 

X 

H 


2 



2 


2 X 

Q 

H O 


H 

2 

P 

M 



V) X (- X 

CO H 

H P E H 

2 

UJ t— 

O 

Ml 

O 

X 

O 

— 

CM 

<C X X p 

X X 

X X P D 

X 

VI V) 

VI 

o 

u> 

X 

X 

ca 

ca 

U vi i/i h 

X X 

VI i/l H O 








+ 

+ 

X 







P 


X 




h 






X 












X 







2 


H 




X H 



X 

H 

H 

H 




H 

(M 


(M 

O' 

<C 





Q 


X 



•7 

< 



*-4 


X 


P 


0 > x 

t— 


> 

Q 

X 

X X 


X 


2 

<a 


<s 


sO 




X 

< 

H 

> 



CM 

X 



H 

CO 

o 

X 

<t 

P X 

H O 

X 

X 

o 

< 

o 

X X o 


X 

X 




c- 

X 

X 

u 

2 

X 

V) 

X 

H 

o 

« X 

X X 

<i ^ 

CM 


X 

& 

p 


O 

CO X 

2 X 

X 

X 

2 

X 

Q 

X O P 


X 

Q 

O 

—• 

ca 




GJ 


<a 

M 

X 

2 

2 

x <2 

x 2 



vO 

Q 

o 

*/> 

X 

VI 

X 

V) > 

*-1 X 

o 

> 


X 

X 

O <t X 


o 

<n 

X 


to 

V) 

VI 

u) 

VI 

P 

VI 

Q 

o 

»—i 


> X 

> X 

VI 

V) 

VI 

M 

X 

2 




V 













2 




2 


2 











H 



Nil 





















H 









N 


D 

X 

X 

<C 

K -J 

<1 <C X X 

X 

X 

X 

o 

X 

XXX 

o 

o 

X 

<c 

<5 

< <c 

X 

X 

X 

CJ 

X 

X 

X 

X 

X 

<C X 

<0 10 

X 

<5 to 

< 

<5 

X 

X 

V) 

k- 

X X 

P H 

to VI 

V) 

to 

to 

o 

Vl 

2 2 X 

X X 

2 

H 

P 

X 

H 

to 

VI 

s 

X 

2 


2 

s CO 

x s 

Q X H 

X 

P H 

p 

H 

H 

X 

"0 V) 

P X 

X V) 

"0 *0 

•o 


"0 

X 

*0 

□ a -d 


VI 

X 

CO 

X 

o 

CO 

*0 

"0 

o 

X 

O 

a 

*0 

*0 

"3 

X O 

xxx 


X x 

X 

X 

X 


P 

< 

Q 

X 

o 

J 


Q 

3 

X 


Q 

X 

Q 


X 

§ 


ft. 

to 


UJ 

> 

|2 
Q 4-4 


H 

X 

O 

Q 

X 


Ul 

H 


to 


m 

to cm ui co 

<a <a :> u> q 
uc-c-r'QmH^zU.f^ 
<a — u, — <tU2w3tQ- 

2 2 £ 2 2 
Sxqxxxkxxxx 

QHZHQHtoQHQfr- 
jvi<m JWO Jin JW) 

ui 

h 


Sfc§ 


X 




c- 

O' x 

o 

c- 

X 


X 

r- 


X 




c- 


X 

X 





X 

X 

O' 

7 

7 


r- 


<31 

c- 



r- 




C" 


c- 

O' 




r- 

CM 

— 



— 

— CM 

— 

— 

CM 


CM 



tM 




“• 

— 

— 

*- 





CM 

”• 

— 

— -« 


— 



— 







— 


— 

— 





X CO 

Vl 


r- 

P o 

CM CO 

o 

o 

CO 

CM 

CO 

c- 

X 

CO 



CM 

X cm q 

CM 

O' 

< O 

r- X 

CM 

O' 

o 


P c~ 

X 



q 

<C 


CM 

O' 



O CO 

r- 

CM P O 

CM 


ca 

X 

co 

ca <r 

X 


X 

CO X 

CO 

■51 

X 

CO 

X 

q 1 

X 

Ca 

q 


X 

ca 

x ca ca 

ca 


MO 

ca 

ca 

ca 

X 

< 

X 

X 

X X 

X 

X 


CM 

X 


MO 

X 



ca 

ca 

X 

ca < X co 

CM 

X 

X 

q 

cm ca 

P 

<C ca 

O' Q 

ca ca 

ca 

ca 

ca 

G> 

ca 

Q 

ca 

ca 

co 

p 

ca 

X Q O' 

Q 

ca 

ca 

O' 

ca 

O' 

ca 

o 

CJ 

ca 

P Q 

Q 

Q 

ca 

ca 

p 

ca 

m 

Q 



O' 

Q 

O' 

Q O' p 

5) 

O' 

in 

O' 

p 

<a; cm 

O' 

u 

— 

<t CO 

CM CM 

CM 

CM 

CM 

O' 

CM 

U 

p 

X 

CO 

X 

p 

co <t ca 

X 

CM 

CM 

CJ 

X 

o Q 

q 

q 

CM 

< o 

<31 

X 

MO 

CM 

< MO 

<31 

CO 



<31 

CO 

CM 

CO < CO 

CM 

< CO <t CO 

as 

p 

ca 


co in 


X 



r- 


CJ 

X 


q 

in 

co 

A 

C 

F 


q 

r- 

<S o 

X 

ca 

CM 

X 

CO 

X X 

_ 

q 

c- 

co X 

X 

X 




q 

M> 

O' 

X X ca co 

MO 

co 

< o 

X 

u. 

X 

X X 

X X 

X 

ca 

ca 

ca 

ca 

<a 

ca 


— 




CM 

CM 

CM 

CM 

X 

CM 

co 

co 

CO 

CO 

CO CO 

q 

q 

q 

q 

q 

q 

q 

in 



in 

in 

V) 

in m mo 

MO 

MO 

M) 

M> 

MO 

XXX 

X 

X 

X X 

X X 

X 

X 

X 

X 

X 

X 

X 

X X 

X 

X 

XXX 

X 

X 

X 

X 

X 

X 

u. 

X 

X 

X 

X X 

X 

X 

X 

X 

X 

X 

X 

X 



X 

X 

X 

XXX 

X 

X 

X 

X 

X 

CM CM 

CM 

CM 

CM 

X CM 

CM CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM CM tM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

X CM 

CM 

CM 

CM 

CM 

C\J 

CM 

CM 

CM 



CM 

CM 

CM 

CM CM CM 

CM 

CM 

CM 

CM 

CM 

<s ca 

ca 

ca 

ca 

ca ca 

ca ca 

ca 

ca 

ca 

<a 

ca 

ca 

ca 

ca 

ca 

ca 

ca 

ca ca ca 

ca 

ca 

ca 

ca 

GO 

ca 

ca 

ca 

ca 

ca 

ca ca 

ca 

ca 

ca 

ca 

ca 

ca 

ca 

ca co 

ca 

ca 

G> 

ca 

ca 

ca ca ca 

ca 

ca 

ca 

SI 

ca 

f» co 

O' 

Ca 


CM co 

<7 uo 

'O 

c- 

co 

O' 

ca 


CM CO 

q 

Vi 

MO 

C" CD O' 

ca 

—« 

CM 

co 

q 

V) 

MO 

c- 

co 

O' 

ca — 

CM 

CO 

q 

v> 

MO 

c- 

co 

O' II 

—• 

CM 

MO 

r- 

co 

O' ca - 

CM 

ro 

q 

in 

MO 



8 

8 


e- 

<a 

S £ ^ & £ 6 s 

8 

8 

8 

8 

8 

8 

8 

8 

COQ'CC'O'ONQ'Q'ttG'C'Q'X 

BcsSSISiIsSqSqSh 

g 

g 

S 

8 

g 

@ ca ca 


5 

S 

s 

ca 


2 - 

o r 


x c 

4-> | 


r x 

C -V 


ul 

P 


J 

o 


J 

.. o 
*-• N. 


i X . !-• 
P O H 
s, O UJ 


>■ I 
O i 

J 


J P UJ , 

4*J «.J — ■ 

X -• •- •» i 


i.Q U C_ 

i .-4 I-. U, I 

*** O' P tv 1 * 

1 —• -• vjJ la ca 

1 to) ;■) ul u’) vl 


l CO q Ul «o, 
i m U, »t 


P VJ 
X Ca 

p x 

ia —• 
VI -) 


tVl —• Ui 

q q x 
X t" 


M> CO O' O CM X CJ 
X Ui U. X CO CO i*J UJ 


i td w w 


lo ******** 


c -M m o 
u - :A 


r oOi 

OhHI 
o t_> _j i 
2 O I 


X fr ' 
o o 


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


Z) 













U 







u 






i- 



2 



— 







s: 







< 









t—4 





X 



t— 









X 






o 



u. 



>- 


p 



X 









X 












Nt 


X 



o 


















z 



P 


>-•4 



X 


< 4 . 

O 






do 









o 



X 


M 






7 




0 - 



P 





CJ 



4-4 



u) 


P 



l • 



X 






p 

UJ 

< 







1-* 



n 





x 


<£ 

0 




O 



p 

H 




II 



<il 



p 


2 



X 







•7 

u 

p 


< 

p 






u 





►-4 



;•» 


H 

0 



u 


17 

X 

2 

P 

2 






1-4 








4—4 


4—1 

H 



p 

V) 

4 —. 


O 






l«l 


P 



t-. 







X 

2 



p 


>* 



X 

>- 

p 





P 



o 





■7 



4-4 




< 

u. 

P 

>- 

O 

X 

4—4 

t- 

►—4 

t • 


ft. 



1-4 


o 



0 


0. 




—» 


H 

•p 

C 


H 




UJ 


Nil 



l- 








*- 



0 

H 


>' 

P 

t- 





VI 





p 





*7 


X 

X 




4-t 

X 

Vi 

X 

X 

X 

p 

P 

l- 

t J 


CM 





> i 



X 


X 

4-4 





X 


vo 

Nil 

P 

<C 

> 

oJ 



. 4 



X 


P 



P 


p 

X 



X 

vo 

p 

7 

4_, 

H 

P 

P 


Vi 

o 


X 





H 



H 


X 

VI 



X 

-• 


X 

P 

VI 


X 

VI 






P 






















CO 


CJ 


H 




—• 




H 




ca 



H 

P 






Csi 


CJ 


■7 


T* 


q 




4-4 

P 

O 

u 

q 


U 

PI 

q 





u 


UJ 

l" 


t—i 


.—t 

X 



co 

p 

p 

V 

*T» 

r» 

r~ 

MO 

>-» 

6 

c- 

<C 

H 

p 


tie 

—• 

X 

—• 

X 

o 


o 

c- 



—• 

Ul 

p 


X 

Nil 

—» 


>• 

p 


CM 

Vi 

p 

p 

ul 

11 

Vl 

tl 

m 

X 


X 

V) 

VI 


VI 

Ul 

X 

O 

u 

O 

V) 

vl 

VO 

u. 

VI 

to) 

*■- 

X 

*-* 

2! 


:: 


2 


X 


2 



2 







2 




V 












•—i 



4-4 















</, 

< 

u 

■U 

x 

'-u 

Ni. 

X 

•Ml 

■Ml 

U4 

X 

<C X 

X 

< 

X 

X 

X 

p 

X 


X 

P 

X 

<t 

P 

H 

-• 

t— 

p 

H 

4-1 

e- 

P 

H 

P 

p 

H 

VO 

VI 

U. 


H 

2 

2 

VO 


»— 

*7 

VI 

X 

X 


•u 

V) 

P 

t-1 

P Vi 

P 

VI 

U 

p 

VI 

~0 

P 

O 

VI 

VI 

U 

Ui 

•O 

Vi 

G 

X 

~0 

Vi 


i 3 : 

b't- 


l- 3> 3» 


X C.- 

r r_ >, 


ON O' I 
p ^ . 


0 

p 

P 

1 - 

4—4 

4-4 

4-4 

p 

P 

4-1 

P X 

p 

*r* 


_ 


P 

X 

X 


















fr- 









4-4 

0 


77 

4_ 

O 

0 

X 

P 

p 

X 

X 


X 

P 

—» 

— 


p 




























l- 

p 

X 

p 

H 

X 

X 

X 

VI 

X 

VI 

VJ 

p 



t—4 


- 

Z> 

0 













1 1 





H 





























C- 


C" 






r- 




X 




C- 



X 

C- 



X 

r- 






















■“* 








-• 



— 





— 



CM 

-* 



CM 

— 





















0 

to 

U4 

cM 

O' 

X 

C" 

X 

X 



CO 

CM 


p 

O 

P 

ca 

M) 

U 


u 

X 

CM 
























p 

X 

it- 

X 

u. 


X 

r- 

q 



q 

q 

X 

X 

X 

q 

— 

X 

q 

q 

CM 

X 

q 

p 

X 




















0 

p 

O' 

P 

O' 

Vr 

O' 

V; 

O' 

p 

CO 

O' 

p 

x 

Mi 

Ui 

in 

p 

O' 

Cu 

p 

p 


ca 

ca 

p 

V) 




















X 

co 

to 

CO 

X 

CO 

X 

CO 

X 

co 

P 

X 

co 

cu 

q 

X 

co 

CO 

O 

P 

CM 

co 

CJ 

p 

CM 

co 

CO 

O' 

O' 

O' 

0 

O' 

O' 

O' 

o- 

c. 

O' 

O' 

O' 

O' 

O' 

o> 

O' 

O' 

O' 

O' 

O' 

p 

14 

P 

Cl 

Ui 


O' 

vl 

p 

ca 

_ 

CO 

VO 


X 

P 

X 

CM 

q 

M> 


O 

p 

ca 

CO 

M> 

X 

X 

X 




X 

X 

X 

X 

X 

X 

X 

X 

X 

X 


X 


X 

X 

X 

. I 

UJ 

p 

ft. 

X 

P 

p 

u 

u 

0 

0 

0 

0 

0 

0 

P 

u 

P 

p 

P 

P 

p 

p 

P 


P 

X 


P 


U4 

P 

p 

p 

p 

4 1 

p 

ul 

X 

p 

p 

p 

p 

p 

p 

P 

P 

p 

p 

UJ 

p 

P 

X 

p 

UJ 

p 

p 

p 

p 

p 

p 

P 

p 

P 

p 

P 

p 

P 

p 

P 

V\J 


kVi 

CJ 





CJ 

t\J 

cJ 

CvJ 

tM 

CM 

CM 

CM 

tM 

tM 

CM 

CM 

tvJ 

CM 

CM 

CJ 

CJ 

CM 

CM 

tM 

CM 

CM 

CM 

CM 

CJ 

CM 

CM 

CM 

Cm 

CM 

CM 

CM 

CM 

CM 

OJ 

CM 

CM 

CJ 


«• >.-M — 

X X X W. 


C, o 

V.V. l J *■ 


ix o.l. U U U c 
Lf) M) C" CO O' ta 


ol Csi O. U U i 


UcJGWUuUtiu^CjlWUlCiiiiiC^CiJCjCilU’GtjGlCi 


0 "ii -- '\l CW U‘; <JJ OLi O' c-i — CJ CO C Vi \D r- CO O'- X — CM co n Ui ^ C' CO O' CJ - Oi O Cf in NO C- C 1 J O' W O <f Ifi 'll 

U « OJ fl CJ w w CM 04 tv. CM Cw CO O CJ CO CO O l‘J U O O <1 >J •C Cf <1 ^ C C C tfl u» ifj if) Ul l/) l/) 

-it'lv..y<sj^v>fciu.Llui^>OtJut.ti{Jt.Otiicii v- bi v^ Cj M O O CJ Ck u SI tJ Cj M S S S a S L j CO B i^i ^ 


Page 26 


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


Number 26 

265 














>> I 
X) c 


*o 










oj in 

d- 

O' 

<T 


N] 







aj m 

UJ 

<j: 

CU 

Ui 

2; 







CL 

f- 

UJ 

x 

UJ 








in 0 

_s 

CVJ 

CM 

< 

ta 







Ll. 




0 

ca 







OJ u_ 





<T 







U Pd 


X 


2 

CVJ 



2 




3 

J 


X 

_ 




!_« 

0 

CVJ 


"O 


UJ 

UJ 


O 



VJ 

ca 


CM 

0 ) T) 

X 

x 


H 

H 

UJ 

UJ 





M C 

0 

0 

X 

H 


Z-i 

2 





ra 




UJ 

X 

2 

6 


nO 

O' 


0 





O 


Q 


<a 

fci 


-L 




H 

H 

H 






03 




U> 

H 

2 

X 





T» Li_ 

oj 

OJ 

■y 

X 

Z* 

O 

J 


OJ 

•y 

ID 

d' u_ 

UJ 

x 

m 


oj 

O 

H 


ts» 

ta 

* 

dj rvj 

d- 

ca 

x 




H 




CO 

c 

— 

0 

OJ 


x x 
u, <j; co 

C' X UJ 
-* CVJ — 


H 

JUh 

X 2 


CO — X 
X X X 
X O' 
— OJ — 


UOUOWtgC: 
U. u M', n. k X 
k k k k ui k 

CU — CU CVJ CU Vi. C\J 


4 — Q 

J ” \ H M i-K 
k) U 1 - J H h " 

k <1 kJ o u k 6 

2 X X k-s L'if- K1 


O' X X X CVJ 

<; U n k <T 

UJ x ui X t> 

CVJ CO —• C\i — 


o x 
X X 
l, r» 
CVJ — 


UJ 


UJ to 

-k t— 
tc UJ 
H UJ 


2 Si 2 5 
Ot-OOK 


o n k , 
I o ca r* 1 


uJ -J 4- 4-* 

i— 4- k x s. h 

X 2 O o U k u 

^XL_:roo_H4-*c:x 

X O • ' - * ' • • — • 


O X I 

uJ Ul 
Q Hi 1 



ts] 

w 

to 

0 

H 


UJ 

J 

tr| 

W tr) 

W 

u w 
>) TJ 



0 

0 

O 

Ul 

X 


2 

0 

u. 

u. 

i/| 

H 




s 









TJ 

OJ 
















X 







u 




CJ 

40 
















IX 

O 

? 

X 

0 

UJ 

CfJ 

< 




j. 
















in 

U 

Q 

UJ 

UJ 

2: 

H 

H 




4 -> 

OJ 



0 


U> 

If/ 

ca 

co 

<U 

la 

< 

CO 

UO 

—. 

OJ 

X 

UJ 

X 

X 

Q 

Q 

CU 


II 

II II 

» II 

I- 



—« 

u. 

CM 

CO 

U, 

0 

Ui 

< 

l*. 


u 

u. 

►a 








O 



in 

M 



u, 

ca 

UJ 

u. 

O 

u. 

w 

UJ 

va 

u. 

f' 

va 

UJ 








2 




in 

dJ 

• 

UJ 

CVl 

ca 

— • 

CM 

ca 

CM 

CM 

— 

ca cm 

—• 

va 

vu 








»-« 




ro 

JD 

0) 
















M 


4 -* 




J 

CJ 


u 

E 

c 

co 







Q 


J 







H 


2> 



H 

D 

2 

2 

3 

•H 

— • 






UJ 

c; 

X 

1- 

h 






UJ 


O 



t- 

CU 

«—* 

*—1 

k 

C 

H 

0 



u. 


0 

:> 

Q 

0 

2 

X 






CO 


CU 




2 

H 

a: 

CU 




« 

h 

-J 

2 2 

0 

<£ H 

»-* 

O 

J 

0 1- 











\ 

n. 

u 

CJ 

CJ 

0 

2 

Ul 

_*• 

<5 

2 

0 

D 

O 

UI 

< 

M 

UJ 











in 

(L 

(U 

> 

ca 

<C 

U 

0 

Q 

0 

M 

J 

O 

CU 

C-. 

CO 

H 

4 — 


in oj o> o 1 


UJ 

m 

r~ 



ca 

ca 

CVJ 

CO 








O 

(U IU 
-1 UJ 






U« 

ta 

ca 


u 

ta 

u 

u. 

0 







►—k 

n 

c JO 

L) 

u. 

NO 

O' 
















t— 


ro *h UJ 

U. 

^J - 

<r 


ta 

NO 

ca 

ia 

<C ca 

ta 

ca 

M) 

ca 

ca 


CM 

CO 

co 

UI 


cr 

v£ ta 


u. 

u. 

u. 

0 

u. 

co 

•q 1 

O' < 

u. 

u 

u 

nO 


ca 

0 

ta 

t^ 

tr 

c 

CPTD H 

Ca 


CU 

CU 

CU 


UJ 















•H 

C (U 






O' 

Q 

U. 

ca 

CVJ 


NO 

CO 

<C 


« 

0 

Q 

UJ 

a 

in 

•H 4 -> _J 






UJ 

UJ 

UJ 

UJ 

u. 

lu 

u. 

u. 

u. 

u. 


u 

u. 

u. 

u. 

UJ 

3 

T 3 n 0 



UJ 


UJ 

u. 

u. 

U, 

u. 

u. 

u. 

u. 

u. 

lu 

u. 


u. 

u. 

u. 

u. 

UJ 


D u B 




tx 


CM 

CM 

CVJ 

CM 

CM 

CM 

cvj 

CVJ 

CVJ 

CU 


CU 

CM 

CU 

CU 

U_ 

4- 

O *H 2 ? 

U 

X 


2 

u 
















in 

—* 

H *D Jh 
C ‘ 

O 

X 

u: 

h 

s 

ta 

<a 

ca 

G) 

ca 

ca 

ca 

«a 

ta 

ca 

ia 

ca 

ca 

ta 

ta 





“ 

" 



co 

<7 in 

NO 

c- 

CO 

O' 

ca 

—• 

CM 

CO 

<7 

in 


O' 

11 








6 

t^- 

ta 

L) Q 

ca 

t" 

ca 

t- 

ta 

s 

s 

e 

8 

8 

8 

8 

8 

6 

H 


h 

1 







BOS 

UJhHh 

> i-i 2 h O 

^ZDo^^ko 
h h o x u: in o'j h to 






2 





UJ 


























CO 





ex 















CM 











t -4 





m: 















^s 











UJ 





H 























CO 












UJ 



















tu 



< 





2 




4 — 










II 

Cs 

U. 







<C 



H 





6 













UJ 


Us 

O 







X 



< 









Ui 









4 - 

OJ 


4 — 







u 



Ui 





u 













4 -* 


2 
















k—4 




H 









kX 

4 — 

O 

2 







u 



U. 









2 


X) 







in 

H 

k-k 

O 










O 





-a 




oJ 


UJ 







Ui 

.J 

H 








>• 












2 









<x 


X 








00 



t- 





• 


u 











vj 

O 

0 

O 










U 





ul 


H 


O 


0 





UJ 



—» 

, , 

4 - 







ca 








UJ 


>- 

UJ 

H 


ul 





Us 


Us 


y 








<r 



H 





UJ 


t 4 

2 








< 


Us 

Sr* 

Us 

2 







CU 



UJ 





<A 



tx 

t— 


(J 




CM 

X 


o 

4 — 

U, 

Ls 


















in 

2 







0 



ul 

X 

X) 

ul 






UJ 



UJ 





H 




k-r 


u 




Ul 



2 

UJ 


H 

tx 






2 



2 





X< 


t- 

Q 

O 


2 




—r 

h 


l * 


0 J 

uJ 

X 






UJ 



ul 





tx 


U 1 

r? 

tx 


S 




CU 

O 



>s 

u. 

Ui 

H 






uo 



in 







10 

•3 



O'j 




UJ 

UJ 


r 

uJ 

Us 

































O 










H 



fr- 




0 


<j; 


h 


4 - 








t" 



4 - 







X 



X 


u 


H 

w 

4 — 




X 




CM 


CJ 


Ul 



X 







O 



O 


<c 


Ul 

> 

c. 

J 

O 

X 

0 




V J 


L_ 


u. 



O 



ca 

M) 

0 

<Z h* 

<x 

•A 

H 


t- 

UJ 

t— 

0 

2 

•r 4 

h 

X H 

CU 


O 

l" 

CO 

o- (X 


O 


4 - 


O 

u. 


H 

CM 


ca 

< 

D 


X) 

UJ 

u> 

2 

*—* 

X 

Xj 

X J 

Cv 

ca 


s-S 


—s 

l/) 

h 

t , 





*n 


X 


0 

tn 

in 

O 


IX 

> 

0 

k—r 

UJ 

O 

O 

0 

0 

vj 

in 

x 

tl 

.1 

b) 


O 

H 


O 


4 - 

























Q 

NS. 







v 


2 


2 

>•; 












»■; 

2 



2 



u. 






*-H 

*-• 


►H 


►-» 

<5 












k-t 




k-k 



X 






X 


lU 

<1 IX 

X 

< 

IX 

>i 

y u; 

tx 

u: 

0 <c 

tX 

<c 

Us 

2 

c: 

iX 

< 

•X 

X 

U 

X 

» s 

X u. 

X 

O 

u 

Q 

OJ 

UJ 

U) 

u 

UJ 

U) 

UJ 

tx 

in 

UJ 

UJ 

0 

UJ 

UJ 

UJ 

OJ 

UJ 

Q 

in 

UJ 

ui 

E* 


0 

H 

X. 

in 

J 

LJ 

J 

J 

T> 

J 


J 

J 

"O 

Q 

UJ 

•o 

•O 

"0 

UJ 

J 

T> 

J 

n 

-J 

J 



0 

01 

T) 


U/ 

u. 

*0 

u. 

Ul 










































< 



























0 




H 















Q 












<C 




tx 

















X 










H 




2 
















O 

0 










X) 




y 















Oi 

, t 











IX 




u 
















X 

X 






u. 


u, 


r- 

U, 




u. 

u. 


l- 

U, 

c- 

U, 



Cs 

o- 


0- 

Us 




u. 





CU 


CU 



CU 



— 

CM 

CM 


— 

CM 

— 

CU 



Cw 

— 


— 

CVJ 




Cvs 



ta 

vO 

u< 

< UI 

<T 

in 

UJ 


f- 

0 

Ul 

CO 

n 

r~ 

UJ 

CO 

y 

CU 

■cr 

Us 

CU 

CO 

CU ^ 


_ 


U-l 



U* 

“* 

<L CU 

BJ 

ca 

u> 

Ul 


u. 

UJ 

U) 

CO 

u. 

UJ 

UJ 

UJ 

UJ 

ta 

Cm 

x; 

Cm 

Cm 

ca 

IN/ 


IL 


Ul 


u. 

CU 

O' 

<a 

O' 

ta 

CM 

UJ 

Ui 

<1 

ta 

ca 

ca 

ca 

Cm 

CJ 

ca 

UJ 

ca 

CU 

O' 

va 

U 

o> 

y 

U 


UJ 

CO 

Cm 

to 

UJ 

C 

<1 CM 

C 

CU 

<C 

ul 

CU 

O 


CU 

CM 

CM 

O' 

< 

CM 

vX CU 

X. 


CM 


ca 

co 

■c/ 


00 

•cr 

CVi 

UJ 

0 

u, 

— 

co 

vO 

co 

tu 

UJ 

ta 

CO 


NO 

0 

0 

u. 


<J 

£- 

< ul 

Us 


■sT 

0~; 

O' 

0 


u. 


CU 

Ul 

0 

vO 


t- 

c- 

c- 

r- 

r~ 

co 

CO 

CO 

co 

CO 

CO 

CO 

O' 

O' 

O' 

O' 

O' 

O' 

< 


•X 

X 

X. 


X 

LJ 

»-s 

1 

k -4 

u. 

u. 

u. 

u. 

u. 

u. 

u. 

lu 

u. 

u. 

u. 

u. 

u. 

Us 

u. 

Us 

u. 

Us 

u. 

Us 

Us 

l ' 

u. 

Us 

U, 


Us 

Us 

Us 

Us 

Ls 

CM 

CU 

CM 

CM 

CM 

CM 

CM 

CU 

CU 

CU 

CM 

CM 

CU 

CM 

CM 

CU 

CU 

CM 

CM 

CM 

0 J 

C'- 

CM 

CU 

CU 


CM 

CU 

CU 

CM 

CU 


x 









Us 




v-s 



X 

















LJ 


l_s 


X 




















X 


0 

u. 

H 


Li 

X 













a'* 






*•• 


2 


X 

0 

















VM 


X 


X 


4 - 




X 










UJ 




la 


-3 

3: 

O 

• 

X 

X 


ts 

UJ 

ui 









Vj* 


4 -* 


U) 


—> 


O 

X 

X 

—> 


ia 

X 

4 • 




X 





0 


2 


i 0 



X 


X 

Li 

l! 



X 

X 




p 





Ul 


X 




—) 

0 

2 

X 

X 




X 

4 - 

4 - 



b 





X 


O 


4 - 


O 


k-s 


X 

L 


H 


UJ 

X 



X 

.4 




CJ 


O 


X 


CJ 

• 


X 

u 

0 



Ui 


L. 




—> 










X 

0 

Ul 

X 


X 


X 

*—k 

UJ 

H 



4^ 

S-S 




• 

ul 

4 - 


H 



2 

X 

0 

tu 



X 

Ls 

X 

X 



0 





0 

4 — 

•—1 


U a 


LS 


X 

t— 

> 

H 



l- 

«r 

0 

H 



4 — 




-J >* 

mJ 


X 


Z> 

4 - 

u> 

Ul 

X 

t —1 


4 - 


'-S 


X 







'Ss 

Ul 



t- 


X 

X 

>- 

X 

LJ 

X 


X 

X 

X 

X 

0 


X 

b 




0 


to 


U) 


Ui 

X 

C_J 

X 


X 


UJ 

0 

0 

0 

X 



X 





4 - 













X 

































2 


ul 






















i-J 




4 - 








r- 



X 



CU 




X 


UJ 

4 - 

CO 




tu 


rJ 




>r 

X 

X 

<? 

X 


y 

X 


X 

O 


2 

X 


CJ 

►J 

CM 

k-k 

O 


4 -« 

X 


c- 


2 

r- 

-» 



• 7 * 

4 * 


k-k 


O 

X 

UJ 

0 

O 

ia 

Us 

O 

X 

2 

X 


—s 

b 

13 

s-S 

<3 

CO 

—s 

u; 


b 



UJ 

X 

0 

S 


O 

v> 

4 — 

X 


O 

X 


l/J 

*0 

4 — 

X 

X 

vJ 

If) 

X 

X 

M 



O 


ifi 

2 


2 



>* 






>: 



2 










us 

NJ 

k-s 



X 






X 



>_S 





lJ 

Ul 

X 

Us 

0 >- 

>s 


>- 

X 

X 

X 

X 

X I-* 

X 

X 

X 

X 

X 

N-C 

X 

O 

X 

f -« 

4 - 

Sr' 

CJ 

4 - 

Ul 

4 - 

U) 

H 

4 — 

X 

H 

Ul 

X 

HH 

X 

X 

4 -- 

X 

Q 

4 - 

(• 

X 

—> 

UJ 

tx 

»—« 

"O 


-J 

C| 

-J 

UJ 

UJ 

J 

Ul 

X 

X 

L 4 

Ll 

X 

Ui 

X 

X 

U 1 

CJ 

X 

a 



X* 


X 























0 

2 

H 





















UJ 

4 — 

H 

X 





















2 

k-l 

H 

O 









X 












lJ 

4 — 

2 

4 — 


>• 


2 

















UJ 

i-» 

O 

X) 


u. 


O 





6 













O 

u. 

O 


H 


Nl 





M 













O' 







Ls 




r~ 


X 

c- 



c- 














CJ 




— 


CU 

— 



— 







0 


CO 

CU 

CU 

UJ 

O 

X 

<r 

VJ 


r- 

X 

X 

•y 

CJ 

t) 

CU 

va 

>r 

CJ 

Us 



>r 


Ca 

X 

Ca 

X 

X 

X 

X 

X 


if 

X 

X 

ir 

X 

VV 

■y 

Us 

Ls 

X 

va 

ca 


ca 


la 


va 

>r 

in 

O' 

jj 

%n 

0 

X 

va 

O' 

X 

u> 

O 

X 

in 

'O 

X 

u 

0 


CU 


X 

CO 

X 

CO 

co 

-1 

CO 

< 


vU 

— 

.J 

w 

X 

y 

co 

co 

O 

X 

CO 

X 


LI 


LJ 

ca 

CU 

*v 

0 

C“ 

.4 

X 

X 


v J 

Jj 

Dj 


Ll 

L. 

tu 

<r 

X 

LI 

n 


Ul 


»-j 

0 

0 

O 

u 

0 

O 

X 

X 

UJ 

^i 

*.-1 

X 

X 

LJ 

k-J 

X 


X 

Us 

U, 


X 


X 

Ls 

Ls 

u. 

X 

X 

X 

X 

Us 

X 

ku 

l.-. 

X 

X 


X 

X 

X 

X 

cJ 

CU 


CU 


CJ 

cU 

CU 

CU 

CU 

cU 

tu 

CU 

OJ 

CU 

OJ 

Cd 

CU 

CJ 

CU 

tu 

CU 

tu 

cU 


Qca<aasjcaieii(S)Gc s icsJcatsiciJtacbJtutajc2Ciiviii A .^vic. i k-jc.iiiciikiJciwNii^Cit>c>iC J JvijGiCuc*iu^ 

co o cvj r> <7 i/j o r- co O' t-j — cvj co <r in no co O' — cvj cn o’ u; o c- w O' — cu to >1 u) no r- (vj n\ 

— r? r* & & £4 ^ <y CVJ CU CVJ i*> co co CO CO O 10 co - - •- -- - - - - G ^ 

Q O O (3 K O Q O O W ki CJ Q ^ (J Ci C.' Gi O l-i f - cd ic .j n Nj i? . ' , 


L U li ui a ti G >J k’ 


ii C CJ u O vi' k.' c. 01 wi k O 

. - - -- - v . _ -• CVJ C> -y U) VO cx> o X -• CVi 

5* jf ^ i 0 4Q in in in in uj in in in uj »n vo vo o O so uj vC vn r- d- t" 

C! .V u G O Ll k il O vi t:l til 55 Cl X ci w k U l: t o v. v.4 


Number 26 

266 


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


Page 27 





THE ZILOG Z-8 


BY U. R. SOURCE 


Zilog’s New Z-8 is the first of a new generation of single- 
chip microcomputers. It is also capable of being used as an 
8-bit microprocessor which can address up to 128K bytes of 
external memory. The architecture of the chip is such that 
under software control, it can be given a variety of different 
I/O and memory configurations, the most important of which 
are: a) an I/O intensive single-chip microcomputer and b) a 
memory intensive microprocessor with up to 64K bytes of 
data and 64K bytes of program memory. Such flexibility is 
made possible by merging the multiplexed data/address bus 
(and the associated control signals) with the I/O-oriented 
ports. Thus external memory can be addressed while as many 
I/O lines are needed can be maintained. 

I/O 

The Z-8 has a total of 32 pins dedicated to I/O. They are 
arranged as four 8-line ports and are capable of being config¬ 
ured for input, output or bidirectional operation; They all 
have pull-ups and pull-downs compatible with TTL loads. In 
addition, all ports are programmable to provide status signals, 
timing and parallel or serial I/O features with or without hand¬ 
shake. 

Port 1 can be used as a byte I/O port or bidirectionally in 
conjunction with Port 0 for accessing external memory. In the 
latter application, the lower 8 bits of the address are multi¬ 
plexed with data. If more than 256 external memory locations 
must be accessed, the upper 4 or 8 bits of the address are pro¬ 
vided by Port 0. 

Port 0 is nibble programmable as either address or I/O. If 
the address requirements are 12 bits or less, the upper 4 bits of 
Port 0 can be independently configured as I/O while using the 
lower 4 bits in conjunction with Port 1 for addressing. 

Port 2 has 8 buffered lines which can be programmed in bit 
mode as inputs or outputs. The output buffers can be pro¬ 
grammed to inhibit the active pull-ups and thus provide open- 
drain outputs. 

Port 3 is a control port and an I/O port. Its 8 lines are fixed 
directionally as four in and four out. In addition, two of its 
lines can be programmed as a full-duplex serial asynchronous 
receiver/transmitter. Port 3 provides handshake control lines 
RDY and STB for the other 3 ports when required. Other con¬ 
trol functions of Port 3 include timer in and out, status out 
and interrupt request. 

When the two lines of Port 3 are programmed as the full- 
duplex asynchronous receiver/transmitter, a bit rate of up to 
62.6K bits per second can be generated with the crystal fre¬ 
quency at the maximum of 8MHz (4MHZ true internal opera¬ 
tion). This configuration also provides for programmable odd 
parity. 


Interrupts 

The Z-8 has six maskable and prioritized interrupts as well 
as reset, which acts as a vectored nonmaskable interrupt of 
highest priority. The six sources of interrupt are the four input 
lines of Port 3 and the two timers, TO and Tl. There is an In¬ 
terrupt Request Register for storing the requests. The Inter¬ 
rupt Mask Register can store bits to disable the six interrupts 
individually or use a seventh bit for a global disable of all in¬ 
terrupts except reset. 

In handling prioritized interrupts, the priority encoder, con¬ 
trolled by the Interrupt Priority Register, outputs an address 
which points to a vector in program memory. When the inter¬ 
rupt is serviced, the Z-8 globally disables all other interrupts, 
pushes flags and program counter onto the stack and branches 
to the location specified by the vector. Disabled interrupts can 
be re-enabled either globally or individually and the use of 
separate Interrupt Request and Mask registers makes it possi¬ 
ble to use interrupt nesting and interrupt polling together. 

Z8 Block Diagram 


OUTPUT INPUT 


XTAL AS DS R/W RESET 



(Bit Programmable) 


(Byte Programmable) (Nibble Programmable) 


Page 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 26 

267 





















The Z-8 is equipped with two internal 8-bit counters with 
individual 6-bit prescalers. The counter/timer circuits can op¬ 
erate independently of the processor instruction sequence and 
thus unburden the program from such functions as event 
counting and timekeeping. They have two user-selectable 
clock sources: the microprocessor clock (maximum internal 
operation of 4MHz) divided by four, or the external timer 
input line at Port 3 can function as a external clock source 
(max 1MHz), a trigger input (which can also be retriggered), 
or as a gate input for the internal clock. 

The prescalers can be programmed to divide their input fre¬ 
quency by any number from 1 to 64. The counters count 
down from any number from 1 to 256 which is stored in a 
holding register. At the end of the count, an interrupt request 
is generated. The two software-controlled operating modes for 
the counters are: a) stop at zero, and b) automatic reload and 
continue count. The counter/prescalers can be started, then 
stopped anywhere in the count; they can then be restarted 
anywhere in the count or restarted at the initial value. One of 
the Port 3 lines serves as a timer output for Timers 0 and 1 or 
for the internal clock. It toggles each time the end of a count 
is reached. 

CPU 

The Z-8 can access an internal Program Memory, external 
Program Memory, external Data Memory and an internal 
Register File. These different memories are implemented as 
separate address spaces and other address such as I/O and con¬ 
trol registers are mapped into the Register File. 

The first 2K bytes of Program Memory are on-chip mask- 
programmable ROM. The first 14 bytes of this on-chip mem¬ 
ory contain the address for vectoring the reset and six inter¬ 
rupts to the proper locations in Program Memory. At addresses 
above 2048, the CPU automatically addresses external Pro¬ 
gram Memory. 

In addition to the 64K of Program Memory, the Z-8 can 
directly address up to 64K of external Data Memory using 
Port 1 and if necessary, all or part of Port 0 as described above 
in the secion on I/O. 

The internal Register File consists of 4 I/O port registers, 
124 general purpose registers and 16 status and control regis¬ 
ters for setting the various configurations of the Z-8. This lat¬ 
ter group includes the input and output registers for the full- 
duplex asynchronous receiver/transmitter. The Register File 
is organized into 9 working register groups of 16 registers each. 
The current group of working registers is selected by a register 
pointer. The working registers within the current group require 
only a 4-bit address field. 

The fact that the I/O and control registers are mapped into 
the Register File allows any instruction to process I/O or con¬ 
trol information and thus eliminates the need for specialized 
instructions. Each of the 124 general purpose registers can 
serve as an accumulator, a pointer or an index register, and 
registers and register pairs may be directly or indirectly ad¬ 
dressed. 

The lowest group of working registers includes the four I/O 
ports. For I/O intensive operations and interrupt handling, the 
register pointer may be set to this group and fast instructions 
used to address the four I/O registers while using the 12 re¬ 
maining registers for temporary storage and calculation. In like 
manner, all the registers for timers, port operation, serial inter¬ 


face and interrupt control are included in another working 
register group so that when the register pointer is set to it 
those sections of program dealing with system configuration 
can be substantially reduced in size. 

In addition to these, the remaining seven groups may be in¬ 
dicated by the register pointer to perform calculations and 
other program operations. The Z-8 can still access them direct¬ 
ly at any time regardless of the value of the register pointer. 

Instruction Set 

The Z-8 provides six main addressing modes: Register (R), 
Indirect Register (IR), Immediate (IM), Direct Address (DA), 
Relative Address (RA) and Indexed (X). There are in addition 
other addressing modes implied by certain instructions (Auto¬ 
increment, Register Pair and Indirect Register Pair). Basically, 
all instructions can use the Register, Indirect Register and Im¬ 
mediate addressing modes. The Load instmction may also use 
Indexed Addressing and Program Memory space instructions 
use 16 and 8-bit Relative Address modes. These register ad¬ 
dressing modes can imply any register in the Register File of 
ony one of the 16 working registers. The Z-8 instructions per¬ 
mit the addressing of registers in the Register File or working 
registers or a combination of the two when two addressing 
modes are used. 

The fact that the I/O and control registers are mapped into 
the Register File means that any register instruction can exe¬ 
cute I/O or control operations. Using the working register con¬ 
cept, a programmer can execute an input or output operation 
between any I/O port and any Register File location in only 
two bytes (6 cycles). 

The six levels of vectored interrupts—maskable and priori¬ 
tized under software control—plus the capability of mixing in¬ 
terrupts and polling give the Z-8 a very flexible interrupt 
structure. To support this interrupt structure, the Z-8 is pro¬ 
vided with a flexible stack scheme and fast context switching 
capability. Context switching is the saving and restoring of 
such pertinent information as flags and working registers when 
an interrupt occurs. 

The Z-8 can use an internal or external stack limited only 
by the available memory and all under software control. One 
of the registers or register pairs in the Register File contains 
an 8-bit or 16-bit stack pointer. The stack is utilized by Call 
instructions to the 16-bit return value of the program counter. 
When interrrupts occur, the 16-bit program counter and an 
8-bit flag register are automatically saved on the stack. Push 
and Pop instructions can also save any register from the Regis¬ 
ter File on the stack. Any bit within any byte in the Register 
File can be set, reset and tested by the Z-8 including any I/O 
port and control registers. Thus, any byte can be used as a flag 
byte to be set, reset and tested by a single instruction. 

In the Direct Addressing mode, the 16-bit addresses for 
jumps and calls are contained in 3-byte instructions. Indirect 
jumps and calls are 2-byte instructions which point to the 
register pair containing the actual 16-bit destination address. 
Two instructions which operate on 16-bit values stored in 
register pairs are Increment Word and Decrement Word. They 
manipulate 16-bit addresses for Program Memory and external 
Data Memory and can also be applied to 16-bit data words. 

High-speed block transfers between external memory and 
the Register File in the Z-8 occur with the Load Constant 
Autoincrement and Load External Autoincrement operations. 


Number 26 

268 


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


Page 29 



These instructions automatically increment the source and 
destination address much the same way as the DMA operation. 
Other forms of address manipulation are possible for block 
transfers such as using Load Constant and Load External in¬ 
structions in conjunction with the increment/decrement byte 
and word instructions. The following is a summary of the 
Z-8 instruction set: 

• Load and Exchange. Clear, Exchange, Load, Load Con¬ 
stant, Load External, Pop, Push. 

• Arithmetic. Add, Add With Carry, Decimal Adjust, Decre¬ 
ment Byte And Word, Increment Byte And Word, Subtract, 
Subtract With Carry. 

• Logical. AND, Compare, Complement, OR, Exclusive OR. 

• Program Control. Call; Decrement And Jump On Non- 
Zero; Interrupt Return; Jump Conditional; Jump Relative 
Conditional; Return; Set, Reset and Complement of Carry 
Flag. 

• Bit Manipulation. Test Under Mask, Test Complement 
Under Mask. 

• Rotate and Shift. Rotate Left, Rotate Left Circular, Rotate 
Right, Rotate Right Circular, Shift Right Arithmetic, Swap 
Nibbles. 

• Block Transfer. Load Constant Autoincrement, Load 
External Autoincrement. 

• CPU Control. Disable Interrupts, Enable Interrupts, No Op, 
Set Register Pointer. 

When operating on working register data, most one- and 
two-operand instructions in the Z-8 require 6 T-cycles. This is 
the minimum instruction execution time. With a crystal 
frequency of 8MHz (giving a true internal operation frequency 
of 4MHz), one T-cycle is 250ns. Two-operand instructions 
manipulating Register File data generally execute in 9 T- 
cycles. The longest instruction, CALL, takes 19 T-cycles. 


TEST FOR SWTPC GRAPHICS DISPLAY 

Dear Dr. Dobbs, Received: 78 May 11 

The following is a program which I have found quite useful 
in hardware debugging my SWTP GT-6144.1 hope some other 
readers will benefit by it. 

The program should be self explanatory. It is relocatable 
to other memory locations as the following MIKBUG dumps 
show. The first one is from the enclosed program: 

P 

SI 13 AO 14FEA0028600A70186FF A7008634A701BD1F 
S10C A024E05 5FEA002A70020F69D 

The next one is from the program which was reassembled to 
start at $0100: 

P 

S1130100FE A0028600A70186FF A7008634A701BDD2 
S10C0110E05 5 FE A002A70020F650 

Those who are not familiar with MIKBUG may notice that the 
last byte on each line is different. This is the checksum gen¬ 
erated by MIKBUG and reflects the different address (2nd and 
3rd bytes) in each line. 

Sincerely, P.O. Box 60725 

Jim Lanford Sunnyvale, CA 94088 


NAM GTTEST 

a TEST program for the SWTP GT-6144 
graphics display unit. 

written by Jim Lanford 
for the SWTP 6800 using MIKBUG 

this is a quick and dirty data inputer 
-it inputs hex from the terminal 
-thru the MP-La (port address at A002) 

-to the GT-6144 (usually hooked to the M A“ 
side of the MP-La) 

-this test program will also work on the “B“ 
side of the MP-La if it is jumpered for output 
and the port address + 2 is in location A002 

This program is very useful for hardware 
types who want to debug the GT-6144 under a 
controlled, one-byte-at-a-time environment. 

It is also useful for some specialized 
software display bugs. 

If you get lost or type a non-HEX digit, the 
program returns to MIKBUG, and is warm started 
by typing “G". 

The HEX address of the MP-La parallel 
interface should be set in location A002/3. 

Port t3 (800C) is usually used. 

GT-6144 Data reminders 

Horz bit select t> write $40 -> $7F 

Horz bit select & erase $00 -> $3F 

Vertical bit select.... $80 -> $DF 
$F0 « invert screen 

$F1 ■ normal screen 

$F2 - enable CT-1024 
$F3 - disable CT-1024 
$F4 * enable graphics 
$F5 ■ disable graphics 


MIKBUG subroutine 


E055 




BYTE EQU 

5E055 

inputs two HEX char. 





• register addresses a 

nd select definitions 

A00 2 




PIALOC EQU 

SA002 

PIA port address from A002 

0001 




CR EQU 

1 

control register 

0000 




DDR EQU 

0 

data direction register 

0000 




OR EQU 

0 

output register 

0000 




SELDDR EQU 

$00 

select DDR 

00FF 




DEFOUT EQU 

$ FF 

define all bits output 

0034 




SELOR EQU 

$34 

select OR 





• initialize 

6820 


A014 




ORG 

$A014 


A014 

FE 

A 0 

02 

LDX 

PIALOC 

get port address from memor' 

A017 

86 

00 


LDA A 

*SELDDR 


A019 

A7 

01 


STA A 

CR, X 

select DDR via CR 

A01B 

86 

FF 


LDA A 

♦DEFOUT 


A01D 

A 7 

0 0 


STA A 

DDR, X 

all bits output in DDR 

A01F 

86 

34 


LDA A 

♦SELOR 


A021 

A7 

01 


STA A 

CR, X 

select OR via CR 





* input/output loop 


A023 

BD 

E0 

55 

LOOP JSR 

BYTE 

input a byte 

A026 

FE 

A 0 

02 

LDX 

PIALOC 

reload index to allow warm 

A029 

A7 

00 


STA A 

OR, X 

output to GT-6144 

A0 2B 

20 

F6 


BRA 

LOOP 

do it again 


END 


NO ERROR(S) DETECTED 


SYMBOL TABLE: 
BYTE E055 

CR 

0001 

DDR 

0000 

DEFOUT 

00FF 

LOOP 

A023 

OR 

0000 

PIALOC 

A002 

SELDDR 

0000 

SELOR 

0034 








MAILING LIST SHOP-AROUND 

Dated: 78 April 13 

Here at PCC we are collecting sources of mailing list pro¬ 
grams, especially those with enough coding space for use by 
small magazines. This is not only for our own continued well 
being, it seems that there is a tremendous variety of people 
and businesses which use mailing lists—from salesmen to 
public interest lobbyists. We’d like to invite our readership to 
send us any sources, or suggestions in this project. If our 
research uncovers anything of interest, we’ll try to let you 
know. 

William Bruneau, 

Circulation Manager 


Page 30 


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


Number 26 




LAZARUS 

A Program to Resurrect BASIC Programs on 

the Apple-11 Computer 


BY ANDY HERTZFELD 

2220 Dwight Way, #210 
Berkeley CA 94704 
(415)548-3072 

Many unfortunate souls have experienced the frustration 
which occurs when you realize that you have just accidentally 
erased the program you were working on. Kicking the compu¬ 
ter may provide some emotional satisfaction but it won’t bring 
your program back. This article describes Lazarus, a short ma¬ 
chine language program which can resurrect inadvertently e- 
rased BASIC programs on the Apple-II computer. 

When an Apple-II integer BASIC program is erased, it is 
usually not destroyed. It is probably still sitting around some¬ 
where in memory; however, the BASIC interpreter no longer 
knows where to find it so it is effectively lost. Lazarus scans 
through memory trying to find the largest valid BASIC pro¬ 
gram that it can. If it finds one it resets the interpreter’s point¬ 
ers to point to the found program, thereby resurrecting it. If 
no valid program can be found an error message is printed. In 
either case control is returned to the BASIC interpreter. 

Of course, things are not quite this simple. If there are 
many program fragments floating around the workspace, 
Lazarus might not resurrect the one you are interested in. If 
you had performed some deletions of low-numbered state¬ 
ments prior to the erasure, Lazarus may restore the deleted 
lines along with the rest of the program. If your program was 
located in an unusual part of memory, Lazarus may not know 
where to look for it. Finally it is possible but unlikely that 
Lazarus could introduce spurious statement at the beginning 
and end of the resuscitated program. In practice these prob¬ 
lems are rare; Lazarus should be successful most of the time. 

The Details 

To understand how Lazarus works, you must first know 
something about the internal representation of an Apple-II 
integer BASIC program. We will examine this briefly here; for 
a more detailed exposition see Steve Wozniak’s article in Dr. 
Dobb’s #23 (vol. 3, issue 3) or the Apple reference material 
when they finally get around to putting it out (the current 
reference manual isn’t very helpful). 

The BASIC “workspace” is the area of memory used to 
store the currently active BASIC program and its associated 
variables. On the Apple-II it is defined by two zero-page point¬ 
ers: LOMEM, which points to the lowest addresses byte in the 


workspace and HIMEM, which points one past the highest. 
Program statements are placed into memory starting at 
HIMEM and are pushed down as each successive statement is 
entered. Another pointer called PP (for program pointer) is 
used to point to the first, lowest numbered statement. PP de¬ 
creases as the program grows; a program is erased by setting PP 
to HIMEM. Thus all Lazarus has to do is scan memory from 
LOMEM to HIMEM and isolate the beginning and end of the 
longest BASIC program residing there. To accomplish the res¬ 
urrection, it simply stores the address of the start of the pro¬ 
gram into PP and its ending address (plus 1) into HIMEM. 

As each line of BASIC program is entered, it is translated 
into a compact internal form consisting of four parts. First 
there is a length byte indicating the total length of the state¬ 
ment. It is followed by a 2-byte line number, low order byte 
first. Next comes a string of code syllables or tokens which 
make up the body of the statement. Finally there is a special 
end-of-statement token ($01) at the end of every statement. 

Knowing this information, it is not too hard to find a 
BASIC program segment; simply scan through memory search¬ 
ing for an end-of-statement token. When one is found we can 
check if it ends a stanement by examining length bytes. The 
fact that the statement’s line numbers must be in ascending or¬ 
der is used to perform an additional validity check. The pro¬ 
gram segment ends as soon as this structure is violated. 

There may be many valid fragments floating around the 
workspace (like pieces of the Startrek program you played an 
hour ago); Lazarus will resurrect the largest one since that is 
usually the one we are interested in. Since that is not always 
the one we want, another entry point is provided that causes 
the last segment (which tends to be the most recent pro¬ 
gram worked on) to be chosen. 

Lazarus was implemented using SWEET 16, a very useful 
little 16-bit virtual machine that is interpreted by the Apple- 
II firmware. SWEET 16 saves a lot of code at the expense of a 
significantly longer execution time. Since Lazarus does a lot 
of 16-bit operations, Sweet 16 was able to spare me a large a- 
mount of tedious coding. (See Woznick’s article in the Nov 77 
Byte for a detailed description of SWEET 16). 

Using Lazarus 

The code for Lazarus is relocatable since all of its branches 
are relative and the only local storage it uses is in page zero. 
$300 seems to be a convenient place to load it. You can load it 
for the first time by going into the monitor mode and typing: 


Number 26 

270 


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


DO 02 A9 
0^1 00 16 
59 42 D5 
44 D5 07 
05 04 29 
05 00 84 
BC 01 EF 
02 AB 21 
2B 71 11 
20 2D FF 


00 85 FO 
4A 00 17 
07 F8 22 
12 27 D4 
38 01 E3 
D1 06 OD 
29 32 E2 
3A 24 3B 
4C 00 2C 
4C 03 EO 


85 FI 20 
4C 00 66 
FO 38 39 
05 OE 24 
22 FO 34 
El 10 FF 
B4 31 18 
29 3C 01 
EO 71 00 


BO 3A EO 

67 37 22 

D3 02 18 

68 31 E4 
D1 F4 F4 
02 CO 24 
68 06 04 
06 11 11 
FF 4C 03 


Once it has been manually loaded, it can be saved on tape 
by typing “300.3AOW” and then subsequently loaded back in 
by typing “300.3 AO R”. 

Lazarus is very easy to use. After cursing yourself out a few 
times for accidentally erasing your program, return to monitor 
mode and load Lazarus. Then return to BASIC and type 
“CALL 768” or “CALL 772”. The former will cause the long¬ 
est program segment in the workspace to be restored; the lat¬ 
ter will cause the last to be selected. When it returns, do a 
“LIST” to see what it found. If nothing could be dredged up, 
an error message is printed. If both entry points recover the 
wrong program, you can adjust LOMEM and HIMEM accord¬ 
ingly and try again. If all else fails, you can still always kick 
the computer. 

A useful extension to Lazarus would be to recover the vari¬ 
able table along with the program, which could be very impor¬ 
tant in some cases. I would like to thank Bruce Tognazzini for 
providing the initial idea for this program. 

A complete source listing follows... 



increasing 

"neinory free 5 paQo 

Mdtess^ 


- uomEv\ 

PV 

UndofiOnoblOll*) 


pro 3 r Mn) 


BASIC. vJOrtepace. memory map 


- PlftEfA 


□ (EO© 1*3 

lemtVi line number uxttftjUnWtsj erei-0f.si5re.mtnv 

tt*- tody of ■tV'ie *+okt.o 

£flSlC statemerit representation 




4 h c 

w o 



p 

c 

0 0 

0 

P E 

hD 0 PT 3 XOAd-P 


c 

3 



c 

E 

0 

0 P 0 o 

Ad 

• 0 0 

CP *P 0 O rH 


0 

w o 

0 c 


0 o 

r x c 

E 

C 0 >3 C 3 X 

O 

X 3 P P 

0 > C rH 0 P 0 


p 

•P 4 h 

C 0 


X 3 P 

E P 

0 

- ? X 0 c 

P 

C W 0 

•H X 0 0 TIP > 


c 


O to P 


O 0 

o a 

P 

0 - Ad -P T 3 


3 P 

p > c >3 co a 


•*H 

E w 

0 


E rP 

X 

0 

5 0 P O P C 

P 

O 0 W 

5 X 0 C 0 X 0 -P 


WOW 

0 -P 

»P ip 


3 

sc s 

P 

h X P C 0 

0 c 

4 h > 

0 P 0 -P r il 


C a C 

c 

rP rP £ 


vO E 

4 h W 0 S 3 

w 

4 h 0 0 O 

X 0 

•P T 3 

C h£) C 0 P W 


o o c 

he E 

0 0 O 


tP 3 0 

o SOS 

1 

•P C c /1 O (O 

p E 

C W • -P 

C he W X W C P 


w C w 0 

O 0 

C p 




Vh 

0 0 O X 

0 

0 W T 3 rH 

0 0 P P 0 0 *P 


•H (Uml 4 h 

c c 

O 0 O -P 


Eh O *P 

h 4 w X X 

o 

0 ? C 0 r rl • 

O P 

0 0 0 0 



C O C 

a td 

P Ad P 5 


W 0 CO 

W o 0 

1 

0 OX P 0 

P 0 

X O X > 

P P W 0 • 


0 w 0 o 

o 

0 W 


r r} 

O O 0 O O to o 

X 3 

W 4 h X 3 P 0 O to 

P 

O O 

0 -p - T 3 0 X P 


o- cx C C W P 

P c 

hC’p ho 


0 X 

P P C P P .P P 

C 

•P X C*P 


W 3 0 P 

OX P rH X O 

p 

£ w £ 0 0 C 

w x 

0 0 0 


CO X 0 


0 

O >3 P-P rH 

C 1 

0 W 0 C 

PP 0 O OPCC 


0 X 3 0 OOT 3 0 

0 



P E 

vrxrxxs • vo 0 O'- 


P - H 3 W 0 


X C 0 

C C X 0 


coco wwCPE 

hi p 

4 h >j 4 -. P 


C 

cc x 0 s x -p cc 

c 

S rH P P -P 

o o 

C o 

W 0.3 CLP W 

E 

0 0 3 CK: 

C W 

0 


0 O O 

W p 

0 

P 'll 0 A!-PPP 

a i 

P O W 0 

X 3 WW 5 3 P P 

C 

p C J C XJX 3 O 00 

0 0 

P ? P P 


P c c 

p p p S p -p P 


W S C O *P 

X 3 

C -PC 

P O 0 -P 

hi 

C O Ad O CCVhEw 

rp rp 

0 rH 0 0 


C 0 0 

0 0 0 FH 0 C 0 

c 

0 M -P .P W 4 h C 

o c 

0 w 

X. Ad 0 -P C Ad X 


•p 4 h O 4 h 0 0 hf 


W 0 W W 


0 to to 

w w hC X w -p w 

o 

P X 4 h P,.P *P -P 

p 0 

E Ad S P 

E O Ad O 4 h 


O 0 * 3 0 0 X 

0 0 





4 h 



0 O Ctl w 



cx JD »P C C to W 0 

x x 








P 0 S O 

X OE-P X X.-P 

c 

m O O-p E 

p p 





c 



0 XhE 



C - <H<H in X 






0 



POX 

Q Q 


>3 0 W >3 W 0 <H 

o o 





o 



W 0 

►p i—i 

0 

L) O C C C CCEEO 

w w 




s s 

w 

X 


>3 C X 

X X 

P 





vO 

r il E 


w o 


0 P O P 



X 0 H 02 S E 4 h S 

hi hi 




E S 

0 

z o 



CO > - 4 - > 


•P c P p P W W X 3 T 3 -H OS 

0 0 

w 


Eh 

O M 


O X 



ccxrAZOv^J-Xvnz 


X-PCXCSS 00 X, S 

rP rp 

|i. KO 


CLJ 

4 PX 


q z 


o -p q o 

K^XHXXiXH 


3 0 O 3 OQKHWW 0 14 h 

4-1 4 -h 

Cl, O O O r-i 


'il O 



X CM »P 


4 h rH 3 


X 

0 EO 0 OXX 33 EXX 


P 3 hfAh, Cl, 

• 

O rH O vx rxvo MCiOWKN 

• 

CM CN-r-lXVfX-<(XJOCOO 

0 O 0 




0 0 


O 

coxxxxxxx<wxx' 3 'x 

0 

CC X«<WxSXKKft; 

0 > 4 h P 

X X o Q x cm 



-C X 


P 



c 



P >3 

ZQSZqxQSZ 



p p 


0 



0 



0 W W X 

MXOX-dtoXoX 




c'll << < 


CC CQ 

X Ep Eh £h Q Q 

X 

X P, CM 

X 

T 3 E -P 


P 

rH CM r ~'-4 vrvvo 6 -CD (>H rH rH 

w w 

Q Z Q Eh Eh 

• 

MDEHZEfaWWQtffHQtf 


Q S O Q S Z Q 

O EH Eh 

•PC P 



KEOCKKKKKKKKa 


p 0 p w r/i 

W 

PWWHWWWWPWwiPW 

w 

rH o m M o ffl p 


TS O 0 W 




0 0 


c 



p 



C «M C 0 

X 

* 


w w 


0 



c 




o 





p 



0 

o 


O 0 

o 



O 





p 

o 


D.-O 0 

X 



o o 

rn 

•p 




rP 


0 -P X 

« 



rxrx 

X 

hi 






P-rH P 





o 

0 



a 

FP 


P O 0 





Eh 

C 



o 

c 


C O > O 




p p 

00 




o 

s 


•P rH C P 




c c 





rH 



O -P 




•P .P 


to 


O O O 








o o 


•p 

CC 

O O O 

c 



C C P 






rp 



•p 



W -P 0 C 



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


O' o O'xnxn 

*< Q <00 00 


O CM -4vO 00 
OOOOO 
c r '> tn f r ' f r '>c*> 


O O •< O C^-nOvO MNP 

cm pq r> w c r VrH ,p »p vo rx cwc o 


•<QUli.OH 4 L'<mOQU 

0000*P.PrH*P«P«PrH»PrH 

(nmtntntn m\ m r r v m m c^v m m 


•H 5 

X O X o 

P. 

rH +■> 

P O CON 

C 4 H 3 a 


h o h rv .4 vncNcoo^ 
rHCMCMCMCMCMCMCMCMCM 
c r vc r vr'c r Nr'\rNC'vc r vc'\r r \ 


co 00 ex cm ov -4 -4 w e'¬ 
er} .4 Q o < rx-d- Q o 

tq o D W O h (M rx-xf 
CMCMCMCMf^rxrxrxr-i 
px rx ox px rx px px px px 


Page 32 


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


Number 26 

271 








NEEDED: SYSTEM IDEAS FOR THE BLIND 


■a 

>> 3 
01 -H O 
X © «M 
P P 
© b£ 
—H C 

• P *H 
0 ) ftx 

• o p 

■H P O 

—' ft c 

ft 

© rf «m 
W »H 
P s 
3 r q = 
oscc 

O M 02 

X M 
w = 
P X 
•H q P 

3 q 

C -H 
3 ft P 
p a. ft 

W P 
as a> • 
X C/J p 


O • © 
P 

HS ft 
W P 
C s 0J 
•HHP 

(dx q 

E -H 
•a 

© © o 

X X H 
P O GO 
CO C 

C © cq 
0) P 
X 0) 
5 OT X 
rt P 

p x 
c o 

•H P P 
O 0) 

ftp c: 

Ct P 
W *H 3 
•HOP 
X P 0) 
P P 
c 

x co c 
a o 0 ) 
© ot X 

0) p 

P c: 

•H X 
© © C 
3c E © 


P 2 

g>S 

P EH 
ftX 


ft p 
3 PQ) 
P'0 

« 0)0* 


© rH 



© © C 

X © «M 

V. cm 

P TJ S *rH CV 

£ C O 

O O 

-H C 

O O 

bf 


•H 

E O ©VA 

*m *H OT 

P OT 

>> O 

P Xvn 

O OT OT 

P OT 
© © 

X ftCVl P 

© 


O rH © 

© • P 

P P 

P o 

VArH OX 

N OX 

OT TJ 

•H PvO © PP 

•H P X 

TJ 


X 

OT © © 

O © 

P 2 

O >*0 

M 

P 

q rq 

P © OP 

© © 

© 

© 2 

X © 

X OT X 

ft X 

E M 

C P X C 

P P P 

CL P 

© X 

=3 bf ft 3 
P C EP 

•H 


P 

P P 

P P 

O P 

© cm © 

© © 

c © 

© -H 3 © 

bO-H bf 

OT bf 

•H OT 

P P ' r ~3 P 


02 ft 
o ft 
O 02 • 


rq 

2 


hX Ji 

»h rH • CV <—i hH i 

hiz,hhKhhok rq • 

02(^0202^020202^ 

_ Q Eh IK Q 2 02 ft-2 Qd < 

QNCqq^WQZEH^OTSCH uj| 
►HXCO^lcOrO^HCOO2'-0^Q2 bf 



ft o U. O 

ft. [Il U. Ul 


'f 


• CP»h»-(OOwHOOOOO «J 
ICV1Cn-,h(VJMC^ 0(\J40CM jF 


oq&.n r>4 mco •< cq cq £ *2 

C^O-C^-COCOCOCOCOCOCOCOCO^^X, 
nr'nnnnnrMnnnr 


Dear Jim, Received: 78 April 10 

A printer in a nearby town lost his sight a year ago. I have 
been asked to take a preliminary look at hardware and soft¬ 
ware that might help him maintain a useful role in his business. 
He is undergoing the usual training. His partner values his 
judgement and knowledge but he is restricted in access for the 
data on which to act. 

My initial reaction is that a small data-base system with 
audio response would be a good place to start. An audio 
response type-writer keyboard should be feasible for input 
although audio input is the ideal. I have looked over your 
articles in Dr. Dobb’s and am hoping you might be able to 
supply an update. I know there are groups working in this area 
but lack references. 

Fortunately, some financial resources are available. If a 
suitable proposal can be assembled, I feel there is a good 
chance for Department of Rehabilitation assistance. This is, 
of course, speculative until we can get an initial reaction. 

I have written Lloyd Rice from Computalker and will 
send out inquiries as I run across references. Any information 
you can pass along will be appreciated. 

Sincerely, 

James E. Tarvid Dellwood,WI 53927 

Systems Consultants, Inc. (608) 339-7259 

Any readers who may be able to help out are urged to 
make contact. -TRW 





TJ 

o 

o 




s 



q 





bD 




o 



o 





© 




OT 

X 

X 

•H 


P 



c o 





p 

p 

P 


c 



o c 




C © 

bf 


© 


© 


© 


CO P 



3 3 

C 

«m 

P 


E 


X 


x C 

P 


O C 

© © 

O 

P © 


© 


P 

© © p 

© 

q 


Cm -H 



q © p ot 






© E 

© 

P 

P 

© 

bf 

3 q .h © tj 


© ^ 



E rH 

P © 

E P 

q 


X © 

C 

OOP © 




o 

3 0- 

© P 

bf £ 

© © 

© O 

© > 

•H 

O X P >» OT 





C TJ 

TJ © 

© <SJ 

P E 

* O 



X X bf OT 




P rH 

© H 

P P 

OT E 

>j © 


ft p 

c 

x © © q © 


TJ © rH 


© 02 

© X o 

3 OT 

© 

X P 

bf o 

q © 

•H 

P P Cvo O P ft 




X 

C p 


E P 

© 

C bf 

o © P 

bf 

© bf- VArH C 



•H 

E C 


O P 

rt © 

P P 

•H 

p o q 

© 

p q © © cm © p 

>> 



3 -H 

rH X © 

OT X 

P P P 

OT OT 

X X 

w © 

X 

> 1 © JX o e c 


> tj r q .h 

>2 

C 

P X 

© 

bD q ot 

© 

p q 

4 P 


X rH P © O bi) OT 

ft 


p 

© 

P -H P 

x q 

o © 

rH TJ 

o © 

X OT 

© 

- C P © -rH 





© 5 

o 

P E TJ 


q 

X © 

X 

P © rH P O OT 


© X cd P P 

E 

c © 

5 OT 

© 

P. © -H 

© rH 

p 

E q x 

p 

X X © O bf OT S 




•H OT 

©POT 

OT X 

P rH 

X © 


O © P 


© P 3 Cm P © 'q 


° . -E 1 S 

o 

rH 

C .H © 

P P 


p > 

© 

p * 

p 

q cr © -h x s- 


.. >?<» W tj - 


TJ 

rH 

c 

•H P > 


X P 

P A2 X 


X © rH > P o 


bfiH C © © 


© q 

© © 

© © 


O P 

p © 

O -H 

Cm 

© P X - - .H 




X © 


E C 

© P 

P OT 

bf 

CA © O 


X -H © © © ft 



TJ 

p 

P © -H 

© *H 

> TJ OT 

© 

- P 

X X 

bp 

vSl,v*>3ai 


g ot bf ©x 


© 

P. 

P E 

•H P 

4 rH 

4 O 

P 

c 

- q © p 


COT© Q.O. 

rH 

p- c 

P* E 5 



X 

X Cm 

O © rH 

•H 

ft© >)©<mX © 3 


•HO 3 © 

© 

3 -H 

3 0© 

P X X 

© Cm 

© 

II 


X 



bf P. P © j 

> O 

1—1 

o C 

OT © 

> 

P X 

O' O 

P P -H 

O 

© X © © »H 

P X 

y m x > 

02 

M 


X 

O © bf 

C p 

X OT 

P * 

P 

.x ftp pp J bC© 


X • © o - Cm 

OT 

O TJ 

OTJCh 

© P o 

p x q 

•H 


X P 




p P .H © -H 

P C 

•H rH 

•h q .h 

X -H be 

TJ OT P -H 

O «M 

«m 

3 O rH 

© 

•HOCMq©CMO© 




P. O 

p. © 

p 5 

C © X 

Q. o 

•H 

OT Cm X 

OT 

ft O -H -H P -H ot E 









X 





^ c S Q 



Q 

X 

O >> 


o 



ft 

ft ft 

© KH 



H 

o 

© © q 


o 


O 


o n 

P © X 



rP 

o 

X x © © 


rH 


© 


33 

OT X OT < 



c 

rH 

p p p 


z 

VA 

X 

ft 

© P > 


CO 

-4 > 

« 

>>TJ 


M 

• 


cq ^ 2 


CJ c^-X- Z 4 O Cb 

02 rH -4" 02 rH 22 

On CO X 

TJ Cm X C 

(M O 4 O' < 

4 4 4 rH 

c 

4 2 - HH 

p * 

® 02 02 l-H O'. 02 02 

02 X ^ Q2 H 

X X o 

© O .H 

X X X X S 

X X X X 

© 







X P X 




o 

(P'XQxxxsxxsir/j 










OT P 



OP pi. 

02 

Q 

02 Q P 


© P © P 

X 

X 

X X X Eh 

c 



. b r? o s E c 

3 O Eh 

Q Eh 22 Q ^ S 

Q E* X 

© >1 rH - 

QOhSNUUUW 

© © 

ft ft 02 Eh ft O ft 


« ^ Jon- 

IPtfl 

»H CO 

h v—i o cn 

HOT© 

P X c 

HQtnuCPQQQW 

5 E 

PZNZWSZQ22K 






© TJ 




© 











ftp 



•H *H 









O © 












O P 

ft 


o-x: © 





X rH p © 




rH OT 

O 


p > 






rH 




o 








C 



bf rH 

rH 







? X P. - 




c © 

z 







P rH 




•«H *rH 

< 


• c 





P © 

t-H 



* P 

o 







C o C + 




O *rl 

tn 











H C 



•H c c 




















O 

O 








p p 



o 

<M M 












P 



m 6 M 



-4 

r> 



Ml 

VA 

© c 



•h 4 h O 



O 

M 

xoow 


Q 

O 

x © 








P O.P.Q2 




P E 



P P »A-4 O O 

CT)h44h'A 

ONOC tH 


<VJ O 4 OnvO 4 4 4 rH 

bf 


*2 P NDOWfi n 

vr< on cq vc Q O 

(VI PO 

P O' (VJ «M 

(M&, AQ6ri,(L,6,H 

c © 

COQO WhQOINJQOO 

X 
























vr co <( rn o 

n cq 

[t.Oh N 

-4 vavt 


coO'Cmouci.OH 


4 VAvO CO O' O Q ft O 


C~\ fA (A (A fA 

rvrN-4 -4 -4 

4 4-4 


4444444VAVA 


VA VA VA VA VA VA VA VA VO VO VT> 

AArvAr'A 

pn aaapn 

AAA 


AAAAAAAAA 

* * 















♦» >> 
c a 


OT «H 

E Q> 
© X 
P P 
bf 

o o 
P P 
a 

OT 


© o 

> ft 

© o 
02 
X 

C - 
3 P 
O C 

<M 0) 

E 

a) bf 

> ® 
© OT 
X 

a> 
© X 
? p 



o cq Q 

CP EH P 

&■ < 2 

•oo a o m 

ov(\hm4hcdq;Ehhc 
02 02 02 02 02 02^X302 022 


9 02 CP Eh Q ft O 

^2D^ r -qqNQ2;2 

c/n-Hc/Jcoc/jrHcn.HocQ 


o © 
ftp 
>> 
OT X 
•H 

X -P 
P OT 
p 

-P -H 

< «M 


X P 
X 


X 

© c 

P -H 

rt <m 

Xo 

3 bf 
IX 

o 


z 

rH NH 
2 02 02 02 2 


at 

E 


q Eh q Eh Q C-h 02 
H OT H OT H OT P 


O 

Q 


ON(\JCN4rHOOCOvOrH < CM 

(\ir'Wmr>HvooNQo 


'Avf) NCOCb-<Q WOhCJ 
vOvO'OvO'TvOVvf C^C^-C^ 
f r M T >r>r\f r \r>r»r\r\r>r\ 


4 vavo c^co < 
c^-r- 

(A r> ca ca (A ca ca 


Number 26 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Page 33 

272 








A TINY BASIC 
EXTENSIONS PACKAGE 


BY LEOR ZOLMAN 

362 Memorial Dr. 
Cambridge, MA 02139 


After getting Li Chen Wang’s Tiny Basic up and running 
about six months ago, from the version published in Dr. 
Dobb’s Journal , I knew I had finally found what I had been 
searching for ever since first getting my IMSAI up: a well 
structured and documented Tiny Basic interpreter which could 
easily be modified to let me do my own thing. Thanks to Dr. 
Wang’s consideration for the needs of his Basic’s users, there 
was ample space available in the command and function tables 
to implement the extensions presented here. 

The routines fall into three independent catagories: cassette 
tape I/O, video I/O for the Processor Technology VDM board, 
and a set of four routines to perform IN, OUT, PEEK, and 
POKE ala MITS Basic. The cassette routines are intended for 
use with a Tarbell Cassette Interface, but shouldn’t be too 
difficult to adapt to any serial storage device with a little 
rewriting. 

The listings are presented in a “pseudo assembled” form as 
opposed to an absolute form for two reasons’ 

1. Since there are two versions of Tiny Basic available 
the one from Dr. Dobb’s and one published in 
Interface Age more recently, the absolute addresses 
intended for one of the versions wouldn’t necessarily 
work for the other. 

2. Many of you have undoubtedly implemented some 
extra features of your own already (into the Dr. 
Dobb’s version) and would need to relocate addition- 
al routines into higher memory anyway. 

My own particular configuration, for those of you with the 
Dr. Dobb’s version who may be interested, is as follows: 

I used the free space from 074F to 07FF for my VDM 
routine (I call it ZVDM) and a TTY output routine (ZTTY). 
The latter was an overflow from the OUTC section, where I 
didn’t have enough room to check for the TTY output switch, 
output to the TTY, and output to the VDM. This problem 
doesn’t occur if you use Dr. Wang’s own VDM driver, pub¬ 


lished in a subsequent issue of Dr. Dobb’s, but I preferred to 
use my own VDM driver due to some of its special features. 

Since the ZVDM and ZTTY used up all the space alloted 
for customized routines, I simply changed the several locations 
which specify TXTBGN (address of the start of the text save 
area). Then, each time more routines need inserting, all that 
needs to be changed are those same locations. They are, by the 
way: 

For the Dr. Dobb’s version: 022A-B, 0237-8, 061A-B 
For the Interface Age version: 0136-7, 0145-5,053E-F 
(in low order first, high order last format) 

These three locations are within Basic as it stands now. 
There are also three such locations within the cassette tape 
I/O routines to follow—two in ‘SAVE,’ and one in ‘CHAIN,’ 
making a total of six location-pairs that need modifying when¬ 
ever the starting location of the text-save area is changed. If 
the idea seems a little troublesome, then you can always cheat 
and pull a little trick: change 5 of the six LXI instructions into 
LHLD instructions which reference the operand of the one 
remaining LXI instruction. Then only that one LXI instruction 
would ever need changing, instead of six! 

By “semi-assembled” form I meant that all opcodes are 
defined for you, but you must fill in the operands of JMP, 
CALL, etc., instructions yourself. Once you have decided 
where the routines are to reside (they may all be put into a 
single continuous block-probablly the best way to do it), 
then you fill in an address to the left of each line, correspond¬ 
ing to where the first byte (out of a possible 1,2, or 3) or the 
instruction will reside. It may be desireable to leave NOFs 
between routines, just in case you ever desire to add bits and 
bytes to the code. Also, this padding may save a lot of sweat 
should you miscount the addresses and need to insert bytes 
afterward. 

When finished, you’ll have an exact image of the code, 
tailored for your software configuration, and it can be hex- 
loaded (or toggled, if you haven’t yet written or acquired a 
hex-loader) right into where you want it. 


Page 34 


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


Number 26 

273 


The last chore that needs doing is to add the commands 
and functions to the appropriate tables. If you’re using the 
Dr.Dobb’s version, you simply insert the ascii string for the 
commands and functions, together with a two byte address of 
their first location (in HI-LO order, not the 8080-normal 
LO-HI) whose most significant bit has been set to one, in the 
appropriate tables. You may call the commands whatever you 
desire, but shortening the names (say, from SAVE, LOAD, 
CHAIN, and NAME to SV, LD, CHN, and NM) would leave 
more room in the tables for other things. I ended up running 
out of room for commands, so I took out some of the padding 
following the function table and transferred it to within the 
command table, shifting the function table starting address to 
higher memory in the process. The only reference to the func¬ 
tion table is at location 04E7-04E8 (Dr. Dobb’s version) 
which should be set to the new address of the first byte of the 
function table minus one. The instruction is the one at label 
EXPR4. This procedure is only necessary if you need more 
space in the command table, and happen to have plenty of 
extra space in the function table. If you are running the 
Interface Age version of Basic, then you must shift the entire 
command and function tables from their present locations to a 
free location, leaving plenty of space between the two tables. 
In that case, there are a few instructions referring to TAB1, 
TAB2, and TAB4 which will need modification. When that is 
accomplished, set TXTBGN (in all the places it needs setting) 
to the first free byte of text area. Some of the routines 
presented here may be inserted into the space vacated by the 
command and function tables, so that it won’t be a waste of 
space. When all the tables and routines are intact, you’re up 
and running! 


Tape I/O 

Four commands have been written to handle the naming, 
saving and loading of programs, utilizing the Tarbell Cassette 
Interface. The commands all center around a ten-character 
program name, stored in a special buffer in memory called the 
“name register.” Whenever you save a program on tape, the 
dump is preceded by this ten character name. When loading 
from tape, you tell the machine to search for a particular pro¬ 
gram by inserting that program’s name into the name register, 
and then executing the LOAD command. Basic will then pro¬ 
ceed to compare the name register’s contents to whatever 
comes in from tape, until a match is found. The restrictions on 
a program name are as follows: 

1. It cannot exceed 10 characters in length. Leading 
blanks are ignored when setting the name, but any 
blank following the first non-blank character 
become a part of the name. 

2. It cannot begin with a *?’. Any other non-blank 
character (except, of course. Basic’s input routine 
control characters and some VDM controls) are legal, 
including most control characters. These, in fact, pro¬ 
vide an elegant method of ‘protection’ of programs 
from unauthorized use, since no one can see the 
printout of the program name. 


Examples: “ NAME1” equivalent to “NAME1” 

“NAME 1 ” is not equivaltne to “NAME1 ” 

“7ABLE” is illegal; “?” not allowed as first character. 
“THIS IS A TEST” gets truncated to “THIS IS A” 


If you enter less than 10 characters, blanks will always be 
padded in on the right for you. If you want the current 
program name to be printed following every RUN and LIST 
command, and for it to be cleared (to all blanks) following 
every execution of the NEW command, then change the 
following 3 sections within Basic: 


addr. in Dr. Dobb’s 

version 

0233-0234-0235 

0267-0268-0269 

0226-0227-0228 


addr. in I. A. 
version 

0141-0142-0143 

0175-0176-0177 

0132-0133-0134 


change to 
this 

CALL RNAME 
CALL LNAME 
CALL NNAME 


Command Syntaxes and Operation 

1. NAME command 
syntax: 

NAME (name) return 
or 

NAME? return 

Sets the name register to the given name, where (name) 
follows the rules for a program name given above. 

Examples: 

NAME WIMPY return (OK) 

NAME WIMPY return (same as above) 

NAME A BIG DEAL return (OK) 

NAME YOUR PRICE! r eturn (exclamation point 

is lost) 

Typing NAME? return causes Basic to respond with the name 
currently occupying the name register. 

2. LOAD command 
syntax: 

LOAD (name) return 
or 

LOAD return 

Loads a program from cassette tape. If the name is not speci¬ 
fied, Basic assumes that you are looking for the program 
whose name is currently occupying the name register. If a 
name is specified, then Basic first replaces the contents of the 
name register with the given name, and then searches for it on 
the tape. 

There is no need to set the tape player running in any 
particular place before the command is typed. In fact, you’ll 
find it easier to first type the command, then hit return, and 
only then set the tape going. The tape may be started 
anywhere, and Basic will skip through any random programs 
that may pass by before the one named in the name register. 
Of course, if you know where a program is located on the 
tape, it would speed things up to set the tape going just before 
that point. 


Number 26 

274 


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


Page 35 



w 


The LOAD command executes an automatic NEW before 
searching, so that the program will always get loaded at the 
start of text memory. The program resident before LOAD was 
typed goes into oblivion, of course. If you wish to append a 
routine from tape onto the tail end of the program currently 
active, see the CHAIN command. 

PROGRAM LOADED 
OK 

gets printed. If the program does not load correctly, you will 
be treated to the message: 

CHECKSUM ERROR; RELOAD 
OK 

whereupon you may try it again. Note that all you need to 
type the second time is: 

LOAD return 

because the name has already been “registered” from the first 
attempt. Should you repeatedly get checksum errors, or no 
response at all, then try adjusting your Tarbell or your player 
as per the Tarbell manual. 

For IMSAI owners, there is a special added bonus. Whatever 
the input routine sees on tape is echoed to the programmed 
output leds on your front panel, so that by watching the 
behaviour of the leds, you can tell whether a program has been 
found yet and is in the process of loading, or if it has not been 
found yet. You can also tell whether the Tarbell has lost a bit: 
Since bit 7 is usually set to 0 in ASCII, then programmed 
output bit 7 should stay pretty solidly lit (reverse IMSAI logic) 
during the load process. If this doesn’t happen, then one of the 
other bits will appear steady and you can bet that the interface 
has dropped a bit or two. 

Typing a control C at any time during a load will terminate 
it and restart Basic. 


Examples: 

LOAD JOHN return 
NAME HORSES 
LOAD return 

LOADED DICE return 


(OK) 

(this combination will 
search for HORSES) 

(will search for a program 
called “ED DICE”) 


3. SAVE command 
syntax: 

SAVE (name) return 
or 

SAVE return 

Saves a program on tape. If the name is omitted, Basic uses the 
name currently in the name register. Specifying the name 
alters the name register and then performs the save under the 
new name. After hitting return, Basic will say: 

HIT RETURN WHEN READY: 
whereupon you position the tape to the desired point, hit 
record, and hit return when ready to save. Basic will prompt 
OK when finished. Control C aborts the save. 


Examples: 

SAVE THIS MESS return 

SAVE THE TIGER return 
etc. 


(names the current 
program “THIS MESS” 
and saves it) 

(names the program 
“THE TIGER” and saves) 


4. CHAIN command 
syntax: 

CHAIN (name) return 
or 

CHAIN return 

Loads the program into memory following the last byte of the 
program currently in activity. The command is identical to 
LOAD, except that the automatic NEW is suppressed. It is use¬ 
ful for loading common subroutines. 

Restriction: the lowest numbered statement of the CHAINed 
program must be greater than the highest numbered line of the 
program currently in memory. Exceptions to this will give 
Basic (and its users) headaches in text editing. 

Example: 

CHAIN RULE return (loads a program named 

“RULE” onto the end of 
the program currently in 
memory, and also changes 
the name register to 
“RULE”. If this is not 
desired, you can change 
the program name back to 
what it was with the 
NAME command.) 

That’s it for the tape I/O routines. May you never need to 
key in a Basic program twice again. 


Special Functions 

This section consists of two functions and two commands, 
all based on their MITS 8K Basic pseudo-counterparts (mean¬ 
ing that they work toward the same ends, but do it different¬ 
ly). 

1. PEEK function 
syntax: 

PEEK (expr.) 

This function returns a value from 0 to 255 corresponding to 
the data stored in the memory address specified by the argu¬ 
ment expression. In order to PEEK at any address in the 
8080’s address space, 

a. Take the decimal value of the address you want 
(0-65535). 

b. If it is less than or equal to 32767, leave it alone. 
If it is greater than 32767, then subtract it from 
65535, add one, and negate that result. 

c. The result from step b. is the argument to use with 
the PEEK function. 

Example: 

to set the variable X to the contents of location 0D97. 

a. 0D97 is 3479 decimal (7 plus 9*16 plus 13*256) 

b. 3479 is less than 32767; leave it alone 

c. X = PEEK (3479) performs the assignment. 
Another example: 

to see location CC00: 

a. CC00 is 52224 in decimal. 

b. (65535-52224) is equal to 13311; 13311 plus 1 is 
13312; negative of that is — 13312. 

c. PRINT PEEK (—13312) displays the location’s 
contents. 


Page 36 


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


Number 26 

275 



The strange values which result for addresses greater than 
32767 are a result of two’s complement 16-bit values being 
used by Basic. 

2. IN function 
syntax: 

IN (expr.) 

This function returns whatever happens to be present at the 
input port whose number is specified by the low-order byte of 
the 16-bit binary equivalent of the given decimal expression. 
In other words, you give it a value from 0 to 255, and it comes 
back with the data at that input port. 

Example: to set M equal to the data on the sense switches: 

M = IN (255); REM 255 IS THE SENSE SWITCH 
INPUT PORT 

3. POKE command 
syntax: 

POKE expr. return 

This command presupposes that you have set the variable P 
equal to a value between 0 and 255. It then deposits that value 
at the memory address specified by the expression. To 
compute the decimal equivalent of a given memory location, 
use the procedure outlined in the PEEK function description. 
Example: fill the VDM memory with ASCII blanks (VDM 
memory is located at address CCOO): 

10 P = 32; REM 32 IS AN ASCII SPACE 
20 FOR I = -13312 TO -12289; REM VDM RANGE 
(CC00-CFFF) 

30 POKE I ; REM POKES VALUE OF P AT LOCA¬ 
TION I 
40 NEXT I 

4. OUT command 
syntax: 

OUT expr. return 

This command outputs the value of variable D to the output 
port specified in “expr.” 

Example: 

Turn on all the programmed output leds on an IMSAI: 

10 D = 0; REM A = 0 TURNS LEDS ON 
20 OUT 255; REM LEDS ARE AT OUTPUT 
PORT FF. 

NOTE: For the commands POKE and OUT, only the low 
order 8 bits of variables P and D, respectively, are used. Thus, 
if P or D were equal to 3, they would have the same effect in 
POKE or OUT as they would with the values 259, 515, 771, 
8963, etc. 


VDM I/O 

The program I call “ZVDM” is a “character output to 
video” routine using Processor Technology’s VDM-1 video 
interface board. The program will reside at location 074F, for 


those of you with the Dr. Dobb’s version of Tiny Basic, and 
there is ample room between the end of it and location 0800 
to insert the ZTTY routine to accommodate both a TTY (via 
the ZTTY routine) and the VDM. This is a general purpose 
routine; it will run with anything that supplies it with a charac¬ 
ter in A and a stack in SP. 

ZVDM is a scroll-based video driver. The cursor originates 
at the bottom left of the screen, scans across for a printed line, 
and returns to the beginning while everything scrolls up one 
line. When given continuous data (a listing, or extremely 
wordy run), scrolling is held to a maximum of about 4 lines 
per second, utilizing the VDM on-board one-shot timer. 

The output rate may be increased to full speed by typing 
the F key during output, or may be halted momentarily by 
typing the space bar. If the keyboard you are using happens to 
latch its data, then typing any other character (after you have 
sped up the display with F or stopped it with a space bar) 
resumes the normal 4 lines/second rate. If your keyboard is 
not latched, then simply letting go of the special key (F or 
space) returns to the normal speed. 

There are two other special VDM control characters: When¬ 
ever a control Z is received, ZVDM will clear the screen and 
restart Basic. Typing a control V shifts the effective bottom of 
the screen up by one line. Since implementing this feature, 
though, I cannot say honestly that I have found any practical 
use for it. 

Carriage return and linefeed characters (CR and LF) 
function just as if the VDM were a teletype, except that you 
shouldn’t linefeed from anywhere except column one. Violat¬ 
ing this may cause your cursor and subsequent text to be 
invisible, since I use VDM hardware blanking to curtain off the 
portion of every line following a CR. 

When ZVDM receives a backarrow (ASCII 5F, or under¬ 
score), it physically backspaces on the screen, wiping out the 
previous character. If the Basic you are using currently inter¬ 
prets mb-outs as character deletes, or any other special char¬ 
acter for that function, then I suggest that you change it to 
recognize 5F’s for that purpose. Then, change the “print” 
handling routines to recognize, say, a $ for the linefeed 
suppression character within a print statement. Another 
feature of ZVDM is automatic wraparound. You may print 
many continuous lines without a carriage return, without any 
ill effects. 

Following the ZVDM listing is my rewrite of the OUTC 
routine. Simply deposit it over the existing OUTC routine, 
and then insert ZVDM and ZTTY wherever you want them to 
go, inserting their address at the appropriate CALLS in OUTC. 

When running, control 0 should still turn teletype output 
on and off, but VDM output should never be affected. VDM 
dip-switch options should be set to: cursor on, blanking 
enabled, and control characters blanked. The other options 
are, well, optional. 

Last and least, you’ll probably need to hit a control Z 
immediately after starting up Basic, in order to clear all the 
garbage out of the VDM memory, and initialize the scroll 
control port. The listings to all the described routines follow. 
HAVE FUN!! 



Number 26 

276 


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


Page 37 



CHAIN" AND "LOAD" ROUTINES 





03 C 

tuj 




p 




p 

QJ 




Ih 


C 03 

rH 




c 




>> 




Q) 


X 

r-r 



QJ 

aj 

c 







P 


C TJ O 

• 



X 

X 

^ QJ 



d 




CO rH 


0 ) C 

E 



03 

p 

X P 



C/ -H 




•rH I-H 


P 3 P 

03 



P 

0 

s c 



p d 




tiD 0 ) 


O O X 

e 




c 

R *H 



•H T 3 




Q> XI 


03 X QJ 

. HO 



E 

d 

0 



X 




e e 


C c 

p 0 



O >> 


QJ X 



O M 




d 


d qj 

CO C 



U P 

p 

X 



PC < 




(U Eh 


X 5 X •• 

03 X 



«M O- to 

•H 

QJ 


O 

C w 




E 


e o ox 

rH 



to d 


c 0 



d X • s 



• 

03 E 


Q> * Q) P 

QJ 

E 


E C C 

QJ 

qj d d 

a> 

rH 

PH+JH 



c 

c o 


> P to X HO 

QJ X 

3 


3 3 

> 

C O X 10 

c 

O 

c c 



Q> . 

Sh 


O X O O C 

P P 

E to P 


CO O 0 ) 

•H 

•rH --- CO CO 

•H 

c 

0 Q) O C 



> p 

X X 


QJ QJ 

>» E 

3 >: C 


.* X 

MP QJ 

P 

P to 

X U X 0 

& 

X 

•H .H rH 

o 


P C CO O rH 

X QJ 3 

to 0 3 


0 X 


3 O QJ O 

3 


E O 


M 

HO rH 

a> 

• 

C d HO 

C CO 

qj 0 u 


O’ Q) OP 

0 

OH Q) 0 

O 

0 +j 

•h E d to 

D 

< 

(0 QJ 

CO P o- 

03 >> 5 E «> • 

X QIJC 

0 X O Q) 


QJ X P - 

p 

C to C 3 

e 

0 d 

C P T) 

Eh 

X 

W 10 X 

co ;>> oj p e « d p p 

HOX O Q) 

aj 0 P 


code 


d x to 


p 

O QJ d QJ 

X 

0 

•H QJ J-, 

0 ) X 

5 

CO P P X C >1 CO 

H J QJP 

X PC 


O E O • 

e 

E X 

E 

c to 

c E n x 

Eh 


o d 

(4 

d 

•H 0 HOX C X X >)p 

O 5 C-H 


TJ P *3 >1 QJ 

QJ £ QJ 

0) 

0 

0 


d 

0 ) O Eh 

TD P 

c 

- - O -H 

CO 0 X ‘H 

0)0)0 


QJ P P 

CO 

P P QJ 0 

p 

X rH X CO iH O 

P 



T 3 QJ 


P CO to -H C S to 

•H 

O C E X 

QJ 

- CO 

3 

CO U c C 

CO 

rH X rH P 

QJ 

0 

*a d p,p 

d HOX 

O QJ -H O X O 

p 03 QJ P QJ 

£ 

0 d 


>> d 3 


>: qj 

0 X. Q) 

CO 

T 3 

C qj 


0 

C >> C r - • 

CO QJ C 

QJ U X 


• to to C rH 

CO P Qj 0 

to 

0 X 

0X0 

QJ 


P CO 

p 

p 

• P 

•HCOPOX>OEQJ 


CO 0 ) 

rH 

to > c 


QJ J-r T> QJ C X 

c 

•a 

to <m a> 

a> 

(0 <hIh£<h 0) 

H 0 ) Q) H T 3 0 lQ )3 C 


QJ O X QJ 

QJ PQ QJ d C 

PQ 

X 03 

C x d 0 


c 

C *H C 

HO 

E 

•H -H 0 *H HO 

P Wi W) CO 

03 CO X X 03 


>»TJ -H X 

p 

Eh C CO 03 

Eh 

O Eh 

d 0 EH QJ 


d 


w 



fe 





CD X 

CD 



X 

CD 






X 



(\f 


Eh X m 

Eh 



CQ 

s 

w 

< 



D 



Eh 


Uj X Eh 

or. 



Eh X X 

5 °. 

? e 


Q to PQ pQ 

Eh « 



W PQ [fi 


Eh EhCO 

Eh 

X 


X Eh W 

< rH 

X X 


X O X < X 

< X O X < 

A 

D 


Q X N 3 


CC X to 

X 

O 

X 

X X < 

X Q X -to 



IH Q J H »HH 

•Eh -h - 



O M 


X Eh - 

X 

V. 

0 Z X 


Eh X 

P O CD <VQ X 

£ to X O to _ w _ 

Q m S 

B 

B 

D 

H 

A 

E 

x m u: a 

< 

O Q < 

O 

W H H Ci, Cl 

X 

O 


X 


X r —1 

Q Q 



Q 0 


X a 

X 

X vO 

VO 


a 


*~H X to 

mxhmP>P>PhJ>C>xX> 

< 

CO Q X H<Jfn 

H10 fH fH 

M x X 

o x x > b 

X < s 

ZXXX< 0 < 0 X>< 0 Q 0 uX 0 X 

2 <SNXCC<WlXr 

< is) < X X X X b r X 

X X s 

•H 00 S 0 »HU 0 '- 3 »hu , - 3 US 0 SQS 0 S<SQ>hS 0 

^UU^QXUXCOQXOXU'H 

<bHOir 

X(/lb 




X 

to 


to 

Q 

O 


;£ 


Q 

< 

O 

X 


I I 


I [WO I &H Ito 
K> P to 


WW4W^HQWc\jr>Wt\jQWQN<vOQNON«r><r\(MacO<HWQNNHfeQNQQ\ONCQ f^O 
W WO r°»Q NOfflONWOO^O'ANOO tN-CO 4 HN NW O OCQ OH < O O N H <UOOXWoQQO 



g 






QJ 



X 



0 ) 





H 

£ 

X 

03 



5 



X 






p 






p 





QJ X 


E 


c 




Q> 




P CD 

0 

3 


o 



C" P 

tJO 





p 

E O CO 


V— 

p 


tj d 

d o: 



d 

X Eh 


3 .* 



c 


0 ) 

CO Q) QJ P 

Q) 

QJ 

QJ 

X 

X 

toP 10 H O 


a 

o 


•H P 

(0 C C >) 

P 

E 

e 

P Eh 

p 

Q X >; O Q) 

CO 

•H 

X 


X -H 

Q) H H X 

>r 

d 

d 

CO 1 

HO 

QJ 0 C EX 


CO 

o- 


•H 

E P P 

X 

C 


d X 

c 

C P QJ P 3 0 

o 

d 

co a> 

d c 

O P 

3 3 P 



p 

rH S 

QJ 

•H X C Q> CO P 

QJ 

« 

3 P 

P o 

QJ C 

X 0 O U 

0 

E 

X 

. O 

rH 

XOOPQJ^JCC 

X 


P -H 

d Q 

X QJ 

QJ 0 e Ih d 

c 

d 

QJ 

X EH 


■HO O >> X O QJ Q> 3 

o 

P 

qj d e 

T 3 

CO CO 

W) P 

>-r 

U 

P 

to O X 

aj 

•H Q> XdQJCPO 


c 

p p 5 

o 

c 

d U E E to 

CO 

HD 

P 

Q Eh 

X 

pnc px Coe- 

QJ 

d 

>> co 

p p 

QJ -rH 

CO d Q) 0 ) 


O 

X -H 

•c 

p 

XC*HOd OQ)-H TJ 

> 

P X o 

Q) 

E 

CO X P P rH 

rH 

U 

O 

C T 3 QJ 


QJ d rH X P C > 0 X 0 ) 

d 

03 

rH P 

HOP 

d • 

QJ O CO CO rH 

r —1 

X 

QJ 

•HT 3 P 

p 

ojpd doodXEX 

to 

0 ) 

d rH 

•H 

VA C O 

E >; >> QJ 

QJ 


• P 

d 3 

3 

x m *h >: n p co 3 to 


u 

QJ >> 

• 

CO 

P to CO X 

X 

QJ 

e d 

Qj — X 

X 

P O QJ XX -rH 



a> X 3 

X Qj 

P 5 

p co e 

u 

> 

•a ho 

> P E 

P 

r 0 p.HQ)P>'OTJE • C 

co 

T3 

> U d 

d > 

CO QJ X 

qj d x ffl d 

d 

d 

T 3 QJ 

d qj 0 

3 

CQJCXQ)d 3 C 3 QJ-H 

aj 

c 

d d Q) 

QJ «H 

C C-H 

ttfrH Eh Eh Eh 

Eh 

CO 

d c 

co HD 0 

O 

d HO’H o H 0 CO d dXTJX 


d 

CO EH C 

>j HO 


X Q 2 - 
POOQ 


cd to b X 
HQO J 


CD 2 
Eh ►h 
- C/J X 
•• Eh Eh O 

• cc w no w 

•toCD -O * 
< < < 
X X X 

H JJH.J H 
><<><> 
S O CJ s o s 


w 

H 

s s 

O to 


CD 
PQ 
6h 
S X 


•Q O 


< Eh X 

„ w q a - - 

Q Q O ^ X < 
X X J 


< x 
x < 


B S 

JOIO 

•o *o 


< x Q < : 
O X X o ► 


X 
Eh 
X 
■ 6h 

Q X < 

CD X X X CD 

><>><>1 JP><>hJ>hJXH 

^ — 00SI0UX<X0<0< 

. ' - SOSO 


H Nj . ^ 

XXXOs = i‘--»'-'S. , -JOit«a. 
UhP^OSSUKXPQ 


Eh X Eh Eh 

X X b b ^ X 

Eh O O S O < Q to ® O co O IS 

- - Uj * O * * £ • O X Oh4(/} W 

xm < mfflxQ<wQ< o wnoX'O 
' X X xo 

SHQSObSOKWH<bXOK 


X X CD X X * 

g >P>JXHHP>JQ>X>s'><M> > 

o<o<ux><0<Q0X00XX0< 

HHSOSOXQSOSO<S'-HQSO'- 3Sc 


X 

§ 


O X 
o o 


0) 

TJ 

o 

c 




to O I to 
vO CM I VO 


pj toW-3'rHWQQWQWQrH<Qmtoc\J.HQtotoOtoC^-Cq<0'< v '\QQoQeQ »-»'0 q WQOr-n«<nNC0QNVVll'0NHr\O 
ol WWOHnoononOHHOHWONNWVONN'OrdNHNNONOWwOUNOCO^tNJHNCqoNOOWQWOWQO 



Page 38 


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


Number 26 

277 



e o 

E p c /3 
0 ) Cl) C < 
P E 3 
to rt o p 
>> E o E 
tO 0 

p p to 

m a) «j c 

Eh t*0 CD -H 


to £ 0 ) 

3 0 0 0 C 
E p E 0 -h 

x 0 p p 

H£H W-H 3 
(0 JH-H O 
O rt C E I 
0 O X -rH i 

to .o S x Eh 
•H 0) < P GQ I 

X O £ 2 -H h 

P P 


a-H ^ 

O (O+^XU 
0 ) (h (DO 
P E Eh O 
< X 


X E 4* •' 

c a o 

3 ttJ 

*Xp .O 

0 c 

> -H P 
rt Ed) 

to a, no 


1/3 >H X * X 


t/J 55 


HKX X H 

X • O < < 


X < 

z 

z 

»-3 

Ub.QQp 200 
Z[qw[i]gx 04 

B§ 

X 

Z 2 

Q 

Eh Z 

H JEW - - - 

P - 

X < 

X Q w X 

HX 4 < xmsmxos 

£h X 

Q X 

X X < X X 


X O 

XXX X 

OhOJ jHHH 

XXNHh 

O O 

to t /3 X X X X Eh 

X c /3 O < X > > 

O z z > x 

X X 

2 D < O O < [il 

h t/j O^SS 

PHbSX 

X 

X X O X X 0 x 


HOHK 

X w w 

W X rt Eh •• (NJ 


Eh 

X w 

Cx 3 X 


Z W 1/3 w w 

•« 

z Eh 

W 


§ 

X Eh 

| 

X < z w z z 

X 

X S 


Eh ZZ X Z Z 

0 

Eh O 

X 

* * * * 


* * 






E 






E 0 


O 






O > 


•H 






•H O 


P 






P X 


O 






0 rt 


3 






3 


E 






E < 

X* 

P 






P Eh 

X 

to 






t 0 C /3 


E 






E 

E 

•H 






•H >3 

•H 







X 


Eh 






z 

=*h 

3 > 






M P 

O 



< 



0 

P 







X to 

E 

X 



E 



O 

O 

O P 



•H 

0 

0 

T 3 

X 

E 

Q 


0 

e 

E 

X E 


tj rt 



E .* 

0 

•rH 

e rt 

■P 

E P 

0 


•rH 0 

X 

P 

rt e 

0 

rt to 

r-H 


P 0 


3 

E 0 

HD 

E E 

X 

P 

3 tO 

0 

O 

0 X 


0 O 

rt 

•H 

O 

HO 

E 

(X OX—' 


X O 

•H 


E 0 

O 


O'—X X 

0 

O 

E < 

P 

5 

P T 3 


z z 
a: x 

< P Eh < O 

X -< - * 

<Q XJI 

P X 
P > < > X Eh 

<O^ZO>W 
O 2 03 X S 2 OS 


3 e to rt x : 

o *h a> >> > o t 

E a to 

P E P 't 

PQ a> O PQ 0) s 

Eh MX Eh M l 

Z 

X ° 

•f CQ 
Eh a: 
a. <co 

P Eh > O <2 

- P - • » • > 

<OX(OJtJ< > 
(X 

0 ,><hhQ>>p 
XO^X>QOO. 
WSi/) Js<?»sc 


E E , E 

0) -p -p .h P rt 

P rt 3 X 
to X XP 

>> ? *H 


< 2 < < 
<P <X 

^ggsga 

OSSXSK 


rt x> td -a 
to -h rt o n 

03 E *H -P 03 rt 

0 rt 0 E E X 

E > 3 rt -h -p X 

-T3 P X > a 

tJ-H e rt a. rt 

rt 0 > x P 

0 P O < 

p > to p p ; 

0 rt >» 0 0 < 

M to to M bO ( 


x < p p < x : 

x x 

XC/3XhHQ>>XP 

xz>x:>qoooc 

xxP5<ssx; 


Eh 



X 

X 

fxj 

Eh 

w 

X 

X 

w 

0 

0 

X 

X 


QrHvovo w^r^CNJ^O On 

o rt o no (\3 o no 


vp,\t\Q HrlQ^ 

W Q U Q fil u O 


O Q 04 PQ CE'O ON 
O rtt^Q'O f\J O 


^QfVJHtillAlL, Wr\N 
Q C^.r^r>»r>cONO S- Q X 


Q WEENOv 

O C^-NO < NO O 


EiAH WiAEWHNrt 
Q W (NJ f^QO no C''- X X 


0 


X 




t/ 3 —* 




o- 







E 


2 




•H 3 




0 







O 


^3 




O 

E 



E 



t,. 










£ E E E 

w 



ro 



C 3 



0 

5 


E 




O 0 0 

X 



E 



Z X 


Z 

E 

0 


O 




X E P X 

O 


E 



P to 

f-H O 


O 

ra 

E 






< O 10 X 



0 

E 


E 0 

X 


X M 

E 



P 




^ P -rH 3 

E 


P 



O >, 

£h X s c 


Z X 


P 


c h 

—' 

. 


10 HO X 

. 0 


E 



P, 

t/j O < •• X P 

< 

X P 

E 

E 


E rt 

X 

X 0 


0 >> 0 

0 X 


3 

to 


X 

• Z X Ul < 

O 

x 0 

rt 

rt 


0 P 

£ 

X l-H 


E t 0 \E 0 

E P 


O 

E 


rt *h 

EH—'X P < O 

X 

X W 

E 

5 


p to 


• Eh t /3 


rt _ E 

O O 


O 

0 

p 

p 

X 0 P < 2 X 


X 

hL 



to 0 


Q < 


e m 0 -h 

^ ^ c 



P 


rt p—' 

P C Eh PI P PI 

2 0 ' 

0 w 

O O 

p 


•H E 

E 

< 0 m 


Eh| E rH 

E rt 


TJ 

O 


x ox 

Eh rt W X t/j X 

< O 

Eh 

0 E Eh 0 0 

to 


HO 

0 O 

O Eh 


0 y rt p 

E 0 


E 

rt e 

t -1 

E 2 

P>X ( 3 sC < 

X * 

s 

E Xc /3 E E 

3 


0 T 3 

ja' 

X X 


e/ e e e 

3 E P 


rt 

E E 

« 

TJ *-3 

P to < Z O — 

O r 

• <2 

•H • Eh -H *H 

E 


E E 

rt 

X 0 


1 3 O 

P rt E 

to 


rt 3 


E X 

Z — Eh PI PI X 

O P 

r X 

p tM X P P 



rt 

E P 

-w 


X X O E 

0 0 

E 


X P 

C 3 Eh 

rt -he 

< O X x X 0 

X PI 

z 0 

, 30 X 33 

0 +-» 0 

0 


W EH X 


•hI OoX 

E 0 t/j 

0 


0 0 

X 

O CN- O 

x X i: O x 

X P 

P O 

O O O 


k- ^ 

E 

J rt 

2 t/. W 



5 E 

P 


E 

X 0 

X C_> E^—- 

X r : 

s 

X X 

E to E E E 


■H P 

rt 

0 p 

< H P-. 


c X* E* 0 E 

0 -H 

E 


>t 

0 p. 

>S *H 

M .. 


r X 

to O 

• 

E 


E to 

z 0 z 


•h Z xi P rt 

bo - 

•H 


E - 

X 

0 H£p 

Eh W •• 



E 0 X E E 

P 

XP 


0 

X f-n 


rt x >>x 

rt to * 

O 


rt to 

< 

OPE 

C/J 2 x 04 


2 X 

0 E 00 

O 

3 


rt E 

* X 0 

VT\ 

rH E rt x o, 

•H 0 0 

a 


E 0 

Z Eh 

E 3 rt 

X < Eh Eh 

Eh 

O O 

PTJ<PP 

E 

• O 



0 X 


X rt 

E >1 E 

X 


>> 

0 c 

E P EP 

CJ Z 0 j t/^ 

CQ 

X < 

tO T 3 10 W 


to 


P T 3 

X u 

P 

E 0 p p p 

E 

E 


O 

0 p 

3 E to 

men co 

S 3 

X w 

>> rt E >> >> 

X 

0 


0 E 

X 2 Eh 

to 

O rH 0 0 0 

rt x x 

3 


O X 


OOO 0 

X 



to rt to to 

•H 



to rt 

< X 

E 

O O HDHOHOO"H*HX 


P -H 

X P 

>> O XJ E 



X w 

p 0 





Q Z W 







0 X 


Ctl 


0 x 

« 0 rH x CQ 





M Eh 







X < 


2 


Eh O 

Eh no 0 EH Eh 





X fil 







O 


< 


< X 



W 

0 


X X W 


CNI til 





0 . X 




X w 



5 

Eh 


< Eh X 







U . >h 




« 



§ ►-3 i -3 

m C oM<h36hX1Eh 
OXZXXCc/'jCcq 
xoppxoxox 


- < z < 

X Z X O X < 

XOOZ * - Q CJ 

j.i^xm^. sx 

§ H < XI H»—(< H > X X X N Eh 
O X CO <X>QXN022asW 
HUhO JS^UXShhQHjX 


< X 

• O 

s x q m *o 


PI X 
X 


X O 04 

Eh 

4 

X 

ws £ 

X O 

CJ W 

P"N 

O W On NO X 

X 

H< X 

5 6 * , 

X 

X O O 

PI 04-4 NA -4 ^ 

4 

Z 0 

2 pj x 

eg eh 

X 

X 


X P 

Z Eh X 

X N Eh 

Z X Zt /3 

< O 04 -4 O O 

O 


X XX 

X Eh 

CNJ \Ti 4 - 04 4 ^ 

4 

X < X 

• x O 

Eh < 
P 

x 0 X X 

O 

Z O vr rH P X 

O 

i 

Q < 

x < d d 1 

c n 


X 04^-44 -4 

04 

00 p 

x rx 




XX < 

X X < < 

C 3 

X 

604 iAnava 

P 04 NTN 4 VA 4 

P 

4 

X O 
Eh 

P x 0 0 


P 

o o 'nrvj r^CNj 

b, tNJ 4 VAVP\VA 


EWrtHEQ C^-Q Cn» 
U3XOXCOOOO 


ewcQhvo < x cu r^- c'n rN c\j q, 

Iilb,UO(MOrib,t)MNJHGUG 


iq N O N 
Q X O O 


o o w n« 

CNJ 04 4 4 ^ 


O -4 ^OVOiCVJ 
04 vn 44 ^ 


O O'oo 00 X 
04 4 4 -4 4 


O CO C^-rxcsj Q 
C\J -4 NTN4- VAO 


II II 
II II 

Q rH X Q Q O' 
OH «<000 


Number 26 

278 


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



05 

o a- 

£ P 
•H p 
CO O 
X 

>3 

. X X 


05 

P X) O 
O 05 P 
E VI O 
>3 M 03 
£ Cd 
Ct P, O 
P 

p -n 

- £ P 

cop 
CO CJ X 
•H 05 P 
10 3 
P O 


P 13 r 
C 05 

p x 


05 

P 

O 05 

E £ 
05 X 
E 

O X 
CO O 
p 

p -p 
H C 
03 O 
5 O 


P 

05 

P C 


o o to 

>1 05 

S cd-H p 

X P 

Q P p 05 

£ 

> 0. *H P 

r-H .M 

X CO C/3 

o o 

O CJ O-H 

• Pi X 

P X UD 

05 +J 

Eh 05 

E £ >» 

P> P P 

OOP 

. -H O 

X O O 

P Cd CO 0) 

E 

•HP P P 

O rH 05 

p 0) P o 

CiOrH F 

05 X P O P 

o 

> P O CO 

X p S 

ro p p aj 

£ O Q 

CO O M P 

cd CO > 


X 

Vi CQ S 

Eh jE S CO Q ~i O 

X ft, to3CO •>0', o 

<co&,(\jo,>os x n: o x 

s o 2= n o o 

* * xcehxxxxeh 
N2fcNO^P>IOOril(q-. ; 
'-J H u b ft, u O S W O, P. K n 'Q 


o 3 
csi > 


•• < 
a-a- 
^ s 
n Q 
> > 


3 3 
> > 






Eh 

o w 


cd • 


Xi 





X 

X Eh 

>-t 

P >3 


05 

(0 




w 

< 

Eh 

P -H P 


05 A* 

•H 




o 

W o 

Eh 

O 05 P 


£ CO 

X 




CC X 


S Cm > 05 


£ 

p p 


£ P 


o w • 

Eh X 

o 

Q cd P P 


P o 

P 05 



X C/3 —' 2 

O X 

T3 

> E <U P.-H 


cd £ 

X XX 


05 p 


- o 

X < 


O rH 


X X 

•H P 


X o 


-PQ X 5H 

X 

O 

O O CO CO 


p 

S ° 


P X 


2 CQ X C/3 

< X 

tiO 

P P 05 -H Cd 


o 

Cd-H - 


P 


•H O X X 

o 


£ 


CO x 

< X CO CS3 


'V -H 


S Q < W 

W >H 


P X to 05 


p p £ 

M) p cd 


H £ 


O Q X > 

o 

£ 

05 W) O -H E 


P -H 

S m <H 

• 

3 

s 

1 X W • or 

< w 

o 

p p to x cd 


ox • 

UP OP 

O • 

Q 

X X CC W W 

X cc 


POO P CO 

0) 


> 05 x P 

p 

O - 

> 

X Q u 

Vi W 

(0 

-Cd£- 

p 

X P P 

cd 


CS3 

P .. M < 

X 

•H 

£ P 05 0) X 05 

o 

CO X 


CL, P -H C P P X 

sojowon 

*"3 O 05 >3- 

bO CO P ■€*• 

o C -H >5 -a: 

p -h x p oj oj x 

X -P 0)£HQ 

T 3 -p > -p x 

0) 05 05 05 E EH 

M E C/5 05 03 2 

C O 3 P P X Hf 

03 CO 05 CO 05 cc 

x o p £ X 

OC+J'h'H P - 
-P 03 E o 

05 -H -P Hp bfl 
P J CT1H c 

03 05 05 *-H 

>>T1 5 -P O -P 

03 05 PH'H P 

E co P a x to o 

p o p -m ro aj 

>3 to ? rQ x 


O 05 


05 


i x> <M P C x 


P P --H -P C 
P P co 03 E 
P CO O 03 O ► 

to -h cq -h ; 

C • <M 
•H P O P -H J 
05 -H c 'CJ H 
O >03 03 O V 

•h oJ 5 e : 

Eh P CQ 

W P P 0) 

cc > 

s c c o 

05 Q -H OX) 
X > Eh X Cd 
Eh 


05 



Eh 

X 

w 

w 


W 

3i 


o 

cd 


£ 

O 

X 

«m 

P P 




o 




>3 > 

Q 

p 

£ 

w 

D 


X 


w 

X 


X 

X 

X 

05 

•H 


p 

0> 

P 

05 


o 

p 

05 

W 

£ 


> 

05 

o 

X 

O 

w 

Eh 

X 

CJ 

Eh 

W 

o 


o 

P 

P 

P 


X 

cd cm 

X 

cd 

p 


£ 

X 

O 

Vh CO 

(S3 

X 

•H 

Q 


cc 


X 

< 


C/3 

p 



•H 

P 

CO 

X 


P <m 


p 


■ 

•H 

A- 

•H 

O - 


p 

P 

2 

Q 

< 

X 

X 

X 

2 

X 

•H 

P 

p 

P 

o 

05 

O 

CO 

CO O 

>3 

cd 

p 

O 

P 

O 

CO 

X 

P 

05 

cd 

< 

X 


Eh 

< 

cc 

5—> 

w 

3 

o 

P 

o H 

p 

P 

3 

cd 


cd 

X 

P 

cd 

P 


P 

05 X 

cd 

W) 

o 

X 

O 

w 

Mi 


w 



CO 

£ 

X 




E 

3 

P >2 

E 


XX 

O 

05 

05 

CO O 

X 

o 

o 



cc 


w 

Eh 

Eh 

W 



p 

P 

>H 

05 



P CO 


p 

p 


P 

X 

> 

O Q 

p 

p 

X 

o 

w 

w 


Q 


M 

X 

Cm 

<H 

p 

o 

Eh 

X 



o cd 

p 

05 

p 

o 




X 




Eh, 

X 

X 


o 

M 

X 

w 

•H 

•H 

o 

£ 

Eh 

p 



>3 E 

o 

bO 

o 

bfl 




Eh 





P CO 
O 05 

co m 


T5PH 
05 P 
CO P O 
3 Cd 05 
05 Cm 

P H P 
HOC) 


Eh w w 

cq >h w 

w w w x 

O CO X X Eh 

< CQ O Eh 

XI W O 

ft, X W Eh Eh 

W Q C/3 D 
X Q O 

< X CO 

2 Eh -W 

< W • CO 
CJ X X CQ CQ 

Eh O • X 

S Eh 2 

• Eh Q 

5-H O 5-< X Q 

Eh H X O <1 

X CO X 

o < X X w 

X CQ W O X 
CQ H £h 
CO >h co 

5-hX W X X ~ 

x 5 -h x w o x b o 

EhEhEh>X Eh O X 

**** + + + + * 


X 

g£ 

X X 
< 
5-3 

5 X 

g w 
CQ 


>h b x 

Eh CQ O 
Eh X 
A3 - 
O S 


X g 

6 h?> 
O Eh W N 


CO C/5 

a -8< 

X 

CO < < 
X Cl X 
X 5-3 O 


e -0 X 

5-3 

S XhJX 
o < o 
X X O x 


X 

o 


HNHEH5 
X X >■ X ? 
0X202 


o p c 

• Eh O 

P X 5 1 
P O J 
O (0 ^ 
X 0) to 

X 05 i 
03 P P I 


T> P 


03 C X 


X 

■ CHP 
rHH 0J 
1 X *H 

IH^Pft! 

: x >h .m x 

5 -H Eh CN 
5 Eh P O 


CQ 


I 


j p • p c cd x 

X O 0) *H O X 
P + 0)>)>J-HCMN 

3 -h x o cocdcdo 

O ^ EH X X P p 
>3 -H 0] O 05 ie - co 


X 

3 r co 

X >H C/j X H 

X X EH X X a 

X Eh 

M X EH X 

X X iso O X S 

h<h 3 xo ' : 5 


>H 

Eh 

Eh 


ICO X 
IO X 


ISc 


< m .'<1 < x cj cam) c\j >—i»—i O' o o 

uaxuxncincMXWuoo 


IO O Q 
IO O O 


UA< A- 
X cacq 


WHQOOftIO WNWOn 
OXOOOXO<AQcAO 




CQMD < rH (MCA 
QWUXQO 


O H4 <QMH 


O'fflOWXH 
(M cm cm cm cm (A 
a-a- a-a-a- 
o o o o o o 


05 0) 
£ £ 
• H -H 


CO *H 

p 


a 

05 



£ 





X P 


X 

o 

£ 



£ 

0) 


05 





4 r“1 

3 

05 

p p 

P X 

05 P 


(0 

O 

P 


05 





* o Cm 

O 

£ 

(0 

£ 

K 05 05 


(0 


O P 


P 





P O 

P 

•H 

P £ 

0) P P 

O P P 

A- 

05 

£ 

£ 05 


O P 





P 


X 

•H O 

P CC-H 

o o 

£ 

o 

>> E 

bOP 


CO -H 

>3 




X £ T5 

£ 


Cm 

P P X 

o co cd 

p 

o 

cd 05 p 

•H c 



cd 




SO £ 

P 

p 

p 

05 P P 

p p 

p 

p 

3 ox 

•H 


P O 

3 




b CJ • 05 

3 P 

£ 

05 05 x 

P O 03 P 0- 

o cd 

p 

X 

cd cd o 

• O 


Cm T 3 

cd 

£ 



P • P 

P 05 P 

05 

P X P CO 

O P O Eh 

0) P x 

A- 05 


X o 

CO X 


•H 


05 



cd CO -H P 05 P 

05 P P 

p 

OP U-H 

cd O O CO > 

bO o 

p 

O A- 

o w 

05 

A- 

X O A- O 

05 



10 -H P o 

P £ cd 

p 

co Cd £ 

P p cd P 

s* 

p 

bfl 05 

bOr* E 

>3p X> 

co a- b£/csj bo 

P 

P 


05 05 X £ Cm 

•H P 

3 

P P P-H 

cd P p cd 

Cd CJ M 

•H 05 

o 

o o 

£ P 


T3 


O 

p 


X X -H 05 -H 

0) O W 

o 

3 oj cd «m 

X P cd o 

x ido 

X bO 

• cd 

• cd P «M Q5 

X 

• 05 « 

x — 

P CO 

cd 

o 

bO* POP 

bO x 


O > X 

O 05 X P 

c X cd x cd 

CO XP X Cm 

•HEX 

O 

CO 05 03 

O P 

• cd 

p 

•H 

>3 £ CO -H x CO 

cd O Cm 

O CJ o 

P CJ X-H 

X 

CO X-H 

05 CO 

o 

0) CO 

P 

05 V-, 05 

P o 

to 05 05 TJ 

co 

CO 

Cd-H p 05 

•H P p 

o j* bi 

X C -H 

. 0) 

P-H P 

>3-* 

£ - 

P -H p 

>3 0) SP £ 

05 X X £ 

05 

cd 

E £ • 3 XP 

P 05 


o 

CO -H P P CO 

CO > P 

X P P 

O 

w 

O £ 

£ 

£ 

£ 

>3 O P cd 

P CQ 

^ cd 03 • E 

P co 


s "s 

P O 05 P cd 

0) O 05 

0) p cd «m cd «m 0) 

05 -H 

O X -H X 

O «M 




05 05 O 3 O 

cd 05 


X X t>0 co 3 

>3 E bo P co o 

-H X 

•H >> 

TD P, 

O 

•H X -H 

O -H 




E >3 £ X bO o P 


co cd 


P vS 

05 >> 

P X 

£ 


viB 

— £> 05 
rH O £ 
cd -H Cm -H 
E P O rH 
•H *H 
O (0 X X 
05 O £ O 
X X 05 


P £ 

O 05 
X 

p 

X o 
O X 


p p 
05 cd 
(0 P 
0) CO 
p 

05 

• x: 

>jp 

i P 
o o 
E P 

05 


P 05 P 
>>£ O 
£-h P 


§ +* 
a e 

> *H 


X o 

05 X X 

c E 


05 


O JC 
t»D O 


O X 05 S 
-X O > i 
P O 

O P X * 

£ - £ 05 r 

£ 05 5 
X O 

•H'd -X 
CO -H 
05 


P,Ow7> 


P 

P 

9. 

CO P 
•H » 
£ 


0) p 
E X 


0) X 
X P X 0) 
H >j P CO 

o x cd co 


X 
5 s 
was 

X X > -X CQ 

< C^-O 

X X Q 

S CQ W > m 5-H 

DIOZX 
x X 5-3 s <0 


2 > O 
*-i S H 


3: CQ 

WXXK 

x a 
x _ 

XCQ5- 

03SXN 
X X <Ob 


o 

o 

o 

Q O o 


cc 


Eh i-3 g 5-3 X W 

XX * X H 3 M3 X 5-3 < W - 

»A2<nQl>HU* XH5 x 

> CQ 5-3 

X ^ ^ *h *-HMM5HX>5-H 
X2O2NgSXNft.M0/2;X>2O(n 
o^s<x3So'-^oh)O h ^5-3SHSo. 


LAO 

V.. A- < g - 5-3 < 

•0 5-3 os - 3 --o- 

X<noOCMQSX>S<Ot-3 

> 

HHX>H^JEhH > X X H > 5M > 

*“* “ ^''"~'2oqXoOXS>OXO 


s < s 

•O -M 

<COS> 
> Hi > X 

O X o s 
S o s X 


g 

> 


X 

o 

o 

5-3 

o 


n 

w 

w 


Ml < O 

-o - - 

<-3- 5-3 < 

> M > ► 

O Q O ‘ 

s < s; 


< 

LAX 
< 5 CA 

•Q - 

X X > < 5-3 

o > X 5-H < 

Q O s > 2 

< s X s < 


S X X 
Q • O O 
> < a cq 

S >hm 

0X2 

X S O X 


Q 

> 


P 

X 

E 


•Q H X 

X > o o 

5-H c Ml 5H 

> a q 2 

S 5-3 < < 


>j 

£ P 

5 cd cd 

< rO 
1, 05 
P 05 
) CO o 

i cd cd 

? x 


cq - Eh - 

X X b < 

CM - O - 
XO x 
C/3 5H 5-H 
D 2 X (SI X 
X M O X O 


vava < WMD W 
WXNNWX 


l§ 


CM W A- rH V 
O CAA-X f 


IS 


Q I CM 


l§ 


IX 

IrA 


:mcAfi3- 

5 CM O X C 


JHVOAO 
5 CM (ACM A- 


W CM A'- 
Q O O 


W < A-CAfA'X Q\0 X M'O A-CA QvQ X tl O NiAWLACM O ft! C 
X Q NCM U AN W^O Nft, NO A*-O'O CACO vO O <A < O A-X C 


CM M3 

O 


) LAX W < PI 
1 X Q X O X 


Page 40 


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


Number 26 

279 



SOME USEFUL SYSTEM ADDRESSES 

ROUTINE DOBB’S VERSION ADDRESS 

I.A. VERSION ADDRESS 

PRTSTG 

063C 

0560 

GETLIN 

05D6 

04FA 

CRLF 

OOOE 

OOOE 

ENDCHK 

05A0 

04C2 

FNDLN 

0614 

0538 

PARN 

04FB 

041A 

AH0W 

00A0 

O0A0 


TWO S-100 GRAPHICS PRODUCTS COMPARED 

Dear Sir: Received: 78 May 12 

Since I have benefited so frequently from the philosophy 
of DDT s communications I wish to pass along an evaluation 
which may help someone else decide between two expensive 
graphics interfaces for the S-100 bus. The Super Dense Merlin 
and the Matrox ALT-256**2 cost about the same but have 
different features which may not be obvious until you have 
gone to the expense of purchasing both. I already had an 
established computer system and needed a graphics interface 
as part of an economical prototype suited for self-instruction 
by simulations of physiological systems. 

Initially the Merlin was the only alternative so I invested in 
the double board and a third tier to get 320 H by 200 V dot 
resolution graphics plus ASCII characters. The factory- 
assembled board was complete and met specifications but it 
was very exasperating to implement in any of my collection 
which includes two Altairs, a TDL ZPU, and a SOL. A major 
source of difficulty was associated with its DMA on the S-100 
bus, a familiar problem to many these days. A major part of 
my memory investment was not compatible, the Z-80 was 
usable, but not the 8080A when the DMA was enabled. In the 
SOL (with no front switches) I could not disable the Merlin 
DMA to even initialize the display parameters. 

In the meantime the ALT-256**2 became available, and to 
meet a pressing deadline I took a chance on a second invest¬ 
ment in it. This factory-assembled board had a solder bridge 
which kept two of the port decoding bits high and made the 
screen respond to addresses as commands (how did that pass 
a “24-hour burn-in”?). Once this was found and removed it 
has been sheer joy to apply the graphics. Within a day I made 
up for several months of lost time. 

The Merlin can be configured for keyboard and cassette 
tapes, may have an on-board ROM monitor and editor; thu.. 
it can be a basic operating system. The Matrox, on the other 
hand, displays dots on a screen, and nothing more. A compari¬ 
son of the features of each follows, viewed with a bias of my 
particular needs. 

The Merlin DMA slows down the CPU to 43% normal oper¬ 
ation speed as the video signal is being generated whereas the 
Matrox does not. If there is any flicker in either one this is not 
noticeable and not as important as the computation speed in a 
simulation application. The user must supply 8K of memory 
for the Super Dense graphics whereas the Matrox has 8K of 
dynamic RAM included on board (a costly component). 

On the Merlin, dot information is in successive 8-bit mem¬ 
ory locations, the addresses of which do not easily relate to 


the X and Y coordinates on the CRT screen; but since the 
Matrox has 256 x 256 dots the dot addresses correspond 
nicely with the position on the screen. The CPU communicates 
with Merlin by memory addresses (not moveable if the sup¬ 
plied monitor is used) whereas the Matrox uses 4 output ports 
and 1 status input port. For the latter one output sets the X, 
another sets the Y, and a third turns the dot off or on. A 
fourth output clears the screen within microseconds whereas 
the Merlin requires a software routine lasting seconds. 

The Merlin has several display options including hardware 
ASCII of 16 lines of 40 characters; three different densities of 
graphics, and both mixed characters-graphics and splitscreen 
displays of the two. The Matrox requires software generated 
ASCII characters to be placed in memory, however this board 
may be synchronized with an ASCII board to give mixed dis¬ 
plays. Also several graphics boards may be synchronized to 
give multiple levels of intensity to each dot. 

If you want to get an integrated operating system and 
graphics package and expect no DMA problems, the Merlin is 
worth your consideration. If you want to add graphics to an 
existing system then the ALT-256**2 is apt to be more suit¬ 
able. With the growing interest in graphics capabilities, compe¬ 
tition is apt to produce packages at less cost than either of the 
ones described here. 

Yours Truly, 609 South Jordan 

James E. Randall Bloomington, IN 47401 


SELECTOR II REPORTING SYSTEM 

News Release Received: 78 April 28 

Selector II is a data entry and demand reporting system for 
users of CP/M and Microsoft Extended Disk BASIC. It 
provides timely information at the user’s fingertips, as well as 
allowing on -line updating of data files. 

Unique reports can be generated in minutes, with no pro¬ 
gramming experience required. The required information is 
simply selected with any variety of conditions desired and in 
the order wanted. Output can be used by programs, displayed 
or printed as a titled, columnized report. 

One-time license price of $225 includes 1-yr warranty. 
Selector II is available on single-density 8” diskette complete 
with user’s manual from Micro-Ap, 8939 San Ramon Road, 
Dublin, CA 94566; (415) 828-6697. 


QUAY 80 FI-S-100 DISK SYSTEM 

News Release Received: 78 May 15 

A floppy disk system for use in S-100 bus computers is a- 
vailable from Quay Corp., P.O. Box 386, Freehold, NJ 07728. 
The Quay 80 FI system, priced at $795. includes the Q/80 
FDC-floppy disk controller board (capable of supporting up 
to four disks), QDOS—disk based operating system, the 
Q/FD1 125 KB 5%” band-driven disk drive with power regu¬ 
lator and interface cable, and the Q/80 FC—floppy disk cabi¬ 
net. Add-on drives (Q/FD1) are priced at $395. each. In addi¬ 
tion to the floppy disk support, the Q/FDC has available a 
programmable 8-bit, TTL compatible, parallel I/O port capa¬ 
ble of supporting standard peripheral devices such as line 
printers, tape punches, keyboards, etc. Product availability is 
30-60 days ARO. 


Number 26 

280 


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


Page 41 



A Z-80 Disassembler inTDL 8K BASIC 


Dear Dr. Dobbs: Received: 78 April 20 

In the March 1977 issue of DDJ you published an anony¬ 
mous listing for an 8080 disassembler. For any student of 
BASIC this was a beautiful bit of work. I can’t hope to come 
close to the original in compactness of code work but anyhow 
have tried to build on it as best as possible. Enclosed is the 
Z-80 version, written in TDL’s 8K BASIC and generating 
TDL’s mnemonics. 

The line numbers are fairly well preserved from the original 
version but all of the comments have been omitted for 
memory compactness. You shouldn’t have much trouble figur¬ 
ing out what was done from the original listing. Some changes 
were made for my own convenience. First, it was necessary to 
use “escape” characters to control the screen clearing, etc. on 
my relatively smart terminal. Second, the listing is controlled 
by a start and end address which are specified after the “>” 
sign. Third, the listing is continuous and I have eliminated the 
“J” routine. Fourth, the screen clearing activity is made to 
progress during the time that the files are being loaded. This 
goes with the smart terminal. Finally, the machine codes are 
printed along with the mnemonics. I still like to see the 
machine code since I grew up that way. 

In the spirit of the original version, please omit my name 
and address from this article. 

This is an example of how the disassembler works. It is 
disassembling a portion of the BASIC (TDL 8K) on which it 
is running, of course. 

Note the limitation on memory address, so the BASIC 
had to be moved to a lower address for the disassembly. 


40 DIM B(b) 

50 GOSUB 9O40-.HEM BASED ON BOBO DISASS.— DDJ MAH 1977 
102 PRINT ES$;CH$;ES$;CS$:GOSUB 9030 
110 PRINT " Z-B0 DISASSEMBLER".'PRINT 

160 PF=TRU£ 

210 PRINT 

215 GOSUB 220:GOSUB 5600 

216 IF C*=" " OR C$="Z" OR C$="-" THEN GOTO 430 

217 GOTO 210 
220 GOSUB 5600 

250 IF C$>="0" AND C$<="7" GOTO 300 
260 IF PH THEN GOSUB 6200:GOTO 220 
300 T=C-ASC("0"):N=1 
310 GOSUB 5600 

320 IF C$>="0" AND C*<="9" THEN D=C-ASC("0"):G0T0 400 

330 IF C$>="A" AND C$<="F" THEN D=10+C-ASC("A") :GOTO 400 

340 IF C=127 THEN PRINT CR$;ES$;EL$;:G0T0 210 

350 IF PH THEN GOSUB 6200 

360 GOTO 310 

400 T=D+16*T:N=N+1 

420 IF N<4 GOTO 310 

425 RETURN 

430 PC=T 

440 IF PC<=32765 GOTO 450 
445 GOSUB 530:GOTO 210 
450 GOSUB 220:GOSUB 5600 
452 IF C$=CR$ GOTO 455 

454 GOTO 450 

455 PE=T 

456 IF PE<=32765 GOTO 900 

530 PRINT "ADDRESS TOO HIGH":RETURN 
900 PRINT CR$ 

1000 REM “MAIN LOOP** 


1002 Nb=0 

1010 X=PC:GOSUB 5450 

1020 PRINT ”: ";:PRINT TAB(15); 

1030 GOSUB 5000:OP=X 
1040 GOSUB 2060 

1045 PRINT TA6(33); 

1046 FOR 1=1 TO NB:X=B(I):PRINT SPC(1);:G0SUB 5100:NEXT 

1047 PRINT 

1050 IF PC<PE GOTO 1000 
1060 END 

2000 L=INT(0P/B1T(6)):M=INT(0P/BIT(3)) AND 7:K=0P AND 7:RETURN 

2060 GOSUB 2000:ON L GOTO 3010,3210,3510 

2120 ON X GOTO 2210,2410,2510,2610,2610,2710,2810 

2132 IF M=1 THEN S$="EXAF" 

2133 IF M=0 THEN S$="N0P" 

2134 IF M=1 OR M=0 GOTO 5700 
2136 S$=JR$(M):G0SUB 6000 

2136 GOSUB 5000:GOSUB 7000:GOSUB 5450:RETURN 
2210 K=M/BIT(1) 

2220 IF OP AND BITC3) GOTO 2310 

2240 S$="LXI ":GOSUB 6000 

2250 S$=RP$(K):GOSUB 6000 

2260 S*=" , ":GOSUB 6000 

2270 GOSUB 5400:RETURN 

2310 S$="DAD ":GOSUB 6000 

2320 S$=RP$(K):G0T0 6000 

2410 S$=02$(M):GOSUB 6000 

2420 IF M<4 THEN RETURN 

2440 GOSUB 6100:G0SUB 5400:RETURN 

2450 GOSUB 5400:RETURN 

2500 REM 

2510 K=INT(M/BIT(1)) 

2520 M=M AND BIT(O) 

2530 IF M=0 THEN S$="INX " 

2540 IF M=1 THEN S*="DCX " 

2550 GOSUB 6000 

2560 S$=RP$(K):G0T0 6000 

2610 IF K=4 THEN S»="INR " 

2620 IF K=5 THEN S$="DCR " 

2630 GOSUB 6000 

2640 S*=REG$(M):GOTO 6000 

2710 S$="MVI ":GOSUB 6000 

2720 S$=REG$(M):GOSUB 6000 

2730 S*=»,":G0SUB 6000 

2740 GOSUB 5200:RETURN 

2810 S$=07$(M) -.GOTO 6000 

3010 IF M=6 AND K=6 GOTO 3160 

3020 S$="M0V ":GOSUB 6000 

3030 S$=REG$(M):GOSUB 6000 

3040 S$="Z ":GOSUB 6000 

3050 S*=REG$(K):GOTO 6000 

3160 S»="HLT":G0T0 6000 

3210 S$=AI$(M):GOSUB 6000 

3220 GOSUB 6100:GOTO 3050:RETURN 

3510 ON K GOTO 3570,3610,3805,3630,4005,4120,4210 

3530 S$="R":GOSUB 6000 

3540 S$=CC$(M):G0T0 6000 

3570 S$=C1$(M):GOTO 6000 

3610 S$="J":GOTO 3650 

3630 S$="C" 

3650 GOSUB 6000 

3660 S$=CC$(M):GOSUB 6000 

3680 GOSUB 6100 

3690 GOSUB 5400 

3695 JF=TRUE:RETURN 

3805 IF M=1 GOTO 7200 

3810 S$=C3$(M):GOSUB 6000 

3820 IF M=0 GOTO 3850 

3630 IF M=2 OR M=3 GOTO 3900 

3840 RETURN 

3850 GOSUB 6100:GOSUB 5400:JF=TRUE:RETURN 
3900 GOSUB 6100:GOSUB 5200:RETURN 

4005 IF M=5 GOTO 7400 

4006 IF M=3 THEN I$="X" 

4007 IF M=7 THEN I$="X" 

4008 IF M=3 OR M=7 GOTO 7700 
4010 S$=C5$(M):GOSUB 6000 


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


Number 26 
281 



1(020 IF MOI ThEN RETURN 

401(0 GOSUB 6100:GOSUB 5400:JF=TRUE:RETURN 

4120 S$=C6$(M):GOSUB bOOO 

4130 S$=" ":GOSUB 6000 

4140 GOSUB 5200:RETURN 

4210 S$="RST ":GOSUB bOOO 

4220 X=8*M:GOSUB 5100 

4230 JF=TRUE:RETURN 

5000 X=PEEK(PC):PC=PC+1:NB=NB+1:B(NB)=X:RETURN 
5100 PRINT HEX$(1NT(X/16));HEX$(X AND 15);:RETURN 
5200 GOSUB 5000:GOSUB 5100:RETURN 
5300 REM 

5330 GOSUB 5000:XL=X 

5340 GOSUB 5000:XH=X 

5350 X=XL»256»XH:RETURN 

5400 GOSUB 5300:GOSUB 5450:RETURN 

5450 T=X:X=INT(T/256):GOSUB 5100 

5470 X=T-256*X:GOSUB 5100 

5480 X=T:RETURN 

5500 WAIT TS,KB:C=INP(TD) AND 127 

5525 IF 0=97 AND C<=122 THEN C=C-32 

5530 C$=CHR$(C):RETURN 

5600 GOSUB 5500 

5640 PR=C>=32 AND C<=126 

5650 IF PR THEN PRINT C$;: RETURN 

5700 GOTO 6000 

6000 IF PF THEN PRINT S$;" :RETURN 

6100 IF PF THEN PRINT " :RETURN 

6200 PRINT BS$;ES$;EL$:RETURN 

7000 IF X<=127 GOTO 7040 

7030 X=X-256 

7040 X=PC+X:RETURN 

7200 GOSUB 5000:OP=X 

7212 L=INT(0P/BIT(6)) 

7214 M=INT(OP/BITC3)) AND 7 
7216 K=OP AND 7 
7220 IF L=0 GOTO 7280 
7230 S$=CB$(L):GOSUB 6000 

7240 S$=CHR$(48+M):GOSUB 6000:S$=",":GOSUB 6000 

7260 S$=RSG$(K):GOTO 6000 

7280 S$=RT$(M):GOSUB 6000 

7300 S$=REG$(K):GOTO 6000 

7400 GOSUB 5000:OP=X 

7410 L=INT(OP/BIT(6)):M=INT(OP/BIT(3)) AND 7:K=0P AND 7 

7430 ON L GOTO 7450,7690,7440 

7440 S$="- GOSUB 6000:RETURN 

7450 ONK GOTO 7480,7500,7550,7600,7620,7650,7680 

7460 S$="INP":GOSUB 6000 

7470 S$=REF$(M):GOTO 6000 

7480 S$="OUTP":GOSUB 6000 

7490 S*=REG$(M):GOTO 6000 

7500 K=INT(M/BIT( 1)) :M=M AND BIT(O) 

7520 IF M= 1 THEN S$="DADC" 

7530 IF M=0 THEN S$="DSBC" 

7535 GOSUB 6000 

7540 S$=RP$(K):GOTO 6000 

7550 K=INT(M/BIT(1)):M=M AND BIT(O) 

7560 IF M=0 THEN S$=''S" 

7570 IF M=1 THEN S*="L" 

7575 GOSUB 6000 

7580 IF K<>2 GOTO 7590 ELSE S$="-?-" 

7585 GOTO 6000 

7590 S$=RF$(K):GOSUB 6000 

7592 GOSUB 5300:G0SUB 5450:RETURN 

7600 IF M=0 GOTO 7610 

7602 S$="—":GOTO 6000 

7610 S*="NEG":GOTO 6000 

7620 IF M<=1 GOTO 7630 

7622 GOTO 7602 

7630 IF M=1 THEN S*="RETI" 

7632 IF M=0 THEN S$="RETN" 

7640 GOTO .6000 

7650 IF M=1 OR M>3 THEN S$="-t-" 

7660 IF M=0 THEN S$="IM0" 

7662 IF M=2 THEN S$="IM1" 

7664 IF M=3 THEN S$= n IM2 M 
7670 GOTO 6000 
7680 S$=ED$(M):GOTO 6000 
7690 S$=CP$(K):GOSUB 6000 
7695 S$=CP$(M):GOTO 6000 
7700 GOSUB 5000:OP=X 
7705 IF 0P=203 GOTO 7820 

7710 L=INT(0P/BIT(6)):M=INT(OP/bIT(3)) AND 7 

7712 K=OP AND 7 

7714 ON L GOTO 7770,7790,7799 


7720 ON K GOTO 7724,7736,7740,7750,7750,7760 
7722 S$="==":GOTO 6000 

7724 IF M=4 GOTO 7731 

7725 K=1NT(M/BIT(1)):M=M AND BIT(O) 

7726 S$="DAD":GOSUB 6000:S$=1$:G0SUB 6000 

7727 IF K=2 GOTO 7730 

7728 S$=RP$(K):GOTO 6000 

7730 S$=I$:GOTO 6000 

7731 S$="LXI":GOSUB 6000:S$=I$:GOSUB 6000 

7732 S$=",":GOSUB 6000:GOSUB 5330:GOSUB 5450:RETURN 

7736 IF M=4 GOTO 7739 

7737 S$="LI":GOSUB 6000:S$=I*:G0SUB 6000 

7738 S$="D":GOSUB 6000:G0SUB 5330:GOSUB 5450:RETURN 

7739 S$="SI":GOSUB 6000:S$=I$:GOSUB 6O0O:GOTO 7738 

7740 IF M=4 THEN S$="INX" 

7742 IF M=5 THEN S$=“DCX" 

7744 GOSUB 6000 :S$=I$: GOTO 6000 
7750 IF K=4 THEN S$="INR" 

7752 IF K=5 THEN S$="DCR”:GOSUB 7754:RETURN 

7754 GOSUB 6000:GOSUB 5000:GOSUB 5100 

7755 S$=»l":GOSUB 6000:S*=1$:GOSUB 6000 

7756 S$=")":GOTO 6000 
7760 IF M<>6 GOTO 7722 

7762 S$="MVI":GOSUB 7754:S$=" ":GOSUB 6000:G0SUB 5200:RETURN 
7770 S$="MOV" 

7772 IF K=b GOTO 7780 

7774 GOSUB 7754:S$=",":GOSUB 6000 

7776 S$=REG$(K):GOTO 6000 

7780 GOSUB 6000:S$=REG»(M):GOSUB 6000:S*="Z" 

7782 GOSUB 7754:RETURN 
7790 IF K<>6 GOTO 7794 
7792 S$=AI$(M):GOSUB 7754:RETURN 
7794 S$="~":GOTO 6000 

7799 IF M<>4 GOTO 7810 

7800 ON K GOTO 7804,7802,7805,7802,7808,7802,7802 
7802 S$="—":GOTO 6000 

7804 S$="POP":GOTO 7809 

7805 S$="XTI":GOTO 7809 

7806 S$="SPI":GOTO 7809 

7808 S$="PUSH" 

7809 GOSUB 6000:S$=I$:G0T0 6000 

7810 IF M<>5 GOTO 7814:IF KOI GOTO 7802 
7812 S$=”PC1":GOTO 7809 

7814 IF M=7 AND K=1 GOTO 7806 
7820 GOSUB 5000:D=X:GOSUB 5000:OP=X 
7822 GOSUB 2000 
7826 IF L>0 GOTO 7840 , 

7830 IF K<> 6 GOTO 7B02 

7832 S$=RT$(M):GOSUB 6000 

7834 X=D:GOSUB 5100:S$="(":GOSUB 6000 

7836 S$=I$:GOSUB 6000:S$=")":GOT0 6000 

7840 S$=CB$(L):GOSUB 6000 

7842 S$=CHR$(48+M):GOSUB 6000 

7844 S$=",»:GOSUB 6OO0:GOTO 7834 

9030 DIM HEX»(15) 

9040 FOR 1=0 TO 15:READ HEX$(I):NEXT 

9050 DATA "0", , 1","2",*3","4","5","6" ,"7" ."8","9".A,B,C,D,£,F 
9080 DIM BIT(7) 

9090 FOR 1=0 TO 7:READ BIT(I):NEXT 
9100 DATA 1,2,4,8,16,32,64,128 
9130 DIM REG$(7) 

9140 FOR 1=0 TO 7:READ REG$(I):NEXT 
9150 DATA B,C,D,E,H,L,M,A 
9180 DIM RP$(3) 

9190 FOR 1=0 TO 3:READ RPt(I):NEXT 
9200 DATA B,D,H,SP 

9203 DIM RF$(3) 

9204 FOR 1=0 TO 3:READ RF$(I):NEXT 

9205 DATA BCD,DED,HLD,SPD 
9230 DIM AI$(7) 

9240 FOR 1=0 TO 7:READ AI$(I):NEXT 
9250 DATA ADD,ADC,SUB,SBB,ANA,XRA,ORA,CMP 
9280 DIM C6$(7) 

9290 FOR 1=0 TO 7:READ C6$(I):NEXT 
9300 DATA ADI,ACI,SU1,SBI,ANI,XRI,0RI,CP1 
9312 DIM JR$(7) 

9314 FOR 1=2 TO 7:READ JR$(1):NEXT 
9316 DATA DJNZ,JMPR,JRNZ,JRZ,JRNC,JRC 
9330 DIM CC$(7) 

9340 FOR 1=0 TO 7:READ CC$(I):NEXT 
9350 DATA NZ,Z,NC,C,PO,PE,P,M 
9390 DIM C1»(7) 

9400 FOR 1=0 TO 7:READ C1$(I):NEXT 

9410 DATA POP B,RET,POP D.EXX.POP H,PCHL,POP PSW.SPHL 

9440 DIM C3$(7) 


Number 26 


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



9*150 FOH 1=0 TO 7:READ C3*(l): NEXT 
9460 DATA JMP,- -,0UT,1N,XTHL,XCHG,D1,E1 
9490 DIM C5$(7) 

9500 FOR 1=0 TO 7:READ C5$(I):NEXT 

9510 DATA PUSH B,CALL,PUSH D,- -.PUSH H,- -.PUSH PSR,- - 
9540 DIM 071(7) 

9550 FOR 1=0 TO 7:READ 07*(1):NEXT 
9560 DATA RLC,RRC,RAL,RAR,DAA,CMA,STC,CMC 
9590 DIM 02$(7) 

9600 FOR 1=0 TO 7:READ 02$(1):NEXT 

9610 DATA STAX B.LDAX B.STAX D.LDAX D,SHLD,LHLD,STA,LDA 
9625 DIM OBJ(3) 

9630 FOR 1=1 TO 3*READ CB*(I):NEXT 
9640 DATA BIT,RES,SET 
9655 DIM HT$(7) 

9660 FOR 1=0 TO 7:READ RT$(1):NEXT 

9670 DATA HLCR, RRCR, RALR, RARR, SLAR, SRAR, —, SRLR 

9680 DIM ED*(7) 

9690 FOR 1=0 TO 7iREAD ED$(1):NEXT 

9695 DATA STAI.STAR,LDA1 ,LDAR,RRD,RLD, —,— 

9700 DIM CP$(7) 

9702 FOR 1=0 TO 7:READ CP$(I):NEXT 
9704 DATA LD,CP,1N ,OUT , I ,D, 1H ,DR 
9620 TRUE=-1:FALSE=0:RETURN 
9840 TS=2:TD=3:Kb=2:SB=2 
9660 BS=6:BS$=CHR$(BS) 

9670 CS=74:CS$=CHR$(CS) 

9880 EL=75:EL*=CHR$(EL) 

9890 CR=13:CR$=CHR$(CR) 

9895 ES$=CHH*(27) 

9697 CH$=CHR$(72):RETURN 


READY> 

RUN 

HJ 

Z-80 DISASSEMBLER 


>3000 30IF 





3000: 

XTHL 

E3 



3001: 

POP b 

Cl 



3002: 

XCHG 

EB 



3003: 

XTHL 

E3 



3004: 

INX B 

03 



3005: 

LD DR 

ED 

B8 


3007: 

INX H 

23 



3006: 

INX D 

13 



3009: 

MOV B , D 

42 



300A: 

MOV C , E 

4B 



300B: 

POP D 

D1 



300C: 

RET 

C9 



300D: 

PUSH H 

E5 



300E: 

LHLD 01B6 

2A 

B6 

01 

3011: 

MV I B , 00 

06 

00 


3013: 

DAD B 

09 



3014: 

DAD B 

09 



3015: 

CALL B11A 

CD 

1A 

B1 

301b: 

POP H 

El 



3019: 

RET 

C9 



301A: 

PUSH D 

D5 



301B: 

XCHG 

EB 



301C: 

LXI H , FFD8 

21 

Db 

FF 

READY> 






COMPUTER NETWORK POLL 

DDJ: Received: 78 April 28 

I read your letter by Jef Raskin, in Volume 2, Issue 10, 
about the D.C. Hayes modem board. 

Randy Suess and I now have one on-line 24 hours a day in 
a computerlized call-in bulletin board system. We are quite 
pleased with it, and wanted to pass on our experiences, and 
also invite your readers to try it first hand. But first, some 
background on the system. 

On January 16, 1978, I thought up the idea of a hobby 
computer-based bulletin board system, as a source of material 
for our club newsletter. I talked over the idea with Randy 
Suess, and we decided to go ahead and do it. I would do the 
software, and he would do the hardware. 

We based it on a 24K 8080 system, using the Tarbell disk 
controller, and an Innovex floppy drive. The D.C. Hayes 
board, going thru a DAA, provided the phone link. 

Within 30 days, we had the system designed, built, 
programmed, and tested. Shows what can be done if you 
really put your mind to it. 

It has undergone very minor changes since going on the air 
in mid-February. A few resistor values were changed on the 
DC Hayes board, and a higher precision op amp was substitut¬ 
ed, all based on work by Randy, and suggestions by Dennis 
Hayes. 

We are now quite happy with the system. It is regularly 
called from California, Georgia, Ohio, as well as lots of local 
calls. It performs well with the possible exception of having 
trouble when the modem being used does not put out a strong 
signal. Very few people have had trouble receiving the signal 
we send out. 

We are currently using a revision 3 modem board, and 
expect to be trying out a revision 4 board shortly (should be 
in place by the time this letter is printed). 

We invite your readers to give it a try. We will take an 
informal poll of success or lack of it, and will report back to 
you. 


Here is how to access the system: Any ASCII terminal, 110 
or 300 baud, should work. There is no “protocol” associated 
with the system. It uses 2 stop bits at 110 baud, 1 at 300. It 
echoes everything typed, character by character, but this may 
be changed after signing on. For the time being, no password 
is required to access the system. We encourage its use, but may 
have to go to a password system if it gets abused. 

Dial the system (312) 528-7141, and when you hear the 
answer modem tone, connect your modem. Then press return 
several times until the system responds. (C/R is used as the 
speed determining character). You will be prompted from then 
on. 

NOTE: People who are successful will of course be known 
to us, but people who are unsuccessful won’t. That’s not right, 
as it gives a falsely biased view of the system’s success. I there¬ 
fore ask people who are unsuccessful in communicating to call 
me, Ward, at (312) 849-6279. I have a recorder on the phone 
in case I am not home. I would appreciate the callers having 
the following information ready to give in case the recorder 
answers the phone: Where they tried calling the system from; 
What type of modem was being used; What type of terminal; 
What speed; Any comments they think might help. I don’t 
have the budget to return all the calls, but will try to handle 
those of interest and particularly those who might have useful 
suggestions. 

Both Dennis Hayes and Dave Caulkins (PCNET) have 
received copies of the software, as they are very serious about 
setting up their own systems. We encourage other clubs to set 
up similar systems. The software is copyrighted, but something 
should be able to be worked out. The copyright is just to 
maintain control, not to limit its non-commercial use. A more 
detailed article on the system will be coming out in a Fall 
BYTE. 

Happy Computing, 688 E. 154th St. 

Ward Christensen Dolton, IL 60419 


Page 44 


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


Number 26 

283 


MORE DOPE ON NIBL 


’NUFF SAID 


Dear Dr. Dobb: Received: 78 April 3 

Mike Fern’s “nips at NIBL” inDD/No. 22 contained sever¬ 
al errors which deserve correction. The mysterious “JS” 
instruction he refers to is a pseudo-instruction recognized by 
the SC/MP cross assembler, and is documented in the SC/MP 
Assembly Language Programming Manual, publication number 
420009C, January 1977. The JS instruction generates a 
sequence of five instructions occupying seven bytes of code. 
The actual sequence generated is: LDI, XPAH, LDI, XPAL, 
XPPC; the effect is to perform a long jump or subroutine call. 
In the NIBL source file, the assembler was directed (at line 2) 
to list no more than the first 2 bytes produced by any direc¬ 
tive capable of generating more than 2 bytes of code, such as 
the JS instruction or ASCII directive. Thus, there are exactly 
five missing bytes of code in the listing at each occurrence of 
a JS, not 4 or -1 (!) as Mr. Fern claims. I suspect his hexadec¬ 
imal arithmetic was a little rusty when he make those calcula¬ 
tions. 

By the way, SC/MP users will be pleased to note that the 
missing code appears in the load module produced by the 
assembler, and that the version of NIBL published in 
Dr. Dobb’s actually runs, bugs and all. 

The bug in NIBL (actually a design error) regarding the 
definitions of “true” and “false” has already been beaten 
pretty well into the ground by Jef Raskin. There are two 
possible fixes for the problem: 

1. Change the definition of “true” in logical expressions to 
-1, rather than 1. 

2. Change the code for the IF and UNTIL statements so 
that only the least significant bit of the logical expres¬ 
sion is checked for 0 (false) or 1 (true). 

At the time Jef reported the bug to me, NIBL had already 
been released and was being made into PROMs in great quanti¬ 
ties for shipment (another way of saying the program was cast 
in concrete). If you don’t like the way NIBL works, don’t 
panic—change the rotten interpreter. I would implement 
fix #2 above by changing the OR instructions at addresses 
5DB and 932 to ANI 1 (referring to the listing in Dr. Dobb’s 
—the released version of NIBL will have slightly different 
addresses). 

NIBL was not designed to sway followers of any particular 
Comp. Sci. guru (such as Dijkstra) away from their discipline 
of programming. It was built as a tool for helping a few hard¬ 
ware engineers debug their applications involving SC/MP, not 
as a language for writing business software or compilers. 
Admittedly, it is an atrocious language by most standards, but 
I would prefer that people compare it with languages in its 
class, namely the various dialects of Tiny BASIC. In all 
modesty, NIBL doesn’t seem too bad by these lowered stan¬ 
dards, aside from the fact that the interpreter is twice as large 
and 50 times as slow as Lichen Wang’s excellent TB implemen¬ 
tation (a result of having to use a hopelessly weak, slow 
processor). 

I can’t seem to find two people who will agree on some of 
the non-standard features in NIBL. Raskin hates the 
notation for memory access, while Albrecht likes it; yet Raskin 
likes the DO/UNTIL structure and Albrecht condemns it as 
completely contrary to the spirit of BASIC. Personally, I find 
most dialects of BASIC (including NIBL) to be distasteful for 
writing large programs (i.e., programs longer than 10 lines). 

NIBL should have remained in-house at National, but the 
marketing people (to whom all us peon programmers are slaves, 
more or less) saw it as a good gimmick to promote sales of 
SC/MP chips. Thus, I was pressured to publish both the listing 
and a quickie write-up full of errors before NIBL was really 


To All Multi-Micro Media Customers: Received: 78 May 15 

Thank you for your order. It is most appreciated. 

The purpose of this letter is two-fold: to acknowledge your 
order and to explain when, if ever, you can expect to receive 
it. 

At present we have not received sufficient orders for some 
of the products to make it economically feasible to produce 
them at this time. The schedule below is our best guess as to 
when the order level will warrant producing the most minimal 
quantities for shipping. 


PRODUCT 

FORECAST 

PROBABLE SHIPPING DATE 

H8-BG1 

Unclassifiable 

Unknown 

H8-BG2 

Unclassifiable 

Unknown 

H8-MG1 

Unclassifiable 

Unknown 

H8-MG2 

Unclassifiable 

Unknown 

H8-MG3 

Unclassifiable 

Unknown 

H8-MG4 

Poor 

July 1 

H8-CODE 

Unclassifiable 

Unknown 

H8-KING 

Unclassifiable 

Unknown 

H8-DISM 

Good 

June 15 

H8-EDUC 

Good 

June 1 

R8-BG1 

Excellent 

May 1 

R8-BG2 

Very Good 

May 15 

As of May 1, 1978, we intend to re-evaluate the status of 


ALL orders for ALL products. At that time, any product 
whose forecast is still “Unclassifiable” will be cancelled and 
the orders for that product will be returned. 

In the meantime, anyone who wishes to cancel an order is 
invited to to so. We will return your original order document 
and if payment was rendered by check, we will return your 
check. In the case of money orders made payable to Multi- 
Micro Media Corp., we will write a refund check for the same 
amount back to you. 

Unless advised to the contrary, products will be shipped 
when produced and for credit card customers, you will be 
billed one at a time. In the case of orders for a combination of 
produced as well as cancelled products paid by check or 
money order, an appropriate refund will accompany the first 
product shipped. 

Again, thank you for your order. We, like you, hope that 
interest will increase in our product line to make it possible to 
bring to you what we feel are good products. Your patience 
during this trial-time is appreciated very much. 

Sincerely, 

MULTI-MICRO MEDIA CORPORATION 
Operations Department P.O. Box 1025 

(303)425-5221 Arvada,CO 80001 


ready to be loosed upon the world. Judging by the generally 
unfavorable reaction from readers of DDJ this seems to have 
been a mistake. 

Sincerely, 

Mark Alexander 149 Jackson Ave. #200 

Redwood City, CA 94061 


Number 26 

284 


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


Page 45 



SAM76 Language Update 


H The current position with respect to 
I Source Code 11 availability of the source code is very 
I I Availability j| staple: It is available la machine 

IJ_LI readable form under the following 

conditions: 

1. - A relatively complex test must be passed with flying 
honors to demonstrate the requestor's understanding of both 
the language philosophy and pragmatics; one of the ten test 
problems might be: 

"Write a procedure named "FETCH" that precisely and 
completely mimics the "FT" function". 

2. - The requestor mu6t demonstrate shill and knowledge with 
respect to assembly language programming as it relates to 
the version of the source code desired; If the source code 
Is desired as a model for Implementation In a new machine 
then skill in the target machine must be demonstrated - team 
work Is encouraged In this Instance. 


Active and neutral execution of the "*I" 
function reTeals the creation date and 
version number respectively; versions 
<0022” with a date equal to or greater 
than 14CC have been modified as required 
to permit portability of the actual work space. The creation 
date code may be decoded using the following procedure: 

< date* 

,3i mr 


Note that scripts output with the "OT" output text function, 
are not in question and that the new version Is only 
required If the user desires to move his work space to 
machines where that space does not start at *h4 00. 


fed, 1, fe u, fed, fe@n //, feu, 31, fe 1, fed, few n /, 



i version | 

I <0022* | 

IJ_L 


This function was added to delineate the 
limits of the user work space; It may be 
used at any time, but generally prior to 
executing the "EX" exit function; formal 
definition follows: 


iI New function j j 
11 "IQS" 11 

IJ_LI 


272 |xqs,s0| 


X Query Save 


3. - The requestor must be prepared to agree to contribute 
free time towards the advancement of the language; this can 
be In a number of ways Including Improving the efficiency of 
existing source code, publishing algorithms and examples, 
giving talks to school and other educational groups &c. 

4. - The requestor must agree to make available for 
publication at no charge any programs written either for 
other machines, or as additions to the source version 
requested. This does not, however, include any application 
programs, normally referred to as scripts or procedures 
written in the SAM76 language Itself. 

The foregoing requirements are an attempt at preserving the 
current Integrity and portability of the language until 
enough Implementations have been made that a "DE FACTO" 
standard Is established; the benefits to users of such a 
position should be obvious. 


The value of this function are two numbers, each preceded by 
the string "s0" representing in the normal number base of 
the machine the starting and ending adresses of the user 
work space that should be saved. 


Normally the "cws" change work space function would be first 
executed to reduce the work space to a minimum size, then 
the "xqs* function executed to ascertain the limits of the 
required save, prior to doing an "exit". 


Version <0022* 14CC corrects the non 
functioning of the "XI" experimental 
Input in the 8060 versions of the SAM76 
language processor. The following shows 
the changes that can be made In early 
versions to correct this problem: 


j failure of i 
I "XI" 

I in 8080 code | 

J_L 


Early version coding: 


Corrected coding: 





XI: MVI 

A.KINP 

XI: 

MV I 

A.KINP 

Through an oversight all of the 1^3 calls 

IT Tl 

STA 

CHA1 


STA 

CHA1 

were not made through the vector table 

II 1^) Vector j | 

MV I 

A.KRET 


CALL 

MSXX 

created at “h400 In early versions of 

the 

11 Patch 11 

STA 

CHA142 


MOV 

L,A 

object code distributed at San Jose; 

this 

II II 

CALL 

MSXX 


MV I 

H.KRET 

anomaly was brought to our attention 

the 


STA 

CHA1+1 


SHED 

CHA1+1 

second day of the WEST COAST FAIRE, 

and 

the changes listed 

CALL 

CHA1 


CALL 

CHA1 

below will correct the problem for users 

with other than 

JMP 

MSXRB 


MOV 

C,A 

“ZAPPLE" monitors: 






JMP 

MSXRB 

Version location from 

to 





NOP 


Z80 80C6 & 8116 CD 15 F0 

CD 

21 04 

CHAl: 04DE 

| KRET = 

C9 

1 

KINP = 

811F & 81CD CD 18 F0 

CD 

24 04 

XI, MSXX, and 

MSXRB locations 

may vary 

between 

versions 

8080 80E7 & 813B CD 15 F0 

CD 

21 04 







8144 & 81F7 CD 18 F0 CD 24 04 


"Tl The normal location for the Interpreter 
I| Location of I j object code was assembled to start at 
11 object code 11 ~h8000; this was a compromise selection 

1 1 _ 1 1 due to the desire to have all of the user 

work space In one continuous area 
starting at 0 for the Z80, and ~h400 for the 8080; the idea 
was to permit saving the user work space as an executable 
load nodule that would be portable from machine to machine, 
regardless of the location of the object code Itself (be it 
below or above *h8000). 

Since then it has become painfully obvious that such hope 
could not be realized with regard to the POLYMORPHIC and 
HEATHKIT systems; consequently changes have been made In the 
object code to normalize certain pointers at the time the 
"EX" Exit function Is executed, and restores these same 
pointers as appropriate to the machine in which the smfed 
user work space might be reloaded. 


i r 

ii 


"CFC" 


Tl 

II 


11 superfluous 11 


II 

11 - 


argument 


II 

II 


It was pointed out that the "cfc" change 
fill character funtlon did not function 
as defined - requiring an extra argument; 
this may be readily corrected by 
replacing with NOP the call to the 
subroutine that moves the argument 


pointer In the expression being evaluated: 
CFC: 


MV I 

A.NULCT-TIR 

; 3E IE 

CALL 

STORNO 


IJSAS 

; replace In 

z80 with one NOP, 8080 3 NOPs 

DCX 

H 


CALL 

HSR9 


MOV 

M,A 


IJRQ 



Z80 

version IJSAS 

Is an RST2, In the 8080 version 


In the 

IJSAS Is assembled as a CALL to MSAS; the locations of CFC, 
STORNO, MSAS, and MSR9 may vary between versions. 


Page 46 


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


Number 26 

285 











SAM76 language afficlonadoes night like II II 

to receive advance copies of material 11 <PREPR1HTS> j1 

scheduled for publication. At this time |J_LI 

it is suggested that those people wishing 
to receive preprints may send to SAM76 a self addressed 
envelope containing one dollar; this dollar will be replaced 
with preprints as available and the envelope mailed - then 
to continue if so desired %PREPRI!frs/. 

An object code version tailored to the POLYMORPHIC should be 
available by the tine this is published. The price is $6.00 
postpaid for this as well as for version «0022». The 190 
page textbook is priced at $12, and a system loader 
information booklet is $2; all of these are postpaid. 
Specify loose-leaf or bound preference for the text book. 

SAM76 Inc., Box 257, R.R.l, Pennington, N.J., 08534 



THIS IS SIRIUS 

News Release Received: 78 April 13 

Sirius II comes complete, using a unique combination of 
two micro processors, the Mostek Z80 (for main computa¬ 
tions), and a Fairchild 3870, that handles all keyboard and TV 
interface overhead. Also included are 32,768 characters of 
read/write memory, RS-232 interface for I/O, 8,192 charac¬ 
ter PROM board with 1,000 character monitor supplied, mini¬ 
floppy disc drive, a 64 key keyboard with alpha/numeric and 
graphic capabilities, and TV interface. Other features included 
are a full disc operating basic interpreter, monitor and soft¬ 
ware programs (ranging from home management, personal 
finance, educational learning programs, process control, to 
games and more games). The Sirius II is also capable of run¬ 
ning the full complement of business software that its big 
brother (Sirius IV) runs. 

Presently available hardware includes additional RS-232 
I/O, additional parallel I/O, add-on 16,384 BYTE RAM cards, 
A/D-D/A converters, and additional mini-floppy disc drives. 

The Sirius II is manufactured by Digital Sport Systems, 
and has a suggested retail price of $1,850. Contact Digital 
Sport Systems, 7th and Elm Streets, West Liberty, Iowa 
52776;(319) 627-4211. 


A BELL FOR YOUR SWTPC TERMINAL 

Dear Sir: Received: 78 Feb 5 

Enclosed is a circuit for adding a “bell” function to a 
SWTPC CT-1024 terminal. The circuit consists_ of a 556 (dual 
555) timer IC, four resistors, five capacitors, and a speaker. I 
built the entire circuit on the 14-pin Wire-wrap socket that 
the 556 is plugged into. The bell is triggered from an unused 
output pin of the 7445 decoder on the computer controlled 
cursor board in the CT-1024. 

The left portion of the circuit is a one -shot with a duration 
of about Vi second. The right portion is an astable oscillator 
with a frequency of about lKhz. The output of the one-shot 
is connected to the reset of the astable. When the one-shot is 
triggered by a low-going pulse from the 7445 decoder on the 
cursor board, its output goes high for Vi second. This high 
pulse allows the astable to oscillate at lKhz for Vi second. The 
IK resistor at the trigger for the one-shot is required to pull- 
up the output of the open-collector 7445. The astable is 
coupled to the speaker through a 10 mfd. capacitor. The 
circuit I built plugs in “piggy-back” onto another 14-pin 
IC (with Vcc= 14, Gnd=7). The cost is less than $4.00. 

Sincerely, 

Stuart Brown 12814 Taber St. 

Ft. Wayne, IN 46803 



TIME-SHARE FOR NORTH STAR 

News Release Received: 78 April 6 

A Time-Share Disk BASIC System is now available for 
users of the North Star Floppy Disk System. Designed to oper¬ 
ate with either 8080 or Z-80 processors, NORTHSHARE tm 
provides up to four independent users with selectable memory 
partitions and buffered terminal outputs. 

Minimum memory requirements for operation are 24K 
bytes. There are no special hardware requirements outside of 
additional terminals and I/O ports to support the multiple 
users. 

System includes one Diskette and Release 3 North Star 
Basic and DOS with NORTHSHARE tm Supervisor and Docu¬ 
mentation Package. Price is $48. Byte Shop of Westminster, 
14300 Beach Blvd., Westminster, CA 92683; (714) 894-9131. 


Number 26 

286 


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


Page 47 










Dr. Dobbs JouRNALof 

COMPUTER 

(Calisthenics f) Orthodontia 

Running Light Without Overbyte 

Number 27 _ August 1978 _ Volume 3, Issue 7 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 

SOFTWARE 


A Compact 8080 Disassembler & Dumper Richard Greenlaw 4 

How it works and how to use it 

A IK Utilities Package for the Z-80 Les Hancock 22 

A companion to the IK Debugger published by Dr. Dobb’s 

A Shorter Printer Driver for PolyMorphic’s BASIC Richard B. Emerson 27 

With an explanation of circular buffers 

Fast Cassette Interface for the 6502 Carl Moser 31 

A BASIC Renumbering Program John B. Trenholme 34 

Adaptable to various versions of BASIC 

Custom File Routines for ALS-8 Larry A. Marek 42 

Common PILOT: Progress Report Larry Kheriaty and George Gerhold 46 


HARDWARE 


The Intel 8086 Mike Gabrielson 
A look at Intel’s new 16-bit microprocessor 


19 







Unix 

Dialogue 

Continues 


Dear Dr. Dobb’s: Received: 78 June 28 

This is a follow-up letter to the UNIX tm letters that you 
have already published. As the chief initiators of the CHAOS 
project, we have faced many of the issues that Mr. duPont and 
Mr. Howell discuss. Specifically: 

1. UNIX typically interrupts upon every input/output signal. 
For example, whenever a user types a character upon a 
terminal, an interrupt occurs. The system then stores the 
character in a buffer and, later, the user’s program calls 
a system subroutine to retrieve the character from the 
buffer. This gives the “lookahead” feature. There is, how¬ 
ever, considerable overhead in buffering characters in this 
fashion. Ignoring the memory required for the actual 
buffers, in a modular system such as UNIX or CHAOS, 
several modules must be invoked upon the interrupt. These 
modules must determine the source of the interrupt, locate 
the buffer associated with the device, read the character 
and place it into the buffer, and finally determine to which 
process control should be returned. On reasonably fast 
computers, such as the PDP ll’s upon which UNIX runs, 
these operations can be handled quickly. On the 8080, 
where searches are slow, we have found that full character 
buffering entails a substantial percentage of processor time. 
Thus, in current versions of CHAOS, only disks and the 
real-time clock cause interrupts, and so eight levels of 
interrupt are sufficient. We do use a one-character buffer 
for input devices, as this permits the system to check for 
(break signals) for computer-bound processes. 

2. We know of two reasonable techniques for handling re¬ 
location. One method entails a bit vector with one bit per 
byte of program. A bit is set in the bit vector if the address 
at the corresponding location must be relocated. Obviously, 
this technique will make a program 1/8 larger on a byte 
machine. 

In CHAOS, we use a somewhat similar technique. At the 
end of each program is a “relocation table” which contains 
the ‘distances’ between those addresses in the program that 
must be relocated. These distances are stored in a single 
byte if possible-when a distance is greater than 254 deci¬ 
mal, a 255 is placed in the byte and another two bytes are 
used to give a 16 bit distance. A zero byte terminates the 
relocation table. Our assembler has an option to generate 
the table, and all addresses are put into the table except 
for those preceded by a # sign. The relocation table is 
actually stored backwards so that the system can easily 
find the start of the table. As a short example, the pro¬ 
gram segment: 

START: LX I SP.TOP 

LX I H, 0 

JMP START 

DS 1000 ;1000._ BYTES OF SPACE 

TOP: LDA 65000 U 

UNIX is a registered trademark of Bell Labs. 


would have a relocation table of: 


high 

memory 

There are a few important points here. One is that addresses 
needing to be relocated usually occur far less frequently 
than one in eight bytes. Also, examining a bit vector can be 
slow, as each bit must be tested individually. Finally, once 
CHAOS has used the relocation table to patch the program, 
the main memory space occupied by the table is reclaimed. 

3. In our current version of CHAOS, we allocate time on a 
simple priority basis. Essentially, every process at level n is 
given time after a single process at level n+1 has used its 
slice of time. Processes that serve devices requiring frequent 
but short segments of time (such as a disk-head controller) 
are put at low levels while processes requiring infrequent 
slices of time (such as a line printer queuer) are put at high 
levels. Also, a process may be suspended by the system. 

4. The size of CHAOS is only about one fifth to one third the 
size of the language (BASIC, PASCAL/S, PASCAL) that the 
users are working in. A prime consideration in choosing a 
processor is therefore the availability of suitable languages 
to build into the system and the compilation/interpreta¬ 
tion time and space required by the languages. The amount 
of disk activity depends to a great extent upon the level of 
the users. At our high school, students learning BASIC use 
very little disk time. UNIX and CHAOS supplement disk 
space with sharable core buffers. This has a major impact 
on disk overhead, especially when several users are trying to 
access a file, such as the directory containing the system 
commands. Also, sharable buffers make filters easier to 
implement. 

6. We believe that many people are interested in UNIX-type 
systems and that even more will be as the word gets out. 
UNIX is written primarily in C (see J Madden’s article on 
page 130 of the October 1977 issue of Byte and any micro¬ 
computer with a C compiler should be able to run at least 
part of the system. There have already been some notable 
successes in transporting software, such as the UCSD 
PASCAL and the PASCAL-P compiler. 

Our own efforts are directed towards producing a docu¬ 
ment of CHAOS detailing our algorithms and data structures 
so that other users can develop yet more advanced systems 
without having to start with the basics. UNIX and CHAOS 
offer great flexibility and promote rapid program 
—and have already spurred us and our students to create word 
processors, interactive debuggers, and even compilers. 

Let’s keep this discussion going in Dr. Dobb’s (anyone for 
TINY-UNIX?) .... 

Sincerely, Clairemont Computer Group 

JeffLevinsky 1541 Loring 

Robert Haas San Diego, CA 92109 




Number 27 


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


Page 3 

289 




A Compact 8080 
Disassembler & Dumper 


BY RICHARD GREENLAW 

251 Colony Ct. 

Gahanna, Ohio 43230 

Many important programs, such as BASIC interpreters, 
assemblers, editors and some of the most sophisticated games, 
are sold without source code listings. Others were written 
directly in machine code. When you want to modify or repair 
them this program will help you find and understand the 
desired routines and can make a source file which can be 
edited and reassembled. 

This disassembler is compact enough to fit in memory with 
your assembler/editor and the program to be modified, unlike 
disassemblers written in BASIC. It operates on a program 
in memory to produce disassembled source code or a hex and 
ASCII dump. 

The disassembled source code can be displayed or printed 
or can be appended to a file in memory. Labels are formed 
from their values in the original program, thus carrying some 
useful information and requiring only two bytes each in the 
disassembler symbol table. They can, of course, take on other 
values when reassembled. 

The optional symbol table building pass and the output 
pass are independently controlled by the user. Either or both 
may omit or reorder parts of a program; thus labels can be 
generated on instructions referenced only from outside the 
area outputted. 

Actual runs are shown in Figures 1 and 2. 

Something for Everyone 

Any 8080 system can use the disassembler and dumper 
(Figure 3, 1165 10 bytes) with the command interpreter 
provided (Figure 4, 288, 0 bytes). 

Users of Processor Technology’s SOLOS™ and CUTER™ 
monitors don’t need the command interpreter. Instead, they 
can use the routine in Figure 5 (81 10 bytes) to define the 
disassembler and dump commands in their monitor. 

The basic disassembler subroutine, DISL, is small enough 
(723 1 o bytes) to form the basis of a tiny disassembler in your 
own monitor. 

How to Use it 

A simple one-pass disassembly is shown in Figure 1. The 
“>” is a prompt from the command interpreter or your 
monitor. Commands end by carriage return, not shown. 


First we define an empty symbol somewhere in RAM, 
at D500 in this case. This uses two bytes for now. 

>ST D500 

Now you are ready to disassemble something. Labels will 
be generated on all instructions because the symbol table is 
empty. The following command requests disassembly over a 
range of addresses with output to your display or other out¬ 
put device according to your version of the output subroutine. 
>DS D9F1 DA06 

During this output the input subroutine (SINP) is called 
at the end of each output line to see if you want to pause or 
stop the output. The space bar will cause a pause until a 
second key is operated. A control( or MODE on a SOL) 
will terminate the output and return to the command 
prompter. Otherwise, output continues without pause. 

If the second address had been omitted or was zero, it 
would have been defaulted to FFFF, which would never stop 
to output since it can’t be exceeded. In such cases use 
controlto stop the output. 

The next command in Figure 1 requests a hex and ASCII 
memory dump over a range of addresses: 

>HA DA60 DA79 

The hex part pairs the bytes to make the line fit on a 64 
character display. There is no other significance, but it is 
convenient when counting across the dump to a particular 
address. In the ASCII part, values from space (20H) to, but 
not including, delete (7FH) are sent to the output subroutine 
unmodified. Others are converted to periods. There is one 
exception: the underscore (5FH) is converted because it 
would be converted to a backspace by my system monitor. 
This assumes your output device handles lower case alphabetic 
characters or converts them to upper case as my TTY does. 

The method of Figure 1 is fine for a quick search for input/ 
output drivers, etc., but you can’t see which instructions 
receive control from calls and jumps and this format could 

Plcrire 1 - A ^lpassenbly with A 0 ?TT/hex r >n’n 

> ST nS'T'l 
>ns r»9ri nA<?»A 
unpin i x i sp , Hr>4F°l 
Fnpri cai \ wnsrs 
wn9tr7 mv/j p,7«tm 

nnQfc-Q r*4l l. wnqrp 

H09E-C 1 x I M, Mb ARC 

HD 9 rr r:4l l ungro 

pnano J7 Hngrjr 

un4?is y>v m,a 

H nAH A CPI f 10 H 
>WA nAAf} n479 

Hn a C9S1 sans ns/i* a l n a iiqap siny hvaa sioc . SI • • ha > • ms • *os • 

VDA7P 0944 4 All f D9SP SP^ir HV^'1 P4I>'4 DAVE V I '111 . Uh .. AA . 


Page 4 

290 


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


Number 27 




overflow an assembler’s symbol table if a fairly large program 
were reassembled. 

To suppress unused labels, a symbol table is required to 
tell the disassembler which instructions are referenced. 
Actually, this table contains only the addresses of such instruc¬ 
tions. 

Figure 2 shows a two-pass disassembly. The symbol table 
is initialized as before by: 

>ST D500 
Then it is built by: 

>BS D9D0 DABE 

This runs the disassembler through the specified range without 
producing source code output. Instead it appends the last two 
bytes of each three byte instruction to the symbol table, 
unless they are already in the table. This assumes the value is 
an address. If it is a constant it could cause an unnecessary 
label to be generated on some instruction in the second pass. 

Flc-ure ? - rwo-Fft«s Disassembly 

> m nvA'i 

>RS H9rv* nnor 
>ns n9fi 

H n 9 F 1 X 1 9P,WDAF'» 

Gftl I wnqrs 
v\/| n.iru 
r./\\ | wngcp 

i xi n , Mnaur 

m n9k f rai I Mn 9 Fk 

,17 wnqFF 
V/ 

PHI ‘inw 
J7 MltATT 

PPI 7fw 
,im7 uda i f 
ixi n ,whapf 
rail 

.IMP wnqri 

op x w 

> xx 


Note that the symbol table should represent all programs 
which could reference a label in the routines you intend to 
disassemble in pass two. If the range of addresses for the 
BS command is not continuous or contains data tables, simply 
use BS on each range separately. (Only the ST command 
empties the symbol table.) If you don’t know where data 
tables are just include everything in the BS range. You may get 
some false symbol table entries and you could misinterpret 
a few instructions if a data area doesn’t come out even when 
interpreted as instructions, but it’s good enough for a first 
try. 

Note that Figure 2 used the control-@ to stop the output 
and then shows the XX command exiting from the command 
interpreter to the system monitor. 

If you want to build an assembler source file in memory 
instead of displaying the output, just use the DF command 
instead of DS. You must specify an end address since there’s 
no visible display to interrupt. Each disassembled line is 
appended to the end of the file, so several DF ranges can be 
used. 

Source files created by this disassembler exist entirely in 
RAM and are useable by several popular assemblers, such as 
Processor Technology’s ALS-8. All line numbers are 0000, so 
ALS-8’s RNUM command is needed before using a line 
number based editor. It renumbers the whole file without 
regard to the original numbers. The current end of file pointer 
is assumed to be in RAM at EOFP. This symbol is defined 


correctly for ALS-8. This disassembler doesn’t use the begin¬ 
ning of file pointer and doesn’t set the highest line number 
field in the file control block. RNUM does that. 

Processor Technology’s Software Package No. 1 uses the 
same EOFP address and file structure, but doesn’t have the 
RNUM command unless you have patched it in. Some other 
assemblers are based on this package, or on an ancestor of it. 

Operands of three byte instructions are disassembled as 
labels consisting of the letter H followed by the four hex digits 
of the value. If it is really a constant you must edit it before 
reassembly. Instructions referenced only by data tables or 
programs not represented in the symbol table may need labels 
not generated, and must be edited. Labels pointing at RAM 
areas and data tables must be defined by EQUates or other 
assembler pseudo-ops. 

Operands of two byte instructions are disassembled as hex 
constants beginning with a decimal numeral and followed by 
the letter H, as required by the above assemblers. Any address- 
dependent values, such as one byte of an address, must be 
edited before reassembly. 

How it Works 

The functions of the command routines have already been 
described and they and the command interpreter are relatively 
straightforward, so this discussion and the flowcharts are 
limited to the process of disassembly itself. 

The basic subroutine to disassemble one instruction begins 
at line 2435 in Figure 3. It can be entered at DISL to produce 
a label or at DISNL to omit the label. The HL registers point 
to the first byte of the instruction to be disassembled and the 
BC registers point to a RAM area to receive the disassembled 
source line followed by a carriage return byte. It advances 
these registers and if it is a three byte instruction the carry 
flag is set and the DE registers have the value of the last two 
bytes. One and two byte instructions reset the carry flag. No 
other registers are defined at exit from this subroutine. No 
other RAM is used except the stack. 


7 6 5 4 3 2 1 0 Bit 



D 

S 

OP 

N 


GROUP 

C 



RP 


OP 








s 


D Destination Register (A, B, C, D, E, H, L, M) 

S Source Register (A, B, C, D, E, H, L, M) 

N Restart number (0-7) 

C Condition (NZ, Z, NC, C, PO, PE, P or M) 

RP Register Pair (B, D, H or PSW/SP) 

OP Group and Op determine the instruction name 

Figure 6. Operation Byte Format for 8080 


Number 27 


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


Page 5 


291 




The 8080 operation (instruction) byte format is shown in 
Fig. 6. OP GROUP and OP represent the bits which are not 
dedicated to variable fields, such as register names, in a given 
instruction type. An instruction may or may not have a variable 
field or it may have both the D and S fields, as in MOV A, B. 
If an instruction has one or two additional bytes they simply 
contain a number which is interpreted by the disassembler as 
described above. 

After generating or skipping the label field, disassembly 
continues by calling subroutine GTPTR which analyzes the 
operation byte of the instruction and produces a pointer to a 
3-byte operation format block within the OPTAB table, as 
shown in Fig. 7. This block gives us, in tightly packed form, 
the name of the instruction, its length and its format. The 


7 

6 5 

4 3 2 10 

FORMAT 

NANS 1 

0 

LENGTH 

NANS 2 


-1 


KAf'lS 4 

NAME 3 


Bit 

B.yte 0 

Byte 1 


Byte 2 


FORMAT CODES 

NAME 1-3 

Letters of instruction name 

0 OP only 


coded as ASCII minus *A'-1. 

1 RP-PSW 



2 RP-SP 

NAME 4 

Last letter of name coded 

3 S 


randomly for table lookup. 

4 D 



5 DS 

LENGTH 

Number of bytes in instruct- 

6 N 


tion less one. 

7 C 




Figure 7. Operation Format Block Layout 


DISL subroutine then converts the operation name to ASCII, 
using table lookup for the fourth letter. Conditional jumps, 
calls, and returns complete the name from a variable field. 

Then the operand fields are generated from whatever vari¬ 
able fields are specified by the format code in the format 
block and from any additional bytes indicated by the length 
field of the format block. Small tables and simple algorithms 
are used in these conversions. 

The only inner subroutine worthy of discussion is the 
GTPTR, at line 3650. This subroutine and the tables it uses 
make possible a compact disassembler by allowing OPTAB 
to have only 58 format blocks for the 256 operation byte 
values. 

First, GTPTR determines which of four operation groups 
the instruction is in. This is simple -because the group is 
simply the left two bits of the instruction, as shown in Fig. 6. 

Group 0 consists of many instruction formats so the entire 
remaining six bits of the instruction are converted to an opera¬ 


tion format block number by direct lookup in the GRPOX 
table. 

Group 1 consists only of the MOV and HLT instructions so 
either format block is selected by simply checking for the 
HLT operation value, which has no variable fields. 

Group 2 instructions all have the same format, with variable 
field S. OPTAB is arranged so that the three remaining instruc¬ 
tion bits are the format block number. 

Group 3 is complex like group 0 and is treated the same 
using the GRP3X table. 



SUBROUTINE TO BUILD POINTER TO FORMAT BLOCK 


Interfaces with Your System 

If you use SOLOS or CUTER you can use the command 
definition routine in Figure 5 with the program (Figure 3) and 
omit the command interpreter (Figure 4). Verify the addresses 
in the PSCN and SCONV jump vectors (lines 1150-1155 of 
Figure 3) and all references to CUTAB in Figure 5 with your 
monitor listing and correct them if necessary. Then simply 
execute the command definition routine from your monitor. 
It will return to the monitor and the disassembler and hex/ 
ASCII dump commands may now be entered just like other 
monitor commands. 


Page 6 

292 


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


Number 27 













Number 27 


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


Page 7 

293 












If you don’t have SOLOS or CUTER, use the command 
interpreter (Figure 4) and omit the routine in Figure 5. Link 
them together and to your input and output routines as follows: 

1. Check that the jump vectors in lines 90-150 of Figure 4 
point to the corresponding symbols in Figure 3. 

2. Point the RETRN vector in line 200 of Figure 4 back to 
your system monitor or, if you don’t use a monitor, to 
the start of the command interpreter. 

3. Point the RETRN vector in line 1135 of Figure 3 to the 
start of the command interpreter. 

4. Point the SINP and SOUT sectors in both Figures 3 and 
4 to input and output routines which do the following in 
your system: 

SINP: Check for keyboard input. If present, return it in 
the A register with the zero flag not set. If not 
present, set the zero flag and return (don’t wait 
for input). Always preserve all registers except A 
and PSW. 

SOUT: Output the character in the B register to your 
display, TTY, or whatever. This is used by the 
command interpreter as well as the DS command. 
Wait until it can be done, then return with all 
registers except A and PSW unchanged. At the 
end of a line this will be called four times: for 
carriage return, line feed and two nulls (00H). 
This routine is not responsible for pause control 
or control-@ detection from the keyboard. The 
CRLF routine in Figure 3 does all that. 

5. Point the PSCN and SCONV vectors in lines 1150-1155 
of Figure 3 to the corresponding routines in Figure 4. 

6. Give control to the start of the command interpreter. 
You are now ready to go. Try the examples in Figures 1 
and 2. 


r*i 


a 

.1 

E 


r z e z 


U Z H C 
_J u c - 
a u x 

i OL > C 
u c z 
IT c « 
V C _! <1 

<r i* c z 
cr c c 2 - 
— x * 
c c 

s 
a 
s 

cc 


■ ir c 
cv e 


• Lx r- -ID 

t- -1 c 3 a. 

_J 1 c LxJ £ 

— c i— r 

r i- • x a 
a j) u: x 

- -I J c - 

u c c - ui — 

a cc u. a 

a i </> in 

<!>->- C O <T 

r- tr S' r- ui 

>- w c 

- >• c <r c z z 

c i- z -) z <r 

a. a uj x u. - 

£ £ X m X S X 

>- U X — X s u- 

cr c d <r s i 

T, 

iX ’ r-» i—i j| n 

■ — U CVJ CVi CV) (/) cv 

z x x x x x 

■ c — a o o u c 

■ lx' u. c o o a c 

: cr u c <r c £ c 

■ c/ c ^ r — 

• u z 

x x j: jc x u. x 

CL C £• C O Z C 

z c- oc c — c 

. cr c <i c <r -j c 


£ C C. lx f- ! 

c c c If 1/ i 


*»■*•»* 


sirsifsifsifs 


ir s it s if 

sj it ir >£ < 

s s s s s 


c c cr O' u 

uuu»- 
u. t- u k u. 

x x c r it 

c u or e q 

> Q IT 

cr 7 O: U 

- c CT C t- 

7 C <j z 


’ i* c k- c 

<T T ~ Z 

cr cr c 

cr c £ 

: u a _■ £ 

. cr c c c 

. sr i- cr c 


■Of 7 U 

c c - 

' c 


' li h _ 

- X <3 C 


C - 
: 7 u 


c u 

X 


k « cr »- t- 


C - it N 
v ? C 
-Chi 
i •“ C 

c z 

7 * C O' 
C £ £ C 
h- X 

UL W c C' 
ii cr h ii 

h- C C 

1* J? 
uc C X h- 
Q cr z r 
Lt (- X 
ix a u z 
I- C £ - 
Z i* 

U X 1 

£ l* si U 

z c t — 
c r t 
£ z c c 


u 

h- 

>■ c 
c a 
c u 
a 


i- cr a a 

b £ £ 
cr cr — -) 
ix cr 
c u 

H X Z 

c c x x 
u c i- z 
;><ru — 

* * ♦ x cr 


Getting It Into Your System 

The program start addresses were chosen to use RAM usual¬ 
ly available in systems configured for the assembler systems 
described above. If you want to put them elsewhere I recom¬ 
mend getting or typing a source file so you can assemble it 
anywhere. Unfortunately, the source file that produced 
Figure 3 occupied 20K of RAM! You can divide it into three 
parts at lines 2405 and 3925 with a minimum of broken link¬ 
ages. The first two parts would occupy more like 6K without 
comments and unnecessary blanks. The third part consists 
entirely of constants in tables and is not address dependent. 
The machine code relocater in BYTE, July, 1977, could also 
be useful. 

If you can read my tapes and don’t like to type I’ll supply 
copies and special editions for a copying fee. 

My system is a SOL-20 with 32Kof RAM. My TTY does not 
have paper tape. I have a MICROPOLIS™ METAFLOPPY™ 
disk system but don’t have it doing assembly language yet. 


I can offer K. C. standard audio cassettes at 300 baud or at 1200 
baud (uses lower tones). The recording format is compatible with 
SOLOS and CUTER monitors. I can also send the results of a LIST 
command to the tape without formatting or error (CRC) checks. The 
software to read this from an appropriate tape interface is trivial. 

Prices: machine code of Figures 3 and 4 in normal 300 or 1200 baud 
format, $4; same at special address, $8; source file with com¬ 
ments (20K) in normal formats, $6; same in three parts, $8; 
unformatted LISTing at either speed, $10. 

Specify speed and format. You'll get a cheap cassette unless you 
send one; they work for me. This isn’t a business so there could be 
delays or rejected orders. 


X — — 

— CV) 


tx z 
-J c 

QLi — 


XXX 
> <r ■* 

-p- 

s r' r- 
CUC 
5> s 


- <r c r tr- u. x u 

> i a c c c_ c 


c/> <r x 

x _j * 

o a x x c i 


X c X X c c 


-£££££ i £ 

c c c c c c c 
2 o e c c c c c 


—■ x 
a c 


i _ 
<T 

c c 
z 

<J 

£ 

£ 

C 

C <! 

* I 


<jxrr<T<iz>rc <rzc c<izc 
c _x x c c £ a £ o — 1 £ cc — c 


nj a — 3 
z c ^ c 
“7 a i £ 


5 IT ? if t if Cif5iferif5ifCifSif5ifSif®if5ifff'ifElf5 if 5 if f if 
ififiCifPMCfff-asu^ — c\ftrr<i^ifif'C'f(‘Paa9'a'?5 - — cvcv 
— —-— — — — — — cvcv.cvcvcvcvcvcvcv.cv.cvaojcvjcv.cv.cvcvcvcvrc'rrrr 


a a u o c 

c c c c c 


c c c a 

c c c c 


u 

<i 

c 


> x 
C £ 
<1 V 
u i r 
a <j 


c 


c cv o- 
a a r- 


x cv. oc 
ct i^ s 


u u cv r «r 

oc cc r- — — 




s s ^ s 

U U lx Lx L. Lx 

<1 C <3 <3 <1 <1 

C C CL C. C C. 


CSS S. 

U Lx Lx U U 

<T <1 <J <3 « 

C C C C C 


C C K C C C 

U U Lx L L U 

C<T<T<I<JC 

c c c c c c 


c c c c c s 

L. L U U U lx 

c c c c c c 

C C CL CCC- 


c c c c c r 

L U U U Lx U 

< c c c c c 

c c c. c c. c 


Lx 

c 


a c u. ix u u 

lx lx lx U lx lx 

<X C C <T <3 <J 

a c c cl c c 


lx Lx lx lx lx lx 

lx lx Lx U lx U 

<r <r <r c c c 

c c c c- c c 


lx lx lx lx cv 

lx lx lx lx s 

c c c c a 

c c a c c 


if CC O' C C S CL 

® s s s s -- 

a: ac a a cc ql a 
c c c c c c c 


r ^ r- oc O' c 


a a o a a a 

c c c c c. c. 


U 5 - ^ if h 

— cv cv cv cv CV 

a a a a cc a 

c. c c c c c 


Page 8 


Dr. Dobb's Journal 


of Computer Calisthenics & 


Orthodontia, Box E, Menlo Park, CA 94025 


Number 27 


294 






X 

UJ 


£ * O 

£ C 

C O H * 

o <r j c 


K C U Ul 

— X Z C 

x c c c 

U Z £ 


• U. U. c 

cr c <t 

— ct u u 

■ c c * a: 

c i -J 

e <s u <r 

^ II c 


u: z 
cl a 
znit- 

U) — <1 Ll L 

p tp i/i i r- a: 
D 
<1 


j x _j e 

J I / 1 - J Ol I • K 

r r x «i c c h u 

; Q. j c Q- x a a. 


: _> >- —• m u: _j — »- 

«JNlZNjQ.Z<J«JN»ZMU. 
OL <i 


ir r 
c a a 

-ICC 

- c * 
r <i a c 


a _j ~ (a 
< i x r 

C C J Q 

z 


l Iti c ® 

U. * % • 

Cl £ I £ I £ I 


£ -J U. 

x c. _j a c c _j 

: CT X -J U. <3XU^X>X—x—Q.Q._lC»- 
’ - C C - C H c CZCZ^»Z>CC<TZU 

aaxo “5 xo£~£~£-.£Q.a.c“tt 


I Ll x x 

CSO-ICI/ 7 CCX 


: c o « x x 

_j x a: <r — a x nj <j x a. 

: x o -J C X IM £ ZZCZ£ 
; — 1 x a _< c.' “j c' — -j - c' 


siruirsirsirsirs^sirri/'Sirsirsi/'Sirsirc'i/’ffirsirisi/'Si/'Si/'Sirsi/isirsirsirsirisi/'F'irjri/sirKir^irsirsi/'sirKifs 
ocxo'^ss — — cvC'c r rsi^iirirX'cr~r^cDXO'»'®c — — 0Cvr'r , '^^iirjrx\£jr , ~r-xtte'9'(5'(r — — cv.'Cvr'r^j-giri/'X’xr-i^xxa'O'KPf — — Cvclp" 
xxx xr^r~c'~r'~r'r-r-~r-r~(^r-r-r'-i^r-r-r-r-r^r--cLac cc cc ctct iinxctiiicciixxttixij'jf'jj'Uff'jff'UO'j'cr./'O'j'j'j'ff ©'KK 5 5 ?■ S 
-— --— — —-— — — — —-—-— — — — — — — —-—---— — —-— — — --— CV.CV.CV.CVCVCV.CV. 


c *r - c — a 
c u cl c c u 


ace c'i*-<s<*‘xr'Ccoc*'a 


c a x <j u <s c <r x <j ^ c - it c CLirac < a. rt-^rxrx — — c cv ^ a <x a cuccr-cvcrc 

c c u c u. o ccu.cc c s c c cuuc c u r-CLr^cv-ncLp-ucccc u cl u — u c a — c — — a. 

•ff'ecucL^iTirxacs — — — •5f' tt 0-ffuu®r‘(rxxr^r-oc.a<jacus—CLirttao'»'0'a'a«xcuuu — <;i/-xo-<ra 
r<i<i<i<raaaaaaaceceecccccccccccccccccccuuuueuuujuuuuuuiiuuuuuuue 
:ccaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 


rrar»cc<i<i<rc<i<i<i<i<iaaaaaaaaceeeecccccccccccccccccccuuueeu 

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxaaaaaaaaa 

cccccccccccccccccccccccccccccccccccccccccccccccccccccc 


LIUUUUUUULLUU UUULLUU 

ccccccccccccccccc 


x 3 x _i x c !\ 

It " li “ S !T » 

P* U if U CL c <3 


c — 1 c a 

X S- f-_I 

- * r x c 

xxxcccx ac cex 


W t/' z 
tr a ii j 

<j c c 
a c x - 
- c e* x c a 


H -I e-CHCI- h- K X 

i <r- k- 3srsrerr uj o 
* c z? x»c»c-cc u •* » 

) x a it x a c ctt^ovDi/'^ x <r —i c x 


x x _j a -i> —• x 

<jxxx.vi — <r a _j a — c i- c _ _• — s 

»-ZZCZ>^CCC<JZU C <3 * z 

— c r £ <r a c' a c “ a c cc _ a 


a?>-jaxa _j — j — a c > a. > ai 

JCC<ICZ£ <T^»C-<TZ><J£ CDCX 

' X £ O 0. —■ "3 C' £ C £ C £ C “3 C £ {/> £ l/' 


s it e u* «■ .r s 

r r- 9 if if x 

r c r- c r- 


ifSifSifSifFirsiff iffifj'/i.ifTifSirEiffi/ifs 

xr-r^oc a a- O' r <r- oc\rr ccirirxxr-t'-ococo'o-ff — 


ifSif?ifSif®if 5 if 8 ifSif'SifSif 5 ifffifEif 5 ifR/ 8 if 8 ir 
— cvCLrr-Q <jiriirxxr-r' 0 ccc*'*'®s— — c\ cl <*- r ^ if if >f x m'- 
ififififiriTififififififiififififirx xx x x xxx x xxxxxx x 


u r* e r* c O' a 

M' if r O (*■• CL 

u cl e <x e cm u 

u u u. c u u. r 


arrifMiCL-c-CM? 
sso. — crsccccec 


C C - if if 

c c c c e 


— <1 CL — 

e see 


c - c cv. r 
c c c c c 


« u c »r r- c — r r 
e u. c e c c ® c 


r'cxcxcxx 

eff-esuffue 

cxcxcxcp- 
c s c s c e. c c 


uccucL-gp* acffccsftr^UuuuiiOifttffocccc u e - <j r-<xae-CLCLCL<\cvir'pirccr<rceucLCL l rt'-<reu-<jt-r-r-ct*<x 

o cl cl cvr r r rrrrr^^^^ < i^<!^^^'<iififififirififififif'/'£x xxxxr^f~p~r'r-r-r'r'r-i^i^ r~('-r~ccccctccccix a^9'U'0'W'T-9-tr a 

aaffmaaacaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 

ccccccc c ccccccccceccccccccccccccccccc ccccccccccccccccccccccccccccccccc 


Number 27 


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







'S' I— 

? > 
— ir 


C x: X (S 

P _i c p u 

j. _i <r c 

x p x p 

— u' — c <r 


y 1 c ^ ^ 
~ c x 
c c u p 

II u. C 

c u : - 


I C <1 c c 


H- C 

u x 
p — 


i w- a e a a c r — • 


r x 

a. i- 

r- I/ - 
Z' P 


y y a i — 

#**♦♦* c 

tsysytsyejycysy 
x oc » o> 5 5 - — cv o c r 

cv&(\(\c\cvcc.accvc\ 


cLOLcc—c<r* a a o <s 


c <r ® c 
i a c u<i a x a 


C Q 
o <r ii 


a a a c c 


a 
c c 
x a 


_? x x 

_ <3 — 

C X C P 
x c -J <r 


«- <T X X <X 

C I- P z c 

C 71 — — _J 


•- — <T 

P *NCI- 

<r c "3 <r y 


X XX II XX 

X X <J — N--<JXC-UUCK« 1 -C>*-C><IX C X X 

PPCPP^CJ-PCP-J-J-J^DXCC >cccc KPC 

- - j <] ") i <Ttr — _j<to:q:ce: Q._j«-pp<rp _• a.y*-c 

CL 


a u x 

X C <T 
X Q- c 
C C » 

CL 

c c 

— A 
3t - l 


x. y 
o ~ 

I U! i 

spy 
u. <j x 
s P 

i 
IS) X 

X II 
C CM 
— C * 

p x ~ 


x p 

•i s <r ^ 
y u; j y 

X S CD X 


• y 


</) -h rsl x 

Z> X p c 
X o o x 


- a — x -j 

c * * c * 

ye a - * y c ifpirsirsirsirsiC'SirsirB-irsirsirsi/'sirsi/'sirsirsir 

i y y Nt 'tc^r-xtta'O'ss — — cv cv y r <3 ^yyxxr-r'-ctcco'O'S® — — w X r r 

i <i <: n <3 <j <j c <3 <1 < 3 yyyyyyyyyyyyyyyyyyyy>>c»c x <c <c <c <c 

C O 0 CV CV CV M X W X X X X CV cc X Oi X W Cl CVCVCVCVCVCVCVjCVCVCVCVCVJCVCVICVCVCVCVCV 


®ysycy®ysy®y®ysys 

^<jyy'CXP'p*xoco' 0 'S-® — — cv 


'i. O' c c u- 

IT iTlC IT if < <1 

x x x c x c x 

c c C c c c c 


< >L X 

x x x x 
c c c c 


c y c - c <ixxcv.rr<rx <r'ccvjnr'flx>cviu'£cvr, c'fcp-r^i" y — — x x cc y <3 — cv r a a. ^ * if u ^ - 

C X X X X — X X « ® --U CC®®--lt'CrcKS-W5SS CSK<irK^ 8 CSS-- — X XX C u 

— <3<3yctff'cxcx—cvr<3yp*p‘<Txoxx®cvyr-0'<raxxxs — — cvy'Cr' 0 -«axcxus — — — cv^vj^yr^c 
* x 'L'A.vL'f'A.x^xr~r'r-t^r'r-p'r-r-r-p'r-ttccccttttttXXXtta' 0 'ff'aa' 0 'a'a'XO'a'a' 0 'y<r<i<i<x<r<i<r<i<r<r<i 
X XXX X x x u c c c c u c c c c c c u c c c c c c c o c c c u c c c c c c c o c c c c c c c x X X X X O X' C_ c x 
“C C C C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCOCCCCCCCCCCCCCCCCC 


y x <3 — 
X X c X 


x c 
x p 

p — 


X p oa 

-i c - <r 

cd a x i- 

<T C 

*- P X 
C X C 
-J X 7 

c x - c 


y c c s c o x 


X o 

p p 

— c 
X c_' 
x y 
c 


: <s <r 

<Si 


£ 

y y 
y a 
<r c 


u i _> 

c 


s 

» 

s 

<s> 


a xa cxKcaia;ciia a a 


a a a a <r a 


i c 
<T P 


a c a c <_ c 


a a ? _i 

<r i - c 

»- _ p 
IX — 

* c 
PC • c c 

c u <? y 


a h p 

i- — <» 

VP X _ 

p — c r y 

— _x — 

x u _• C X 


rv- c_' t— x a ix<r — Xfl\i- y _j 

ZI-XPZ CPCXCCPX’ <i 

rjya--: u - juc jti c c 

p 


X > c PC X 
y p p — i x 


X 

c__ 

C Z I c 

c c a 2 
2 
<J 
i 

p a 


C —II XXXX X 

_ z> z> a. yyx — <jx<jx<ix<xx— c 
c c »-rrz>H?i-?i-?i-?>h 
paxii — £y — y — v — v — i y 
x 


* c 


y 


y c 


y®ysysy®y®y®y 
y'A.yr^r^xcc^occ:^--. 
ssscscsssssss —- 

CL CL CV CV CV.CVCV CV CV cva CV CVCV) CV CV cv 


# * c c * 

<sv®y'5V5yg.y® 4 /‘®ycivsir(sy'Gysv®v®yc 
CVjcvyr"^<jyi/-\ANCf^P“ttxa'a\c® — — cvcvyr*^^yyx 

---CVCVCVCVCVCVCVCVCVCVCVCVCV 

CVCVCVO CVCVCVCVCVCVCVCVCVCVCVCVJCVCVCVCVCVCVCVCVCVCV CVCVCV 


—< —1 X X ^J _X»‘_'I 

aax_ y 

zpc>t-c»-cKcZ'i-c<jpx i c a c c “ 

^xcpypypycLyyxc-.x x _■ <r c_• ~d a 

y v ” 

y y c a 

<T <* _ l - 

y y *- cc 

—ray 

C CD — 

* * * * * C 

irsvsysy<sir&visy®ycy®i/-sysv 
'£r~r-ococ 3 ' 0 '®®.- — cvcvyy^<jyyyy r- 
Ci'ClCiCiaciicvrrrrrrrrrrrr r- r~ r' 
acvcvcvcvcvicvicvcvcvcvcvcvcvcvcvcv-c cv cv o o cv 


a 

c 


a 

c 


a c x 

c c c 


a ® 

c c 


c ® s a e 

c c c c c 


x x 

x x 


X <J V O' x 

x x x r- x 


C p* 

O' ® 


® x — cc r- 

cv <3 s ® s 


cv p~ o r r 
c r c - c 


r <j x a <r cv v 
-x-cj c 


c cv x p- y e- 

c a r r- cv r* c 


c - 
<1 ^ u 


y y r 

CCS 


ucvrcvrcvrcvrxcv 

yssssssssys 


r cxcvoocvvcv — —cv — ccvy 

® c t*> s p* n **• r c v ® c c: c c 


a c 
c c 

a- — 
x * 

c c y 
c c x 


X 

a 

c 


X E 

X s 
a c 
c c 


c 

c 


cvyyyxr-v^a.xxxx 

S®SSSSS®ESESS 

X c c c c c c c C C C C CJ 

cccccccccccc c 


cvyr-a vca a axxcvy^yyxr*x«accu 

----— CVCVCVCVCVCVCVCVCVCVCVCVCV 

X c c c c c c c X X X X X X X X X C X X X X X X 

xcccccc cccccccccccc ccccc 


x ® — cv <3 

cv r r r r 

C X X X X 

ccccc 


y «c ^ a x 
y r: y y tr rr 
xxxx x x 
c. c c c. c. c 


c s — <3 y 
r <i <i vi o 
xxxx X 

ccccc 


< r- oc a u x. 

<1 51 C <3 <3 

X X X X X X 

c c c c c c 


xx x x cv y 

vi <i <3 y y 

X X X X X X 

c C c c c c 


Page 10 

296 


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


Number 27 






X 


x t- 
w c- 

I- 2 


tt tt! II 
i* O < 


u.' c e. c a 
h j u a > u 

>- tt a u. u 

a: —' a t- t- a. 

u. I h I/ 1 

a. u u c c 

c ^ c j h 


— y 
h- 2 
<1 — 


<T — 
X lx. 
(x UJ lx) 

I- I X 


c •> u y ^ y 

ccGCcwcf'acyaaQ.ciox: o. o o 


— <x c c 


K 5 i t' I 

>- u c * •> 

a s c <r ti i cv 


<r cj <3 a <r 


i s li li 

tt y a a: 

f* s < i m 


<3 X Q. 
1-2 2; 
y — -5 


> j i , 

C «I C 3 Q_ I 

2 e x a. c . 


A U. 

X _) _1 X X I lx. X X 

<rx_ji:> — «j<rr<rxQ.xxxixiiiy<ixeoo — 
l-2<TCC2<rCC?t-2CC Z 2 C 3 a C _J _) _J 2 Kj 
tf' w CliIflC.'JUC/'N'llLw-H t-Q..JQ.QC0CQC^3 

a 3 


A 3 
H C 
2 A 


5 Z> <T — K > I> X — ? 

c r-C*Xrvja 2 CC 2 X 2 -H 

2 iic"5CC22-0"3 


e, _j c 

> X X _J X o 
C ZCJ<XCJl- 

2 •- x o x y> 


— <J Z> CJ -* — > x 
>HC£H2XC22 
2y2X<JC2”)- 


o 


<1 cc 


y e y s y 

CM CC O' O' 

5 K C S 5 

r r- r 


y®y«sy®y>®y®y®ysy®y®y®y®y®y®y®y. ®y®ir>6rysyffye:y , ®irsysy>sy®»r 
®--cviwrr)<i ^yy'C'C^r~ttJ®0'0'®s — — cvjwncr-q •qyyvC'cr-r-occto'O'C® — — xxr“<r-<j'9yy 
— — — — — — — — — — — — — — '- — xxxxxxxxxxixxxxx x cv c\ cv cv rrnrrrrrnrrr 

rnrnnrinrrrrnrrrr'r'P'nnrrpinnnrrrrrrrrrrrrrrrnnrnrnrrrr: 


sy®y®y®y®y®y 
'C'£i^(^ya O' O' s s — — 
r'r-r-yr'rr'r < 3^-<J<i 
rjr'r-r’nr'r. r r r r, r 


c 

c 


c c 

c c 


c 

c 


o 

c 


c 

c 


c 

c 


c 

c 


c 

c 


a 

cv. 


C £ 00 

t- c cv 


CJ 

£ r~ 


<j £ i" cv. f- 

■q tt s y 


0C 


c £ u & y 

< fr r* y >c 


cv r r 

<S 5 CJ 


<r c — y> uj <r 
r- cj i* tt tt — 


cvirrc u . * c <t cm r ^ - r r 

®®c_ Mi u - s s u. c cv - 


y<r — f^f^t-'£« 3 Lx 

ii-cssst uir 


<r r* <i u <5 

r* a. c u c 


a u. r u <x 
f" y x tt tt 


< r cc c cc r- 
y cm u c tt r 


r u.cv.a.u.'cua.cfo 

c crst-sixU-r^u.® 


a c c s r s — oyvcao'oc 

£ £ £ — —-.-- - 

CCCCC CCCCC CCCC 

CCCCCCCCCCCCCCC 


C ll - -ft^l'KKO'ClIL'Clil 
- XXXXXXXXXXXXX 

ccccccccccccccc 

ccccccccccccccc 


uujix® — a r ■q »c O' c c tt c u 
WWCMrrrrrrr.rrrr r 
ccccccccccccccc 

C c c c c c C C.C c. c c. c c c 


— -q y r-~ O' 

<i <i q <i q q 

c o c c c c 

c c c c c c 


cj c c 
<1 ^ <1 
c c c 
c c c 


u ix cm r 
<J <J y y 
CCCC 

c c c c 


•q •qi^r-O'ca.ctt®— <5 
yyyyyyyyy'C'C'C 
ccccccocccco 
cccccccccccc 


c a 

_i 

2 — 

C 3 
X T 

lx 

X 
y <r 
c > 

_i i 

lx x 
-H C 
lx 

c n 
C 2 
2 ~ tt 
X X 
tt 3 >- 
— C I- 


-J I 3 

x ® y 

c c x 


CV 2 2 

y * 

x y <r 


a y y ii x 
r- C X X y o o 


x y y 

a <r cv.i 3 j a a • 

a a 3 -* y y ac a » 

<T'CC'Cxyxxxa<iaa 
x 


- > 
3 C 


.• <r a. x <r a. x <i _j 


c - t- 

a ® y 
<1 * -I 


c\ c c 
' c 

■ X H C 


y — y 
M Z X 3 I 
3 0 . c x ' 


> cj c cj — z> x y c > cj — J> —■ m x y - „ . _ ^ .. ^ __ 

,> iv n. ^ ^ ,r. ■, 2XcZXlv^t-2>2>K2>H2Z>2 


xorazcczc 

attorc2Xxc 


X2 C2Ch.«ix^_lxiv-'|- 

3t/)2<'2 0“5yxxcj“32y 


cx*—a— <jx — <jx—<o_ 

2>l-2>h2>- 

~)2 y — 2 y — 2 


*-• rs/ y ; 

X 2 X < 

■ c 3 w ; 


rv 2 :> CJ 

2 C C 

3 - 2 X 


y ® y ® y ® y 
CM 3 r> -q -q y y 
i— r- i— 

CM CM CV CM' X CM CM 


: y ® y is y c y®y®y®y®y®y®y 

r-p'ccyo'0'®.® — — xxr'r-'q-qyy 


:y®y®y®y. ®y®y®y. ®y®y®y®y®y® 

:r»r‘oci^o>sc--cvicvirr)q <qyyy yi^r^a 


■ u.ixu'tj'c-'C.— — ^ irif 'i x i'^CCtta'0'C£--CViCVir(*l<I •qyy'C >1 M' K I f ( 

l'-l'*r~r~t''00XCCCCXCCXCCCtCCCC.(X(X0C(X0t0Cci.XCtO'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'O'< 
X X CM XI a CVJ X X CM X X X' CM X CM X X X X X X X X X CM X X X X' X' CM X X CM X X X X X! a X X X X < 


X 

UJ 


U. 1 

-J 


c 

u 

u 


a 

c 

c 

2 

u 


ou'U-coccaacccaa <j 


XX XX 

•— cj> — c><r<rxx<ryx*- 
X C C > C C CH22CI-2^ 
—'<3 2 2 <r 2 _jy — — _jy —2 


y®y®y®y®y®y®y® 
C - Oi X r (Mi -q y y < sf r- 

ss®®«®®ss®sss® 

rrrnrrrrrrnrrr 


c 

c 


c 

c 


c 

c 


c 

c 


c c 

c c 


c 

c 


CJ 

X 


® — 

<J X 


r* sc <. £ 

U G £ — 


£<rr~ £ tt. £ r- r- cc 

•qcy yxy y yx 


cs x 
c u. 


£ tt 

r x 


S £ 
U — 


u 

u 


£ 

<s 


K 

X 


<r y u y<r uu.u.u.'ir^ — y 

l c I* it c i^sissuyuu 

auu. — xyy'cr-a.O'accu 
c<xcaaaaa.a;a:acLa:aa 

C_ CJ C.' CJ C c C C CJ CJ CJ CJ CJ CJ CJ 

ccccccccccccccc 


x <r < r~- u a — y tt <r 
c u. y u c u u. u cj 

tttt — — x ^ y r* < « a c tt 

a a cj c cj c_- cj c cj c cj c c 

cj c cj cj c c c cj cj cj cj cj cj 

CCCCC cccccccc 


ttXMirttftrttXr.ttr 

rssrcrssrssrc 

— r , 'qyf^<rcCtt«s—x-qi^r- 
CCCCOCCCCtttttttttttt 
C CJ CJ CJ CJ CJ CJ C CJ CJ CJ c CJ c CJ 

ccccccccccccccc 


tt X <3 c- tt X C r- 

tt c 1^ CJ CJ tt CJ p“ s 

p~f^O'cccttxxsir^r-tt 
tttttttttttttttttttttttttt 
CJ CJ CJ CJ CJ CJ CJ CJ CJ CJ C CJ CJ 

ccccccccccccc 


— cru-tt;cr''<ixr'r<TXrtt 

— ttyrty- ®s — — scr 

O'octt® — xr-^yxr-a.O' 

tt tt tt tt £ £ ££££££££ 

C CJ CJ CJ c c cccccccc 
cccccccccccccc 


Number 27 


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


Page 11 

297 





-1 

QC 

<1 


CL CC 

c <r c s 

o ~ o c o u u> <r c 

u. 


o -J zNzciio.1 a c x z u. o •- 

d X X M O C U C L. J <1 U-'CC 

I • “ * «* ■ • ■ " * “ * * ^ * * - * L' > li.' - C\1 n <5 t 

o ~ c 

c ot 

u uia: 

_ o c 

' 3 _ _r 2 kD2D2: 

{/) OC?C?<3< 

doduiocccdoccucccc — » ir w ui u u: i 

*- _i 

<r x c 

qd a. q: ui a. 

*- H DDL 

d C 0. 2 > 

I 2 U. C •— C/> <X CC O O I 

o x * # * c ir u c i 


o c c c *" a - — 

z x a a: 2 s ex 

“) CM X X Q: <1 T) U _) 


irsiTsifsirsifs 

'C^t'ttiCCO'aSG- 

f^r-'nnr-r^r^ccctcc' 

mncrrirnr-rmr! 


u. t- 
x c > 

- c>«o><r - tt — 

2 C C > d C d ex x 

<r <r z z <r z _) u u. o. _j 

c c 

2 A 

X — I 

Q- X II J 

- H- <T I 

* C 

_1 * c * * 

irsiTisirsinsinsirs 

- a a* n r ■‘i <j in ir xxr~ 
CCXKOCCGOGCCXOCOCOCX 
otrrwnnnc'inccrr 


7 > C C (2 > ~ C 

-« c ccoc ;> e • 
i <i <r <r i r <r 


n" s ir 5 if e ir s i/i sirsi/'sinsirsiririnKirsirK if^ifsirsirsifsir 
or cc O' O' © s — cm cm n n * ^ tr m x x p- r~ oc ccc?'Oes — — c\ cv r r 1 <i <j ir if 

UlftCC([r(MMMMMMMMMMMMMMMMMMMM S5SK | SSS ' S f : i5 : . 

r r r r r rrrrrrnrnrnrrrrrrrrr^ <j ^ <3 <3 -q -q 


® cm n 52ix x O' 


1 0 e e c* e e e 
: ui u' ui lu uj u 1 u 


o ji zrnaif 
• ~i j 2 71 a. a x 


iff'lfKlfSlfSifKif'SifSif'SifSifSfSlff.lflfSlf 

>cM'ciC(M>5'5;--c\a i rr<j <jirirxxr-'r-ix;»0'(sjs 


cv w r r virif'*-'tri'CL»o'B 5 

ssssesses'sesscDS — — 


cm a. u. u. x r: — x r- u u <t t' c — 

C S & 5 It! c — It' k im if - — 

5Tr»notO'<rou.u.u cv,<iu-xoco'<raa.a:aL(i 

o o o c c c o c c c ccccccocecdc 

CCCCCCCCCC CCCdCCCCCOCC 

cccccccccc CCCdCCCCCCCC 


cl 5j oc c 

<3 <1 <1 5J 


— u. — — r u. u « r~ <> ® t*- o u<r ur'sssc cl ^ oc c 

— ^ CO tt 1C if r. 1 if C CM <5 <1 ^tT5j^t/ , 'mir^ q q q <I 

ce uu.u.®.-cvnu-xc'‘Cccccc<cuuscM5jxcc<reu.uscL^xxxxxxxxxxxxxv©xxx 

£ CCCU-UUUUU.U.UU.UXU.UuU.U.U.UU.U-U.U.USSS'SCSSSSeSCC. CSSSCS<D<S<S1CS 

c ecocccececccceeccccecececcuuu.' uiu’ U-UU.UU-U u u. u. u: x uj u. uj ui 

c ccccccccecccccccccceccccccccccccccccccccccoboo 


H • n X 

> I Dl 

ac - « s : 

X •> « < 

x <r cd 00 <x h <r . 


x a j 3 

•» X % IT 

1 x <i x <r a. 


2 3 x • - 3 • 3 
xw uso«c<rc 

ICLS* • - _J 


I o X CC H H 

® X X % c c 

a o p“ <r o c o 


-J — <TX<I2»-* 
<r > H 2 QC c > 
c £ <n — x l. z 


a. *-> <x x h- 

£ > K 2 u 

3 Iif Hfl: 


• - O > H 

>ocui 
z <i x a: 


:x> j>tf!ccucja-«« a. 

■ 2 C <T C C 0: 0: 0: 0: <r c 2 d 0. O d Z 
l-ZOllLttttaKolfl ■) 


-* X Q. « 

X > N 7 Z X 

• O Z 3 - 3 o 


SifSifSiflSifSlfSiflSifSifSifSifSifSifSlfSifSif. 
w w n r <1 5iir'ir*fi>xt^p'xx<>a's® — — CMCMnr?5j ^ m ir x x 
<j- | *5i<3<j-<j<r5i5j'q<*-q<j5j5j<j J r l /-)ir. ififififififififififif 


ifsifscfsifsifsifsifsirsifsifsifsifsifsifsifsifsiifsifs 

cm n n 53 ^irwxxp~r-occco' 0 'S<s — — CMCMmr>5j ^inmxxr-ncccco'O'S 

iriDmtririririr'criPiririrtrirxxxxxxxxxxxxxxxxxxxxr^ 

r' ff m fo r*' rri ro ^ rr r* *c ^ m ^ ir> kt ^ m- ^ ^ — — 


X X >1 N N -V N N N N N S 53 5J <3 flfflflflflflflflflflf l flflfl/'^|/'|/>^^^^^^^ l£ X'C\CX'C'0'C'£X'f'vfX'C^ 

nnnr'r'nnmnnnnmrrnmmmnnnnnnr'nr'r'mnomnrr. rrrDrnrnnnrnp'nrrrnrr'nr 


— c CM 

ox cs 

x o x 

* o * * c 

s — — cm cm r> O 5J 51 if If x 

t^r~r^r~r^r~r-r-r>-r~r'-t^ 

rnrrrnnrnrnn 


d u. a r u. uj n 

o r s s <1 no 

If K < ff OCCU. 

xxxxxxxx 

cceccccc 

cccccccc 


ui &i r O' 
n ® <s o 


— r u. u. <1 r- o' 

— a ir n co if o 


® ^ a u. s <t -q r~ scuq 

5i (» 0'®mnr-®p' <ia.a 

LC\jrcDDifitU.u.itc - x x ui <r x n ujucm — 

rKS^uMtssMSScititUitcuu r- u c — 

xooo'<iodu.u.s — CL>n5ir^oc«jou—nxxxxxxxxr-o'oo 

ttlCCOXICICICO'O'OO'O'lhO'^O'O'tfC^C^^tfCtf^ddd^ 

CQOCCCCCCCCCCCCOCCCCCCDCCCCCCCQ 

CCOCOCCCCCCCCClCeCCCCCCDCecCDCCd 


n u- cm u. u: <r o n u 

c it c u.nono u. 

U.CMCL5jr-t^O'XU.U.CLCM 

<rccaaa.xa;xffaoo 

ccceecceccec 

cecccccccccc 


Page 12 


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


Number 27 






co 

n 

x 

-j 


0 . 

x co 
x _j 


X _] X 
a: _j x 


CC O' 


9 IT 

II II 

<1 <x 

O H- 

-J CO 


co co 

_J -J 

♦ ♦ 

_J O <1 tO »- 

-J O <T to H- 


C 1/3 
9 Ql 

' _ a: 


•i ® 

X CM 

<r •• 

CO X 

o 

X 

X <0 X 

9 0 . 9 

_) UC _) 

C X c 

♦ + ♦ 

D <1 (/) h X 

c <1 CO t- <1 X 


CM 

II 

o 

c 

o 

9 

_J CM 
C -J 
♦ ♦ 
o x <r a 
e x <x o 


CV! r 9 

CM CM CM 

II II II 

era 

<x to in 


CM CV CV 

— 1 —I _) 

♦ + ♦ 

cc-i/r-t/a 
tfc-irr-i/ia 


IT 


ii 

X 

Z 


■x. i" 

CVJ CM 

II II X 

X O CVJ 

o <r ii 

c c <r 

o 


O' 

CV 

II 

Z 

<r 


in n 

x x 

xx cv 

XX _J 

♦ ♦ ♦ 

zxco*e<icc<r<r<iz 

zxcoxc<co<r<i<iz 


s 

r~ 

ii 


x 

X 


CV 


X X 
X X 


r~ 

ii 


cv, 

_) 

♦ 

c X 
c X 


X 

CO 

II 


9 

CO 

II 

O 

X 

X 


m 

co 

n 

_) 

9 

X 


VC 

CO 

II 

X 

<x 


X 

_) 

♦ 

OX~X_]Ol*Xe>X<T_JX 

ox«-*x_Jo^xoix<Tja: 


axxxxaaxa 

QOOOOCOCC 


x a a 
c c c 


a a: cl a ai cl ao ai cg cc cc cr cc ao 
CCOCQCCQQOOQDC 


xx x a 
o o c c 


a xaxxxxa'xxxxxxxxaxxx a a a a a a a a xxxxxxxxxxxxai 
cccccaooacooQooQOcaccocccccccocoaaocoaoco 


ITS/ISI/IS/K/ 

'dhM'CCO'O'ES 

99999991/llT 

999999999 


S IP K IT S / S /l 
<-cv CV r r' 9 9 

iPiPiPiPiPiT'i/iiP 

99999999 


SlP®iP®lPSiPS 

iotr>' 0 'Cf~r»ccocO' 

iPiPiPiPiPiPiPiPiP 

999999999 


iPSlPSlPSlPSlPE 
O' 5 5 — — cvj cv) r- r" 9 
IT'C'C'C'C'C'C'CC'C 

9999999999 


PSlPSiPK/S 1 
9 IP IP >C >t M' X 
vt'O'C'C'C'C'C'C 

99999999 


IPSIPSIPSIPSIP 
X O' O' (S ® — — X CVJ 

999999999 


SlPEiTSlPSiPS 

rr<!9/p^'£r' 

999999999 


iPSiPElPSlP'SlP 

r^xccO'O'®® — — 
c^p-r-r-p-xxxK 

999999999 


CVJCX 0 'U 9 -'-C 09 ^OCCCC 0 XCJU 9 — (0 9 - XCO 
-----T 0)-9 0 ! CViK«CO-C-K 


w U a; o' U n »■ n v - u n i 
-Mlf KS<T®« ITS S 9 i 


— %* vsoiSBWs-ns-wsftS-wtt-w* v> » »* » - ».*»«. n » 

cvjco9in'cr'XO'cxocx , x® — cvjr9i/3'fC'xo'<rxcjcxxx — xc r 9X'C 
99999999999999 IT. iPlfl/miPiririPlPlTlP IT. iTlTlT, 'C'C>0'£C'£'£ 
X X X X X X X X X X X X X U X X X X X X X' U X U XX X X' X XI X X X’ X X X X 


UL;nu.a-wn^w. x,l'ttO'<iaiUCUIXB- 

CV]OJCV.CVJCrCOCOCOCOCOCOCOCOCOCOCOCOCOCOC09 9 >i n -n >i >i >i n -s -x -N N ■M’N >* u. u, 

X X X X X X X X X X X X X X X X X X X X X X X' X X X X X X 1 X X X X X X X - X X *»- —- •»- t*. •* 

DDCCCCODOCCCCOODCCOCOOCOCCOCOCOCCCOCCCiDCCOCCCC 


9 if'Ci‘CC 0 '<iacc 

------ _i'i't'C'C'C't'C'C'C 

X X X X' X' X* X X X' X U' XX X XX X X XX u. ul. u. u. i*. 

ccoccoocdcocccccoccccccco 


X ® — CV.' 
x r- t- r- 
X X X X 


i i a. x s 

• W 9 ®®CCVJ 9 'CCVJ'C 
JCVJCV CVJ 9 CO NC O' — — 


a s cv. 

CVJ 9 NC cv < O' 
CO < O' — — — 


u u- 

rz’Zc ddu:D3dd2>-d:d:dd: 

■C?O(jOC?CC200OC?l-OC?!?e{?GC? 
.XX X X X X X X X X X X X X X X X 


Z ODC'I-JXQCCOX 

X C 99999 CXX in 

:>x_jcvi<oox-1-J_j_jxxq:v)cc2c 
: 3>X*_I_J*CCCCC *xxxxxxx 


-J c 
on 

X h- C 

- c 1 - o 

r <r z a 

- C Z -I X 
: X X Q 

a c x c 
l c x i- o 
o m 

b’ to z CO 

JlO-<«« 

— to CO 

x — 


I c x >- X 
c cc c. 
: to 

3 I- to X (O 

— H c I- 

] CL •-* — 

CL >c CC 


lO 


i coa: jcc j 


to D 
»- o 
-- <r 


co in co 


■II-tOH 
. C* X t- X 


) to to to to to to to 

X X X X X X X 

♦ ♦♦♦♦ + ♦ 
raa<taoior'Citoa:aj<rz<rxx<rcQc<rozx 
[OD 9 :oocoz'QDtoa;DD<r 2 <rxci:<rc a: <r o z a. 


X -I H- I 

x -i h r 


ajccccajcQcrcrcccrcLccaDCctrccGceLccircccoccccoc m cc a a 
CVJOCOQOOOCCCCOCCOODOOOQOOC — CJOCC 


0 . 

o 

c 

a 

IS. 


c ******* 


a. 

D 

C 

X 

IS 


c > 

? z 

< 

X C I 

s x 

X + 

> oc z 

> r' <s z 

o z 

z c 

9 X 
X 

a cc s a 

o c to c l 

<0 X 


^ - c c ^ - z 
3 > ^ O O X « 2 


SiPSiPSiPSiPSiPSiPSiPKiPSiPSiP. SiP5iPSiPS^®iP®lPSiP®lPS'lP8lP®lPSlPSlP®lPSlP(SllP(SiP®lPEirKlPSir'SlP 

— — CVCVJC0C09 9lOUO'C'Ot^r'KttO'0'S(S«- — (VJCWC0C09 9iniT'0'Or-t^(X)000'0'®®^-,— CVJCVJC0C09 9lOlO'0'Cr^f^XCOO'0'(S!(S—'-CV.0. 

— — — — — — — — — — — — — — — — — — CVlCVJCVJCMXIOCVJCVJ CVJ CVJCV1(\JXJOJCVJWWCVCVJCVCOCOCOCOCOCOCOCOCOCOCOCOCOCOCOCOCOCOCOC09 9 99 9 9 

9999999999999999999999999999999999999999999999999999999999999999 


5 IP S P S P ® 

co r 9 9 lO lO 'C 

9 9 9 9 9 9 9 

9 9 9 9 9 9 9 


— 9 9 — 9 COCOIOCVJCOCVJCVJ — X — CCCM — XCM — COC® » O 9 C X -C 

'£5S'C®Sf'-®f'SS'tKlSr--S'C-®'£iS-. <S CS — <1 (S — 


O'C0'9C0CVJ0'U 

(ccosccs-oos 


'C'C'C'C'£’C'L'C'£'CiC'£'C'C't''C'C'C 

xxxxxxxxxxxxxxxxxx 

DQCDCCOOCCCOOCJCCOC 


»c «c *c »c 
® ® 5 ® 
X X X X 

o o c c 


'C 't 'C 

® ® ® s 

X X X X 
C D C C 


'C vC 'Ll vC 

0 5 ®® 
X X X X 
O O Q C 


'CMCff,<MEOC 
® 5 5 ® ® ® ® 5 
XX XX X X X u 
CCC OODQC 


XX 8 -Wn 9 P't 
o® — — — —— — — 
xxxxxxxxx 

COQOCCCQC 


x O' <r a: c c 


xxx x x x x 
c C o c c o c 


XXX® — OJC 09 
— — — CVJ CV CV CVJ CVJ 
X X X X X X X X 

caoocooe 


9 9 lO'Cr-XO'^CD 
CVCVJCVJCVJCVCVICMCVICVJ 

xxxxxxxxx 

CQOCCOCDo 


Number 27 


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


Page 13 

299 





co 


U. k. Il II U. Il II 

x ujx u x it x uj o u c uj ui 

— <ixixa: — oaocxococ — tjc*-<rxQ:Q: — _)oc«:xa::E: — oco«_jxa:a: — <rcc_JxuaLt~<xo — <txaco:—oco<rxctQ: — c 

XI-ZZO>-JZ<rOOZO>aL2XI-ZZe:><X2<TOOZO><r2XI2ZC'><l2<j:iC_'ZC.>ZZXl-ZZo2>l-2<rCCZC.'>£ 

_ji/)-- — azacDo-Ja — cio:Djifl'-«c£ii: 2 ojo-< oza: d jvi — «-'CZcrc_)c~czo 3 -Jt/>~ — o z i/i : o _j c ~ c z c 


CL 


c a. a. 

a c z 

o lc m u 


co O' 1/1 cm — acor-r^X'CCM — s^-c^irO'ircM—®t/» 

— —cu — — — coi/icm — cm — — — r>ir.-a. — — — 


acrcccLcociaDcccrcctiacracaaactaaaa cl 

CCCOCOOQOOOCCCOCCCCCCCO 


®ifl®in®in®insir8if's^si/'5if 1 ®if'5 , i/'® 

r- cc. co O'O' ® s - — cv w n n <i cirirx^r-t^cc 

— -— — — CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM CM 

i/ii/iiri/ii/ii/ii/iir. i/ii/ii/ii/iininiri/ii/ii/iiririr 1/11/1 


r-r-cO'CCM — ®'f'f^cnf“iTCM — ®Kr^r'>C'LCM — 

ITCM — CM — — — COlT — — CM — — — CMi/G — CM — — — CO 


CLCDQCcDCLQtccGDCLCDa i a a £L a a a a a a. a ai ai 
OOOOCOOOGOOCCCCOCCCCCCCJC 


irsiTsiftsirsirsiflsirsifisir. s/s itqits 
xoo'ss — — aJCMcoco^^i/iiT'C'Ct^t'-a x im> 5 

awannrnrrnnrnrrnrrrrrrn^ 
it it it it in iTi i/iifini/iir>iriri/iirir>inu'iriri/iir. ir, it 


r'DiniPCM — ®a>r^p'^'LCM — s x ir a> - s n 

■T 1 — — cm — — — cowcm — cv — — — ro <r ^ <j <7 


D 

CLCDODcrcLOCtracicraacLaiCLCLcr c? x a oc cc cc 

CQOCCCCOOCCOOCCC UJ C O C O O 


X 

co 

CL 

K 

* c 

iT(si/isirsir®irsir®ir(si/'isiri®inKifl®i/i 

it — — CMCMcocn^r^irir'C'cr'C-xxa'O'®® — — 

i/iifli/nriniri/nninriririririr. iri/uftiriftinirm 


cno'ocL« — ^acMcuaMtCMO'Qn 

s — — ®®®cm»o — — — ®«kcmpo® — 

l/ 1 'Gr~X< 7 '<ICQOCUJU.® — CMCO^lT'C 
CCCCCLtEQDCCCDCDOrCLCCaOOOOOC 
IL L‘ 111 UJ U 1 b . 1 U) UJ It U! It 1 U 1 Ul kl u; U . 1 U U) 

cccooccccccocooccc 


O'CCL^nO'CLCMCOODC^O'C — O' 

— ® ® s a: ro — — — s s s cu n 5 - — 

Mio'caiucuu.s - cm co <x 1/1 >© t" 

OCUCOCJCOOOCCCOCCC 

u; u 1 u. uj u: uj u u uj k 1 u: u u u u u u 
occooococccocccco 


eff «u»ns<roa:<iir9>oua'c 
S 58 -r---S 58 WrSS -*5 

OC O' CfflCCU'US-CMr 
C C C O C C C C U' U. UJ U U UJ UJ UJ u 
u; u u u; u u u u u u u u u; ui u. u u 
ocococccococcoccc 


cc<t«^0'aii.'<roa<i'c o — o'ooac 

® S CM r - ® — ® ® « G. 1 CM CO CM CM & 

0'<raiccu u®-wn^^^ifl'CM 

UU.U.kUU.UU.kli.UU.U.U.U.kU.U. 

uui uj kk k Uk k k k uj uj k uj uj uj u. 

coocccccococoooooc 


o 

UJ 

2 


X 

r 

II 


0 

r 

11 


in 


s 

■q 

II 

a. 

z 

"5 


<r 

11 


o 

2 

c 

o 


CO o 
-J u. 

♦ ♦ 

tf Kutfl uiowHuoznn 
<r a c i o c i oc/>i-c-ozx _ 5 .j 



oc-Jcr a: u »- a: 
c<r_ic-Jsau»-a:i 



■ -r t t * ♦ 

o: irt-a.uia.Di/ia.ca.xhi 

Qtc/i»-a.oxa-Z>c/)a.ca.xi-x 


cv 
1 r 
11 
2 


_J 

c 


CO 

to 

II 

t- 

D 

C 


Q. I 
Q. I 


*r 

if) 

II 

UJ 


1/1 

i/I 

II 

o 



2 

2 


iiaaiiraaaiiaiaia:icita:(Laiiriiairaaaaaa[iaa.aiLa'iiajiia i ita(iaiLiia 

ooccccccccoocccoocccocccccccccccccoooococcoc 


a a a a a a a cc a. ajQDajOLcca. ccacccra 
ccc cccoaoooooocccooc 


c 

2 

2 

<X 

z 

u 

a 


c~ 

c 

2 

<r 

s 


h r 
c 
1 - a 
0 : a 
u 

> z 

2 — 

C </) 

e x x 
a o 
ir h- c 

U C/1 _J 

j ? or 
a — 

<x a. 

c h u. c 

o C' 


3 - {/> 

C OJ U! Z 5 

a: _j x <2 

c -J ~ uj u 

C 3 C 

u. c 2 

«J — X 


a 

c 

2 


'c 

1/1 


OJ 

o 


®irsifsif5irsinsi/isir®ms 

cii cm r r sj <3inr'£'iM'iX(j'a'5 

XXXXXaXXXKXXXXXXO' 


1/lKlTS / SlfClTEifSifSiTSl/IS 

<s — — cv. o r'ro •qiriP'L'X r-r'-oecco' 

O'O'O'O'^O'O'O'O-O'O'O'O'O'O'O'O'O' 


IflSlfSUISi/'SlT, SiTEifSlTSin 
(>88 — — c\.cnrr <j <j if~ ir < vc r~ 
O'SSSGSSSCSSSG®®®® 
viriniririfirifiriri/'ir.irifiririr 


smsinsinsinsi/isirsirs^sir 
aoxoo8®--CMC\inr < j <j it tr »c »c 
®®®®—————————————— 

i/ii/ii/iini/ii/ii/iiri/ii/ii/iirinc/iiririr. vr 


— cvee — rcrco^nc 

K — SSS®SS — — GS 

r'<JiT'ir'KO'«iCLccu 

r~f^r^r^p»r~r-r-r-c^r^r- 

UUUUU'UUJUU'U-UJU. 

CCCCCCOCCQCC 


c s <r s sco — cross 

<J— U <J®S<TXU.<JS 

US-UCO^lT'tl'Xff' 

r-xxxxxxxxxx 
u u. u u u u u u u u u 

COOCOOCCCCC 


CMiT-qCMSSCMCO^Sr. X 
— S — U.SSC — — — see 

<acDuiu®-ar^ir 

xxaxxxo'O'O'O'O'O' 

UUUUJUU.U.'UUUU u 

ccccoccccccc 


sir. ro®u.®x<jxroG 
it — r-irs — — — x — — 

'cr^xa><rxc'cu u. s 

0'0'0'00'0'0'0'0'0'<r 
U'UUUJ UUJUUUUIU 
CQCCCCCCCCC 


xo'U-SU.ir^i/iO's ^O's 
CCSCMSSCO — ssssss 

— ur^iT'Cf‘X 9 'flttcc 

U U : U Ul U UJ U UJ U! Ul UJ u u 
cccoc eccoaccc 


UJ u. s IT u <J X 

s S — — S S CO 

UJU.® — G.CO'Q*! 5T ^ ^ 
CCCLCLCLCLOJCLajaDCC 

uj uj uj u u u k k u uj uj 
ccccceocaoc 


Page 14 

300 


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


Number 27 




Si 

3 


IT 

O' 

3 

3 


® iT> 

m r- 

r~ S 

3 l/ - 


S 

O' 

<3 

<T 

3 

a 

3 

s 

a 

cc 

<3 

IT 

CS 

X 

<1 

(T 

r- 

3 

IT K C if 

® 3 3 — 

r- — 'c r* 

3 X 3 X 


S) ® 
00 O' 
O' r 
•3" cv 

<S> ® 
cm r- 
O' m 
•3 cv 


O' 

3 

3 

X 

3 

3 


\T. 

O' 

IT 

3 

e 

IT 

s 

3 

s 

O' 

3 


S 

3 

3 

3 


in 

3 

n 

3 

S 

in 

cn 

3 


® 

x 

3 

3 


in 

cn 

co 

3 


in s 

3 CM 
3 CO 

3 3 


S 

IT 

3 


in 

® 

to 

3 


m 

® 

IT 


IT 

CO 

s 

in 

® 

O' 

O' 

3 

m 

x 

IT 

3 


® 

P- 

m 

co 


S ® 

m 3 

f" <s 

3 S 

S S 

0 3 

p- p- 

3 3 

s in 

IT 3 

3 p- 

3 3 

tn ® 

3 CO 

3 r* 

3 3 

s in 

r — 

3 p> 

3 3 

in ® 

— 3 

3 3 

3 3 

s m m 

s s CM 

3 _ 3 

3 in 3 


6. in mm 

e — —3. 

f" x r 3 

3 — 3 CM 


m in g 

3 ® m 

3 O' O' 

3 3- — 


r- x 
m cm 

— 3 


in ® m 
sin m 
CO O' 3 
CM 3 3 


® ® ® in 

- vO O' O' 

s in cm r- 

in 3 3 co 


in ® 
CO CV) 
m 3 

3 CO 


ms s ® 

3 x a — 

CO 3 ® 3. 

n 3 in 3 


m 

x 

3 


e 

3 

3 


m ® m 

3/ CV 

m x in 

3 3 — 


m m m ® ® 

m O' 3 r- 3 

S x 3 cv — 

CM m — 3 in 


m ® 
p- r> 
CM CO 
CM CM 


in m ® ® m 

X O' CM 3 x 

® CM O' 3 O' 

m CM 3 3 CM 


m m in m ® 

3 O' 3 r- in 

m O' m cm r- 

— 3 3 3 co 


® ® ® 

CM O' 3 

m CM 3 

3 - CM 


m m ® m 

in in O' O' 

3 s x in 

3 m 3 3 


m m m m ® ® m 

s cv a m cm ® m 

3 cm r co m r cm 

3-— CV 3 — 


® in m m 
3 co x x 
x O' cv: cv 

— — CO 3 


m m ® ® ®. ® m 
m — m ® O' cm cm 

X 3 O' ®3" p- r- 
3 — CM CM CO ro cv 


in ® m m m ® ® 
® — m O' c m3. 
X 3 ® ® ® — X 
CM — CM cvi m CO CO 


m ® m ® m 

3. fO 3. ® CO 

CO CV CV — CO 

r- — 3 m cv 


® ® ® m ® ® 

p- co ® c co 3 

3 x 3 m in O' 

--CM — — 3 


s s m m s m m 

O' CM CO ® r. 3) 
— X 3 X 3 r O' 
X 3 3 X 3 — 3 


m ® ® m ® ® 
in P* 35 3 3 ® 
X3CMP-P-P- 
CM 3 3 CM CO CO 


in ® m s in m s 

3 — m cm x c- — 

P“ X 3 3 CO CM CO 

CO CO CM — 3 — — 


m ® m mm® 

s m co 3: p* co 

3 cm 3 r~ x 3 

CO — 3 3 3 3 


e r- a> ® cv 

O' CV co 3 £ 

cl a cc c s 

a c c c ® 


CM — — 3 3 CO 
p- C u o 3 ® 

c x a cl c s 
c o c c c ts 


p c. m o: cv o ^ o> u 3 u p* c o x 3 
O' u. s a. c cv u <r u u u c^ 3 3 x ® 
accocoeaaa cocoa® 
00000 0.0 0 0000000 ® 


cr x x — 3 r* u. m in 

— — 3 3 3 3 3m® 

c o c c c a dc x ® 

CCCCCCOC® 


<xr~®®®®(^® 

® UJ ® — 3COO 

u.ssscsa® 

oc®®o®o® 


®®® — 0)3X3 
3CM3CMOXCU. 
SSSCCkCU 
®®®OCOCC 


3U.mXU.C0X3O' 
<tX®®0C — O'®® 
D«im®oxccs 
COO®OOCCS 


<T ® 
® CM 

s ® 
s s 


mi-— x x 

OC Z X 2- c CL CV 
CQ.CC <3 X-ll- 

o _> in <r a _j cn m m >- c 
<T 33 axa-atraxc 


u c p- o x — a <r 

C 2 C — CM 2 P- -J QC H 2 X 

i CM_J 

zxxxxxxxxxzc a. on a. c. 
C C c (J O <J C C C C C' c c o c c 


- -J -) 

XC-1ZXX X _) 

-imcnmm _) ox CMtn«j 
U.tN»-HH|/)iflu 2 C OOOC *- 1 

ccccccocxxxxxxxx 


XXX h JZ 

x m x ® co co h x >- x ff >- 
XX CMHXXXX _) a J 2 V) 

zxxtnmcxxxi-33xxxxx 

xxxxxcsocccxxxxixx 


r> cm 

"5 -1 


X _J 

O I 
X h- 


X X 

X X _] X UJ 

m — i- p- o _j~i- x h in — p- o 

Z)oin ul z <rc«n c “ zzm z 

xcocxx-ozoo^ocxx-oc cja.mxxD- 5 ' 


X 

cj •— o- a. i in —* p- x x o -r- p- x m •- p- x 

2 x in c H Z> z in o o z x in c — zxm a — 
>ZcnXXX“DXcX<rXXX“3Xo3XX x x z> c cj x c xxmzx 


■ Pr'WW'Cmo'- 
rm33CM3333 


nrcoco'Cmp - CMcop*33)mo' 
m33CM33m3m3mCM3 


— ®fooco'3mp- — scoP'S'Cmo' — mmx — 3m — 
333in33CM3333CM3inc03 333m33P-33m 


>- 3 a m u 


xxxxffxxaxoxxaa'xxmxxxxxxcixxmxa a a. a aa xxxxmxxxx xxxaxxxa o a a a a 
000000000000000000000000000000000000000000000000000000 0 0 


Z 3 Z 

in in 0 c 

X C O X c 


_J x 

x a 

* * c 

®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m®m® m®m®ms.m® m ®me m®msm. sm 
xxcocn 33 mm 33 P'p*ttK^O'®s — — xcjcor) 33 mm 3 > 3 P‘P-ttao' 0 '®® — — CMcvJcocn 33 mm 33 P‘C^Ka<T' 0 'es — — xx 
mmmmmmmmmmmmmmmm 333 33333333333333333 p-r^f^p-r~p-i^p-r'p-pp-(^r^i^p-p-r-ppaccixcra:ci 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm 


0 3 2 0 

m a > z 

* c cn x 

® m ® m ® 

cn r 3 3 m 

x x oc x oc 

m m m m ir 


CU^^CC'CWO-ff'iTXSPUJCO'IJ'O ff <?'XXO^- 0 'XX®CXCXl> 3 XO' 
^ xxnxcnxm—xxcnxc^xcr — xxcnxnxm — xxxx—xn 


is m u u u «• w uj «. 

m — xxxxcnxx 


0'Cmx®cxcxo3X0'Ujxc — cpr-a ®xu cra'3aa'®x 
(M«fti(fi_«.AAiAi_fti» pl fti^(rXrxn-XXrcvrR.rftia 


s ® 
x x 


s s 

X X 


cpccocxx® — xn3m3t^xo'<ixooxx® — xc r )3m3r~xo'<rxooxx® — xn 3m3c^xo'ca ooxxs—xcn3 3 3 <r< 

xxxxxxx®®®®®®®®®®®®®®®® — — — — — — — — — — — — —^jxixxxxxxxxxxx xxx cn cncr co mm cn me 

XXXXXXX'XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXU XXX XL* XXXXXXXX X XU 

oocccocccoocooococoooccccoooooocccoooooocoocccccocccoccccccccc cc 


Number 27 


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


Page 15 

301 




U. «*5 U a 6' c l c 

<iiL^ircviC£(j<iu 

— oousscc- 

a u cd a r m. - q 

u U‘ c c s r c u u* 

ucvqocvccuaq 
ouuo'Sr'-—c — 

o o cv c ri <\ o r- c 
p“Xcoesco-o 

<ir?<ia'&-iica 
<x-c- e s c c p* 

cl <r cl s u p- a c 

Ui — — r- r r o u c 

O' o u r u c c u — 

ccii(\ rcccc 

i-uii'ru-ac 
c ® u r- s q c (" c 

qcv<rUk/-ccv<jq 
CO — h. C C 6 a « 

CvrruiTr-irc 
c-r c s o- u c 

accii-cv-cir 

COjCCUSCCC 

p- o u o- c s s — c 
O'CU'P-qcvcqc 

ci/’rcvsiu.^fl q 
ceccvqrscx 

— c r c s r c a c 
cc — ccsc-'cc 

— uo'O-p-cvO'O'c 

u U-OU-CSt'UC 


s s s s s s s ® s 

LLS-ar^iT'f 

a a e o o o c c c 
ccccccccc 


c i' 1 ii. i' 4 n n s 

- LltO/'O® 

r r'c , mcv<ru'®ui 

— e®cc<j<-'nr> 

rs-ocirsfT'Cu. 
S U ® C U q ® o m 

cv q — c — ui o. x n 

su’ccvuusp-x 

s<r<r<rr~ir. soo 
q — ® C m U m O C 

c. " — r- — ui cv u. 

esqueumuu 

CCVXC'CCCCVl — 

c s x c u coo — 

S SSCV U ® X ® P* 

c q c i^o — cmos 

<3 q u q u cm r~ u <r 

C o r> O Q O C u t*“ 

USUSU'CJTQC 

— UquSSmQC 

qu—uuuux® 
u r-xur-urev — 

cccirct^nncv 

-ccucmsco 

rt^xs—'Ccvit-s 
-xuucvsemu 

r^-'Cc'Cruu 
s c s u o u it r u 

cv Lifcif«ru.rc 
s — o — up'nsc 

S'cr~aeoccvx 

q u ® — q c o ® cv 


®s®s®®®ss 
r^xo'cccocu u 
o o o o o o o o o 
cccccccc 


Cf^<r it 1 c s n n i/i 

CP* — II c it u (Oil. 

xoircaujooo 
CV (J U C U U ® C P* 

nnnqruuiuJD 
os — qevt^nue 

ro.rc'C'Lii.-L. 
ssasoir. UJ« — 00 

cvjc — r^cuncc 
® c c a css co 

sa — c t- cd a q o 

cvcvup-mr^si^r- 

u cv. n u <rwocnr: 
r , c'®mu®qc® 

r <r cvj c c\ s ui o cv 
s — scsnncvjs 

cv ® <x c u u 1 o u x 
® <r — 'Cuncnq 

<ru c<rn cuo'U 

— UCC* 0 0 X 00 

niocr'uoono* 

— U.I'SiT'flOSO 

n — C'ccnncvjr- 
SU-OU P* O ® ® m 

CVOP~^C^C®q 

scsscnccvx 

— M^SMiJ'CplS 

^cu^qcxou 

wof^socuen 

cac—eqxqu 
ap'ccuxp‘r*m 


®sss®®®«® 
s — cvi r q iT'cr-oc 
ccc c c o c c c 
cccccoccc 


qnr — — <rnno 
e*ec — xmqt^® 

<tuocuujcvcvx 

ccnoqqqs® 

qqcxuixsm® 
nee c o o m cv — — 

ui — cc n'Coo no 
u — cosqq f -<s 

®c<rr~ — x®or> 
tr c os — q cv ® q 

qcvxqqr*®q — 
cast 1 — qmss 

ucvu'ur~qm — cv 
somsmqqq— 

q®qu«i®®qu 

uiqr^sxcvmsq 

— U UU ® O' U^T — 

uu u. s e c q ® s 

cuocujr-® — cv 
CP-ccnmmq — 

XCCVUU«® — ® 
O'Coovneccvqf^ 

cqcvcvrsnc — 
op*eex®qq® 

unssuunouj 

soo&onnqq® 

Ut^UUiqUUX — 
sshhhiir qq>c 

u.<. couirsmcv 
socccxcvq® 

uccvccq-<rqcv 

sccouxmq® 


sssssssss 

O'CXOOUJU® — 
OCCCOCOU’U 

qccogccco 


0'ncvo'CVQ®n 
®ncv® — q® — 

x — mujn<®x 
m<i—cv®®®x 

oqo — cvncvq 
cv®®® — ®u — 

evom — cvqqx 

— cv n ® — — — — 

uon — nnms) 

®cv — ® ® — ® — 

O'xa>qoocvu 
x q ® ® ® ® — s 

cvnnqao®® 

— — CVJ® — S®lT 

no — — o»n®n 
®cv®®®®qp* 

qooo'q® — nin 
®q®cvn®ui — 

a-oqxnco® 
s s cv — ® ® co in 

<■ - -non — x 

n®®®®®qcc 

oqwqcvcvnn 
k in q ft n - ®® 

'Cnnxu — ®® 

— — ® — ®®® — 

u — oou , 0 'cv®q 
®® — ®s — q — 

cq — O' cvj o 4 r 
c qawrsiii- 

qoqo'W — ®cv 
— ® — s—® — o 


KSSSSSS® 
ftnqiT'CMcO' 
Ul h h h U U U! UI 

occecoco 


uc^qi^O'qq't 
® — — — — nn — n 

ucvcv®uja>a>0'a> 

® — — — ® cv cv cv cv 

smmccccoo'Un 
® — — — — cvncvn 

O' O' O' O' O' c ccc 
srnnrftftftft 

q — non-uiuuu 
® cv cv — cv cv cv cv cv 

®q<««»nn-ou 
® s ® s s — — — — 

O'GCdjODCXSS®®® 

®®®®snnnncv 

moooca a cc a s 
ssssscvcvcvcvcv 

qO'O'O'O'Xincvn-s 

— — — — — cvnnncv 

innn — UO'O'O'O'S 
n — — — ® cv cv cv cv cv 

ucooc — — — — s 
®®®®®nnnncv 

®» 0 ' 0 ' 0 'CCOC® 

®nnnncv^icvcvcv 

uiqwqin'CU' uiuhi 
cv®cvwcvcvcvcvcvcv 

O' Ui <X <1 <1 <1 * cc u. ® 
® S S ® ® ®-— cv 

CLiraa.curca'O'O. 
oc — s®s®wnnn 

ssooooaa cccc 

— — sssscvcvcvcv 


®® 5 ®®SS ®®5 

<rccoou)U® — cvn 
Ui U 1 U Ui UJ u u u u u 
cccoocccco 


cv 

V 

n 


I* 

u c 

h- _] 
U T 

it L.’ 

Ol u 
• r r 

U w 


a> 


.2f 

IZ 


c C 
2 :r 
— c 
y. c 

Z X 

c o. 

V X. 

: u 

c a 
c ^ 
: u 

\r 

> t/ 

a c 
c r 


-i c 

: u i- <r yi 
a x <n x i 


'l x 
i. x 
~3 


<J IA> 
X CC 


sssssres 
— o nqir<r»a 
eeesess s 
sssssc ss 


css 
O' s — 

c- 

css 


O' c c CL 

c ccc 


s 

c 

O' 

c 

X 

i 

w 

tn 

<r 


o ccc 

esse nnrsr'CO' 
ccccccccccc 
O'O'O'O'O'O'O'O O'O'O' 
CCCCCCCCCCC 


r> in 

cv — 

cv* a 

n q 


c. 

q 

£' 

U" 


m 

cv 

O' 

q 

® 

O' 

q 

in 

O' 

oc 

q 

s 

x 

x 

q 

m 

n 

m 

q 

® 

cv 

m 

q 

m 

s 

m 

q 


® ® ® 
n in 'O 
— x ® 
n q in 

ip in in it 
q x n — 
* ® x P“ 
n n q q 

s ® in in 
r f ft if 
< O' q 'C 
n cv q q 




m 

® 

s 

in 

® 

r- 

O' 

q 

® ® 

q x 

x s 

q in 

it ® m 

r n cv 

q ® ® 

q in m 

s in in 

cv r- oi 

q o r- 

q q q 

in ® m s m 

q q q n r- 

q in O' — q 

— q q m- q 

s s in m ® 

q r q r- q 

q in x ® q 

— q q in q 

® s s r ® m 

r s x q ® r- 

q v n if c i r 

— q cv q m q 


s m ® inm 

O' q i*- O' cv 

q n q q o> 

q cv q n cv 


® ® s ® s 

® q m q O' 

q q q m O' 

q q — q q 


s m m s 

p* s — q 

m q m r* 

q q — q 


® s s 
cv — r- 
r- q — 
cv n r 


m m mm s ® ir 

O' m r — x cv s 

f~ n o — r- q r 

— q q cv — — q 


8 m m £ m 

cv s cv n 

— m q q q 

cv q q q q 


in m ms ® mm 
I'mso'ftmto 
q x r» ri n q x 
q — n q r r ft 


® m ® m m m 
p* cv — n cv x 
r? n m cv- m m 
q q --q q 


m m m m s m ® 

s-mminr- 

® O' q m n m x 
m q cv q q cv r 


m m. m m ® ® m 
s x q p- — — s 
q x n q r* r- 
—-q n — cvi 


5 if if SS 5 

x ® s q q q 
m—mr^xr 
r r r - ft <j 


ir m m m m s 

cv O' q — x o- 

a q t" ® m cv 

q — — cv — q 


m m m ® m 

f- O' O' — r 

O' m cv q m 

— q q q q 


CCroO-DiiJif 

CCWCCChifl 

rftcu r-0'<rcv 

C'Cif ftOSO 

scoucvm — m 

— c «** u c o o c 

r'ccammof' 
c c e c — s a O' 

rqc^r-cvuc 
c a c r o c q c 

<roucvr-a:o — 
r e a u s c c o 

r* m- o u cv r- m x 

c o e f* ® O' c e 

emu u u o m. cv. 
c-on-ucvocn* 

a h r u it — u c 

— c cvi t- r. c C c 

r'O'Cisatro'U 
cr'O — ccr'D 

s — u. q O' cv — q 

c s a — r- s r 

uac—cvccr - 

— c c u u c c ® 

r ft h a g — cv a. 

cxr-ccvcxc 


n q m <i <r x u 

U S >i) U O 111 h 

s' c « u ® m q 

s a o r* u ui r* 

— 'f. O' >£ <r CL c- 

o u U U U D CV 

<r e* c x- u — u 

COUOf'UMi. 

O' <r q cv q 
usocuicr- 

c •* c r- a c_'m 

e s O' u c c cv 

I'CflCif—ft 

q c p* o a < f* 

iT'iiTO'GCC'- 

cj u O' o e c cv 

a c a a <r m n 

c o p* U' c c r* 

cv o c — r u a 

xsccuou 

c q q c c O' a 

c s u c o r c 

carcs-r 
s c O u s u 

uo'<rcsa<r 
u <r c c cv c c 


® 0 'Cvcjf-qxou' 

quiosmr^cv®® 

sacsccc®® 

®co®ccc®® 


qo'®s®sx®ui- 

nncvqqau<r®x 
uussss cs®e 
cossssc®®o 


q cv if s s if. u 'C 
®r>xu — qu® 
uxxxsoq® 
ccccscc® 


C u ® C X O' (T 

r* u u c — u u 

a c <r c s c. q 

O C C Q S C C 


— q r - u. O' q m q x 

CU— S 1 ^-— — 

CCS C u ® s s s 

cc® cess®® 


q x > 

XX CV H C 

z> O CDH 

sxxjzctniz 

_J-l_lJ_J_l-JiZ 


-1 X 

zucex_Jh-x 

uz?qqqqqq 

CCCCCCCC 


PO X z u o 
x <r _i m x x z 

U I- H D X In o 3 

c xxzi<icxxmtn 
c cccxxxxxx 


U X Z 3 . 

c f- x «n 

CL (1 t— X 

u u u x a 

x a a x x 


> a 

?Xfth I- 

c z x r i 

c — x c m h->h- 

m in in m m m m f— 


> x 

> X 


m r u cv 
u — u s 

x cv a. c 
sees 

q m p- u 
— — r* r: 


C r- <j c 

C S O 

x oi O' a 
cccc 

c ® X X 
O' X C f" 


O' s c 
0" c c 

u 

c q a 
s c 
<r 

u r c 
<r c O' 
o 


X s ® ® ® 

2- u s - x 

r <r cr cr cc 

c c c c e 


s ® s ® s ® 
r- q m 'i r* oc 
x x x a x x 
c c c c c c 


q u ui o a 

U U U X c 

C u <T C O' 

C hcch 

S — S O' C 

S X U C C 


S S S S S 

O' <r ere c 

a x c or a 

c c c c c 


Page 16 


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


Number 27 


302 










X 2 
<1 

c ? 


c 

C 2 1/ 

i CV V 

L 

t- 1 . u 
• - C 

7* i C 

S' tf c 


U 0£ 
£ 

C U. 

2 C 


£ -K 

£ C 

c c 
c c 


x l 
U 

X c 


2 b 

c z 
o a 


a c 
2 
b <J 
N £ 

— k 
-) C 

c a 

h- £ 

-~ c 
2 X 

— u. 


2 

C ~ 

»- c 


—■ a. in 


£ C b. 

C 

X u. u. 

u. — — 


i. H- 
C ~ 
X W 


2 — C 
i u 


t* 

C b 


C - i 


2 

H C 


__ x X X l 
0 2 2 2 : 


— — C\ 
X »- K 
I- X X 


HHCCV){/)C/)(TU.UXI- 
WWIIIIHIIDCQOXIl 
- (— * H * t- • H * »-• CtC 


C 2 
H C 

or 

m u. 

u 

2 <r 
— u 

l- i r 
Z IS 

c u 
a or 
a. c 
r o 
in <r 


«> ?L r 11 

roc- u-zcrai c 

i 

f— 

e. x u; C- c o x 

ji—cx— £ x x _j r c 


XI - C I 


—J a. •- a X •- i A i J x q •— — — — •— •— >- COCO <T -* 

rcxczxNcooxoca.isja.Njr£a 2 - f c a. a. c c c <r * c 
jxjjH(jTi/!oxi/!X_'i;2ctt:v:L‘ji/'‘:<:c‘)COCc " - 


a. 


s c e 5 f 

a o g — cv 

I' r- i CC i 

s s s s 6 


SCGS&GSS&SS&GSSGSG&SSSGS&GGGSS 
<jiT'cr-xo'® — cvio'cin'Ci'-xo'S—&io'Cir'CP“XO'S> — evo: 
xaxaaxO'O'OO'O'O'O'O'O'O'GSSGSSSKSC — — — — . 
sgsssscs.kssssssc: — —---—-— 


css ggsggssg sc 

ir'Cr-aos—cvio'cif'xo 
-«-cv cv. c\j cv cv cv cv c\ 


ggcssssss 
o-s — a r ^ it < p* 
Cirrrrrrrr 


<T 

C 


<r s c 

os c 


<1 

c 


c c <r a 

c c c o 


<J O' — O' 
IT C <3 C 


03 O' n O' 

IT c m C 


'£0X0' 

<3 c in o 


s c g g a <r a — a c g a 

o s cv. rose—evs—cv. 


o 

0 


c it o r r o- O' 
e c --c u 


rrct'CKO'^c^ 

irc*o*G«*c* 


u x u s 

C m lx K 


<r a: — <i r uj <r 
CV U CV — — lx C 


aacva<iixccux'£<ju<r* 

— liCVU — U-C**C_'CU u. ix c 


C'tucvo'O'O'O^uro 

ucixbcvcvcvcv a * — e 


■<3 O <1 < 
ir in in ir 

<1 <3 <1 C 

CCCC 


<i a cess 

if 1/ if if >f *c 

c <3 <r c c « 

c c c c c o 


<i <t <r <i <r < 
c c c c c c 


r- o clou¬ 
's < vc 'C * 

<i <r <r c <r <x 
c c c c c c 


03 if r* O c C <3 

i*“ r- r- r- t- r~ 

<s <r c <r <i «i <j 

c c c c c c c 


<iccu—cvninxao'«3 
ot'-r>r-xxxxccKxx 
«<r<r<r<i<r<r<r<x<i <r<i 
ccocccccoccc 


Cixix — cv'Oirr^cc 
XXX O'OO'OO'O'O' 
<3<i<x<i<i<r<r<rc<i 
CCCCCCCCCC 


ix — <j'cxaecu u.G—o 

0'c<i<r<i«j<3c<rcacia 

<rc<x<r<i<3<r<r<r<c<:<r 

CCCCCC.CCC-CCC 


If If If If If 

x a a. a a 

< <i c <1 c 

C O C c c 


<- _J 2 • ; 

c c - c : 

x — 

= X X I . 

u c <r u ■> 

O Ijl V — — ■ 

- 1 f- 2 S S 

r x r — o <- 1 

ocx j r 
2 </» 


nee 
b c J 


£ 2 


x - : a c ? r <r 


lx> 

U 

c 


£ C 
X X 
<T 

C lx 


>• c 

I u C J I If 

z cl - u. e m 

s c a c u u 


u r — <j in u i 


ii-TX-a *- c 2 <r c 
ot-ac Z2XXC 
aaxacxc xx 
> c a h > c 
c ucc c_r c — -x 
c*-a»-bc<r+ -* 


= C k X 

a c x 

C' r -- a 

- C b 

c t- 2 x r a 


0 . b 

r- C 

X 

0 12” 


- > - is, b - _ C 

Xts<CX2l_'X<32 
c ■: I i: -3 <IJ c “ 


X — J X — _ 
C‘ 5 <3 2 x <1 
C 2 C' “ J C 


1 X — . 


x a rv 

2 k 2 

— C 


C X > <x 
c 2 C c C 


C b. h- G* 2— — k 

j J c b a r- .jt ix u c 

if u. i i: ix 1 x ? r i- b _ i b -> 

COOC>^-CU C US c b 

hi-Hi-i*if'ni**ca*# *2 

SGSC. SSSSCCC 5 GGGGSS 3 

cv r ■q m 'i a ocgsgs — Ci o <i / >i 

-—-- CV 5 GGGCVO cv CV cv O 

GC GS^GG^CTGGGGGd SSSS 


GSSGCir. T GSG. GGC5 GGGG 
CCO'G — OG'Cif'Cr-XO'G — 0G<3 
cvcvGrrroroGor'^’qc'g'q 

SGSGGGT GGGGG GGGGS 


SG- GSGSGGSG. SSSCGGC 
XO'G — 0jO<3iT'£O'X0'S — O O n' 
VlClflflflflflflflflflf'f'l'f't-f 
G. E SCSSGGKSG- SCS SG G i 


C G C G G S S 
ais-cvr-Jif 

'Co-o-f^r^o-i** 
G G T G G GG 


CL (J CL X G ^ G 

c c c c c c c 


c O' O' c o O' 

c c c c c c 


<T < COO 

c c c c c 


O' coo 

c c c c 


oo cccc c c 

oc cccc c c 


lx x cv u o c 

<3 — O' x — — e 


if' ii a 

bob 


b X b C 03 lx b 

abb G O* (" — 


— G 

c_ c 


a c 

CV if 


a 


00:00 o o o. 

C C C C_ C_ c_ <0 


C < CL — CC r-uc^UCV 
CSC CV C_ C b C b C. 


c a a < c r 

c c cv cv c c o. 


c cv 
c c 


<CO — cv C— C 0 r~CCCV< 30 C.CV 
see cvcvcv — — — aeae — — a c 


e b. cv m a x a 

c c b e u u b 

O' O' O 0 0-00 

c c c c c c c 


a b--- 

bbblxblxbb. 

O O O' O' O' o oo 
cccccccc 


---^ r- o 

U U b b b b b. 

O O O (X- O O' 0 

c C O C C C c 


c c b. cv u- ȣ x a 

bb.bGG SSS 
OOOCCCCO 
CCCCCCCC 


eb.- ■vjr'-ca 

GG--- 

C<T<3C<1<X<IC 

ccccccc c 


eu — cv if a a a a 
— — cv cv cv o tx a cv 
ccccccccc 
ccccccccc 


c s o o 'C o e 
cv r r o o o o 
ccccccc 
ccccccc 


b-G — CViT^Oca 
occccccc^: 
ccccccccc 
ccccccccc 


C b X G — CV O 

'j'iNirififir 

c c c c c c c 
ccccccc 


Number 27 


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


Page 17 

303 










Lt iVt IWL Sfc)cJ/. 7 Sl i«v t\u» m>‘j I U*. VdvU 

l Obtf'S I ddllU JlilWV i llllli.llj U duel wo7 l lU bbVU 

AUOJd u*j< du biijduuv- M l.ri MivitJa I Ivj ob? 1 vij wZ. uj ^avu 





rccuao'^cccru'Cvr 
O S C — u c -- C C 5 u c x 

xrccvcaccer— dCO'O 
C O C C (_' lx C C C IT CV - C CV C 

a c i» ii ii c - ar-^aaacra 
• ! 3CflCf^irc.''fi/'CCU l* < $J lx.’ 

r~ O' — u'tu. — cvro'ccca>r 
C-CVU.Gr — C — CCCU.CV.U 

i r a- r~ a <flcr. 

:cc<iMcii-ccceM 


c N ' j. i— z r: r 

& s L ■ U *? l/> ^ '/I / c 6 

C 2 X ■* Li CU.CC ti S 

vl 

S 

U. J J 

•* u. x c- « 

r ? h c a 

1 X z a. i- a- 

* r # c c w 7 s 


e 

<5 



rcrcc'-cr-yssr s c 5 ® 

— 0 '-«<r J*‘0cc-y— or — >£ — r 

cv s <g 

----— — c — 5: c 



r sryisyryrr? 

n <;r<rrM.ai — r r- 
ICCEE 5 C:t;-Sf' 


gorges sires 

— <31^ — *. a cv x cv 

■qC'cr'oa ® ^ r 

— csss—-cs 


SEES s s s s s s s 
9 "£a^'iai'sa<i& 
cv a it cv a ^ ci. s » ff 1 a 
cgsssss — see 


— CO <J a o tx r'r'r-ccvucc 
ecu c a c 1 — - if c o u. ; b 

rucc r '0'U<i<ja&/ECi oa — 
c — cr»eucv~c*succve 

<x r u <r — cvi <x <3 — O' o a a cv c 
ccf^cucccucc — cv u c 

iitt'tcci^c<ir<ii<r< 5 fl 
lx. C <S S CCCU“C'CUCU — r- 

c - 1 cv o> e o-cvicvcvc — cc—sue 

o oc q u c u: Ci c c * it x r u c 

orirr-cvoaesaa < * c it 
c c u <*“ u e c c <1 ir c c c w 

u a c o c <r — dOO'O-set'Oe 

c c c c c c c c c c c cv c c c 

r (^cu.<xs — ccr^ruuscO' 
CC'CU.CCCVCV * C C U CV C » 


uuu—uuriu 
u - c a 'f 1^ — o r 

sc<T<rs<i<r<i 
SCCCSCCC 

<J c 1 o- 
a 0 u e 

L ii _ fir 2 

2 CCUUUUUGG CVS U U a c c c 

acraaccracrcccu a. rrrc—iXic 

<!<r<i<r<'<i<r<Tc<'c<r crcrai-iici? 

C.OZCCC.CCC.CCC OCCCCUUU 


— u so — <ro roiru<iaii'£sE»'Ciiru.c'i | r 
a u 'CiiLiTirrca ur-uuECU.cu u c c c c 

<Oa<30'<I<TG.<CO'GO'0'<S4GO'0'0'0'00-0' 

cccccccccccccccccccccccc 


0 . 0 . 0 . SL T' > X Ci U 

—' —J -Jc— cv>x20l?o.i- ore _i 

ex x 3 h 1- it o c. ^ c ? r i-<ii/!ifl:ita. <n- 
■? c C uuxxff«j(/ue-cxxh-occccxt^ 
UCCX?2 , 2c 10.ttiri/!(/;l/lt/;l/l|-hl-l-f-hl- 


a. c c u c a. — c 

<J 

c — c — a> — r — 

u c r c — CV u 

s 

erasotco-r 
O' c — c u c c c 


XSSSSCSS 
xcuus — cv. r 

_0'0'O'C<JCC 

cccccccc 


cc^i'iru.ar' 
C - IT <J - It CV c 

rer^<raccr 
a * ir c — c x — 

rro O' 5 c — u. 

-u c s c — * 


ggessggs 
^ ir \c t^coaco 
o<j<r<i<ic<r<j 
cccccccc 


Page 18 

304 


Or. Dobb's Journal of Computer Calisthenics 8c Orthodontia, Box E, Menlo Park, CA 94025 


Number 27 









BY MIKE GABRIELSON 

Box 2692 

Stanford, Calif. 94305 


Memory Organization 

The 8086 can address one million bytes of memory, using 
a set of “segment” registers. Every byte has an address. Loca¬ 
tions FFFFO! 6 through FFFFF 16 are reserved for the initial 
program load routine (the CPU jumps to location FFFF0 j 6 
on reset). Locations 0 through 3 FFi 6 are reserved for inter¬ 
rupt pointers (described later). Addresses are 16 bits and 
stored byte-reversed in the 8080 fashion, but a 20 bit address 
can be constructed before a memory access by offsetting a 
16-bit effective address four bits to the right of a segment 
address contained in one of four segment registers, filling in 
the four low order bits of the segment address with zeros 
and adding the two. The segment registers define the 
base address of four segments (a “code” or instruction 
segment, a stack segment, a data segment, and an extra data 
segment) of 64K bytes each, with each segment falling on 
16-bit boundaries. The segment registers are named: 

CS code 
SS stack 
DS data 
ES extra data 

and each is 16 bits in length. As described above, they are 
extended with four low order zero bits to form a 20 bit seg¬ 
ment base address. The entire megabyte of memory can be 
divided into these four segments and is dynamically allocat- 
able by changing the contents of the segment registers. In 
addition, an entire memory block up to 64 bytes, can be 
moved from one group of memory locations into a complete¬ 
ly different group. Word (16 bit) operands can reside at even 
or odd addresses. Referencing word data (but not instruction 
fetches) at odd addresses does require an extra memory 
cycle, so it is worth it to locate word data (especially the 
stack) on even address boundaries. 


In addition to the segment registers, the 8086 includes all the 
8080 registers (but with different names), plus a few new 
additions. The four 16-bit general registers have high and 
low order bytes which are independently addressable. Thus, 
the 16-bit accumulator, AX, contains the bytes AH and AL. 
The other 16-bit registers include four pointer and index 
registers as well as the instruction pointer (program counter) 
and flag register. A breakdown and comparison to 8080 
register structure looks like this: 

8086 8080 

Name Name Meanin g 

General Registers 
AX — 16 bit accumulator 

AH — high order byte of AX 

AL A low order byte of AX 
BX HL 16 bit base register 
BH H 8 bit register, high order byte of BX 

BL L 8 bit register, low order byte of BX 

CX BC 16 bit count register 
CH B 8 bit register, high order byte of CX 

CL C 8 bit register, low order byte of CX 

DX DE 16 bit data register 
DH D 8 bit register, high order byte of DX 

DL E 8 bit register, low order byte of DX 

Pointers and Index Registers 
SP SP 16 bit stack pointer 
BP — 16 bit base pointer 

SI — 16 bit source index register 

DI — 16 bit destination index register 

Instruction Pointer and Flags 

IP PC 16 bit instruction pointer (program counter) 

flags — 16 bit status register 


Number 27 


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


Page 19 


305 


Intel has been slowly leaking information on its new 16 
bit microprocessor, the 8086. Except for the concluding 
paragraph, the following is intended to be an objective report 
describing the various features of this new device. I have pur¬ 
posely skipped most of the hardware details (such as pinouts 
and interfacing), since that is not my area of expertise. Of 
course, all specifications are subject to change by Intel, and 
no endorsement of this article by them is implied. Other Registers 



The 8086 status register contains all the 8080 flags plus four 
new flag bits: 

DF direction flag (for string operations) 

IF interrupt enable flag 

OF overflow flag 

TF trap (single step) flag 

When TF is set, an interrupt is generated after the execution 
of the next instruction. This allows efficient implementation 
of software to allow single stepping, such as in a debugger. 

Addressing Modes 

8086 instructions can be from one to five bytes long, with a 
large number of addressing modes, but the basic two-byte, 
two-operand instruction allows byte or word operations from 
register to register, register to memory, or memory to register, 
and is formatted as follows: 


Field 



Name 

# Bits 

Effect 

opc 

6 

opcode, selects instruction 

d 

1 

defines direction: operand 1 “to” or “from” 
operand 2 

w 

1 

selects operand width: word or byte 

mod 

2 

sets addressing mode (whether r/m is a reg) 

reg 

3 

selects an 8 or 16 bit register with w 

r/m 

3 

same as reg for one mode, else selects which 
registers compute the effective operand address 


The various combinations allow a memory operand to be 
addressed in the following ways: 

• as an 8 or 16 bit immediate operand 

• relative to a segment register (CS, SS, DS, ES) using a 
16 bit offset 

• with an index register (BX, SI, or DI) 

• relative to a base or index register (BX, BP, SI, or DI) 
using an 8 or 16 bit offset 

• with a base register (BX or BP) plus an index register 
(SI or DI) 

• relative to a base register (BX or BP) plus an index 
register (SI or DI) using an 8 or 16 bit offset 


Instruction Set 

For every 8080 instruction, there is a corresponding 8086 
instruction (or, in some cases, a short sequence of instructions) 
to perform the same function. Nearly all instructions can 
operate on either 8 or 16 bit quantities in either registers or 
memory (push and pop are notable exceptions). And of 
course, several additions and extensions have been made . . . 

• An XLAT (translate) instruction searches a table to find 
the corresponding value of an incoming variable. Once 
found, this corresponding value is substituted for the 
original value. Therefore, using the iteration control and 
string primitives with the translate instruction, a task such 
as translating a string of EBCDIC characters into ASCII 
characters can easily be performed using only seven 
instruction bytes. 

• An LEA (load effective address) instruction automatically 
computes the effective address of a memory operand. 


• There are single instructions to add, subtract, multiply, or 
divide signed or unsigned 8 or 16 bit operands in binary, 
BCD, or ASCII, carried out in two’s complement form. 
This allows easy implementation of multiple precision 
algorithms. 

• The CBW and CWD instructions convert (sign extend) 
bytes to words and words to double words. 

•Variable length shifts and rotates (using a count in CL) are 
implemented. 

• A set of one byte instructions use SI and DI as pointers to 
a pair of byte or word strings (the pointers are optionally 
automatically incremented or decremented after each 
operation). These are the “string primitives” and during 
their execution, the SI and DI pointers as well as the CX 
count register are updated after each operation: 

Move move source string to destination string 
Compare compare strings 
Search search destination string 
Load load from source string 

Store store (fill) destination string 

• A REP (repeat) instruction automatically repeats a follow¬ 
ing string instruction (move, compare, etc.) for a specified 
count in CS, or while or until the Z bit is set or reset. 

•CALL, JMP, and RET instructions can transfer within the 
current segment or to another segment. Calls and jumps 
use relative addresses to allow position independent 
(relocatable) code. Conditional transfers must be within 
±128 bytes of the instruction. A return can automatically 
pop a number of parameters off the stack. 

•Various LOOP instructions perform a decrement of CX 
and jump ±128 bytes depending on the result (and option¬ 
ally testing the Z flag as set by instructions in the loop). 

•Software interrupt instructions provide efficient break¬ 
point and overflow handling. 

• A WAIT for external interrupt instruction is automatically 
re-executed at the end of interrupt handling to allow syn¬ 
chronization with external devices. 

• An ESC (escape) instruction places memory operands on 
the bus so that other processors can receive instruction 
streams and use 8086 addressing modes. 

•A LOCK instruction can precede any other instruction so 
that while the instruction executes, other processors in a 
multiple processor configuration are locked out and 
cannot interfere. This allows easy implementations of test- 
and-set or semaphore operations in software. 

Speed 

Both five megaFlertz and eight megaHertz clocks are supported. 
At 5 MHz, one clock cycle is 200 nanoseconds; at 8 MHz, it is 
125 nanoseconds. The fastest instructions, such as register to 
register moves, take two cycles. The slowest instructions, such 
as a signed 16 bit divide, take over 150 cycles. 

Instruction execution is overlapped with the fetch of the 
next instruction. In the 8086 up to six instruction bytes can 
be accessed and queued prior to actual execution. The queue 
forms the pipeline of instructions and time is saved because 
the instructions are accessed while the instruction execution 
portion of the microprocessor is busy, thus resulting in signifi¬ 
cantly improved operating efficiency in the microprocessor. 
“Dead time” on the memory bus is greatly reduced, thus 


Page 20 Dr. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, CA 94025 Number 27 


306 



allowing moderate speed, less expensive memories to be used 
while still achieving high CPU performance. Intel consistently 
claims ten times the “performance” of the 8080. 

Interrupts 

The reserved memory locations 0 through 3FF 16 are divided 
into 256! 0 4 byte interrupt pointers, where each pointer cor¬ 
responds to an interrupt “type”. Every interrupt supplies an 8 
bit type number, which is used to select the appropriate 4 byte 
pointer. The pointer is interpreted as a 16 bit segment address 
and a 16 bit offset in the segment, and control is transferred to 
that address. The first 32 interrupt pointers are dedicated: 
type 0: divide error 

1: single step 

2: non-maskable interrupt 

3: breakpoint 
4: overflow 

5-31: reserved 

The 8086 also provides software maskable interrupts. The 
total overhead at each interrupt (for pushing flags, disabling 
interrupts, transferring control, returning from the interrupt, 
and so on), is 88 cycles. 

Another feature afforded by the architectural enchance¬ 
ments of the microprocessor addressing capability is improved 
input/output addressing. The improvement permits a maxi¬ 
mum of 65K bytes of I/O port space. The ports may be either 


8-bit or 16-bit ports and the 16-bit ports may be located at 
either odd or even addresses. Moreover, indirect I/O addressing 
is now possible with the 8086, a feature not available on the 
8080 or 8085. 

Conclusion 

The 8086 is a sophisticated device with a very large instruction 
set. At one time, the various types of CPUs (micros, minis, 
midis, and maxis) could be differentiated by speed and 
addressing capabilities, but the trend is to minimize those dif¬ 
ferences. The 8086 may be “micro” in size or price, but 
certainly not in performance. 


For $360, Intel is marketing the SDK-86 System Design 
Kit, a complete single board system including CPU, 8K 
ROM, 2K RAM, and I/O. The board also contains an inter¬ 
active LED display and keyboard. The system monitor is 
contained in ROM and there is a wire-wrap area for custom 
interfacing. All bus and parallel I/O signals are TTL com¬ 
patible and serial I/O is 20/rA current loop TTY or RS232. 
The system comes with a comprehensive design library. 


TINY-C’ INTERPRETER FOR 8080 AND PDP-11 

News Release Received: 78 June 22 

An interpreter for a subset of the C structured program¬ 
ming language which runs on both DEC PDP-11 and Intel 
8080 processors is available from Tiny-c Associates. The tiny-c 
Owner’s Manual includes a complete reference description of 
the language, a tutorial walkthrough of a training program, lots 
of sample programs including comments on their programming 
style, and a description of the Program Preparation System. It 
also includes commented source code listings of both the 8080 
and the PDP-11 interpreters, and a chapter on how the inter¬ 
preter works. 

Tiny-c is intended primarily for the education and hobbyist 
markets. The tiny-c language handles integer and character 
data, and arrays of either type. Other features include com¬ 
pound statements, if-else and while statements, global and 
local variables, pointer variables, and functions. Functions may 
have arguments and may return results. Recursion is allowed. 
The interpreter also recognizes calls to functions written in 
machine language. These, too, may have arguments and return 
results. A minimum of 16K bytes of memory is recommended 
to run tiny-c. 

The package includes a Program Preparation System with 
which the user can write, edit, run, debug, store, recall, and 
link tiny-c programs. The PPS includes a standard library of 
tiny-c software tools. The PPS is written in tiny-c. Thus it 
serves as an example of a significant use of tiny-c, and is also 
easily adapted to a user’s or operating system’s requirements. 

The Owner’s Manual is available for $40 from Tiny-c Asso¬ 
ciates, P.O. Box 269, Holmdel, New Jersey 07733. Machine 
readable copies of the interpreter are available separately on 
several formats of tape and disk. 


ERROR MESSAGE MANUAL 
FOR NORTH STAR DOS 

News Release Received: 78 June 15 

The NORTH STAR DISK SYSTEM ERROR MESSAGE 
SUMMARY is for users of the North Star Computers floppy 
disk system. This manual is a compilation of all DOS and 
BASIC error messages given by the North Star system. The 
manual gives the meanings of these messages in easily under¬ 
stood terms. Numerous examples extracted from programs 
serve to illustrate what program errors cause these messages 
so they can be avoided. The manual serves as a reference 
source in debugging programs when occurrence of these 
messages appears. Also illustrated are error messages resulting 
from improper DOS input commands as well as BASIC com¬ 
mands. It is available from HSC COMPUTER SERVICES, 
LTD., P.O. Box 43, Brooklyn, NY 11236, by sending check or 
money order in amount of $5.00 plus 50 cents shipping and 
handling, available from stock. 

MKB-2 KEYBOARD 

News Release Received: 78 June 26 

The MKB-2 Keyboard by MicroAge, is designed for use 
with the new 64 and 80 character display video boards. 

Included as standard in the MKB-2 are a numeric key pad, 
upper and lower case, cursor control keys, 2-key rollover, 
and auto repeat on all keys. The MKB-2 is assembled in a 
heavy duty steel case with parallel interface, strobe or pulse, 
on-board regulation (5v, 12v), complete with standard DB25S 
connector, and black double-injection molded keys. List: 
$149.00 Contact MicroAge, 1425 W 12th Place #101, Tempe, 
AZ 85281;(602) 967-1421. 


Number 27 


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


Page 21 

307 






A IK UTILITIES PACKAGE 
FOR THE Z-80 


BY LES HANCOCK 

305 Lexington Ave. 7-C 
New York, NY 10016 

This is a companion piece to the IK Debugger, written to 
run on a Digital Group Z-80 system with ZE audio ROM, 
TVC-64 interface and TVC-64 monitor (see DDJ no. 24, 
p. 12). Starting the program causes it to clear the TV screen 
and print this menu: 

TVC-64 UTILITIES 

0 MONITOR 

1 SEARCH 

2 COMPARE 

3 MOVE 

4 HEX MODE 


You can pick any item on the menu by keying in a number 
from 0 through 4. (Anything else is ignored.) 0 returns control 
to the monitor and 4 sets hex mode for routines 1,2 or 3. (De¬ 
fault mode is octal.) 

As soon as one of the three utilities is chosen, the screen is 
erased and a new banner appears. You’ll be prompted for the 
appropriate addresses and data entries. Carriage returns are not 
used to signal the end of an entry, except in the case of the 
target string for item 1. When a utility has all the parameters 
it needs, it runs to completion, then waits for you to press a 
key. The space bar restarts the utility; any other key sends you 
back to the menu, reinitializing the program and resetting oc¬ 
tal mode. There’s no way to recover from typing errors. You’ll 
have to use the RESET switch to abort, then start over. 

Item 1 is a string search utility. It searches any range of 
memory for a string up to 9 bytes in length. Bytes are speci¬ 
fied in octal/hex notation or in ASCII, and any byte in the 
string (except the first, of course) can be left “wild”—in other 
words, you can search for discontinuous strings. 

This last feature is really handy. Suppose you’re looking for 
jumps to page zero. There are 256 possible 3-byte strings to 
hunt for: C3 00 00, C3 01 00,... C3 FF 00. You can find all 
of them in one go by specifying the target string as C3 // 00, 
where // is a wild byte. 

The syntax of item 1 is as follows: 

SEARCH A-B FOR STRING 
A?aa 
B?bb 
STRING? 

where aa and bb are two 16-bit addresses entered by the user. 
As for the target string itself, you can define it in either of two 
entry modes: 

1. Octal or hex notation. Simply type in a string of bytes in 
octal or hex. Don’t try to separate them; the program prints 
a blank after each byte entered. To specify a wild byte, press 


the slash key (/). The slash will be echoed twice or three 
times, depending on whether you’re using hex or octal. To ter¬ 
minate the string enter a carriage return. If your string is 9 
bytes long no c/r is necessary; the program will take off as 
soon as the last number is typed. 

2. Text strings. There is provision for entering text directly in 
ASCII, but it’s necessary to distinguish between the two 
ASCIIs supported by the Digital Group. One is the code we all 
know, with the high bit off. The letter A is hex 41, the numer¬ 
al 1 is hex 31. The other ASCII, with bit 7 set for use as a 
strobe, codes the letter A as hex Cl, the numeral 1 as hex Bl. 
Where you want to search for text with the high bit on, enter 
a single quotation mark (’), then type in the characters. For 
straight ASCII, enter a double quotation mark (”), then the 
text. No wild bytes permitted in either case. 

The address of the first byte of each occurrence of the 
string will be displayed at the console. If there are enough ad¬ 
dresses to fill the screen, output ends and the program waits 
for a keypress. Then it erases the screen and goes ahead. 

Some examples: 

SEARCH A-B FOR STRING 
A7 000000 
B7006000 

STRING7315 372 000 (c/r) 

000350 001237 002016 002073 002101 003232 003324 004176 
004262 004277 004316 004361 


SEARCH A-B FOR STRING 
A? 000000 
B7000377 

STRING?315 _/// 000 (c/r) 

000114 000130 000133 000153 000156 000162 000170 000214 
000223 000226 000350 000357 


SEARCH A-B FOR STRING 

A? 05^ 00 - hex mode 

B? 05 FF 

STRING? 'Assembler < 9 bytes, no c/t needed 

05 9A 


SEARCH A-B FOR STRING 
A7000000 
B7 010000 

STRING? "Assemble (c/r) 
NONE 


Item 2 is a routine that compares corresponding bytes in 
two ranges of memory. It reports out every mismatch, giving 
addresses, the bytes themselves in octal or hex, and the ASCII 


Page 22 

308 


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


Number 27 



equivalent of each byte. (Note: the Digital Group’s TVC-64 
board uses an MCM6571L character generator with special 
symbols and Greek letters below the blank.) Output is slanted 
across the screen for better legibility. As with item 1, you can 
clear a filled screen by touching anything on the keyboard. 

An example: 

COMPARE A - B TO C - D 
A?010033 
B7 010045 
C7005255 

(erases screen) 

010033=311='I 005255=343'c 
010034=311='I 005256=357=’o 
010035=311=' I 005257=360='p 
010036=301='A 005260=371='y 

010037=377= 005261=000="*< 

010040=310='H 005262=000="*< 

010041=310='H 005263=000="°^ 
010042=310='H 005264=000=" 

010043=300=' @ 005265=000="K 

010044=276=’> 005266=000="*4 

010045=301='A 005267=000="*< 

Item 3 copies a block of bytes from one range of memory 
to another. You supply the starting and ending addresses that 
define the source block, then the starting address for the new 
block. The utility transfers the data and prints the new ending 
address. 

MOVE A - B TO C - D 
A7 000000 
B7001000 
C? 100000 

D? 101000 - this line printed by the 

program itself after 
the move is completed 


Footnotes To The Code 

1. Line 180: The TVC-64 monitor contains a routine, here 
called TVE, for printing a string of high-bit ASCII charac¬ 
ters at the TV console. Before calling it the user sets HL to 
point to the first byte in the string. A rubout in the string 
(hex FF) will erase the screen; a value n from 1 through 
hex 7F will print n spaces; an empty byte (0) ends the 
string. 

2. Line 200: The monitor subroutine NUMIN gets a byte from 
the keyborad, entered by the user in octal or hex notation. 
(See note #3.) But what if we already have the first of the 
two hex or three octal digits that represent a byte? In that 
case a call to FINISH will dive into the middle of NUMIN 
and come back with the rest of the byte. 

3. Lines 310, 5910: By Digital Group convention, the byte at 
hex address 01A7 is a mode code. If it’s ASCII ‘H’, the 
current mode is hex; if not, octal. 

4. Line 1570: SEARCH keeps its not-found flag and its 
paging counter in alternate registers E and B respectively. 
The counter is initialized to 96 because the first page of ad¬ 
dresses is printed below the routine’s headers and parame¬ 
ters. If the first page overflows, the counter is reset to 127 
for subsequent pages. (Space is left for a slash to indicate 
that there’s more to come; hence the odd number.) 


The Code Listing 


67E9 




0100 

• • • 

• • 



87E9 




0110 

• IK UTILITIES* BT L6S 

M4NC0CK • 

67E9 




0120 

• 


• 

• 

6769 




01)0 

• VERSION 

OF M4Y 12* 

1971 • 

6769 




0140 

• • • 

• • 



6769 




0159 

• 




799# 




9160 


ORO 

7000H 


7999 




01 70 

• 




7999 




0100 

TVE 

E0U 

0200H 

SEE NOTE #1 

7999 




0190 

MONTH 

E0U 

0500H 

NON 1 TOR ENTRY 4D0R 

7999 




0200 

FINISH 

E0U 

0449H 

SEE NOTE 02 

7999 




0210 

KETB0 

E0U 

0 14 8W 

6ETS 1 8TTE FROM KET80 

7999 




0220 

E84SE 

E0U 

00E6H 

ER4SES TV SCREEN 

7900 




0230 

NUMIN 

E0U 

9446H 

GETS HEX OR OCT BYTE 

7000 




0240 

• 



FROM KEYBO 

7000 




0250 

NUM0UT 

EOU 

02 46H 

PRINTS BYTE 4S HEX OR 

7900 




0260 

• 




7000 




0270 

• INITI4LI24TI0N 


7900 




0280 

• 




7000 

31 

00 

70 

0290 

START 

L0 

SP.START 

SET ST4CK POINTER 

7903 

36 

CF 


0300 


LD 

A * • 0 * 

SET MODE TO 0CT4L 

700b 

32 

4 7 

01 

9310 


L0 

(0147H)»A 

SEE NOTE 03 

7906 

21 

78* 73 

0320 

ST4RT2 

L0 

ML »UT1L 

CLEAR SCREEN AND PRINT 

700b 

CO 

00 

02 

0330 


C4LL 

TVE 

MENU OF ROUTINES 

7906 

36 

81 


0340 


L0 

A * ’ 1 ' 


70 10 

CD 

47 

70 

0 3 50 


C4LL 

NUNS 


7913 

21 

36 

73 

0360 


L0 

HL*SRCH 


7916 

CO 

00 

02 

0370 


C4LL 

TVE 


7019 

06 

36 


0380 


L0 

8*620 


70 IB 

CO 

91 

70 

0390 


C4LL 

LINE 


70 IE 

36 

62 


0400 


L0 

4* '2* 


7020 

CO 

47 

70 

0410 


C4LL 

NUNS 


7023 

21 

30 

73 

0420 


LO 

HL»CMPR 


7926 

CO 

00 

02 

0430 


C4U 

TVE 


7029 

16 

30 


0440 


L0 

8*610 


702B 

CO 

01 

70 

0450 


C4LL 

LINE 


7026 

36 

83 


0460 


L0 

4* '3' 


7030 

CO 

47 

70 

0470 


C4LL 

NUNS 


7033 

21 

45 

73 

0460 


L0 

ML»MV 


7036 

CD 

00 

02 

0490 


C4LL 

TVE 


7039 

06 

40 


0500 


LO 

8*640 


7030 

CO 

81 

70 

0519 


C4LL 

LINE 


703E 

36 

84 


0520 


LO 

4* *4 • 


7040 

CO 

47 

70 

0530 


C4LL 

NUNS 


7043 

21 

44 

73 

0540 


LO 

ML *MX 


7046 

CD 

00 

02 

0550 


C4LL 

TVE 


7049 




0660 

• 





7i«9 «57» • SELECT SOUTINE 

7049 9580 • TO BE USED 


7049 




0590 

• 





7049 

CO 

48 

01 

0600 

INPUT# 

CALL 

KEYBO 

OET A BYTE 

704C 

FE 

60 


9610 



CP 

080 M 

IF NOT AN ASCI 1 

704E 

38 

F 9 


0620 



JR 

C•1NPUT0 

NUMBER 0<«N<S* 

70 50 

FE 

65 


0630 



CP 

0B5H 

6ET ANOTHER 

7062 

30 

F 5 


0640 



JR 

NC * INPUT# 


70 54 

E6 

0F 


0650 



ANO 

0FH 

CONVERT TO BINARY VALUE 

7056 

07 



0660 



RLCA 


TINES 2 

70 57 

6F 



0670 



LO 

L*A 

6ET RESULT INTO HL 

70 58 

26 

00 


0660 



LD 

H*0 


7054 

11 

65 

70 

0690 



LO 

OE • TABLE 


7MD 

19 



0700 



ADO 

HL»DE 

ADO TABLE START ROOM 

70 5E 

22 

62 

70 

0710 



LD 

( INNE0)»ML 

STORE AT INNEO 

7061 




0720 



D8 

2AH 

INSTRUCTION! LOAO 

24 










7062 




0730 

• 




HL EXTENOEO 

7062 




0 740 

IHNEO 

ON 

TABLE 

OPERANO FOR INSTRUCTION 

65 

70 









7064 

£9 



0750 



JP 

(HL) 

JUMP TO SELECTED ROUTINE 

7066 




076# 

• 





7066 




0770 

• 

TABLE OF 

ENTRY POINTS 

7065 




0780 

• 

FOR 

UTILITY ROUTINES 


7065 




0790 

• 





7065 




0000 

TABLE 

ON 

MONTR 


00 

05 









7067 




0010 



ON 

SEARCH 


B4 

70 









7069 




0820 



ON 

CONPAR 


56 

72 









7068 




0830 



ON 

MOVE 


FO 

71 









7060 




0840 



ON 

HEXNOO 


26 

73 









70 6F 




0850 






70 6F 




0869 


SUBRS AT 

THE F0LL0NIN6 

70 6F 




08 70 


LABELS! • 

SPACE* PRINTS 

70 6F 




0880 


1 BLANK ON TV SCREENS 


70 6F 




0890 


■QUEST* PRINTS CHARACTER 

70 6F 




0900 


IN ACCUMULATOR* THEN 

•?■» 

706F 




0910 


■TV" 

PRINTS CHARACTER 

IN 

70 6F 




0920 


ACCUMULATOR 


70 6F 




0930 






706 F 

F5 



0940 

SPACE 

PUSH 

AF 


7070 

3E 

40 


0950 



LO 

A *0A0H 


70 72 

18 

06 


0960 



JR 

SPC 


70 74 

CO 

79 

70 

0970 

OUEST 

CALL 

TV 


7077 

3E 

BF 


0980 

QUEST 1 

LO 

A.*?* 


7079 

F5 



0990 

TV 

PUSH 

AF 


70 74 

03 

00 


1000 

SPC 

OUT 

0 


70 7C 

AF 



1010 



X OR 

A 


70 70 

03 

00 


1020 



OUT 

0 


707F 

FI 



1030 



POP 

AF 


7060 

C9 



1040 



RET 



706 1 




1050 

• 






Number 27 


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


Page 23 

309 





7081 




1060 

• 

SUBR 

TO PRINT f OF 

BLANK 

7114 




2170 

• 



ELSE 1ST BY Tt INPUT* 

7081 




1070 

• 

SPACES 1 NO 1CA T60 BY V41UE 

7114 




2180 

• 



IS BYTE ' 7 

708 1 




1080 

• 

IN 6 





7114 

20 

06 


2190 


JR 

Z *SETL 1 T 

YES; STRING KILL NF 












7116 




220# 

• 



STRAIGHT ASCI 1 

708 1 

CO 

6F 

70 

1100 

LINE 

CALL 

SPACE 



7116 

FE 

A2 


2210 


CP 

0A2H 

IS IT-? 

7084 

10 

F6 


1110 



OJNZ 

LINE 



7118 

20 

09 


2220 


JR 

N?.NUMBER 

7086 

C9 



1120 



RET 




711A 

ce 

CB 


2230 


SET 

1 *E 

YES; STRING IS ASCI 1 

7087 




1130 







711C 




2240 

• 



K1TH HIGH BIT ON 

7087 




1140 


SUBR 

TO PROMPT FOR 

TKO 

711C 

CB 

FB 


2250 

setlit 

SET 

7 *E 

708 7 




1150 


2-BYT6 V4LU6S* RETURNING 

7111 

CO 

79 

70 

2260 


CALL 

TV 

ECHO • OR ■ 

708 7 




1160 


THEN 

IN HL ANO DE 



7121 

18 

09 


2270 


JR 

INPUT 

6ET 1ST BYTE OF STRING 





1170 







7123 

F 6 

60 


2200 

NUMBER 

CP 

0A0H 

BYTES THAT ARRIVE HERE 

708 7 

36 

Cl 


1180 

66 T48 

LO 

A* 'A' 



7125 




2290 

• 



ARE NUMERIC; IF BLANK 

7068 

CO 

74 

70 

1190 



CALL 

OUEST 



7125 

28 

05 


2300 


JR 

Z » 1 NPUT 

I6N0RE THEM 

708C 

CO 

46 

04 

1200 



CALL 

NUN 1 N 



7127 

FE 

AF 


2310 


CP 

• /' 

IS THIS A ■KILO" BYTE? 

708F 

67 



1210 



LO 

H » A 



7129 

20 

2A 


23 20 


JR 

NZ*NTKIL0 

7080 

CO 

4b 

04 

1220 



CALL 

NUNI N 



7126 








7093 

6F 



1230 



LO 

L * A 



7128 




2340 

• BEGIN KIL0-8YTE ROUT 

INE 

7094 

0b 

38 


1240 



LO 

B * 560 



7128 




2350 

• 



7096 

CO 

81 

70 

12S0 



CALL 

LINE 



7128 

M 



2360 


LO 

4*0 

OFT 0YTE COUNT 

7099 

36 

C2 


1260 



LO 

A •' B ' 



712C 

F 6 

09 


2370 


CP 

90 

IS THIS 1ST BYTE? 

7098 

CO 

74 

70 

1270 



CALL 

QUEST 



7126 

CA 

00 

70 

2 380 


JP 

Z .START 

YES* ABORT 

709E 

CO 

46 

04 

1280 



CALL 

NUMIN 



7131 

30 



239# 


DEC 

A 

OEC BYTE COUNT 

704 1 

67 



1290 



LO 

D»A 



7132 

0? 



2400 


RLCA 


7042 

CO 

46 

04 

1300 



CALL 

NUMIN 



7133 

07 



2410 


RICA 



7046 

5F 



1310 



LO 

E*A 



7134 

07 



2420 


RLCA 



7046 

C9 



1320 



RET 




7135 

F 6 

Cb 


2430 


OR 

0C6H 


7047 




1330 







713? 

32 

36 

71 

2440 


LO 

(81 T0).A 

6 NOK CONTAINS OPERAND 

7047 




1340 


SUBR 

TO PRINT ASCI 1 


7136 




2450 

• 



OF FORTHCOMING BIT-SET 

7047 




1350 


NUMBER IN 

A* THEN 

ONE 


7136 




2460 

• 



INSTRUCTION 

7047 




1360 


BL4NK SPACE 



71JA 

21 

FC 

71 

2470 


LO 

HL *MASK 

704 7 

CO 

79 

70 

1370 



CALL 




7130 




2400 


oe 

0CBM 

INSTRUCTION! SET <HL)*N 

7047 

1380 

SUMS 

TV 



ce 








7044 

CO 

6F 

70 

1390 



CALL 

SPACE 



7136 




2490 

81 T# 

OS 

1 

MHERE THIS BYTE IS N 

7040 

C9 



1400 



RET 




713F 




2500 

• 


7046 




1410 

• 






713F 




2510 

• KMEN 

BYTE 

COUNT IS 8 

» THE ABOVE INSTRUCTION 

7046 




1420 

• 

SUBR 

TO K4IT FOR KEYPRESS* 

713F 




2520 

• KILL 

BE SET (ML)♦7; 

KHEN 7* IT KILL BE 

7046 




1430 

• 

THEN 

COMPARE INPUT 

K1 TH ASCI 1 BLANK 

713F 




2530 

• SET 

( HL ) *« 

6; UNDSOKEITER 

7046 




1440 

• 






713F 




2540 

• 




7046 

CO 

48 

01 

1450 

KEY PR 

CALL 

KEYBO 



713F 

36 

AF 


2 550 


LO 

A* •/' 

ECHO SLASH TKICE 

7081 

F 6 

40 


1460 



CP 

0 A0H 



7141 

CO 

79 

70 

2560 


CALL 

TV 


7083 

C9 



1470 



RET 




7144 

CO 

79 

70 

2570 


CALL 

TV 


7084 




1400 


• • 

• * • 

• • • • 

• • 


7147 

36 

A 7 

01 

2580 


LO 

A*(01A7M) 

IF MODE IS OCTAL* ECHO 

7084 




1490 


ROUT 

INE TO SEARCH ■ 



7 14 A 

FE 

C0 


2590 


CP 

•H* 

ANOTHER 

7084 




1600 


SPEC 

IF IEO 

RANGE OF 

MEMORY 

714C 

28 

05 


2600 


JR 

Z.MEX 

7084 




1510 


FOR . 

A GIVEN STRING 



714E 

3E 

AF 


2618 


LO 

A * * / ' 


7084 




1520 







7150 

CO 

79 

70 

2620 


CALL 

TV 


7084 




1530 


INITIALIZATION 



7153 

18 

03 


2630 

HEX 

JR 

NEXT5 


7084 




1540 







7155 

CO 

A9 

04 

2640 

NTKILO 

CALL 

FINISH 

COMPLETE the HEX or 

7084 

4F 



1650 

SE4RCM 

XOR 

A 


clear kilo-byte flag 

7158 




2650 

• 



OCTAL BYTE l ECHO 1T 

7085 

32 

FC 

71 

1560 



LD 

(MASK)»A 



7158 

CO 

6F 

70 

2660 

NEXT5 

CALL 

SPACE 


7088 

06 

60 


1570 



LO 

B *960 


SEE NOTE #4 

7158 

00 

77 

00 

2670 

LOAD 

LO 

( IX*#)*A 

LOAO BYTE INTO BUFFER 

7064 

CB 

C3 


1580 



SET 

0*E 


SET NOT-FOUNO FLAG 

715E 

DO 

28 


2680 


DEC 

IX 

OECR POINTER 

708C 

00 



1590 



EXX 




7160 

15 



2690 


DEC 

0 

OECR COUNTER 

7080 

CO 

66 

00 

1600 



CALL 

ERASE 


CLEAR SCREEN ANO 

7161 

20 

99 


2700 


JR 

NZ * 1NPUT 

IF 9 BYTES NOT USED 

70 C0 

21 

36 

73 

1610 



LO 

HL*SRCM 


PRINT BANNER 

7163 




2718 

• 



YET* GET ANOTHER 

70C3 

CO 

00 

02 

1620 



CALL 

TVE 



7163 




2728 

• 




70C6 

21 

53 

73 

1630 



LO 

HL»A0 



7163 




2738 

• SPACE TO I 

NEXT LINE 


70C9 

CO 

00 

02 

1640 



call 

TVE 



7163 




2748 

• 




70CC 

21 

SC 

73 

1650 



LO 

ML »F OR 



7163 

3E 

09 


2758 

ENOPUT 

LO 

A *90 

6ET NO* OF BYTES 

70CF 

CO 

00 

02 

1660 



CALL 

TVE 



7165 

92 



2768 


SUB 

0 

USEO INTO 0 

7002 

21 

61 

73 

16 70 



LO 

HL *STRNG 



7166 

57 



2778 


LO 

0 • A 


7005 

CO 

00 

02 

1680 



CALL 

TVE 



7167 

ce 

78 


2780 


BIT 

7*E 

KAS INPUT ASCII? 

7008 

06 

26 


1690 



LO 

8*460 



7169 

20 

04 


2790 


JR 

nz.short 


7004 

CO 

81 

70 

1700 



CALL 

LINE 



7168 

07 



2888 


RLCA 


TINES 4 

7000 




1710 

• 






716C 

07 



2818 


RLCA 



7000 




1720 

• 

GET 1 

>ARAMETEHS 



7160 

06 

01 


2020 


SUB 

1 

MINUS 1 

7000 




17J0 

• 






716F 

C6 

08 


2030 

SHORT 

ADO 

90 

PLUS 8 

7000 

CO 

87 

70 

1740 



CALL 

66 TAB 


GET SEARCH RANGE 

7171 

EO 

44 


2840 


NE6 



7060 

65 



1750 



PUSH 

HL 


SEE N6XT9 

7173 

Cb 

40 


2860 


AOO 

640 

SUBTRACTED FROM 64 

7061 

65 



1760 



PUSH 

HL 



7175 

47 



2860 


LO 

B* A 

PRINT THAT MANY 

7062 

06 



1770 



PUSH 

OE 



7176 

CO 

81 

70 

2070 


CALL 

LINE 

BLANKS 

7063 

06 

33 


1780 



LO 

8*510 



7179 




2880 

• 




7065 

CO 

81 

70 

1790 



CALL 

LINE 



7179 




2890 

• SET 

UP FOR SEARCH 


7068 

21 

61 

73 

1800 



LO 

HL»STRNG 


PROMPT FOR STRING 

7179 




2900 

• 




7066 

CO 

00 

02 

1810 



CALL 

TVE 



7179 

El 



2910 

NEXT6 

POP 

HL 

GET TOP Of RANGE 

7066 

CO 

77 

70 

1020 



CALL 

QUEST 1 



71 7 A 

Cl 



2920 


POP 

BC 

1 START OF RAN6E 

70F 1 

11 

00 

09 

1830 



LO 

DE *0900H 


SET 0 TO 9 (MAX BYTE 

7178 

87 



2930 


OR 

4 

RESET CARRY FLA6 

70F4 




1840 

• 





COUNT) ANO SET E TO 

717C 




2940 

• 



(OR NEXT INSTRUCTION 


00 

21 

45 73 

1850 






ZERO 

717C 




2950 

• 



MIGHT BLOK UP) 

70F 4 

1860 



LO 

IX* INBUF 


6ET INITIAL INPUT 

717C 

60 

42 


2960 


SBC 

HL*8C 

GET SIZE OF RANGE 

70F8 

00 

65 


1070 



PUSH 

IX 


BUFFER ADDRESS 

717E 

65 



2970 


PUSH 

ML 

(KMICH GOES 


FO 

61 





POP 

IT 



717F 

Cl 



2900 


POP 

BC 

INTO 90 












7180 

03 



2990 


INC 

BC 

PLUS 1 (IN CASE THE 

70FC 




1900 


INPUT OF : 

STRING BEGINS. FLAGS AS FOLLOKS. 

7101 




3000 

• 



STRING FOUNO IS 

70FC 




1910 


BIT 

7 OF 

E IS SET 

IF 

INPUT ■ ASCI 1 STRING* 

7181 




3010 

• 



COTERMINOUS KITH 

70 FC 




1920 


0THER8ISE 

INPUT IS 

ASSUNEO TO BE A SERIES 

7181 




3020 

• 



THE RANGE SET) 

70FC 




1930 


OF BYTES 

IN HEX OR 

octal representation. 

7181 

El 



3030 


POP 

HL 

START AOOR INTO HL 

70FC 




1940 







7182 

5A 



3040 


LO 

E»0 

SAVE BYTE COUNT IN E 

70FC 




195# 


IF THE FIRST BYTE 

input is ■ THEN the 

7183 




3050 

• 




70FC 




I960 


USER 

KANTS TO SEARCH 

FOR ASCI 1 BYTES 

7183 




3060 

• SEARCH TILL FIRST BYTE OF 

70F t 




197# 


KITH 

THE 

HIGH BIT 

on* 

IN THAT CASE 

7183 




3070 

• STRING IS 

FOUND* OR 

TILL 

70FC 




1980 


BIT 

1 OF 

E IS SET* 



7183 




3000 

• SEARCH RANGE IS EXHAUSTED 

70FC 




1990 







7183 




3090 

• 




70FC 




2000 


IF THE FIRST BYTE 

INPUT IS • THEN THE 

7183 

53 



3100 

L00K2 

LO 

D»E 

BYTE COUNT TO 0 

70FC 




2010 


USER 

KANTS TO SEARCH 

FOR STRAIGHT 

7184 

FD 

E5 


3110 


PUSH 

IY 

RESTORE POINTER 

70FC 




2920 


ASCII BYTES* KITH 

THE 

HIGH BIT OFF* 

7186 

00 

El 


3120 


POP 

IX 

TO STAR T OF BUFF 

70FC 




2030 


IN THAT CASE BIT 1 

OF 

E IS ZERO. 

7188 

00 

7E 

00 

3130 


LO 

A • (1X*0) 

GET 1ST BYTE 

70FC 




2040 







7188 

60 

• i 


3140 


CPIR 


SEARCH FOP IT 

70FC 

CO 

48 

01 

2050 

INPUT 

CALL 

KEYRO 


GET BYTE 

7180 

28 

07 


3150 


JR 

Z»NPXT7 

FOUNO ITI 

70FF 

F 6 

80 


2060 



CP 

80m 


IS IT C/R? 

718F 

09 



3160 

BCZERO 

Exx 


OUT OF RANGE: CHECK 

7101 

26 

60 


2070 



JR 

Z»ENDPUT 


YES* END INPUT 

7190 

CB 

43 


3170 


81 ? 

0»E 

NOT-FOUND FLAG* 

7103 

ce 

78 


2080 



BIT 

7 *E 


IS STRING LITERAL? 

7192 

20 

59 


3180 


JR 

NZ.NONE 

TAKE APPROPRIATE 

7105 

28 

06 


2090 



JR 

Z »NOTL 1 T 



7194 

18 

50 


3190 


JR 

FIN 

EXIT 

7107 

CO 

79 

70 

2100 



CALL 

TV 


YES* ECHO IT 

7196 




3200 

• 




7104 

CB 

48 


2110 



BIT 

1»E 


IS IT STRAIGHT ASCI 1? 

7196 




3210 

• 1ST 

BYTE 

KAS FOUNO; 

SEARCH 

710C 

28 

40 


2120 



JR 

Z*LOA0 


NO* LOAD AS IS 

7196 




3220 

• FOR 

SUCCESSIVE BYTES 

IN STRIN6 

7106 

66 

7F 


213# 



ANO 

7FM 


ELSE KILL HIGH 81T 

7196 




3230 

• 




7110 

18 

49 


2140 



JR 

LOAD 



7196 

15 



3240 

NEXT7 

OEC 

0 

OECR BYTE COUNT 

7112 

F6 

47 


2150 

NOTH T 

CP 

0 A 7 H 


BYTES THAT ARP 1VE HERE 

7197 

28 

25 


3250 


JR 

Z.PRINT2 

FOUNO KMOlE STRINfll 

7114 




2160 

• 





ARE EITHER NUMERIC OR 

7199 

78 



3260 


LO 

A *8 

BC * •? 


Page 24 

310 


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


Number 27 




7T9A 8 1 
7198 26 
7190 C5 
719E 
719E 78 
719F 92 
7TA0 47 
7141 34 
7144 96 

7146 26 

7147 97 
7146 19 
7144 C8 
714C 
714C Cl 
7140 00 

714F DO 
7162 26 
7184 23 
7166 96 
7166 16 

7108 ED 
71 BA 29 

710C 16 
71BE 
7186 
716E 
7166 
710E 6b 
71BF 08 
71C9 09 
7ici ce 
71C 3 19 
71C5 
71C8 36 
71C7 CO 
71CA CO 
71C0 CO 

7109 96 

7102 09 

7103 26 

7104 10 
7108 29 
7107 SC 
7106 CD 
71 OB 50 
71 DC CO 
710F CO 
71E2 CO 
7165 01 
71E6 61 
716 7 78 
7169 81 
71E9 29 
71E8 16 
7160 21 
71F9 CO 
71FJ CO 
71F6 CA 
71F 9 
71F9 C3 
71FC 
71F0 

71F D 
71F0 
71F0 
71F0 CO 
7299 21 
7293 CO 
7296 21 
7299 CO 
720C 21 
720F CO 
7212 06 
7214 CO 
7217 
7217 
7217 
7217 CO 
7214 13 
7216 05 
721C E5 
7210 01 
7216 El 
72IF EO 

7221 05 

7222 E5 

7223 06 
7225 CO 
7228 3E 

7224 CO 
7220 CO 

7230 67 

7231 CO 

7234 6F 

7235 Cl 

7236 El 

7237 
7237 
7237 
7237 EO 
7239 
7239 
7239 
7239 
7239 06 
723B CD 
7236 21 
7241 CO 

7244 16 

7245 05 


Number 27 




3270 


OR 

C 


7246 

5 A 



4380 


LO 

E»D 


F 2 


326# 


JR 

2 »BCZERO 

YES* YOU'RE OONE 

7247 

CO 

46 

02 

4390 


CALL 

NUMOUT 




3290 


PUSH 

BC 

IS NEXT BYTE ■BUD"? 

7244 

01 



4400 


POP 

OE 




3300 

• 



LET'S FIND OUT 

724B 

CD 

46 

02 

4410 


CALL 

NUMOUT 




3310 


LO 

A »E 

NUMBER OF BYTES IN STRING 

72 4 E 

CO 

AE 

70 

4420 


CALL 

KEYPR 

BAIT FOR KEYPRESS 



3320 


SUB 

0 

MINUS CURRENT BYTE COUNT 

7251 

28 

AA 


4430 


JR 

Z*MOVE 

IF SPACE BAR* 



3330 


LO 

B * A 

RESULT IS SHIFT COUNTER 

7253 




4440 

• 



MOVE AGAIN 

FC 

71 

3340 


LO 

A »(MASK ) 

GET MASK TO BE SMIFTEO 

7253 

C3 

00 

70 

4450 


JP 

START 

ELSE BACK TO MENU 



3350 

ROTATE 

OEC 

B 

ROTATE MASK LEFT 0 IF 

7256 




4460 

• • • 

• • • 



03 


3360 


JR 

2 * TES T 

NEXT BYTE IS 2ND IN 

7256 




4470 

• ROUTINE TC 

1 COMPARE TNO 



33 70 


RICA 


STRING* 1 IF NEXT BYTE 

7256 




4480 

• BLOCKS OF 

MEMORY AND 


F 4 


3380 


JR 

ROTATE 

IS 3RD* ETC 

72 S6 




4490 

• DISPLAY MISMATCHES 


7F 


3390 

TEST 

BIT 

7 » A 

IF BIT 7 IS SET* NEXT BYTE 

7256 




4601 

• 






3400 

■ 



BILL BE 'BUD* 

7266 




4510 

• 






3410 


POP 

BC 


7256 




4520 

• INITIALIZATION 


28 


3420 


OEC 

IX 

OECR POINTER 

7256 




4530 

• 




7E 

00 

3430 


LO 

A»( 1K♦• ) 

GET NEXT BYTE 

7256 

f 1 

00 

00 

4540 

COMPAR 

LO 

6C*0 

SET NOT-FOUNO FLAG 

04 


3440 


JR 

2»N0SKIP 

IF BYTE BAS B1LO* 60 

7259 

C5 



4550 


PUSH 

BC 

1 PAGING COUNTER 



3450 


INC 

ML 

RIGHT ON TO NEXT 

725A 

CO 

€6 

00 

4560 


CALL 

ERASE 

CLEAR SCREEN ANO 



3469 


OEC 

BC 


7260 

21 

30 

73 

4570 


LO 

HL*CMPR 

PRINT BANNER 

06 


34 70 


JR 

NEXT 7 


7260 

CO 

00 

02 

4560 


CALL 

TVE 


41 


3489 

NOS*IP 

CPI 


FIND NEXT BYTE OF 

7263 

21 

53 

73 

4590 


LO 

HL»AB 


04 


3490 


JR 

2 »NEX T 7 

STK1NG? 

7266 

CO 

00 

02 

4600 


CALL 

TVE 


C5 


3500 


JR 

LOOK2 

If NOT* START OVER 

7269 

21 

60 

73 

4610 


LO 

HL • TO 




3510 

• 




726C 

CO 

00 

02 

4620 


CALL 

TVE 




3520 

• PRINT AODRESS OF 


726 F 

06 

28 


4630 


LD 

B.430 




3530 

• STRIN6 BHEN FOUNO 


727 1 

CD 

81 

70 

4640 


CALL 

LINE 




3540 

• 




7274 




4650 

• 






3559 

PRINT2 

PUSH 

ML 


7274 




4660 

• GET 1 

PARAMETERS 




3560 


PUSH 

OE 


7274 




4670 

• 






3870 


EX X 



7274 

CO 

87 

70 

4680 


CALL 

GETAB 

GET START 

83 


3588 

603 

RES 

0 »E 

RESET NOT-FOUND FL46 

7277 

06 

38 


4690 


LO 

6*560 

1 END AOOR 

00 


3590 


DJN2 

NEXT8 

OECR L OC A T 1 ONS “PR 1 NTE'J 

72 79 

CO 

81 

70 

4700 


CALL 

LINE 

OF BLOCK 1 



3609 

• 



COUNTER* SKIP ON 0 

727C 

3E 

C3 


4710 


LO 

A * ' C 1 


4F 


3610 


LO 

A * • / • 

PRINT / 

727E 

CO 

74 

70 

4720 


CALL 

OUEST 

GET START 

79 

70 

3620 


CALL 

TV 


728 1 

CO 

A6 

04 

4730 


CALL 

NUMIN 

AOOR OF 

48 

91 

3630 


CALL 

KETRD 

BAIT FOR KEYPRESS 

7284 

F 5 



4740 


PUSH 

AF 

BLOCK 2 

66 

9 0 

3640 


CALL 

ERASE 

CLEAR SCREEN 

7285 

CO 

A6 

04 

4750 


CALL 

NUMIN 

INTO IY 

7F 


3650 


LO 

8* 1270 

RESET COUNTER 

7288 

Cl 



4760 


POP 

BC 




3660 

NEXT8 

EXX 



7289 

4F 



4770 


LO 

C » A 




3670 

8AKUP 

DEC 

ML 

GET A DDR OF 1ST BYTE 

728A 

C5 



4780 


PUSH 

BC 




3689 


OEC 

E 

IN STRING FOUNO 

728B 

F 0 

El 


4790 


POP 

IY 


FC 


3690 


JR 

NZ »BAXUP 


7280 




4800 

• 






3790 


LO 

E • H 

PRINT ADDRESS 

7280 




48 10 

• COMPARE BYTE N FROM 

BLOCK 1 

46 

02 

3710 


CALL 

NUMOUT 


7280 




4820 

• BITH 

BYTE 

N FROM BLOCK 2; IF 



3720 


LO 

E *L 


7280 




4830 

• NOT 

IDENTICAL* PRINT 

ADDRESSES 

46 

02 

3730 


CALL 

NJMOUT 


7280 




4040 

• ANO 

PRINT 

EACH BYTE 

AS HEX OR 

6F 

70 

3740 


call 

SPACE 


7280 




4850 

• OCTAL AND 

AS ASCII 


6F 

70 

3750 


CALL 

SPACE 


7280 




46 60 

• 






3760 


POP 

OE 


7280 

7E 



4870 

LOOK 

LO 





37 70 


POP 

ML 


728E 

FO 

BE 

00 

4880 


CP 

<IY*0) 

ARE BYTES EQUAL? 



3760 


LD 

A »8 

DOES THIS FIND 

7291 

20 

00 


4890 


JR 

NZ *FOUND 




3790 


OR 

C 

COINCIDE BITH ENO 

7293 

23 



4900 

NEX00 

INC 

HL 

YES* BUMP POINTERS 

98 


3610 


JR 

NZ»LQ0K2 

OF RAN6E? IF SO* 

7294 

FO 

23 


4910 


INC 

IY 


96 


381# 


JR 

FIN 

STOP* ELSE SEARCH AGAIN 

7296 

05 



4920 


PUSH 

OE 

SUBTRACT BLOCK 1•S 

68 

73 

3829 

NONE 

LD 

HL»N0N 

PRINT “NONE" 

7297 

E6 



4930 


EX 

OE *HL 

POINTER FROM 

09 

92 

38 30 


CALL 

TVE 


7298 

EO 

52 


4940 


SBC 

ML » OE 

BLOCK 1 ENO A00« 

46 

70 

3840 

FIN 

CALL 

KEYPR 

BAIT FOR KEYPRESS 

729A 

EB 



4950 


EX 

OE*ML 


84 

70 

38 50 


JP 

2»SEARCH 

IF SPACE BAR IS 

729b 

01 



4960 


POP 

OE 




3860 

• 



PRESSEO* SEARCH AGAIN 

729C 

38 

2E 


4970 


JR 

C*ENOALL 

IF PTR ■> ENO* OONE 

00 

70 

3870 


JP 

START 

ELSE BACK TO inf MENU 

729E 

18 

EO 


4980 


JR 

LOOK 

OTHERBISE CONTINUE 



3880 

MASK 

OS 

1 


72A0 




4990 

• 






38 90 

• • • . 

• • • 



72A0 




5000 

• SUBR 

TO PRINT 




3900 

* ROUTINE TO MOVE 


72AI 




5010 

• BYTES THAT DON'T MATCH 



3910 

• A BLOCK IN MEMORY 


72A0 




5020 

• 






3920 

• 




72A0 

Cl 



5030 

FOUNO 

POP 

BC 

POP PA6IN6 COUNTER 

66 

00 

39 30 

MOVE 

CALL 

ERASE 

CLEAR SCREEN AND 

72A1 

CB 

41 


5040 


BIT 

0*C 

IF BIT 0*C IS ZERO* 

45 

73 

3940 


LO 

ML * MV 

PRINT BANNER 

72A3 




5050 

• 



THIS IS THE FIRST 

09 

02 

3950 


CALL 

TVE 


72A3 




5060 

• 



MISMATCH FOUND 

53 

73 

3960 


LD 

ML »A8 


72 A3 

28 

06 


50 71 


JR 

NZ•ONGO 


00 

02 

3970 


CALL 

TVE 


72A5 

CO 

E6 

• 0 

5080 


CALL 

ERASE 

so be clear screen. 

60 

73 

3980 


LD 

ML • T 0 


72A8 

01 

01 

0F 

5091 


LO 

BC*0FfTM 

SET PAGING COUNTER 

80 

02 

3990 


CALL 

TVE 


72 AB 




5100 

• 



TO ISO C SET FLAG IN 

2F 


4000 


LO 

8*470 


72A8 




5110 

• 



C TO SHOB THAT THE 

91 

70 

4010 


CALL 

LINE 


72AB 




5120 

• 



2 BLOCKS ARE NOT 



4020 

• 




72 AB 




5130 

• 



IDENTICAL 



40 30 

• OET PARAMETERS 


72AB 

C5 



5140 

ONGO 

PUSH 

BC 




4040 

• 




72AC 

E5 



6150 


PUSH 

HL 


87 

70 

4050 


CALL 

6ETA8 

GET START 

72 AO 

05 



5160 


PUSH 

DE 




4069 


INC 

OE 

ANO ENO 

72AE 

CO 

E0 

72 

5170 


CALL 

PRINT 

PRINT BYTE t AOOR 



4170 


PUSH 

OE 

ADDRESSES 

7281 




5180 

• 



FROM BLOCK T 



4080 


PUSH 

HL 

FOR BLOCK 

728 1 

FO 

ES 


6190 


PUSH 

IY 




4080 


POP 

OE 

CALCULATE SIZE 

72B3 

El 



5200 


POP 

HL 




4100 


POP 

ML 

OF BLOCK 

72B4 

CO 

E0 

72 

1210 


CALL 

PRINT 

THEN FROM BLOCK 2 

52 


41 10 


sec 

ML » OE 


7287 

16 

20 


5220 


LO 

8*320 




4120 


PUSH 

OE 


7289 

CO 

01 

70 

5230 


CALL 

LINE 




4130 


PUSH 

HL 


72BC 

01 



5240 


POP 

OE 


38 


4140 


LO 

8*580 


72B0 

El 



5250 


POP 

HL 


81 

70 

4159 


CALL 

LINE 


72BE 

Cl 



5260 


POP 

BC 


C3 


4160 


LO 

A* • C• 

PROMPT FOR 

728F 

10 

08 


5270 


DJNZ 

NEX 303 

IF PA6IN8 COUNTER 

74 

79 

4170 


CALL 

OUEST 

DESTINATION 

72C1 




5280 

• 



IS 0* PA6E IS FULL 

46 

04 

4180 


CALL 

NUMIN 

ADDRESS 

72C1 

CO 

A8 

01 

5290 


CALL 

KEYBD 

BAIT FOR KEYPRESS 



4100 


LO 

0* A 


72C4 

CO 

E6 

00 

5300 


CALL 

ERASE 


46 

04 

4200 


CALL 

NUMIN 


72C7 

06 

0F 


5310 


LO 

B»150 

RELOAD PAGING COUNTER 



4210 


LD 

E » A 


72C9 

C5 



5320 

NEX 30 3 

PUSH 

BC 

1 SAVE ON STACK 



4220 


POP 

BC 

POP BLOCK SIZE 

72CA 

18 

C7 


S330 


JR 

NEX00 




4230 


POP 

ML 

< START ADOR 

72CC 




5340 

• 






4240 

• 




72CC 




5350 

• BRAP 

-UP 





4250 

• MOVE 

THE BLOCK 


72CC 




5360 

• 






4269 

• 




72CC 

Cl 



53 70 

ENOALL 

POP 

BC 

BERE ANY MISMATCHES 

B0 


4270 


LOIR 



72C0 

CB 

41 


5380 


BIT 

0*C 

FOUNO? 



4280 

• 




72CF 

20 

• 6 


5390 


JR 

NZ.FINI 




4290 

• PRINT END 

ADDRESS 


7201 

21 

97 

73 

5400 


LD 

HL * 1 DENT 

YES* PRINT •SAME* 



4300 

• OF MOVED BLOCK 


7204 

CO 

00 

02 

5411 


CALL 

TVE 




4310 

• 




7207 

CD 

AE 

70 

5420 

FINI 

CALL 

KEYPR 

BAIT FOR KEYPRESS 

38 


4320 


LO 

8*560 


7204 

CA 

56 

72 

5430 


JP 

Z *COMPAR 

IF SPACE BAR. 

81 

70 

4330 


CALL 

LINE 


7200 




5440 

• 



RERUN COMPARE 

94 

73 

4340 


LO 

ML »ND 


7200 

C3 

00 

70 

5450 


JP 

START 

ELSE BACK TO MENU 

00 

02 

4350 


CALL 

TVE 


72E0 




5460 

• 






4360 


OEC 

OE 


72E0 




5470 

• ROUTINE TO PRINT ONE 




4370 


PUSH 

OE 


72E0 




5480 

• BYTE* BITH ASCII EQUIVALENT 


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

311 





7269 

1269 

7269 SC 
7261 CD 46 
7264 SO 
7266 CD 46 
7286 36 8D 
7264 CO 79 

7260 56 
7266 CO 46 

7261 36 BO 
72F3 CD 79 

7266 76 

7267 6E 89 
7269 39 94 

7268 96 42 
7260 18 94 
7266 98 47 
7361 18 96 
7393 C6 89 
7385 66 89 
7387 39 92 
7399 18 94 


5490 • ANO CURRENT POINTER 
5588 • 

5519 PRINT 
5629 


5539 
5549 
5559 

5569 

5570 
5580 
5580 
5600 
5610 
5620 
5639 
$640 
5650 
5660 
5670 
5680 ASCI I 
5690 

5700 

5710 


001 


LD E*H 
CALL NUMOUT 
LO E»L 
CALL NUNOUT 
LD A#* 
CALL TV 
LO E»(HL) 
CALL NUNOUT 
LO A * • 

CALL TV 
LO A »(ML ) 

CP 89H 

NC»DO I 
B *9A2H 
ASCI I 
B»0A7H 
NEX2T 
80 M 
80H 

NC*NEX2T 
NXT220 


JR 

LD 

JR 

LO 

JR 

ADO 

CP 

JR 

JR 


400RESS 

735C 



6100 FOR 

OC 

•FOR • 



C6 

C6 

02 

A0 




PRINT 400RESS 

7360 



6119 

OB 

0 



00 








7361 



6129 STUNG 

OC 

•STRING 1 



03 

04 

02 

C9 CE 





C7 








7367 



6130 

OB 

0 


PRINT BYTE IN 

00 







HEX OR OCTAL 

7368 



6149 NON 

DC 

•NONE* 



CE 

CF 

CE 

CS 





736C 



6150 

06 

0 



00 







IS IT ASCI 1 KITH 

7360 



6160 TO 

OC 

•TO C - 

0' 

HI OH BIT ON? 

04 

CF 

49 

C3 40 




NO* PRINT ■ 

AO 

A0 

C4 






7375 



6170 

OB 

0 


YES* PRINT • 

00 







SET HI6H BIT 

7376 



6190 UTIL 

08 

06 FH 






NON IS IT A 

7377 



6190 

OB 

240 


PRINTABLE CHAR? 

19 





NO* PRINT SPACE 

7378 



6290 

DC 

•TVC-64 

•jtilit 


7306 6E 66 

5720 NEX2T CP 

0FFH 

YESl IS IT RUB? 

04 

06 

C3 

40 

B6 

7300 

5730 • 


(RU80UT MOULD 

84 

40 

05 

04 

C9 

7300 

5740 • 


CLEAR SCREEN) 

CC 

C9 

04 

C» 

C5 


7300 20 08 
7306 CO 6F 
7312 CD 66 
7315 19 09 

7317 65 

7318 78 

7319 CO 79 
711C 01 
7310 CO 79 

7320 00 04 
7322 CO 81 

7325 C9 
7126 

7326 
7326 
7326 

7326 3E C8 


JR NZ#NEX45 
NXT220 CALL SPACE 
CALL SPACE 
JR I NO 
PUSH A6 
LO A* B 
CALL TV 
POP AF 
CALL TV 
LO B»4 
CALL LINE 
RET 


5750 
6760 
5770 
5780 

5790 NEX45 

58 0 9 
5610 
6620 

58 30 

5840 INO 
5650 
5860 
5070 
5800 
5990 
5990 • 

5919 HEXNOO LO 


NO* YOU CAN PRINT IT 


PRINT • OR ' 
PRINT BYTE IN ASCII 


• ROUTINE TO SET 

• HEX NOOE 


SEE NOTE #3 


03 

73B8 

65 

7399 

B8 

C9 

7302 

3C 

7393 

00 

7394 
C4 

7396 

98 

7397 

A9 


40 

D4 


CO 

CF 


6210 

6220 
C 6 CE 

02 

6230 
6240 
6250 NO 
6260 


OB 

DC 

OB 

OB 

OC 

DB 


6270 IDENT OC 
CO C5 


1010 

•0 40NITOH• 

600 

0 

• 0 ?' 

0 

• S4NE' 


7328 

32 47 

01 

592» 

LO 

(0147H)*A 

739C 


6280 

06 

0 



732B 

C3 08 

70 

5930 

JP 

START2 

00 








73 2 E 



5940 • 



7390 


6290 • 





732E 



5950 • TEXT 

FOR 


7390 


6300 • INPUT BUFFER 



732£ 



5960 • BANNERS 


7390 


6310 • 





732E 



5978 • 



7390 


6320 

OS 

00 



732E 



5980 MON 

OC 

•MONITOR • 

73A6 


6330 INSU6 

OS 

1 



CO 

C6 

CE 

C9 04 











CF 

02 





NO ERRORS FOUND 






7335 



5990 

OB 

0 









00 






FILE : 

3000 

67E8 






7336 



6000 SRCH 

OC 

•SEARCH* 

READY 








03 

C5 

Cl 

02 C3 



LTA8L 








C8 






AB 

7353 

ASCII 

7303 

BAX *JP 

7103 

BCZERO 

718F 

733C 



6010 

DB 

0 

61 10 

7136 

CMPR 

7330 

COMPAR 

7256 

001 

7266 

00 






EN04LL 

72CC 

ENDPUT 

7163 

ERASE 

00E6 

FIN 

71F3 

7330 



6020 CMPR 

OC 

•COMPARE* 

61 N 1 

7207 

FINISH 

04A9 

FOR 

735C 

FOUND 

72A0 

C3 

C6 

CO 

00 Cl 



BE TAB 

7087 

603 

71C1 

HEX 

7153 

HEXMOD 

7326 

02 

CS 





HX 

734 A 

I06NT 

7397 

IMMEO 

7062 

INBU6 

73A5 

7344 



6930 

Ob 

0 

IND 

7320 

INPUT 

706 C 

INPUT0 

7040 

KEY80 

0148 

00 






KEY PR 

70AE 

LINE 

7081 

LOAD 

7159 

LOOK 

7280 

7345 



6940 NV 

OC 

•MOVE • 

L00K2 

7183 

NASH 

716C 

MON 

7326 

NONTR 

0500 

CO 

C6 

06 

Cb 



MOVE 

7160 

MV 

7345 

NO 

7394 

NEX00 

7293 

7349 



60 50 

08 

0 

NEX2T 

7309 

NEX 303 

72C9 

NEX45 

7317 

NEX T 5 

7158 

00 




OC 

•HEX MODC’ 

NEXTb 

7179 

NEXT? 

7196 

NEXTB 

7102 

NON 

7368 

7344 



6060 MX 

NONE 

7160 

NOSKIP 

7188 

NOTLIT 

7112 

NTVILO 

7155 

C8 

C6 

08 

40 CD 



NUMBER 

7123 

NUMIN 

0 4 46 

NUMOUT 

0246 

NUNS 

7047 

C6 

C4 

CS 




NX T 2 2 0 

7306 

ON 60 

7240 

PRINT 

72E9 

PR INT2 

718E 

7352 



6070 

08 

0 

OUEST 

7074 

QUEST 1 

7077 

ROTATE 

71A4 

SEARCH 

7084 

00 






setlit 

711C 

SHORT 

7166 

SPACE 

7066 

SPC 

7074 

7353 



6080 AB 

OC 

• A - 8 • 

SRCH 

7336 

START 

7000 

START2 

7008 

STRN6 

7361 

40 

Cl 

40 

AO A0 



table 

7065 

TEST 

7144 

TO 

7360 

TV 

7879 

C2 

40 

40 




TVE 

0200 

UTIL 

7376 





736B 



6090 

DB 

0 

file 

3000 

6768 






00 






READY 









PILOT ON NORTHSTAR DISK 

Dear Dr. Dobb: Received: 78 June 9 

Through the kind cooperation of the author, Dr. John 
Starkweather, the source code for 8080 PILOT which you 
published in your Journal last year is now available in machine 
readable form from the North Star Software Exchange. 

Anyone interested may order diskette NSSE5 from: 

North Star Software Exchange 
2547 Ninth Street 
Berkeley, CA 94710 

The price is $9.50 including the cost of the diskette. The 
diskette also includes a remarks file and an executable file con¬ 
taining a preliminary version of PILOT modified to run with 
the North Star DOS. This file also includes the standard 
PILOT demonstration program. 

Sincerely, 

Thos Sumner 

Page 26 

312 


THE 6502 PROGRAM EXCHANGE 

News Release Received: 78 June 13 

Apple II users can now run an extended version of the high- 
level language FOCAL (DEC trademark). FCL65E, as it is 
called, is available on an Apple II format cassette ($25) and 
occupies 1000H-2665H in memory. A Mini-Manual ($6) pro¬ 
vides I/O information and descriptions of FCL65E’s com¬ 
mands. The FCL65E User’s Manual ($12) contains 104 pages 
of programming examples to help you exploit the power of 
the language. The complete source listing in cross-assembly 
form ($35) will enable the enthusiast to customize FCL65E 
for his particular applications. KIM and TIM cross-assemblies, 
paper tapes, and KIM Hypertape cassettes are also available. 
For further details and information on other available 6502 
software, send $1.00 to The 6502 Program Exchange, 2920 
Moana, Reno, NV 89509. 


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


Number 27 




A Shorter Printer Driver for 
PolyMorphic's BASIC 


BY RICHARD B. EMERSON 

158 E. Butler Ave. 

Ambler, PA 19002 COPYRIGHT© 1978 

I am the proud owner of a PolyMorphic Systems Poly 88 
with an 8080A CPU, Video Terminal Interface (VTI), 20K of 
memory from various vendors (Godbout, IMS, and IMSAI in 
order of preference), A Poly Cassette Interface, and a Poly 
Printer Interface. It is this last item that led me to write this 
article. 

Sooner or later every computer owner wants a permanent 
copy of his triumphs (the very non-permanent CRT is fine for 
the less memorable events!) and at the same time it becomes 
painfully clear that a hard copy device is not cheap. Most 
printers that warrant any serious consideration are priced at or 
above the cost of a CPU and cabinet. I am fortunate enough to 
have access to a TI-745 portable terminal. This fact removed 
the first obstacle to getting a printer running. The second 
problem is the matter of finding the electronics to drive the 
printer. Unfortunately, most printers lack the good grace to al¬ 
low you to hook your printer up to your particular bus, be it 
S-100, SWTPC, Benton Harbor, or Greyhound. This is where 
the manufacturers of parallel to serial and serial to parallel 
interfaces come in. They make boards that put the right signals 
in the right places so that your printer can be “heard”. My 
first thought was to buy a printer interface from PolyMorphic 
but a shortage caused by problems with the printed circuit 
manufacturer meant that the interfaces were as scarce as 
programs that run perfectly the first time. I decided to look 
elsewhere. 

I didn’t have too much success finding replacements be¬ 
cause the Poly 88 CPU clock runs about 9% slower than most 
8080 systems. This is so that the VTI can use the system clock 
to generate the needed sync signals for an essentially flicker 
free display. When I tried to use a Franklin Electric 3S+P I/O 
board the baud rates came out all wrong even at rates as low as 
110 baud. The card is capable of running as fast as 9600 baud 
and every rate was off by a significant amount. If you do have 
a need for three serial ports and if you have a 2 MHz clock, the 
Franklin Electric board at $150 is a bargain that is hard to 
beat. Actually, even had the board been compatible with my 
Poly 88, I would still have been faced with the problem of 
software. Poly’s printer interface uses a USART with connec¬ 
tions to ports 0 and 1. Because the cassette interface also uses 


the same ports, just changing the IN and OUT instructions to 
new ports would not have the desired results even if one as¬ 
sumes that just changing ports would work at all. This is prob¬ 
lem number three; without the software to drive the printer 
interface, all you will have is an impressive looking drain on 
your budget. 

While standing around waiting for my printer interface kit 
to be delivered I reviewed what I needed to drive my printer. 
The assembler that I had just bought (PolyMorphic’s Assem¬ 
bler version G02) has a driver already written into it. My 
BASIC doesn’t have a driver in it but Poly does supply an 
auxiliary program that will drive a printer connected to their 
printer interface card. It seemed, then, that I was spared 
having to write anything to make my printer work. 

My waiting was rewarded by a phone call from the good 
folks at Personal Computer Corporation in Fraser, PA. My 
interface had arrived! Before leaving Personal Computer I de¬ 
cided to check the parts list against the parts that were actual¬ 
ly in the box as there weren’t too many parts to check. It was 
a good thing that I checked because ALL of the parts for 
driving a current loop device, such as a Teletype, were missing. 
Personal Computer offered to replace the parts with some 
from another kit in the shipment, but the parts were missing 
from that kit, too! In my case the loss is annoying more than 
anything else, but for $65 I think that PolyMorphic could have 
done better. 

The kit went together with only one or two bits of excite¬ 
ment. The first thrill was finding out that what I thought to be 
a 1N5252 diode wasn’t. Thinking nasty thoughts about kit 
packers, I double-checked the manual to see if an alternate 
part number was listed somewhere. Sure enough, four pages 
later, buried in the instructions was the other number, 
1N5254A. The second thrill was finding that the resistors R2 
and R5 were not mentioned because they seem to have been 
dropped from the design (I like to see sequential numbers 
when it comes to parts call-outs.). A note saying that they had 
been dropped would have saved me much page flipping. By 
following the rather crude sketches on page nine of the manu¬ 
al, I set up the jumpers needed to test the card. The next step 
was a smoke test so I pulled all of the cards in the mainframe 
except the CPU which is where the interface is connected. This 
may seem a bit extreme, pulling all of the cards out, but it is 
cheaper than having a short or wiring error smoke more than 
just the new card. 


Number 27 


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


Page 27 

313 







Having passed the smoke test properly, I ran the test pro¬ 
gram which echos data at 9600 baud. This ran the first time 
off, a very pleasant surprise. All that remained was to hook up 
the TI-745 and try it out. The owner’s manual from Texas 
Instruments told me what pins did what on the terminal’s 
connector and so it was easy to connect up a cable. Well, it 
was almost easy, the control leads took a little tinkering. The 
TI-745 requires that the Data Carrier Detect (DCD) line be 
pulled high before the terminal will run. By connecting the 
DCD line to the terminal’s own Data Terminal Ready (DTR) 
line, the terminal tricks itself into running. I did not want to 
put the jumper between the DCD line and the DTR line on the 
TI-745’s connector so I borrowed pins 5 and 6 of J1 on the 
interface card. Ordinarily, pin 8, the DCD line, does not ap¬ 
pear on the jumper block, J1. However, by tying the pin 8 side 
of the CF jumper near J2 to the pin 5 side of the CC jumper, 
it is possible to make the DCD line appear on J1. All that re¬ 
mains is to tie pins 5 and 6 together at J1 and to remove the 
jumper that PolyMorphic recommends go between pins 9 and 
10. While the steps discussed above are fine for a TI-745, 
other printers may need different connections. The printer 
interface manual suggests connections for Teletypes, Dec- 
writers (available from Heathkit at a fair price), and Hytypers. 

My first attempt to use the printer with the assembler was a 
great success. I was also able to use BPRINT, the BASIC 
printer driver, to list off programs written in BASIC and also 
to copy the program’s output from the screen. I soon found 
that BPRINT has one major flaw. It takes up over 500 bytes, 
and, since I’m cheap, I’d rather put program code in those 
bytes than a space-eating buffer. The majority of the space is 
consumed by a 256 byte circular buffer while the code resides 
in the remaining space. The obvious question was, could the 
buffer be cut down without hurting performance and the 
answer is yes (Why else would I write this article?). 

The accompanying listing of BPRINT retains the essential 
features of PolyMorphic’s BPRINT. It switches on the printer 
with CTRL/Q and the keyboard is switched on with CTRL/R. 
CTRL/S and CTRL/T turn off the printer and keyboard 
respectively. The restart address is not the same as the one that 
Poly specifies. Use 4A8D instead. The baud rate table on page 
five of Poly’s writeup for BPRINT still applies for the most 
part, the only change is that the constant for the baud rate is 
now at 4A42. If you want to change the number of pad char¬ 
acters from the current value of 10, put the new value into 
4A7C but be sure that it is not less than 1 or evil things will 
happen. Sharp-eyed readers will note that the buffer extends 
from 4B0F down to 4B00 while ERRMSG extends from 
4ACD up to 4B03. This is not a real problem because either 
BPRINT loads, in which case ERRMSG is excess baggage, or 
BPRINT doesn’t load, in which case the buffer isn’t likely to 
be needed. If you are still bothered by this, all that is needed 
is to shorten ERRMSG and be sure to end it with a zero byte. 
For those who understand circular buffers, that’s it. There is 
only one final caution. Sometimes the printer will start print¬ 
ing one character over and over when restarting with the 
CTRL/Q. Don’t panic, just type another CTRL/Q and hit 
return. The USART is being asked to drive two devices and it 
appears that noise on the CPU card can sometimes cause the 
USART to start sending nonsense. In the writeup that comes 
with PolyMorphic’s BPRINT, they insist that you must restart 
BASIC through the point labeled START (4A8D on this ver¬ 
sion). In fact it appears that 99% of the time you can restart 


through 2003 as always. This has been tried in both versions 
of BPRINT with good success. The only “gotcha” seems to be 
that WH1 (0C24) and SRA4 (0C16) must not be modified. It 
is, in fact, possible to type CTRL/Q, CTRL/R, return, and 
then record type-ins made after typing CTRL/Z. The screen’s 
display of the registers and so on do not come through WH1 so 
they are not printed, but any type-ins made will appear on the 
screen as always and on the printer, too. 

One thing needs to be made quite clear about circular or 
ring buffers. The name describes only the concept; they aren’t 
really circular. But it makes it easier to visualize how the 
buffer functions. What happens is that a range of addresses is 
selected such that the highest and lowest addresses seem to be 
adjacent. The accompanying sketches show how this feat of 
memory topology is possible. In this program, the lowest two 
digits of the pointers’ addresses meet this requirement. If you 
look at the lines after the labels WRITE and SEND you will 
see that the L register is decremented and tested for zero. In 
this case L will be restored to OF making 4B00 seem adjacent 
to 4B0F. A buffer that is 256 bytes long would be restored to 
FF automatically by the DCR L instruction. The HL register 
pair may contain either BPP (Buffer Put Pointer) or BGP 
(Buffer Get Pointer) but for the purposes of this discussion all 
that matters is understanding why address 4B00 can be 
thought of as being adjacent to 4B0F. Study the sketches of 
how the pointers move. At the start of the program both BPP 
and BGP point to the same place. As data comes in BPP moves 
ahead of BGP, and BPP will continue to advance until it is 
again equal to BGP and the buffer is full. Any time a character 
is read from the buffer, BGP advances and it may continue to 
advance until it is equal to BPP and the buffer is empty. In the 
second example the buffer has started to fill with the string 
“THE QUICK BROWN FOX”, however, the character “3” 
is left over from something else that was in the buffer. 
BPP is loading an “N” and BGP is getting a “T”. The one thing 
that must not happen is to have the “get” pointer move ahead 
of the “put” pointer. If this should happen you might wind up 
getting back characters that haven’t been put in the buffer yet! 
Actually old characters would come out but in any case the 
results would not be valid. 

The example of the buffer is one character away from being 
full. Since BPP may not pass BGP or “wrap-around”, what can 
be done? The easiest way out is to stop BASIC from producing 
too many characters for the buffer. WAIT does this by making 
sure that the interrupts have been enabled and then halting the 
CPU. When the USART asks for the next character it generates 
an interrupt, forcing the CPU to start running at routine TISR 
(Terminal Interrupt Service Routine). There is a chance that 
something else generated the interrupt (The console keyboard 
and real-time clock both use interrupts and you may have 
added devices that also generate interrupts).) so the first thing 
that is done is to verify that the USART did, in fact, cause the 
interrupt. If it did, READ or WRITE is executed, depending 
on the USART’s status buffer, otherwise the CPU is sent off 
through IORET, the monitor’s return point for all interrupt 
service routines, to see what happened. 

There you have it, circular buffers are in fact handy bits 
of software that allow you to tie together a fast CPU and a 
slow printer without resorting to magic incantations or lots of 
expensive chips. As you can see, circular buffers are quite easy 
to understand once you, ah, get a-round to it. .. 


Page 28 

314 


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


Number 27 




Number 27 





CS 


ill 


2 

o 

d 


_ C* 
in 

I s 3 


o' 

ui 


u <J 

u. -r 
D 
cQ 

ul 

£ 


C* 


ui 


_i 

§ X 



X X I 
*- xl =t 
X X 
E2G 


I 

H x 




•xi jj 21 X 

x a 

□ □ • X) Cl 

^ MU - 


-<LL 
ix aJ 
U-Z 
■XuJ 


>co 

*-*r-- 
ix cr. 


UJO 

K- w 

X 


— □ LL CJ 


•i 

> h- x 

a. co 


six 
x •=• uj 
•X ■=■ o 

</) OJ OJ 


(/> </) 

■I •! 
Cm CO 


x o <r i 
c- > /> i 
x> to x* : 


I I CO 
w w r- 
Uj x- X 

CU 'XI □ 


W I rl r 
X -t •. 
'*u - V o •: 


a. aJ UJ l 

'I 1 LlI X L 

I 'X a. □ C 

o 


: x« x> X- x> •:•••': 


x ♦ x 

IX IX ^ 

: i uj ■ ix co 

j *r u. w j j . 

* Ul CO *t 

CO 


:• X _i X' x> ld 

:■ 'X G8 G> IX 

J UJ LU LiJ □ 

IX 


• a. uJ •! ix 


■X t 
' *1 ■! 
] — ix 

: > •• to 


■ i/J IX' 

. uj • X 
IIW'I 

• — IX I 

•! O 

• O 

. a 


: i x c 
< *- i- uj •: 
x I 

J □ X UJ ' 


■I 'I a _j 


•- -X -I > t- 

h- 1 - i- x •••:■ 

I X CO Z' 

a □ 

LL X 1=1 H -X 

U. I I- UJ 

□ uj h I r 

LL Ji-MO 


-• </> > 'I _J 
1 □ UJ —■ uJ J 

« x > a. •! 


' -i .=1 

1 1 - _j 
i x . 


J X> X '!> A A A 


□ UJ i 

i— </> l. 

□ " ' 


II 

LL P H 
•X* -< L 


:• -x x ix .r i=i 


X' X 
□ □ 
ix ix 


'I Cl ll h I j •; 

ll r j x x x x h i- i i 

□ “) M ”1 H "l £t IJ . 


: J 3 J CO o . 


■ ix a 

. _j </> a 

; •! x cl x 

z -I 

IX ixi 

UJ XI 

. h- z •- 

□ X' X' LL 

• □ CL LL LL Q 


•I □ X 

IXI l£r f— 

■» CO CO 


J M □ 

Z X z 

w w .. 


X' UJ Tf 
H CL 'I • 

uj o ll : 

i— (s) : 


Z U. C'J -t I U. X 


• 'I 

: 'X* Cl 

j x 


« CO OJ *t •=■ u. 

:• o o o ix ixi 

:• o o O rf rt 


IXI LL 'I U. OJ 


'T. .J. . 7 . ,7 17 . 
’t rf rf rf 


•I 'I 

’t 

r. ir« 


-1 r - .1 Mi 1 


1—1 Ll f - -t Q £ 

1=1 '=' 01' •=■ '£' a L 

OJ UJ OJ CO CO LU 0 

'_' '-'J '-'J 1=1 '. 


t_. u. "j £' r-- OC' co 1=1 '=■ oj it.' r - 

L"J M M M M M k-l M 111 UJ 111 UJ 
■7 >7 >7' '7 -7 >7- '?■ '7- -7 '7 i7 >7 17 . 


'I Cm (J 
UJ UJ UJ 
•7 <7 - '7 . 
’t rt 


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


Page 29 


315 











•—i X I > uJ ul a. a. 

□ □ I J j. CL IX X • 

LL LL J 11 □ ij I- U ^ “ 1 

t- t- r- . > x . . > =' ^ , 

Z' uJ t- D I I *•*■ X 7J 

a. '£■ lL ul X uJ — 11 X i— i 

LL r J LL —' > I 

ll ii Z j G □ CU <£> X □ 
Lu ill □ I t— r- Z r- i 
X u. Z tO aJ — Cl , 

X X > > UL ►- X >••0 h- r lu i 

GDhhOZCQDni— UII 

w w i— H - 3 — • a. i. i 

•• •» •* •» •' LL LU * X 'I — < 

LL I Cl LU I- 


X LU 
Z ii I CO 

lu x -x •: 

*— I uJ 

i— _i ll 
>■ X LL LU I 

:< > Li z 


LL * Zl— 

1 - -I to x *— • 

lu I uj □ □ lu • ■ ■: 

• £• O > Z a. I I c 


uj 

C-> i/\ ll Z LL 

LU — -« X 

</f I 1=1 X 

Cl '_' f— □ I 

LU 0J OJ — — OJ XXX ' 

►— h- X H LU 

Z t- h- Z X X 


j i=i to to to to to a h- a x : 

. Z Cl W M Cl M IJ U □ I- 1=1 . 

X Z X 

X h- 'll o 
(-0 X Z' U) Z h 

•i' i- ji a h- 

X III ■£' to □ X □ _J X 

J X X J J X □ Z X LO ID X 

X X X' X X X X H- 


: x n — _j x x x _i _i — _j x ►— — > x _i x x x 

: >_• z x i x h- t- i x x i z — x □ x w x z z z x 

• X -> _l to X to . I _J I I _J to li) "I UJ UJ J X □ ■ U M -I Z C 

X 


ax x 

z □ □ 

Z X X 

XX X 

.. UJ LU 


X X 

_ ’f t 

Q X N X 

8 ~v X U‘ OJ >?• 


ij. ft W o H rf If' I- O' X X 

f r - r- a< X' oj X- o:« x< x co 

X X X X X X X X X X X 

rt rf »f rf rf rf rf rf rf rf rf 


LU LU 1- LU 

O ij X 

CO H H UJ I UJ I^J CO I 

X oj — •=• — X (J oj . 

w uj i’ 't r - oj x i 

iYi O'* O' o. O' O. |7-, |7. I 

X X X X X X X X I 

rtrf*ff»frt*frf 


x x o x x x a - o ® 

•t «t OJ *t *t ■=■ rf rf o CO 

•i' X t-< *7' X If' X X U"| 

' J> •=■ If' X' X' OJ X' X OJ •=• 

1=1 OJ — OJ X OJ Oj x oj — OJ X 0*1 

»-* •=• <_i OJ oj il CO CO OJ OJ CO OJ X CJ 

X X »-« rf I'- X' X X — rf P- X X 

O' O' X X X X X X X X X X X X 

X X X X X X X X X X X X X X 

’trfrfrfrf'frfrfrfrfrfrfrfrf 


17' o .7 ' U* X 
f •- CU’t a- X' 
x x ■•_' x <_« a« co x« *7 . 

rf «t •=• *r X' co u"i r . x> • 

IT* OJ rf OJ Ll 07 ■ 

LU CU u • £> CO rf '*u h- I 

M H UJ N <1 Q 07 07 •=• •=• CU 07 OJ I 

X CU IX X I_j |*U O Sfl CU *t t r - • 

LU Ll CU X' rf f - XX LU CU X' X LU ' 
X X '_' '_' O O O X 1=1 X L-i I 

X X X X X X X X X X X X X ' 

rfrfrfrfrfrfrfrf rf rf rf rf rf • 


^ © Cd .=' rf © |J, 

X' OJ x OJ N ITJ rf 

'*0 rf U- x © CO CO O 

X' N X' I'- OJ IS- if' o 

■=• oj x in x cr. — — 

oj cu x r - x x ’t i*u 

'7' UJ 00 o 00 «7J 07 

rt x x cu r- x t 

IT' a- X »-< If' X- X *-i 

LU LU LU Ll Ll Ll Ll •=• 

X X X X X X X X 

't’tTfrfrfrrrtrf 


- a ll 

a 

r > x 


X x _i _i — 

cl x _i «- a 3 

I- X X Z f- r- r 
G ft u ii Z • 


. i uj m i i i uj i; 

■ i it J j 2 Cl ' • l 
i —' OX ul O Z' i 

X UJ f iL h 

' 0 »— to to lG to ►— . 

.XJLUXUir-UlUJ. 

< *-• lu x i- > to ll _i •: 


I-* *Z* uJ to 

ZZ Jr 
-< □ x X z> 

Z O Cl O aJ 

i— » CL 

x r- □ X I 
X —' x Z 1 X uJ 

UJ'Im X 

D uj i j xx a 

XI »t— 

*- a z I- I to 

X I— □ UJ ■=• x 

X' tO Z tO rfr x 


J • z z to 

J X X • 

: □ I c 

» X 3 »- Z 

:« n X 

xxx z 

J it J ' J X □ 

: □ a x x x 

■ x xx 

to h- x x x 

: x x x z x 

] x to x x x 


•- *T |£| Zi » 
t- X X H- X 
» X X X ' ll 
i i • i a to — 


*- *— X 

X' — 'Zi H UJ X J 

X X X X X Z X 

x X Ll X X X 

X □ X XntfiH 1.0 x 


*- CL to x X CL N Mil li X 
'JDjHigMuZt.QE rj I 5 ► 

J X u. u. LJ X Z X X “• z X '_' “!• to X l 


XI XX 

to to — XXX 
? x im 

* X X X • ' I ■ .X I 


_ X x z 

•—< »—< h- X xxx 

U. It M J J M (: a. i X x i :> X x a. xx 

p o X I _|I Z X X I— z X X t- Z X X 

LL x X t-.i to Z □ I x to X tO ~f X O Q 

UJ UJ (J 


i X X 
XXI h- 
] □ X I- - UJ 
> £L X X UJ CL 


to a. ll z x 

— *t CU LU □ 

X <x o to X 

•►XX 


LU 'Ll —• U‘| CO i. 

u. r - xxx' 


: x x x -r X x i x 


X OJ o 
•=• t •=• rt 
' -V X X X 

i - x x 
>;u cu x • £■ ■=• . 


X X X x 

’t t rj- rt 

x in r - r -- — cu 

•=• co ixi cu •=• r . 

I *-« cu CU X co CO 

1 X CU OJ 0J 07 1=1 


) i7- i_i x OJ •£> 07 '7- '_' X *7J rf >.£/ it. i 

V 'v! % t t t ** * *»■ u*. uo ijo i 

: '5 i 2 2 2 ' r ,r 'I * 'I 'I 'I X X ' 


oo 

— X 07 X i7 - 
X 0J X X O 

cu o:* •.£■ i - co 
r - r ■ r-. r. r-. 
X X X X X 
rt rf rf »f Tf 


Page 30 


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


Number 27 








Fast Cassette Interface 
for the 6502 


BY CARL MOSER 

3239 Linda Drive 
Winston-Salem, NC 27106 

The February 1977 issue of Byte (page 82) contained an 
interesting article on a minimum hardware cassette interface. I 
have used this technique to develop a cassette I/O to record 
and load on tape at over 1600 baud. Because I don’t unpack 
bytes for recording, the effective data rate is over 160 bytes/ 
second. The accompanying software listing for 6502 systems 
provides a record start sequence which requires at least ten 16 
bytes followed with an OE byte to be inputted in sucession be¬ 
fore loading can commence. At the end of loading, two byte 
checksum is used to detect errors. The hardware consists of a 
direct connection from a one-bit output port to the micro¬ 
phone input and a non-inverting hysterisis circuit incorporat¬ 
ing an LM339 comparator as the playback electronics. Actual¬ 
ly, I’ve used a direct connection for the playback with success 
but some cassette decks won’t work unless the comparator is 
used. My General Electric and two Sanyo tape decks work 
very well without the comparator but the Realistic deck won’t 
operate at all without the comparator. 

An interesting note is that some tape decks put the signal 
on the barrel of the record and play jacks instead of on the in¬ 
ner tip. I’ve found that in my Realistic deck, the earphone out¬ 
put signal is on the barrel and the record input in on the inner 
tip. With both the record and play leads inserted, this creates 
an effective short. 

To use this software, enter data in memory locations 0180- 
0184 as follows: 

0180 = LOAD/NO 
0181 -0182 = Start Address 
0183-0184 = End Address 

The record routine will record from Start Address to End Ad¬ 
dress. LOAD/NO has no meaning to the record software. 

The load routine will load from Start Address to End Ad¬ 
dress but store data in memory only if LOAD/NO does not 
equal zero. When equal 00, LOAD/NO can be used for verify¬ 
ing and conditionally selecting modules on tape. 

The load and record routines have callable entry points at 
C/WRITE (3E00) and C/READ (3EA5), and non-caUable en¬ 
try points at LOAD.ENTRY (3F41) and RECORD.ENT 
(3F52). If C/READ is called, the Z-bit of the PSR will be true 
on return if no error was detected and false if errors occurred. 
If execution is at the non-callable entry LOAD.ENTRY, a 
break (via a BRK instruction) will be executed at end of load¬ 
ing and register A will indicate if the data was loaded correct¬ 
ly: R(A)=00 for good load, and EE for error. 

To sum up, this has been a very reliable scheme and works 
error-free with the cheapest tapes (even Concert tapes which 
can be bought at many department stores at 3 for $ 1.00). 


♦sv 



Cassette z/o /Vardujare. 


« O 
C_> N 



O 


o rs 
or co 



ir 

• o 

o <1 «J 
uj uj — 
a o' > 

^ n x 
o o 

O — CO UJ 

s *— o 
— o •— 

UJ — UJ 

uj cr cr ►— 

►— o UJ 
uj .. to 

CO ►— UJ CO 

to cr ►— o 
•a o ►— o 
o a uj 

to o 
to *— 
5 . *“ <1 7 
• I « o — 
II UJ u* 

a ice ► 



a. uj uj uj o 

►— o o •— UJ 

r: • • — or 

o cr — 

v. s o 

0.0 0 
Z M UJ 

— cr or zr 
o o *— Z' 
ii a a — o 

II WHO 

•» o o — — 


o 

o 


tv o ^ cr ir «c 

o o o o o o 

V ♦*- U_ V 


<3 UJ Z - >— <3 

— > ►- => ^ a. 

an >- o o o 

<3 to x o o *— z 

» x ►— * + o w 3 s i— 

o z J a • rr cl o cr 

II UJ 3 O- Z •- O Z« 7 <lO 

II I O O >- — O — O »— Z 

••OOU-tOTC<r •• •• _l to UJ 


iSKiSR.issR5iS(S'Se;f;sp:isis.&sii.siS(sss 
•-Mfneiir. (f^ao - so(\jn^musor<T'S r_ (\jcnTiin 
«—«— *-«—*— ojojcsjrsjfvcu 

f 5 ®S(SKK(S(SSISISIS<S)ISeJISISiSIS 3 S®ISIS®S 


Number 27 


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


Page 31 

317 








_j o cr 

iu a o 

O O Q. C 
O \ l 


<3 <J <J 


1X0" <TO«J<3 x y iD 1/1 
T O rr ►— _j I <j co o ^ ui 7 *— 

a. —iocoo-O-i——d i <1 i/ia i- d i Q- 


v ♦ 

to ♦ CO 


to — tn in ts 7 in z 

o: s ir ir (f uj cr uj 

QO-OO-f^sO V. 

O — OQO>— 00>— 
«TX'<l<J70'«370 
♦ CO* * UJ 7 * U. 7 

uuju<iao«aoui/i 
7770X^00X0 Ui ►— « 
— x — _jO(T_jo<rcoa: 


o o 
is o o 

IT O UJ 


tsts.ssis.isK. ssssensssisis es 

co<ris«-cvjw<iri(frv(roiis»-(\jn^irtc(>. 
or® cncrcrCT'crcTfTCTcrrT s ss. s 5 ms <s 

®®ISISS5i®ISI^ISS(Sr-«-r-^^^r-^ 


IS.KIS^I&KCt.KISIRrCSKiSiSS.ITlSK-S'SStSKlStS.PisisiS.ISIRlS'SSIS^^'E^IS.S^'rtRIS'SIC; 
oc cr ps »* tj it t£ r- or ® s «— (v, co ^3 iru.'^cc<T l «Sf-c\jn« mu ^a'eis,r(v/o*tfltC'*-rrt' <- m m « in 
•S ^ 1 * *“ * r ~~ r ~~ * ^ c\j <\j cvj i\j t\j <\j cvj fv cc c\j ro ro co 00 co m ro co n r > co tj ^ q ^ ^ m in in to 10 in 


UJ UJ UJ UJ UJ 

tc ic co m ic 

is.T»es> a is 1 R o 

s is. is S R lx. S u 

CT-Ocroccocc S D (T- Qcr <1 <• «S is 

tj <iis(rt£^«3(\j<(\j(ri£< o o t c 


<s 

ro u 
tvj K: 
o O 


*- tc cvj r» 

<r o cr o 
o in o in is 
« op < or tr 


if N n r>- t or u no »— 
usuucrsuocs 

U rsu iTOSiPOISaS 
U)Oiii<iu(r<U(Toic 


'TS tr 'JL 
SOU.' 
<\J CC •s 

«s or M 


u is ro m an cr «3 cc uj *— co tr r>» ar cr cr 
in ic if it tr ififiicifsNNN r»«.rxfs. 
UJUIUJUJUJUJUJUJUJUJUJUJUJ uj uj uj 
rororororororororororororo ro ro m 


IS. (Vj 

or at 

UJ UJ 

ro ro 


t MTOUJ 
an ar or or on 
U< UJ UJ UJ UJ 
ro ro ro ro ro 


ul o nin n « o uj >" 'p * 
occTcrcra'cr cr rr <j «i <3 
U 1 U 1 ui UJ UJ UI UJ UJ UJ UJ UJ 
ro ro ro ro ro ro ro ro ro ro ro 


m r- rr 
«j <1 <1 

UJ U' UJ 


— *— X 

ar x o 

* UJ CO 


•a O Olfl 

*— •— ►— UJ 

nr tx »si 
o o o — 

►— Q- sj a. _j 


X o 

— UJ 

»— o *— 

7 X 
<v x cr 

ro *— m 
7 UJ 


7 7 X 

O O CO 

o o o _» 
o cr o uj 
* ui •* o 
o N U V O 
7 •• 7 Q. 7 
X H- X O X 
•— 00 — CO o m 
** ♦ O * _l 

or 

< <1 rr u uj o 
Q o l/l UJ ? U. 

_j co —j o cr 


co co 
r x 
o o 

UJ UJ 
X X 

o o 

* ♦ 


x x a. •— 
• <r j « 

CO \ o O 
cr uj u v 


3UI3XX 
to > co cr o x 

x «i x n ►— 

O to O UJ — o 

UJ Ul>- I I 


o 


o cr 


co 


<1 <3 <j ar <y — 
o x o co _j cr 
_j cl _i ~5 a. * 


I CO CO ►— UJ *— 

o *— 7 ►— X 7 a. 

o — ox*— ac o o o 

oujccocc-uj* cr o o • 
♦ 7 0*CC70UJ0_J. 

x o or • x • o 7 cvj • ^ ( 

o •• ►— cr o •• uj <1 

1 co x or - o cr *— * *— — ►—( 

.5C3ISCrilUJD!tDir<li 
O O ** # ♦ N O U O * O I 

crcr<T<j_jc_>crorrc_3Uj 
■cocoo*—coocoujtnui7 • 

' ") ■) _j co « i o rr o o r. 


k 5 «s is IS 

if v or cr s 

(V (V, c\j c\i ro 

IS S 5; IS IS 


MSSISSRISISRRRISE'SSISISe: 
oMn-oirifsa O'S'-MrowiotfKcr 
ro ro ro ro ro ro ro no ro 

SlSRlSISiSISISlS'S'SIS&iSRiSiSIS 


is R s r is Ki-KssK)ira'sr-(v,si—(1 JS IS(S S ( SS( - 5 | SS | SK|ISS55SSKS5;SS 
^ ^ *“ cv ro ir cc o-o-arcTiS)'—nocsjcorororo^jinif NccO'<T®»-MrO'o tcNcrs'-mro^inirN 

”' ”~ SJSSISISSCSSSSSRSlSSISSSRSSSSS 


is S 5 R T is R R I 


; 5 IS R RR S S R R Rl R I 


R IS R 

o cr o 
« is or 


5 If tf •“ R S Q S O' 


(\j O 
O' if O 5 


<1 ar cv o o 


UJ UJ 
ro ro 

s cvj ro cc r- u. tn 

<s o o u ua u. 

(Vj If tr s R R 

«j ar ar <1 cvj cvj cr 


o 0^3 
in cr if r on 

<1 TJ «J (S l£ 


iucnn«ifuroQifis 
> RuuRp-smuu. 
IRirirXRRRRtfR 
J(VJ< 0 )S(TMU.MOO 


a < u uj 
S R R R 
UJ UJ UJ UJ 


no in 
cvj ro 

UJ UJ 


UJ ®ro I C 
cm ro no ro 

UJ UJ UJ UJ 
ro ro ro ro 


CP< CC OR 
no ro ro ro 4 
UJ UJ uj uj ui 
ro ro ro ro ro 


«— roxO’IQli.f-ttfOfl 
■*i'<»'ff'«j*jT»^Jininininir 

LU XI 111 UI 111 III It! III HI III III II. 

rorororororororororororo 


Page 32 

318 


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


Number 27 










e. 


' ti st co x x 

II «I « T II (*) f" 

"> <r O UJ T UJ © II || 

i n <i m iuuj ♦ «so 

5 UJ \ II fO IT 4 Q U . 1 

C O- *_ O II II O « V 

J II (/• 7 «— 7 X cr * X 

•lOiluNtr + lHSm 

• im\art-c;3 ii 

- c. >•— — --Ol/'O 

soooxx^traco 

^ _J 2 ? U) ir * x u i 


rr. o O rr «a x 

+ O 4— + + + 

2 • •* s >: > 

or ►— *— tt *r 

o — — o •/> o 

n ir <"a. < u. 

« « 3* « O « 

o _j (_> uj <x r « w 

_J O x 7 O vO O — 

O IT O T J T J i 


n. or 

V. s 

UJ o *• 

X 

<1 <1 a i/i 

4- 0 7 4- 

_J ■» X 


♦ ♦ ♦ ♦ 

3 : r 2-2 

rr o rr => 

(✓> cr tr tr 

t y x y 

a c o <_? 

u.i ui uj uj 

T X «S T T 

O O T. O O 

« • » « • 

OOO « «J C3 <» to 

_j _j o *- o o »— — 

o o <j cr_/ <3 co ur 


r uj c x i i a. cuj a- x a a. a 

w 7 O IT 002 07 IT CT O © 2 

“3 x 7 7 


is. «- cr 

■o<y a cr o x r~ i/' 

'f IT UJ <■ li’ 111 r— u. 

U 1 uj co cr uj co co x x co 

co po ii lu co ii ii ro cv || 

II II >- CO || UJ «— II X 2 

X >- o ii o or + *~ co cn 

on j o « o o- * ii a. 

O* UJ 7 C •- O (/> ►- <4 

_j o cf O — i i/i u. ui j or u. 

\ 7 •'^'v'V -4 UJOtJO 

«ujujninai-uau. + 
►— * roc — o — — o \ n o 
ii uj x o x <j or 7 ii 7 

n u y a ui __ i/i ■» n — nr uj 


CS KR'S'S'-(Mi!ns,<riS(^-j;Kis*-fVjcn»JU)|£^(r(TK'“(Vnn4lS'SS?K'»'(«;iSSSK'rE-S! , ;»p:SKS 

cc ^-or'T , sss'“(vj'»-nuiu'i'crcrcr(r(r(ra''r crcr('(T'rfTiT\i— (V' r '«LPu'^o - r’' •- <v ^ ip ^ i— 

*— '-■-'-fMM(\j(\j(Vj(\J(\JfVjCoOJ(\|MM(V('.OJfVi<Vj(\f\){'j(\(V(\J^cr rr r r, f rc"rrr'Crcr, 4 ) « 4) vt « 

ru rocvjC'j(\i<>jruc»i<Njt\jrsjcvtvjoJCvj<\jfvj<Njf\jcvjcvjfVi<\JC\jtNjcv<\j<\j«\j(\jcvjcocvj«vjfvjc\jc\j<\JCv,tvj<vjrvjc\j<vicvjOsicv<\j 


xf j~ sr ** 

O O UJ O -c- O 

or x i ix uj ’S jt r. 

*- rv O O «» cvj <i x 


u 5 (V| « It nr a. a 

«- (V (\i cvj cvj x; <vj cv. 

u X X X X X X X 

CO CO co CO CO CO CO co 


rv. cv © co co 
O OPOO 
j or 10 u“ <r t uj s 
■Oif or o tr or if 


cr w or «s o UJ is. 

-o CO CO CO CO CO ro Tj 

x x u u u u u u. 
co 00 co co ro co co co 


in t s •— u 1 tr os 

< t U 1 X R 

rR(ris«!«U.'an; cc «R «s «s 

M O « S IJ Uj w <3 0 (VI K UJ U 1 


c- « « or <r « t uj s 
U.ILU.U.U.U.UU.U. 

co ro ro co co (o <0 c»i ro 


1 tr cj or r*«, uj ( 

1 UJ n- UJ UJ U co 

j co u. uj co <3 uj 11 ; 

11 ur co 1 , uj co ui ( 

•— UJ II CL CO H ►— 

— co uj 2 11 o - v < 

(C II 7 O O i£ T > 

• UJOUc \ \ ■ 
0 4-.. sum o ► 
ar — t—ocroo- 
uja r 7 \ o uj- 
t 'vj * o — t_J _j cr : 


O 2 UJ CO CO * 

• 4— _) *— O or o -r jr ( 

. 7 S 7 « <J OO 

. rr> a. — uj uj uj uj t 

•00 c <3 cr u a: »s t x : 

-00 U S N S \ S U O ( 

i « _i • * o * o ** « * : 


o uj ♦ co uj 

uj rr ^ 2 x 2 x uj 

►— o x a. riuru*- 
»- O • 2 <X CC> co >- 

x 7uii/'OicxuJxuj'r 
\\\tru\u>o>\ 
a o a. o \ a uj *i uj «i o 
<3 «3 — OOOXCOXCO<I 
uj o <i 7 o o o uj 


U* *— O 4—0 O »— © XI *— v/“ 4 — CO * 

o rr x rrx o rr •— o or to rr co uj 

• o * o ■* • o •* • o ui o uj *— 

0 Q. 4 — 0 — >— a.4—oa.cjo.0 <j 

^ n - v — rr — \ s c \ o •— 

UJ 7 c 7 c CS X 7 « UJ7 T 7 QT © 

*y — it — * «• « — ■» rr — d. — a. tr 


a ui u uj v >- o a uj 

7 7 Z 7 00.027 

O IT — X _J O T O ac 


O •— 4- to 
_l CO CO —1 


>o- ►c<iro««'<«Mrfl'iuj'r«jfi(/) 

.-COOUJI— toooxoi co _j 2 7 to _J 2 4 - 
<5 3 _J I CO -)T_jQ._ia.~5Q.OT -30.00- 


« <J (O I 

_J Q 4— 1 

a. _j cr »ni 


or rr c- rr uj 

co to UJ '0 7 

-3 -3 x “J t 


cr c ct o © cr uj o to 
CO UJ CO CO UJ CO 7 UJ o 
"3 mcr t to t 


IS5SKSSSSRISS ® R •“ R R S IS. 

or or CT'iSi' - (Xjco^Tiocr r^-ar nr IT s r- oj 

if u' if if it if if tr if tc tr if if ic if 4- r» n- 


R , "RKSIV®'SR I SIS' _ (VIRRISRS • _ (V 1 ' r 5jRf(\JCJISRl^SSRS'S l SISSISRRiS'S'lS , SS , Sir , S Rts-R® iS’S’S'*: 
or nr rr s «— cvj rf'oific^-’^r-cciTR' rvi(\.'(V(\i(\j' r 'rfrfrc»jirtC'^x i TS'— (VjrfTjifitct^crCT'iS: <— Mm^ififp^cftT' r—cviCOyj 
ifici£^r.N4>4-N.f.4.r«.N4.Nor®ii ixacrccorir‘r(r(rcrirarccir'J’'3''T9'<y'(riTa'ff'(j'iS‘S®isisissis(sisr-i-'-r- 
*“ *" •“ •“ T-^ *— w— 1- r- r- *— •— r- f— ^^^^r-^^-^*-(^(\;r>J<\J(Vjt\jrVjC\jCNJ<VJ<\J<\jCM<M 


T SI X If tCOTU-O- R N (*l 4j 

»— © o u. o ® uj >s uj s uo ir 

(Teste's- -9 s s cr ® s 9 9 s 

OOUJQ <1 O cn O O « ff or (vj 


•X ■S Cu 'X U *“ T- f\, |J_ 9 Mt r* X 

u> or !S o or x o o x< o es u< o u_ 

sois<-KRif(ririsorir 5 is t it s or rr r 

(M*rU.«(VJ(r< 9 <J 9 (VI X O D CM if O -X LC <3 tc 


xx oc ~r 

cv j x e>. o 

e: >s cr uo 

<vj o < or. 


x rr. s- x on x X *— 

cvj x cr ro es (V, X cs 

•se; rr r ©<s.oc«s. 
cv. X (Vi (\j x CVJ O co cc 


O IJJ tSi (NJ ^ (C or *1 o U' R I\ 9 

•O <1 T T XXXXX XOOO 

lil Itl III 11 J 11 J 11 i 11 i 11 i 111 ui lii iii hi 

CO CO CO CO CO CO CO CO CO cocococo 


v « Q X s| tcor<rxox<s Cv. SJ c-<r<ixox 
OOOOQOQQQOQQXXXi X X X X X' X 
XXXXXXXXXXXXXXX XX'XXX'X 
cococococococoromcorocorococo co co co co co co 


XX XX 
XX XX 
CO CO CO CO 


•— x a. 

■s © © es 

xx xx 

CO CO CO CO 


<3 o x (Vi in r» c_J o 

©©©i-r- r-*-r-r- 

X X X X X XXX X 

co co co co ro co ro ro co 


Number 27 


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


Page 33 







A BASIC Renumbering Program 


BY JOHN B. TRENHOLME 

120 Montair Ct. 

Danville, CA 94526 
(415) 820-0909 

This program renumbers Microsoft BASIC programs. It has 
been designed to have all its routines self-contained so that it 
doesn’t depend on the BASIC interpreter for subroutines. This 
makes it larger than it might be, but also means it will work 
with a variety of interpreters rather than just one. The specific 
version presented is for 3.1 8K cassette BASIC, but simple 
changes (below) will adapt it to other versions. 

The program allows you to renumber starting from a line 
number in the middle of the program, rather than just from 
the beginning. This is so you can identify logical blocks of pro¬ 
gram statements by giving them line numbers starting with (for 
example) 1000, 2000, 3000, etc. Debugging is much easier 
when this is done, and other people can read the listing with¬ 
out getting hopelessly lost. 

Input to the program consists of three numbers in RAM: 

1. The increment to be used between lines (stored at 
0004H & 0005 H). 

2. The new line number of the first line to be renum¬ 
bered (stored at 0006H & 0007H). 

3. The old line number of the first line to be renumbered 
(stored at 0039H & 003AH = 57 10 & 58 10 ). 

These numbers are stored in low RAM postitions so that 
BASIC can POKE them to the desired values. The first two are 
in places that BASIC uses to store the addresses of internal 
routines for the user. These addresses are never used by 
BASIC. The third argument is stored in two NOP locations fol¬ 
lowing a RETurn in RST7. If interrupt is used via RST7, an¬ 
other location will have to be used. 

The renumbering program takes 512 bytes. The version pre¬ 
sented here is for use with a SOL, so it is assembled in the SOL 
scratch RAM starting at C900H. To put it elsewhere by hand, 
just change all the C9’s that are the third byte of 3-byte in¬ 
structions to 3E if you want the program to start at 3E00 (or 
whatever), and all the CA’s to 3F (or whatever). The first C9, 
for example, is at C90E. The program uses two bytes of RAM 
which are presently at C8FE and C8FF; so C8FE will have 
to be changed to somewhere else. Except for these two bytes, 
the whole thing can be in ROM. 

The following short program will renumber BASIC from in¬ 
side itself. It is especially handy while writing a program, since 
you can quickly make space for more lines if you inadvertent¬ 
ly leave something out. When done, you can move the first line 
of the program up to 10000 or so and renumber the successive 
blocks to higher multiples of 1000 (then hitting RETURN dur¬ 
ing input and typing more numbers probably won’t clobber 
the program). Then just delete the lines containing the renum¬ 
bering stuff, and you’re set to go. 

1 INPUT “Increment between lines”; I 

2 J = INT(I/256): POKE 4,I-256*J: POKE 5,J 

3 INPUT “New number of first renumbered line”; I 


4 J = lNT(I/256): POKE 6,1-256*J: POKE 7,J 

5 INPUT “Old number of first line to renumber”; I 

6 J = INT(I/256): POKE 57,I-256*J: POKE 58,J 

7 POKE 73,0: POKE 74,201: J = USR(J) 

In the last line, 73 and 74 are the locations of the user-defined 
function, which depends on the version of BASIC being used. 
The 201 is the high byte of C900H in “split decimal” nota¬ 
tion, which is what BASIC uses when referring to memory lo¬ 
cations. Change 201 if you move the program. To reuse the 
same increment you used last time, type GOTO 3 instead of 
RUN. If you’ve added new lines between old ones and want to 
clean things up, just use GOTO 7. 

Be careful when using this program. No error checking is 
done to insure that you don’t renumber the program in non¬ 
ascending order, allow the line numbers to get larger than 
65535 so they will wrap around to 0, or otherwise screw 
things up. The author, from painful experience, always keeps a 
backup copy of the program before making changes. 

The one check that is made is for non-existent line num¬ 
bers. If the program finds GOTO 300 and there is no line 300, 
it makes up a line number which is one more than the line 
number that would follow the last line and puts that in in¬ 
stead. For example if the increment between lines is 10 and 
the last line number becomes 540 after renumbering, the 
GOTO 300 becomes GOTO 551. This is easily picked out 
when reading a listing, and avoids incorrect jumps if (as is of¬ 
ten the case) you start typing new lines in at 550. 

In Microsoft BASIC, the program is stored in RAM as a 
series of lines. Each line has a two-byte pointer at the begin¬ 
ning, which points to the next line. Then there are two bytes 
containing the line number in lo-hi binary form. Then the text 
of the line is written in ASCII, except that reserved words such 
as FOR, GOTO, SIN, etc. are replaced by one-byte “tokens” 
which have their high bit set to 1 (i.e., they are “negative”). 
In some versions, tokens may have more than one byte. The 
text of each line is ended by a 00 byte. The program as a 
whole is ended by a 0000 pointer, so the end has three 00 
bytes in a row (one for the line, two for the pointer). Because 
the pointers (which are used for fast searches in GOTO’s and 
GOSUB’s) are in absolute address form, the text can’t be 
moved unless the pointers are reset; it would be better to use 
one byte to specify the length of the line so the program 
would be relocatable and shorter. This would limit line length 
to 256 bytes, which should not be a problem. 

The program works by moving the program text as a whole 
up near the stack, which is presumably well above the end of 
the program (if not, memory is almost full and disaster may 
occur-you did keep a backup copy, didn’t you?). It then 
starts reading the text of the program, looking for GOTO, 
GOSUB, and THEN tokens (ELSE also in extended). When 
a token is found, it then looks for numbers after the token 
(leading blanks before the numbers are copied unchanged). 
When a number is found, it is converted to binary and a new 
number is created. Instead of making a table of old and new 
numbers, the program makes up the new number by using the 


Page 34 

320 


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


Number 27 




Old line numbers that are stored in the program text. It starts 
at the first line to be renumbered, and counts from the first 
new line number by the increment amount, stepping once for 
each line encountered. When the line with the old line number 
is found, it has the new line number. This new number is then 
converted to ASCII and inserted into the program text. The 
program looks for a comma after the line number; if one is 
found, it assumes there is a series of line numbers (as in ON K 
GOTO 10, 20, 30) and looks for another. 

As the search and conversion occur, the new text is moved 
back down in RAM, and the pointers are reset appropriately. 
The moving up and down is necessary because the length of 
the text may change as (for example) line 214 becomes line 
10160 (life would be much easier if the line numbers were pre¬ 
converted to binary before text storage). After all the numbers 
in the text are reset, the numbers at the beginnings of the lines 
are set to their new values. A jump is then made to a section of 
BASIC which resets the stack and zeroes out the variables 
(since the renumbering has very probably clobbered them). 
The stack is preset before the jump so that the RETurn from 
this BASIC routine is to location 0000, which causes BASIC to 
give its OK and wait for more input. 

The one word of RAM used is the storage for a pointer to 
the beginning of the first line of be renumbered during the 
text change phase, and for the new line number storage when 
the numbers at the front of the lines are being changed. The 
only tricky part is the updating of this pointer when the line it 
points to is moved back down in RAM. 

The method of using the lines themselves to make up new 
line numbers is slower than making up a table (see Steve 
Wozniak’s recent article in DDJ no. 23 on renumbering in an 
Apple), and in fact takes time proportional to the square of 
the number of lines to be renumbered. However, the program 
renumbers a 400 line program in about 7 seconds on a 2 MHz 
8080 system, so speed should not be a problem except in ex¬ 
ceptional cases. The space saved means larger programs can be 
renumbered, so the tradeoff between time and space goes to 
space in this case. 

Other versions of BASIC can be renumbered also, but a new 
version of the program will be needed for each one (sorry 
‘bout that). The things the program has to know are: 

1. TTie location of the stack base pointer STACK. This 
is set by BASIC’s initialization routine, after it knows 
how much memory it can use. Look in this section of 
the code to find where it is (or see the listing of NEW 
below). 

2. The location of the pointer TEXT to the beginning 
of the BASIC text. This usually follows STACK in RAM. 
The text usually begins at or near the beginning of the 
initialization code, so you can look for locations con¬ 
taining this address (plus or minus). 

3. The location of the pointer SCALR to the end of the 
BASIC text and the beginning of scalar variable storage. 
This usually follows TEXT in RAM. 

4. The location NEW2 of the entry to the routine for 
NEW which does everything except text removal. NEW 
will set SCALR to equal TEXT to delete text, then erase 
array variables and strings similarly, reset the stack, and 
RETurn. This program has to jump in after the text re¬ 
moval phase. See the appendix below for more about 
NEW. 

5. The tokens for GOTO, GOSUB, THEN, and (if ex¬ 
tended) ELSE. These are most easily found by writing a 


short program containing them and looking at the resul¬ 
ting text of the program (starting where TEXT points). 
In this version, ELSE is not used, but room has been left 
for testing it by testing twice for THEN (see after label 
NONUM). This makes hand patching easy. 

There are a number of useful subroutines buried in this pro¬ 
gram. Comparison of DE and HL is done by DEMHL. TSDIG 
checks to see if a byte represents a numeric character (0-9) in 
ASCII. ASCDE is a standard routine to convert an unsigned 
ASCII number between 0 and 65535 to binary (without error 
checking). And DEASC will convert an unsigned binary num¬ 
ber to ASCII in RAM in about 2000 machine cycles, with lead¬ 
ing zeroes suppressed (the heart of this routine is a modified 
version of one found in an article by Tabb and Roginsky in 
EDN for January 5, 1977, page 46). 

I hope you have a lot of fun using this routine, modifying 
it, and (hopefully) improving it. If you come up with some¬ 
thing nice (the needed addresses for other BASICs, faster or 
shorter code, etc.) drop a note to good ol’ Dr. Dobb’s so the 
rest of us can know about it. 

Appendix 

The NEW routine can be found by looking in the command 
address table for any specific version of Microsoft BASIC. In 
3.1 8K cassette, this starts at 0170H. The entries are in the 
same order as the literal table of commands, which contains 
the ASCII text of the commands, functions, etc. (the first or 
last character of each reserved word will have its high bit on); 
this starts at 0088H (3.1 8K cassette only!). Just count off 
two bytes per routine until you come to the entry for NEW, 
which will be the address in lo-hi order. Then look in that 
location for the routine. In 3.1 8K cassette, NEW starts at 
039DH and looks like this: 


NEW 

RNZ 


QUIT IF SOMETHING FOLLOWS 

NEWl 

LHLD 

TEXT 

GET POINTER TO TEXT AREA 


XR A 

A 

ZERO 


MOV 

M, A 

L0 POINTER =0 


I NX 

H 



MOV 

M, A 

HI POINTER =0 


I NX 

H 



SHLD 

SCALR 

SET TEXT TOP 

— 

---THIS 

IS WHERE 

WE COME IN- 

NEW2 

LHLD 

TEXT 

POINT TO TEXT 


DC X 

H 


NEW3 

SHLD 

NTEXT 

POINTER TO NEXT TEXT 


LHLD 

MEMTP 

TOP OF MEMORY 


SHLD 

STRNG 

ZERO OUT STRINGS 


CALL 

RESTR 

DO "RESTORE" 


LHLD 

SCALR 



SHLD 

ARRAY 

ZERO OUT SCALARS 


SHLD 

ENDVR 

ZERO OUT ARRAYS 

NEW4 

POP 

B 

RETURN ADDRESS 


LHLD 

STACK 



SP HL 


RESET STACK 


LX I 

H,SLOTS 

RESET TEMPORARIES 


SHLD 

SLOTP 



L X I 

H, 0 

RETURN ADDRESS =0 


PUSH 

H 



SHLD 

STEXT 

TEXT IF STOPPED 


LHLD 

NTEXT 

NEXT TEXT 


XRA 

A 



STA 

VARFL 

FLAG FOR FOR, DIM, FN 


PUSH 

B 

RESTORE RETURN ADDRESS 


RET 


ALL DONE 


Number 27 


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


Page 35 

321 





X 


o 


X 


c_ 


UJ <-* 
X O 
or. o_ 


01 
ix 


Uai <r j i : 

•* *“X * •* 

X X CJ UJ O . 


X X 
o X 


o 

ci 


o 


^ x x x <r ?- x x 


x — X H-« o 

e: e: o e: e: ci e_ x 2 

• * • < * ~X X O •-< 

XOXCL J <tX' U -X'XU.’xCiOOX^''CU lj: ~ 


UJ 

X 

Q O H o O 

r r o ^ h: 
X 


^ <t 
X 

* o 


>X <C 01 

£3Z7: LC *-H NJ : 


: «£ ui a. 

X ^ ^ 

I X <c o 


XnI>X>XX 
^ 2 CJ O 2 CJ CJ E. 
M -3 X F._ £“ X -1 


X 

<c 

I— 1 


X X Cl - J 

ci :> x 2> :> <x oixr>x 2 >xxcLOQ-C-oa-x 
XC^OOXJsjX^OZ'OX-CIC^'. Oi-h OU1 
x F- —. ? J O-j0.h-i?:.-hF_JoX-DX-301XX 


ff 


■X x 


* * * X 


e: x 


CJ X 2 o X UJ 
01 X > 01 LC 


01 5T. 

X 

* ■» x n 


o Xc 
X XU 


01 

i X 


in CD H- CO C7 S — CM tO ^ m U X CX C7, S —• CM tO -TinCJXCCj'. S— CMtO-^TinCJXCO J. S —« CM fO <3 lA CD CX 0'S- -(\j fO <3 A CJ X »’ <7> 

in itua irwn cjcjcDCDtDCDiDCDcDvjxxxxxxxxxxa cx'CCcccccx. cxcococx o c- cc o o o o (7 a k o fa f3 c ^ s r. cs> s • 

sss s Q S S r3CslOir3f.'OSI^r)n?llS!SC3Nl3!5firjSRnRQQr)iS*?RKK)S^)^NS'S''--------<--' 

S S S S S ®Q SRP5SRK s S S i51"IR^G l SQSr'' “ 


* * * 3- 

; — Cm io ■?: iT' <t) 




£7 

CJ 


£7. £7 

CJ CJ 


<7 

O 


Q (7 <7 CT 

SO o o 


J< 

O 


o 


to x 

M X 


Cl 

in 


(7. j- o s 

ro in in <r 


s 

<3 


O'- S Q 

■«T 

X rO 

<r 

r-1 

rO 

Nl 

X 


X 

to CM 

X 

to to CO 

01 to 




in 

Lxj tO 

CO 

C7. S 

c 

in to 

X 

to vc 

<i 

o — 


— to r- 

— <7. 




<3 S 

X 

in c 



_ 

n cl 

vj cj in 

in 

r- CM 

x o 

CM 

CM 

CM 

<t 


X 

CM O 

X 

CJ r- 

X CJ 




X 

^ CM 

<T 

r~ cq 

CJ 

CJ CM 

in 

cm in 

CM 

CJ x 

X CJ CJ to 

X CJ 



r~ 

O' o 


o CJ 



X 

X CJ 

m u? t— r- 

X 

(Ti <X 

X o o 

X 

S 

— 

CJ 

fO 

fO 

<T m 

a 

a cm 

o o 

s 

s 

s 

s 

— Cm tO 

<r in 


O- <l CSJ 

o Q 

X 

— -«T 

m 

X O' CJ 

Cl x 

X 

X X 

I*. 

S —< 

CO to 

in 

in in 

in 

vj r- 

CM CM CM CM 

X 

CM CM 

CO CM CM 

CM 

fO 

Kl 

fO 

to 

to 

fO tO 

iO 

to to to 

to to 

■*r 

<r 

<r 

<T 

■<T -5T 

<T 

■<5 <1 

<3 

<T 

<T 

■<T <3' 

*3- 

in in 

m 

in in in 

in m 

n 

in m 

m 

co m 

vj 

VO CO 

<o> 

CJ CJ 

CJ 

CJ CJ 

O' CT> CT> 

<T> 

(7> (7> 

0)0)0^ 

O 

<7. 

<7 

C7- 

C7 

a 

<7 O 

<7> 

ooa^ 

C7> 

c 

a. 

C7 

O 

O O'- 

C71 

O O' 

C7 

C C7 

O' 

<7 C7 . 

O < 

C7> CA 

O' 

O' C - O' 

C7 <7 

(7> 

C <7 

a 

O' O' 

(7 

<7 £7 

O' 

<7. o 

C7 

<7. O 

O CJ O CJ 

CJ 

O O 

CJ CJ CJ 

O 

O 

CJ 

CJ 

CJ 

o 

CJ) CJ 

O 

CJ CJ o 

CJ o 

CJ 

CJ 

CJ 

o 

O O 

O 

O CJ 

CJ 

CJ CJ 

CJ 

O CJ 

o 

CJ CJ 

CJ 

CJ CJ CJ 

CJ CJ 

CJ 

CJ CJ 

CJ 

CJ CJ 

O 

CJ CJ 

CJ 

CJ o 

CJ 

CJ o 



* * 
* 01 

* e: 

* <x 

* X 

* O 

* O 

* X 

* X 

* 

* o 

* >—l 

* 05 

* <X 

* X 

* 

* X 

* X 

* o 

* UJ 

* o 

* X 

* o 


* * 

* * 

■# X • 

* X 2 


* 

* 

* 

* 

* 

* o 

* -3 

* 

* X 

* x 


O 01 * 
> 2 X ■* 
: <i * 

: -J x * 
J -JO * 
: <c —< * 

* j> # 
x * 
r oo * 
: x 2 


£7 ■ 


* F- 


1 <£ X # 
- X 01 * 
O X * 
i * I— * 

* n: 2 X * 

* CJ O <£ * 

* X * ft *-H »-H * 

-# X * X 01 O * 

* X # >- 01 X * 

* e; * x 

' * o 

* o 

i * 

* <vo 


* 

* 2 
■# X • 
* X ■ 


* * * * 


X 

01 


* 
M * 

o * 

X >- * 
X Oj * 


e. e: * 

X ^ * 
X o * 
X o * 
* 

* * * 


0J 

+ 00 

X X + X 
-UH 7 
^ <i. X C 
CJ I— x «o 

S C/1 X S 


X 

01 

X 

X 


X 2 
X x — X 
K' g < X 
CCK Sh 


X D D D OX3XXJ 
CJ (J Gl C? 0 C3 U u 
X X X X c/1 X X X X 


X 


X 


CO 


OXXCMOOX2X 

< x <r :-t h h ui u o 1 

I— X o x o o x x 

O t- 01 ^ * C OH X 


X 

X 

E- 


CJ 0. 
O X 


o 

X 2 


3 

o 


X 

e: 


x -*r 
o o 


oi 

o >- 

X X 

o <r 
Uj x 
o 
x x 
o e: 
x x 


x 

X 


X 

<0 

e: 


Q 

2. 

X 


y £ 


o 

X 


o 

X 


D3 

xxx 

X 


X 




CO 


X XX 

7T 

CJ 


<7' 

X 


CJ 

X 

Cl 

X to 


X XX 


s 


tO 

DC 


<c 

S X 

XT 

o 

1 

X X 

<E E EX 

X 

O X 

s 

o 


X 

• X 

►—1 

X 

» 

CL - » 

CJ •> X J> 

2. 

s 

-s- 

s 

s 

s 

X c/1 

XXX 

X x Q 

• 

X 

Ul o X 

C/l0lX<a:QFg 







Cl 



o 




X 


X 




o 



X 










CJ 







X 


X 




a x 

X Cl 

X X 

X 



Cl XXX 

X 

X 

X 

X 

CJ 


xxx 

►-H Ul X 

01 X X 

CJ X 

s— t 

O J> > 

XXXXXKil/1 

<i 

CJ 

<t 

CJ 

X 

3 

o x X 

X X>X 

X <c o 

2S X 

X 

<go 

ICJOQXn^D 

1—* 

X 

X 

X 

o 

X 

x oi 

X 0_I 

X CJ X 

X X 

X 

O ^ E- 

XCldEToiOIX 

X 


X 




X 













X 



X 




3 


X 



X 

<r r 



> 



X 

X 

—• 

X 

—■* 


X 

X X 



o 



X 

•«- 

3 

O Cl 


t—l 

Ul ^ 



e: 



X 


X 


X 


O 

X 






> 

* 

2 


o 

* 

X 

* X 



* 



IZ 


—• cm to -«t incor^ cc cr, s —• cm *o <r in ^ h K 1 (?i s —- cm k> -^r in cj x do q — cm ki in ^h cg c7 s — cm to ^ in 'C h do C7 s — cm to ^ 

rjMQRQfisiOK — — — — — — — — — — cvjCMC0C\)(XCvJCM(\iC^(MfO'O'OfOfOfO'OK)rOro < 7' < T < T<r<ro'<T<r<r- | 7ininininin 
SddRrniQnsriSSUSNQQilQSS'lS'^Sl'lSQPvSlSQQNSQSQSQSIQSSSlS'SlSQISSQ 

GfirjilC5J3P?OOSOQQRClSSKKilRGKlCSnQGlSJOlSS(5r5(Sf5!lGSfOKKir\!PilSRP5K)KlKlRr3POr2 


CM s co cr. 

S S S (J 


X 

X 


CO 

s 


<7. <7> 
O O 


o 

s 

s 

ts 


OSS 

s s s 
s s s 
css 


s s o 

OSS 

s s o 
s s o 


s s s 
SOS 

s s s 
s s s 


s s s s s 

S S O Q S 
S S Q S S 

o o s s o 















s 




s 


to 


S 



s 




in 





X 
















s 




s 


<T 


■sT 



X 




<T 





in 
















s 


c 

O' 

— 

m 

<t 

in 

Q 

_ 

S 

— 

£7 

Q 

■q- 

c 

00 

CD 

X 

00 

Q 

CM 

m 














s 


CM 

X 

CM 

X 

CM 

X 

CJ 

Q 

X 

CM 

tO 

■»T 


CM 

s 

CM 

X 

s 

CJ 

CJ 

CJ 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

X 

s 

s 

to 


X 

X 

X 

CJ 

X 

s — — 

•«r 

in 

CJ 

X 


CO 

CJ 

Q 

X 


<3- 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

X 

s 

s 

s 

s 

s 

S 

s 

s 

S 

—. _ 

- _ 

_ 


_ 

—• 




CM 

CM 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

s 

X 

£7 

O' 

£7 

£7 

£7 

O' 

<7 

£7 

£7 

O' O' O' 

£7 

O' 

£7 

£7 

C7 

£7 

£7 

£7 

O' 

£7 

£7 






K 



s 

s 

s 

s 

s 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ 

CJ O CJ 

CJ 

CJ 

O 

CJ 

o 

CJ 

CJ 

o 

CJ 

CJ 

CJ 


322 


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


Number 27 




UJ 

2 


cm m — 

X X X X 


x-sr. o 

' -J U W 

3 CD <£ _J X 

; UJ CUJ • ► 

I ^ X Q O CD : 

cd 


UJ Ci • <X is 

- - C5-- 

:_JXXXQX* WQD 


El“ CD « 
UJ - O I 

CJ X X <C • *-1 < 


— X — 

O El 3 

-J UJ UJ 

O Q •i' 


HEO 

o •• • 

x x o <x x 


—> X _J X >- _J X o 

JQ.H J>>a. 1> <X <£ M X X X X -H CJ I— ►-< X W>r>OOQO^H>HHQX"XX: 

CO»-i<rQOO OX ^ ^ X 2 2 2 El X X CJ X El X <t X<I0^)00<I<t<t<lX0^><I.0 O 2 I 

i(_>xxu^^xE:o“3t^ c T-'»-'^) <T o x o o x xcjxxE-EqoooldEieiqxxx.-.: 

5 O *-. Q 


X <t o X 
J (_) X —J 


X o 

CD X J> > X 
x x o o 2 

X E M 


uj o »— x cd n m ox x _j h- 

<3 ^ CD CD a <t OO 2 CD O 3 3 x 

UJ CD CD*-* CO UJUJUJ 

* * h- -#*#(—• * * # C Q * * 2 2 2 

C\]fO^^^r^Cfia>o--CsJ*O' <T ‘ rv '^ r ^‘ CtJ ^SJ~"CVJ^-«T»rv'Dr“Xc7NCi--«0J»O<T»r*V£>r^C30^Sl--C0'O^J‘‘^^ >r ^CCa'S5 — Csl»O- , TiA'^r'C0<^«S3—■• CM *0 *0 

COCCCOK)COCOCCCO(7\^^^a>^^£A(7'^SSSC3®C3SQCJC3 — — — — CMCMCMCMCMC>JCMCMCMCM»0'OrOrO»OtOrO*0*OrO - «r^''«T , *r*T-«T 

— — — — — — — — — — CMCMCMCvlOOCMCMCMCMCMCMCMCMOJCvlCMCMCMCMCMOOCMCMCMCMCMCMCMCMCMOOCM CO CMCMCMCMCOCMCMCMCMCMOOCMCM 

SSQSSQSSOSQQSISQSONSlSQSiSElQSOISSQiOfSQS'SSlOlSSCaiSSCaSSSSQSQISQSnsnSQSSISQSS 


*r»iD Q — Qq-«T— UJUJ<tCVj^“0sjK)rO»O UJ CO UJU Oi -DCO^CW^O'^^WJu.^C^a; —*0UJUJ<I*0 <OCJO<Cin<UJ^rO 

UJ O CJ UJ CJ ^ <TUJMi.L)®ffiUS(MU X Q U. rO CJ — OOXCDVDcMCsJ —• OJ D >T> — — UJ UJ (\] r- U. (J U CVJUQCJUJCM^C' CO 

r^coa'(7iOQQ(S-wio<r w ^<couJii. s^ p O'0^in'^coc7'<<r<t<iQP3-WfO -«t *rv cd t- cc ctcQUJU.ks-w^ rv <i< <rcQe5-<nACO^<r 
UUOUUUUDDDQOQQDQDQUJUJUlWUJUJUJUJUJUJliJUJUlWU.lt.lj.li.li.lj.li.U.U.lx.li.li.li.li.U.SSSQSSSSRQ-----*- 1 - 
O'OsOsOsOO'OsOsOsOsOsOsO^OsO'OiOsOsO Os O' Os Os O' OsOsOsOsOsOsOsO, OsOsO" O' OsO OOsOsO, OsOsO^OsOs<L<X.<Z<Z<X.<L<X. <Z<Z.<Z<Z<X.<X.<X.<L<X.<X. 
OOCJCJCJCJOCJCJOCJCJOCJOOCJOCJCJOOOOOCJOCJCJCJOCJOOCJCJCJOCJOCJCJOCJCJCJOOCJOOOOOCJOCJOCJCJCJCJCJCJ 



o* 

H 


CD 

X 


CD CD 

CD 


<1 X 

X 

H- X 

X *-* 

X 

CD X 

X 


<r i— 1 

1— 


X 2 

H K CD 

o 

IH 

XUi •— 

CD 

t- o 

X 2 X 


X X 

1— 1—■ 

X 

CD * 

X 

*—* 

X • 

A O CD 


x • 

1 X 

1— 

2 


1—• 

X S> ^ 


2 

X X o 

CJ 

CD *-* 

El X X 


•> O X X •> 

e: x 

El Q X X O O X 


1 uj xxx c 

2 o ED E 2 

x- t ei *-. eh^iwduj 

>•> •> - X •• O 2 O 2 X 

<txxx<cxxx<rx miccjo jh, 


) > r> — x 


X > X > 

£i5£ 


X O X 

x CD -J —1 NJ ' 
C X) x <C 2 x 
X 0-IOTJ 


x x <r 
' 2 2 x M 

I -• *-« C -3 


^><IXX>5xX>5xXX^*-h m m 

0H-Z2p^220H*X220XMX M X I 
J.WHHLoTHHrc/ihHHEuTo “30' 


IWWSt El 

■ JUJ ?cc 
UJ h- X) X X x c 
UJ CD 

J 2 o 

i M CO 

1 -J« X 

IhN <t X X > 

X 2 I- 2 2 o 

O -J X * CD EI 


mu E>-U) 
El *-* ZD X Q 

• x> a 2 <t o 

2 CD O 2 CD 

• JH2h< 

X 


XNCUHc 
O ~D CJ “D X O 
X 
> 


, ^ - CvlfO 

• oo oj cm cm 


<3 iTN CD r~- CO ^ Q 
cm oo oo oo cm cm *o 


—• X *0 -«T >T\ VD I 
rO rO *0 rO *0 *0 I 


| *0 *A CD 

•«T -ST -<T 


sr- < T^iAin»r*inir*inin*n»r»ir\cDCDCDcD cdcdc 


I COh- 00 OiQ — 

r- r- r- r~ to do 


: rs OS>OOOOS)S)S><S)SG2 


M53QSQC3Q8QISSQSQC58BQ S IS ( 


Si s s s si q 


CO CTi CO 
uuuu 


O- Os O, 

CJ CJ CJ 


CM <1 Q ^ -(O 
X X «T <T CJ x 


fO-HfO 8 - ^ COCM - - 'OSOIXCM'O'O^CUCM'O'OXCM'O^XCM rOK)XX<rX<CX<I XX 

xr--xf'^Qcjxcjoxf'~xr'“Xr-c3®xxcjc''‘®sjxf'~c3«s>c\jt-is ocMf"-Uou.oU_o x o 


Os Os Os Os 

CJ CJ CJ CJ 

si *r* r o — <£ 

X X X <c X 

X*0*0XX<tQc Q 
SSCMf'kuUQ CJ 


vm vm - - '-'J ^ RCM' S - u- 0 “- Ul*- U u-CJ CJSCMr-Li-UUQ CJ 

<1 Q 8 — C\'>r'^COWCCJr^CO(7i<iCOUU.CM^CCcr. <xm(jDXli.8-<TinM9r^OC(7n3;XCjDXXU.®-fOWCOQ]OESCM^ir\incflr^COOaIlX'-«<r<r 

^<Dt^f^ r -^r^i^ r ^ r -r^f--r'r'r-C' r --xxxxxKxxD 0 cccAC^<7^<7ic^c^cA<7'C^(7.c^c^cr5(^(7i<i<r<x<x<i:<x;<rxxxmxxmmmxmmooo 
0< O O O'' O Os O OO O'OsOsOsOs O'* O'OsO'O' O' O', O, OsO'O'OOsOsOsOsO'OsOsOOsOsOsOsOsO^OsOsOO'O^OsOsOsOsO'O'OO'CXO'O'OsOsO'OsOsOsOOs 
CJUOUUUUUOOUOOUOOOUCJOOUUUUUOUaOUUUOUOOOOUUUOOUULKJUUOOUOUUUOUUOUOL) 


Number 27 


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


Page 37 








>- 









OJ 



r- -<T — rO CO vCi VCCC X 

m — 


X 









X 



CO <S <Z rO «0 CD <S —* X 

<X 


X 

-J 




x 




X 


o 

CD G s c <r c Q C «j 

CO <s 


<r 

c 

-J 



o 

=* 



{— 


1—4 

L) S ® G D O C?G O 

s s 


o 

f: 

X 


X 

1 — 




2 


03 



S f— 


—i 



o 


X 



t—. 


c 



1 — x 

+ 

o 

o 


<t 

o 

2 


{— 

o 


CD 



(—• X 


UJ 

1 — 

03 

h- 

1—1 

i—i 


2 

X 

X 


2 <t - 2 ) 1 — CC XI— 

X 

x <r —i 

<1 

CD 

2 

X 

0 J 

od 

X 

X 

X 


o 

o 

mHXQ>-F - H 2 

X 2 

o 

-if 


i—i 

2 


< 


2 

f: 

3 

<L 

1 — 

<IX W 2 [C D 3 X -1 

<X X 

C_) t—i 1 —■ 

CO 

3 ?! 


i—i 

X 

Dj 

X 

o 

X 

O 

1 — 


XXX *-*—.2 XXO 
OCDUJXxX^^CL 

o X 

X X 


t—i 

X 

-J 

<x 


X 

CD 

X 

X 

• Ua 

X 

CO 1 - 

H<tH 

II 


o 


X 

Z?c 

CD 


o 

X 

• 

o 



mH X 


O 

<L 

2 

X 

X 

f—• 

X 

2 

o 

• 1 — 

<t 



mom 

<z 

CD 

m 

O 

o 

2 

OD 

•—« 

*-« 

X 

x x 

UJ 




<£ ~D 

o — 


CD CD <t X c 


m > 

'H XD U 


X f— I— 

X 2 — 2 . *- 

CJ CQ <L 4 -, 3—4 F^ —4 

•> *>0 O UJ O ~ 23 

CL ffiXJXL i fl.X^a.XX<CXFG 


o 

x 


x r- x ?: 


X —' F. 

UJ O •> 
CD CD X X C 


ST. < 
XX-J 


O CO 
<L X X 
LHCCD 

2 OD •— 

3 _J UJ 

uj ? jo: 


CO 

UJ 
X ^ 


^QQfjK'jJ-Ot? S ro m 

eg ho U J -sr tx: c^. — cc ro rsw ^ 
<I<t< 7 '<?«tSC 7 ' <C<tC 2 C^i CO C" 
OOOOCvOOOCDo^O 


-< <t CD 
t— x> a: <i 
u: *: x ru 

UJ 

2 > 

e 

o 

O CD (- 
O J> 

* m 


O C O KLX N H 

cj <x 2 2 o 2 . x 
< n i hQ t x 


X OfllDD X CJ CD <J 

<XO->>JJCUJO-W>X< X -1 X X => X > 
HZOCC-XJ. 2XI02c^!XNUIG^020 

od —i x t > o j —J o—it/ja. o.r m cxjXJXm^mJ- 


cd cd 

JO Jl> 
X <1 X o c 
JQoja. 5: 


X > > 

200 
m sr 


CL X 
O X 
X “3 


O 


X 

X- if * 


CL 2 {/I UJ 
FI X C > 
“D X aD <=■ 

I— CO 
UJ UJ 
X t— H 1 
O 2D ( 
<s 2 n :, . 


■if * * .13 


K-—covo-^invcr-oocT-Ki — coro «r m vc? r~ co cd s —• co ro m vc; r- oc cr <s> —• coro<rinvjr>-coc 7 -'S — cOfO^^vor^-occT'ts 

- - - - --■ — — CO CO CO CO COCOCOCOCOCOrOrOrOrOrOrOrOrOrOrO-^T ^ ^ <r <r <nA ^ in JMA lA lA iTM^ 

rO^'O'OfO.O'O'O'O'O'OfO'OfO'OiOfO'O'O^tOfOfOi'O'O'OfOfO'O^fOfO^fO^fO^'OfO'O'OrOKirO'O'O'OfO'OiOrO 
K^GIORKSSOOKISIKS: GGGGGGGSSSGSSSGGQGSGCjCG5JSGSGG 


o f-* x f uj 

CL CO h CD O UJ 2 — X I— X 

F. <1 L n ' 2 H 2 3 3 D 2 X UJ 

DUJhhOmUJUJ J WU1I 
jiDQLO J2ZOXH3 


mUJOL'<U^C4<lOff^ 

v? m m r- m vc> — s ro <xqc~ 
<x <x <x <x c <r < 7 '. <r <x <i < 7 ^ <r 
CJCJCJCJCJCJCJCJCJCJCJCJ 


JH S H2 >- 53 

W<mWXJ<HH 
nHC^HHh^? —»COJ— 
OD> mmGHDUJODIiJUJ 
CC CJ CD X CJ ►—I F? 2 C 3 f - ’ f -1 




<t 

<r 




CO 

CO 

K DO 


< 

CO 

s 

d: 




<r 


rO 









o 

o 




s 

o 

S CJ 


CJ 

CJ 

s 

CJ 




o 


s 

<i m 

X CD CJ 

s 

ID O'. 

— 

— — rO 






















x co 

m in oo 

s 

n- <r 

<x 

VC> X 

s 


.n 

X 




in 

X 

VJ X 


o 

X 

<r 

UJ 




CD 


o. 

o o 

o o. s 

<r 

O rO 

CT' 

<t CO C7D 

—• 


c- 

VC 




■^r 

X 

ru x 


c 

X 

s 

X 




DC 


<c 

CJ CJ 

CJ CJ s 

o 

CJ S 

CJ 

O S o 

VC X 

cr> 

x r- Cm 

ro >n co 

O' 



COrO—*<7>SC0<Iin 

<1 co — 

in X rO 

^<rcc 

<r m ro ro ro CO 

<r O' 

CO 

— X ro 

07 X 

rO 


—• ro 







— <c 

CM 

CO cm CD 

CO — O 

o 



S s X M3 03 CO 

CO X 

co co x 

x r— co 

m cj x 

COXCOf^-COr- 

CO — 

CO 

x r- 

CO 

07 07 

O 


X CJ 




























UJ s 

x m 

X 


S' 

X CJ 

CD CD UJ 

xo- 

<T in V£> 

o> C 

<1 

c 

CDJUQXX 

CO UD 

vc? a o 

Q X X 

ts —. <T 

in0D^<EU 

CD ts 

— 

<r in 

07 

r~- od 

C7- 

uuu 

CJ CD 

CD x; 

X X 3 

X CL CO 2D 

CJ 

■05 lO 

vo 

vo n- r- 

r- n- t"- 

r- 


r- 

f— r— r^- r- 

CC CC 

CC CO CO 

DC CC CC 

^ C7> 

(?) CK O^ CK 0~ 0 

o< <t 

<r 

<c <r 

<1 

<i <r 

<t 

<c <t <t 

c <t 

CJ X 

Fl—. co 

m 

C 3 

2 

H < Q 

<t <r 

<c 

<E <t <L 

<L <C <C 

<1 <i 

c 

<t 

<£. <t <t <t <r <c 

<£ <C 

<r <t <r 

<1 <c <t 

<c <r <i 

<z <t <r <c <t <t 

C <z 

<r 

<r <i 

<c 

<t <r 

<r 

C <£ <C 

<z <x 

cn x 

x <c o 

C7 

O X 

O 

2D h- C/D 

o o 

o 

o o o 

O O O 

o o 

o 

o 

UUOUUO 

CJ o 

CJ CJ CJ 

uuu 

CJ CJ CJ 

O O O O CJ CJ 

o o 

CJ 

CJ CJ 

CJ 

CJ o 

CJ 

UUU 

CJ o 

<r cj 

CD X cj 

*-» 

X 2 

2 

m c/d i— 


CO 
















2 





OJ 

X 



X 



















t —4 





• 

o 



2 
























CS 

X 



o 

I— 

OD 1 — 

















X 

CD 




s 

X 




* 

X X 













1 — 




(.1 A 

X 



C/D 

—« 

M 



1 — 

2 

o 0 D 













1—4 




CJ 1 

C/D 



• 





X 

o 

XX 







03 










X X 

C/D 



— 

°e 

OD o 



X 

CD 

X X 



r- 




X 






1 — 




1 - X 

X 




0 D 

OD 3 

o 


X 

C'- 

M O 



CD 




1 — 


QC 




o 




2 

X 




OD • 

X 1 — 

3 


<L 

s • 




2 




>- 


X 




CJ 




—1 X 

X 




* s 

CC 

{— 


f— 

o 

1 - —1 



X 




UJ 


m 








X 

X 



OD 

s s 

X X 

CD 


OD 

CD OD 

2 4—4 









f: 




*> 

CC 



>- x 

X 



“ 

cs s 

X CJ 

CD 


X 2 

<x 

—< o 



1 — 




o 


23 




X 

X 



X x 

C/D 



s 

s s 

X —4 

4—4 2 


*—4 •—1 

X x 

X OD 



<r 




X 


2 




o 

m 



<t 3 




—• 

— 

OD X 

f: —4 


X 

X -1 

X c 














f: 



2 

C/D 








1 — 











X 





X 



*-. CJ 

X 






OD 


*— 4 






>- 




1 — 

2 

<£ 

X 



2 



x 2 

O 

s 





l— 


CJ 






<z 




>- 

4—4 

1 — 

1 — 


CL 




4—4 

X 

C/D 




CO 

CO —. 


—1 


00 




3 

L 



m 

X XXX 

X 


f. f: 

X 



X X 

X CD 

4—4 


CD 

<CCDX<I s O 

B 

G 

c 

G 

D 


1 — CD CD 


c 

<r 



c 





•> 

►X 

X 


•> X 

2 



x t— 

M •* 

1 — 


CJ 

►U *“ 

•> 4—4 

^ 4—4 » (—4 » 


X - 

m 


•• 


f: 

2 

CU x 

<t 

X 

X 

w 

H 

B 

C 

CL Q fl] 

2 

X 

A 

D 

B 

D 

4—4 

CD CD 


2 C/D 

<C 

X ^4 

X 

Xi 

CJ m CD X UJ x CD 

CD CD CD CD <r 


x <r h 

— X • 

3 

3 

F 7 

X 







X 





X 



O 

CJ 








X 











2 








4—4 4—4 

2 






o 


e; 
















>- 



01 —< 

4—4 






3 


4—4 











l— 31 

CD 

X 



2 



2 CJ 

CD 


X 

CJ X 

X 

X 

X 1 - 


X X 





< 


> X > 

m 


2 0 - C/D 2 > 

=> X CD 

X Ou 

X 

2 > QJ M 0 - 1 — 

2 

1 XH 

= OD 

<£ => 

C 

03 

XXJ>XJ >>—0 _ 1 

2 > X > > O 

CJ (J CJ X ■> 

X 

*—. CD 2 > 

X 1 - 

ac nj 

Q 2 

O 

3 

fsl 

X O X Q 

O X <L 

i- f: 

2 

C X 2 O X 

X 

O 2 

X 

<E 

X O 

X M 

X 

cj <r 

O <L O 

O 2 > O <1 

o <r o h o x 

X X 

X <t o 1 — 

2 f: N 

z> n 

o 

2 x 

o 

“3 

f; _ 

e: 

03 “D 

F 0 .CL F 

FT. X CD 

X-D 

4—4 

F u 3 q. a; 

X 

CL —. 

X 

1 — 

x f: 

O J X 

x o 

f: o ^ 

^ X o 

F' cj y: x f: x 

X X 

X o ^ 

cox 

F <r 

f; 

—1 X 







X 








*—4 O 







o 


o 











X 





X 



m *“■ 

X 



















CJ 



1 — 


X 

>- 


i 

1 — CJ 






1 — 


h- 


s 









2 a. 



>- 


<£ 

<t 


VC? X 

—1 C/D 






X CO 


X 


OD 









f: 



m 


F 

3 


— n 

3 <X 






X CJ 


X 

1 — 

—4 









3 






O 



X 






*— 4 



X 

1 — 









* m 



X 


-if 

2 


* * * 

■if if CD 






-if CD 


•if 

X 

*“* 



07 

r- 

DO < 7 ; 

s 

__ 

CO 

*o -^r m 07 

r~ oo o> 

S — 

CO 

ro •‘T in vc 

DC 

< 7 ? O 

— 

CO rO 

m ^7 r- 

00 C 7 D Q 

— CO rO «n 

VL? r— C 3 C C 7 D 

(S — CO r -3 ^ vn 

VC? f- 

CC CMS — 

CO r <3 <T 

in M 7 n- 

CC o 

■«r 

■^r 


in 

m m 

m in m in 

in in in 

VC? VC? 

VC? 

ID ID id ID ID 

VC? 

id r- 


r- r~ r- 

r- r- 

n- 

00 

CO CC 

DC' 00 CC 

CO X X 00 

C 7 V O O Oi O 

O O O O' ^ 

s s s 

s s 

s 

S KJ 

CO CO 

CO CO CO 

co co 

CO CO co CO 

CO CO CO 

CO CO CO 

CO CO CO CO CO CO 

CO CO CO 

CO CO CO CO CO CO 

CO CO CO 

cococococococococo 

CO CO CO CO CO CO 

CO CO CO CO rO ro 

ro ro rO 

rO ro rO 

ro ro 

s 

s 

S S 

(S 

s s 

s s s s 

s s s 

s s 


S S S s S 

S 

S CD 

s 

s s s 

C 3 SS 

s s 

s 

Q S 

s s s 

s s s s 

G G Q CD S S 

s s 

S S Q S 

s s s 

s s 

s 

s s 


<r <x 

o cj 


s <r <z 

so o 


<1 <c <z 

o o o 


<t 

o 


c 

ro 


CO 

rO 


< 3-00 VC? 

S — CO 


in 

VC? 


QD CU S 00 DO 

vc? ko s m m 


—. x s 

03 S ro 


VC? <r rO UJ ro <L 
mo ■*■ co r- o, o 


— vnQ^r<i;c 7 irOtO'OUJCOCO — O — rn O' 

uju^^n^^ow^cooo cd — c_? 


cro<tm(LCJunicr'UJ - o so- <x u_ u. u. u. o <x 
r'CQOU}u]o < J'o^ < J , -uJoinuin r^- s s s s o v-" 


w uj to o* foe?? 

uJmo—ccr-coo 


CHUU.Q-W'OW^r'CO^cQUJk(M^^^COc7'<I <r q] O QQOQOnUJLL-COrO'^O' CCmOQU-KfOCO- 00K)(^<tCQOpS——K)0'^0'CO CO <£ 
— — — pjpj^CviCJCOWWOJ(NjCJWC\J f o»oiO'Oro'OfOfOiOfOfOfOrO'OfO'OrOfO^ < T'Vi^ , 'vr^r < i < r < iintfMnininininininin^^3v/3v/3ii5«^vci/3ii?wv/) 

<i<t<t<r<i:<t<r<t;<i;<r<xc<r<c<t<i<r<c< 3 :<c<x<c<t.<i<r<t<r<t<i;<i<i:<r<c<xc<t<x<i<r<i<£<r<t<i<t<c<x<x<t<i<t<c<c<c<i<i<c<tc<i:<<r;<i<i; 

oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 


Page 38 

324 


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


Number 27 




YET ANOTHER 6502 DISASSEMBLER FIX 

Dear Dr. Dobbs: Received: 78 May 22 

The Basic language disassembler for the MOS Technology 
6502, published in Dr. Dobbs volume 3, number 1 (page 6), 
has proved to be an interesting and useful program, but ap¬ 
pears to contain a number of errors. Some of these were cor¬ 
rected in volume 3, number 3 (page 3), but further bugs have 
since been found. I would recommend that the following 
changes be made, in addition to incorporation of those pub¬ 
lished previously: 

DELETE STATEMENTS 611 AND 908 

MAKE THE FOLLOWING CHANGES (ADDING NEW STATEMENTS 601 AND 645): 

240 DATA 14100,35304,56100,56100,56100,35305, 3303,56100 

300 DATA 36100,24210,33130,56100,28300,24300,33300,56100 

310 DATA 12200,24222,56100,56100,56100,24203,33203,56100 

320 DATA 16100,24304,56100,56100,56100,24303,33303,56100 

330 DATA 42100, 1221,56100,56100,56100, 1200,56200,56100 

380 DATA 23100,56100,53100,56100,49300,47300,48300,56100 

390 DATA 4200,47222,56100,56100,49203,47203,48204,56100 

520 DATA 45100,43304,56100,56100,56100,43303,25303,56100 

601 Dl=-123456 

645 IF c=56100 THEN 1000 

902 IF Dl=-123456 THEN 909 

1010 GOTO 910 

These changes correct a number of errors in the five digit 
codes used for deciphering the instructions. A bug is also cor¬ 
rected in which a spurious operand with a value of zero would 
be printed if the first location disassembled contained a single 
byte instruction. Another change is made so that disassembly 
will not terminate if a non-valid opcode is sensed. This change 
was made both for reasons of convenience and to allow 
verification to be done, as described below. As with the 
original version of this program, no attempt is made to convert 
addresses or opcodes to hexadecimal or ASCII representation, 
nor is any attempt made to improve the nicety of the output 
formats. 

When a computer program is written that includes a com¬ 
plex numeric table, it is desirable to devise a method of verify¬ 
ing the correctness of each entry, without the necessity of 
waiting for all possibilities to be encountered during execu¬ 
tion. For this program, an exerciser was devised to generate 
each opcode possible, so that the program can be seen to 
properly disassemble every opcode and format combination. 
This method of verification is desirable, since the disassembled 
output generated by the program can then be considered to be 
reliable. The verification technique was performed on a PET 
computer, and is detailed here so that it can be repeated in the 
event that further program changes are made, to re-confirm 
that new bugs are not introduced. 


To perform the verification, first load the disassembler into 
the computer. Then add the following additional program 

statements: 


2000 

FOR J=0 TO 255 

2010 

FOR K=0 TO 5 

2020 

POKE 6656+6*J+K,J 

2030 

NEXT K 

20*40 

NEXT J 


This program will generate every possible opcode and will 
repeat it six times, to allow the disassembler to treat it as 
having 1, 2, or 3 bytes. The block of opcodes occupies 1536 
bytes, and is placed into the high end of the PET memory (for 
an 8K machine). A different area of memory may have to be 
used for other computers. The opcode generator is executed 
with the following command: RUN 2000. 


When the program returns to the READY point, the dis¬ 
assembler is executed with the normal RUN command. Enter 
starting and ending addresses of 6656 and 8191, respectively. 
The disassembly that follows will include all 6502 opcodes and 
formats. Verification can be made by comparing the computer 
output with the MOS Technology manual (MCS 6500 Micro¬ 
computer Family Programming Manual, Second Edition, 
January, 1976, Appendix D). Note that the summary cards 
distributed for the 6502 may be lacking the ROR instruction 
from either the alphabetic table or the numeric opcode table. 
The PET computer output will scroll across the screen at a 
high rate. To slow down the display speed to a more conven¬ 
ient rate, hold down the RVS kev during execution. 


For the convenience of users of the PET computer desiring 
a cassette copy of the corrected program, I will be happy to 
send a copy to any reader who mails me a blank cassette and 
50 cents for return postage. 

Very truly yours, P.O. Box 575 

Bennett Meyer White Plains, NY 10602 


M6809 MEMORY TEST 

Dear Dr. Dobbs: Received: 78 June 15 

Congratulations on “Resident Memory Test Systems: With 
an Example for the 6800” in Number 25. Not because it was a 
good 6800 program—which it was not—but because of the 
reason it was not. 

My 6800 based S-100 CPU would no more know what to 
do with a LDU, TFR or PSHS instruction than it could deal 
with a MOV or CALL instruction. Apparently, Mr. Ritter has 
given Dr. Dobbs a memory test program for the M6809, 
Motorola’s new enhanced 6800. 

Some of the features of the 6809 were described in the 
February 2, 1978, Electronics, p. 95; others are evident in Mr. 
Ritter’s article. The program in the article shows that the 
6809’s instruction set is much more flexible to use than that 
of the 6800. It includes long branches, two, rather than one, 
stack registers and two index registers with a full set of load 
and store instructions for each, the ability to selectively push, 
pull and exchange all registers and compute and load effective 
addresses. The instructions vary from one to four bytes in 
length and appear to use mnemonics which are consistent with 
those for the 6800. 

I hope that Motorola will continue to make software (and 
other data) for their 6809 available and that Dr. Dobbs will 
publish it. 

Sincerely, Three Embarcadero Center 

Kenneth Drexler Suite 2300 

San Francisco, CA 94111 

How embarrassing. Not being a 6800-er I failed to look over 
the code closely, assuming that if it came directly from Mo¬ 
torola, they must have it working, which indeed they do. . . 
on the 6809. I have learned that the 6809 should be available 
in the fourth quarter of 1978 at a very reasonable price. It 
will be compatible with the entire 6800 chip family, have an 
on-chip oscillator/clock driver, 2 accumulators, 2 index regis¬ 
ters and 2 stack pointers. The 6809 instruction set will be a 
superset of the 6800 instruction set. It will have 11 addressing 
modes, will be able to carry out 16 bit operations and . . . 
when you get one you ’ll be able to run a memory test from 
Dr. Dobb’s. -TRW 


Number 27 


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


Page 39 

325 



APPLE USERS CAN ACCESS DOW JONES 
INFORMATION SERVICE 

News Release Received: 78 June 14 

Apple Computer, Inc. has announced a new service which 
will provide owners of its computers with stock portfolio in¬ 
formation and other financial services. Using a telephone link 
up, users of Apple II Computers will be able to dial Dow Jones 
& Co., Inc.’s Stock Quote Reporter Service for fifteen-minute- 
delayed stock and bond quotations. This information along 
with software provided by Apple will enable the user to deter¬ 
mine current portfolio value, short and long term gains, and 
rate of return, among other things. At a later date, Apple II 
users will also be able to call up current news stories on com¬ 
panies in their user’s portfolio. 

The cost of the stock quote service will include a one-time 
fee of $25 plus a usage charge of $3 for the first three minutes 
plus 50 cents a minute thereafter for each usage session. It 
will be available from any authorized Apple dealer starting 
June 26th. 

The Dow Jones & Co., Inc. Stock Quote Reporter Service 
consists of a large computer facility in New Jersey linked to a 
nationwide communications network. The service dispenses 
current stock quote information (delayed 15 minutes) and 
current and recent past (up to 90 days) financial news stories 
from the Dow Jones news media: The Wall Street Journal, 
Barrons and The Dow Jones News Service (Broad Tape). 

Presently, users wanting access to network information 
have to purchase a terminal, such as a teletypewriter, and 
modem. For most users, each request to the network requires 
the entry of a series of statements into the terminal to log 
onto the system and thereafter to enter another sequence of 
statements to acquire each piece of information desired. 

Like the terminal, Apple connects to the network via a 
modem and accesses the network by way of a password ac¬ 
quired when the user purchases the service. The password is 
presented to the Dow Jones network via the Apple II key¬ 
board. However, the Apple brings to the network computer 
power which simplifies and performs the task of logging onto 
and processing information from the network much more 
efficiently. Moreover, because Apple is a computer, the 
amount of information processing that can be carried out is 
greatly increased. For example, with Apple Financial Evalua¬ 
tion Service II—a portfolio analysis program-the Apple auto¬ 
matically calculates long and short term profits and losses, rate 
of return, etc. 

To log onto the Dow Jones network with Apple, the user 
loads Apple Financial I—a stock quotation program—then 
follows the instructions displayed by the program. These tell 
the user to dial the local telephone number of the Dow Jones 
Network and then insert the telephone receiver into a modem. 
Once a telephone link is established between the Apple II and 
the network via the modem, the user is only requested to enter 
his password to log on and gain information from the network. 

Besides the logon feature, the Apple II is also very cost 
effective in its use of network time. With Apple Financial I, 
all symbols for which a quotation is desired can be entered 
into the Apple prior to logging on. Thereafter, Apple requests 
the desired quotes from the stored information without fur¬ 
ther keyboard input from the user. Thus the time on the net¬ 
work is always spent accessing and transferring data and never 
involves costly manual input typing time. 


Apple Financial I permits the user to access quotes for up 
to 21 stocks per portfolio. This number is increased by adding 
additional cassettes, each of which can contain 21 stocks. 
Thus it is possible to have one large portfolio or a number of 
small portfolios. In this way an investment counselor can 
quickly access quotes for each of several clients simply by 
loading the appropriate cassette. Moreover, stocks in a given 
portfolio can easily be added or deleted. 

With Apple Financial II, the amount of processing per¬ 
formed is much greater. The program permits the user to 
calculate his/her portfolio’s current value (up to 16 stocks) 
and calculate short and long term gains and losses for each 
stock and the cumulative profit and/or loss as well. Thus, an 
investment counselor with a number of clients has instant 
access to the performance of each stock in any of the many 
portfolios he/she may be managing. Like Apple Financial I, 
this second program will be easy to use for the investor. 

Other programs planned include a news retrieval routine 
which will permit the user to enter a company’s stock symbol 
and receive a series of headlines associated with that symbol. 
The user then has the option of selecting a headline and receiv¬ 
ing the text of that story on the Apple display screen or 
optional printer. Other such programs as this are planned for 
the future. See local dealers or contact Apple Computer, 
10260 Brandley Dr., Cupertino, CA 95014; (408) 996-1010. 


News Release Received: 78 June 19 

WINTER has added a new 5-day hands-on advanced pro¬ 
gramming workshop to their microprocessor training schedule 
for Fall ’78. The course objective is to develop those skills 
required to plan, prepare, test, and document 6800/6801 
microprocessor applications software. The course is offered 
November 27—December 1, 1978 in Lafayette, IN. For infor¬ 
mation call Jerilyn Williams, (317) 742-6802; or write 
WINTER Corp., 902 N. 9th Street, Lafayette, IN 47904. 


News Release Received 78 June 26 

The Personal Computer News is a monthly newsletter 
edited by Donald L. Wallace, and is published from Dayton, 
Ohio. PCN is dedicated entirely to a variety of reader serv¬ 
ices, and contains no paid advertisements. PCN features a 
regular news column detailing developments in the micro¬ 
computer industry and related technologies; objective product 
and software evaluations geared to the small businessman and 
the hobbyist alike; and two features due to commence this 
summer include a PCN-operational Software Exchange and a 
Trading Post classified advertisement section. In addition, a 
Software Sources listing culls the latest entrepreneurial offer¬ 
ings from the microcomputer media, and an Index to Com¬ 
puter-Related Articles cross-references features in the popular 
computerist magazines. Subscription Rates: $9/year in the 
US; $ 15/year in Canada and Mexico; and $24/year overseas. 
Personal Computer News, PO Box 425, Dayton, Ohio 45419. 



PERSONAL COMPUTER NEWS 


Page 40 

326 


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


Number 27 



FIX AND MANUAL CORRECTIONS FOR 
PROCESSOR TECH S GPM 


Received: 78 May 1 

Users of Processor Technology’s General Purpose Memory 
Module (GPM) board, part of the widely advertised Subsys¬ 
tem B, will find that they can not load or use the cassette 
tape version of the ALS-8 Assembler without first modifying 
the GPM board. 

The problem is caused by the fact that the GPM board 
responds to memory addresses in the range of EOOOH to 
FFFFH, whether or not any ROM chips are installed on 
the board. 

The following modification to the board disables this 
response and allows locating a standard 8K RAM board in this 
address space, so that the ALS-8 tape can be loaded. The 
modification does not affect operation of the CUTER monitor 
or of the PHANTOM startup feature to the CUTER monitor. 

In the following instructions, all location descriptions 
assume the board to be held with the component side facing 
you and the edge connector down as shown in the card outline 
drawing (Fig. 5-1) in the GPM manual. 

1. On the front (component side of the board), cut the thin 
trace connecting the pad located near the top end of U30 
and the pad located under the body of R8. 


ZF if ■ 

£F 011 ( t‘1 




p/teli ujo 




5°Ht> 


FAon Al 


FlW OJO'l 2- ( Cj) 


-D* 1 

uo 


To 031-IS 


cs 


GPM Fix ptn. /u.s-8 


i/‘fjrs 


The following GPM manual errors, discovered during the 
course of the above design, may also be of interest: 

Table 3-1: The SI-8 description should read “allows phan¬ 
tom signals from auto start (on GPM) to S-100 bus”. Switch 
settings should show SI-8 “ON” for an IMSAI, if auto start 
from the GPM is desired. 

Figure 5-1: (card outline drawing) and Figure 5-2 (schematic) 
both identify U9 as a Prom B, a 2708. U9 is really ROM C, the 
CUTER ROM, a 9216B. 


Note 1: This is the first thin trace just above the top end 
of U31. This trace carries the card select signal from pin 12 of 
U30 to pin 15 of U32. By cutting the trace between these 
pads, the board can easily be returned to its original state 
should you ever install ROM chips for the ALS-8. 

2. On the rear (copper side of the board), connect the follow¬ 
ing seven wire jumpers: 


FROM 

TO 


pin 10 of U30 

pin 1 ofU23 

Note 2 

pin 2 of U23 

pin 12 of U19 


pin 10 of U19 

pin 11 of U19 


top end of R3 

pin 13 of U19 

Note 3 

pin 12 of U30 

pin 11 of U23 

Note 4 

pin 10 of U23 

pin 9ofU19 


pin 8 of U19 

pin 15 of U32 

Note 5 


Note 2: Pin 10 of U30 is available at a pad below U30. This 
pad may be located by following the thin trace, on the rear of 
the board, from this pin down to the pad adjacent to the “1” 
digit of the number “100” located near the bottom edge 
connector. 

Note 3: The PHANTOM signal is available at several locations 
on the board. The most convenient one from a wiring stand¬ 
point seems to be at the top end of R3. 

Note 4: Pin 12 of U30 is available at the pad above U30 
referred to in step 1. 

Note 5: Pin 15 of U32 is available at the pad under the body 
of R8, referred to in step 1. 

The overall circuit will look as in the attached logic diagram. 


Figure 5-2: (schematic) has several other errors: 

The signal at U30 pin 12 (CARD SELECT) should be 
shown as active low. 

The signal at U30 pin 9 (ROM C) should be shown as active 
high. 

The unlabeled dual input gate shown connected to bus pin 
76, is really an inverter (U23) with pin 9 as input and pin 8 as 
output. 

Ed Elizondo 6 Cypress Court 

East Windsor, N.J. 08520 


2 NEW F-8 PRODUCTS 

News Release Received: 78 March 24 

Comptronics has introduced two new F-8 products for the 
serious hobbyist and design engineer. 

The first product is an F-8 CPU board compatible with the 
S-100 bus. Complete with 3850 CPU and 3853 SMI, the unit 
provides sockets for 2K of EPROM monitor, two PIO sockets, 
and connections for six I/O ports. The board has 64 bytes of 
scratch pad RAM, and a fully buffered data bus. The Model 
F-8S100 sells for $239 as a kit, or $275 assembled. 

The second product is an F-8 microcomputer with key¬ 
board and six digit display. The unit provides audio interface 
and speaker compatible with the on-board KD-BUG (3856) 
music routine, 2K of RAM expandable through an S-100 con¬ 
nector, and IK of EPROM with 4 additional 2708 sockets. 
Model KD80 sells for $375 as a kit, and $425 assembled. Con¬ 
tact: Don R. Swanke, Comptronics, 19824 Ventura Blvd., 
Woodland Hills, CA 91364; (213) 340-8843. 


Number 27 


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


Page 41 

327 



Custom File Routines for ALS-8 


BY LARRY A MAREK 

6008 East Lake Dr., Apt. 3B 
Lisle, IL 60532 

Here are a set of routines I have worked out to take advan¬ 
tage of the tape routines in CUTER/SOLOS and the ALS-8 
assembler. The ALS-8 assembler has the ability to assemble 
source code given to it by an outside driver in addition to the 
normal assembling from a file in memory. CUTER/SOLOS has 
the ability to appear like it is reading a byte from a tape when¬ 
ever asked. “Appears” is important because the assembler 
could not perform its operations fast enough between bytes if 
the tape was actually in constant movement. By combining the 
two features, assemblies can be made of HUGE source files. 
The only restraint is that enough memory be available to hold 
the produced object code. 

To use these routines change line 0006 of the listing to 
agree with your CUTER/SOLOS starting address, then 
assemble the program anywhere in your system. 

Before a tape file can be used, CUTER/SOLOS must 
“OPEN” the tape file, so make “OPEN” a custom command 
using the address associated with the label “OPEN” in your 
assembly. 

Example: CUSTE /OPEN/ 0000 

The command has three forms: “OPENW m n”, “OPENR 
m n”, and “OPEN”. “OPENW m n” prepares a file that will be 
written to. Optional parameter m can specify the tape unit 1, 
2, or if left blank, will default to unit #1. (Note —two tape 
files may be open at the same time, but one must be a read 
and the other a write). Optional parameter n specifies the baud 
rate of the tape —1 or unspecified is normal 1200 baud, 2 is 
300 baud (Note—open files can not have different baud rates, 
also the last OPEN command used will control the rate). 
“OPENR m n” prepares a file that will be read from, options 
m and n are the same as in “OPENW”. Plain “OPEN” will 
display which tape files are open and if they are a read or a 
write file. 

When a tape file is emptied or filled CUTER/SOLOS 
must be allowed to close the tape file. Thus, another custom 
command in ALS-8 should be set up with the address of the 
label “CLOSE” in your assembly. 

Example: CUSTE /CLOS/ 0106 
The two forms of this command are: “CLOSW” to close a 
write tape file, and “CLOS” to close a read tape file. 

Before the assembler can assemble from the tape routines, 
a file must be recorded out on tape in byte format. To do this 
another custom command in ALS-8 with the address corres¬ 
ponding to label “FSAV” in your assembly is used. 

Example: CUSTE /FSAV/ 015F 

The command has only one form “FSAV”. This will start 
the tape and record the source file in the byte format. A write 
tape file must be already open and when “FSAV” is done the 
file will still be open. The tape file remains open so that large 


programs need not be in memory all at one time. Some words 
of caution here—when you are “FSAVing” out a large file— 
DO NOT—close the tape file until after the very last section 
has been “FSAVed”. 

The “CLOS” command will cause any left over bytes (byte 
format is actually 256 byte blocks) to be saved out on tape 
along with an end of tape file marker. Also, the very last line 
of the source file must be an “END” psuedo-op. This is so the 
assembler can tell when to begin its second pass. Because 
VERY much of the tape is blank between ‘byte blocks’ 
“FSAVed” tape files will use about 3-4 times as much tape as 
the same file saved by a normal CUTER/SOLOS “SAVE”. 
This makes these tape files VERY slow. 

The last custom command should be associated with your 
address for the label “BUILD”. 

Example: CUSTE /BUIL/ 0180 

“BUIL” is the opposite of “FSAV”. It will read byte format 
tape files into the current file. By specifying an address after 
the “BUIL” command the tape file will be read into the cur¬ 
rent memory file until the hex address is reached, then just the 
remaining bytes needed to finish a line are read. (If no end is 
specified the whole file will be read in.) Thus “BUIL” and 
“FSAV” can be used to pass very large source files amongst 
hobbyists without regard to memory limitation. Each user 
“BUILds” a memory file according to his/her available 
memory. 

The last thing to define in ALS-8 is the tape file input 
driver with your address for “ENTRY”. 

Example: IODR/CASSI/ 0091 0000 
ALS-8 is now ready to assemble any size program for you. 
ALS-8 does a carriage return and a line feed at the end of its 
first pass. This is your cue to rewind the tape. The motor will 
turn on automatically. When a tape is fully rewound strike any 
key on the keyboard to continue the assembly. 

Remember, all routines work with the file name as found in 
the “CURRENT” file in ALS-8. As tape files are written they 
will get the current file name. When reading tape files the 
current file name must match the name used to write the 
tapes. 

Here are some “quirks” I found in CUTER/SOLOS as I was 
writing these routines. Tape unit two is 42H not 40H as 
described in the CUTER/SOLOS manual. A big mistake exists 
in CUTER/SOLOS-if a call is made to “FOPEN” when the 
designated file is already open the stack is “POPed” once too 
many times! Instead of returning with the carry bit set, the 
processor takes off to whatever garbage is on the stack. (I 
spent several hours one night tracking this problem only to 
read about it the next day in an old “SOLUS” newsletter). 
This explains the point and push in lines 0072 and 0073 of 
this source file. By pushing the error handler address on the 
stack the extra pop will put it in the P.C. register and the error 
will be handled by “TAPER”. 


Page 42 

328 


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


Number 27 




For those of you using ALS-8 that is now available on a 
CUTS cassette I have found a “bug” in it. The problem is in 
the “ASSM AAAA BBBB” form of the assemble command. 
The assembler is supposed to assemble the code for start 
address “AAAA” but put the object code at address “BBBB”. 
I have only thought of one real use for this-when you are just 
trying an assembly (to get the syntax errors out) before you 
break a large source up into byte format. The cassette version 
is supposed to handle this and it does okay until it hits and 
“ORG” pseudo-op. Then BOTH the “AAAA” and the 
“BBBB” address become that of the “ORG” value. In both the 


older PT #1 and the old ROM version of ALS-8 an “ORG” 

statement just ADDED to 

the “BBBB” 

address. The fix is 

relatively 

changes: 

simple—read in 

the cassette 

then make these 

RDBP 

CfiSSETTE VftLUE 

chhmge td 

ECBF 

22 

7D 

MOV RvL 

ECCO 

FI 

C3 

JMP PRTCH 

ECC1 

DO 

F0 


ECC2 

C9 

F9 


F9F0 

00 

93 

SUB L 

F9F1 

00 

■5F 

MOV EsR 

F9F2 

0 0 

7C 

MOV R« H 

F9F3 

00 

9R 

SBE D 

F9F4 

00 

57 

MO’S-' D? R 

F9F5 

00 

£R 

LHLD BBUF-*-2 

F9F6 

00 

FI 


F9F7 

00 

DO 


F9F8 

00 

19 

DRD D 

F9F9 

00 

22 

SHLD BBUF+2 

F9FB 

00 

FI 


F9FB 

00 

DO 


F9FC 

00 

C9 

PET 


CORRECTION ON MODEM ARTICLE 

Dear Tom.' Received: 78 June 12 

Received your letter and complimentary copies of the 
Jun/July issue of Dr. Dobb's Journal today. It is very satisfy¬ 
ing to see my article in print. Unfortunately, there seems to be 
an error in one section of the article. 

The last paragraph in col. 1 on page 6 should read: “... the 
system must, at a minimum, provide for ring detection (the 
Hayes unit provides this while IDS does not)." 

The significance of the correction is that it establishes the 
foundation for the claim that the Hayes unit can be directly 
connected to the phone lines without an intervening DAA. 
This claim is basically correct (except for the required certifi¬ 
cation and certain other technical details that I allude to in the 
article) and I certainly don’t deny it. 

I noticed on page 44 of Issue 6 the article “Computer Net¬ 
work Poll” reports reasonable success with the Hayes unit. The 
manual I used as reference on the Hayes unit related to the ori¬ 
ginal unit. I note the article refers to a revision 3 modem board 
with anticipation of revision 4 shortly. On the one hand, this 
seems to bear out my reservations about the board. On the 
other hand, it seems Hayes, with help from users of his board, 
is making an effort to correct its deficiencies. 

Thanks for accepting my article for publication and keep 
up the good work. Your previous issue (Vol 3, Issue 5) was 
really outstanding. 

Sincerely, 9655-M Homestead Court 

Tim J. Pugh, Jr. Laurel, MD 20810 






n 











LU Lu 

CL 











M -4 h- LL 

UJ 











U X > CL UJ 

h- 











J -J □ lu cq Uj m 

r -1 X 

lu 



UJ 

to 






_J_J_J^J Jl Q_J 

> (J 

F 



I UJ 






ui jtt _J -j □ 

•X 

UJ QL J— X 


CL 

►— 

X 






Iuiuhft.zbgx 

Z h- 

E X A 


UJ 



CA 



CD 


•_) U X' UJ — i X 

n ~ cl 

X Z X LL 



0) u 

t—i 



r-w 


uj lu a. n h- i- 

a 

Z I • 1 — X 


X 

UJ 

z 


F • 




ZMUjFz'iujrhH 

a X Ll 

UJ CL (J X 


X 

> UJ UJ 

F 

M • 




Luai-X'-uji-a-'Z; 

uj □ 

LU X LU CL A Z :3 □ LL 

K 

r 

1 —< 

F > 

X 

Z •(• 

fp 

r. 

F 

CL -J > W X > O Z Z' 

Hd J 

x^u|U.iu , - , F a 

X 


X' 

►H HI 

Z 1 

Z' X UJ 

1 



□ (J A E A Z' 

Z- LL a 

ho. JClijXkUJiIL 

Ll 

UJ 


X LD 

$ 

0 X 

c-j 



LU UJ F A U 

UUJll 

u. ►- x u. <: :• FUZit u 

F 

X X 



X 

• □ X F 

J 

J 

F 

LUUJQFI-EUJUJOF 

A ^ *-• F 

Ll lL A X UJ LU I - * LU UJ 

— i 

X X 

z 

X 

X 

E F X 

<£ 

*- 

(/> 

jJI-WEIUJ'Im 

ZA Z 

h-a A J 0 . X J I 

□ 

U. \ X 

lD 

X - 

A 

X x« 


1 


UhIUlL>_i>Q.uJll 

X Z' -1 OJ □ 

Z u. > □ o »- a 


1 o z 

X 

• 

MJ 

X F Z X 

It 

£ 

(k 

U U. CL 3 <•') A l- W CL Z 

a x w a u 

LU Z □ Q. h- CL 'I> ►h X 

u. 

Ll 

□ 

C-) UJ CA 


X X - F 

□ 

•r 

UJ 


A 

LL XXI— 1 il h q. UI 

_l 

□ mi-i 


r x n 

A 

XXX — 

IL « 


t- 


o UJ UJ UJ 

Ll IX A Z CL Z A (J F J 

\ 

1 »—< >-« 


UJ *-< E 

X 

> □ X 

□ 


o 

X X X X X X 

oua. 

jluz m ZDjm ' x 

LL 

A ui 

». 

XXX 

X 

F £03 

in \ 


u 

x X x i u. i j '-'j a * fn 

OJ O XXX 

OttlUttH x X X D U. O 

Z CA CA 

A 

□ X 

X 

X □ X 

UJ K-, 



F- 1 A o « oj oj o ^ — 

hCOF hh 



UJ X X 

Z 

A X 

00 • 

LD 'X X 

z 

x 


q v' 9 — 9 I* o;i 'X op 'X* 





X 

: E Q_ 

A 


M UJ 

u 

X 

+ + 4 + + + t + 4 + 


xxxxxxxxxxxx 


z 

3 X 

z z* 

't 

K 1 

i 

o 

Q.CLQ.P-^Fiia.Q.a. 


•=■ Ij' f - L T A O' O p C'V 

•£> 


z 

Z X A X X 

X + 

?'t 

'i 

o 

UJLUUuJLULUuJLULULU 

_ X 




□ 

Uj x x a 

X A X 

D h 


o 

1 — ►— I— I— »— 1 — 1 — 1 — »—»— 

X X X X 

O O O O — O O |V, CO r- '.£1 OJ 

X 

CJ 

XX- 

F 

Zi E D n 

I 


o 

DDDDjDXODD 

o o OJ Ll 

AAAAAALULULULULULU 

L-l 


□ X 

O 

A Z' A 3 

. IL 

• 

o 

O O o O O (J O (J o 

O oj CO’t o 



o o 

UJ 

: CA F 

F O 

A Z — n 

uj Ui 

•t 







X 

► z 

— OJ 


J h- 








►-< 

(A X A Z — 


H 73 








U X X z 



IL U 

I 








F □ X 

r. 

A X 


i 

XI 

X> D D X X X' Z' X X Zi 

X Z* Zi X X 

XjjXjj.'j X _i 

X 

X X X 

Z X 

> — 

XXX- 

t U> 

■I 

0 

Q. 000000000 

0 0 0 o a 

00 00 0 0 0 00 0 0 0 

G- 0 0 

UJ F t A 

X « 

X X A X 

P 2 

.j 

UJ 

LulDlulululuLululuUj 

LU LU UJ LU LU 

LULUIULUIULULULULULULUIU 

UJ UI UJ 

X CA X Z 


X U X O 

F H 








a 

Z □ 

U F 


In in 









XXUX-* 


D D 

>- 

& 

ZmFf a UJ K h- 

o HOJh 

O 



X 

X X X X Z 


U 

CQ 

UJ 

UjD>?-Q.'XlLA^ — 

OOhhQ. 

UJ fl. (L U. U. I 0 ) i Z H L 

Ll 

X 

X 

— □ CA 

(A Z> 

r 



h- 

CL J«KZ 4 Jj-Q.Z£ 

OJ O H-. n 

J L I X X O X CL X I 

X 

U X 

F 

X : 


Lu 



z> 

a u m d. -i i h (4 d j 

. nwrzl 

*- □ □ A A 3 X O X 

LL 

□ lL X 




X 

♦ ♦44 

4 

4 o 4 

!LlJ.il 20 Alhll 2 

4 W ( -) X X K 

4 U. A LU A *-« (/> X X (,■ > 3 U. U 

4 UJ Z 

♦ 4 

4 4 4 

4 4 

4 □ 


o oj oo tj- in •>£» h- co ij. o in -a n a> cr- ® — oj co ^ in vd n od o> ® — oj co ^ in ■£> r - co cl o oj co in n co x. ® — oj 

o o o o o o oooo-h^h — — ^ — oj oj oj co oj co oj oj co oj co co co o*> co co co co co or* 't ** m in in 

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O •=• O •=• •=• O O O O O O O O O O O ■=■ O o 

oooooooooooooooooooooooo ooooo ooooooooo oooooo o o oooooo o 


X 

-J 


UJ lu [ 


LU X 


UJ CO 
F CL 

r z:§ 

z> — 

. ■ UJ 

til5 x 

l£l Q_ (/) 

F 

a z 3 


CO ► 

c 

F 


se 

a: 

Z UJ 

sans! 


A > 

z z 

OJ □ 


OJ 

+ CL 
Ll Cm 
O Z 
a z> 

CQ Z 


6 ■ a 

DKiur 

fflt— D LU — 
X 0 3 1 

a a. n p w 


£ 

□ 00 CQ 


F U 


UJ ± 

a - S 

cq x a. u. o in 
r A (.) r * ». 

x n .kip« 


st; 

x > 

D A 
□ I 
CA UJ 

UJ LL 

Z UJ X 

ui 

JI«E 

— □ w 

> lo a. — 
□ JEtD 
Z o LU o X 


r ' 

x w 

z 

, f- 

I't P t Q 


_ X A X _ _l . X 

— n > x ca x x > ~ 0 '<t ~ -J * ~ 

Nfl.IuhjItPClLI-XX>lif->r 
“HJOEtOl J O Z X CL CO J J Z O X (/> Z — 


X 

CA 

oo 4 in x> n ro ^ o cu co 4 in ■ 0 n coco o oj 

in in in in in in in so •£• •£■ •£> x •£• •£• •£> •£• •£• r- r - r- 

o o o o o o o o o o ■=• o o o o o •=• o o •=• 

0000000000 o o o o o o o •=• o o 


000000000000000000000 
0000000000000 oo o ooooo 
ooooo 000000000000 oo o o 
00000000000000 oo o 000 o 


• O »_• O O C- O O' O O' O O' O O' 

O' O O' O' O' O O O O O O O' O O O O' 

O O O O' O' O' O O O O' O' O O O' O' O' 

O' O O O O O O' O O O O' O' O' O' O' O' 


O O r-i o 

o 

03 

O O CD O CO — 

A o a O 

o 

CJ 

AO CJ A 01 O 

X - CD N a 
X CD UJ In N 

0J — 


— — a a o u in LL 

X 00 N o O 0J •=• ^ 

in ^ 


loarujdujojix'ojin 

X A tt' sD X '.U — — '-D A LL 
0J CJ r- X ■=• CO 0J — o 0i x 

OJ CJ CA X CJ 

XUN 

CO x 

OOOOOOOCO •-£> A 

XI O CO 

rt N 

03 A X X — OJ in CO A A o 


_...... « aj ^ 

lOOHHHHHHHHdJ 0J 0J 0J 0J 'IJ CO CO CO CO 
■ o O O' O' O' O O O O O' C- O O O O' O' O' O' O' 000 
> O' OOOOOOOOOOOO O' O' O' O' O' O O' O' O' 


Number 27 


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


Page 43 

329 



P 


X 

~ £ 



I X 



X 


CJ 3 



P 

X 

1— 

P 


Z:- 

p 

h- CO 

sa 

P 

> 


d 

E X 

i— 

R 

CO 

(-0 

HH it 

UJ 


s 

p 

□ I 

> in 

X 

3 


X u 

X X 

UJ 

CO 

X 



I 

CO 

h- 

X LU 

X X 

H 

X CO 


3 X 

X 

D 

X 

X 

3d 

3 X 

X 

p p 

LU 

R 3 

□ (J 

« X 

X h- 

P 


x 


d CO 

R 

v z: 

± X 

UJ 0 

1— •—< 

3 

•t p 

h g 

P X 

CO I£| 

r/i 

gf 

X 

t-t p 

P IU 

CO 

H P 

U X 

X X 

X 


CO 

3 CO 





3 3 

p p 



I/O 

d 

HH > 



X 

P 

X R 



I 

P P 

3 R 



I CJ 

X d 

05 X X 

•* R R 

I . 


co <r 

^ i 


P 3 
□ 
x o 


J I J J O. Q. (lh 

o a i g □ n □ uj 

IU J CJ LU X X lL X 


r ►— . 
x p 

~5£ 

□ I cj 


\ : 

a; x l 


w £ 

eg □ 

CL »-• 

a. p 
co i' 

I CL 

“ J 

n a. 
r □ 

*-* X 

2& 

iii x 

♦ * ♦ ♦ 


□ LU CJ HI 
X CO 
CO □ CO > □ 

<- :i r co 'i _i 
<t x 2 cj 

0. _l X CL 

>- 


UJ 

X 

p hh 

i :fe 

K • O 
CL CJ 
P □ 
x u. □ 


X UJ >• 
CO J J 

ttr« 

5 3 § 

CO UJ P 
CL CL 

d co 

I y— - 

UJ r UJ 
t- fu cl 
□ x x 
Z2h 

I 


X P 

UJ X 


I 

co 

R X 

X X 

CO X E 

1 X 

p 

56’ 

f d 3 

3 X 
X X 3 

lu X 

X P E E 

1 X f- 


'-Cl lL I'J P E a. H [ 

x □ e x Uj a: 3 : 

SlHlIhhHI 


•“* CO f— P 
ia«iifl.h 
P ' J J Z u. Z H 

2 g □ ii h it _ 

« ru «r c-o CL cl i- co 3 th 


3 ct *-< N nr r 


JJU"'H CO 


♦ * * 


J'IUj a: t— 
X R 3 X N CL P 
O -I □ (J “ X □ 


-X 

3 


CJ I- 

a h 

^ “ Lui 

CL UJ UJ □ (J h- 

IUEZI- LU -I 

R X X J JE 

UJ 'I Z Z J I! h Q. □ 

5- UJ *• U P X 
'X 1 Z LU I UJ XU 
X ~ P J UJ D 
> hHhI CO h 
lUEMUZllf- 
J X - ~ CL 

h zml iu □ o t a iu 

lL R 'X > CL X U) L 


• IU 
co m co 

ui x □ 
co lu _j 
a Cl U 
P 

X P 
H 

i CO 
3 LU J- 
CO 0.1 — 

□ □ X 
JPj 
(J 


U R 
UJ 

q£ 

57 

P lu 
X 

X 

X IU 
X R 


IQWEIiiL 


P P 

MHH jHltP CL 

X X > X X R X X 


X 

UJ 


X P P 
X X X 


PS :f.r 

■ - X IU 

!§S3fS 


& fe 


IU IU I 

tv g ^ a j 

ujEt^L 

_ X J U H(J3 

**. IU • IU >— *—• IU hh x 

lc LU Cl IV) 3 P -< PI- > >liMDp|- 
X X - X CO H3RX <t j-± 

iu — i— u x p m CD 03 

X UJ IU X P _ K LU , LU P h- UJ r UJ 3 


P 


I □ IU X X X 

: I 

P □ U5 

P 


CJ 3 X □ P h- 

: O 

® CJ 


D 

R R R 

C O M 



x 

IU X X 

R d I 

’t 

P 


P IU EPh£|l. 

E P 3 

X + 

X 

•« 

- I x I — P Uj oj 

X CJ 

U R IL 

X 

UJ 

iiRinzfizcLiih 

3 : C-0 

3 3 3 

X 

p 

r. r. r. > » 3 □ X Ul 

3 P 

R 3 R 


lu 

r— I— IU n. uj ijj U- r— uj uj u h- iu Z UJ 3 

IU - EXXPRXpPX mC0> 

cd x .j 0 -) xphiztHiup co x x x C Uj 
— LlI •—« i.- .i X ' 1 P X h- U P X *-* 3 c- i 3 ip 3 


SjLcJ 

p y~ 

p i- 
PU| 

U P X 
h- X 
P — X 

o.i x 

□ 30 
P X 

.1 .-ij 


0 ) i— w l— i— y x P t-i tk 

ph kp -*«:o^pp hh h-duj 

ids id 135dS - 

_ “ X X X P 


X R 3 X X C 


3 _ 

•303 


*sdl 


O-J _ _ 

□ p p x ►-* x x r j p x X x x p 
o i x o x r j o z - - -- 

P P |_| P - P o 


P ± X Kj p 


x x x p e o x p n x x x o 

O X O') 3 . J O 3 X P (J 3 CJ 3 


.3 


a 

j 


□ 

p 

g 


op a- o oj co 

rt *t 10 UO in u* 


rj- U-J r- CO IT, O - 

u _ < uo ui in u‘ in •£• 


•ij 
0 -o 


•3 ’t UO 
VO P 'D 


•-£• N CD iO o « nj (<) 

'•£> • £» ' D ' D N N K N N 


in i£i [•- CO &■ o r-. oj CO 

r- n K r- r-- co oo co co 


■& uo 

0j 05 


•d r- od a - w' — oj co in p r-- co a- 
00 CO CO CO X' '3 if- >T- I?. '?• if. I.T. X. 1?. 


■ 0 ? cr . 1 


^ oj '■ 


> O O O O O ' 


o ^ uo \D r - oo ct> o «-i cvj 
oj oj ''a «:.j oj oj oj -''j oj oj oj oj oj oj oj oj oj oj oj cu p oj oj 


u o 

’t R 


X R — —• — cr . 

05 O CJ R P fJ 


05 05 

0J O 


- oj in uo in- uo no uo co « r c 
g g 'J ip o g g g g g c 


r uo ^ x u. n 

U. 0J H U. H P 


X P 0J CJ 0J R x 05 R X U 05 
05 U CJ 05 05 CJ 05 R CJ L) X R 


:• U in lL U rt N 05 U 
:• OJ O rf CU - o rf it, 

< ^ X' RhXRiT 05 
J -« c- u 0J 05 (J R CJ 


U - 05 N U t 
P 05 P U0 0J —i 


N - 

IU o 


R U0 
R 0J 


^ o rf it 05 

^ t£i ^ C- Tf 


05 K,Oh 

CJ P CJ O 

UO R ± CO 

-| R O rt- 


0J O 05 U CJ 05 


t CO 0J R U. 
•5 R O X 


05 ' J 05 CJ R ij 05 P CJ U R 


1 R iu u il il iiilu.Il li. u u oj + r - a* p p ^ 05 •£> a-. X cj o o u cj u oj rt r- x r o co <o -o <0 -o 
1 y y y y y y y g y g gi g m m r r p q p p p p p p p p p p p u p u u u o o o o 


■15 •-£' •■ill cr - ULL « t r - X P P U CU UO 05 P P U 0J 05 Xi ct- 
Z- O O O O O ~I T-. r-i rn ^ OJ 0J 0J 0J 0J 0J 05 05 05 05 






X 








C-0 

ir 






p 

I 

X 


C- P X 

h- 

p 

0 

R h M 


R 

it 

X - P 

X • 


p 

p X 

P • 

X P 

X 

X J _tf 

X • 

p 

0J 

Cu 


« UJ UI X 
III D P 
• T wi- 
:• p 3 

‘ * £ ' 

i 

X 


3 

□ 


■ £ X 
X UJ 
J X h- 
3 
p o 

^ -I 

H 

Uj 


LtH X •- X 

P R P h- X 
r x a X x p 

$ 2 P 3 X 1 - 
(/) P X (/> □ P X 

X - -I IX 

I UJ J I UI I— 3 


P 

c- K 

C- i hh l 
■ P X c 
<1-3: 




P 


X 

i£ 

R X 

r Q 

11 u < 


pp >-ip •—< P P 3 I 

X X U I- U X 3 □ X 

3 E 3 

XX X 

P □ 0J □ I— □ 

iLHOIhl-HhlltEH 0 J 
P3X-«3X^-5-PX3 2 
X 3 > ZP r. 3 X X ■ ' “ 

' CJ X I 3 X I 3 I- CJ 


CO 

*—' |— |— H 

I - I 
h- C ) h- 
W P 


p I- 

r- ui 3 — 

p □ p p 

3 I P 3 — 

□ “ 


cu a 

PhH 

— 3 3 
3 □ • 
13 3 1 


R $ 

P X U 

S P P P P 

X . I 3 R 
K CO • H □ 

• □ X r- 

>LhP PP liJ 

_X CJ 3 R I— 3 P r 

R 3 3 X □ H CO 3 3 r3 

I- R P X H CO 3 CO 3 

^ □ P IU P COR i-i CO 3 f- 

« 3 > lL > P 3 P X X 

CO □pHPQj3H3i5 D 

X X 0 3 3 X □ U □ X 3 Z) 


h- '55 U 3 05 I- R 3 
— CO P X CO « 3 3 IU P 3 
3 P X ' J P * 3 CO X r 
3 X O CO X X 3 X C O X I « • . 


□ 

2 
p _ 
CJ 


d 

3 X 
p d 


,AJ * 
co X d i- p 
3 U 3 H X 
hl-Zd 
I ~ 3 

3 h- > 
C ) C -0 r,o J 

p 


CU 


X h- 

3 X 

*■ I 

• R 0J .3 


P P 


P P I 

- ~ r j p p x ~ -« — n p p x > x c-o x x - hh 

: X 3 X X R X x r j X X Z X X 3 d P 3 E d X > r J CL 
■ - .- - - X 3 E □ E X o 


X I P P 

X X - CO 1-1 P 3 P X ►- - 

I- □ X 3 X X >3 X R X X N X _ 

CO X P X P CJ P CJ P P CJ 3 P O 3 CJ CJ P P CJ 3 P 3 CJ 0 3 3 C- 

3 

P X 


•-H »- X 

N > X N 3 

X 3 O X 3 


□ 

X 


X 

R 

3 





R 


C-0 


X 


1 



CO E 

h- 

Uj 


LU 


M 



CO •-< 




K 


C-0 

1 


UJ 

X 

i 

i 

E 


CO 

• 


CJ CO 


p 


f-. X 


X 

• 

X 

CJ CO 

u 

X 

X UJ 

d 5 

E 


X 

p 

XXI 



UJ CO 

1 X 

►i 


d 

p 

X P 

> 

R 

R □ 

X 

c- 

UJ 

u 

X 

P X 

. -± 

E 

PEP 

U P P 

C- P X h- 

I 


CJ 

CO CO X 

• ZE- 

X 

«£ 3 

3 P 

P E X - 

h- 

co 

►H 

X X 

. X 


i e p a 

LRhLui] 

L Z □ I 


X 

R 

*-< 5- 

UI 

UJ 

p a 

E^uxd 

E h r o p 


% 

□ 

U 


EXE I-* 

3 3 d d 


ID P 
IU P 
X R 


U P X 
C O h- 
• 3 X 


P 3 

~ a 

X X 


p ui *-< ± ± I P 

EP2UUIU.I—U C 
x d 



E 

> 


D 


p 

I 

d 

d u 

1- X □ 

- P d X H 

\— 

iu £u 

X P 

x 

□ 


R h- 

co x 

x . 

V 

h- R 

co g p r— ' 

X 

> CO 

H 

fO 


CO 

X 

X 

p 

P 

R P 

CO E 

1- X R X X X 

kH 

X C-0 

X 

lu u 

p 

f-H 

p p 

U P 

p 

R UJ 

IU P 

XPEHdd 

d 

CO X 

IU 

1- 


X 

u 

X P 

□ R 

IT.' CD 

X X' 

X 

X X P P CJ R 

X 








3 













P CO 

U . 


R 


> 




rt 


*— 1 

h■ h- 

E CO 

3 P 

P 

E 

X E 

X 


X 


IU 


I 

b-A V 

*-« X 

R f 

*:- 


P R CO 

P 


o 


X 


CJ 

X R 

P 

E 

R 

~x : 

XX E X 

c 







_i M 

X 

r 3 

M 

P 

X r . X KH I 

LU 

W I R 

R W CO 

X 

p 

X 

CO 

Cf X X 

x d 

W I X 

I X 

I X 

1- 3 CJ P (J 


X 

p p 

E£ 

X 

CO R 

h- 

♦ M 


III P 

3 C O CO CO 3 X X r J X X 3 X P 

3 3 ;■ 3 Q R X E X P 3 R X 

IU X X X IU P d 3 h C0 p _j i_. 


X 3 
P R 

x »- 

X E 
IU ^ 


3 ~ X CO P X >h ~ 

S X RjID3ud(L N X C 
P P X O X 3 “i 3 O 3 O ‘ 


0J 

h- 


P 


♦ M ♦ .j o 


05 ^ IT,' • U N 05 '?• >=' -i 0J 05’t U5 'J5 N 05 O- •=' « 0J 05 ^ IT- 'U N '55 0- ■=• — 0J 05 ^ IT' X' f_- 05 ' 
r _" r j f j r j r j r j: r j ® ® ® ® ® X* 05 ® ® 'I' '7- |J- 'J- 0- O'- O- O- O- O- O- O O o -z- o J 


) r- x> o- o ^ oj o-j rf m -o k 05 o-. o -< r 
, ^ oj 0J CU oj CU '\l 0J OJ 0J liJ 05 05 C 


5 05 05 05 05 CO 00 ' 








05 

o 


0J 

•55 



o 

v—i o 

0J 05 CO 0J •=• 



0 


CJ 



p 

•_1 

° 


o 

o o 

P 

P U 

o -z- 



05 



N 


'£> 


p 

W 

r- 

N o R 

••U 

® U0 N OJ •=• 





0J 

■Z. 




p 

4 

in 

R ® IT' 


•X' 

- rt r - 

0J 

^i 


in 


R 


R 

X 


UJ 

X 

«-• UJ 0J 

R 

R X 

-IPX 


U 


R 0J 

'P 


CJ 

05 

0J U 

CJ 

0J u o 

r -' 

• J 05 

0J Cl 

in 

■£' 

r- 

X R P 




r r 

x 

CJ 

U. 0J rt 

r- 

X R 

o 05 IT' 

05 

C*5 

05 


05 

!- 

*t 

4 


4 

rt 

f y y* 

lr. 

in in 

•Xi *•£• •£• 

o 

o 

o 

o 

O 

o 

o 

o 

o 

o 

o 

o 

o -Z- -Z. 

-Z' 

o o 

o 'z- o 


O I\| 05 o 
P P P P 


• 1 * o o in 
-i '55 X' - 


CO <=• 
|J o 

05 


K 

LU 


? ® ‘D 05 0- R R IU - 


R 

U 


in in In* 

IU R O 


X N OJ O Oj 
*3 R O 05 CO 


05 R 

<J f_i 

’t 0 
X R 


O O rH 


U 05 R U".' •=• X' 

O O CJ (U X 


*-< x in R *-« X X N UJ X LU X 
0J 05 P O UJ U R N U 3 U R 


1 rH (JJ 0) ^ t N t' W C 


g u u oj if' uo ir« in in in x> r g u •=• 05 ■£' n &- o uj 

't- 0 -. ® X X X X X X X X X X X R R R R R R R 


• O O O O O « 


Page 44 

330 


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


Number 27 



a. 

cE 

E 


UJ 


CE 

LU 

£ a 
X □ 


R Uj 
X -J 

UJ rt. 


UJ»—< 

UJ . «J u_ 

B ur. >- 
d z -- • u. lu 

-II d □ X _1 IuJIL'I 

x- L' UJ M i u □ I □ Q 
I ll -I d U. R CJ Q. 0. 

•i □ •:-■:< u u □ iid 

U h- pL UhE' 

> h- 1 /) g u u g d • 'i j 

■i u u r cl h* r □ i id u □ 

• ■ «d a. ui o CD UE J«wl 


h- g a. 0 . z; ll 

— >* UU _J □ d G 

r r Qo.it z: uu_x 

d g z d * 11 •- - □ cj 

iCLlLLllUhE'jLLlEwU. 


U 

a. 

>x 


d 

£ 


u 

Ql 

□ 


u 

lu 

U 

G 

R 

R 

d 

*-» 

>—< 

UJ 

d 

d 

ii 


3 

& 

d 

ft 


a 

CU 


£ 

U- 

□ 

R 

r 


n 

cj 


CU O rj- X) 00 cu If) o in rt U. CO R N o 

•j- d o .T. o cc oj I •=. cu ^ it. rt •=. ^ n 

—< © ©©—<*-« 0j —• CO Oj CU 

o •=• (J © © © CJ © © © CJ © © i_i © © 


n 11 m r UJ 11 co. _ _ 

d cd iu pj iu □ a Uj z □ >- cu lu q d g 
□ ihhirvzllj jrKQ.Q.DZi 
ji jriEHi-Miii.oLjt: cd cu □ 
r u cj Uj u u. 1 _i □ ii d cd g 1 - 3 3 


(i I • 'Jl Cl N o [j. if) « n K o fi o h O yi 

□ Uj R O © If. CJ CD UJ If' Oj L IP o Q - 

© -. nj — o o © co © © oj N co 

© © u O © © © © © © ©UR ® ■=• u O 


I -J 

: 'l ■ ' -J u 


X 'I 'J _J 

Z W I U i- '_i u u. ^ 

— J d CJ 0. “• E CJ *"> 













fro 


G 








U. d 

•- r j x 

r =rJ 2: 

u 

u 


u 

CJ 

o 


D d 

d r r 

> I z 

to 

G frj 

G 


m to 

G frJ 

G 

G I 

o ~ •- 

E JO 

d 

g d 

G 

d 

q d 

G <± 

G 

G CJ 

-j 

d 

t> 

r 


E 

r 

c 



lL 

u 

u 

d 


d 

d 

rt 



G 

G 

E 

□ 


□ 

□ 

□ 



7~ 

r 

d 



cu 


OJ 


© © 

U 

U 4 

4 U 

4 ♦ d 


4 4 d 

4 4 3 

4 4 3 

4 4 

•X> CD 

•£• r_- * 

'?• •=• 0J CO 

m ■ £> N CO 

cr. 

° -• Ol 

n y in D 

K 'Xi 17% O 

OJ 0j 

u o 

© © o 

>_. —. —. 

»-» •-* 


»-< 

Oj CU OJ 

CU OJ OJ OJ 

OJ CU OJ CO 

CO CO Oj 


C'j CO Oj 

CO CO Oj CO 

CO CO 

CO CO CO 00 

CO 

oj CO CO 

0j Oj CO CO 

CO CO CO Oj 

0 j Oj CO 


© © © 

© © © © 

© © 

© © © © 

® 

o © © 

© o © © 

© © © © 

© © © 



r n r - r ► 

•M«a.hzi 2 a.h> 
: Z E □ Ii d 'J > □ IT ; 


> Q 0 CU ’t rf OJ r- 

p © © © © rt. © 
:■ © © © © © © 


3 1 I wzh r r u oj to (i 
lu □ iu*-_id~op_iGDb 

t; - PILjilEJD 30 lujMjh 

JDttZDUDHjHUMUZU tO 

•r 0 Q o Lu u lL u. _i r d d’ to to g d 3 3 






^ © Ll 

rt U. ® G rt 

rt LL o O rt 

rtliOOrt 

rt LL O o rt 







U1 OJ .jj 

IT. rt OJ OJ rt 

in 3 CU OJ rt 

in ^ oj cu in 

in rt CU CU IT' 



cc* 

© 


— •=• vD 

® llj C'J 

cr. o u oj ^ 

a> o lu cu r* 

0. o LU cu d. 

d. O LU OJ cr. 



(J 

(J 

© © 

© G U 

OJ rt U-. OJ 

rt OJ rt Uj rt 

v- CU v ID 

^ OJ rt in rt 

rt '1J t in rt 

cr . in 

X) y -r CO G rt IL G Q O U. d ® CD ® 










• £. © 

© ilj cr. G •£' LU ^ O O © ^1 u. CC' 111 ^i 

'f 

G 

O co 

Q Qj »-• IT' CO 

© oj o 

u -• u j d in 

u cu in ll in 

UJ ^ IT' IL OJ 

LU CU If' IL OJ 

CO >=• 

-i 1 x i O^rtrtrtOO © © © © o © 


° 

(J *t 

© >1 © © p 

•U U j U*' OJ 

rt CO rt rf <fr 

rt CO rf rt rt 

rtCOrt^m 

rt CD rt rt Uji 

UJ G 

© O © UJ © G © © (J ® (J O © © (j 

oj d 

in q 

- d d 

f - u oj co x* d oj 

—' *-« uj OJ P 

in ® o . £i cu p 

ipooxi C'J G 

in o © r. m g 

in o o •■£. r. ir- g 



OJ CO U O UJ IL G 

r - il (j oj co oj ■_> 

OJ rt rt u j o 

in OJ ir. rt in O 

in cu in rt in o 

in oj in rt in rt o 

IT- OJ IT. rt in rt O 




1' '£• CJ G •=■*-. rt N CO I © U © CO '■£» *0 ••£> 

'I 1 1 I « w ft Q w w Q Q u U (J 'J <_« 


r u y u 

U U UJ u 
o © © © 


© rt. *rt *H 
© © © © 
OJ OJ CU OJ 
© © © © 


•XI N N N 
CU OJ OJ OJ 



LU G > 

Cj G Q 

v Q_ CD d tl 

OJ OJ OJ 

I Ll □ UJ R 

cu cu cu 

(j □ —i i r 

© © © 

d GOGUJ 


z R © r — 

i l' Ll I > © d d I- R > 

□ ZZhiQCUZilHH* 

CJ J«> jO-HtrilCt 
LL u — Z □ d ( 0 t O I- Z- 3 3 


d ~ 


r 

|SE 


d co 
: 3 ' 

3 g £ 


R 

»- CD 

r co 

:5i 


B 

.j 


(t d 
R Z 

CO 


LU 

r 


3 

r r 

kS 

iis 


U. 5 

-I U 
d -■ 
W O X 


E 

- u 

? d 


fl 



6 


IU 

CD frl 



d 

h- frl 

-1 _J 


UJ 

3 ft 

D J 

3 rJ 


R 

□ 

CJ -1 

hQm 



d 

-1 

ii r ll 


Ll 

UJ 

a r 

fV ~l p 

iL 


d i'D 

R 

d Lu □ j d 

cd y 

R 

□ d 

r x 

XOtf J IU 

n d 

c 

u. o 

^ R 

u d d d i 

• d G 

uj 



d Z Q 

• d 

d 

z z 

UJ 3 

a. c j fr ) 

. I □ 

d 

[D i-h 


e 

d co 
Z LU 


R G _ 

3£ !iJ£ 


QJ 0 .II 
C|j DU*-. 

to 

a! 


. J CJ LD 

i£i h d d iu r 

DR Z G > U 
DLODZDhI 

r i tt 'I G LL h 


is 


d *-• 
□ 

u £ 

G d 

R a 

to r 


lilfi p 

-J r r 
HZIU p 
IL D J □ 

□ HI U 

U. O U. 

G p □ S S 

r R d i 

u : ZU.U 

R r id ’ r 
u -• u r u 

0 R — ID 


fro 

d 

UJ 




t V . 

3 -jiu 

X- lu IU 
d X E I 
R -I Lu no 
HiRUJM 

r X D d 
D (J □ ll 
U R □ d 
R > R t -0 ll E 

uj d Lu uj d d 

ID to _l d IU G 


u u 
z r 

□ a 

G G 
R J 


Z CO R UJ 


m3 

E 

d 

P« 2 = 
g£ E gn 

d 1 d u. 

R R d R 

> LU 4. D CO 

Z G LL X □ frj 

EE CD EL) 

E •' 

IT Z 

z 

LLDU.DE 

L)J UJ d 

X 

X 

> 

z > UJ UJ -J 

□ GOG • 

D d luJJ 

ft rrJ 

d N 

O d Q X G G E • 

d G D d •-* 

W* LU G G G G 

3X3IRIU.I 





□ •--Id 

Uj g 

> •- N HtXXl N R 


-= iZ 

D 

□ 

d x d e 

? ? 

PdZ>RZZCJZiU 

1 ft 

LU h 

<3 

UJ 

(J JUD 

R d 

E CJ > E fr) — — G ■ d 

ft 

G G (J 

LU 





uj d 

□ Z LU 




UJ d 


> R 

Z d CD 



G G G G I _J _J 

i i i 3 c S g p d □ o i 

_J to _l to Z _J d U d “I |_1 


U d 
r e 

- “I 


d 

R 

♦ 44 


) f in 0 

J 0 J 0 J OJ 
J CU 0 J cu 
:• © © © 


r-- co 

OJ OJ 
0 J 0 J 


I^J CO oo 
0 J 0 J 0 J 
© © © 


cZ liJ 
□ d 

e d 


0 J Oj * Uj -jj 
Oj 0 j CO CO CO 
0 J 0 J nj OJ 0 J 


r 

♦ E 

r - oj c 
CO 0j c 
OJ cu c 


£ 

I 

(J 


S □ 1 

U. R 

4 4 4 4 4 4 


d 
4 LL 


□ 

5 


-J □ 

*- r 

K 

r il . 

t K ^ lL 

lu r u t j 

I- UJ ll M 
> d 

G d to IU 
-• D ^ U 
(J HH 
G R IL 

diu ^ 

U I E IU 
dRHj 

p □ u ? 
R R > 3 
r d 

g *- □ r 
r e u 
d t- j u :> 

E U E >- 
E -I ID 

□ — r 
u u. u to 
■> *—< 
: UJ •— 

G u ID R 
-Id M 
HDUJ E 
D □ I ~ 
G to R _J 


US , 
E5tE 

□ > LL h 


U J 
G I. 

E tO 

d 

£c 

d □ 

R R 
IU u 


S S'; 

d 3 ► 


d d 

u 

R G 

to E 
U D 

r r 


□ □ 
R 

: r 


r 
J D 
J □ G 

«o d 
IU 
• d 
. E 


£& 


G 

5 


u 

ta 

CJ 

LU 
& - 


LL 

D -J 


G d I —J d G G 


. r id 
: -i u 


Il d 
D LL 
G □ 


O r □ d > 

►-« LiJ h Lj h G 

u □ —J t*- to h- lu 

j d *- d r > d 

-I ►- LL □ • •-• 

□ □:-■• U. U IjlQmI 
dGI dddDdED 
Ii. d □ □ U U 
J IU U h- d d it 
J > R '0 QU'IER 
Z H 'I IU U Z 1 I J □ I 

IL t j 'D d IU I'J O G r G 


r r ii a d 

U. hh > U IU j. □ 

Dr g g d d x □ 

g d i-i r d » u _j 

G ll I d I U R E '£ G I 


G . GOG I —J J 

U > d N XJJJt to J 1 > J O X 
IDiLZuIIIQjaDE □ d Z 
J E □ ~ G tO _J to _l d C_< d “1 “1 Z O “• G 


r 
uj •- 
_i 

•- Q 

u. d 
u 
R d 

•J 

U U 
d G 
d 

□ R 

(J to 

d e 

d U 

□ r 

LL •-* 

_i 

S£ 

I R 

i U. 

U □ 


e r 

_j d 
E 
> U 
d d 
□ 

E U 
U I 
E h- 


I CU 0 J (5 '\1 0 J Z 0J OJ 0 J 

© © © © © © © O © 


ij. © *-H 

in u*< 

0 J CU 0 J 


0 J CO rt 

it* in in 

CU 0 J 0 J 
© © © 


in vd r - oc> o- © — oj co 4 - iri •£> r-- 

ir> in in ir< in d d d d d d 0 d 

cu oj " .. 

© © 


4 4 4 4 4 4 

•DO '? • © »" Ol CO rt IT> 
•Xi x» f - n r - p-- r - N 
0 J 0 J ilj 0 J 0 J 0 J 0 J '\J 
© © © © © © © © 


G 


i P N © cr- ©■ — nj oj u'i '£> r- © a. © -• oj co 

N f'- N N 00 00 00 00 0j 00 0j 00 Oj Oj 0> <t. 0> O. ij. 

1 U OJ OJ CU OJ CU Oj OJ OJ oj oj oj OJ oj CU CU 0J OJ OJ 

© © © © © © © © o © © © © © © ©• © © © 


in 0 N 

O' o. o . 

CU CU OJ 


CD o 

cu — n © 

.H 

rt 

© © © © CO 

o 

rt. CO rt. © 

© rt. 

o UJ 

Lil © LU LU 

© 

o 

p p p p o 

u 

© LU o IU 

G o 

in o 

uj l£| © © 

© h_ © 

Ll 

n rt. u j u. in 

o 

co &. G o 

Il d* 

- -D 

~ O CD *D 

CU Uj o 

rt 

© u. o UJ rt. 

— 

rt x> •£. vD 

uj CO 

, OJ CO 

G »- R 0 j 

uj Uj oj lu oj co co in oj cr. 

d oj d C'j •£' d uo g 

d G CU CO 

d G rt CU | 

: co (j 

CJ OJ o o 

r- u_ cj rt. oj rti 

© u u 

•XJ CU OJ CU Tt co UJ U IU G U G CJ 

0 J N G >_• 1 


u p © co co co oj oj -x* cr 


Cr. u Ll Ll LL U. d ■=> OJ In N Qj 0- d R U LL Ll Ll Ll Ll U. U. U. Ii. Ll cu U0 Oj R u Ll o Oj *t t- d G 

•t^^^^’r^ininlnin in in in in in uo in uo in uo uo uo uo ir.< iri •£• d •£< •£« -d *d r- r- r- r - r-- r-. 

© © © © © © o © o © c 


OjOj^-tfTt^^rJ-rt-rJ-^tf^^^^Ujin 
© © © © O © © © © O © © © © © © © © © 


© © O © © © © © 


cr • cu 
• X< cr . 


J 0J CO U CJ U Ii. G r-- • J G OJ 

w w w <_• © © co ^ in a» cr . u. cu in • £■ j. d g © — ’t r- ■» cc> oo co 

oj co oo co oo oj co oj co co co co or' co >?• >7- >?■ o* a. it. ix d d d d d d d 


d g o © © © 


:• © o © © © . 


Number 27 


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


Page 45 

331 



COMMON PILOT: Progress Report 


BY LARRY KHERIATY and GEORGE GERHOLD 

Micropi 

2445 N. Nugent 
Lummis Island, WA 98262 

Increasing interest in using microcomputers as teaching 
tools in combination with increasing realization that BASIC is 
not a suitable language for most teaching applications has 
created a demand for microcomputer implementations of 
PILOT. This article is a status report on a number of micro¬ 
computer implementations of PILOT and a description of the 
extended version of PILOT which has been proposed as a 
national standard for the language. This extended version is 
called COMMON PILOT. 

The original version of PILOT (often called CORE PILOT 
or PILOT 73) was created at the San Francisco Medical Cen¬ 
ter. The language was designed to work on Datapoint terminals 
in a stand-alone configuration. The simplicity of CORE PILOT 
appealed to users who wanted a language for introducing 
children to programming. The philosophy behind CORE 
PILOT appealed to users who wanted a language free of 
assumptions about proper teaching strategies. The latter group 
added extensions to CORE PILOT to convert it into a power¬ 
ful tool for Computer-Assisted Instruction and for other types 
of interactive computing with an important dialogue compo¬ 
nent. Fortunately most of the extensions were influenced by 
an extended version written at Western Washington University; 
therefore the resulting dialects of PILOT turned out to be 
similar in form, but dissimilar in details of syntax. Under these 
circumstances standardization seems to be both an achievable 
and a worthwhile goal. The National Library of Medicine has 
assumed sponsorship of the task. Initially it appeared that 
there was a sharp division between the supporters of simplicity 
(which seemed to be essential for small machine implementa¬ 
tions) and the supporters of power (which is essential for 
acceptance as a general CAI language). One of our reasons for 
attempting a microcomputer implementation of the WWU 
extended version of PILOT was to demonstrate that the 
division was based on false premises. The microcomputer im¬ 
plementation, which was done under the sponsorship of 
Western Washington University, was so successful that the 
resulting version was used as the starting point for a detailed 
proposal for the national standard. COMMON PILOT, as 
described herein, is a refinement of that original proposal; 
the refinements are based on extensive discussions with other 
PILOT users and on our experience in preparing a version for 
commercial distribution. We anticipate that this version will 
be backed by a number of institutions at the standardization 
meetings. 

At this writing (May 1978) we have completed the system 
for a 6800 processor, and we are testing a version which takes 
full advantage of the calculator board and the multi-user capa¬ 
bility of the Southwest Technical Products 6800/2 computer. 
This version will deliver COMMON PILOT on a 4 terminal 
system. Hardware requirements include a 32K 6800/2 com¬ 


puter, 4 serial interfaces, a dual floppy disk, a calculator 
board, the multi-user board, and 4 CRT’s. As the total cost of 
this hardware is about $6000, the system opens the way for 
schools to begin using CAI at relatively low cost. Southwest 
Technical Products will be distributing systems software for 
this version of COMMON PILOT starting in the summer of 
1978. The software will function on a single or on multiple- 
terminal systems. 

In addition we are translating the system software into 
8080/Z80 code, and we are testing COMMON PILOT written 
in PASCAL. PASCAL source copies will be available by Fall 
1978 for $300. 

Description of COMMON PILOT 

At least two microcomputer versions of PILOT have been 
described in the microcomputer journals. These versions 
are actually subsets of CORE PILOT. COMMON PILOT 
includes numerous features which put it into a different class 
from CORE PILOT. Perhaps the most significant feature of 
COMMON PILOT is the fact that the PILOT program is inter¬ 
preted from disk. The system automatically pages the program 
into memory. While only a few lines are in a buffer at one 
time, there are no restrictions on branching ranges, that is, 
branches are not restricted to that portion resident in memory. 
As a result there is virtually no limit on the length of the CAI 
program. A typical PILOT program to provide one hour of 
quality instruction may be 1500-2500 lines long and may 
occupy 60K-90K on a disk. Workspace in the memory is 
reserved for storage of variables, arrays, and strings. COMMON 
PILOT uses floating point variables, one- and two-dimensional 
numeric arrays, and varying length character strings (maximum 
length 999). 

Language Summary 

Labels; 1 to 6 characters (labeled line begins with *) 

Operation Codes Remarks 

PR: option list U — force to uppercase 
S — eliminate spaces 
E — escape allowed 
L — force to lowercase 
G — goto allowed 
W — clear label table 

blank option list leaves prior options 
unchanged 

R: remark ignored at execution time 

T: text type text after substituting current values 

for string and numeric variables 
: text continuation of previous type 

A: accept answer into answer buffer (option¬ 

ally into numeric and/or string variable) 
M: pattern match answer buffer with pattern 


332 


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


Number 27 



J: destination 

jump to label, last A: , next M: , or next 
PR. 

U: label 

use subroutine 

E: 

end subroutine or course 

XI: string variable 

execute string variable as PILOT instruc¬ 
tion 

FI: record, string 

load variable from disk 

variable 

FO: record, string 

write variable onto disk 

variable 

D: variable (N) 

create 1 dimensional array 

variable (N,M) 

create 2 dimensional array 

variable $ (N) 

create string variable 

C: variable = 

assignment 

expression 

C: /variable edit 

text editing of string variable 

option 

Edit Options: 


C — capitalize first letter 
U — translate string to uppercase 

/xy/ — replace all occurrences of character x by character y 
/x/ — remove all occurrences of character x 
Match Pattern Symbols: 

* — match any single character 
% — match space, start, or end 
& — match any number of arbitrary characters 
! — match one answer or another 
Modifiers: 

H append to T for no CR/LF (TH:) 

J append to M for auto jump to next M if no match 
S append to M to allow for some spelling errors 
X append to A to override input text editing 
Conditioners (append to any op code): 

Y execute only if last match was successful 
N execute only if last match was unsuccessful 
E execute only if error condition raised 
C execute only if last conditional was true 
n(0-9) execute only if equal to answer counter 
Rational Expressions (append to any op code, enclose in 
parentheses): 

execute only if logical value of expression is true 
Execution Time Commands (entered by student in response to 
A:): 

goto destination — jump to destination 
@ text — causes U: SYSX to be executed 
Computational Operators and Features: 

+ — * / ** !! (string concatenation) & (and) !(or) *- diadics 
= < > < > <= >= «- relational 

'v (not) — monadics 

%A — system variable, answer counter (number of sequen¬ 
tial uses of same A: instruction) 

%B — system variable, answer buffer 

ABS, FIX, INT, SGN, RND, SIN, COS, ATN, SQR, EXP 
LOG, LN, STR (float to string conversion), FLO (string to 
float conversion) 

ASC, CHR, LEN, INS (instring) 

Subscripts: 

X(N), Y(N,N) N = variable or constant, 0 to 999 
A$(P) character at position P 

A$(P,L) substring, starting at P for length L 


It is evident from this summary that COMMON PILOT in¬ 
cludes numeric and string operators which make it comparable 
to a good extended BASIC: random access disk files are sup¬ 
ported (when handled in the DOS), and the conversational and 
pattern-matching capabilities are very powerful. We maintain 
that COMMON PILOT contains all the features necessary for 
versatile CAI, and that it does not contain unnecessary fea¬ 
tures. We do anticipate extensions to facilitate graphics since 
at present graphics can be handled only by loading control 
characters into string variables and displaying them via Type 
instructions. A set of graphics commands will emerge from the 
standardization meetings. They will take the form of a set of 
operators which can be included in the text field of a G: op 
code. 

PILOT has the unusual history of being a CAI language 
which was designed and implemented by authors who were 
experienced CAI authors and who used the language to 
program CAI materials.* The result in the case of COMMON 
PILOT is a language which is powerful enough for program¬ 
ming sophisticated CAI materials, which is efficient enough for 
use on microcomputers, on minicomputers, and on large main¬ 
frame computers, and which is simple enough for teachers to 
master in a short workshop. With our implementations it will 
be easy for all CAI users to get access to 100% compatible 
systems that are extended enough to deliver high quality CAI. 
The SWTP 6800 version provides an inexpensive entry into 
CAI for new users. The PASCAL version provides an easy way 
to implement COMMON PILOT on larger machines either by 
running directly or by coding from PASCAL into machine 
language. While the exact configuration needed for the 8080 
version is not yet defined—and may depend on vendor support 
—it will provide an alternate low-cost entry into CAI. Potential 
users desiring a more complete description of COMMON 
PILOT may obtain an author’s guide from Micropi for $6. 

Micropi also plans to offer courseware written in COMMON 
PILOT. We will have a number of courses available by Fall of 
1978. It is hoped that the library of courses available will 
continually grow as the availability of low-cost hardware 
encourages more CAI authors. We also have the facility to do 
machine translation from COURSEWRITER II and III and 
much of BASIC into COMMON PILOT. 

So, if you’re interested in CAI that’s like the big guy’s CAI 
but at hobby prices, look into what COMMON PILOT offers. 
If you are tempted to invent another version of PILOT, please 
let us know what you propose. We’ll transmit them, but not 
necessarily advocate them, to the standardization meetings. 
It just might not be too late to avoid doing to PILOT what has 
been done to BASIC. 

* We have observed that programmers who are experienced 
with computers but new to COMMON PILOT and CAI often 
propose extensions to the language which are of very limited 
use in CAI programming. 

Editors Note: People’s Computer Company publications have 
long been interested in implementations and uses of PILOT. 
Articles, programs and listings can be found in the following: 
People’s Computer Company Newspaper Vol 5, Nos. 3-5 
People’s Computers magazine Vol 5, No. 6, Vol 6, Nos. 1 & 2. 

A complete documentation and source listing of Dr. John 
Starkweather’s 8080 PILOT can be found in Dr. Dobb’s 
Journal Vol 2, Nos. 4 & 5 (April, May, 1977). - TR W. 


Number 27 


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


Page 47 

333 




Dr. DoBB'S loURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 28 September 1978 Volume 3, Issue 8 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 


SOFTWARE 

EM8080: An 8080 Emulator for 6800 Systems Gary Gaugler 4 

Now you can run 8080 code on a 6800 

Lisp for the 6800 Fritz van der Wateren 24 

Description of an implementation of this list processing language 

FORTH Dump Programs John James 26 

Some examples of programming in FORTH 

Dumping Northstar Disk Files Titus Purdin 38 

Vocal Memory Dump Phil Mork 42 

Demonstrating a simple voice output technique 

HARDWARE 

The Last of the First Aubrey Dahl 20 

The last Univac II is laid to rest 


Making a New Case for the H-9 Terminal Howard L. Nurse 30 

Converting Heath’s terminal to display lower case 


A Programmable IC Tester for KIM Joel Swank 


33 





© David Dameron 1979 




INFLATION HITS DR. DOBB’S 

A magazine depends on the good will of its readers for 
its continued existence. Dr. Dobb’s Journal has been 
especially fortunate in having readers who have put up with 
irregular deliveries, occasional foot-in-mouth disease and 
have yet submitted valuable material out of sheer interest in 
the subject and a desire to share their enthusiasm with 
others. We count ourselves lucky for knowing such folks. 

However, Time and Dow-Jones wait for no man, and the 
rising cost of everything is forcing us to increase the price 
of Dr. Dobb’s. We have gone on for 214 years without an 
increase in the cover price and now find it inevitable if we 
are to survive as an independent journal which accepts no 
paid advertising. Starting with issue number 29 (October, 
1978) the cover price will be $2 per issue and the subscrip¬ 
tion price will be $15 per year. Until October first, we are 
including the opportunity to subscribe or renew your 
present subscription at the old price of $12. 

While we regret the necessity of a price increase, we 
hope that it will enable us to continue to present the kind 
of articles and comment which will make personal 
computing an interesting and rewarding activity. For this 
we can only partially rely on money. The other part of the 
equation is the continued confidence and support of you, 
our readers and contributors. 

— Tom Williams 


SOME PRAISE FOR A SUPPLIER 

Dear‘Doc’: Received: 78 June8 

Just wanted to drop you a line to let you know how much I 
enjoy your mag. I think it’s first class. I also think we ought 
to thank all of the authors who have so kindly allowed you 
(and all of us) to share the fruits of their labors. 

Sometimes, we hobbyists are quick to condemn a supplier 
for poor service, but slow to praise good service. I want to do 
my share to correct this by mentioning a company which has 
gone out of its way to help me with an equipment problem. 
The company is George Risk Industries, G.R. I. Plaza, Kimball, 
Nebraska 69145. They are an OEM vendor of keyboards and 
related items, and have several low priced models for the 
hobbyist market. I had a problem with my keyboard, and I 
wrote them a letter describing the problem. To my surprise, 
I received a personal reply within 1 week, including mailing 
time. The info was helpful, but did not solve the problem, so 
I wrote again. Within about 10 days, I had not only received a 
reply, but also a bag of parts which fixed the problem, all at 
NO CHARGE. Considering the tales of woe we all read about, 
I was most impressed with this service. Along with the ‘fix’, 
the company included some other useful info. They are dev¬ 
eloping applications sheets which show how to interface GRI 
keyboards to popular microcomputers. Keep up the good 
work. 

Regards. 2514 Glendale Ct. NE 

Lewis Moseley Conyers, GA 30207 


...AND MORE PRAISE 

Dear Tom: Received: 78 July 24 

I have read for many months now your comments about 
the widely varying quality and support offered to the Micro¬ 
computer fraternity. Once in a while, something unusually 
good happens and this is the reason that I want to call it to 
your attention. The good guys in this case are KEA-Micro¬ 
design of Canada, the manufacturers of the Graphic-Add 
Board which when added to a P.T. Co VDM turns it into a 
device capable of excellent graphics for the extremely modest 
sum of $50.00. 

I originally purchased Graphic-Add when it first came on 
the market and because of my limited software experience 
was at first chagrined to find that the software basically was 
written for SOL and the SOLOS operating system. I had 
neither. What I did have was a Micropolis disk system that 
used packed BCD for storage while Solos wanted pure Binary. 

I wrote to Ken Anderson and got an immediate response 
and a number of helpful suggestions. By the time I was done, 
Ken Anderson had written me a conversion program using the 
peculiar Assembler Language calls of Micropolis so that I 
was able to link Micropolis Basic to Graphic-Add. 

I was still glowing with pleasure from the help that I had 
received, when to my surprise, Ken Anderson sent me a com¬ 
plete updated set of software, at no extra charge, with a 
wonderful cassette which included a super version of LIFE 
with full graphics, a graphics version of Li-Chen Wang’s 
Robot Language, and a patch called GAX, which when com¬ 
bined with P.T. Co’s Basic 5 gives a powerful Basic with full 
Graphics Control Commands. 

I have really never written letters of praise before. But 
when one gets this kind of support and interest from someone 
really interested in helping regardless of the miniscule cost 
of the purchased item, I figured I had to let you know. 

By the way, while I am handing out rare praise, may I 
also compliment Micropolis for their support and rapid res¬ 
ponse to my many and varied questions about their system. 

Sincerely yours, 1 Rutlege Road 

Raymond M. Glueck Pine Brook, N.J. 07058 


FLASH WARNING-SAM 76 CP/M RELEASE 

News Release Received: 78 July 31 

Forty undescribed but working functions. Particularly 
dangerous uncautious execution %xu, etc. /=. Watch Dr. 
Dobb’s for descriptions. The source program for the disk 
functions as implemented in the CP/M version will be pub¬ 
lished in Dr. Dobb’s Journal, however copies may be 
purchased for the implementation of the moment—no 
guarantee that it will match the object code furnished—but 
to serve as a model for implementation in other disk systems; 
price is $10.00 postpaid; available as a xerox printed copy 
or in machine readable form on standard diskette or paper 
tape [TDL macro format], SAM76 Inc., Box 257, R.R.l, 
Pennington, N.J., 08534. 


Number 28 


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


Page 3 

337 




EM8080: An 8080 Emulator 
for 6800 Systems 


BY GARY GAUGLER 

2276 Beaver Valley Road 
Fairborn, OH 45234 

If you enjoy your 6800 as much as I do, you rarely spend 
much time with thoughts of the 8080 or Z80. Nevertheless, 
there always seems to be some program which appears in a 
magazine that I would like to try out but can’t since it was 
written in 8080 code and won’t work on my 6800. Well 
now we can run 8080 code right on our 6800 machine via 
“emulation.” 

Emulation is a technique whereby the code of the “target” 
(the 8080) is executed on a “host” machine (our 6800). 
The emulation process executes the target machine code 
via software written in the host’s language. So what we have 
is a way to run 8080 machine language programs via software 
in a 6800 system; we do not have to rush out and buy an 
8080. All of this emulation capability is not free; the cost is 
loss of speed in emulated code. Code which is run on an 
emulator (at least for macroprocessors like we use) will be 
slower, much slower, than it would be if run on a machine 
for which it was intended. Since fast execution was not a 
prime consideration for emulating, just the program’s intended 
function, the slow execution time can be tolerated. 

The emulator maintains a set of pseudo registers for the 
8080. These are actually locations in the 6800 machine’s 
RAM such that when a reference is made to a specific 8080 
register via an 8080 machine instruction, the RAM location 
corresponding to that register is operated on to result in a 
RAM contents equal to that in the real 8080 register. One 
of the most important registers to emulate is the condition 
code register; great care must be taken to ensure that this 
emulated register contains valid results for all operations 
which might be performed. 

The emulator presented here provides a bonus feature: 
it can execute 8080 code and in addition, it can do so in a 
single step mode. This is nice if you want to try out a routine 
you have seen or one which you have written in 8080 code 
and would like to observe the program flow step-by-step. 
This feature is possible because EM8080 contains two levels 
of emulation: a monitor level in which the user interacts with 
the emulator and provides instructions to the emulator, and 
another level which is the actual emulation function. 

EM8080 displays the emulated registers when requested 
through the emulator monitor (the RG command), whenever 
the emulator stops emulating because it encounters an opcode 
it does not emulate, or when it encounters an address which 
was specified as being a break address. There are certain 
8080 instructions which are not emulated—those which deal 


with the parity bit. When an instruction is encountered but 
is not emulated by EM8080, emulation ceases and a message 
“NOT EMULATED CODE” is displayed along with a register 
dump. 

The instructions which EM8080 recognizes as monitor 
commands are: HP, AB, CB, LO, CR, RU, RG, SO, SF, PC, 
EO, EF, EX, control C, and space bar. When the emulator is 
first executed, a colon (:) is displayed which indicates that 
no emulation is in progress; the emulator is in a monitor mode. 
The HP command will print out a summary of the monitor 
commands and explanations in case you should need a little 
refreshing while emulating. The other commands are: 

AB — This command will cause EM8080 to prompt for an 
address which will be the breakpoint address. When a 
program is being emulated and the address set up by 
the AB command is encountered, emulation ceases 
and a register dump is performed followed by a return 
to the emulator monitor. 

CB — This command removes the break address as set by the 
AB command. 

LO — This command permits the entry of octal data into 
memory. 

CR — This command clears the emulated registers. 

RG — This causes the emulated registers to be displayed. 

SO — This command enables single stepping through the 
8080 program. 

SF — Turns off the single step mode. 

PC — This command sets the 8080 program counter (PC) 
to a value entered from the keyboard. 

EO — This command enables the echoing of characters 
when received. 

EF — Turns off the echoing of characters (normal mode). 

EX — Also control C. Returns to M1KBUG monitor. 

RU - Also space bar. Causes the 8080 program to be RUn. 
The space bar accomplishes the same function but is 
ideally suited to use in the single step mode since 
execution of each instruction is initiated via a single 
space bar depression. 

I/O 

The only specific care which must be taken before using 
the emulator is in emulating the input character function 
from the keyboard. EM8080 may be used with MIKBUG 
at 300 baud maximum or with an ACIA type monitor at up 


338 


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


Number 28 









Install a DPDT or DPST switch as shown. When emulating, throw the 
switch closed. When operating the computer normally, be sure that the 
switch is open. 


to 9600 baud. The input character function is handled via 
an IRQ interrupt initiated by the start bit when using 
MIKGUB or via the receive data register full flag (RDRF) in an 
ACIA. The program listing is written for the MIKBUG monitor 
with the necessary modifications noted for use with an ACIA. 
Both versions have been tested with the benchmark program 
and perform the same. 

Fig. 1 shows the hardware changes which must be made to 
the MIKBUG interface (the MP-C card with the SWTPC 
68 computer). When using an ACIA, connect the IRQ (not 
the NMI) pad to the “I” pad on the MP-S serial card. 

The emulator was benchmarked on the PALO ALTO Tiny 
Basic by Li-Chen Wang which appeared in Dr. Dobb’s Journal, 
Vol. 1, No. 4, May, 1976 on page 12. This BASIC runs about 
twenty times slower than the same BASIC on an 8080 system. 
The emulator was run on an SWTPC using a / I CPU board. 

Due to the length of the emulator (about 3K), 
arrangements have been made with Computerware in 
Encinitas, CA to supply KC cassettes of the emulator and the 
benchmark BASIC for $9.95 post paid. Computerware’s 
address is: 830 First St., Encinitas, CA 92024. 


tr z 
*- 3 

cn a 


< * 
u 
• o 

a o 
u_ a 

_J < 
O 03 


> z a z 

: M i/i o i/i a o 

a a a o •- 

o « < a i- 

a x < x < 

<x UKU JU 


3 x < i z a 

t-4 O C 
3 (Vi Q -4 O >- 
• U 

KOHOUJ 

> 3 3 3 3 > 
jaaiQ.cc 

«t- z ►- z c 

> d d —h a 
) O X O X •“* 


< o 

•- UJ 

a z 


a a 
cn 3 
a 
uj a 


u 

►— < 
uj a 

o IP 


cr z a 
z o 

M I UJ 


a a 

i < < 

u i u 
z <_ 

c <X 
a o 
1ZK 
(Vi •-> 


OUJ-UN440CL/IO 
O^Q-IJ-UOCJOO 
00—<—<000000 
aaaaaaaoaa> <r 


z o 

OZh®3 
O -« O -T CO 
OOuJOJC 
IP UJ CD < •— 
CD » & X 


a < 
o o 
« a 


< < 
<r < 
l/ll/l Q t- 
o < j in 


►- u. oxo 

uj _j u rvj 

o o a - 3 z 

a <- o a O »-< a 


i/i u n 
Z Z O 

o o 

X X a 


<0X0 
zoo 
O Z 
X *-« a 


<10 1/1 

4- t- O H- u. 
Z a <1 Z Z _J 
o - _j □ o o a 
x a a a x x o 


tn z 
in <r 
*- a 
x o 




3333333333 

OOOOOOOOOO 

UJUJUJUJUJUJUJUJUJU-' 

O *-< in in 

3 < i ax i 

crt-oxonj 'i in 

— e3Z<x3-<3— o 

xac*-cDcaca*-< 


o < x x a 
a a o ►- x 
O CD _J IP 


a > 

< *-• 
x 

IP z 

hBO 

-« o 
a o o o 
o in <i uj 


3 < < < 
O O ►— *-< 
UJ _J IP o 


a a a a a x 

OOOOOOr- 

Z Z Z Z Z ^ if) 


< cd < a: cd < < 

x>-<a<aa<<o<<<oa<<uj<xa<aa 

HUJiPoiPiPotDi±j*-occujiPomzcoiPt-inip 

ipiPccjnjuaHPjucDijuccj-OiPCDai 


uj o —< o 'r*> o cd uj oo 

< o o< o < ar-o 

r- o < -< -< o —■ < m a — C ao<o<ucr 

ip «a a n a a <\j pjipo —* a o oivipaipcir 


ip>pr-co«7'o-<(vjn>t 


OU-UN < 4COIPO 
Cf^C*3<J(_Ol_OC 
OC^H—<000000 

aaaaaacoacc< 


o o CM ip co 
c o o o o 
o o o o o 
IP IP IP IP IP 


c c 
c o 
IP IP 


cc a 

-< -< n 


«N«9<CDUHlV409UliiU. -<4 'CMJUliJIl.Hn'CO'Oa 

rrr,r, r'r.rjjj -4 -4 -4 
ooooooococooooooooooocoooooco 
LPIPIPIPIPIPIPIPIPIPIPIPIPIPIPLPIPIPIPIPIPIPIPIPIPIPIPIPIP 


Number 28 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Page 5 

339 




CD < ►— 
< UJ CO 
Z _l UJ 
UJ U h- 


uj in in 
x uj cr uj 


o o o o o o 

UJ UJ UJ UJ UJ UJ 

a a a a a a: u 
o o 

CCUDUX J<U 


O O Q 

-J _J — Q -< < 

u. u. a. o <x a. z 

k cd y: a cc ic 3 

x < in uj < in a 


I O O {/) 

o o -j in < x 

*-_J<U_:DOXt-U4U. 

hju.z>-zzh<ikjo 

U.H3U33IOUJ3Q; UJ 

' *—xo:ina:Q:»a » o (_> a: 


inminininininin z in in in 

inxixxxxxx kxoi i 

u.OfNjrvjt\jnj(>jc\jrvjrvju»in»yuf\iU'T 
JUKt-KKt-HKI-JXHQ.hai- 
cr a: 333333 Djq:iu303iu3 
o»oooooooou*o»o*o 


Z>D~a»-OXXUJ< 

oo j jwujoa z a 
ujiuuuk cr jute® 


DahUJHuj<xQ:><aaQ. 

oininzinzccoinoininx 

UJ“>»-CD*-CDCD_J")_l“>n"> 


u in a in 

Zb- _J b- 

a u a 


urn a in Daacrcrcrcrttaaaxxxin 

Zb- _J t- CJ J J JJJ JJJJJOZKh 

*-• a o cr uji_>ui_juuuijuou_i*— incr 


Dorxaaaoraaaaaxaxaxa 

oinoinminininininininoinoinox 

UJ~>_l“5—>_J—>_J—> 


z z 

3 3 

a a 

o O' u. < 

a o co 

< < < < < r\j u. 
in in o in in o o 

UJ U O Mil O -O O 
or-r^njU-CDOJfvj 

®UCO(MJU.^-J Nff 1 
CCCCCCUjUjIlU.' 
oooooooooo 
ininininmininininin 

in'Cr^-coo'©'—rurw 
44444ininininin 


MJ O co uj u. co cc co 

coo o >c sec u o cc 

—•<r-<i.-uj<o«iooo 

ininoin—cinujinujinin 

OO'DO'C OUJOUJOOUJ 

cof^ivr^c\ji\jOGCija or r- 
cDCDu-nvo® <o on® O' 

UU.U.UUU.UUUOCC-© 

OOOOOOOOCF-«r<^ 

inininininmininininininin 


U. O' 

r- cr 
o cr 


u.o c-.(vjn^-om>o r*- 

CC U ODCDCDGOQDCDGDO CD 

< < <<<<<<<< < 

inir inininininininin in 

U.U.U.U.U.U.U.U.U.U.UJCCU.O' 

r*-r^irr^-r^r^r^Kr^r^oou.n 


in in 
4 in 


4 r» co cd uuu. ivjn^cru i. win® muu. 

—* — --^--i\.(\jMV(\j(Vjnnnnrn 

in in in m ininininininininininininininin 

r- co o —* n4in®NcDO'oiHwn>tin'CN 

f*- CO CC COCOCOaOCCCOCDO'O'O'O'O-O'O'O' 


CD U. < < 

© < o o 
o < o o 
in in uj uj 

OUJOOl 
(E O (T CD I 

> o cr a* * 
t 4 4 4 4 


<<<<<< 

o o o o o u 
o o o o o o 
UJ UJ UJ UJ UJ UJ 


CD r- co uj 
O ffiOO 
o < o < 
in m uj in 


ininininininininininininininin 
h(\jh 

OJ CVJ CVI OJ 


' o ^ (\j n 
- o o o o 
i <\j r\j rvj (M 


in «o n co O'« 
oooooo- 
(\l (VJ (M (\J (\J (\J f 


< U. CO 
O CD U 
O < O 
uj in uj 


in in in 
4 in «© 
rvj oj (\j 


a: z 
b- o n* 
in — _i 


in o 
a o uj 
c a 


a cr »- 
uj < z 
I X o 


ZlflH 

o cr *- 
x 

u in 
O o 
k uj a 


z a in ► 
*—5 0: • in 

o o *— o uj 
a o u. z > 


J- l/l z 
« u_ a 
3 3 
* a ►- 

O UJ 

c ►— cr 
_J z 

*— u! 

o a • 
o a • 


o o 

►- H- > 
Z Z Z 
0 .5 O X 

x a x z 


»- o c 

z o u 

ozx~*zx-*xx 
xo * z o »z * * 
• XOXX^XOJO 


N X I\l 

- * z 
» o X 


n > »— 
Z - 3 
X » o 


\ Q. \ l/l \ < X (_) X UJ X X XI_1XQ.XU.XZXU.VE 

ajaDaxacooxa 3zooo>-oi-u.>-oxu.xx z 
luxQujjoujujauji/iuaujuiuujuujuujH 
* N.xx<ixox_jxi_>XQ:xaxinxinxinxujxujxx 


O -J 

w 3 Z 

vijxaxu.xzxu.xExcr 
~ ^ ‘ • u_>-oxu_xxzxt- 

"* * ".MX 


. o 

J o 


o -• a 
in < a o o 
u. x ►- o o u. _j 
j m 4 a < j u. 
(X < O < CD (X CD 

u i a cc <j u < 


<i a <x o. 
a in a x 

CD n CD 


x<rauj<a.ujxa 
ooxzoxzox 
jjur jucc jt 


<aoxxxx<<a 

oxujzzzzaox 


DUCDOCDUHUCDUCrOCDOCDUCDOCCOCDUCDOtDUEOCDDaa 

oooooooooooooocoooocjooooooooooinx 

UJU-U-U-U-U_U-U-U-U_U.U-U_U-U-U-U.U_U_U.U-U-U-U_U-U.U-U.U_UJ - l - 5 


cr in 

_J H- 
i_> a 


ooxooxooin 

cwoinuiKiflzi- 

ujt jni/iiHix 


o rvj m r*- 
in m ir in 
© © © © 
in in in in 


z m 
o z 

X X 

o co 

CD O O 

© « © cr < —* 4 oj © 
inirocino©©© 

U1 «— \T1 1.1 li I 

occ<rviir<(ViU-'C 

«IOO(\J4MO'CCO 
irin'EZ'C'C'C'CiD 
C CO© c oco© 

ininininininininin 

® 0'o-H(vjn4iT'0 
NMiatCC®! 


cc o 
O 4 
© — 
in in 


'O^-r^cooccDcoo'OUJ 

cc<x(\jooocf\jar^ 

u.^nin>OMcoo'CDo 

©©©©©©ococ 

inirinininininininin 

®0'o-H(\in4in®N 

CCCOO'O'O'O'O'O'O'O' 


®<-onoucDn-oj©(vjon-OMn-in^in^ino<© ouj 
4in4in4in4in4iririninininirininir. iT4in 4ir4ujin< trr^ 

©0(\J4'OCO<OUJ©('J4'OCO<OliJ©(VJ4'ncD<OUJ©fVJ4'ECOCOCD 

accococccccaaccoo' 00 -o-ooo<<i<i<i<j<i<<cc(rcr:crcrcrcr 

OOOOOOCOOOOOOOOOOOOCOOOOOOOOO©©© 

ininininininininminininirininininininininininininininininininin 

0'O'-(\jn4in'0N®0'OH(vir)4in®N®0'OM(\n*)4ji®N®0'© 

0'OOOOOOOOOO-<«-<-<-.rH rt ^^^(\j(\j(\j|\j(\jivjM(VJf\J(Vjn 


cr c 

o © 

in in 


cr n uj n < a) O' 
o M M 4 O © O 

© <T O O <1 O < 

in m uj uj in in in 


rvj(\iincocDuJ-*4r- 

GUUUUUCCC 

©ocooocoo 

ininininininininin 


Page 6 

340 


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


Number 28 





Q. 

>- 


< a z 

H- O «-* 

< o 

cz <j c; 


z *- o 

o — 

—' X t- 

►- u •- 

u z a 

3 <* 

a a 


in 


■ cc 


o 


UJ (/) OJ ► 
a in 
u in in ( 
lu 

I- uj s 
uj in ~ 
o Jt- 


-• X X Q 

ir • * z 

x o x o uj 


< X 
—< X 

-• n k o 

H- H- * U 

a * ouj 


s (via <r x 4) o rsj 't u 'C © rvj >j x >o o ru -r .© 13 x «n 

3aoioi/iohHhHiHj-t(.(Ma.('ihi\jifli\ji-nin nznhiii't iin-jt- 
’ion3noninnunikin<ninnon3noninniijn2nuniniiJOiiJ( r )uj3mn 

ja. 03 oaocrocrozooocroa.oo(_>aocrozo*-'oz<j(rzazozoLOct 


awu< <n 

X ZUJKKX 

i_> cd o in in ~> 


D<auo<<K<a 

O O X Z UJ h O D h X 

uj juiroin jjin-) 


z)<o_j<xx<aa 

0(TZinKODD<I 

uj»-<<in_j_i_jH--) 


3XCDCDCDCDCDCDOCCDGGCDCDCDCDU)CDCDCDCDCDCCCOCDCDCDCDCDCDCDCDCDCCCCCOCDCDCDCDCCCrCD 

OQOOOOOOOOOOOOOCJOQOOOOOOOOQOQOOOQOOQOOOOOO 

^lLaU.lL.lLU.U.lL.U.U.U.Ii.li.U.lLU.U.U.Ii.U.U.U.U.L.U.U.U.U.U.U.U.U.U.U.U.Ii.U.U.U.U.U. 


CO < U O o OJ 
U U U U O C 
~ ~ — (\i Pu 

in in in in in in 
-« ru m ^ in >0 

O' O' O' O' O' & 
(\J (VI (VJ (VJ (VJ (V 


ix cr r*- 

4 <\jo<sor> 

in c o in o in o in 

vC^'0<n-v£)Ljr-uj 

acci\j-jcc<u<ih- 

cococDOu.oninGo< 

O C C © C 

(\J(\Jf\j(V (\j(Vj(\jOo(\J(\j 

ininininininininmin 

o^run^in'Or^-cocr 

000000000c 


CD u. 'C 
nj (Vi cd 

(VI (V, o <1 

in m o m 


ooujo-«4r^a-uo 

(vrvrvrvrvfvn. 

(Vj(VJ(Vj(Vl(V(Vi(Vj(VJ(VJ(V 

inininininininininin 

— mi*) 4 in>OMoa o 
mmi’immnmmom 


iL.<in<r'00(n<vjno^oD(vir**^(vir^«xocoujo<(vj<r:oDa'co<cDo(vjcD<cD(v:(rD'0(vj(r 

<u.ivjnoo-J4ir«(vjuoMin^(n 4 .Hi 1 ji 1 .Din-jiruHiri 1 .u^-jukuauD^-ju 

(vj<vj«tr)^(vj^r>(vjn^(vj^r)^r)(vj(vj^r^nrvj^r)(vj(vj^r*-m(vj^r)(vj(vj(vif r )(vi(vj^n(vj 

inininininininininmininininininininininininininininininininininininininininininin 

u.A.-HninMMBQu.-Hnins^cDQu.^ninNa'CDQu.-ninMrcDQu.-'ninMJ'CDOu. 
(vivjnnnrinnoo^^ 4 4 ^^•^«tinininininininin'C'C>o<x;»c»c*o*or^r>-r-r^h-r^r^N 
(vtvj(vj(vj(vj(vi(vj(vj(vj(vj<vj<vj(vj(vj(vj(vj('j(vj('j(\j(\j(vj('j(v;(v(vi(vj(vj(v.'(vjrvjrvj(v(vj(vj(vrvj(vj(v.(\j(vi(v 
ininininininininininininininininininininininmininininininininininininininininininin 

ivin>tin<£>r-coo'o^(vjm>tin>or-coCT'0^ojm>tin'Or^ooa'o-.(vin>»in'nr^coa'o-H(\jm 

rvjN(vi(virvj(viiM(\jr)nnnmnr»mnr)>t>t>t>t->j>t>t^>t>tininininininininininsOvO'£)«c 

nnnnnnnnnnnnnnnnnnnonnnnnnnnnnnnnnnrinnnnni’i 


z z II- 

cr < 4 > 

3 a. oc 

h- u. o 

UJhQOH 

cr uj a in 

uj ►- a — 

O Z 3 
ZhUKK 
< X UJ UJ UJ 
cr x © o 
z UJ Ul 


o 

UJ X 
X < 


c z 

O Ul 
l_> X 
UJ 
uj a 
> o 
< z 


z < 
o z z 
— c — 


Z Q 
O _l Ul 
*-• UJ 0 

cr 

4 u 3 

z o Ul 
Humu 
h- u> a 
in a a 3 
Ul 3 o o 
oouin 


* x 

• m o 
1 < 

• x cr 


in <-« in o in — in 

UJ UJ UJ UJ 
H- II >- II >- II >- 


o x o a. o 

X X Ul 
o o cr 


> 0 >- x u 

I- Uj I- Ul a 

cr x 3 

> > o 

a 11 cr 11 in 

o o 

iinxwh 
UJ UJ Ul UJ Ul 

X >- X >- o 


z 

o 

•— 4 

>- >- o 

U < UJ 

3 o cr 
cr 

H- UJ Ul 

in u o 
z a a 
•-33 
o o 
o in in 


a 4 »- 
Qhlfla 
O 4 •-« UJ 

4 o o cr 
uj x 
> >- cr 3 
a cr z 
c o c 

X X >- o 


x_iin»-Kt-.»- 
ui < uj ui ui o UJ 
x x >- o o a o 


o *■* 
in < cr 
X 1- o u 
U < Q U J 
a. o 4 a a: 
* a n uj u 


j in o x o 
• •- a * a. 
« uj o o 


o o m 
o win 
a * in 


©o-*o-*o©© 

UU-4OC0-«O 

*«o*i_)»ucr 


• oc * cr 


ui © in o in r 

awi/ixoauiN 

#*i/)iroxin*i 


J- * O P- ♦ H • Z 
troo** cr © uj 


O 4 XuJO 

ox * cc o 
Q “) I O # O 


3 x a a x a 
o c in in k 1 
uj 3 3 3 in 3 


)H << 4 < < < 4 <4 <4 < < 

C ►- 

ox<<cnxxx<ocrcr(r<xo<<OQ.oaoaoQ. 

CDQQI-4ZKI-[DZinininhCEZl-CDZIUJlUJlUJ7 
)ajjini->-<ini/ii-<jjjini'4ini-4uccu(ru(D3 
c *- 


in i 
> z o 

- *-« H- 


3 0. 
C5 X 


3 a 

O X 


3 a. 

O X 


<< < << 4 4 CD 4 4 <<CD 

Dx<aoao<a.uju<44aujU44a 

OOQIUJXUIQXZUJI-QQIZUJI-I-X 

ujjJUCDutrjuiroinjjucDOinin 3 


3 a. o x 4 x 4 
o x uj o o o o 

Ul U CD J J J J 




^ Ul 
00 f" 
< © 
in uj 


N U CD 
4 CD O 
© 4 © 

uj in in 


in in in in in in 


co a- © 
— rvj 
rvj rvj rvj 


u o 
CC CD 

4 < 

in in 


o 

© © 

> 00 © IT 


r^- 

o 


UJ 


- cvn 
(Vi (Vi rvj 

(VJ (VJ (VJ 


ui'On-'f>oouur»4444r^( fc 4r^N4^r^^n- 
u«cc—•ouu-—'Cc>t>r^(r~cocc^cccc(Vjoc(v 

rvjinh><aDuu.rvjr>in<o^coGDouj^(vj^^>oo< 
eca.ccncc(tao‘ffo(M^affO‘a<<<<44 

inininininininininininininininininininininininmin in in in in in in inininininininininininininininininininin in in in in in in in 

in'OM»^o^('in^in'OM®(ro-H(vjn4ir>ON®a' 

(vj(vj(vjivj(vinnnnnnnnnn44'44 4 >t >t 4 >t 
(\j(vj(vj(vj(vj(vi(vj(vj(\j(vj(virvj(\j(vjrvjrvj(\j(vjrvi(vjfvirvj(vj(vi(vi 


in © in © © in « 

( N -o >0 vO 4 N r 

n uj cr cc d 4 cr 1 
..I'OaocDOUor 

: c o c c o c u 1 


< (3 U < 

OC CD 4 CD 

4 CO 4 04 4 

in -h in © in m 


0 —« (\J 

in in in 

(VJ (VJ (VI 


in 
in in 

(VI (VJ 


r- cd 
in in 

(VJ (VJ 


© —• 
vO ■£) 
(VJ (VJ 


r> 

so >0 

(VJ (VJ 


l/l'CN 
«© © <3 

(VJ (VJ (VI 


CO O' O *+ (VJ (3 
-OONNNN 
(VJ (VJ (VI (VJ (VJ (VJ 


4 in o sco o o 
n- r- r*- r*- n- n- 00 

(VJ (VJ (VJ (VJ (VJ (VJ (VJ 


-• (VJ 
00 CD 
(VJ (Vl 


-t in «o m» o> o 
co cc co co co co o 

(VJ (VJ (VJ (VJ (Vl (VJ (VJ 


Number 28 


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


Page 7 

341 



3 I 


o 

a 


UJ 

z 

3 

o 


Ui UJ 

o o 


o 

CO 

o 

CC 

II 


¥ 

O 


I/) 


e 

o 

CO 


o 

ao 

o 

X 

II 

sc 

o 

< 

t— 

X 

© 

© 

co 

® 


z 

a 

3 

h- 

Lkl 

Ct 


© 

CO 

o 

® 

II 


* 

O 

< 

h- 

tn 


o 

o 

® 

® 


UJ 

* 


a 

x 

< 

o 


3 < 
X H- 

UJ 1/1 


z * 

-H < 
3 X 


3 3 

< a 
*-< a. 

o UJ 


o 

0. 


z 


UJ 

z 



o x * < * a 
a * uj * uj z 
UJ h Z O 2 UJ 


it I— 
h- to 
to X 
X UJ 



♦ 

o o * 

Q. CL SC H- 

* • Q H- IO 

UJ UJ z to X 

Z Z UJ * X UJ 



* O Q H- 

i- z a. < to 

lO ►— *0>-H- 

x to uj a ct z 

UJIZUJOH 


o -h rvj 
o < > >- 

u >- a: >- x 
* uj u u u u 


< < < < 


< < < 


<<<!<<<< 


3 < _J < CL 3QCtOtOtO<ICXX<<< <CL 

Dl- Dhl OtflhQUlQWOWOOhOKI 

0.100.(0”) 33X3030.30.33X3103 


3 to to to < 
ck oujq: 

UJ to J o CD 


3IOtOlO<X<X 

OhDUJOtOQlO 

ujto_jQ_iaja 


< 3 3 3 a: < a. 3 

O tO tO tO 3 ►— X O 

J < < < U tfl ”) UJ 


10IOI03<3<< 

KOUJDI-DhQ: 

ifl3oaioatoai 


Diotfltoxxaa 

OZt-OOKtfll 

u)Mio33toan 


3 < ►“ UJ H- UJ lO 

a o x z x z 

UJ 3 H CC H tE tr 


o < 


«x to 


3 

a. 


CO 


3 

CL 


to 

a 


UJ 

a 


o 

z 

UJ 


o 

z 

UJ 


« n 
>■ > 
a a 
a o 


© n 

© to 


— n- o uj 

< O 00 CE CD 

n < < < < 

to in in to to 


u o UJ ' 

CD CD cc r- 
<>-«<© <i n 
to © to © io to 


fw 

o CD 
< < 
to to 


—* N- U O < 

OX CD O CD 

<X «I < <3 «x 

to to to IO IO 


o uj - *■« r*> 

II CD n o or 

< <* n <3 «j 

to to to to to 


UJ 

CD 

< 

to 


N- O 3 O' 

00 O CD CD © 

< < < <j n cc 

to to to to © to 


® o U 
CD UJ O 

< < >c < o 

to to © to © 


® 
CD 
UJ < 

o to 


(\jr*-(\jr»uj ou.U4 < 0 <C< 0 <CUJ< 0 N< 0 NUI 

n < n < N* CDCCCDf r )CDf r )CDf r )U<CD«X CON* 


U.UJ40 
CD CD &) (Vi 


U.UJ4<O<O<O<O<OCC00(OU.MiJ 

iirnanffncc44'jNCDN 


L.UJ4(\JN(VJN© 

xxnnxmxoj 


— 4 U U UJ u o u. 
n cd a u u cd t- 


OQOOOO 4 N- 

ccr^(VJN*(Vin ®co 


UJ U CVJ 4 
©©•—•»-<>—• 
o d n n co 
to to to to io 


r^r^<o©«^^io®a>uuj-Hfo<o 
l Hi«>Hn(Vj(\,(v.(Vi(\i(Vi(Vi(Vir r n to 
nonnnnnnnnnnonn 
lOlOlOlOlOlOlOlOlOtOlOlOlOlOLO 


O' O' o u o 

r r ro r. 4 

n r, m n n 

to to to in to 


cvjf\jx®o>oo©^4X®r^ 
4444444xxxxxx 
nnnn cr r> n m n n n co n 
totoioioiriotoioiototoioio 


<0 OOnONCOCDUU. 
to to <0<C<C<0<0<0<0<0<0 
nn nnnnnnnnci 

tom lotoioioioioioioio 


^^rvjto®coujo 
r^r^N-r^N-r^r-® 
n ci w o Pi ri o ci 

toioioioioiototo 


CICIOO 1 CCUJO 
ct a cc cc ® ® O' 
Cl Cl Cl O Cl O Cl 

to to to to 10 to IO 


*-• n 
a O' 
n ri 

to to 


® o< © ^ n^i/i< 0 N® 0 'Ort(\jn^i 0 ' 0 N 

C1C1C1.J ^ 4444444XXXXXXXX 


o< o rvj m 

to ® ® -C 'C 

4 4 4 4 4 


i0®r^®0'o^(\jn^-i0'0N-®0' 

<0<0<0<0<OSNNNNNSNNN 

444444444444444 


^ryci-jio-csooo' 

®®®co®®®®® 

444444444 


<vj r> 4 to ® 

O' ^ O' O' O' 

4 4 4 4 4 4 


N- ® Oh(\jC) 

O' o> o © © o 

4 4 IO IO IO IO 


<f to <0 ® O' 

© o © o © 

to to IO to LO 


o 

a 

u 

INI 

o 

z 


o 

X 

UJ 

INI 



3 

Q 

O 

u 




a 

UJ 


n ® o tvj n 4 I <o o tvi n 4 ® 

lOXlOX Zl0NOl<0O<0l/)<0NNNNNMNh 

nujnujujni/inoncinocit/icincinnujcii/i 

ozozzoaoaoooaoaooooozoa: 


z 

o 

f- < < 4 < < 

>-• N-QN-Q^-Ql-Ql— Q|— 

Q 3Z3Z3Z3Z3Z3QH- 
z xujcrujcrujaujcrujcKZuj 

O 3 3 3 3 3 3 3 3 3 3 3 UJ a 
O 


O 

to -< 

X < o 
U X N- U 3 
3 3 4 3 3 0 

a z o a. *- z 

* O « CL O I 3 


♦ ♦ 

Z to 4 CD 

ici- OX X 

►-to O 3 to IO X 

to X 0X3 3 • 

*X3 o» a x© 


♦ 

(O CD 

-• tH 0 3 

X 3 I— lO 0 3 3 

Z IO X 0X3 

© 3 0X3 0*0. 


GDCCCDCDCDCDCDaOaD(EGDCDaDGDOOCDanCDCDaOCDCDCD 

ooooooooooooooooooooooo 

UUUUUUUUUUU3UUUUUUU3UUU 


«(CI\J[rCDUMj.<(J'<<DlO(VjClNQ4UJ(DlillVJ 

3UOOO®4XUt\J®©ON-403('J®©ON-4 

n(Mn(ViM"}n(\j(\j^<j^(v^r)Mn^^4W<jn 

u^®u)inirio®ir>i/ii/iinu)i/iioioioioioioioiototo 

Hni/INO'COQU.HCllONO'CDOU.-iCllOMMllO 

®®®cc®ccccaaoo'0'0'0'0'0'<<4<<<< 

cvjcvjcvrvjcvcvcvjojtvjcvjrvicvjcvjcv.rsjrvjcvjfvjcvcvjcvicvcvj 

loioioioioioioioiotoioioinioioioioioioioioioio 

4l0®N®0'©*-*f'Jf*)4‘l0®N®0*O«-*{Vjn4l0® 

'O'O'O'O<O<ONNNNNNNNNN®®00®®(I)(C 

connnnnnnnnnnnncnnnnnnrjnr) 


o 

3 4 0 4 0 
Z Z X 3 X O 

X CC CD CC CD cr 

3 


to 4 3 4 a X 
O X X X X X X 
X CD X CD CD 3 3 


3 x x x a o x 
OlOQtOUlZ x 
3 3 3 3 3 •-* 3 


X XXX4444 


X XXX 


310(0104X404414 
OhOUJQDhZI- Cl/O 
3®3033tO*-<(03X3 


IX 3t0t0l04X4U< 

IO X 0>— Q300H-ZN- 

X 3 3 10 3033I/)h(0 


3 

X o o 

© —• 

n n 

* * ♦ o o 


o 

rvj 

n 

o 


o 

m 

n 

o 


o o a n- 
® z 3 

O C13X 

O 0 3 3 


X 

3 

z 



4 

I 


to 

3 

X 



X 

o 

X 


® © 
N- ® 

NI\lC)liJlL<ir'CNMC10Cl 

_^,_ooococooir:io 


X ® 3 X O ® 
© ® N- ODN 
© < © © 4 n 
IT IO 3 IO IO IO 


-« N- 4 U 

OX X 4 

4 4 4 4 

to X X to 


CVJ to 

u u 

x r\j o o 

to to o o 


^ N- 

N- OX 

n < c 

x xx 


4 u ro © 

x < -i 

<t <i m m 

xxx x 


®0N“04©X0<0X33 030003 

l\j(\J(V(VM\;(\J(V(VJ(VJl\J(VNN X <J CC X 0- h- 


334<03N-ON-vC<Cv£)vt)UJ 334®3N-ON- 

aiEi'ikUii.irL^^^cis xxcouuuxu 


b.HClXMMDOli.HC)XCD 

4 aaacr xxxxoooo 

<\JOj(\Jt\J(VJ(\J(Vj(\i(\jC'J(Vj(Vj(\j 

xxxxxxxxxxxxx 


CD CD 3 <J N 4 

o o o o o c c 

CVJ <Vl (Vj CVI CVJ CVJ CVJ 
X X X X X X X 


00©r)4f^403-*n4- 

OC3UUU.U3U.UUU 

CVJCVlCVJCVjCVjCVjCVJCVjCVJCVjfVjCVJ 

xxxxxxxxxxxx 


<Of^ 4400 h^c.<(J) 

uu uuuococoo 
cvj cvj NNftjcicicinnci 
XX xxxxxxxxx 


®0'o^t\ir)4X 

®® 0 '^ 0 ' 0 ' 0 ' 0 ' 

OOCIOCICICICI 


®N®0'©H(\JO 

O'O'O'O'OO©© 


X <C S CD O' C h 
© © © © © ^ ^ 
4 4 4 4 4 4 4 


n4l/'<0N®0<OHftjO4 
—— ^CVJCVJCVJCVIOJ 
444444444444 


X® ®O s O»-«('JI34X® 
cvj cvj (Mf'jmnnnnnn 
44 444444444 


Page 8 

342 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 28 




z 

O < 0 < 0 <<J<X 0 < 0 < 

•-* Q.QQ.QQ.OQ.QQ.QQ. 

H I2I2I2ZZI ZI 

»-• DUJJUJjUJ^UJJliJD 

Q 
Z 

o 

o 

Z (/)< 0 < 0 <Lu<_l<»—' 

o oaoaujazaaorz 

mcrcrmfr. rrnrmrrrrm 


cl o z 

O Z J> 

* a uj 


^ ct a. a 
o <n a: r 

UJ 


kx o o a. o 

m » o o o z 

*-• o * uj < Q. UJ 


aoj<<<o:a 
I/ICOQ hhl/ll 
CC<UJ»-l/)in~>“) 


COCO O O O 

•£• a ®> O ■£> QvO Q 'O O OvOO OsO Q 
X<ZKXZX<ZXKZX<K zx<xzxxz 
n • uj n • uj f*j » uj r*} » UJ n >- • uj m >- uj m • uj 


a o<atr<ao<a o < o: o o: < a o < < a a < 
u'QQ'i/iDai/urawzauizcai/izacn/izQ: 

CD<CECD(AlCCCCl/'£rCD<CDa;H-'UJ<t’Cr*-«OCDCCOCD 


o _j < d < c < < a 
coazozcri-r 
uj <r »-< _j < < 1/5 “> 


(MDOu.^mnNO'CDO u_ u. cu in co co uj « ru 

<v(\j<v. rv. <v r; r> r, r r, 4 4 

<'4-4-4'4^^«4«4>4>4 -4 >4 >4 >4 >4 >4 >4 <4 >4 

inininininininininmin in in in in in in in in in 

iD'ON®ao^(\jn4in'CNcc o —< rvj n in ® ^ ® O' 

cDODcoooooo'O'O'a'O'O'O'O'a' 0000 00000 

inininininminininininminin « >0 <c \o ® ® ® >0 >0 


»o in < co 
<r cd < r*- 
< < n n 
in in in in 


mmr-r^cocouj'-* 

>4*4-4>4«4>4>4>4 

inininininininin 

^Mn4in®Nffl 

\C-C'C>sC'C'C'C~D 


UJ UJ 

njocoor^>£5o^oocc<<orM^-<ocr'CCon 

ujoujooujocujoocoinocoinooaroo 

C0'OCOC0(\JOO-4OOOCCO0O<OC2—«C 

ocuj<v-ocuj<\jccuj<\iOCUj<'JOcn‘U.’<'Jcrf^u. | <\joDu.<'j 

4^)®<OUJOM4'0®<OUJ'<ninN<0liJO(Vj 

iriniriririr'C'f'C'C»c>£-»c< l cr^r^r-^-N-r^r-£ca 

44444444444444444444444 

inininininininirininininininininininininininin 

o — njri4-in»or^cco'o^<vfn^in>cr^ooo'o^r\.' 

nnnnnnnn( r )444 

'C>0>C£I4)'C'04)»0'0XIX3-CX)^4)4)'04)'£ I X)'0'0 


<cc 

<\j rvjtvj 
o 00 
o 00 


O'r^'4'O'JCcr^uj 

r- occ ou. - cc n 

OOn4<OQOCDOL. 
0 o o-a o o oa 0 

«4>4>44>4'4>44>4 

in in in in in in in in in 

o^(\jn 4 in®N® 

ininininininininin 

vC»C'C'£)'C'C'C'C'C 



Number 28 


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


Page 9 

343 



a 


QC. O 
at uj 
o at 


z a 
»- u 
o z 


a 

a 

< 

u 


c 

z 

o 



in 

a 

UJ 

in 

o 

UJ 

a. 


cr 

u 


o 


in 

a: 

UJ 

h- 

in 


o 

ui 

cr 


UJ 

> 

o 


— rvjncxaar- cm 3 cr 

•f ^ ^ HU 1 - -f IQJ1 J1U 

ooo«£uj>ouj< OO.Z 

UUO*-OXOZQUO*- 


cr cr n- -• i\j n a a z r*~ 
o~*mr z z z i ju-o -o 
uj>oujooozujoo 
ozozouo*-ooo 


INNNSNSS Q Q 

UJOOOOOOO oo 

ZUOUUUOO OO 


< in o 

X O UJ cz 

U UJ X U.O o oo 

za* xr o -< z oz 

•— » O * UJ * *— UJ UJ 


<j in cd in <j 

a o oc o cr ^ 

QQUUJ>< oouxuia^xa. Q 

o o uj cr * z o Q- • cr a :> • o z 
ooo*o*-*aujo*oroauj 


cc 

cr 

ox X •-* 

Q. * * > 

uj o I o i 


x o 

• z 

x o 


< < 


< CD CD < <X 


< < 


CD < < CD 


CD CD 


crcDcrcDcrcEaccLCDCDcDcc 

oooooooooooo 

U.U.U.U.U.U.U.U.U.U.U.U. 


CCCCaDCCODCECDCCCrCD 

oooooooooo 

UUUUUUUUUU 


cccrccacrcrcrxcc o < 

OOOOOOOOO UJ o 

U.U.U.U.U.U.U.U.U. O _J 


<XO<JO<COO<ICL 

*-ozazozujzt-x 
in_j*-*»-<_j<cr>—m3 


u<<xu<ux<x<<<ao. x < x < < 

ujoi-oujauioooot-Kifli o o o ►- cr 

o _j in j o cd o j _j _j _j in in 3 3 _j _j _i in cd 


-4 cr 
M o 
o z 
o ►- 


< CD 
cr cr 
o o 
z z 


o 

cr 

o 

z 


< 

in cr cr z cr 

m o i_ r*- •-* 

O UJ UJ o > 

o o o ox 


> > 
X X 


z 

z 

o 

o 


4 

Z 

o 

o 


•—u.xu.UjU.ujcrz<V3u.ujUj4cc:ujCMu_uj4<cr(\ju-Oucrcrz 
uj<U'Dccar^o>Jo — 'DcccT'croooO'CcocrcT'Oira— vCxct-< 


< < O' u. 
cd cr r- < 

< < x < o 
in it in in o 


z 

CD 

UJ < _ 

U. X © © 


Z CD 
CD M 
< r*, 
in in 


< < oo u. < 

CD CD O < CD 

< < IT < OU < 

in in in in o o in 


u. u < o < 

CD < CD < < 

< © < < in © n 
in © in in in © in 


co u. 3 

N ID ID 

n < © < © uj 

in in o in o uj 


3 

CD 

< © 3 

in o cd 


zzxxxxzruzzzxxxzrvtn4xxxxzrvz<rzxxxz 

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 


<zr-uior-4Z4r'-or<‘Uj < zf v -uj<o<ujzujzf , '-r'-ouj uj z uj n- © 
Mrac<octtu.L(i->jctN n-cccrcjZfMMU.UJOCccnujcDr'- u. uj u. u. cm 


UJ o © 
U. Z CVJ 


ujoi\J4'Ca)<uujo(\J4 
M'lnrrrrnr 4 4 4 
ininininininininininmin 
inininminininininininin 


<3CD<OUJO(\J4'OCI) 

4 -4 >4 4 4 in ir in it in 
inininininirinininin 
inininininminininin 


<uujorvj4'Cco< ou. 
xxxzzzzzz cz 
ininininininininin in ir 
inminininmininin m in 


cmxx<cdoocm4Xx 

r'-r-r-f^-MMxxaaa 

inmininininininininin 

ininminininininininin 


H UJ 4 S ^CDUJxn^C^OUJ'H 
a,icM70'0'(M><<<<<<cr 

in. ininmininininininininininin 
inininmirinininininininininin 


4 MM) UJ 

cd cr cd a a: 
in in in in in 
in in in in in 


© o 3 in 
o o o o 
in in in in 
in in in in 


4XZMxcr©e-<cM34XZMx 

333333444444444 


a-o - (\j n 4 in-c md o o « i\j n 
4xxxxxxxxxxzzzz 


>4 ZMxao—« cm34Xzmx 
Z ZZZZMMMMMMMMM 


o«(\jri4i/i'ONCD»o^(\jn4 z m x cr © 

CDCDCDttlCOCDajCDCDO'O'O'Oa O O O O O 

r- r*- m r*- x 


cvj 3 4 in 
o © o © 
CO CD CO CD 


UJ 

a 


O > O 
•— _J < 

*- z 
o o uj ; 

3 _i c 

a ccd* 

f- O < 

inoi- 

z 

— a a 
© z o 
© x < u 
in 

n uj m cm 
x in 

z u. in in 

c UJ 


O Z UJ 

3 < O 

a a o 

•- CD o 

in 

z c o 
— z 
o 

o h- o z 
J J z o 

* 3 O UJ • 

• co a o o 

3 


uj in 
a z 

O •-* 


O CM O 
O © O 

< o < 


(MOO 

o O o 


X X O X o 
• o o z 


o<o < © < a uj 


O O X M 3 

o a * o z 

<1 I.J O 13 lil 


< X 

ox UJ 
© © O X 


OHiMnao: in rvjmacrirr- >-• m 3 cr cr cr m 
OOOOOU—*© rQ-*—<00—•-‘X'MMrMOO'-'fM 
000©/UJ>OliJ<l ©©ZUJ^OUJOOO^Ul^ o 


. - CM 3 X a X m 
fMZomnoo—«nx 


< < CD X < < 


< < 


a<_j<io<o<<-j<a< 

caoaxzozcc>-3croor 

xcDXi-a<j<<inaxxcD 


a < < x x 

in o m m x 

3 _i in 3 3 


< 

M M f*- 

3 O © 

© © © 

O O O 


CM 

© 

O 


< x < < a 
o o M x x 

J J OUT 3 


CM O 

Z © 

© © 

O O 


3 < 
c cr 
uj t- 


UJ 

< < < < o 

o 

o_j<x<oaxa 
zini-oo < o x 

<<l/)JJKI-J3 

m 

UJ 

►— < 

© 

© 


3 cc cd cr cr cd cr cr 
caoooooo 

UJUUUUUUU 


CDtCDCCCCirirCECD 

OOOOOOOOO 

UUUUUUUUU 


ccffitcaDtuEccir 

OOOOOOOOO 

U.U.U.U.U.U.U.U.U. 


X X X X X X X X 

oooooooo 

uuuuuuuu 


X 


X 

© 


X X 

a x 
< o < 

X UJ X 


X X 
X X 
—« Ui < < 

© U. X X 


X 

X 

< < X 

O X U' 


O X ^ CC 
UJ X<M 
Z © < 3 3 
X © X X X 


XU X 

xx r— 

<<003 
X X O U X 


O' o z 

UJ Uj X 

4 4 < © © 

XXX © o 


I > "' — ‘Z‘ —, ULljUjMCC Z<UUUU<crCT'OCCUUUC , CCZ' — 'CTUU uj cm X 
COXUJZXC7'<U'4ZUZCCCrXUCXUZ®0'0'0'4M©ZXa'<0 


ZoO'r*-Z4Z4CDM(\JOZo 
MlNOr (t(JU.'-r3CHMV 


O Z M o Ui 
cr < x x m 


Z UJ N c UJ 

x u < cm r- 


r- 4 X M UJ Z z UJ UJ 
— X-4XOX C Uj Z 


'JZZXXXX-4fMZZXXXX'4fMXZXXXX'4rMZZXXXX'4fM 

xxxxxxxxxxxxxxxxxxnxxxxxxxxxxxxxx 


CMXM<XOUI©3'4MX 

<0<<<<<XXXCLX 

>J44'J4'J^44-J44 

xxxxxxxxxxxx 


< O U. IM 4 N < O© 

xx cruooc oc 

>J'4 4*4 

XX X X X X X XX 


3 X M <4XOUJ«4 

C C C CCOOCU.U 

*44-4 4444444 

XXX xxxxxxx 


M X < OOUJO(M4ZX<UUJ©CM4ZX<OUJOCM*4ZX<OUJO(M4ZX<0 

uu-'u. UjU-U.uu.uuuuu.uocc ccccc<Hnr.^^p.r-^(v J (V(va(\j(\ J (\ 1 

4-4 4 44444444444XXXXXXXXXXX XXXXXXXXXXXX 

XXX xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 


•—<(M34XZMXO'©'-<CM3>4 
Z Z Z Z Z Z Z Z Z M M M M M 

z z z z z z z z z z z z z z 


ZMC^O 

r^r-MMcr 

z z z z z 


CM 3 4 X Z X O' 
X X X X X XX 
z z z z z z z 


O — (M34XZMX 
OOOOOOO'O'O 

zzzzzzzzz 


O « (\) 3 4 XZMX0'O'^(M34XZMX O -h (\j 3 4XZMXC7' O >h AJ 3 
0000000000-HHHHHHHHH-.(M(M(M(M(M(Mt\JlM(\J(ll3333 


Page 10 

344 


Or. Oobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 28 




a 

UJ 

t— 

z 



to 

CL 


< 

a 

o 

UJ 

a 

o 

o 

<3 


o 

cd x ^ 

cr ujt- a) i- h oo oo 

XO (Tin*-«l/>l/)OuJUJO o O UJ uJ Q o 

• 2 ozx z zz a oiz z zcrcrz 2 

• IOH-. * < UJ _J UJ UJ UJ CD CD UJ a O UJ X I UJ CD CD UJ Q OUJ I 


* * in 

K H O 

Q l/l (/)OUJXXXX 

zz z z a • * • • 

x uj uj uj uj * oom -t 


O O X 

o o - 

* uj uj < 


oj 

X 3 O O 

•• z O < 

in uj o o 


♦ in 

^ a: mo 

o a o uj 

< < O' < a 

oo*o* 


3xo< z> a x a. x x x a x 

oouja o i/i t- z o z ►- x o 

uj j o cd uj -> in ~) jmi/o _j 


x x a. x x x a xxxa. x x 

z ►- * oz»-x O Z *- X OUJ 

*-* in ”> _j •-< m j m i/) _j q 


x a. xxxa. xxxaxxxa. 

*- X O UJt- Z CUJhIOUJKI 

in - ) join - ) jcim joon 


CD<X<CD<CD <<<<<<< 

x<<o<jii<o<<j<j<q. 
oooooinina zap-Ok-Ok-x 
jjj<<aat-<oina.ina.in-) 


CD CD CD CD CD 

<<<J<<<<X 

oi-ujt-ctoao 

jinotncDjcDj 


m *-< n n n m r> 

o o o oj ^ ^ 

o o o o o o o 

0<JCJOO<J<J 

<n or^r*- f- r-oo u. u. ® —• —• co n m ® u. 

DC UJCDUJ CD CDN < < N CD (UN CD (BN < 

<oo ®<® <x < m < < n < « m < <sr> < 

mo< in in in in in in in in in in mm m mm in 


m m m cr ^ cvj 

m m r*- o o o 

e c o < < < 

o o o o o o 

u.® -h —• ® ® o ® r*- r^®u. voo ® 

<N CD CDS CD 1! h- CD CD N < CDCO n- 

<cn < <a m < < ® < < n < o o m < •-<<< < mn 

mm m mm m minin mmmoooo c m in o om 


UJ < o 
U. ® <\J 


OU.UJ UJ 00 U. UJ UJ ® U- UJ 

a: u. r*- u. o u_ t" u. o u. h- 


UJ ® U. UJ UJ ® U. UJ UJ O' U- UJ 

u. o u. K u. o u. u. o u. n- 


UJ O' u. UJ UJO'U-UJUJO'U-UJUJ 

l o u. n u_ o u. r*- u. o u. o 


oomO'Oh-r*- <<r^t\jr*><\jr^uj 
uj<<uinnocDccccn<n<N 


n- < o uj uj —• < n < co uj *-« < in ® m 
OOOO OOCC CCCC U. b. U UJ UJ 

mmmm m in m m in in in in m in in in m 

mmmm mmmm mmmm mmmm m 


uj u. cvj m ® o o u. <vj n o 0000 nor>- 

U. U_U_ U.UU.U. U.OOO o CO 

m m m mmmm in «c <c ® -c o o ooo 
mmm mmmm mmmm mmmm mmm 


<oo-^^r^<oujo<\jr)<mr“<oujOHr) 
•— •-♦cvjjvtvn.cvjcvcvrrnmcnrir, r- n m < < < 

'C'0'C'C'0'C'C'0'C'C'£)'£)'0'0>£ivC'£)'C'£'£'C 

mmmmmmmmmmmmmmmmmmmmm 


co o> o cvjr)<m ® O' o oj 
OOO^h '-h —< ^ ^ cvj 

®®®® ®®®® ®®®® CD 


m < in ® O' © cvj m < in r- ® 
oj Oj cvj cvj cvj cvj n n n n n m m 

®®® ®®®® ®®®® ®® 


o- o <vj r> < m h-®o'©D<-m® 

< 4-<<mmminm 

®® ®®®® ®®®®®®®® 


r- ® O' 0 —< cvj o <m®r^-®0'©^<vj 

inmin>£)'£>'0'£)'£>'£>vOsC'0'£>r-r^r- 

®®®®®®®®®®®®®®®® 


m —1 cvj 

00 r- © 

< < © © 

00 00 

< o cd u. 

GO CVJ CVJ < 

< 'D \o m O' m < 

mm in o c u. in 

vcr'-^r-osoouj 

uumucviOMo 

®0'00©CVJ>t® 

•j -} 4 -immirir 
'G'C'C'G'C'C'C'O 

mmmmmmmm 

<m®r-®0'©-< 

r^h-r^r^r-f^®® 

®®®®®®®® 


Number 28 


Dr. Dobb’s Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, Ca 94025 


Page 11 

345 



D 

<3 


o < < *■* < ox^xc\jxroxr'-xo>rxinx®>x 

<<►-<►- XQ.(Vii/)oooo—«oojor)or^«ao>»oir»0'CX 

>- l_J ** O »X~*<nQ«*<M«ffCM«ff(M«ff(Vitf*CM>-*'rMV*rM«*(MUJ 
UtXtXIOI-tl/lD*U*UtUtUtUUtU*UlUZ 


o x a: ►— z 
a *o-auj 
» uoataz 


o z o i o < 
cr — o a o 

>• *- i\J U uj >- u > X 
Nf-lflWUOhUhU 
*h-l-»<.~.|-<»-UJ 


a x o >- x 

a * w a tu 

* uj o * a. z 


< < <<<<<< < < < < < < < 

o « < <<x<<<<<aoaoaoQ.oaooaoaoo.oQ. 

zcQ'OttDQt-ohoii i jiiijiiijii 1 jri i )ZiujiiijHiJi 

MJCDJCJJI/lJI/lJOOlUiriUffiUCDOflC-OCIlUBUtr") 


z> x < o a o a 

O C O UJ Z UJ z 
uj _i _i cr o cd -> 


<h-o<<<<<ao 

oi^ujaKaoK jz 

jt-ajoaitD jwum 


Z) x < a o a. 
o o o i uj x 
iu j _j u cr 


* * * o * * * 


O n CD (/' < O CL 

UJ CD CD CD CD UJ o 

<m<«^<o<u<<oo«nwnnnN®«j -4 o in u. -o cm cm 
in<o<oinoin©inin©o©o©o©oooin©cDocD©uin 

cc ru cc cm u. « aDcccccrcocvicccvjccfVJccfvjcof'jr- cc cm cc cm co cm r- 


coa-o^.f\jn>riD'Or-coc7'o—<cvjn>jirisor-acO' o t\j n ^ ir >o ®a>o-<(\jn4ir'Or-co 

(\j(\innnr)nn(*ir)nn4^^^44^44^ipi/iiririripir mi 

ooooooooooooooooooooooocooooo cooooocoooo 


co oo cd o u. n 
a cl a a a c o 
r*> r>- 

in in in in in in in 
o m i\j n ^ in-a 
o o o © o o o 


rvj in n in cm «t 

UJ CD UJ CD UJ UJ 

(\j<3C'jO<JUJ < J < 3<3 <1 

omonjincininmin 


>ccocDOu.(vj'tr^<o o 
ccooucoccc u. 

r^r^r-r'-r-r^r^r-r^r'- r~ 

inininininininininin in 

®o>o-H(\jn4in'ON®a 

r-h-ccoDcocccooococccoco 

oooooooooooo 


CO CO CD O U. —< 
U. UJ U_ UJ lu U. 

in in in in in in 

•j in ® n ® cr 

(T ^ (T Q* O' (T 

O O O O O O 


X X 
3 * o e 
o o -■ «- 

_J _l X X 

o o o o 
CO O CC o 
O CO O CO 
CO 'C CO ^ 


o x a x a. a 

Q. * X * X X 
UJOhHKH 


♦ O 

in —* k u u 

in r*- < o cr o 

* (/> % QT * 9 x * < 


_ ~ « * K K * K * xxcd O' <x o < ru < -4 < o <x> < 

«n xo -j in -o I s - •-* c\j m o <c f— < k < k < k < k < < t- 

i/i'0(\O'j(\jir(\j'i)i\isrM'H(\i(\ii\jn(\j(\j^u<wuwuw(j>¥Mj>wu 

#l/)*UQtUtU*UtU*U#U«008XQ:»X*X»XUtXU*X 


3X1- _| . 

C UJ <3 

X o 

- a a. x 

j z o UJ 

o < u. cr 

O 

■ * * * < 


X<<<<XI/1 
O O t- O ►- O t- 


U. U CD CD 
CD CD CD CD 

< o < ^ < 

in o in o in in 


o o <\j m r- < o 
Uj u u u u Ul u. 

® >0 ® ^3 ® ® 

in ui in in in in in 


aoc>0'-*cvjr>^in'0h"co 

inifi'O'C'O^®®®®® 

(rcrcro'O'iytro'tT't^^ 


D<auo<x<i<a.j 
OCX ZQCK0DU10<D 
uj_jucD_jujin_j_/a_j»-Q. 


o n- u. in >o 

CD «t CC CD 

< r~ cvj \C r- < < < 

inooo in in in in 

® - <C ® h-UJ'O'C'O'OIVJ 
CD CC CM CC CD O CD m CD c n 

uj uj ^ cn in r- < a o - ^ i/i 

UUOOCCOCC*-**— *-•»— 

ininininininininininininin 

o-.(\jn^in®^®cro-<tvj 

NNNNNNSNNN®®® 

ooooooooooooo 


i < <. _j < a 
in a t- zj b- x 
aKinai/’T 


<<<«!< < < 

D<JdO<aOtlOQ.O(1.01IOI10[10<I<<<<<<<<<U<<U<< 

oc x uj o x uj x uj x uj x uj x uj x uj x uj tt ot—aQaoaoa zoo: zoo; 


X <J X X 

O h- —. CM 

CM U CM CM 

ox o o 


CO O < O UJ 


^NocroH 
00 OC CO <D o o 
o o o o o o 


< >o D < 4Dino>onr vO--'^fM^-*m.-<ocrr~ccO'r'-©ncMu_ <i <r cc < co «—< 
ino^inccMomomono^-o—o^HO<xin<J<u« 3 ii.<ujin<ujin<UJ 

vC—<r^-—<r~—.r^-osOf'-o>£!o>£)o>oou>ooo'Co 

CECOCMCCCCCVCCCMCOCMGOCMeOCMCCCMCCCM CMCCCCCMCCCMOO(VCCC\.r'(OCMn»COCM 

•J4N0'CDlUO(\J4'0<D<UUJO(M4v0ffi<UUj^ninN0 , (IIQU.(M'l'0(y‘CD 

cm cv cm cv cv re r, rrn n r c. cr 4 4 4 4 4 4 4 iniririfir. irinir®>t®®® 

irminmmminmminmminmininminmmininininmmmmininininininin 

r)^m«or^®0'c^fMm^in'Or*'COC7'o^cMfn^in«or“CO<T-o^cMr)>tu^>or>- 
(HMMMMrCrooOOOOOOOOiiHHFiHHHHHHCMMCMCMIMNlMIM 
O' O O O O O O OOOOOOOOOOOOOOOOOOOOOOOOOOOO 


Page 12 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 28 



c. b- 
Z uJ 
< O 


< cr 

_j o 

U Q 


o cr a cr 
o z c z o a 

< •—I O —< Q O 

H- < t— < < 

_J u u u u o 

< o c o o o 


CD 

o a: h- cn oc i 

o k- UIK- 

_jx»-x<oxx_io>— ox> -__- 

aouoQoa^ir_i 30 • z> • z> u o o a. * r: * o 
ujojjjwcDu»ojoo#oojjifliniri/)jo 


x z »- 

CJ •-« H- X ►- KCDO 
-»-X<lXa.Xa.OX 


m m x 

O < < O (_) 

o :r a m ►- 

^ 1 / 11/1 # 3 


n i 
® < o o 

n i n k 
CO W 3 

* _i » o 


<XXXXXXXX<I<XXIO 
*-►—oujujujujiij*—otoaioo*— 
i/)i/)jOQQOOi/ua _j a _j rr 


z a < a < x w 

<(/)K(/U-OH 
Tt/ni/i ja 

c 


Daaat-ujKiraaxQx <tt<a cti-uj»-uji-ujx<x< 
oi/iji/iviZKjji/ioi/ioci/iQvii/iuizwzirzoKzcr 
lUlUIKCDinuUTJIJJlJIIKCIlKCCt-CCJ^'-CC 


D 40 
O K- 

uj cr 


X < 

uj a: 

o CD 


3CDoaa<cr<Da<Q:<o 

o<ztocoo'io£rztoo'iocrz 

UK<(TCDO _ )H<[EO-)l-< 


® o- b- 
UJ UJ UJ 
< < < 
ip in in 


r*- cc 

Ul UJ 
< < 
in ip 


h-UUIO'O'O'O'OU'C'D'O'CUJO' 

muuooooouccmccr'uri 

ip®iiiuiuoH(\jr)«oa<ouj- 

NNNNMC®a.«;tt(Ctt<tacr 
CD CD CD CD CD CD CD CD CC CD CD CD CD CD CD 
IPIPIPIPIPIPIPIPIPIPIPIPIPIPIP 

•tir«cr > -cD(>Or^(\jn4Ui'0^co 

r^-f^r'-r'-r-r^®®®®®®®®® 


< u < ui ui 
c uj o uj UJ 
® < ® < < 
IT IP IP IP IP 


cm ip co cd ui —• 
a cr cr a a -a 

CD CD CD CD CD CD 

IP IP IP IP IP IP 


CD CD (VJ CO O O O CD O ® O O < CD O O O 

O UJ O' UI UUUJOUOU UI O O UI UJ UJ u 

0<®<CT<I<<30<0<I 0®C^CC<<\J<<<CT<0 

ipipipiproipipipiripujipoipcuipip^ipcipcipo 


('j(\jip®mujon® 0 '(juf'jipr^<<_)u(\jipr^<e)u«-<'t®r^ 
<<<<<<cra:a a cLauotjoooccccccuuuu 
®®®®®®®®®®®®®®®®®®cocccc®®®®®®® 
LniPiPiPiPipiPiPipipiPiPLPiPLPiPiPiPipipipipiripiniPiPip 

®U'o>H(\jn4iP>OT-®0'o^Mn4ip»oN®a'OM(vjn4ir 

(M?> 0000000000 -H^HHHHM«w(Um(ViMMV 

^*-<rvjr\jrvj(\jf\jr\jr\jrvjrvj(\jc\jt\jc\j(\j(\irvjc\j(\jf\jc\j(\jf\jf\jfvj(\j(\j 


t- ® 
(VI OJ 
(VJ OJ 


a o 

n o cr r- o ct c c h t- 

t_j u i-*Hn uj menu o 

CTO 'C4DO<QN^ D<DN-J 

OM ~«®®®cd«-®®®cc^® 

<od ooujo(vi>t®0'<oujor)< 

UU UUUUUUUU UUUOOO 

cc® ®®®®®®a®®®®oo'0' 

ip ip ipipipipipipipipipipipipipip 

o •-« m<fiPvOr--®cTo^rvjm >JiPsO 

m m nnnnnnn-j-t -J •('J 

rvj rvj (\j(\j(vir\j(vj(vj(\j(\i(vi(vj(\j(\j(\j(vj 


e'¬ 

er 


o 


cr 

< 

I 

u 


O 10 
X -• 

U I 
MJh 
Z 

O O b- 

*- z 
o -* 
x v) cr 

u uj a 

uj >- 

• in 
io a o o uj 

*-• ® z z >- 


a 

o 

u 


ip 

UJ 


KO C 
D — v— 
a»- _j ip 
z IP < u 

*-• > b- 


D- 

(J 

O 


UJ 

o 

< 

a. 

ip 


P- 

U 

O 


X 

UI 


a: 

u 

> 

o 


cr 

< 


o 

< 

m 


_j o 

I- < «-H 

— k- O 

UlOh U 

U ■ O P- _J 

(TOO *-h < 

x *-* u. o ►— 

< -J U«D JO 
►— *— _J < UJ u *—■ < 

u k- < h- a jk j h c 

u cr h- (JO a < uu 

_i < o o x n < i- o k k 

Q.O a o ui -« 

►— O O h- C O _J 

u uj m j u uj •- a. u 

•">0 JHH>D JI > 

x<z<3x<tr<o< 

iPiP(\j>cE(Pipm>oiP 



P- 

o 

cr 

UJ 

tsj 


a 

to ■— 
to ip to cr 


v _j >- to 


ip 

ip 

u 

cr 

o 

0 


in 

to 

UJ 

a: 

o 

a 


u 

or 


cr 

o 


cr 


UJ UJ 

o o 


o < 
u < o 
000 ^ 

OXXXr- 
o uj (_> tj cr 
< uj uj uj a 


1 

o 


< o 

o z 

X UJ 
(J o 


o >-o o *-oo o 

n *-« t_> •— m •—< <_j •—. •—« x *-• 

h-xi-xt-x <aioo<oiooo 00 
Xmxr-Xt-jr-t_J_Jr-_jr- 0 _Jr-i- ►- H- 
ooaoscotpuz «iuipuz<uu - ou 
joipomo <oh>o <o*-«>oo»oo 


X 

a. 

ip 


X 

z a * a a 

*-« to ® uj u. uj n 

• b- ►— 1 j— T- i- rvj r- o 

- t_> - o - o - umow 

*o*o»o*o»o* 


X 

o 

P- H- 

- o 

* o 


* 

cr 


u 

o 


< < < < < 


< < < < < 


< < < < 


< I- UJ b- UJ 

o to z to z 

JK UK CD 


o cr o a < 
o to o _j cr 
uj "> ui o ® 


0 to d a a k 
o »- o ip to IP 
uj a u “) cc ►— 


UJ K UI K UI tt < 
ZlPZlPZWK 
CD ►— CD »— CD CD IP 


a a < cr < a 
ip ip ir to r— ip 
”) CD O CC I/) 


cr < < < cr < in 

(Piri-oiPOi- 
m o to j -) j a 


o ® 

Z K- 
*- a 


<jto o to _ j_ 1 _j cn 

Zb- Zb- (PlOtPI- 

*-*cr •— cr < < < cr 


do. oaoa. oihcupoip 

OIUJIUJIUIIII JZK 

UJUCEUCDU(EUCEUm< a 


< cr _j < _j 
QlPDKD 

_j ") a tp a 


a 

a 



CJ 

o 


a 

tp 


* 

CD 


o 

o 


cr 

ui 


u o IP 

o o < 


o 

o 


IP IP < 

GD UI UJ 

< < ip < ro 

ip IP o ip o 


o 

UJ 


-* 

UJ 

< O' 
IP o 


(_> CD U O 

< UJ UJ UI 

*- H lP<U<< <IP 

U'Jiprvjiptvjiprvj 


sC U sD ® 

UJ < UJ UJ 

o < t_) < n < 

fO IP UJ (V) IP (Vj IP 


o ® ® ^ ® 

< UI UJ o UJ 

u < < o —• < 

uj - ip ip o uj ip 


moo 

UJ UJ UJ 

< < < 

IP IP IP 


uooooor-r^ufor- 

ivucujMujnocvoo 


u —■ 

m ui 


UJ 

< 

ip 


® o ® o ® 
cd r- (vj <vi 


o u o 
ct (vj 


OOO'DO'DO' 0 Or^OO<Of^OO<f'-' 0 O' 00 ' 

trccr^(VJT-(Vjr^(Vj®cccD®mcc(icr®CDCC®cccEm 


O O' o O' 
m m 


O O' ® ® ® O' 

m < < < d 


— cn^tO' ® q (vj (Vj 

®(vj®(\j®(v®(v®rvj®m ® cr m cd ro 


r~ 

u u 

T- T- 
IP IP 


< o u 
u u u 


IP IP IP 


O' O' 

OOOOO OO 
® ® ® ® ® ® ® 
IP IP IP IP IP IP IP 


<<OU(Vl-tK 

COCO ' »—• •—< 
® ® ® ® ® ® CD 
IP IP IP IP IP IP IP 


O-UUJOn^ffi CDQ 
^-,^_(\ j (V.(V(Vj(Vj(V. 
®®®®®®®®® 
IPIPIPIPIPIPIPIPIP 


onip®aioor) 

nnrrrn^4 

®®®®®®®® 

ipipipiptptpipip 


K- 

® ® 
IP IP 


® CD 

CD CD 
IP IP 


O U 

® ® 
IP IP 


O —I 

IP IP 
® ® 
IP IP 


(vi n 
ip ip 
® ® 
ip ip 


-(^<0®<t)UIOM-}<0®< 

IPtPlPiPtPiPtP®®®®®® 

®®®®®®®®®®®®® 

IPLPIPlPlPlPlPlPtPlPlPlPtn 


m o 0 ^ 
® ® r- 
® ® ® ® 
ip ip ip ip 


-t 

® 

ip 


h tvj n 4 1/1 ® o- o ^ 

00000 o o o —1 «-< 



ro>t 1 0K®(To^(vn<rin > cT®0'o-(vjn^ip>0K®0' 
—• —* ^^rt^(v(vj(vj(vj(vj(vi(vi(vj(vj(vjnnnnrnnnr)n 



^ (VI 


irivCK® 0 'o-H(vjr)^ip«CT cr o —• cm m 

IPlPlPlPLP'DsOsO'D'CsO'D'D T N S N 



Number 28 


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


Page 13 


347 




in 

z 

o 


c o * 

UJ l 
cc q 


o cc ► 
CD 3 l 
© O l 

ou in £ 


t— o 
O CD 

a © 


o o 
o < z 
a ►- *- 


cc a: uj 
o o fr¬ 
ee ►- 

a 

c z c 

UJ O U 
*- X 
< sc 
J wu 
3 > < 
X «* I- 
uj in in 


*— 5£ UJ 

>- < a 
uunr 
3 CC 

or t a ; 


lUjU. X JU 
Z UJ 3 _l 

C • UJ I < 

3 — 3 ax 

3 O Z < 

a O >- *— 3 O 

< O 3 Z 

J 3 UJ U < 

. U. UJ o 

3 0V> 
L *— O O QL CL 

3 3 z a a 

- < — a < < 

t x in o o o 


O 

< o 

3 < 
U 3 
U 

o 

O U 
3 O 


UJ X 
X UJ 
X 

cc o 
o uj a u 

< > u. a 

3 o > i 

3 o x 

UJ 

>“ O SC 3 

•-• < o > 

X Q. < < 

3 in it in 


in 

z 

o 


a 

z 

o 

o 


CL 

3 


in 

►- 

a. 

3 

a 

a 

3 



QQvOUCD'00<rr^oocr)r->j-r , ir^O'^<<xoncDrn<3<rr' 

3UJinu.3r^aDO‘oircomr*“<tcC'-<u.cof'jcD©aocijcr)^cD 

*o<oinin' 0 > 0 'Oir>oinr*»r“'t(\j>tn^^^*©r)>oin-<< 

LnininininininininmininintninininLninininininininin 


o 

X < < 

3f-ojnr)cuojr-in'-'inxxx)cfu-*nfvj^ 

axo-iMn-jui'ONNftjNownm^No 

O^rooooooooofVfvnnmmmrio 

«gdoooooooooooooooooo 


Q 

u < cc 

3 >- QU 
CC CC < 3 
U O O O 


z ►- 
r in 
o x 


inH«<('jHuno3unc'0'J(E'0(rNMjn'0<(ti-< 
cr^coor- < ^ucr'DiO'Coirff'Oivuj'-'-io.^cc ^ 3 
<o^0'Do<0'0in'0inNN'J4(u-J>»nn^n>D< ^- < 

ininininininininininininininininininininLnininininin 

in 

z < CD o o 

M^J\J(VJ(\JfUn4N4X><4'00<0(\J^33n u_I 

U0©^<'JO^in'0'0r~^'0o-*r)-t>0f^3Q:>-Q0X3 
uujoooooooooojojnnmrinn< 3 a < o o 
<0)000000000000000000000033 




•f © a 

3 o o © © © < 

< < o © © ►— 

«n tn tn m «n in « 


CDCCCDCC'CrCDCDCDnjQOCDCDCDCDCDCDCCCDCDCDCDCOCCCDCDCDCCCCCDQC 1 

oxx xxxxxxxxxxxxxxxxxooxxxxxxxx 

uccaxctattCCttttffccaccaccciaCECCuuccttffttctaacc 

' v,r ' >- occ cccc 

o o 1 < 3 •-» a o t- 

<_>3cci_;coo*x>-f—h-au 

<U>->II>-l-»-XXX.<0 


SC O O O O 3 
3 0 3 0 3 3 0 
< Z U < 3 > O 


i/iinoa juk < z 3 < 3 > o <3 >->-ii>-i-»-xxx<o 
x in o x 3 a in ho®aihua>->-Hj-t-uuuuuoacuo 
unct-zuii inx<<xinooo3>-»-33000_jinoc.o_j 


O CC CD CD CC CD 3 
CC O O O C O O 
O U U 3 U 3 3 


- (vk u cu'Oi/h\j< (\J3m330-*r- 'C in 
r*'>to<iinc>30ca''-'>i'0(vj©LncDcrof s 'CDC7'crnjcr3 
<©>t^'n't’0'nir>'0'0r^r*“>t>t^ro(vj(\j^©r)<«n<< 
in3inininininininininininininininLninininininininLn 

o 

O a < CD < CD 3 

ino©r»njr-^c\jrsr^riKxnjs}-vnno©vO<(\j a o 
xooo(\j(\j^in'0'0h-oino^f\j^x)r^r s -a >- 001 

d)<oooooooooi\j(unnnnnr)n3Q: <00 

4CDU000000000U000000UU00033 


aooMfni\j 30 <N'CU.u.'-UicuiMiJO'Hoa ru ^ 
oinaD<xoo'<r-oa'0<in<(\jux5>xr^ocDcr3'JCD3 

ininininininininininininminininininLninLnininininin 


cd 3 < r^^r-r^r~f\jr~-f'jf^xof^^x)'C'C'»'^'^oin o 

<33 ofij(\jn^C'ONN>jo-'ajnin-cs-<v<Q 1 

h- ex in ooooooooofunnnnnnnciax o 

<<00000300000030000<JUU0033 

3 


© © © © © 
« O O O If 


NO'<0)D3-nXJNO'<00330«(\)l , 14l/10MMDOQliJO 
crcrticra:a:oocccocooc33333Ui3 3 333333 

<4<<I<I<<<<1<<<<<<<I<1<<<<1<<1<1<1<<<<< 

inininininminininininininininininininininininininininininin 


n n 4 ip «o co < 

-4 <t -4 >» 

© © © © © © © 
<<<<<<< 


© — c\jn>tin>nr^ooO'©^(\jr)<jm'Or^coc7'©-<(\jo^iri'Or^ao<7' 
wivj^ji\j(M(\j(\j(\j(\jt\jnnnnnnnnnn4-}-t'J-J'J-J-j-Ji 
mmonnnnmnmmnnnmmrinnmmnrinnmnnmn 


—*rvjm-jin>or-cDC7'o 

inininininmininin'O 

r'lmonmnnmnm 


tvj 

X) 

rj 


O 

CD 

X<('J3-^<oaiTUJ-J3CEffCCnc<a<-J'£:<30K^ 
>O'J<3CD0'O3OfllCDOl/'M-3OO®CDaOM0'O 
in<o<in>»>t'nininin>#inr^r-fvj4-r)m>t>t — <<x)inco 
irinirininininininiririninirinirir. inininininirininin 

a ►— 

o 3 in < 

oinonNNnn- 1 ow-ox«o(vi'jn-jno3 oj a o 
<a3o^(\jn^«o^NM*)X'<(\jnin>oN^3 001 

cd o cc 000 © oooooNMnnnnnnou; >- < 30 
<<CD00000000000U0U00000U003 


© 

rvj 


o 

a 

m 



< 11 < 11 < 11 < 11 < 11 < 11 < 11 < 11 < 11 4 11 < n < n < o < 11 < 

tntntnmmmtntntntntntnmointn 
• X) • 3 • 1 * •— *0 *u »o * o • o • 3 *3 *0 • a. * x • 

0<0000000303030a oa oaoinoinoino30'T 


h- a v 

3 0 ►— 

< O II o • 

X < z o < 


a -• 
3 a < 
3 3 ►- 


o 

o 

a 

o 

in 

a 

o 


o 

in 

3 


cc o <a u 

-* h- rvj ►- 

** 3 *» 3 

» O » O 



O 

3 

a 


a 

o 

o 


3 

o 

o 

o 


3 o z 
000 
a < o 
o 

© © 
x cc cc 
000 
3 ai ou 


< a 
a x 
o 3 


3CDoaoa:occoaDoa)0£EoaoccoccoaDO(Doa)occoacD 

0000000000000000000000000000000 

3333333333333333333333333333333 


OtEUDCOirOCCCDCD 

0000000000 

3333333333 


D a x CL 
oincx 
3 cc _i “> 


3 < a < a 
o o in o x 
3 _i “> _j -> 


~1 CD CD CD CD CD CC CC CC 

oxxxxxxxx 

3 aaaaaaaa 


in o 

o 3 
3 a 

cc cd u o 1 


o o 
o o 
1 _j < 3 


•O CD 
C C 
O O 

in in 

n- co 
>* 4 

CVJ OJ 


CD O O 3 

© c c c 
0000 
in in in in 

© oj m 
in in in m 

r\j oj oj oj 


c — ononomoinoinooooofvjot'JOOomomoinQ'j 

0-JOJO.JC.JO^OJO^OlfOlfOlfOlfOlfOlfO-JCC 

33'H®<(\J4CC<(\J4inMJ'CC3^UJOCDOtT'CDinr‘©OjOf\Jl/lS 

c c • (\j n. >4 >1 lt in a a. c a « a oC33©cfv-(v-3 >1 ir ir x. x 

000000000000000000000<!<l<<i<<l<t<i<i<i 

ininininininininminininininininininininininininininininininin 

in>or^cca'o^njro^in>£!r^cca'0'-<ojn^inx)r^cccro^ojmjjin 
TvOvoo«C'£»'£)'C'0>c>'Or^r-f^r-r^r>'n-n-h'h>iocooocccDco 


ivyii hi ^ I- w u- v ^ uj n ui i' u, it u « 11 j ui r- uj u 1 o <-< iu ri j it r-cccro^ojn^inx; cc O o ^ 

in m ininmininx)X)>0'CvDvox)vCvCX)r^r'r'r^r^r^r^r^r^r'CccocDcccDcc aocccDooooooo 0000 

oj oj ojcijojojojojojojojojojojojojojojojojojojojojojojojojojojojojoj ojrvjojojojojojojojoj tv oj n n 


ao(Vjnn-jsco(j‘<cD 

'Cr^r^accaao'aa 

<<<<<<<<<< 

inminininininininir 

r^cooo—•ojoi^mx; 
COODCOOOOOOOO 
ojrvjojojojojojojojoj 


© o- 
sC o © 
c ir 3 


o o 3 oj 
o o o < 
< < < < 
in in in in 


in in r- < u ^u. shiud^iT'O 

<<<<< <<ccaaocccrcc 

<<<<< <<<<<<<<< 

in in in in m ininininininininin 

co in o- o rvi n 4 in <0 om o> 

OOOOO © r-4 ~ ^ r* 

nnnnrs n n m nnnnnnn 


Page 14 

348 


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


Number 28 



o(vj^<£>^ninoo 

vT>j>TvTLniriin>y 

oooooooo 


o n ^ co o h ftj 
IP IP CP 
S ^ N N N f* S 


iP'P'P<tcEa'iPo^(\jn>tt\jr^o^(7''-*nip>onipr^CT'—nipr^O'-Hmipr^O'^nco — >t>co'-<n<tiph- 0'o.-rr\jr)ip>Dcr~-«r-iP0'r'J0' 
iMfi(Vj<vjinmai'0'0'C<C'0^oo-<0'oooo'{M(>j(\ji\jnnnnn^^^^^irinir'C>o^)^NNNNN^occDcDXCDi , i^in4ooino 
h-p-O'O'r^r^'Cf-^h-r^P'-ooooO'OooO'nfPnmnmmmmnmfonmronmmmnmmc’jmmn nnnnnnnwi\i(vjH« 4 


0'r^r^(\jojfvjf^<vjf^'PiPcof^a''X)a'n«£io>cfVjr)-pooof\jipa)-<r)-.>tip^r)f\jnoipo—or^cDC7>'Poa'—>cfvja>vor^f^v£) Hi/icc^ij'on^socvjny 
O' n -t ^ co ^-•oocT'—•'-^^r^r^h'iP'Ococpfvj'-'—«'^f\jfvj(\j(\jr r )nc7'Or'r-ia'Or^f\jO(7'r'f\jocO'Of\jrn(\j>x5^-noa' oipo •jN-t^iru/i'Oncor 

flco , coa'a«£fl0occor*-0'0-0'co'0'0ecr^r^r^aooooooooorripip^ir)irip»cr r . iriP'PniriP'CiP^DiPir. 'CniT'CiP'O 4irir'£iP'£>4rv.(\.cv^-^- 


vi 

< CD < CD O 

r^- cm r> f- -« rvj n^ir«r'NNrt(\ji\jn4ir'ONx x x x xx)<x«oi\i^«oi\i44)oi\c4«oi\i^«n«Hn«oivin4« o-cvin^ « jho^ouju. 
-jiPLPLP'£)vO'P'P'D'0'0'£i'0^r^f^r^-r~h-h-f^O'-<rvjn>jiPv£)h-xoooo^H'-<—<^Hf\jrvjf\j(\jnnr r )n>t'JiPLPLP>0'£i'£i'P'£)r^-r^r^r^r^r'jo^-«r-«Q:ccj 
oooooooooooooooooooooiMMCMNiMftjNNMnnnnnnnnnnnnnnnnnrtnnnnnnnnnnnnnrxoQOjjii: 
oououuuouooaouuououooouuooouuoooououooouuuuuoououoouuououuouuouauouou 


UJl/lCDlTinCDO'XlIIM’lIM-JCDn^.J^CCXJf'XQUU.'T 

<<CDCCUOUJ0'NQ-'O(7-rUJ'tOU.| J . ^-JUJU.QliJ(\JlO 

f^<r^iprvjojcc<o<(\j(\jcccof^ccor^t\j—im—.c<<rvco 
ipipipipipipiptpipipipipipintpipooipipipipipipipipipip 

v a c x c »- 

►— Q (J 4 O O Z C 4 CD _J <J 

t-UJ d DC- X U < — X — IQ < U. ►- X o 

*— X U Z UJ < NZ^XhKf-l-«Ji-i/)0*-OZ>-XXJ 
cuozziua ou.zoa iiiuu33^o:Duii/i»-DC'ar< 
oi^*-h-)-)_j_ji 2 izoocoao.aactQ:Q;Lnip>-> 


<iQfvj<sOLP<rcru.r^cnujuJ<ujOLLj<TC3a)o>Dcpc-<ufv 
a ® r- - ccrijj^^o<iiijcc'u.NCciroDD--iiu.u. 
c<-ir4iv<<co(VJir<a «cror^pjc(v<'-cr^-cc>j< 
<XlPlPlPlPlPlPlPtPlPlPlPlPlPlPlPUJlPlPlPlPlPlPlPlPlPlP 

_j ►- i a t- ^ >- 

za UCD JK CD O Z O < •-< < o 

a a k a _j _i *- »c ac-*oo»--‘i -- u. ac x oc 

H JliiU < «J X ^ Z h<KUH<I“I/1C)hoZV1X> 
xuju-zoi ozocr :> o cj a. _> o a □ u i c-du^ok 
ujiH^H-j-jjjiiixooooo.o.aaaaatPtPK*- 


ltl*.®CD(VNaCO(\J<OMEff'-i^'OMMtUMJmon 
cDor r )r-uj^'«Mi*.oipip<o>oujo<o>-^oiij£r('-oiijouj 
< o <r irr- ^n<oooi/iooo<-nsnsHHi\jHoo< 
iPlPlPlPlPlPlPlPUIlPtPlPlPlPlPUJlPlPlPlPlPlPlPlPlPlPlP 

a) o t- —< 

< Q Q X h D to 4 a I O CD 4 t-I 

I'OaZOQ.DIIIlDKQOUIXUlMhJ —« CJ —« o: CJ 

cj_jxou,zxo*:zz*--..-.»_Kj-aQ: u ~ o « >- a. < >- 

Q.UJfPZ0UJZ)0>-'00>Xl_)<_>Z)tJ0:D4XJ— l-Okif-f- 

uiHHHTTjiiiizoooaaaaaairifliflifli- 

-NCDU.Oli.inONO'^UJD'CNOC<<JL.iiJO(CCff'0>CU.U. 

f^Q>C'COt\Jf r )(EliJ'}(\J0'CEU. l U,'U<U.OU.'£)UJ^0UJ0U-J 

m <\j < ip o 4- -jcO'£>ooip<<<or)(Vin^)r)>j(\jo<c<r-r^ 

iniPiPiP<iPiPiPiPiPiPiPiPiPiPujiPiPiPiPiPiPiPiniPiPiPip 


O' >o >o 

4 ~ O' 

~ <D CO 


rvj oj >o ■£) 

ip 4 o co 

« <0 co 


m o r^- 4 

n c\j m 4 cvi 

CO —• f\j —■ CD 


< a o ic w 
o <j<k o u *- a x < 

— »- «p a caocD-jc-aaoj 4 — _j 

c _j x o zxo—'ZZ*-»»-c-»-aa_j 


4 ^ Z 

O l_> (_) •— 4 

»- o z a 


c _j x o zxo*->zz*-'»»-t-»-aQ._j »-©~*zol<»->- 

Z4C-ZOluDDXOO>UUUDUCD<lDhhD^t-^U 

iiiiiHH-njjxxxzcco(iaa.[ni:aQ:Q:wiflhx 

®nuu»c(MMcccoH®u®<'Jin4 -a u.<4(rr.(Mc<c 
MCQ4O«n<Ol/l®UC0 4 4UCDOOU.<O(VJOMElIl- 
n<4HC04n«(7OO4<C0C0O<O(DIM44N«H44N 

ip in ip u; ip iripipiripipiriririru,ir<tipiririririririririr 
_i o to < 

o H- CD h-n CD to )C cl i o O CD o 

_J I to O a O 4 K^XCDC/ltMl/ll/l-IC/tOOCCQ. 

o u.oc-zxoanzh-x>->-K-X4»-(00o-<zt-ioac- 
Z c-ZZUJDOI/lZOl/lWUUDUH'rowhl-DlUI/lIU 
uJir*-«*-"}->_i_ixxxzocoa.aaaa:a:a:a:iotn»-x 


o rvj r- n oj 
fO PO O' co 
^ ^ vC 


^■orupaon(vjN^(\jn'4®4^(VjococM*)o^(\M\jN(vjeoM4uin>o 
o^-of\jroro(\jt\jcoooooor^—* — r-«^^co(\j(\j>or-(\JO'C\jc r )rom^r r ) 
^ ~ ^cc^r>r^r>r^r^>or>r^h>r^h-cor^r^>o«pr^cor^r^r^r»0'r^ 


—* o o> cc 
n n co 
n n rvj n 


o o o 

O _J to 

< U. X o 
CD CD CD O 

< < < < 


f\jipo(\j®s(\jn>oN^(vjn.40M*)o^«oNo(\jnniP(\i^nco4M 
<c niP(\jn>trHPHCo 4coc\j'0'0o nr-ipcocorvjiPtPiPO'O' 4 voipcunn 
r*f r )P r )>00'COCD'D'£JCDCC'00'CDCCCC'0'0'C'CCCDflC'00'0'0'CD 


x wna z < 4 <j cd 4 < 

uj (/) < o « k o o^(\jnNN(vjns-(\j(\inNNN(\j(\inN-H(vicvin 
aa-jooxuj ooooooHHH(\jMi\jt\i(\jMi\jnnnn.f4 44 
Q O l/l 4 unc ct oooooooooooooooooooooooo 
4 4 4CDCDCEIUUUUUUUUUU(JUUUUUUUUUUUU(JU 


Number 28 


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


Page 15 

349 







SYMBOL DEFINED REFERENCED SYMBOL DEFINED REFERENCED 


CD yO (V 

>© r- dj 

me in 


r- »c ® 

yo in cc 

mo -p 


dj 


m d- yO 
m \C m co 

in m d- >r 


o .p 

o -p 

(Vi rvi 


■c 

cc 

m 


■P m O' co 

O' -p t*- 

m d- -p 


CD 

O 

DJ 


O' — 

in >p 
m r*- 


r*- >p 

o 

dj rvj 


in co 
in o 

O' .*• 


O' o 

»n d- 

f- n 


yO o- r*- m ■£) 

yO m in m ir 

>* d> m r- Yp 



>y o 
m (V 
O' (VJ 


m 

m 


(V 

YC 

m 


OJ 

CO 


© m in -p 

yd n in (vi m 

*$■ r- m r- -p 


inoN 
o o m 
(VI DJ hH 


o* Yp 

r- yO 

>d 


(VI 


m 


00 D- >p 

d- in 

•p o (*> 


(VJ DJ 

•p in 
DJ o 


in m dj p" o in 

-t (vj in in O' 

r- m r» -p 



* «D CD 

© hh © 

DJ DJ — 


•p co 

dj O' o m 

h-. o -n 


yC 

in 

m 


o o m yo 

<n co a -J 

m dj cd m 




in -j 
m -j (\i ® 
(VI O' ^ 


o> m 
dj 

P*- 


co O' co m -j 

<p © -j- -n o' 

m d- .p in h-. 


jno m dj p- 

r** ® m o ^ o' 

h h(VJ DJ DJ 


dj m -«O' 

DJ O' CD yO 

—• d* in 


Y0inm.-*©in'£>c0DJ0'C0m^0'in'^D-~-o>*>*0'D-Y»r^Y0('j.-«_«Y0m-HD-0'DjinmDjDj<n**r*-0j©0'r^-*'0 

m^mcDO'0''ninYninD-D~D-Yno^oo'omcDO'om(vr^O'OYODjYno'ininr^D~^<tOYOino^Dj^«^>tm 

dj co Djm«tr-D»commc^(viin ^(viHHHHHHHHMmDjH m ivj ^ m yc 4 


o «p cd o m CD 

•p .p yo *> o m 

m m *-« dj co -p *•> 


o^mm®inYCj®0'-'inmmo->jDjNjo 

^Djh-r“0'ommDj^Di«D-^mocoDi'£iO'( r ‘. 

m o o o —• .p .p m Yp Yp o o ^-<<-*DjcomDjDjm 


u 

n 

ii 

ii 

ii 


o in co 
in in -« 
(Vi o 


ccvCO'OvtvcoO'-<coo>c)'C r^cvi 

CDOr^D~D-D-DjOinr^OODJ CD o 
m m m m p^ p>- 


m m 

o o 

f" yJ 


ii 


o _j a i- 

m d o cd o in < cd 

<s cc (E -tin yd t) i-i-i- * rr rr a 

QT'-^-'Djmzzzzzzz x 

irKY-zzzoooooooaain >>>uj 
JJIIIIIIIIIIIIII i i i z 


m4 ^ffl-NDjO"C«-4D)4<»4mino 

O (VI m-tO'44'O'M-J'J't 4 m O' DJ DJ DJ 

(V m r- .-.^Hnmmo 


mo-inoo'j'£®®j-<(r®om(vj 4 oin®»iM — -p in in 

mmO'DJ^^DjDjDJN®OOm4^DjDJNNDJO»M CD CD O yO 

(v •— Dj in in ^oo^->^H^Y»^^^oo'*-*^m j (\. d. j 


o a o o x * in in 

(no oo^*-azzaa i x i 

za. >o<moiiiHHin)xo dj j u 
xx 

Ul Ul X OOOOOOOOOOQ.33DZ) 

zz zooooooooccooooo 


o o < oho o <I <m 

ox in - dj h in i- h h h j j j x x o in 

KHio.a<<<o.ai-i-i-jjin(nin o o o 

3DUUUOHMOOO:aDDDDD<<IlilUJlLl 

ooaa.a.a.a.aa.a.aacLaa.a.a.acrcrcra:a: 


D- m a 

yd r*~ cu 

P" P*- O 


(v a ~ cc m 

r> r*- O' m 

in <4 o r» o 


YO Yp o 

C O CD 

D- vO O 


m DJ DJ DJ «* 

O' in «n yc m 

-p -jo 1 in O' 


—« m r~ dj 

in r*“ in dj 

O' y* yO O' 


m m yO yo o 

cc m o' in >p 

.p dj d- in o> 


o Yfr 

•p >p 

e co 


(\J CO -P in O' 

m r in in —< 

•per- 'CO' 


r- CD D- o o 

Y C Dj CD IT rn 

yJ dj d- in o 


y© m 

m in 

yC r- 


(VI 

yO 


cc dj 

DJ 

O CD 


r- yo in in 

~ O' <t — — 

>t o fY- c o 


fh m ^ dj m d- o 

>n in dj cd yJ >r 

Yt co in dj <o in co 


dj dj in 

m m nJ 

yO fw 


o o ^ ® 

r*- m o o- 

in yo y» m 


in o 

Dj Dj 

O CD 


o <f ® r- r*~ 

o p*- m o © 

(VI cc D- 'co 


iC mo inir m r- 

Yjina ho >t >j 

yJ CD y® (Vj yC in CD 


O r>- r«- 

(V (v m 

yT ^ r- 


NOIMf O' yC 

© r- o m o o 

in y* m in yo m in 


yO 


d» moo o -* 

m dj co on © © 

yo co dj r- mo 


© o o m m co ^ 

m p- cd dj mm 

yT co yJ in m co 


c o 

(VJ r* DJ 

YO >-< p- 


in co yo m —« D- y» dj 

p^oD-om o o <t 

m m m m yo m m o 


DJ DJ 
DJ o 
DJ DJ 


DJ m DJ DJ 
dj m in y* 
o ® i/i s 


y£) yO Dj ^ D- 

P- CO DJ © yO 

(vj k in cc 


O DJ inNN -JO p^ dj 

^© — - in®- om 

~ -t ® -p ^m m co 



DJ ^ 
DJ 
© r>- 


m yo j m ® 

-P'ONODJ 

^ in m in in yo 


m dj dj 

o o m 

m m o 


o o 
^ o 
DJ DJ 




0-0 ® 

- ^ Yp DJ 

m in in r- 


cd ^ -J CD yO 

y£> CD —• O 

dj p^ p-y m co 


Ytop-^Yt^m'O cd 

O®^ HH^OO CD O 

-H-®M®Yp-M-P DJ CD 


cd © mm in 

m dj yo —» © 

'-y y£) co 


O ^ Yp (Vj -rn 
ffiNONODJ 

© in m in in yc 


m m o 
o o o 
m y£) in 


o r*Y -h® pm 

y® —• m o yT 

m dj (VJ dj •—< 


mmmmp“YtDjcoop^mocDooYODjoDjp^m-^mD-p^^ 

moo-YOooco-«r^p^cDP--tcDococcor~Dj(VjocopY~^ 

ininin4iniP-N«««®wNNNHHNHHHO-M® 


YC®«OHHinNoon®OHO' oo nHNomin®min®ono(VjooDj®'M®®mrMnsm'po® 
0inDJinN0Dj40O0©o0'p®>Minin^o®®N0inttiC0s®(Vjffl0(M®®0ooDjOiMYC 
Hin-p - j oh HfflDjmnDj HH^r.m n n 4 omnmin®Djmm®YpH(vjHDj(vjH 


ii 

ii 

ii 

ii 

n 

ii 

ii 


in <d Yp o 

o © -M © 

(v in in ir 


oin®4 j®omM\i 

©mm-Mp>-mmp^mDj 

irmmmeccccDccccm 


Yp in o 

CD CD »h pm 

r> p' m cr 


o 

co 


D- P*- © — P*- O 
N04-PHDI 


p-m p- m m m m 


hm m 

O DJ 

^ m 


Oh® 

®®h 

mom 


oin®m(viMn«OHNOHNms 
HinoO(*)®ODJMVl®NNNHDj 
YpcvD-mnD-YCD.© p- H-. 


H-.mDjoomcomom(vj 

ocoocoopHoomom 

©m^mYDYrDjYp^YC^ 


p^ cd Yp 
HlVJOO 
m (Vi — (V 


o m <d 

yP yP O 




in a 

u. h (vj m <i u ph cm m a 

_!>->>->- < oooooo 

aaoo:a:>->- <<<<<0 

uuouuoucooccoc 


< 
or cr 

u 0 o 

UJ UJ u 
O O U. U- 


< u. or 

li-ZOOO_JI- 

x 1 x 1 x u. in 
o a o o u >h z 
liJ U_ liJ UJ UJ UJ Uj 


Q O 

z a 

UJ UJ 


_J >- ►— Q. I 

ZH 1300 O <IUI- C J < ® u Q K < X 

otp- naaujj®®i- xcrcrcrcrin z_ioooo_j»-aQ.a 

*- *- -J-J-JXU XXUJ OOUUUK uj<zzzz<ujx xx 

x UJ <UIUJOJ-h nit.ZZZZZZZOOUUJUJUJUJlQ:DDD 


xuuui- 

< O O O X 

o o o o o u. 


Page 16 


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


Number 28 


350 









4®<da.ocu.r-®oj<roinoo'©o-o^coin»-'incr , -in'*C'4u.ujc;oiOjOi 
oo<ict'®on-—< r-ojmodO'®oju.coomd®cEa:inudC7'incT'44N-ujN-.~ 
0o^nNo-j^«o^u(vnooso4ujM i jooNNo^' , )iro(\j4onu 

oo44nnLn.*,*r\jin4d40jf\jooj44o40jinooojin44ojd4ddnj 

f\jB^)ONniijN 4 40ooaj-Htjaoou»ou.ooao4 o d oj o o ^in>o 

t -j 4 44 m 

o-r-ooiooa'inoujooujO' 4or>-^u-(7*oofvj«i .-<>44 O' 40dui©or*~© 
no(VJ4no44'J4(VI04444'tN444Min->n44^-tW-J4(VJtVl4(\J 
OQO^n(’)u,|\jOlflO^0'Ok)rtHNo^(VluJ' , lOO>t4^OO^CMnc0in(\l 
noO44'0'>l/HVi4O^)4O444OMUUn44(M(\J444N(\l444in44 
noa«oosoo(MQinNoaiHouoi/iani\iuon4oui^®ooin4iviH 
4ni/14(\J0ir(\Jl/14'C0O^4l\J-J044'Jl^-JO44(\J-J4l/l(VII\J44^4 
or^N-oojoo40inN-ON-r^oindmd4ujinO'inoo»-<oj.-<4*-*'-*4oo4 
(VjnoM^O(\u/l-I 4 O O d O OJ 4 44l/144in4M/HVJ4l/'4 4 4 4 4 4 OJ 4 
rvjooo4^-«4niijf\jQHr^QOf^on^ujO'4or^nn—« o4ooj(\jooqu 
4 ® O O 4 n 4 44domooo40j444 4lDooiT>44 MT4irinM(Vj44 
4n4o^o4i/i(M , iniiOBiMii(M/inu.oo40oin4 4noni\j^i\joo 
44n^4(\J4444lflMOin'04in4ir4(VI(\JNO(\J44lflin(VJ'J4l*lir4(VI 
doN-N-om40joujoj—«nor^—«ojoom*-«or^mo4UuJ©omor^-a>CT'o 
4l\jno(M4 4U104lP4l/)(VI0 4inM(\l4in(\l0404 4 4(M04(\in440 
o(\iooooc(\i4(Mn(\JNoocoi\ji\(«oin-on«oo^oo4oo-ooi/i 
M4nooinrvjui'C4 4iri4no4iH4n(\j44o4M\ji\j 40 ® 4onm(\jco 
o4nir^i r )nu.No4nino«rtHrtnawna^Mnfvioo'No(vjnoirN 
044i’)®in440(\lin4 4IM44 44Ml/144l/l40ni/l4N00®4440 
ddor-r^OLTimo4r)ujnjmoom4oojoujojoor'-®inr'-o^«N'0©do 
d4(vjoooj44©4d4d4d(vj4 4 (\JirN4in(\jon4 4©o®o©©d© 
NO(\iODO4OI\i4(T0'niiJ4®OUM\JO(M\l»-4Oin(VlO«NOn4U.n 
0^4noo<(\|^ 444W4®4l\J44®04J144n^monoo®®4® 
OO4n®(\IOU,lT4NOO0'O®4O4H(VJOH«i l jn4nn®OeNNO(M 
0044n®(\j4 444IVlM4(Vl4iri\j44S(Vi44 444 4lfllVJ0ir004ir 
-hn®onn 4 4 4 o 1/1 - ® o (\j 4JioiiinNon4i/iooini\j-nuooo® 
od4njooodd(vj44doj4ojd©44©©4d4oo4d4dojo©oj4 
N-N-oojocN~on--Oj^«4—Ojnojo.— oc®omor^cc4d(vr^o(\u4®4 
noM4non(\ji/i4i/i4 4 4d(Vj4r'-40j©r*-ojdOjr‘'r*- 4 4 1/1 4 n 4 441/1 
000000000000000000000000000 000000000 

0lilU.O-Pjr)4t/1®N®(/'<®UDUlU.O-<(Mn4l/'®N®0<®U0WU.O 

-*-H«(vj(M{\j(\j(\j(\j(\j(M(\j(\j(\i(\j(vj(\j(\j(vjnnnnnnnnnnnnnnnn4 

dddddddddddddddddddddddddddddddddddd 

monooomnoooooooooomoooooooonoooooooo 





o c u. u u a o cr 4 u a (\iu.<ML®ak®4®iLU uui40.r^od0 44 U- 

O O ® « -*(T(Ml/'ONO®®S0(>0'-'(\JN0UUJffiUI/>-' d O © CT C ® 1/1 O ® U 
0O(TOO(MO(VlNOOOlLOH-40i/li 1 j0>44(tcoU®®l , lI'-«J-®4O 
OO«Oi/1(M\J4O(\ll0N4O4ri4O4 4Oll/ll/lOO4l/1Ol/11/1(M4( , )O4O 
^®N®riN®-<QOni/13H(\JOO04(>®HljJ|/lJjnouJQO4®OOQO® 
1/1 ® o in ton4oo®i/i4oi/ii\j!\jtn 4 404 4 4 4 —* 01 4 o ivj 4 o oj 0 / o oj 01 
r^r-o<_)oa«£>4ccf^O'-*kncr)rvjn<rvjooQu.oi\j4tDm(7'CDouoorn4coco 
400Ninon44ff 1 WK1404 4(\nni'JI\J044l/1l/IO' , 14 404004 4ino 
do^o©4ouor^od00ooou.o-«^iju.4modo4®©®ojoo4o 
40 nn(\i 4 ri 4 (M 00440 Ml/l(VJ 404 l , 1444 in 0 fl(\ll/lH(yji/H\jinMt/l 0 
(\j4ccoi\iujno®Q®oo®oni/iQ®iMooo-iO(\joon®nu)®n«n4 
i/i4(viwi/i44(viino<M\jN4oinin4oinN(\jin444noinon4oininin4 
ri 4 H(\injioo 4 ®N 44 o(\io-*i/i«(\jn<ooi/i(M , )i/iooo(roo 4 ouj 
M4441/14004inon®(\)OftJl/i4044M(Vl(\J444^4on40(Vl4M4 
©40j-«<om4000duj®®od00o©o(r0jo®o®in4©oN-o0©d 

(Vl4in4 4MMf4(\J0n4ir004 4 0(MlT(VJ4l/'lVJir004 4nM40404 

®©0'4©or*-r*'Oooj©d40oo©®oodoo®o4o©uj®od®©d© 
inf\j4i/i(\Jinooi\jn4f r i4 4oo(\j(\J4oinin 41 / 11/14 —« o 01 4 4 o 4 oj oj oj oj 
4H>on(\iooQoo(\jnQU®®i/i 4 o o —« —< < 4o®m®inoo(\j®nco 
44ini/i44ooo(\jin444i/)oni/i(vjo(\jin'J4infuo4in40(\jinonoin 
u-oo(\j<Mni/i(\iO'oi/iouo®iij®®oi/i4onoQ440(?®(vjQ(viQO 
444f\Jin4ri4a'4404rv J ojon4inoo4i/icvji/ii/ioinin(M — o4ono4 
O4o-«oooor- — da'0j©oojod40®ooooo-«oo©®o©4©®< 
i'j4(\j44(vjwino4i/i(Mnon4n44oo(\jino(\j4i T Mni/iinoo(vj4nin4 
OU-MX!Oni/l04QMnoO(\jn0U««"0O0<OQO00N®lil( , lUJO 
04 4 1/11004401/140401111/1 4 4 4l0on(1l«O4(U4W4O^in44 4 OJ 
'C o •—< O' o^©o®noouj®omod©oodO®'HOOd©<* «—• l/i 4 in o o o 
® OJ 4 4 43 , in0Jl0i10JO4O44O40l0JO"14OHiM4 40404d4040 
N-o4dor^mccuo-*-«CT'C!UJUJ40jooojooocoooodooojmo40N- 
ooifii/ioouun(\joj4n404 4oinon4ri4oooin\Mrvjoji/ii/i(\j(uM(vj 
QM^oooo4ooojoo(M>»«rnno(\in(>(\Joo)nffi®on(\ioo®o® 
O«i04(J'O(\l4noi00J(Ul04 4O4O(1JI044l0OHi0inoO44(\/l0OOO 

ccr^ooN-~.oood(vm<o,©ooinctmroodmcco4cr~©o©c:cino 

l0O0jOOno4W0'4 4M00JMO4O44O0J44ON4OHi00JO4O(UO 
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 
H(iin4io®s®a<ffiuouju.oH(un4in®N®»<®uDUJU.oH(un4in 
444444444444444ini/H/ll/11/1l/1inini/lini/1l/lini/1ini/1®®®®®® 
ddddddddddddddddddddddddddddddddddddd 
ooooooooonoooooooooooooommmmmoomooooo 



l/H/'l/11/)(/ll/ll/ll/'l/l»/ll/ll/ll/ll/1l/ll/l®l/ll/ll/)l/U/ll/ll/ll/ll/)l/!l/ll/ll/ll/l(/ll/)l/ll/1l/)l/l 


o II 
UJ II 
U II 
Z II 


n 4 d o 
in 4 d oj 
— -lun 


4 O' 00 4 O' 
co n r\j 
o o —• o o 


(U (\j 1/1 4 o 

in o> in r- cc 

Oj d Oj Oj Oj 


«Hin4 4HOjino'OM>o-<Hn4an®ino®N«®N 
in'£i^Nin®>CrH^^ r -^inojoj40'ina''-nffl®®^N- 

oj oj o ^^« r -^ r - r< (\ i -(v-(v^r)®rii/iooo'-(io 


®M*iin«n-<Mnn®®'H4( , i®4®o® 
®0'®N®ff‘^-4®®4“ - ■“ * 

® ® o. (ij Oj (> r r — — 1 —• — 


®®H4n®4®o®-®oooin(M5'«in44 
®4SNnH(^inn 4i\/ojnooj(vi®nnin®^ 
^^^^-riojiVpHtvnr, r r- ® ® © o o *-• a © 


o II 
X II 
X II 
>- II 
in n 


O > b- 

< <■ CD < _j u ic t- z i o o 

oo-h—<o-h—« 4 ® u o u u a. —• cc ►- ooxx *-*oao < 

ooooo-*^^zzzz>->->-i-aaa x v) <t < x x a i- >- >- _j ►- h- 
►-f-l-l-f-l-l-l-DIDDDUOOU* ^ ll O. ® h h o 1*1 r ® k K «J U U 
aaaaaffaaaairir®®®®®®®®®®®t-i-hi-i-i->xK 


2 ; 

3 

a 


a c c 
a: (vj d 
o o 

o CVJ (VJ 
Q O (VJ 
0 0 4 
(VJ (VJ 4 
in <vj 4 
o d 

4 0 4 

d o © 
in o (vj 
o o 

4HO 

o tvj o 

(Vj n (Vj 
(VJ ON 

4 o o 
4 no 
4 4 0 
>0 0 0 
4 (VJ 4 

o (vj m 

OJ 4 4 
O 4 UJ 
0 4 4 
O >o o 

(VJ 4 OJ 
N O (VJ 

O (VJ 4 
0 0 4 
0 0 4 
(Vi ~ >0 
in OJ 4 

O O O 
O —« OJ 
O O O 

in in in 
mom 


r~ 4 m © u. 
® onhu. 
oj d d © o 
m oj 4 oj m 
HN OtVJO 

o o oj 4 m 
0 0 0 4 0) 
m o o 4 4 
n n n (3 o 
4 (O OJ 4 OJ 
o n r>- o (vj 
(vj n o (vj 4 

(VJ o o o 4 
4 0) 0 0 4 
4 n (vj ® ® 
4 4 in (VJ 4 
d © ® r- o 
4 (VI 4 o (VJ 
O (VJ UJ o o 
OJ 4 4 O O 
O 4 O (VJ O 
o 4 4 in (vj 

4 d OWN 
OJ 4 (VJ 4 O 

o- o (vj in o 

O (VJ 4 4 o 
C O 4 4 OJ 
o o 4 4 in 
4 in >n o O' 
4 Oj 4 OJ 4 

•H N O M d 

4 o oj 4 in 
4 C O 4 O 
4 o O 4 4 
o o o o o 
n-Jl/ldN 

o o o o o 

in in in in in 
0)0)0)0 0) 


o r- 
r- o 
>-« r- 
o o 
n- O 
o o 
O O 
O 4 

o ® 
4 in 
in cj 

4 4 
UJ o 
4 OJ 
O —* 
OJ o 
OJ 4 
4 O 
4 O 
4 O 
d O 
4 4 
O O 
(VJ OJ 
O (VJ 

o 4 
o 4 
O 4 
n* d 
O 4 
O © 


> OJ 
N- O 
O O 
o o 
CO O' 
o o 

in in 
o o 


U.’ (VMVj ® 

o oj in o 

(VJ 4 4 O 
O 4 4 OJ 
O 4 4 in 
o d o O' 
O 4 OJ 4 

N O OJ d 

o oj 4 in 

0 0 4 0 
o O 4 4 
(VJ 4 d o 
O O 4 Oj 
J N O (Vj 

O o (Vj 4 
©004 
O) 0 0 4 

o m d d 

4010) 4 

0 4 0-0 

(Vj o) o Oj 
oj o o o 
4 O) o o 
4 O) OJ d 
4 4 in O) 

d O n N 
4 OJ 4 O 
O (Vj UJ O 
(VJ 4 4 O 
O 4 O' OJ 

o 4 4 in 

Oj x O O' 
Ol 4 Oj 4 
O O O O 
< CD O O 
o o o o 
in in in in 

O) O) O) O) 


a n < 
4 ® < 

o oj in 

0 4 0 
® 4 © 
0 4 0 
Ndn 
0 4 4 

o © © 

O OJ (VJ 
N- O (VJ 
0 0 4 
4 O' 4 
0 0 4 
or*-® 
0 0 4 

o o © 

4 o OJ 
o o o 
OJ 4 o 

(Vj in © 
4 4 4 
4 UJ N 
4 4© 

d © o 

4 (VJ © 
© (V 4 
OJ 4 4 
0 4^ 
©44 
O- d 4 
0 4 4 
f- o o 
© Oj OJ 
© © O 
UJ u. O 

o o ^ 
in in in 


N- O (VJ 
© (VJ 4 
0 0 4 
0 0 4 
mod) 
0 4 4 
in n o 
O O (VJ 
O o o 
o o o 
O Oj 4 
4 in 4 
o o 
OJ 4 o 
OJ UJ o 
4 4 0 
4 O' OJ 
4 4 in 
>0 0 0 
4 OJ 4 

o oj in 

OJ 4 4 
0 4 4 
0 4 4 
—> >o o 

4 4 Oj 


in in oj 
oj cc <4 
o r- o 


o < 


> OJ 


> OJ 

o oj 4 
0 0 4 
©04 
O Oj d 
0 4 4 
o o o 
—« oj m 


o o _ 

4 0 0 
o o CD 
OJ 4 4 

oj in r- 

4 4 0 
4 UJ O 
4 4© 
d © ^ 
4 OJ O 
O OJ d 
OJ 4 o 
0 4© 
©40 

indo 
4 4 4 
o- © o 

O Oj OJ 
O © OJ 
0 0 4 
oj d 4 
in 4 4 
o r- d 
4 0 4 
d O O 
in O (Vj 

ON O 

4 0© 
Ol/IN 
OJ O 4 
o o o 
4 in d 


a cc <j 
— — o 
(VJ uj o 
4 4© 
4 O' OJ 
4 4 n 
d © O 
4 OJ 4 

o oj in 

OJ 4 4 
0 4 4 
0 4 4 
O' d © 
4 4 OJ 
N O OJ 

© Oj 4 
0 0 4 
0 0 4 
OJ O d 

o in 4 
d N- o 
O O OJ 
O O O 

o o o 
o o ^ 
4 o in 
o d f«- 
OJ o o 

oj o o 

4 0© 
4 o Oj 
4 4 in 
d © O 
4 (Vj 4 
© © o 

Nit? 


o o ~ 
in uj x 
04 © 

©40 
O d O 
in 4 4 

p» © © 
O (VJ OJ 
o o OJ 

0 0 4 
d 4 4 

o in 4 

d N- d 
0 0 4 
O O © 

O O OJ 

o 0 - © 

4 0© 
odd 

oj o d 

OJ O N 
4 0© 
4 0 0 
4 4 © 
d © O 
4 OJ 4 
o oj d 

OJ 4 4 
© 4 UJ 
© 4 4 
OJ d © 
d 4 OJ 
N O Oj 
© Oj 4 
o O © 
< ® U 


dinddddddi/'dddddddini/'irdi/'i/'di/'dirinini/i 


Number 28 


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


Page 17 


351 









n lj « n 

'C OD «J 

u. o aj -j 
coinoo 

-* CD U. O 
<r n cr> m 
O o o CD 

si n cd co 
>* Q r^~ O 

OOl/ll/l 
OOffi -J 
o -» O' CO 

r- uj uj 
a o o d 
u. u. *- © 
ns«o 
n •} ui 
o < in cd 
O u. o © 
'OMD ^ 

— in < 
o oo in u. ri 

OQ(M(\JO 

n«oocoo 

O O >C U 111 
H<nNs 
u.ir hoo 
r-r-aoor*- 
O *-< uj O UJ 
© < m m 
u. u. u © © 

N U. UJ O CO 
ID (T III lii iT 

CM 00 C5 l*. o 
o © o © o 

< CD O O UJ 

< < < < < 
in in in in in 

n n n n (f 


cn in in in in 



in 


i —i 
(0 
3 
4-1 
O 

<c 


o 

•3 


u 

CU U 

M 


O 0] 

CO < 

o a 


44 

QJ 0 


rn 

O' 

n 

co 

CM 


o 

ac 

in 

O 


•P (3 

(\) P 

in co 



c 


n 

u 

o 

■p 

w 

•H 

Cn 

a 

p 

a) 

T) 


c 

c 

3 

p 

D 

« 10 
-H 

0 

r d U 

M 

^ W 
0 ^ 
rs n 


CD 

c 


§ 


>4 

Q 

O 

© 


o 

© 


o 

© 

o 
n~ o 
r c 
o 


— O 
o 

U »- 

m o in 

o u. 3 *—< 

a © u a *: _j 

.. © — ..on 


o o o o o 
z Z 2 Z 2 

*: * *: * * 
a a a: a a; 
o o o o o 

3 3 2 2 3 

in in in in in 


o 

n 

a 


- x o 
: uj h- 
. z in i 


z i 
a —. > 
o a i 
u. a. ; 


asaas 
o o o o o 

< < < < < 


O A A A A A 


> O © Z 

j co 3 uj uj uj ui uj 

ic a i x x x x 

O A K K »- K t- 


•—'ll*—. 

*- K 

K Z h 1 

z a *-. x o 

*-• o a u h 

a u a z in 


O A O A o A A 


3 
* a 

o A 


a aocor‘~cc©u.'»<i_) 0 ©r*-c;ccc'»u.'»'ca:©^iroou. 0 ' 
inococroouuj^ococo'r^in<'0'j«jaDr^cMconcra'f*'U.^fMin 
uoincinivjconccoccoconcoscoinn-. ccro^to —'©>joo 
4o4onmonoinoooino-jir4(\j-j omo-to^oinoo 
©Ho^coiMonoQQjiQoo^^oO'j in c_> m —< —< © n m —. 
ajniMno^ono^ojoojo^'najaj^'tajin^-tin'Oji-ji 
n®o®Q04o®<HcocooHnnocou r)o®o®-j®ocj® 

noinooM^run^no^onunninm-t 'fno(\j^inoN4o 
•jooosfflwninoooo®oooo4oNoo©noooino 
no4o^m-j«J4fvjMofu>t(\j^f\J44Minajooinajooino 
o®<--<in4ino^onco®®nino<UHU.-'in®oo<-'-joffl 
nin<tn>tin<to 4 o^^ino 4 -jo>t-jn 4 ->t>*ininorn«oinin 
nuioo(\jnoaoi\joo40oo(\joO'} nHn®OHn®ou 
4-<tojrMinin(MncM>tinnjin©infMinfMtM4 , in^-t©cM'OCM©cMfM 
o^onajoo®o®n®n<jn®®o(\iH o^(MOocooo©'t 
o4-o^4fv-Lnoooininin<Mninooin>r (\j-jinooot\joon 
U'odoooQDooO'joujO'Jori-t^ MjincO'O^nino 
rvj(\jninajo4-o-?o(\j-?aj-j{\j-toin-}-j in>jininino<t^sO(M 
coooonco\o<^cO'rouoinouffl®HO u.ou.u®i\i<ffOcoH 
oooini/in^no>fo^o^o4iro-jo 4-tM>tnj©>t«t>^©-^ 
QOQo<tcooooonovo©a'©inQ>j-in uajninomujino^ 
onoi\i4oi\j(\JoM4(M-tf\j >j (\j ^ o 4 in 4mnno4-j 404 
■H®®ouoon4®®n®o®r)4ffio® ©>rooccrn-«orn>t 
no4o4oo44inonoinon44oo iM-*<MCMinin^fM>a-in 
©0ono«soo40in00QSo440 fflH®HuooH(*)n 
(\joojn(\jinninMinono4orii\iininoin444(Min(M44in 
n®®®nin®nin4o®<r-o©n®n u-^r->t>4‘oo—«in© 
4>4inon^oininin4 , nin'jfonoinoin fM-r.r-4m(Mo.j>Trvj 
oo4QH4QO4oujninoonH00N ©©O'-joocmcm©© 
in(Min©r)<4ofv>4fvj<t<r^cMfM>jin4-o<r r»©^«j(M©^3incM© 
n®n4ooNO(joino4oioo®in4in o®®^i\jo®u.»hic 
ininin4n(\j40404040400-4-t4 (Min>t^^'Oo<t>t^) 
o4oujr p ioir®OrH04oNoocouj(\i iMcoooncoco^co 
(M^CM>J^©»tr)CM-tCM>t(M«tinin©(M^in 40 M(\I 400 M 40 
00000000000000000000 oooooooooo 
'Of*~ooo'<cDUOUJii.o^rMn^in>OA-coa' <®uouJUOHNn 
'O'O'nNO'O'O'n'n'O'Of^r^r^r^r^r^r-r-f^r- r^r^r^r^r^r^mcococo 
inininminininininininininininininininin inininininininininin 
nnnnnnnionnnnnnfonnnnio nnnnnnnnrin 



cnininininininininmininininincninininin inininininininininin 


r^-cM-.cruii-f^a>rinr'-Hr', r-.couc<iinr^u«ior^r)4<iaccx'c 
uj<nu.inu.o©n<ii.O'^f*-ouj<cy'fMUJUJCM'ncor^f**«-.»-icDUJUJ 
inoooUUUU44OOUUU0®M440UUU —< CM © O CD L_ U. 
noooNffinNffiHoonnHHioMfflnmu^ ® o o ® s to 
OUUJOQins®4UJUJHin®niLUJU'00(M®0004UJUJ(7'QlL 
l\JI , 0! , l(MJ(MO<Uir®l T IXO®0( r l®nO'®<(\JOM , )NN®HO 
<-«0^oOU_OU.O 41MOU.U.UD® ® U O U It U U. 4 ® ® O Q U. U. 

^couomocr^r-^ooor^iju^-.u.^o^cor^ncDina'ooou.u.in 

-H(juj<nQu.souu<onHN43ujuj4u.ininQUJUJUJ®oinin 
^-Hninuo'Cu«^n^®®oooNininn®in'4onrtin«®oo 
40000UUUO®l04lLU.lLMJ004lLU.NU.OvONOOirO 
inoooncDUj'£ia'-'4-con-.^.r^-HCDa'«oinnf^cDcDo-H-.inr^o 
nUJU>4QMnij.QUJUJ4li.-'-4U®UUJCDin^MJUU.UMnU 
inin-<in<r'U(Mnmf^-.c_)CDC7'onr*-r)r^oouJUjr)r-.u_ruvto-f 
Ol\JOOUUU0O40OinuuU4<(M4UUU®O44-HUin0 
cm© >t©(rr~r)f^^Hec^^ccii.roro(M©©©r^u.rnf*>0'cc<ca'inr*“in 
ou<oinMnmuiuJ4®inoin®U4UQmnDnuju®u®u4 
oNffio®®0'ffiQninou®4<®N®iL(M®ooHa(Mno<o 
®(MO®UUUQO®®4U.NMn4® >J <h U. O U. U. 4 4 O 4 II O II 
®OOMn®NN®Off'Of0Mi.U.O'4O©^MnUJ'f®OON^U, 

®®UJ(jn^onu®uju®HU.Mj 4 uunshhuiuuoujo i u. 
offiincc4®'n<MnMno'Uo®nin^inffl4ffi(MMi.u.s®ujo 
0MOO0UU.D04 (\JOUJDUIlOOhOI/1QIl 0 44IMOUOU 
ouorHNln^N®•40--<uJ'£)I)ffl^lnuJo^^^^4oln©^^'H 

~<uj<4UJii.'-'--<inii_ooo-'incDf'-'Cooij-r^r^inh-ujinoi_>ujC7'0 
•4ininM-«cocc^MM-.mr-«o'<3 <MnsooO'-®c>ss-'OOo 
Uf r l-4UUU.UU.UJ(\JUJOU.UU.U.4CMinoinUU.D440>Jli.lLin 
•4®-'®lMQinNOO-®U.U.nCD(7'-<0®NiJ>N-0-<-H-<-H7'l\JN 
ino<Mvoinr^r^r^o>nuJUJQ^—»inuJOO'tr^cEininuiJUJOu_Of^ 
ir©-innffi(MocDnMnoa®un^MU.<©ffi®m^in-(M<o 
©C0 ^ 4UJUlLlLO(0(M4000U®00-LinuU 4 U 4 O U. U It 
inin®onii.u.Noffluoa'u.inino®-4®Nsu.in(?'0®-<M*)N 
©u4®u.inminuuujuua®nujuuj'4^Nu^uiuuJC®inir 
(MfMinr*-0'0'0'-.r^h-coin<<<M<Mor*-r)ncoco^©r^r^no<ujuj 
ooooooooooooooooooooooooooooo©© 
•4in®N®(><fflU0UJUOH(Ml r l'4®®N®0<ffiU0UJU.O^<'J 
QCCCa0<X)O0(X)CC<X)<X)COCCCDO'O'O'O'O'O'O'O'O'O'O'O'(7'O'O'O'^^*t 

ininininininininininminininininininininininininininininininin 

nnnnnnnnnnnnnnmonnnnnnnnnnnnnnn 



ininininininininincnincninininincnininincnininincnininininincn 


•— cm m ^ in 


* 

o 


® (MU. I U tt ® 
O a 4 ® K MO 

O © © © 4 - c u. 

O ® ® CD >H Q ro 

u. u ® -o u in o 

®N®Hh(MO 
UOOOffll/IU 
O' © © CO O' U. ri 
r» co uj uj o o in 
OhME(Oo4 
Q (VI O o -too 
P~- •—< -4 © O M >—« 
ou4uuuin 
uj o- n in ® 4 
UO4O40U. 
(O ffl ^ O O h ffi 

inuuui 4u h 
«-• in m in m < in 
a ^ >4 © © u_ u_ 
u O' o o - > n 
—. vo uj uj uj cd in 
UMOMnCMO 
It H Wo o U. u. 
n o ® ® o n it 

N 4 ®UJ 40 ^ 
O in CD r-* M CD CD 
II (\J 4 O O U U 
®0®0-hCD^ 

m o u u r- o 

^ ro in in n © cd 
u_ 4 o © © in in 
h- o © oo co in co 

O O 4 O O IT 
o ~ o —• ~ li. © 
o o © o © o © 
cn in <c ® o 

<<<<<<< 
in in in in in in in 
rn m m m m n m 



in in in in in in in 


Page 18 

352 


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


Number 28 



A CONSUMER COMPLAINT 

Mr. Maury Goldberg 
MiniMicroMart 
1618 James St. 

Syracuse, NY 13203 

Dear Mr. Goldberg: Dated: 78 May 2 

We have received the enclosed request for assistance from 
one of our readers regarding an order placed with you. Since 
the complaint seems reasonable enough on the surface, we felt 
it would be in his interest as well as that of the home comput¬ 
ing community as a whole if we inquired on his behalf. 

Enclosed you will also find a copy of Dr. Dobb’s policy 
statement regarding consumer complaints. May I expect a 
reply from you within three weeks of the date of this letter? 
Thank you for your help in making the home computing 
market a pleasant one for all concerned. 

Sincerely, 

Tom Williams 
Editor 


Dear Dr. Dobb’s, Received: 78 April 28 

I’m writing in hopes that you can help me resolve a prob¬ 
lem which exists between myself and MiniMicroMart. I had 
hoped that it wouldn’t get this far, but it appears that I’ve 
done all I can and it’s time for outside help. I’m hoping that 
you can aid me. 

On January 5,1978,1 sent an order for three circuit boards 
and some documentation for a total of $84.85. 

I received a package from MMM within two weeks. How¬ 
ever, it was only a partial shipment. They showed one board 
(their #CMOD 8-2P-100) as backordered, with estimated 
delivery of “Indefinite approx. 4 weeks maybe the 8-22 bd.”. 
This statement was on their work order/packing list, also 
showing my invoice #8222, dated January 12, 1978. There 
was no definite shipping date as required by Federal Trade 
Commission mail order rules, no offer of refund and no post¬ 
age paid reply medium, also required by the FTC. Oh well I 
thought, two out of three isn’t bad, and I settled down to wait 
four weeks for the third board. 

Unfortunately, there was another problem with that ship¬ 
ment. I had ordered their MOD-8 system manual that goes 
with the boards I purchased. I found however that the MOD-8 
applies only to 8008 based computers, so I sent it back to 
MMM, asking that it be exchanged for their 8080 manual 
(this request, along with the 8008 manual was sent the day 
after I received the shipment containing the boards and man¬ 
uals). At the same time, I ordered a copy of their Monitor-80 
program listing, enclosing a check for $6.00 to cover the cost 
of the Monitor and shipping on both the Monitor listing the 
8080 manual. The check was cancelled (so they obviously 
received the MOD-8 manual and Monitor-80 order) but there 
was no sign of the documentation, much less the board. 

After 45 days (no FTC acknowledgement of my order, 
no backorder notification, no offer of refund, no postage paid 
return medium) I wrote, asking what had become of my Mon¬ 
itor, Manual and circuit board. No response. 

One month later, 12 weeks since my original order, I wrote 
once again. No response. 


Two weeks later, I wrote again, this time sending the letter 
Certified mail, with a Return Receipt, informing them that if 
I didn’t hear from them, I was going to file a formal mail 
fraud complaint against them with the FTC. The Return Re¬ 
ceipt came back, but nothing else. Apparently they aren’t 
afraid of the Federal Government. 

So as it stands, it has been nearly four months since I or¬ 
dered three circuit boards and three pieces of documentation 
and all I have is two useless boards and one piece of data, and 
a large bill for envelopes and postage. 

I have contacted the FTC for a copy of their complaint 
form, but as we know, the wheels of justice turn slowly, so 
I am turning to you for help, Dr. Dobb's. 

I know that your world is very busy and that you have your 
hands full most of the time with the Journal, but I think you 
would be doing a service, not only for me, but for all comput¬ 
er hobbyists if you would check this out and see what’s with 
this company. 

It’s bad enough that I’ve wasted four months on a company 
with policies like those of MiniMicroMart, but I think that 
worst part of this entire episode is being totally ignored by 
a company which takes your money and delivers very little. 
A company which also apparently views government regula¬ 
tions with disdain. 

I should add, as a footnote, that I’m not interested in a 
refund, I want the circuit board and documentation I paid 
for. 

Thanks for your time, 2005 Whittaker Rd. 

Robert J. Retelle Ypsilanti, MI 48197 


Editor’s Note: 

Mr. Retelle eventually received his documentation but never 
his third board. Dr. Dobb’s has received no written response 
from MiniMicroMart. 

On July 26, Dr. Dobb’s contacted Mr. Maury Goldberg 
by phone. We were informed that the company manufactur¬ 
ing the boards had gone out of business and that he could 
only offer Mr. Retelle a refund. -TRW 


NEW GRAPHICS SOFTWARE FOR SWTPC 

News Release Received: 78 April 20 

GRAPH #1 and GRAPH #2 are utility packages enabling 
convenient use of the SWTPC GT-61 graphics display with a 
6800 computer. GRAPH #1 is for use with a machine language 
program while GRAPH#2 is for use through SWTPC 8K 
BASIC version 2. When using GRAPH #2, the user can 
program the GT-61 display directly from a BASIC program 
without any machine language programming. 

Both versions can display, as well as erase points, lines, and 
the complete upper-case ASCII character set. Additional 
capability for user defined characters (such as chess symbols, 
or even space ships) adds to the ease of use and versatility of 
GRAPH. Each package is priced at $5.50 (for paper tape), or 
$6.50 (Kansas City Standard Cassette) postage paid. Package 
includes either paper tape or cassette, and a 22 page instruc¬ 
tion manual with sample programs and a full source listing 
of GRAPH. Contact: Applied Microcomputer Systems, Box 
68, Silver Lake, NH; (603) 367-8004. 


Number 28 


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


Page 19 

353 



THE LAST 
OF THE FIRST 


BY AUBREY DAHL 


The Univac II was a marvelous collection of5,200 vacuum 
tubes, 18,000 crystal diodes, 184,000 magnetic cores, hun¬ 
dreds of feet of plumbing, and countless miles of wires. It’s 
a wonder that it worked at all; but work it did - for more 
than 18 years. 

The year 1958 was not exactly a banner year in the course 
of human events, but it did usher in a computing classic when 
Sperry Rand first presented the Universal Automatic Com¬ 
puter Model II (Univac II) to the world. 

It was not only one of the most powerful computers of that 
time, it was a veritable workhorse, persevering in varied en¬ 
vironments on many different applications, and working on 
and on over the years far beyond the time of its expected 
obsolescence. 

But, inevitably, even reluctantly, the end came. 

What is believed to be the last existing functional Univac 
II in the world finally stopped reading, writing, and comput¬ 
ing this March when it was retired after more than 18 years 
of reliable, sometimes even incredible, service. 

The last 13 of those 18 years were devoted to the proces¬ 
sing of accounting data for Computer Data Corp. an enterpris¬ 
ing Gardena, California service bureau, where the first genera¬ 
tion machine was kept alive with third generation software 
developed by the firm. 

Univac II was able to support the accounting needs of an 
extraordinary number of Computer Data customers, more 
than 1,000 who probably didn’t realize or care that their 
work was being done on the clanking antique. 

Computer Data’s president, Thomas Pryor, bought the 
machine from Pacific Finance in Los Angeles in 1964 when, at 
a youthful 5 years old, it already was obsolete. But the price 
was right and Pryor had a need and a fondness for the won¬ 
drous instrument. 


Reprinted With Permission of DATAMATION © magazine. 
©Copyright by TECHNICAL PUBLISHING COMPANY, 

A Division of DUN-DONNELLEY PUBLISHING CORPORATION, 
A DUN & BRADSTREET COMPANY, 1978-all rights reserved. 


The cost of the computer was minimal compared to the ex¬ 
pense incurred during installation. Much larger in size than an 
IBM 370/168 and less powerful than a present-day mini 
(in fact, it is being replaced by one — the Sperry-Univac 
V76), the Univac II was moved by cutting out a wall in the 
building that housed it, and carting it across town to Gardena, 
where a building had finally been located that had a back door 
large enough to accommodate its unwieldy size. It wouldn’t 
have been much more trouble to disassemble, move, and re¬ 
assemble a two-bedroom house. 

When Sperry Rand first built the Univac II, it was hailed as 
an impressive achievement in the emerging science of auto¬ 
mated data processing. And, indeed, it was, even though only 
about 32 were ever built. 

Think back. 1958 was also the year of the hula hoop. 

And it was only a year after the introduction of the 
Edsel. 

The Univac II had much greater speed (160usec add time 
versus 525) and memory (10,000 12-bit words of core versus 
1,000 words of mercury delay line) than its predecessor, the 
Univac I, which is often acknowledged as the first commer¬ 
cial computer. 

Characterized by tube technology, the II boasted more 
than 5,000 vacuum tubes, or “valves,” uncounted miles of 
wiring, an immense water cooling system, an enormous, 
tricky console, and a central processor that was 9 feet high, 
10 feet wide, and 14 feet long. 

A Walk-In CPU 

In fact, the cpu was so large that it had a door on it and 
interior space enough for a person to stand up and move 
around in it. The computer and its peripherals, which together 
weighed more than 8 tons, required a room with about 2,000 
square feet of floor space. Its water cooling equipment was 
nearly as big. Input was in the form of !4-inch magnetic metal¬ 
lic foil tape on reels that weighed about 2Vi pounds — each — 
and were, as one might expect, very durable. The foil tape is 


Page 20 

354 


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


Number 28 





no longer made, but the original tapes worked fine right up 
until the end. When a bad spot appeared on the tape, it was 
possible to simply punch a hole in it at that point and con¬ 
tinue to use it; the tape drives would skip over the hole. 

The II was not basically a punched card machine, as were 
most of its brethren. That magnetic foil tape was the input 
medium, too. Data entry was done, as it had been on the 
Univac II, using key-to-tape devices — long before the 
Mohawk Data Sciences engineers and others put their minds 
to the matter. 

Unlike newer machines, Univac II had a radio speaker that 
was used to “listen” to its operations when troubleshooting 
the system. Any deviation in the sound of the noisy computer, 
and the bug usually was spotted. Inventive programmers 
took advantage of this feature, in dull moments, and wrote 
routines to make it play music. What modern day machine 
would be able to sing “Auld Lang Syne” at its unplugging 
ceremony as the II did? 

According to various users of the old machine, it was the 
most complicated and overdesigned piece of equipment 
ever built — and one of the most dependable. 

It was in 1958 that the first U.S. earth satellite, the 


Explorer I, went into orbit and discovered the Van Allen 
radiation belt circling the globe. Globe? That same year, 
another space probe, the Vanguard I, determined that the 
earth is slightly pear-shaped. 

And Tim Tam won the Kentucky Derby. 

Other users of the Univac II system included the U.S. 
Navy Electronics Supply Office, the Department of Agri¬ 
culture Commodity Stabilization Service, U.S. Steel, Metropo¬ 
litan Life, and Pacific Mutual Life. 

These organizations bought their systems new at a price of 
around $114 million each. Tom Pryor bought his secondhand, 
after it had been used for five years by Pacific Finance. He 
estimated that with knocking out a building wall, moving, and 
the setting up — which included installing an $80,000 water 
cooling system — the machine cost him $250,000. That’s 
about $20,000 a year for 13 years service he’s enjoyed — dirt 
cheap. 

The “high speed” printer that worked with the computer was 
actually a Univac I device that was five years older than the 
Univac II. It was capable of a then-incredible 600 lines per mi¬ 
nute on alphanumerics and was good for 8001pm when pushed 
a little. It was still capable of this performance at the end. 



Photo courtesy Sperry Univac Corp. 


Number 28 


Or. Dobb's Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Page 21 

355 















The Software Lives On 

The programming language used with the computer was, 
appropriately enough, machine language. But the third genera¬ 
tion software developed by Computer Data over the years 
enabled Univac 11 to perform accounting applications that 
included payroll, accounts payable and receivable, invoicing, 
and inventory control in a kind of “pipelined” batch mode. 

Computer Data had developed, among other functions, a 
monitor that allowed each customer’s applications to be 
handled separately, but processed all like operations sequenti¬ 
ally in what might be called a “sub-batch.” 

Although all the accounting programs are integrated with 
each other, they are structured into standalone modules. The 
specific requirements of each client are accommodated by the 
coding of selected options in each module. These options are 
recorded by entering what is equivalent to a company profile 
on each firm whose work is to be processed. The programs 
then perform as if they are custom programs especially designed 
for that particular company, except that all of the invoicing 
for all of the clients is done in one pass, then all of the ac¬ 
counts payable, etc. 

Because of the modularity, a user could begin with less 
than the full system and know that when he developed the 
need and was ready for it, the expanded system would be 
available to him. In a way, the concept was a cross between 
tab processing techniques and batch processing. Yet it was 
highly efficient in that, unlike batch or even multiprogram¬ 
ming in batch, it avoided continual loading and unloading of 
programs. And of course the machine was built long before 
multiprogramming was introduced. 

The software has been converted to the Sperry-Univac 
(nee Varian Data Machines) V76, and will be made available 
to installations using Varian computers in accounting applic¬ 
ations — like an old man teaching his grandchildren a few 
tricks. All of the accounting systems will be offered by Com¬ 
puter Data; they may be offered by Sperry-Univac’s Mini- 
Computer Operation as well. 

The U.S. was approaching the end of a decade that had 
been relatively calm and peaceful, even though controversy 
continued to flare over the continued development of nuclear 
weapons. The so-called minorities were asserting themselves 
in a way that would ultimately result in the publication of 
a book named “Roots ” and a new awareness of human legacies. 

The machine was an incredibly reliable worker from its 
beginning. “It had only two down times of more than eight 
hours in 12 years of operation,” said Pryor. 

Through Fire and Flood 

But those down times were certainly singular. In one in¬ 
stance, the machine began to function sporadically and thor¬ 
ough troubleshooting failed to turn up the cause of the mal¬ 
function (the computer wasn’t operating well enough to exec¬ 
ute the fault-finding routines). 

Then someone thought he smelled smoke coming from 
the top of the cpu. He climbed a ladder (remember, the cpu 
is 9 feet tall) and found that there was cable erosion from 
what he later called “tired insulation” — the cable, which had 
been about a full inch thick, had frayed away over the years 
to a 1/4-inch strand. Still the machine had run on. And so 


the cable was cut and spliced, fresh insulation material was 
wrapped around it, power was turned back on, and the Univac 
II again operated with its customary reliability. 

Arnold Palmer was the PGA’s leading money winner in 
1958 with $42,507. Skirts were getting shorter and the nuc¬ 
lear powered submarine USS Nautilus made the first under¬ 
ice crossing of the North Pole on its way from Hawaii to 
Iceland. 

Another time at Computer Data the big machine went 
down due to a plumbing problem. When the door to the main¬ 
frame was opened, water gushed out onto the floor. 

The computer, Uniservo II tape drives, and power supply 
all were cooled by a system that pumped water chilled to 50° 
at a rate of 130 gallons a minute through copper piping. One 
of the pipes that ran under the floor of the computer had 
sprung a leak and water was jetting into the air like a small 
geyser. The first step taken was to cover- up the leak with what¬ 
ever material was at hand - “keep operating” was the watch¬ 
word. 

Water or no water, only after the shift was ended was the 
extent of the damage surveyed. The floor was soaked and the 
drainage hole under the floor of the cpu was under water. 
There was water, water everywhere. An ordinary hand pump 
was purchased from a nearby builder’s supply outlet, hoses 
were attached, and the pumping proceeded. Fans were turned 
on and placed to help the moisture evaporate. And in a matter 
of hours, the job was finished. 

Almost. When the Univac equipment was moved in, an 18- 
inch-deep trough had been dug in the cement floor between 
the main frame and the console to hold the cables connecting 
them. The trough had been covered over with fitted wood 
planking. When the cover was lifted, the trough was found 
to be brimming with water, the cables completely inundated. 
The machine had run in spite of this. And there wasn’t a 
single short circuit in the system. 

Succumbing to Old Age 

Richard Means, Computer Data’s engineer who watched 
over the Univac II for the past 13 years, and who worked for 
Sperry Rand on a similar machine for three years before that, 
said that it was a “phenomenal” computer in terms of depend¬ 
ability. 

“I have taken components out of it for maintenance or 
whatever and it just wasn’t supposed to keep on working, 
but somehow, it did. It made some kind of inner adjustment 
and stayed on. Incredible!” 

However, Means added that each morning he came to work 
during the months before the computer was phased out, he 
kept his fingers crossed and said a little prayer. 

To help maintain his machine, Pryor bought Univac com¬ 
ponents as spare parts when other machines came to the end 
of service over the years, and kept them in rented space in a 
warehouse next to his company. The warehouse has become 
an archive of first generation computer hardware. 

President Eisenhower signed the Presidential Pension Law 
in 1958, and sent Vice President Nixon on a good-will tour 
of South America, where he was mobbed in Caracas, Venezu¬ 
ela. 

And the Supreme Court reordered school integration in 
Little Rock, Arkansas. The more things change, etc. 


Page 22 

356 


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


Number 28 



A change in business requirements in the mid-1970’s 
and the continuing growth of the company led Computer 
Data to the installation of an on-line system that could also 
continue the firm’s time-tested batch operation. 

Cost considerations and performance were major factors 
in the decision to make the conversion to the V76 mini¬ 
computer, which is currently priced at about half of what the 
secondhand Univac II had cost and provides a great deal 
more capacity, speed, and power. 

The V76 minicomputer has two 64K 16-bit memory 
modules. The mini has semi-conductor memories instead of 
core, and two 92mb discs. According to Pryor, the continuing 
drop in the price of discs was another reason for the conversion. 

Another cost factor was the electricity bill. It was running 
about $2,500 a month, with the Univac II accounting for about 
80% of it. When the V76 was added during the changeover, 
Pryor said that he hadn’t noticed an increase of even $100 
in the monthly bill. Now that the V76 is being used 
exclusively, the savings are, at the least, substantial. 

There were other, more particular, grounds for making the 
change. Even with the extensive spare parts inventory, 
maintenance grew increasingly difficult. And qualified techni¬ 
cians understandably became scarce. 

Pryor explained that engineers trained in tube technology 
for computers had become a vanishing breed because tube 
logic had not been taught to undergraduate engineers in recent 
years. Thus, as the need for a certain proficiency diminishes, 
so does the proficiency, itself. 

1958 was the first year that airlines carried more trans¬ 
atlantic passengers than ships and the year of the first jet 
service across the Atlantic, by BOAC. Charles de Gaulle 
became the President of France, and President Eisenhower 
sent 5,000 Marines to Lebanon. 

And the John Birch Society was founded. 


And Althea Gibson repeated as national woman’s tennis 
singles champion at Forest Hills. 

Scrap or Souvenirs? 

There is, of course, a nostalgic concern that the last 
functioning Univac II has been consigned to history. When 
asked why he had used the old workhorse for so long, Pryor 
answered, “Because I owned it and it worked, and I wanted 
to wait until minicomputers became usable and could provide 
the right kind of accounting software support to go with our 
own system programming.” 

The ultimate disposition of the venerable computer is 
still a matter of some conjecture. Pryor thought he might 
rent warehouse space for it and the spare parts and preserve 
what is now a relic for future interest, if he finds it 
economically feasible. 

On the other hand, he might, as he said, just save some of it 
and sell the rest for scrap metal or souvenirs. 

Dick Means had some thoughts on that subject. “The 
Varian operation undoubtedly will bring in new business 
with its advanced technology, but it wasn’t that the demands 
were too great on the Univac — it was just over the hill.” 

He smiled. “As for reducing the machine to scrap, you have 
to remember that it’s Mr. Pryor’s baby — he could never watch 
anyone take a hammer to it.” 

The Pioneer moon rocket was launched in 1958. It didn’t 
reach the moon but it achieved an altitude of 79,000 miles, 
30 times as high as any previous man-made object. 

The Univac II family set its records as well. Its last member 
was operating productively 20 years after the series 
introduction, its meter having recorded 43,219.9 hours of pro¬ 
cessing, 79,637.1 hours of being powered up. Those marks 
may never be equalled. 


TURTLE’ ROBOT FOR HOME COMPUTERS 

News Release Received: 78 May 8 

The Turtle is a small home robot invented by William D. 
Hillis, a senior at MIT. The Terrapin™ Turtle is believed to be 
the first commercial offering of a home robot ready for sale. 
It can ‘walk,’ ‘talk,’ ‘blink,’ ‘feel,’ and draw,” says Dan Hillis. 
Hillis is affiliated with MIT’s Artificial Intelligence Laboratory 
which has used types of “turtles” in various projects. 

The Turtle acquired its name because it is approximately 
the size of a box turtle, consisting of a chassis topped by a 
hemispherical dome 3 Vi inches in radius. The Turtle has two 
large wheels and is capable of moving six inches per second. By 
turning the wheels in opposite directions, the Turtle can be 
made to rotate exactly on the spot. Other endearing features 
of the Turtle include beeping its speaker and flashing its lights. 

The Turtle can also “feel” and “draw.” The former is ac¬ 
complished by using its dome/shell as a touch sensor so that 
the Turtle “knows” when it bumps into an object. To draw, 
the Turtle lowers a pen from its chassis and moves. With these 
two capabilities, the Turtle can map rooms by entering them, 
bumping into the objects within them, and storing the config¬ 
uration in computer memory. Then the Turtle can let down its 
pen and draw a rough representation of the floor plans. 

The Turtle has lights for eyes and a speaker to emit sounds. 
It requires a parallel interface: one compatible with an S-100 



bus is available as an accessory. Each Turtle comes with ten 
feet of cable and may be purchased either as a kit or fully as¬ 
sembled. Each kit comes with a tested, 20-page instruction 
manual. 

Brochures are available. The Turtle sells for $300 in kit 
form and $500 assembled. The interface is $40. Contact David 
McClees, Terrapin, Inc., 33 Edinborough St. Sixth Floor, 
Boston, MA 02111; (617) 482-1033. 


Number 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, Ca 94025 


Page 23 

357 





BY FRITS VAN DER WATEREN 

van't Hoffstraat 140 
Haarlem, NL 2014 RK 
The Netherlands 


LISP is an interactive list processing language and very suit¬ 
able for microprocessors. LISP is very easy to learn and has a 
very simple syntax. It is very easy to write recursive programs 
and functions, because the system will stack all returns and 
intermediate results. When you want to define, for instance, 
the function for N!, in LISP this would look like: 

(DEF FAC (N)(COND ((EQ N 0) 1) 

(T (TIMES (N (FAC (MINUS N 1))))) 

) ) 

“BASIC minded” people would find this an ugly notation, but 
in fact it is very well structured. 

As you see, we define the function FAC of a variable N. 
The function-body is a CONDitional expression, where N is 
tested to be EQual to 0, then the result is 1; else (T) the result 
is the product of N and the ‘FAC’ of N — 1. 

As you see, we recursively call the function FAC again, 
where N is assigned to N — 1 and so on. As I said, the system 
will stack all the intermediate results. This is done on a so- 
called Association list, because all structures in LISP are lists. 
Not only data is represented as a list structure, but programs 
and functions are also lists. This is one of the powers of LISP. 
And by means of the list notation you can directly see the 
internal structure of a list. 

This interpreter recognizes “inner list” notation only, but 
it is very easy to write a program, in terms of LISP, which 
recognizes both “inner-” and “outer lisp” notation. We could 
write: 

(DEF lISP2( ) (PROG (A) 

START (TERPRI) 

(TEREAD) 

(PR I NT(QUOTE :)) 

(PRINT(C0ND((AT0M(SETQ A (READ)))(APPLY A (READ) NIL)) 
(T (EVAL A NIL)) )) 

(GO START) )) 

When we now call: (LISP2). We are in the just defined higher 
level interpreter, which has “: ” as a prompt (the input routine 
READ will still print so we get : * as a prompt now) and 
the system will now evaluate both: 
car( (a b) ) which gives A and 

(car(quote (a b) )) also giving A. 


In outer lisp notation the system does the qouting for you. 

For completeness I shall give the definition of DEF: 

(PUTPROP (QUOTE DEF) 

(QUOTE (LAMBDA (L A) 

(PUTPROP (CAR L) (CONS LAMBDA (CDR L)) EXPR ))) 
FEXPR) 

We can now define a function by: 

(DEF function-name (list of parameters) (function body) ) 
The basic LISP interpreter consists of a READ. EVALuate 
and PRINT cycle, and will therefore directly execute the 
expression, the user has typed, and print the result. When you 
type, for instance: 

(TIMES-3 4) 

The system directly responds with: -12. 

It is not my intention to give a complete description of the 
language, because a good description is too long for just an 
article. But there are some good books about LISP (see Refer¬ 
ences). 

This implementation of LISP is a version which is called in 
the literature LISP 1.5. That is standard LISP, or LISP 1, with 
two extensions called the PROG-feature and the FUNARG- 
mechanism. 

Features of This Implementation 

• The interpreter uses 4.5K bytes, including the initial 
OBLIST, and runs very well in a system with 8K bytes. 

• Non compacting garbage collector. 

• Advanced I/O capability. 

Implemented handlers are: 

TTY handler with an ACIA. 

READER handler with a PIA (A). 

PUNCH handler with a PIA (B). 

And it is very easy to extend this by patching the device 
table with an address to user written handlers. 

• Very free input format. 

• Easy error recovery by means of BACKSPACE, DELETE 
and CANCEL. 

• Automatic storage allocation. 

• Extended error messages. 

• The interpreter recognizes ‘inner lisp’ notation. 


Page 24 

358 


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


Number 28 







Brief Function Description 


Arithmetic functions 


Elementary functions 


(CAR X) 

(CDR X) 
(CONS X Y) 
(QUOTE X) 
(RPLACA X Y) 

(RPLACDX Y) 


I/O functions 

(READCH DEV) 

(READ1 DEV) 
(READ DEV) 

(TEREAD) 

(PRIN1 DEV) 
(PRINT X DEV) 
(TERPRI DEV) 

(OPEN DEV NAME) 

(CLOSE DEV) 

Predicates 


(ATOM X) 

(NUMBER X) 

(NULL X) 

(EQXY) 

(GREATER X Y) 

(COND (A B) (X Y)) 


(LIST A BC.. .Z) 


(EVALX Y) 


(APPLY XYZ) 

(PROG (A B....) 
L (statement 1) 
(statement 2) 

) 


(GO L) 
(RETURN X) 

(FUNCTION X) 
(ALIST) 


value is the first element of list X. 
value is the remainder of list X. 
value is the list: (X . Y) 
value is X literally 

replace the ‘CAR-part’ of X by Y; 
value is X. 

replace the ‘CDR-part’ of X by Y; 
value is X 


read one single character from ‘DEV; 

value is this character. 

read an atom; value is this atom. 

read an S-expression; value is this 

expression. 

flush the input buffer; value is NIL. 
print atom X; value is NIL. 
print S-expression X; value is NIL. 
print a CR and LF on DEV; value is 
NIL. 

open a file on DEV with NAME as 

file name. 

close file on DEV. 


if X is an atom, value is T else NIL. 
if X is a number, value is T else NIL. 
if X is NIL, value is T else NIL. 
if X is the same as Y, value is T else 
NIL. 

if X is greater than Y, value is T else 
NIL. 

If A is not NIL then B is evaluated; 
else if X is not NIL then Y is evaluat¬ 
ed; else NIL. 

The result is a list of all its evaluated 
arguments. The number of arguments 
may be infinite. 

Evaluate X with Y as association -list. 
In fact this is the LISP-interpreter 
itself. 

Apply the argument Y to the func¬ 
tion with Z as initial association-list. 
With this function we are capable of 
writing programs in LISP. The first 
argument of PROG is a list of vari¬ 
ables used inside the PROG, and the 
remainder is a list of labels and state¬ 
ments. 

Goto label L (literally) 

Return from a PROG with the value 
of X. 

This is a quotation for functions, 
return the current systems associa¬ 
tion-list. 


(PLUS X Y) 
(MINUS X Y) 
(TIMES XY) 
(QUOTIENT X Y) 


value is X + Y 
value is X — Y 
value is X * Y 
value is X/Y 


Some miscellaneous functions 


(SETQX Y) 
(PUTPROP XYZ) 


(GET X Y) 
(SASSOC X Y) 


X is set to the value of Y; this is also 
the value of this function. 

The property-list of atom X is 
extended by property Y under an 
indicator Z. If the indicator already 
exists, then its property is altered; 
value is Y. 

Get the property saved under the 
indicator Y from the property-list of 
atom X. 

Lookup X on the association-list Y, 
when found return its value; else NIL. 


How to Obtain This Implementation 


Send an International Money Order to: 
F. v. d. Wateren 
van’t Hoffstraat 140 
Haarlem, NL 2014 RK 
The Netherlands. 


Costs: 

• $ 10 . - 

• $25. - 

• $30. - 

• $12.50 

• $32.50 


for an object papertape in SI-FORMAT complete 
documentation, and a listing of the I/O package of 
LISP. 

for an assembler listing with symbol table and the 

macro generation for the OBLIST (in GPM) 

for the above mentioned two items. 

for cassette tape, Kansas City standard, 300 baud, 

including description and I/O listing. 

for cassette and complete listing. 


References 

1. Berkeley, Edmund C., and Daniel B. Bobrow, The Programming 
Language LISP: Its Operation and Applications, MIT Press: 
Cambridge, MA, 1966. 

2. Friedman, D.P., The Little LISPer, Science Research Associates: 
Palo Alto, CA, 1974. 

3. Siklosky, Laurent, Let's Talk LISP, Prentice-Hall: Englewood Cliffs, 
NJ, 1976. 

4. van der Poel, W.L., The Programming Languages LISP and TRAC, 
T.H. Delft: The Netherlands, 1972. 

5. Waite, W.M., Implementing Software for Nonnumeric Applications, 
Prentice-Hall: Englewood Cliffs, NJ, 1972. 

6. Weissman, Clark, LISP 1.5 Primer, Dickenson: Belmont, CA, 1976. 


Number 28 


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


Page 25 

359 



FORTH DUMP PROGRAMS 


BY JOHN S. JAMES 
1090 Miller Ave. 
Berkeley, CA 94708 


Here are a couple short examples to illustrate programming 
in Forth. 

Forth is a stack-oriented programming language which is 
also its own operating system. Typically the complete Forth 
system fits in only 6K bytes of code, which includes the Forth 
compiler, a run-time system including I/O drivers and virtual 
memory, a text editor, plus an assembler, which is (optionally) 
used for writing new I/O drivers or time-critical code which 
must run at full machine speed. Forth object code is very 
compact and the system is interactive, yet run-time speeds 
can be as little as 30 percent slower than machine code (100 
percent on 8-bit micros). Typical hardware is 16K bytes 
and a CRT; for serious development work, a floppy or other 
random access mass storage for source programs is necessary. 
For more introductory info, see my article in the May, 1978 
issue of Dr. Dobb’s. 

The Forth system is like a root of a language which grows 
toward any application area for which it is used. Forth 
programs consist of short (usually one to five line) definitions 
of new operations, which then become part of the language. 
Each large application program is really a special-purpose 
language, greatly facilitating modification. Because object 
code is so compact, any general purpose operations (such as 
the examples below) can be added permanently to the 
language. Then they are automatically available to be used 
from the terminal as commands, or as instructions in other 
programs; and they are used in exactly the same way in 
either case. 

Here is a Forth program to dump a specified number of 
bytes from a given memory address: 

: DUMP 3 F = 0 DO DUP I + \@ . LOOP DROP ; 


Examples of its use, in decimal and octal: 

8100 10 DUMP 

32 0 114 31 214 6 18 11 140 6 

8100 10 OCTAL DUMP 

40 0 162 37 326 6 22 13 214 6 


Most Forth systems can use any number base, even above 
16, in which case letters after ‘F’ in the alphabet are taken 
as digits. These number bases affect only the I/O; internal 
computations are binary, so there is no loss of efficiency. 

Forth operation names are separated by one or more 
spaces. Names can be any length, and can include any combi¬ 
nation of letters, numbers, special characters, or even invisible 
control characters. At compile time, the system first searches 
the dictionary of operation names. If the character string is 
not found, it tries to make a number out of it, using the 
number base which is currently in effect; if this fails an error 
message is given. Almost all of Forth, the system itself and 
the user’s applications, is part of the dictionary. 

In the example above, the first character string is (a 
colon), which is the DEFINE operation. It sets up the 
beginning of a dictionary entry for the next word, ‘DUMP’. 
The definition is terminated by the semicolon. 

‘3 F =’ sets ‘F’, which is the output field width, to three, 
so that each number which is output will take at least three 
spaces (plus an additional space between numbers). This is 
done so that the output will line up well. Otherwise each 
number would take as many spaces as it happened to require. 

At execution time, the number three is pushed onto the 
stack, then ‘F’ is executed. ‘F’ is a variable of type INTEGER, 
declared by the system and used as field width by the output 
routine. Forth users can declare their own variables of type 
INTEGER, of other system-defined types such as CONSTANT 
or ARRAY, or they can create their own user-defined variable 
types. 

Any variable of type INTEGER is really a Forth operation 
which pushes the address of a location suitable for storing an 
integer onto the stack. After ‘F’, *=’ is executed; it places the 
second number on the stack into the address on top of the 
stack; and then, like other Forth operations, it destroys its 
arguments on the stack. 

‘DO’ and ‘LOOP’ are structured looping operations. ‘DO’ 
takes an initial and a termination value from the stack (the 
loop actually ends one before the termination value). In this 
case, when ‘8100 10 DUMP’ is executed, the stack contains 
‘8100’ and ‘10’ before DUMP starts to execute. ‘ 3 F =’ makes 
no net change to the stack, but ‘0’ is pushed on before DO is 


Page 26 

360 


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


Number 28 





executed, so DO sets up a loop of ten iterations (index values 
zero through nine). ‘DO’ destroys its two arguments on the 
stack, which then contains only ‘8100’. 

Now ‘DUP’ makes a copy of what’s on top of the stack, 
making the stack be: 

8100 

8100 

‘I’ is an operation which pushes the value of the index of the 
innermost ‘DO’ loop onto the stack. *+’ adds the top stack 
values, replacing them with their sum. On the first iteration, 
zero was added, leaving the ‘8100’ unchanged. 

‘\@’, or BYTE FETCH, replaces the address on the top 
stack value with the byte which was at that address. V, or 
PRINT, prints the value on top of the stack, and then discards 
it. Each time around, the ‘8100’ sitting on the stack is copied, 
the loop index is added to it, and the byte at that address is 
printed. 

After the loop terminates, ‘DROP’ is executed. It throws 
away the top stack value. This is to get rid of the ‘8100’, so 
that DUMP does not leave garbage on the stack after it has 
finished. 

Incidentally, this program could also be written (a little 
better) as: 

: DUMP 3 F = OVER + SWAP DO I \@ . LOOP ; 

‘OVER’ takes the second argument on the stack and (without 
destorying it) pushes a copy of it on to the stack. After the 
*+’ is executed, the stack contains: 

8110 

8100 

(assuming that ‘8100 10 DUMP’ was executed). The rest of 
the working of this program is left to the reader as an exercise 
(SWAP reversed the top two items on the stack). 

Here is a dump program which formats every 100 bytes 
(if in decimal) into a separate block of print-out, with the 
starting address printed on a separate line. (In octal, every 
64 bytes is in a separate block, and similarly for other number 
bases.) 

: BYTEDUMP 3 F = OVER + SWAP DO 

I BASE @ DUP * MOD 0* IF CR CR I . CR THEN 
I \@ . LOOP ; 

8000 140 OCTAL BYTEDUMP 

17500 

234 4 140 6 12 0 64 25 262 14 110 25 246 36 140 6 24 0 100 36 

66 15 140 6 62 0 100 36 66 15 140 6 106 0 230 36 166 14 200 4 

166 21 146 21 156 24 276 36 214 6 12 102 117 130 104 0 32 37 326 6 

136 14 266 27 

17600 

42 37 356 27 200 37 214 6 6 107 105 122 115 0 142 32 326 6 140 6 

36 0 64 13 140 6 37 0 64 13 214 6 3 102 131 105 40 0 162 37 

326 6 22 13 214 6 4 104 125 115 120 0 376 33 326 6 202 14 44 31 

2J36 21 136 14 

17700 

266 27 234 4 100 30 200 4 210 21 66 32 

This program is similar to the example above, except for 
the added second line. ‘I’ puts the loop index on the stack, and 
‘BASE @ DUP *’ duplicates the value of the number base 
currently in effect and multiplies, leaving the square of the 
current base value on the stack, with the loop index value 


below it. (‘BASE’, like ‘F’, is an INTEGER type variable 
defined by the system, and used by the V output routine.) 
Then MOD replaces those two numbers by their modulus, 
which is zero if the loop index (which is the next address 
to be printed from) is evenly divisible by the square of the 
current number base; otherwise it is some non-zero value. 

This is done because in Forth, structured conditional 
instructions take zero as truth-value FALSE; any non-zero 
value is TRUE. ‘0=’ tests the top of the stack for zero, 
replacing it by ‘1’ if it was zero, by zero otherwise; i.e., ‘0=’ 
reverses the truth value of the number on top of the stack 
(some Forth systems call this operation ‘NOT’). 

Now ‘IF’ tests the top of the stack; if it is true (non-zero), 
code following the ‘IF’ will be executed. (If false, code after 
an ELSE would be executed, but the ‘ELSE’ clause is optional 
and not used here.) In either case, execution continues after 
THEN’. 

In this example, if the address of the next byte to be 
printed is evenly divisible by the square of the base, the 
modulus is zero, which ‘IF’ would interpret as false. ‘0=’ 
reverses the truth value, and the code ‘CR CR I . CR’ is 
executed in that case. This code does two carriage returns, 
prints the address (the value of ‘I’), and does another carriage 
return. 

This program in object form takes 64 bytes; it can be left 
as a standard part of the system or, if memory is very tight, 
it could be loaded when needed. It can be used from the 
terminal as a command, or as part of another program. ‘BYTE- 
DUMP’ doesn’t care how its arguments get on the stack, so 
they don’t have to be literals; the full power of Forth is 
available to compute them. 

This program is written in the Caltech version of Forth, 
which is distributed by DECUS for PDP-11. Other Forth 
versions use different names for a few of the operations, e.g. 
the equal sign may be equality test, with an exclamation mark 
used for the STORE operation, where these examples use 
qual sign. Usually software is fairly easily transportable even 
when the Forth versions have not been designed to be 
compatible, using redefinitions such as: 

But Forth versions on different machines can easily be 
identical, so that software written on one machine can be 
transported to others without change. Currently the Forth 
Interest Group (787 Old County Rd., San Carlos, Ca 94070) is 
developing identical implementations for several different 
micros and minis, and the code will be in the public domain. 

This paper hasn’t mentioned other features of Forth, 
e.g. nesting of loops and conditional, recursive routines, easy 
implementation of multitasking, tree-structured vocabularies, 
or modular debugging. Forth is especially suited to real-time 
control applications, to large projects, and to small machines. 
Software development times are often a fraction of what 
would otherwise be required. Today, access to Forth can be 
hard to find (e.g. to my knowledge, the system used for these 
examples is the only one currently running in Berkeley). We 
expect increasing use of this language as it becomes more 
available. 

NOTE: For more information, see the newsletter Forth 
Dimensions, published by the Forth Interest Group, 787 
Old County Rd., San Carlos, CA 94070. Price is $5 subscrip¬ 
tion, $1 single copy. 


Number 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, Ca 94025 


Page 27 

361 



STRUBAL VS FORTH 


Gentlepeople: Received 78 July 5 

This letter was inspired by John James’ article on FORTH 
in your latest magazine. (No. 25, page 21) I was very impressed 
with the ingenuity of this system. It seemed very cleverly de¬ 
signed to get so much capability in such a small space. Unfor¬ 
tunately, I think that FORTH fails one of the primary tests 
of a good programming language: readability. I feel that a 
good language is designed to make programs easy to read 
and understand. Easily read programs are easily debugged pro¬ 
grams. I was hard pressed to figure out that: 


: POLY DUP DUP * 5 * SWAP 7 * -10 

was the evaluation of the polynomial 5X 2 -7X-10. I think 
that a language should express such a statement more like 
the following form: 


PRINT 5*X*X-(7*X)-10 


which is much easier to relate to the task at hand. To under¬ 
stand the FORTH construction I have to think about stacks, 
etc. and the internal representation of data. High-level lan¬ 
guages should insulate the programmer from such considera¬ 
tions as much as possible. 

The illustration on page 24 is another example of the lack 
of readability of FORTH programs. I doubt that any program¬ 
mer could quickly determine what this program does. I have 
seen programs for the LIFE game in many languages, but the 
FORTH example was by far the most obscure. No doubt 
it is easier to use than assembly, but there has to be something 
more readable. I think a well commented assembler program 
would make more sense to the average reader that the 
FORTH example! 

I enclose an example of how I feel the example program 
might be written. The language of my example is STRUBAL, 
a language that J. Hemenway and I devised. A STRUBAL 
eample appeared in an earlier Dr. Dobbs’ (no. 23). STRUBAL 
exists as a full-compiler for 6800 systems. It runs in a min¬ 
imum of 16K bytes of RAM and requires mass storage. The 
example compiled into 1888 bytes of object code, which 
is considerably bigger than the FORTH code of 475 bytes. 
However, the run-time package required by the STRUBAL 
code was 3.9K bytes as opposed to the FORTH interpreter 
size of 5 to 6K bytes. The STRUBAL assembly code file could 
be readily optimized by a programmer knowledgeable in 
6800 assembly language to remove 200 to 300 bytes. I feel 
that program size (within reason) is not so valuable a measure 
of language quality as readability, but STRUBAL and FORTH 
seem to produce roughly equivalent load modules when all 
memory-resident parts are accounted for. Since the STRU¬ 
BAL code is directly executed, it will be much faster than the 
FORTH code, which must undergo some interpretation. 
True, STRUBAL requires the overhead of multiple passes 
through the source program, and it needs intermediate files, 
but the end result is a program that both works and can be 
read by someone else. The example program took me about 
20 minutes to write and key in, about 8 minutes to compile 
and run, and it ran the first time. 


The example maintains two “universes”, each an array 
with 25 rows and 81 columns. A “generation” is defined as 
the conversion from the present universe to a new universe. 
Lines 6-12 set up a random first universe. On average, half 
the elements of the universe (called “cells) will have a star 
0*’) in them (called “alive”). Lines 13 through 18 copy the 
new unvierse back into the old and print out the universe as 
the latest generation. Line 16 uses the STRUBAL string 
capability to copy an entire character string at once. Lines 
20-46 create the new generation. Lines 23-28 count the 
neighbors of a given cell. As in the FORTH example, the cell 
itself is counted. The STRUBAL keywod “XTRACT’Yemoves 
a number of characters from a given string. Lines 30-38 deter¬ 
mine the state of a cell in the new universe. Note that a cell 
counts itself as a neighbor. 

The STRUBAL example is rather “self-explanatory” ... 
and I feel that this is major strength. The STRUBAL compiler 
is available from: 

Hemenway Associates 
151 Tremont Street 
Boston, Mass. 02111 

on Smoke-Signals, ICOM, SWTP Flex, and PERCOM disks. 
A source-book which gives the entire source listing and com¬ 
prehensive algorithm descriptions of the compiler will be 
available soon. Hemenway Associates markets an extensive 
line of 6800 software, including a macroassembler, editor, 
linking loader, and cross-assemblers for the 6502, 8080 and 
F-8. 

I feel that software writers should strive for readability 
in their work. What good is a clever algorithm design if no one 
can find if among the verbiage? 

Sincerely, 148 Wood Street 

Robert D. Grappel Lexington, MA 02173 


OOOl 

0002 

0003 

0004 

0005 

0006 

0007 

0008 

0009 

OOIO 

0011 

0012 . 

0013. 

0014 

0015 

0016 

0017 

0018. 

0019 

0020 

0021 

0022 

0023 

0024 

0025 

0026 

0027 

0028 

0029 

0030 

0031 

0032. 

0033 

0034. 

0035 

0036 

0037 

0038 

0039 

0040. 

0041 

0042. 

0043 

0044. 

0045 

0046 

0047 

0048 

0049 

0050 

0051 


* PROGRAM TO PLAY LIFE 

* INITIAL GENERATION RANDOM 

* 80 BY 24 MATRIX TO FIT CRT SCREEN 

* INSPIRED BY FORTH VERSION IN DR DOBBS #25 PG 24 

* 

DSTRING B1(81. 25). B2(81.25) 

FOR 1=1 TO 25 
FOR J-l TO 81 
STRING B2(J.I>= 

IF RAND(I) LT 0 STRING B2(J.I>= * 

NEXT J 
NEXT I 

LOOP PRINT ///, C793. NEW GENERATION' 

FOR 1=2 TO 24 
STRING Bid, I )=B2( 1, I > 

PRINT ✓ ,XB1(2,I) 

NEXT I 

FOR 11=2 TO 24 
FOR Jl=2 TO 80 
NBRS=0 

FOR 12=11-1 TO 11 + 1 
FOR J2=J1-1 TO Jl+1 
XTRACT TEST-1.B1(J2.12) 

STRING IF TEST EQ * ' LET NBRS=NBRS+1 
NEXT J2 
NEXT 12 

XTRACT TEST-1, B1< J1, Ill 

* CELL WITH 2 OR 3 NEIGHBORS SURVIVES 

* CELL WITH <2 OR >3 NEIGHBORS DIES 

* EMPTY WITH 3 NEIGHBORS CREATES NEW CELL 

STRING IF TEST . EQ THEN EMPTY 

IF NBRS LT 3 THEN DIES 

IF NBRS GT 4 THEN DIES ELSE SURVIV 

* 

EMPTY IF NBRS NE 3 THEN DIES ELSE SURVIV 

DIES STRING B2<J1,I1>=' ' 

GOTO ELOOP 

SURVIV STRING B2(J1,U)= * 

ELOOP NEXT J1 
NEXT II 

* 

INPUT /.'CONTINUE (Y OR N>?',XTEST 
STRING IF TEST EQ Y THEN LOOP 
STOP 
END 


Page 28 

362 


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


Number 28 



USE OF NOPCODES AS EXECUTABLE LABELS 

Received: 78 April 7 

Every microprocessor has one opcode defined as a “no¬ 
operation” (NOP), useful as a filler in program gaps or timing 
loops. In addition, some micros have opcodes (defined or 
undefined, the latter “illegal” and so not necessarily identical 
in chips from different mask sets) that are executed without 
causing any detectable change anywhere. These can be called 
nopcodes. E.g., the 8080 and Z80 have 7 instructions ($7F, 
$40, $49, $52, $5B, $64, and $6D) that move the content 
of a register into the same register, and so are defined 
nopcodes. Although they must now be the least-often used 
opcodes in the 8080 set, they could be used as executable 
labels for the next instruction. Such labels, although meaning¬ 
less to the CPU and with no effect on operation (except 
timing), could be assigned meanings interpretable by 
debuggers, relocaters and other programs. The information 
content of the 7 “monops” (short for one-byte nopcodes) 
is limited, but could be increased by using sequences of 2 
(“monop-duos”) or 3 (“monop-trios”). For example, the 
8080 could have 49 monop-duos and 343 trios. Since 
interpreting logic could easily recognize solos, duos, and 
trios, this would allow 399 different labels. If the 8080 NOP 
(00) were allowed as the second and/or third element, the 
total would become 511. 

Although the 650X has no defined nopcodes, it now has 
a large supply of undefined ones. (This of course will change 
in the enhanced versions now in the design stage, but there 
are thousands of systems now using the original design.) 
It has 6 monops ($ 1 A, $3A, $5A, $7A, $DA, and $FA). 
It also has 5 two-byte illegals ($80, $82, $89, $C2, and 
$E2) that require an “operand” byte but make no use of it. 
I think of these as “binopcodes” (nopcode plus one 
“noperand”) or “binops”. Since the noperand can be any one 
of the 256 possible 8-bit bytes, the information content of 
binops is very large (and they would be simpler to interpret 
than monop-duos or -trios). There are also “trinops” (e.g., 
the 8 illegals of type X! C). 

Before going on, I should reply to the letter by Paul Schick 
( DDJ #21), that is a strongly negative reaction to my article 
on 650X opcodes (DDJ #17). Neither in that article nor in my 
note in BYTE (2 (12): 72, 1977) did I advocate the use of 
illegal opcodes as instructions. In fact, the whole point of 
my legality-testing subroutines OPLEGL (DDJ #17 and 
#19) and HYLEGL (DDJ #22) was to screen out illegals. 
I presume that the 650X designers know very well what their 
chip does with illegal opcodes (although they see no need to 
document it!). I respect their decision not to support even the 
illegal operations that might be somewhat useful. However, 
designers are not endowed with divine omniscience and 
infallibility. They can—knowingly—do something foolish, 
or—unkowingly—do something wise. The point I am trying 
to make in this note is that some nopcodes may be so useful 
as programming aids that their retention as defined elements 
in an instruction set merits serious consideration by designers. 
I am presently exploring the implementation of 650X bin op- 
labels, but this will require time and thought, so I am 
publishing the concept in order to make it immediately 
available to other programmers (and to designers). 

In thinking over possibilities for scanning-debugging (of 


which my program SIMBUG in DDJ #19 is a very primitive 
example), it became increasingly clear that the superiority 
of assembly langugae over machine language largely rests 
on its much higher information content, especially in labels. 
This makes assembly-language programs much longer, 
somewhat more intelligible to human beings, and quite 
unintelligible to the microprocessor. A fairly complex 
assembler program is needed to translate them into machine- 
intelligible form. The assembler also acts as a scanning- 
debugger and as a program locating and addressing controller. 
Labels play the major role in these useful activities with 
the crucial symbol-table at the core of everything. 

In the KIM-1 program SWEETS by Dan Fylstra (BYTE 
3 (2): 62, 1978), there is an ingenious use of machine- 
language labels. However, a Fylstra-labeled program is not 
executable. Labels must be removed before execution, and if 
there are execution bugs they may need to be re-inserted for 
the program revision. This limitation could be removed by 
using binop-labels. In fact, some problems of machine-code 
relocation might be soluble by retaining at least some nop- 
labels in the taped or disked programs, which could then be 
address-corrected by a relatively simple program. 

A special kind of labeling is also possible with legal 
opcodes. E.g., a STORE instruction addressing a location in 
ROM is in effect a NOP, so that both the ROM page and the 
location on that page can convey information. Also, any 
instruction that is unreachable in program operation could be 
used to store non-program information (a trick used in my 
subroutine BYTNUM, in DDJ #17, 1977. However, the detec¬ 
tion of and in formation-retrieval from such labels would be 
less convenient than with monop- or binop-labels. A ROM- 
trinop ought to use a STORE opcode normally rarely used in 
working programs, to make detection easier (the page of every 
such opcode would have to be checked to distinguish between 
ROM and RAM), but would still involve more bytes and 
execution time. 

The conservative view of a microcomputer system is that it 
should differ from large systems primarily in scale, in the way 
that a VW differs from a Mercedes, and that there ought not to 
be qualitative differences in hardware, software, or methods of 
operation. Innovations should arise in the giant systems, and 
then (to the extent that the micropocketbooks of micro users 
allow) be copied at the lower levels. I prefer another analogy. 
There are no elephants that burrow underground like moles or 
can fly like bats, and downsizing to the level of insects allows 
even greater diversification. Micro systems are going to be 
individualized and customized in ways that would horrify 
IBM, and some innovations at the micro level (most will of 
course be failures) may well migrate upward. 

H.T. Gordon University of California 

College of Natural Resources Berkeley, CA 94720 



Number 28 


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


Page 29 

363 









MAKING A NEW case 
FOR THE HEATH H9 TERMINAL 


BY HOWARD L. NURSE 

665 May bell Avenue 
Palo Alto, California 94306 

Copyright, 1978, Howard L. Nurse. 

If one reason you invested in a computer is to take advant¬ 
age of word processing programs, a display restricted to upper 
case is as useful to you as a one octave piano is to a composer. 
Here is a simple method for converting the Health H-9 video 
terminal to display lower case alphabetic characters. 

After studying the circuitry, I found it would be easy to 
modify the H-9 to include the missing characters. The key¬ 
board on the H-9 would be difficult to convert, but Heath 



Fig. 1 

Detail of H-9 Character Generator board showing lower case modifi¬ 
cation 


Reprinted with permission from REMark Magazine, Journal of Heath 
User's Group. 


has provided a convenient parallel I/O connector on the rear 
panel of the terminal, through which an external keyboard 
having upper and lower case can communicate. 

This article describes how you can add the integrated cir¬ 
cuits and keyboard to an H-9 to make it a full upper/lower 
case terminal. 

Circuit Modifications 

A circuit diagram and parts list for the changes to the H-9 
Character Generator Circuit Board are shown in figure 2. Two 
integrated circuits, an RO-3-2513-/CGR-002 from General 
Instruments and an SN74LS27, must be added to generate the 
new characters. 

The lower case memory, an RO-3-2513/CGR-002, has a 
surprise in store for the unwary. For some reason (probably 
perfectly logical) the addresses on the input of the CGR-002 
chip are inverted with respect to its upper case twin. The H9 
modification would have been simplified had the address 
formats of the two character generator chips corresponded. 
The General Instrument catalog lists a version of the 2513, 
the CGR-005, which has correct address levels, but this device 
is not readily available through mail order outlets. Fortunately, 
the required inverted addresses are available on the inverted 
Q outputs from IC202 and IC203. The outputs from the 
character generator chips are directly compatible. 

The outputs from the character generator chips can be 
made active or high impedance, depending on the level of the 
enable inputs on pin 11 of each chip. When pin 11 is low, the 
outputs of the corresponding chip are active. 

IC223, an SN74LS27 Triple NOR Gate, has been added 
to the character generator board to select which chip will 
be active. When bits 6 and 7 of the incoming ASCII character 
are high, IC223 recognizes that a lower case character is pres¬ 
ent and enables the lower case character generator chip. At all 
other times the upper case chip is enabled by the same IC. 

Wiring the Two Integrated Circuits 

The two new integrated circuits are piggy-backed onto host 
IC’s on the Character Generator board. A photograph of a 
modified board is shown in figure 1. I found the easiest way 
to add the devices was to mount a socket on the original 
chip, and then to mount the new IC in the socket. A total 
of 7 external connections must be made to the character gene- 


Page 30 

364 


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


Number 28 

























rator chip through pins on the socket which have been bent 
out at right angles from the socket. 

Once the socket pins have been bent, place the socket 
over the existing chip (which you should remove from the 
board while performing the surgery) and solder the remaining 
pins to the corresponding pins on the IC. Note that the chip 
enable, pin 11, is also bent out from the original upper case 
chip. This is the only pin on an IC which must be bent as part 
of the modification. 

IC223 is attached to IC201 in the same manner. For this 
IC, however, only pins 1,2,7 and 14 are connected to the host 
chip. All other pins on the socket must be bent so they do not 
touch the host chip below. 

The wiring of the two integrated circuits is completed by 
connecting the six address lines to IC202 and IC203, and the 
two chip enable inputs to IC223 as shown in the schematic 

Keyboard Interface 

A variety of keyboards which provide lower case alpha¬ 
betic characters is available at reasonable cost. Look for one 
which has a parallel output port and provisions for locking 
the alphabetic characters in upper case during the times when 
you don’t want lower case. I chose the new Cherry “PRO” 
which offers much flexibility in addition to meeting the mini¬ 
mum requirements. 

The Cherry “PRO” has five user-defined keys which you 
can wire to provide any output character you desire. I am 
using four of them to provide Control-I (TAB), Control-S 


(Stop), Control-Q (Go), and Control-C. By adding an 
SN74123N dual monostable multivabrator IC the keyboard 
has a “Typamatic” mode which repeats all keys if they are 
held down for more than a half second. 

A schematic for the wiring between the keyboard and the 
terminal is shown in figure 3. The data transfer handshaking 
requires that the parallel data from the keyboard be present 
from the keyboard strobe until the terminal has sent back a 
signal saying that the data has been accepted. This handshak¬ 
ing takes two additional IC’s on the output of the keyboard to 
latch the data. 

Software 

Heath software will support lower case characters. The Text 
Editor (Ted-8) and Extended BASIC are the two programs 
which can make the most use of the new capabilities of your 
terminal. Ted-8 is easily adapted to accept both upper and 
lower case characters by typing “L” while in the command 
mode, and then answering “Y” to the computer’s question: 
LOWER CASE CHARACTERS (Y/N)? 

Extended BASIC must be configured to accept lower case 
characters. Start with the distribution tape and add any re¬ 
quired patches. Then follow the instructions in Appendix A 
of the BASIC section of your software manual. Type the 
prompt L, to which the computer will respond: LOWER 
CASE (Y/N)? A “Y” response will configure the software 
to accept both upper and lower case characters as String Data. 


MONITORS FOR THE 6800 

Dear Dr. Dobb’s, Received: 78 June 14 

The Motorola 6800 microprocessor is gaining in popularity 
against fantastic odds. It has been estimated that some 26 
million lines of code have been written for the Intel 8080 so 
that all the 6800 owners are busy writing to catch up. 

Southwest Technical Products Corp. has helped the 6800’s 
popularity with selling systems at prices lower than most 
competitors. When they introduced their first systems, the 
operating system (monitor) provided was MIKBUG. This mon¬ 
itor has several problems and for the serious user its replace¬ 
ment is mandatory. The latest SWTPC systems now have 
SWATBUG, a monitor system developed at SWTPC. This 
system is also in a MC6830 ROM. For those users who own a 
PERCOM, SWTPC, or similar cassette interface, this system 
does not activate the RC line and the cassette interface must 
be operated manually. M6800 owners do not despair, help is 
on the way. First, Shifting Sands Microcomputer Products 
Corporation, Box 441, Fairborn, Ohio 45324, manufactures 
the RC-68A which is a PC board with sockets to allow user to 
plug in 2708 EPROM in place of the 6830. This allows one to 
use 2708 monitors such as the SMARTBUG monitor sold by 
Smokesignal Broadcasting Co. or to customize one’s own 
system when access to programming facilities for 2708’s are 
available. 

The purchase of the PC board, SMARTBUG, and an MP-S 
board which is a must for I/O will certainly upgrade any old 


system. This is about the only way to allow use of the Percom 
CIS-30+ at 1200 baud, which is the rate used for local storage 
by this user, and this done without any errors for over a period 
of 10 months of extensive software development. 

The owners of 6800 should look forward to a PASCAL and 
FORTRAN within the next year so that an update is probably 
in order to keep abreast of future advances. I also recommend 
for the user the Shifting Sands Dissassembler and Display soft¬ 
ware. For display make the following patches if one has a ter¬ 
minal such as the Lear Seigler ADM3A which allows 80 char/ 
line. 


ADDRESS 

PATCH 

S5E4E 

$01 

S5E4F 

$01 

S5E50 

$01 

S5E51 

$01 

S5E52 

$01 

S5E53 

$01 

$5E55 

$01 

S5E83 

$01 

$5E84 

$01 


I hope that this information will be of benefit to your 
readers if you see fit to publish same. 

Sincerely, Dept, of Computer Sciences 

Chuck Adams North Texas State University 

Denton, Texas 


366 


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


Number 28 



A Programmable 
IC Tester for KIM 


BY JOEL SWANK 

4655 SW 142nd St. #186 
Beaverton, OR 97005 

With a few dollars in parts and a small program, KIM can 
be used to test most SSI integrated circuits and some MSI 
devices. The best thing about this tester is that it is 
automatically programmable. You don’t sit over the data 
book trying to figure out what a device is supposed to do. 
You just plug in a known good device of the type under test, 
press the program key, and the tester is programmed to test 
that device. 

This idea was published in the June ’78 Byte by Mark 
Thorson, but his implementation is a black box with hard¬ 
wired logic and memory. I have moved all logic into software 
leaving some inverter/buffers, some wire jumpers, and the test 
socket as hardware. 

The program communicates with the IC through a PIA 
(Peripheral Interface Adapter). The 8 bits of PIA port A are 
used to receive signals from the IC and the 8 bits of PIA 
port B are used to send signals to the IC. While being 
programmed the tester sends each of the 256 possible 
combinations of the 8 bits on port B to the IC and the 
response to each is recorded in memory. During testing, each 
combination is sent again in the same order, and the response 
is compared with that in memory. A result of not equal means 
a bad IC. 

Since different IC’s use different pins for input and output, 
it is also necessary to connect the PIA input and output lines 
to the proper pins of the test socket. This is most easily 
accomplished by jumper wires and some easily changeable 
type of connector. Unneeded inputs or outputs can be left 
unconnected. The power and ground must also be jumped to 
the proper pins. 

The B port of the PIA is also used in automatic pulse mode 
to send a 1 microsecond pulse on its CB2 control line. This 
pulse occurs each time data is written to the B port. The 
CB2 line is in verte d to become the CLK and inverted again to 
become the CLK. These 2 signals are provided for devices 
that need a clock signal to strobe in data. 

To use the tester, start execution at location 200. The KIM 
display will light with 0’s. To program the tester, insert a good 
IC of the type to be tested in the test socket. Be sure that the 
jumpers are properly set. Press the PC key and the tester will 
program itself. This builds the pattern of responses in memory 


page 3. To test, plug the device to be tested into the socket 
and press the DA key. If the display lites with all 0’s the device 
is good. If an error is encountered the display will contain 
information about the error. The left 2 digits contain the 
byte sent to the tester. The middle 2 digits contain the byte 
received from the tester. The rightmost 2 digits contain the 
byte from the pattern. The AD key returns control to KIM. 

This tester is able to test most 14 and 16 pin TTL circuits. 
If 74LS TTL is used for the inverters, CMOS can also be 
tested. If care is taken with the jumper programming, some 
MSI devices can be tested, and by expanding the software 
more complicated devices could be checked. 

The program of the tester is the 256 byte pattern in 
memory. This pattern completely and unambiguously defines 
the logic of the device being tested. Patterns for each device 
could be stored in a file for later use. Of course the jumpers 
would have to be programmed exactly the same to use the 
pattern again later. Are there other uses for these patterns? 
Could a program be used to generate the logic from these 
patterns? Maybe these or something similar could be used 
by the manufacturer to describe a device. The data could be 
used to program everyone’s programmable tester. 



JUMPER CONNECTIONS 
FOR A 7400 


Number 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, Ca 94025 


Page 33 

367 







1000 : programmable ic tester 


<o3 £0 Pi A 



p 

A 

Op 


P 

A 

7 


e> 

07 



"DATA Pfcom DEsJICt 


CL-K 


CLK II xz. 


14 - 


Xfc 17 


T>P\tA To tC-Jict 


Juo^pEP A RSA 


l Z 3 + 5 fe 1 


R '« u iZ 13 \4 15" l(o 



O 

X 


UJ 
























3 


1- 











3 







2 

V- 


»- 




















CD 




X 


3 











< 







►H 

< 


z 




















\ 




A- 


a 





> 






3 







X 

X 


M 




















l-i 




3 


z 





< 







X 

































CJ 


M 





3 






3 

X 




2c 


a 

t- 


M 




















X 











X 






< 

CJ 


O'- 


< 


h~ 

3 

X 

10 




















NO 




CO 


3 





3 







z 


>- 


X 

X 


X 

u 

2c 




















M 




M 


M 





M 






>- 

X 


X 


H- X 

X 

X 

f— 

M 





















-J 











O 




> 

>- 

X 

M 


X 

C- 

3 P- O C'- 

CD 

o 


> 

Q 




















< 




X 


< 









< 

X 

X 




> 

X >- X >- 

z 


X 

X 

Z 








CO 












M 











X 




3 

X 


» 


o 

X 

*- X X X 

X 

CD 

h- 

a 


UJ 







z 







CO 





*- 




►- 


h- 





«. 




X 


X 



M 

X X 

X X 



< 



CD 







a 







UJ 





M 




X 


X 





X 




CD 

h- 

> 

CO 


3 

X 

3 3 


3 

X 

a 

M 

< 







m 







CO 





Z 




u 


u 





3 




fH 

X 

< 

X 


< 

o < 

X CJ X CJ 

o 

X 

X 

□ 

D 

CE 














JD 





»-» 




X 


X 





U 




CJ 

CJ 

CO 

>- 


J> 

z a 

>- X >- < 

z 

>- 

z 

u 

CO 

CD 







< 







UJ 






























X 

X 


1- 







u 







X 






























X 


h- 

CO 







►H 







o 































z 

CD 








z 







CJ 






























CJ 

» 

■ UJ 

UJ 







3 







< 

















X 

3 




< 


< 






1- 

X 

' h- 

CD 

Si 

«- 

oo 

O' 

< 

CD 

Jt 

Si 

ca 


00 

00 

on 


X X 

< 

ca 



< 

X 


X 


< 


< 


m 


h- 

h- 

X 

a 

X 

JD 

X 

CO 


X 

t- CD 

X 

H— 


z 


< 

gj 

CD 

QJ 

x 

U- 

U_ 

5 

SI 

S3 

si 

Si 

Si 

S3 

X 

^ vU 

S3 



-J 

J X x 


X 


3 


3 


Z 

Z 

z 

z 

t- 

X 

3 

X 




3 

X 

X 

X 

i o 

X 

S3 

S3 

SI 

ca 

S3 

SI 

a 

<1. 

< 

< 

< 

< 

< 

a 

X CJ 

X 

oo 


X 


K- 

X 

M 


M 

U t- 

CJ 

A- 

S3 X 

X 

M 

CJ 

X 

X 

3 

X 

UN 

3 «- 

XiJXia 

3 

f- 

z 


f— 


Si 

S3 

SI 

S3 

S3 

S3 

CJ 

O 

o 

CJ 

a 

O 

a 

t— 

*- e- 


S3 


on 

CJ 

(J S) 

Q 


Q 

on 

cj cm u 

S3 * 

♦ 

* 

CO 

CD 

♦ 

< 

♦ 

r- 


K- «— X 

< 

3 

M 

< 


O 














M 






























1— 



X 

_J 

_J 

_i 

_J 

_J 

-I 

< 

_J 


_l 

_i 

_l 

_j 

z 

-I _J 

-J 

X 

o 

< 

< 

< X 

X 

X 

X 

< 

< 

< 

< 

< 

< 

< 

< 

X 

X 

X 

C3 < X 



X X 




UJ 

u 

O 

u 

a 

o 

CJ 

i—i 

o o a 

u 

u 

CJ 

o 

cj a 

a 

CJ 

-J 

CJ 

h— 

A- 

O h- 

z 

h- 

Q h- 

CJ X 

a h- 

b- 

t— 

CO 

CO 

s 

X h- 

26 

a 2 e 

X 2 X 2* 

z 

2 

CD 



NJ 

• 

• 

• 

• 

• 

• 

X 

• 

• 

• 

• 

• 

• 

It 

• • 

• 

• 

u 

X 

CD 

CO 

_J CO 

M 

CO 

3 

CD 

3 

CD 

3 

CO 

CO 

CO 

3 

3 

u 

X 

CO 

CJ 

QJ O 

CD CJ CC CJ 

X 

3 

X 




_) 

X 

< 



X 


< 

< 

< 

CD 

CD 

m 


CJ 3- 

*: 


h- 
















X 














h~ 

t— 

CO 

X 

I— 

h~ 


< 

X 

_J 

<L 

X 

_j 


z x 

p- 


hH 






























< 

< 

UJ 

z 

z 

Z 


h- 

n 

1- 

J— 

M 

i— 


CJ H- 

X 


z 












3 




3 












.. . 

" •• « 

•• CL 

CL 

* 

M 

0. 

X • 

.. .. . 

• a 

Q 

CJ 

Q 

CJ 

CJ • 

’• •• • 

• CO CO 

a • 

■ 

• n 












CJ 




.. < 










>• — 

•• 


EJSSianSSSISSEilBEdS&lCilSSSUSI 

T-oorA^-iPivOr'aDOca«-ojm^irivOt^cDO'si*-i 

G)6JscasiaisaBi-«-»-T-T-»-«-»-T-^(\ J c\)i 


issieasoacacasis 





< 

< 

< 


< 


< 

< 




X 

X 







U 







CD 

CJ 

a 


a 


C 

CD 




*" 

*" 







T - 






3 

T- 

ON X 

oo 


S3 

U 


U ON S3 

CD 

< 

O' 

X 

< 

CM 

'O 

CM 

UN 

ca 

X 

13 - 0^ Si «Ef X 






ON 

S3 

Si X 

s 


S3 

ON S3 

CM S3 S3 

X 

X 

X 

*" 

'O 

X 

X 

3 


X 


SI «“ X ^ 





a 

O 

CD 

CD CM 

X 3 

X 

O' 

0 O' 0 O' 

UN 

UN 

UN 

S3 

S3 

UN 

S3 UN O' 

S3 

O' S3 0 s S3 O' si CJ 





CJ 

< 

3 

3 < 

3 

X 

3 

< 

3 

< 3 < 

3 

3 3 

CM 

CM 

CJ 

X 

3 

u 

3 

O X 

U X O O ^ 





S3 

e- 

ON 

>0 O' X 

X 

X 

00 


O' O' CJ 

X 

ca 

CM 


0^ 

< 

(J 

X 

ca 

(M^vC3<UUJS 





S3 

S3 

IS 

si ca 

S3 

S3 

SI 

*“ 

«- 

T“ e « 

T~ 

00 

CM 

CM 

CM 

CM 

CM 

CM 

ON 

ONONONONONONON^J 





00 

00 

00 

CM CM 

CM 

CM 

CM 

CM 

CM 

CM CM CM 

00 

CM 

CM 

CM 

CM 

CM 

CM CM 

CM 

CM 

(M CM 

CM CM CM CM CM 





S3 

ea 

S3 

S S3 

S 

ea 

s 

S 

S3 

si ca S3 

ca 

IS 

S 

IS 

S3 

S3 

S3 

s 


S3 

S3 S3 

si S3 ca s ca 




S3 

ca 

S3 

S3 

ca ss 

ca 

S3 

S3 

SI 

S3 

si ca is 

ca 

S3 

S3 

IS S3 

S3 

Si 

S3 

ca 

S 

Si 

IS Si 

S3 S3 S3 ca S3 

S3 

ca 

S3 

S3 


00 

ON 

UN \Q 

(v co 

O' 


CM ON 

UN \Q 

O' 3 

O' 

ca 

*- 

CM 

ON 


UN sO 

[S3 O' S* - 

CM 

ON 




ON 

ON 

ON ON ON 

ON 

ON 

ON >3- C <3- 


*2 <3 *3 


UN 

UN UN UN 

UN 

UN UN 

UN UN UN sO 'O UJ 

v0 

'O 


Page 34 

368 


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


Number 28 














uajcoco<Ocaeuea<3'casis^T*a'si3 

uciiciis&ieiic>isssssss&is 

(JCOCOCUCCal&lS^SSSCSSS 

EJKS&llSSSSSSEdSSISISS 

ucococu^ciiejsi^EitjK^ciias 

6JS6jK)Seil&lSCilStJSKlSKlS 
OXXXUN* - * - * - UN» _ * _ « — iD«~ «■"*- 
QcjssisciissssQCJiaejss 

UiOCDCD^CJCJS^cjejcjcsieaia 

nUMSSSSSBSSQSSKS 

UCOCOCO^sisisim-kikisiM'Kisisi 

CdSSSSSSS&lSSUSS&lS 

UCDCcco^eiaejcj^siHs^isss 

SBSSSSSSSSMSS&1SSS 

3xxxun*-«--*-un«-«-*“un*-*- , »- 

SUUBUSSMSSSISSIS1SS1 

ucucua)«j&is&i^6itjtj^6jej(a 

SBSBCJHSCijeJMCJBejCJSS 

UOaCD^CJCiSCGmU^QQQ 

SSSSSSSS&1SUSSUSS 

ucDCDQj^cjejcj^isiscj^cjej&j 

SSUCISSSCdSSSSSSSS 

3XXXUN«-«“*-un*-«-«-un«-*-*- 

3sisasi6a6i3tsca3ea33333 


LJ 


< 

C_i 


3 


< 

z 


o 
< 
3 
C3 

Ci 

El 

X 


X 

U 


3<<<'DC\J(\JCNJvOC\jr\JCNJvD(NjCNJCNJ 

Caeasi5lEl333515iea3Basi5l3 

3<<<'Dcnjcnjcnj>ccnjcnjcnJ'0cnjcnjcni 

u. E)SSSSSSISSSSS 51 SISIS 

l 3<<<U3C\jcnjcnj\OcnjcnjcnJ'Ocnjcnjcnj 

r'N SMsstsnassuiBiasssisis 

» ll. [iHLiih^nnhnnnM^nn 

a easisisisisssisissisiEiscas 


z 

CC 

UJ 


< 

X 


a 


o 

A 


sussoissBisssss&isca 

N'-C\jn^ir''OMDO'<CDUQUti. cnj 

sssssssssseasssss a 


A 



LIGHT PEN FOR COMMODORE PET 

News Release Received: 78 July 17 

A self-contained light pen which plugs directly into the 
Commodore PET 2001 user port has been announced by the 
3G Company. This light pen makes it possible to bypass the 
PET’s keyboard and interact directly with the information 
displayed on the CRT screen. 

The light pen adds versatility to most graphics programs 
and is valuable as a teaching aid for young children. It also 
adds unique capabilities for application programs aimed at 


the non-computer oriented person. The light pen is complete 
and ready to plug into the PET. A sample program and pro¬ 
gramming instructions comes with the pen. The entire package 
sells for $24.95 and is available from 3G Company at Rt. 3 
Box 28 A, Gaston, Oregon 97119; (503) 985-7176. 


_J 





y- 




LI 
















3 X 

1 


u 



LJ 





< 




U 
















3 3 






M 





CD 




►H 






X 










3 )- 






u. 




LJ 





> 





3 

X 










3 3 










> 

O 




LI 





3> 

3 






Q 


3 


3 X 


3 




z 




M 

LJ 




3 

z 




M 

K 






3 


3 


y- 


3 




X 




LJ 

Z 





X 




3 

:o 






> 


1- 


< 


Z 




LJ 




3 

X 




z 

LI 




CJ 

z 






M 


3 


► i— 


X 




l- 




LJ 

3 


X 


* 

y- 




3 

< 



X 


1- 

3 


3 


< 

< 

3 




1- 




X 

1- 


LJ 


a 

y- 




X 




3 


z 

U 


X 


< Q 

y— 

y- 




< 







2 


z 

< 





i- 



2 


3 

3 


X 



< 

3 




X 




• 

X 


►—I 


z 

X 




• 

CJ 



y-i 


X 

X 


3 


Z 3 

3 

X 











h- 


z 






3 



y— 







y-* > 










o 

LJ 



LJ 

3 

a 




o 

X 




3 

< 

< 


«L 


3 

3 

< 




M 




z 

> 


NO 

Z 


3 




z 

X 



O 

Z 

1— 

h- 


h- 


3 M 

Z 

1— 




Z 




LI 

< 


UN 

CD 

►“ 

►— 




3 

cj 

CJ 


UN 

o 

< 

< 


< 


I- X 

3 

< 




►—< 




CO 

CO 


CNJ 

Q 

CO 

< 




UD 

u 

z 


CNJ 

o 

3 

3 


3 


>- y- 

X 

3 













u 

X 















X 3 











>- 




H- 

3 





>- 







>- 



X 











• 





Z 





• 







m 



o 















a 

3 















Z 3 






X 


-J 







»— 

3 





3 





X 

3 

3 



3 Z 






►— 


*- 


CO 

►- 


CL 



1 




X 

*— 

<3 


X 


h- 

h- 

1- 

X X 

X < 

3 

< 




< 


< 


_J 

< 


3 

X 

LI 

3 




3 

< 

X 


3 

X 

Z 

z 

< 

Z 

3 


< 

< 




pn cl 

ca Q_ 


3 

CL 


3 

3 

Z 

X 


Sl 


3 

X 

X 


3 

3 

X 

X 

X 

l-H 

3 


y- 

1— 




* 

ca 

* 


CL 



X 

CJ 

M 

X 


Sl 


X 


3 


1- 

CJ 

* 

* 

__ 

♦ 

< 


3 

O 













►— 
















Ji 






< < 

> 

>- 

< 

X 

< 

>- 

LJ 

a 

3 



>- 

< X 

X 

3 

>- 

3 

03 

>- 

< 

< 

< 

X 

3 

< 

< 

X 


Z 

O f- 

3 H- 

>- 

C/D 

h- 

z 

Z 

LJ 

(J 



Q > 

3 

2 

Z 

z 

Z 

3 

y- 

h- 

o ►— 

2 

3 

y- 

3 

t- 


3 

_J CO 

-I to 

H- 

3 

CO M 

CD 

X 

X 



3 

1— 

3 

CJ 

X 

w 

X 

X 

X 

X 

3 

Si 

“D 

X 

X 

3 

X 


• 

CD 



CL 










X 







o 






X 




W 

a 



3 









CO 

3 







X 






3 




3 

X 



_J 









3 

3 







X 






3 




Z 

.. a. 



CL 





" 

•• 

** 

*• 

t- 

f- 






•* 

3 




** 

** *• 

•• X 



** 

3 





CNJ 










CNJ 










CNJ 


< 

< 








SI 










Sl 










Sl 


3 

3 




pn *r- 

si 

St 


SI 

ca 


X 

ud 




Sl 


ca 

Sl 

UN 


UN 

X 

X 

< 

Sl 

X 



CNJ 

Sl 




ca 03 

ca 

3 


X 

OJ 


L 

u 




Sl 


X 

X 

ca 


L 

3 

L 

L 

X 

L 

CNJ 


SI 





X UN 

Sl 

^T CD 

ca 

r- 

CD 

ca 

ca 




Sl X 

s: 

«- 

Sl 

X 

Sl 

Sl 

^T 

UN 

T- 

UN 3 


3 

3 

ca 



< CO 

< 

CD 

O' 

CNJ 

O' CJ 

□ 

L 




<c 

O' CNJ 

o 

CJ 

u 

3 

L 

X X 

Cl X 

^T 


CD 

< 

>D 



pn un x O' 

CD 

U 

L 


CNJ 





m3 

X 

O' 

CJ 

3 

ca 

«- 

PN 

un o x 

3 


Sl 

PN 

nC 



M ^ 


<3- 



UN 

UN 

UN 




UN 

UN 

UN 

UN 

UN 

m3 

vC 

>D 

X UD \Q 'O X 


X 

X 

X 



cnj cnj 

OJ 

CNJ 

CNJ 

CNJ 

CNJ CNJ 

CNJ 

CNJ 




CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 

CNJ 


CNJ 

CNJ 

CM 



ca ca 

ca 

Sl 

SI 

SI 

SI 

ca 

ca 

Sl 




Sl 

Sl 

Sl 

Sl 

ca 


51 

Sl 

ca 

51 

s 

ca 

Sl 



ca 

ca 



j H Q 

St 

Sl 

SI 

Sl 

Sl 

Sl 

Sl 

Sl Sl 

Sl 

Si 

SI 

SI 

Sl 

Sl 

Sl 

Sl 

Sl 

Sl 

Sl Sl 

Sl 


Sl 

ta 

ca El 

si ca 

si ca 

ca 

IS 

3 

3 

n vo x cd 

O' Si 

«— 

CNJ 

PN 

ST 

UN %D 

x 

CD 

O' 

El 


CNJ 

pn ^ 

UN 

UD 

(V X 

O' si 

*- 

CNJ 

CN ^ 


X CD 

X 

3 

«— 


G vC '■O 

vO 

nO 

X X 

x x x 

O' X 

x 

x x cd co 

X 

X 

X 

X 

X 

X X 

X 



X 

X O' 

X X 

X X 

X 

3 

3 

3 

- T~ 




*■ 




«“ «- 


*- 



*- 










«“ 

«“ «- 

*- «- 


*“ 

CNJ 

CNJ 

CNJ 


uj^u» - f r iscMEic\jc^m<0'eiac\j*-tsmcD<r r >s»u.u.'DCD 

3CNJ«-eacasiS!ea3X'0'CL5ia:Ea3<tfLL^TX«-<0UNUN 

a3CNJCNJ<<<<<<CNJC\iLeacNJsiea5iCNJ'S5icNjCNJLUC\JCNJ 

<SSQOQQQQBSr5iaiSHSSSBiaSfrSIS 


Cj q. <X<G3<CDteOZ 

iaiJJII<<DirhIHj]hh3hhOJZIJ3D 

>JJhhHH|-h2llu < '2LJ<<JZZIIDUhliJJ 

J]<UUOOQOCUJUJDHH^a.Q.a.Q.Q.Q.Q.J3tflhK 


Number 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, Ca 94025 


Page 35 

369 





















NEW COMPUTER LAW 


Dear Dr. Dobbs: Received: 78 July 17 

Computer users should know about SB1766, the “Fed¬ 
eral Computer Systems Protection Act of 1977”, now working 
its way through Congress. The vast, open-ended scope of its 
wording makes any use of almost any computer “without au¬ 
thorization” punishable by 15 years imprisonment or fifty 
thousand dollars fine. 

While directed mainly against financial crime, the wording 
clearly covers students who play games with computer time 
intended for class assignment use, or employees who use com¬ 
pany computer time for unapproved research on personal pro¬ 
jects. Another problem concerns university and other com¬ 
puter centers where typically a few files are explicitly confi¬ 
dential, some are explicitly public, but most development 
work is accessible but not explicity public, essentially a kind 
of proto-publication of “anyone can look at this but I don’t 
assume responsiblity for correctness.” It is common practice 
to browse this work for the sole purpose of keeping up with 
the field and improving programming technique. Under the 
new law, any use of this vast and irreplacable community 
library could be interpreted as a felony. 

The law could deter public use of open-access community 
bulletin boards (which now exist in several cities), open com¬ 
puter conferences, and other public data bases. These free 
computer services are more than just experiments or toys, 
as someone setting up one can be repaid many times over by 
up-to-the-moment, specialized professional information com¬ 
ing in. We can expect hundreds of scholars or groups to start 
open-access computer conferences or data centers for special¬ 
ized interest areas (not necessarily computer oriented) as term¬ 
inals become more widespread. Although using these services 
would be entirely legal under the proposed law, it may be 
hard to communicate which ones are open, because typic¬ 
ally no advance arrangements are made. Commonly you hear 
through the grapevine “call this number and hit carriage 
return”, and often there is no way to even find out who is 
running it, short of attempting to log in. If the computer 
turned out to be restricted to members of a certain organiza¬ 
tion, the law would be broken, and usually a record of the call 
would exist. 

Essentially this proposed law covers every possibility and 
leaves the actual definition of what is or is not legal to prose¬ 
cutors and courts. This is poor legal draftsmanship, as over- 
zealous prosecution does exist, especially in hot new areas 
of law enforcement, and defendants are stripped of legal 
protection. 

This proposed law covers so many legitimate activities 
that it threatens the natural growth of decentralized computer 
use. It appears to have been drafted without proper input 
from industry. Congress must hear from industrial and profes¬ 
sional groups, or it will pass a law with effects which could 
not possibly have been intended. 

Sincerely, 1090 Miller Ave. 

John S. James Berkeley, CA 94708 


95th CONGRESS 
1st Session 

S. 1766 

IN THE SENATE OF THE UNITED STATES 

June 27 (legislative day, May 18), 1977 
Mr. Ribicoff (for himself, Mr. Domenici, Mr. Griffin, Mr. Heinz, Mr. 
Jackson, Mr. Kennedy, Mr. Metcalf, Mr. Percy, and Mr. Thurmond) 
introduced the following bill; which was read twice and referred to 
the Committee on the Judiciary 

A BILL 

To amend title 18, United States Code, to make a crime the 
use, for fraudulent or other illegal purposes, of any 
computer owned or operated by the United States, certain 
financial institutions, and entities affecting interstate 
commerce. 

Be it enacted by the Senate and House of Represen¬ 
tatives of the United States of America in Congress assem¬ 
bled, 

That this act may be cited as the “Federal Computer Sys¬ 
tems Protection Act of 1977”. 

SEC 2. The congress finds that — 

(1) computer related crime is a growing problem in the 
Government and in the private sector; 

(2) such crime occurs at great cost to the public since 
losses for each incident of computer crime tend to be far 
greater than the losses associated with each incident of 
other white collar crime; 

(3) the opportunities for computer related crimes in 
Federal programs, in financial institutions, and in other 
entities which operate in interstate commerce through the 
introduction of fraudulent records into a computer system, 
unauthorized use of computer facilities, alteration or 
destruction of computerized information files, and stealing 
of financial instruments, data, or other assets, are great; 

(4) computer related crime directed at institutions 
operating in interstate commerce has a direct effect on 
interstate commerce; and 

(5) the prosecution of persons engaged in computer 
related crime is difficult under current Federal criminal 
statutes. 

SEC. 3 (a) Chapter 47 of title 18, United States Code, is 
amended by adding at the end thereof the following new 
section: 

“ 1028. Computer fraud 

“(a) Whoever directly or indirectly accesses or causes to 
be accessed any computer, computer system, computer net¬ 
work, or any part thereof which, in whole or in part, operates 
in interstate commerce or is owned by, under contract to, or 
operated for, on behalf of, or in conjunction with, any finan¬ 
cial institution, the United States Government, or any branch, 
department, or agency thereof, or any entity operating in or 
affecting interstate commerce, for the purpose of (1) devising 
or executing any scheme or artifice to defraud, or (2) 


370 


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


Number 28 







obtaining money, property, or services by means of false or 
fraudulent pretenses, representations, or promises, shall be 
fined not more than $50,000, or imprisoned not more than 
fifteen years, or both. 

“(b) Whoever, intentionally and without authorization, 
directly or indirectly accesses, alters, damages, or destroys 
any computer, computer system, or computer network 
described in subsection (a), or any computer software, 
program, or data contained in such computer, computer 
system, or computer network, shall be fined not more than 
$50,000, or imprisoned not more than fifteen years, or both. 
“(c) For purposes of this section, the term — 

“(1) ‘access’ means to approach, instruct, communicate 
with, store data in, retrieve data from, or otherwise make 
use of any resources of, a computer, computer system, or 
computer network; 

“(2) ‘computer’ means an electronic device which 
performs logical, arithmetic, and memory functions by the 
manipulations of electronic or magnetic impulses, and 
includes all input, output, processing, storage, software, 
or communication facilities which are connected or related 
to such a device in a system or network; 

“(3) ‘computer system’ means a set of related, con¬ 
nected or unconnected, computer equipment, devices, and 
software; 

“(4) ‘computer network’ means the interconnection of 
communication lines with a computer through remote 
terminals, or a complex consisting of two or more inter¬ 
connected computers; 

“(5) ‘property’ includes, but is not limited to, financial 
instruments, information, including electronically produced 
data, and computer software and programs in either 
machine or human readable form, and any other tangible 
or intangible item of value; 

COMPAS EDITOR AND ASSEMBLER 
FOR 6500 FAMILY 

News Release Received: 78 June 23 

Computer Applications Corporation announces the 
immediate availability of two software packages for the 
6500 microprocessor family made by Rockwell, Synertek 
and MOS/Technology. These are a text editor (E/65) and two- 
pass assembler (A/65) designed to run on any 6500 based 
system. Both programs are similar to software written by 
COMPAS staff and offered in the Rockwell System 65. Each 
program is designed with transfer vectors to link the program 
to I/O routines in the user’s system. 

E/65 is primarily designed to edit assembler source code. 
Line oriented commands specify input/output of text and find 
specific lines to be edited. String oriented commands allow 
the user to search for and optionally change a text string. 
Character oriented commands allow cursor positioning and 
character deletion. Text may be loaded from or dumped to 
a bulk device other than the system terminal. E/65 also 
features a second entry point to edit text which is already 
in memory. 

A/65 is a two-pass assembler which conforms to the 
specifications detailed in the Rockwell and MOS/Technology 
cross assembler manuals. A full range of run-time options 
are provided to control listing formats, printing of generated 
code for ASCII strings and generation of object code. Object 


“(6) ‘services’ includes, but is not limited to, computer 
time, data processing, and storage functions; 

“(7) ‘financial instrument’ means any check, draft, 
money order, certificate of deposit, letter of credit, bill 
of exchange, credit card, or marketable security; 

“(8) ‘computer program’ means a series of instructions 
or statements, in a form acceptable to a computer, which 
permits the functioning of a computer system in a manner 
designed to provide appropriate products from such com¬ 
puter system; 

“(9) ‘computer software’ means a set of computer 
programs, procedures, and associated documentation con¬ 
cerned with the operation of a computer system; 

“(10) ‘financial institution’ means — 

“(A) a bank with deposits insured by the Federal 
Deposit Insurance Corporation; 

“(B) a member of the Federal Reserve including any 
Federal Reserve bank; 

“(C) an institution with accounts insured by the 
Federal Savings and Loan Insurance Corporation; 

“(D) a credit union with accounts insured by the 
National Credit Union Administration; 

“(E) a member of the Federal home loan bank 
systems and any home loan bank; 

“(F) a member or business insured by the Securities 
Investor Protection Corporation; and 

“(G) a broker-dealer registered with the Securities 
and Exchange Commission pursuant to section 15 of the 
Securities and Exchange Act of 1934.”. 

(c) The table of sections of chapter 47 of title 18, 
United States Code, is amended by adding at the end thereof 
the following: 

"1028. Computer fraud". 


code may be stored directly in memory or output to a file 
which may be the same as or different from the listing device. 
Thus an assembly may be made for listing only, object code 
only or both. 

E/65 and A/65 are priced at $100 each (Prepaid) and are 
supplied in object form on paper tape or KIM compatible 
audio tape. Listings of the source code are available for 
$25 each. Programs are assembled to start at memory location 
200 (hex) but may be ordered to start at any location if a 
listing is ordered. Full documentation on the installation and 
use of each package is provided. Contact COMPAS, 413 
Kellogg, Ames IA 50010; (515) 232-8181. 


RUMBLINGS ABOUT DIGITAL GROUP 

Dated: 78 July 25 

Persistent rumors have been circulating about Digital 
Group’s financial troubles including the suggestion they 
were about to file Chapter 11. A call to Digital Group gleaned 
the following: Ms. Edgar, secretary to DG president Dick 
Bemis was rather candid about the fact that the company was 
having financial trouble but that they had had a meeting 
with their creditors who were working with them to solve 
the problem. She assured me that Digital Group was not 
filing for Chapter 11. — TRW 


Number 28 


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


Page 37 

371 



Dumping Northstar Disk Files 


BY TITUS PURDIN . ■ 

5901 JFK # 101 

North Little Rock, AR 72116 


Dear Sirs, Received: 78 Jun 20 

Enclosed is a small utility program which I have found very 
helpful in designing and debugging disk files. I found that, 
with my limited operating system, I could not look at the con¬ 
tents of such files in absolute form. I was wasting a lot of time 
writing utility programs in BASIC to read disk files in logical 
form as an aid in tracking down bugs. Problems such as end-of- 
record marks spilling over into subsequent records simply 
defied detection. 

This program was designed to run in a Northstar environ¬ 
ment and uses the disk drivers in Northstar DOS, but could be 
adapted to run with other operating systems. The program 
reads named disk files of any file type and prints the contents, 
16 bytes per line, first in hex and then in ASCII. Each line is 
numbered to show the relative location of each byte in the file 
in hex. Non-printing ASCII characters are replaced by periods 
(.) in the print out. The print out can be interrupted with a 
line feed (OAH) and restarted with a carriage return (ODH). 
The print out can be aborted with a control-C. In the event of 
an abort, certain input errors, or normal program termination 
control is passed to Northstar DOS. 


h 

X H ~ XXX 

WQU.22 H o O O 

% % X X •> * O — Ca] CM Cal CO [a] 

oxocltocdococjcoocoo 

J J J > J 

EJ00_4CJE00*}0“50"5 


QQ-*Cyn'73SlSSS)S(SSQSS(SS(S' H 
r-oocr>cncoooo\<s — cv)n<Tif>NOC'-ooO'® — evict) 
i/ii/iinihi/ii/iin<ovOvOvC'CvcvC'C>ovo>r't' f ' 


CD 

<t 


O 

CD 

CD O 

O 

O 


<t 

<1 


<E 

CM 

CM 


CM 

CM 

CM 

CM 

CM 

CM 


CM 

CM 


CM 

m cd 

o 

CM 

in cd 

<t 

<r 



IS 

CM IS 

CO 

«S 

u. 

(S 

(S 

O 

u. 

Ca] 

U. 

CO 

<7 ro <r 

CO <1 

CO 

<r 

Q 

CO 

w 


Q 

Q 


QpQ 

Ca] 


Ca] <t 

Cl] 

<t 

O 

o 

s 

CM O 

O CM 

O 

o 

(a. O 

la. O 

Ca. 

o 

in 

CO 

CD 

Q 

S 

CO 

O 

O O Q 

& 

CM 

m p* <r 

o 

o 


O 

O 

P» 


t- 

C*» 

r- 

CO 

CO 

CO 00 

00 

CO 

<r 

<r 

<t 

<r 

<1 

<t 

<t 

<t «t 

<r 

c 

<x 

<t <1 

<x 

<r 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM CM 

CM 

CM 

CM 

CM CM 

CM 

CM 


— 0. CM Ca] 

if- X H _) <% 

Q 2 'a. Ca] ^ Q 7 

E — X -• Ca. — X 

* * x x £ * * x <t 

oxcLo 2 oxo.*co 


-i -j j 

:> •< t: u! 

e -J o o 


3 

_J n. 

_ j _ 2 * x i 

:> x: <t v: :> — :> 2 o i 

E _1 O .J E x •— Q 1 

X 


X w •£ ■>< 

O J2W 
X *■* - 
[a. Ca. CO 

- in x 


f— —• 

a 2 h 

Z -J T 3 T 2 O 

o q 2 i*. o 

O I S H ih o <1 I 


T X J 

H 8 H h. H h 

X 

u 

Q 

Ca] 

2 

to 

H 

J 

<t D CM D in D [a. 

H 

J 

X 

X 

«t <t 3 

u. 

«* O % O t O 2 

o 

i 

0. 

UJ 

% * O 

2 

CD a CD U CD U 



f— 

IE CD U X CJ 



J J J 

* h\'hQ, 

.NQ.25'EMQu20<I5253!f: 

)"DO"35!U“DjQ-.j;OS:OSO"3 


<t • 
I«IW2 
O u 2 <t 
X <t x 
W <t 2 O 

u 

o O 1x1 co 

<r h j 

J 2 H t«. 

a. —. u. •-« 


_ J _ J J 

55 jyfllN Jhh j 

oo3zoz<t:>y3 

EEU-mQTOE-JCJ 


i/ississss ^ s s s 

QQSSQ-OlO^irt'Oc'COO'S 

SKJ'StSQ&'SfStSlSlSQ'SiS® 


^ ^ O 

^ l •« M •« •. •* •. •. •< M ^ O 

a0^iS8SS8S l SSSS(9S8'*Oir)S8QQISS8SS S l S®S)®«S®Qin<S-*CMf'5'CiniSSJ®®(StS><S®®® 

fl00'5-wn^ifi\0t'M(j»!8-<Mr)<rifi'0*0'£)v0N!Dos-wn<ri/)'0t^r0ais-cun^ininic«0»0'0'0'0Nc00'®-w«<rir)'0 
q®-« — — — — — — CMCMCMCMCMCMCMCMCMCMCMCMCMcor)cocococo< r >cococo<7'3’<7<T<T<7<7-3 , ^ , <T < 3 ,< J , ^ ,J T^ < Jininininininin 

888288SS88Q88888888888888888888888888888888888888888888888 


o cc cc 

CM CM CM 

u. in z. to 
cm u. 
w - .d a 

Q CM C O 

® CM iP CO 
® <3 <S Q 
<t <I <r <t 
CM CM CL CM 


O CC O 
CM CM CM 

. i. ■c cc ® <r 

e p- w r«. <s> 

JC — Q — td 

S CM O CM S 

a: a t* n >o 

— — 

<t <r <t <t <x 

CM CM CM CM CM 


<c o 

CM CM 

<S S) 8 O 

CM — U. ® 

vo co a cm — ti] 

n CM S U CM s 

CO <t CD o U. CM 

oc « <c ^ <c <c 

CM CM CM CM CM CM 


o u -di <r «tu o o o <r 

CM CM CM CM CM CM CM CM CM CM 

<t - Q 01 li. 8 O <7 — — (S — U- — <7 

n in ® lO If) if) ® CM 1/1 <7 CM C7 IP <7 CM 

UI*)kOl«.Or)0]onCM87U8OSUU 

<Jb ( tOl».-^« 0 P<tQU|i. 8 nill 00 <tQ 

ciCMCMCMWnnnnnnnn<r<rq , <7<7<7 

<t<t<t<t<t<a:<r<t<t<x<t<r<i<E<t<r<r<x<i 

CMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCMCM 


o <i cd o cd 

CM CM CM CM CM 

— m is cm cc 

<7 CM U. — CO W 

P6QnQCMQW-Q 
b^OCMSOOSCMU 

Q-*CMin»OP-<tQU.CM 

inminininininmino 

<t<t<c<t<t<t<r<t<£<r 

CMCMCMCMCMCMCMCMCMCM 


Page 38 

372 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, Ca 94025 


Number 28 







•- X 

3 ^ 
z 


x ® ® c 
co o css - 

— —■ CVJ C 


Q 

X 

X U * , 
H X tO 
X * ■ 
Q W Q 
CD . 
H X 
3 O X i 
0. H H I 
2 CO 


CD 

1 

2 

: o w 


X NJ 
U 2 
Q 3 



X 

T H 









o 

f- 

2 








X 

o 

X 

U 








o 

3 

o 

Z 









CD 

2 3 








to 



o 








to 

X 

to 

X 








u 

o 

3 

X 








X 


3 









Q 

to 

X 


• 







Q 

to 

U 

to 

2 







X 

u 


H 

s 








X 


2 3 







* 

Q 



h 







o 

Q 

3 

X 

u 








X 

X 

X 

X 







o 


X 









u 

Q 



2 







X 

2 

o 


o 








X 

u 

X 



H 


X 



z 


X 

CU 

H 






X 

—t 

U 


CU 

U 


2 


X 

X 

CU 


X 

2 

® 

to 


— 3 

z 

Q 

Q 

CU 

% 

Q 

—i 

CU 


% 

% * 



Q 

® 





to 

X 

m x 

o 

Q 

X 

CU 

H 

O 

X 

H 









u 

to 

X 








2 

X 

_t 


H 





o 

3 

3 


Q 

2 

<-• 

*-• 


3 


3 

-J 


to 


. U I 


U x 
CJ X H 
X U 
3 a: z 
a. <t o 


00 

X H X 

1 X Q 2 U. CO 

i -* X ~ 3 CVJ 

1 * % x x ® 

iUXO-UW 


z 

X >• 
X O U 
w - X 
X x H 

<t 3 

to 

X - X 
H H 
X O X 
Q X U 
3 X 
U. CD X 
O - 

<r 

a o h 
2 H X 
— Q 

2 O 

2 x z 
u o 
O to x 
X u. 

CD 'O 
U CO 
U. 3 U 
0 0 2 


X 3 

o 

3 
X CD 


X 

H U 
CJ 2 
<X - 

- 3 

Q X 
2 O 
<t <t 
W 

X CO 
H X 
O 

x to 

- X 

U 


X X 
H H 


> 3 *: o •< rr x 2 

. 2 3 £ _J 3 O 3 


5 3^2 

Z 3 cj o 3 


Q X 

25 

x a 


i — oj co <r i 

I CVJ CM CM CM < 

I CM CM - 


X 

J 

CD 

Q 

, «* X 
l P- s> 

i oj co 

' — CVJ 


® ® ® ® (S ® ® 
tr ifi <c t* co o> s 
cvj cvj cvi cvj cvj cvj co 


StJSStS- 

-> c\i n ^ i/i i/i 
n n o o o n 


vO CO Q CVJ 
<o cvj ® cj 

OUJU.es 
U. X u. ® 
x x x m 

CVJ CVJ CVJ CVJ 


O outset) O CD CQ ® 
CVJ CM CM CM CM CM CM CM CM 

-* -* x xxcumuxcDmco 

8QU. XXCUCU®CJUUCU 
U'O-U-.^QCUU — Qpco 

nscvic-cviuQscviuou 

Ot/)C^<riDlil-<T^O'UU-CVJ 
®®®ts®®—-cu 

cDmmxmxcDCDCDmmmcD 

CMCMCMCMCMCMCMCMCMCMCMCMCM 


to 


3 

• 

Q 

X 

CD 


f- 

o 


X 



Q 


Q 











u 

2 

t- 

U 






X 





X 

X 

2 

H 





X 

X 





Q 


3 Z 

t—4 

X 

X 


U X 


X 

X 

X 

Q 

U 

O 

—• 

X 

X 

t— 



(J 


X 

H 


X 

\ 

O 

X 

3 


to 









a 


X 





to 

H 





to 


3 






u 

2 





(-* 

a 

3 

u 






3 





3 

u 

—< 

X 

M 




o 

o 





X 

X 

3 

X 

H 




z 

o 


3 














H 







z 







* 



CU 

CO 

•T 

m 

sD ® 

® 

® 


CU 

CO 

X 

® 





in 

in 

in \o 


co 

CO 

00 

CO CO 


® 




co 

co 

co co 

CO 

CO 

CO 

CO 

CO 

CO 

CO 

X 

X 









“ 


“ 

“ 

" 

- 





a 


u 






u 






CU 


X 












X 


u 







a 





X 


X 







X 






X 

CU 





X 

CU 

X 





"• 

<t co 





<t co 

CO 





m 

CO 

O' 





o 

o 

® 





CU 

CU 

CU 





w 

CU 

CO 





CD CD CO 





X 

X 

X 





CU 


CU 





X 

X 

X 


u 

X 

w 

X 


u J 
2 \ 
- X 
J 

a 


2 H 
-« 3 
X 
to 

to u 
u CD 
X 

o J 
a 3 
<r 

3 

U 

X X 
H U 
H 
tO O 

Q X 
-J X 
— <t 

5 X 

X O 


X I 
s !-• <i ; 
% CJ i 

m x o : 


-« X 3 
3 a o 
£ J z 


'Cvin^sssssss 







a 



H 

J) 


3 

u 



hH 

H 

to 

U 

X 



u 

U 

u 

X 




to 

o 

X 


to 

2 


X 


o 

to 

u 

O 

H 



H 

u 

to 

2 

2 

o 


to 

to 

3 


3 

H 

u 


3 


>. 

« 


z 

Q 


a 

2 

X 

H 

_l 

2 

a 

2 


3 


3 

<£ 

2 

<2 


O 




<2 


X 


to 

H 

H 


to 

o 

X 

H 

Z 

■H 

X 

X 

X 

o 

X 

M 


X 

u 



u 

X 

to 

X 

H 

Q 

u 

3 

X 

H 

CJ 

O 

U 

3 

z 


X 


X 

h 

X 

o 

z 

u 

v: 

X 

3 

X 

U 


3 

u 

X 

H 

—1 



2 

X 

X 


z 


H 

O 


o 

H • 


• 

_■ 

o 

to 


to U 

X 

X 



H 


X 3 

u 

u 

o 


2 

—< 

5 J 


~ Q <t 
X X Q 3 
3 Q 3 Z 


X X 
o < 
X I 

X H t 

a <r 

►H Q 
X 

Z : 
U O I 
X x I 
f- U I 


2 H 2 • tO 


U X 
~ X 2 X 
X u 3 * 

CD tO O o S X Q 


: x h 

’ U 2 
i X », 
X 
X X 


x5 

X02Z30ZQ 

XQO<tOS^J 




U Q 

X CVJ 

SOW X 

® X <S ® 

O X U. — O' <c VO 

80^ W8-8 

co m oo O' o Q u 

co co co co co co co 

X X X CO X X CO 

« CVJ CM M CV1 CV) W 


• wntj/iiOMo^si/isssssss 
icococomcocococou'O'S-cvjn^i/i'O 


X o 

X X 
® U ® 

■7 0® 

u.mcu*cQr^cox 

Q®OUCJC*-CU — 


® — xinr»<£mu 

xxxxxxxx 

xmxxxmmm 

xxxxxxxx 



3 

X o 

X 


2 X 

u 

X - 


3 2 

a 

X u 

H 


u to 

O 2 

3 


X 3 


X 

>. Q X tO 

-J 

X X 


X U 
o u 
X to 
X 

U to 
3 

- o 

H *-h 
3 

2 u 

3 X 
X 

a 

— 2 

X ~ 
3 to 
2 H 
D ~ 

- Q 

u 

to 

H tO 
2 J 

X 5 
X X 


X 3 


-J J 

!xx 


X u t 
X J ■ 

2*! 
X o 

o X : 

H U < 
X 

» X 


u 


► 2 


— • X 
0X00 

X o ® ^ 

- U X o 
X o 

H (— - 
X 2 X 


m 

X X Q z X 2 
J"ThJ3 
X «. % X X Z 
O O X x o 


3 to 
X U 
2 X 

— o 


2 H U Z 2 

H X 

• H 2 X H X 3 
Z 3 Z ~ H • 
Z X U Q 

U 3 3 X U 

-J - X H 

OJ-i O Z 2 

H X X Z O O 

3 


O Q ! 


X 2 X 


H X 






H I 

3 I 

H 


X H 3 

H 

X 

H 

H 

o 


Q 

CO 

_ 

z 


H 


2 X H H 

-• a 

X 

O' 

Q 2 

Z n 

Q 

2 

X 3 



a 

H CU 3 

X 

3 

X 

3 ® 3 •-« 

x - 

Q 


X ~ w x 


X 

M 

d “• 

o 

eo 

X 

Z 2 

r- X 



O 

Q 

X % O 2 

% ® 

H 


•« x % •» 

X ~ 


X 

X z 

to 

■> 


•i O 


a 

X 

O 

® 

U X O 3 

X X 

to 

o 

H 

P 

C 

H 

X a 

X 

X 

o -* 

u 

X 

o 

Q 

X Q X Q O O 

u x 




o 

Q 

o 


o 

U 

>• 

u 




X 


to 

z 




3 

X 

to 

to 



z 


X 

X 

to 


to 

3 

o 


•-i 


2 

3 





to 

to 

X 

H 

to 



X 



to 

u 

X 

u 

u 

3 

a 


X 





z 

3 

u 

to 

X 


u 


o 






3 

o 

3 

a 

a 

X 

H X 


•• 



X 

X 

a 

X 

u 

2 



X 


X 



*— 

3 

X 

a 

X 

X 

u 

m 

u 


a 













t— 













u 

s 


X 

CO 

X 

in 

tC 

r» 

X 

O' 

® 


in 

CO 

CO 

CO 

CO 

CO 

co 

CO 

co 

CO 

CO 

O' 

O' 

O' 

r* 



r- 


c*> 




r- 

p- 

p~ 

p* 

® 

® 

® 

® 

® 

® 

Q 

® 

® 

® 

® 

® 

® 


J J J J JJ 

20X0XX23XQi<X23xX3XX3XXXZ 

XZ0Z003Z0JJ03ZJ0ZJ0ZJ003 


Q 

X 


-i -< :> x •< 
3X0 HZ 
r 3 z to -. 


x 

a 

H 
K tO 


x X rsj H H 
2 O 2 3 X 
~ Q 3 Z 3 


X 

3 

O 

X 


C 2 

5 - 3 

j j <j a 

^ x ^ 

: x o m o x 


. X CC NJ M 

> z o 2 3 x 
: - a 3 z 3 


NJ 3 

to f- 
u z 

3 -H 
O X 
Z X 


>wco®®®®®®ss®cs — ■ 


!®®SSSS8S®S88SS®888' 


)®®®®®®® — - 


:QO®®®<3 — cvjco 
■CO^Ul'O^cOtDSOffl 


CD O 03 CD <t 

X CVJ X X CVJ 

in u u co m m 

X ® o U X o 

O U - Q Q CO 

U 8 CM U u U 

X CVJ <T C' <t Q 

® O' O O' O' O' 

X X X X X X 

CM CM CM CM CM CM 


o x u o O ® X 

CU CVJ CM CM CM CM CM 

—•QXX'-"X TO,, ' M 
x®« ® 


O ffi 
CU w 


a cd 

CU X 


o CD CO X 
CVJ CVJ CVJ CU 


\ ^ aj ^ n 

'Or'QP-QUW'OQ 
U p> • * *»—»** 


QCUU — QU — QU 


' l - V4. W Ut. " V, M M IIMV S U Ql W Ul OJ UJ 

iXxxxxmmmmmooooooQQQQQ 

:xxx<txxxxxxxxxxxxxxxxx 

JOJCVJWCVJCVJCVJCVJCVJCVJCVJCVJCVJCVJOJCVJCVJCVJCVJCVJCVJCVJ 


m 

CD 

oo X 






CO 

00 

CJ 

<s 



<s> 

X 

u 

® 

® x 






u 

X 

u 

X 



u. 

Q 

a 

CO 

u — 

u 

X 

CO 

CO 

a 

X 

u 


VO 

co 

Q 

X 

UJ 

o 

o 

® — 

p' 


X 


® 

a 

® 

X 

CO 

X 

® 

o 

Q 

CO 

CD 

u ® 

CO 

X 

m 

'O 

p“ 

CO 

m 

Q 

® 

X 

CO 

X 

p- 

a 

Q 

Q U 

u 

u 

u 

u 

u 

u 

u 

u 

u. 

u 

u. 

u. 

u. 

x 

X 

X x 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

X 

cu 

X 


Number 28 


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


Page 39 


373 















<t £ 


^ X 
J <S 
CD cn 


CD 

§ 

2 

X J ( 


- X r 
> £ < 
£ O * 


S3 <3 l 

p» co ( 

<3 S> r 
CM CV) c 


. V! 0. < 
• U £ I 

: a *o . 


q u 

• <C 2 

> U « 

• X j 

l X U H 

!~ m S 
) til o 2 
: u h 

J CO U 

: u x 

O J H 
3 H •—i 

: x co 
: 2 co 
hUil 

• X x <J 

« H O 
O X 
. H 2 X 

CO o 

1 U to H 
1 O X 
1 O U CO 

o u 

> -J -J o 

• O ffl cd 

X 

H U J 

• 2 X O 

> O O X 

: CJ £ H 
1 2 

i to It) o 

<t X O 
X <* 

> H 

: h u o 

> - X 2 
] u 

: x x x 


) CO CO CO 
I CO CM (M 


X -1 H 2 

x m u j 

is x x H 

* o _j x 

oq m £ <t m 2 


— x X <t X 

> £ M 2 H £ 

S U ^ H CO o 


O 

J 

m 


CV] 

♦ 

X 

Q 

Q 

<t <C 


CM 

2 ♦ : 
X X . 
Q Q t 
2 Q £ 
W <c £ 


X 
X 2 
-J — 


X 
J 
ffi 
X 
•% cj 

® S S3 
— CM CO 
CM CM CM 

CMCMCMCMCMCMCMCMCMCMCMCMCMCM 


I S S 8 S 8 S ( 

■ in *o r» oo o s ■ 


-J 

CD 

X 

o 

£ 

<s s 

<7 lO 
CM CM 
CM CM 


<C X 
a o 
J Q 


S3 s> 

o p- 

CM CM 
CM CM 


M H 

r> to 


<s <s 

CO o\ 
CM CM 
CM CM 


u 

X 

o 


X 

o 


5 

X 

CD 


X 

o cj 
J 

5 5 

CJ £ 


X H 
Q 2 X c 

*5s!! 

x x o c 


8 8 8 8 
S) — CM CO 
CO CO CO CO 
CM CM CM CM 


® <s 
<y io 
co co 
CM CM 


J J 

Zii 

JUU 


s> s s» 
'Oh*® 
co co co 

CM CM CM 


CD CD 
Ci] U 
X X 


: x 
• o 

i 

X 
I u 
: m 

!5 

. 2 


H 

£ 3 

* O 

CD O X « 


: x k> i 

: u 2 i 

iQTt 


5 H <£ H 

S3 a S D 
«. O •. O 

mumu 


j j 

H JH Jh 

£ cj £ CJ X 


2 X 

o X 2 X 

cj s> u <r z q x 

•* ■* X CJ * i <1 

xmmxcDxto<tmz 


Q Q 

X X X X > _ J H 
XXr>£w22£OOXU] 
IOJEOThmTSSJX 


8 8 8 
O' tS — 

n <r <7 

CM CM CM 


— S3 

— CM 

CM CM 


X 
. X 

8 8 8 

co ^ in 

<T 

CM CM CM 


b. 

(£ 


X 


(3 S3 
vo p* 

>r <y 

CM CM 


SS88S8888888S888QQQ88888 

®os-wnqin»or'coosi-cyn^io»£)^coo'Q- 

■q , <yiomir)ioiOioioininir)\0'0^'ONOvOvov£)'0\oc^r~ 

CMCMCMCMCMCVJCMCMCMCMCMCMCMCMCMCMCMCMCVlCMCVJCVJCMCVJ 


CO 



m 


u 


CM 



CM 


CM 


O 

<3 


CO 


U 

X 

m 

CO 


5 


■q 1 

(3 

CM 

>o 

m 

co 

<r 

<t 

O 

CJ 

CO 

CM 

CJ 


CO 

S> 

X 

CM 

■q 1 

in 

00 

o 

CJ 

<c 

m 

m 

m 

m 

m 

m 

m 

m 

m 

CD 

m 

m 

m 

CM 

CM 

CM 

CM 

CM 

CM 

CM 


m 

w m 

U 

W 

CM 

CM CM 

CM 

CM 

O' 

U CJ 

<T 

*> 

CJ 

CM 


<7 


tO <t CJ CM CO 
CD O CO CO O 


coum 

CM CM CM 
<t O CO 
Q <3 
— <T <t Q <£ CM CO 
CM CO CO CO CJ CO CJ 


o' cj a s> — <y p- 

CJ CJ CJ Q Q Q D 

m m m m m m m 

CM CM CM CM CM CM CM 


m CJ CD CO <3 

CM CM CM CM CM 

id q to m m b 

X <3 Q U X CM 

DW-QQP) 
CJ S3 CM CJ CJ CJ 

<t Q X CM lO to 
Q Q Q U) U U 

m m m m m m 

CM CM CM CM CM CM 


- m 

u 

vO Q CO Q CV] o 

truwsau 

m o x is — <r 
u U U X x x 
m m m m m m 

CM CM CM CM CM CM 


CM 


Q - <t • 

Q ^ Q ^ 

O Q O Q O' 
8 CJ (3 CJ CJ 

in <t o X 
X X X X X 

m m m m m 

CM CM CM CM CM 


Wo O O U 

CM CM CM CM CM 

X 8 8 — CO 13 X 

■q > u ® — si ts -7 

CM — 'OCO<tqn(OWB<t!> 
CMCM8ffiU8CMUf“8CMU 

tsniOBO'OQW^cMqr* 

88888888hhh m 

cjcjocjocjcjcjcjocjcj 

CMCMCMCMCMCMCMCMCMCMCMCM 


H 

X 

X 2 <t 
X I> 


X X to 

-- O H ® H <t <t 

».=>•» ■» CJ ^ CJ ^ 

3 o£ooo<txm<coxm 


J 

2 <i 


> X X X > <c. 

-02220H: 

<io£mhhsio: 


)5 hhXUm 


id 

— X 
J 

to 

f— — 

2 

— u 
X 2 
X - 

J 

2 

— H 
2 

X — 
u x 

H X 
o 

Sb 


U H 
O 2 

<t D 
J o 
X o 


a 

x 

<t 

O >• 
CD -J 
>• J 
u — 

X o 

O X 

£5 

2 H 
O 

£ J 
J 


2 

H X 
X O 


X 

X 

X 

<t .. 








o 

w 

x w 


X 


CJ 

u 


CM 

H 

CM 

CJ U 


o f— 


o 

2 

3 

* 

D 

* 

CO 


% o 


X 



m 

m x 

<x 

l-H 

£ 

u <t <t a 

o 

O X 

J 





-t o 

CJ H 





<t 

5 




to 





H 


— 

X CJ 

— 

<t to 

> x > <r x 



<t 


3 

£ 2 

> 

X 

o 

2 O H 2 


£ 2 

a 


£ CJ *0 

£ 

co U 

£ 

— £ co — 

£ u a 


X 


H J 
2 ( 
- X . 
X O * 

x x : 


J „• 

o 



X 


<t x 

X 

X 

H 


CJ • 

>• C 

u 

_ u 

m u 

X 

X 2 

H 

H 

3 - 

a u 


J 

w a 

to 

X 

i- 

f- 

U H 

^ to 

X 

m 2 


o • 

£ — 

i— 

CO to 

5 X 


<£ O 

2 X 

2 X 

a 


— a 

X 

U X 

s 

CJ o 

2 O 

X V 

M H 



2 

H 

X CM J 2 X 

ai^^xai _j v*. 
ocjxa.o<tx®o 

J JJ J 

0£J00X0U1 


O 

O X 
J o 


\i 3 


<t J 
3 - 
H 
W 2 
X D 
H 

to 


D 
. X 


H X -< 
J D <t 
X IS 3 


J 

J —• M 
5X2 

CJ O "0 


O X 

I H 

H O 
CJ 


W 

2 

X J 

a x 

2 ^ 

w x 


J to 

w 

X H 

w >- 
x m 

U X 
X D 
H O 
X 


5 52 

to be -q- 

* x •* 

£ <t £ O £ 


D 

O 

w 

X 

X 

w 

El 


2 

V U 

<1 X 

o u 

2 


X 2 



CO 


W 

O X 



H H 


X 

X D 

•— i 

>-« 

2 CO 

X H Q> N] H 

<c 

H 

X N3 

X 

w x 

2 ^ £ 2 > 

o 

tO U 

o a 

J 

£ — 

— £ CJ r> £ 


H X 



w X 


CO 

CO 



X 


u 

x’ a 



CJ w 


V 

X 2 

CJ 


2 X 

m 

5 

H <t 

sj 


M H 

§ 

H 


H 



2 



(3 

C3 

(3 

S3 

S3 

S) 

S3 

S3 

s 



S) 

s> 


S3 



s 

Q 

— 

CM 

CO 

q 

s 

S3 

S3 


S3 

S3 

S3 

<s 

<S 

Q 


CM 

<s 

S3 


<S 

ts 

S3 

(3 

s 

S3 

S 

_ 



■q 1 


s 




















O' 









to 

O' 


— 



q 1 

U> 


in 



o 


CO 

O' 

S3 

— 

CM 

CO 


m 

m 

in 


P- 


O' 


—> 

CM 

CO 

C 

n 

m 

in 

in 

m 


p“ 






















'O 

'O 


\o 

o 

'O 



-o 






P» 




c*» 

p- 


C' 

P> 

CO 

to 

CO 

00 

CO 

co 

co 

to 

to 

to 

CO 

CO 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

O' 

rr» 

O' 

O' 

O' 

O' 

O' 

S3 

S3 

S3 

S3 

S3 

<S 

<S 

S3 

CJ 




















































~ 







“ 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 


O 






w 


u 


a 






m 









u 




CO 






m 


CJ 

m 

m 


CJ 


CO 







m 



































W 












CM 






CM 




CM 



































CJ 


a 


<T 



X 

IS 


X 








a 


S3 


CO 






n 


CJ 

rr' 

in 



< 

CC 






a 

CO 







U 



















<r 








'O 

CM 








■q 1 




CO 






X 

q 

X 

-ii 

X 



S3 





























o 

o 

O' 



<l 

X 


O' 

<t 

o 

'C 

to 

CM 

W 






o 

O' 

CM 

CO 

U 


CM 






a 

u 


a 

a 


a 































S3 

r- 




■ty 

CM 



U] 

s 

m 

a 

CO 






is 

p- 

CO 


S3 

m 

U 






o 

S3 

CM 

CJ 

o 

<t 

CJ 

X 

O 





o 

X 

CJ 





X 

CJ 

CM 





CO 

CO 

m 

CJ 

CO 

a 

X 

CM 

CO 

<7 

m 

o 


< 

CJ 

X 


CO 


in 

p- 

O' 

<t 

a 





X 

S3 


CM 

in 

O 

CO 

O' 






o 

X 


<y 


<t 

m 

u 


































m 

in 

O 

o 


o 

o 

*) 

o 

'O 





o 

P- 


p* 



p- 







p* 














n\ 





















m 

m 

m 

m 

m 

m 

m 

m 

01 

01 

01 

01 

01 

01 

m 

m 





m 

m 

m 

m 

m 

m 

m 

CD 






m 

m 

m 

m 

m 

m 

m 

rr 

m 





































CM 

CM 


CM 

CM 

CM 





CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 






CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 

CM 





CM 

CM 

CM 





CM 

CM 

CM 





CM 

CM 

CM 

CM 

CM 


Page 40 

374 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 28 









H H 

: x x x x 

r o so u. 

i a. s >f i - h 


IZZnZZWZZmZZsjZZU] 

i«<TH<i(i:H<ta:M<i 2 :M« i x 

o •• 

H Ci] 

•• OH 

cvj U o 

H O Z 

x 


Q H • 

Ci] o <t 
o <x r»i 
z z x x 

H <t <c <£ 
x X X 
O O 2 ; 

Z Cl] 

ui X :> 

CD D H 
X 03; 

Cl] Q >. Q 

H _J 

O D U. O 
<Z O O X 1 : 

XX — SC 

S _] 

T t/) '-O O 

utuo co x 

s x a 

X S Q 

O O' Q Z _] 

' 1 . C\J <t m _] <E H 

< H Ci] 

£ UU1CC 


- U3 - 1 ] 
u- V H z ' 
U^hh! 
Q Z Z _] • 


C NO >J) 

3 - NO Q LO 

: f'- -j c 
> Ci] - n o j 

) 7 /) W X o 

: o r *a ~ - x 

: c >. 3 s 

• - - —* CV3 \0 1 


•Si £ 

Cl] o 

: z <x x 

) •—« UJ u, 

. X J X 

) U] <£ X 

X H U. <1 

: u] z o h x 

> H 3 HO 

Z O H -H 

! 3 O Z J H 

) O 3 <n 

> O X O H <t 

] Ci] o 3 J 

] £ H 

W <X 

. H X 


T U3 G X £T CO . 
Q Q a Q Q Q 


C 

1 3 |X' LTi X J'j !/) U) !/) 1/1 '/) 7) J) I/) I/) 1/1 U) (/) !^ 
iCQCCQCQQQQQQQQQQQli] 


^->ojn^insssstsisssss , ;sssssssss- , ains3sss(S'HC'jr 
c\jcocuajoococo<TLn'Ot^aoo'S — cor)<ri/ivOHcoo'S — coa'cocvjn-q-iovor^rnco o t> ^3 — : 

HHHHf«-C-HHt^P*'HC , »P*C0C0C0C00000C0X>00C00'^<>3NO0'0'0'0'0'O'0N0']''>3''':S1 

CVJCOCVJCVJCVJCVJOJCVICVlCVJCVJCVJCVlCVJCVJCVJCVJCUCVJCMCOCVJOJCVJCVJCVJCVJCNJCVJCUCVJCVJOJOJCVJCVJOJCVlCVJC^roro 


<1 •• •• •• U >• •• •• •• •• H •• •• W *-l •• •• •• •• H M M •• 

X —< <\)coq-inNrr*-»c'M:>XHZMi-«<£XXXox QQ * 

T r ‘ CX^X-^XXXCOZj^HHXroHQHHiCXJO 

C QQCC3CQGCi]O^ZJii]'X<IQOOJ<OH 
■ *i X XXXXXTXT>-OCi, 3 XX tQ'tl^CDiXU) 


a. 1 l. .l i 1 . 1 . 

S ~ T S OSQS'S^'SSSSSSOSSSS'SSSSSSQ 

3-*: co iO\CHrocN3-^ojco>TLn\cp~cooNS — coco<ri/ior^cx) 

•' 3 3 3 3 3 Si 3 <3 — — — — — — — — — -.CVJ0J030JCV1CUCMCVJCV1 

r^r'N-O. - *'. r<i rr\ r<\ r*~‘ rr\ r*\ r^, r*\ rr\ rr\ rr\ r*\ rr\ rry r*\ rr\ rr\ 


S<TCQQ 3 C 0 -*U. 3 -q- S <S — Cju 

(SOCOQ-q-COSt^ T> 3 ) IT) <T tO p- 

21'O l IB]'C<tC»DOD''CCOffi'CXE>CI> 
QUOQUOQUOQWOQWOQWO 

oo<Ioci.-*c'i'Cco<tccQCi.®cv]^uor>ON 

— — — -^COCOOJCOOJCOOJCOCOCOfOrOCOCO 

000000000000000000 

CV3COCU03CV3CVJCOCMCV]CV3CV3CVJCV3C\3C\3COCV3C\3 


) 3 3 (S> 3 3 — — — —• — •COCV1COCV3CMCVJOJCVJCVJ 

cooococococococorococorococococococorocococococo 

in 3 3 3 O 3 Ci] Q U. <T 

^ Oj a a q a q q n co 

fflinificc'-iooinin co 
jo >j <j -q- q co in <1 co 

’n 3,Q3CO\OOCOt**Ci]COCO 
- cv qqminqmqqinr) 

•• u; -* — o fJ o — co u. m -• 

■c-q-q , <i-q--q-<r<rin-q--q , co 

o'ONWW^ocr'-qos 

mqqqqqci/m^inn 

x q w w U3 < 1 , QdxQsscuw q"qr>roQCx]u. — co 
Vi- c** • O'O'Uicr uaQWii.u.u.isnqqqqqqinin 
O OOOOOOOOOOCOOOQQQUlUlCilCdWUlCi] 

cuacvjaa-cococvcocjcoojcococococvjcvjcocucvjcococvjco 


Number 28 


Dr. Dobb's Journal of Computer Calisthenics 81 Orthodontia, Box E, Menlo Park, Ca 94025 


Page 41 

375 













BY PHIL MORK 

12 Woodland Rd. 
Weston, M A 02193 
(617)894-7147 


Dear Dr. Dobb, Dated: 78 June 13 

Here’s an offering for your journal, the Vocal Memory Dump. 
It was hand assembled, the listing is from my disassembler 
(hence no labels). The comments were added later. For $3 I 
can supply cassette tapes of VMD for those readers who 
don’t want to type in the program or implement the input 
hardware. I’ll include the resistor and capacitor for the output 
circuit. Specify Tarbell, Kansas Citv. or Digital Group format. 

My hardware is a home made 8080-based CPU board on an 
S-100 bus. For memory I have 24K RAM plus another 256 
bytes RAM and IK PROM monitor on the CPU. I/O 
consists of six parallel input and output ports. I use a Digital 
group TVC video and cassette board, and a D to A which I 
use for music. My printer is a Kleinschmidt M-311. I have 
256 x 208 dot video graphics implemented using a homebrew 
interface which uses one of my memory boards and gets 
timing from the video board. Software includes Digital Group 
Maxi-Basic, Software Technology’s Music System, Wang’s 
Palo Alto Tiny Basic and WSFN These last two support my 
graphics hardware (PATB has added commands to ERASE the 
screen, PLOT a point, and DRA W a vector). 

Keep up the good work! Best wishes to you and your 
“family ”. 

PhilMork 


The vocal memory dump (VMD) program pronounces the 
octal value for each memory location in a block specified by 
the user. As such it is a useful tool for verifying memory 
contents (ever try to look at two listings at the same time?). It 
uses digitized speech waveforms in the form of a one bit sam¬ 
ple every 155 sec., which means both hardware and memory 
requirements are minimal. It would seem that a one bit ap¬ 


proximation (ON or OFF) would be completely unintellig- 
able noise, but although it is indeed “lo-fi”, it is quite intel¬ 
ligible and on par with many communications radios. The 
trick is to use a high pass filter before digitization and low 
pass filter on the “D to A” end. 

The Software 

The VMD requires slightly over 3K of memory, all of which 
may be ROM. It is assembled to start at location 000000 
Octal, but may be loaded starting on any other page, then 
using the relocator program (listing 2) to fix jump addresses 
and memory references. The only modifications which might 
be needed to make the VMD run on any 8080 or Z-80 based 
computer would be the input subroutine (wait for keyboard, 
then input a character to the accumulator), the selection of 
the output port (now 013 octal) and a timing constant (now 
set for a 2 MHz clock). 

The Hardware 

To use the VMD program, you will need an 8080 or Z-80 or 
based computer with enough memory to hold the VMD and 
any other program you wish to “read”. Also required is an 
ASCII keyboard interfaced to the computer, the most signi¬ 
ficant bit of an output port, an audio amp and speaker 
(I use a Hi-Fi), a resistor and capacitor. The amplifier should 
have a high impedance input (10kf2 or more) and be able to 
accept a signal of around 1 volt (the AUX is fine). 

Doing It 

Connect the most significant bit (bit 7) of an output port 
through a 1K£2 resistor and a 0.1 pF capacitor to the input 
of audio amp as shown in figure 1. Load the VMD program 


Page 42 

376 


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


Number 28 



(listing 1) anywhere in memory, as long as it starts at the 
beginning of a page. If other than page 0, load the relocat¬ 
or, set byte 000001 to the page number where the VMD now 
starts,and run the relocator. Make any needed changes in the 
keyboard subroutine (000230), and the output port number 
(000117). Turn on the amp, and run VMD. Type in two six 
digit split octal numbers: the starting and ending addresses 
of a block of memory (any non-octal characters will be consid¬ 
ered octal, it’s the 3 least significant bits that count). As you 
type, the digits should be echoed by a voice (my voice!). 
After 12 digits have been entered,the program takes off, 
pronouncing the octal values of memory locations until the 
end address is reached. The program is then ready to accept 
two more addresses. If the voice is too high or low (fast or 
slow), try playing with the timing constant at 000121. It 
should be OK for a 2MHz clock (no waits). 

Your Own Thing 

Octal output of the accumulator and digit output (3 least 
significant bits) are written as subroutines which can be 
called by external programs. Addresses are (000040) and 
(000063) respectively. The VMD is a simple-minded program 
which serves a useful function, but maybe more importantly, 
it demonstrates a simple way to give a computer vocal output. 
I chose octal for several reasons: I use octal and hex would 
require 8 more digits (another 3K of memory), and there 
might be some ambiguity between some of the digits (B,C,D, 


although I could use Bravo, Charlie, Delta, etc.). To digitize 
your own speech, use the circuit shown in figure 2. Input level 
should be around .5 volt, so you’ll need a preamp for a micro¬ 
phone. What I did was tape the speech I wanted to digitize, 
then play the tape into the computer. You’ll probably want to 
play with the input level some for best results. Use the pro¬ 
grams in listing 3 to record and play back speech. I used the 
input program to record the digits for VMD and edited out the 
space between digits by hand. The sampling rate can be varied 
by changing byte 000071. As it stands it samples about 6500 
bits per second (or 820 bytes/sec.). I can record about 30 sec¬ 
onds of speech in my 24K of memory. It would take around 
24K to digitize the 64 ASCII characters. If you have a floppy, 
you might only need one word in memory at a time while 
the computer is pronouncing it and seeking the next word on 
the disk. I figure you could get over 600 words on an 8” disk¬ 
ette. 

How about adding speech output to BASIC? Standard vo¬ 
cabulary might include the decimal digits, “point”, “plus”, 
“minus”, “E”, etc. to allow numeric output. Special mes¬ 
sages for an application could be included in the BASIC pro¬ 
gram as an array of digitzed speech, or to avoid loading multi- 
K of speech, the program might ask you to say “shields 
weakening” or whatever during program initialization. This 
might also be fun for a conversation-type program. 

Thanks are due to Jim Anderson for his talk and de¬ 
monstration of speech digitization at the April ’78 meeting of 
the New England Computer Society. 


I 

O 

* 


o 

u 


U 




u 

•o 

bOTJ 


to CO •• 

41 4) O 

>» C 




^ H OH 
+* T3 >-(0 
•H ” Q . 


J • <3 
) — </)g 


►> 

T3 

O 

£3 

>* 

45 
> 
45 


4) 

C 3 

£3 


•a 

■o 


* 

O O 

c 


£ £; 


1 u -*-» 
l o >» 
I <M £3 


I £ -H +* 

D ao * o 


J 

< 

a 

55 

CM 

® «S 





(0 

o 

55 



IO 




IO 






















a 

ca <r 


— 


S 


£> 







O 



















u 


n 

a 

CM CL 


— 

«-• 

a 





s> 




65 






G 








a 



cv 

CM 




5J 

S «S> 


6 . 

& 

5. 

u 














G. 











CM 


•— 




® X. a 

X 

G -J 

5. 

G 

o 

G5 


IO 55 

CO 



a 

to r- 



a 

*z 

5' 

<r 

<x 


<r 


< 

T 7 * 

a 


•o 


«o 

G 

_i 

CL 

-1 

<s> • a 

* 

6 . • 

6 . 

6 . 


GJ 

• 

5. 

G5 

• 



a 


X Cj 

UL. 

a 

m 

• 

C •“ 

u. » 

u. 

• 


L « 

• 

• 


— 

• 

C> 

a 


5 


X c 

X <t o 

6 , <1 

UJ 6 

<£ 



CO 

IS 






< s<x < 



IO l) 

IT 

o o 

S- Oi 


X 

U- 

_J < 

O 


i»: 

ii‘ 

a su 

G 

x <t u. 

« 

0-4 0 -J 






d 










•» 




X 

X 

X 



X 










O 

X -J X X =» _1 

x > a. 

-vl > 

Q.N O 


=>o 

u — 

-J 



r> a c 

’SI (Si 

in 

—• 

Z> 

—t 

<r > x 

<1 

« 

•> 

X 


r> 


o 

f- 

»-* 

O. *v_ X 

hJ 

x > a 



O < 2 U O < 

2 O >- 

2 O 

k. 2 

X 


•« 

O -J —1 2 C 




=> ZD 

ZD 

Cj 

c 

Ci 0 2 

CiC/C 

o 

r 

uoo> 

Or 

ZD Z> 

0 2 1- 

2 

2 C V 

Om 

m 

x o •- x x u 

— XU 

X O -3 


3 

«_> 

X cc 

u; <r 

O 

X 

OC 

i c oz 

o 

x >* c < 

a. a. 

a, <i 

>■ 


J 5.*- 

—1 X — 


y 

*“• 

_1 X 

X 


az 

O T 

0-3 0 

TJ 

— 20 

O 

£ 

io»oirtioioo»nfO«Tiii c\i ir. ?o cm 

»o 









in in 

in 

\C 

r- 

y£ 

Cs»f~ IO 

CM IO 

cm 

to 

cm r*- 

O <S> t~- 

to If 

in cm u\ 

cm /o in io 


in — in r- 


s t- 

r~ 5. 

G. 





— 


_ 





5 



— Cj <S. 

— fO -s 

— 

<T 

a 

— U 


—• 

— 

c 

a 

a a — 

vv 


X 

<s> 

tn to a »o — to 

a — cm 

to — 

CO to 

IO 

O 

»o 

— Si 

es io 

IO 


a 

s. ca 

to 

— IO CM CO 

k;- io 


rr 

— 

a 

a -• a 

a — a 

3 


a 

a — 


a a 

to 

a 

a i«5 a 

K5 

a — cm 

J 

& 

to <Tt" s> — cm ir\ vtf r- 

G» IO 

<t tr. 

6 . 

H 

GJ 

IO 


55 

IO 

<7 KO 

l-~ 

CM io in M3 

r- a 


O’ 

T 

u\ 

O- Q — 

CM io 

in 

(O 

r~ 

a ~ 

cm io in 

(D 

a cm io itf 

r- 

CM IO -sj- 

< 

<5, 

(Si <5i G — —• — 

— — — 

CM Cm 

CM CM 

IO 

aj 

<T 

<r 


in 



If WtCh 

r- 

r~ 

n 

r- 

r~- 55 5. 

a a a 

a 

a 

a 

—• —• 

— 

—• 

—• 

— 

CM 

CM O CM 

c. 

IO IO K) 

8 

a 


O 5) 

S N. 

C- 


65 


G5 G5 

55 

G. 


(S. 55 


G. Si G. G. a 5) 

a 

a 

a 

5 

a — — 

— — 

—• 

— 

—• 


— 


— 

—• 

— 

— — — 

— 

— — — 

ca 

a 65 G G a G 

'SQG 

G» G) 

Cw G. 

S, 











a 

a 

a 

a 

a a a 

a a a 

a 

CM 

a 

a a 

a 

a 

c. 

a 

a 

a a a 


a a a 


btf S 8 S Q "5 M 

«» G5 

■S Gi 

G> 6 

G» 


55 


5. (S 







a a 

a 

a a a a 

a a a 

a 

a 

a 

a a 

a 

a 

a 

a 

a 

a a a 

a 

a a a 


b. 

G K> «*L G 55 CL 

CC CL CJ 

55 S 

5J ® 

55 


GJ 

G5 G) 

55 55 

55 

55 

a 

55 S> 

Cw 

a 55 a 55 

a a 

a a 

a 

a 

a a a 

a a a 

a 

a 

a 

a a 

a 

a 

a 

a 

a 

a a a 

a 

a a a 


Number 28 


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


Page 43 

377 







s p — c c>, p g g q 

\ f) (iKi q p cc to ¥ 

K; IO PJ e. CM CM ¥j ¥' & IO G ftai 

q p vo o: g q «g q vo q 

p —■ p ^ g ~ p p <> g *■-• — 

— s g to io cm — to g ® g g g 

PtiPvtVOiOtOPIOGt' — g 
c* k q r- q vi. q — is <v c. Ci t>. 

g c\j »o — to —« — g io g c« g g 

WMf h h q p — g — g g g 

p p p G s. io —b 

10 10 K) c - r c io to ro to cm G 

io q p q ~ — - ss>6.c»i'j 
g — g to to vo c. vt- p p g g <s 

GCM— GCM — lOtO — fOIOiM G 

g — to p (ve s g r- p — « vo 

® *s t p *— p p c* <s q — 

fO «-* G «— »0 Ki tO IO <T. G G — C 

— g — q in p ip ci ^ g - g >x) 

<s p p io to p p p io g g vo — 

G IO G G G — S — CM K to — ® 

ppppGPpqp q q g s 

K/ f. c ts> —• —* — p ¥j SO VO s 

K) a w mo s a a a a *o r g 

caa—•a-f'SKj^aio s 
g c uj w h- q qa io ® a <s 

CM K~. K> G — K. C\, a C! a ® c« a 

rsppppqpr-pvoGP c. 
w • r .K> r~ k> — — — a r a c a 
OSSrstOMaiOGCP G 

p — — io — to -<-c aN w c 

-vpbc. c. <ra<T&r;-(G q 

g s a s w — cm r a a a cv s 

c*. p p cv. — t' um? a-- to g g 

p p p q g — c. p p p 

tOfOtOtOtOGtOlO — OCMG — 

& ¥.■ ¥i p to q vo p t. g — g g 

a s a e c: c g ® io cm g g 


•o — 
P G 


Vi P ¥~ ( M p 
p f c. vo * < 
. f. ft- ¥ fO fO 

- a a c j c»i n 
g vo vo p •- 

. M*i 10 -* s 

- —• U. f' h- f~ 

t p p ► . — 

> G ft. S % g 

. p s p g vo 
-hc.cr — 
)mCCK. e* 

— p p t q 

- t p — p t- 

G — tO tO ft. 

q — t' q 

P ft ft p p 

- r , S G r, — 

— *3 % q * 

o. t^ r q 

- * ¥ <L. ¥ 

t~~ ¥ t~ q t- • 

p ■< r p q 


p vi g p io t 

vt. P w — C. « 

«. ► r • ft K < 

e. ft . p ft — • 

c * p c. c t 

■ a \ f B »•: 1 

: p g — G 5 I 

r o <■> r q i 

— g cm io to > 

p *■ q q 

r-u. p p c 

. ft. s ¥ — G 

. t*> g •— f* q 

— VP (S h- f- i 

G K K G — 


' g q r~ 
r- — — q 
— ¥' a ¥ 

G k* r. 

q r~ < t' 

^ , — (■/ —• 


q v> - '- o 

i- vi c r. q g 

, ¥. g c ¥ c\j G 

a u g 

G G P" G O- C 

ci esc :- 

C S li h M> 
u e up 
— wlGC: 1 

5 vt> r . -.v :j q 


p,it<k r — v..»- t- q f» g n g t 

h-*-M'^qM i a r-qr-GGGGqG 
o K ro O GK. r, K) v w P; rt i 5 5 s C - K> 


q 

— i^ 

c — 


f' — s^- 

» r . <•.. — v 


•r f ► • ¥ 

■*. ' V" *. .- 

i* * c c r- 

q o r- q — 

¥ ’. ¥ f ' 


vi t- r- q 

r- ¥ h- q ; 

*j CV —• K 

ro -* f > n. ( 

, ¥. <J c- vt i 

. r. ► s. *. « 

■ r- q ¥ u 

V K C t" 

¥• ¥ ¥ 7s- 

* 6. G- — C" 

t- vl? — 

(V — ¥. vv. 

. CVMfV 
u, — c. 

• - M KJ - 

r g y£ g w 

« r- ¥ r> ^ 

. fO ^ — Cj 


q g g f*~ q 

<j? g r* if 


<s, g c N V C- 
G G G G *i G 
C'u G rr G ►. G 

5 v£ G f" I" G 
r- G G c, G G 
K) G CV T G G 

<TP !, 5 ' r~ 

— v cp qp 

r S ^ K. K. p. 


U — u. r- 

u? ¥) c. q r- 

o ¥■ -C oi K. 


- r~ q g r j if. g c p p p~ ¥ c* 

. r- jp q — g f- r- g g- -. 

.-nK;C&*-«r,«-isMG 


tfP-W' SN<f K.p IT -PSC *{ CCC 
r-V-K. L C-wt-q — C»P~ GC- P'GW G q G G 

-- G CVJ —• GlVjfOGGGC\jGGGK^G — GG 

ipsp-pppsp app cppc <vvx)g 
q u > v£) — P K) U'. q r- — P'P'Vl/t^- G G G — —* 

G G —• »0 C CO IO K; K' M K KC G G Q S G 

h>v6 c « a a a p a p t 6 « a a k cj * g 

<f^«»i 0 6 pq««t-i> q g ic g q g g c. 

««6iS sionRas^ IO&KJIO - GGG 

q l qioapvt-qpvcppppas ^ ’» .v 
if if ic-p k cpi- p-r-pccc,!) g q 

— <V CJ CV) »C GGrVfOK?GGK. GGG O •— 

ir ir it s* k — g r- s a vp ^ (c a is. q g cv g 

t'. P- IT' V£ G r- — G q r- r G G G G P' P. 

P, ('JP(VCI n lOC('. CP'PICIOCCP'CC 

G-qq—K) — P~ qp PPICtfPK'-. *S GG 

cvvtacs'fCK.pppqpK — e- g g — r. 
-K)-«ssaiocp:oas«-aat.(sa 

inciocvwQsasaa®"''. pp r -a c 

r-PCVvoujpvDBi qppGPpr q c. p. 

SNGNS -K-K. K. C»»«iir C P - — r K- 

_ _ G G 

c vi/ p — cv) ¥j cv. »o p. r- q — i- g g c g g g 
-cjaa-aaiocc-e^csrtces 

if«ioeao--RBK5{vr, vc»p p- P K.qr 
ItflOCyi-SPP SP «<Mi! <f CPPr GG*— q 

«--c\i a nio aicio & b avic c s - a :• 

WKiPlO •? rK)P - KCVPP— Gr w. p“ G c 

IfiftPWP-CPC. tP PPCvtC GGC.G 
--lONioo&ircciciSiiocioio-pjc g 

vo k> to K' q p-> ® g q r scsippcs^ios 
t'-q cv p — r-PKPP jp cp g o. g g g g 


ifi it• to ifv cv ^ p~ r~ p- ¥ cvj q k> g q 
c vi/ p — cvj k> cv. to p: r- q — i 


¥) r. 


p~ g q p- q t 

— r- c 

¥* ¥1 G. ro ¥’ r 

G — P- C — l 

— P- — — C_ 

. CV G C c V 

c p- q r p t 

r. r- p- — p c 

• c. ¥ ¥ , k. . 

' q q ci g c 

- - g g q 

• ¥j ¥) c, CP ■ 

) c p p p k r 

c v p p- v_ r 

. c. — — k: g ■ 

. VO -* ¥ 1 • 

• q ^ w c c i 

: r.. r ki o k, i 

K, p q r* p- - 

— ¥ — • P I 


Cv. q r. V£» r. 

U — U' P- P~ I 

¥.¥')¥¥)¥'! 


VIP- 

t' c. 
g r 


u — p- — f. t 
IT s. P- q r 


p. — 
G P- 
<S — 


! co p c wp q p~ 
q p g p c- p- p 
|CIC).0,«|OC. 

¥ c. ' —• k> q q r \ 

o. G ' g • c r. 

¥: Cv. & g Ki ^ — 

. G VC' P P K P- vi. 

• vr< p p~ q t p 

> iO CM p-J P-- G K. ¥' 

G q q ^ G — G 

— p; p c- G vo g 

• G cv - cv *0 — 


S ic c — p- q vo q p p sj — 
VO q q G G P P~ P- C. p-J G G 
c »o pi e rcKicccaa 

P-GqGGCJP'P-GG — S 
— vop-voqqp^GvoqGG 
a io o n o sio-iocio 

q p- p- p- p- ■? p r, p p p c 

p- p. r- p- p- s c c vc c s 

ptcioaioscvwsiocv® 

G CJ q VO G CM q VO G CM q VO 
nioioioa® g g —• — —• 

— CVJ CMCMCMOCViCVJCV) 
G G G G G G G G G G G G 

G G G G G G G G G G G G 


IP C M K P 5 iP C 

o G q ¥. P- ro VO 

G ft.' G K* S ¥< d K. 

fO PPPCPP 6 

G G P - S P) I' P 

CV] G ¥) G l\) G Q P\ 

s s G P P C to S 

G VO C P P VO G U. 

cm r <s p)GK' a« 

\ \\\\\\\ 

g _ r^p-r^p-p-r-f' 

G -, — ¥ U P — K If 

CM Z CM 0 . CM CM tO tO tO 

CM 5 CM CM CM CM CM CV, CM 

S - G G S G G G FJ 

G “ G G G G G G G 


G Cl tO P ¥, vi » ¥; G -1 
p- g — q L' o. cv ^ g g 

— *S- G P> ¥ p, .S S' r» C 

v. p p p - p g q q p- g 

vOvO’-GPPGPP'GG 

fO fO .V G *0 — G to — S) G 

■o wpp q — p- sis? 
vo p q —• p cm p- g g q G 

¥. fO ¥j fO "j G — o. G JO S’ 

\\\\\\\\\W 
p- p-p-p-p~r~ppr-p-p~ 
P- — tO IT P- — ¥. XT' P~ -- ¥j 

lO S G S G — ^ ^ • CM CM 

Cm to ¥, ¥. to ¥. to ¥. ¥) ¥, fO 

G GGGGGGGGGG 
GGGGGGGGGGG 


IfV VO CM CM q — P P- —• G 
qupif — g — p-c-o 
cm o . — g to a & r a g 

IfVVOO.. CM — tOGGPP* 
p r q K' - p r> — p p 
to cv. G G ¥) — to CM* to — 

G CM vo G — G P rOGG 

to to q tr g vo k ¥. g p 

— G CM CM G ¥. G ® O. K' 

\\\\\\\\\\ 
p-ppr-p-p-f^p p-p 

= Ii.p-IOITP-IOITP 
© O' 0.1 IO ¥j to to g a K 

* to to to f. to ¥) q q q q 

r GG’OGG GG^GG 
~ GGGG G GGGGG 


P P P G C O q P O- CM 
P-GP&VOVOPPCG. 

— 6 G to to to G <S' CM G 

— P GP — GGGGG 
VOP-VOGGGC G — G 
pjlOrOGGGGfOG S 

ITG—GqvoPP-G — 
Cm G G G P P P G —> G 
GGGlMJOGtO — G G 
WWW w w 

pppppp-p-pp-p- 

—• to in -- K/ If P' — K 

»-* «-•—*—» CM CM CV O’ K) tO 
qqqqqqqqqq 
ssaaaaasas 

GGGGGGGGGK 


IT. ^ W ", P P P ¥ P 

to . u vo q r > p ¥> ¥) 
rr^c —~:mgg5 

g q vO P c q Q G f. 

G P PPGPqvo — 

Cv] to G to o; IO to ¥' ¥. 

StMCv SP C\'«Pf 
GGPGPviG — tO 
_ tOiO-CJOlOSQW 
-\WW\\\\ 

Z mio in it. ifi to i»‘ ir ir> 
u qvoGCMqvoGCvq 
^tOtOGGGG — — — 

5 q^ if' if it. ir ir in in 

r G G G GG G G GG 
GGGGGGGGG 


If O. 

q vo 
to to 


G GGinPtoqpqtOvop 
G GGqif — iro p q G G 
to — GfOGtOtOGtO — CvJG 


q CM 
G — 
G G 


GPGGP-tOlfiGPGPG 
G tO P- G P- G — VO IO >0 P- G 
G — G G tO GGIOG — fOCV> 


4) 

C 

o 

T3 


0 

C 


o. 

o 

o 


O E 
+* o> 



o 

bC 


■M 

C 

3 

O 

o 

*> 

4) 

co 


P. 

o 

o 


u 

41 


§ 

■H 


bO 

C 

o 

bO 


O. a 
4> C 


bC 

•H 

T3 


ta 

4> 3 

> «-» 


O "O 
T3 

» 


+J O >> T3 4) G 


© "H bfl C 
,0 . *H ® 
>, > -O 01 
JO H 

* c r, o 


C 

* -H 


(TO C 


U » 
- 3 «m 
•P U "O *Gfci +> -H 
41 £ T3 CO 4) £ 

bcv « taa ^ « 


►» 

« 


o 

Ml 

O 


4h 

O 

£5 

CO 



4) 4> 
b C CO 


&. 4> -*-> 
0 > -H 
O (0 <0 
h in i 


to to 

CM — 
G — 

vo q 
G — 
G G 


IO — 
G — 
G G 

q — 
q vo 
to to 


bO • 

•H O 
T3 O 
OS 
4) 


Q q CM 
§ 


>* 

os 

o 

£ 

X 

z 


P- to 

— CM 

CV CM 

CV P 
G G 
G G 

VO IT 
If P 

CM G 


P- CM IT G G P 
P If B P CV. P 
G CM G G G to 

G G CM G G —• 
ve G If VO P, p 
tO G — — CM tO 

6 . — G to G in 
g ¥ q if if- — 

G G G G CM CM 

C ft -CP vf 
G ¥ G P- VI P 
G ¥) G G CV CM 

P- G VO in G to 
vr g p — — r- 

G G tO CM CM’ IO 

g a t. p vo in 

CM ft. g in —• P 
CJ G to to G CM* 

6 - P IO G VO G 

g g g q in •—> 

G G G — IO CM 

p q — to <r p~ 
p- vo g g q P~ 
to to G G to CM 

Q G P G to q 
q g r> g g in 
tO G •- G G to 


p- to g p q p 

P ¥ ■ G P- — P 
IO G to — C'J ~ 

-vop P; C CM 
sup vo q u 
CM — — tO tO to 

p p q pj p ir 
pbcppp 
--to G G G 

— q q «-• g g 

VOP il K; p a 

t** 1 tO — G IO JO 

¥. g p qpp- 

tn G P- P P P 
GGGtO— — 

G p to q -— G 

— P VO G CV. G 

G to cv: — G IO 

P G to G vo q 
p — p- q r- p 

G IO IO K> CM — 

VO P IO P CM P 
P tO C - P G ft. 

IO — CJ — ~ s 

IO CM vo to G q 

G VO P G P P 
G G tO G — tO 


G X Gj 

G • G 

c < n -r. t r n x 

v > a. »v» o. a. Q. p. 
Z O 2. Si* C 'O f w- 
o2iuoaafl.ir 

CMqeviCM-*—— — 
cppGvs.0Jq — 
io — v\j to to to to to 


uvg — CMinvoPG 
p - ) q q q q q q if. 


G G G G 
G Q G G 
G G G G 


G G G G 
G G G G 
G G G G 


U 


q 


>- 



G 



q 


G 





G p 

#o 


G 


to 





G vo 

VO 


CM 

tO G 

CM 





G — 

•— 


G 

C G 

G 





CM G 

G 


G 

_1 G G 

G 

P 


q 


* G 

G 


G 

•s •» •» 

G 

G 


» 


OlUiSffl 

G 



X CO _I 


G 


-J 

a 




-J 


-4 





•—■ uc pj a: 

NJ P 




_1 

— 

a 



KU2L 

zu: 


< 

O :> 3> 

<t 

Z 

Q 

o 

c 

JQTQ 

“3 CC 


O 

£E£ 

O 

< 

< 

i. 

Q 

— in cm in 

CM — 

a 

m 

in vo vo 

in 

VO 

IT. 

p 

in 

iS) — G G 

G — 

X 

—• 

q g ir. 

— 

q 

G 

tr. 

G 

G G IO G IO to 

o 

to 

— G G 

IO 

to 

0 * 


® 

G to q p 

G tO 

H 

G 

to q vo 

G 

IO 

in 

vo 

P 

vo VO VO VO 

P P 


G 

G G G 

—• 

— 

—• 

•— 

— 

^ M M 



CVJ 

CM CM CM 

CM 

CM 

CM 

CM 

CM 

G G G G 

G G 


G 

G G G 

G 

G 

G 

G 

G 

G G G G 

G K 


G 

G G G 

G 

G 

G 

G 

G 

G G G G 

G G 


G 

G G G 

G 

G 

G 

G 

G 


CM 
<t G 

» G 

< < < _J G 

Q Q D > O. 
M Q C Q O J 
X < < T* -o 

ap p p p io 

— G G G m G 
IO CM CM CM — to 

g — cm ¥ j q in 

CM CM CM CM CM CM 
CM CM CM CM CM CM 
G G G G G G 
G G G G G G 
G G G G G G 


G 

IO » 

CM CO 

G G O. G 

G< G G 

G G X G G J 

< 


to 

vo 
P G 
IO G 
CMG -* 

G G 00 


to — 

G — 


— r-Gtocvjcvjt^ptov^Pt^ 
g t. - if. - ^pp q p — g 

G GIOGtO — tOGGP, KiG 
G VOGqtOGCMG-^IOtOG 

g p g to m q vo q in cm q g 
CM t^sto — — toto — GK PD 

g g p q p to io p q k, p 
G GP^GqvO— PVOPP 
g si-cvi^-aafiioss 

— ?as q g in io vo p to sg 


2 a; 

a. 

3 2 a: i < o w 

< 


CM 



G 

CMP — G—CMPtO 

io — q 

o 

“S 

Q. — O 

-j i_> a. a. 


CM 

CM 

a. 


G 

G K> — G tO G to 

CM CM CM fO 


cm in io p 

cm m — — 

Cd 

CM 

P 

05 


q 

P G VO VO S IO P 

G in <0 P 



vo io vo 

p — «o — 


G 

G 

a 


p 

KD G m P G P G 

G 

GPP 

to CM 

»o 

IO to CM 

IO to IO to 


G 

G 

U) 


to 

G G — CM IO CM — 

CM CJ tO G 






\ 

S 



\ 

\w w w 

\ 

w\ 



vo P — 

cm m g — 

w 

G 

G 


r 

G 

G G G G G G G 

ft. 

G G G 

to to 

to to to q 

q q in if'. 

hJ 

G 

CM 


o 

G 

cvj q vo g cm q vo 

¥. 

cm q vo 

CM CM 

CM c: CM CM 

CM CM CM CM 

ffl 

IO 

to 



G 

G G G — — — — 

CM 

CM CM CM 


G 


S G G G 


G 

G 



— 


— 

— — — 

G G 

G 

Q G G 

G G G G 


G 

G 



G 

G G G G G G G 

G 

G G G 

G G 

G 

G G G 

G G G G 


G 

G 


■ 

G 

G ® G G G G G 

G 

G G G 


Page 44 

378 


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


Number 28 







SCMCMCMC^^— <TGV 0 -« 7 t-tOGCMvevCGG NQi 

GGCM^in cm <*t-vc to t-r-s—c> - r- u> s. o b 

CMGGCVG— GIOIOCMtO— CMCM — Si — IO CM G G 


GSvcs^vcinGvet- ^ -• sssGSvrveiof-vcinvcGc; 

®—intovcscvif'iosst-t-GGGGSt-G — * ^ cv o. ® 

G. — G — CM CM — (OfO®lOirtOQ6 5-Q5iCii-t\J-W«VBaS 


CMCM^IOGinCM^ — Q <Th IO S G G> G 
g — ®cucMCMt'~t-inr-»o cm cv g <r g g 

® tO — IO CM CM IO — CM (O IO ® G G — G G 

GCMCMint--«TCM»oGt-t-«Tr- g cm ® ® 

GSGCM — PO — — P7®®tOP0 B 5l S 5» 

CM CM — ® m CM <7 IO IO G — PO 7 IS B S B 

<? S&8S 

G— GtOGGCMtOCMIOCMtOGGGG® 

Q CM <T Gf-t-* — vC — IOV0 Q MS 61 S S 
to — -rinvet-'C-q’tot-sp. c-t-os 
Q _ CM — — —— — — G — N(0 SB 6 S 

g^cm — vet-to<*«r®r-ve<TGGSG 
vc s ® ® ® 

S«C\lS-*8-®-W®KW - S' ® ® 
gg — GCvininvccMr- <r to p- cm ® ® ® 

sinr»CMCMCM— < rir>f-mGtove<TGG 

cm — to cm — — B^SQIOS^CXISSlS 

^ra — —r^cMcvi^r—s u? ® b b 
IOG tniO<T<Tin — IT'S — VC ’TW SB S. 
®Q®W--K)(\jniO®KMOSiQ(iS 

gcmgc— vc—cut—CMr-r-r—t-G®®® 
--BC\i- < TU''IOK)r'S--SQBB 
GCMCUGtO—CMCM - — CM — —tOGGG 

IS G in — Ifl ® ® K) C\l S S G ShRS G 
eswQ-ifiws-KiBtfK.winsss 
a-,-®—swnioino - s s s 

QCVl*-»^U>Slf'^*It'^>OhSSS& 

cm m g g to cm — <t vc to it cv. t- ® s — ® 

G G CM CM — — — tO — CM — CM G ® G S '"2 

RCVSir^VtflO-IOSSf'-tfSBS 
BBWSSMf.-h-SBB'lOh-SBB 
as - -SIOIO- SSIOSIO - GGG 

WB-miT'Cl'TCVBGir'B'rCN’&BS 
G — ®r- — GtO'JCumr-t- u? b s s s 

Q ® Q - — — CM »0 — (O IO IO 6 8 8 8 8 

«ts®' 3—c\j»oc\Jir, K) — f- — <ns n s 
S— ^mGIf. CM— VC — CMtO S W 8 W 8 
G — G — SI0CVII0®C\JC\)8S»0(8SQ 

GG'CSiriO«TVC < 7 < 7GGt-(OSGS 
B S ^ GGGPOPjCMiOvC ^MOSG6 
® G CM IO IO — CM IO — IO(\MOK)WS8Q 

QQITCM— «y)lf'C\I^^WP''^SSS 

S «? s g to if. ?o vc t- p;. r- vc s «» s s ® 

w asions-»s wnio - s — ® ® g 
_ \\\\\\\\\\\\\\\\\ 
- vClCVCVCvCVCVCVCvCVCvCVCVCvCVCvevC 

* _ ko in t- — to ir. r- — to in r- — to in r- 

* S, — — — — CVICMCMCMlOlOIOfOGGGG 
® « _ — _ — — — „ — — — — — CMCMCMCM 


s r- <r vc to <7 p> <r <7 g g ir cj ® 

s U/ — a . - cu — b G <r vo u'i is 

S S K) - 8 8 — IO 6 S CM®® — 

IS — <7 VC CV S C\) B & B G VC VC — 

G V£ P m P- <7 f-<J G g cm to ® 

®IO~tO — QtOCviSS CM — CM® 

® cv <r vc cm ir. cm in s g <r cm in 

B <r B W <T tn G CM G IO g g m ® 

GIOIOCMtOCMCM®— G — IO CM G 

is. — cv. <r — ir ai r~ — »s cm cm ® tn 

G VC *? IO vC C< 'MG.C.G. g — — cm 

® ® — — to — S G — S CM CM — CM 

G G P IO CV CV) — IT**® ® p- cm r- 

5 — VC If t- — CM CM C. S' <7 CM — P- 

G CM — — — tOGCi — G ® to — to 

® BIO - to <T CV1 S ^ W <T CM m *7 

G S VC IO — IT — G CV -<7 G CM VC 

GGSGCMlOGC'—G — G G CM 

SGU. — tOCMCNJlf <T — G «7 <T CM 

6 C. <1 CVl ^ B - B If . B G CM CM G 

G ® IO CM — G — (MBS ® — G CM 

ggvc — ior-c\i^ — — ® «r <7 r- 

® G 'J— — — -5TtOM)Ci B <C lO U' 

BB-S--SC' vS G G G — G 

SSO-CMB<7-BK) G CM P ^ 

G G VC G If. IT. <7 If . CV vf S - O’lA 

BBS— CMBMMa— CM G G CM 

GGG-TCUVCGt- CM G ® G If. IO 

S G P — <7 -T - IO G — vC G VC — ® 

GSCMtOfOlO — CMCVCM GGG — 

G G P <7 — <TM5VC<M<T G CM CM — 

GG — — If. VCPCMG — CM G <7 vC 

G G IO IO CM CM — IO CM CM —lOtO — 

C.S — VjCMinCMVC — GX ® — G CM 

tsGvcvcin-^to^inG— — <7 in cm 

gg — — r — tCGtO — ® gcmg — 

g g> <r to — r- «e g cm vc g g in <7 in 

G G to I-G — in If. <tt — — G to <7 

8 B CV 8 to SO - B BC CM G G — 

— ® vc vc — m s in to in cv cj in ®-m 

S G — — P P — CM IT -7 0 ® — — ® 

G G IO — CM® — GGG® ® ® ® ® 

s g p — <r ^ vc cu to — in m <r m ® 

GGVC4— VC® — »M«nCM - 0; CM — 1C 
— iOCViOCUCMiOR® c G ® — CM 

\\\\ \ WWW „ \ \ s\ 

VCVCVCVCVCVCVCVCVCVCVC > VC VC VC vC 

— toint" — toirr^ — to it. ^ in r- — to 

___,-,£\jc\JCMCMtOfOtO to to to ® ® 

CMCMCMCMCMCMCMCMCMCMCM z CMCMtOtO 


cm t- ® r- vcr~tovc® — vc®r- g® 
sinintor-®s®vc — ®vc — vc® -7® 

CMCM — ®®tO — ®tOCMCM®® — GtO® 

®t^to®-«T®r~®r~rovctr\r-^to ®® — 

— toinGr-^r^sr^vcGG-vyrow ®g® 

— —CMtOfOtO — CMIO— ®® — ®f) ®®® 

OJBCMM^Qr-vdSBtO^MO^ CM ® in 

CMto- 9 ——veto—-^®® — *7 r~ r- ® t~- 

— — CM — ® — GtOtOCMG — Gtoto ®®CVi 

— Qins^TvCQtOt^CM^r — ®‘G h- ® h- ® 

inCMG-*®t^G* , t-G'— — ®h-G 

®®®tOIOfOCMtOIO — tostoto ® ® — ® 

— to CM VC vc h- — K 10 t~ Q <T S *T G G G ® 
tOCVl^hh-^VCSh GGr-lOCMGVCm 

to — — — * 0 ®t 0 » 0 t 0 t 0 — to— ®G®CM — 
«r»nr~®r- <r<r^®ro®to® — *ccm® 

toG^^r^Gh-tOf-'r-ir.G — ^r-t-iSG 
®®CM®OtOIO®tOlO — COS — — GG® 

r-CMG— Sh'f-h'r-vC—CMC^GGG ®® 

BromB<7iM-— —SGvx-r't- ® <7 ® 

®tO®®tO — —®®® — G®tOCM®K>® 

m^r-cM — to ® to t«> if cMin-^vcvc<TG® 
cm cm to r^- r- <7®®®to — 7 t'f'" 10 ®® 

— — ®tO®— OtO®G ®®(V. *OG GG® 

r^CM — tO®®r- — 8lOhM'<T6b ®G 
VC<7CM®r-vCtOvCr'CM®GG — ®U G® 

® to — ® to to ®tOtO®G®G®®tO®® 

®r-®®vc®r- — vcr^G-^mf-t-GGr- 
it«t r- — t^r-r'GGGr-r-vCGt^ 

QGGCM— Qto®—lOvM — — ®GtOG — 

veev— <r<7<TG<7r-®Gvcr--r-r-<7;sG 

— t^|f\t~-Gt~- <t f- IS < TGt'~r~ — — f' GG 
tOGtOGGtOtOIOGtO ® to IO IO IO GG® 

® CM in S VC t' ® 

tOCMVCI'-t'- — vet^vetOGve B 7 - B B 
®G — ®tO®—— tOtOG— GtOtOG®G 

mvMr-vcr-®vctof~c-ir to®«s.®r-G® 
cM^t^r-^rsf-Gtor' g cm r- r- n- g g 7 

— trCMCMGIOtOGG — IOGIOGG — G® 

mcM'er^Gt'-f'iOGvcGG — g — Gr- ® 

h-h6UIKM'68h7B-78'Ch ® 
tO—— ®CM— ®CMtOfOCUCCGGQtOtO® 

<T®vC®®r^®G®*>«— Gin — tOt^G® 
to IO M vet- <7 G r- 7B77l r Jf'8t r -CMB 
to GtOtOGGCMtOtO SOB ® — tO GtO G 
\\\\\\\s\\\\\\\\\\ 

VCVCVCVCVCVCVCVCVCVCVCVCVCVCVC VC VC VC 

int- — tomt-—toinr~ — toinr- — tom r- 

G® — — — — CMCMCMCMtOtOtOtOG GGG 
IOtOtOtO»OtO»OtOtOtOtOtOtOfO<7 *? <7 «7 


GGGGGGGGGGGGGGGSSGGGGGGGGGGG gggggggggggggggggggggg 



rj v>; u r- if, o c . v* g ® e <r 

K- if y . (1 - 6. r- l» B G CM G 

G to — G G CM f G * CM — G 

t--CJ-7t BBS - ® — CM 

r-Gver-uV — G ® G G GGG 

to cv to to 10 G G 'i ® CV G — G 

— I- — r. —to G G 

v_ r 7 \ Mf! B VC <7 G 

CM — CM S P. to CM GGG ® — ® 

vc c r- r- t- b. g *.* cm p ® ® in 

vCP r-t-C-GB GG— CM — ® 

G K- to CV p S rs BUB G G CM 

to vc r f O M — I v - _ G G 

10 r. — t- v .• s <. •> cm to — 

to G K r p- — r .. ..M -V — CM G 

sc — C» K t*i •■'• G K . n G CM CM 

N o <v s — c- Cl 4 . C CM G m 

® K G C. S r i Cj G Cv — — G 

IT 7 - 7 C TIT 7 r . - G — G 

r- M:r c r- w p~ p j- vc g g 

*0 •? . K. f . — — C: K G G — G G 

— t- U G — — Z, r. B S CM CM 

.t-UGP. GGPV-SG G — «? 

CJ f — Ol B S S 10 B S GGG 

r- 7 r- r r-r-o s-cmp. — g to 

r— vcp C 1 C v — Ps. CM G ^ 

— C‘ C. P" ? C f —PR G — G 

'< I- 7 7P'f <V (S - — G CM 

B - u»h p C. Mv 6 6 — G CM 

P. — f f p *• — G ® G — CM 

tovcr-?cvr-— p: p* - ® — ® 

to f- C'. ® ® I- S. <S — s G CM G 

cyjr. scvfssssQ to — cm 

P. ■S<7r-t-V£<TCVC.G — G 

P CBl-t-t-r IT — B B VC CM G 

GGPj— CtOCVG — G — Q to 

IT <r f> C\ — — SIS — G G-^tO 

7 K. 5 P P B U B vi 8 G G VC 

— ft.aiRP’I'^BBS G — G 


cvvc®r-tot-t-r~®r-—tor- Gver-t- 
7 — BP GP tJ - P - S B p. <rr-t-to 

— — ® tO 10 IO ® G to G CV GGtOG — G 

G— VCGVCGIO® — <T r~ Pj t- t- ® P> — 
SB-6PBBVDBP77-PPSS 
G G — to to CM CM to 4.1010 rt G - — CMtO 

8K'8PPBP'f7-BS8IOB'CP 

— tn®t- — r-tot-r-G^i-t- 

GGG to® to CM — tOStOtOIOP)PJP)P) 

to-® 78P s «Tr-<7 , r-t-r-r-r-t'-ve 
GtO — POf- — G — tot- — — t-t-GIO — 
GG—tOtOGCMGGtOGGGtOGGG 

8SP8P68MOPS8BIO-86 
VCB78P 7PP ® — -^vC<T®-«T^t- 
G CM ® G G tO tO GCMGtOIOIOCMtOtOfO 

CM — vc to G P- t- tot-—-vrveveGt- Gt- 
BtOBBPt/P; G — 8PPP7 — veto 
GGGGtOGG GGtrtO — — tototo® 

-7-7PI078SPS'C7lOlOvC'H 

vc to vc — t- g r- ® g to — r- 
GCMGCMGCMtOtOtOGGGGtOCvjtOCM 

GGG <7h l- P IOvCGf—PVCG—t— — 

— t-VCtO — 1-10 BP7PP P 7 7 S 

G G G G ® IO G G — IO— GGlOtOGtO 

G — <r — <r — — g Gt-toror- gk>gp 

Gtoto^t- ® G t— ® t— G G G t— ®t- — 

G CM CM — tO CV CV tO G — Q C: G — CV IO CV 

*7" 7W-PBPPP5 <tp:p to to p g 
G tO<T<7‘tOV£7P'. t-t-Gt- ^Gt- 7P,P 
G — CM tO G tO IO GGCMIOtOCMGtO GtO 

W88S5P8PIOPB67 6PPP 
®— U/G^tOGGGP-'GVCvCvC— ®P 
G CM G G tO G tO GCMGGIOlOtOGGfO 

IO-VD8PS8P8SPPP6S7P 
VC — — CM I- 8P tO 7 P B P. P 7 P S 
G G — G tO tO tO GIOtOG®GtOtOp)CM 

--7P&PP — — <* — GGGVCt— G 

r-^cMG^r- — G-^t-Gvcvcvet-r-to 
GGGGIOGGCM — tOtkllOtOIOGGCM 


GGG — IC 5 SPS 7 P 7 P 

GG— CVGvcvCtOvct-rOt-G 

G®G — GtOtOGIOGGGtO 

vC— vCG — mGPtOGt-tOlOVC 

8 7 P *j SBIO— SW 77 W" 

G — GG — IO — G CM IO — 10 — G 

P 8 P B — GGGtOVCPvCPG 

— G G 7t)87St:S877 

GCMGG G — GIOPjGCMtOtO® 

G — t— <7 — 7 BVCIOP - G — G 

®G- CMGvct- ^tOCMt-vCt— 

tOGGG GGGfOtOGGGto — 

t-G—® — ®GP«rp— top- s 

t- G G G — CMt-GPG<TvCGve 

— K, tOG GGGGtOGtO — tOtO 

B Pi S 7 GG^TG — IO-«TvCVC — 

GVCVC— GVCGVCVCGPIOP. VC 

® G tO G G tO G IO IO CM IO ® G CM 

Gr-ojr- GG — G vc — vc ^10 p 

VCGGG 8 N 7 «P tPtO 7 G 

tO CM G G GG— GlOtO — GiOlO 

t- — G — V<r^t-t-Gt-tOl-G 

— vc VC G GGG—tOGIOGGVC 

G — G ® G CM — GGtOGptOCM 

& 7 B IO NSIOP « 7 PB 7 - 

G IS G IS GGvCGGPPjPfO <7 

CM tO — CM G — — G 10 G IS tO U IO 

G G VC — 8-88 —MO—P « 

VCVCGG —B—B 7 P- 7 WP G 

IO — S CM GGGCMtOGtOtO — tO 

vCGGG 86788 PSICWP 

— -T®-^ QSS 57 S 6 PjP, - 

® ® — G G CM G tO ® IO CM G CM 

<TGGG 88777 P 87 -VD 

PV B 8 7 G—GGf— G f- tO VC P- 

GGG— GGGGIOCM — GGG 

f-<TGG G G G CVJ — tOvCt-tOvC 

P- CM G IO QS 767 BP 67 - 

— GGG Q — GGGtO — tOtOG 


B W 8 G CV 7 6 7 Ui B GGG CM - ^® 

VC PJ r— P ID P P P 7 8 U) r. « GGG 

tOG — IO — CM® — ® — GGG G — G 

7PvCG877PG«f?8Q6IOvCW 
PGPver- r- to — t- P B 7 B CV 7 w 
GGCMtOGtOGG — — S — GGG® 

SVC877P«)P7r —GG CV tO CV 
t-—c- - P Pi - BP G GGG CM G U 
-68810668100688866 

— GP^VCCMVCVC 76 7 B6IO 
G — PPVCPGG — VCt.BB 7 7S 
CM G — — — 8P(M6P)(\86WS- 

-PU3 7(0 PtO t VCP — <T G CVS® 
<Ct';PPS-7B--BBBB77 
tOGIOfOCMCM—GGGGGCM SG® 

IO 7B 7P P P1IOP G GGGGG-T G 

7 P) P P t B 76B 7VCCVIB BB7 8 

IOG — —lOCMlOCMGtOIOGCV—GCMCM 

-G7PIO 6-81086108 GCVGG 
CM r- in — vc G'VCVCGVCVCGG G CM G CM 

G — IO GlOIOtOtOCM — — G — ® — tO G 

tOvCPP®®— -sr — CV'GGvC GG® G 

7P77VD 7BPBP 66B B77 C\l 

tOGGfOtOtOCMtOtO ® G IO — G — v\) G 

87»DP8P)-W8P G to in <T — — <7 

topto — 7 vc 8 P) v/> P G G <T G — IO — 

CM G G CM (0 >0 IO G IO G ® G G C- S Cv. G 

— Pt-toto — to in VC to ^ G CV 7 CM G G 

VC — 77<TvevetOP®tOGCMCV7CMG 
IOGGIOtOIOP>GGCVl®®® GGG® 

(MVCVC87 — — — VCP —t-G GGin — 

<T IO — IO t- vC VC G G tO G t— G G G vC CM 

tO GCMCMGtOtOCMG G S G CM GGGG 

P SPP7l0 8- (V'r GG G 8CV17 6 
VCVCVC«TPGVC — 76W6666CVIS 

— G — tOtOCMtOCM— CVCMIOG G CM G CM 

*-. VO Mfvsp CM VO G G P — G GG— ^ 

— PIOP-.VC — VCGGVCCMGG GG — — 
CMIOGCM — IO 10 IO tO tO ® — G G IO ® CM 


P-7KWSP)-WQ G G ^ 

P P/ Ifi Q cv bt to IT 7 G GG — 

IO to s G G — — G CV G GGG 


G CM — G VC t- G 888QiC^778P VC 
8N»C8PGPPPIOPPPP-7PIO 
G ® — IO IO G IO tOtOGIO—— tOGtOtOG 


GGG 8868718PPS7 

GGG — CMGGPvCtOGlOt- 

G tO — G — — GtOtOSCMtOG 


GGvCP — tOVtovC — tO^T — G G P VC 
IOPIOGG 7«6PP 87 6 IO 67 6 
G — 6P)Wl08t0P)88t088W86 


BP-S-WBB CMCM 
Gu.— VCVCG SG— CM 
CM G ® CV CV! G — G G G 


78-8-78VCPPP 
GSGmsr-Gst-ioio 
8 B- -.08 8 610 8 G 


PIC8VCVC87PP — G 

— r-ve — ioppps68 

8--888-IOCV16 G 


g G g g * r- 

® to G CM G G — 

G G G G CM CM G 


Gt-— GtOvCCMGG — — 
7®vCvCVCtO <7 r- vCGvC 
IOGIO — (OGtOSGtOtO 


vCGr- ® G CM — G CM — — 
PvflPIfVPiCS 676 7 
G IO. G IO tO — G — G G — 


r- intOP-scMirt-®G 
r- to t- c\. ® cv u r ■ m — s 
— tOCMGSJIOG® — G 
\\\\\\\\\\ 
ininjAinininininirtn 

VC QfM 7 & (V 7 VC® 

-CVJCVICVJCVOIOK'IOB 

in m it tr. it- in tn ir> in vc 

GGGGSGGG GG 
GGGGGGGGGG 


•® — GG^G — t- — 7SP7PP 7PVCGV 
i G VC ® — tOGGGGPGGPIQlOP — — t-t 
•GGGtO—CMGGCMtOlOGtOGGtOGGlOP 
.\\\\\\\\\\\\\\\\\\\' 
r777777777 7777777777’ 
J7VCSCM7VCGCVJ7 VCGCM^TVCGCM^vCGC 
1ISG — —— — CMCMCMCMtOtOtOtOGGGG— > 
>vcvcvcvcvcvcvcvc*cvcvcvevcvc PPPPPP 
tGGGGGGGGG GGGGGGGGGGC 
IGGGGGGGGGGGGGGGGGGGG 


i«MP8 7P7PVC»rvap 710 8f 

r 7 8 op sp 7 P)Pt-itovc *r r 

B — G IO — CV IO tO GG G G IO tO PO I 
‘NN\N\\\\\\V\\\' 

)P>lOtOP)tOP)tOlOlOlOtOIOlOtOI 

rvCGCM 7veGCM *7 VC G CM 7VC GC 
JWlOlOtOP)8S68 - — — — CMC 
t-t-t-t-r-GSGGGGGGGC 
iGGGGG — - - — 
tGGGGGGGGG GGGGGQ 


Number 28 Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 Page 45 

379 










Page 46 

380 


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


Number 28 



COSMAC Elf 

Experience and Comparisons 


Dear Doctor Dobb: Received: 78 March 24 

Your magazine is always a welcome sight whenever it does 
arrive. Keep it up. 

From time to time you and some others have published bits 
about the 1802 micro and the ‘Elf computer. Although quite 
underdeveloped, this seems to be the lowest cost way for a 
youngster or beginner to start. 

Two days a week I have been taking my Altair to a private 
school to expose the youngsters to micros. One student 
became so excited that he wanted to build a micro from plans 
in a very old issue of Popular Electronics. I explained to him 
that the later issues of said magazine have a series of articles 
on a much easier, lower cost micro-computer: the ‘Cosmac 
Elf. He came to the conclusion that it is really cheaper to buy 
a complete kit rather than one piece at a time. 

Presently there are, as far as I know, just two good low-cost 
versions of the ‘Elf. The ‘Elf II’ from Netronics R&D in New 
Milford, CT, or the ‘Super Elf from Quest Electronics in 
California. 

Which is better? Well, Timothy bought an ‘Elf If for a little 
over $100 and I got the ‘Super Elf for just about the same 
price. They are both good. Almost equal, but not quite. 

First, the common points: Both are about the lowest cost 
for a good micro-training tool. Both use a single P.C. board 
with the 1802 processor, 256 bytes RAM and a nice hexa¬ 
decimal keypad and led display. 

The power supply is a single 5-volt regulator on a heat sink 
fed by four rectifiers and a 1000 Mfd capacitor. The step- 
down transformer is external so that no high-voltage is present 
on the circuit board. You must order the transformer separate¬ 
ly for the ‘Elf II’. Don’t be foolish and try to run it from a 
6 volt transformer or a bell transformer. The power supply is 
very weak and you must have the right transformer for good 
operation. About 8 to 10 volts AC is required. 12 volts AC is 
too much and will overheat the already hard-working regula¬ 
tor. 6 volts is not enough. 

The reason is the hex display. It uses as much current as 
the rest of the computer. I have modified my ‘Super Elf so 
that the average display current is reduced by giving the led 
display pulsating D.C. 

Both come with good assembly instructions, but some 
prior knowledge of electronics is helpful. Although Timothy 
has not ever built anything like this before, he did quite well. 
The main problem was trying to make modifications before 
finishing the kit. He now has it up and running and inside a 
very nice formica cabinet his father made. 

Both dealers promise additional devices for their ‘Elf kits. 
Adding an I/O and 4K of memory will amost double your 
micro-computer investment. Still, it is about the only way 
you can get going for less than two hundred dollars. Now 


about the differences: The ‘Elf If has a larger board and has 
lots of room to expand, while ‘Super Elf is very crowded on a 
smaller board. One pad is provided for a standard 44 pin 
connector. If you wish to expand you must directly wire into 
the 50 terminals on the upper edge of the P.C. board. 

The power supply transformer is included in the price of 
the ‘Super Elf, as is a simple monitor on ROM. However, it 
is very limited. You might like to have an address display. It 
is available as an option for the ‘Super’. No provision on the 
‘Elf II’. The hex key pads are almost identical on both, but 
Timothy and I agree that the arrangements on the ‘Super Elf 
is more logical. So he rewired his keypad so that ‘0’ is in the 
upper left and ‘F’ in the lower right. ‘Super’ includes an audio 
amplifier and speaker for the ‘Q’ output. First thing I did was 
to try a music program which was not very loud. Timothy has 
built his own ‘Q’ amp and used a larger speaker for much 
greater volume and better bass. 

My ‘Super’ came with large ‘500’ type seven segment 
displays. ‘Elf II’ came with similar but smaller displays. The 
‘Elf II’ can not single step a program. The ‘Super’ has provi¬ 
sion for either single step or running a program slowly as an 
aid in program debugging. 

To sum it up: ‘Super Elf appears to be the winner, 
although ‘Elf II’ may be easier to expand. Both are a good 
buy. What is needed for both kits is a modification to use a 
1702A PROM. 

What the ‘Elf needs is a good prom program to read data 
from a Kansas City cassette and write into the ‘Elf’ memory. 
Tim uses the cassette program published in Dr. Dobb’s. He 
first keys in the Read Cassette Program, then loads in his 
favorite programs via the cassette. I knew that it could be 
done, but the first time I saw him do it I was spellbound. His 
entire system cost less than the cassette interface for my 
Altair. This is a good example of the cost-effectiveness of 
micro-processors. The 1802 doesn’t need a UART or fancy 
interface to load data into memory. Just a few simple parts 
and a short program! 

The 1802 needs more software. I am going to try my hand 
at writing a Tiny Basic for the 1802. If it turns out OK then I 
will make it available to other hobbyists on cassette tape. I am 
using the Altair to cross-assemble to the 1802. 

Maybe it sounds like I am down on Netronics. No, not 
really. Be aware that what you get is not exactly what you see 
in the photo. The 86 pin connectors are extra at $5.70 each. 
And the four buttons on the far right may be replaced by 
toggel switches. And not all IC’s come with sockets. Both kits 
fail to use the required 22K pull-up resistors needed for TTL 
to CMOS. One of our units gave some trouble because of this. 

Yours truly, P.O. Box 27462 

John B. Palmer Tuscon, AZ 85726 


Number 28 


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


Page 47 

381 





Dr. DoBB'S joURNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 

Number 29 October 1978 Volume 3, Issue 9 

A REFERENCE JOURNAL FOR USERS OF HOME COMPUTERS 

SOFTWARE 

LEDIP: A KIM/6502 Line Editor Kiumi Akingbehin 4 

An expandable program for creating text and source code 

Quick and Dirty Routines for BASIC Dennis Allison 13 

Subroutines to implement some useful functions 

POW: An 8080 ‘Processor of Words’ Herman Watson 18 

Whatis: An 8080 Expression Evaluator Mike Gabrielson 34 

A program for evaluating arbitrary arithmetic and logical expressions 

HARDWARE 

The Digicast™ Project Jim Warren 16 

A broadcast-based information system for the public 

Data-Boy™ Speech Processor James Anderson 30 

Description of a new, low-cost speech interface 





© David Dameron 1979 





EDITING TINY BASIC 


A NEAT TRICK 


Richard Greenlaw Received: 78 July 24 

Here is another extension for Lichen Wang’s Palo Alto 
Tiny BASIC. I have modified the GETLN routine to allow 
editing of existing BASIC program lines. 

To edit a line, type the line number as usual. After that 
each control-L (the load key on a Sol) will input successive 
characters from the original line in the program. You can 
backspace over them or blend them with new text as you 
like. The line can be terminated by carriage return from the 
keyboard or from the original line if you go that far with 
control-L. 

If the line number doesn’t ejdst a line delete is simulated. 

I typed a source from the Interface Age version (12/76) 
so I added this by reassembly, not patching. You will note 
that I have changed some of the control codes, such as line 
delete, and have replaced the RST single byte calls with 
normal calls so I can run at 2A00H under Micropolis MDOS. 


A 

G£ I LN 

CALL 

OUIC 

lOUlPUl TROi'i A 

kJ w32 A 


AKA 

A 

izeko 

AAJA 


STA 

EUFLG 

IIiMoICAIE ED 11 POl.MlEK -MOT *| 

A A A A 


LX I 

D#BUFFEk 


AA50 

GLI 

CALL 

CHKIO 


A AM 


JZ 

GLI 


AA1A 


CF1 

0CH 

JCTL-L (LOAD kEY O-m j^l) 

A A H0 


CZ 

GLEI) 

J GE 1 CHAk h kOi»i OhlGlM.AL LIME 

0 09 A 


CPI 

7FM 


A 1 AA 


JZ 

GL3 


0 110 


CALL 

OUIC 


A 1 dA 


CPI 

0AH 


0 I JU 


JZ 

GLI 


A 1 AA 


Oka 

A 


0 1 b A 


JZ 

GLI 


0 I 60 


CPI 

1 bH 

JCTL-X Is liNE DElET"E 

A I 70 


J L 

GL4 


01 HO 


S TAX 

O 


0 1 90 


IMA 

O 


0 dAA 


CPI 

CR 


Adi A 


*2 



Add A 


MOV 

A# E 


A dAA 


CPI 

Ah h h&HiJFEIML) 

A'dAA 


JMZ 

GLI 


AdM 

GL3 

MOV 

A t E 


AdbA 


CPI 

0FFKAPHJH EMU 

A'dlA 


JZ 

GL4 


a dm 


DC X 

1) 


AdVA 


MVl 

A,SFH 


0 300 


CALL 

ourc 


0310 


JMF 

GLI 


0 320 

GLtO 

PUSH 

K 

J ED l lOr? 

0330 


PlJ4H 

IJ 


A AAA 


PUih 

tl 


0 3 b0 


a 1 AA 

u 

JUcLlMll fakTIhl i.mPJT 

0 3 60 


LDA 

EUhLG 


0 3 70 


OkA 

A 


A 3 60 


J.MZ 

GLEUA 

j n* ptr imio old line set 

0 390 

* F I .Ml) 

LINE WnObE MHk 

BEGINS i MPuT LINE 

0 400 


LA 1 

l>» KiJFrEK 


04 10 


CALL 

Tb T.MIJM 

J ML = tt 1 MAk Y LI Me. * 0k A 

0 420 


CALL 

FiMULiM 

IIJE- >L 1 ME lh L b£ 1 

0 430 


MV 1 

A » 1 hrl 

ICIL-A Li.ME DELE IE 

0 440 


JMZ 

GLEDX 

J Ih MO 1 FOUND C4MCF.L LImE 

0 4b0 


I.MX 

IJ 

JSKlP HIMAkY LIME Mok 

0 460 


IMA 

u 


0 4 IA 


ACHG 



04b0 


bHLO 

EDP r k 

MMIIIALIZE E.Jir POINT EK 

0 490 


MV I 

A* 1 


0 b00 


b IA 

EOFLG 

JlMUlCAle. EDIT FTP bET 

0 b 1 0 

Gl.tDA 

LmLD 

EDP 1 K 

; Ed IT fOINIEk 

0 t>20 


ho v 

4 # M 

;pk0i*. 0 PlC INAL LIME 

0 b 10 


IMA 

M 


0 -340 


SHLU 

EUr* 1 R 


0bb0 

GLFIJA 

pop 

rt 


0b60 


r'OH 

IJ 


0 b 74 


POP 

rt 


0bti0 


KE 1 



0b90 

GL4 

CALL 

CKLF 


0 600 


MV 1 

A»nEn 


061 3 


JMF 

GE TL.M 


b4b/> 

Lsr*" 

E«JU 

5 


Vn 1 ) 

EUFLG 

u.b 

1 

I ED I I ADDKE.bb SET FLAG 

b 4 60 

EOPT 

Db 

2 

JED IT P n 1 NT Ek IN 10 ^kIGImAL 


Dennis Allison Received: 78 Aug 11 

This trick using the Decimal Adjust instruction generates 
the ASCII character corresponding to the hex digit in register 
A. I first saw it in the Intel MDS monitor. Ken Burgett tells 
me it was due to Bill Byerley. Both are with the Intel software 
group. Assuming a number between 0 and 15 is in the A 
register, 


8080 

ACI 090H 
DAA 

ACI 040H 
DAA 


6800 

ADD A, #$90 
DAA 

ADC A, #$40 
DAA 


gives the characters 0 through 9 and A through F in ASCII. 
Just how it works is left as an exercise for the reader. 

16 BITS FROM CROMEMCO? 


Reports are that Cromemco would be developing a new 
CPU around Zilog’s new Z-8000 16 bit microprocessor which 
will be sampled this year. A call to Cromemco netted a sincere 
“no comment” with the additional remark that Cromemco 
was “looking to develop a family of compatible machines.” 
We’ll be watching. -TRW 


PUSHING 8080 REGISTERS 


Mike Gabrielson Received: 78 July 27 

It recently became necessary for me to devise reentrant sub¬ 
routines for pushing and pulling all registers on the 8080. The 
push routine turned out to be surprisingly difficult. Can your 
readers construct a more elegant version? 


1 

2 



Pusher - reentrant 

routine to push all registers * 


3 



Mike Gabrielson 

7/24/78 * 


5 

6 

0000 

E3 

’usher: XTHL 


jswap HL for return address 


7 

0001 

D5 

PUSH 

D 

;save D, E 


8 

0002 

C5 

PUSH 

B 

jsave B, C 


9 

0003 

F5 

PUSH 

PSW 

;save A, PSW 


10 

0004 

E5 

PUSH 

II 

;put return address on top of stack 

11 

0005 

210800 

LXI 

H, 8 

;get offset to stacked H, L 


12 

0008 

39 

DAD 

SP 

;HL :* address of stacked H, L 


13 

0009 

D5 

PUSH 

D 

;now we need DF, so save an extra 


14 

000A 

5E 

MOV 

E.M 

;E :■ stacked L 


15 

000B 

23 

IN X 

H 

;point to stacked H 


16 

000C 

56 

MOV 

D, M 

;D :■ stacked H 


17 

000D 

EB 

XCHG 


;restore HL 


18 

000E 

D1 

POP 

D 

{restore DE from extra copy 


19 

000F 

C9 

RET 




20 







21 



It's unlikely. 

but 

if the stack is situated so that it crosses 

22 



between 0 and 

FFFF, 

then the DAD instruction may destroy 

the 

23 



caller s carry 

bit. 

In that case, the following longer 

JUt 

24 



foolproof version is necessary: 


25 







26 



XTHL 




27 



PUSH 

D 



28 



PUSH 

B 



29 



PUSH 

PSW 



30 



PUSH 

H 



31 



PUSH 

PSW 

{save carry before DAD 


32 



LXI 

H, 10 

{now the offset's bigger, too 


33 



DAD 

SP 



34 



POP 

PSW 

{restore carry 


35 



PUSH 

D 



36 



MOV 

E, M 



37 



INX 

H 



38 



MUV 

D, M 



39 



XCHG 




40 



POP 

D 



41 



RET 




42 







4 3 







45 



Puller - reentrant 

routine to pop all registers * 


46 



pushed with Pusher * 


47 



Mike Gabrielson 

7/24/78 * 


48 







49 







50 

0010 

E3 Puller: XTHL 


{swap junk for return address 


51 

0011 

FI 

POP 

PSW 

{ignore junk 


52 

0012 

FI 

POP 

PSW 

.•restore A, PSW 


53 

0013 

Cl 

POP 

B 

.-restore B, C 


54 

0014 

D1 

POP 

D 

{restore D, E 


55 

0015 

E3 

XTHL 


.-restore H, L and stack return address 

56 

0016 

C9 

RET 





Number 29 


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


Page 3 

385 









LEDIP 

A KIM/6502 Text Editor 


BY KIUMI AKINGBEHIN 

Department of Mathematics 
Wayne State University 
Detroit, Ml 48202 

LEDIP (an acronym for Line EDItor Program) is a general 
purpose line-oriented text editor program for 6502-based 
systems. LEDIP can be used for such purposes as writing 
letters, preparing texts, and generating source programs. 

LEDIP is designed to be memory-efficient and easy to use. 
Residing in about IK bytes of memory, LEDIP uses an effici¬ 
ent data structure to minimize the memory occupied by the 
user’s text. LEDIP performs memory compressions and 
expansions as needed after each line of text is entered. Not a 
single byte of memory is wasted. In addition, LEDIP allows 
the user to select the location in memory where the text 
is stored. LEDIP’s small memory requirements make it ideal 
for memory conscious users. With LEDIP, a reasonable a- 
mount of text can be edited in a system with as small as 2K 
bytes of memory. 

Running LEDIP 

LEDIP Version K4 (assembly listing shown), runs on KIM 
systems with at least 1 .IK bytes of RAM starting at location 
2000 hex and going upwards. Since LEDIP is a text editor and 
not a memory editor (compare EDITHA/SWEETS, DDJ 
Vol.3, Issue 5, May 78), and I/O device such as a teletype is 
also needed. Readers with such a configuration may directly 
key in the object code and enter LEDIP thru location 2000 
hex using the G command. LEDIP should respond with the 
question, “STARTING ADDRESS?”. This is the cold entry 
point; warm entry point is at location 203C hex. Version K4 
with the changes indicated in parenthesis will also run on TIM/ 
DEMON systems. Readers who don’t feel like keying in a 
1.1K object code can obtain paper tape or KIM cassette of 
LEDIP from the 6502 Program Exchange, 2920 Moana, 
Reno, NV 89509. Include a $2.50 duplication/distribution 
fee. Versions of LEDIP for other 6502-based systems includ¬ 
ing VIM (Synertek’s new 6502-based SBC) are also available 
from The 6502 Program Exchange. JOLT users should note 
that the TEXT command supplies the rub-outs required by 
the JOLT resident assembler. 

Using LEDIP 

LEDIP starts by requesting a starting address for the text 
from you. Type a four-digit hexadecimal location. Your text 
will occupy this location and subsequent memory locations. 
Be sure to specify usable RAM. LEDIP uses 18 contiguous 
bytes near the top of page zero to store variables and constants 


pertaining to the text being edited. In addition, LEDIP resides 
in about IK bytes of memory. These locations should be re¬ 
served for LEDIP’s use and should not be used for any other 
purpose. The FILE command can be used to find out what 
these locations are. Once a valid starting address is given, 
LEDIP does some initialization and responds with the prompt 
character, a slash. A line number or command can now be typed. 

A line number can be any four-digit decimal number bet¬ 
ween 0000 and 9999. Leading zeroes must be included. If a 
line number is typed after the prompt character, LEDIP auto¬ 
matically goes into the edit mode, types a space, and waits for 
a line of text to be entered. A line can be of any length bet¬ 
ween 1 and 252 characters. Any upper or lower case ASCII 
character can be entered. Control codes and other special 
codes can also be entered. All control codes, with the ex¬ 
ception of the backspace (control H), are stored as received. 
A backspace deletes the last character entered. Carriage- 
returns are not allowed within a line. A carriage-return term¬ 
inates a line. Text lines are modified, replaced, deleted, or 
inserted using line numbers in a manner similar to BASIC. 
Note that this technique makes edit-mode commands like 
DELETE, REPLACE, INSERT, etc. unnecessary. 

To add a line of text, type a new line number and then type 
in the text. To insert a line of text between two existing lines 
of text, type a line number between the two current line num¬ 
bers and then enter the text. For instance, to enter a line of 
text between lines 0022 and 0029, type 0024 and then type 
the new text. LEDIP will do the memory shifting and mani¬ 
pulations necessary, and will insert the new line between the 
two current lines. To delete a line, type the line number and 
a carriage-return. To replace or modify a line, type the line 
number and then type the new text. To create a blank line, 
type the line number, at least one space, and then type a car¬ 
riage-return. 

If a command is typed after the prompt, LEDIP automati¬ 
cally goes into the command mode. LEDIP recognizes the 
following five commands: 

LIST — lists the entire text with line numbers 

TEXT — lists the entire text without line numbers 

FILE — states the block of memory currently occupied 
by the text 

EXIT — returns control to the system monitor program 
(if present) 

CLEAR — clears current workfile and requests location 
for new text 

The FILE command states three blocks of memory: a block 
of 18 bytes used by LEDIP on zero page, a block of memory 
occupied by LEDIP, and a block occupied by the user’s text. 
The LIST and TEXT commands can be terminated at any time 
by using the hardware interrupt or reset and re-entering 
LEDIP through the warm start. LEDIP should always be 


Page 4 

386 


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


Number 29 



entered through the warm start if the current text is to be 
preserved. The EXIT command leaves the monitor program 
counter pointing to the warm start; hence only a G need be 
typed in most cases to re-enter LEDIP. An accidental CLEAR 
initiation can be corrected by an interrupt and a jump to the 
warm start. 

LEDIP texts can be saved on tape in two formats for fu¬ 
ture use: an ASCII format and a hexadecimal format. To 
save a text in ASCII format, type TEXT, start the paper tape 
punch or cassette recorder, and then type a carriage return. 
ASCII formatted type cannot be reloaded into LEDIP for 
future editing. If future editing is desired, the text should 
be saved in hexadecimal format. To save a text in hexadeci¬ 
mal format, type FILE. LEDIP will define three memory 
blocks (e.g. 00D1-00E2, 2000-249D, 0100-01C4). Now type 
EXIT to return to your system monitor program. The monitor 
can now be used to save and reload the data contained in the 
first and third memory blocks. When loading your text thus, 
LEDIP should be entered through the warm start. 

LEDIP checks the validity of commands, line numbers, 
line lengths, and continually performs read-after-write verifi¬ 
cations. An error will result in one of the following error 
messages: 

M! nonexistent memory or memory overflow 
C! invalid command or line number 
H! improper hex number 
L! line too long 

In the case of invalid four-letter commands, LEDIP defaults 
and executes the command whose first letter matches that of 
the invalid command. 

A Brief Look Inside LEDIP 

In keeping with the objective of a memory-efficient text 
editor program, LEDIP uses a sequential linear list (conti¬ 
guous memory block) of variable length records to store the 
text. While a linked list or “table of line pointers” approach 
would have resulted in less code, it was decided that memory 
usage should be given priority over code reduction in the 
kind of environment in which LEDIP is likely to be used. 
The decision to use variable rather than fixed length records 
is based on the same consideration. Zero page locations STAD 
(starting address) always points to the top of the list and 
LOCC (location counter) always points to the bottom of the 
list. HEXBU (hexadecimal buffer) is invariably used to walk 
through the list. Each record (line of text) consists of three 
fields as shown in figure 1. LEDIP makes conservative use of 
the stack (page one) and only uses 18 bytes on page zero. 
These two pages are therefore largely available to the user. 


increasing address 


0 

N1 

N2 

§ 

§ 

§ 


0 


L — length of line (one byte) 

N1 — line number low order byte 
I\I2 — line number high order byte 
CCCC ... — ASCII characters (variable length) 

Figure 1: LEDIP data format. 


Since the text list contains no absolute addresses or links, 
LEDIP is essentially text-relocatable. In fact, the block 
memory move subroutines in LEDIP can be used to move the 
text around in memory. Only STAD and LOCC need be 
changed whenever the text is relocated. 

The other main consideration in writing LEDIP was to 
write an easy-to-use text editor. To achieve this goal, three 
decisions were made; viz. LEDIP shall be line oriented and 
not string oriented, line numbers shall be used for all edit- 
mode operations, non edit-mode commands and error mes¬ 
sages shall be kept to one easily remembered minimum. The 
apparent simplicity with which line numbers are used to edit 
text lines obscures the actual processes which go on inside 
LEDIP during edit operations. The flowchart (figure 2) gives 
a clearer picture of these operations and the routines which 
are invoked by each. This flowchchart is roughly the second 
level in a four level top-down flowchart development of 
LEDIP. 

LEDIP readily lends itself to modifications and extensions. 
Readers who wish to implement additional commands will 
find that the routines necessary for most additional commands 
(edit and non-edit) are already in the program. It should be 
noted that LEDIP does not use any command tables. Three 
NOP’s have been included in the command handler (CMHD) 
to facilitate this. These NOP’s will have to be replaced by an 
appropriate jump to the code extension. For instance, imple¬ 
menting a single line or line number range LIST only requires 
changing the contents of STAD and LOCC and then invoking 
the already existing LIST routines. LEDIP features several 
useful subroutines which are callable by other programs. These 
subroutines include block memory moves, ASCII conversion, 
hexadecimal and decimal character validation, save and restore 
register, and other routines. Zero page locations defined at 
the beginning of the program are used to pass parameters to 
and from these subroutines. 

Since the CRLF, SPACE, and type-a-byte subroutines are 
as easily accessible as the standard read-a-character and type¬ 
a-character subroutines in most resident operating (monitor) 
systems, LEDIP directly calls all five I/O subroutines. All 
I/O calls flow thru a series of jumps near the end of LEDIP. 
Hence only ten locations need be changed to implement 
LEDIP on systems with different I/O configurations. LEDIP 
saves and restores all registers during I/O calls. Readers writing 
their I/O subroutines should remember to include proper delay 
for the CRLF as may be required by the console device. 
Readers who wish to add pagination to LEDIP listings should 
note that one inch top and bottom margins on the standard 
teletype requires 12 blank lines after every 54 text lines. 

LEDIP does not feature a software BREAK test since 
the hardware interrupt or reset can be used to terminate 
LEDIP listings at any point. KIM users who wish to add 
a break text would have to poll the 6530 PI A data register 
at location 1740 hex. TIM users should poll location 6E02 
hex. Since all I/O operations flow thru the restore register 
(RESR) routine, a good place to insert the break test is at the 
end of the RESR routine. Three NOP’s have been included to 
facilitate this. In implementing a break test, care should be 
taken to restore the stack and to restore registers destroyed 
by the break routine. Since LEDIP preserves the syntax of 
the input text lines, readers who are interested in language 
translation will find LEDIP a useful basis for the development 
of an interactive compiling or interpreting language translator. 


Number 29 


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


Page 5 

387 




3 “ “ 


u.i ac 
H uj 
vo K- 

— z 

O D 

UJ O Z 

O 

v- a ui 

of uj cr 

-a ►- 
a u > 
u < a 
a ol a 

JL < |L 


-J t-gr 


UiOutc < a cor-sOir-vrmrsj — 
ocoooc.eaoooooc 

•»**»«f'«****’*‘*‘*‘*v**»**’ 

MHPNNHI'HNNNNNN 


X -J 

D D I _j I j a I jI Jl j 
CKOQuua u ro o o w i/i 
X X < ^ CJ o X UUJIU Z ZUJUJ 

inujht-DOujl cd cd uj uj o o 
I Ii^w j jK ui *- r ** *. • 





* « # 

* 

It •» 

* * 


z 

CJ 





O 






* • # 

« 

• « 


“ 





Z 






• • 


• 


f- 











« * 


* 


vo 





X 



VO 



« * 


* 


UJ 





UJ 



C> 



» « 


• 


3 

• 












• 


o 

UJ 

CJ 



z 








* 



CJ 





ac 


QC 


X 

« * 


* 


UJ 






UJ 


►— 


UJ 

« * 


* 


X 

> 

UJ 




K 


VO 



* # 


* 


H 

UJ 

X 



a 

O 

UJ 






* 



o 

X 



LL 


t- 

“ 







CJ 


►- 

U- 



ac 


“ 


O 

ft « 


« 


z 

UJ 


-J 


UJ 

< 


«_) 




VO 

* 


■<1 

-J 

at 



Kl 

X 


vo 


no 

1 # 

* 

♦ 



CD 


ft 


M 







U 

» 


UJ 

vo 


(X 


mJ 


X 



► 

• * 

_j 

« 

•-* 

CJ 

Z 

o © 



< 







* 

h- 


U 










ft • 

U 

• 

«J 

:* 

CJ 

ac 

UJ 



UJ 






u. 

* 

f— 

»- 



a. 



a. 


X 


at 

» « 


• 

tn 


UJ 

O v 


Z 

>- 


Q. 



« t 

UJ 

♦ 

t_> 

u 

X 

Z H 








» * 

Z 

• 

•» 

-J 

h- 










« • 


* 


a 











» » 


* 


o 

z 










* 1 

3 

» 

Z 


u 




>- 






• • 

U 



<* 








UJ 



* * 

at 

* 

u 


t 







►— 



* 1 



a 

vo 

e- 







< 



« » 

z 

« 


Ul 

VO 




v> 



ac 

i- 


* * 

•—• 

• 

ft- 

a 

to 







UJ 

UJ 


• « 

«J 

« 

O' 

► 

UJ 




o 

X 





« * 

> 

* 

»— 

V- 

a. 


u. 

u. 

UJ o 

<_> 

«* 



O 

* « 


* 



CJ 


-J 

—j 

UJ <J 

>- 



z o 

• « 


• 

Ul 

UJ 

o 


at 

OL 

U» »- 3 




O 

« « 


• 


Z 

< 


o 

o 

* vo O 


f- 

f- 

f\J 

• * 


• 

C 









a. 

a 

•» 

» • 


« 

—i 

►— 

o 

o a 

QC 




a a 

H 

• • 


• 

O 

3 

z 

J vo vo O O 

vo z 


• 

• 


* • 


• 

© 

3 

•— 

CJ 

-> 

—> 

3 —J 

-> “ 

CD 




• « 


» 


a 

»- 










« • 


• 

a 


at 










* * 


* 


m 

< 




m* 






« « 


* 

o 

“ 

h- 

c- 



b- 






« • 


• 

UJ 

X 

vo 




< 






* * * 

* 

* * 

mJ 

k- 

t 

*- 



K 






# * * 

• 

» * 




vo 



vo 














-r 

m 

-r 












no 

(\j 

<\j 

rg 












eg 

fVJ 

uj oj 


n- 











«# 

•r 

UJ QJ 

m 

u. 










00 O 

O C O' O oo o 










O «NJ 

rg 

< CD 

rg o 

o 


a 

ac o 


«* o 

Ot H 
< 4X 

X VI 
U K K 
UJ l_> 
— X UJ 


to to 
< UJ z 
or uj 
► O X 

O VO < 
U. h~ - 

O — ( 
vo Z 
uj < • : 


c UJ 
X -j 
f ►— —< 
ac < 
UMU 
O K 
<t VO vo 
to —■ 
to Q 
It J I 
X O 4 • 

CJ » UJ 

at o vo 
□ uj « 
* X • * 
a >- o a 
UJ Z UJ 
0 3 1 
• »- O H 
vo u. o 
ac o 

UJ uj vo Q 


UJ u u. 
CJ •— U- 
UJ > Z) 

a uj co 


Z uj — 
“—JO 
hOW 
3 to < 
O Z 
at CD uj 
O I 
VO fr- 
“ u 
X X Z 


O UJ 
<* QC 

ac •* 


a a - 

x — < z 

ujOI - 
X U' o 
-J o 

o o o 

— o “ o 

_J Z -j _J 


o z o 

UJ UJ “ < 

a a h- 

>- Z VO 
»- <t 

—J O 

_j vo u Z 


Z “ 

□ Z 

O “ 


o 'T «J x XK 3 _j _j J X X 

uo JC < u. O'^O-JXu.cdOOCDCjO 
4IhJl»-MKl-<JX<UX<U 
OOVOqc* Dl»D/>>aUJHDUJh' O 
aIci(u»a*Ouuulviji^j 

uai/>tt<tt<(xaaQC4t<44<<< 
VOVOOVOOVOOVOr VO|/IDHkOhh 
JO joooo Jinvuiflvi 


Ohj'MJ'ou.O 

OOOOOOO— 

oooooooo 

N(VJ NNN OJM (\J 


- rjr> f in ^ k mao-M’if ir< .o r*. cu a- c «\j m r> uo r» a> O' q — 

Nrgf\jpuC'j(\jwM(vjmrifnr'<fln(o«omr' < <r <j < <r >r <r 4 # in i/\ m o oinminoin^^) 


iNjni^irtJSajac- 1 


O n- © f\j E'J’tH'TOtDfvjOeDirujg <5 

f* 1 © —« »r >riM\iircu40ocot)D 

OOOOO'OO'Oooouoiriuoininin 

rvjf\jconj<f\j<<\j^r\jru<cocD<oocu 


rt in od < OU.N4N <QO<\j'T'Oao< 
jjHMjj(vjMi\jnjnjmrrir'immn 

ooooocooooooooooo 

f\j eg rg r\j rororgrgn.rgrg»sjrgr\jrgf\jr\j 


'•* m cuo'O-'njr'^K'-oNaiO'O 
•r^r>-r~p^r-fu.toaoeDOD(caoBucooDcocz- 



Page 6 

388 


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


Number 29 



















X UJ 
UJ OL 

X x 

a 
*- X 

UJ Cj 
to cj 


I UJ — 

x z 

Of —• UJ 

1 J > 

a. cj 

K l 

CO 00 
I < a 


uj i a 
to cj z 


> 

a 


3 


X 


3 X 
CD 

X UJ 
Uj QC 

x x 

a. 
h- x 
uj u 


* 

3 

Z 


X — — 


CJ 

u 


UJ QC 

z o 

— X 
h- t) 
3 

O I/O 

QC — 

1/0 

— 3 

I <r 
>- x 


< CJ -J -J cj 


O uj CJ 


Z UJ 
X Q- 
QC LJ 


z / 
u — 

CJ _J 


►- -J X ►- CM C/ »- 

I'll U I X _j I _j 

Xft -*UN K UJuUJ ~ 

UJ 1 «jZ_jOOC.ZQC>I 
Xo<-J<a«J— — 


x a. r j j < x cj x 
UJ* >t-UJ>> J|- 

□ woaaoi'i 

I J Jf X O X 


uaoai'iQ.oau>-<<aaoaa;aa. 
to t> uj to cj x uj co r ooj—uoooujc/o io i/i r 


u. X 

to u. 
z —• 
< o 
QC U 

J— X 


z a 

o uj 
CJ oc 


* * K « 

*“ •> _J 

-» -» -I 3 

CJ CJ K —< *oj UJ it ji r< (j OD fo ^ m as H 

CJ CJ CJ IO I O J «J X to _j X -o UX”>0”)»*|L< 
U UONxd-QOJ- CJ Ch Z 0-0 0 CDujOQO»>H- 
X CJ —j -J _j UJ X xZtoz_j—'XZxO_jIxXXOCDto 
U> » — — OXo-J — :* -J X CJ — — -J-J-JX X J 

< >- < a ujaaiuaaai'io.oaa.x^a.oviuaaa 
z to to z to x to cj x uj to x o o x UJ cj cj to to *: 
_jjtio<on“)(c*in*i«Diffi"»-ojjyeD 


“> -> -o o 


U. H Z 
I/O Z — 
z UJ «J 
< QC 
Of QC S 
►— 3 uj 
CJ z 
to 

— u u. 

n □ 
-j 

CJ X X 
af h- H 
k 0 15 

z z z 

O UJ uj 
CJ _J -J 


X * 

4 -J 

-J 3 45 

u a, a cd cj 

CJ X CD uo X IO JO 
□ UJ l > > > H O 
Cj j X uj CD CD CD to -a 

x<u<aiaaouj 

OOCDHt/OtOtOtOZ 
J J 1/1 1/1 "O *1 1 1 CD 


OOOOC cjUOcjOhitcOOOCOu 
(NjiNju-rucc -r u_ r\j -*■ <JercDf\jf\ju_C'jr\.(\j.r 


o- cj u. — >r oamuj-mrs x c u- *m in eo 
< x « ajicecaiCDajC'UC/uuuuQOO 
CC cjOOCJcjOOOcjOC ooc ooo 


rj fc 
CM cm 


mno 

INJ CM CM 


.notuicoffo cd uj <\j fs. cj 

rc < on uj o do cjo*co < 


* o f*- m 


r- o O' a <-#o>ocjcju..-. w^wu/wwi_»-r^» 

CJ O CJ Cj ad x < c m ^ C < q^ujOqo OO* 

u> O — —• OOOOOuOOuOOuNh^ o OC O O CJ 
< 4 0*0 ONM ON ♦ NIC <r U. IVJ 4 44UU.O)ffMM-f 

cDQu^f r i«r.0DcEOo# r 'Oajecoo< r '»C'r» (J ffi O u. N in 
C/OOuj uj u- ui hi uj u. u. u_ u- u-u. OOOO O © O O — 
O CjOOOOOC'OOOOOOO-i — r-« — — 
i\ji\if\jfvjM(\jiNjn,njM(\jnj(vjnjfvjfijnjMnj n <nj n (\j (vj m 


INJNNMN*'JI'J(\J('J 


,r '' 4Jr '~ cd cr © — fM no -r m « n ai a Oo-fvjm^-uo^n.aj cro*-'«Nim^»n^r*-coO' 0 «- im c >r m z> co cr cj 

^ — '• - " ,< «4"4^* , «*-*«x — «* — »4CMfMCM«MCMCMC\iCMCMCMfMCMCMCMCMCMCMCMCMCMCMCM ngcsjoor\jrvjrsjrof\j«\j 


to u. 

UJ •— P 

> U X 

- Q h X 

uj uj Z CJ 

Of CJ X ~ 

< UJ — LJ 
Of » CJ 
O UJ to 
X * © X O 
ha* - uj 

to UJ > h- oc 

h uj a or 

Q CJ Q UJ UJ 

Z x > u 

x oc uj Z to 
4 -J □ Z 
u X u o < 

CJ CJ to w QC 

O Z t 

_J J— CJ I 

a u 4 uj 

K X > to 

4 □ UJ CJ *~ 
X QC X X 
Ha *- to a 


•— to x 

CD UJ 

a x to 

3 uj 
v to a. 

QC to ► 

H < h- 


a Cj 
a x 
— to Ul QC 

o — a 3 


UJ to oc z 

h a uj < 

CJ UJ CD X 

X h- X * 

QC CJ 3 o 

< X Z CJ 

X a 

CJ x UJ U- 

X Z — 


a 

QC 

CD 


X _J X 

CD X ►> 
QC CJ CJ 


uj a j a 

h- UJ O Z 

cj 9- oc -a 
x 3 ►- T 
Of Z z 
< CJ o 
X UJ CJ Z 
CJ Of X 


i- 1 


UJ CJ CJ 
a < uj 

► UJ i 
h Of O 


io >r 3 

cj u. u. cj to * o I cr 

CJ J M ► < I CD I X X 

M X a #0 CJ c j I > UJ . 

« uc * CJ cx O x o cj I : 


CJ CJ 
CJ CJ 


u 

X 

c- 


o a ™ > x 

_l Z UJ —J 

x •_ x — 


CJ CJ 
CJ CJ 


cj u x- x — 


O x <3 or x a. ac of to a a x>-xq.oo- xv- < a uj u 
-j OhtoOtotOtOCjX toOQh-I UJXOZHXZtO 
CJ —J i/o —> —j •n-oaioijji/iuftoji-touoo -> 


— * 
-J X CD 
—J UJ CJ 
XI — 


o 

Ul 

z 


x uj uj cj 

UJ Of UJ | 


CJ h UJ Of 
to Z Z UJ 
< CD — U 
CJ -J to 

u z 

CD CJ U X • 
Z CJ Qf UJ 
UJ X J to 

zx~ 

— O h- to * 
^ UJ O — Qf 

a z uj 

X ► UJ J X 
I-lOh 

i/i oc a 

UJ to U H 
> — — Z UJ 

— a z 

ujt hu- 


UJ to Q; QC 

UJ O UJ 

Z X X H UJ 

•—tOQfCJh- 
h- to X X X 
j Jaf- 
X QC 

_ ui x a 

Of X CJ CD 

to CD h- or 

— Qf rc a 

x Qf □ ui a. 

»- uj ►— r. x 


a r 


h- CJ 
CJ x 
x a 

Qf to 

X * 

X CJ 
CJ X 
CD 


z 

o 


U 

a 


a a 

X of 

X UJ 
CJ Kl 


z X 

CJ 
h- UJ 
UJ X 
C9 CJ 


—• *VJ X- —I -J 

-X CJ CJ CJ C. iXh-CJCJC/CJ 

CJ CO to CJ to (J 1/1 U to U. Cj— CJXOtOCJCJCJ to CJ “> 

KOXCJ XCJ<CJX-J_lHf^'h-H-OXCJOLJ'rXCJ c. 
uj ^ > I M > X > X > oc • 3tC3W|f*XjjJ>I f.x 
0«au*QfoauQ'uiia«0J*au-»xa(j * -j 

QcaujxQ-OCJUJcjujcx x a xq; q Q-O >■ xo. ujqx q. uj 
toX Z Q* UJUJZZZtOQtOQtoX X UJOHX Z UJ o * z 
—> CJ CD JCJCDOIE'-'(OOJ“IJO*1CJ(CJIOCJ(CCCJ CJ CO 


IM h IM U. •rOUI^UJOOO*'I o- o - no ^ UJ 

oo** - I'Jlf'f'OCUuOC'DCjOhO 


& & * a 
cj o u in 


cr cd x r- cm m 
'foooeuoujp 


qd a m c> o fjccoocmc - — c o mcc - — oo 

OXQjrVJ X NNMD4N4X(JQa.^4UirOUW 

CJ o U — 'T 'OO'CJll.-i^MfiCCU.H'J^hO'OO 
m m r, ^ -r>r>f44if'ifMrinu'inif'^ci'0i)«<!0 
CJOCO cj cjcjccjoooooooooc OcjOO 

fMCVJfuCM CM C\JCMCMfMCMfMIMfMC\ifMr\JfVJC\Jf'JCMf\jCMfvj 


*r x- ^ o 

CM CM CM CM 

ocMcj'r—'TcjoxHOcroor- ■*' 

x - xifoCM IM'IOOOQQUUO CJ no 


ocrcni/o-oc-ooo (?Ol?OucrO'CHHOO , f' cro 

M CJ O XCJU-CJOUJOCMXCMXCMXCJUXO-OOUX CJ O 

Cioir>MJ(Dau.Hnna3<ou. NtfiMJCOiLtrJ inr~ 
r- h- h- Hr-Hr-HecaococoaDajajO'ao'O'ao-axx <x 
ooo cooooooo oooooooooooco o o 

fMCMCM CNJCMCMMCM<MCMfS| CMCMCMrMCMrMCMCMCMrMCMCMCM fM no 


riCMm-cui^hcoag^ Mnxici'thfluO'O - KPwirtMuacJHMpi4in«MrffO"i CMmx-ir»u»h-ooO'Cj*xcMc»o*r»n"OHajco — Nm<nncihCb(Jo 
OOOOOOOOOOCS OOOOOOOO — —I — — — — — iMNNfM(MNrjNMVJion(i.(OfOM(r. mmr>r4^^^4<h'r + ifMMfMniniiMfiir'ii'ii'0 


Number 29 


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


Page 7 

389 











< cj 

► 

U. < l 


j. r. (\j _j 
O n in 
ui > > Ui 
CD U O O 


— X _l U p 

Wl/iw Jl —• 
Z ID UJ u > > 
‘-DO ZOO 
‘-ill -l l 


<iaa <uui^u<Qiaa era 
►■ninCJujirouj»-v»wv) it> X 
i/nijwi/iirowT5*> —> —> 


► - >■ 
3 UJ 
o CJ 


17) —j 
— Cl 
X co 


uil D 
2 a -a 
»- cj ■ 


X O U. 
u UJ — 


— ox 


n -I 

3 < 
er > 

*-* — . 

l/l UJ z 

' <* X < ' 


z uj a uj 

<► nn 

-* Z ~ 
7-0 J 
a « u a 
3 a uj 

o o x 

ui* Zi¬ 
ff a < o 
• i a 

UJ < O h 

■ O mu 

C 4 UJ ff < 

j — x >- »~ 

a ff- ff-i/o 


—> u u 


* < j: : 
J o CJ 
j * * i i 


■ u< v u. u. Z ■ 


4 1/1 V) 

I — — 


—J o 
u z 
a < 
►- x 
Z X 
U CJ 

cj cj 


o ff- 

ff- U- X 

a uj 


x v- ff- ~ 


o o 

WU40 

K «/> ff- 

— 17) 17) 

4 ff UJ D 

3 UJ I UJ 

a. Z 
o. i/i a a 
Z O 3 
o 4 a K 

UJ ff * UJ 

Jl-iu* 


• </> — 
) U. CO 


-J X CO UJ o o o 

— UJ — _j z z z 

u. I- _J CJ <i «t •< 

ff- _» cj «: x x 
» » % « c a l 

Ot-DhOKCJOQO 
C/1 — CO*— l/^«—"1/1CJ CJ CJ 

UI/1U.(^U.I/1U« -ft « 


I*— U J H X J t /1 (j I 


CO H - X * — • 


O ft 

a x 

o ~ 


o x 
o 


~ ff- » 


— i/o UJ 


U UI o CJ 

> co cnj m 

z * r * 


i a* oaoaoacjaoa.aaa.QL 

J Z x UJ l LLl UJl UJ I uj CD O O X CO 
J 4 CJ CD CJ CD CJ CC CJ CT CJ cc z Z Z O 1 


O X z ff- 

O CJ UJ 4 
CJ »— CO ff- 
-UJ * Irt 
# o CJ CJ 

4 4<<o a. * ff a 
OXOIIXCOt/OX 
-ja-jaa*o“»3-o 


ix — x >- -j ► 

Uj 4 o CJ cuu.occ c.cn 

l/l UJ 4 h- _J _l «3 ff- «3 

Qt^ft-3 -aKDO-3 

u « u. □ u. U l/l D CO U 

a>><oe>-a.a<Qe<a. 

1/1 O O CO Z Z CO G CO C- CO 

i j jo-iruo jo 


OUl->rU)N(7'BDu.Mlfl a • CD 
4 4 CD CD CD CD CD CD CO a CJ CJ CJ CJ 


rvjrv.rvjrM<\j<sjevj(\jfsjf\jrsj(\j n n 


(\ju-u> fia)«J4 — uui^ri 
■J Cj *4 — 


Cj 4 cm u 

— rc M n 


CJ CO GO CJ 
Of ICO 


v' cr cr Dora on ccr o 4 44uDOajaio®uOOu 

4MUUUU.UUUUOUUJUJUJ4 INJ444«Cl#rM(SJ^ 
UlC«M ♦>0<U<UUJOIM4 «McauU-M<MH«(l CJU. 


OOOOOOC-QO 


IUU.ILUI 


•MrjfM/vrvjfvj»Njf\jfvjr«je\jf\jf\j»\jfNjf\j r\j<\jrj<\jp\jf\j<\ifsj rg pm 


ajir>r-«*oujc>< r| «f'oo< 

OOOOOO — — -4 — — 
rurvj«Mf\jf\jiNj<Mfv'»\jrsjr\. 
fMIMf'J»\j»NJCsjfUfSjf\jlMfVJ 


— fcim >riT.^jr^-ajCrO--iM ro>4»r 1 ,off-ajC2'0*~‘<\iff'W*r>>off-cuCT-CJ-« 


i m pn r'cifiMpipicif''. (cnr'fn(ii(40('.pi(npiniT'mn( 


immnnnrir po m m fn m < 


inU)N0UO , O-‘MW4lf''ONCUO , t 
ininirminoO'fl^-o .o *o -o mj «o ff- 
i ffi fo m pi co co pi co co p pi p pi co co co 


► O 
15 

z x 


O QC 
at uj 


co — 


O 3 
UJ CD 

22 


0 4 0 XX 

on 

cj O o z uj ; 

z < z uj o i 

_i — X X 2 

ff ff ff O 4 4 ' 

CO X CO J O J— ( 

OO 1 o _I n . 


j a c X 


_j a. cd 

n a - i 

O UJ -O UJ > > > 

MDjDUOOi 

j r <i i xx - 

» cj cj o < t» oe oc : 

1 CJ Z UJ ff- 1/1 co CO I 

I CD •- ffl l/l 1 -> O . 


• UQo 

i J 4 O 


ff CJ 1U 
X CJ O CJ >Z) 
uj CJ < CJ _J 
ff- -J —I —J < 


*3 X 
ff- > 

CO z 

3 ~ 


cj co cj 
I CD CJ UJ 

I co CD o 


CJ CJ 

_J o 
cj < 


4 0 0 0 1 
►- o Z UJ : 
l/i C — en ■ 


-j a z 

CJ QC — 
cr 3 j 


1 CJ ac 0 X 3 on i _i cj r 3 cr t— 

: o a Pen co cr cj —> co i/i_j~>i «<a.o< 

I CJ X > X UJ X UOUJOUJff— o> >>_jff- 

: j uj CJ iu o uj O J 4 o jon 4 DUOon 

’ — *- 1- X «. X •*- iX<X«j_jXXCOX 

[ CJ < QC < 440 xo 0004 ff 0 ffffao 0 
)BM/lQff-QjDOU ZUlff— COUJCOCOCOcoX 
i co i/i o u i 7 i _j cj —j 4 uj — cn in -o cd ~o “o ~o ~o ~o 


Z 17 ) 

— Z • CC 

—J <3 Z IT X 

— QC U ► > 

ff- — cj a 

ff- I- x x 

QC CO QC 

uj — uj ac er 

co co co co 

Z 3 Z -> -> 

— o — 


CC O CD 
X UJ x 
ui er u/ 
X » X 


UJ 


- UJ 


z z 
— o — 


ro po pi p pi 

CM (\J M N P: r\J 

CJ CD CJ ♦MP 11 D 41 M 4 -* 4 «V.P-I 
n «r po ooDDi/DMoaoff 1 


(3 17 l\J 4 
CJ Cj O CJ 


O pvj 

f\j a. 


WU44P104 
D D C O C d ff 


OQ<7<DQUJ<MCJ 

OOQCjujoOO 


C 12 4 INJOHOr^NffCDO 
D DO O UJ O -C C N o ^ UJ P’ 


oooicirnii'iffc^on'ooyooffi - _ _- - - 

— <®<aC 7 UJU. 0 DffJNl\J 4 P '4 U <D O -< O IU 12 UJ Iff 4 ^ 


cr o uj 
— ff cj o o 


< 0-0 ffnru'O-oooo 


oO^-moiniMrcoN—o ooiroovooco 

pi 4 ffl 1C O M 4 (C«3 — «343C7UluaOf\JU-fNJC\jrofSj«r 


UJ —« -4 ff 03 <3 OUJOM 4 4 j a' |D UI - PI 4 C (D < o Cl U H ff Iff ff < 
NfO( 4 PipiPIPlP 4444444 IT« *r> l/> Ifl IT in int^in.cO'O-O'O 

Po<MPvjf\jPc»Mf\j<\jporsj<\jf\jf\jM<MPoojfLjPsjrvjf\j rvro r\j rv ru i\j ro r. 


C UJ o IM 4 ^J 12 CDQu. O M 4 ^ ® < o u — 4 ff 4 o 

42-£ip-ff-ff*r^r-ff-ff*r^ajiu20Da.aia5CDcDCrc7'OO'C2' 

— — — — -4— ^4 — 

MWMffJNfVJIvjr'jPvjffjNNnjff.ffJivjffjffjpgnjffjfyjfNj 


fj pm fsj cm rsj 


-(\Jffi4KlCJff®C7C-Mffl4inilfftD(2V-l\Jfn4irajffO(20 -fyff1 '< , ' f 'O^ aj 0 , C3 - MP14in0N®C2C-(\Jffi4ll'iCffroC20-Mr'4lf'^ff®C2o 
Pif0PiPlPiP)P)PlPI4444444"P4 4lC'ifitf'HlU'i/llfl|QUMf\^)'0'0'C'0'C'0'<)-0Off'ffiff-^^ffff.^ff.ff(Bloaj0D®BBOE®(2(2(2(2(ff(20‘(2(J'(2 - O 
fsjPu^*r4rsjPuro«vjPuooruPur4PufvjiNjojPsjouPuruPuruf\jf\jroru«vjPvjru<>J«NJ^J^^J<NJ«vjiNiivj<vj^opvji\j04f^poPor4«Njr4r4c\jfNj»cf\jrurgiNjro<^PUP4roc\jr\ioocNjrL.p'um 


Page 8 

390 


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


Number 29 













* N 
» * 

* c 
0 

it 

• 

•* 

« 

* 







a 


















» * 


* 

* 







UJ 


















* » 


* 

« 



UJ 




k- 






k 












# » 

u 

* 

* 



X 




< 





u 

a 






U 






# * 

UJ 

* 

• 



k- 




ui 





-J 

k 




UJ 


CD 






* * 

Cj 

* 








a 

a 


u. 


a 


• 



k 


►- 




z 


* t 

uC 

* 

• 



IX 




o 





CJ 

UJ 

k 



k 






CJ 


* » 

O 

* 

■# 



3 

• 




3 


3 




cn 



CD 


UJ 






* # 


-* 

* 


UJ 


a 


cr 

u 



a 


<j 

• 

X 





k 




k- 


« * 

-I 

* 

« 


X 

k 

UJ 



•— 

X 


X 



O 

UJ 



a 


► 




<1 


* * 

■«» 

♦ 

* 


k- 

Z k 


X 


k 


k 


cn 

« 

X 











* * 

CJ 

* 

* 



UJ 

CJ 


k 

IX 





UJ 

k 


U 


CJ 








■* * 


* 

» 



» 

•u 






-t 


a 

m 

in 









-J 


• * 

k 

« 

* 


Q 

Z 

a 


* 






k 


M 



CD 


UJ 




CJ 


• * 

UJ 

* 

* 


O 

u 

< 






a 


k- 

O 










X 


• * 

CO 

# 

« 


*1 

CJ 

X 

• 

UJ 

UJ CJ 


LJ 



k 

o 

a 


* 


a 




UJ 


• # 

< 

* 

* 




CJ 

o 

a 

oc 

u 


u 


UJ 


< o 



a 


c 






* # 


* 

* 


UJ 



UJ 

«i 





cn 


—i 

k • UJ 



-j 




» 


UJ 


* * 

a 

« 

« 


Z 


X 

> 

a 

k 

in 


in 

X 


< 

cn cn > 

UI 




X 


I 


a 


* 

-j 

# 

« 



CJ 

UJ 

u 

ft 

in 

< 


< 

-j 

k 

3 

x a 

a 


k 


o 


a 


► 


# * 

< 

* 

* 


K- 

in X 

UJ 

t_» 

3 




CJ 

3 

O 

U j uj 

► 


UJ 


M 


X 


k- 


* • 


* 

* 


3 

<4 


cn 

CJ 

> 

a 


CD 


O 

UJ 

k cj cn 



in 


X 






• » 


* 

# 


O 



UJ 






k 

a 


UJ 











* • 


i 

« 


u. 

UJ 


OC 






o cn 

OC 

3 

3 m a 











* * 


» 

* 


cc 

I 

k 

a 






< X 

3 

<o 












* * 


» 

* 


3 

k 








k- UJ 

in 

X 

X 











# * 


# 

* 


cn 



V 






cn X 


UJ 

ui X k 











* * 

-j 

# 

* 



a uj 







w 

► 

X 

X k 











* * 

3 

* 

« 

_ 

k- 

k 


O 






a 

oc 


□ o 











* « 

C) 

* 

• 

i/i 



<1 

z 






k O 

k 

l/' 

k 03 Z 







o 




* N 

U- 

*• 

•« 

<i 

X 

in 

ft 

<1 






<4 

X 

k 

UJ <4 





I 


z 


X 

k- 

* » 


* 


—> 

UJ 





i/i 




k k 

UJ 

UJ 

cn a 



-j 

3 

X 3 


<4 

— 

CJ 

c 

* U 

in 

• 

« 

CD 


— 

LJ 

X 

< 

< 

u 


r- 

uj in 


in 

a x 

u 

u 

a 

CD 

CJ cc 




k- 

k- 

* * 

m 

* 

# 

< 

UJ 

cc 

k 


m 


CM 


<o 

in 

UJ 


k U- 

3 

-J 

< 

X 



3 

Ok 

3 

in 

* J 

Z 

* 

« 

w 

J 



a, 

•** 

a. 

k 



O 

-J 

a 

in » 



UJ 

k UJ 



* 


* 

* « 

— 

» 

-• 


a 

UJ 

a 

o 

» 

< 

«• 


« 

3 k 

a 

U 

3 k O 

CJ 

cj in 

I 

cn x 






» * 

K- 

• 

« 

m 


k- 

CJ 

UJ 






CD 


»». 

-> Z UJ 







UI 


a 

a 

0 * 

3 

# 


«t 

k- 

«J 

► - 

k 

u 

in i_j 

in 

cj in 

X k 

H 

O 

— ft- 

a 

U 

< 

<4 

< < 


X 

O 1/1 

i 

* » 

CJ 

* 

» 

M 

—i 


< 

o 

3 

CJ 

a 

k 

cr k 

UJ UJ 


z 

□ □ □ 

in 

in o 

k 




-J 


—> 

* * 

OC 

• 

* 

CC 

3 

a 


a 

CJ 

cd in 

a 

1/1 QC 

X cn 

<4 

k a a 

—> 

“5 

-j 

in 

-J c/i 

a 

UJ 




* * 

£E 

# 

• 


r 

a 

3 

k 







ft. 


k 











• • 

3 


« 

•— 


CJ 

ft 

in 






* 3 


UJ 

k k in 







< 




* * 

tn 

• 

• 

•— 

cn 

a 

3 uj 






U CD 

cn 

CJ 

Z Q£ UI 







a 




* a 


* 


V- 

•— 

a 

Cj 

o 

in 




in 

_! X 



— k o 



k 




ft. 




• » 


* 

» 

in 

X 

a 

CJ 






< 

a ui 

X 

* 

o z 

in 


in 




□ 




* « 

l * 

• 

# 


k- 


< 


•— 




•— 

CJ X 

k 

k 

a ui < 

X 


X 




CJ 



„ 

« * 

« < 


* 

„ . 


,, 

„ 

.a . 

eo 
« «t 




cr 

<i 

. 14 . 

« i* 

•» 




UJ 

X 




4 •* 


in 


14- 

O 


o 



m k uj 


z k 
O UJ 

U «/l 


Q- O 

W a 

CJ UJ 
CJ pu 


UJ • 

z c/ 

— CJ 
k CJ 
3 -J 

o 

(X LJ 
ec Z 
3 < 
in 

3 
c/i 0D 

— X 
X UJ 

►— x 


UJ 

in 

* o 

QC UJ 
UJ > 

x a- 

k UJ 
O cn 

UJ 

1/1 « 
— Q. 


UJ 1/1 
UJ 
UJ (J 

oc 

<4 «t 


UJ 

k 

ft- 

CD 

(X 

UJ 

CJ 

QC 

CJ 


UJ 

a 


CJ 

t_> 


a 

UJ 

o 

QC 

CJ 

X 

o 

X 


_i — T 
3 -J -j 3 x 

(C U I B U 

X <_> a x CJ 

UJ O X u CJ 

X _j cj I _i 


a uj < a c/i 
D * Z O ftT k 
JUCC JUft 


oc 

• «t 

a uj h 

UJ CJ Cl 1/1 

X <4 

k ■< in JL 

m a 
L 1 /UU 4 

a ~ ft * 

K 

UK tt UJ 

— a x 

« Of »— 

UJ U cl 

k - UJ □ 

CJ k 

< UJ « 

oc uj k- Cj • 

< in CJ uj o 

-> X Z z UJ 

X CJ U oc > 

UJ k u- j at 

*/> < ► UJ 

oc tn uj 1/1 

cj c/> * • QC ui 

— UJ U U QC 

> uj uj j a 

uj — x a u 

<n ujo x oc ► 

x CJ O I- 

uj uj o uj Z O 

to QC Z OX 

< C/1«J < 
Z. UJ — 

QC Z UI c. > 

3 — CJ U Z 

ft" k ~ -I < * 

UJ 3 > QC o 

Oc CD UJ cj CJ UI 

I OC O uj k 

uj cd «* a o 

O 3 Ui k QC 

< Iflj *kk 

— o a 1/1 

a c/> c/i c/i c/i uj 

QC — Z — O 

X O u 

CJ k- O — CJ -* 


z 

OL 

3 
k 
a uj 
uj oc 
k l 

O UJ 

«J CO 

QC X 


I QC 
CJ OC 


UI CJ 



CJ 

UJ 1/1 
QC — 


X Z 

CJ CJ UJ 

k C- <n 
UJ V* OC 
O » CJ 

oc a o 

CO * UJ 
1 u cc 


CO 

QC 

CJ 


'T e 
M fc 


a o o 

< N «f 


tr o cr o cr o 

CJ CD UJ O UI -o 


O O Kim IT lf> o 
(VI M < 03 < a) « 


in «iO«i mo 

< UQ< U4J 


o a o 
<m 0 u 


C UJ H 

00 CO O' 

<\J (NJ l\ 

ro f\j cm 


•T eco 

ir a cj- a ao 

ru cm cm re fsj r\j 
M MM M MM 


UJ - ^ CO «J (j 

a- «j < -a *t < «i 
M MM M M M M 
M MM M M M M 


Q U_ —• rr iTv k~ 
< 4 a CO B) CO 
M MM M MM 
fM MMM MM 


CO CC Q 
CO c cr 

f\J f\J fSJ 
CM CM CM 


-> m r -r in .£> p- 

•r >r ♦ «r ♦ ♦ <r 
^ *r ♦ 4 


!C O u "* M f 
^ <r ui inir in 

♦ -r * *■'*■>» 


^ IQ i) N OO O 
IQ |Q IQ IQ IQ |Q 

-r -r ^ 


Cj »h M m ^ tQ 

•o •£) •&>•£> *0 4: 

■* -ft «r *r «r 


•AJ fM O) a Or- 
O vO k k 

>r «r <r < ^ 


M O) -f |Q i) M 

r» k r<- k r- 

•r -r «r ♦ >r ♦ 


ajoo-Mn<iQ^Na)Ou-"Mr 

kMDCDOJCDcoaiajocDmoooO' 


>riQOkWO‘OHM 

000000000 


M*IQ^)kCDOO 
OOOOOOO — 

IQIQIQIQIQIQIQQ 


X 

3 

U 


X X >- _l k k 
CJ CJ CD CJ CO <3 
I k CJ k CJ k k 
- 3 □ 3 O 3 IO 


QC Ui < 
Cj CO _J 


UJ 3 
Z □ 
— I 


UJ c /1 J h- U- < l/l li. u I k 
COX UX-Jk«Jk kCJX 
a J I uiac</>a«A3Xui 
UUUkU JO* O-k 

U- oc a uj qc a. ac < ac at a. 
COCOCOZcoX in O in in ft 


oc cc 
U X 
U. UJ 


t < -4 

k 


a. a 
► ► 
► k 


3 k- 3 k 

ID V CD >■ UJ CJ CD H 

X CD X CC cj CO X k- 

UJk- UJ k < <X 0 CO 

ft UJ t CJ Ml 3 X 3 UQ.Z — 

O 2 UUI «»0 • U WO « j 

acaacok<cLk<oCQcaQca 

lOCOCOUJQOCOUJOCOIOlOloX 

TIICEJJ-IOJITI’II 


Z k _J 
UJ CO X O 
to X a. ft 


3 c/> - 
CJ z t 

QC o C 
CJ 

*• I 

QC UI C 

k- X * 

z k- : 


UJ CJ I — 
J k- 
a * uj 
— ft o _i 
k s k ~ 


— X o u 


X X k 

U Cj >—* CJ <1 

-I Xk- CM k k 

QC • 3 ¥* 3 CO 

U * G * CJ J 

<*ja<Q'<oca. 
—1 _J to o c/1 o 10 x 


1 Z <1 — 


UJ Z 

O 0 

< CJ 


oc co 
CJ z 
QC < 

ac OC 


CO CJ 

UI z* 

Q. «* 


-I O k 
a - 3 
Cj » 3 


10 C/> QC 

— z < 

IGk 

k- CJ 10 


-r -r «» o 

CM CM CM C\J 


CM CM CM 
MMM 


>r o CM 
CM CM CM 


cn cm 

CM CM CM 


CM CM CM 
CM CM CM 


>f *r «r cm co c\j 

CM C\J CM CM CM CM 


*♦ ■+ < O -C * 

CM CM CM CM CM CM 


Q -f < >0 O OCJ 
CM ir> CJ X) CJ CO 


bui UOM U <CU- « UIQ 

cc cr < cj «r u- k iq mm 


-r o co cm o <0 

<J < (J O G) <t) 


o O ^ U -f 
O'CIQU. CM in 


M Q -c - C U CM CO ■f’ 

^ IQ M IQ Cli <» -f IQ 


O O IQ O IQ C O 
< CM < CM < CM «C 


oooooojoo-ooo 

MMMOM-CM<MM'C 


o 0000 — Oao — OOO O c_> 

CM CM CM U CC CM CC CD CM CM <M CM «*■ 


BCDOOOOOU 00-0 

4JOM«tM<M-t M < M 


O U CM >*■ k O OJ 
—> ^-1 M CM CM M CM 
CM CM CM CM CM CM CM 
CM CM CM CM CM CM CM 


it cm iq od < o 0 co in cd cc 

CMCOfOCOCC'CO^^ 'C 

CMCMIMCMCMCMCMCMCMCMCM 
CM CM CMCMCMCMCMCVJCMCMCM 


UJ-.CkO'BOO-BiJffuLI. 
♦ IQiQiniQlQlQ^J^^^^ X) •£ 
CM CM CM CM CM CM CM CM CM CM CM CM CM CM 
CM CM CM CM M CNJ M MM CM CM C\J CM CM 


Mn^kauiu- 

kkkk-kk-ka> 

cmcmcmcmcmcmcmcm 

CMCMfMCMCMCMCMCM 


CMT 

an 01 co 

CM CM CM 
CM CM CM 


— CM 

k* r» 

CO CO 


if m 4 J 
k- £ £ 


k 03 O' 

k> 

cn n fc, 


CJ — CM 
CD 00 00 
cn cn cn 


m u> 

00 co 00 


•C k (D O' O 
QD 00 CO CD O' 
cn cn cn cn cn 


— cm cn in 
O' o O O O' 
cn co m co co 


Ok 03 o-o — 
OlMkOOC 
(ci cn cn co >r -c 


CMCO'T IQ -O k OD O' O — kJ 

ooooooco — — — 


cn-cmokooO'O* - cm pi -r iq 4 k cd o- u ■* cm pi >r iq 

— H»i»<^«CrMMriiNCMCMCMCMM(MCMC*lP1(nmfnr, 

^ >r >r >r >r 


<ikojoo 
co cn co cn 

-f ♦ -» «r 'K 


Number 29 


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


Page 9 

391 

















Ui tu fr- 

oj a z 

CO < UJ 

O — • 
*— ae to 
uj at 
to U. UJ 
Jtf u fr- 

o 3u 
uj cd < 
X o' 
o — < 
*- x 
u-' cj uj 

Z CO 


ae •— 
O u. x 
u. — a 


- » o 

a < 

ft UJ t/l 

—j — 

► UJ 

OC O 

► CO < 

Z •- _l 
UJ u. 

O I 
• < t_> 
-4 _J 

it u. • 
X | o 
uj cj z 


3 C 
0 3 — 
ae ar uj 

cu UJ UJ 

3 to CD 
to <t 

at 

V U. u 
ar O 
fr- -i 
Z to < 
UJ fr- * 

Z — 
UJ UJ u . 
_J »- UJ 

a z o 
— o -« 

fr— UJ X I 


H Q fr- *- _j 


to < u_ 
— V 

X CO 

k o — 
t_» o 

UJ ae 
I CO UJ 


U-* cc xr^it— X<*Ox x 

u uj <_> X'TI-TXrnirox uj 

X C. ^^DtiV‘Ut»U(J*U^U x 

*0»*<«Q«UJ*UJ%UjI»UJ o 

► a ►x<^OB.trta.(/)^(/)M/H)(oxiu(/t 

O * O O Q O UJ * UJ » t_> » UlUJhUJZU 

j u hmj a uff uaucr uao ea 


• z — 

j—o»h- 

i a uj z uj « 
■ a o — to < 


*r — oj 

^ i x 


u 3 • 

C_J 3 a: O 

CD X UJ 
CO x UJ > 
f~ Uj I QC 
Z X UJ 

UJ Z CO 
— UJ 

z <o ae 
O a a 
uj O UJ 


x o z « 
»- uj < o 

fr- UJ 
co Z UJ ae 
O X < 
UQH uj 
< a. _j 
co o 


C- K h •> 
O UJ UJ 

a U o ► 

CD -J Z O 

3 «* ar 

CO >- fr- 
ar 3 co 
co O co UJ 

— Il x o 
X uj uj 
fr- T- X < 


O CC 
Z X 


fr- u 
< ~ 
o 

< ae 
a o 
u ae 
ac ae 
a. uj 


_j _i -< x cv 

3 3 ® 3 UJ 

cc CD X cc _j 

x x uj x o 

uj uj z uj z 

X x — x — 


QU O 

z uj _J 

— o 

-1 c. 

at — ►- 


o 

< 

a 

o 


fr- o >- o is 


UJ CO z Z I 


UJ — — 


X<UJ<J<UJUJOC0 

OOjCkUZujh 
—i— juj<coco — cd at 


3 < ( 
o o 
ae O t 


—J J U i. u » 
U U> J U J I 
U tJ U tJ CJ > 

o o z o z z 


x<t_jc_><ujt_»ujato 

oo-io^-ozz*-*- 

_J _J UJ < CO CD — CD -5 O' 


u uj o uj o to < < >r o m »r> 

uocjooocj>ro<c;r , cjc , 'CJ uj 

oooootooocroo'oaocT'O if o < oo 

< >r <<0(ju.uautcutroff —-o uj~o o 


ro'uuJu^-J'CaxuiuyN^CMCOtt 

OOCOrJ«rt-^r‘^-MNM(MMM CM f\J 

mcnmcnrornr-rocomr- n (o m cn (o co co con 
f\jrjf\jf\jf\jr\jc\jf\jc\jf'jf\. f\jr\jf\jf\jrjr\jf\j cm fM 


o ujo«- n ion a cc 
Mrofomitimcopir 
focoforopnr-rorofo 
f\J CM csj cvj cm cm cm cm im 


uuJo^r'iof'CMiuj 
m c. 4 # ^ ^ -j- >f ^ ♦ 
co m n co jr, n r< w n 




\ o r» oo cfr O cm cd < tr* -v 

•-- - r «# «e *e 

)>o -o-o « 


• ae 

ae uj 


< < a. at co 

J Jl tflh 

ft u oo a 


► > 

z — 

o 3 


— X 
uj uj 

CO x 


3 fr¬ 
ee co 
X U 
uj o 
X 


ac fr- 

UJ 

CO x 


3 - 
O UJ ' 
ix to I 


CO CO 
— UJ I 
I CO 

fr- < 


UJ < 
fr 

u> to 
X X < < 
uj uj at — 
O O < CD 
Z Z I 
— — o x 

fr- fr- » o’ 
uj uj uj a 
to to o < 


3 to 
cc < 

<w> — 

C\j < to CD 


: *t < < < <X < fr- << fr- X UJ 

i»- x<a. _j_j_j_j<x<oruJUJ< x >- uj co 
OCOtOIOCOtOtOfr- LU O to _J Q fr- UJUlZfr— 
-j _j _j -o < < <1 < wo JO u <ioq otfa 


X o 
or z 


K Z 
— 3 
CD 
ae uj 
a 

i z 

uj CJ 


cd Uj • 

3 u> c_> o 
co o c_> Z 

-j a < 

UJ _J 

z x X 
— o z 

»- at — % 

3 U O 


co ae » CD 
3 uj to ae 


— O UJ 

I ui X 


uj fr- 
o CJ 

a < 


fr- ® 
uj 3 
O to 


-J tx —< — i 

(JftUUU 
o r u j (j 
OujUuD 

_J fr- -J O _i 

Uj < UJ < to UJ CO 
UJOCDfr-OUJfr— 
co j co co cc o at 


co 

< i 
C_> 
Cl 

U. _J 

o ® 
o < 


X — UJ 
fr-Z flt J 

— uj uj 

co u. 

UJ o LL X 
a Hi D 
fr Z (L •> 

fr- — o 

<XUJ 


<- fr UJ 


3 3 to 

CJ to CD UI 

at at x CD 

CD UJ UJ 

3 fr- X ► 
to UJ 

< V CJ 

to ae cn 2 
— < < 
X X O 
fr- UJ fr- < 


X CJ 

Cl 

K 


X < z 

UJ at u 

o < fr- ae — 
z i — o 


to o fr- CO <_> 


X UJ X CO u. 

UJ fr- UJ < -J 

n X 3 o x a a 

** — a * - a u 

fr-<atfr-<xaujaco 
OCcoXfr-OX Zcofr- 
-I -IO - h JU co -> ue 


CJ CJ 
to to 
< < 
a- a 
D c 


o r 
< — 

X CJ 
UI UJ 

x o 


tr oo tJ“ dj <* 
o o o o a 


OMif'C«<<j<ir<inOajir'0'<(nCu 

< <cD<veJOOCJOoujeD<\J**'00 , tjaoau; 


ft. 0--r fr 

CD CJ CJ O CJ 

cm fu rsj cm ro 

CM f\J CM CM CM 


cu <ouj— fMcn>j-ir\fr' od«x q ujo ^ ^ir»K 
UUUUaOODDOCD o o iu UJ UJ Uj ui 
CSJ<MtMr\J«MtMfM«MCUCM fMfrofSjCMf\Jf\JCM*M«M 
(Njr\J«MfNJfMf\JrofMfVJfMfMCUr\.rvJ(MCMf\JtMfM 


CD a CD o U_ — fD 
uj uj Uj uj uj u. u 
M f\J CM CM CM <M CM 
f\J CM fVJ fVJ CM fM CM 


»r so oo co uj Cj u. — f' - 
uuu-uuuuoCO 

CM CM CM CM (M (M CM (O (r. CO 
M M M M M M IM OJfMCM 


h t\j rn ^ uo^ofr- coCfro •-*<Mr'rtr>>D'r~. ao- o — CM r ■•■^•cfr-aJtro , - , fMr-'-rcr«ofr-cDCruJ- - <MP r i<'tr'-or^oJO-C5--CMri^-ir'U)fr*cua'0'^rMf»i>#-uo^3fr“aja 


irvir<ir>ir\ir>tnir>inu>io 1 


Page 10 

392 


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


Number 29 











o 


UUJO V) 
ZZUJh- 
Mfiec (i 


o co i/> af at _j jpi x _j 
•f uj uj u.i » o u a a wa w i 

UJOOI’IC z Z > z lli uj » uj : 

l r * x _i u z uj^uiOuj c. *-< o o o t 

« - . v < i. iu |l • i i i » * i » i ; 

v <<auiaou<o<wuu<u<wui 
o o ►— S Zi/iiuujoir»-uujuiOa:»>uuji 


J-xx-j-j CJ — X — 

UOUUO u M O M 

yujzuiu o > z > 

Ob ujDcd O-iOUJO 

J( UK •« E t 1 


JWW JlrtO J* 


• — M 

I *- MQ 

> > Z 

) Z — C_J UJ 

— » X E 

j < < a. c/ <_> to <_> 

’ j J X UJ CD U 111 

} a. a. n i/i to ff d 


CO IT\ f*» O' 
cr- a- cr tr¬ 
ee co co co 
co co co co 


O i*’ «*•< OU o O' •-« ro r\j >r ■« h ■* u. m cd 

c o u a cj o cjocco o oqcjcjg 

C h — p- C (J O ® u' U 1C C OCDicau , 'OOCO 

<auroONu.f><uiaJBu(n<ujV8iui7'< 

<UUJO* v '<M? < u uj c m ^ ia c ic o u. »< 

Craff<<i<<<<<<QjirttcEa a: cr c « u 

fncomfc mmpifnP'(rii , 'ncifnc'i*immfnnir 1 
r> cororv cof\jf\jcocof\jcoco cococo cj cj m r. cocj 


^ O < y in O y O' < IC Cvi — co-r 

OOOOO (90000 ^ o o o 

(Cu>icmicc0fvj«<O ooo)®oiraoj3 

<CDCD<cw<cy uj o -o ^ ^ m uj cd u 

ffffOu-Hen^^cD 4 uuju.C^^£(d 
OOOOOOQOOOOOOLUUJUJUJUJ 
rofooio'ifocoroccfo cneoeocnfococnroro 
COCOCOCOCJCOCOCJCJ CJCoCOCOCOCOCJCoCO 


c ® a o —< co c •ric^K-ajyc.-c-ci'Ctf'XJcioyoHMp -r IC XJ t- <u ff tf - w rw 
-*•■**■' cococo cocococococjco ro co m rc ft -r o ^ « tc ic ic ic ic 


to >o r- oo o 0'-»cofn'Tu>^)f^ooo-o-«cjrr, ^ tc .o r- wo'0 ,, "* r ' J<T), ** f ''0 
lCiClCiAiA<O<O4)^)4}<O>O^4)4}f>>NSNNC-^h-f k -NID <D C0 < U(DC0(n 

c~r^r-c*r^r^c-r^c-r^r*r>-h.r^r-f*.r^C'f^r>r»r^r»r“^-r^r^Nr'C*r^r>- 


» •— uj m 
Z — • 
I O •- Q 
Z _J H- UJ 

D — > 
I U at at 

u UJ I/O UJ 
i X to 
i on O uj 
a 

• I u a. 


< 3 

U DO CO ► 

•“• — 1 X 
h- UJ O 

Z O X Z 
UJ <1 < 

O _J z 
— u — -t 


_J 3 — CO 

u a> jt y 
O X X X 
CJ UJ o o 
CM J X Z Z 


>- < u cj o «/> v <a w 
OOF u uj h uj o » ►— 
jjOBBaojua 


< a o (f>- 
O J uj ►- I 
j ub a . 


-J -J O i x 

O O F o O 

Z UJ o Z UJ 

UJ CD Z UJ CO 

IKUJIX 

< a uj < a (a 

OF Z O F h- 

jub jua 


) < X o 

z o 

■ — —• I/O 

• K X uj • 

J w O O 

UJ Cj F UJ 
J O H- > 

O a 

► WZ Ul 

j a w 

: o uj uj 

■ i at o a 

uj o uj U- 

) I Ol 
— < F X 


o «o to •*:* j c x j -j 

UJ UJ UJ E.UJFOE O I/O x 
acoo—<» X O uj > uj uj > 
OFF F _JZ u Z B CJ B D □ 

XujFFFFF 

► <<uoaaouujuu'u 
O Q »- I UJ X CO uj Z Z Z z z 
JJl/)UBOOtL«CC->-.CC 


m y O m •* o* o 

OOOoO o o 

C-^COOBr'-u 

<Bomi«aiBQ£ 


( r )lA-/p-f r lMuO‘ACO^jH'lJ 
O D U C) O > >0 w* CJ O O O UJ 

O - - - C U O O X) o x> >o o 

< en O' o u. ■*■ co u. uj o uj uj o 


u. -* ci in h- y «x b u u. 
^u>if'i/>iAicir'UAicir> 
fr m m fn m n n (n in m 
co cj co cj r\J cj Co co co cj 


O Co >E -O h» O' 00 
>0 -O -O >C -O O -£> 

CO CO fr\ pn (T CI CD 
CJ fv CO Co CO CJ CJ 


UUI O M •T O 

»o .o r- h- r- c- 

C1 CO to fO CO fr) 
CO CJ <C Co CO CO 


haBOitH-rMTicQuc 

r-r^c-r^r-cocoaju/oooaooo' 

COfOCOCnCOCOfOCOCOfOCOCTiCO 

COCJCOCoCJCJCjCOCOCOCOCOCO 


f^ajOC'^c^c^>ru^4JC-(ijoo^c^ro^iCvor^auO'Or-cocn>ric<)r-cuO'0^‘Cjco>ru>^)r-CDO'X:»-coco^-if>'Or-ooO'C^«--*cofO'T»f'^5f^auoo-<coco>riC'0 
■jccif'iriAifiiAir'iAif'ir'iA^i'O^iic^^^^'O^c^.f'^-ccsfW'C^BoajeocDffioBBoyyytj'yyyyo'O'O'JOOPOOOoo - — «'•* 

'0'0'0'0'G'B'0'0'G'*J'0'0-li'0-G’CO'V'0'G-0'D'0-0^'iJ'0-0'{)-0-0'0'0'0'G'0&'0-0'0-0*)'0'0'0^'0'0-G'00-0'GT* , T*"t^T*‘T*-t , ~l*-T*‘T*‘1‘*T*-f , -r^1 , + T^T , *r- 


Number 29 


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


Page 11 











o 

ID 


♦ * * 
• * # 


V- Qt K £* Q t 

U l_) O (_) l-J 

<1 u. «a U- ui u. 

(t a u 

< O' < •£> <i h 

x uj x o a h- 

U N U W 1/1 m 

^ r*- r- 

<* m < v- 


►- — ' 

ah- >- co 

t/> m tr rv 


O Uj Ul (D 

«t i/i at/i 

u 3 ► 3 

aw t— — 


LD UJ ID UJ | 

a t/i a i/i i 

>-3 v 3 i 


< x >- co 
* h- h- 

i/i t/i c > O' 


a n a a u\ a a «5aacraocnooi/i 
>Oii/i>ujc/i>uji/i>uj(/i> uj uj 2 uj 
<1 —« ID <1 — iun — CCUJO 

aaaaaaucaaaaaaa-flxv- a a a. t/> 

l/l ui I l/l } t/1 l/i X tfl ui X t/i l/1 o Q O CD O O h- 


ttCJU. - 

m m m •$■ 

*r ^ -r >r 
eg f\i f\i r\j 


ecu. uiroucDouffluiuiEiDinr —• 
m f\j uj r. in o r < ^jpiaujricicjou 

OOoOOoOCoOOoOOm®-*- < < < c 

4 LD ID UJ o 

MH4)cuJH>f^<c)0(f l ujauujc inj jtw in 
'h'h •*>*>» inintnmm>o®*J-0*0'*)h- h-h-h*h- 
'T-T <r 4 « <r ^ ^ ^ ^ 

Nf\JI\MV|MMfVJM(\!(\JMr M MMfSJ fVJ (\| N IM (\J 


f f '^g , iu0'th | f f >u.0^Q0C)0 < iCN0Q'h 
ir«fui^M^iMjimi«^iNjfnoo © o m m fg m 

'0«)<uuJOM'»oa)<uui"iMP, 'nrhO'io 
hhhhhCDflOOJCDOOff iDCOaa'O-O'O'O'CyO' 
•r ^ 4 ♦ ♦ -I ^ -e <r « ^ 4 

rurgrorgfgfSjrgrgfvjrvjrMrgrgrgrgfsjrorgrsjiNjfV 


a; cr O — m m m.cr-coo«o^rNjcgf\jf\jrjrgfvjr\jrgmmmm>r.e -e *■ in m m m ® 
©«©©©©© ®©®u)(u©a)©uj(D©aj©aj©®uj©iucoco ®®®®®®®®®®cD®®®®®®®®®®a>®®®®<r>cu® 


‘ -L -l X . 

> O — O o < 

Ul —* Uj CJ . 

) CD J CT □ | 

*- < » _i 3 


I MXJ 

- moo 

• >22 

I mt O UJ UI 

I * l * W 

O © CO <_> ■< l 

I UJ CD U UJ h I 

I 1/1 1/1 (D Q t /1 C 


UJ <1 <x . 

X C> < 

-J CO . 


nj o 

♦ ♦ > © 

o a 

o o o X -J 

O O © 

a o o a < 

_J _J _l CO o 


X uon i -j 

co o © m co •- co 

UJ O U > LLi — UJ 

O O CJ _j CD O _j O 

i « -J w t X <L 

**x©<©©©o<co 
i-D j oau z uj c- h- 
ui _mj «,i<icd—• ® t/> a. 


X QC < X UJ 
Ol/ll- UJ Z 
jOI/lQfll 


® uj o mm 

«i r > > 

o a 

> •• •* •••*»-* 


cd >0 CJ 004 o Nr < hir m ru ^ m 

OOCJ ooc oucjooo o o o o 


S 5 C) c 


Ou-w-m>» - ®®<xt_jujonj'*'«Oh-<2®Ou. 
UJ UJ u u. u. U- u u u. u OOOoOOCOO 
mmmr 

rMruMtvjMiNjMMMNMrurvjcjrcMNMivj 


(TijUJCnjminr^crccou 
X«*J —ifgrgcvjfsjcv. pg eg eg rg 

^ i\ifvjfvjf\jfvj«\jcgf\jf\jf\j 


© f\j in h- ® 
m m m m m 
*f -r -e -c 

rj ro fu Mm 


h©0'C-Nfn-etfi<jh©ao- < »'j»0'«’©oN©0'OHNn^©^)r.Eao-<M»o^jfioMD(j.Q^fy< , ’’rif'< ) h®0'0- < M* , '’Cif'^hB0'C‘P<N©g’ino 
® <d co a- ^tf'ffaao‘»atf'ooooot>oooo-»i^H*i»i»j^Huwhj(\jNMN(\jNfyjN©j*im' , 'i r i f| ' , '* , 'h©'C'» ■+ '©<#•** * -e •rmmmmmmm 
h-r^h-h-r^^h-h-r-h^h-h-r*®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®® 50 ® 00 ®®®®®®®®®®®®®®®®®®® 


Page 12 


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


Number 29 










QUICK AND DIRTY FUNCTIONS 

FOR BASIC 


BY DENNIS ALLISON 

169 Spruce Ave. 

Menlo Park, CA 94025 

Recently, Gene Wallis called my attention to the fact that a 
number of BASIC interpreters for the hobbyist are not provid¬ 
ed with a full complement of intrinsic functions. He was work¬ 
ing on an energy utilization program and needed sine/cosine, 
log, and power functions badly. These programs are quick and 
dirty implementations which I did to give him a tool to get his 
job done. 

A word of warning though. These are quick and dirty in the 
sense that they have not been carefully tuned or tested. They 
may well contain errors. Certainly the choice of approxima¬ 
tion may not be optimal. All the functions are computed by 
using various range reducing formulae and then applying a 
polynomial or rational approximation from Hart’s Computer 
Approximations (Wiley, 1968), an encyclopedic compendium 
of approximations which is now out of print. The approxima¬ 


tions given in the algorithm section are all accurate to better 
than seven digits, but the programs should be trusted to only 
six digits or so because of truncation of the coefficients, 
carelessness of implementation, and the vagaries of local float¬ 
ing point arithmetic. 

The programs are also given in BASIC. They have been 
tested using the dialect of BASIC supported by the Unix time¬ 
sharing system. The Unix BASIC differs substantially from 
most hobby BASICS, so the test programs were transliterated 
into something more generally acceptable. Beware—errors may 
have crept into the code. 

Lastly, if you do use the programs, considerable efficiency 
can be gained by tuning the code to your particular BASIC. 
In writing the functions we chose the simplest possible code 
rather than the most efficient. A little rewriting may speed 
the functions enormously. All these functions are to be 
invoked via gosubs; they expect an argument in x and return 
a value iny. xO,xl, x2 ,... are used as temporaries. 


Square Root —SQR(x) 


1. x < 0 is an error 

2. reduce range 
t= 1 

jx =x/100; t = t * 10 | untilx<l 
note: x * t * t = original number 
0<x< 1 

3. make a guess at Jx via a polynomial (accuracy is 
.56 digits): 

y 0 =.115442 + 1.15442 * x 

4. iterate until ly n + 1 — y n \ < 10~ 6 (or so —depends 
upon floating point accuracy) using: 



5. final answer is: 


J'n + i * { 

You don’t really have to do the test in 4. as the iteration will 
double the accuracy (approx) every time. So: 


iteration 

0 

1 

2 

3 

should be enough -> 4 
certainly enough -> 5 


accuracy (digits) 
0.5 
1 
2 
4 
8 

16 


500 

rein 

y = 

sqrt 

(x) 

510 

if 

x<0 then 

goto <error> 

520 

xl 

= 1 


55e 

if 

X <=1 

the 

n goto 570 

540 

x = 

X/100 

550 

xl 

= xl 

* 10 


550 

got 

o 530 



570 

y = 

.115 

442 

+ 1.15442*x 

580 

x2 

= 5 



590 

y = 

e.5* 

(y + ( 

x/y ) ) 

600 

x2 

= x2 

- l 


eie 

if 

x2>e 

then 

goto 590 

62e 

y = 

y*x 1 



ezz 

ret 

urn 




Number 29 


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


Page 13 

395 






Log Base 10 


1. x < 0 is an error 1 

2. x < 1 then j sign = — 1 x = —telse sign = 1 

' x 

3. reduce range, find n such that 


since log (-^) = — log(x) 


— <— < 1 
10 io« 1 

and SCt * = 

4. s=/l0 x 

5. z = (s — 1) / (s + 1) 




P(z 2 ) 




G(z 2 ) 



6. lgt = 

(n + r — 

.5) * sign 

^0 

3.1878 

22082 

024 

Px 

-2.6558 

08794 

66 

P2 

.26686 

32700 

47 

Qo 

3.6701 

15625 

115 

Q i 

-4.2809 

73292 

83 

Q2 

1.0 




rem y = log(x) base 10 

x <= 0 then goto <error> 

= 1 

x < 1 then xl = -1 
x < 1 then x = 1/x 

e 

< 1 then goto 600 
x = x/10 
5e0 x2 = x2 + 1 
590 goto 660 

x = 3.162278*x 
x = (x -»1) / (x—1) 
y = x*x 

x3=3 .187822+y*(-2.655809+y*0.2668633) 
640 x4=3.670116+y*(-4.280973+y) 

650 y = (x2 + x*x3/x4 -.S)*xl 
660 return 


500 
510 If 
520 xl 
530 If 
540 if 
550 x2 
560 If 
570 


600 

eie 

620 

630 


Power lO* 

1. alarms if x too large positively 
return zero if large negatively 

2. if x < 0 | inv = true , x = I x I } 
e l se | j nv = false | 

reduce range to [ 0, x /i\ 

n = int (x) 
x = x — n - .5 

_ 2x P(x 2 ) 

Z Q(x 2 )-xP(x 2 ) 

result = /TO 10 w (z + l) 
if (inv) => result = 1 / result 

P 0 69.5569663167251 
P t 8.7517567967368 

Q 0 60.4164133787158 
Qi 34.2951432306918 
Qi 1 


5e0 

rem 

y 

= 

10'x 


510 

xl 


0 



520 

if 

j 

< 0 

then xl = 

1 

530 

if 

X 

< 0 

then x = - 

X 

540 

x2 

= 

int 

(x) 


550 

x = 

X 

- 

n - .5 


560 

y = 

X 

* 

X 


570 

x3 

= 

es. 

55697-*y*8.751758 

5e0 

x4 

= 

60. 

41641+y*(34 

.29514+y) 

5S0 

y = 

( 

2*y 

*x2 )/(x4-y* 

x3) 

600 

if 

i2 

= 

0 then goto 

640 

610 

y = 

y 

* 

10 


620 

i2 

* 

x2 

- 1 


630 

got 

0 

eee 



640 

if 

xl 

= 

1 then y = 

i/y 

650 

retur 

n 




Page 14 

396 


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


Number 29 





Inverse Trig 

1. If x < 0 return —atan(lx l) 
since atan ( —x ) = — atan(x) 

2. If x > 1 return ~ - atanf—) 

2 x ’ 

n 1 

since atan (I x I) = — — atan (yjy) and x > 0 

3. compute atan (x) in [0, tan-?-= 1] 
by: 


Z = X* X 


atan(x) = 


P 0 +Pi z + P 2 z 2 _ 

Go +GiZ + Q2Z 2 +Gs ^ 3 


P 0 80.78998484078 
Pi 72.5814378046 
P 2 11.11774163116 


£00 rem y = atan(x) 

510 xl = 1 

520 if x < 0 then xl = -1 

530 if x < 0 then x = -x 

540 x2 = 0 

550 if x > 1 then x2 = 1 

560 if x > 1 then x = 1/x 

570 y = x*i 

580 x3=80.78£9£+y*(72.56144+y*ll.11774) 

£90 x4=80.?£999+y*(99.£1128+y*(28.13286+y)) 
600 y = y*x3/x4 

610 if x2 = 1 then y = 1.5707963 - y 
620 y = y*xl 
630 return 


Go 80.78998647615 
Qi 99.5112677199 
<2 2 28.13285868067 

Qi 1.0 


Trig Functions 


Sine: Compute as cosine using: 


sin (x) = cos (j 


*) 


Cosine: 1. test arg too large 

\x I > 10 d ' 3 , d= # of digits in floating point 
then error 

2. x = lx I since cos(-x) = cos(x) 

3. x = mod(x, 2 7r) since 

cos ( 27T + x) = cos x. Range is now 
0 < X < 2 7T 

4. 0 < x < -y: s = +1 x=x 


7r 

— < X < 7T : s = — 1 

3 7T 

n < x < ~ 2 ~: s = — 1 
< x < 2 ir:s = +1 


x = Iw — x I 
x = 17T — x I 
x = lx — 27T I 


5. z = x 2 

y = P 0 +P x z +P 2 z 2 +P 3 z 3 +P 4 Z* 
cos = y * s. 


500 

rem 

y 

= sin(x) 




£10 

x = 

l. 

£70796 - 

X 



£20 

rem 

CO 

s (x ) 




530 

if 

X < 

0 then i 

= 

-x 


£40 

if 

X > 

1000 then goto 

<error> 

550 

x = 

X 

- int(x/6 

.283185)*6.283185 

£60 

x 2 

= i 

n t(x/1 .5707963) 


570 

x2 

= 1 





£60 

if 

xl 

= 1 then 

x2 

= - 

1 

590 

if 

xl 

= 2 then 

x2 

= - 

1 

600 

if 

xl 

= 1 then 

x = 

2 

141£93 - x 

610 

if 

xl 

= 2 then 

X = 

2 

141593 - x 

620 

if 

xl 

= 3 then 

X = 

X 

- 6.283185 

630 

xl 

= X 

*x 




640 

y=e 

.9999999+xl* 

(-. 

49£9991+xl*(.04166359+xl*( 


-0. 

001 

365370+xl 

*(0 

,e000231£393) ))) 

650 

y = 

y 

* x2 




660 

ret 

urn 






P 0 .999999953464 
Pi -.499999053455 
P 2 .0416635846769 
P 3 -.0013853704264 
/> 4 .00002315393167 


Number 29 


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


Page 15 

397 




THE DIGICAST™ PROJECT: 

AN IMMEDIATELY VIABLE BROADCAST-BASED 
INFORMATION UTILITY FOR THE GENERAL PUBLIC 


BY JIM C. WARREN, JR. 

345 Swett Road 
Woodside, CA 94062 


This is the abstract of a talk being given before the 2nd 
Rocky Mountain Symposium on Microcomputers in Pingree 
Park, Colorado, August 27-29, 1978. 

Computers have been consumer products since 1975. 
Individuals involved in the consumer computer industry 
estimate that there are 50,000-200,000 general-purpose 
digital computers installed in peoples’ homes. Thus far, these 
have been exciting, educational, challenging toys— 
to the extent that they have been used for non-commercial, 
non-tax-deductable purposes. Their primary use as a 
consumer product has been in non-arithmetic or minimal- 
computation applications. One difference between their being 
an exciting toy, and making them into an obviously useful 
consumer product, of value to the general public, is the ability 
to attach them to large data-bases of interest and use to the 
general public. The Digicast Project proposes to provide one of 
the first such “attachments” for personal computers. 

The single database facility most widely used by the general 
public is unquestionably the newspaper and newscast. The 
newspaper provides a large, though certainly limited, data¬ 
base with updating. The newscast provides a much more lim¬ 
ited, similar database, with much faster delivery. In both cases, 
the database is available to the public only in a human- 
readable form, requiring manual scanning. The newscast has 
the additional undesirable limitation that it must be monitored 
in its entirety by a human listener or viewer, and must be 
monitored at explicit times. The Digicast Project proposes to 
provide most of the utility of the newspaper; provide much 
more content than is economically feasible using newsprint; 
provide the speed of access of a newscast; and provide the 
data in machine-readable form so that the consumer may use 
an arbitrarily “intelligent” intellectual assistant-the home 
computer-in scanning of the incoming data. This will be 
accomplished at a cost that is acceptable in the consumer 
marketplace, using well-known, established, reliable techno¬ 
logy. The Digicast Project hopes to have at least one facility 
operational by the end of 1978. 


The Project proposes to transmit digitally-encoded alpha¬ 
numeric information on FM subcarriers. By the laws of 
physics, every FM broadcast facility has at least two such sub¬ 
carriers that are usable within the laws of the FCC—the Fed¬ 
eral Communication Commission. It has already been proven 
in commercial broadcasting environments that such transmis¬ 
sions can be reliably conducted at 4800 baud, and some of the 
engineers involved have indicated that they are certain that 
trivial hardware modifications could double that transmission 
rate. SCI Systems, Inc., 8600 S. Memorial Pkwy., Huntsville, 
AL 35802, has a printer that includes a receiver for an FM 
digital broadcast using a proprietary encoding scheme 
developed by SCI engineers in cooperation with personnel 
from Digital Broadcasting Corp. of McLean, VA. The FCC 
has already adopted all of the necessary policies to allow such 
utilization of SCA’s—Subcarrier Authorizations. Only straight¬ 
forward administrative approval is required in order for any 
licensed FM station to begin transmission. The hardware 
modifications at the transmitter cost well under $10,000. 
The receivers— exclusive of the receiving computer—are 
obviously producible for $50-$100. Both transmitter and 
receiver software can range from quite simple to arbitrarily 
complex. The most simple software can make the system 
extremely useful. 

The scenarios for utilization are also arbitrarily varied: 
International, national, and regional news—all of it—can be 
made as accessible to the general public as it now is only to 
newsroom editors and reporters. It is delivered to newspapers 
and broadcasters by wire services, already in machine-readable 
form. Little additional effort is necessary to inject that data 
into the transmitter computer for “Digicasting.” The con¬ 
sumer, interested in specified topics, need only instruct the 
receving computer to monitor the local Digicast(s), and save 
all articles containing specified keywords. Note that the 
keywords need not appear in a “headline;” they may be any¬ 
where in the article, and will still be noted and the article 
saved. 

Perhaps one of the most useful services that a Digicast can 


398 


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


Number 29 





offer is in the area of “want ads.” If one desires a Honda for 
under $3,000, then one instructs the Digicast receiver in the 
obvious manner. There is no need to waste time scanning 
uninteresting want ads. There is also no need to classify the 
ads—a boon to those selling a variety of unrelated items. 

Stock and commodities transactions can be Digicast, 
requiring little or no rekeying upon their receipt from the 
wire service. Further, if they are in fixed format, then it would 
be a simple matter for the receiving computer to feed the data 
to a stock analysis program, again requiring no rekeying. 

The system must be financially viable if it is to be a wide¬ 
spread and useful information utility. It is reasonable to be¬ 
lieve that it is financially viable. Consider the income sources 
of a newspaper or commercial broadcast—commercial adver¬ 
tising, classified advertising, and subscriptions. Classified adver¬ 
tising, sans classification, can be conducted without change 
from the past as far as payment is concerned, and with vastly 
greater utility. The counterpart of commercial advertising can 
be continued in a manner quite analogous to its traditional 
form. It can be “forced” on the consumer by injecting it in 
the beginnings of articles. Subscriptions can be implemented 
through encryption of the data being transmitted and sale of 
monthly decoding keys that need only be typed in to the re¬ 
ceiving computer. One subscriber paying for the key and giving 
it to several others is no more of a problem than one sub¬ 
scriber to a newspaper giving his copy to someone else. 

This abstract provides only the most brief glimpse of 
digital broadcasting and its potential utility and impact for the 
society at large. Most of the details of the Digicast Project will 
be published in the Intelligent Machine Journal, a biweekly 
newspaper oriented to low-cost computing power, edited 
and published by the author. The Journal carries discussion of 
the design alternatives of the Digicast hardware, software, 
systems, and protocols, and publishes Digicast standards as 
they are adopted. Discussion, suggestions, and general dialogue 
concerning the design of digital broadcasting systems is solici¬ 
ted for publication and distribution in this periodical. Most of 
the information is thereby explicitly placed in the public 
domain. Only explicit hardware designs will be proprietary, 
protected by the traditional patent process, and the names— 
Digicast and Digicasting-are proprietary and protected by 
trade mark. Additionally, explicit transmitter system designs 
will undoubtedly be protected by their creators via trade 
secret methods. 

There are a multitude of FM stations. There are a multi¬ 
tude of interesting and useful applications of the proposed 
systems design. There is room enough for all. Let us stand on 
each others’ shoulders; not on each others’ toes. * 

* almost-direct quote of Dennis Allison in Dr. Dobb's Journal, 
January, 1976. 

/Vote: Subscriptions to the Intelligent Machine Journal are $18/year 
to U.S. addresses, and may be directed to 345 Swett Rd., Woodside, 
CA 94062. The author of this paper, the Director of the Digicast Pro¬ 
ject, will publish all public-domain information regarding the Project 
in the Journal. Personal requests for explicit information will be 
answered with information about the Journal, due to limited time and 
funds. Correspondence offering suggestions may be published. Corres¬ 
pondence offering experience-based assistance or cooperation is, un¬ 
fortunately, the only kind that may evoke a personal reply. Please 
include day and evening telephone numbers in this latter form of com¬ 
munication. 


CUTTING STENCILS WITH A DIABLO PRINTER 


Dear Dr. Dobb’s, Received: 78 July 7 

These routines allow you to use a Diablo printer to cut an 
ordinary office stencil, a problem with many small systems 
printers because the printer head has so little mass, as 
opposed to ordinary office typewriters. We used no film in 
front of the stencil, and inserted the typing plate behind the 
stencil. We then programmed the computer in the system to 
output the text to the printer as per the attached program 
routines. 

The routine CUTSTEN.LIN just types each line 4 times. 
This is adequate to cut through the stencil for most letters. 
The routine CUTSTEN.CHR does better, though; it types 
heavy characters like H or M more times than light characters 
like i or 1. 

Most computers which allow programming of output 
routines should be similarly adaptable. Many word processing 
systems will likely require such modification, because the 
impact printers used (like the Diablo) commonly strike fast 
but not heavy. Our system is a Cromemco Z-2, and the printer 
is made by Data Terminals & Communications (San Jose), 
using a Diablo Hy-Term print mechanism. The routines are 
written in Sheppardson Basic, operating under Cromemco’s 
CDOS. 

Sincerely yours, 495 3rd Ave. 

Richard French San Francisco, CA 94118 


» t 72, RIB30N OFF?" 
PLATE, IN POSITION?" : @ 


00 @ : CUTSTEN: TYPES OUT EDIT FILES ONTO STENCIL @ 

05 REM- VERSION CUTSTEN.LIN: CUTS STENCIL LINE AT A TIME, USING 4 PASSES. 

10 DIM F$(13) ,A$(79) 

20 SETT 0,-1 : REM- DISABLES PAGE-WIDTH CHECKING. 

30 REM 

40 PRINTER ON LINE & RESET?" 

50 PITCH = 10, WHEEL = 

_60 STENCIL BACKED BY PLmt, n 
170 INPUT-TEXT FILE NAME ? ",F$ 

180 REM 

190 OPEN\l\FS : REM- OPEN ASCII DISC FILE ON CHANNEL 1. 

200 OPEN\4\"$T5" : REM- OPEN DIA3L0 DRIVER CN CHAWEL 4. 

210 QUT%0050%,%0084% : REM- SET BAUD*300 ON TUART (I/O BOARD). 

220 REM 

230 ON ESC GOTO 350 

240 REM- IF USER WANTS ESCAPE CO CLOSE FILES. 

250 REM _ 

(13) ;ASiCHR$ (13) ;A$;CHRS (13) ;A$ 

!60 


260 INI 
280 eyr 
330 03TC 
340 REM 
350 CLOSE : @ : END 


100 3 : CUTSTEN: TYPES EDITED ASCII FILE INTO STENCIL ::::::" : @ 

110 REM- VERSION CUTSTEN.CHR: CUTS ONE CHARACTER AT A TIME, SEVERAL PASSES. 
120 IMODE : REM- ALL VARIABLES ARE INTEGERS. 

130 DIM F$ (13) .AS (79) ,C$(0) 

140 INTEGER T(127) 

150 SET 0,-1 : REM- DISABLES PAGE-WIDTH CHECKING. 

160 REM 

170 0"PRINTER ON LINE & RESET?" 

180 PITCH « 10. PLOT = ON?" 

190 §"WHEEL = f72. RIBBON OFF?" 

200 STENCIL BACKED BY PLATE, IN POSITION?" : @ 

210 INPUT-TEXT FILE NAME ? ",F$ 

220 REM 

230 OPEN\l\FS : REM- OPEN ASCII DISC FILE ON CHANNEL 1. 

240 OPEN\4\"ST5" : REM- OPEN DIABLO DRIVER ON CHAMvIEL 4. 

250 QUT%0050%.%0084% : REM- SET BAUD*300 ON TUART (I/O BOARD). 

260 3\4\CHR$(6) : REM- ENTER PLOT MODE. (NO AUTO ADVANCE AFTER CHAR PRINT.) 
270 REM 

280 ON ESC GOTO 580 

290 REM- IF USER WANTS ESCAPE GD CLOSE FILES. 

300 REM 
310 MAT T=1 

320 DATA 3,3,8,9,5,5,2,3,3,4 
330 DATA 3,3,2,2,2,8,4,5,4,9 
340 DATA 5,6,4,9,9,5,5,2,3,2 
350 DATA 4,6,8.9.5.8,8.7,10,10 
360 DATA 4,6,10.5.12.10,7,7,10,8 
370 DATA 8,7,8,7,11,9.5.5.3.3 
380 DATA 3,1,2,3,5,7,5,9,5,6 
390 DATA 9,7,4,5,8,4,9,5,5,10 
400 DATA 8,3,6,4,5,5,8,6,6,4 
410 DATA 3,3.3,3 
42u FOR Z=33 TO 126 

430 READ D : T(Z)=D : REM- LOAD TABLE WITH DATA. 

440 NEXT Z 
450 REM 

460 INPUT\1\AS : REM- GET ASCII LINE FROM DISC FILE. 

470 FOR X=0 TO(L£N(A$)-1) 

480 C$=A$(X,X) : REM- SELECT CHARACTER. 

49U N=T(ASC(C$)) : REM- OBTAIN PARALLEL NUMBER FROM TA3LE. 

500 FOR Y*1 TO N 

510 0\4\C$; : REM- PRINT CHARACTER N TIMES. 

520 JCXT Y 

530 @\4\CH t$ (6) ;CHR$ (32) ;CHR$ (6); : REM- PLOT OFF, ONE SPACE, PLOT CN. 

540 NEXT X 

550 9\4\CHRS (6) ;CHR$ (13) ;CHR$ (10) ;CHR$ (6) : REM- PLOT OFF, CR & LF, PLOT CN. 
560 GOTO 460 
570 REM 

580 £\4^CH R $j 7 ) : REM- TORN PLOT OFF (REGARDLESS OF PREVIOUS CN/OFF STATUS). 


Number 29 


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


Page 17 

399 











POW:An 8080 
'Processor of Words' 


BY HERMAN WATSON 

P.0. Box 341401 
Coral Gables, FL 33134 

Note: Normally we would have typeset the text of this 
article, but we reproduce it here as we received it as an exam¬ 
ple of what this program can do. A sample of the “Edit" 
or upper case Input File is given for comparison.-TRW 


....row_ 


POW is a program that is a "Processor Of Words" for 
the 8080 computer. POW most closely resembles a program 
called PRINTER written by Clyde Roby. POW has the ability 
to set margins, tabs, spacing, justification, and indention 
and in addition provides automatic centering, and automatic 
paging with titles and numbering. 

This program works on an existing file that has been 
prepared with some type of editor and saved on a mass 
storage device. I am currently using a modified version of 
F. J. Oreeb's editor that was published in DDJ June/July 
1976, along with Peripheral Vision's floppy disc operating 
system. POW has in the past been used with cassette tape, 
and by substituting the cassette I/O routines for the FDOS 
I/O routines, it can easily be converted back. 

Commands are freely inserted into the source text when 
it is prepared. POW will react to those commands when it 
encounters them while printing out the file. Commands all 
consist of the same format which is a colon immediately 
followed by a two letter command name, then a delimiter 
with optional data for the command, and/or a terminator. 
Delimiters are either a comma, or a space, and a terminator 
can be either a comma a space, a carriage return, or 
nothing. This allows maxinum freedom from rigid command 
syntax. A sample of the command format is shown by the 
definition of margins: 

:DM,10,70 

In addition to the list of commands, POW also has the 
ability to allow the use of an upper and lower case printer 
with an upper case only input file. This is accomplished 
by using special characters representing a single 
capitalization, a Shift-Lock, and a Down-Shift. These 
special characters are an ASCII Shift-N and an ASCII 
Shift-L . One single Shift-N character is used for single 
capitalization, and two consecutive Shift-N characters are 
used for Shift-Lock. POW begins in the upper case mode and 
will remain in it until either a single shift character or 


THIS IS 1 Hfc “Eli 1T '* VERS I Uri UF THE MLt US EH FUR 
PPEPRRING THE INSTRUCTIONS. THIS IS THE TYPE DF FILE 
THRT IS INPUT TO PDW FOP PROCESSINC. 


:PT.10*5:PH*IDrO 
:TM,48, "POW.. 

: JT 
5PG 

i CM* ^_POW_\ 

>LFV3 

: BP * "'PDW' IS R PPOGPRM THRT IS R “^PPOCESSOR ~UF 'WOP 
FOP THE 8080 COMPUTER. 

- PULI' MUSI CLOSELY 

PESEHBLES R PPOGPRM CRLLED ^PRINTER' WRITTEN 

BY '"CLYDE ROBY. POW' HRS THE RBILITY 

TO SET MRP6INS* TRBS* SPACING* JUST IF 1CRT ION* HMD 

INDENTION RND IN RDDITION PROVIDES 

HUTCJMRTTC CENTERING* RND RUTOMRTIC PHGING WITH 

TITLES RND NUMBERING. 

:BP« THIS PPOGPRM WORKS ON RN EXISTING FILE THRT 
HRS BEEN PREPRRED WITH SOME TYPE OF EDITOR 
RND SRVED ON R MRSS STORRGE DEVICE. I RM CURRENTLY 
USING R MODIFIED VERSION OF - S F. \J. GREEK'S 
EDITOR THRT WRS PUBLISHED IN "'"‘DDJ J'UNE/"JULY 
1976* RLONG WITH PEPIPHERRL ''VISION S FLOPPY DISC 
OPEPRTING SYSTEM. 

^POW' HRS IN THE PRST BEEN USED WITH CRSSETTE 
TRPE* RND BY SUBSTITUTING THE CRSSETTE ''' I -O' 

ROUTINES FOR THE ^FDOS I'O' ROUTINES, IT 
CRN ERSILY BE CONVERTED BRCK. 

: BP, COMMRNDS RPE FREELY INSERTED INTO THE SOURCE 
TEXT WHEN IT IS PPEPRRED. ""POW' WILL 
PERCT TO THOSE COMMRNDS WHEN IT ENCOUNTERS THEM 
WHILE PRINTING DUT THE FILE. 

"COMMRNDS RLL CONSIST OF THE SRME FOPMRT WHICH IS 
R COLON IMMEDIRTELY FOLLOWED BY R TWO LETTER 
COMMRND NRME* THEN R DELIMITER WITH OPTIONRL 
DRTR FOP THE COMMRND, RND'- OR R TEPMINRTOR. 

DELIMITERS RRE EITHER R COMMR* OR R SPRCE* 

RND R TERMINRTOR CRN BE EITHER R COMMR R SPRCE, R 
CRRPIRGE RETURN, OR NOTHING. THIS RLLOWS NRXIMUM 
FREEDOM FROM PI6ID COMMRND SYNTRX. R SRMPLE 

OF THE COMMRND FORMRT IS SHOWN BY THE DEFINITION OF 
MRRGINS::LF*1 
:CM, s^DMn* 10,70 

:BP,^IN RDDITION TO THE LIST OF COMMRNDS, "POW' RLSO 
HRS THE RBILITY TO RLLOW THE USE OF RN UPPER RND 


a Down-Shift character is encountered. An input file 
containing both upper and lower case ASCII can be processed 
without modification in the default mode (Upper Case). 
Case modifications are only done automatically once the 
Upper Case mode lias been exited. 


Page 18 

400 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 29 











The singlo shift command (Shift-N) will automatically 
capitalize only the character that immediately follows the 
command. For example, " pow" would be printed as "Pow". 
The Shift-Lock command locks the carriage up, until the 
Shift-Down command is given, so for example, " pow " would 
become "PON", Capitalization commands work in all areas of 
POW. Page title capitalization uses the existing 
capitalization mode, but will not change the present mode 
if capitalization is specified in the title. This means 
that when a new page begins with the case set in the lower 
case mode, even if a Shift-Lock command occurs in the 
title, once the printing of the title is over and the text 
is resumed, the lower case mode will be restored. 

PROGRAM STRUCTURE 

Pow starts with a greeting message containing 
instructions, and then goes to the "MAIN:" area to get a 
command from the console. The "L"-Load command reads all of 
the input file into memory and returns to the "MAIN" area. 
Wien the "P"-Print command is given, control is transferred 
to the principal loop of the program, starting at "PRIN:". 
"PRIN" then gets a character from memory and checks to see 
if it is the beginning of a command. If it is, control is 
passed to the area called "CMND:" and the command table 
"CTAB:" is searched for a match. If a match is found, then 
a subroutine call is done to the command routine with a 
return to "PRIN". 

If the character is not the beginning of a command, it 
is then checked to see if it is a capitalization command. 
If it is, the routine "CAPRt" handles the case processing. 
The carry is set on return from "CAPR" to indicate whether 
the present character is to be ignored or not. 

If the character-is not a capitalization command, it 
is then checked to see if it is a Shift-K. This character 
is used to indicate that the character immediately 
following the Shift-K is to be output without any 
processing. 

"PRIN" then checks to see if the justification is on 
or off. The routine "UFMT:" is used when there is no 
justification, and the routine "TMAT:" is used for both 
left and total justification. 

The routine "urMT" will output the text as specified 
in the input file, honoring all carriage returns as the end 
of the line. It will in addition force a carriage return 
if the text tries to go past the right margin. 

The routine "FMAT" outputs text either left justified 
(against the left margin, with as many words on the line as 
possible) or total justified with spaces filled. Total 
justification begins as left justification, and then 
randomly begins filling with spaces until the line is 
completely filled between the left and right margins. 

In either the left or total justification mode, all 
carriage returns are converted to a space, and the 
carriage returns that get printed are computed by POW. 

It should be noted that POW ignores line feed 
characters, and will work with a text file that either 
contains them or not. If vertical spacing between lines is 
needed, it should be specified with the :LF command, and 
not with multiple line feeds or carriage returns. 

There are three areas where the text is taken from 
memory and used in the program. The main one is at "PRIN" 
itself, and the other two are for the page titles and the 
centering commands. All output goes through "OBUF" except 
page titles. The printing of page titles is done directly 
to the printer without any use of the "OBUF" buffer. Title 
printing is suppressed until page two is reached. This 
allows the printout of the first page without a title. 

Since I am using this program with my Selectric 
printer, I have included the output routines used for the 
printer. The conversion table is included, but might be 
different for other machines. The machine is a Datel 1030 
terminal. POW itself is written to run strictly with ASCII 
code, and as I have demonstrated, conversion can be 
accomplished either on input or output to other codes if 
necessary. 

POW has the provision for stopping the printer and 
waiting for the paper to be changed. Pressing the 
"Attention" button allows POW to continue with the next 
page. The area for that is at "DVDR:", and uses the code 
for A.ttn on my printer. This section can be changed to 
ring the bell and wait for a press of return on an ASCII 
terminal. 

The usual proceedure for setting up a file that will 
be output with POW would be to first define the margins, 
then the top of the page length, with the line for the 


title, then the text length o* the nago, and the length of 
the bottom of the page. The title can be nut on the bottom 
or the top of the page. The sum of the top of the page, 
the text length, and the bottom of the page length should 
be 65 for a Selectric with a Pitch of 10, or the same for a 
Teletype. Next, a page number of zero is specified, then 
the top or bottom message is defined. The justification 
mode is chosen, and then the tabs should be defined. The 
paragraph break can finally be defined, and the last 
command before the beginning of the text should probably be 
":PG" which forces an immediate start of page number one. 
(page number goes from zero to one) The order that these 
commands are given is not critical, nor is it necessary to 
include them all. POW has all of the critical commands set 
to default values, and new snecifications are necessary 
only if the default values are unsatisfactory. The ":PG" 
command is used, because it tells POW when it is starting 
the first page of the file. 

With thi3 brief description, the source listing should 
be pretty well self explanatory. 

COMMAND SUMMARY AND DEFAULT VALUES 

:DM,10,70 Define margins, left margin, right margin 

:DT,15,22,30,45 Define tabs up to a maximum of 14 tabs. 
Tabs must be in ascending order and no error checking 
is done on them. 

:PL,45 Define page length (the text portion) to be 45 
lines long. 

:JT Begin total justification mode with automatic 

space filling. 

:JE Close present line and end all justification 

*JL Begin left only justification mode. 

:CT,Tab,Text Center the text about the tab that is 

specified (Note, the line i3 not printed after this 
command) 

:CC Close Centering command MUST be issued after the 

last :CT command. This closes the output line. 

:LF,Numb Line Teed the paper up "Numb" times (Index on 
Selectrics). This is really a CR, LF sequence to 
printer "Numb" times. 

:BP Break for a new paragraph. Since carriage 

returns are converted to spaces during either total or 
left justification, it is necessary to be able to 
specify the beginning of a new paragraph while in 
these modes. This is done with this command. The 
printer closes the present line, then does the 
specified number of line feeds, and then indents to 
the specified tab. The indention is automatically set 
to the left margin when the margins are defined, and 
is also set v/ith the next command. 

:DB,1,15 Define the paragraph break to be a number of line 
feed's and an indention to a specific tab position 
(default is LF**1 and tab set to the left margin) . The 
indention can be set at any place either to the right 
or left of the left margin. 

:NP New Page forces the close of the present page, 

feeds it out of the printer, and then begins a new 
page. 

:CM,Text Automatically centers the text between the left 
margin and right margin. This command does NOT need 
to be closed with a :CC command. 

:PN,0 Set the page number to the specified value (max 

is 256) 

:SP,1 Set the spacing. If single spacing is desired, 

the value would be 1, if triple spacing i3 desired, 
the value would be 3. 

:PT,LF,Numb Define the top of the page to be LF (10) 

spaces long, v/ith the title occurring on line "Numb", 
if "Numb" is zero, no message is printed. LF can also 
be zero for a page of complete text. 

:PB,LF,!Jumb Define the bottom of the page. 

:TM,Tab,Text Define what the top of page message will 

be. It will be printed "Tab" positions over, and 
"Text" will be the message. If in a colon is found 
while printing "Text", the present page number will be 
substituted for the colon. Example: 

":TM,45,PAGE-:-" would cause the top message to be 
printed at tab 45 as "PAGE-4-" v/hen page 4 is printed. 


Number 29 


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


Page 19 

401 



:BM,Tab,Text Define what the bottom of page message 

will be. 

:P0 Will immediately force the beginning of a new 

page (it will not finish the present page). This 
command should be given at the beginning of the 
printing of a new text file. 

sOF This command will turn off the high quality 

printer but will continue processing of the text as if 
it were on. 

:0N This command will turn back on the printer after 

it has been turned off with the above command, this 
allows sections of a long file to be skipped over 
after an error has been found and corrected, allowing 
printing to be resumed after the error is corrected. 

FDOS ROUTINES USED 

Cl: Console input routine. When thi3 routine 

returns, the accumulator contains the character typed 
on the console. If no key was struck, the CPU will 
wait in Cl until onp is struck. 

CO: Console output routine. The ASCII character in 

the C register is output to the console printer. On 
return, both the and C register contain the 
character. 

Cf.TS: Console status check. I* the console has had a 

key struck, the accumulator returns with the value 
OFFII. If no key has been struck, the accumulator 
returns with the value 0OH. 

RESTRT: This is the address that restarts the FDOS 

monitor. 

TXTYP: This routine types the text string pointed to by 

the HL register. The routine types all characters, 
and the last character typed will have the most 
significant bit set. This terminates the routine. 


TXTIN: This routine is used to get the file name that is 

to be opened. 

REDFIL: This is the address of the buffer pointer that 

will be used for input from an FDOS file. 

FILNAM: This routine checks the syntax of the file name 

input with txtin. 

LOKFIL: This routine looks in the FDOS directory to see 

if the specified file exists. 

OPNIN: This is the routine that opens the FDOS file for 

sequential input. 

FDREAD: This routine is a functional equivalent to Cl: 

except it inputs the next character from the open FDOS 
file. If the end of the input file has been reached, 
the routine returns with the carry flag set. 


Herman Watson received his 
Bachelor of Science in Zoology from 
the University of Florida at Gaines¬ 
ville, in 1969 and his Master of 
Science in Electrical Engineering 
from the University of Miami in 
1972. He is a Biomedical Engineer 
with the Division of Pulmonary 
Diseases, Mount Sinai Medical Cen¬ 
ter, Miami Beach, Florida. Some of 
his research interests include model¬ 
ing and analysis of the Pulmonary 
system. Ambulatory Monitoring, and 
EEG analysis. 




x 

z _i 

□ ^ LL 

I- *+ - 

x ■,•> 

3 X UJ 


: • x '' 

□ Lfc ’ 

■ . D C 


ui 

UJ 
Cl £& 


ZL ►— 
□ 


Z 
UJ •-* 
X lE 


X "I 

I x 


X (- 
•X h- 


a x uj 

U. UJ 1 
LL li h 


.. □ 'X' X X V) _J H 

X' u. ft it z. x _i z 

i>i □ it □ to z ll ii • 

Z Uj D ll UI D m 111 ll — : : LL 

i- cl x co i u I it a = CL 


X J ll □ « Z > U z 
I— s 1 JD1E / UJ X 

h n j w fti I I X Cl ll Z 

- LL 3 X CL UI UJ UJ x z: 

>2‘ I- I- 10 _! ■:••• ' H □ □ i 

/ / / / / / X / / / / , 


OJ rf If 

UJ u u 

'■'J rf rf 


:• i- oj •= if -1 

r v u < co v • 

. OJ U CO CO 

t u- ’t t 

-• u. • £' X 

J 1 t CO U’.i 

J r- o co x 

'■<j 


•t U" 1 
U rf 1 
rt rf 


V rf ll" 


OJ UJ t 

OJ CO 
CO • M 
if Z' 

If. OJ OJ l 
U X Oj ■: 


J rf OJ I 

I *t fij , 


I X 

i X o 


J V CO M U. OJ 1=1 
• If 'U OJ rf rf If rf 

\ O ' O o x ITU •=• 

' rf OJ rf rf rf If rf 

:■ If •=• OJ r- ^ ■=' OJ 

J UO OJ IT.' If rf OJ UO 

jhx^ •=■ •=• v r- 
j if •=• y. oj oj if v 


If IT' '=■ •=• — 

rf rf OJ OJ V 

OJ OJ W 
V OJ If If rf 

•=• If If If M 

If t rf |f rf 

X CO rf LL U rf 

rf rf i 


.'.J if OJ • 


OJ rf rf if rf ■ 


- t=i CO CO U OJ u O' M UI X- CO UJ 
■|J '=' rf If I "t If rt OJ '=■ rf rf If rf rf 


•- . • £. O' ui co co q oj r- 

- ~ O _ ^ Oj Oj OJ 



O rf O. UJ CO rf |J. UI CO CO t=< OJ r- *•£' Ut ■•£> £0 O If X 

*t rf »f rf if U"' U"' If 1 ••£■ X' X fj- K N CO CO CO X' X' X X X X X 


402 


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


Number 29 







'XI Cj 


>1 It ill 
H X 

■X IX 


-« t- X + 

' Ui Z. Cl 

- Cl X Z. -■ < 7 * 

uS'I « 'IX Z. 


•X J X X •/• I .1 E 1 J z 


Ci it a 
I - JL 
X _l T _J 


I JQ 

M M LL I/'' I J LL h It w »— 

> X Z :• K I □ IU □ Cl u CL I UI 

Z >-l 1 LL X I ' LL X U. X LL 


. UJ LU X ' • C Cl 

1 —I —I • *- f J »—• •— — IJ h- —'Xu. *- _J _J — L . 

ll (_> Cl z. > tx r j a. i □ . c, z. 1 i j x cj z. i ' X . 

• 1 - u. " LU Z. _J _l '. t X J Z —• • ■ i l * 

. 2 UJ 


O |V, |V, 

v u’.i cu — - 7 - uj -.'j uj u. 

— — •_> UJ "J UJ U. O ll 


• r - uj r- * . 

"J ll" 1 -X ru U >L • 

« N u o n i, r . f . r. i 


OJ 

^ 'I LL UJ f - CO Cl ■ 

I-.J |V, rf f. ,-,j C . 


I UJ "J 0’> If' •■£» CO '7- 


•x ci rf U ' 1 - 'J.ll ''ij u"' cci uj ^ rt n .7 

—• — *'0 '"'J '"'J **'J 'U '*'J "J I'J •‘•J ••• ft rt «t -t r t 


•x x —<’t -v <7 x 

*t ’fr *t If' If* If' If' lf‘ If' 


J UJ le. Ll 

i h- 'I I' 

: <l z (A (■:• « : 

- □ ci x a □ d •: 

—I LL - J IX • ■ i 

\ =■ x z _J X •: 


Z* _J © Q 

□ I LU LL 

LL M It h ■ Ui > LL PJ > X I— 

□ O □ Z Z. LU N □ I I □ I 111 

> k *r z tt *- it iu z '_' ct n x 


X *-• > '_' X 'X > ► 

XD JZ J JliD, 

x —j z x • x x :. z >: 


(/) Cl 

« X 

'X K JQ 

• — r j ►— x hxl'Ih j jh 

X Z EOXZZhX'IIUJ 

• “i uj “> □ _j u _i o x 

x a 

□ 'X- 


J— Cl I XXX 

Z> 'X •! K X X 


Cl Cl X N ■ J -H 
c- Cl ru If* 'I Of 

r - cu r - r- o r - 


r - <x x i-i x x o ■— of 

Xi Ci C* lm Ci Ci Ci 


'_' M X - 7 • £• 
'_' '.' Q Q M 


Number 29 


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


Page 21 

403 












u 

□ 


tt Z _J C' - ' Ll is- - ' _i 

IOE J I- H 1 'T j D Z> X 

■ • • X □ Z> _• X X * X x a. • 

i i i i u m □ n i '••• •.* u. -i ll r : 


* -i r a: 

• m x r-j r 
: j D ■ w ' 


: <x _i > -X x : 

• i— X r j □ h- 
' •' Z Q k 


: a f ii- x : 

i i il i ; 
J ~• LU — ► 


•o v co X 

n .-.j r~ .-j 


^ X 00 

X| oj c- 

•=• oj r-- 


X Cu OJ X Ll X Ll X 

CO X CO ^ i_. mj oj ,.j 

oj n oj -h r-. rt r - r - r-. 


X X 1 »- X 

If- t X' 

OJ OJ OJ OJ 


I '"'J X ''J 0 X ■- X *—i OJ CO X ill X LU M OJ w X LU OJ CO X P X '7- X X '"'J CO CO X f- UJ '"'J X O X CO —■ X CO X 'X « CO M X X M 'I • > oj r. X "J Q OJ ro Cj _ ,t 

X CO x i_i ro i‘m i_i ro x co r- co oj o co CO Co co «_> cij o f -_ ll *_> X CO <j oj r-. oj x O o CJ co *r ro -”i co oj * iz. c i_. i_. ... ^ 


^ co 'L' CO ^ I_I IX O CO X' '7‘ CO X OJ HO CO <J. <_'»=) X X OJ CO X' '?• X h X X c H OJ Tf r-._ i;o rr. i_j X OJ CO rf •£. ij. i i ll OJ ip -J.' 1 O. . . Q O O', rj r ._ ^ LU _ rj 

• X X X X X X X X X X X X X X •=■ © O O O © O *■« *-**-* .i —• — — OJ OJ OJ oj OJ OJ OJ oj CiJ CO O'' CO O'* O'* CO CO t 11 rf i t U', u'i IP u IP ip IP v X 

‘ T Z Z Z| Z Z Z Z |Z Z Z Z Z ‘!y 'i* 'i* '[y 'jJ OJ OJ 'OJ • jj OJ OJ X OJ OJ X X X X X X X X X Cij x ijj oj Oj Oj Oj OJ OJ OJ OJ Oj Oj Oj OJ OJ 'jj OJ "J Co oj oj Oj oj Oj 


x z: a 
“• - o x 
j 11 - j 


Z. X 
' •=- .1 f— 
Z LL IJJ G 
■1 X i 
Z' r- X 


Z _J Z PC'I •- 1 
•I X X 'I X • » X 

Lt • ' I J _J X 


M i Z* 

h J h tf, □ x ; 

X X > X ! 
J J Z □ h O ' 


^ -I Z> - X 

P •— ZL • >■ h- h 

' X CO C X X 'X -- -• N 

: x := x z> j z j w ii ' j x z . 

... z: x 1 —| t— 'i x .j •_< “ “• ■ 

X XHliil 

Q X D I a 

h- Z X h- h~ <_• ( 


Z X Z Cl 
'I Z- h- 
X 'X 

X to X 
' x -X 


U M X 

• 1 • 1 X X 

• - a a x 


j cr j i j x > — 

•x t- i 'j i m o 

• .J -j _J Z Z L 


X CO X X CU X 

CO CO Oj cu oj oj ro 

— r - r- r - r - oj r- 


* ip 'i co x x co x <x cr- cu <x •-< oj x x *-* cu cu -o 

' CU r - oj ll f- CO C 1 * 1 <7- CO rf ro rr. m -'ij ro 


X X -X X OJ 

CO X X 


CO *7- 'I O X ■- CU CO l >7- 'X LM o X —' OJ U"‘ CO <7- OOhI \-. 

CO or* CO CO CO .7 .7 . .7 . *7- <7 - >7- cr . ‘7 - *7' '7 - •! -I «X 'I 'X *1 'X CO « Oft « 


. 7 . x •- co i r- 


Page 22 

404 


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


Number 29 








r j *1 z z. 0 


r_i ixi «I 

£1 


a 

LU 

Li. 

□ 


LU 
— LL 
LL □ 
J- X 


X 

U. 

a 


lu a 
) <y > u. 

• LU 

. □ LU 


X ft 

a — cl t a i 
r - 001 ft _j a. 

• lU LU <j Z. • LU - 


K X 
X •! Cl 
a « lD 


•X l 
ll r J , 
□ Cl 


~ 0 □ 

_JX — C 


UJ X 
LL I— 0 
Cl □ 


UJ LU 

'X a 

'X 

: b 

. UJ LL 
X h- 


!=- p‘ 


a j- 

CL * ' L 
Cl -X > 


LL _l 

a. • 

► 'I x ■ 
■i i o 0 


- ^ P ^ 

o I j. ,1 ’ 


> J J - N M J M li ,1 ,1 > 'X LL _l LL f j ll I I- ll M > .I_j.lL 

.5- 'I 'I LL Z > '1 / . Z. O CL I 1 □ Q Z I I 'I ; CL K iu w Cl l 1 □ H I m i 

■ z _i *-i _J O ' X J |_| tfu ■*' x LL _J O CL X I ' _J _1 ► 


X 

' ‘X ' 
) M Z' 

: _j a 


— _j cl f j : 
> 'luxe 
x <_• 1=1 -i: 


•i i > 

*- 0 □ 


□ 

Cl 

■ □ 'X • 


•I' -X 
— Cl 

•• 1 CD 


I H Cl 

I- — K 

Z 


•1 i-i •=■ — n f • a- 

= m lu UJ UJ LU lu 

•»J i'U >jj ft '''J OJ i'ij 


— -X 
1=1 UJ 

00 OCI 
o O i 
N 


OJ ^ ft 


UJ M M UJ I'IJ UJ 1=1 -I 
ft (J LL ft »*|J 


O 'X 
If' l_l 


rf . 7 . 

O nj cu 

f-. f - f - 


-t •! r- ix u. -I CT '0 0 cu u. oj ft x uj co ft <-u >x - 

ft ' v ' uj I_I rf >:•*! uj I_| I_I O I_i ll ft I_| ft ^ q f._ ,V| ,-g , 


J. Uj UJ — f> sill CO lu uj U. OJ CO •■£• f - 'I w UJ u rg y. ft a. •! m u. '=■ u tj k 

LLl LU Ui U. U_ Ll Ll U- LL LL •=' '= •=• © O O O ~ ^ ^ ft ft rg rg 

ft i’ij ijj rg ft ft rg rg rg ft iYi ro r.‘. ft ,v, ,v. ,y, 


in CU LL -I OO LL © I\J 00 U- ifi Tt 

•=> uj cu uj co '■£> if- ui co eg o © 

N r- co co co co co r. ro r ._ n_ r_ 

=• o o o o o CL 0 Q o o o o © © 

CU ft C 

U. I b‘ UJ P m OJ UJ CTi P I UJ 111 1 P ft rg rg x LL ft 

rf co ll co o 0 r- oj o o u. u. _■ <_• v *ll co _> 

X P UJ U. - 'f IP ct' a. 1 P o i-g tf> N 'I 0 =• ft rf r. X uj I_| LL 

eg 'Xi rg cu co co co co co CC' co rj rj -t in in y* /■ y y y y* 

CO CO co (O co co i "0 ft CO I V I (O' co ft, ff, ft, ft, ft, .V, ,Y, ,v, ,v, ,v, ,v ft, ,v, 

•=■ •=■ o o o o o o © © o o ©■ © -■ t p. C' c r- c b c 


rt r - 
•=• I-g 
r - r- 


0 

x 

-I 


UJ LU 

'X P 


1 Z f- 

‘I X <10 i'L UJ • 
•I 


I Z 0 1 it 


•I u 

-i *r k 


• > U. _• 


it t j D •_ ■ 


-J 'X > X 
• I 0 c 

0 _J X 0 


tb 

□ Q 
ft X 


a 

»x« 


D Zi 

ft 0 


ft 

(X 0 

X UI J- ft 0 

ft 0 </. 0.10 

ft 0 LL I * Z' LL 

Cr;i IT '7 0 0 X a 0 

0 0 
UJ CO 
UJ 


I 0 'I 'I 0 
X ft 0 UJ 
I .o X ' •* ft 


1 

0 X '0 ('» 

UJ Ll : 


t D 
<X 0 

X 

ft > 

□ *- 


UJ - 0 > 


'I 

ft X (/) co 

0 ft C D 

I • ft ft 

I 0 I 0 ll 0 X X 


0 LL LL . 

0 0 I 
Z' X - 
U. 0 X I 


a -I 

a. 

X 

D 0 


J □ 

0 X 


ft ft 0 0 ; 


□ 

0 

Q 


> 0 *-• 'I ft 'I ft ft Z> 0 *— a. Z' ►— 


UI ft N ft x □ f J ft f .j z X X 0 Z 0 X •_> i 
0 X i 0 X ' ft ■ i ■ 0 0 »— i i 0 a. [ 


•I ft 
0 X f J 
0 LL ft 


ft 

I- U. 

. Z« o 'X •! 
a 0 ll r 

' LL 0 CD 

□ o 


r - 'X 0 LL •=' Oj ' ' . rt 

l •!> l u v r - r. r. r. 

' 'J |- g OJ rg rg rg i'g ijj i g 


x —. rg 0 -X .1 f - 0 CO 0 rg rg ll ' 'J CT. 

— i'O nj uj ij f-_ rg o i_i rg iX i_i 


r - co 0 ft = co t y< •£• r-- oj 0 uj ft i'U 

f - r - r - r - r - a- co oj o:* co o: ft ft oj ft >?• 

.g oj rg ft ft rg rg ft ft rg rg rg rg rg rg rg 


ft O 0 O O .i 


— 0 UJ 

ft o OJ 

r- k r - 


UJ ll UJ 'X r- iX UJ ft ft rg ^ rg t 

Ll LL OJ r - 10 ft rg rg rg ft , 


ft IT 1 00 I 0 UJ h CO t y, iYi lu LU U "j rr, . 

a. a- ft ft it. a. ii .x ii 'X a a x .1 0 0 i: 

(U CU Oj oj ft ft rg rg rg rg rg rg rg rg rg rg . 

o o c- o o o c ■- o ■- o o -r ■: 


y- ft x 
0 0 0 
CU 0.1 rg 


l_l ft rf y-i .£i , 
0 i. 

OJ CU Oj "J oj rg , 


uj eg if 1 L' 

k-l 0 0 0 

rg |-|J rg rg rg 


Number 29 


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


Page 23 

405 







■X X X UJ 
I 

X t- X X 
_i uj 
x uj x 

I H it 
H X> *- LU 

X D ~ X 3 

"lira 


x x x x 


X •/' 

- x 


•>•• XX -• 


X 

□ 

X 1=4 

UJ X 
N □ 

UJ D > 

(-:• i- x 

xx xx 

UJ X (J X X X h- ■=• x 
x xi x iv. x x oj x a 

X X X —J » •- 1 X X X UJ - » 

■_> uj X x t <_■ in > x « co x ■: 

3 Z X 

□ v> a uj 


< X X ~ 

- i- r j x n x I 

: i,i -1UIU.Z >_• ~i ■ 

x •- 

X \— 

X UJ 


1 UJ •- X > X 
X > X □ h 
1 uj z a z h 


□ 

UJ 

-J 


_J •/> 

□ UJ X 
X X < 


I 

,1 x X M X • X X X 1 J— 

x z ci x r -j > z > t- i- ui 

' X “ </> _J o “■ Z “ Z IV) • . X 


□ .. 

X •>•> 

x X 


1 5* 

■ x 1-1 : 


I- I- X z z X 

Z X Z K XX 

X • t- » X Z h- 

x u x x x x x x x a j- x x i ' 


-I X 

:• —j x 

• X z 

z 

J X □ 


□ •: 
□ : 


> x > x _j *—i x > x xxx x x : 

□ z □ z x x a z x ii z r j — z z ; 

Z H Z H H J □ z H □ “U -I It H H I 


X 

□ 

a x 


x x x x 
X x •_> 


in 0 

r - rt 


rt U‘< 

CO XXX 0J 
r - x ci u ci 


X 


IT' -H CO U"< 

o r\j oj o 

N rt rt r- 

'=' «-4 O 0 ro o 

o o o 
x x x x co x cu r - >? • 
c* x co i_* co co co o 


CO X X' X U X ^ 

xxxx xxxx 

CO CO CO CO C'-' CO CO CO 


rt X' CO CO 

xxxx 

co CO CO CO 


X X —' ’T ■£• 

x u o o o 

CO CO rt rt rt 


•J. 0 c_. 

rt *t 


rt rf rf 


rt r- x* o x co • £> r - 

’t’tTj-TfrJ-rf’trJ-Tj- 

O O O O O O O O O 


CO X X CO X 
0J CU OJ CU CU cu 
rt ^ rf rf rf rf 


cu co rt in oo x 

ro ,V| ,V| iy, ,v, ,y, 

’t rf rf rf rf rf 


1=1 X X CU 

co CO 00 CO rt 

rt rt rf rf rf 


X' l t 
X X 

It l I 

'I i 
h- 
X •— 

a z 


a 

a x 
_j x 


r x 

x i • 


•i x x x -x □ r 


-Jj Z' 

x x 
h- Z 

'I i D j □ > 


> t- I/' 
X L> X 
'I x a. 

Z u. X ■ 


X X □ X 

a x x x x 

□ QJ X h- i j 

-I 3 _ X 

X w _■ 

H M I X □ 

Z Z i <: - .i 


X X D 

I—I x X X 


Z X X X * 

x — i □ cl r x 

X *1 H 


• x x >_• i—i ; 


u in UJ i. 

V X x 10 x Q 


□ z x x 


z X *t 


5 Z& 


x z x o; 

■ 3 □ J Z • 


•X 

Z > • X 'I 
Z *— X 
□ X X X 
j- X - 


UJ X 
X t 


X z 


: x a - ; 
. □ z x i 
- z u u 


■ 'X o I- 

i x . □ 

I Z '1 UJ 


. x x ;= . 

MitD. 

' _J □ Z . 


Z' I- X 
D X • ' 
X 

^ 0 . X 

^ ” x •••• 

X X X 

Z X- X 3 


X UJ 


X J— □ 

X z 

X X X' 


X X 

cu cu 

N CO 


•=' ■= rt X o O X 

'.Jj co '*u 

X X X 1=4 X M jj <7- '•£' rf i 


;• co co x T 
«r - ■_> rv o 


co —< x 
cu x <7 - 


X — •£• <7 X X •=• — ro rt u - ' CO O' XXX 

■£• r - r-- r - r-- r- >■- oj co co co 

ro ro ro ro o'i ro ro ro ro ro ro ro ro ro ro ro r> 


rt u - ' CO *J. XXX •=' —' oj i;o rj- u -, (J-, <T 

CO CO CO CO CO CO co |J- O' |J. .T. IT. IT. |J. |J> if-, 


x x x •=■ cu u - ' r- x x 

,T, .7, ,7. -T x X X X X 


Page 24 

406 


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


Number 29 













z c 

—' lit I 
■X D . 


□ 

N D ! 


•X > IZ Z' 


11 li : ii : . 

; H U r J h • 

• Lt •! a >T D • 
’ I 


« j h j , 

_l > 'X x .x i 


K □ LU Z._I aJ ► 


Z IIta.LtlXLta.LtU.LLri.LtLta.LtLtLLiXU.Lta. 


ggDggogpbQggDggggggggggagDD^agouQc 


■ Ll) Z 

'* t- z 
• a 

o •_> 


w tu «t 

rf <X> 

•=• LL o Ct 


— T t. I.T. 
(X, |X| MJ CCi 

’T ’t t ’t 


It — rj L' .T, 
*t rf rf rf $ •* 


•1 Ll ’t 

'J U M M 
n ’I rf rf rf ’T 


*t Lt t r- ixi 'X -X >x -x x ai • rf i i r . 

? u ' 1 * f- u'* lita.iiiiiftt •=• 

* y n y •_« y x y u'- u' 1 y rj- y . t -, ..£■ ' 

t •- U'- - *t O y - 1 rf ■- y c t c 


1 i 11 yi -t r - u‘- 


cj y u- n u'' i in i ixi 

ji* r - y ' v ' in £■ ■£> it ti 

*t - i •- i - i - 


f_- I?, w IH li -r-t |V, U", f._ iT, ai H Lx H I/, y f._ ij, A H Lx O’ i y 

MMuACUjLUAlXJLxlUJLUlxJLxU.LtLXLXltLxlX'- O •=• 
lltllll’MIlllllll’MItLi'. I)’, y 


ii ■ u u' u u - ' u y u' y u u' u' 1 u' y y u' u' 


a z* 

lx _J 

•I 
Lt > 

□ 

UI it t 
O Iti X 
D Ll It l 

z a 


Z W ll l- 1- It 

□ r- O Z Z lx Z ll 

jl- -I - - UJ LL - 

i *- mil it x «=i -ixi 

_j 

I 


z z 

LL - 
I ‘X <t< . 


UJ it Ll 
X □ 

Ll ll 
ll a 
J h ll mi 

a. j u 
z* UJ II ' 
u II 


LL LX D Z 

x — a x -h 

• _i *x _• * 

X uj a 


C' it' □ A i- _j z 
- X - z □ z- 
•I - Cl _J LL a. ' 

Z Z UJ I ll Z Cl 

'X 


. z f j uj z z : 


z 

Z .. 

a z 

□ 


•- k x g z z 

UJ it 
_J LL 

■x o z 


- x . 

UJ Z I 
It •— t 
>1 a- . 


•X > > X _| 


'mac, 

- x j x ■ 

X f— _i D J 

•- C I _l ► 


fu _J > — < i Z J ll -- r.j i— _j>— _j_i_jcl*-' 
Z <1 o LL Z Cj X Z a Z 'X X I ll 'I £ LL 


'j. <x 


Cl' rf y 

rt rf rf 

rf rt rf 


uj ir.< -I ' li — y iti 

If.' *'U U‘| I'lJ C'J OJ UJ UJ UJ 


m UJ lx i-' CO <7- ll it 

i i i u' u'i y u'i y u'i 


rt iIQLUU. 
•£• £ £‘ £ ■£ •£< 
*1 1 t 1 ’t T 


UJ U*' x -1 •- i 


I'U U' I - 
. .7 I.T .J. 

•t *1 h 


U'I U'i i=l X v 

uj r- 0*.i lm »-h ( 

•t 'T. r. rij r 


• 7 ' a. -i *x -x x -r 

t i t t t t 


Number 29 


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


Page 25 

407 














. j. D - Cl UJ z 


i -I > : 

. x o . 

I '— 1 Z *■ 


1 Li. -X -I 


£ 
•X I- 
- UJ 


Z U. 

-• z 

□ Q 
LL 


I- Mi X 
Z □ I 
CL » .=* 
•I I 'X 


•I 

• r, 

•X 

1=1 

'X* UJ 


• r j o. > 
. z Cl 

• * uj z 


■X LL > -I ► 

ll a. □ cp ; 

n cl z j • 


i x _j > : 

i o . 
• _i z * 


LL 

LL Z 
X UJ LL 


•I Cl M ►- Z 


<£• Z E 
: Cl ui Cl 
I -J h- 
■ >£• LL 


•X* E I 

IldJl 
•I •£' . 


» a 
O E 
• -lIGt- 
J UJ □ J U. 


•i j a c a x 

• ll Cl u. • IU 

a I Cl X Z Z ■ 


LL X '. 
-I Cl i 
a. *1 
—J Cl 

i r. 

'X 

Cl 

•X 


a '£ 
“• CL 


ja cl t 
•X I- Z l 

I_. IV. I 


Z _J •£ -I 
■ Z 'X X 

: □ z 


.=• _* x ll a — . 

LLf'iDluTh: 

C a Z _j •—• • • .j > 


■ I- D 

: ” •• 

i □ U. □ 


^ J> •£• =• -I M >X 

U. •=' T CO Mi O 

•£• r - :p j* 1 f- oj r - 


* "J =) OJ ij 1=1 UJ x 

_• -‘'J •=• '-'J 


UJ co CP >x uj • 
K OJ 1=1 •=• u. ' 


•J- u'< r- >x 

<= CO if' 'I o 

rv r- n •=• r-._ 


UJ UJ 

CO ll"’ 


UJ ^ O •=■ ^ iT , CO •=■ 

UJ Ll OJ fO LL ■=•»-( |v, 

Uj ■ £• r_. u~. ■£' r- •£• ip 


fP «T . 

Mi •=. 

oj r - 


t f - X CP =• O ' •£■ CO Mi (_• 1=1 '=• CO rf £. 

lii Ui Mi Mi _. !_• I_. U & M M M 

if- IP uj if.' jj if uj' o'' U'- if* u' u' if. u'* if* 


•7 f - U. l£ 1 ^ OJ - O Ui >1 UJ 0"' P 'I UJ CO OJ <0 or* Cm oj CO Cl lij (=, |V| 

r - Mi —■ co lij oj >_i uj oj n oj i_i 1=1 u. ^ oi .V, 

2* '5 O •=• — t N 'X Oi UJ U. •=■ C'i X' 011 <7- 'I Oi UJ —• ’t N 'I i=i o 

wmwwmUJUJUJUJUJUJUJUJIi Ll Ll Ll Ll Ll U. Ul '=■ •=' O O O *■« 

U - • U‘> U' 1 U*' if' U*' !!*• I)-.' if* If' If' if* U - ' U' 1 U - ' U' 1 U~' if' If' ll - ' If £• £• •£• '£' •£• •£' 


'XU. LL •=• UJ 

OJ OJ OJ 

•t r- r- r. oj 


i -1 r - co u. «=• *x ■ 

I |V. iCi rt •_! O', . •» > 


■X mi u. oj 

W r> H H I'lj . 

£' £' £' '£• '£■ 


'■£' '?• 'X Ci UJ U. 
OJ "J 'ij OJ OJ ' 'J 
'£' £' •■£’ '•£' •£• l 


— OJ ■=■ 
LL OJ U. *''J C" 

■•£' r- ■£» r - u'' 


OJ if' CO Ui UJ 


z z 

Cl * 

•I -I X 


z 

Cl Cl 
•I '_ 


uj j z a. z *jj cl mi 

MMU.UJI=Ll.Jd'll- 
Z h- > h- 'I Z LL 
UJ O CL lu » '£ Mi 
□ '/•:* 

u. z 


it >1 □ j; Cl 1 


1 •£ I i 
Ml » Mi I 

»- Z 1 •- I 


x n z i ll r j ll n i 


• — □_)> x - M 


j a. uj j a a j 'i •! . 

-J— •! z z -I h- j— . 

•i • • i 

•- UJ 

UJ 1=1 z 

y> uj — 

^ Z •• Ll •• 

—I 1=1 Z •£' UJ LL 

Z - -I C, 'I 


•I X Z h- 1 . 


ID 


u. 


•x uj ' oj uj 
oj r - > u oj u •_> 


a u oj .-.j.. 


•I UJ • ■ • UJ CO UJ 'X' Mi ij. 
"J f - OJ Ll U. 'ij 


1=1 CO Ct ■ 

'_' l_l I 


I_I OJ *-• M M 'X '=• UJ L 

LL OJ Ll •=' Mi ^ Oi ■=• . 

'•£' r - r - .£« r- oj — uv r . r 


i oi — 'ij Ci oj m P X I . i 

l lij OJ |_, f.. Oj (■.. ,■ 


'=' 1=1 '=' 
CO Mi 1-0 

r- '-'j ip 


■=• Oi u‘‘ 

0 . o*. ro o’. 

u'. ui Ui Ui 


if If' Uj Uj if if' U’ Ui U ' 


' I P w U) OJ CO ••£' O' LL Oj u - ' CO Mi UJ *t V- «I CP •=■ ro •£. f-. X m ll "J U’* f-- 

Uj U* IT' ui U’ £• ■•£' •£' •£' •-£' V- f - f - f - f. CO CC* CO CO CO CO CC' CO '7 >7 <7 

U_i Uj If' Ui If- If. if If- Ifi U‘- If* Ui U' 1 U'' U*' U'- U' 1 U'' U'' U" 1 U"' U‘ U' 1 U' U'' U’ 


? i 1 11 1 uj 


'I Mi UJ —• 
•X 'I >X CO 
If' If' If' IP 


Pane 26 

408 


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


Number 29 





1 ►” XI- 

•I 1 ' HIU'I*,' 

Z- N 

J ^ u. I i I- 

- u 'X H Z it 'I 

• -II Z- D -1 X 

i z y- a z z h- 


Lu u ‘S' z a i ► 

H L 1 x 1 I- 1 , 

Z O it - 

— D O h a £ 
'Z-u.f-_J.tZ.LjU'. 
u D • ■ •! U D 


•i u a 'I j. ii -I a l 

•I 'I 'j □ □ I t- » 

u. f- X ll Ll 

- Da u. l 

t-LLU lb U. CD I- I- V 

t- Z X ZJ JJ • • Z 4 

'L U' LL _J 0.1 X LJ l 

-J LJ H Z li. 


_• u. 

U lb 

1 . u u 


Lb l£. t- 

U _J I 1 a. . u a. x J. 

” a i UJ d •! Z L_ Z Z — u- -l. 

Z _j -1 •- ui ^ - u.; tr, ,i ,i ; 

Cj f- — -I _j .J _j L J. *- i- i 

*- Lu a- ► 

ui >1 LX Z a LX •! 1 r ll f- * 

cl >x u a i l; a • • - a u 1 


•i Da-: a . .. s 

l _j ,t — z lj u f— 


i- i 
Z LL 

Hli h£ 
L L -■ LL 


z i i i 

UJ 1 J u Ll u 

<=• • *- .v, u u 

I X -X I i UJ —■ —• c - 


a -X CL z- -«'X a 


lb Ll' UJ UJ JJ Lb UJ Lb Lb UJ lb Lb Ui U' Lb lm w Lb Lb LL X IL lb lb U ■ 

1 -J > 'X .> X CL 'X J- > > > _J > > > _ > _J _J > > - - - - - _ 

‘X ll_ U I j C_J Z u,u.u,wJ(^u.iLii.ujauJUJU ( diLii|jju, l u^, lL ' UUlUjl . ll _ 

' -'i-iJi a a H ll. 


; ai a. uj lx- ij.' w a. 


lb UJ •• f— 'X 1 lb j_ X Z. f— Lt_ U U. 

a Z. I- • J O I K i I ij I 

‘X u U O U • • '£ U Z '.J li' Lb E I l- 

•x* •» _j Lb cn ... . x _j ... .j x k- 


ib ,r IL K x LI I " 'b U L. Z XX 

—j 'I □ U O Lj L! U J a a U '1 Lb x •! • . ‘b » 

►- ,i »- j. l -*■- - iu u. _j i _j j .t Z *- - . 


"J 'X' tj- LM UJ 

UJ UJ UJ lb u: Lb 

b b 'b •£' '£■ b 


— l - 'I W L' M UJ U. 
lLlLlLlLU.llU.Lll 
'£' l i b b •£• 'b b b 


^ '!J Z’ ? V.' i' Cj 'i‘ -I '-I w UJ U — — 'ij m a — "j 't ll" 1 i' i .1 u. 

~ :f L* f _- r _- [_* L: t- L r _- r _- r _- L* r .- r _- f _- r _- f - r - r_- r - f ' r*. i - 1 rV r' J f' J f? f 


□ Q .X . 

-J CL X C 

•_ Lltfii 


u • ' JIEI 

m □ ai i- i 

:> j uj j uj i 

«-* •_* Z £L O . 


•X 1 Z 'X' Z Z u 

u b u X u 

I J X O u 

•x »— *x b- .. a 


' L- 'X X- X. •—I 

UJ X L- X I 

_j x rj — 


_» _j 

_J _l 'X 'I 
. ' J'l'lMh 


Z _) 

— ' i _i t— CZJ I 'X . 

CL l 1 Ul I* 'I h ' 


rf h ij. i' r i i.'IJ 'X' 

U*i i‘ij 0 1 ^ ll J Lb |V| 

••b r - r - b r-- u*' 


•j' cd *x •=■ '7 •=• 

lb CD ^ Oj •— r r i 

uj .-.j -i r. r-_ ■£, u‘> 


— b - a- u 

LL '''J T 1 ' ''ij i_i 
i* f- u*' u _i r - i' 


•=. •! r - >L •! "J CD -I i 


-< ”t r - 'X' Cm UJ — *t f - 'X 

*T *t t *t t T u‘. U"' U ' U*i 

•b £• -b •£■ b -b -b ■£' •£' b 

w- -r o X -r r- •=' •=• o •=■ 


W - t f - 'X M 'X |V, ' L' 0 CD l 

U‘ v£i •£' •£• •£• •-£• •£• f - fv f. r. f. | . i 

.,£. •£. £. •£. -£■ X X £• 1 


Number 29 


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


Page 27 

409 












□ 

_J 

_J 

r 


a. x 

j— — , , 

ll I _ 

x a. a 


a 

z. x 

- -X 


•I 

LL 


LU 
X X 
«x □ 


I X — 

I X LL 

. -X K 

(J 

I - LU 

. V> _J 

. “I UJ 


a. uj 
k o 
x -I 


I < 

•XI 


. X 'I 
• X LL 

X 


'-' U W M I , 


I X X X X X X -X XI 

' OJ X .Tj z OJ X CO X 


I X 

H LL C 

O X — X - . 

• ’ * 1 ‘ • L 

•I CO «X X' I • 


•X I 
-J ’ -• 
X* -X CO 


•X J 'j I i 

• LLl • M L 

• ' I • • •! O '. 


ofi 


XXX 
• Cl Cl ll : 


x *i a □ i' 


*- - - ~ XX- Zi > - r j _ _J ; 

x NX r j x r j « x z N © □ z > x > <x • 

x <_:• “• _i x x '*• uj e i z ■ z 


' X X X K 

. r j o □ □ x 

• X X X Cl 


’• X 

: a. 

• X ill » 


X 

X 

X ' * 

□ X' : 


X 

X H 
□ > 


x x 

•— —• ' ' M 

X X X □ 




OI 





IT* 




rt 


rt 



o 





CO 





O' 





X 




00 


00 


CC' 

X 



CO 


r- 










CO 




o:- 




'»• 

CO 



X* 






•X 

— o 




o 

o 




o 


o 

X 

o 

C' 


o 


O i i 















CU 

"J 


"J 




CO 








X 'X U"' 

U*' 

U*' 

O' 

•£> 

»-• 


O' 

X 

X «I 

X 

•I 

X 

•I 

•X 

O' 


•X 








U-l 

X 

u • 


OJ 

**■ 

r- 

rf 

X Lr 

X 

° 

X 


Oj 

•I 

X 


f -_ XI CO 





CU rt 

U"' N 'X 

X 

Q 

M 

X 

o 

•v, rf 

If' 

'-£' 00 

X 

X 

o 


IP 

CO 

•T- 







rt 

rt rf rf 

’t 


rt 

rt 

U"' 

U" 

if- 

If' 

If' IP 

U"' 

If' 

'•£' 

•■£' 

'£' 

•£' 

sO 


• o ■.£' r - 





CO CC' CO 

CO 

CO 

CO 

CO 

a* cc- 

-! 

CO 

00 00 

oc« 

CO 

a* 

0'« 

o 


CO 

CC« 

0j 

CO Oj CO 

•o 

CO 

00 


L — *T IP CC' 0- X X X o 

- CO CO CO CO CO CO CO CO O- O' 

i 1 co co co CC - CC' co co co co oj 


z 

I. I 

□ 


X □ X 
I X x 

-J 'I I' 


:• x h- 
X t— X 
X ID ►— 

—• a ' 

XXX 
_J _l _l 

a o □ 

</.• i/> •/> 

XXX 

a □ □ 


x 


xxx 
x - t— 


. • 


X X 
X X 
— X 


X XX* X* u 

> - X £ □ XX 

Xj-X_J'IX — X 
X X — 1 X x 

-JHXXX*- X X 
XXX X X- (/' u. 

— X'XX — xxxx 

t— XX—<LLt— KXX 1 
XX' X X —• X 

X JL D X 

— 1 '/> X _• X 

G □ X X X Z Z U 

X — X I X •• — — — 

x a u x *■■} x x 


UJ xi 

X x 

X X 

X X 

X X 

x 

i>m • x 

i a x X* 


X ' • X 
1 X 

»- UJ X • 
X •_» l 


- x x n xxf ii-xe- 

• X □ »=J X X 'I X Z Li cn X 

x j tz •rj ' l x x 


XXX 
— •£• 

• 0 |V ' 


I rt 

X CU 


X X — r j X 

*r x z z 

X u “• 


IIIXXXIXI 
u. O' t X £• 0- X 

t rj .£, f -_ •£. r . , 1 j 


II II II II II II II II II 


'XXX X Z X 

> X X X X X — X — X 

j —X > —'LLXXXUL — L 
' X x I- — X — x M z. ■ 

x — 1 • . : x —• x cd x x . 

1 X I I- h d U. w _J — ' CD • 

j X z 

i D 


* ' _= — X X X X X 

■ c x x x x x • 

• X X X X “• 


X 

X 

□ 

u. 

X 

X 


X I- X £ X 

• X X X - L X X - 

□ X I— —> X X > — x 

X X . X jt X t- f- M 

x l-j x x □ — • x —• ; . x 


X 


□ . 


*t CO O' 1 W U” 1 ' U* U _l 

oj r - f - ''u ■£' r - o •£. o 
CO • — 1 ' •— 1 co • co ■ cc* 

M Q — O 1=1 O I Zt O 

^ M P I W 'I H 'X M 'I O ' 

• 'J OJ c. L I_I 


I- 11 

x i- ; 


— a : 
X X 

(- 

H X X 


00 <=• O ' — 

CU ’t (J'l T Tf 

rf rf X .£' X o 

U-« IT' Tf Tf Tt ,x 

— O O' O O X 

oj oj oj co 

CO 0*' ' , T ll" 1 U" 1 

*r u"‘ oj it- -t t 

r - O ' u"* if *x l 

U"' t ’t ||‘| 1- t 


■u *t l - CC' 'X X X X X I 

Uj U X U. X Ll X X. u I 

r - r. r. r - r- r - r r- r. i 


LL — OJ r-_ — •-£' 

X X O-I CO rt 

r- r- co co c- o o 


IL O' t O (=• »'0 •£• O' -X 
rj rf L' r . '£' f'. r - r . i-i.l 


if' x x — r - ‘X x ■ 

o:> o: •» a< co o. oi> o: o:- ■ 


rf iT. LU 1*0 'X' M 
OJ OJ OJ co ro CO 
co co co co co a* 


Page 28 

410 


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


Number 29 










D 

X 

• ' X 

111 h- 

U □ 


•x > *-• _> x n > h a. ii a. h 

X li 13 . . X ■_ X O Z □ □ Q UJ 

O li I J I M "| £ if Cl iL li It 


a. Lii H X* 
LU ' • • K 
_J Uj I- LL ll 
lii it lU □ X 
LL _J 

O UJ X 
LL LLI ' ' 

□ XX 


J UJ li LU • 
ii li n i j 
•I 1=4 Ll I- 


— 1 ' LL' IX 

X C! • • X • 

i- ii r i- « 


i *x > 
r - lu 
£ a 

MU 

u* x 


iXiii 

i r- -x » 

co 


- •- f\J 't 


i i 

i r - i 

4 MU I 


3 X 
• *1 

:■ U’* 

£• £ 
«’. 
t- £• 


1 I 'I M I 'I I 


' □ 
> ’I 


x g 

i- r 


i x 

' •J □ i i 


•1 LL L 
□ 
Lu Ll 


•'•J U" 


mu r - 

x o:< 

T IP 


x <x 

oj u'< 

X 


CL 

OJ 

■X 

n 

•■£• • • • 
r _ rij 
a. r>-> 
r- f. 
• 7 - '1 
’T ’t 


'i J 'J.' ’I r _- '? 't 4 W X ^ '" |J ,v ‘ ^ 

>7 a. .7 .7 .7 .7 .7. .i .7, ,7. .7. ,7, 17. 


Ifi -X 
•7, .7 


u-i x 
"J ''Ll 

. 7 . a 


MU OJ 
t U* 
•T. . 7 . 


a x •: 
x ll ; 
x - 


x r- 

•=4 Ul 1 


X X 

11 (l m a. 1- _j ' 1 < 

Z Z D X XX 


w x > X _J _| 

I'l (ti CL I I x K H- J I- 1.1 7 - J UL I, 

13 X a > LL X- . X C :■ ii D X X 

' X X LL Z Z □ J L 1 I D U I _J l= “• 


LL LL 

^ ~ X 1 X 




•=.-—** if. ‘.if tj. X 1—1 •— 

•7 L X X X X X X X X 

•x* co Co co 10 co co co co co 


L XXX 


"J " £• >7 'I P n - t 1 ■ 1 

L=U L^4 I—I L_ 

CO CO 01’ CO CO CO CO Co LO CO CC- CO 1 


- '‘*J ll ' L 1 '7 - 
1 X X‘ UJ X X X 

I.I.- M > 0 I I - M . 


X X 1=4 OJ rt t - X 1=4 X 
UIXXXXXXXX XX 

CC CO CO CO CC* CO CO 0.* CO CO CO 


Number 29 


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


Page 29 

411 










DATA-BOY m 

SPEECH PROCESSOR 


BY JAMES ANDERSON 

Copyright 1978 
Mimic Electronics 
P. O. Box 921 
Acton, MA 01720 

The Data-Boy™ speech processor is essentially a speech 
“digitizer” which uses a proprietary signal processing tech¬ 
nique to convert the human voice into a single bit data stream, 
and vice versa. “Digitized” speech is typically thought of as 
speech which has been sampled with an analog-to-digital 
(A/D) converter, stored in digital memory or transmitted in 
digital form, and then re-converted to analog form by a 
digital-to-analog (D/A) converter. By using certain char¬ 
acteristics of the speech waveform, especially the fact that the 
amplitude components tend to decrease with increasing fre¬ 
quency, the resolution of the A/D and D/A converters re¬ 
quired can be decreased from, say, 8 bits down to a single bit 
while maintaining intelligibility. When this bit stream is 
sampled at a rate of 8000 samples per second, highly intel¬ 
ligible speech can be obtained. The speech quality is close to 
that which is given by a CB radio. At this low data rate (8000 
bits per second), the sixteen hexadecimal digits, “zero” 
through “F”, can be spoken from the data stored in only 8000 
bytes of memory. 

Speech digitization has several advantages over other 
methods of speech production. First of all, the hardware 
required is fairly simple and can easily be mass-produced, 
thus lowering the initial cost to the user. Secondly, the soft¬ 
ware cost is small. Simple programs for sampling, storing, and 
playing back the speech data can be written with little effort. 
Also, the cost of adding a new word to an existing vocabu¬ 
lary is minimal. Finally, the system gives “natural-sounding” 
speech (especially when whole phrases are recorded and played 
back) because the speech was originally produced by a human. 

A one-bit speech representation has several advantages over 
other speech digitization methods, aside from the obvious 
reduction in the number of I/O lines. The speech can be stored 
in very slow memory (100 microsecond access time or less) 
and a few random bit failures in the memory will not signifi¬ 
cantly affect speech quality, as the speech data itself is highly 
redundant. Thus defective RAMs and ROMs can be used, and 
these are available at very low prices... so don’t base the 
cost of a speech storage memory on what you’re used to pay¬ 
ing for computer-grade chips'. Note that this use of defective 
memory is not recommended for use with, say, 8-bit A/D 
conversion speech digitizers as bit failures in the MSBs tend 
to give rather annoying “pops” in the speech playback. 

Another interesting aspect of the one-bit representation 
of speech is that it is very easy to do digital signal processing 
with such data. The Discrete Fourier Transform (DFT) can run 
in less time than it takes the Fast Fourier Transform to run— 


and with a much simpler program. The reason for this is that 
when the time domain data is always a “zero” or a “one,” 
all of the complex multiplications in the DFT turn into addi¬ 
tions. Thus it may be possible to do automatic word recogni¬ 
tion on a limited vocabulary in something approaching real¬ 
time operation. 

The Data-Boy™ speech processor system provides a 
low-cost, easy to use, reliable method of speech production. 
In fact, this method of speech production is the lowest cost 
of any method available where limited vocabularies are con¬ 
cerned. New uses for computer speech output, such as video 
games, aids for the handicapped, and perhaps even talking 
appliances, may result. 

Interfacing the Data-Boy™ 

The speech processor can be interfaced to just about any 
serial or parallel I/O port on a computer, as long as the port 
uses TTL-compatible signals. Any bit which can be changed 
rapidly under computer control can be used to produce 
speech! As a last resort, it is possible to interface the Data- 
Boy™ to a computer through the computer’s A/D and D/A 
converters, as long as the TTL conventions for signal levels 
are observed (this is applicable to large computer installations 
where user access to I/O ports is not available). 


300-/V 



Simple Configuration for Recording and Playback 


Figure 1 shows a simple configuration for the recording 
and playback of speech. The power supply, microphone, and 
speaker should be connected, but are not shown. An optional 
Light Emitting Diode (LED) is shown, which gives a visual 
indication to the user when the SQ UELCH threshold has been 
exceeded and data is present on the TO COMPUTER line. 


Page 30 

412 


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


Number 29 








The recording process is initiated when the user notifies 
the computer that he or she is ready to record (via a RUN 
switch or keyboard input, for example). The user then speaks 
into the microphone while the computer samples the data on 
the TO COMPUTER line. The computer stores these bits (the 
speech data samples) in memory until a fixed length buffer 
is filled. At s ome future time, th e computer puts the data 
bits onto the FROM COMPUTER line at the same rate at 
which they were originally sampled, and intelligible speech 
results at the speaker. Phonemes, words, or entire phrases can 
be stored and reproduced in this manner. NOTE: If phrases 
are stored (continuous speech), a certain amount of static 
(noise) may be heard between the individual words of the 
phrase. This can be eliminated by editing the data so that 
only the valid speech remains (set all the other bits to zero), 
or by simply recording the words one at a time and then out- 
putting them in succession to form the phrase. 

Sophisticated Configuration for Recording and 
Playback 

Figure 2 shows a more sophisticated configuration for the 
recording and playback of speech. The power supply, micro¬ 
phone, and speaker should be connected, but are not shown. 


Input Program 



In this configuration, a user speaks into the microphone, 
thereby automatically in itiating the recording process. As long 
as the DATA READY sig nal is active (low ), the computer 
samples the state of the TO COMP UTER line and stores 
these speech data bits in memory. The DATA READY signal 
line can be connected as an “interrupt” signal to the com- 



PATA - C co^paTfr. 

Sffrcff f/tic csset. 

Figure 2 


puter, if desired, or it can simply be sampled periodically to 
see if it is active. Speech output is handled in the same manner 
as before (see section E). A flowchart for a computer program 
which utilizes the configuration of Figure 2, and which makes 
efficient use of computer memory space, is presented in Fig. 
3. 


Output Program 



Number 29 


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


Page 31 

413 




















If only half-duplex operation is required, the speaker can 
“double” as a microphone. Speech quality may degrade some¬ 
what, depending on choice of speaker. The microphone input 
leads should be terminated (preferably shorted) when not in 
use, to prevent spurious signals from triggering the DATA 
READY line. One possible configuration is shown: 



If higher power output to the speaker or external volume 
control is desired, an additional power amplifier can be used. 

Speech Storage Space vs. Intelligibility. 

A common method for evaluating speech intelligibility 
is the “articulation test.” Typically, a person reads a list of 
syllables or unrelated words to an “untrained” group of lis¬ 
teners (recognition ability improves with practice) and the 
percentage of items identified correctly is taken as the arti¬ 
culation score. By choosing test material representative of the 
sound statistics of a language, a realistic test of the system can 
be made. Word articulation scores for speech which has been 
processed by the Data-Boy™ input circuit, sampled at a 10 
KHz. rate, and played back through the output circuit are in 
the neighborhood of 90% for trained listeners. When words 
are used in sentences, contextual information is present which 
leads to considerably higher articulation scores. To test your 
system, try recording the sentences “Joe took father’s shoe 
bench out,” and “She was waiting at my lawn.” Together, 
these sentences contain most of the sounds in the English 
language. 

For a fixed memory size, the amount of speech which can 
be stored is inversely proportional to the sampling rate. For 
example, if one spoken word can be stored in 5000 bits of 
memory with a 10 KHz. sampling rate, then two spoken words 
(each of the same duration as the original spoken word) 
can be stored in the same memory with a 5 KHz sampling 
rate. Thus it pays memory-wise to have the lowest sampling 
rate possible. However, there is a trade-off in intelligibility. 
To minimize this trade-off, the following two methods of 
speech recording are recommended. 

1. Words containing mostly low frequencies (eg., “one”) 

can be recorded with a much lower sampling rate than 


words containing mostly high frequencies (eg., “fix”). 
Simply store the sampling rate which was used to record 
the word, and use that same rate to output the data for 
playback. 

2. The effective amount of storage required can be reduced 
somewhat by using phoneme concatenation. For example, 
the spoken word “seven” can be stored as an “s” sound 
followed by an “eh-vun” sound. The same “s” sound can 
also be used in other words such as “six,” “s” plus “ick” 
plus “s,” without having to re-record it. Similarly, one 
recording of the word “teen” will allow you to generate 
“seventeen” with a simple program which outputs “s” 
plus “eh-vun” plus “teen.” The method is quite limited 
with this hardware, however, and in general will not pro¬ 
duce acceptable speech. For example, when the spoken 
word “dog” is broken up into “duh” plus “aw” plus 
“guh,” the resulting audio does not sound like the intended 
word. This is due to the fact that in natural sounding 
speech, the end of one phoneme often blends into the start 
of the next (but not always, as was shown in “seventeen”). 
If all of the phonemes are recorded separately, some 
method is needed to blend them together—a formidable 
task indeed for this method of speech production. 

Other methods, such as encoding the bit stream, are pos¬ 
sible but may prove difficult to program or result in little 
memory savings by comparison. Note that the two methods 
cited above apply to the recording of discrete spoken words. 

A reasonable vocabulary can be stored on a standard 
floppy disk: 240,000 bytes can contain 240 seconds of con¬ 
tinuous speech (or about 480 discrete spoken words) if an 8 
KHz sampling rate is used. Alternatively, a cheap semicon¬ 
ductor RAM or ROM system can be built to any size, using 
slow and defective chips (with random bit errors). A few ran¬ 
dom bit failures will not significantly affect speech quality, 
as the speech data itself is highly redundant. However, bit 
failures of a periodic nature (eg., every eighth bit set to a 
logical “one”) will tend to introduce undesirable “notes” 
or “tones” into the reproduced speech. In any case, it is more 
cost-effective to use an inexpensive “speech storage” peri¬ 
pheral mass memory rather than expensive computer main 
memory for vocabularies of more than 20 words or so. 

Intelligibility of speech produced by the Data-Boy™ 
speech processor can generally be described according to the 
sampling rate used. A 5 KHz. rate gives marginally intelligible 
recorded phrases. An 8 to 10 KHz. rate gives highly intelli¬ 
gible single words or sounds and extremely intelligible phrases. 
Sampling rates greater than 15 KHz. merely waste memory 
space while offering no appreciable improvement in speech 
quality. 



414 


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


Number 29 


x 


X 


N 

X 

z 








CO 





z 





z 



o 



X 

z 

H x 



x e- 



»- 

X 

3 H- 



X X 



<i 

h- 

x cn 


X 

K 

cn 


X 

cn 

i- >- 



h- <r >- 

X 

X 


>- 

3 cn 


> 

•H »H X 

X 

Z h- 

X 

cn 

o 


X 

X X 

h- 

u >- 

X X 


o 



X 

Z 

h- X 

O X 

o 

X K 


<r 

<L O K 

PH 

M 

o z 

r- 

X 



H- t- PH 

O 

X 3 

x <r 


o z 


<i 

<L Z 3 

X 

X 

cn 

Z 

X 


X 

X »-l 

p" 

H- X 

>- 

X 

Z 3 



X 

X X 

X 

<1 X 

3 

X H- 


h- 

i- z cn 

3 z cn 

cn h- 

X z 

h- 

3 X 

X 

X 

X 3 O X 

o o X 

X X 

X <c 

X 

H- X 

X 

CD 

CD X X >- 

z x >- 

X CD 

X z 



X 





z 

o 

X 


















X 

3 

X 

X 


X 

PH 

X 



1- 

cn 

X 


V— 






•z 






X 


o 

►— 

X 



z 

>- 

z 


z 



X 


o 

o 

<r 

so 


3 


X 


u — 

■x 

X X 

X 


u 

<T 

X X 


u 


X 

X 


X 

h- 



( - 

X 

x 

h- 

<L 

z 

X 

3 X Z 

z 

c 

h- 

X 

X o 



X 

z 

z 

v-t 

c 

z 

o 

o 

T-* 

o 

x 

3 

*—i 

3 

cn 

X - X 

X 

PH 

PH 

XI 

3 ►— 

CD 

H-t 

K. 

X 

PH 

i 

c 

o 

GO 

CD 

X 

X 

'C 

o 

X 

z 

>- 

♦ OH 

t— 

X 

X 

X 

x cn 

* 

X 

o 


I- 

*- 

X 

z 

-tft 

4* 


** 

H H CD tfv 






X 

f— 


<i <r 







<1 

<E 

<1 

<r 

<x 

<1 














X 

X X 


X 

<r <i 

X 

X 

u 

X 

X X cs 

<1 

<1 

c 


<E 

CJ 

X 

<r 

X 

3 

3 

3 3 

X 

X 

X 

X 

3 

X 

X X 


cn 

J z 

o 

X 

X h- 

cn 

o 

X 

z 

Z X 

X 

X 

»- 

X 

i- 

X 

X z 

X 

z 

5 

c 

c c 

z 

z 

CJ 

X 

C5 

Z X 



CJ 3 

X 

X 

x cn 

<E 

X 

X 

X 

H4 CJ 

X 

X 

cn 

X 

cn 

X 

X 

X 

X 

3 

X 

X 

X X 

X X 

X 

X 

X 

X u 




CJ 













CJ 







X X 

X 



Q 

X 

X 

X 







O 










X 







X o 

z 


X 

z 

X 

X 



H- 

c 

cn 


X 










c 




X 


X 

X K 

u 

X 

X 

X 

X 

X 




3 

►— 


o 










X 




o 

<x 

<1 

1 - z 

X 

z 

z 

X X 




3 


3 


o 










X 




x 

1—i 

KH 

3 O 

t—t 

X 


3 

D 




a 

# * 

* o 


* X 



*■ 



* 




* X 



* 

* cn 

* X 

X 

o z 

* X 

X 

►“ 

X 

X 

cn 



<r 3 


o 

in 

in 

<r 

<r 


fS 



<T 


bn 

S) 




n 









X 

co 

X 

1 

X 

H X 


CD 

CD 

CD 

H 

00 


CO 



00 


GO 

on 




X 









X 

X 

r* 

o o 



O 

_ 

o 


o 


cn 

00 

_ 

c 

»H 

H 


Q 

X 

o 







<1 


X 

X 

<r 

X 

CD X 


o 

o o 

o 

CD 

o 


o 


o 

o 

o 

o 

o 


X 

X 

X 







N 




X 

X X 


X 

rs 

CD 

>0 

<1 

>0 

00 CJ 

IS 

SO 

rs 

SO 

IS 

>0 

c 

S3 

o 

X 






CO 

X 


o 

X 

o 

X 

IV IS 


u 

<1 X 

rs 

rs 

IS 

n 

O X 

cn 

00 

X 

<r 

X 

X 

<r 

n 

CJ 

IS 






c 




X 

X 

O 1*5 


>0 

O- X 

X 


<r 

rs 

Cb <z 

x 

X 

_ 

<r 

>0 

o- 

u 

X 

X 

»H 


■0 


<r 

bn 

<3 

rs 

co¬ 


z 

<T 

on bn 


U0 

un bn 

bn so 

so 

>0 

<1 >0 

o 

>0 

rs 

IS 

IS 

rs 

rs 

IS 

rs 

CO 

y-f 


U-4 X 

00 

CD 

CO 

CO 

co 


cn 

H 

eH sH 


tH 

tH y-i 

tH 

tH 

*H 

H 

tH TH 

sH 

tH 

y-i 

*H 

T-1 

T* 

«H 

H 

tH 

y~i 

o 

o 

*H o 



sH 


H 



o 

o o 


o 

o o 

o 

o 

o 

o 

o o 

o 

o 

o 

o 

c 

o 

c o 

o 

o 

CO 

CO 

X X 

o 

o 

c 

o 

o 




X a 
<1 z 

IX c 
CD 

O X 

X H- 


x >- 
u x 

PH 

o x 

3 X 
<1 
UJ 3 
iX X 
O X 
t- <1 
CO X 


UJ »H *H 

X o o 

X CD N CO 

<x 

X H- h- H- 
CD <E h <1 
A 

X y UJ 

X H o 


05 


05 


X <1 3 X 
I X I 
uj <i k- <r 

XhDw 
<1 X O X 
3 

05 05 

X X U 
O 05 05 

05 X 3 


<1 

X 


x 


x 


X 



X 

p~ 




X 


<T 


cn 

X 


X 

X 




o 




x 

X 


X 

X 

cr. 



X 

cn 

X 


X 

z 


X X 

>- 

x 

x 



X 

X 


3 

Q 


HH 

X 

X 

z 


X 

o 

X 


a 

X 


X z 


X 

CJ 

X 

c 

X 

X 



X 


PH 

X 

z 


a 


X 

3 


X 



c 

X 


t-1 

Q 

cn 

z 

X 


x 

• 


X X 


a 

X 

x 

cn 

o 



3 

z 


<Z PH 

3 

x 



X 

u 

X 

p- 


1—1 


X X 


c- 


X 

X 


<1 

X 

Z 

CD 



X 

X X 

X 

<1 

X 

X 

X 

z 

X 

X 

X 

X *— 

z cn 

3 z cr 

cn 


■— 1 

X 

X 

g 


X 

X 

X 3 

o X 

C 3 X 

X 

X 

<T 

cn 

CJ 

X 


* 

X 

CD X 

X X 

Z X X 

X 

X 


►H O 
X o 


<t 

ph X 


UJ 

X 

XXXX X X 3 X 


Z X 
UJ <T 
X UJ 


►“ XX 

Z XX 

CJ xx 

K X K 3 


XX X * X * o * 


3 

X CD 

Z X 

PH O 


* * * * * * 


N 

X 

<x 

z 

PH 

* 


x x 

X X 
X X 


ZXXX<I<E<TXXXXX 

OXXXXHS-XXZXZ 

cjucjcjxcocnxcjHrjiXi 


X 

-I 


X <T <E <1 X X 
X X !- Q 05 X 
X X X X 3 X 


X 

05 

X 

X 

<r 


x 

cj 


o 

3 


X 

o 


05 

-* * 


z 

X £J 
<1 X X 


z 
x : 


x x u : 
cn o x : 
xxx. 


X X 
Z X 


CD ph 
*■ X 


<E C 

R S - 

X X 0j 


X 

X 

z 


<1 u 

X X 












0- 


rs 




V 


o 

so 


<r 


IS 



<r 

S5 












3 


CO 




CO 

X 

CD 



CO 


CD 



CO 

CD 



o 

o 

o 

H 

re 

n 

«r 

rH 

m 

r4 

o 

— , 

00 

o 

CD 

TH CN 

▼H 

H 

o 

o 

tH X 




CO 





CD 

o 

o 

o 

o 

o 

c 

o 

o c 

o 

o 

X 

CD 

o 

C <r 

X 

o 

CD 

o 

o o 


c 

o 

o 

o 

O 



X 

X 

n 

X 

X 

X 

-0 

IS 

fS 

X 

u. 

X CJ 

so 

X 

SO 

is >o 

X 

X 

<r 

0- 

<X S5 

CJ 

CJ 


•<o 

f> N 

■0 

<z 


u 

so 

•o 

so 

-0 

so 

CO 

<1 

<r 

o 

so 

O X 

CN 

IS 

00 

X 00 

X 

L) 

IS 

so 

rx r-j 

c 

X 

r-j 

CD 

X 

X 

<r 

o 

o 

1*5 

bn 

fx 

0- 

X 

X 

X 


3 

-0 

CO 0- 

ft 

X 

tH 

n so 

CO 

X 

X 

H 

rn so 

X 

o 

CJ 

X 

o 

3 

so 

o 

CO o 

o 

o 

c 

o 

o 

o 

■»H 

H 

y~* 

•rH H 

1H 

tH 

r-j 

CN CN 

CJ 

r-j 

C l 

m 

3 3 

3 

3 

3 

3 

<r 




H 

H 

H 


▼H 

-H 

P-1 


tH 

»H 

y~< 

»H »H 

»H 

Y-t 

•»H 

H tH 

T-l 

H 

y-t 

tH 




y!+ 

H 




o 

o 

o 

o 

o 

o 

o 

o 

o 

O 

o 

o 

o o 

O 

o 

o 

o o 

o 

o 

o 

O 

o o 

o 

o 

o 

o 

o 

o 

o 


Number 29 


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


Page 33 

415 


0147 26 FU EINr- *-i MAKE SAMPLE RATE 8 KHZ BITCNT 0134 BUFEND 0187 BUFFER 0189 CLEAR 0116 

* BELA i 0143 DELAY2 0179 DONE 014B LOOPI 012E 

0149 20 E3 BRA LOOPI CONTINUE L00P0 015E M0NT0R E0E3 0UTEEE E1D1 OUTS 0156 

* PI A 8014 PI AB 8016 QUIT 0153 STOP 0181 

014B 86 45 DONE LDA A t'E ‘END - PROMPT TEMP 0185 TIMER 0186 



Whatis: 

An Expression Evaluator for the 8080 


BY MIKE GABRIELSON 

Box 2692 

Stanford, Calif. 94305 

Programmers often need to manually verify the results 
obtained by a computer, especially while sitting at a console 
and debugging code. Pocket calculators with capabilities like 
hex or octal readouts and Boolean functions are a conven¬ 
ient tool, but ignore the fact that the computer itself can 
operate as a handy desk calculator. 

Whatis 

Whatis is a program for the 8080 that can evaluate arbi¬ 
trary arithmetic and logical expressions, such as: 

5 * (3 - (6 * 2)) < = ( # FFE / 2) 

Whatis operates as a subroutine. It accepts the address of an 
ASCII string that contains the expression to be evaluated. 
The end of the expression string is marked by a character 
called EOS. In the accompanying listing, EOS is equated to 
zero. Whatis will evaluate any string and return the expres¬ 
sion’s value in the HL register pair. If the result of an expres¬ 
sion is a string, the value returned in HL is the address of the 
string. However, if a fatal error (such as division by zero) 
occurs, Whatis will load the address of an error message 
string into HL and then call an external routine named 
SABORT. Whatis does not expect SABORT to return control. 

Whatis Input 

Whatis breaks the expression string into a sequence of logi¬ 
cal syntactic elements called tokens, which are special se¬ 
quences of adjacent characters. A token is either an operator 
or a constant. 

Operators 

Operators are used in conjunction with constants to form 
expressions. The operators are: 

6 dyadic and 

* dyadic multiply 

+ dyadic add or monadic plus 
- dyadic subtract or monadic negate (two’s comple¬ 
ment) 

/ dyadic divide 

II dyadic remainder 

< dyadic less than 

> dyadic greater than 

<= dyadic less than or equal 
= = dyadic equal 
>= dyadic greater than or equal 


« dyadic or monadic rotate left 
» dyadic or monadic rotate right 

I dyadic inclusive or 

II dyadic exclusive or 

~ monadic one’s complement 
~= dyadic not equal 

Constants 

Constants occur in one of two forms: numbers or strings. 
Numbers represent values for use in expressions, and can be 
represented in decimal or hexadecimal. A decimal number is 
a sequence of decimal digits. A hexadecimal number is a se¬ 
quence of hexadecimal digits prefixed by a pound sign ( #) or 
enclosed in single quotes and prefixed by an X. All numbers 
are evaluated with 16 bits of precision, and overflow is ignored, 
so that numbers are limited to the range 0 to 65535 decimal 
(0 to #FFFF hexadecimal). 

Examples: 1234 

X’ face’ (64206 decimal) 

#32B (811 decimal) 

99999 (evaluates to 34463 decimal because 

of overflow) 

Strings are any sequence of characters enclosed in single 
quotes. Each character represents the corresponding seven 
bit ASCII code, with a high order eighth bit of zero. Two 
consecutive single quotes are required to represent one single 
quote within a string. Null strings are ignored. 

Examples: ‘Pack My Box With Five Dozen Liquor Jugs’ 
TJSERS”S MANUAL’ 

Expressions 

An expression has the form: 

{|operadl}operator} operand2 

where “operator” is one of the monadic or dyadic operators, 
and “operandl” and “operand2” are constants or expressions. 
The brackets j } denote optional items. Dyadic operators 
require both operands, monadic operators require only 
“operand2.” 

All operators are of equal precedence, and expressions 
are evaluated from left to right. Parentheses around an expres¬ 
sion may be used to alter precedence; the innermost expres¬ 
sion in parentheses is evaluated first. Expressions are evaluated 
to 16 bits of precision with no check for overflow. All arith¬ 
metic operations are performed using unsigned two’s com¬ 
plement arithmetic. 


Page 34 

416 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 29 





Examples: 3 Evaluates to: 3 

((3)) 3 

-(+3) #FFFD 

~3 #FFFC 

1000*1000 16960 

#FF & 300 #2C 

16//6 4 

1+2*3 9 

1 + (2*3) 7 


(#2B - (7 I 12)) +(5 I I 13) 36 

Relational Operators 

The dyadic operators 

= = ~= <=<>=> 
are used to form expressions that evaluate either to zero or 
to one. All relational operators perform an unsigned magni¬ 
tude comparison. If the relation is true, the operators produce 
a result of one. A false comparison results in zero. 

Examples: 5 == 5 Evaluates to: 1 

3 + (2 ~= 6) 4 

(1 <= 2) <= 3 1 

#FFFF <0 0 

The operators 

« » 

can be used as dyadic or monadic operators to rotate (not 
shift) 16 bit operands. Rotation implies wraparound of bits. 
Shifting can be accomplished with the multiply and divide 
operators. When used as monadic operators, operands are 
rotated one bit. When used as dyadic operators, the first 


operand specifies the number of bits to rotate. 


Examples: << 2 Evaluates to: 4 

» 3 #8001 

> > ( < < 2 ) 2 

3 > > #f0 # IE 


String Operations 

If a string constant appears in an expression with oper¬ 
ators, the value of the string is the ASCII code of the string’s 
first character. An exception to this rule occurs when two 
strings appear with a relational operator: then a character by 
character comparison of the two strings is performed, using 
the ASCII code to determine relative order. If the two strings 
are of unequal length, the shorter is padded on the right with 
blanks. 

Examples: ‘A’ + 1 Evaluates to: #42 

‘ABC’ & #ff #41 

‘CAT’ < ‘dog’ 1 

‘PAD’ == ‘PAD ’ 1 

‘123’== #31 1 

Final Notes 

The Whatis program listing was generated by a one-pass 
assembler. As a result, all forward references show up as 
question marks in the object code field. 

Provided with the necessary input, output, and error hand¬ 
ling, Whatis can be a useful addition to a programmer’s toolbox. 




Number 29 


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


Page 35 

417 










5 


>• O — X V 
IflZ O Q 
=> < to h h 

O - C Z 

-■ u x a: os 

> i< H W U 3 

uu cxt- 

x x o 3 O x 

o. t- w a 

H CO • CO 1/3 » 

u 4 o ul ui O 

O 3 Z >« X Z 


Q -E-* CO * 
30U1I/IU0 
- Z O •- X z 


JXQaUIIUCKUJ-tQXQQ 


OEXICCC 

X X c c c u 
x ;d z x z * 

SI Q D J D < 


zuzkzsu a o 

ZKU4U<31i.UlflZX 

OOZQ-Xq,hOXXhH 

c'li.4J4aiLU£4«U) 

u u a ia. io in |H | 

OCQ.JXXXXXZXCOX 


O.Q.XO 
3 a o || 
co H ' co o 


cu a, a. x c 

X O O X IX J 

£ < ix o 3 x < 

» X O O I CO CO > 


XXQOZXCJZXX X X to 


OX J 

xco>*-j>>x>«x>m>>ffl>oQe- 

*OO0>C0000>Z0O00ta0ZCX 

3xxs:z:uxxxs:z:>-z:tnxxcoxr>ox 


< - - > H 

•• QXNXUOIO 

co jonunxx 


CHXc-lXc'3XC'lXc'JXt' 

ycouououoOTU'- 


CO J m J x > M _J X X J X 
DXX<NUOXN<I OCX 

xjju’^qzo'-ju'-s xun 


X O X X X o 

cj O O w M o 

U O u 
o -J to CO 

3 Z O Q Z 

H X O O O x 

X E- O O X 
CO O 

H X z Z 6- 
X XXX 

OE-HxxH 
XZUOOZ 
x C H E-* x 
O X X X 

< X C 3 3 X 

X Z3 X X X 3 

= U O Z Z U 


X E- O O 
X O Z Z CO 
O X C C H 
X X 


X X e* Q —• 

x > to z f- 


H > O CO ' 
X C Z X O 
'JlAXXZ 


CO 0) z 

O CN 

C CO Q X Q Z 


x a c 
to x x J a h 

3 XU X O X 

x j a to x x 


1 . > x > x - E- X«CJ«E 

CcjOZOSTnXX £ > Z X L 

Jnzr — zurjxx u z: n -> • 


> x n > x e-* 
O £ Z O £ X 
£ U X £ U X 


"UHUf 
I •• •• X Z X £ U 

10 CO O X U CJ 0 

3t*Z 
■« X X •• 




Page 36 


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


Number 29 


































2 


10 u < u a. u ui 

uz a. z x o- z (\. 

06 3 O H 3 to 3 E-U 

<x* to h to x to u to mq 
' Q to to *XXX ‘ O to to ' X to to -tj > 

OZ<UOU.<UOhi<UO>-<<UOi-iO< 

z<~->«z3K>.zx~»zH-'>-zaz2 


a u 
u M 
H a, 
U M 

2S 

< 3 
I 

u 

H 

U X 

z u 

M J 


KUhE 
Q > X H 
Q < id to 

< x z 

a. 

H Q H U 
tO Z CO CO 

O < o x 


as s x 
6 U O H <C 
iHEEE 


O X z 

DHh 

o •-> a 
x h 
o to 
z to 

s -« H H 
Q O to 
Z 3 < 
to a 3 


J to < 

C HZ 

U 06 O U 
<03 
j a o to 


z to H co u. 
3 H O 3 a 
0 3 C 

: * 3 oto c 

- to O 3 < 

CO 

*>*oifl »e- 
5 < » to o a 
£ z h x z c 


0.22 
O < O 
z * z 

tflUOH 

to z ex 
to x H H 
EZEtn 
O < H 
Q to Q 


3 Q X Z 3 > 
C O H Z 
O H 

- E- to to - to 
d z co x o to 
3 « X < Z >* 


O Z O 
Co O O 
*-> u 
to to 
co as e- 

Q to U 
O > CO 


CO Q u 
>6 < 

O X H 
H Q O 


to to 
co at as 
Quo 
O > E- 

u o2 
Z M CO 
to a a. 
x < O 

°s* 

H Q to 
to z x 
o < o 


H . 


H as u 
O to 
a tu to 


who to » 
X to O to CO o 
H O 3 <-> >* Z 


H Q CO 
to z to 
o < to 


to* a* o 
*<s < <j> co 
<* z* a 


H H 3 

MU' to SC 
H H' HU 
CO CO* to < 

O O' O CO 3 


£ x < 
* * >. 
QUO 


« a 

5? 22 


z > a 
to •-• < 

OS Q CO 


3 0>< 

Q CO tO 

- ' x a 


l&isssislsi 


> M W 

d O a. > f 
CIUZC 


> M l-t 

0X00.0 

z o n o n 


J»J>Xk 
X 3 < o z X f. 
3 X U Z ► 


3 X X X X 3 ME 
*»<0>000<0>u 
-sooxa«ao'->xo 


"H Jh 

> > < to 

Z X O 06 


"H J(- 
> > < CO 

X Z O X 


►H W 3 H 
:> > < to 
JCZUE 


o *n oj vo < o 


n r- < a m a 


D S SMS S S S 


< < to < r~ i 

Htsns m i 

to to a co co h a 

M ® o X o in o 


O * 

E-* x 
< H 
06 Z 
CO *- 
X O 
O x a 


< as 
to O 
to H 


O as 
co O 
x e- 


to >* 


06 U X 

q x o h 

to x o < ' 

x z a H — x a 

QUEEtO' to O 

Q U X < CO X 

< x O 3 E- x 
O » M 
E- < to «H ' to 

coE-coOtotOOco 
OtOB-ZOMZB- 


O to >• Z 

H to S- to < 

< to x > as 
X 06 Z HU 

u a u < x 

X Q X O 

OCX 3 
o u 

H H < H > 

u u H O u < 

o o to z u to 


Q tfl >• tfl o 

Z to H to z 

< U X u » 

X x x as to 

CO Q U Q to 

X Q Q m 

O < x < x 

o 

H H < H - 

to CO H to O 

O C3 X O Z 


< J X 
os x O *-• 
CO u x H 

£ fe g 

O u u 
X z H Z 
z 

H H M OS 
U U O O 
O 3 X X 


c to o to 
a to 3 u c 

Q X O X 2 


X H X 3 < 
O X X X X 
x x O | as 
OH « ti- ~ 


«< XX «< -H H 

XHXUOZ E- OS 3 o x 

O X X X X < xxxtoo 
X X o |XX3 ZO ICO 3 

OH - CO o O to < - 3 - < to 

XXOQUXXXXQOXVrXX 


H H X H 

X X X X 

X X H X 3 

X X 3 X x X < 

»X ' X * X > 
< X < X < X u 


« < 
X X 
X < 
U X 
X CJ 
X 

Sfe 


C U < X o X 


O HZ 
X X 3 
tu M Z 


o u X M 
H X 
z u u 

e to X 3 
X Q 3 
u O Q < 


X ' <' 3' 3' 


g. 3. 3. 3„S 


S- v 3.-'2. > 


33m3c-J3XX3m3mnXXE 

<XX<Z<33XX<XZOOC 

U33UOUXX33CJ3UXXC 


X •• 
O Cu 
X O 


> 3 > 3 m 3 X 

O < o < >< z 

Z U Z U Z U 3 


o •• 

X 
1 £ 

I 22 

I U U I 
I O X I 


x a a 
X 3 > X 3 X E 
3 X o z X O Ci 
X 3 JT •- X X Q 


3 > M M m M 


jinunuTu^UTU 1 - 


BOt-jUt-SUZO 




nt'4QS5M- 


1 U fd o u X t. 
3 si m vo av < c 


U U 

O O U t_) X o 


to cn r*- cm cm to cj o ^ 

.M"l\Ct'®UlUQQQQQQQQ3 




Number 29 


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


Page 37 

419 































O CO 
X X 
S 3E 


< J :c 
Eh X W 
IS) 10 

z 3 x 


4 t3 
X EH o 
O X •! 


tO W - 
CO X tO CD 


— 4 Z> O 


II to 
C 4 X 


O E-' 
co O s 
Q Z ' 


' 6 -.' 
«j O " 
• 2' 


W »HW • 

n to o to to o 


to to Z £ 


: in x is) x to 


in E'¬ 
en 

to to o 


t to a h to 


t-1 i JL. 

QJIHOlOO 
«- < 4 E- Z X Eh 

-• a >• < t- < 
» to E-* Z E- X X 
n * > — a. to a to 
0Q<ZOZfl.ZH 


X X Z X 4 X 4 X 

X E- 3E X X Eh X E- 

to h a.DO a-atca 
z in U' — -h a x o z o x 
* ox z to»to-«c»E-« 
<£ X to <> — xo4inxxxx 


O x 
in o 
x a 


O E-* 

o a 

X < to 


vo z to 
— ox 
Z O 


Z 4 X 

4 X O 

XX x a z 


JtflXIfl 

Z' o« 

Q H 
to Z Eh tn 


to x to to 

X X o o 
O E- X X 
< < 
O £3 > > 
*H Z 

x < in in 
to X* ' 
x to a a 
o x z z 

z o 4 4 

x a 

Eh U X tO 
— — X X 


Eh > H 
CO < to to 
uinua 


in x < 
O 2 
X Eh x 
0 4 3 


X X O to ti 
o4uo: 
Z Z X v 




O Eh X 
3 - X 
H Z O 


4 X X 
XXX 
X EH EH 
u X z 

D O X — 

> O 
h a 4 x 
n z x 


Eh — X rH * 


SSF. 


o x o o in in x 


— O — OO—OE- 
XZXXZOEhX 
uxuuxtninx 


x x — 4 — J — X E 
JOX>t-XxXxtj 
iQwxmjinowQ 


5W3WS 


vo < m a- — a <• 




nvOO'XOaQXB 


n ov x u x x a 


* u o o o o c 


rtriminifitnintrtt/ 


nmmmmmmmir 


CO 00 CO 03 CD CE 








'iflMOO'SHNI'l^inifiMOWSHNn^l/'IOMOO' 

-iinmu->ir>voiovOvovovovO'«ioior''f'-r'r»r'-r-rHr~rHr~ 


o vo vo vo vo 


O x X x ii 

a X X o 

z v 4 x x E- z 

x x x Eh 4 a 
SC X X Eh X Eh 4 
0 0 4 a x x x 
Eh X Eh O - X 

x — * 4 

e- a o in * x 
xzocnxoxtn 

(34JHXZU1H 


Q X 
4 > 
Z Eh 


4 X 
Z O 
O X 


Q X X O 
Z 4 X X Eh Z 

X X X Eh 4 Q 

X X Eh X Eh 4 

O 4 O X X X 

Eh /s Eh O m X 
X - • 4 

Eh Q O X * X 
xzocnxoxtn 

04XMXZX— 


5 H Eh 


x n- 

Z O' 


Eh >. 
X X 
O 4 


in Eh 

4-0 
x O x 


. 5< Eh 


D > X X O Eh 
3 4 O X O X O 
x x x a o x Eh 
' a a o > 

0 O 4 EH o z a 
JZZOUOOO 
-4 — 00404 


IS) o 
Z X 
O X 
U X 


XX X 
fc» Eh X X 
Eh O > Q 
X O 4 Q 
X OX 4 

X 4 X H 
X 3 X 
E- Eh O 


H X Eh 
3 I X 
* 4 O 
OX* 

5°S 

u O' Z 


0£^<® 
XXX 
O Z Eh 


> Eh in X 


I) X a 

j o x > 

h z o a 


X o 
E- Z 
4 

X Eh 
4 - 
X O 


X Eh 4 

X X X U4 *. UJ 
» -XX I * 
O Q 4 X X O 


‘.S 


X — 

x a 
x 4 


>><XcvJ>><X 

rzoonrrox 


o a 6- x « a 

•H EH 4 X o x II 4 
X O X O X O' X 
0042x0X4 


IS) X 
E- X 
X z 
4 O 


— Z 
O X 

- o 


O Eh 

a o 
4 Q 


< ® E 1 U E 1 XX ' 

6 ».xxo ' * e 

xxoozxaxxxov 


a £ a 


X X i_ 

H> — XXOQ>>QQQ-i- 
30>44Z4004440< 

'jrzoooorzooQxi. 


x - Eh 

4 > x 
OCX 


T. VO Eh 
O O x 

S IS) O 
X. X 


O pH Eh 

-OX 

•> 9 52 g . 


3 X — O 
I4XZ 
> O X • - 


> — _ 

Hi 


E 4 X 

5 Q £ 

I X X X X 4 Z 


J Q a Q Q X X 
i 4 4 4 4 4 Z 

? o a o o o n 


a a a 

x x o 

Eh H SC 

4 X' O' O O 

* * X O X O 4 

004' O' OX 


X>> — 

O O O X f 
X Z Z O i- 


OxXXXXXXXti 


rinvo rv eo a> ® - 


HiNn»uii«r't0 9iSH(vn»i/ 
-iiovnininininininvovovovovovi 
'ininininmi/iininitMnu'ininu 


'in^UlvOMOO'SHN 

'r'l'M'i'M'inco® 

runinininininu'ininm 


Page 38 

420 


Dr. Dobb’s Journal of Computer Calisthenics & Orthodontia, Box E, Menlo Park, Ca 94025 


Number 29 






































ur 


uJ I h 

a. \ -J 
° \ 3 

O Q 
i X 
E-* ll 
.. x 
£h 01 


hZOi/1 * 

CO O U ul O 

& a ~>- z 


S o — 
Z (V 
u >-h o 
x h x 
O < ui 


CO 3 

S-ZOM ' 

uouuo 

O Q '— >• Z 


Z J 
2* 


O Q 

f. 


ul S Q X IX 

- » * | a. to 

u x < co x eo a a. 


a > co u x 
O -• * * oi 
x a x j a 


<n x x 
a. > x 
O — <A 


a. q 
O * 
a. < a 


a < x a x x 


a. o xx 

O * |- 

x < co x < 


£-* < 
o a: 
< xx 

* ioi 
x o x a 


x q < co < x 

O - ' * *ui 

x<xx<-j.jx 


X Q < U1 < X 
O * » » «01 

X<XX<J.JX 


x a < to < 

O * 

X < X X < J uJ 


>M>< Q X X J Eh 
OXO«N<UI<U 
ZJXOnQQ'->OX 


_J J _l l— V J > < > U > J > > J > X X J Eh 

< < < uJ v <0XN0<0<00<0UX<UJ 
UUUX UXO»-jXXXXXXXXQnUX 


J>< > X > X > > X > x X J EH 

<0XN0<0<00<0UX<U 

uxorjxxxxxxxxonux 


J><>X>JEh 


J><>>4>JH 
<oxooxo<uj 
uxoxxoxux 


J > < > > < > 


Q<m<oXQXXUXi~xmOo% 


Q < 


u X X X X Q 


auOSH(vn«fuiieM8(jiui>.os5 


■MOr-a]»®H(Nn<ri/ 


H U u u 

n'»rir>eoo\<muatiJX®'M^'r-cocs>®oo 

'KN(NNN(NNNNNNninnPinf | innnnn'nn 

SQlS®SSISlSOSISEllSISSISOISOISS m "’ m 

, 'Co<7'®^H<NroHrinvorHwai®<HrMn>»invor~ 


Q < ■» f- c 
UMSior 
UQuJU.<S'-i->Tini/-iinincDCTN<c 


O < t. 


IX JllOMOffl C 


u h w C' (Q Q U 

U < vo r~ < o 
•*■ ao O' < 
O IO to ifi 
s fa ® si 
n n x in 


O Q 
z z 

-I < 
X X 
H UJ 
C/1 X 


c o z oi z 


x x z x z ; 


* -J 6- > 

• <oif 
> — 

j a 
» o x : 
C Z O *1 
1 < X U 


- r- hi X 
•MQOI 
* O X 

U O 

1 N 

. E- E- 
tuum 
1 Q O - 


in - Eh w u 
U O UJ o hi X 
X Z O Z >* U 


< UJ 

X 

o < 

z 

< X 
X Eh 
UJ O 


° 2 
X X 
UJ z> 


2£S 

Cl] o u 

89* 

c. 

EH eh * 
UUE 
O O 0 


> > 
< o 

01 X 


Eh O] Eh 
< aJ X 
XXX 
ui a id 
x a 
O < x 


xxx x 

O U O H 

< x z 

01 Eh o O) X CO 

01 01 Eh 01 X u 
UJ < Ul Eh J UJ 

x s x x z a x 

Q Id Id □ h < a 
O Z X Q o EH < 
< O < X Eh 

co O 

e- > Eh Eh Eh H Eh 
I d < Id Id Id Z Id 
OOIOUO-U 


01 01 01 
a o 
z z z 

22° 


E- O O) 
Id Q D 
U < X 


< m o u < 


coy<oy>ZNX>zo>o 

jxRux5<j:u’-iuxxxxq 


I 1 h I h Eh 
/ o > y > to 
tKsx 


SHSs 


Z X 
I < => 
I X EH 


a x a 


-H Eh 
O X 

oi o 


Q Q CO X < X b 


els 

CO X 
X Eh I 
O 01 

O CO 
E X 
P* Eh I : 

58 i; 


<<Nyoy5uoxuOu 

au'-jQXQiaxojxxo 


X < X «r H 
E- X -d £ CJ X 

axiidoio 

X O If-ZO 


X EH JO 
Eh XXX 
X O < < 

X £ X a Q £ £ 

Eh ' * a a » 

1X<X<<UJXO 


JQ JE- 

< < < Cd 

u a u x 


o a 
a a 
< < 


x uj < o < x 

O » » - * 01 

x<jj<xxx 


)ooo<no<u] 

: 01 £ £ O) £ U X 


ot co in id to id id ui 
OUldiOlNIdnU 
»iciifi«(j«0'Oiin<iliUQtdSiNni' 


«l CO Q u <N u 
OCT'<H5c_IUXf' 


ruo P* CD l]t Q r- 




Number 29 


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


Page 39 

421 
























:u)qu. 

' O — XL 


Z bi E-E- 
<QQ>>- 
as o z to cd 
bl U < 

CL CC HQ 


bl bl to bl 
I I H I u t 
QHhHI" 


fiOMJa-aa 


to ce i/i 
Q. O W) ('• 
OHUJ 

S X J 
Q => 

IUQO. 

H a. < 

O —x 
u o 
> E- E- < u 
<UlalHU 
in o e> w > 


Q Q 
< « 
» >• 


\ Q Q -«- 


a a 
< < 
z z 
ll il o o 

' A . £ £ I 


HUD £■ 

0. CL X Cl. C 

l z O iz CD ; 

* < *bl < - «; 

1 CC Q Q a Z I 3 


bl ul 

z a. 

O O 


Z-iXXJXSX 
-W1 * Ul * V) W U1 

< a. < a. < a a. a 


-ui>j>4a.JH 


uu < x o IE- c 


> j ►- .j >xje- 
3xx<isiozxuj 


E- E- X 

aoiJ>£lbXai£tX OU. H H U W < 

QDDHUUUZOOOHUHUUQKOUOa 

<U1£QCJiX<hK|i 14JUU Z £ £ Z Z CL bl 

Q. , Q. l a. l c. l a l Q. l a l o. l Q. l a l a l cL l Q. l a l a l a. l Q. l Q. l a. l o, l a l cL l 


) i x 
: i x 
I W> 


f >d <C IB 1C « 




nn ib m O'o> O'O's< < ill u lu 
aaaaaoauuoaoa 


0'<QUU.QSn'B'B'0'6'B'6l00'<QU' 

blulblblblb.b.b.b.b.b.b.b.b.b.b.b.Ci.b.C 

~ — ~ _ QBSSSSSSOSQSSO! 


no>u(blL(L[i 


ini/ir'O'dlQlu-ninr'O'O 


-IO'S-(Nn»tu'iOI'#3'QH(NJO< 

SiOiBM'i'r'r'r'p-f'f'r'coacocoa 


i030isnssE5.st: 

0O'®-1(N''IVlC''Br s M0 


Sf'tOO'S- 


b®®®®®®®® 


•J H J 
>. 3 J X 
JUIDUl 


a — 
j 

J x J 


WQH 
Z X 

Ct. < o 

IcSK 

O u 


Z D3 
b- «t O 
b. X X 


< E- < 
«</!>> 
ui x a 


E- « 
WQH 

Z D3 

b- < O 
U. X X 
O U1 
Q. U 

a o « 

Z Cl 
< t- < 
tcw> 

UJ X u 

a. — 

O b. o 


< bl 

3 in 
in a 


> a, 
a. o £ 
O as D3 
a cl n 


U)K z 

z < -i < 

NB.O « 

CL £ bl X 

O o | cn 

cl u a x a. 


Z < -« ® 

<n a oo 

CL £ bl bl 
O O II 
a. u a. a. 


cn x 

z « — ® 

fN O. O O 

a £ bl bl 


Z = 

<N a. ooo 

0. £ bl bl bl 
O O III 
a u a. a cl 


a ® cn 
O - l 
a. a a. 


J E- 
< bl 

u x 


J -1 CL 
< < O £ 
u u n n 


j j 

< < u t> 
u o n*- 


4 X CL 

< u £ 
u*n 


J o 

J X 0 

gy; 


>OX>4H 

)£00£0<u 

EU££U£OX 


bl ui 

a _i 

- aJa. 1 


■"B O' O' O'O' u b. c 
'r'r-r~r'r'p'r-a 


r'CS^cNi'-ivi/ivcir^ci 

ococococooooococoa 


D « <6 <B >B <B U 

b ® ® ® ® ® a 
f in'or'coo'« 




rT^r-coo><(auQs----(-'fr'<<<c<Qsnm 

ommmmmcDXfflxouoouououuouQQQ 


f> ® HNn<TU 


Dl'COffiSHNmr 


ri'BMOO'S' 


Page 40 

422 


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


Number 29 
































A MICRO-BASED PROJECT FOR THE 
HANDICAPPED 

Dear Madam or Sir: Received: 78 July 31 

The Spain Rehabilitation Center at the University of 
Alabama Medical Center has a project underway to demon¬ 
strate both the utility and economic feasibility of the new 
generation of ‘personal’ computers for use by the severely 
disabled. The programmability of the computer will allow it 
to serve as a general purpose appliance to be used as an aid 
to communication and education as well as for environmental 
control and entertainment. 

This system, as currently envisioned, will consist of a micro¬ 
computer, an on-line storage device for programs and data, 
two T.V. monitors for user feedback and information display, 
a printing device for typed output, a speech recognition 
device for vocal input of commands, data, and text, a 
powerline controller for environmental control, and a 
telephone dialing/answering device. We are attempting to 
select components which are widely distributed and serviced 
as well as being plug compatible and economically priced. 

Programs will be written or purchased to perform specific 
functions in each of the four general areas mentioned above. 
However, we would be very interested in receiving ideas from 
your readers, particularly those who are disabled, those who 
have disabled friends or relatives, and those who have personal 
computers and would like to develop hardware or software 
for the system on their own, regarding specific functions 
which they would like to see developed and which could 
be accommodated by the proposed micro-computer system. 

Sincerely, Spain Rehabilitation Center 

Charles Healey U.A.B. University Station 

Research Associate Birmingham, AL 35294 

(205)934-3320 

COMMENTS ON KIM CASSETTE PROGRAM 

Dear Mr. Warren: Received: 78 Aug 14 

Now that Dr. Dobb’s is slowly beginning to publish more 
6502-oriented material, it’s left the never-never land of 
“good computer magazines” to become a publication that 
I can actually use ... and perhaps even take issue with from 
time to time. The basic motive for this letter is to comment 
on the “High Speed KIM Cassette I/O” in DDJ #26. While 
the high-speed facility is useful (its usefulness being, roughly, 
in direct proportion to the KIM users’ exasperation with the 
normal monitor program’s rate of cassette loading and dump¬ 
ing), the approach in #26 is the third version of a high-speed 
binary load/dump to be published in the past year. To my 


mind, the best of the three is Robert Tripp’s “Ultratape,” 
which is discussed in issue #1 of his 6502-oriented magazine, 
MICRO. “Ultratape”’s superiority derives from the fact 
that the program search capabilities of the KIM monitor 
aren’t lost as they are in the other two versions; the tape 
header and the first byte of tape data are in a high-speed 
ASCII format (Jim Butterfield’s “Hypertape” format—which 
is the normal KIM format, and monitor-compatible, at 6x 
normal KIM rate) before dropping automatically into binary 
format for the rest of the dump. Not noticeably slower than 
the version you published; but for those of us who need the 
tape search provision, a superior program. As well, the pro¬ 
gram in #26 uses parallel port bits PB2/PB3 to control cas¬ 
sette deck function. While author Bridge has kept this com¬ 
patible with the original control subroutines in MICRO-ADE, 
similar cassette control routines are used in Tripp’s “HELP” 
utility file programs for the KIM-but toggling PB0/PB1 
instead. Since changing a constant or two in a program is a 
lot easier than rewiring the parallel port (although the cir¬ 
cuitry change is fairly trivial), in the interest of compatibility 
the constants in Bridge’s tape control subroutines 
(and in MICRO-ADE) could easily be changed to toggle bits 
0 and 1 instead of bits 2 and 3. 

While I’ve got your ear, I should pass on to you the names 
of three distribution points for computing equipment and 
insight whom I’ve found invariably reliable and fast: 

1. Forethought Products, POB 386, Cobourg, OR 97401; 
the manufacturers of the KIMSI KIM-SI 00 interface/mother¬ 
board, they produce a quality product with excellent docu¬ 
mentation and service, and have responded to my many 
queries and comments quickly and thoroughly; 

2. Arisia Microsystems, 1455 Gregwood Rd., Mississauga, 
Ont. L5H 2T5 and 

3. Orthon Computers, 12411 Stony Plain Rd., Edmonton, 
Alta. T5N 3N3 are two Canadian dealers (primarily of S-100 
equipment) whose prices are fair (in most cases better than 
I would do importing myself and paying duties/post/exchange) 
and service fast and reliable. 

Peace. 25 St. Mary Street #411 

Barry Tepperman, M.D. Toronto, Ontario M4Y 1R2 Canada 


DC HAYES RESPONSE TO MODEM COMPARISON 

Dear Sirs: Received: 78 July 18 

In Volume 3 Issue 6, Jun-Jul 1978, you printed an article 
by Tim Pugh entitled “Intelligent Terminal Implementation 
for the S-100 Bus.” I enjoyed reading the article. It was 
informative and well-written and the program looks good 


Number 29 


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


Page 41 

423 







though I haven’t tried it yet. Unfortunately, I am writing you 
because the article contains several inaccurate statements 
about our S-100 modem, the D.C. Hayes 80-103A Data 
Communications Adapter. 

Mr. Pugh points out that we chose to use the simpler 
MC 14412 modem chip instead of the MC6860, which 
provides several automatic functions. This consists primarily 
of some simple answering logic. We found it to be less 
expensive and much more flexible to implement these 
functions with a separate I/O port and some software (less 
than 10 instructions in 8080 code), which can give the user 
such capabilities as answering on the Nth ring, etc. For 
example, one of our users has programmed his machine to 
listen for the phone to ring. If the caller rings once and then 
hangs up, it answers the next call. Otherwise it lets the phone 
ring. This makes it unlikely that someone who doesn’t know 
about modems will get a squeal in their ear when they try 
to call you. The 6860 always answers as soon as the phone 
starts ringing (well 51 milliseconds after). This will work 
even if the CPU is not running. This means it will answer and 
accept a long-distance call even if the system has crashed. 

The design criteria for our modem was to get the most 
performance and flexibility possible for the least money. As 
Mr. Pugh notes, our modem is about $100 less expensive 
than the IDS board. 

The filter specifications in the Motorola application note 
are quite conservative. We do publish a recieve sensitivity 
figure (—37dBm), which is sufficient for reliable operation on 
about 90% of all long-distance calls. Since the digitally-created 
signals from the MC 14412 chip contain very little energy in 
the harmonics below the 13th and 15th (which occur in the 
25-40 kHz band), all that is need on the transmit signal 
is a simple low-pass filter to keep these harmonics below 
—40dBm. As Mr. Pugh points out, filters are pretty compli¬ 
cated and require a lot of expensive parts. Since we wanted to 
keep the price low, we felt that the additional parts to get 
98% were not justified. We are sorry that Mr. Pugh did not 
try our modem in a full-duplex configuration, because it 
does work. On page 44 of the same issue, there is a letter 
from Ward Christensen describing a system using our modem. 
It normally operates full-duplex, and has been successfully 
used by dozens of people from all over the country. 

We only provided two baud rates (110 and 300) because 
those are the only standard rates for ASCII. Our manual does 
provide detailed information on rewiring the baud rate genera¬ 
tor for non-standard baud rates, however. 

We didn’t provide a dial tone detector because a simple 
2-second delay is adequate. Telephone company design 
rules virtually guarantee that properly functioning telephone 
exchanges will provide dial tone within that time. 

The auto-dialing capability of the IDS modem merely 
creates the pulses, which is not the most difficult part of the 
dialing software. It still requires software to get the phone 
number, and to feed the digits to the dialer. I have rewritten 
Mr. Pugh’s subroutine DIALIT (which dials a single digit) 
to work with the 80-103A. The original consisted of 11 
instructions occupying 28 bytes, the modified version 
contains 22 instructions occupying 49 bytes. Since I don’t 
believe any program works until I see it with my own eyes and 
I haven’t run this one yet, I can’t guarantee that it works, but 
it is pretty simple so I doubt that I made very many mistakes 
in it. 


We did not provide power for the coupler because the 
standard S-100 bus voltages are not high enough to meet 
the telephone company’s specs for the coupler (20-26 vdc), 
and the telephone comapny specifically requests 
non-switched power. Telephone company power is usually 
about the cheapest option available for a coupler. And if 
it’s not, a 24vdc power supply is not very expensive. 

The 80-103A is designed to use a DAA, and our manual 
is quite clear that although it will work when directly 
connected (it does have a ring detector), it is not legal to do 
so in most places. 


AN I 

0FH 

ISOLATE DIGIT 


JNZ 

D1 

CHECK FOR 0 


M VI 

A,10 

AND CHANGE TO 10 


PUSH 

PSW 

SAVE THE COUNT OF PULSES 


OUT 

MODEM2 

A DIAL PULSE IS CREATED BY OUTPUTTING 



A VALUE CONTAINING 0 IN BIT 7 
MODEM CONTROL REGISTER 

TO THE 

MV I 

B, 2 

STANDARD (10 PPS) DIAL PULSES 

LAST 

CALL 

DELAY 

ABOUT 60 MILLISECONDS 


MVI 

A ,80H 

END THE PULSE BY SETTING BIT 7 

BACK 

OUT 

MODEM2 

TO A 1 (OFF HOOK CONDITION) 


MVI 

B , 1 

DELAY ABOUT 30 MILLISECONDS 


CALL 

DELAY 

BETWEEN PULSES 


CALL 

CSTAT 

NEXT 3 INSTRUCTIONS UNMODIFIED 


JZ 

D2 



CALL 

CR$ST 



POP 

PSW 

GET THE COUNT BACK 


DCR 

A 

DECREMENT IT 


JNZ 

D1 

KEEP MAKING PULSES TIL IT GOES 

TO 0 

MVI 

B , 15 

INSERT A .5 SEC DELAY BETWEEN 

DIGITS 

CALL 

DELAY 



MVI 

A, *-• 

UNMODIFIED FROM HERE ON 


CALL 

RET 

TCHAR 




We recommend renting the DAA from the phone company. 
The DAA is a pretty silly gizmo and really doesn’t do much 
other than introduce another couple dB loss into the circuit. 
But when you rent the DAA, you get treated as a data 
customer. Most data customers are big companies using big 
computers. They demand the best service and get it. With 
the DAA, you are paying for that service and you can demand 
it too. Telephone company design rules for local loops 
(the pair of wires from your house to the central office) 
are more stringent for lines with DAA’s, and when they install 
your DAA, they take more time to make sure you get a 
good loop. This is important because local loops lose more 
data than long-distance lines. With a bad long-distance line, 
at least you can dial again, but if your loop is noisy, you’re 
out of luck. 

We don’t sell kits because we believe that they don’t make 
sense economically. We found that the actual difference in 
cost to us between a kit and an assembled board is only about 
$10. Rather than create an artificial price difference (and a 
lot of headaches for us and our customers), we decided to 
assemble them all in our factory. All of our boards are tested, 
burned in for 48 hours or more, and tested again to assure that 
they meet all of the published specs. 

I am presently modifying Mr. Pugh’s program to run with 
our modem and intend to submit it to the CP/M user’s group 
as soon as I get it working. 

If you would like information about our modem, call or 
write us. We make a real effort to answer our user’s questions 
and to help them make their systems work. 

Respectfully, D.C. Hayes Associates 

Donald J. Hyde P.O. Box 9884 

Director of Software Atlanta, GA 30319 

Development 


Page 42 

424 


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


Number 29 





MORE ON FORTH IMPLEMENTATIONS 


CLEARING 6800 MEMORY 


Gentlemen: Received: 78 Aug 18 

I read John James’ “Forth for Microcomputers” in Volume 
3, Issue 5 with great interest. I have been involved with Forth 
and Forth-like languages since late 1975, and am one of the 
promoters of it at the University of Rochester. To clarify your 
article’s last page, the University of Arizona, (primarily the 
Kitt Peak Branch of AURA, Association of Universities 
doing Research in Astronomy) is running single user versions 
of Forth on CDC 6400, HP 2100 and Varian 6201. 

At the University we are running a multi-tasking Forth 
called URTH on the following machines: IBM 360/65, 
INTEL 8080, MODCOMP II, HP 2114, HP 2100, PDP 11/34, 
and soon the LSI-11. These are used for applications as diverse 
as laser control, fusion diagnostics, data entry, telecommunica¬ 
tions and image processing. 

We also have a manual, and will be setting up software and 
manual distribution shortly. Anyone interested should write 
me at: The Laboratory for Laser Energetics, 250 East River 
Road, Rochester, NY 14623. 

A technical Forth/URTH internals manual is being pre¬ 
pared from a series of talks and workshops given at the Univer¬ 
sity during the past year. 

In reference to your comment about micro-coding the 
Forth interpreter, it has been done for an HP 21MX-M com¬ 
puter, and was reported in the European Southern Observa¬ 
tory technical note LS 76-119 by S. Lorenson dated 10/ 
29/76. 

Good luck to all who are interested in Forth. 

Sincerely yours, University of Rochester 

Lawrence P. Forsley Laboratory for Laser Energetics 

Rochester, NY 14623 

SOFTWARE [IDEAS] FOR 50<t 

Gentlemen: Received: 78 July 12 

Perhaps your readers would be interested in another soft¬ 
ware source — the U.S. Patent Office. Statutory disclosure 
requirements are such that systems patent applications should 
include software. A patent recently issued to Hewlett-Packard 
(4,089,059) contains software for a 6800 based system. While 
not directly usable because of hardware differences, the source 
code may be of interest to those with 6800 based systems. Pat¬ 
ents may be obtained for fifty cents each from 
Box 9 

Patent ^Trademark Office 
Washington, D.C. 20231 

Anyone interested should be prepared to spend a fair 
amount of time studying: in the patent mentioned above 
there are 226 drawing figures, 20 pages of text and 150 
pages of source code—the patent is 1% inches thick. 

Very truly yours, 165 Hurd Road 

Paul F. Wille Aurora, OH 44202 

Just remember that the software mentioned is also protected 
by the patent in which you read it. The purpose of patent 
disclosure is, of course, to inspire further invention but care 
should be taken to avoid infringement. -TRW 


Dear Dr. Dobb’s, Received: 78 July 28 

Your September 1976 issue contained a letter on page 32 
from Richard Kaapke which described, among other things, 
a nine byte 8080 program for clearing memory. Last night I 
decided to try something similar for the 6800, and devised 
the following. 

Routine 1 (8 bytes): fill memory with NOPs. Properly 
assembled, this routine will execute anywhere in memory. 

2000 8E 20 03 LDS 0STACK 

2003 86 01 STACK LDAA i?N0P 

2005 36 PUSH PSHA 

2006 20 FD BRA PUSH 

Routine 2 (5 bytes): fill memory with zeroes. This routine 
must reside at the addresses shown, and assumes that execut¬ 
ing an opcode of zero is identical to executing an NOP. 

FFFB 8E FF FD LDS 0HERE-1 

FFFE 8D FE HERE BSR HERE 

Routine 3 (8 bytes): fill memory with ones (all bits on). 
This routine must reside at the addresses shown. 

FFF7 8E FF FA LDS 0THERE 

FFFA CE FF FF THERE LDX tfHERE+2 

FFFD 8D FE HERE BSR HERE 

Assuming that every location in the address space acts 
like RAM (ie, can be read, written, and executed), then all 
three routines fill ALL of memory, obliterating themselves 
in the process. 

Sincerely, Box 2692 

Mike Gabrielson Stanford, Calif. 94305 

(415) 493-5217 

REPORT ON WELLES FLOPPY CONTROLLER 

Dear Dr. Dobbs, Received: 78 July 20 

I think you may be interested in one readers’s experience 
with the Welles Floppy Disk controller and FDOS Software. 
After reading about this modern wonder in BYTE, I ordered 
a blank PC board from Dr. Welles. My order was confirmed 
after a week or so, and I had my board in about 5 weeks. 
This is not in any way a kit, you should know all about TTL 
logic (or be ready to learn). I replaced all the 74XX and 
74LXX chips (except the 7438) with 74LSXX, so that the 
card now runs a lot cooler and some of the signal lines look 
a bit cleaner. There were a few errors on my card, but they 
were all covered in the documentation that came with it. 
After working with this system for around 10 weeks I can say 
that it really works, the FDOS software works well, though it 
lacks that “polished” look and may give you some odd results 
every once in a while. It has not yet dropped a file, however, 
believe it when it says I/O error. I feel that nothing else I’ve 
seen comes close to it for the cost. (A little under $600.) 
Shopping around lately I’d found everything from about 
$450, the key is finding a drive for $350—it can be done. 

Sincerely, 408 Oakwood 

A1 Marshall Angola, IN 46703 


Number 29 


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


Page 43 

425 




Dr. Dobbs louRNALof 

COMPUTER 

(Calisthenics Orthodontia 

Running Light Without Overbyte 


Number 30 November-December 1978 

Volume 3, Issue 10 

SOFTWARE 


A LISP interpreter for the 8080 Darrel Van Baer 

Documentation and complete source listing 

4 

Curve-Fitting Using a Focal Interpreter on the KIM-1 Theodore E. 

Bridge 12 

Binary Tree Manipulation on the 8080 Mike Gabrielson 

A tutorial treatment 

15 

Programming Languages and Standards David Chapman 

18 

SAM-76 Language Update Ancelme Roichel 

19 

BASEX: A Fast, Compact Interactive Compiler Paul K Warme 

Description of a new intermediate-level language 

26 

Tiny GRAFIX for Tiny BASIC Joel Swank 

A subroutine package for Tom Pittman’s Tiny BASIC 

32 

Copying a Diskette on Intel Double Density DOS Paul M. Julich 

40 

HARDWARE 


The Heath H-8 System Tom Williams 

Featuring Heath’s new diskette system 

22 

The STD Bus Keith Britton 

A critical look at a proposed new standard 

i __ 

34 





© David Dameron 1979 





























A LISP Interpreter 
for the 8080 


BY DARREL VAN BUER 

1522 Brockton Ave. Apt. 5 
Los Angeles, CA 90025 


As assembled here, entry is at zero. Most of the code may 
be anywhere in memory but all LISP data elements (CONS 
cells and atoms) must be in the first 32K of memory. The 
interpreter is completely self contained except for terminal 
I/O. On input from the terminal, all control characters are 
ignored, and thus may be freely added to improve readability. 
All input is parsed as literal atoms and S-expressions. An atom 
is any string of alphanumeric characters not over 16 characters 
long. Some examples of legal atoms are: 

ATOM 934 A47 47A 

Some examples of illegal atoms are: 

VERYLONGSTRINGOFLETTERS (More than 16 

characters) 

AD-P (Contains non alpha¬ 

numeric —) 

The only other characters recognized by the system are 
left and right parentheses, commas, periods and blanks. 
Consecutive atoms in lists and S-expressions must be separated 
by at least one of these symbols to be recognized. Blanks may 
be optionally inserted before left parens and after right parens. 

Both input and output routines can handle mixed S- 
expressions (with dot notation) and list notation. The output 
routines will always use list notation whenever possible, but 
will use dotted notation whennecessary.E.g.,an S-expression in¬ 
put as: ((INTEL.NIL).8080) would print as ((INTEL).8080). 

Logical values returned by EQ, ATOM, NULL and EQUAL 
are T and F. These must be quoted when used as constants in 
a program. These are also the logical values expected by COND 
(actually COND only tests for T). 

The interpreter is an EVALQUOTE mode interpreter so 
two S-expressions must be entered for evaluation to occur. 
Both of these S-expressions must be followed by a blank 
to allow for the lookahead used in READ. After recognizing 
the second S-expression, which is a list of arguments to which 
the first S-expression (typically an atom) will be applied, 
both of these expressions are effectively quoted, so all atoms 
in the expressions stand for themselves, not any DEFINEd 
binding. Once the interpreter recognizes the second expression, 


it does a new line and types *»’ followed by the result of 
the computation. 

For example, if the following is entered as input: 
DEFINE(((TT)(F F) (FF(LAMBDA(X) (COND((ATOM X)X) 

(T(FF(CAR X)))))))) 
the interpreter will respond with: 

> > (T F FF) 

If you then enter: 

FF (((A.B).C)) 

the interpreter will respond with: 

>>A 

The following functions are defined as built in subroutines: 
ATOMjx] T if the value of X is a literal atom, F otherwise. 
NIL is an atom. 

NULL[x] T if X has value NIL, F otherwise. 

CONS[x;y] Returns a new S-expression whose CAR is X 
and CDR is Y. 

CAR[x] Returns the CAR portion of a CONS cell. The result 
is undefined when applied to atoms. 

CDR[x] Returns the CDR portion of a CONS cell. Unde¬ 
fined for atoms. 

EQ [xy] Returns T if X and Y are the same atom or the same 
CONS cell, F otherwise. 

EQUAL [x;y] Returns T if X and Y are EQ or are congruent 
trees. Objects which are EQUAL will print identically 
although they may use different CONS cells, and thus 
not be EQ. 

CADR[x] Same as CAR[CDR[x] ] 

CADDR [x] Same as CAR [CDR [CDR [x] ] ] 

DEFINE [x] X must be a list of definitions. Each definition 
is a list whose first element is the name receiving the 
definition and whose second element is the definition. 
The value is a list of the names defined. 

EVAL[e;a] E is an expression to be evaluated. A is the assoc¬ 
iation list defining the environment for evaluation. 
The value is the result of this evaluation. 

APPLY [fn;x;a] FN is a function name or functional form, 
X is a list of arguments for the function and A is the 
association list to be used. The result is the result of 
applying FN to the arguments in the specified en¬ 
vironment. 

ASSOC [x;a ] X is an atom whose association is fetched 
from the association list A. The value is the first CONS 
cell from A of the form CONS [x;value]. 


Page 4 


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


Number 30 

429 






PAIRLIS [x;y;a] X is a list of atoms, Y is a list of values, 
A is an association list. The result is a new association 
list consisting of the old association list preceded by 
new association cells constructed from pairwise joining 
of elements from the list X (for names) and Y (for 
values). 

The following are special forms recognized by the inter¬ 
preter: 

COND[ (tl vl) (tl v2) ... ] COND is the conditional (“if’) 
element of LISP. It takes an indefinite number of 
arguments, each of which is a two element list. COND 
successively evaluates the first element of each of these 
lists until one is found with the value T. The value of 
the COND is then the result of evaluating the second 
element of the same list. If none are T, the result is 
an error. (For this reason, the last pair is usually of the 
form ((QUOTE T) expr)). 

LAMBDA[v;e] V is a list of variable parameter names. 
LAMBDA is the function designator of the LISP world. 
When a LAMBDA expression is applied to a list of argu¬ 
ments, the arguments are paired with the variable list 
V (via PAIRLIS) on the front of the current association 
list in EVAL/APPLY. Finally the value of the expression 
E is evaluated in this new environment and returned. 
LABEL[1 ;e] LABEL is used to associate the expression E 
with the label L then evaluate E in this environment. 
The primary use of LABEL is the definition of temp¬ 
orary recursive functions (as opposed to permanent 
definition via DEFINE). For example, the example with 
DEFINE and FF earlier could have been done as: 

(LABEL FF (LAMBDA (X) (COND ( (ATOM X) X) ( 
(QUOTE T) (FF (CAR X)))))) ( ((A.B) .C) ) »A 

Here, FF is only meaningful inside this expression, 
whereas after DEFINE, FF is a permanently known 
function. 

Internal Organization of the Interpreter 

All free memory in the first 32K is used as non-reclaimed 
storage for lists and atoms. Because there is presently no 
garbage collector, problems are limited to those with at 
most 8000 CONSes (in 32K). 

For built in, assembled functions, the calling conventions 
are as follows: HL passes the first parameter and returns 
the result (except that functions which return only T or F 
such as ATOM return T by setting the Zero flag and F by 
non-zero flag). DE passes the second parameter and BC 
passes the third parameter. BC and DE must always be re¬ 
stored to their original values before returning. HL must also 
be restored for T/F functions using Z/NZ returns. For 
functions with more than three parameters, BC and DE are 
not used and HL passes a list of the parameters. Note that 
there are no functions with more than three parameters in 
the system at present, but APPLY has code to follow this 
convention. Assembled functions may call one another di¬ 
rectly. 

The interpreter has two permanent internal association 
lists. One is the list ASMFN (at 0637H in this listing) which 
is a list of all assembled functions. The value of these atoms 
are CONS cells in which CAR is the real memory address of 


the code and the CDR is a flag describing the function. This 
information is in the L byte. The high order bit (80H) is 
on if the function returns T/F as Z/NZ. The low order bits 
are the number of arguments. Zero is used if more than 
three arguments. 

The other list is initially NIL, but is modified by DEFINE 
to include new definitions. This list is the initial association 
list used by EVALQUOTE when it calls EVAL. This list is 
stored in EVQAL (AT 04B4H). 

The interpreter also maintains a tree used by READ to 
record all atoms known to the system so that only one copy of 
each atom is kept. The initial state of the tree is computed 
following START (at 04CDH) and stored in NAMETREE (at 
042FH). 

The interpreter is fully reinitialized following reentry at 
zero. To reenter the interpreter and keep old function defini¬ 
tions and known atoms, the interpreter should be entered 
at INLOOP (at 0599H). 

The I/O routines required for the interpreter must pass 
the character in the accumulator with high order bit zero. 
Further, they should restore all registers before returning. 
Equates for the address of the pertinent routines are in the 
first few lines of code. If you patch the object code instead, 
OUTC is called in 5 places following OUTPUT (0050H) and 
two places in EVALQUOTE (028EH). EVALQUOTE also 
calls CRLF, a routine which should send CR, LF and whatever 
nulls needed in your system. The only call to INCH occurs 
in NEXTCHAR (at 0348H). 


•X 15 Z) 

3 < -U 
UUh 

x as c 
z 2 co o : 
j y £ . 

^ Z 'T J ■ 
£ : 

a w q 

> > a ch : 

< < a m « 

CflTIZOt 


■3 x ■a m ■s 

33 a a a 

ii '3 '-T X Lij Cij 

a r- -o a a a 


3 3 3 3 3 3 
O O O O O O 
UJ id ty CU aJ 


C X X 2 £ £ < 2 

-* O Q r J3 * - * CO 

'JCJCJ^CXICJCL 

‘-3 33 35 c 1 J 


£XQ£ 


> >: a, > 
0200 

t H Q, Z 


J X I Cu Z 
H £ Ci3 u J a 

3 a x z as cq 

* * 

■-H -N -Of'-COON 

aaaaaaaaa 

a aaaaaaaa 
s aaaaaaaa 


Q 15 rM r/> 

Q Q X X x 2 

< < < < Q O 

UUU'J cj tj 

r-\ —I -H -H —I -H •—I .-f rH —I rq ,-N f\J CM CM .N iN ."N tNJ rs) m r 

a a a a a a a aaaaaaaaaaaaaa- 
a a a s "S a a s a aaaaaaaaaaaa; 


a 

a 


< 

a 


uuoar^r«j.x>vOii,oa.>j-NoQa-HOQ 


m r- 


s aaaaaaaaac^ 
a aaaaaaaaaa 
a aaaaaaaaaa 
a aaaaaaaaaa 


sD'T.<OCJQoJi J arHrNr^ 
aaaaaaaarH^H—(r-t 

aaaaaaaaaaaa 

aaaaaaaaaaaa 


sDC^-3JCQ'i]ti,a^liNrO<^ 
H H H H H H M .N .N (N ,N 

aaaaaaaaaaa 
aaaaaaaaaaa 


Number 30 


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


Page 5 


430 



X 

> 


— '3 
X < 
< X 


03 0 
S 3 
3 

< t/3 
£ 
T p 

b < 
x 


o x 
2 > 
II < 

x x 


: <h 03 
: os > - 

» X < - 
' % 03 ' 


X S 
Q O 
o x 


O 03 
O X 
— X 


X XX 
03 — < < 
J<UU 
X — — — 


H J r ^ J 
J < O 2 < 

x o .< -> o 


o 

O H 

03 c 

J X X *J E 

C M J H J t 03 

O Z < -1J < O ea 3 

x x o x o x n x 


< 

OS EE 

< < o» 

: o o O'JQi 

: x J y J J 

I 03 X X X X X X 

3 < o < < o o 

1 u x u o x a, 


TOO CJ 03 Q T 


T T J O X 
S3 03 03 -J T O 
2 3 3 * O < 
s % 1 O X 'J 


o-.ro 0 x 00 


J 3 
J O 
3 Si 

Z < TO 


J 3. 1 7 I H (h 

o o a j! j 

U 13. is o X 


< N > 

o z o 

3 Z 


J 03 

< >1 

X X 3 5h X 

< < O D < 

U O 03 Z X O O 

X J X 


X X X X 3 X 3 X X X 3 X 3 X J J I X J J mmm -« 

>rH r .O'.nyiXXXXXXXXXXXXXXXXcH:/i71XX3XX5HXXXsaXXX'HX 
O03333<O<CO<O5H<COCO<0O<OX 3 EO<ZOOX<<<“-~~'^ ' 

Z E 3. Q. 3. o X O X O 1 X ’ 1 ^ ’ 1 ’ 1 ' ^ f 1 f '. V A. A. sa> f 1 A. A. V- r 1 r . r > 


I<0<05H<0<0<00<OX3 30< 
lOiXOXXOXO^OXXUX X X X X O 


ZOOX<<<ZOO<XO< 
TllEOOOTlVJilU 


‘ J3 J s x> 31 3 - 


• t J~t as » j ^ - 


' r> n f'' a 31 3 - 




- j~> o r-- jo j\ 3 - 


O >1 
O O 
■Ji -Si 
Ji t Si 
< < 

P XI ^3 Ml 3\ 3 - 


iinminiriinji.n^^^’O^'O^ncvDvO'XJSsr'Ssr'SsssajxHDJoa 


33 3 333 3 3 3333333333333 33333 3 33 3 333333333 3 333 3 33333333333333333333333 3 333333' 


O 


X 


X 


JI o O.NOJ'3aJ'Qll<i/1-na'tl3DHH3iriyi3I|Qa-lHJiC3\Q,NSJ13'yii/iy'a3lDllQH'rQaQaQH2ia-iui- l 

O O X o o X O O O O X o X 3 O X O O o 3 o x Q O X o O 3 > X o o- o O O >0 x O 3 X 3 o r X O X O a 'X o X o X O Q 'X O 3 o Q 
N’'ir'<3Xi,N"'i0S<!IlO*3' , ''Dr'33Jl<Iia!i..N l /l'i)S»<!3Hi]HiN' , l^yi^S< , ll , ja..N'*lq l S»aOj.3"l^in'BS»a'OIi 
X X X .0 X X X 3 o O O O O O O O 3 Q Q 3 3 3 3 3 3 3 X X X X X X X X X X X X X X X X X X X SJ 3 3 3 3 3 3 3 
3333333333333333333333 3 333333 3 333333 3 333— - — — - 
1 3333 3 3 333333333333 3 3 333333333333 


3unif1'aQiNHH3'QQQNHH33'H3 

“Qxooxa 00000 x 3 o o x o 


33333333 


U U U Ll -1 -I U LU UJ U IU U Ol 'il it. i. i. i. « u. Ill J, Ji Ji 'i. 

3333 3S3333.3 33S333S33333S33i— 1 »—i«-ai— i-^— 1 »— 11 —!•— 11 — 1 <— 1 <— 1 <—i-a'— 11 —i--a 
- --— 333 3 333333333333333 3 33333 


>1 Hi 00 X X X 
4 !N ."N .SI .N -SJ ' 


33333333 3 3 


XXX 
Q <Si 3 X 

EES 

O 5h Eh < 

►h 'Ji 

X 3 X 

- O m X X 


Eh x O —• 

— P-H Z 

j. H E * 

>-h Ji D * 

H^hQ 

H J < W — 


x X ► 


< X X 

Z 5h Z X X < 

O Ji O x 3 

C-h X 5h I O O 

h < sa X X 


J X X 

• > o 
< o 

1 Ji X 


3 3 
Z E 
X Eh 


I 3 

N II 

z < 


O e 

X < * 
Z Eh * 


< 
X X 

< o 


X z 

X X 
3 X 
O E 
X 3 
E O 


x a . 

X z t 
Z X ' 


X 
X < 
> X 


3 X 
O X 
X X 
X 'Ji 


< XX 
E X < > 
> X ^ 
X < Si 

> n ;h e 
>h x 3 

> Q T O 


TXT 
■* 3 3 
< 3 JO 


Q X E X X 
X O O X 3 
X < X O H z . 


X 

X X z 
3 Z •* 


5h O 5h 

< 5h < 


TECS 


<X < X XZZTECZXCr'XCOTCOTCTE 


• XXX 
-3 XX 
< O 


EX iX X O * XXE5 h- H E • • 

- < 3 X 3 X *■ 3 -H < 3 - 3 0 3 - D 

XXOOTOZOCOZOOCOT TOO COX 


X>XXX£H>^H-i ( rH>EN>EcH 

zooooxozexos Z O S X 
xZQOQEZCOESOESOE 


XXXX XX XX X XXTXXXX X XX X XXX X 

XX XEXEIH hEN^E5‘WXnhEXsJ'J1>h>>X>X1nEE Xi— iXX>a(/)XXEXX mXEXXxXE OXX^hXE 
3<fO<S<0'X>SZESX3<ZXS<Z30ZOOZO<OZOOX><<Z3<<0<<sa><S<<><0 3<<><0 
EOOOoOEESOEXOEEOeXoOeESCSSxSOQoEEESOOeEOOEOOOSOeOOSOEEOO'SOE 
Eh Eh 


!i1 , OSJ3J'OH.N'^^ , in'Or''B3'3HN' y Pfl l i/l'Cr v » J>3H’Nf r l<fUTai s -X0NaH.N' , P^yt'Or'J0J'3Hi'N' , 1fi/1.0r s JO J' 3 H -f in 'fl S J) J\ S3 ,—( .N "P ■a 1 in 'll r' o 

-^ rr . r r.nr«^qi rr « T ^j.^j.^j-» T ^-^j.^. t n 1 j-,j- 1 ,/^ u -, t /- )L r ) i/^ L nmvo^O'rvO'X>vOsO i ^>vovor^r~r^fH-rHrHrHr^ r ~rH-xwx l xxxJOXXxo>o>o>3><T> ( T>3>Ji- : rti3>3333333 3 33 

33333333333333 3 3333333333 3 33333333333 3 3 3 3333333 3 333333 3 33 3 3333333XXXX-HX—IXX—) 
3333 3 3 SS333333S3333333 3 3 S33333S333333S33333333333S 33333333 -3 33333 3 33 33333333 


3 3 3 3 3 
3 3 3 3 3 


3 3 <r 3 3 (S> 
3 3 3 3 3 3 


333 33 3 33 

E 3 3 S3 333 


3 

X 


S3 3 

3 3 X 


3 3 
JO JO 


■J -3 X J> 3 

TH" , 'T 00 


^ Q Ji CQ 'JI X 

^ '/no cn r- 


JI JI 
3 ■£> 


CO JI |h JI JI 3 
CN 3 rn TS s m 


3003JT.3Ti.3XJ1 
H^CMOXS^.N 3 


r.'N'DU213'U , 'OaJ'U<3QfflO\iDQ<a"'QHJ'U03&iQIJl/lQiNH«Q!MinU'OMO"IMQiDMHH3WaOQ.NifiQQHaQ<UQ' , 'QQXCHiDQaaaH 
sjr''Nj.-N.s40r-XE0^X0r-X0X0 00 00X0'^T0<X0X00 r N0000f^-XX'Trsjr-0300X0'^000X0 0X000' v '000 0^0ax00' Y '0X 


i/t O S JO JI < 
.“N -U JNI -SJ CN CN 
3 3 3 3 3 3 
3 3 3 3 3 3 


ra o X 3 X CN 
N .N N -h « -n 
3 3 3 3 3 3 
3 3 3 3 3 3 


if) X I CO 
ro i-o r** 
3 3 3 3 3 3 
3 3 3 3 3 3 


CO X i—I CO 

rr> n ji^j. 

3 3 3 3 3 3 

3 3 3 3 3 3 


U'BOQmsHTh 
<r ^r^j-'T*j’’TiO)unu~)Ln 
333 3 333333 
3333 333333 


<Q3' r "jinr'Xj.<iiii]i|tN' ,- ^xs<;asHtsx 
ininxxxxxxxxxxxssssshssfflxxx 
3333333333333333 333 333333 
33 3 333 3 33333 3 333 3 3 33333 3 3 


X X 
CO CO 
3 3 
3 3 


-O <0 Ol O X 

31 JI 31 Ol JI 

3 3 3 3 3 

3 3 3 3 3 


IT! v£> 
< < 
3 3 
3 3 


31 O X i-H 
< < < X 
3 3 3 3 
3 3 3 3 


Page 6 


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


Number 30 


431 



X 


X o 
< 05 
U < 


CO z 


CU X 
Z < 

o 

id 
X d 
X 05 
Z X 
O H 


Z Eh 

o 

>-1 Cd 
O U Eh S 

05 05 U a 

< < Z 75 

a CO 
Q E-* X < 

Z CO E-» 
CN ^H J (J X 

II ii J H rj 

13 J <SH 

a x u o x 


X 10 

< o 

Cu Ld 


O Cd 
Z 05 
O 
U 'H 


OOQXJQCdQ 
05 05 < **«••*< 
<I<<UXUXJU 


£h H f 
< id • 
X e-t X : 

< - X 

U X < : 


X < 


— X ~ 
< O J 
ll - £h < 

H •• z yj > 

Cd X Cl 13 13 

U Q — 05 — 


X H 
J J id 

X U < XX 

* •* > X 

X Q Cd J Q < «. 


X 


z z 

X o X 


X —- X < X 
> z > + < 

< X < U 
10 ~"75 < -— 

< 

Q 

X T. 

z < 

< J 
X J (H 
< -OO 
x u a a x z 


- X —. 


X —> Q 

> z < 
< X u 
X •— 


Q ► 

_ < ' 
Q X X U £ 


u — 

*H z 

£ X 

o — 
t-* x 
< < 


X 

a j 
a < 

< > 

U X Q 


J 6-» Q 

‘ a o < 

X X z Q X X u 


a z 

X < X 

u u — 

< - X 

=H — X 

X Z Q 

X < 

o — u 


• ~ ~ O 

• X z 


Z H z 

z XXX 

XX —' u —' 


— o 
X u 
a x ii z ii 

< > •• o •• 

u < x u u 

— X Q '-’to 


z x u z x j 

o * -o * - 

uqqxuxux 


Z d 
X X 

— a 

X j 

a x 

Q X 

< x 
u 

— < 


X X J 
Q J 
X - 3 
X J z 


X ^ X — 

o < O X X 

X - X > — < 

X U X < u u 

X •—’'d '—• 


X X 

x a < 

X Z J J 
3 d X tH XX 
“230 < < 

< < Z Z X u u 


J X U X 

J>>>>JXJeHI-t 

JU<0000<U<XXNI 

JdUCZEEUXUOSXn 


t-t X X X X > 
X O O X O O 
J X X X X X. 


^•J^X-CXX X X X X O X X X J XXXXOXUXX J O X U X XX XXX 

>XXX<WXXMXNlXXXXXXXXXX 6 -tH-iXNXXXXXXXXXXC/)>>X>>XXXXXXiriMXX XXX 
g<0SU3<3X<Z003<<Ut-'<<0XX<Z003<H<UE-'U<300<00 0UHU<0 , d><<NJ3i:< 
"SUXT XUXXU^XXXUUXXUUXXXUTXXXUXUXXXUXZSUZSXXXXUXXSUUnXUU 


X 


vt3<£MXMc>fl^ 1 o v ovor'NNNr'NNNNr'acoacoma»®cDa)!J'3>OM3Myio\wo\3\wsss 

•"N N CN CN N IN -NJ ,-N CN CN CN CN CN >1 N CN N CN CN CN N .N ,*M CN CN rsl N ,N N .N -s| ,-vj CN .>j .N .N N N M «1 m 

ss , ssas'Ssis3ssssss'S , ss , sQS5sss3'3ss'SS'S'Sssssssss 


(N>»i«tinior'COij»SH>N"3^in'or'co£i\aHM£nfl'in'£ir'a)a33H.'N«3^ , i/u£) 

nr) m) r*) CT) rn nr) i'O nr) nr) nr) nr) nr) nr) nr) CT) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) nr) ,-r) 

-S3a^3a03SS33SSI'33 l S0'3 , 3'333 


39999399999 : 


X 9 
9 9 


9 33 «T X 

(9 S3 X 3) 00 


S3 

3 


3 X 


3 S3 


3 

3 


3 3 

3 3 


X 3 3 CN 3 3 

3 X 3 3 3 3 


•-N CO Ci4 X 
3 Q Q 3 


v© t> r* u cn 

3 3 v© x in 


vO 

T\ 


3> < X < 

3 ifl 1*1 H 


>© X xu x n* 

3 x 3 x in x <r 


l© V© 

3 X 


v© X 3 3\ < "T> CTi 

J) X 3 «r x S 3 


®X<<Q'«rQ.N®aXQO%-H< 

UXUQu^'U'vo^ouxuu-'^U 


—ixctixsjiQxx m q in 

QUUXinincjQ^j XUQ 


QfN-HrHLOQQcQXQQ^H^^HQrNf—IXinQXQCQXCQQinsO>Q'»TQXX ro XQX£TlXQQ<inQQ 

UUQXXUUXXUUOUxUUQXXUXUXXXUOininu^ , '^ , X'dXXUUUXuUUXUU 


XUXx^rr^ooo><mxx>‘^xv©<T>: 
UUUQQQQQQQOQ'dXXX: 
XXXXXXXX—4XX'—I'H'Hr-H'Hr 
S333SSS33S333333' 


QXX SH.NlTl'OTlTl<0[jH<jr'XJ'< 
XXXXXXXXXXXXXS333S3 
XXXXXXXXXXXHX.'NMINMMM 
3333333333333333333 


Q3XCNinoO!Tl<QSX^TinvO<Ti<QX 

3XXXXXXXX£NCNmrMtNfMrM.-NCN 

^MtNtNIM.NNMfN.NfNtNtNtNMINNtN 

333SS333SSS33S33S3 


X3X«Tini©!Ti<XOQXXiNXTT^JJ< 

CN X X XXX X X X X X X X “3 1 'J 1 'T 

CNCNfNCNCNCNfNfNCNrNCNr'ICNrNCNCNCNiN 

33333333 3 3 3 3333333 


£N 

3 


X 3 X 

v in in 

CN CN CN 
3 3 3 


< 


d 


d 

x a 

d - 

os X 

- E 

x — 

X 

< 

U d 

II 


d 

X 

z 


X 


z 

II 

X 


d 

a — 



z • 


d — 
d 4: 
X - 
< d 


- u 
OS o 
O n 
d d 
d < 
d —- 


•N 

o 

n 

n 

< 


ic < 
O 

x d 


O X z 
0 X d X 
73 d 0 a 

< z < u 


u 

33 



z < d o OS 

os o x o x a 

< x D - O D < 

XU<zaadZQ-EU 



•o 

X 

> 

d < 


U — d 

33 X X 

— o 

d X X 

> < X 
< U d 
U3 — 05 


< 


a 

x 

x 

23 


d 

n 

n 

< 


o 



n 

O 


x x o 

> > 73 
< < 73 
73 73 < 


U 

Z 

a 


x 

< 

> 

x 


X Z 
X Cu 
n. a 
x a 
x o qs 

X o < 

X u 

-X 


< 

H 

< 

a 


z 

O 


IX X 
U X 
Z II 

a x 
x a 


z 

X 


X 

X 

o 


< 

a 

z 

o 

u 

a 


a 


3 
x u 
a > 
e u x 


73 


a 


x x 
a > 
u x 


0 £E < U X < 
< 33 X < U X 


X 

x n u 

X ' « 

< a x a 


s: u 

z < x o 

O z < x 

X X - X 

< < a r a < 


x 

X 

x a 

X E-* Z X X X « 

a o x Q - ^a 

z z x u a x u 


H ^ > 
X Z X < 
U x o c/3 


X 

x 

X 

E-* 

Z X 
x > 
O 

X X 
\ 
Z H 
X 

a H : 
H x 5 
x x c 
X x c 


X 

\H 
Eh Z 
m Eh 
OS O Z 
O X x 

x o 
X z x 
H NJ X 
x z a x 
H \ fx x 
X 03 X < 
X u 

X X 

z z z z 

05 05 X X 


X 

II 

X 

33 


X 

H 

< 

X 

O 

X 


H 

X 

X 

X 

X < 

< a x a x 


EH X 
X Eh 
x X 
X < 


a x <x 


x x x < 


D X X XX X 
EXXoaX XX X 

UE<Z<N<<CN< 

< a u a u x u u a u 


•73XXsJXxXcNQ;XX=-«xXNJXXXX=Ha < lXXX>>>>>>EX>>XEHXNaXX>' 
3<<ZdX<ZOO< dX<Z0 3<<dOx<<c_»0300 0 0- : H<0 00 d<zaa - > 
XUUdXXUdXXUXXUdXXUUOSXXUUXESSEEZXUEEXXUdXX^ 


X X XOX XX XX 

X XX>>XXX>XC/3C/3HH< •—* CO CO > > *-* 

<cN 0 < 00 <u< 00 aaxzxxaa 00 z 

UdXUZZUXUZXXXX<r)XXXZE< 


X 

< 

> 

d 


£h 

a < 
u < 

H r* 
O O 
z z 


X 

X 

X 

X 

< 


Eh 

U3 

M 

X 

X 


inioo T 3 ji a —i :n»** in 

X>XDX>ODTiTiJ)J)T\J) 


33333333333 


-O r- oo>3—i.N' v ''rndn-3J 
n3NJN J\333 3 3333 3 
—t —I —I -H N N -N N N -N N .N N 
333 3 333 3 3 3333 


7 N 3 —t'l^'N-nvOr-- x>j\* 3 —in-'' Tin d h 
3 —1 —I r-i -1 n-) r-\ —| —) —) —i .N N .N .N CN .N N N 

•N CN M N N N N -N N CN N -N N N N N -N N N 

333333333333333333 9 


jo s ^ h .N 'f ji x>r- X) 
r^r^r*)nn> nr) rr*nr>nr) nr) r*)rr) 
N N N N N N N -N N .N N 
333 33 3 33333 


<J) 

rn 

CN 


iNfo^iniONcoaiQHCN^fliiniONcojis 
'T'rT’T^’T'T’Tininininmininininini© 
CN .N CN CN CN CN CN CN .N CN CN CN CN CN .3 CN CN CN CN 
3S333333S333333333S 


3 3 3 3 

x 

—i n n "j 


3 OJ - 


X3 3 3 

-h -h a 


3 3 
3 Ti 


3 3 

3 in 


< a cn —i —i j xi —i _i -n —i —i a a on —i to ax x> r- j ) q i, <*» q 3 —1 o> a cn in 

U U a d U u —I U U a d u u U a X U U dO^-ioo © d U in n Cj Cd U U x 


i a 31 h a m 


* a a o' 


x^aNaxoQ<ao''naaNin 

duuuuuuuuuuxuuua 

©o>ux-N7id^ox.N^>crr-<ad—.w. 

3333333333333333 93 3 333333 


a a x » n- jy 


33333933 933“ 


r-JOJiud3 ,v '©r-xxxX3'-i'Tn-X3>< auaxo- 

d dc^-r-r-r'r-r-r'r' x> jo a© x x cox x x x x 

1 * 1 * * 4 ’ .H H H H —C H H H 

33333399 


u u 

a 3 3>—ijiacNinin—<a a<na , faaDafflHininHMNHinincNCDiD 
din'n^ouuxx—<UUUXUininuMuf^QuQ3<X3(jX'd> v ©x 


N"iriniD5i , jaLi]H'TN<cDU[KiS'*)ifNa)oi<!nu& ) (NiniON«oi 

TtT.3>7\TiJ\T.C7\o\<<<<<<<mxXXXXfflXXXUUUUUU 

•—I —I ^ —H-H—1-H-H^ — lr-tr-ii-^r—tr-)r-ti—)i—)i—)i—in -1 H H H H --1 —I r-i r —I H i- 

93333393 3 333333333333333333 3 3333 


Number 30 

432 


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


Page 7 



d 


Id 

CJ 


< 

-d 

X 

< 


o o 

CO E-* o 

co a 

cd as 

-3 CJ Cd 

Z Cd 

2 m as 

Cd 6-« 

z - as 

&■« h s 

X X X Cd 

MO z 

CO m OS 
o X OS Cd Cd 

< £ X > 

d 3 O H < 

X 3 O O CO 


it: 

-d D M M 

z ,h < u 

< J 

td S Z 

J > M d Z 

<<JZ O 

: co vo — o 


x z 3 

Cd d X Cd 3 

2 d x d x d cj < a £ x 

COCO -*><02 X *• «* iH * 

ma<MXXcQuoz<QQ*» a a q (j q t 


z d x < < < a, x x < 

O - - * O * C2 » 

3CJ<CQeO<COXQxacQZXQa£CQCJX<XX 


X X < < £ Of 

XQcO<r-xacjcOxaa£ Z 


X 3 CJ i 


X Q X 


J d x x d x d x x xx x xxx x x 

^?y zz 22f £<i: 5 3<<Or-4ZOr-4003QOOZZaOOZOOXOd3 D^OZOQOOZZQDZUN'JZ^BOOOU 

“irt.a.a..i«>«i MMa j X g raaiSOCaSOiaiaiS<ZJXClHMk:i(0p? Q 0 Q r70(oa|a|Q|tf 


MOiOHHStUUTaid<<£SUJ4aUttOMSMiia ( 0| 1 4ts» 


d z 

O M 

td 

U Z J * 
d 
< 

X cl u 

cj z 


CJ X 
(H CJ 
X X 
d 3 
Z CJ 


m < M d 

x u tH d < 

CJ 3 'O X CJ 


n m ^ in v 

H H H H » 
V W ■ 

a ■s s s ' 


> on -a -h a -r 
i ,3 a rg rN <n 

1 't T T <f f 

> a a a a a 


aaaaaaaa 


i^»nn'Or'a3\sH.N^fin^r'«3\sH.N'*'>fin'fln-s3iSHiN' r !q , inior'; 
■ m m m m m m m *t 'f'TtTTT^r’T^ininininininininininiO'fixiiO'fiiOiDioi 

''T'j’TTT'fTT <3-^r-crvr^r-5'»j'»3 , vrrj'Tr'T -r t • 

>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa- 


i .n m ^ in in r' co 
- r- r- r> r- r- r- 

" 'T ^3* ^ 'J ^ 

) a a s saaa 


Ijl 3 H .N T in lO 

r- d co oo oo co n co 
aaaaaaaa 


a a a -N 

a a a a 


in a 
a x> 


a a -a 


ms m *r m 
S X as s 


Q 

Cd 


on on 'T cj a Q a x 

a u ax a < a —i 


a 

oo 


x 

a 


a iO a o u -=r 
-j a .n » J\ cj 


(NH<' , im<fQg3Min<oiOa ( , BQHifiJiQQtN'»ioiN , ^Hin<r'r v rr' , ’<;r'inrMHU'Of^ : J"C' , c''no'D r '< 

axQaa^» , '3'CJCJCj3'-iocdn—icj-icd—icjr^'sar^a'dQtd—i*rr^a33r--aCj , .dr^x'£>cjcd33P'-cdXM 


'Oco^<iOMin<QcNar'HHH3< 

'f.NHHJ'USuaUCOcOUQCdU 


QMQX<^IONQ 

aou^o^ou 


xr^cocQcjQcdxanxoN<ocdX3«Tr'-'x>ONCjQ;dxa3a' , 'Nxj*nxr^.oooN<:Qcjxa33«Tm 
UldiltdldUCdai-i.Ciji.a.iiCi.CuaaaaaaaaaHHHHHHHHHHHHHHNN.N.NlN 
cvo-ic^c'ioir^.'^rvrvr^o^.^i 04 o-icsimmmmmmmmmmmmmmm. mm mmmmmmmmmmm 
a aa a a a a aaaaaaaaaaaaaa aaaaaaaaaaaa aaaaaaaaaaa 


iOM JUOUQd 

.•N .a fN CN rsi CN ,-N .-N 
'm rm m m tm rm <m , m 
a aa a a aa a 


X a 3 cm m x r~- 
a m m m m m, ro 
m m m m m m m 
a a a a a a a 


<ffiUCbSHINm 
m m rm m *t ^ ^ ^ 
mnmrommfo'o 
aaaaaaaa 


■*rnoocaQ3~'*r 

<f'i'r<f'fininin 

a a a a a aa a 


< d cj < 

< > m > 

CJ < Z d 

y> d — < u 


m j cj 

d < < Cd 

< 6* 3 J 

> * o < 

d Q Q d Q X CJ 

d X d 

d Si 3 d X X a 

< 3 X < 3 O Z 

UidUlQiT 


I * 
d < 

X •- 
< ~ d 
- d 
-* O 3 
— M Z 

cj — a 


cj -» 


— < ■— 

— > — 

Z r d Z 


X Q 
— < < 
uuu 


— 3 ‘d>-.<>—3 
cjcjz><xu<zcj 
---- 


X d 

X Q < 

< < > 

CJ CJ Cd 

d d d 
d d d E-. 
< < < r d 
CJ CJ CJ X 


X < 

< > — 

X CJ Cd CJ Cd 


X d 
3 > 


d d XdddddO 

d X d dddrddx 

<X<:>33<<3<<U 
CJ 3 CJ X X CJ Cj X CJ CJ X 


Cd < 
> > 
< Cd 
CO — 


CO X < 

Z OX 

O X > - 

cj a co cd eo 

3 

d d x a 

X d X E-* d > 

H < O d Cd X o 

X U X X c-4 d z 

o 


CJ X < CJ < 

d k 
> X d ► 

o o < « 

Z X u c 


U CJ X 

M C-* M Q 2 
3 3 3 CO 

O O O XXX 

X 


a o 

Z M 
3 X 
O id 
X X 


o. Cd 
Cd X 
I Cd o 
> X £ 

: h 

I X d 

i X M M 

O Z 

I X Cd II 
• 3 £ > •• 
: z 3 < cd 
i cd 3 co a 


6-* X 

< S> 

dxcos 
m £ cd a 
z O Cd X 2 
*CJ X * CO 
X <C 6-4 X X CQ 3 


Z X X d X O 
< Z < ' ' < U 
Z < £ CO CJ CJ < 


ddd 3 X X 3 d X Qd dd 

<dddE-4XCOCOXMdtSlt-tOXXe-'ddX>>dd 
»<<<Ld 33OX<ZXX00CdX<£00<< 

:OOUX£XXXdU3d XXXdCJ3££CJU 
O £-< 

6-4 3 

< O CO 


> 
N O 
X £ 


J CJ X 2 
- * Q W 

: d cj x 
d x 

> d CO 
O < 3 
£ CJ X 


d X (O 

d d X d Z d X 

3 X •* * O - - 

ZMQQUCJQCQCO<mX< 

d X d X 

dNCO>>dXXX><X> 
<Z300<0ZZ05-*Z3 
CJ3X££CJXMMZCOMZ 


- B Jl S H a 


*rnvor~ D^a^-ia'^'Tnar^oo J'arHa^'Tnvor^oocTi a-iam<finiOMD3>s 
~ ~ * ~ »Tninninninninn.nv£>v£)vovov£)vovOv£>vOsDr^r^r^r^r^r^-r~r~r^r~x 
rr*sr)^~r)rr.r*>mmmmm mm mmmmmmmmmmmmmmmmmmmm 


aaaaaaaaaaaaaaaaaa 


HaMviniOMosaHaro-fifiiOMsaiS' 
\ui-i'i'i'i'i-i'i'i'i'iuCOXCO®COCOCO®COa>3l3'0\J'3'0\WO'3'a! 
mmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ‘ ~ 


a a a -4 a a a 

a a a a a a a 


m a a a a 
a u- x x a 


<f «*ia 
a a a 


a 

x 


a 

a 


a a a 

a a a 


x on x CJ a on on 

x a a nn —i <r «r 


lO H id jn ON a 
on a m a a n 


on m cQ a 
x a cq a 


x ' 0 * r~- oi n 

a cj co a a 


3n—tQ^H-HaQOQONQmQoonQQ'-'-tQQ'B 
03^HCJ3CdCJCJdCJCJCJCJCJ0dCJCJCdCjCJd 


3—40Nn<C'TQ^3QCdQQ30NnnncQ'-HQar-t"^f—i^HON«COr^^QQQooa 
OQUUaf<f[duU' , ’UUUUQUXM!NUU‘N[uOQUaUUi''fU(JU'0 


ON 

X 


q n q a n 
CJ x CJ CJ 3 


QQ<H3roQa<3CJ 

nCJQaar'aar^ 


xoi<Qa—lanaoajcd 
nnnnxxxxxxx 
a a aaaaaaaaa 
aaaaaaaaaaa 


xamasoiCQa—I'a* 
xr^r^-r^r^f^-r'xxx 
a a a a a a a a a a 
aaaaaaaaaa 


r-xoNOQcdXaf'N«Tn 

dxxxxxxonononon 
a aaaaaaaaaa 
a saasaaaaaa 


xxQaroxr^xoi<x 

ONONON<<<<<<<< 

a a a a a a a a a a a 
aaaaaaaaaaa 


idrH*rr-»ON<xcdM«3' 
<CQiXCQCQCQcacQCQCJ(J 
a a a a a a a a a a a 
aaaaaaaaaaa 


nxoNCjQCdxaroxoN 
CJCJCJCJCJCJCJQQQQ 
aaaaaaaaaaa 
aaaaaaaa aaa 


< (K) X S H !N ^ f l/l 
Q3QQXXXXXU 
aaaaaaaa a a 
aaaaaaaaaa 


Page 8 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 30 

433 





< < - < 

H H' H < 


: < z x < 

: o x o £ x 


xfn<a 
x < .. * 

X Z H X ■£ 3 


N U IX N ^ 
n -3 O “J x 


H x H H 

X > X 
X £ Z X 

o 


J ISJ < > X 

< Z Q O Z 

o 3 x s m 


a: ja.x> 

Z C E X O 
h u n s 
H 


XH oQ 
oxo 
X OS co x 


XSSXSXXSXXSSXSSQ S.2SX.2C0C0Q5.5CQ _2S.SQ 2 2XXXX 2 X 8 2'2XX2 
QQQQQQQQQQQQQQQ QQQQQQQ QQQChQQQ QQQQQQQQQQQQQQi 


1 cm no «f in vo r- 
vO'OvO\Dvo^'i)r'r'r'(^r^r't^f^ 
jii/iifiiDifiifiininiAirii/iatinifiin 
SSSS3S3SSISSSSCIS 


r'-r^ooaocoGO;x)ooao:x>cococricj\<5>J' 

inininininm-ninininininininmin 

83S83S33S8888388 


'fin^or'C03N3H.Nfnfl , in'cr' 
0M^au3\0>3'SS«33SSS 
i/iiniCi/iiCinvovDCvo o >o -o vo 
38338338333838 


CO^S.H.‘NfO^/l'Or'XJl3H.N' , <1 
SSHHHHHHHHHHM.N.NM 
-Q 1 p vO ^ vO -D iO vO ^ vD vO vO vO sO i Q 
33 3 3333333333333 


^in^MD^SHlNrCTi/lvOMD 
[NiNMiNMCNfnmcn'nfOi'immm 
kO > XMO'0-0>£^)>0<fiifi^^<0£vD 
3 3 3333333333333 


no CO *f no «f no ^ xT 

33 3 3333 333 

UUUU CO Q 

Cli X CN Cii 3 3"> X CN CO V H Jl 

<<Uj<i ( OM^vOHQ.N<r'n^a«HS 

UQXU<uU®^UU'cr'iN3uU' N r' 

■^•r'<CJX3'HCNTfr^<Q3rHCNrri'X>a\CJ 

38SSSHHr|Hr|rHININ!NINMIN!N 

333338SS333S33S3S33 


3 if Q r-t if U, *T X no 

s in ^ 'tf n 1 *r ■f ld 

i—{ a\ s^‘HCi.'»irntN'nfnc\ivroa«»iHca 

O O QST^STins^inS'T’TS'J'f 

Qid^t ll H(Nfl'CMJ\<IIl Q U XHfO V ifi 
tN|.-N.N(NfCrO'C'OrOfC"1'Cf^rn"1»rfq'’T 

3333833S3S333S33333 


in o> in -n Hin h in h in 

<f «f vO >3" «f T 'T lD lT> 

'XMJlOU.NiilHiOi/UJiNU'nUQ'J^Hi, 

3N , <r<rs'rs’T3'rN i 'r3'3 , N , 'jsin'r 

'T'r'T'T'ji/iicii/ii/iiniciifiiniriinin^iDio 

^ if if f *f f if if fffffffffff 

S3S8S33S3S3333S3883 


■y\ —t*r rH.-N m o h h 

f if f <f m m f m«f 

mH'T^uU'n^fNf^ffcj'jinin^ 

fsn3f-f3f'rins'f'f3if^r3'fin 

'£M)»<UQlXSM'Cf'Xl'I)JWDQ[i]3 

vOvovovovoX'Oior~-r~r^r~r-r'~r~r'-r~r''X 

fffff'ff'ffff'ffffff'ff 
83333383833 3 3333833 



f rr s "1 mrcrcmfimr'if'ii’ircsi'if'ir'l cn s no cn cn no no s 

3 8 3 CO 3 3333333333X333 3 S 3838 3 8 X 

C_) r- if 3 f Xin'f3Q.-H0N3XQ3 3 0'ir' if VO in f H I s - Cti X 3 

■ji Q 10 3 m uMn3iaco<oiQ®35i<Q *f 1—1 a f h < QX8 

.NQnJH3MnQ£0QtNQWQtNQfCQMHWQQ MCDQHCJNQ.NQQ(3\Q(NHOMn 
OOOCNOQOXOOOOOOOOOOCNOOO UauQUUUUUUUUniuQ 

r-<Q3Xfinxovox.'^inxcQXrH^'r'<Q3mrovor^<cQOxrNinxavcjxrNro 
'nininvovovoi£>v£)vovovor^i^-r^r-r^xxxxxo>!Tia>inovcTiaN(TicTN<<<<<<xx 
nononororor^nonOnonO'^nornnonononoronononO''OnononO''Onononononononononononono 
33 3SS888383S88S8 3338SS8888333388388338 


no no no 3 *f n> no no «f *f if no no x f 

8333 8 3 83833 S 3 38 33 

f Q <Ti VO CJ ao CO OaiTlU3'3'Ul® 03 0300 O X o 3 

in Cd< r-H CTi CN if JltNO'J'^OO'IN <Xl no 3> CN X X "N f 31 rN 

QCDQQlUQH!J'<IiJ3Q£Liai<CiJfn<ai r t<a<3'<ti]XX(J'<Ci3<<tnUSQ<M 

OaoOUOQOi , '!i.OU<0«XO m XOmXO"’XQ<0' , lXOQ<XOOi , lX 

ifr^xxxxc'jro'fr^(Ti<QMXCNj’fr'<oxiN^finao<xoQ3rNinx<T'XOXiN 
XXXXXXOOOOOOOOOQaaaQQXXXXXXXXXXXXXXXXS 
nonono''n<^rononononononorononononononorononononononO''OnononononO'"OnOi'OnorO'f 
3333333333333 8 , 3833S8SS3S3383S83 3 33 3 333 


Number 30 

434 


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


Page 9 





M 

O 

X 


U 

M 

£ 


O 

M 

05 


M E-* 
X U 

M < 

X X 
H 
M 

co X 

< o 

CO Cl, 


X 
(N. H 
Z X 

M 

< X 
X x 
M U X 
O Cl, 
Cl, Cl, Cl, 

o 


o 

3 

o 

X Z 

as e-< h h 
Z O Q 
H Z 'J I 
JUHU 
•J X X 





O 





s 





o 



o 



o 



o 






o 

o 



£ 




M 







M 


0 


M 


M M 

Eh 

X 


£ 


X 

II 




X 





o 





£h 



£h 



M 



Eh 






EH 

Eh 



o 




£ 







> 


z 


> 


M > 

X 

Q X 




m a a 





< 





Eh 





< 



< 



< 



< 






< 

< 



Eh 




O 







< 


M 


< 


X < 

M 

Z < 


o 


X Of Of 

u 




+ 





< 








+ 



+ 



+ 






+ 

+ 



< 




£h 






M 

X 


X 


X 


Eh X 

Z 

Cd — 


z 


XXX 

X 




Eh 





+ 





Eh 



0H 



EH 









Eh 

Eh 



+ 




< MX 






EH 


















< 





Eh 





< 



< 



< 



< 






< 

< 



Eh 




+ M < 






O 







Of M 











Q 





< 





X 



Q 



X 



U 






X 

£ 



< 




Eh X X 


X 




3 a. 







X o 




u 




X 



Z 





X 





z 



a x 



a 



o x 





X 

o 



X 




< Eh U 

Eh 

X 


Eh 


O' O 






> 

Eh X 




< 




1—l 

X 


o 

X 


X 


a 

X 


X 


o 

X 


< M X 

X 


< 

X 


X 


X 


X 


a, x 

X Eh X 


X 

< X 


X 


Of X M Eh 

3 

M 


3 


X o 






< 

> > 




X 




z 

z 


u 

z 


z 


u 

z 


z 


u 

z 


U Z Z 

z 


u 

z 


< 

z 

z 


z 


< z 

z < z 


z 

u z 


z 


M Z £ X 

X 

X 


X 


< X 

2 



s 


X 

U H 


X 


X 


X 



O 



o 


o 



o 


o 



o 


- *• o 

o 



o 




O 


o 


- o 

o - o 


o 

- o 


O 


- O < M 

z 

< 


z 


> z 

X 




X 

X 

-05 




o 




a 

u 

X 

X 

u 


u 


x u 

3 

u 


X 

u 

X 

X Q U 

u 


X 

u 

X 

X 

a 

u 


u 


X u 

Q U X U Q U 

X U 

Q U 


X u z z 

f-f 

Eh 


M 


M M 

a, 

X 

Q 

X 

X 

X 

X X 

X 

< x < z 


X X < 

Q 


X 

X 


X 

0 x 0 


X 


X 

0 


X 

X 

X 

X 0 


X 

X 



X 0 X 0 

X 

X 0 X 


X 

0 X 


X 0 

X Q X 

X 

X 0 

X 0 

X 

X 

X 

X 



Q 

Q X 





X 




X 

X 

M 

X 

X 

X 

X 


X 

X 

X 

X 

M 

X X 

MMX 

X 

X 

M 

X 

X 

M 

M 

X 

X 

X 

X 

M X 

O, X X m X 

X 

X 

X M X X 

X 

X 

M X X X 

X 

X 

X 

X 

X 

X X 

X 

X 

X 

M 

Q 

X 

M X X 

X 

> < x 


X 

X X > 

X 

X 

< 

3 

X 

< 

u < u 

X 

< 

o < 

u 

X < 3 X X < 

< U X 

< 

3 

X 

X 

< u < u 

X < 

o < u X < O < 

U X < o < u 

X < X < 

< 

< u 

< u 

< £ 

3 

3 

3 

X 

< 

X 

X X X o o z 

ZNXOOO 

3 

X 

u 

a, 

X 

u 

X 

u 

X 

X 

u 

X 

u 

X 

X 

u 

a, 

X X u 

u 

X 

X 

u 

a. 

X 

X 

u 

X 

u 

X 

X u 

Or U X X U 

X 

u 

X X u 

a, 

u 

X 

X U X u 

u 

u 

X 

u 

X 

U 3 

a. 

X 

X 

X 

Q 

X 

XXX 

X £ < 

*-H 

n 

X 

X X £ 

X 


•3 , invor^coa\SHCNm^irnor'coo\SHCNn'finvor'00(^SHtNrn^invor'coONSHtNnfl , in\or-co3iSHr'im^fin>ar'Coa\SH.’Nro^in>or^cO(j\SHM' ¥ i«i'invor'00 
HHHHHHCN(NCS[N(Nrsfvi(NNcvi(»iro(»ifnrn'nrorornfl^<f<t<f^^^^tr<rininininini/iininiflifMO'0'avDvovO'O i £\CMor'r'r'r'r'r'r^r'r'M»oococococococooo 
r^r-r-r-r^r^r^r-i^r^r^r^r-r-r-r^r^r^r^r-r^r^r^r^r-r^r^r^r^r-r-r-r-r-r-r-r-r^r-r-r-r-r'r-r-r^r-r^r^i^r^r^r^r'r^r'r^r^r^r^r^r^r^r^r^r^r^r^r'r^r-r'r^r^r^ 
s 'Si ■a s •si ssssssssssssssssssssssssssssssssssssssssssssss ass sssssssssssssssssssss 


S S S 

CO S CO s 


S 'T S S3 

s co s S3 


«J* S <f s s s 

00 S CO CO S3 S3 


s 

S3 


S3 

Si 


S S S 


T SVfOCOM 
CO S3 S3 S3 S S3 


CO 

S 3 


CO sO Q S 

H >0 Q H H 


CO lO ca 3 vO ’£3 

(-" M CO S H rH 


Cl, £3 Cl, CO 'T Q 

»r h N <r in a 


<r uoi 

in CO Os 


S3 S M CM 

(S X < X 


U 

X 


HQinnQ 

h u a n u 


XQXMQMQXMQinM 

MUXcmUQUMCmcjMcm 


QQXMQinMMQXQXMQMQXMQMQXMQMQXMQCMQQQXQX 

UUUNUaMHUUOUNUQUU<NUQUHNUQUUNUNuUUUUU 


QcOimninH(MNH[NO\HU'nU<<J'Hr-tCOtN 
UUaUQfNcofNCNCNa Mr'<cocjCL,CJU r " tT ' 


05 (J Cl, S3 CO 

CN CM CM ro CO 

in in in in in 

S S S S S 


so r- < X X H CM 
co co co co ro *3* 
in m m m in in m 

S S3 S S S S S 


in ID <T> CJ Q S CO 
t t <r <r in in 
in m m in m in m 
s s s s s s s 


lO O' < Q S H 

in m m in io io 
m m in m m m 
s s s s s s 


r- < co m X cm 
SO SO sO SO so so r— 
m in in in m m m 
s s s s s s s 


m so as < Q s 
r" r" r-- r~ r- co 
m m in m m in 
s s s s s s 


h ^ m co x u a 

m m in in in m in 

s s s s s s s 


ScoioaiCJGuCNcoiOf- 

in m m m m m in m in in 
s s s s s s s s s s 


<QHXsco^rr-<Q 
<<<<XXXXXX 
m in m in m in m in in in 


a asHCMimor'cecj' 

axuuuuuuuu 

m m in in in m in in in in 


S3 S3 '-I S S3 


a j h 

3hH 
U < < 


O > 

Cl, < 
£h X 
> X 
U X 


soa 

X Cl, Cl, 

£ Eh S 

' > - 

S X U X 

s 

Q 

2 M J »—l 

Q ^ X X > 

Q X X X 

X 
Of 

X J Eh 

> <x 

X OI < 

X > £h 

XXX 


X H 

O O 

Eh 3 
< Of 


O 
&h 
X < 
O 

Z 

X 3 C 
X O 3 

x z : 

Eh X C 


X X X EH X m 

X H < < h X < X 

X 2 C* Eh Z Z XZ 

* «. » *■ > - ^o » o 

X£X£X£XMXQUXXU 

Q XX 
5<m5<m5<mmXmmXX 
Z>Z>Z>^' T ' — 

M x M X M x 


X 


< 

> X 
X z 

- W - -o 

3UXXQUXXU 


X z z 
*o 


O X 
X Z 
-O 


< X X 

X z z 

- O O 

X U Q U 


< X X 

X Z O 

-O 

x o X X 


Q XX x o x o X X CJ XX XX X CD x m X X CJ X X 0 XX 
mXmmXXmXXXXmXXXXmXXmmXXmXXXXmXXXXmXXXXmXXm 
XXXX<XX<CJ<UX<0<UX<3XX<XX<CJ<U5<<0<CJX<0<CJX<35< 
XXXXUXXU5<05<XUXU5<XUXXXOXXU5<O5<XUXO5<XUXO5<XOXX 


3'3HN ,, ''Tinioi v ®3'SHMfOif/iar'®iO'aHf'ioM | inar'fflO'3HN'OM'inar'ao'SH!N'*''»in'or'coo'SH."Mco'»iniDr'»0'SHCMcoM , inar'®0'SHCNco 
M'^TTTT^^^^^^^xininininintnininin£>£>£>£5£>£>£>£>£>£>r'-r--r''r--r'-r'-r-r~r~-r-cococoaocoooaoaocoaoa''05050505050''05a>05ssssssssssMMMM 
O £3 £3 £3 sO £> £3 £3 £3 £3 £3 £) £3 £3 £3£) £3£3 £> £)£> £)£)£3£3£5£3£3£3£3£)£3lO£5^£)iO£3£3£3£3£3£3£3lOin£3lOlOiO£3£5iO£)£3£3lO'sO£5£>'nr~r'r^r~r^r~r~-r~l— f" I—l~~ 

sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss 


s^r^rss 'T s s 

CO s co CO s cos s 


'T s 
00 s 


s s ^ s s ir s 
S CO S 00 00 S CO s 


s s 
S CO s 


H N O' CO 

•o 1 in ^ in 


S S S S S X X 
S S3 S3 S S < Cl, 


Cl. S 

Cl, S 


S S r- 3 £ co £3 £3 
T S CQ 50 S M CO >—l M 


i—i so 


SO M 


■T 3 £) —1 £3 

in s rH a> i—i 


< so 


in rH 


CO 

'T 


U r- s as u ^ ir> 

IT S iTUT T /) 3 


CO co ^ 
in it s 


i/'Hi/'rHSO'SS 

*r^s<rinmss 


S3SSH>M£C0£)O£3O£)H(NH 

SSSSrSINcOiNcONCHMcOININN 


QinHQaQfflHQHQfflHQinH 

UMiNuauuMuQuMNuaM 


Q in rH Q X Q X 

u a m u x u m 


QrHQXrHQrHQXrHQin-H 

uauuiNuQuu.Nuu^ 


fM O t £ co <; 
00 CO CO CO 00 CO 
M 1 T 'T T M 1 

s s s s s s 


X u 

00 CO 


s s 


XSrHfN<r£>r^o\xUQX|Xsrsj«a , £>05UXCL,rHrM'srinr^- 
a>asasasasasasasososasas*c XXXXXXXXUUUUU 

SSSSSSSSSSS 3 ssssssssssssss 


<QSCOVOI—-kCQMMCM 

uuaaaaaaacdM 

SSSSSSSSSSS 


inDCMJQSm'Jh<QU 

aaaaaaaaaaaa 

ssssssssssss 


s 

in 


s 


s 

m 

s 


in oo on cj 

s s s s 

s s s s 


a.srorrf'- 

SHHHH 

in in in in in 
s s s s s 


< X CO Cl, CM 
HHHHM 

in in in in in 
s s s s s 


in £3 

CM CM 

m m 
s s 


Page 10 


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


Number 30 


435 




u 

OCJ MUUUOCJOUU 

CJCJi-HH-t Smihmmi-hhhmm 

ZZOOmHOOOOOOOO 
OOE-*H£<H^6-*H6-'HHEh 
E-*6h<<0.+ <<<<<<<< 

<< + + 6hH + + + + + + + + CO 

+ WQS JJU 

sjiH.N«j , i/ir'»sH' y i'f\or' 0 \s < < cn jn^'i'Hr^QscUMjvojwaiNU^Jco^H co £ z q as < as O <-3 

HH(N(N(Nf'irM.-NfOmfOfnm«ir»ntJ«^a:inzcoOH<HCi.HQMQtNJ[ND(>JH' r iO' ,1 C^J , J'K os Z ox I Ct< Q Q J X X X M CO < 

i,i,£i,iui,a4!i ( !i l [iiCu!i,Ct.[i 1 CiH(i,Ct.HH<CL 1 QCt,Oti-e-'CuOCv.CiJCt.<li.<ti.3ti.OC»-<^COCL,>Ci J a J i < < Q Q H O >N (d < < Z> rH Q "N < CO > 

<<<<<<4:«i<<<:<<4:<<zucu<u<<<u<Q<u<u<z<cij<a l <«{<[d<<<UHUHU'N<®u»QHU-iUHzcoucoii,^<Na 


X 

a, 

a. 


< ~t 


2;3 2 2232223S3222322SS2SS23223S22333SZ2ZZ2S233: 

QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQaQQOQQQQQQQ- 


X'H^rr^-srncoj* 3fnioa>cNinao.-i*rr^3 *h r- 3 ro vo cn m in xj »h 

r-t cn in (N ro m m m rH ^•r*i-ipH<-i'HrMC'imrorom^ , f>iin®<H^H^Hr'imc>ic'irororo 

CliCliCiiCz^IxiCliCliCli Cn CtiCnCnCtiCnCuCHCLiCLjCnCHCnCiiCuCnCnCnCnCnCijCnCnCijCuCnCn Cn 
<<<<<<<<<<<<<<<<-<<<<<<<<<<<<<<<<<<<< 
(NroTrinvoi x -coo'SH!N"i'j , LOtcr , 'OOij\(aH^m^Lncor'XONSiHC'i' y i^Tinvof > '00o'QHfNn^ , invor^oo^®H<N' r i^'iO'or^ooj\iaHCNM<j'mvflf'30(yNSH.Nfn9' 
voi£iyovoiovDvo'or'r'r'r'r^r'r^r'r^r-oocococo33cococococoffio>OMj»OM3>a\(j\o>a\sssissis®aisiiaHHHHHHHHHHr>4cMCNCNMCNiNM(N.NMfnfOf»iro 
:»xco»a3cocoaococococoaoaoaoxaoa3aocoao3ooao»:ococox3aocoa3coajxcoxcna\nnnncncnnnnnn^a\^nn^a\cntna>(na>nncnnncn(ncn:n'n 
33S3333S3333333'S>® , S>SS3333S333333333333333333333333333S333333SS3333S33S33S3 


iOvOmi 0 iOvOl 0 iOV 0 i 0 vOiOvOiOlO^OS ^•vO^ , iOxriO«J , iO^ , iO^’i0^fiO^ , iO*J’lO«a , lO 'rvDfl'iOf'D'T'DSS'aSSSSSSSiriSSSSSSSSSSSHS —I 3 rH 3 
3333333333333333COCO30O3CO3CO3CO3CO3CO3CO3CO3COj2COiSCO3CO3COr23333333333333333333333333333 

Cuf''»liar'Ci 4 CQ' v 1Ci J r'f»>cDr'Ci J cO rr i®'0( s '<;cO' T 1CL4Hi»lli < r'OOfflQCL<fOfOOOr-QCD' v 1CL4ffl' y 1Hr x vOCQ^H®H'OMCQHHMCuH' r lH^£>Ha'HmCN!nrovO(NU‘'NvD<»i 

'Tcoina3incoin(^ini^ioa\voa\^<isro<rn <I ;rr < j;rocQ^cQ»rcn^(iir'Ur s U^U co U®Q | 3'Q 1T 'Q'SiSHSHSfN®rococi J sssss'J , cocQcou'SHS' r isiais 

QCL,Hnmr'j-cQQii ( Hninr'(jMiiQCL < Hroinr^(TicnQ(i J Hfninr'aicQQu,Hrninr'^cDQCi < Hroinr^(j\cQQCi.Hrnuir^aMiiQCi,Hrouir^!j\mQCL,H^inr'(^£iiQ 

xrx*ininininininininiOinin\Ov©\ninior^r~r^r^r^r~r^r^3®OT®ooaoco®<n<n(n^<n<n<n<n<<<<<<<<:cQcacocoxcQcQCQCJ(JCJUOOCJCJQQQQQQQ 

COCOVOVOVOVOVOVOVOVOVOVOVOVOSAVOVOVOVOVOVOVOCOVOVOVOVOVOVOVOVOVOVOVO^OVOVO 'O'O'DvO'OVO'O'OvO'DvO'O'O'O'O'O'O'O'O'O'O'O'O'OvDvO'Ofi'O'O'O'O'O'OvO'O 
3333 S3333333333SS33333333 3 3333333333 3| 333333333 S33333SS333S3333S33 33 3 3 3333 



m in m m in in in ^ in 3 3 3 in co s 3 s 33 'T 3 3 

33 333 3 3 3 3 SCli3 333 3 3 3S333S 3 

3 <£ CTi i—I <C 3 O CJ CN Cn 3 0"\ 3 Cn CO T\ vO <T> vO «3* VO V 9llO>CiC'CiO'£lOiClOvOiC 

Q CQ Cd Cn CQ CQ Q Q 03 Q 3 ^ --I Cn -H I— t 3 3 3 rH CQ >— I CQ 333333333333 

S <f'OWNfo<<CKinoMB<oiHHHCQaincNini , ns<H<aiHinrom QcomQQmQoicncOQHWQinin<fQQcDQQcD<;aQNHHm!i J com[i J M^£iiM<cQco 
Q''J , r~-cj<ncjQ'TCJ3WCNCnW(JCnMU ( ^'Q'S>UCnUCNCnUOUU CJUMOUMOUUMUQOCJWQininCJUOOMCNCdCJcNQCdCji£)ror'cnr-'» , r^«a < r^^cO 

<QSH(Nin'OtjiuQU^ | s ,T ’ , > , inior'»ij\<QUHfN<viior s -co3iU£ijCi<'N'»i'fr'<cQCdCKiaH'finiO(j\<cQUOSH»fr'»cncj&<N(»i'irc^a\caQCx J Hf , iin(^o\cQ 

UUQQQQQQQQQQtdti3MCdUUtdIdCdUUai[L < Ii J Ci,Ci.[i-Ci<CnIuCiiSSlSSS3SSHHHHHHHHHH(NCM,NMr'ICN^(N'*imwmmf«irom^'T^'I'T'J' 
inininininininininininininininininininininininininininminininininioioiO'Oi£>'Oioio>x)io-oioioioiovoio^ioioio^'Oii5iO'CioioioioioiDioioioioioioioiD 
3333333333333333S3S333333333333333S3333S3S3333333S 33333333333333333333333 


Number 30 

436 


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


Page 11 



A Curve-Fitting Program Using 
a Focal Interpreter on the KIM-1 


BY THEODORE E. BRIDGE 

54 Williamsburg Dr. 

Springfield, MA 01108 

I have three reasons for writing this article. First I want to 
report on my experience with the FCL65E interpreter that I 
purchased from the 6502 Program Exchange, 2920 Moana, 
Reno, NV 89509: 

Program (HYPERTAPE on cassette) $19.00 


Mini Manual 6.00 

User’s Manual 12.00 

Listing 35.00 


Total $72.00 


Not being able to locate a suitable BASIC interpreter for 
my KIM -1,1 decided to give this a try. My first project was 
this curve fitting program. I believe the FCL65E interpreter is 
more compact than BASIC, possibly a little slower, but quite 
adequate. It has excellent diagnostics. It even has string func¬ 
tions. 

My second reason was that I would like to see a BASIC 
version of this program published in DDJ, hopefully with a 
timing comparison. With my program, it took 40 seconds to 
calculate the regression coefficients in example 1 with six 
degrees of freedom, and 16 seconds in example 2 with four 
degrees of freedom. I think there may be many readers who 
would like to have a BASIC version of this program. 

My third reason is that I want to donate this program to the 
public domain. It is very handy if you want to read data from 
tables or curves, or even if you want to make sense out of a 
large mass of test data. 

I once used a FORTRAN version of this program to analyze 
a large block of test data on the performance of a very big 
centrifugal pump. None of us could make any sense out of the 
data, but the computer could. It showed that the efficiency 
peaked at the end of the first month, and then started to fall. 
We were then able to optimize the maintenance schedule on 
the pump. You could use a similar program to optimize the 
spark and throttle setting on a gas engine as a function of 
speed, load, and temperature. 

In the listing, I present a FOCAL program for finding a 
formula that will relate a dependent variable, W, to two inde¬ 
pendent variables, X and Y. When we say W = /(X, Y) we 
simply mean that the variable W depends in a definite way on 


variables X and Y. For any value of X and Y there is one and 
only one possible value to W. To make this analysis, we assume 
that a polynomial equation can be found to express the 
relationship. 

We will now consider an example having 3 degrees of free¬ 
dom (a parabolic fit) with respect to X, and 2 degrees of free¬ 
dom (a linear fit) with respect to Y. 

The polynomial equation will look like this- W will be the 
given value, and V the calculated value of the dependent vari¬ 
able: 

V = C(0) + C(1)X + C(2)X 2 

+ (C(3) + C(4)X + C(5)X 2 ) Y 

So you can see, if we knew the coefficients in the array, C, 
we could calculate a value of V for any combination of values 
for X and Y. 

Our first task is to find values for these coefficients that 
will give a minimum error. Since there are 6 unknowns in the 
array, C, we will need 6 equations. These regression equations 
have been developed in the science of statistics and are not 
hard to program. We will express these equations in matrix 
form. For each data point (one value of X, Y, and W) we will 
develop a correction to be added to the matrix and will collect 
the total in array, T. 

We will build the first row of the correction matrix in array, 
U, and each of the following terms will represent consecutive 
elements in this array. There are 7 terms representing this first 
equation. The last term is the given value of the dependent 
varaible, W. Thus: 

U = 1, X, X 2 , Y, YX, YX 2 , W 

Using the following algorithm, we will build the regression 
matrix in array, T. It will have 6 rows and 7 columns. We 
initialized array T = 0. For each data point, we will update 
every element of array T as follows: 

T(I, J) = T(I, J) + U(I) * U(J) 

I varies from zero to Ml, and J varies from zero to M. Let 
XI = the degrees of freedom for X, and Y1 = the degrees of 
freedom for Y. Then M = XI * Yl, and Ml = M — 1. 

We must have at least M unique data points—as many as we 
have total degrees of freedom. That is, at least one data point 
for every row in the matrix T. The more, the better. After all 
data points have been processed, we will perform a Gaussian 
elimination to solve the simultaneous equations for the regres¬ 
sion coefficients. 


Page 12 


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


Number 30 

437 




This program was written in FCL65E (FOCAL) for the 
KIM -1. FOCAL is very similar to BASIC: 


D for (DO) 

in FCL65 

is 

like 

GOSUB 

in 

BAS 

C ” (COMMENT) 




REM 

** 

»» 

F ” (FOR) 



»» 

FOR 

»* 


G ” (GO) 

»* 

n 

»* 

GOTO 

»» 

»> 

I ” (IF) 

»> »» 


»» 

IF 



S ” (SET) 


»» 


LET 

>> 

>» 

T ” (TYPE) 

»* »» 



PRINT 


»* 

A ” (ASK) 

»» »» 


i» 

INPUT 

>» 

»» 


The DO statement in FOCAL assumes an implied return at 
the end of the line (i.e., D 6.8 in line 5.7 of the listing); or, at 
the end of the group called (i.e. D 3 at the end of line 7.1). 
However, a return will be made whenever the command R is 
encountered. The FOR statement in FCL65E assumes an 
implied NEXT command at the end of the line. 

The IF statement in FCL65E is like a FORTRAN II IF in 
that it cannot handle logical operators. Rather, the expression 
within the parentheses is evaluated. A branch is made to one 
of three line numbers that follow the closing parenthesis, 
depending on the value of the expression. It branches to the 
first line number if the expression is negative, to the second if 
it is zero, and to the third if it is positive. If any of these line 
numbers are missing, control drops through to the next 
instruction. 

I believe that the comments on the listing and on the 
examples that follow will complete the explanation of the 
program and its use. 


0X2 
U, F- O 
U. — 

U to 

P _4 01 I 

a H X I 

_> u; 
X 01 P < 
X I 

Ul o 
0, F- I 


>• ui h ; 
X 04 
Inti 

h u. o ; 

•• v, , 

ri5ui: 

04 it > 
W u j I 
X O O l 


; to 


u x 
w o , 
cu ui h ; 
x x 

H H 2 

O 

03 O 
04 vX 
L- uJ 
<Ul3l 

11 <2 


>- 

£ 


F- F- 

H 




H 


— 

* 

>r 




2 •* 

2 

X 




^ U: 


> 

ii 


< 


« P >4 





X 

• 

u 

ii 

< 


VX 


o o; »-t 

O 

J 



o 

CU 



CM 

CM 

H 

X 

X X X 

X 

3 




CM l 

CM 

>- 

0) CM 

CM 

D 

••l 

X H 


p 



X 

1 

II 

# 



O 

— 

< <t 

X 




X 

P 1 

o 

CM 

— CM P 

P 

X 

1 

h Vi E 

o 

2 



< 

M* 

s 


• CM 


II 


<34 - 
P 2 

a 

□ 

> 



X 

o 

m 

p- 

•** 

CM P CO 


01 

II 

M 

<C O 






F- % 

in 

01 

X r' ■' u 

w 

■* 


<00 H 

X 

o p 

J 

J 

<t 

O 

ii 


i n a u 

4* 

— 

01 


< 01 w -- , ~ 

(4 Q i/i Ui U U J P 03 H • 

o UJ x _J O — CM CO 

0,00 04 .1- — J Q W _J • It 

m O 1/1 II .^hQnO OusUJ-Q 

t' 

H □ O-sJ.'O — CO 

<t . -• P It II II II II II U II 1 

2-"OUUJ>>^0^5» X . — 

W ^ X 

q w \o u, di - cm ca — cm si in o; — — 

04 > U. X II It II II II II . 0J — — VI 

004 0JEXXXXXX CO X — — : 

O Z-> O O 

O U O U O VI W Ui W l/i Ul OOHH0J0, w Ul F Q O Q 


UJ — 
^ >- 
Cu > 
X CV1 


XW II 
~ <*> 2 


CO II 
N N • 


+ ♦ 

2 - 
II 2 
— II 
2 2 
X U, 

CO CO CO 


— co in i 
o ca co i 


} CM <s ts 
« CM CO 


M <T 

II • 

M X CM 
CM 

to : ^ 

— M 
cm : w 

CM H — 04 
CM 

^ 00 s CO 
N II *11 
wm: w 

m ul F Ul 


CiSCUCItJCllSSC>i5iCi; 


Ol & S Si ^ 
CM CM CM CM CM CM 


CM CM CM CM CM CM 


SI 81 81 £1 



J — — 


U Ui 

X J 
U Ui 

co tC 
UJ u! 
■» > 


r- — o 


<z o - 

■ 04 2 l 
! o. uj 'ii 

o J - 
i u, u : : 

• T. < - 

; SSi 

ui : — 
•03 •» X 

■ X — || 

» x — £ 


‘3 .* 

II CO 

«S> CM 
Cl Pi 
CO * 

• Sj 
CM I 

co *o 

X - | 

Z Cl CM 
h “J M 


X < 
— X 
H •» ^ 
O — 

O O — 
U C- 
Ci Sj 
ul O \ 
U Oj — 


- II II 
. CO CM 

i “0 


— CM Ui Cs. 
C* — CM CO 


►« CO *0 

0J ^ + 
Ul H H 


O “S ■» 
2 I — 


3“ A 

o | 

11 : to 

2 H Cb ‘ 

^ C> <T ■ 
H . ~ 
2 ^ tj I 

X cm i i 
X • ■ 

o ^ 

F- <3 h 


I 


O 01 I 


X y 
, * 


wj : 

II x 
h3 : 
•» % 

— -o 


Z V F 
O • * 

-» — <r 

i* 

U t. — -M Csl 

2 II I II • 
— =0 — — 


x n 

— * 
X “3 
t— ♦ 
< — 
T. II 


j r. 

— «\ 

U Ck 


C 5- X X 

II X P 


i Gj ed 
I t" ox 


i 01 O X 
i lit P- O' 


II •» 

— Cii 

II 

X o 
X •«* 

— X 
II 

— — 
l- 0j H 


r~ o 
u . ... 

Ul O ^ 
F « Z' 
2X0 
— I + 
X — u. 


— -c 

O — i_ 


( 7) 
2 X 




X X {- 

•«* H II 

i/» X < 

<44 •» : 

CM 2 

II x * c 

O W^l 

H II l 
U. 2X1 

- X C 

0, l 

X 01 

h I 

W X ( 

— X * 

2 < (- i 

^ t 

O 01 X I 

F* l 

U -Pi 

II X I 

— — — U II 


o x 

X ~ 
F- 
o ■* 
H 7) 


O 2 

*-! S 

X O 


X — 


O N 

P - 

o X 
o ^ 
■* t- 
X II 


ui co : 

H 

J p 

4lJ ‘ 

tl 

X * 

04 P 


H 

<J! 0i 

J 

H y : 

t. s 

t- — ; 

n 

u *o C 

ci x t 

<14 CM < 
F- 2 

+ 


: uj 
•» 01 
2 X 
■* II 
— < 

H ^ 
>- 


: o o — 
* ”0 
•• VI u w 


t. o 
x II 

u. > 

U 0)‘c 

O' o < 


X X 

II t 

CM <T 


i F- 01 
. CO 04 


I ti 
X 

II II 


. O Cil Ci 

1 F CO O' 


o — — — — 


CO Cl co co 


<X •q 1 


ui ui in ui ui ui in i/i w >o no vo o r- c— c— t-~ r- t-~ ijocococoeocnwccicococo 


Number 30 

438 


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


Page 13 




















EXAMFLE MO- 1 6 . f FrPCrEC 6 . PPPPBFF 9 .PrPPPFP 9 .feefEEC 

The following magic number was typed by the program just to 

let you know that something is happening during the long wait. l.EPPEeEC A. PECCPEC e.CCECCEC 6 . FeCCeZC 


u 

o 

n 

<u to 

C 0) 





CD 

I CO 

CO Ul I O' 

I CO CD Ul I 

k ol i O | U) W 

o Cji uj ci uj n co 

k. C- c— O -j Cv l/) 

Cu Cl —• C*- vO C~ Co 

Ul <7 in . cO <7 i/> 

O' O c\l O' • ■'I 

. CnJ | — <7 . 

CO • . I t" 

I C»1 — CO I 

I — 

UC.tiku.wO 
J UJ ul U U (J U 

C. ^ iy U U O 

O u CJ O Ij C> L 

Cil Cii Cm Cu Cl <7 

li. CJ U) CJ - V 

Cd tw • Cd • C- 

• • r~ • — . 

CO -7 NO CO 

w-s Csi lii | Co Ul Cd 

U uj uj W U 

C- O U t< li o 

C. U O L. li U 

u ul u b O N 

Cl ill Ul t» ml vO 

U id Ul Ul • t~ 


u 

J-C.t-t-C.ulC- 
w U Ul ui (j Ul 

u t Ci O U U 

Cu O C C <d t 

U Cl U u o c. 

U O C. C. C. C. 

U< Cl Ui C. • n_ 

• • • • to • 

— —• — CO VO 

to 

t C C Cl ui c 
Ul Ul Ul Ul C- Ul 
uiCCCCu 
UuCulCU 
(.UiCiutiCi 
ui u Cii U C. ui 

Nil C* Co Cal • CO 

• • . • Cm . 

— W Ul - N-i 


- w n <f iti no 


ul 

to 


Cl 

Co 

Ci 

to 


u 


o 

u 

u. 

ul 




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


Number 30 

439 








Binary Tree Manipulation 
on the 8080 


BY MIKE GABRIELSON 

Box 2692 

Stanford, Calif. 94305 


Imagine that we are writing a compiler. How should the 
symbol table be organized? One possibility is to use a binary 
tree. Figure 1 illustrates a binary tree that contains seven 
symbols (strings representing variable names). Each symbol 
is contained in a node along with two pointers. The pointers 
are used to link together the nodes of the tree. A special 
pointer called the root points to the topmost node of the tree. 
(Computer trees grow upside down.) Grounded pointers on 
the bottommost nodes have nothing to point to. 


On the 8080 and similar computers, we can let each pointer 
be a 16 bit address, and each symbol can be an ASCII string. 
Figure 2 shows a portion of our tree as it might actually be 
stored in an arbitrary region of memory. By convention, we 
will set grounded pointers to a zero value, and delimit each 
string with the NUL character. An actual symbol table for a 
compiler would include some extra bytes in each node for 
flags, values, and other information about each symbol, but 
we’ll ignore that to simplify the examples. 




Number 30 

440 


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


Page 15 


IOZ2 












The symbols in our tree are arranged in a special way: 
if we pick any node, we find that the left pointer (if not 
grounded) points to a subtree containing symbols all alpha¬ 
betically less than (preceding) the symbol in the node. Simi¬ 
larly, the right pointer points to a subtree containing symbols 
all alphabetically greater than (following) the symbol in the 
node. Maintaining the tree in this ordered manner allows us 
to design very simple but effective algorithms to manipulate 
the data in the tree. For example, suppose our compiler 
needs to look for a symbol in the tree. How should the tree 
be searched? Starting with the first node (pointed to by the 
root), we compare the node’s symbol to the symbol we desire. 
If there’s a match, we’re done. If our symbol is less than the 
node’s symbol, we follow the node’s left pointer and repeat 
the test with that node. If our symbol is greater, we pick the 
right subtree, and so on down the branches until we find a 
match or until we reach a grounded pointer, which indicates 
the symbol is nowhere in the tree. The sample subroutine 
called SEARCH will search a binary tree like ours using this 
algorithm. 

1 ; SEARCH - search symbol tree for an ASCII string 

2 ; Mike Gabrielson 8/10/78 

3 ; accepts: BC = address of string to look for, terminated by NUL 

4 ; DE - address of ROOT pointer 

5 ; HL = contents of ROOT pointer (equal to address of 

6 ; first node if not grounded) 

; returns: carry set if string not found in tree (DE ■ address 

8 ; of last grounded pointer) 

9 ; else carry cleared (string found, HL * address of 


10 



1 


node 

containing the matching string) 

12 

13 

14 

15 




NUL - 0 

,-end of string character 

0000 

7C 

SEARCH: 

MOV 

A ,H 

,-is the pointer grounded, 

16 

0001 

B5 


ORA 

L 

indicating end of tree? 

17 

0002 

37 


STC 


; (assume "yes") 

18 

0003 

C8 


RZ 


;yes, end of tree, string not found 

19 

0004 

C5 


PUSH 

B 

;no, save address of caller's string 

20 

0005 

E5 


PUSH 

H 

.-save address of node 

21 

0006 

23 


I NX 

H 

;skip past the node's 

22 

0007 

23 


I N X 

H 

,-left and right subtree pointers 

23 

0008 

23 


1 N X 

H 

,-and stop at the first character 

24 

0009 

23 


IN X 

H 

;of the node's string 

25 

0 00A 

0A 

NEXTC: 

LDAX 

B 

;get character from caller's string 

26 

000B 

BE 


CMP 

M 

.-same as character in node's string? 

27 

000C 

C21600 


JNZ 

TESTED 

;no, wrong node 

28 

0 0 0 F 

03 


I NX 

B 

;yes, 

29 

0010 

23 


I NX 

H 

.-point to next character pair 

30 

0011 

FE00 


CPI 

NUL 

;was that the end of the strings? 

31 

0013 

C20A00 


JNZ 

NEXTC 

;no, test next pair 

32 

0016 

El 

TESTED: 

POP 

H 

.-restore address of node 

33 

0017 

Cl 


POP 

B 

.-restore address of caller's string 

34 

0018 

C8 


RZ 


.-done if strings matched (carry's cleared) 

35 

0019 

DA1E00 


JC 

LEFT 

;pick left subtree if caller's string is low 

36 

001C 

23 


INX 

H 

.-else get address of right subtree pointer 

37 

0 01D 

23 


IN X 

H 

38 

001E 

56 

LEFT: 

MOV 

D, M 

.-get address of subtree into DE 

39 

0 01 F 

23 


INX 

H 


40 

0020 

5E 


MOV 

E, M 


4 1 

0021 

EB 


XCHG 


;then into HL 

42 

0022 

IB 


DC X 

D 

.-leave DE pointing to last node accessed 

43 

0023 

C30000 


JMP 

SEARCH 

.-continue searching down the tree 


How do we grow a tree in the first place? One necessary 
ingredient to grow a tree is memory. Let’s assume we have 
access to two new pointers. One pointer is called FIRST and 
is the address of the first byte of a contiguous chunk of mem¬ 
ory available for the tree. The last available byte in the chunk 
is pointed to by LAST. This arrangement is illustrated in 
Figure 3. Each time our tree needs a byte to grow.it can grab 
the byte pointed to by FIRST, and then increment FIRST. 
Memory is exhausted when FIRST passes LAST. Now we can 
modify our search so that when a symbol is not found in the 
tree, a new node is automatically grown for it. The next listing 
is a subroutine called LOOKUP which appends new symbols 
to the tree as necessary. (To simplify the code, this version 
of LOOKUP does not check if FIRST passes LAST, indicat¬ 
ing memory overflow.) An example of a call to LOOKUP is 

LXI B,STRING ;get address of string 
LXI H,ROOT ;get address of ROOT 

MOV D,M ;get contents of ROOT 

I NX H 
MOV E,M 

DCX H .-restore address of ROOT 

XCHG ,-adjust registers for LOOKUP 

CALL LOOKUP 

The calling sequence can be simplified if the contents of 
the 16-bit root and node pointers are maintained in standard 
Intel byte-reversed format, instead of unreversed as the code 
currently requires. Changing the code so that all pointers are 
byte-reversed is an easy exercise left to the reader. Figure 4 
shows how the tree has grown after a LOOKUP of the symbol 
THETA. 



Page 16 


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


Number 30 

441 












1 

2 


5 

6 

7 

8 

9 

10 
11 
12 

13 

14 

15 

16 

17 

18 

19 

20 0000 CD- 

21 0003 D0 

22 0004 2A- 

23 0007 E5 

24 0008 EB 

25 0009 72 

26 000A 23 

27 000B 73 

28 000C AF 

29 000D 12 

30 000E 13 

31 000F 12 

32 0010 13 

33 0011 12 

34 0012 13 

35 0013 12 

36 0014 13 

37 0015 0A 

38 0016 12 

39 0017 03 

40 0018 13 

41 0019 FE00 

42 00IB C21500 

43 001E EB 

44 001F 22- 

45 0022 El 

46 0023 37 

47 0024 C9 


LOOKUP - find ASCII stcing in symbol tree 
Mike Gabrielson 8/10/78 

accepts: BC » address of string to look for, terminated by NUL 
DE ■ address of ROOT pointer 

HL * contents of ROOT pointer (equals address of 
first node if not grounded) 

returns: HL * address of tree node containing the string 
carry set if a new node had to be grown 
else carry cleared (symbol already in tree) 

MEMORY OVERFLOW IS NOT TESTED FOR! 


NUL * 0 ;end of string character 

!EXTRN SEARCH ;SEARCH is not defined in this assembly 
!EXTRN FIRST ;external pointer containing address of 
;first byte of available memory for 
;growing new nodes 


LOOKUP: CALL SEARCH 
RNC 

LHLD FIRST 
PUSH H 
XCHG 

MOV M,D 
INX H 
MOV M,E 
XRA A 
STAX D 
INX D 
STAX D 
INX D 
STAX D 
INX D 
STAX D 
INX D 
SAVNAM: LDAX B 
STAX D 
INX B 
INX D 
CPI NUL 
JNZ SAVNAM 
XCHG 

SHLD FIRST 
POP H 
STC 
RET 


.•symbol already in tree? 

;yes, all done 

;no, get address of node about to sprout 
;save address of new node for return 
;HL :» address of last pointer SLAKCHed 
;replace grounded pointer with address 
jof new node 

;clear register A 

;and grqwnd the two subtree pointers in the 
;new node 


;get next character from caller's string 
;save in new node 

.•adjust pointers for next character 

;was that the end of the string? 
jno 

;get address of next available byte into HL 
;save new FIRST 

;yes, restore address of new node 
.•indicate new node was grown for caller 


A nice feature for our compiler would be the capability of 
listing the symbol table in alphabetical order. How can we list 
our tree? Because of the way the tree is ordered, one elegant 
algorithm we can use works as follows: before listing any 
node, first list the node (subtree, if any) pointed to on the left, 
then list the original node, then list the node (subtree) pointed 
to on the right. Start with the node pointed to by the root, 
but always try to first visit the left subtree at each node. 


This is a recursive algorithm that is easy to implement on 
machines with a stack like the 8080. The final sample program 
is a recursive routine called PUTREE that will dump our tree 
using this algorithm. An example of a call to PUTREE is 


LHLD ROOT 
MOV A,H 
MOV H,L 
MOV L.A 
ORA H 
CNZ PUTRE 


;get contents of ROOT 
;swap H and L 
;to be consistent with 
;rest of tree 
; is root grounded? 

;no, output tree 


A way to visualize what’s happening is to imagine an ant 
visiting each node by crawling around the edges of the tree 
(see Figure 5). If the sun is shining from the upper left, and 
the ant shouts out each symbol the first time it crawls along a 
shaded side of the symbol’s node, then the symbols will be 
shouted out in alphabetical order. 


PUTREE - output symbol tree in alphabetical order 
Mike Gabrielson 8/10/78 

accepts: HL = contents of ROOT pointer (must not be grounded) 


9 

10 


! EXTRN PUTNAM ;this is an external routine not 

jdefined in this assembly. PUTNAM 
.•outputs the ASCII string addressed 
;by HL (which must be saved) and 
.•terminated by NUL. 


11 

12 

0000 

D5 PUTREE: 

PUSH 

D 

.•save pointer to the pointer when 

reentered 

13 

0001 

E5 

PUSH 

H 

;save address of node 


14 

0002 

56 

MOV 

D, M 

;get pointer to left subtree into 

DE 

15 

0003 

23 

INX 

H 



16 

0004 

5E 

MOV 

E, M 



17 

0005 

23 

INX 

H 



18 

0006 

EB 

XCHG 


;then into HL 


19 

0007 

7C 

MOV 

A,H 

;no left subtree? 


20 

0008 

B5 

ORA 

L 

;(pointer grounded?) 


21 

0009 

C40000 

CNZ 

PUTREE 

.•subtree exists, traverse it now 


22 

000C 

EB 

XCHG 


;restore address of original node 

to HL 

23 

000D 

23 

INX 

H 

;skip right subtree pointer 


24 

000E 

23 

INX 

H 

;and get address of symbol name 


25 

000F 

CD— 

CALL 

PUTNAM 

joutput the ASCII string 


26 

0012 

2B 

DC X 

H 

;get node's right subtree pointer 

into DE 

27 

0013 

5E 

MOV 

E,M 



28 

0014 

2B 

DC X 

H 



29 

0015 

56 

MOV 

D,M 



30 

0016 

EB 

XCHG 


;then into HL 


31 

0017 

7C 

MOV 

A ,H 

;no right subtree? 


32 

0018 

B5 

ORA 

L 

;(pointer grounded?) 


33 

0019 

C40000 

CNZ 

PUTREE 

.•subtree exists, traverse it now 


34 

001C 

El 

POP 

H 

;restore stack 


35 

001D 

D1 

POP 

D 



36 

0 0 IE 

C9 

RET 






Number 30 

442 


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


Page 17 









PROGRAMMING 
LANGUAGES AND STANDARDS 

BY DAVID CHAPMAN 

Western Reserve Academy 
Hudson, Ohio 44236 


Over the last few years, the tremendous proliferation of 
microcomputers has been accompanied by a growing reliance 
on BASIC as the “standard” high-level language. Nearly every 
microprocessor has at least one BASIC available for it; the 
8080 must have at least a dozen. This is an undesirable state 
of affairs for a number of reasons, not the least of which is 
that BASIC is an atrocious language. Some people have there¬ 
fore suggested that some other language should be made stan¬ 
dard; but this is not the solution. 

Flaws in BASIC have been written about elsewhere 1 . The 
language has only three datatypes (rel, array, and string), 
only the most elementary control structures (GOTO, GOSUB- 
RETURN, and FOR-NEXT), few built-in functions, and only 
the most primitive function definition facilities; it supports 
either no files at all or only sequential files, and so on. “But,” 
you say, “surely all these deficiencies could be corrected by 
relatively minor modifications in the language?” Yes, some 
could be and have been. The result, however, is often some¬ 
thing that is not quite BASIC, which is supposedly a standard. 
This is because most of the language’s problems arise not from 
semantic difficulties (lack of random-access file capability, 
for example) but from fundamental syntactic problems: 
verbosity, verb richness, lack of structure, and a general lack 
of thinking through. BASIC was, after all, designed as an 
educational language and as an improved FORTRAN-not 
for applications programming. 

The obvious (though mistaken) thing to do is to replace 
BASIC with some other language as a standard. Of course, 
this would mean some revamping in the microcomputer 
industry. This might not be difficult, as most of the manu¬ 
facturers suffer from advanced, chronic bandwagonism: every 
time any one of them comes up with something new, it is 
immediately copied a dozen times over. 

This bandwagonism hurts everyone: the innovators have 
their ideas stolen; the bandwagonists must compete against 
many other companies making an identical product, and the 
users get little freedom of choice in buying their computers 
and accessories. Bandwagonism has also tended to establish 
standards, most of them informal, incomplete, and harmful. 
The S-100 bus, established simply by its use in the Altair, 
the first computer to be produced in what were then large 
quantities, has an excessively large number of lines, many of 
them undefined or multiply defined, and uses expensive 
hundred-pin connectors. 2 The Kansas City standard cassette 
interface, by now more or less abandoned, was slow, ineffi¬ 
cient, and error-prone. 3 Various other cassette “standards,” 
for example the CUTS system sponsored by Popular Electron¬ 
ics, have faded even further into oblivion. It is also worth 
pointing out that variations between implementations of 


BASIC generally force one to re-write programs when trans¬ 
porting them from one machine to another. In general, in a 
field developing as fast as microcomputing, standards will 
merely hinder progress. 

Besides these general considerations concerning the desir¬ 
ability of standards in the microcomputing field, there is 
the question of applicability when establishing a language as 
a standard. No language is good at everying; the so-called 
“general purpose languages” are good at nothing and merely 
mediocre at everything. BASIC has been discussed above; 
FORTRAN is very similar, only, if anything, worse. Most 
of the structured languages, while syntactically relatively 
clean, are very rigid, limiting, and poor at dealing with amor¬ 
phous data or problems. PL/I, the language that was to be 
all things to all people, is a syntactic disaster, a language so 
huge that few people know all of its arcane abilities and dis¬ 
abilities, a partial combination of ideas and constructs stolen 
from many other languages. 

This article was originally intended to extoll the virtues of 
my own favorite language, SNOBOL4. SNOBOL4, though 
designed as a string-processing language, is good at a wide 
variety of things, including, contrary to popular belief, nu¬ 
meric processing. However, I would not recommend it for all 
purposes to all people; it is poor at dealing with file I/O, 
for example, and has even less control structure than BASIC. 
There is no easy way to correct these deficiencies, as they are 
due to the basic syntactic structure of the language. 

Several people have suggested designing a new language as 
a standard for microcomputing. 4 This has all of the arguments 
above against it as well as some others. There are already 
literally thousands of languages available, and there is no 
call to write a new one unless one has some radically new 
idea or application. Moreover, most of the well-known lan¬ 
guages already have textbooks available for them, a group of 
people who are familiar with the language, and often a rigid 
standard. All of these things would have to be built up from 
scratch if a new language were made standard. At least one 
of these attempts is doomed to failure because the author is 
attempting to include “all of’ PL/I, FORTRAN, BASIC, 
ALGOL, SNOBOL, COBOL, and bits of RPG and APL. 5 
Assuming that this is possible in under a megabyte (many big- 
computer PL/Is run to hundreds of kilobytes), it would be 
a syntactic catastrophe. Sure, maybe such a language could 
do everything PL/I, FORTRAN, et al. can, but then so can 
machine language. Using all that power would be difficult, 
to say the least. The enormous power and elegance of such 
languages as APL and SNOBOL4 is due to their syntax, which 
could not possibly be made compatible with PL/I, for 
example. (cont’d on page 21) 


Page 18 


Dr. Dobb's Journal of Computer Calisthenics 8< Orthodontia, Box E, Menlo Park, CA 94025 


Number 30 

443 



SAM 76 Language Update 
No.3-July 1978 

BY ANCELME ROICHEL 


II This new version Is upward compatible 
I version 11 with previous versions and Is the result 
I <0023> 11 of user requests for means to facilitate 

J_LI access to major pointers. In addition 

linking of user programs to the processor 
Is simplified; provisions are made for up to four overlay 
zones defined by the user. These enhancements were made 
without, however, Increasing the size of the processor. The 
new functions are defined below: 


- |9cn,current,new| Change function Name 


I This function has now been enhanced 
I so that execution of Jews/ without 
I arguments serves to reduce the work 
I space to a suitable minimum. 


The neutral form of this function may be |1 Tl 

used to "re-speclfy" size of Inter record || *ot" 
gaps and length of leader and trailer; II Output Text 11 
the two forms of this function are: I I I I 

Jot,nl,n2,...,nN/= which serves to "output texts" whose 
names are symbolized by "nl", "n2", "nH"; the overall output 
is bounded by 64 bytes of leader, aDd Individual texts are 
separated by 16 bytes of gap. 

&ot,leader,gap,nl,n2,...,nX/= first resets the 

specifications for leader and gaps to the new desired 
decimal values symbolized by "leader" and "gap", and then 
outputs the texts In the normal manner. 


I 

I 

I 



it r 

"cws" 

11 Change Work Space! 

U_L 


This function allows user to rename any of the resident 
function "current" names to any desired "new* name; these 
new names must consist of two or three alphabetic 
characters; In changing names the user should be 
particularly careful In his command sequence. At this time 
"os" and "Is" should not be changed. 

• IqloI Query current 10 assignments 

The value of thi3 function Is In the current "X" base the 
value of "IQBTTE" as defined by the monitor * if such a 
facility Is provided. 

- |slo,lobyte| Set 10 assignment 

This null valued function Is used to reassign the monitor 
"IOBTTS" If provided for. It should be noted that a "cold" 
start entry into the processor carries with It the current 
monitor assignment; If this function Is used then a "control 
C" or "ex" exit causes restoration back to the original 
assignment. A "warn" reentry, or a "hot* continue causes 
reassignment to the setting In force at the time of exit. 

- |xll,90| Xamlne Label List 

The value of this function Is a list of internal system 
labels available for examination by name; these labels nay 
be actual values, identify locations of program entry points 
or tables, or give addresses of memory locations in which 
system pointers may be found. Each label name is preceded by 
the string symbolized by "s0". (Label names and their 
purpose will be described later). 

- |xal,label,offsetl Xamlne Address of Label 

The value of this function Is the value of the "label" to 
which the value of the "offset" is added. Both the value 
returned and the "offset" are In the current "X" base. 

- Inud,function,arguments! lull Display mode 

The "nul" function serves to modify the scanner to the end 
that instead of a value being returned by the function whose 
name Is symbolized by "function" (with Its appropriate 
arguments), output of what would have been the value is sent 
to the currently assigned "console" device. 


The exit function In version <0023* has 11 

been enhanced to automatically reduce the 11 "ex" 11 

work space to a suitable minimum prior to IlExit functlonll 

returning to the operating system. (J_ Ll 

Reentry automatically restores the work 
space to its maximum allowable size. Hext enhancement will 
be to Implement the passing of a file name and other 
Information back to the operating system. 


The accompanying figure shows a typical arrangement of the 
user work space, as well as associated pointers and their 
names. This work space nay be located either below or above 
the main system program, can be saved after having performed 
the "ex" exit function, and this saved file can be reloaded 
In another system with its workspace in a different area of 
the machine; a "hot" reentry permits the process terminated 
by the "ex" function to resume with the next and other 
subsequent unevaluated expressions. 


Typical system labels as determined by || 

the "xll" Xamlne Label List function are |I System Ii 

given below with their characterization. jj Labels 

IJ_LI 

"AST” ; Address System subroutine Table 

"ASV* ; Address System subroutine Vectors 

"EHC" ; Entry Continue "hot start" 

"EUR" ; Entry Restart Level “warm start" 

"ESL" ; Entry Subroutine Links 

"OPV" ; Offset Permanent - Variable tables 

"PQA" ; Pointer overlay A - "extra* 

"POB* ; Pointer overlay B - "disk" 

"POC" ; Pointer overlay C - "plot" 

"POD" ; Pointer overlay D - "user" 

"PSE" ; Pointer service entry 

"PSK" ; Pointer function *SW" 

"PST" ; Pointer function "ST" 

"PUL" ; Pointer user link table 

"PWA" ; Pointer Work Area start 

"TAE" ; Text area end 

"TAH" ; Text area high 

"TAL" ; Text area low 

"TAX" ; Text area max 

Details of the mechanism of linking the overlay areas to the 
system function table, and details of user application of 
system subroutines will be described In a later write up. 

Tl The Inquisitive person may begin to 
Exercise for 11 Investigate the system subroutine 
the adventurous j| system by finding the code for the 

_Li "ir", "xrp", "xw", and "xwp" 

functions. The entry point for 
functions can be found using the "xqf" function. The 
function ends with either a "Jump" or "return" instruction. 
In the body of the code are some subroutine calls; the 
addresses called are also found In two other places: 
somewhere beyond the start of the table located at "AST" 
(said table locates some fifty of the system subroutines) 
and also somewhere - the same Index distance (but modulo 
three) In the table created at address starting at "ASV". 

The first table Is used if an instruction in one of the two 
following forms is encountered in a user program: 


Number 30 

444 


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


Page 19 







RST 6 CALL ESI 

index number index number 

Alternatively a "call* to the proper location in the table 
of Jump rectors which starts at "AS?" will achieve the same 
task. 

In like manner other subroutines may be identified through 
exploration of other functions. 


The user may make use of the "sw" and |II 
"sy" functions by storing at locations j "sw" and "sy" | 
determined by %xal,PSW,offset/ and | linking | 

3txal, PST, offset/, respectively, the |J_ I 

memory addresses which execution of these 
functions should reach. If the offset Is 0, then the 
temporary table address Is given. If the offset is that 
value returned by executing %xal,0PV/, then the permanent 
table address Is given. The "xrp" and "xwp" functions may be 
properly used to read and write In these locations. 

The value of this function is the contents, in the current 
"X" base, of the identified sector. Each "byte" is preceded 
with the string symbolized by s0. 

- Ixws,unit,track,sector,X| X Write Sector 

This null valued function places the string symbolized by X 
In the designated sector. If that string is greater than one 
sector then only as much as will fit will be transferred. 


Tl The "bf" bring file, and "uf" update 
special I| file functions operate as expected 

II feature of II when used with the active function 

11 bf and uf II marker - namely: %bf.filename/, and 

IJ_LI fcif,filename/. If the neutral form is 

used then any file may be brought In 
regardless of its type (provided there is room) and may be 
put back on disk. Care must be used in doing this since 
strange flies will not have the necessary pointers to be 
compatible with the SAM76 processor. This Is a very 
effective means for moving flies from disk to disk - 
particularly on one disk drive systems. 

For example: 

fcbf.xdlr.com/: 

How change diskettes 

fcuf,xdir.com/: 

(nav-uf-aef} 

Ho-hum an already existing file message - well no natter 
%ef,xdlr.com/fcuf.xdlr.com/: 


Whenever a non fatal anomaly occurs ||II 
during the execution of file ij Anomaly 
functions, a value is returned by |j Indications |i 
these normally null valued functions, i I I i 

These values are in the form: 

{nav-function-anomaly} 

In the above indication, the function being executed is 
symbolized by "function", and the anomaly type may be one or 
more of the following: 

"dsk" disk 

"nrm" no room 

"err" error 

"fnf* file not found 

"dir" directory 

"clo" close 

"ext" extension 

"aef* already existing file 

"rud" reading unwritten data 



This overlay is nominally IE and provides at this time the 
following functions: 


prim 

Id Ho 

Description 

BF 

220; 

Bring File 

EF 

224; 

Erase File 

FB 

226; 

File Branch 

LF 

216; 

List Files 

QFA 

QFA; 

Query File Attributes 

QFE 

QFE; 

Query File Extension 

BF 

243; 

Read File 

SDU 

SDU; 

Select Directory Unit 

SFE 

SFE; 

Select File Extension 

UF 

218; 

Update File 

WF 

244; 

Write File 

XRS 

XBS; 

X Read Sector 

xws 

XWS; 

X Write Sector 


Those functions which in the preceding table have a numeric 
"Id Ho" have been described previously in Doctor Dobbs as 
well as in the SAM76 language manual; the other functions 
are still in the experimental evaluation phase and are 
described below. 

- |qfa,filename,s0| Query File Attributes 

The value of this function is a list of file characteristics 
derived from the disk operating system directory; each 
attribute is preceded by the string symbolized by "s0". One 
of the attributes is the file size expressed as a decimal 
number of 256 byte pages. 

- |qfe| Query File Extension 

The value of this function is the current setting of the 
file extension; note that there is a difference between 
■blanks" or "spaces" and "null" or zero. 

- |sdu,d| Select Directory Unit 

This null valued function allows the user to designate the 
Directory unit to be accessed by the various file functions; 
a Directory unit is any device which has a directory 
structure and could be cassette as well as disk. 

- |sfe,extension I Select File Extension 

This null valued function is used to preset a desired file 
extension so that the extension need not be used in any of 
the file functions. In effect this may be used as a 
classification means. The extension nay be set to any 
desired three (or less) symbols, including spaces and ???, 
or to the null string (viz: %sfe/) with varying effects. 

- |xrs,unit,track,sector,s0| X Head Sector 

This new enhanced version Is available on I 

paper tape or TDL cassette as follows for lAvailablllty II 

a postpaid price of $8.00 - ($2.00 credit J _LI 

will be given to original purchaser of 
earlier version returned with order); POLT-88 version for 
8080 only on cassette $8.00; CPM version on standard 
diskette $15.00. 

Addresses In table below are all In HEX. 


Type 

AST 

TAR 

TAM 

START 

EHD 

Z80 High 

0100 

0400 

7FFF 

8000 

SFFF 

8060 High 

0100 

0400 

7FFF 

8000 

ASF 

Z80 Low 

0100 

3400 

FFFF 

1000 

2FFF 

8080 Low 

0100 

3400 

FFFF 

1000 

3SF 

8060 Poly-88 

4800 

5000 

FFFF 

2000 

4SF 


Page 20 


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


Number 30 

445 






Motes: TAR : START - OPT; all Tersion with AST at 0100 are 
CPM compatible; Z80 Terslont make use of RST0 thru RST6 
while processor Is running and restores RST0 on exit; 
TAM=FITF Is theoretical aaxlaua reduced by else of operating 
systea used; CPM diskette contains low terslons; the disk 
oserlay Is at C00, and other overlays are at 400 and 800; It 
Is possible In the CPM systea to run prograas which are 
saaller than 21 without affecting the SAM76 processor. 

Text book describing the language in siaple terns is 

available for a price of $12 - postpaid. (Specify bound or 

loose leaf). Systea loader booklet appropriate to object 

code foraat Is $2. 

I The source prograa for the disk 
I functions as lnplenented In the CP^f 
I version will be published In Dr. Dobbs 
I Journal, ' however copies nay be 

purchased for the iapleaentatlon of 
the nonent - no guarantee that It will Batch the object code 
furnished - but to serve as a model for Iapleaentatlon in 
other disk systeas; price is $10.00 postpaid; available as 
xerox printed copy or In aachlne readable fora on standard 
diskette or paper tape ITDL macro foraat]. 

SAM76 Inc., Box 257, R.R.l, Pennington, H.J., 06534 


iiSource for CP/to j 
11 Disk functions | 



(cont’d from page 18) 

Recently, PASCAL has been hailed as the “next” standard 
language. 6 Besides the arguments above against standardiza¬ 
tion, I am not very impressed with PASCAL as a language. 
Some syntactic kluges have been pointed out already, 7 but the 
main problem with PASCAL is that it is one of the class 
known as “structured” languages; a misnomer, as SNOBOL4, 
for example, has a much neater, more elegant, and simpler 
syntax. That PASCAL is structured means essentially that 
the programmer is limited with respect to the control structure 
that he can use. This makes the source code easier to under¬ 
stand and debug, but it restricts the programmer and may 
discourage creativity. The controversy over structured versus 
nonstructured languages that raged in Communications of 
the ACM and similar publications for several years seems now 
to be over, structured programming techniques having emerged 
victorious; but this does not mean that you, or I, or anyone 
else has to agree. 

Rather than making PASCAL or some other single lan¬ 
guage a standard, what is needed is a total lack of standards, 
allowing the programmer to choose which language to use 
for a given application based on the problem’s nature and his 
personal preference. Each microcomputer manufacturer 
could write one or several languages that had not yet been 
implemented for their processor. Transportability between 
machines could be provided by device-independent I/O: 
the user, or, better, the maker of the user’s mainframe, would 
write a set of I/O subroutines for the user’s hardware configu¬ 
ration and I/O devices that would be called by the language 
interpreters and compilers, these being written with calls to 
user-provided routines only. Repeatability of code would 
be very helpful. Alternatively, the writer of the language might 
spend the small amount of extra work needed to modify the 
basic program for use with a variety of common systems. 
Some software is already being offered this way. 

Some obvious first choices for languages to implement 
on microcomputers are PASCAL, ALGOL, LISP or one of 
its many variants, SNOBOL4, RPG II, GRASS, SKETCHPAD, 
APL, MUMPS, C (anyone for MULTICS on a micro?), GPSS, 
SIMSCRIPT, and a TRAC*-like language. 

A lack of a high-level programming language standard 
would not only give the user the benefit of a wide variety of 
languages to choose among, it would also be to the advantage 
of the computer makers: there is certainly more money in 
being the first to introduce a SNOBOL4 than in being the 
hundred and first to produce a BASIC. 

References 

1. See, for example, Marc LeBrun, "Tilting at Windmills, Or, What's 
Wrong with BASIC," People's Computer Company vol. 2 no. 1 
(December 1972) p. 5. 

2. John McCallum, "The Altair (S-100) Bus Forum: PCC 77," BYTE 
vol. 3 no. 3 (March 1978) pp. 148-151. 

3. Robert Suding, "Why Wait? Build a FAST Cassette Interface," 
BYTE vol. 1 no. 11 (July 1976) p. 46. 

4. Glen A. Taylor, "Language Development: A Proposal," BYTE 
vo.2 no. 11 (November 1977) pp. 190-191. 

5. Peter Skye, "The 8080 High Level Language Project of Peter Skye, 
Continued," BYTE vol. 2 no. 5 (May 1977) pp. 68-70. 

6. Carl Helmers, "Is PASCAL the Next BASIC?" BYTE vol. 2 no. 12 
(December 1977) pp. 6-8 and 184-185. 

7. Leigh Janes, "Reactions to Previous Comments," BYTE vol. 3 
no. 2 (February 1978) p. 159. 

♦Trademark of Rockford Research, Inc. 


Number 30 

446 


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


Page 21 





The Heath H-8 System 

BY TOM WILLIAMS 

Editor 


The Heathkit H-8 computer system has been on the market 
for over a year now and since introducing the basic system, 
Heath has been gradually adding accessories to its product line. 
Somewhat more controversy than is usual for the introduction 
of “another 8080-based system” surrounded the coming of the 
H-8. Now that most of the dust has settled, however, and 
Heath has followed up with the introduction of a floppy 
diskette system, it seems a good time for a calmer look at the 
H-8 and its present and future peripherals. 

Since the microcomputer market is so vast and varied, any 
evaluation must, in addition to a critique of hardware and soft¬ 
ware, take into account the portion of the market a manufac¬ 
turer appears to be aiming at and the apparent suitability of 
that product. Since this is the sort of exercise that makes or 
breaks executive careers, I will not suppose that my judgments 
are the “last word” on the subject. 

The H-8 is an unconventional looking 8080 system and 
gives evidence of having been designed from the “ground up” 
without prejudice by previous designs. The two most striking 
features are the front panel display and keypad, the arrange¬ 
ment of the mother board with its Benton Harbor Bus ... and 
the lack of a cooling fan. 

The front panel display allows the user to examine (and 
alter by means of the front panel keypad) the contents of 
memory locations, and registers and to address I/O ports. The 
display is in split octal which is unfortunate since the majority 
of published microcomputer software is in hexadecimal. This 
is not so bad as long as one is working within octal, but 
refering to other material published in hex and then converting 
can be annoying. 

The mother board, which is mounted in the right side of 
the cabinet instead of on the bottom as in many S-100 sys¬ 
tems, incorporates Heath’s own bus design, the Benton Harbor 
Bus. The introduction of this new bus design has been one of 
the more controversial aspects of the H-8. It is a 50 pin bus 
with all but seven pins permanently defined. And Heath has 
designated those pins it reserves the right to change in future 
products. Heath claims cost and engineering considerations as 
the main factors influencing the introduction of the new bus 
structure as well as the fact that the S—100 bus was created 
before the development of a system controller. One of the 
main considerations, according to Heath, was to insure that 
signals which could possibly interfere with each other were not 
on adjacent bus lines. A detailed discussion of Heath’s new bus 
by Tom Yeager, chief computer engineer for Heath, can be 
found in the August 1977 issue of Interface Age. 

Interference and impedance considerations also play a role 
in the discussion of an extender board. Heath recommends 


working on boards in a bus slot by moving the board in 
question to the rear of the cabinet and removing enough other 
boards to make room. This is not the most convenient 
arrangement and definitely awkward in the case of the CPU 
board which is connected to the front panel display board by a 
short three-wire harness. You certainly can’t get a logic probe 
down between them and this leaves the scary alternative of 
probing about on the foil side keeping track of all the pins in 
reverse order. Nonetheless, Heath has discouraged use of an 
extender card for servicing because of the possibility of its 
changing the transmission characteristics of the bus. The one 
attempt by an independent manufacturer to make an extender 
card was an awkward affair and the instructions told the user 
to steady the board with one hand while working on it. 



H8 System with H9 Video Terminal 


All this aside, if we grant the fact that the Benton Harbor 
Bus is on balance an engineering and cost advance over the 
S-100 design (or lack of it), we must still recognize that there 
are powerful factors which would tend to deter a manufac¬ 
turer from introducing an improved design. The most obvious 
of these is that there are no accessories being manufactured for 
that bus at the time it is first put on the market. No company 
can come out with everything at once. I have heard from 
Heath that they are planning many more goodies, but the fact 
is that at the moment you just can’t get a modem or video 
graphics board for the H-8. In fact, the only serious indepen¬ 
dently produced product for the Heath bus to date is the God- 
bout 12K RAM board. The lack of such accessories can act as 
a deterrent to the potential customer, and the fact that Heath 
nonetheless decided to market a new bus design speaks for 
their confidence in their product. 

One of the most striking features of the mainframe, and 
one which attracted the immediate attention of the computer 


Page 22 


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


Number 30 

447 





music people here at People’s Computer Company, is the ab¬ 
sence of a cooling fan. Considerable design effort seems to 
have gone into producing a machine which could run without 
an AC motor in the immediate vicinity. The cabinet is vented 
on top and bottom and the voltage regulator ICs on the 
various boards are mounted on aluminum heat sink brackets 
at the end of each board. These brackets would be inadequate 
heat sinks in themselves, but they bolt to the bottom of the 
chassis and to a tie bracket at the top which in turn is attached 
to the metal cabinet. They thus provide for cooling by means 
of a combination of convection and conduction to the mass of 
the unit. This bracket on the unit operating with three 8K 
RAM boards, disk controller and serial I/O board was rather 
warm to the touch but still seemed equal to the task. 

The mother board which is mounted in the right side of the 
cabinet, comes with connectors for seven boards in addition to 
the CPU and front panel with the rearmost connector reserved 
for external expansion. The power supply consists of a +8 
Volt, 10 Amp supply (regulated to +5VDC on each board) and 
a ±12 volt supply at 500 mA to provide the +12 and -5 Volts 
required for the CPU — enough for ten boards averaging 750 
to 800 mA each. 


OOOOOOA 

to 

003377A 


004000A 

to 

023377A 


024000A 

to 

027377A 


030000A 

to 

037000A 


040000A 

to 

041147A 


041150A 

to 

042177A 


042200A 

to 

SYSFWA-1 


SYSFWA 

to 

LAST RAM 
ADDRESS 


PAM-8 ROM 
(1 K) 


UNUSED 
(4 K) 


HDOS RAM WORK AREA 
(1 K) 


HDOS ROM 
(2 K) 


SYSTEM RAM AREA 
(359 bytes) 


USER STACK AREA 
(279 bytes) 


USER PROGRAM AREA 


RESIDENT HDOS SYSTEM 
(approximately 2 K) 


Memory Map Courtesy Heath Co. 



Heath kit H8 Digital Computer Mainframe 


Ideas for expansion have been incorporated into the 
original design. In addition to the rearmost mother board con¬ 
nector, memory addresses have been reserved for various 
expansion devices. The front panel ROM monitor occupies the 
first IK of memory space. An additional 7K are reserved. The 
disk controller ROM and RAM, for instance, are mapped into 
this reserved area with plenty of room left over for other 
things. The fact that the monitor and this much reserved 
memory space are located at the bottom of memory means 
that a great deal of 8080 software, which requires RAM 
starting at the very bottom of memory cannot be used with 
the H-8 system. There are, of course, ways to get around this 
and it is possible to disable the front panel ROM. 

Heath is currently marketing two memory boards — a 4K 
(expandable to 8K) and a 16K board — and two I/O boards. 
The I/O options currently consist of the serial/cassette I/O 
board with one serial port and cassette interface, and the 
three port parallel board. Heath has just begun selling a four 
port serial card now available in assembled form for $250. 
These I/O cards all have one interesting component in com¬ 
mon: the 8251 USART. 

All Heath software uses the same console driver and in the 
serial board, the 8251 is used to take the parallel data from the 
data buffer (or put it on as the case may be) and convert it to 
serial data. On the parallel card, the serial output of the 
USART is run into a UART and converted back into parallel 
data. This technique allows the use of the same console driver 
since in either case the CPU is “looking” at the 8251. 

The Terminal 

The H-9 terminal, while a good value for the price of $550, 
is the weakest part of the system. It provides a 12 inch CRT 
displaying 12 lines of 80 characters — upper case only. The dis¬ 
play is crisp and solid, but users may find the 12 line limit 
somewhat inconvenient. A very useful feature, however, is the 
short form display mode. This switch-selectable option 
displays information as four 20 character columns, each 12 


Number 30 

448 


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


Page 23 





lines long, and is excellent for displaying long lists of numer¬ 
ical or similar data. In the short form mode, the display scrolls 
off to the left when the screen is full. 

A third display mode, the plot mode, will display a dash at 
a proportional distance above the plot information code (an 
ASCII character) which is repeated four times on four 
lines (?). This is a rather bizarre way of presenting the infor¬ 
mation and I have yet to find a practical use for the plot 
feature. It may have its advantages, but it remains aesthetically 
displeasing. 

The H-9 has a serial port (RS232), which is usually con¬ 
nected to the H-8, and also a parallel port. The parallel port 
might be a way of circumventing the need for a parallel 
I/O card in some cases or as a printer port. I have used it as a 
means of inputting lower case characters from a separate key¬ 
board after converting the H-9 to display lower case (DDJ 
Vol. 3 No. 28, p. 30). 

The keyboard of the H-9 is adequate but a trifle inconveni¬ 
ent. The keys are all the same size and color and the RETURN 
key is located right next to the SCROLL and LINE FEED 
keys. This has caused some aggravation with illegal character 
error messages and the like. 

Software 

Heath supplies a full set of software on cassette with the 
H-8 mainframe. This includes a console debugger (BUG-8), a 
text editor (TED-8), an assembler (HASL-8), and Benton 
Harbor BASIC. There is also a cassette-based extended version 
of BASIC available for $20 which includes string functions and 
file capabilities. 

Benton Harbor BASIC is a good value for the price, but it 
does not have some of the added features of some other 
versions on the market. The extended version occupies about 
9.2K and incorporates some rather novel features while omit¬ 
ting some of the editing and renumbering capabilities found in 
other BASICs. 

BH BASIC represents numbers internally in 6 digit floating 
point. I did notice that raising a number to a power (even an 
integer) does not give a precise result because BASIC executes 
this command by multiplying the natural logarithm and then 
raising e to that power. Thus: (XtY) = EXP(Y*LOG(X)). 
Some of the unique features include using a Control B to exe¬ 
cute a designated GOSUB from the keyboard while a program 
is running. Other control functions give access to the front 
panel display (for monitoring a register or memory location) 
and control of the real time clock. 

Some of the extended BASIC formats are: 

Internal line format: 

2 bytes: line numbers 

1 byte: carriage return (new line) 

1 byte each for command and following space 
1 byte each for character in the line which is not covered 
by the above, except that spaces, line number and start 
of text are ignored. 

Number = 6 bytes 

Array = 6 bytes + 2*(no. of dimensions) + 

4*(no. of elements) 

String = 6 bytes + (2 bytes + no. of characters) 

String Array = 6 bytes + 2*(no. of dimensions) + 

4*(no. of elements) + [2*(no. of ele¬ 
ments) + no. of characters]. 


New Products 

Heath people are reluctant to discuss new products until 
they are almost realities. Their reasoning is entirely commend¬ 
able, given the sorry history of the industry on this point 
in the past, but it does run athwart my function as a jour¬ 
nalist. Therefore, I shall report those things Heath has ad¬ 
mitted to definitely having on the way and then the wild, 
unsubstantiated rumors. The real things include two soft¬ 
ware products: a diskette version of Microsoft BASIC and a 
disk version of UCSD Pascal, both to be available in March 
of 1979. Also, a dot matrix impact printer was shown at the 
Philadelphia show in August and should be available in late 
December or January. Projected price, $895 assembled, 
$595 in kit form. There are rumors that Lifeboat Associates 
of New York was interested in adapting CP/M to run on the 
H-8, and Tony Gold of Lifeboat Associates told me they were 
interested in just that, but had not yet gotten the necessary 
technical information from Heath. The author of SAM 76 
(see DDJ No. 21, Jan, 1978) reports a similar problem. 

HDOS/Diskette System 

The Heath H-17 diskette system is based around the 
Wangco model 82 drive unit. Heath sells a cabinet which will 
accomodate two drive units and there appears to be no 
provision for expansion to additional drives. We have seen the 
wired version and the kit is due to be available in the near 
future. The kit assembly should be fairly simple, consisting of 
little more than assembling the controller board, power sup¬ 
ply and cabinet. 

The drive uses a stepper motor and worm gear to position 
the head. The disk is hard sectored and organized into 40 
tracks, 10 sectors each for a total of 102.4K bytes of storage. 
Heath appears to be quite proud of the access time of its disk 
drives, but is careful to caution the user not to confuse track 
seek time with random sector access — the true time it takes 
to get to the data. Both drive units I used performed reliably 
at a track to track seek time of 8 msec. This means an average 
track seek time of 104 msec. Add to this a rotational latency 
of 100 msec, (the average time it take a sector on a given track 
to come under the head) and we have a random sector access 
time of 2 04 msec. The HDOS and controller make use of the 
motor on feature of the model 82 drive to extend motor life. 
If no commands are sent to the drive for a certain length of 
time, the spindle motor shuts off. When required, the spin¬ 
dle motor turns on and takes one second to come up to speed 
before accessing can take place. 



Page 24 


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


Number 30 

449 




HDOS appears to be a rather sophisticated diskette oper¬ 
ating system and can best be described as consisting of 2 major 
portions of interest to the user: the system diagnostic and 
optimization portions and the general operation portions. 
These distinctions are my own. The main diagnostic programs 
in HDOS are contained in TEST 17 which starts out by check¬ 
ing the drive’s rotational speed and displaying it on the H-8’s 
front panel LEDs. If the rotational speed does not fall within 
the parameters required, the user can make a small adjustment 
with a trimpot on the drive’s circuit board. 

The next test is a general read/write test on each sector to 
test the head and seek mechanism. This is an exhaustive test 
making three complete passes and requiring fully 40 minutes 
to complete. Any problems are displayed as either “hard” 
or “soft” errors and the user is referred to the media check 
or to the troubleshooting section of the manual. A media 
check then performs a test on a diskette to determine if there 
are any bad sectors. The results tell how many bad sectors 
were located and lists the individual sectors. During the initial¬ 
ization procedure for that diskette, the user can enter the bad 
sectors and HDOS will ignore them while using the remaining 
good ones. 

The final test checks the track to track seek time of the 
individual drive units. HDOS makes its first attempt at 18 
msec. It then displays the highest speed at which the unit 
will seek reliably. This information can then be used during 
system optimization to set the seek time for the drive. 

The SYSGEN portion of HDOS allows the user to copy the 
minimal operating system onto another diskette to use as a 
system volume so that the original can be safely stored away. 
To this minimal system can be added whichever other pro¬ 
grams from the distribution diskette the user wishes. Thus, 
several system volumes with various portions of the distribu¬ 
tion software can be created, such as a diskette with BASIC, 
one with the editor and assembler, and so on. The minimal 
system contains among other things, SYSGEN itself, PIP, the 
peripheral interchange program that allows copying a file from 
one drive or peripheral device to another, and SET for opti¬ 
mizing the system. With this latter program the user can set 
the track seek time to the optimum determined in the diag¬ 
nostic sequence, set the console or alternate terminal to 
backspace and set the proper number of stop bits. STATUS 
displays disk statistics including the number of reads and 
writes and, more importantly, the number of hard and soft 
errors encountered. An error that occurs 10 times in succes¬ 
sion is classified as a hard error. 

The distribution diskette sells for $100 and contains disk 
versions of all the software supplied with the H-8: BUG-8, 
HASL-8, TED-8 and BASIC. In addition, there are a number 
of programs specifically oriented toward the operation of 
the disk system. These include: 

BASCON This allows the user to read a BASIC program into a 
buffer in memory and convert that program as a file onto 
the diskette which will run under the HDOS BASIC. 
TXTCON Like BASCON, this allows the user to convert 
cassette text files created under TED-8 into text files on 
the disk. 

ONECOPY This is a program for copying files in a system 
with only one drive unit. ONECOPY is one of the more 
fun utility programs in that it reads a portion of the file 
from the source disk into a buffer in RAM. The size of this 
buffer is dependent on the amount of memory in the 


H-8. It then displays the word “destination” on the console 
as well as the characters DES on the front panel LEDs. 
The user then switches diskettes, hits RETURN and that 
portion of the file is written onto the new diskette. The 
system then displays the word “SOURCE” on the terminal 
and Sou on the front panel, instructing the user to switch 
back to the source diskette for another portion of the 
file to be copied. This process continues until the entire 
file is copied. 

Documentation and Service 

If there is any one area where Heath outshines all comers, 
it is in documentation and customer service. Heath’s assembly 
manuals are of a uniform quality—as they are in all Heath 
products-containing illustrated, detailed, step by step instruc¬ 
tions with interim checks and voltage/resistance tests. But the 
documentation goes far beyond this. 

The operation manuals contain full schematics, timing dia¬ 
grams, options for configuring I/O, and detailed trouble¬ 
shooting flowcharts. The one criticism is that the schematics 
contain only Heath part numbers which must be referenced 
to the manuals to find out what the actual IC number is. It 
seems that this is an inconvenience it would have been so easy 
to avoid. Also included in the operation manuals for the H-8 
and H-9 are circuit descriptions and general theory of opera¬ 
tion sections with timing diagrams and drawings which allow 
the interested user to study the details of his system to the 
depth of his interest. 

The software reference manual contains a detailed des¬ 
cription of all the software, with many examples of the unique 
features. These are not courses in programming, nor are they 
meant to be, but user reference material. Also included are 
listings of several BASIC utility routines, including the console 
driver, as well as listings of the front panel monitor and disk 
controller ROMS. 

Customer service is available through the factory or through 
any one of 50 Heath Electronic Centers around the country. 
Each has factory-trained people specializing in different 
Heath product lines. For those who do not live near a Heath- 
kit store, the company maintains a telephone number in 
Benton Harbor, Michigan with technical advisers on hand to 
answer desperate questions from the hinterlands. I have 
checked out this number several times and can report some 
very positive experiences. 

In early January, while I was constructing the H-8 itself, 
the line would often be busy. If it was, the woman who an¬ 
swered when I finally got through asked how many times I 
had tried and found the line busy. By Spring they seemed to 
have gotten their traffic problems ironed out and there is little 
trouble getting ahold of a technician. The man at the other 
end has a system in front of him and his answers to my some¬ 
times manufactured (and occasionally genuine) questions 
were always quick and clear. What you get is either a direct 
answer or a list of steps for isolating the problem such as 
swapping or substituting various ICs. To customers who have 
long since resigned themselves to futile letters and the general 
eral runaround, this kind of treatment is nothing less than 
heavenly and puts real substance behind the Heath motto, 
“We won’t let you fail.” 


Number 30 

450 


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


Page 25 



BASEX: A Fast, Compact Interactive 
Compiler for Microcomputers 


BY PAUL K. WARME 

423 Kemmerer Road 
State College, PA 16801 

BASEX is a new intermediate-level language for microcom¬ 
puters that combines some of the best features of both BASIC 
and Executable machine language code. It is almost as easy to 
use as BASIC and yet, it is nearly as fast and versatile as assem¬ 
bler language. The BASEX compiler is interactive ; that is, it 
permits you to enter, list, edit and run your program without 
the help of any auxiliary programs, such as editors or linkage 
editors. In this respect, BASEX is more like BASIC than FOR¬ 
TRAN, PASCAL and other compilers. Most BASEX com¬ 
mands resemble their counterparts in BASIC language, and this 
facilitates learning the language and translating programs from 
BASIC into BASEX. 

The main advantages of BASEX are its speed (typically 7 to 
20 times faster than BASIC) and the compact size of BASEX 
programs (typically at least 6K bytes smaller than similar pro¬ 
grams written in BASIC). This difference in size is due to the 
fact that the BASEX compiler does not have to be resident 
during execution and the run-time subroutines occupy only 
2K bytes of memory. However, since the BASEX compiler and 
run-time routines together use only 8K of memory, it is gener¬ 
ally more convenient to leave the compiler in memory while 
debugging your BASEX programs. A microcomputer with 16K 
bytes of memory is adequate to make full use of the power of 
BASEX. Since the BASEX compiler is able to decompile its 
own object code very rapidly, you only need to save one copy 
of the program (the object code). This is a distinct advantage 
over FORTRAN and other compilers, which save separate 
source, object and executable versions of the same program. 

The Origins of BASEX 

About a year ago, I was having a lot of fun with my IMSAI 
8080 microcomputer until I tried some BASIC programs to 
draw pictures on my video terminal and play electronic music. 
Unfortunately, BASIC was too slow to permit smooth motion 
of video images and accurate timing of musical notes. After 
buying a chess program written in BASIC, I found that it took 
about ten minutes to make a move. The Bulls and Cows game 
(similar to Mastermind) in 101 Basic Games often took 10 to 
30 minutes to make a move, much to my consternation. In 
short, I discovered that there is a rather large class of problems 
that demand greater execution speed than BASIC can deliver. 
Unfortunately, many of the things that I wanted to do, such as 
interactive graphics, electronic music and word processing, fall 
in this category. 

At the time, it seemed that programming in assembler lan¬ 
guage was the logical alternative to BASIC, although I dreaded 
the thought of writing large programs (>8K) in assembler lan¬ 
guage. When I started translating one of these large programs 
into assembler language, it was quite discouraging. I had to re¬ 


invent the wheel at every turn, writing routines to input and 
output numbers and text, multiply, divide, etc. Then I noticed 
that certain operations were done repeatedly in different parts 
of the program and could be called as subroutines, thus avoid¬ 
ing repetitious coding. After thinking about this, it occurred 
to me that most of these same subroutines would be needed in 
just about any large assembler language program. 

From this point, it was easy to conclude that assembler lan¬ 
guage programming would be much easier and faster if all of 
these useful subroutines could be made available in any pro¬ 
gram. A method was needed to pass arguments to the subrou¬ 
tines; the most straightforward way of doing this would be to 
insert the addresses of the arguments immediately after the 
subroutine call. This approach requires that a region of mem¬ 
ory be set aside for a symbol table ; that is, a table containing 
the names of variables and their present values. 

Pulling on the Bootstraps 

The next step was to write a set of subroutines that would 
be generally useful in almost any program and then write a 
compiler in BASIC that would translate three-letter mnemonic 
names of each subroutine into a CALL to the corresponding 
subroutine. The compiler also had to copy each new variable 
name included in the user program into the symbol table and 
leave a two-byte space for the value associated with that 
name. Once the compiler was working in BASIC, I used it to 
translate the compiler into BASEX (in other words, a series of 
CALL’S to BASEX subroutines). If this sounds circular, well, 
it is. 

I now had a compiler written in BASEX which worked 
about 20 times faster than the compiler written in BASIC. The 
speed advantage of BASEX was already paying off! In order to 
put some finishing touches on the BASEX compiler, the origi¬ 
nal version was copied to a different part of memory and the 
original compiler was used to modify the relocated copy. In¬ 
cidentally, writing a compiler in a new language is a good test 
of its versatility and power. In fact, I decided to add a few 
more subroutines to the run-time package during the process 
of translating the compiler into BASEX. 

An Overview of BASEX Program Commands 

Table I summarizes the commands available to BASEX 
users. Notice that all of the command mnemonics are three let¬ 
ters long and the data types include 16-bit signed constants 
and variables (-32,767 to 32, 767), one-dimensioned arrays of 
up to 255 values, string variables of up to 255 characters and 
string constants of any length. One unusual feature of BASEX 
array names is that the “(” is treated as part of the name, 
much like the “$” at the end of a string name. Thus, the clos¬ 
ing parenthesis, ), is not needed after the element. For exam¬ 
ple, DATA( 1 means the first element of the array called 
DATA(. Variable names may contain any number of charac- 


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


Number 30 

451 




ters (or numbers), which makes BASEX programs more de¬ 
scriptive than BASIC programs. Since variable names are saved 
only once (in the symbol table), the memory cost of using 
longer, more meaningful names is slight. 

Pseudo - Operations: 

The BASEX pseudo-operations are used only by the com¬ 
piler; they are skipped over during execution of the program. 
The REM command is for comments, which are set off by ex¬ 
clamation marks. The DIM command tells the compiler how 
much space to save in the symbol table for arrays and strings. 

The *** command marks an entry point in the program which 
can be addressed by the GTO, JMP and CAL commands. This 
feature of using names instead of numbers for entry points 
adds to the readability of BASEX programs. The END com¬ 
mand indicates the end of a procedure or program. 

Arithmetic and Logical Commands: 

All of the arithmetic and logical commands place their re¬ 
sult in the accumulator, which is referred to by the letter A 
(this is the only reserved variable name). The accumulator, A, 
is a 16-bit variable that can be used just as any other BASEX 
variable. The sign of the most recent arithmetic or logical op¬ 
eration is retained for conditional branching via the JMP com¬ 
mand. The arithmetic commands allow addition (ADD), sub¬ 
traction (SBT), multiplication (MLT) or division (DIV) of 
16-bit signed constants or variables. Commands are also avail¬ 
able to determine the ABSolute value (ABS), INCrement a 
value by one (INC) or DECrement by one (DEC). The logical 
commands (AND, NOT, IOR, XOR) operate simultaneously 
on all bits of a 16-bit constant or variable. 

Load and Store Commands: 

BASEX provides several ways to load and store values in 
memory. The SET command is equivalent to the LET com¬ 
mand in BASIC. The DEF (DEFine) command allows multiple 
SETs to be combined in one command. However, it is more 
convenient to use the DAT command to assign values to suc¬ 
cessive elements of an array. The BRD (Byte ReaD) command 
works like the 8-bit PEEK or EXAM functions in BASIC, 
while the WRD command gives the BASEX user the added 
capability of reading 16-bit words anywhere in memory. The 
complementary functions of storing bytes or words in memory 
are performed by the BRT (Byte wRiTe) and WRT commands. 
These commands are analogous to the POKE or FILL com¬ 
mands in BASIC, but it is easier to store multiple bytes or 
words using BASEX, since multiple values can be stored with 
a single command. 

String Commands: 

Basex needs only one very powerful string command, STR, 
to duplicate the ASC, CHR$, LEFTS, MIDS and RIGHTS 
string functions used in some versions of BASIC. Characters 
can be transferred back and forth between strings and variables 
(or arrays). Substrings are specified in terms of their first and 
last character positions in a given string. The CMP command 
CoMPares the alphabetic order of two strings and allows con¬ 
ditional branching via the JMP command, based on the out¬ 
come of the comparison. Other useful string commands are the 
LEN command to determine the LENgth of a string or sub¬ 
string and the VAL command, which returns the numeric val¬ 
ue of a string in the accumulator, A. 


Program Control Commands: 

One of the most useful program control commands is the 
JMP command, which branches to a labelled (***) entry point 
if a particular condition has resulted from the most recent 
arithmetic, logical or compare command. The conditions that 
can be tested for are EQual (EQ) to zero, Not Equal (NE), 
Less Than (LT), Greater Than (GT), Less than or Equal (LE) 
and Greater than or Equal (GE) to zero. The GTO command 
can be used for unconditional branching. Structured program¬ 
ming buffs may choose not to use the GTO command, but 
after all, if you know where you’re going, the GTO is the 
quickest way to get there. However, structured programming 
techniques can be used with BASEX. 

Instead of the FOR. . .NEXT loop structure of BASIC, 
BASEX uses the FOR and TIL commands. The FOR com¬ 
mand sets the initial value of the loop variable, while the TIL 
command adds or subtracts any value from the loop variable 
and then checks to see whether the terminating value has been 
exceeded. If not, the program branches to the statement 
following the corresponding FOR command. FOR.. .TIL 
loops can be nested to any depth and there are no restrictions 
on jumping into or out of loops. 

BASEX has a much better facility for calling subroutines 
than BASIC. For starters, subroutines are called by name, 
rather than by statement number, so the subroutine name can 


BASEX PROGRAM COMMANDS 

X,-Y and Z are variables or constants; A( is an array; S$ is a string 
"TEXT" is a string constant; variable names can be any length. 

>> Pseudo-Operations << 

REM !BASEXi (comments) DIM A( 10 S$ 80 (Dimension arrays & strings) 
*** START (Program labels) END (End of program) 

>> Arithmetic Commands << (Results are in the Accumulator) 

ADD X+Y (add) SBT X-Y (subtract) MLT X*Y (multiply) DIV X/Y (divide) 
ABS X (absolute value) INC X (increment) DEC X (decrement) 

>> Logical Commands << (Results are in the Accumulator) 

AND X&Y (logical AND) NOT X (complement) 

IOR X#Y (Inclusive OR) XOR X%Y (Exclusive OR) 

>> Load and Store Commands << 

SET X=Y or SET A( 1=X or DEF X*Y A( 1=X ... (equate variables) 

DAT A( X=Y Z ... (initialize an array) 

BRD X (read byte at X) BRT X=Y Z ... (write bytes from X onward) 

WRD X (read word at X) WRT X=Y Z ... (write words from X onward) 

>> String Commands << 

STR X=S$ Y or STR A( X=S$ Y (string to variable transfer) 

STR S$ X X*Y or STR S$ X X=A( Y (variable to string transfer) 

STR S$ X Y=S$ Z or STR S$ X Y = "TEXT" (string to string transfer) 

CMP S$ X Y-S$ Z or CMP S$ X Y-"TEXT" (compare strings) 

LEN S$ X (length of string) VAL S$ X (numeric value of string) 

>> Program Control Commands << 

JMP CC X (jump to X on condition CC = Eg, NE, LT, GT, LE, or GE) 

FOR X=Y.TIL X+Y>Z (loop) GTO Y (unconditional branch) 

CAL X Y Z ... (ca.ll subroutine X) GET Y (pass Y to subroutine) 

PUT Z (return Z to caller) RET (return from subroutine) 

>> Input/Output Commands << 

INP X A( Y S$ Z ... (input) CHR X (print character) 

PRT X A( Y S$ Z "TEXT"... (print) TAB Y (tab to column Y) 

XIN X (read input port) WAT x Y (wait for condition Y on port X) 
XOT X (write output port) DSI/ENI (disable/enable interrupts) 

>> Memory Search and Move Commands << 

BSR X Y Z (search from X to Y for byte Z) 

WSR X Y Z (search from X to Y for word Z) 

MOV X Y Z (move memory from X through Y to Z) 

BASEX COMPILER COMMANDS 

LSI' or LSM (list all or part of the program or symbol table) 

DMP or NTR (dump or enter one or more memory values) 

INS or DLT (insert or delete one or more program statements) 

SIZ (print program size) LOC (set program pointer) 

RUN (run the program) MON (exit to monitor) 


reflect its purpose. The first argument after a CAL command 
is the entry point name, defined elsewhere in your program by 
a *** command. The optional second and subsequent argu¬ 
ments specify variables to be passed to or returned from the 


Number 30 

452 


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


Page 27 




subroutine. Within the subroutine, you can use the GET com¬ 
mand to receive a value from the calling program or use the 
PUT command to return a value. Since the variables named in 
the GET and PUT commands may be different from the names 
used in the CAL command, you can reserve “local” variable 
names for use in subroutines. However, any subroutines that 
are compiled at the same time and share the same symbol table 
may access any variable without using the GET and PUT com¬ 
mands. This allows “global” variables to be shared by subrou¬ 
tines. The RET command is used to RETum from a subrou¬ 
tine. 

Input/Ouput Commands: 

The I/O commands in BASEX make it easy to communi¬ 
cate with terminals and instruments of all types. To customize 
BASEX for your terminal, you simply fill in the address of 
your routines to input and output one character, as described 
in the manual. The INP command INPuts one line of charac¬ 
ters or numbers, ending with a carriage return, and stores them 
in the variables listed after the INP. The PRT command 
PRinTs a list of variables or constants, separated by spaces. 
The PRN command does the same, but omits the space be¬ 
tween items. You may space over to a particular column by 
using the TAB command or print a single CHaRacter with the 
CHR command. 

If you wish to communicate directly with I/O ports, you 
can INput from port X with the XIN command or OuTput 
to port X with the XOT command. In both cases, the byte to 
be communicated is placed in the accumulator, A. The WAT 
command WAiTs until the input port specified by its first ar¬ 
gument gives a non-zero value when ANDed with its second 
argument. You can also ENable or DiSable Interrupts with the 
ENI and DSI commands. 

Memory Search and Move Commands: 

Since the block memory search and move commands are 
extremely fast, they are indispensible for writing compilers, 
editors and other programs where speed is important. The 
BSR command SeaRches for a particular Byte (8 bits) within 
a specified region of memory, while the WSR command 
SeaRches for Words (16 bits). If the specified byte or word is 
found, its address is placed in the accumulator, A, and the con¬ 
dition flags are set to the Less Than (LT) condition so that 
a JMP command can test whether the search was successful. If 
the requested byte or word is not found, the Greater Than 
(GT) condition is flagged. The MOV command MOVes a group 
of bytes from one region of memory to another. It gives cor¬ 
rect results even when the new region of memory overlaps the 
old region. 

Using the BASEX Compiler 

The interactive BASEX compiler makes it easy to write and 
debug programs. Each time BASEX is restarted, it prints 
“RANGE?” and expects you to enter four numbers to desig¬ 
nate the first and last addresses of your program and the first 
and last addresses of its symbol table. Let’s call these addresses 
PRG1, PRG2, SYM1 and SYM2, respectively. BASEX works 
with decimal numbers, since most people think most readily 
in base 10. If your BASEX program is already loaded in mem¬ 
ory and you have previously declared its memory space, you 
can type a 0 after the “RANGE?” prompt, and then a carriage 
return (here denoted <CR>). In this case, BASEX will print 


the current values of PRG1, PRG2, SYM1 and SYM2, just as a 
reminder. 

If you want to write a new BASEX program, you should re¬ 
spond to the “RANGE?” prompt by typing the starting ad¬ 
dress of the program (PRG1), a space, and then type the same 
value for PRG2, followed by a space. The space is the pre¬ 
ferred separator between numeric arguments, although any 
non-numeric character will do. Now, you should type the ad¬ 
dress of the last byte in memory that you want to set aside for 
the new program, a space, and then type the same number 
once more, followed by <CR>. This sets SYM1 and SYM2 to 
the top of memory because the symbol table builds downward 
from the top of memory. The BASEX compiler will now erase 
any program that previously existed between PRG2 and 
SYM1. 

Whether you are starting a new program or revising an old 
one, the value of PRG2 is next printed, followed by a question 
mark. The “?” always signals that a BASEX program (the 
compiler, in this case) is waiting for user input. You can now 
type any three-letter BASEX command mnemonic, a list of 
arguments and then <CR>. The BASEX compiler checks to 
see whether your command line begins with a compiler com¬ 
mand (discussed below) and if so, performs the requested ac¬ 
tion and then retypes the value of PRG2 and “?” once more. 

If your command line contains a program command, the 
appropriate CALL to a BASEX run-time subroutine is inserted 
in your program, followed by the symbol table addresses of 
any arguments specified in the command line. If any new vari¬ 
able names occur in the argument list, they are copied into the 
symbol table. Next, the compiler updates PRG2 to the address 
of the next available program location, prints it and waits for 
another command line after the “?” prompt. Notice how the 
automatic line number feature of BASEX facilitiates program 
entry. 

BASEX Compiler Commands 

The BASEX compiler commands allow the user to list and 
modify programs. The SIZ command prints the values of 
PRG1, PRG2, SYM1 and SYM2 in the following format: 

PROGRAM ##### ##### SYMBOLS ##### 
##### 

The LOC command allows you to set PRG2 to any position in 
your program, so that the next program command will be 
inserted there. If you want to LiST your entire program, you 
can type LST; if you type one number after LST, the single 
command at that location will be listed or, if you type two 
numbers after the LST command, all program commands be¬ 
tween those limits will be listed. The LSM command is used to 
LiSt the entire SyMbol table and one or two arguments may 
follow the LSM to list selected parts of the symbol table. As 
each variable name is listed, its location in the symbol table 
and the current value of that variable are also printed. One use¬ 
ful debugging technique is to insert an END command at some 
point in your program and then, when your program halts, list 
all or part of the symbol table to determine the current values 
of your variables. You can now alter the values of certain vari¬ 
ables, list the program or modify the program. In most cases, 
you can still resume your program after the END command 
without harmful side-effects. 

The INS and DLT compiler commands are used to INSert 
or DeLeTe program lines. Both require two arguments, which 
specify the first and last memory locations to be inserted or 


Page 28 


Dr. Dobb's Journal of Computer Calisthenics 8i Orthodontia, Box E, Menlo Park, CA 94025 


Number 30 

453 



deleted. These locations can be determined from the program 
listing. The INS command moves the last part of the program 
to a higher place in memory, prints the range of the relocated 
program segment, sets PRG2 to the first location to be insert¬ 
ed, prints PRG2 and then waits after the “?” prompt for one 
or more new program commands to be entered. When you fin¬ 
ish entering new commands, you should use the DLT com¬ 
mand to delete the unused locations up to the reloaded pro¬ 
gram segment. In cases where the altered program will be the 
same size or shorter than the original one, you can use the 
LOC command (instead of the INS command) to set PRG2 to 
any location in your program, enter the changes, and then 
delete any unwanted commands with the DLT command. 

The DMP command is available (or printing the decimal 
values stored between any two memory addresses that you 
specify. A carriage return and line feed are printed automat¬ 
ically whenever the address is evenly divisible by ten; The NTR 
command can be used to eNTeR one or more decimal values 
into sequential memory bytes, starting at the memory address 
specified by its first argument. When you want to RUN your 
program, you merely type the RUN command, followed by 
the desired starting address. Since your program has already 
been compiled as you entered it, there is no delay before your 
program begins. The address given after RUN can point to the 
first byte of any command in your program or any other pro¬ 
gram. You can restart BASEX at any time by typing RUN 0 
or just RUN. After your BASEX program finishes, it will jump 
to location 0 and restart BASEX. 

The MON command allows you to exit conveniently to 
your system monitor. In view of the great diversity of mass 
storage devices now available, BASEX contains no mass stor¬ 
age handlers. However, you can use your system monitor to 
save and load BASEX programs or you can even use BASEX to 
write a tape handler, as will be shown by one of the examples 
coming up. 

BASEX Error Messages 

In order to maintain fast program execution and small pro¬ 
gram size, BASEX is somewhat weak on error checking. Never¬ 
theless, it is a rare thing for a BASEX program to run wild, be¬ 
cause after each BASEX command is completed, a check is 
made to be sure that the next byte in the program is a CALL 
instruction. Any other instruction will cause the program to 
halt, and error dump will be printer! and then the BASEX 
compiler will be restarted. Other run-time errors (of 18 differ¬ 
ent types) will also halt and print and error dump, consisting 
of the values of all the registers, the program location where 
the error was detected, the error type number and the top 
three words on the stack. In addition, when the BASEX com¬ 
piler detects any of nine different types of program errors, it 
prints a two letter error code and ignores that command line. 

Relocating LOADER for BASEX Programs 

It is frequently desireable to be able to move a BASEX pro¬ 
gram to a position different from that at which it was com¬ 
piled. A special program called the LOADER (written in 
BASEX) is provided for this purpose. Although the standard 
version of the LOADER overlays the BASEX compiler, it can 
be used to relocate the compiler or the LOADER itself. The 
LOADER commands include MOV, to MOVe a program or its 
symbol table to a new location, PRG to modify the PRoGram 


and SYM to modify the SYMbol table to take into account its 
new location in memory. The DMP, NTR, RUN and MON 
commands described above are also available in the LOADER. 

The FIX command is the most powerful LOADER com¬ 
mand; it moves the program to a new location, removes all 
pseudo-operations (REM, DIM, and *** labels) and moves the 
symbol table to directly follow the program. As each variable 
name is moved, its new location is printed and the name is ab¬ 
breviated to its last letter to conserve space. Comments are 
also omitted to make the program smaller. After the FIX op¬ 
eration, the program can no longer be listed or changed by the 
BASEX compiler, nor can it be relocated by the LOADER. 
This provides a measure of protection for proprietary soft¬ 
ware. 

EXAMPLE: Memory Test Program 

Let’s write a simple BASEX program to write every possible 
8-bit byte in every memory location within a selected region 
of memory and then read it back to verify its correctness. Of 
course, any errors should be reported by giving the erroneous 
value, its location and the correct value. In order to compare 
BASEX with BASIC, we’ll do it first in Altair BASIC, version 
3.2. 

10 REM MEMORY TEST IN BASIC 

100 INPOT "FIRST AND LAST BYTESFIRST,LAST 

110 FOR 1=0 TO 255 

120 FOR J=FIRST TO LAST 

130 POKE J,I 

140 IF PEEK(J)=1 GOTO 160 

150 PRINT "BYTE",J,"WAS",PEEK(J), 

";SHOULD BE",I 
160 NEXT J 
170 NEXT I 
180 PRINT "DONE" 

OK 

RUN 

FIRST AND LAST BYTES? 16501,16600 
DONE 

OK 

In BASIC, this program took 250 seconds to test 100 
memory bytes (25,600 write, read and compare operations). 
Now, let’s translate this program into BASEX and observe how 
similar the two programs are. 

*GO BASEX 

RANGE ? 11000 11000 11500 11500 
11000 ? REM 1MEMORY TEST IN BASEX! 

11006 ? PRT "FIRST AND LAST BYTES" 

11012 ? INP FIRST LAST 
11020 ? FOR 1=0 
11028 ? FOR J=FIRST 
11036 ? BRT J=I 
11044 ? BRD J 
11050 ? SBT A-I 
11058 ? JMP EQ OK 
11066 ? BRD J 

11072 ? PRT "BYTE" J "WAS" A ";SHOULD BE" I 

11088 ? CHR 13 

11094 ? *** OK 

11100 ? TIL J+1>LAST 

11112 ? TIL 1+1>255 

11124 ? PRT "DONE" 

11130 ? CHR 13 


Number 30 

454 


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


Page 29 



11136 ? SIZ 

PROGRAM 11000 11136 SYMBOLS 11387 11500 


11136 

? LSM 



11387 

DONE" 11387 



11395 

;SHOULD BE" 11395 


11409 

WAS" 11409 



11416 

BYTE" 11416 



11424 

OK 11100 



11429 

J 0 



11433 

I 0 



11437 

LAST 0 



11444 

FIRST 0 



11452 

FIRST AND LAST 

BYTES" 

11452 

11476 

MEMORY TEST IN 

BASEX! 

11476 

11136 

? RUN 11000 



FIRST 

AND LAST BYTES 

? 16501 16600 

DONE 




RANGE 

? 0 




PROGRAM 11000 11136 SYMBOLS 11387 11500 

The execution time in BASEX is 29 seconds for 100 bytes. 
This is 8.6 times faster than BASIC, even though this version 
of BASIC is the fastest one tested by Tom Rugg and Phil 
Feldman in their article, “Basic Timing Comparisons ... Infor¬ 
mation for Speed Freaks,” published in Kilobaud (June, 1977, 
p. 66). When I coded their longest program, Benchmark Pro¬ 
gram 7, in BASEX, it ran in 7.1 seconds, whereas Altair 
BASIC took 51.8 seconds and other versions of BASIC took 
up to 235.6 seconds. Apple’s 6K integer BASIC took 28.0 
seconds; this may be a better comparison with BASEX, since 
neither of these use floating point arithmetic. However, like all 
benchmark programs, there is a certain amount of variation in 
performance, depending on the nature of the program. In all 
of the cases that I have tested, BASEX runs 7 to 20 times 
faster than Altair BASIC, Version 3.2. 

EXAMPLE: Intel Format Tape Routines with Check¬ 
sum 

The following program reads, writes and verifies tape files 
in Intel format. It is fast enough to work with my National 
Multiplex CC-7 data recorder running at 2400 baud (try that 
with BASIC!). It will also work with paper tape or other fla¬ 
vors of cassette tape. The use of descriptive names for entry 
points and subroutines makes the program fairly easy to un¬ 
derstand. 

In Intel format, the first byte of a record is a colon and all 
subsequent bytes are in ASCII hexadecimal form. Bytes 2 and 
3 are the record length, bytes 4 through 7 are the load address 
and bytes 8 and 9 are the record type (0 here). Next comes the 
data, two ASCII digits per byte, and then the checksum, which 
is the negated 8-bit sum of all the digits since the colon. At 
the end of each record, there is a carriage return and line feed. 

The verify operation is the same as the read operation, ex¬ 
cept that the values read from the tape are just compared to 
the contents of memory. Subroutine INCHAR reads one 
ASCII digit and OUTCHAR writes one digit on the tape. Both 
of these routines must be customized for the user’s I/O ports. 
Subroutines READCHK and WRTCHK read and write mem¬ 
ory bytes as two hex digits and update the checksum, while 
READHEX and WRTHEX do the same thing without contrib¬ 
uting to the checksum. Subroutine HEX converts ASCII hex¬ 
adecimal digits to binary, whereas HEXOUT does the reverse 
conversion and goes on to output the result. 


The program and symbol table occupy 1,712 bytes and 
they can be compressed to only 1,097 bytes by means of the 
FIX command in the LOADER program. 

PROGRAM 12288 13406 SYMBOLS 13453 14000 
13406 ? LST 

12288 REM 1INTEL FORMAT TAPE ROUTINES! 

12294 DIM ANSWER? 6 

12302 DEF TAPE 2 STATUS 3 

12314 *** BEGIN 

12320 CHR 13 

12326 PRT "READ/WRITE/VERIFY/STOP" 

12332 INP ANSWER? 1 
12340 CMP ANSWER? 1 1 "R" 

12352 JMP EQ READ 
12360 CMP ANSWER? 1 1 "W" 

12372 JMP EQ WRITE 
12380 CMP ANSWER? 1 1 " V" 

12392 JMP EQ VERIFY 

12400 GTO 0 

12406 *** VERIFY 

12412 SET VRFLAG=1 

12420 GTO READ1 

12426 *** READ 

12432 SET VRFLAG=0 

12440 REM !READ NEXT BLOCK! 

12446 *** READl 

12452 SET CHKSUM=0 

12460 CAL INCHAR 

12466 SBT A-58 

12474 JMP NE READl 

12482 CAL READCHK 

12488 SBT C-0 

12496 JMP EQ BEGIN 

12504 SET NBYTES=C 

12512 CAL READCHK 

12518 MLT C*256 

12526 SET ADDRESS=A 

12534 CAL READCHK 

12540 ADD C+ADDRESS 

12548 SET ADDRESS=A 

12556 CAL READCHK 

12562 FOR BYTE=1 

12570 CAL READCHK 

12576 SBT VRFLAG-0 

12584 JMP EQ READ2 

12592 BRD ADDRESS 

12598 SBT C-A 

12606 JMP EQ READ3 

12614 PRT "V" "ERROR AT" ADDRESS 

12624 GTO BEGIN 

12630 *** READ2 

12636 BRT ADDRESS=C 

12644 *** READ3 

12650 INC ADDRESS 

12656 TIL BYTE+1 NBYTES 

12668 CAL READHEX 

12674 ADD A+CHKSUM 

12682 AND A&255 

12690 JMP EQ READl 

12698 PRT "R" "ERROR AT" ADDRESS 

12708 GTO BEGIN 

12714 REM !READ WITH CHECKSUM! 

12720 *** READCHK 
12726 CAL READHEX 
12732 SET C=A 
12740 ADD C+CHKSUM 
12748 SET CHKSUM=A 


Page 30 


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


Number 30 

455 



12756 RET 

12760 REM !R£AD 2 HEX DIGITS! 

12766 *** READHEX 
12772 CAL INCHAR 
12778 CAL HEX 
12784 MLT A*16 
12792 SET C=A 
12800 CAL INCHAR 
12806 CAL HEX 
12812 ADD A+C 
12820 RET 

12824 REM ICONVERT ASCII TO HEX! 

12830 *** HEX 
12836 SQT A-58 
12844 JMP LT HEX1 
12852 SBT A-7 
12860 *** HEXl 
12866 ADD A+10 
12874 RET 
12878 *** INCHAR 
12884 WAT STATUS 2 
12892 XIN TAPE 
12898 AND A&127 
12906 RET 

12910 REM !WRITE TAPE! 

12916 *** WRITE 
12922 PRT "WRITE RANGE" 

12928 INP FIRST LAST 
12936 SET A=0 
12944 FOR BYTE=1 
12952 CAL OUTCHAR 
12958 TIL BYTE+1 10 
12970 REM !WRITE NEXT BLOCK! 

12976 *** WRITEl 
12982 SET NBYTES=16 
12990 SBT LAST-FIRST 
12998 JMP GE WRITE2 
13006 REM !TERMINATOR! 

13012 SET A=58 
13020 CAL OUTCHAR 
13026 SET A=4 8 
13034 CAL OUTCHAR 
13040 CAL OUTCHAR 
13046 GTO BEGIN 
13052 *** WRITE2 
13058 SBT A-l5 
13066 JMP GE WRITE3 
13074 ADD A+l6 
13082 SET NBYTES=A 
13090 *** WRITE3 
13096 SET CHKSUM=0 
13104 SET A=13 
13112 CAL OUTCHAR 
13118 SET A=10 
13126 CAL OUTCHAR 
13132 SET A=58 
13140 CAL OUTCHAR 
13146 CAL WRTCHK MBYTES 
13154 DIV FIRST/256 
13162 CAL WRTCHK A 
13170 CAL WRTCHK FIRST 
13178 CAL WRTCHK 0 

J. JIB b FUR BY'i'E = i 
13194 3RD FIRST 
13200 CAL WRTCHK A 
13208 INC FIRST 
13214 TIL BYTE+1 NBYTES 
13226 SBT 0-CHKSUM 
13234 AND A&255 

Number 30 Dr. Dobb's Journal of Computer Calisthenics 

456 


13242 SET C=A 

13250 CAL WRTHEX 

13256 GTO WRITEl 

13262 REM 1WRITE WITH CHECKSUM! 

13268 *** WRTCHK 

13274 GET C 

13280 ADD C+CHKSUM 

13288 SET CHKSUM=A 

13296 REM !WRITE 2 HEX DIGITS! 

13302 *;** WRTHEX 
13308 DIV C/16 
13316 CAL HEXOUT 
13322 SET A=C 
13330 *** HEXOUT 
13336 AND A&15 
13344 SBT A-l0 
13352 JMP LT ASCII 
13360 ADD A+7 
13368 *** ASCII 
13374 ADD A+58 
13382 *** OUTCHAR 
13388 WAT STATUS 1 
13396 XOT TAPE 
13402 RET 

13406 END 13406 ? LSM 

13453 ASCII 13374 

13461 HEXOUT 13336 

13470 WRITE 2 HEX DIGITS! 13470 

13492 WRITE WITH CHECKSUM! 13492 

13515 WRTHEX 13308 

13524 WRTCHK 13274 

13533 WRITE3 13096 

13542 TERMINATOR! 13542 

13556 WRITE2 13058 

13565 WRITEl 12982 

13574 WRITE NEXT BLOCK! 13574 

13594 OUTCHAR 13388 

13604 LAST 16100 

13611 FIRST 16101 

13619 WRITE RANGE" 13619 

13634 WRITE TAPE! 13634 

13648 HEXl 12866 

13655 CONVERT ASCII TO HEX! 13655 
13679 HEX 12836 

13685 READ 2 HEX DIGITS! 13685 

13706 READ WITH CHECKSUM! 13706 

13728 READHEX 12772 

13738 ERROR AT" 13738 

13750 READ3 12650 

13758 READ2 12636 

13766 BYTE 6 

13773 ADDRESS 16101 

13783 256 256 

13789 NBYTES 5 

13798 C 0 

13802 READCHK 12726 
13812 INCHAR 12884 
13821 CHKSUM 0 

13830 READ NEXT BLOCK! 13830 

13849 READ1 12452 

13857 VRFLAG 1 

13866 VERIFY 12412 

13875 V" 13875 

13880 WRITE 12922 

13888 W" 13888 

13893 READ 12432 

13900 R" 13900 

13905 READ/WRITE/VERIFY/STOP" 13905 
13931 BEGIN 12320 (cont’d on page 39) 

Orthodontia, Box E, Menlo Park, CA 94025 Page 31 



TINY .. FOR TINY BASIC 


BY JOEL SWANK 

4655 SW 142nd No. 186 
Beaverton, OR 97005 

Tiny GRAFIX is a system for graphic display on small 
micro computer systems. It is composed of a SWTPC GT-6144 
TV graphics board, Tom Pittman’s Tiny BASIC, and some 
machine language subroutines. It runs on a KIM-1 with 4k 
of memory. 

The GT-6144 divides the TV screen into 6144 rectangles 
in a configuration of 64 horizontally (X) and 96 vertically 
(Y). It has its own 6144 bit memory used to maintain the 
display. This memory is altered by data from the computer. 
The data consists of X coordinates, Y coordinates and control 
codes. Data is received via one eight-bit output port with data 
ready strobe. The GT-6144 has no facility to send data to 
the CPU. The GT-6144 is connected to KIM by the B port of 
a 6820 PIA. 

Communication with the GT-6144 is handled by a set of 
machine langauge subroutines located at $200. They are de¬ 
signed to be used with the USR function of Tiny BASIC. The 
following functions are provided: BLANK — Initialize the PIA 
and the GT-6144 and clear the screen; ON — Turn on spot 
at coordinates X,Y; OFF — Turn off spot at X,Y; FILL — 
Turn on all spots on the screen; REVERSE — Reverse the 
screen; CNTL — Send 1 byte of data to the GT-6144. 

The USR function passes data from Tiny BASIC’s 16-bit 
signed integer variables to these subroutines. The calling 
syntax is shown in the comments of the assembly listing. 
Only the low order byte of each parameter is used by the 
subroutines. Subroutines ON and OFF do minimal checking of 
the data for validity. With the CNTL subroutine a BASIC 
program can send any value (0-255) to the GT-6144. 

Tiny Graffer is a simple BASIC program that will graph an 
equation of the form Y = f(X), where f(X) is any valid Tiny 
BASIC operation. This equation is entered between fines 
8000 and 8200. One value of Y is computed for each value of 
X. Tiny Graffer requires 4 input parameters to scale the graph 



on the screen. They are start value for X, increment for X, 
low of Y range, and high of Y range. A good value for the 
equation Y = X*X is -64,2,-100,4000. This results in picture 
1. There is also the facility to do negative graphs (black 
line on white background). This is done by changing line 
1020 to P=579. Usually in 3 or 4 attempts input values can 
be found that will produce a centered graph. 

Tiny Pattern Generator takes advantage of the wraparound 
nature of Tiny BASIC’s 16-bit signed integer variables to do 
computer art. An equation of the form U = f(X, Y) is used to 
control the pattern. The program computes U for every other 
spot, and then based on present criteria either turns it on or 
off. The variables H and L define the range for turning on 
spots. A good range for most functions is L=500 and H=3000. 
Very small numbers also turn on spots. H & L should be set 
before the program is run. Every other spot is used instead of 
every spot to speed up generation (Tiny BASIC is pretty slow), 
and to provide a more pleasing display. Many interesting pat¬ 
terns can be developed with this routine. Pictures on this page 
and the next are examples. 

One problem with the GT-6144 is hard copy. About the 
only way to get hard copy is to take a picture. To take a 
picture the shutter of the camera must stay open for at least 
1 raster scan of the TV (1/60 second). Instead of shelling out 
for a camera with variable shutter speed it is possible to use 
a Kodak instamatic camera (the cheapest one). The shutter 
speed of this camera is not directly adjustable and the normal 
speed is less than 1/60 second, but when a flash stick is inserted 
the shutter speed slows to allow for less fight. So I cut the 
plug-in out of a used flash stick and plugged it into the camera. 
This slowed the shutter speed enough to allow the camera to 
capture a full raster scan. 

Because of its speed, Tiny BASIC can only do static gra¬ 
phics. These two programs only scratch the surface of what 
can be done with static graphics. With a few fine or figure 
drawing subroutines (in BASIC) and some imagination, sophis¬ 
ticated graphic displays can be produced by Tiny BASIC. 



Page 32 


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


Number 30 

457 





0200 8F 02 re 
e203 2e 09 02 


0206 8C 02 re 


020f. er 03 ce 

020E FA 
020F FA 
0210 FA 
0211 A9 39 

0213 er 03 re 
0216 60 


re 80 

A2 00 

8F 03 ce 
A 9 F F 

8C 02 ce 

A9 3C 
8C 03 ce 
20 00 02 
re 

C 0 F 0 

dp Fe 

A0 80 
E 8 

Fe 40 
C0 F 1 
A2 F 1 
86 F0 
Ae F4 
20 00 02 
60 


CSP : HRAFIC bUFROUTINE PACKAGE 

TINY TASIC INTERFACE VEHSION 

FUNCTION : 

TO PROVIDE AN INTERFACE FOR THE SWTPC 
6144 TV CRAPHlCb POAHD. THE PC ARD IS 

connected via the n port of a 6820 pia 

LOCATED AT MEMORY LOCATIONS 0802 
(CATA REGISTER) AND 0803 (CONTROL 
REGISTER). IT ALSO USES CONTROL HIT 
2 FOR CATA OUT PULSE. 


TINY FASIC CALLS 

TLNK : INIT PIA AND CLEAR SCREEN 
P-USR(539) 

cn : turn on spot x,y 

P-UbR(577,Y,X) 

OFF : TURN OFF SPCT X,Y 
P-USR(579,Y,X) 

FILL : TURN ON ENTIRE SCREEN 
P.USH(609) 

RVRb ; REVERSE THE SCREEN 
P-USR(596) 

CNTL : SEND X TO 6144 
P-USR(518,X) 

CRC $0200 

ZERO PAGE STCRACE 

REVR * $ 0 0F 0 


EXTERNAL LABELS 

0ATB * $0802 
CTLF * $ce03 
CETK * $ IF6A 


TVCUT ; SUBROUTINE TC SEND DATA FROM 
X & Y REGISTERS. 


TVCT 

STX 

T ATB 

SEND X 


JSR 

TOGO 

PULSE 

SENC 

1 BYTE 



CNTL 

STY 

DATE 

SEND Y 


TOGGLE s SEND PULSE ON CONTROL FIT 2 
TCCG LDAIM $34 

STA ctlb CONTROL LINE LOW 

NOP 

NOP OELAY SOME 

NOP 

LDAIM $ 3C 

STA CTLB CONThOL LINE HI 

RTS 


FLANK : CLEAR ENTIRE SCREEN 

CLNK LCYIM $80 INITIALIZE PCRT TO OUTPUT 

LDXIM $00 
ST X CTLB 
LDAIM $FF 
STA CATE 
LDAIM $3C 
STA CTLB 

WRIT JSR TVCT CLEAR A BYTE 

INY NEXT Y 

CPYIM $ F 0 END CF LINE? 

BNE WRIT NO 

LDYIM $80 HE-INIT 

INX NEXT X 

CPXIM $40 END CF LINE? 

TNE WRIT NO 

LDXIM $E1 NORMAL SCHEEN 

STXZ REVR SAVE STATUS 

LDYIM $F4 ENABLE CHAPHICS 

JSR TVCT SEND 

RTS 


TURN CN SPCT 


093 0: 0241 09 40 CN CRAIM $4e CN ‘’IT 

0940: TURN CFF SPCT 

0950: 0243 29 7F CFF A.NDIM $ 7F LIMIT 

0960: 0245 AA TAX 

0970: 0246 C0 60 CPYIM $60 Y IN RANGE? 

0980: e24e 90 02 CCC YOK YES 

0990: 024A Ae 5F LDYIM $5F CLIP 

1000 : 024C 9e YOK TY A 

1010: 0240 09 80 ORAIM $e0 INDICATE Y 

1020: 024F A8 TAY 

1030: 0250 2e 00 02 JSR TVCT SEND 

1040: 0253 6e RTS 

1050 : 

1060; REVERSE : SUBROUTINE TO HEVERSE THE SCHEEN 

1070 : 


1080 : 

0254 

A 5 

Fe 

RVRS 

LDAZ 

REVR 

GET CTL BYTE 

1090: 

0256 

49 

01 


FCRIM 

$0 1 

TOGGLE BIT '/> 

1100 : 

025e 

e5 

Fe 


STAZ 

REVR 

SAVE 

1110: 

025 A 

80 

02 

cn 

STA 

DATB 

SEND 

1120 : 

02 5 C 

20 

09 

02 

JSR 

TCCC 

PULSE 

1130: 

1140 : 

0260 

6e 



hTS 




1150: FILL 

1 160: 

1170: e261 A2 40 FILL 

1 1G 0 : 0263 A.0 60 f.EWY 

1190: 0265 20 00 02 WRT 

i2ee : 026C ce 

1210: 0269 C0 F0 

1220: 0260 T0 re 

1230: 0260 FP 

1240: e26F F0 B0 

1250: 0270 00 FI 

1260: 0272 60 

TS. 


: SUBROUTINE TC TURN CN ALL 
LDXIM $40 INIT COORDS 

lcyim $ee 

JSR TVCT SEND THEM 

INY NEXT Y 

CPYIM $Fe END CF COLUMN? 

f NE WRT NO 

I NX NEXT X 

cpxim $ee cun? 

ONE r.EWY 
RTS 


SYMBOL 

TAELE 

320C 3260 






CLNK 

0217 

CNTL 

0206 

CTLB 

cec3 

CAT B 

0802 

FILL 

0261 

cetk 

IF 6A 

NEWY 

0263 

OFF 

0243 

ON 

0241 

REVR 

0 CE C 

RVRS 

0254 

TOCG 

0209 

TVCT 

02eo 

WRIT 

0228 

WRT 

0265 

YCK 

024C 


: L 1ST 

1000 REM TINY PATTERN CENEHATOR 
1010 A.USR(535) 

1020 Y-0 

1 e30 X-Y-( Y/ 2*2) 

1040 GCSUB 8000 

1050 IF U<-12000 A-USH(577,Y,X) 

1060 IF U>L IF U<H A-USR(577,Y,X) 

1070 X-X+2 

1080 IF X<64 GOTO 1040 
1085 Y.Y+1 

1090 IF Y<96 CCTO 1030 
1100 PR "FYE" 

1110 END 

6000 REM THE PATTERN CENERATION FUNCTION GOES HEHE 
8100 U-X*X*X/7-Y*Y/ 9+X*Y-X*X/8+Y*Y*Y/ 13 
820e RETURN 

:L 1ST 

ieee rfm tiny chaffer 

1010 REM 

1015 REM SET P-577 FOR PCSATIVE GRAPH 

1016 REM SET P-579 FOR NEGATIVE CRAPH 
1020 P-577 

1025 RFM INPUT X-START, X-INC, Y-LOW, Y-HIGH 
103e INPUT S.T.U.V 
1035 RFM CLFAR SCREEN 
104e A-USH(535) 

1045 RFM FILL SCREEN IF NEGATIVE CRAPH 
1050 IF P-579 A-USR(609) 

1055 REM COMPUTE Y INCREMENT 
1060 N-(V-U)/95 
1070 X-S 
1080 L-0 

1085 HEM COMPUTE VALUE 

1090 cosub eee0 

1095 REM SCALE RESULT 

1100 Y-(N/2-U+Y)/N—1 

1105 REM CLIP AT EDGE CF TISPLAY 

1110 IF Y<0 CCTO 1150 

1120 IF Y>95 COTO 115e 

1125 REM DISPLAY VALUE 

1130 Y-95-Y 

1140 A-USR (P , Y , L ) 

1150 X-X+T 

1160 L-L+1 

1165 REM NEXT X 

1 17e IF L<64 GOTO ie90 

1180 PR "BYE” 

119e END 

8000 RFM The FUUATION TO PE CRAFFED COES HERE 
8100 Y-X*X 
8200 RETURN 



Number 30 

458 


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


Page 33 





The STD Bus: 

A Critical Look at a Proposed New Standard 


BY KEITH BRITTON 

P.0. Box 6214 

Hayward, CA 

Recently Mostek and Prolog jointly announced a new bus. 
Such announcements appear from time to time, generating 
close scrutiny from a handful of intensely interested parties, 
mild curiosity from a somewhat larger and mostly hardware 
oriented group and, from most of the rest of us, no more 
than dull resentment at the need to increment our files of 
dubious mnemonics and ill chosen acronyms. The STD bus 
may well repay somewhat closer attention, for a surprisingly 
wide variety of reasons. STD is an abbreviation of the word 
standard and the principal importance of the bus lies in its 
proponents’ attempt to create a widely adopted standard 
rather than to merely launch a product line. Few observers 
will fail to find something of interest in the resulting inter¬ 
play of politics, economics, history and tradition (distinction 
intended), mechanics, engineering decisions and tradeoffs, 
software/firmware/hardware interactions, logic, individual and 
corporate personalities. And, for those addicted to private or 
professional meditation, there is not only room for considera¬ 
tion of the immediate and future technological impact of the 
new bus but also of some subtle sociological implications as 
well. 

The Bus — General 

A bus design is probably best considered top down. That is 
to say from the general logical content through the specific 
logical meaning of signals to their electrical and mechanical 
expression. As proposed, the STD bus is a simple synchronous 
bus with an eight bit data path separate from a sixteen bit 
address path. The necessary control signals are also simple 
and distributed one per bus line. Thus the overall philosophy 
of the bus is to accept limitations while gaining simplicity, 
but there is also an attempt to fit the bus to a variety of eight 
bit processors and to make token provision for memory and 
I/O expansion. The read/write controversy is resolved on the 
separate line side, an exception to the general air of frugality. 

The economy of lines (56) used by the STD bus is not only 
a distinguishing feature but also a significant selling point. 
Every line which must be supported exacts its economic toll 
in bus drivers and buffers and in printed circuit board area 
for both motherboard and cards. This may not be a disadvan¬ 
tage for a complex high unit value computer, nor for highly 
flexible hobby/development systems as in the S-100 bus. 
However, for the more price-conscious industrial control/light 
data processing market at which the STD is aimed, the fewer 
pins the better. Perhaps even more important, for equipment 
aimed at industrial environments, is the reduced difficulty 


experienced in maintaining reliable bus operation and reduced 
power requirements, especially where line termination is 
employed. 

As a practical matter, the number of lines also determines 
the pin spacing and contact areas, which also impact econo¬ 
mics and reliability. Contact pins on .156 inch centers, as in the 
common 44 pin standard sockets, allow the design of cheap 
but excellent motherboards. Signal traces may be heavy, and 
therefore of low impedance, and there is plenty of room 
between signal traces for ground line shielding. Power supply 
is unlikely to be a problem thanks to the substantial contact 
area of the power pins. A motherboard capable of reliably 
handling state-of-the-art data rates can thus be produced as 
a simple double sided PC board and manufactured by a 
marginal board house. In contrast, a comparable motherboard 
for connectors in .1 inch spacing is a work of art and expen¬ 
sive. The .125 inch spacing used for the STD bus represents an 
engineering compromise between these extremes. As such it 
offers some rewards for good design but threatens significant 
penalties for bad. 

Card Size and Shape 

STD bus advertising stresses the card size, and for good 
reason. A system using many small cards, as used by Control 
Logic Corp., incurs significant expense in connectors and 
buffers. Increase in system size and complexity leads to 
awkwardly shaped card cages, and motherboards so long as to 
present formidable difficulties for high speed data. Systems 
with comparatively large cards, such as the SBC 80 and LSI 
11, economize on connectors, buffers and bus lengths but at 
the cost of increased card complexity and expense. In addition, 
enclosures for large cards are generally expensive and may be 
mechanically weak. Large cards are both inherently more dif¬ 
ficult to support and more difficulty to thermally control. 
STD cards are 4 'A inches wide and, as standard, 6 X A inches 
long. Supported along their long sides, they are well adapted 
for use in rigorous environments. They also represent a com¬ 
promise in terms of card area, which make them well suited 
to their market. System maintainability is critically dependent 
upon module size, as is first cost, though to a lesser extent. 
Large, complex multi- function cards significantly impact 
first cost unless all functions are used, and impact maintain¬ 
ability in that failure of any card function is likely to result 
in complete card replacement. STD cards will be typically 
single logical function, encouraging board swapping trouble 
shooting, reducing spares inventory, and keeping initial system 
cost aligned to functional requirements. 

The small work area of the STD card produces some 
problems however. While it can certainly accept as many as 
48 chips for a dense arrayed card such as a memory board, 


Page 34 


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


Number 30 

459 



even excellent printed circuit layout will not allow densities 
equivalent to much more than 30 chips for more randomly 
arranged circuits. For this reason, skill in printed circuit board 
design will be at a premium for this bus. Note, however, 
that this applies only to the standard STD card size. Unlike 
other buses, the STD has the potential for being compara¬ 
tively flexible in its card area. The 4Vi inch width of the card 
fits a very wide variety of standard enclosures, and while the 
most popular is certainly the 6 Vi inch length, other lengths 
are supported most notably the 9.6 inch. This latter offers 
roughly double the effective work area, that is the total area 
less buffer area. Even longer cards, though possible, are un¬ 
likely as the resulting card cages become mechanically poor 
and circuit board layouts become increasingly inefficient 
due to the increased aspect ratio. 

An interesting comparison may be made between the STD 
standard card and its probable extension and the Eurocard 
system. The small Eurocard is roughly 4 inches by 6 inches 
(100 x 160 mm). Unlike the STD card, it is fractionally too 
narrow for two 40 pin dip chips to be aligned crosswise, a 
surprisingly significant layout disadvantage. Its effective work 
area is only some two-thirds that of the STD cards which, 
combined with its less advantageous aspect ratio, will in 
practice nearly double the number of small Eurocards com¬ 
pared to STD cards required for an equivalent system. Since 
increasing the area of the Eurocard by increasing its length 
would incur very substantial aspect ratio layout inefficien¬ 
cies, the Eurocard area expansion is done by increasing the 
width, resulting in a disastrous economic disadvantage for 
small systems. The larger cards require two connectors rather 
than one, use different motherboards, different supporting 
chassis, and large and small boards cannnot be intermixed 
in a single system. If the STD bus does in fact become the 
standard for industrial electronics within the United States, 
this comparative flexibility may prove to be a significant, 
perhaps even crushing, advantage over its European com¬ 
petition. And with the advance of the metric system within 
the US, existing cards will fit a 115 millimeter card guide 
spacing with 175 millmeter and 250 millimeter card lengths. 

Power 

The principal logic power supply is 5 volts supplied with 
off-card regulation to avoid local heat concentration. Two 
bussed pin pairs are provided at one card edge to allow both 
ample contact area and room for motherboard traces of un¬ 
limited area. At the opposite end of the card single opposed 
pins supply a nominally analog plus and minus 12 volts. This 
supplies, though with limited contact area, the 24 volts likely 
to be needed for industrial controls. Power is more likely to be 
contact area limited than trace area limited since the pins 
concerned are the outboard pins on the connector, allowing 
unlimited trace room. The ground return for these pins, which 
need not be logic ground, is more limited physically, but this 
is partly compensated for by use of two bussed pins. Both 
sides of the board may therefore be used with heavy traces 
and, if desired, extra area may be used between sockets at 
the expenses of the power lines to reduce impedance. 

Up to this point, the power supply and distribution can be 
considered beyond reproach. The remaining power supply 
blows two more precious pins on minus 5 volts. This eyebrow 
raiser becomes even more curious when one realizes that the 


pins are specifically not bussed and that at least one of the 
bus proponents does not propose to supply this power level 
for standard systems. This curiosity comes about for partly 
historical and partly corporate policy reasons. A draft of the 
bus dated in May shows the two pins concerned as undefined. 
Corporate policy then required that no pins be left unassigned 
and it seemed possible that minus 5 volts could prove a useful 
substrate voltage, particularly for use with dynamic memories. 
Although this possibility later receded, no one could think 
of anything useful to do with the pins so both were assigned 
to an unwanted power level, the primary function of which 
is to discourage ultimate use of the pins concerned, leading to 
the pointed question—What is the STD bus standard? Either 
an STD bus designer has a right to expect an STD compatible 
supply to supply this power level, or the STD bus may well 
be headed down the road pioneered so well by the S-100. 

Bus Lines—Address/Data 

As proposed, the STD bus has eight data lines and 16 
address lines. Data lines are bidirectional and all lines are three 
state. This is the classic arrangement for a synchronous eight 
bit processor and is unsurprising since the Prolog customer base 
buys four bit and eight bit processors and Mostek, which 
was unable to second source the Zilog Z8000, offers no 
processor larger than eight bit. The absence of any system for 
multiplex use of the bus and/or wider data paths is highly 
regrettable and the biggest reason why this bus should not, 
as it stands, become a national standard. 

Multiplex operation is becoming increasingly common and 
for good reason. For memory parts, multiplexing roughly 
halves the number of pins required, significantly reducing 
direct costs and dramatically reducing the printed circuit 
board area required and this is of great importance to small 
cards used in the STD bus. Similar advantages, though less 
marked, are realized for CPU and other support devices, and 
this has led to multiplexing, originally considered only applic¬ 
able to 16 bits and up, to extend downwards into the 8 bit 
field, notably with the support line for Intels 8085. There is, 
therefore, a good argument for multiplex capability on the 
STD bus even if the bus is to be considered restricted to 8 
bit operations. 

To allow synchronous and multiplex cards to coexist 
within a single machine would require only two lines to be 
used for multiplex operation control. Obvious candidates 
would be the minus 5 power lines. Adding this capability 
would greatly increase the flexibility of the bus since multi¬ 
plex processors could still use synchronous cards by demulti¬ 
plexing at the processor card buffers. In addition, the addition 
of multiplex capability would allow the use of wider data 
paths—up to 24 bit. At first glance this may seem unneces¬ 
sary or even undesirable for small systems and systems 
particularly designed for industrial control use. It must, how¬ 
ever, be realized that PDP 1 Is, Novas and even more power¬ 
ful processors have long been commonly used for industrial 
applications for which 8 bit machines prove inadequate. A 
national standard based on the STD bus could perfectly well 
support the Motorola 68000, the Intel 8086 and Zilog Z8000 
as well as a wide variety of 8 bit processors. This would allow 
the user to maintain a high degree of compatibility amongst 
his most common cards, which will always be predominantly 
8 bit I/O cards. 


Number 30 

460 


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


Page 35 



Memory I/O Control 31-36 

Four of the six lines are quite straightforward, separate 
read and write lines plus two lines for memory or I/O select. 
The remaining two lines are designated for memory and I/O 
expansion, one line for each. Enquiry, however, reveals that 
although Prolog and Mostek are in accord as to the designa¬ 
tion of these lines, neither has as yet formulated a scheme for 
actually implementing expansion. This provides another can 
of worms, since the implementation chosen will impact 
software, firmware and hardware. Expansion capability may 
be used in two ways. The most obvious is to simply extend the 
number of I/O devices or memory locations which may be 
addressed. Less obvious, but for engineering applications 
possibly more significant, is the ability to use alternate 
memory locations or I/O devices. This is best illustrated by 
considering the latter. 

A subroutine using absolute I/O addresses may, given 
alternate bank capability, be applied to more than one set of 
I/O devices by simply swapping banks, with implications for 
both hardware and software. Memory management, for pro¬ 
cessors not designed for page mode operation, is more of a 
problem. One means of implementation would be to treat 
the memory expansion line as the 17th bit to be decoded on 
each memory card. This would required each memory card 
to be burdened with the necessary decoding logic, a small 
but significant expense and penalty in precious PCB real 
estate. A second system might be to AND with memory 
request or the enable from the address decode, which has 
similar disadvantages. Another system is to allow optional 
jumpering on each memory card for memory request and to 
issue memory request upon the appropriate line at the proces¬ 
sor. Similar considerations apply to I/O cards. This latter 
scheme involves negligible expense or real estate penalty, 
other than on the processor card, and has the advantage that 
since all four lines are conveniently grouped, a simple jumper 
or switch arrangement allows any desired mix of memory 
I/O expansion. This latter flexibility would have one disadvan¬ 
tage. Fewer devices could be controlled in this manner than 
could be controlled using the two expansion lines as address 
extensions. But memory and I/O cards are not the only ones 
to be considered. Extended memory or I/O could be managed 
from the processor card or from a separate management card 
addressed by the processor via I/O instructions. 

Actual implementation for memory management is not 
as simple as it might appear at first glance. The CPUs to be 
used were not designed for such duty, and it may entail 
some curious and amusing oddities in bit hardware and soft¬ 
ware. Consider the case of a CPU which is swapping memory 
pages by issuing an I/O instruction. The next instruction 
fetch will be from the “new” memory page, and from what¬ 
ever byte the preceding I/O instruction left the program 
counter pointing at. Transfer between pages of ROM can thus 
require some care in coding while transfer between pages of 
writable memory, assuming one has succeeded in achieving an 
initial beachhead, could add a novel dimension to self-modi¬ 
fying code. Equally amusing, although unattractive, is the 
thought of dribbling data back and forth across boundaries, 
hand carried in registers. 

This nonsense can be alleviated by processor card logic 
which arbitrates read, write and instruction fetch between 
designated memory banks. Other methods are also tenable, 


but again, in the absence of a defined standard covering 
logical approach, addressed board hardware and software 
techniques, and management device address, it is hardly proba¬ 
ble that any two manufacturers for the new bus will achieve 
mutual system compatability. 

The Control Group 37-46 

Six of the ten signals are straightforward implementations 
of logical requirements—bus request and acknowledge to allow 
multiprocessing or DMA, maskable and nonmaskable interrupt 
request with interrupt acknowledge allowing one level of 
interrupt priority but requiring vectoring for further interrupt 
expansion, and wait request for slow devices. The remaining 
four lines are more questionable from the point of view of a 
national standard. 

Refresh is a frankly Z80 signal, though Prolog documenta¬ 
tion states that it may be supplied from a specific purpose 
card. Standardization upon a processor dependent signal, 
or mimicry thereof, is at best questionable, but there is worse 
in store. Pin 38 turns out not only to be defined in terms of 
specific hardware, but also in terms of the manufacturer’s 
specific product line, and mutually incompatible products 
to boot. Prolog defines this pin as machine cycle sync for the 
convenience of the bus analyzer it sells (note that this is NOT 
the sync associated with an instruction fetch). Mostek calls 
the line by a different name and uses it as a hardware single 
step controller. In justice, it has to be admitted that this is 
not inconsistent with the general tone of this proposed 
standard. Paraphrased: “Manufacturers shall adhere to a 
universal standard except that they shall note in their litera¬ 
ture where they deviate therefrom.” In this instance it is 
unclear whose definition is the STD bus definition, but there 
is a good argument that neither should be. Nor is this the only 
signpost pointing to the road pioneered by the S-100. 

At Wescon Prolog showed its 7000 series STD cards while 
Mostek showed its STD-Z80 cards. The Z80 has no separate 
pin for interrupt acknowledge, the logical signal being pro¬ 
duced by an AND of the instruction fetch sync signal, Ml, and 
I/O request. Both companies issued this logical signal from the 
CPU card to the appropriate bus line. The I/O card usage 
differed, however. Z80 peripheral support chips requiring an 
interrupt acknowledge are designed to decode directly from M1 
and I/O request. Mostek cards reportedly did just that, ignor¬ 
ing the bus line intended for the purpose, which was the line 
usd by Prolog I/O cards. Prolog I/O cards will therefore work 
with Mostek processors and vise-versa, but this is only true 
for Z80 processor boards and Prolog proposes to offer 6800 
and 8085 boards almost immedately. Caveat emptor. 

The remaining two signals of this group are titled CPU 
status 0 and 1. CPU status 1 is used for any signal identifying 
an instruction fetch, Ml for the Z80. The remaining line, 
unused by Mostek, is used by Prolog for SO for the 8085 and 
VMA for the 6800. In general the clarity, precision and com¬ 
pleteness of definition for these lines—again bearing in mind 
that the companies concerned are proposing the STD bus as a 
national standard—is perhaps best illustrated by these words 
from the Prolog draft of the bus manual. “The status control 
lines are used to provide timing information related to special 
machine cycle operations. Where it is specifically available 
status 1 is considered to be a signal to identify instruction 
fetch.” 


Page 36 


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


Number 30 

461 



Reset 

All computer systems need a reset line. The STD bus has 
two. One is a short, clean, debounced signal for use by TTL 
logic. The other blows one of the few precious lines available 
merely to communicate an external push button closure to 
whichever bus resident card supplies the former signal. Power- 
on reset and debounced external push button reset can per¬ 
fectly well be handled on the motherboard, and/or at the 
switch, saving a line and/or a slot and/or CPU card real estate. 
If a second reset line is to be provided, for engineering pur¬ 
poses it may be better employed as an addressed reset, which 
would allow the processor to reset a card by issuing the reset 
and the card’s I/O address. This would avoid the necessity of 
issuing a general system reset / and, since it would reuse the 
address decode already available, avoid issuing multiple reset 
commands or committing additional I/O addresses for the sole 
purpose of implementing local reset functions. 

Clock 49 and 50 

The STD bus has tow lines for clock signals. One is the 
processor clock and the other is available for alternate system 
use. This will allow slow speed devices to use a common clock, 
a simple and effective arrangement. 

God Is On My Right 51 and 52 

The STD bus is unusual in defining two pins for daisy chain 
operation. These pins are not bussed, but connected 51 to 52 
along the motherboard. Implementation of daisy chains is 
therefore greatly simplified since adjacent cards may control 
each other and priority is simply established by physically 
positioning the highest priority card to the right of the next 
highest and so on. This will prove a great convenience for I/O 
operations, interrupt driven applications, and possibly for 
implementation of multiprocessors. 

An Opportunity 

The STD bus, as presently proposed, is a competently de¬ 
signed synchronous bus for eight bit processors unusually well 
suited to its putative market—engineering and light data pro¬ 
cessing. But incompatibilities exist even amongst the earliest 
cards, bus definitions are often fuzzy (and at least one case 
mutually incompatible) and no apparent consideration has 
been given to a support or policing system capable of estab¬ 
lishing discipline amongst nominal bus suppliers. Based on the 
above, a reasonable prognosis for the bus would appear to be 
islands of very good engineering in a shambles comparable to 
the S-100. Nevertheless, the potential exists for the STD bus 
to become a well controlled system of complex building 
blocks of truly extraordinary versatility—the 7400 series of 
the microcomputer world. This can reasonably be achieved by 
a hardware change, a policy change and an organizational 
development. 

The hardware change is the definition of two bus lines for 
control of multiplex operations, preferably by junking the mi¬ 
nus 5 volt power. This would open the bus to the new 16 and 
32 bit processors and would allow use of the new generation 
of 8 bit support devices. 


It has been the policy of the original STD bus proponents 
to define all lines of the bus in what is already exposed as a 
futile attempt to avoid anarchy. Fortunately, this untenable 
policy is capable of simplification and rationalization. If the 
bus be considered from a top down design stance, it will be 
immediately obvious that certain signals should be expressed 
within the bus architecture because they are logically 
necessary or extremely desirable for computer operation. In 
this category fall the address and data lines, read, write, 
memory and I/O select, bus request maskable and nonmask¬ 
able interrupt (with acknowledgements), wait and reset. These 
signals should be supplied and used, to the exclusion of alter¬ 
natives, for their logical purpose by all suppliers to the bus. Of 
lesser importance is a second category of contenders for bus 
space, commonly used and highly desirable conveniences. In 
this category fall the processor clock, instruction fetch identi¬ 
fication and daisy chain system. 

The remaining single lines on the bus, having failed to 
justify their inclusion in either general category, should be 
considered as utility lines and defined as such. This is no bar, 
of course, to multiple definition. Line 37 could, for instance, 
be defined as refresh/utility. Thus refresh, if implemented, 
must appear on that pin and no other. The physical implica¬ 
tions for this approach are trivial, merely that to accommodate 
the dual or multiple use potential of such lines, no permanent 
connection be made to the pins concerned. This requirement 
may be simply met by use of a jumper or a prepared trace 
separation point, a necked down portion between two pads 
usable for repair. STD bus designers, and more importantly 
users of same, could thus enjoy a high degree of flexibility 
while maintaining, for the bus fines of primary importance, 
standards of such rigidity as to preclude basis system incom¬ 
patibilities. 

No standards wll be observed without discipline. To apply 
it, the STD bus needs a watchdog. Industry watchdogs tend to 
be toothless, but in this case the situation is unusual. The teeth 
are obvious but the dog is not. For the market at which the 
STD bus is aimed, adequate commercial coercion can be 
simply applied by withholding use of a trademarked logo for 
products which do not meet established standards. Hobbyists 
will buy an off brand article but industrial purchasing agents 
will not. Proof—when did you last see a non-UL approved 
appliance in an office? There are a number of obvious pos¬ 
sibilities for a regulatory body, JEDEC, ANSI, and IEEE to 
name but a few. None are noted for snappy footwork under 
pressure, blinding speed in their committee work or evident 
desire to expose themselves to the muck raking and flak den¬ 
sity which may be reasonably expected. The organizations 
named might, however, be persuaded to nominate board mem¬ 
bers to an association of STD bus manufacturers set up for 
standards development and maintenance. 

Such organizations are not without precedent and much 
might be adapted from the commissioner oriented forms of 
organization developed to police national sports. In addition 
to its regulatory function, such an organization could perform 
an invaluable service to manufacturer and customer alike as a 
central information source for the bus. Available information 
could include second sources, plug compatible sources, func¬ 
tional equivalents and near equivalent alternatives. Incompat¬ 
ibilities and cautions could be flagged, as could existence of 
application notes or other useful references. In addition, cross 


Number 30 

462 


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


Page 37 



referencing could be done to sources of related items such 
as STD width enclosures and solid state relays and transducers. 
And this information could be easily made available on a 24- 
hour basis for the price of a microprocessor, a disk and an 
answer modem. 

Futurebus 

The IEEE has committees working to straighten out the 
S-100, rationalize microprocessor bus interfacing and, signifi¬ 
cantly, to study, anticipate (and hopefully in some measure 
ure to direct) future developments. Since we may be abso¬ 
lutely certain that the STD bus is not the ultimate bus, it may 
be well to consider its probable lifespan and the changes which 
may occur to it within the near future. A number of techno¬ 
logical trends are already sufficiently well defined to allow 
extrapolation. At the risk of belaboring the point, an obvious 
trend is towards multiplexing. It seems reasonable to suppose 
that the STD bus will have limited scope and/or limited future 
if it remains synchronous and, since a trend is also fairly ob¬ 
vious toward wider data paths, if it remains 8 bit. 

Interface and I/O support chips become ever more complex 
while simultaneously single chip microcomputers gain in 
power and richness of built in I/O devices. To some degree 
these trends are convergent and are likely to impact the STD 
bus in two ways. Increased chip complexity will reduce de¬ 
mands from printed circuit board real estate, a definite plus 
for the STD compared to its competitors. But the trend will 
also be to distributed intelligence and array processing. This 
will place an increasing premium on bus architecture factors 
favoring multiprocessor or distributed intelligence use. Since 
the STD bus was not designed with this in mind, its present 
architecture could prove to be a blind alley. Presently, how¬ 
ever, distributed intelligence and its problems remain but 
poorly understood. 

Trends in memory toward increased speed and density 
at reduced cost appear unlikely to significantly affect STD 
machines used for engineering purposes as such applications 
tend to require little memory. For data processing applications 
of STD machines, unless multiplexing opens up all 24 address/ 
data bits for address use, the present single designated memory 
expansion pin will prove totally inadequate to prevent the bus 
from reaching rapid obsolesence. 

The remaining major question mark for the future of the 
STD bus results from a quite evident trend which has, to date, 
been relatively unremarked. In the past processors have 
radiated a wide variety of status and timing signals usually 
using a pin for each. A move away from this practice is a 
recurrent theme for the most recently developed CPUs particu¬ 
larly the Intel line. The signals may still be available redun¬ 
dantly at individual pins, but all necessary signals are likely to 
be recoverable from a small group of encoded status lines. 
This makes so much sense in terms of reduced pin count, 
board and bus complexity, as to be clearly the way of the 
future. Consider the STD bus. Every status or control line 
emanating from the processor could be replaced with a block 
of four encoded lines, and there would still be space in the 
encoding for multiplex control and I/O and memory expan¬ 
sion. True, each card would then be burdened with decoding, 
but this would merely involve a simple mask ROM with four 
inputs configured as bus buffers, hardly more expensive than 
the buffers required for the present arrangement. Presently, 


the bus proponents intend that it should be a living thing and 
adapt to technological change. Production lines have a certain 
inertia as do customers. Probably significant changes could 
be made within the next two or three months, present com¬ 
mitments being still limited, and hopefully this opportunity 
will be taken to immediately make changes which cannot be 
long postponed. Flexibility and change are essential to avoid 
ossification, but one should bear in mind Borge Langefors’ 
fifth principle—“If the time it takes to implement a change in 
a system is longer, on the average,than the mean time between 
changes, then the system is not viable.” 

Who Will Salute? 

Reference to the Oxford English Dictionary reveals three 
senses for the word “standard.” Firstly, a standard is a rallying 
point. The present burning question in several board rooms is 
simply —who will climb aboard? Without wide support, the 
STD bus will not become a standard, nor will it become a sig¬ 
nificant market place. It may be reasonably expected to 
attract a substantial number of very small manufacturers 
because it is the only game in town for the commonly used 
card size. Many cards, thanks to the bus’s philosophy of com¬ 
petent solid simplicity, will be fitted to the bus by mere 
pinout reassignment. It is possible, however, that Mostek and 
Prolog may have more difficulty in attracting to the bus com¬ 
parably substantial full line competition. Implementing the 
relatively minor modification necessary to allow multiplex 
and multibyte bus operation could significantly alter this 
position, particulary since there is no evidence as yet that two 
giants and one bigee, Motorola, Intel and Zylog, have yet 
committed to a bus for their wide processors. 

A Good Measure? 

The second sense of the word standard is that of a measure. 
Would, or could, the STD bus become a good or bad standard? 
and further, would the wider implications of such a standard 
prove generally beneficial or detrimental? As proposed, the 
STD bus seems far too limited to have the significant impact 
necessary to generate a market segment standard, let alone 
a national or international one. On the other hand, as pro¬ 
posed it already contains the bulk of the features likely to 
be needed for at least the next decode and has no obvious 
bar to adopting the missing ones. 

The IEEE owes a particular debt for its future bus studies 
to Hermann Schmid, who recently kindly supplied this author 
with a paper titled “A Top-Down Approach for Monolithic 
Processor Standardization,” containing his current thinking 
on the subject. His focus has been particularly upon the mid- 
80’s, but the paper exhibits an almost eerie correspondence 
with the opportunities open to the STD bus and its propo¬ 
nents. For the STD bus, and by extension the segments of 
industry and humanity directly or indirectly impacted, the 
future could be now. 

Microprocessor building block standardization could pro¬ 
foundly affect the widespread application of artificial intel¬ 
ligence. But this is a more serious business than merely the 
drastic cost and development timesaving which might be 
expected to parallel that shown, on smaller scale, by the stand- 
ardiation of the 7400 TTL series. Microcomputer standardiza¬ 
tion has to be seen in historical perspective, and a striking 


Page 38 


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


Number 30 

463 



analogy can be made with the British of 200 years ago. America 
is leading the way in a revolution far more profound than the 
Industrial Revolution. Where the British, during the Industrial 
Revolution, extended man’s muscle with inanimate power, 
Americans are today extending man’s mind with artificual 
intelligence. 

From the engineering anarchy of the early Industrial 
Revolution certain standards emerged, some to become, 
for economic reasons, immutable. For instance, the British 
bequeathed the world a standard railway gauge of 4’ 814” 
for no better reason than that a few miles of existing haulage 
road being adapted for railway use had timbers convenient 
for that spacing. Pressures for standardization are increasing 
so rapidly that it seems hardly likely the next decade will 
not irretrievably commit our descendants. The STD bus will 
not be the ultimate bus, but it deserves careful consideration 
and perhaps support if only because of its potential as a proto¬ 
type or test bed capable of at least enlightening possibly 
irrevocable technological decisions which we cannot long 
evade. 

A Thing Erect 

The third sense of standard is that of a thing erect-which 
may lead cynics and those familiar with the traditions of the 
industry to suspect a digit. Neither of the original STD bus 
proponents claims to be other than a commercial organiza¬ 
tion and out to make a buck. It is seldom reasonable to criti¬ 
cize manufacturers for introduction of a product line contain¬ 
ing features peculiarly adapted to their advantage, but by 
proposing the STD bus as a standard, Mostek and Prolog have 
exposed themselves to judgment in more than simply com¬ 
mercial terms. The usage of pin 38 is clearly self-serving 
and hardly in accord with a spirit of standardization. There is 
also evidence, particularly related to the minus 5 power 
supply pins, that the companies concerned have been willing 
to accept at least questionable engineering decisions, in an 
unseemly haste to lock up all pins, and create a defacto stan¬ 
dard. Interestingly, the smaller company, Prolog, has adopted 
the more intransigent take-it-or-leave-it stance. Development 
of a new bus is, or should be, a problem orders of magnitude 
greater than can be indicated by this somewhat cursory 
article, and is a subject which has engaged increasing attention 
from many fine minds. In particular, the IEEE committees 
studying bus related matters are an obvious resource and 
reference point. Presently, this author has been unable to 
trace any attempt by Prolog and Mostek to consult such 
resources or to apprise them, in a timely manner, of their 
intentions. A prima facie case thus exists to indict both 
companies for at least irresponsibility, in the context, it must 
be emphasized, of the STD bus proposal as a standard. 

Judgment on this issue would, however, be premature, 
since the companies clearly do not yet have their joint act 
together and their proposed bus may turn out to be more of 
an asking bid than a fait accompli. If this proves to be the 
case, history may record substantial indebtedness to them 
for short-circuiting years of tedious committee maneuvering 
by developing the small system standard for the 80’s to the 
point where adoption is swiftly possible with but minor 
changes. And the sense of erectness may well be associated 
with the names of Mostek and Prolog—for stature that has 
hitherto been often lacking amongst the industry’s leaders. 


13939 STATUS 3 (cont’d from page 31) 

13948 TAPE 2 
13955 ANSWERS 6 S 

13970 INTEL FORMAT TAPE ROUTINES! 13970 
13406 ? 

Other Applications of BASEX 

The BASEX manual includes a very useful sample program 
that allows you to convert numbers from any number base be¬ 
tween 2 and 36 to any other base and do arithmetic (+,-,*,/) 
or logical operations (&, #, %) in any number base. This 1K- 
byte program will do everything the $60 TI Programmer cal¬ 
culator will do and more! I have also converted that chess pro¬ 
gram and the Bulls and Cows game into BASEX; both run 
about 10 times faster than they did in BASIC. That factor of 
10 is the difference between fun and boredom. BASEX was 
also ideal for writing a powerful word processor that I call 
PRO-TYPE (see below). In order to use my North Star disk 
and Meca tape drives with BASEX programs, I have written 
some utility routines that permit random or sequential access 
to disk or tape files, etc. These things have a way of eating up 
time, so the interactive graphics and electronic music programs 
haven’t yet been translated to BASEX, but someday ... 

Hardware Requirements and Availability 

The current version of BASEX was written for the 8080, 
but it also runs on Z80 or 8085 microcomputers. However, it 
is fairly straightforward to translate the 2K bytes of run-time 
subroutines to ran on other microcomputers. Since the 
BASEX compiler and LOADER are written in BASEX, they 
should work with minor modifications on any other micro¬ 
processor, once the run-time subroutines are available. It 
should also be very easy to translate any user application pro¬ 
grams from one dialect of BASEX to another. The conversion 
for the 6502 is already underway and if there is sufficient in¬ 
terest, BASEX may be made available for other microproces¬ 
sors, as well. A second limitation of the current version of 
BASEX is that it resides in the lowest 8K of memory (loca¬ 
tions 0 to 5 and 64 to 1FFF), which presently precludes its 
use with some computers that have ROM down there (e.g., the 
Radio Shack TRS-80, Heath H-8). 

The BASEX manual is being published by Byte Publica¬ 
tions, Inc. and will be available from them or from your local 
microcomputer store. It includes a more detailed explanation 
of each command, sample programs and fully commented list¬ 
ings of the assembler language run-time subroutines, the com¬ 
piler and the relocating LOADER program. A full explanation 
of how the BASEX user can add his own customized com¬ 
mands to BASEX is included in the manual. It also contains 
the object code for these programs in bar code format. For 
those of you who want to be the first on your block to try 
BASEX, I have a limited number of copies of the preliminary, 
unedited version of the manual available for $10. North Star 
disks or Meca tapes containing all of the programs are available 
for $25 from Interactive Microware, Inc., 116 South Pugh 
Street, State College, PA 16801. Other disk and tape formats 
will also be available as soon as possible. This company also 
markets the program that allows BASEX programs to access 
North Star disk or Meca tape drives and the PRO-TYPE word 
processor, which is written in BASEX. 


Number 30 

464 


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


Page 39 



COPYING A DISKETTE ON 
INTEL DOUBLE DENSITY DOS 


BY PAULM. JULICH 

Dept, of Electrical Engineering 
Louisiana State University 
Baton Rouge, LA 70803 


The program presented allows one to copy track by track 
all blocks of diskette regardless of attribute. The program runs 
considerably faster than the INTEL supplied program using 
ISIS Commands for copying files. A complete diskette can 
be copied in 2 minutes, 45 seconds. 

An added benefit is that the copied disk is identical with 
the original. In other words corresponding blocks will contain 
identical data. This may not be true for disks copied file by 
file using the ISIS Commands. 

The attached listing of DCPY is the output of the INTEL 
Relocatable assembler. After the program is loaded the disk 
to be copied is placed in Drive 0 and a formatted disk which 


is to be written on is placed in Drive 1. The program is exe¬ 
cuted by directing the program counter to COPDK. During 
the copy operation the system will indicate to the operator 
that each track is copied by a message on the CRT. When the 
copy operation is complete the program will return to the 
Monitor. 

As the program is written it requires a buffer of 6656 
bytes beginning at location 6000H. The buffer address may 
be changed however in line 7. 

A similar program can be written for the INTEL Single 
Density DOS. The major difference is the size of the para¬ 
meter blocks. 












Ui Li *T CJ 
O © © O 
© U. O O 
© li. © © 


X X 

G I © 

Lu © © n o © o -'j 
CO 

©**** 111 * 1 X 1 


XX X 

X >0 © 

© ^ ro © © o >o 
******* 


1 ****** * 


Hl-C 
2 U u_ 

I C ijJ * 
O X CO 3 


ui co * rv 
•<r ui rv © 
© © © © 
© © © © 


<IN C0 0> Ort Cg M^IiI'OMDO'OhNM^K'ONOJ^Oh eg n -T if) -o ©■ CO !>© ’-t Cg 
eg IN IN IN n m M rn f'm M ro M ’T W V 'T ^ f f 'TliT y - ) ill ill UI U‘J UI UI UI u~! -0 -o -0 


iii * u. eg — ro » 


Ui b- -t IN ill -o CD 
<E © * * * * * 
© © © © © © © 
o © © © © © o 


© -m in n %- ui o 
© © o © © o o 
© © © o © © © 
© © © © o © © 


© O <T © © © O 
© -H M © © © >0 

rv co ch <r * u * 
© © o © © © © 
©©©©©©© 
©©©©©©© 


T *T 

^ ro ui 

'T •■T 
f -4 © !> 
ill eg 
* © © 
in ui © 

ui in -o <r 

© w ^ 
© © © © 
o © © © 


© ro •— © © © © © m © © © © 

©©0©0©'0©-f©©0©'0 
* i J w Ui u. O H C J M V ill ■<) N CO 

—• r g in eg in eg eg eg eg eg 

o © © © © © © © © © © © © © 

©©©©oooo©©o©©o 


ifj b_ eg <c 

cr. © eg eg © 

_i © © © © 

o © © © © 


CC C X h 3 

UJ <E U CJ 2 

05 Li. X Ui uC 


i C Q Ci X 

: r 2 2 _j 


Ci Cl. CJ O I- 

<r x -x - cn 

u. CJ Ui X u. 

X X 

J J J X _J 

_j _ 1 _itonjii:- 

c -i <r i 1 x <r o iii 

uuua_ 1 u u. or 


1 eg to v ui •0 N mo- © h eg ro <5- ui 
, ^ ^ ^ ^ ^ ti ^ eg eg e g eg eg eg 


iUUUUCiUUU 


Li © eg rxi ^ i\ 
eg ro ww ww 
o © o © © © 
©coo©© 


© © © o © © © © © © © © o 

o o © © o o © © © © -o © © 

■c * <1 t-i ii © eg <r h u o "O a co 

© ■>-« *- eg eg —1 eg —* eg eg ©• o -r ui 

urSMi-iCiM-nCiCiwrtq<TaiiiirJO. 

Ot-UuUUhUUOiNUON u u u 

^oowoo-ull eg to co * ui u_ © eg ui 

n M c <t T *T -T T UI ill ill UI UI UI "O >0 <1 

© © © © o © © © © © o © © © © © © 

c © o © © o © © © © © © © © o © © 


© © © © © © 

© © © © © © 

n c h a iii u 
© © © © © © © 

co eg eg ui eg eg eg eg 

iv ,r; irj n n n eg eg 

■o rv <e * u. eg ui co 

'O --0 --0 -O -<i fv. f\ !\ 

O © © O © O© © 
© o o © © © © © 


© © © © © © 

©©©©•© © 

-<.■©© u. rv 

© © —* eg eg © 

whhwwOCOOCh 
u -»oau©oc©©T-« 

a ui h <r n <[ is o c uj u_ 

rv rv co co co co co co co co co 

© © © © © © © © o © © 

© O © © © © © © © © © 


eg ui co * o u. eg r<-j 
o-i>ochi>0'©<r 
© o© © © © © © 
©©©©©•©©© 


Number 30 

466 


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


Page 41 










COMPRESSED SUBROUTINE CALLS FOR SC/MP 

Dear Sirs, Received: 78 Aug 24 

With reference to your SC/MP subroutine manager in the 
March 1977 issue of Dr. Dobbs, please find enclosed a com¬ 
pressed version of the same. 

Yours faithfully, National Semiconductor 

Phil Hughes 2900 Semiconductor Dr. 

Microprocessor Marketing Manager Santa Clara, CA 95051 

7.2.6 Compressed Subroutine Calls. 


This example permits the user to impliment nested sub¬ 
routines while using only 3 bytes per call. 


Initialization 

LDI 

H(HANDL) 

; Load address of 


XPAH 

P3 

; Subroutine handler 


LDI 

L(HANDL) 



XPAL 

P3 



Call 

XPPC 

P3 



.ADDR 

SRI 

; Address of Subroutine 1 


XPPC 

P3 



.ADDR 

SR2 

; Address of Subroutine 2 



etc. 



RETURN: 

JMP 

RET (P3) 



JP 

RET (P3) 

; Any one of these 


JNZ 

RET (P3) 



JZ 

RET (P3) 


Organization 

Routine 



RETURN: 

ST 

-1(P2) 

; Exit Subroutine 


LD 

@1(P2) 

; Get us byte of RET ADDR 


XPAL 

P3 



LD 

rai(P2) 



XPAH 

P3 



LD 

-3(P2) 

; Restore A U 

HANDL: 

XPPC 

P3 



ST 

@-3(P2) 

; Save ALLU 


LD 

@2(P3) 

; Adjust P3 


LD 

(P3) 

; Load lower S/R ADDR 


ST 

1(P3) 

; Save temp 


LD 

@-l(P3) 

; Get upper part 


XPAH 

P3 



ST 

2(P3) 



LD 

(P3) 



XPAL 

(P3) 



LD 

@1(P3) 

; Restore ACCU 


JMP 

HANDL 



T = MfifODL. . 


SAM76-FORTH-STRUBAL 

Received: 78 Sept 4 

In Volume 3, Number 8 of Doctor Dobbs' Mr. R. D. 
Grappel, a co-devisor of STRUBAL criticized “FORTH” 
on a variety of points. Since the SAM76 language might be 
subjected to virtually identical criticism I find it appropriate 
to submit the following in defense of FORTH and SAM76. 

Mr. Grappel criticizes FORTH on the basis that the pub¬ 
lished representations are difficult to read. He by implication 
suggests that “pseudo English” is the way to make things 
legible; for some people that may be true —particularly if they 
use a latin character set. Many people in the world use other 
alphabets and linguistic representations, and for them 
STRUBAL would be quite foreign, whereas the symbology of 
FORTH and SAM76 is readily adaptable to their needs and 
desires. 

Furthermore it would appear that Mr. Grappel fails to 
recognize that FORTH, and SAM76 also, is a “core langauge” 
capable of self redefinition to the extreme of looking just 
like STRUBAL—or APL—or BASIC —etc. There is a speed 
price to pay for such conversion, but that is one way of doc¬ 
umenting a program for the benefit of the reader—and yet 
execute the procedures as written in their highest form. 

I am not familiar with the internal details of FORTH, 
but I would hope that the FORTH interest group maintains a 
registry of well defined resident primitive functions and that 
means are provided within FORTH as they are in SAM76 
for dynamic change of resident function names to permit 
international users to select function names or mnemonics 
best suited for their native languages. Portability of programs 
on an international basis is thus facilitated without imposing 
“anglicisms” on the rest of the world. Note that conversion 
of programs by editing is usually not a viable method because 
in languages such as SAM76, and probably FORTH, the 
function names might not exist until computed at run time, 
and consequently the only safe way is to dynamically change 
the state of the machine to match the program being run. 

Mr. Grappel merely mentions in passing the fact that 
STRUBAL requires an overhead of multiple passes and needs 
intermediate files. This renders interactivity and immediate 
write—test —run mode of operation impractical if not impos¬ 
sible. Consequently “one shot” programs written in 
STRUBAL require considerably more time than those wirtten 
in FORTH or SAM76 before the user sees the result sought. 

The issue of speed is becoming rapidly a non-issue, and if 
one accepts the forecast of infinite speed—zero cost comput¬ 
ation by the year 1985, then that aspect of STRUBAL be¬ 
comes totally irrelevant. 

Mr. Grappel also glosses over the fact that STRUBAL runs 
in a minimum of 16K bytes (possibly 15.7 or 15.8 with 


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


Number 30 

467 






skilled reprogramming) and that the object code for just the 
one particular program is 3.9K bytes as opposed to the 5 to 
6K bytes for the FORTH interpreter. I hardly consider it a 
saving to have a run time program be 4K bytes versus 5 or 
6K bytes if all it can do is one thing. It is even less of a saving 
if you need a prior overhead of 16K just to achieve that saving. 

Again the issue of space is becoming rapidly a non-issue 
and the fact that the run time program is 4K or 6K becomes 
totally irrelevant. 

It is interesting to note that the number of symbols that 
the user has to key in to produce the polynomial illustrated 
“5X **2— 7X—10 ” is approximately the same in both 
FORTH and SAM76 as illustrated below: 

FORTH:POLY DUP DUP * 5 *SWAP 7 * -10-; 

SAM76 %dt,POLY, !%su,%su,%mu,5,%mu,X,X,//, 
%mu,7,X//,10/// 

For the purpose of clarity the content of the SAM76 language 
text named POLY is analyzed as follows: 

%su,%su,%mu,5,%mu,X,X, //,%mu,7,X//, 10/ 

t X 2 —^ t t 1 

Lsx 2 ---1 l_ 7X —I 

-5X 2 — 7X- 

-5X 2 —7X—10- 

Admittedly SAM76 is not primarily intended to be a 
scientific or mathematical language, but it is powerful enough 
to simulate a substantial portion of APL in about 600 bytes of 
user defined procedures. The interpreter requires approx¬ 
imately 8K bytes of Z80 code and this can be reduced, 
without reprogramming, by about 300 bytes at a cost of 75 
microseconds per subroutine call (2 megahertz clock system). 

It should be noted that the philosophy underlying the 
implementation of the SAM76 language required the pro¬ 
vision of a very rich resident function set —approximately 
150—explaining the fact that the interpreter is significantly 
larger than required by FORTH. 

Cordially, Box257 RRl, 

Ancelme Roichel, Pennington, NJ 08534 

Descriptions and updates of the SAM76 language may be 
found in IEE Computer Society Repository, Dr. Dobbs' 
Volume 3, Issue 1, 3, 6 and 8. A good beginner’s tutorial 
appears in Creative Computing (May-June) and (Sept-Oct) 
1978. 


FORTH/STRUBAL REBUTTAL 

Greetings: Received: 78 Sept 22 

I enjoyed Robert Grappel’s response to my FORTH article. 
His language STRUBAL looks like a good piece of work, a 
strong candidate to replace BASIC or FORTRAN on small 
machines. But I question his comparisons of STRUBAL 
and FORTH. 

Let’s start where STRUBAL is strongest—clarity and 
understandability of programs. I admit that for small programs 
like the LIFE example which Mr. Grappel re-wrote, 
STRUBAL is clearer than FORTH—to programmers oriented 
to BASIC or FORTRAN. But since STRUBAL evidently 
isn’t extensible, somebody reading STRUBAL sees the primi¬ 
tive statements-FOR, NEXT, STRING, PRINT, XTRACT, 
etc.—no matter how large the application. In contrast, a large 
FORTH program defines an application-oriented vocabulary 


—and if it’s documented, the user seldom or never has to look 
at the source code of those definitions. A brief description of 
what each one does, plus a list of arguments in and results 
out, is enough. A STRUBAL programmer always goes back 
to the statements of the original language, while a FORTH 
programmer can use large or small chunks of previous work, 
interchangeably and with no separate subroutine protocols, 
linking loaders, or trouble with name conflicts. And FORTH 
is structured, with no GOTO and no statement labels in the 
system. 

Of course any extensible language puts more responsibility 
on the application communities to develop reasonable standards 
and to avoid useless idiosyncracy. There is more incentive for 
communication. Is this a problem, or an opportunity? 

Mr. Grappel pointed out that his LIFE program in 
STRUBAL took less time to develop than Boulton’s 
FORTH version of LIFE which appeared in my article. But 
most of Boulton’s time was spent on the word “ARRAY,” 
which is a special kind of operation (a “defining word”) 
which creates a new data type. Most FORTH systems come 
with ARRAY already defined (and now Boulton’s has it too). 
STRUBAL also has an array type available, but if a new data 
type were needed, it would take some time indeed to define 
it (by changing.the compiler). 

STRUBAL is a little faster than FORTH when speed 
doesn’t count. When it does, critical sections such as inner 
loops can be re-written using FORTH’s assembler, to run at 
full machine speed. FORTH interfaces so naturally to machine 
code that the user doesn’t need to know which operations 
are code and which are higher-level; except for speed it’s 
transparent. And the higher-level is fast enough that code 
is seldom necessary; higher-level FORTH overhead is com¬ 
monly 30 percent over machine code (on 16-bit stack-type 
machines and more like 100 percent on 8-bit micros). FORTH 
executes an indirect threaded code which should not be con¬ 
fused with usual interpreters which are ten or more times 
slower than code. 

And now for compactness. Indeed it’s true as Mr. Grappel 
showed that both systems take about the same space to run 
that little LIFE example (1888 bytes for STRUBAL vs. 
475 for FORTH, but 3.9K for the STRUBAL run-time 
package, and 5 to 6K for the entire FORTH system, which 
usually stays in memory at run time). However if you multiply 
the size of the project by 50, you get 97K for STRUBAL 
vs. 30K for FORTH. And FORTH would probably compare 
even better than this, because programming is in increasingly 
larger chunks as the application grows, and each invocation of 
any chunk (regardless of its size) takes two bytes. 

FORTH (like STRUBAL) is supposed to use a floppy, 
but recently I played with a stripped-down version which 
uses no external storage except an ordinary cassette. This 
bare-bones FORTH has no assembler and no editor—it resides 
in 3.8K bytes, running stand-alone except for a ROM monitor 
which handles reading and writing of the cassette, and I/O 
for single characters (which FORTH could do, but it uses the 
monitor since it is available). While I wouldn’t want to develop 
a major project on this little system, it’s remarkable how 
conveniently it does work. You load the cassette (about 20 
seconds), then type in and run FORTH source statements. 
As soon as each statement is typed, it is ready to run, as it 
compiles while being typed. With no disk or editor, if you 
make a mistake and don’t discover it until after a carriage 


Number 30 

468 


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


Page 45 



return, you have to re-type the whole statement (which is 
short, seldom over three lines). FORTH debugging is excep¬ 
tionally thorough, because the statements are short and mod¬ 
ular. Without the editor, when bugs are discovered the state¬ 
ment must be typed over; and worse, on those rare occasions 
when a statement way back in the program must be changed, 
all later statements which refer to it must also be retyped, 
or they will continue to refer to the old definition. This is 
why you want a floppy and an editor. 

After developing some definitions, you can ‘FORGET’ 
early scratch work back as far as desired, re-type what is 
necessary (e.g. your new utilities, color graphic operations, 
or other applications), then save the whole system on a new 
cassette. Next time it will take a couple extra seconds to load 
the tape, with perhaps a few hundred more bytes, and your 
new language is ready. There is no line where the FORTH 
system ends and your applications begin—the whole language 
(including your programs) is homogeneous. 

Later when I do get a floppy for this machine, this little 
bit of FORTH will grow into a full professional development 
system, just by having three or four pages of FORTH source 
code (for an assembler, floppy I/O, and a text editor) typed 
in. 

Sincerely yours, 1090 Miller Ave. 

John S. James. Berkeley, CA 94708 

For more information on FORTH, see Forth Dimensions, 
the newsletter of the Forth Interest Group, 787 Old County 
Rd., San Carlos, CA 94070. Subscriptions are $5. for issues 
one through six. 

ASTRONOMY APPLICATION FOR PET FORTH 

Dear Tom: Received: 78 Sept 11 

After reading Robert Grappel’s letter (No. 28, page 28) 
comparing FORTH and STRUBAL, I felt that my experience 
with FORTH might be of interest to some of your readers. 
Although I had been vaguely aware of FORTH for some years, 
I had never had the opportunity of trying it out until Pro- 
gramma Consultants (3400 Wilshire Blvd., Los Angeles, 
CA 90010) made it available for the PET 2001. I’ve had 
their PET-FORTH version 1.0 for two weeks now and I find it 
to be an ideal language for my needs. 

I am currently building microprocessor systems for astro¬ 
nomical data acquisition and analysis. For this application I 
must be able to control custom I/O interfaces and other hard¬ 
ware. My machines must be physically small and inexpensive, 
so large memory and mass storage devices are undesirable. 
It must be possible to design code that results in simple and 
yet flexible user interfacing. Easy program modification and 
testing are essential since much of the program expansion 
takes place during (hopefully short) periods of cloudiness 
at the telescope. FORTH, with its resident interpreter, 
compiler, and assembler, meets my needs perfectly. I can write 
a line of code to operate an external device and then immed¬ 
iately execute that code to see what happens. Since my 
debugging involves hardware problems as well as software 
problems, separate passes to compile, then execute would be 
inconvenient. 


Since FORTH code runs at almost full machine speed 
(the 100% penalty generally quoted for microprocessors 
refers to general FORTH code, not tightly coded inner loops), 
I have had no trouble coding clock routines etc. where timing 
is important. Several comparisons of FORTH’s speed versus 
BASIC’s speed in the PET have yielded ratios of x 9 to x 18 
(but BASIC was working to ten decimal digits accuracy, 
FORTH only to five digits). 

The real advantage of FORTH, however, lies in its essen¬ 
tial function of defining the vocabulary of a special purpose 
dictionary. I can define dictionary entries which carry out the 
various basic functions of the telescope and data system. 
The user can then use the FORTH machine as a programmable 
calculator with the equivalent of many special function com¬ 
mands. As an example, the following code might point the 
telescope at a specific position (right ascention -RA- and 
declination -DEC-), select a blue filter, take data for 10 
seconds, and record that data. 

12 33 26 RA= -21 33 06 DEC = POINT 
BLUE FILTER 10 SECS TAKE DUP DAT A = RECORD 
In this example I use previous FORTH definitions to store 
the coordinates, activate the telescope positioning motors, 
push the filter number of the BLUE Filter on the stack, output 
that filter number, set up a data integration time, digitize the 
data, store it at the next location in the array DATA, and 
finally output it to the recorder. Although the definitions of 
these functions might not be “readable,” I think most would 
agree that the final code used by the observer is very readable. 
For my purposes definition readability is much less important 
than this ability to define a logical and simple vocabulary for 
the user. Even the best observer tends to become a bit mud¬ 
dled at 3 AM on a cold, partly cloudy night and I want to give 
him as much help as possible. Although STRUBAL or other 
languages could have been used to program a series of prompts 
(“RA?”, “DEC?”, “FILTER?”), this would “lock in” the 
exact sequence of operations. FORTH gives me the flexibility 
to set up a variety of operations, repeat them, and change 
them as I choose. 

I don’t think it is necessary to comment at any length on 
specific points of Mr. Grappel’s letter, but I would like to 
make the following points: 

1. His first example of the difficulty of reading FORTH 
(the POLY definition) essentially comes down to the old 
argument of postfix versus infix operators. Some like one 
(and buy HP calculators), some like the other (and buy 
TI calculators). 

2. The comparison of a 3.9K run-time STRUBAL package 
with the full 5 — 6KFORTH package is unfair. Using the 
cross-compile option of FORTH would result in a run¬ 
time FORTH package of less than IK bytes for this pro¬ 
gram. 

3. I doubt that STRUBAL would run “much faster” than 
FORTH since optimum machine language code could only 
run twice as fast as FORTH. 

To close, STRUBAL looks like an excellent choice for the 
BASIC programmer who wants to move up to a compiled 
language, but for me FORTH looks much more useful. 

Sincerely, Department of Physics & Astronomy 

John P. Oliver University of Florida 

Associate Professor of Astronomy. Gainesville, Florida 32611 


Page 46 


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


Number 30 

469 



QUESTIONS - AND ANSWERS - ON DATA 
TRANSFER 

Dear Mr. Pugh: Received: 78 Aug 21 

First let me say how much I appreciated your article in 
Dr. Dobb’s Journal, No. 26. Your article provided a great 
deal of information in a field in which I am just now getting 
started. Toward this end, I have subscribed to the PCNET 
Committee publications recently. I also plan to start attending 
their meetings in this area. 

Right now I am putting together a disc system using a 
Tarbell board and a couple of drives. As soon as I have this 
system operating, I plan to obtain your program from the 
CP/M User’s Group. 

All the above gives some background for the questions I 
am about to ask: What is the reason for having to operate 
the system at a baud rate half of that of the terminal console? 
How can this limitation be overcome? I would like to operate 
at a baud rate at least of 300. 

In connection with your discussion of losing data during 
file transfers, I anticipate even more trouble than you have had 
because from the documentation I have, my head will unload 
after only 2 revolutions (I am using Shugart 800 drives). I do 
not know yet how I will solve this difficulty. 

Very truly yours, 1096 W. Remington Dr. 

Robert L. Edens Sunnyvale, Calif. 94087 

Dear Mr. Edens: 

I am glad to see you plan to join the PCNET as I believe 
the more participation it receives the more effective it will 
become. 

As to the questions you raised in your letter, I am afraid 
I did a very superficial job in explaining system timing. The 
following discussion may be helpful in clarifying this. 

1. If communication is taking place between two personal 
computers with each operating at 300 Baud (Modem rate) 
and each transmitting via the keyboard, there should be 
no data lost even if a 110 Baud terminal is being used as 
console device for one of the computers. This is so because 
it is only the character burst rate that occurs at 300 Baud. 
In order to cause the true data rate to be 300 Baud, the 
operator with the fast console device would have to type 
at a rate of 300 words per minute—where a word consists 
of 5 letters and a space on average. 

2. If a large time sharing computer is communicating with a 
personal computer at 300 Baud and the console device of 
the personal computer (PC) uses a 300 Baud printing 
terminal as console, some data will probably be lost. This 
is because the TSC outputs a line at a time and usually 
transfers it at the maximum rate allowed by its modem 
device. At the PC end of the communications, some delay 
is inserted between the receipt of data by the computer 
and the relay of this data-on a character by character 
basis—to the console device. This is caused by the time 
taken to execute the instructions necessary to input/output 
the data and, perhaps more time consuming, check the 
status of each I/O device (the modem and console respect¬ 
ively) to see if they are ready for a data transfer. This time 
delay builds up with each character transmitted if the con¬ 


sole is only capable of 300 Baud operation. If the data 
string is sufficiently long, data loss will occur. If the console 
device were capable of transfering data at 600 Baud then 
both the computer and the console would be “twiddling 
their thumbs” while waiting for receipt of the next charac¬ 
ter. 

Perhaps this answers the question as to why the system 
(modem) must operate at a baud rate half that of the 
terminal console. Of course there is no problem if the 
console is operating at a baud rate significantly higher 
than the modem rate, e.g., modem.rate=300 Baud; console. 
rate=9600 Baud. Further, choosing a ratio of 2 to 1 is 
really an oversimplification. The real value is somewhere 
between 1 to 1 and 2 to 1.1 can only say that my printing 
terminal successfully copied data at a rate of 150 Baud 
while it was operating at 300 Baud. However, it would 
not copy data reliably if its rate were set equal to the data 
rate. 

As to the question of data loss during file transfer. No 
data loss will occur when your PC is transmitting files 
since it does so “in its own good time.” However, when 
you are receiving a file, it is the guy at the other end who 
determines the rate, i.e., whether the data is passed through 
the modem at its maximum rate or whether there is a 
certain amount of “dead time” between characters or 
groups of characters. The following approaches can be used 
to overcome this problem: 

3. At 300 Baud each character requires a minimum of 30.3 
msec time, i.e., (30.3 msec/Character ==> (30.3 sec)/(lK 
characters). Thus, it takes approximately 1 minute to trans¬ 
fer 2K characters. If, instead of writing each block of 
128 characters out to disk as soon as the data block is 
accumulated, one were to buffer (save) the data in memory, 
one could buffer 15 minutes of data with 30K of memory. 
The data could then be recorded on disk. Thus, by breaking 
up the data to be transferred into manageable “time slices” 
one could transfer a large file without data loss. 

4. If communication is occuring between computers which 
adhere to the PCNET protocol (or some similar protocol) 
then a file can be received without data loss. As in (3) 
above, memory buffering in excess of 128 characters (bytes) 
is required. However, the amount of buffered data is small 
compared to the above approach. Under the PCNET 
protocol, data is transmitted in block format with the data 
content of each block being 0-253 bytes. To keep things 
simple, assume block size=256 bytes. The receipt of each 
block must be acknowledged although up to four blocks 
may be transferred before receipt of the first block is 
acknowledged. If no acknowledgement (ACK) is sent, 
the sender goes idle and awaits ACK before transferring 
more data. Thus, a data buffer of IK BYTES (4*256 
BYTES) is sufficient to assure no data loss. The data thus 
buffered can be written to disk before the sender “times 
out” and breaks off communications. Following the trans¬ 
fer of data to disk, the ACK for each of the four data 
blocks can be sent to the sender resulting in the restart 
of data transmission of the remaining data, etc. 

5. If one is communicating with a TSC which does not 
provide for PCNET protocol and one can not afford to set 
aside a large buffer as in (3) above, then he may achieve 
the desired result by using interrupt processing and double 


Number 30 

470 


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


Page 47 



buffering. Thus if one had an IMSAI PIC-8 board or simi¬ 
lar interrupt handling board and a DMA floppy disk con¬ 
troller he could force an interrupt each time data was avail¬ 
able from the modem and store it in one of the two buffers 
allocated for data storage. When the first buffer became 
full the incoming data would be stored in the second buffer 
while the contents of the first buffer were written to 
disk. Each buffer could have a size equal to one physical 
disk record (128 bytes). Thus, only 256 bytes of memory 
is needed to implement double buffering. 

It may be possible to perform interrupt processing without 
a DMA controller for the floppy disk but I have not yet 
figured out how to do it. Consider that whereas it takes only 
4.1 msec to transfer one physical record (128 Bytes) to 
disk—assuming a 250K bit data transfer rate; the total time 
required may be much longer. This is because the time be- 
ween blocks is sufficiently long to assure that the head has 
“unloaded.” Thus, it takes 35 msec to load the head and an 
average of 83 msec to reach the desired sector—one revolu¬ 
tion of the disk takes 166.6 msec. Thus, 118 msec may be 
required before writing can begin. Since the microprocessor 
must be ready to control the writing of each data byte, it must 
wait for the instant that the sector has been reached and 
immediately begin data transfer. This assumes that the read/ 
write head is already positioned at the proper track. Since at 
300 Baud each character takes 30.3 msec one will “drop” 
3 to 4 characters on average while attempting to write a 
record to disk. 

Sincerely, 9655-M Homestead Court 

Tim J. Pugh, Jr. Laurel, Md. 20810 

Phone:(301) 776-5253 


LAST CHANCE ON DG TV READOUT CARD 

Dear Dr. Dobbs: Received: 78 Sept 13 

It has come to my attention that The Digital Group has 
discontinued production of Dr. Suding’s 16 by 32 TV Read¬ 
out Card. They still have on hand approximately fifty printed 
circuit cards which they are selling for $15.00 a piece. 

This video card has some very nice features: parallel inter¬ 
face to the computer for fast update, on board memory, 
use of the Motorola MCM 6571 pre-programmed character 
generator (there are ten different ones to choose from) and 
the card connects easily to a television set via an RF mod¬ 
ulator (Pixe-Verter #PXV-2A) and a 72 ohm to 300 ohm 
transformer (Radio Shack). I use a wire-wrapped version 
which is connected to a 12 inch Sony and I get an excellent 
picture. If you decide to purchase the card be sure to get the 
5.990 MHz crystal at $4.95 and the schematic and circuit 
description DOC TVC-1-R1 for $1.50. Altogether you 
shouldn’t have to spend over $80.00 for the card and parts, 
not counting the RF modulator and the 72 ohm to 300 ohm 
transformer. A good buy, considering you also get the printed 
circuitry for the Suding 1100 Baud Casette Interface on the 
same card. I would recommend a couple of modifications. 
Capacitors Cl, C2, C3 and C4 should be changed from Mylar 
to Mica. My board works better without capacitor C4. If you 
wish to use the white rectangle for a cursor rather than the 
underline, the least significant data line must be inverted by 
inserting a 7400 NAND gate between pin connector 8 and 


IC 22. IC 22 must be changed from a 7430 to 74H30. This 
makes the card home up on octal 376 and frees the white 
rectangle for use as a cursor. 

The enclosed program is a general keyboard input program 
with video echo and utilizes a software-controlled cursor. 
If you do not invert the LSB, byte 075 must be changed from 
177 to 137 and byte 174 from 376 to 377. The various sub¬ 
routines contained within the program are screen clear with 
cursor at home-up position, back space, carriage return, 
up one line and down one line. If you use a status bit with 
your keyboard, a call to your own input routine should be 
inserted at 011. 

Sincerely, 12012 Pebblebrook Lane 

Don Woods. Carmel, Indiana 46032 

P.S. 

1. There are two obvious errors in the schematic. Line 4 of 
IC 29 and line 4 of IC 9 do not connect to the five plus line. 
Oddly enough the same mistake appears in the schematic 
for DG’s 1024 Character TV Readout, IC 13 and IC 3. 

2. Prime parts can be obtained from Jameco Electronics. 
Good prices and fast service except for their 22/44 printed 
circuit edge card connector. Stick with Vector, Cinch or 
TEKA. 


000 

061 

111 

hhh 

LX I SP 


SET STACK 

003 

315 

152 

100 

CALL 


CALL CLRSC 

006 

315 

140 

100 

CALL 


CALL TVDSP1 

Oil 

000 



NOP 



012 

333 

004 


IN 

KYBRD 

IN PORT 4* 

014 

346 

177 


AN I 


MSB EQU 0 

016 

303 

362 

100 

JMP 


JIMP TO KYBRD PATCH 

021 

376 

015 


CPI 


COMPARE RETIRN KEY 

023 

314 

217 

100 

cz 


CALL CRLF 

026 

376 

137 


CPI 


COMPARE BACK SPACE KEY 

030 

314 

241 

100 

cz 


CALL BKSP 

033 

376 

012 


CPI 


COMPARE LINE FEED KEY 

035 

314 

152 

100 

cz 


CALL CLRSC 

040 

376 

025 


CPI 


COMPARE CONTROL U 

042 

314 

271 

100 

cz 


CALL IP 

045 

376 

004 


CPI 


COMPARE CONTROL D 

047 

314 

303 

100 

cz 


CALL DWN 

052 

376 

000 


CPI 


OTHER DATA THAN CONTROL ? 

054 

304 

140 

100 

CNZ 


CALL TVDSP1 

057 

303 

Oil 

100 

JMP 


JMP BACK TO KYBRD 

062 

076 

040 


MV I A 


LOAD A WITH BLANK 

064 

366 

200 


OR I 

TVNC 

SET MSB HIGH 

066 

323 

003 


OIT 


OUT PORT 3* 

070 

257 



XRA A 


CLEAR A 

071 

323 

003 


OUT 


TIRN OFF STROBE* 

073 

311 



RET 


RETIRN 

074 

076 

177 


MV I A 


LOAD A WITH WHT RECTANGLE 

076 

315 

064 

100 

CALL 


CALL TVNC 

101 

311 



RET 


RETIRN 

102 

257 



XRA A 

TRIGR 

CLEAR A 

103 

107 



MOV B,A 


CLEAR B 

104 

074 



INR A 


LSB EQU 1 

105 

315 

066 

100 

CALL 


CALL TVNC PL IB 2 

110 

005 



DCR B 


DECRE?.£NT B 

111 

302 

104 

100 

JNZ 


JIMP BACK IF NOT DONE 

114 

005 



DCR B 


DECREMENT B 

115 

074 



INR A 


LSB EQU 1 

116 

315 

066 

100 

CALL 


CALL TVNC PLUS 2 

122 

005 



DCR B 


DECREJENT B 

123 

302 

115 

100 

JNZ 


JllJP BACK IF NOT DONE 

125 

311 



RET 


RETIRN 

126 

315 

102 

100 

CALL 

CIRSR 

CALL TRIGR 

131 

315 

074 

100 

CALL 


CALL WHT RECTANGLE 

134 

315 

102 

100 

CALL 


CALL TRIOR 

137 

311 



RET 


RETIRN 

140 

315 

176 

100 

CALL 

TVDSP1 

CALL TVDSP2 

143 

315 

062 

100 

CALL 


CALL BLANK OIT 

146 

315 

126 

100 

CALL 


CALL CIRSR 

151 

311 



RET 


RET 

152 

001 

002 

000 

LX I B 

CLRSC 

LOAD BC WITH COINT 

155 

315 

062 

100 4 * 

, CALL 


CALL BLANK OUT 

160 

005 


DCR B 


decrement b 

161 

302 

155 

100 

JNZ 


JllIP BACK IF NOT DONE 

164 

015 



DCR C 


DECREMENT C 


Page 48 


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


Number 30 

471 



100 


165 

302 

155 

100 

JNZ 


JIMP BACK IF NOT DONE 

170 

076 

040 


MV I A 


LOAD A WITH CRLF COINT 

172 

127 



M0VD ,A 


SAVE COINT 

173 

076 

376 


MV I A 


LOAD A WITH HOME BYTE 

175 

311 



RET 


RETURN 

176 

366 

200 


OR I 

TVDSP2 

SET MSB HIGH 

200 

323 

003 


OUT 


OUT PORT 3* 

202 

257 



XRA A 


CLEAR A 

203 

323 

003 


OUT 


TERN OFF STROBE* 

205 

315 

212 

100 

CALL 


CALL CNTCHK 

210 

025 



DCR D 


DECREMENT COINT 

211 

311 



RET 


RETURN 

212 

272 



CMP D 

CNTCHK 

COMPARE COINT 

213 

300 



RNZ 


RETIRN IF NOT ZERO 

214 

026 

040 


MV I D 


LOAD D WITH COINT 

216 

311 



RET 


RETIRN 

217 

315 

062 

100 

CALL 

CRLF 

CALL BLANK OUT 

222 

000 



NOP 



223 

074 



njR a 


LSB EQU 1 

224 

315 

066 

100 

CALL 


CALL TVNC PLUS 2 

227 

025 



DCR D 


DECREMENT COINT 

230 

302 

223 

100 

JNZ 


JIMP BACK IF NOT DONE 

233 

026 

037 


MV I D 


LOAD D WITH COINT 

235 

315 

143 

100 

CALL 


CALL TVDSP1 PLUS 1 

240 

311 



RET 


RETIRN 

241 

315 

062 

100 

CALL 

BKSP 

CALL BLANK OUT 

244 

315 

102 

100 

CALL 


CALL TRIGR 

247 

315 

126 

100 

CALL 


CALL CIRSR 

252 

024 



3NR D 


INCREMLNT COINT 

253 

076 

041 


MV I A 


LOAD A WITH D CNT PL IB 1 

255 

272 



CMP D 


COMPARE A WITH D 

256 

302 

264 

100 

JNZ 


JIMP IF SAME 

261 

076 

001 


MV I A 


LOAD A WITH 1 

263 

127 



MOV D,A 


SET D COINT TO 1 

264 

257 



XRA A 


CLEAR A 

265 

311 



RET 


RETURN 

266 

000 



NOP 



267 

000 



MOP 



270 

000 



NOP 



271 

315 

062 

100 

CALL 

IP 

CALL BLANK OUT 

274 

315 

315 

100 

CALL 


CALL IP 32 

277 

315 

126 

100 

CALL 


CALL CIRSR 

302 

311 



RET 


RETURN 

303 

315 

062 

100 

CALL 

DWN 

CALL BLANK OUT 

306 

315 

344 

100 

CALL 


CALL DWN 32 

311 

315 

126 

100 

CALL 


CALL CIRSR 

314 

311 



RET 


RETURN 

315 

325 



PUSH D 

IP 32 

SAVE COINT 

316 

257 



XRA A 


CLEAR A 

317 

001 

340 

000 

LX I B 


LOAD BC WITH COINT 

322 

074 



INR A 


LSB EQU 1 

323 

315 

066 

100 

CALL 


CALL TVNC PLUS 2 

326 

005 



DCR B 


DECREMENT B 

327 

302 

322 

100 

JNZ 


JIMP BACK IF NOT DONE 

332 

074 



INR A 


LSB EQU 1 

333 

315 

066 

100 

CALL 


CALL TVNC PLUS 2 

336 

015 



DCR C 


DECREMENT C 

337 

302 

332 

100 

JNZ 


JIMP BACK IF NOT DONE 

342 

321 



POP D 


RESTORE COINT 

343 

311 



RET 


RETIRN 

344 

325 



PUSH D 

DWN i2 

SAVE COINT 

345 

257 



XRA A 


CLEAR A 

346 

006 

040 


MV I B 


LOAD B WITH COINT 

350 

074 



INR A 


LSB EQU 1 

351 

315 

066 

100 

CALL 


CALL TVNC PL IB 2 

354 

005 



DCR B 


DECREMENT B 

355 

302 

350 

100 

JNZ 


JIMP BACK IF NOT DCNE 

360 

321 



POP D 


RESTORE COUNT 

361 

311 



RET 


RETURN 

362 

376 

033 


CPI 

PATCH 

COMPARE 

364 

312 

XXX 

XXX 

JZ 


JIMP TO MONITER 

367 

303 

021 

100 

JMP 


JIMP BACK TO KYBRD 

372 

000 



NOP 



373 

000 



NOP 



374 

000 



NOP 



376- 

000 



NOP 



377 

000 



NOP 




*MIET BE CHANGED TO CONFORM TO USERS CWN PORTS 


LEDIP AVAILABILITY 


the published version (Version K4). The reduction in code was 
achieved by deleting the LINE REPLACE/AD JUST routines 
and using the LINE DELETE and LINE INSERT routines to 
achieve the same result. The penalty for this code reduction is 
a loss in speed which becomes apparent when editing large 
amounts of text. Apart from this difference, the two versions 
are completely compatible. In fact, the LEDIP user need not 
be aware of this difference. 

Version K6 source listing is available for $4.50. LEDIP 
manual with sample runs and hex dump is available for $3.00. 
LEDIP hex paper tape or KIM hypertape cassette (on user’s 
cassette) is available for $2.50. The 6502 Program Exchange, 
2920 Moana, Reno, NV 89509 can be contacted for more 
information. Thanks. 

Sincerely yours, 

Kiumi Akingbehin Wayne State University 

Computer Science Department Detroit, Michigan 48202 



SUMMER 1979 COMPUTER SCIENCE 
SPECTACULAR 


Received: 78 Sept 14 

The Summer 1979 Institute in Computer Science at the 
University of California, Santa Cruz, U.S.A., will feature two 
major programs—an advanced course on Computing Systems 
Reliability to be offered July 9-20, and a symposium on 
Programming Methodology to be held in August. 

Programming Methodology features 25 of the world’s 
leading figures in computer science including Edsger W. 
Dijkstra, Burroughs Corporation, The Netherlands; David 
Gries, Cornell University, U.S.A.; Donald Knuth, Stanford 
University, U.S.A.; C.A.R. Hoare, Oxford University, England; 
O.J. Dahl, University of Oslo, Norway; J.J. Horning, Xerox 
PARC, U.S.A.; Niklaus Wirth, Institut fur Informatik, ETH, 
Zurich, Switzerland; W. M. Turski, Warsaw University, Poland; 
and William McKeeman, University of California, Santa Cruz. 
The symposium is three weeks in length. Participants may 
attend one, two or three weeks of the program. 

Computing Systems Reliability will be presented by Brian 
Randell, University of Newcastle upon Tyne, England, and a 
dozen renowned lecturers. 

For information, write to Institute in Computer Science, 
University of California Extension, Santa Cruz, California, 
U.S.A. 95064. 


Dear Tom: Received: 78 Sept 6 

Your readers might be interested in the following additional 
information regarding LEDIP, the KIM/6502 text editor. 

Version K6 of LEDIP is available from The 6502 Program 
Exchange. Version K6 occupies less memory (116 bytes) than 


COMPUTERS IN THE HUMANITIES 

Received: 78 Sept 10 

The Fourth International Conference on Computing in 
the Humanities will meet August 19-22, 1979, at Dartmouth 


Number 30 

472 


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


Page 49 




College. Papers on any topic involving computing in the 
humanities will be considered for presentation. Languages of 
the conference will be English, German, and French. AB¬ 
STRACTS of 500 to 1000 words should be submitted by 
December 1, 1978; acceptances will be announced by April 
1, 1979. For further information, contact Stephen V. F. 
Waite, Chairman, ICCH/4, Kiewit Computation Center, Dart¬ 
mouth College, Hanover, New Hampshire 03755. 


BAY AREA 

A users group for Heath owners will be starting in the San 
Francisco Bay Area. Contact Bob Bance, 218 Roble Ave., 
Redwood City, CA 94061. 



Z USERS GROUP FORMED 

The formation of a Users Group for users of the Z-8, Z-80, 
Z-8000, Mostek 3880, and other microprocessors in the same 
family, to be called the “Z Users Group,” was announced by 
Jon D. Roland, its organizer. 

Roland called for contributions to the newsletter that the Z 
Users Group will publish, including systems and applications 
software, interfacing problems and solutions, evaluations, 
extensions, and modifications to products based on these 
chips, criteria for selecting chips for various applications, 
proposed Z-8000 bus standards, benchmark programs, ideas 
for features in future chips in this family, and information on 
new products, suppliers, software available, and interesting 
applications. The Z Users Group will be independent of Zilog, 
Inc., Mostek, or any other producer or user of Z-chips. 

One project Roland hopes to get support for is a group 
purchase of Z-8000 chips, so that members can get some 
of the first chips at reasonable prices for evaluation and devel¬ 
opment. The address of the Z Users Group is 1015 Navarro, 
San Antonio, Texas 78205. (512)222-1427. The dues are 
$5.00 per year. 



CLEVELAND DIGITAL GROUP 

Received: 78 Sept 1 

The Cleveland Digital Group meets the third Sunday of 
every month at 2 p.m. The CDG clubhouse is located 100 
feet east of Broadway Ave. at 8700 Harvard Ave., Cleveland, 
Ohio 44105. 


TRACE 

The Toronto Region Association of Computer Enthu¬ 
siasts, Box 545, Streetsville, Ontario L5M 20 Canada, 
are assembling a list of certain of their members who are 
willing to assist other members with hardware and software 
questions in exchange for whatever the two parties can agree 
on. Their newsletter, TRACE also contains a helpful question 
and answer column. 


PAPER STRIKE HITS HOME 

Due to a long-term strike in the paper industry which 
has been going on since Spring, we have not been able to 
obtain our usual quality of paper and are forced to print 
this issue of Dr. Dobb’s on lower quality paper. It is very 
embarrassing to have to raise the price of the magazine and 
then not be able to maintain the physical quality due to 
an industry-wide shortage. We understand that there are 
good prospects for a settlement soon, but that does not 
mean an immediate end to shortages. We will, of course, 
go back to our regular paper as soon as humanly possible, 
but in the meantime we must ask our readers to bear with 
us. —Tom Williams 


Page 50 


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


Number 30 

473 



















Index 


This is an index to articles and programs, but some letters have also been indexed. References are of the form 
issue number/page numbers. Those in normal type are references to programs. References separated by a 
comma are connected in some way; those separated by a semicolon are completely distinct. Unless otherwise 
marked, a program is in assembly language. Except for author entries the processor type is marked or clear from 
the context. In general, a program can be found by author, processor type, and program type. 

The following table gives the correspondence between month/year and issue numbers. 


Vol 1 - 1976 Vol2- 1977 Vol 3 — 1978 


January 

1 

11 

21 

February 

2 

12 

22 

March 

3 

13 

23 

April 

4 

14 

24 

May 

5 

15 

25 

June/July 

6 

16 

26 

August 

7 

17 

27 

September 

8 

18 

28 

October 

9 

19 

29 

November/December 

10 

20 

30 


1802. see COSMAC 
6502 

arithmetic 

floating-point 7/17-19, errata 10/57 
trig functions (extensions to KIMATH) 20/15-21 
article 

programming tricks 28/29 
cassette interface 27/31 -33 
disassembler 8/22-25 

(BASIC) 21/6,errata 23/3, 27/39 
games 

lunar lander 7/22-25 
mastermind 8/26-27 
text editor 29/4-12 
utilities 

breakpoint routine 3/17-19, errata 8/33 
debugger 19/42-44 
memory test 17/23; 21/4-5 
monitor 7/20-21 

opcode decoder 17/20-22, 19/42-44; 22/5-7 
relocator 14/30-31 
string output 8/33, 10/50, 12/8 
see also Apple-ll; KIM-1; BASIC, tiny: Pittman 6502 

6800 

articles 

LISP 28/24-25 

SWTPC I/O control interface 17/35-37 
Resident Assembler 8/19-21 
programming tricks 6/19-10; 29/3 
disassembler 13/30-33 


8080 emulator 28/4-18 

GPM (macroprocessor) 20/22-29 

graphics 16/19-20 

interface to IEEE 488 bus 16/31 -55 

utilities 

display test 26/30 
memory clear 29/43 
memory test 5/9; 25/28-33 
timer routines 9/21 

see also SWTPC; BASIC, tiny: Pittman 6800 
8080 

arithmetic 

multi-precision 13/15-23 
expression evaluator 29/34-40 
articles 

BASEX (language) 30/26-31 + 

8080 emulator (on 6800) 28/4-18 
Intel - NEC chip differences 10/14-15 
programming tricks 6/9-10; 28/29 ; 29/3 
disassembler 12/30-43, 17/15 ; 21 /38-46; 27/4-18 

(BASIC) 13/25-29 
games 

button button 6/38-39 

chase (a dot) 10/58-59 

life 10/60; 24/10-11 

oops (line drawing) 9/30 

unizap (teaser) 5/10-11 

see also games: chase (by robots) 

graphics, see graphics: 8080 



languages 

ACT (macroprocessor) 24/27-46, (PL/M) 23/20-45 
BASIC, see BASIC 

CASUAL 10/19-32, 12 / 4 , 12 / 44-45 

KAPIAR (macroprocessor) 20/31 -59, errata 23/3 

LISP 30/4-11 

MINOL 4/9-17 errata 6/36, 7/32 
PILOT, see PILOT: 8080 
miscellaneous 4/5;8/12;8/18 
music program 2/6-7, 3/6, 8/32-33,16/21 
operating system 

Kernel 18/20-40 
text editor 6/13-26 
utilities 

backspace routine for display 19/18 
binary tree routines 30/15-17 
bootstrap 6/8 

compactor (for BASIC programs) 9/31 

debugger 9/26-29 

diskette copier (ISIS) 30/40-41 

disk file dumper (Northstar) 28/38-41 

drivers 

disk 12/12-17 
display 2/34; 30/48-49 
modem 26/4-16 
loader 3/16, 7/31 
memory 

clear 8/32-33 

dump 26/18-23;27/4-18; (vocal) 28/42-46 
test 8/32-33 
monitor 4/18-32 

reformator (for assembler programs) 6/10 
relocator 13/8-9,22/14-20 
sort (quicksort) 24/20 
status push/pop routines 29/3 
word processor 29/18-29 
see also H-8; Microsoft; Mits; Polymorphics; 

Processor Technology; SOL 

8086 

description of 27/19-21 


Abshire, Jim 10/52-53 

accounting program (BASIC) 19/36-41 

acoustic coupler, see modem 

ACT (macroprocessor) (PL/M) 23/20-45, (8080) 24/27-46 

Agoston, Max K. 18/20-40 

Akingbehin, Kiumi 29/4-12 

Alevy, Gary 12/28-29 

Alexander, Mark 10/34-50 

Allen, Dave 16/7 

Allison, Dennis 1/1-12;2/4-5; 13/34-35; 29/13-15 

Anderson, James 29/30-33 

Anderson, Ken 25/17-20 

APL. see also EMPL 

APL Core Project 17/18-19 

Apple-II (6502) 

utilities for BASIC 
renumber 23/4-9 
append 23/4-9 

erased program recoverer 26/31-33 
see also 6502, KIM-1 
arithmetic 

binary calculator (KIM-1) 23/13-15 
expression evaluator (8080) 29/34-40 (BASIC) 6/11-12; 
10/52-53 

floating-point (6502) 7/17-19, errata 10/57 
miscellaneous functions (BASIC) 29/13-15 
multi-presicision (8080) 13/15-23 


square root routine (algorithm) 13/23 
trig functions (extension to KIMATH) (6502) 20/15-21 
see also number systems: conversions 
Armstrong, Arthur 19/28-29 
Arnold, John 1/13-17, 2/13-31 
Arnold, Mark 2/8-12 
Assembler, 6800 Resident 
article on 8/19-21 


Barber, Jerry 11/8-62 
barcodes 14/36-43 
BASEX (language) 30/26-31 + 

BASIC 

criticisms of 2/4-5;30/18+ 
games in. see games 

LLL (Lawrence Livermore Labs) (8080) 11/8-62 
miscellaneous functions (BASIC) 29/13-15 
tiny 

design and history 1/1-12 

Denver (F.J. Greeb) (8080) 3/20-30, errata 8/34 

Palo Alto (Lichen Wang) (8080) 5/12-15, 6/35 

extensions 12/6-17; 15/6; 19/18; 26/34-141; 29/3 
Pittman 6502 

extensions 30/32-33 
Pittman 6800 

extensions 9/23; 12/5; 12/7 
Texas (Whipple/Arnold) (8080) 1/14-17; 2/13-31 
extensions 2/34; 6/34; 8/30-31 
see also CASUAL; FOCAL; MINOL; NIBL; SCELBAL 
and under manufacturer's names ' 

Baum, Allen 8/22-25 
Baunach, S.C. 16/31 -55 
benchmarks (BASIC) 15/8 
binary tree routines (8080) 30/15-17 
black box, computer as 14/34-35 
Boaz, Ray 5/9 

book reviews: 9/36; 11/15; 11/62; 14/46 

bootstrap (8080) 6/8 

Borgerson, Mark J. 7/29-30 

Boute, R.T. 22/46 

Bowles, Kenneth L. 23/16-19 

Bradshaw, Jack 7/20-21 

breakpoint routine (6502) 3/1 7-19, errata 8/33 
(KIM-1) 16/25-27 

Bridge, Theodore E. 20/12-13; 26/24-27; 30/12-14 
Britton, Keith 30/34-39 
Broom, J. 7/8-9 

Broucke, R. 16/12+; 16/13-14 ;16/1 7-19 
Buchanan, Martin 9/32-35, 10/54-55, 13/37 
bus 

IEEE 488 16/31-55 
S -100 7/8-9 ; 25/40-46 
STD 30/34-39 
business software 

accounting program (BASIC) 19/36-41 
calculator, see arithmetic 

calculator chip, interface to micro 1/18, errata 7/16 
cassette 

interface, modem as 10/7, 14/6-7, 19/5 
interface (6502) 27/31-33 
I/O (6502) 26124-27,29-41 
CASUAL (8080) 10/19-32, 12/4, 12/44 -45 
Cecil, Alex 23/20-45, 24/27-46 
CHAOS (operating system) 26/3, 27/3 
Chapman, David 30/18+ 

Christensen, Ward 12/30-43 
Cline. Arthur W. 23/11 -12 
Coats, Jack O. 3/16 


475 



codes & cyphers 7/12- 15. 8/35-36; 9/16-18; 12/9-10; 
(BASIC) 15/9 

Cohen, Harvey A. 13/12-13; 24/10-11 

Comer, Edward I. 12/11 

compactor (for BASIC programs) (8080) 9/31 

compiling, article on 25/4-16 

computer control of tape deck 8/3-6 

computer crime bill 28/36-37 

COSMAC (1802) 

article on 15/34-44 
utilities 

I/O, monitor, music, timer 19/30-35 
CPI 600 11/3+ 

CP/M (operating system) 4/5 
CRT. see display 

curve-fitting routine (FOCAL) 30/12-14 

Dahl, Aubrey 28/20-23 
Data-Boy™ (speech digitizer) 29/30-33 
data communication, see networks 
Dazzler, TV. see graphics: 8080: dazzler 
DEAFNET 17/10 
debugger 

for 6502 19/42-44 
for 8080 9/26-29 
for Z-80 24/12-18 
delivery delays, report on 19/6-9 
Denney,D. 7/8-9 
Dickenson, John 11/8-62 
Digicast Tl ^ Protect 29/16-17 
Dinely, M.G. 13/15-23 
disassembler 

for 6502 8/22-25; (BASIC) 21/6, errata 23/3, 27/39 
for 6800 13/30-33 

for 8080 1 2/30-43, 17/15; 21/38-46; 27/4-18 
(BASIC) 13/25-29 
for Z-80 (BASIC) 26/42-44 
disk, floppy 

diskette copier (8080/ISIS) 30/40-41 
file dump (8080/Northstar) 28/38-41 
interface and driver (8080) 12/12-17 
displays 

plans for display board 6/30-33 

ideas for 6/28; 10/8; 12/4; 15/17; 16/11 

utilities 

backspacer (8080)19/18 
driver (8080) 2/34; 30/48-49 
tester (6800) 26/30 
Dompier, Steve 2/6-7 

Eaton, John 20/15-21; 23/13-15 
Eckard, Royce 11/8-62 

EDITHA (machine-code editor) (6502) 25/34-39 

editor, machine-code 25/34-39 

editor, text, see text editor 

Elizondo, Ed 27/41 

Elliott, Dan 12/24 

Emerson, Richard B. 19/15-17; 26/18-23; 27/27-30 

EMPL 14/12-16; 16/11 

emulator (of 8080 on 6800) 28/4-18 

Espinosa, Chris 8/33 

expression evaluator, see arithmetic 

F8 

FD8 disk system, modifications to 18/44 
Ferguson, Mickey E. 12/7 
Finkel, LeRoy 7/36-37 

Fisher, Eugene R. 9/26-29; 11 /8-62; 12/12-17 
floating-point, see arithmetic 


FOCAL (FCL65E version) 30/12-14 

Formaniak, Peter G. 13/10-11 

FORTH 25/21-27; 28/26-27; 28/28, 30/44-46 

French, Gordon 22/22-39 

Fullmer, Howard 25/40-46 

Fylstra, David Jon 17/10 

Gabrielson, Mike 24/20; 27/19-21; 29/34-40; 30/15-17 
games 

acey-ducey (BASIC) 7/26-27 
button button (8080) 6/38-39 
chase 

(a dot) (8080) 10/58-59 
(by robots) for (8080/VDM) 15/10-17 
errata 19/20 
modifications 

impatient robots 16/30 
real time 17/26 
to Poly VTI 17/27-29 
proper credit 18/41 
rewrite for (8080/Dazzler) 22/30-41 
life 

(BASIC) 1/13; 16/12+ 

(8080) 10/60; 24/10-11 
(FORTH) 25/24 
(STRUBAL) 28/28 
further references 17/24 
lunar lander (6502) 7/22-25 
mastermind (6502) 8/26-27 
number guess (STRUBAL) 23/10 
oops (8080) 9/30 
slots (BASIC) 7/26-27 
stars (BASIC) 7/26-27 
teaser (brain teaser, unizap, shooting stars) 

(8080) 5/10-11; (BASIC) 7/29-30; 12/11 
tiny trek (MINOL) 6/37, errata 7/31 
trap (BASIC) 7/26-27 

zapp the moon man (CASUAL) 10/24; (BASIC) 12/24 
Garetz, Mark 7/22-25 
Gaugler, Gary 28/4-18 
Gerhold, George 27/46-47 

Gordon, H.T. 12/8; 17/20-22, 19/42-44; 22/5-7; 25/34-39; 
28/29 

GPM (macroprocessor) (8080) 20/22-29 
graphics 
6502 

GT6144 14/32; 30/32-33 
6800 

oscilloscope 16/19-20 

8080 

dazzler 19/21 -27; 22/22-29; 22/30-41 
P.T. VDM 8/28-29; 16/28-30; 18/8-19 
Poly VTI 13/12-13; 19/28-29; (BASIC) 16/17-19 
hardware 20/6-8; 26/41 
Graves, Rod 13/41-44 
Greeb, F.J. 3/20-30; 6/13-26 
Greenlaw, Richard 27/4-18 
Gruhn, David 12/9-10 

H-8 

bad review 19/10-13, retraction 21/3, parody 21/5 
reviews 20/9-11; 30/22-25 
Hahn. Harvey E. 3/15 
Hancock. Les 24/12-18; 27/22-26 
handicapped 16/4; 17/10; 18/7 
Happy Lady 1/5-10 
hardware 
new 

8080 floppy disk interface 12/12-17 
6502 programmable 1C tester 28/33-35 



hardware, new (cont.) 

homebrew TV display board 6/30-33 
modifications 

H-9, lower case 28/30-32 
I MSA I 

RAM-4A fix 3/6, 13/7 
memory clobberer fix: 8/17; 16/60 
VDM-1, fix 17/33-34 
TVT-11 

64 char/line & scrolling 12/25-27, 
proper credit 15/45, 
errata 16/56, 
extension 22/46 
64 char/line 12/28-29 
lowercase 16/57 
bell 26/47 

proposed 

segmented memory 12/11 
extended addressing 14/35 
Hayden, Russ 12/6-7 
Heath kit. see H-8 
Hertzfeld, Andy 26/31-33 
hexadecimal (or hex), see number systems 
HI, tiny 9/32-35. 10/54-55, 13/37 
Hicks, Bruce 16/21 
Hudson, David 16/19-20 
humor 8/17, 10/32; 14/44; 22/3 
Hutchinson, Perry C. 21/10-17 

1C tester, programmable (6502) 28/33-35 
IM6100 7/10 
I MSA I 

hardware fixes 

to RAM-4A 3/6; 13/7 
for memory clobberer 8/17; 16/60 
Intel-NEC chip differences 10/14-15 

index 

to The Computer Hobbyist 5/26-27 
interface 

cassette (6502) 27/31 -33 
floppy disk (8080) 12/12-17 
IEEE 488 bus (6800) 16/31 -55 
ISIS (operating system), analysis of 21/10-17 


James, John S. 25/21-27; 28/26-27; 28/36-37 
Julich, Paul M. 30/40-41 

KAPIAR (macroprocessor) (8080) 20/31 -59, errata 23/3 

Kee, Henry L. 9/23; 12/5 

Kelb, Carl 7/26-27 

Kendall, Bruce R. 16/22 

Kernel (operating system) (8080) 18/20-40 

Kheriaty, Larry 27/46-47 

Kildall, Gary A. 22/10-13 

KIM-1 (6502) 

breakpoint routine 16/25-27 
calculator, binary 23/13-15 
cassette I/O 25/24-27, comments on 29/41 
curve fitter (FOCAL) 30/12-14 
disassembler 20/12-13 
editor (for machine code) 25/34-39 
graphics routine 14/32 
programmable 1C tester 28/33-35 
see also 6502; Apple-11 
KIMATH (arithmetic routines) 

extension to (6502) 20/15-21 
Kushe, Willi 16/25-27 


language, interpretive 

for tiny BASIC 1/6-12 
language, programming 

comments on design of 3/7;3/15; 17/15 
Dijkstra's (hacked up) 19/19-20 
implementation ideas 17/16-17 
miscellaneous 30/78+ 
for robots (8080) 18/8-19; 25/17-20 
translation techniques 25/4-16 
see also ACT; APL; BASEX; BASIC; CASUAL; EMPL; 
FOCAL; FORTH; GPM; HI; KAPIAR; LISP; MINOL; 
NIBL; PASCAL; PILOT; SAM76; SCELBAL; 
STRUBAL 

Laughlin, Neils 19/19-20 
Laurer, G.J. 14/36-43 
law 28/36-37 

LAZARUS (erased program recoverer) (6502) 26/31-33 
LEDIP (text editor) (6502) 29/4-12 
linkage editor, see relocator 
LISP 

for 6800 28/24-25 
for 8080 30/4-11 
list processing 

article on 24/4-8 

LLL BASIC, see BASIC: LLL (Lawrence Livermore Labs) 
loader 

for 8080 3/16, 7/31 
for SC/MP 21/13 
Longtin, Brent 16/8-10 
LSI-11, interface to S-100 bus 11/3 

McCormick, Edward M. 19/30-35 
MacDougall, John 22/42-43 
machine-readable characters 15/45 
McKeeman, William M. 25/4-16 
macroprocessor 

ACT (8080) 23/20-45, 24/27-46 
GPM (6800) 20/22-29 
KAPIAR (8080) 20/31-59, errata 23/3 
SAM76 21/18-37;see also SAM76 
Marek, Larry A. 27/42-45 

MATHPAC (trig function routines): KIMATH extension (6502) 
20/15-21 

math programs, see arithmetic 
memory clearer 

for 6800 29/43 
for 8080 8/32-33 
memory dumper 

for 8080 26/18-23; 27/4-18; (vocal) 28/42-46 
(BASIC) 18/41 
memory tester 

for 6502 17/23; 21/4-5 
for 6800 5/9; 25/28-33 
for 8080 8/32-33 
for Z-80 22/42-43 
microcomputers 

in electronic toys 16/24 

microprocessor, see 6502; 6800; 8080; 8086; COSMAC (1802); 

CP 1600; F8; IM6100; PACE; SC/MP; Z-80 
microprocessor instructions, proposed 16760 
Microsoft BASIC 

renumbering program 27/34-38 
Mills, Jonathan W. 19/21-27 
MINOL (8080) 

documentation and code 4/9-17, errata 6/36, 7/32 
game 

tiny trek 6/37, errata 7/31 
Mits BASIC 

modification for two terminals 9/24-25 



modem 

as cassette interface 10/7, 14/6-7, 19/S 

driver 26/4-16, errata 27/43, comments 29/41-42 

reviews 

DC hayes board 20/5; 26/4-16, 27/43, 29/41-42 
IDS board 26/4-16, 27/43 
Pennywhistle 103 17/11-12, 17/13 
Monagan, James 22/8-9 
monitor 

for 6502 7/20-21 
for 8080 4/18-32 
for COSMAC (1802) 19/30-35 
Moody, Bob 16/15-16 
Morgan, David J. 24/22-25 
Mork, Phil 28/42-46 
Morrow, George 25/40-46 
Moser, Carl 21/4-5; 27/31-33 
Mueller, Erik T. 4/9-17; 14/12-16 
music 

program (8080) 2/6-7, 3/6 8/32-33, 16/21 
printing of 3/10-11 

bibliography of computer music 7/33-35 
networks 

Digicast™ project 29/16-17 
PCNET 17/7, 17/13; mentions of 26/4, 30/47 
other: (D.C. area) 14/3; (EFTS) 16/61-62; (DEAFNET) 
17/10; (bulletin board) 26/44 
Newberry, Steve 20/31 -59 
NIBUSC/MP) 

documentation and code 10/34-50, errata 15/4 
criticism 22/21 , response 26/45 
Northstar 28/38-41 
number systems 
conversions 

binary to decimal (algorithm) 1/2 
octal to hex 16/13-14 
hex to octal 16/13-14 
hex vs octal 19/5; 22/45-46 
miscellaneous 15/4 
Nurse, Howard L. 28/30-32 

Ockers, Stan 14/32 
octal, see number systems 

opcode decoding (6502) 17/20-22, 19/42-44; 22/5-7 
operating system 

CHAOS 6/3; 7/3 
ISIS (analysis of) 21/10-17 
Kernel (8080) 18/20-40 
Unix™ 4/3, 6/3, 7/3 
optimizing (a program) 22/5-7 
OZNAKI project 13/12-13, 24/10-11 

PACE 

review of PACER 9/12-13 
Pack, Charlie 4/18-32, 19/36-41 
Palmer, John B. 18/41 
Parker, Dan S. 14/10-11 
PASCAL 23/16-19 
PCM-12 (review of) 7/10 
PCNET.see networks 
Pearce, Craig A. 21/5 
Peterson, Richard K. 13/36-37 
Pfafman, Fred 13/7 
PILOT 
8080 

code for 15/18-33 
documentation 14/17-29 
errata 19/18, 20/63 


modifications 

editor 22/43-44; 24/22-25 
other 17/24 
on North Star 27/26 
Common 27/46-47 
information exchange 14/17 
tiny 

proposal 13/34-35 , responses 18/43, 19/35 
see a/so FOCAL 

Pittman, Tom 6/9-10; 8/19-21; 12/3-4 
Poduska, Paul R. 20/9-11 
'polish joke'4/78, explanation 7/35 
Poly88 (review of) 10/16-18 
Polymorphic’s BASIC 
review of 14/8-10 
printer driver for 27/27-30 
Polymorphic’s documentation, corrections 19/15-17 
Poly VTI. 13/12-13; 16/17-19 
POW(word processor) (8080) 29/18-29 
printer 

driver routines (8080) 14/10-11, 19/35; 27/27-30 
(6800) 12/7 
Processor Technology 
BASIC 

INT function fix 8/34; 10/9, 13/4; 17/26 
tape load/save 16/23-24 
assembler fix 13/7; 16/22 
G.P. Memory module fix 27/41 
programming languages, see languages, programming 
programming tricks 6/9-10; 28/29; 29/3 
programs 

miscellaneous 

interactive peek/poke (BASIC) 22/8-9 
stencil cutter (BASIC) 29/17 
see also under processor type (for machine and assembly 
language) or program type 
Pugh,Tim 26/4-16 
Purdin, Titus 28/38-41 

Rankin, Roy 7/17-19 
Raskin, Jef 13/25-29; also most reviews 
reformator (intel to proc tech assembler) (8080) 6/10 
relocating machine code 
article on 22/10-13 
rel ocator 

for 8080 13/8-9; 22/14-20 
for 6502 14/30-31 
forZ-80 13/8-9 

renumbering routines for BASIC 23/4-9; 27/34-38 
reviews 

computers 

DZ-80 15/7 
H-8 20/9-11; 30/22-25 
PACER 9/12-13 
Poly88 10/16-18, errata 13/5 
miscellaneous 8/15-17; 14/46; 15/5; 18/5;24/19-20 
modems 17/11-12; 17/13; 20/5 
software 

Mits BASIC, Poly BASIC and NIBL 14/8-10, errata 
16/7. 17/31 
other 20/29; 26/17 
Rice, Lloyd 4/6-8 
Ritter, Terry 25/28-33 
robots 22/4; 18/8-19; 25/17-20 
Roichel, Ancelme 21/18-37 
Roth, Richard L. 22/14-20 

SAM76 21/18-37; 23/46; 26/46-47; 30/19-21;30/44-45 
Sanger, Joseph Jay 15/10-17 


478 



Santore, Ron 6/38-39; 16/23-24 

Savir, D. 14/36-43 

SCELBAL 2/8-12 

schedule program (BASIC) 16/15-16 

Schuman, Philip 17/35-37 

SC/MP 

loader 21/13 
language 

NIBL. see NIBL 

subroutine manager 13/36-37, 30/44 
Scully, Tim 22/43-44 

Selectric: converting to an I/O device 13/41-44 

Shaw, Dan M. 13/8-9 

Shepard, John C. 5/10-11 

Sherman, Ralph 14/30-31 

Simmons, Webb 21/8-9 

Simpson, Philip 22/30-41 

Skovgaard, Erik 21/13 

Smith, Glendon 6/30-33 

Smith, R. Lynn 12/25-27; 16/57 

Smith, Stephen P. 21/6 

Snell, John 7/33-35;9/12-13 

software 

editorial on 12/3-4, response 16/7, 16/8-10 
piracy 5/3;19/20; 22/20; 25/3 
SOLI8080) 

disassembler for 21 /38-46 
file routines for ALS-8 27/42-45 
patches to run Mits BASIC 18/42-45 
sort routine (quicksort) 24/20 
speaker, using TV, for computer output 12/4 
speech 

digitizing 28/42-46; 29/30-33 
synthesis 

article on 4/6-8 
reference to paper on 8/9 
products 3/12; 5/7-8; 8/7-8; 20/6-8 
Stallings, Gordon 13/30-33 
standards 

proposed 

memory map 9/22 
S-100 bus 7/8-9; 25/40-46 
Z-80code 13/10-11 , response 17/34 
Starkweather, John A. 14/17-29; 15/18-33 
status push/pop (8080) 29/3 
Stedman, John O. 9/16-18 
Stiefel, Mai 7/12-15 

string output routine(6502) 8/33, 10/50, 12/8 
STRUBAL 23/10; 28/28. 30/44-46 
structured programming 
article on 21/8-9 

Stumpf, Adolph P. 2/34; 10/9; 13/4 
Suding, Robert 1/18 
Swank, Joel 28/33-35, 30/32-33 
SWTPC 

6800 I/O control interface 17/35-37 
miscellaneous 20/30 


Teeter, John 11/8-61 
telephone, see also networks 
telephone company 7/36-37 
terminals 

for trade 16/14 , retraction 17/10 
Singer/Friden/Burroughs 10/9; 12/27; 15/5; 17/33 
Terry, J.M .24/4-8 
text editor 

for 6502 29/4-12 
for 8080 6/13-26 


Thompson, Bill 6/11-12 
timer routines 

for 6800 9/21 

for COSMAC (1802) 19/30-35 
tiny BASIC, see BASIC, tiny 
tiny BASIC extended, see BASIC, tiny: Texas 
trace routine (Z-80) 23/11-12 
tree, binary 

manipulation routines (8080) 30/15-17 
Trenholme, John B. 27/34-38 
TVT-II 

driver (8080) 2/34 
see also hardware: modifications 
TV. see display 

TV Dazzler. see graphics: 8080: dazzler 
Uni vac II 

article on 28/20-23 

Unix™ (operating system) 4/3. 6/3. 7/3 

utilities see under type of processor, computer or utility 

Van Buer, Darrel 14/6-7; 30/4-11 

Van Der Wateren, Frits 28/24-25; 20/22-29 

Van Dyke, Don 21/38-46 

Van Valzah, Bob 10/19-32, 12/44-45 

Wadsworth, Nat 2/8-12 

Wang, Lichen 5/12-25; 6/8; 17/33-34 ; 18/8-19 
Warme, Paul K. 30/26-31+ 

Warren, Jim C., Jr. 

editorials 2/3; 3/3; 4/3; 5/3; 7/3; 9/3-4; 10/3-4 
other 4/5; 8/3-6; 9/6-7; 11/7; 16/5-6; 29/16-17 
Watson, Herman 29/18-29 
Wayne Watch 16/5-6 
Weisbecker, Joe 15/34-44 
Whatis (expression evaluator) 29/34-40 
Whipple, Dick 1/13-17; 2/13-31 
Wilcox, Bob 3/6 
Wilcox, Dick 11/3-7 
Williams, Steve 16/15-6 
Williams, Tom 19/6-9; 30/22-25 

Winzenread, Marvin R. 8/28-29; 9/30-31; 10/58-59; 10/60; 

15/9; 16/28-30 
Witham. Steve 17/16-17 
word processor 

for 8080 29/18-29 

Wozniak, Steve 7/17-19; 8/22-25; 8/26-27; 23/4-9 

Yob, Gregory 22/22-29 
Young, Kenneth 20/6-8 

Z-8 

article on 26/28-30 

Z-80 

differences Zilog-Mostek chips 19/9, retraction 21/13 
disassembler (BASIC) 26/42-44 
miscellaneous 7/11 
patches 

for Microsoft 8K BASIC 12/20 
for Mits 12K BASIC 17/25 
utilities 

debugger 24/12-18 
memory tester 22/42-43 
miscellaneous 27/22-26 
relocator 13/8-9 
trace troutine 23/11 -12 
see also 8080 
Zeigler, John 3/17-19 
Zolman, Leor 26/34-41 


479 










5490-4 

$18.95 


\ 


[» 

HAYDEN BOOK COMPANY, INC. 

Rochelle Park, New Jersey 


ISBN 0-8104-5490-4