This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
B r o N n a n d W h i t e e n d C o l o r e d A l l O ~ e rb y R i c h a r d r . S u i t o r
U n d e r a t o n d i n g y o u r A p p l e ' a C o l o r
SAIflIL!.tWlllm u !IOU.,,! PIiOORAMLISTlIfG
82ti 033' .A 9 66 Ull.IM 1 C l1 12 8 D 13 C .2 '0 0 L.tIXDl D
8 3 0 O l l S 9 D D O 8 0 stU • ] 21 688 3 3 0 3 " l8 I n :8 1 11 0 3 11 1 .2 ro 03 ! EC I 3836 03Qlj QC 3! D3 JM P !3D839 0'3'7 n M O P8 11 0 0 ]. 11 8 U ! lOP
8 . 1 1 , 0 3 1 1 9 IJD DO 81 STU Boon Q[EN VIOL!T
au 03-C' $8 108115 n " 'D rtI 03 9 B C l l FOREST
. : : r : :8 . 1 1 1 Q ~ . I f E I ' lie "'9 03 J J o I P 8 1 1 1 G R B E N
Design of a PET/TTY Interfaceby Charles R. Husbands
Shaping U p Your Appleby Michael Faraday
Apple II Sfarwars Themeby Andrew H. Eliason
Apple Piby Robert J. Bishop
A Simple 6502 Assembler for the PETby Michael J. McCann
The MICRO Software Catalog: IIIby Mike Rowe
A Debugging Aid for the KIM-lby Albert Gaspar
6502 Interfacing for Beginners: Address Decoding IIby Marvin L. De Jong
Brown and White and Colored AllOverby Richard F. Suitor
6502 Bibliography: Part Vby William Dial
Programming a Micro-Computer: 6502, by Caxton C. FosterReviewed by James R. Witt, Jr.
PET Composite Video Outputby Cal E. Merritt
Power From the PETby Karl E. quosig
Classified Index: MICRO 1 - 6
Apple Integer BASIC Subroutine Pack and Loadby Richard F. Suitor
A Partial List of PET Scratch Pad Memoryby Gary A. Creighton
A dv er ti se rs I nd ex
Computer ShopThe Enclosures Group
The Computerist, Inc.The Tax StoreA B C om put er sColor-Tech TVMICRO
IFC Computer Components2 Micro-Psych
10 Connecticut microComputer12 United Microsystems Corp.12 Darrell's Appleware House13 Personal SoftWare13 PET-Shack Software House
MICRO is published bi-monthly by The COMPUTERIST, Inc., 56 CentralSquare, Chelmaford, MA 01824. Robert M. Tripp, Editor/Publiaher.Controlled Circulation postage paid at Chelmsford, Massachusetts.
Single Copy: $1. 50 Annual Subscr i ption: $6.00 (6 issues) in USA
Copyright 1978 by The COMPUTERIST, Inc. All Rights Reserved.
systems. These range from a program to punchreadable leader of a paper tape to FOCAL- a DEChigh-level language similar to BASIC.
IN THIS ISSUE •••
There were so many good articles submitted forthis issue of MICROthat we have had to modifythe format slightly to make more room. Most ofthe MICROmaterial has been reduced to approxi-mately two-thirds its old size, providing about50% more space per page. While this does maketype smaller, it is still very readable. Somematerial, in particular program listings, wereleft full size. This new format will permit usto print a lot more material without increasing
the cost of printing.
Howdo you get hardcopy from a PET? You couldwait until Commodore comes out with a printer.Or you could buy one of the PET/RS232 adapters.Or you can use the techniques and software thatare presented in "Design of a PET/TTY Interface"to quickly and cheaply use a standard TTY as aPET printer. The article by Charles R. Husbandsprovides both the hardware and the software re-quired.
If you have wondered about how the charactersformed on your Apple II, read "Shaping Up YourApple" by Michael Faraday. In addition to ex-plaining how the mechanism works, a couple oftables make it easy to make your own adapta-
tions.
Now that STARWARSs back at your local drive-in, it seemed appropriate to print a short pro-gram by Andrew H. Eliason which presents the"Apple II Starwars Theme" - sounds of the mainbattle scene played on your Apple. While thisprogram may give you some insight into the oper-ation of your Apple, it is really included justfor fun.
O n a more serious vein, in spite of its humoroustitle, "Apple Pi" shows how to use BASIC to cal-
culate mathematical functions. Robert J. Bishoppresents the history of calculating Pi, and thenprovides a program which, given forty hours, cancalculate the value of Pi to 1000 decimalplaces. In case you do not want to run the pro-gram yourself, the results of his run are print-
ed. It might be a challenge to someone to writethe equivalent code in assembly language and seehow long it takes to run.
One of the most constant complaints of PETowners is the lack of support for assembly levelprogramming on the PET, in spite of promises byCommodore for a ROMor tape of a machine codemonitor. This will be partially alleviated by"A Simple 6502 Assembler for the PET" by MichaelJ. McCann, complete in this issue. The packagepresented here consists of the assembler, a saveon tape routine, a load from tape routine, and adisassembler to produce listings. Two errors inthe listing were discovered after that portion
of MICROwas printed, so please make the follow-ing changes in the listings:
190 IF VAL(A$)<l ORVAL(A$»6 GOTO180
15020 IF LEN(A$)=3 THENHN$=A$:OP=O:RETURN
Since the "BASIC 6502 Disassembler" written by
Michael for the last issue of MICROwas, with\very minor modification, capable of running onan Apple as well as a PET, the assembler portionof this program is probably also modifyable forthe Apple. The exercise is left for the reader,as the math books are fond of saying.
There is a "Call for Information" in regards toa MICROHardware Catalog which we hope to startcarrying in the next issue. If you have hard-ware of interest to the 6502 community, thenfollow the instructions and submit your stuff.
A rather neat program which serves as "A Debug-ging Aid for the KIM-l", written by Albert
Gaspar, provides some good support for the KIM-land resides totally in the "extra memory" from1780 to 17E6. Four basic operations are given:
Insert BREAKpoints, MOVEblocks of data in
memory, calculate BRANCHoffsets, and CONTINUEexecution of the program.
The program is very tightly coded and shows someways to really pack your code.
The series on "6502 Interfacing for Beginners"continues with "Address Decoding II". This ser-ies, which began last issue and is written byMarvin L. De Jong, shows the novice how themicrocomputer works via simple hardware and
software projects.
One of the most obvious features of the Apple IIis its color capabilities; The article "Brownand White and Colored All Over" by Richard F.Suitor explains in some detail the theory behindthe color of the Apple. He also provides a fewsimple BASIC programs to allow the user to dosome experimenting with color.
Part V of the "6502 Bibliography" by WilliamDial covers entries 335 through 360. Due to the"explosion" of material being written about the6502, some changes have had to be made in theorganization and content of the bibliography.
Straight advertisements will no longer be refer-enced or will material contained in flyers.Minor articles in relatively obscure magazines
may be omitted. And, where a single issue of amagazine has a lot of articles of interest, theindividual references will be combined under onegeneral magazine reference.
"Programming a Micro-Computer: 6502"a book byCaxton C. Foster, is reviewed by James R. Witt,Jr.
Cal E . Merritt discusses the "PET CompositeVideo Output", showing how it works and how toconnect up to it. Karl E. Quosig whows how toget "Power from the PET", a method of getting+5V from your PET.
A "Classified Index: MICRO 1_6" lists all ofthe major articles and advertisements from thefirst volume/year of MICRO. Material is classi-
fied as General, KIM-l, Apple, PET, or Ads.
A very useful utility package is presented byRichard F. Sui tor in "Apple Integer BASIC Sub-routine Pack and Load". The assembly level pro-gram, which is presented in its entirety,permits the user to simply Pack and save hismachine code on tape and the Load and unpack it.
"A Partial List of PET Scratch Pad Memory" isprinted on the back cover as a reference guidefor PET owners. This material was prepared byGary A. creighton, and should make using and un-derstanding your PET much easier.
Part III of the MICROSoftware Catalog has eightentries covering a wide variety of software and
[E xcer pts fr om a l e tter by Don al d C . Sco uten toth e E dito r, EDN, r egar ding th e A ppl el PIA st uff. J
"T he diff icul t y in us ing PI A's and V IA's o n t heAp pl e II a rise s be caus e of the w ay t he A ppl ed ecod es the 1/0 s el ec t (p in 1 ) a nd devi ce s el ec t(pin 41 ). Thes e ar e acti vate d o nl y d urin g ph ase2 of a c ycl e th at addr esse s th e par ticu l ar co n-ne ctor u nder c onsi derat ion. Thu s, if t hese se -l ec ts ar e u sed . .. to a ctiv ate the C S (or n otC S) o n a PI A, th e enab l e pin (pin 25 ) a nd t he C Sg o acti ve al mo st si mul t aneo usl y . How ever th edat a sh eets cl earl y req uire a 18 0 n sec set uptim e for the C S befo re the e nabl e be come s ac-tive . Th is set up tim e is nor mal l y avai l abl e on6502 b us sinc e the addr esse s a re gua rant eed tobe val id 300 n sec i nto phase 1 (and thu s y ourcir cui t work ed on a KIM ) . ~. It i s, h owev er,cl e arl y im poss ibl e to use the int erna l Ap pl e de -codi ng and sati sfy the PI A '" r equi reme nt of18 0 ns ec setu p t ime. .
T he ab ove p robl em sho ul d n ot be int erpr eted a s adef ect in the A ppl e II sin ce i t is a s el f con-s ista nt syst em and 1/ 0 po rts can ea sil y b e ad dedif desired.
M y sol utio n w as to bui l d a simp l e add ress d e-cod er o n my 1/0 boar d that use s t he a ddre ssl ine s in stea d o f t he se l ect s. T hus th e C S oft he VI A i s acti vate d wit h s uffi cient se tup ti meand the V IA wor ks pr oper l y."
A note fro m Paul Fa rmer of M icro prod ucts , 1024
1 7t h S t., H ermo sa Bea ch, C A 90254, suggestsu sing thre e b uffe rs i n ser ies on a C M OS 4050
I C ch ip. Eit her pha se 0 or phas e 2 can be us eda s th e in put w ith eno ugh del a y f or t he se tup o fa P IA or VIA .
P ET Dr op pi ng s
A new ide a i n m agazines : C UR SOR ( tm) MA GAZI NE isa m onth l y c asse tte of p rogr ams f or the PET . ro uget five pro gram s per m onth on ca sset te via 1 stcl as s mail . At $24.00 pe r year ( 1 2 iss ues) ,th ecost pe r prqg ram is $.40 ce nts each. O f c ours e,t he ac tual va l ue o f t he p rogr ams d epen ds ont heir va l ue t o y ou. Wri te C U RSOR , P.O. Box 550,Gol e ta, C A , 93017 for in fo or ca l l 805/967-0905.
Mark Zim merm an, 61 9 Woodl and Drive , S ierr a Madr eC A 91024 wr ite a bout the LIF E game edg es:
"If one copi es the to p and bot tom e dges of thescreen ( & l e f t & r ight edg es) to oppo site Side s,th en sim pl y ap pl yi ng t he LIFE al go rithm to thec entr al (o mitt ing ext reme edg es) a rena giv esc orre ct wra p-ar oupd (t oroi dal ) edg e s truc ture .Example:
ABC DE F G HI J K L
L I J K L I
D~IA BCD AH E F G HI EL I J K L IDAB C D A
K im K li pp in gs
Th e S an Fern ando V al l e y KI M-1 Use rs C l ,u b is o ITan d runn ing, a ccor ding to a repo rt fro m J imZube r. M eeti ngs w il l b e h el d th e sec ond Wed .of each m onth at 7: 30 pm . Un til ano ther pl aceca n be fo und, meet ings wi l l be he l d in Ji m'sapartment: 20224 Cohassett 116, C anog a Park , C A91306. Ph one for ino f: 213/341-1610.
Mi chael C hibn ik of 10445 C ano ga Ave . C hatsw orthC A 91311 , h ad a fe w c Ol l l l l l en tsb out Mi cros oftBAS IC f or the KIM: "I did n't s et e noug h inf orm-at ion o n th e pe riph eral s th at we re u sed. A not eab out M icro soft BAS IC is t hat m ost of t he p eopl ewh o h ad bo ught it (in the a bove cl ub) d id n otl ik e the fa ct tha t th e co de for the inte rpre teris sel f modi fyin g in m any pl aces and th at it isno t PR OMab l e ." [ Ed itor : So meon e r e po rted thatthe y had a sked Jo hnson C om puter abo ut t he PR OM-abi l ity of th e M icro soft BAS IC a nd was tol d t hatit is PRO Mabl e. Does an yone ha ve any hard i nfoon this s ubje ct?]
Robe rt F ord Den ison , R D 5 Te eter R oad, Ith aca,NY 14850 has de vel o ped a res iden t s ymbo l ic 6502as semb l er whi ch runs in 3K ( 4K reco mmen ded) a ndus es a "Qwer ty" ke yboa rd for inp ut and the K IMdi spl ay for outp ut. To te st it he i s "o ffer in~a free 'sne ak pr evie w' of t he asse mbl e r to asma l l grou p o f 6502 us ers . .. ( sinc e he) woul dap preci ate c omme nts o n a ny p arts of t he doc umen -tat ion that ar e not perf ectl y cl e ar. Writ e h imf or f ur th er i nf or ma ti on .
G en er al G ar ba ge
You mig ht wan t t o w rite to Ro bert El l iot t P urse rat P .O. B ox 466 , E l Dorado , C A 9 5623 a nd r eque sta co py of h is "Wo rl d' s Se cond M ost I ncom pl eteSof twar e Lis t for PE T, Rad io Sh ack, A ppl e & S o l"
MICROBES
Ap pl ay er M usic I nter pret er, Sui tor, 5 :29:5:30 OA20- 82 20 O B5 : 3 1 OAOO: 8 3 9 0 OF 8 3 9 0 OF FF
O F 1 8 : 1 C 1 A 1 8 1 A 9 1 1 C 38 18OF50: 8 1 5 5 55 55 F FOF58: 8 1 0 5 0 5 05 FFOF90: 83 58 O F D4 BO 8 3 50 OF 8 30810: 48 02 2 8 02 08 0 2 E8 01
T hese pr obl em s are in t he mus ic an d ton e t abl e ,and w ere c ause d b y the 8' s on his TTY l oo kingver y m uch l ik e 0' s. Mak e the ch ange s and themu sic wi ll pro babl y. sou nd bett er.
A B ASIC 6502 Di sass embl er for A ppl e and P ET,McC ann, 5: 25:
5:26 3020:5:27 6000:6100:
6120:6250:
DC=IB:GOSUB 1000ASL s houl d be ASL ZCLC shou l d be C LIJMI s houl d be JM PIC P X shou l d be C PX Z
D/A a nd A ID Conv ersi on Us ing t he KIM -1 , D e Jong,2: 1 1 : IC sho ul d be l abe l ed "1408" and pin 1 4sho ul d ha ve 1 .5( ( resi stor to +5 , w hil e p in 1 3goes d irec tl y t o +5 V (ch eck spe c s heet s on 1408t o be abs ol ute l y sur e of conn ecti ons) .
resident in the machine to list other programsunder development, the program was written inmachine language to be stored in Tape Buffer 2.Figure 2 shows a simple memory map of the PETrandom access memory allocations. Without asecond tape cassette unit, a memory buffer of
198 bytes is available. When another program isloaded from tape or the NEWinstruction is exe-cuted the operating system zeros out memory lo-cations 1024 and above. However, it leaves thememory locations below 1024 undisturbed. To ex-ecute a machine language program the USR in-struction must be called. The USRcommand usesa pair of memory location pof nt.er-s stored inmemory locations 1 and 2 to extablish the firstlocation in machine language code to be process-ed. Locations 1 and 2 are not modified by theloading of a program from tape or the execution
of the NEWinstruction.
DESIGN OF A PET/TTY INTERFACE
Charles R. Husbands24 Blackhorse DriveActon, MA01720
8192 $1200
With the recent acquisition of a PET Computerone of the facilities that was immediately need-ed was a method of obtaining hard copy listings
of programs under development. In addition tothe PET I had an ASR33 Teletype Unit availablewhich had been interfaced to my KIH-1. Thisarticle describes the hardware interface and as-sociated software necessary to use the ASR 33TTY as a printing facility for the PET. An im-portant design goal for the interface was to de-velop the software to remain resident in thecomputer in such a manner that the program underdevelopment could be loaded, run and listedwithout disturbing the list~Rg program.
The Interface Circuit
Figure 1 shows the 20 ma current loop circuitrequired to interface the ASR 33 to the PET.The circuit consists of an open collector NANDgate to provide the proper buffering, a diode
and a pull up resistor. The completed circuitwas built on a small perforated board. The PET
supplies power and ground to the interface boardfrom the second Cassette Interface. The input
signal is delivered from PAOon the PET paralleluser port. The interface board is connected tothe teletype by means of the PRINTERand PRINTERRETURNines. These lines attach to terminals 6and 7 respectively on the ASR33.
( +sv
r--------- ----, r----I I II > I I
I
$
R l I II
I PRINTER II IU:TURN LINEI 7I R N T I I
I I I I
I I I ~'"
I \ I I fNPVT:3 I I 6t TTY I PRINTf.It
I
Irc 1
I LINE I PRINTfRI I I
I 1 7 CR 1 I I
I I IL_____________ J IL.. ____
) c a W D
Parts List
LIC1! 7438 I Quad 2 Input NANDOpen Collector ILCR11 1N4001 I 1A 50V Diode IIR1 1150 ohm 1 1/2 Watt Resistor I
Figure 1.
A fairly simple circuit for buffering the con-trol signal from the PET Computer and convertingthat signal to a current level capable of driv-ing the printer mechanism on an ASR33 TTYUnit.
A Hap of the PET Random Access Memory Space.The Listing Program resides in machine languagein Tape Buffer 2.
A flow diagr,,~; of the Listing Algorithm is shown
in Figure 3. The program after proper initia-tion examines the first character of the third
line in the display for a value corresponding tothe letter "R". It is the letter R appearing in
the first display col umn which is used by theListing Program to exit the listing algorithmand return control of the program to the callingroutine. The R in the first col umn would nor-mally correspond to the READYdisplayed by thecomputer at the end of a requested listing block
or at the completion of an executed RUN. If thecharacter in the first column is anything but anR the program executes a carriage return andthen a line feed. The program examines the nextdisplayed character and translates it from dis-
play format to ASCn format. The subroutinePRINT is then called.
1 k~M***TELETYPE LISTING ROUTI~E.*** ••2 R~M CHARLES R. HUSBANLS3 REM
4 REM THIS PROGRAM LISTS THE DATA5 k~M APP~AkING ON TH~ SCREEN IN6 k~M S~kU\L T£L~ TYP~ FOkMAT. TH~7 REM PROGRAM IS STOk~D IN MACHINEH k~M CODE IN TAPE bUFF~R .2. TH~9 HEM PRU(;kAM IS ~XEl..UT~L USIN(, "USk".
10 P()K~(01),5820 POK~(02),03
29 REM ••INIT ••• I~ITALIl~ VARIAbL~S3~ PUKE(826),1694\'1POK~(827),110
921 Rl:.M AN "R" IS FOUND IN 1ST COLM.921 POKE(922),169922 POKE.(922),169923 POKE(923), 128924 POKE(924),141925 POKE(925),66926 POK~(926),03927 POK£(927), 141928 POKE( 928),89
9 4 9 R E M •• PR I N T •• TH I S S U B R O U T I N E P R I N T S \ 1 51 0 P O K E ( 9 9 5 ) # 25 3
9 5 . , R E M T H E C H A R A C T E k I N T ·T Y F O R M ~ T . 1 5 2 0 P O K E ( 9 9 6 ) # 1 1 3
9 6 0 P O K t . ( 9 34 ) #1 6 9 1 5 31 1 1 P O K E ( 9 9 7 ) # 9 6
9 6 1 P O K E ( 9 35 h 2 5 5 1 5 3 9 RI:.M•• IJEL~Y
9 62 P OK E( 936 )#1 41 i 1 5 4 . , P O K I : : ( 9 9 8 ) # 1 6 9
9 6 3 P O K E ( 9 37 ) # 6 7 ' 1 5 5 0 P O K t : ( 9 9 9 ) # ~2
9 6 4 P O K E . < 9 38 ) # 232 1 56 1 1 P O KI :: ( 1 " '1 11 0 )# 4 1
9 6 5 P O K J : ; ( 9 3 9 ) # 1 7 3 1 1 5 7 ~ P O K E ( I ~ 0 1 ) # 2 5 4
9 6 6 P O K e < 9 4 0 ) # 2 5 5 . 1 5 8 1 1 P O K I : . ( 1 1 I I 1 I I 2 ) # 1 t l 39 70 P OK E( 94 1) #0 3 1 1 5 9 1 1 P O K t . ( 1 0 0 3 ) # 1 6 Q
9 8 0 P O K J : ; ( 9 4 2 ) # 1 4 1 I M J I 1 P OK l: .( HI 0 4 ) # 8 2
9 90 P OK E( 94 3) #2 5211 6 0 9 R E M •• D 1: . 2
1 00 0 P OK E( 94 4) #0 3 1 61 0 P UK I: .( 11 I5 05 )#!>6
1 1 1 1 1 0 P O K E ( 9 45 ) # 14 2 1 6 1 9 R EM •• 1 J t . 4
1 02 0 P OK E( 94 6) #2 53 1 62 0 P l lK I: . (1 1t l 1l l6 )# 23 3
1 0 3 1 tl P O K t . ( 94 7 ) #1 I I 3 1
h l 4 1 t l P U K E ( 9 4 8 ) # 32 ! 1 630 P O K t . ( 1 0 0 7 ) # I - I 1
h I 5 I t lP O K E ( 9 4 9 ) # 231 1 1 '1 641 tl P O K I : : ( 1 0 ~ 8 ) # 1 7 6
1 1 I I 6 1 t lO KE ( 9 51 11 )# 0 3 1 6 5 '" P O KE ( I "' ' ' '9 ) #0 3
1 0 7 0 P O K I : : ( 9 5 1 ) # 1 6 9 1 6 6 1 ! J P O K E ( I ~ I I I I ) # 2 0 6
1 0 8 0 P O K E ( 9 5 2 ) # 7 9 i 1 6 7 0 P OK E( 1 11 11 1) #2 54
I I t l 9 0 P O K l - . . ( 9 5 3 ) # 2 3 2 :1 680 P O K E ( h 1 1 2 ) # e a
I 1 1 1 11 : '1O K E ( 9 5 4 ) # 4 1 1 6 8 9 R EM •• D1 : . 3
I I lI!! P O K I : . ( 9 5 5 ) # 2 5 4 1 69 0 P OK E( 10 13) #1 72
1 1 2 0 P O K E ( 9 5 6 ) # 1 4 1 1 7 0 0 P O K E ( I I t l 1 4 ) #2 5 4
I 1 31 1 1 P U K E ( 9 5 7 ) # 7 9 1 7 1 1 1 1 P O KE ( 1 01 5 ) #0 3
1 1 4 1 1 1 P O K E ( 9 5 8 ) # 2 3 2 1 72 0 P OK E( 11 II 16 )#1 6
1 1 5 0 P O K E ( 9 5 9 ) # 3 2 1 730 P O K E ( I I H 7 ) # 2 4 3
1 1 6 0 P O K E ( 9 6 0 " ) # 2 3 " 1 7 4 0 P O KE ( 1 01 8 ) #9 6
1 1 7 1 t l P OK I: : (9 61 ) #0 3 1 7 5 1 1 1 k E M •• ( .;O UN i ( I I t!I Q)
1 1 8 0 P O K E ( 9 6 2 ) # 1 6 2 1 7 6 0 k E M • • ( ' ;H *' I R1 1 Il 21 11 )
I 1 90 P O K E ( 9 6 3 ) # 0 8 1 7 7 ~ R E M •• T MP X ( H I 2 1 )
1 1 9 9 H E M •• O UT I 1 7 M ' " R E M •• i I M H ( 1 11 1 2 2 )
1 2 1 t l l - lO K l : . ( Q 6 4 ) # 1 7 3 1 7 9 0 R EM •• P (' ;H ~R ( 1 1- 12 3)
Hi I t !-1 E N D
1 2 1 0 P OK l: .{~ 65 )# 7 9
1 2 2 1 t l P O K l : . ( 9 6 6 ) # 2 3 2
1 2 3 1 t l P U K E ( 9 6 7 ) # 4 1
1 2 4 0 P O K I : . ( Q 6 8 ) , 2 5 4
1 . 2 5 1 1 1P O K I : : ( 9 6 9 ) , 7 8
1 2 M ! P O K I : . ( 9 7 ( 1 ) , 2 5 2
1 2 7 1 1 1 P O K t . ( 9 7 1 ) , 0 3 L A B E L O P F I E L D L O C O P F 1 F 21 2 8 1 t l P O K I : . ( 9 7 2 ) , 1 0 5
1 2 9 0 P U K l : . ( 9 7 3 ) , 0 0
1 3 1 t l 0 P O K I : . ( 9 7 4 ) , 1 4 1 I N I T L J ) A #0 8 2 6 1 6 9 0 01 3 1 1 1 1 P O K l : . ( 9 7 5 ) , 7 9 S T A C O U N T 8 2 8 1 4 1 2 5 1 0 31 3 2 1 1 P O K I : . ( 9 7 6 ) , 2 3 2 T A X 8 31 1 7 0133"" P O K E ( 9 7 7 ) , 3 2 L O O P 1 L DA 3 2 8 4 8 , . x . 8 32 1 8 9 8 0 1 2 81 34 0 P O KI : . (9 7 8 ) , 231 t l t;MP ' 1 8 8 35 2 0 1 1 81 3 5 1 tl P O K l : . ( 97 9 ) , " 3 B E Q F I N D R 8 37 2 4 0 8 3
L O O P 3 L DA H O D 8 39 1 6 9 1 31 3 6 1 1 1 P O K I : : ( 9 8 0 ) , 2 0 2 S T A P C H A R 8 4 1 1 4 1 2 5 5 0 31370 P O K E ( 9 8 1 ) , 2 0 8 J S R P R I N T 8 4 4 32 1 6 6 0 31380 P O K E ( 9 8 2 ) , 2 3 7 L DA l O A 8 4 7 1 6 9 1 01390 P O K E ( 9 8 3 ) , 1 7 3 S T A P C H A R 8 4 9 1 4 1 2 5 5 0 31 4 0 0 P O K I : . ( 9 8 4 ) # 7 9 J S R P R I N T
8 5 2 32 1 6 6 0 31 4 1 1 6 P O K E ( 9 8 5 ) # 2 3 2 L O O P 2 L DA 3 2 8 4 8 , . x . 8 5 5 1 8 9 8 0 1 2 81 4 2 1 1 1 P OK I: .(9 86 ) # 0 9 S T A C H A R 8 5 8 1 4 1 2 5 2 0 31 4 3 1 6 P O K E ( 9 8 7 ) # 0 1 S E C 8 6 1 5 61 4 4 0 P O K E ( 9 8 8 ) , 1 4 1 S B C #2 0 8 6 2 2 33 321 4 5 1 1 1 P O K E ( 9 8 9 ) , 7 9 B M I A L P H A 8 6 4 4 8 1 21 4 6 0 P O K k . ( 9 9 0 ) # 2 3 2 L DA C H A R 8 6 6 1 7 3 2 5 2 0 31 4 7 1 6 P O K E ( 9 9 1 ) # 32 S T A P C H A R 8 6 9 1 4 1 2 5 5 0 31 4 8 0 P O K E ( 9 9 2 ) , 2 3 0 J S R P R I N T 8 7 2 32 1 6 6 0 31 4 9 1 6 P O K E ( 9 9 3 ) , 0 3 J M P C L N U P 8 7 5 7 6 1 2 2 0 31 5 0 0 P O K E ( 9 9 4 h 1 7 4
T o t h e C o d e l i s t w e w i l l a d d t h e O C T a l n u m b e re ac h a rr ow r ep re se nt s.
SHAPING UP YOUR APPLE
M ic ha el f ar ad ay2 46 B ro nx vi l le R o adB r o n x v i l l e , NY 10708
G o i n g b a c k t o t h e o r i g i n a l e x a m p l e i n t h e m a n u a lw e c a n r e p l a c e t h e e n t i r e c h a r t o f b i n a r y d i g i t s
w i t h a n O C T a l n u m b e r p u t d i r e c t l y a b o v e o u r "u n -w r a p p e d" a r r o w s , l i k e s o :
O C T 22770 ~ ~ ~ 155 526 6 637
f . ~ - t t t t - - - - ~ J f ~ - -
E v e n t h o u g h , a s a p r o g r a m m i n g n o v i c e , i t t o o k m ea w h i l e t o t a k e o n A p p l e I I ' s H i - R e s o l u t i o nG r a p h i c s I h a v e t o a d m i t t h a t t h e s e e m i n g c o m -p l e x i t y o f c o n s t r u c t i n g a S h a p e T a b l e h e l d ac e r t a i n f a s c i n a t i o n f o r m e f r o m t h e f i r s t t i m e I
o p e n e d t h e R e f e r e n c e M a n u a l . W i t h G a r y Da w k i n ' s~l i g h t f u l p r o g r a m a p p e a r i n g i n C r e a t i v e C o m p u t -' i n g
d e l i g h t f u l p r o g r a m a p p e a r i n g i n C r e a t i v e Com-
p u t i n g r e c e n t l y t h e r e i s n o l o n g e r a n y r e a ln e e d t o a p p l y t h e o r i g i n a l t e c h n i q u e , b u t a g o o du n d e r s t a n d i n g o f s o m e t h i n g n e v e r h u r t a n y o n e , i fo n l y t o v e ri fy o th er w o rk in g a rr an ge me n ts .
I f y o u h a v e a T I P r o g r a m m e r , o r a n y c o n v e n i e n tw a y o f c o n v e r t i n g f r o m o n e b a s e t o a n o t h e r ,h e r e ' s a s i m p l i f i e d m e t h o d o f u n t a n g l i n g t h a tu r i s i g h t l y ju m b l e o f a r r o w s a n d b i n a r y d i g i t s o np a g e 53 o f t h e "B i g R e d B o o k". T h e k e y i s i nr e c o g n izi n g t h a t t h e c o n v e r s i o n c h a r t i s n o t h i n gm o r e t h a n a n O C T a l r e p r e s e n t a t i o n o f o u r 8 - b i t
A l B
C O C T
• ,000 00 0 T o t h e C o d e l i s t w ew i l l a d d t h e O C T a l
- 001 01 n u m b e r t h a t e a c h
•a rr o w r e pr e se n ts .
010 10 2
. . 011 ". 3
t 100 ~
. . . 101 5
,110 6
. . . 111 7
b y t e . O C T a l i s b i n a r y b r o k e n i n t o g r o u p s o ft h r e e ju s t a s H E X i s b i n a r y b r o k e n i n t o g r o u p so f f o u r . T h e f o g l i f t s a l i t t l e a n d w e c a n n o ws e e w h y t h e "C " d i g i t i s l i m i t e d t o t w o b i t s : w eo n l y h a v e a t o t a l o f e i g h t t o s t a r t w i t h . L o o k -i n g a l i t t l e f u r t h e r a l o n g t h e s a m e p a g e w e c o m et o t h e C o n v e r s i o n C o d e s a n d i t ' s h e r e w e c a nb e g i n t o m a k e t h i n g s r e a l l y e a s y .
C B A C B A
S h a p e
W e a r e g o i n g t o c o n s t r u c t e i t h e r t w o - o r t h r e e -d i g i t n u m b e r s f r o m t h i s l i s t a n d n o w c o m e t h eo n l y r u l e s r e q u i r e d t o d e a l w i t h i n t h e w h o l ep r o c e d u r e :
1 . W h i l e a l w a y s t r y i n g t o m a k e a t h r e e - d i g i tn u m b e r , t h e "l a s t" d i g i t o f a t h r e e - d i g i t g r o u pc a n O N L Y b e a 1 , 2 o r 3 ( r e m e m b e r t h a t t h e "C "d i g i t i s o n l y 2 b i n a r y d i g i t s , w h i c h c a n r e p r e -
s e n t t h e O C T a l n u m b e r t h r e e a t m o s t ) .
2 . A s u s u a l , t h e s e n u m b e r s a p p e a r L e a s t S i g n i f -i c a n t Di g i t f i r s t a n d t h e r e f o r e t h e "l a s t" d i g i ti s , i n r e a l i t y , t h e f i r s t d i g i t o f t h e n e w O C T a ln u m b e r .
So w e c a n n o w d i v i d e t h e l o n g s t r i n g o f n u m b e r si n t o t w o - a n d t h r e e - d i g i t , r e v e r s e - o r d e r O C T a ln um be rs w it h s la sh es :
O C T a l 2 2/7 7 10 ~/~ ~ 1/5 5/5 216 6/6 3/7
"u n w r a p" t h i s l i s t , r e v e r s i n g d i g i t s a s w e g o :
"u n w r a p" t h i s l i s t , r e v e r s i n g d i g i t s a s w e g o ,a n d c o n v e r t i n g t o H E X :
O C T
2 277~O1~~
H E X
123F206~
o 0 010 010 t t--t +
. . t t
E v e n t h i s c a n b e a b i t t e d i o u s a n d s i n c e I f i n dt h e a r r o w C o d e c o n v e r s i o n v e r y e a s y t o r e m e m b e r- N o P l o t , U p C l o c k w i s e t o L e f t = 0 t o 3; P l o t ,U p C l o c k w i s e t o L e f t = ~ t o 7 - I d r a w m y d i a -g r a m s o n g r a p h p a p e r u s i n g t h e s e O C T a l n u m b e r !!o n l y .
T h u s ,
. . . . . . . . . .t •t .. ,
t .. ~t ........
b e c o m e s
1 5 5 5 2
4 64 2 6
42607773
o 0
o 0 o 0 000
S o m e c a v e a t s . I t ' s s t i l l a g o o d i d e a t o d r a f t 'a n o r i g i n a l d i a g r a m w i t h p l a i n d o t s ju s t t o g e tt h e s h a p e a n d s c a l e t o y o u r l i k i n g . T h i s a l s ob e c o m e s a h a n d y g u i d e f o r t h e d e b u g g i n g y o u ' r ea l m o s t c e r t a i n t o h a v e t o d o . A n d t o o , i t m a k e sg r e a t f u n f o r y o u r n o n - c o m p u t e r f r i e n d s w h om i g h t l i k e t o p l a y C o n n e c t - t h e - Do t s a f t e r a c o u -p l e o f b e e r s .
A b i g p r o b l e m ke e p s c r o p p in g u p us i n g th e s c a l ef e a t u r e . I t s e em s t h at w h e n b l ow i n g u p t h eo r i g i na l d r a w in g th e A p pl e I I u s es th e d i r ec t i o n . 'f m o ti o n a s so c i a te d wi t h th e p l o t te d p o i n ts a s •a b a s e r e f e re n c e f o r t h e ad d i t i on a l p o in t s .
T h i s o f t en l e ad s t o s tr a n g e l y a s s ym e t r ic a l p i c -t u re s i n l a r ge r s c a l e w i t h "l in e s " of d ot s go i n gi n u ne x p e ct e d d i r e c ti o n s . A s a l w a ys , a l i tt l ep l ay i n g ar o u n d c an r e a l l y m a ke y o u f e e l go o d .H av e f u n . .
H e x i d e c i m a l - O ct a l C on ve rs io n T ab le
A n dr e w H . E l i as o n2 8 C h a r l ea l an e
F a l m o ut h , M A 0 2 5 4 0
J u s t f o r t h e f u n o f i t , h e r e a r e s o m e r o u t i n e st o c r e a t e s o m e t h i n g w h i c h s o u n d s l i k e t h e m a i nb a t t l e s c e n e f r o m S T A R W A R S . E n j o y l
A pp le I I S t ar t re k S ou nd s R ou ti n eD is - a s se m b le r L i s ti n g
*3FAIL
3F A I - A O O E L t v U O E3 F.43 - A2 0 0 L[; X U O O3F A 5 - 9 A T X A3 F A 6 - 1 8 C L C3 F A 7 - E 9 0 1 S S C 1 $ 0 I3 F A 9 - DO F C S N E i 3F A 73 FA!3- 8[; 30 C O S T A SCD303 F A E - E 8 I : ' J X3 F A F - E O 8 C C P X n 8 C3 F B I - DO F 2 B N E i 3F A 53 FB3 - R "J L E Y3 F3 4- [;0 E.D E N E 1 3F A 33 F B 6 - 6 0 . P . T S3F 37- 0 0 B R K3F E P - 0 0 B~l{
3F 9 9 - 0 0 B E K3 F I : l A - 0 0 S P K3F B B - 0 0 B E X3 F R C - . 0 0 BR;{J F E l L - 0 0 E!"'X
*
L o a d v i a m o n i t o r s t a r t ~n g a ~ 3F A 1 :
3F AI . 3F B6
3F A I - A O O E A 2 0 0 · S A I B E 93F A 8 - 0 1 DO F C 8 0 30 C O E B E O
3 F B O - B C [;0 F 2 88 DO E D 6 0
*E nt er B A SI C a n d s e t H I HE M :1 6 28 8 .E nt e r t h is p r og r am a n d R U N :
L I S T
> L I S T1 0 P R I N T M S T A R BNr:rLE. SOtjN[; E H E C T S M2 0 1 = f i N D ( I S ) +I , : R E M S H O T S
"·30 J = R ~D ( 1 1 ) *1 0 + 1 2 0 1 R E . M DU R A T I O N4 0 P O K E 1 6 2 9 0 . 1 1 P O K E 1 6 30 4 . J5 0 C A L L 1 6 2 8 96 0 N = R N D ( 1 0 0 0 ) : F O R K= I T O ~: N E X T K
7 0 G O T O 2 09 9 9 E ~D
T r y I = R N D( ~ O ) + l a n d J = R N D( 2 5 5 ) .
T h e a b o v e m a t e r i a l i s b a s e d o n t h e "P h a s e r "s ou nd e ff ec t f ro m ·t \p pl eI I S ta rt re k.
A d d ZI P t o y ou r c a ss e t t e t a pe I / O wi t h
Z I P T A P E
a f as t - u p t o 4 8 00 b a u d - au d i o ta p e r e c o rd i n ga n d r ec o v e r y sy s t e m f or KI M - l a nd o t he r 6 5 0 2b a s e d s y s t e ms . I t w i l l f u nc t i o n a t t h e h i g h err a t e s o n m o s t go o d q u a li t y c a ss e t t e re c o r d er s ,a nd ev e n e c on o m y t y p e u n i ts s h ou l d b e a bl e t of un c t i o n a t 24 0 0 o r 36 0 0 b a ud .
Th e a s s e m bl e d a n d t e st e d i nt e r f a ce u s es a s i ng l eI C t o tr a n s l a te a u di o i n p ut t o lo g i c l e ve l ,b u f f e rs a n d a t t e nu a t e s s i gn a l s f o r r ec o r d i ng vi a i
e i t he r a n "A UX " o r "M I C " i n p ut . A 1 0 o h m lo a di s in c l u d ed f or r e c o r d er l oa d o n p la y b a c k. O n ly+5 V a t l e s s t ha n 1 0 m a i s r e qu i r e d fo r p o we r .
T h e so f t w a r e u s e s a b ou t 3/ 4 p a g e e a c h f o r th eDu m p a n d l o a d p r og r a m s w hi c h m a y b e r u n a s s u b - Ir o u ti n e s . T h o ug h w r it t e n f o r K I M - I , c h a n ge s a re 's u g ge s t e d f or u s e o n T I M s y s te m s , a n d on l y m in o r 'm o d i f ic a t i o n s s h o u l d b e re q u i r ed t o r un o n a nys y s t em w h i c h h a s a 6 530 o r 6 5 2 2 I / O c hi p .
O n e po r t o f th e P I A i s u s e d f o r d a t a, o n e fo rc o n t ro l o f t h e i n t er f a c e , an d a t h ir d a c t s a s ab u f f e r t o s i m p li f y s of t w a r e i ns t r u c ti o n s .
H a r d w ar e / S o f tw a r e p a c k a ge i s $2 2 . 5 0 + $1 . 0 0 S&H .Ad d $3. 0 0 f o r K I M c a s se t t e c on t a i n i ng s o f t w ar e .NJ r es i d e n ts a d d 5 % t ax . S A S E f o r f r e e i nf o .
LE WIS E DW AR DS , Jr.
Co'or-Teeh TV1 4 5 1 H a m i l to n A v e n ueT r e n t on , N J 0 8 6 2 9
B a c k Is s u e o f M I CR O a r e A v a i la b l e .
S i n g le c o pi e s o f i ss u e s 1 - 6 a r ' tl$1. 5 0 ea c h ,
i n c l ud i n g p os t a g e i n t h e US A a n d C a na d a . Add$ 1 . 2 5 p e r c op y f o r o v e rs e a s Ai r Ha i l p o st a g e o r$ . 5 0 pe r c o py fo r o v e rs e a s S u rf a c e p o st a g e .
G e t "A l l of ~I C R O - Vo l u m e I "
W h i l e t h e s u p p l y l as t s , a l l s i x i s su e s o f M l ' C f lOV o l u m e 1 a r e a v a i la b l e as a "p r e ss - b o a r d" bounds e t . No w y o u ca n g e t a s e _c on . d. s e t t o k e ~p b l ?U"'dw h i l e y o u s e p a r a te y o u r Indi v i d u a l copres I n t oa n o t eb o o k b y c a t e go r i e a . Or ' . ge t . a ~t f o r 8
f r ie n d w h o h as jus t b o u gh t , o r I S th I n k I n g 8 b o ~tb u y i ng , a 6 5 0 2 b as e d s y st e m . O r , h o w a b o u t as e t f o r y o u r c om p u t e r c l u b
Jl o c a l l i b r a ry o r the
l i br a r y w h er e y o u w o r k. Ih e p r ic e f or t he c o m-p l e t e se t is $7 . 5 0 i n c lu d i n g p o st a g e i n t h e U S A .P os t a g e t o a l l o t h e r c o u n t ri e s i ~ $ 1 . 0 0 s u rf a c eo r $ 4 . 0 0 A i r M a i l . I f y o u a re I nt e r e s te d , a c t
n o w , s i n ce w e w i l l p r o b a bl y no t b e r e pr i n t i ngt h es e i s s u e s a ga i n .
Name: •••••••••••••••••••••••••••••••••••••••••
S t r e e t : •••••••••••••••••••••••••••••••••••••••
C i ty: •••••••••••••••••••••••••••••••••••••••••
S ta te : •• •• •• •• • •• •• •• • •• •• ••• Z IP ••••••••••••
I ss ue N um be r: 1- 2 3 4 5 6
"A l l o f MI C R O - V o l u me I ":
S e n d O l e c k o r I t :Jney Or d e r t o :
M I CR O , P . O . B o x J , S . C h el m s f o rd , M A 01 8 2 4
- - - - - - -Southern California 6502 CenterComputer Components of Orange County
6791 Westminster Ave., Westminster, CA 92683 714-898-8330Hours: Tues-Fri 11 :00 AM to 8:00 PM - Sat 10:00 AM to 6:00 PM(Closed Sun. Mon)
Why S ho uld Y o u Buy From Us?Becouse we can help you solve your problems and answer yourquestions. We don't claim to know everything but we haveenough references and contacts in the 6502 field that we can
help you answer your questions.
Sign up for 6502 Information Exchange and Worl"\shopsSystem Meetings Next Meeting
Kim. Vim. Super Kim 2nd Saturday of Month Sept. 9 Super KimCommodore PET 3rd Saturday of Month Sept. 16 Pet Documentation
Apple II 4th Saturday of Month Sept. 23 New programsand peripherals
APPLEII we are the Apple Experts
New Software
$10.00
$10.00
$ 5.00
$10.00
• APP LE POWEP . COM TP .OL IM TEP .FACE
- Thisinterface plugs into any peripheral slot on the Apple
board and provides 16 channels of control. Power Contro
modules plug into the interface via a ribbon cable. Each
Power Control module provides 4 seperote 11OVA.C.
Circuits at 12 amps. Up to 4 Power Control Modules
may be used with each Interface.
-Control Room Lights. Stereo Equipment 5ecurity Systems
Electrical Appliances
-Handle Up to 1000 WattS per Channel Directly From
Program Control
=-Complete Isolation of the Computer From the ACLine
-PRICE-
• Apple Power Interface Oaard and One Power Control
Module (~95.0Q)
• Additional Power Control Modules (Controls Four AC
Grcuirs) (~350Q)
Memory for Apple "• Set of 8 16K RAM CHIPS $200.00
• Set of 8 4K RAM CHIPS $ 20.00
• Micrapraducts Co-resident Assembler
• Universal Data Management
• Super Othello• Graph Plotter w/ axis
Bob l3ishops:
• Apple Tolker
• Color Organ
• Dancing Man
• Space Maze
$20.00
$50.00
$10.00
$10.00
• P P.OGP .AM M ABLE P P.IM TE P. IN TE P.FACE (S 80.00)
-On board EPROMPrinter Driver
-Full Handshake Logic
-High 5peed Parallel Output Port Capability
-Provision for 256 Oyte I/O Drive in EPROM
-Printer. Driver Programs Available for Centronic.
5WTp(·40. and Other Printers
We are O range Co unty's o nlyAuthorized Commodore Pet Dealer• Commodore PET(8K) $795- • PETPrinter (delivery Sept.) $595
• Svnertek's VIM-I $269 • Commodore KIM-I $245
• Microproducts New Super Kim 395 (Demonstration at Kim Worl~shop Sept
Send for a complete list of software and new product information.
Mastcrcharge, Visa. 8 of A accepted. No C.O.D. Allow rwo weeks [or personal check to clear Add $1.50 for handling and postage. Forcomputer svstcm, please add $10.00 [or shipping, handling. and insurance. California residents add 6~; sales tax.
The three arrays mentioned above each store par-tial and intermediate results of the calcula-tions. Each byte of an array contains either
one or two digits, depending on the value of thevariable, TEN. If the number of requesteddigits for Pi is less than about 200, it is
possible to store two digits per byte; other-wise, each byte must contain no more than onedigit. (The reason for this distincLion occursin line 1070 where an arithmetic overflow canoccur when trying to evaluate higher order termsof the series if too many digits are packed intoeach byte.)
Robert J . Bishop1143 W. Badillo, Apt E
C O y ina, C A 91722
The program evaluates the series expansion forPi until the next term of the series results ina value less than the requested precision. Line1055 computes the variable, ZERO, which can betested to see if an underflow in precision hasoccurred. This value is then passed back to themain program where, in line 270, it determines
whether or not the next term of the series isneeded.
Results
Figure 2 shows the calculated value of Pi to1000 decimal places. Running the program to getthese results took longer than it did to writethe program I (The program ran for almost 40
hours before it spit out the answer.) Howeverit took less than two minutes to produce Pi to35 decimal places, the same accuracy to whichLudolph von Ceulen spent his whole life strivingforI
Since the 'program is written entirely in BASICit is understandably slow. By rewriting all or
part of it in machine language its performancecould be vastly improved. However, I will leavethis implementation as an exercise for anyonewho is interested in pursuing it.
Figure 1.
Program Listing
)LISTe REI'I * * * APPL.EF~I * * *
~ I T T E N 8\': B O B B IS H O P5 CALL -936: VTAB 113 : TAE .:5 : P RIN T
" H O W M A N Y D IG I T S 0 0 " ' O U I ~ A N T "
1 8 I NPUT S I Z E15 CA lL -93 62 8 T E N = 1 0 : I F S IZ E ) 2e e THEN 5 e
3 8 T E N= 1 00 : SI Z E = ( SI Z E + 1 ) / 2~ ~ = 4 9 9 6 : T E R I ' I = 81 9 2 : R E9 J L T=
122886 8 D IY=1000: AOO=200B: S U B : : : S e o o :
I N I T = 4 e e 9 : C C P r ' = S O O 978 D II'I COH5T flN T(2 ): CONSTANT(1 )
= 2 5 : CONSTANT(2)=239
6: 15
Everyone knows that the value of Pi is about3.1416. In fact, its value was known this accu-ratelyas far back as 150 A.D. But it wasn'tuntil the sixteenth century that Francisco Vietasucceeded in calculating Pi to ten decimalplaces.
Around the end of the sixteenth century theGerman mathematician, Ludolph von Ceulen, workedon calculating the value of Pi until he died atthe age of 70. His efforts produced Pi to 35decimal places.
During the next several centuries a great dealof effort was spent in computing the value of PIto evern greater precision. In 1699 AbrahamSharp calculated Pi to 71 decimal places. Bythe mid 1800' sits val ue was known to severalhundred decimal places. Finally, in 1873, anEnglish mathematician, Shanks, determined Pi to707 decimal places, an accuracy which remainedunchallenged for many years.
I was recently rereading myoId copy of Kasner &Newman"s Mathematics and the Imagination
I was recently rereading myoId copy of Kasner &Newman's Mathematics and Imagination (Simon &
Schuster, 1940), where I found the series expan-sion:
.,.,., ~ (b(-I) 1<+1
/\ = L2 1 < . _ 1 ) 5 2 1 1 . - 1
K=I
00
L(.=1
4(-1)k+1
The book indicated that this series convergedrather quickly but "... it would require tenyears of calculation to determine Pi to 1000
decimal places." Clearly this statement wasmade before modern digital computers were avail-able. Since then, Pi has been computed to manythousands of decimal places. But Kasner &
Newman's conjecture of a ten-year calculationfor Pi aroused my curiousity to see just howlong it would take my little Apple-II computerto perform the task.
Program Description
My program to compute the value of Pi is shownin Figure 1. It was written using the Apple IIcomputer's Integer BASIC and requires a 16K
system (2K for the program inself; 12K for datastorage). The program is fairly straightforwardbut a brief discussion may be helpful.
The main calculation loop consists of lines 100through 300; the results are printed in lines400 through 600. The second half of the listingcontains the multiple precision arithmetic sub-routines. The division, addition, and subtrac-tion routines start at lines 1000, 2000, and3000, respectively.
In order to use memory more efficiently, PEEKand POKEstatements vere used for arrays insteadof DIM statements. Three such arrays are usedby the program: POWER,TERM,and RESULT. Eachare up to 4K bytes long and start at the memorylocations specified in line 50 of the program.
1 8 9 R E " I ' f 4 I N L C G >125 F ~ PASS= 1 TO 215e G O S L E ; I N I T2 9 0 G O S L f . ; C O f ' I r '
218 PO INT ::TE I\ 7' I: D I Y I D £ = E > 1 ' : !))SUB
D IY
2 2 8 I F S lG N ) e THEN G O S U B ftc
2 3 1 3 I F SIGN{e T H E N G O S U 8 S I . £2 ' I e E X P = O ( P + 2 : 5IGN=-SIGN2 5 e POINT::POj,£~:: DIYIDE=ClWSTAfH(
P A SS ;': GOSU F.:0 1 V
2 W I F PASS=? T H E N G O S U E : D IY2 7 8 I F Z E R O { ) 0 T H E N ; 2 0 0
JJ e N E X T PASS
4 8 t l R E " PR WT TI£ R E S U L T
s e e PRINT : P R I N T
516 PRINT "H£ VALUE OF P I T O "; ( T E N / iO O + 1 ) * S IZ E . ; " D E C IM A L P L A CE S : " : P R I N T
93 F ' R I H T P EE K (R£ SUL T); •. ";
5 3 e FOR P LA CE "'f <:f:S ULT + 1 TO RE5U l T+S I Z E
5 4 f i I F TEN=: :1 f ! T H E N 5713
~ I F PEEK ( P LHC[ )( 11 3 T H E N r 'RHHI t S · j
578 P RIN T P E E K (Plf lCE);
~I N E X T PUn:~ P R IN T6 0 0 E .N !)
1003 f~ EI'! l)IVI5IO N S Uf:RO UTlN f
1 8 1 1 3 D I G I r : : : iJ : 2 £ 1 ' : 0 = = 9
1 8 2 1 3 F O R F ' L A C £ = P O I N T T O P O H l T + S I Z E193f i C o I G l i · : ~ I ) I G I T + PEEK (PLACE)1 9 4 £ 1 p u o n E N T ::1) I G IT/CII V W E
11N) R £ 5 W U E : : : f) I G I T MOD D I V I D E1 8 5 5 Z E R O : = Z E k ' I J O~: ( Q U O T I E N T + R E S I t IUE)
3m8 D IF F E RE lI : E = P E EK ( R ES U L T + f tA C D- P E E K ( T E R t 1 + P l A C E ) - l O O N
3848 LlB=0
3rle I F 01 F F E R H I C D = 0 TI£N 3eoo3 8 6 9 I ) I F F E RE N C £= D I F F E R E N C E + T E N3 870 LO AN =1
3888 POKt R E S U L T + P l A C E , D I F F E R f N C E
3890 N E X T PUn :3 1 8 9 R E T U R N
4 8 l ! 8 R E " IN In f l . I Z E R E G I S T E R S48le F O R PLAC£=0 TO S I Z E
482e POKE POl£R+PLACL e~ PO~! TE~PL~,0
4 8 4 1 3 I F PASS=1 T HE N F 'J fC E R E 5 U l. T +P L O C e : , e
4 8 S e N E X T purr486e POKE P ( )I ,( R, 161PA55 t 2
4978 I F P AS S= 1 THE N 011lIDf=5
4&\ I F PAS~;=2 T H E N 01\111)£=;239
49ge PO I H T = P O W E : R : G O S U B 01\1
4190 E X P = l : S I ~ : : J - l * P A 5 S4 1 1 0 R E T U R N
5 8 I l l 1 \ : £ " C O P Y " F ' O I o l E R " IN TO Q T fR M "
5 8 1 1 3 F O R PLACE=0 TO S I Z E592e POKE TER I' I+P l .ACL P E E f : : ( F ' O f , ! E R +
PLOCD583e NEXT F 'L O C E
5 9 4 e RETU~:N
H £ V A L l I E O F P I T O 1 8 0 0 D E C IM A L P L O C E 5 :
Michael J. McCann28 Ravenswood TerraceCheektowa ga, NY 14225
M o s t c o m p u t e r h o b b y i s t s d o a l l o r m o s t o f t h e i rp r o g r a m m i n g i n B A S I C . T h i s i s u n f o r t u n a t e s i n c et h e r e i s m u c h t o b e g a i n e d f r o m m a c h i n e c o d el e ve l p r og r am m in g . On t h e a v e r a g e , m a c h i n e l a n -g u a g e p r o g r a m s a r e 1 0 0 t i m e s f a s t e r t h a n t h e i r
B A S I C - e q u tv a l en t s . I n a d d i t i o n , m a c h i n e l a n g -u a g e p r o g r a m s a r e v e r y c o m p a c t , m a k i n g e f f i c i e n tu s e o f m e m o r y . I h a v e w r i t t e n a s i m p l e 6 5 0 2a s s e m b l e r i n C o m m o d o r e B A S I C ( s e e l i s t i n g ) w i t ht he f ol lo wi ng f un ct io ns :
T h e r e a r e t w o w a y s o f r e t u r n i n g c o n t r o l t o B A S I Cf r o m m a c h i n e l a n g u a g e . T h e R T S ( R e t u r n f r o mS u b r o u t i n e ) i n s t r u c t i o n m a y b e u s e d a t a n y t i m ee x c e p t w h e n i n a u s e r m a c h i n e l a n g u a g e s u b r o u -t i n e . R T S r e t u r n s c o n t r o l t o t h e c a l l i n g B A S I C
p r o g r a m . I n c o n t r a s t t h e B R K ( F o r c e B r e a k ) i n -s t r u c t i o n d o e s n o t r e t u r n c o n t r o l t o t h e c a l l i n gB A S I C p r o g r a m ; i n s t e a d c o n t r o l i s r e t u r n e dt o t h e u s e r , i . e . s y s t e m p r i n t s R E A DY w i t h t h ec u r s o r .
1 . I n p u t s o u r c e c o d e a n d a s s e m b l e2 . S a v e o bje c t c o d e o n t a p e3. L o a d o bje c t c o d e f r o m t a p e4 . R u n m a c h i n e l a n g u a g e p r o g r a m w t ~h S Y S5 . R u n m a c h i n e l a n g u a g e p r o g r a m w i t h U S R6 . L i s t m a c h i n e l a n g u a g e p r o g r a m
I h a v e i n c l u d e d a s h o r t m a c h i n e l a n g u a g e p r o -g r a m . W h e n r u n t h i s p r o g r a m w i l l l e a v e a p a t -t e r n o f s m a l l w h i t e d o t s o n t h e u p p e r h a l f o fP E T' s C RT .
I N P U T S O U R C E C O DE A N D A S S E M B L E- S y m b o l i c a d d r e s s e s a n d o p e r a n d s a r e n o t p e r -
m i t t e d- A l l a d d r e s s e s a n d o p e r a n d s m u s t b e s u p p l i e d
i n b a s e 1 0
- E a c h l i n e o f s o u r c e c o d e i s a s s e m b l e d a f t e re n t r y- S o u r c e c o d e i s i n p u t t e d i n t h e f o l l o w i n g
f o r m a t :( mn em on ic )( on e o r m or e s pa ce s) (o pe ra nd )
- T h r e e p s e u d o i n s t r u c t i o n s a r e s u p p o r t e dO RG -S t ar t w it h t hi s a dd re ssN O T E : i f t h e u s e r d o e s n o t s p e c i f y t h e o r i g i n ,
i t w i l l b e s e t a t 8 2 6 b a s e 1 0DC -De fi ne c on st an t, p la ce t he o pe ra nd v al ue
i n t h e n e x t l o c a t i o n i n m e m o r yE N D- E n d o f p r o g r a m s o u r c e c o d e
S AM PL E M AC HI NE L AN GU AG E P R OG RA M L IS TI NG
8 2 6 0 33A A 9 6 6 L DA I M 1 0 2
8 28 033C A 2 0 0 L DX I M 08 30 0 33E 9D 0 0 8 0 S T A X 3 2 1 6 88 33 0 34 1 E 8 I N X8 34 034 2 F O 03 B E Q 38 36 0 34 4 4 C 3E 0 3 J M P 8 308 39 0 34 1 E A N O P8 4 0 034 8 E A N ~8 4 1 0 34 9 9D 0 0 8 1 S T A X 330 2 48 4 4 0 34 C E 8 I N X8 4 5 0 34 D F O 0 3 B E Q 38 4 1 0 34 F 4 C 4 9 0 3 J M P 8 4 18 5 0 0 35 2 0 0 B R KA V E O B J E C T C O DE O N T A P E
- O b je c t c o d e s a v e d u n d e r f i l e n a m e s u p p l i e d b yu s e r
- O r i g i n a d d r e s s s a v e d w i t h p r o g r a m
L O A D O B J E C T C O DE F R O M T A P E- L o a d s o bje c t p r o g r a m u n d e r f i l e n a m e s u p p l i e db y u s e r
- O b je c t c o d e i s s t o r e d i n m e m o r y w i t h t h e s a m eo r i g i n a d d r e s s u s e d w h e n t h e p r o g r a m w a sa s s e m b l e d
S AM PL E M AC HI NE L AN G UA GE P RO G RA MA S I N P U T T ED F R O M T H E K E Y B O A R D
? O R G 8 2 6? L DA I M 1 0 2? L DX I M 0? S TA X 32 16 8? I N X? B E Q 3? J M P 8 30? N O P? N O P? S TA X 330 24? I N X
? B EQ 3? J M P 8 4 1? B R K? E N D
R U N M A C H I N E L A N G U A G E P R O G R A M W I T H S Y S- T r a n s f e r s c o n t r o l o f t h e 6 5 0 2 t o a n a d d r e s s
s u p p l i e d b y t h e u s e r
R U N M A C H I N E L A N G U A G E P R O G R A M W I T H U S R- T r a n s f e r s a u s e r s u p p l i e d v a l u e t o t h e
6 50 2 a cc um ul at or- T r a n s f e r s c o n t r o l o f t h e 6 5 0 2 t o a n a d d r e s s
s u p p l i e d b y t h e u s e r
L IS T M AC HI NE L AN G UA GE P RO GR A M- L i s t i n g i s p r o d u c e d b y d i s a s s e m b l i n g o b je c t
c o d e- Di s a s s e m b l y i s i n t h e f o l l o w i n g f o r m a t :( d ec i ma l a d dr e ss ) (h e xa d ec i ma l a d dr e ss ) (b y te n l)( b y t e # 2 ) ( b y t e n 3 ) ( m n e m o n i c ) ( o p e r a n d )
T h e f o l l o w i n g a r e a s o f m e m o r y a r e a v a i l a b l e f o ry o u r m a c h i n e l a n g u a g e p r o g r a m s w h e n t h i s a s s e m -b l e r i s i n m e m o r y : l o c a t i o n s 1 8 8 4 - 8 1 8 4 a n d , i ft a p e #2 i s n o t u s e d , l o c a t i o n s 8 2 6 - 1 0 2 4 .
1 R EM 65 02 AS SEMB LER PR OGRA M2 R EM B Y MI C HAEL J. M C C ANN3 REM FO R USE ON THE C OMMO DORE PE T1 0 DI MM N$ (2 56 ) , BY J( 25 6) ,C O$ (1 6)20 FOR E =O TO 2 5530 READ M N$(E ),BY J(E)40 NEX T60 FOR E =O TO 1 5
70 R EAD C O$(E )80 NEXT90 PRIN T C HR $( 1 4 7):P RINT1 00 PRI NT"1 -IN PUT SOU RC E C ODE AND A SSEM BLE":PRI NT1 1 0 PRI NT"2 -SA VE O BJE C T C ODE O N T APE":PRI NT1 20 PRI NT"3-LO AD O BJE C T C ODE FR OM TA PE": PRIN T130 PRI NT"4 -RU N MA C HIN E LAN GUAG E PROG RAM W ITH SY S"1 40 PRI NT"5 -RU N MA C HIN E LAN GUAG E PROG RAM W ITH USR "1 50 PRI NT"6 -LI ST MA C HINE L ANGU AGE PR OGRA M"1 80 GET A $:IF A$="" G OTO 1 8 01 90 IF VA L(A$ )=O OR VA L(A $»6 GOTO 1 8 02 00 O N V AL (A $) G OS UB 1 40 00 ,2 00 00 ,9 00 0, 10 00 0, 11 00 0, 29 002 1 0 GOTO 9 0
1 00 0 S X=I NT (DC /1 6)1 01 0 U N=DC -( SX .1 6)1 02 0 S X$=C O$(S X)1 030 U N$=C O$(U N)1 040 HX$ +SX$ +UN $1 05 0 RE TURN2900 PR INT C HR$ ( 1 47 )2 91 0 I NP UT "S TA RT A DDR ES S" ;, AD:=03000 IF 1 =24 GOTO 5 0503001 1 =1 +13005 IB=PEEK (AD)301 5 IF MN$( IB)<>"N ULL" GO TO 3050302 5 DC =I B:GO SUB 1 0 00:G OSUB 1300 03030 P RINT AD;AD$ TAB( 1 ~) HX $ ". "304 0 A D=AD+1 :G OTO 3000305 0 pN BYJ (IB) GO TO 3060 ,309 0,40 503060 DC =IB :GOS UB 1 0 00:G OSUB 1 300030 70 P RI NT A D;A D$ T AB (1 2) ;H X$ ;T AB (2 1) ;M N$ (I B)307 5 A D=AD+13080 GOTO 5 030309 0 DC =I B:GO SUB 1 0 00400 0 B 1 $=HX$40 1 0 DC =P EEK( AD+1 ):GO SUB 1 00040 1 1 B2$=HX$40 24 GOS UB 130 00:P =DC
4 030 P RI NT A D;A D$ T AB (1 2) ;B 1$ ;" ";B 2$ ;T AB (2 1) ;M N$ (1 B) ;T AB (2 7) ;P40 35 AD=AD+2404 0 GO T O 503040 50 DC =IB:G OSUB 1 00040 60 B 1 $=HX $4070 DC =PE EI(A D+1 ):GOS UB 1 00040 80 B2 $=HX $4090 DC =P EEK( AD+2 ):GO SUB 1 000
5000 B3$=HX$5 0 10 O P =P E EK ( A D+ 1) +( P EE K (A D+ 2) . 25 6 )5011 GOSUB 130005 02 0 P RI NT A D;A D$ T AB (1 2) ;B 1$ ;" ";B 2$ ;" ";B 3$ ;T AB (2 1) ;M N$ (I B) ;T AB (2 7) O P502 5 AD=AD+35030 GOTO 3000
5050 GET A$:IF A$="" GOTO 50505051 IF A$=CHR$(19) TH EN I=O:RETURN\5052 IF A$<>CHR$(13) GOTO 50505070 I=O:PRINT CHR$(147)5080 GOTO 30006 0 00 D AT A B R K, 1 ,O R AI X ,2 , N UL L ,0 , NU L L, 0 ,N U LL , 0, O R AZ ,2 , AS L ,2 , NU L L, 0 ,P H P ,16 0 10 D AT A O R AI M .2 . A SL A .1 . NU L L. 0 .N U LL . 0. O R A. 3. A SL . 3. N UL L .0 . BP L . 2. O RA I Y. 26 02 0 DA TA N UL L ,O , N U LL , 0 , NU LL ,O , O R AZ X, 2 , AS LZ X, 2 , N U LL , 0 , C LC , 1 ,O RA Y' .36 0 30 D AT A N U LL , 0, N UL L ,0 , NU L L, 0 , OR A X, 3, A SL X ,3 ,N U LL , 0 ,J S R, 3, A ND IX , 2, N UL L ,06 0 40 D AT A N U LL , 0, B IT Z, 2 ,A N DZ ,2 , RO L Z, 2 ,N U LL , 0, P L P, 1 ,A N DI M ,2 , RO L A, 1 ,N U L L, 06 0 5 0 D AT A B I T, 3, A ND ,3 ,R O L, 3, N UL L ,0 , BM I ,2 , A ND IY , 2, N UL L ,0 , NU L L, 0 , NU L L, O6 0 6 0 D AT A A N DZ X, 2 ,R O LZ X, 2 , NU L L, 0 ,S E C, 1 ,A N DY , 3, N U LL , 0, N UL L ,0 , AN DX , 36 0 7 0 D AT A R O LX , 3, N UL L ,0 , R TI , 1, E OR I X, 2 ,N U LL , 0, N U LL , 0, N UL L ,0 , EO R Z, 2 ,L S R Z, 2
6 0 80 D AT A N U LL , 0, P HA , 1, E OR I M, 2 , LS R A, 1 ,N U LL , 0, J MP , 3, E O R, 3, L SR , 3, N UL L ,O6 0 9 0 D AT A B V C, 2 ,E O RI Y , 2, N UL L ,0 , NU L L, 0 ,N U L L, 0 ,E O RZ X, 2 ,L S RZ X, 2 ,N U L L, O6 1 00 D AT A C L C, 1 ,E O RY , 3, N UL L ,0 , N UL L ,0 , NU L L, 0 ,E O RX , 3, L S RX , 3, N UL L ,0 , RT S ,16 1 1 0 D AT A A DC I X, 2 ,N U LL , 0, N U LL , 0, N UL L ,0 , AD CZ ,2 , R OR Z, 2 ,N U LL , 0, P LA , 1, A DC I M, 26 1 2 0 D AT A R O RA , 1, N UL L ,0 , JM I ,3 ,A DC , 3, R OR , 3, N UL L ,0 ~B V S ,2 , AD CI y ,2 , NU L L, O6 1 30 D AT A N U LL , 0, N UL L ,0 , AD CZ X, 2 , RO R ZX , 2, N UL L ,0 , SE I , 1, A DC Y ,3 ,N U LL , O, N UL L , O6 1 4 0 D AT A N U LL , 0, A DC X ,3 ,R O RX , 3, N UL L ,0 , NU L L, 0 ,S T AI X , 2, N UL L ,0 , NU L L, 0 ,S T YZ , 26 1 5 0 D AT A S T AZ ,2 , ST X Z, 2 ,N U LL , 0 ,D EY , 1, N UL L ,0 , TX A ,1 , N UL L ,0 , ST Y ,3 ,S T A, 36 1 6 0 D AT A S T X, 3, N UL L ,0 , BC C ,2 , S TA I Y, 2 ,N U LL , 0, N UL L ,0 , S TY ZX , 2, S TA ZX , 2, S TX ZY , 26 1 70 D AT A N U LL , 0, T YA , 1, S TA Y ,3 ,T X S, 1 ,N U LL , 0, N UL L ,0 , S TA X ,3 ,N U LL , 0, N UL L ,O6 1 80 D AT A L DY I M ,2 , LD AI X ,2 , LD XI M ,2 , N UL L ,0 , LD YZ ,2 , LD AZ ,2 , L DX Z, 2 ,N U LL , O6 1 9 0 D AT A T A y, 1 ,L DA I M, 2 ,T A X ,1 , NU L L, 0 ,L DY , 3, L DA , 3, L DX , 3~ NU L L, 0 ,B C S, 26 2 00 D AT A L DA I Y, 2 ,N U LL , 0, N UL L , 0, L DY ZX , 2, L DA ZX , 2, L DX Z Y, 2 ,N U LL , 0, C LV , 1
6 2 10 D AT A L DA Y , 3, T SX , 1, N UL L ,0 , LD YX , 3, L DA X ,3 ,L DX Y ,3 ,N U LL , 0 ,C P YI M ,2 , CM P IX , 26 2 20 D AT A N U LL , 0 ,N U LL , 0, C PY Z, 2 ,C M PZ , 2, DE C Z, 2 ,N U LL , 0, I NY , 1 ;C M PI M ,2 , DE X ,16 2 30 D AT A N U LL , 0 ,C P Y, 3, C MP , 3, DE C ,3 ,N U LL , 0, B NE , 2, C MP I Y, 2 , NU L L, 0 ,N U LL , O6 2 40 D AT A N U LL , 0, C MP ZX , 2, DE C ZX , 2 ,N U LL , 0, C LD ,1 , CM P Y, 3, N UL L ,0 , NU L L, O ,N U LL , O6 2 50 D AT A C M PX , 3, DE C X, 3, N UL L ,0 , cp x i M, 2 ,S B CI X ,2 , NU L L, 0 ,N U L L, 0 ,C P X, 2 ,S B CZ ,26 2 60 D AT A I N CZ ,2 , NU L L ,0 , IN X ,1 , SB C IM , 2, N O P, 1 ,N U LL , 0, C PX , 3, S BC , 3, I NC , 36 2 70 D AT A N U LL , 0 ,B E Q, 2 ,S B CI Y ,2 , NU L L ,0 , NU L L, 0 ,N U LL , 0, S BC Z X, 2 ,I N CZ X, 2 ,N U LL , 0, S E D, 16 2 80 D AT A S B CY , 3, N UL L ,0 , NU L L, 0 ,N U LL , 0 ,S B CX , 3, I NC X ,3 ,N U LL , 06 29 0 DA TA 0 ,1 ,2 ,3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F9000 PRINT CHR $(t47)901 0 INPUT "EN TER FILE NAME";N$9020 OPEN 1,1,0,N $9030 IN PUTI1,ZZ9040 INPUTI1,EN9050 FOR AD=ZZ TO EN9060 IN PUTI1,DA%9070 POKE AD,DA%9080 NEXT9090 CL OSE 19100 RE TURN
6: 19
~ i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i ~ ~ ~ c : l (!) i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i l i
P RI NT C HR $( 14 7)INPUT "ENTER ADDRESS IN BASE 10";ADIF AD>65535 GOTO 10000SYS(AD)RETURNP RI NT C HR $( 14 7)I NP UT "E NT ER A CC UM UL AT OR V AL UE ";A CIF AC<O OR AC>255 GOTO 11010INPUT"ENTER ADDRESS IN BASE 10";ADP OK E 2 ,I NT (A D/ 25 6)P O KE 1 , AD -( I NT ( AD /2 5 6) . 25 6 )X=USR(AC)RETURNA=AD:S3=INT(AD/4096)A=A-S3·4096S2=INT(A/256)A=A-S2·256S=INT(A/16)U=AD-(S3·4096+S2·256+S·16)S3$=CO$(S3)S2$=CO$(S2)S$=CO$(S)
U$=CO$(U)AD$=S3$+S2$+S$+U$RETURNP R I N T C H R $ (1 4 7 ) :A D =8 2 6 :Z Z= 8 26P RI NT " (M NE MO NI C) ( SP AC E) ( OP ER AN D) "GOSUB 15000F=OFOR E=O TO 255I F M N$ =M N$ (E ) T HE N B Y=B Y%( E) :F =1 :C D=E :E =2 56NEXTIF F=O GOTO 14260ON BY GOSUB 14100,14130,14180GOTO 14020
POKE AD,CDAD=A0+1RETURNIF OP>255 OR OP<O THEN PRINT "ERROR":RETURN' P OK E A D, C DPO KE A 0+1 ,OPAD=A0+2RETURNIF OP>65535 OR OP<O THEN PRINT "ERROR":RETURNPOKE ADtCDB2=INT(OP/256)B1=OP-(B2·256)
PO KE A 0+1 ,B1PO KE A 0+2 ,B 2AD=A0+3RETURNIF MN$="ORG" OR MN$="END" OR MN$="DC" GOTO 14280PRINT "ERROR":GOTO 14020IF MN$="ORG" GOTO 14300GOTO 14340IF FO=1 THEN PRINT "ERROR":GOTO 14020FO=1
I F MN$="EN D" GOTO 1 4360GOTO 1 438 0EN=AD-1RETURNP OKE AD, OPAD=AD+1GOTO 1 4020INPU T A $
IF LEN(A $)<3 THE N PRINT "ERROR":GOTO 1 5000IF LEN(A$ )=3 THEN MN$ A$:OP=O :RETURNS =O:FOR M=1 TO LEN(A$ )IF MID$(A$,M, 1 )=" " THEN S=M:M =LEN(A$ )NEXTIF S=O THEN MN$=A$ :RETURNMN$=LEFT$(A$,S-1 )OP=VAL(RIGHT$(A$,LEN(A$)-S»RETURNP RI NT C HR $( 14 7) :S Z=0INPUT "ENT ER PR OGRAM NAME"jN $OPEN 1 ,1 ,1 ,N$P RI NT #1 ,ZZ: DA J=ZZ: GO SU B 2 01 10
P RI NT #1 ,E N: DA J=E N: GO SU B 2 01 10FOR AD=ZZ TO ENDA%=PEEK(AD)PRIN T#1,DAJ :GOSUB 201 1 0NEXTC LOSE 1RETURNSZ=LEN(STR$(DAJ»+SZ+1IF SZ<192 THEN RE TURNPOKE 59 41 1 ,53T=TIIF (TI-T)<6 GO TO 201 50
POKE 59 41 1 ,61SZ=SZ-191RETURN
6:21
\.:----------'--~~C}clC) ...
MICRO .. PSYCHA bi monthl y newsl et ter for those int erestedin sh aring ide as an d e xperien ces about theuse of micro s and m inis in psychia try a ndps ychol og y .. C ommu nicati ons netw ork, i nfoabout hardwar e, softwa re, researc h, boo krevie ws, etc. $l O/year to MIC R O-PSYC H ,26 Trum bul l Street , N ew Hav en, C T 0651 1 .
T h e C O N N E C T I C U T m i c r o C O M P U T E l 1 A DA p t e r m o d e l 1 2 0 0 i s t h e f i r s t i n a l i n e o f p e r i p h e r a l a d a p t e r s f o r t h eCO M M ( ) [ x J l. I I :E T . T h e C m C A DA 1 2 0 ' " d r i v e s a n kS-232 p r i n t e r f r o m t h e P E T I E E E - 4 8 8 b u s . T h e C I I I CA DA 1 2 1 l 1 Q1l l o w st h e P E T o w n e r t o o o t a in h a r d c o p y p r o q r a m l i s t i n g s , «' I d t o t y p e l e t t e r s , m «' l u s c r i p t s , m a i l i n g l a b e l s , t a b l e s
o f d a t e , p i c t u r e s , i n v o i c e s , g r E p h s , c h e c k s , n e e d l e p o i n t p a t t e r n s , e t c . , u s i n g a s t a n d a r d R S - 2 32 p r i n t e r .T h e c r n e A r A m o d e l 1 2 ~B c o m e s p s s e m b l e d a n d t e s t e d , w i t h o u t p o w e r s u p p l i e s , c a s e , o r R S - 2 32 c o n n e c t o rf o r $ 9 ~. 5 0 . T h e C m C A DA 1 2 ~C c o m e s c o m p l e t e f o r $ 1 6 9 . 0 "' . S p e c i f y b a u d r a t e w h e n o r d e r i n g . ( 30 0 b a u d i ss u p p l i e d u n l e s s o t h e r w i s e r e q u e s t e d . I n s t r u c t i o n s f o r c h e n g i n g t h e b a u d r a t e a r e i n c l u d e d . )
W O k D P R O C E S S l k F O H T H E C O M M O DO R E P E T
C O N N E C T I C U T m i c r o C O M P U T E R n o w h a s a w o r d p r o c 8 !: s o r p r o g r a m f o r t h e C O M M O DO R E P E T . T h i s p r o Qr a m p e r m i t sc o n p o s in o a n d p r in t t n o l e t t e r s , f l y e r s , a d V e r t i s e m e n t s , m a n u s c r i p t s , a r t i c l e s , e t c . , u s i n g t h e C O M M O [J ) k E P E Ta n d a n kS-:l32 p r i n t e r .
s c r i p t d i r e c t i v e s i n c l u d e l i n e l e n g t h , l e f t m a r g i n , c e n t e r i n g , «' I d s k i p . E d i t c o m m a n d s a l l o w t h e u s e r t oi n s e r t l i n e s , d e l e t p . l i n e s , m o v e l i n e s , c h «' l g e s t r i n g s , s a v e o n t o c a s s e t t e , l o a d f r o m c a s s e t t e , m o v e u p , m o v ed o w n , p r i n t a n d t y p e .
T h e C r n C W o r d P r o c e s s o r P r o Qr a m a d d r e s s e s a n R S - 2 32 p r i n t e r t h r o u g h a C m C p r i n t e r a d a p t e r .T h e e r n c W o r d P r o c e s s o r P r o Qr a m i s a v a i l a b l e f o r $ 2 9 . 5 0 .
k S - 2 32 T O C U H H E N T L O O P / T I L A DA P T E H
:...---.----T h e C m C A r A p t e r m o d e l 4 ~0 h a s t w o c i r c u i t s . T h e f i r s t c o n v e r t s a n R S - 2 32 S i g n a l t o a 2 ' " m a c u r r e n t l o o ps t o n e t , a n d t h p . s e c o n d c o n v e r t s a 2 0 m a c u r r e n t l o o p s i g n a l t o a n k S - 2 32 s i g n a l . W i t h t h i s d e v i c e ac o m p u t e r ' s t e l e t y p e p o r t c a n b e u s e d t o d r i v e a n H S - 2 32 t e r m i n a l , o r v i c e v e r s a , w i t h o u t m o d i f i c a t i o n o f t h ep o r t . T h e C m C A DA 4 0 1 1 c a n a l s o b e p a r e l e l l e d t o d r i v e a t e l e t y p e o r I I S - 2 32 p r i n t e r w h i l e s t i l l u s i n g t h ec o m p u t e r ' s r e q u l a r t e r l "l l n a l . T h e C m C A DA 4 0 0 c a n e a s i l y b e m o d i f i e d t o b e c o m e a n k~-:l32 t o T I L a n d T T L t oI l S - 2 32 A C A p t e r . H I e C m C A I J A 4 0 0 d o e s n o t a l t e r t h e b a u d r a t e a n d u s e s s t a n d a r d p o w e r s u p p l i e s . T h e c u r r e n tl o o p I s i s o l a t e d r i o m t h e R S - 2 32 s i g n a l b y o p t o i s o l E t o r s .
T h e C m C A I J A 4 ' 1 0 I s t h e p e r f e c t p a r t n e r f o r K I M i f y o u w a n t t o u s e a n R S - 2 32 t e r m i n a l i n s t e a d o f ac u r r e n t l o o p ~e l e t v p e . ,
T h e C m C A ~A 4 ~"' S c o m e s w i t h d r i l l e d , p l a t e d t h r o u g h s o l d e r P a d s a n d s e l l s f o r $ 2 4 . 5 0 . T h e c m e A DA 4 ~Bc o m e s w i t h h a r r i e r s t r i p s a n d s c r e w t e r m i n a l s a n d s e l l s f o r $ 2 9 . 5 0 . ,',_',
T h i s a n n o u n c e m e n t \n s c o m p o s e d o n a C O M M ( ) [X 1 H E P E T a n d p r i n t e d o n a G ET e r m i N e t u s i n ' 1 , : C m C A DA 1 2 0 0 C n r in t e r a d a p t e r a n d t h e C m C W o r d P r oc e ss o rP r o q r i J m .
N a m e : L A B E L E RS y s t e m : T I M b a s e d o r a n y 6 5 0 2 b a s e d s y s t e mM e m o r y : l KL an gu ag e: A ss em bl yH a r d w a r e : P a p e r T a p e P u n c h o n T T YDe s cr ip t io n : T hi s p ro gr am p u nc h es l eg ib le c ha r-a c t e r s o n a p a p e r t a p e a n d i s u s e f u l f o r t h e
l a b e l i n g o f p u n c h e d p a p e r t a p e s . A 6 4 c h a r a c t e rs u b - s e t o f A S C I I i s u s e d . T h e r e i s l i m i t e de d i t i n g c a p a b i l i t y o n t h e d a t a . T h e r e a r e an u m b e r o f o p t i o n s f o r c h a r a c t e r s i ze , s t a r t i n ga d d r e s s a n d T I M o r 1/ 0 i n de p en d en t c o de .C o p i e s : N o t S p e c i f i e dP r i c e : $ 4 . 0 0I n c l ud e s : C o m m e n t e d s o u r c e l i s t in g , o p e r a t i n ga n d m o d i f y i n g i n s t r u c t i o n s , a n d a h e x t a p e .O r d e r i n g I n f o : S p e c i f y t h e f o l l o w i n g :
C h a r S i ze 5 x 5 o r 5 x 8S t a r t i n g a d d r e s s 0 2 0 0 o r 1 0 0 0S y s t e m T I M o r 1/0 I n d e p e n d e n t
A u t h o r : G i l H o u s eA va i l ab le f ro m:
G i l H ou seP . O . B o x 1 5 8C la rk sb ur g, M D 2 07 34
N a m e : H U E YS y s t e m : A n y 6 5 0 2 b a s e d s y s t e m .M em or y: 2 .5 KL a n g u a g e : A s s e m b l yH a r d wa r e : A S C l l 1/0 d e v i c e .De s cr ip t io n : H UE Y- 65 i s a s c ie n ti f ic c al cu l at o rp r o g r a m f o r t h e 6 5 0 2 m i c r o p r o c e s s o r s . I t o p e r -a t e s f r o m y o u r A S C I I k e y b o a r d l i k e a c a l c u l a t o r ;w i l l o u t p u t t h r o u g h y o u r r o u t i n e s t o a T V s c r e e no r T e l e t y p e; i s p r e p r o g r a m m e d t o d o t r i g f u ?c -t i o n s , n a t u r a l a n d c o m m o n l o g s , e x p o n e n t l a lf un ct i on s a nd o t he r g oo d ie s ; a n d i s p r og r am ma b lef or m an y o th er f un ct io ns ( fi na nc ia l, a cc ou nt in g,m a t h e m a t i c s , e n g i n e e r i n g , e t . c . ) y o u w o u l d l i k et o c a l l a t t h e p r e s s o f a s i n g l e k e y .C o p i e s : N o t S p e c i f i e d .P r i c e : H e x Du m p a t a n y e v e n p a g e - $ 5 . 0 0
M a n u a l a n d L i s t i n g s - $ 2 0 . 0 0O rd er i ng I nf o: S pe ci f y s ta rt i ng a dd r es s.A u t h o r : Do n R i n d s b e r gA va il ab le f ro m:
T h e B I T S t o pP . O . B o x 9 73M o b i l e , A L 36 6 0 1
N a m e : W o r d P r o c e s s o r P r o g r a mS y s t e m : P E TM e m o r y : N o t S p e c i f i e d .L an gu ag e : N ot S p ec i fi ed .H a r d w a r e : R S - 2 32 p r i n t e r a d d r e s s e d v i a a O n c
p r in t er a d ap t er .De s c r i p t i o n : T h i s p r o g r a m p e r m i t s c o m p o s i n g a n dp ri nt in g l et te rs , f ly er s, a dv er ti se me nt s, m an u-
s c r i p t s , a r t i c l e s , e t c . , u s i n g t h e C o m m o d o r e P E Ta n d a n R S - 2 32 p r i n t e r . S c r i p t d ir e c t i v e s i n -c l u d e l i n e l e n g t h , l e f t m a r g i n , c e n t e r i n g , a n ds k i p . E d i t c o m m a n d s a l l o w t h e u s e r t o i n s e r tl i ne s, d el et e l i ne s , m ov e l in e s, c ha ng e s tr in g s,s a v e o n t o c a s s e t t e , l o a d f r o m c a s s e t t e , m o v e u p ,m o v e d o w n , p r i n t a n d t y p e .C o p i e s : N o t S p e c i f i e d .P r i c e : $ 2 9 . 5 0O r d e r i n g I n f o : N o n e .A u th or ( s) : N ot S p ec if i ed .A va il ab le f ro m:
C o n ne c t i cu t m i c ro C o m pu t e r1 5 0 P o c o n o R o a dB ro ok fi el d, C T 0 68 04
N a m e : ZI P T A P ES y s t e m : K I M - l , m a y b e e a s i l y m o d i f i e d f o r a n yo t h e r 6 5 0 2 s y s t e m w i t h p r o g r a m m a b l e t i m e r 1/ 0
M e m o r y : 3/4 p a g e e a c h f o r r e a d a n d w r i t e p r o g s .H a r d w a r e : S i m p l e s i n g l e I C a u d i o t o l o g i c l e v e lc o n v e r t e r a n d o u t p u t b u f f e r l a t t e n u a t o r o n 2" s q .b o a r d . Di r e c t i o n a l c o n t r o l , 4 c o n n e c t i o n s t o
c o m p u t e r .De s c r i p t i o n : A f a s t a u d i o c a s s e t t e d a t a r e c o r d -i n g a n d r e c o v e r y s y s t e m . P r o g r a m m a b l e t o 4 8 0 0b a u d . L o a d s 8 K i n l e s s t h a n 1 5 s e c o n d s . F o l -l o w s K I M - l p r o t o c o l o f o p e n e n d e d r e c o r d l e n g t hw i t h s t a r t a d d r e s s , e n d a d d r e s s , a n d r e c o r d I Ds p e C i f i e d a t u s u a l K I M l o c a t i o n s . L o a d b y !D,i g n o r e ID, a n d r e l o c a t e m o d e s . Da t a r e c o r d e d i nb i n a r y f o r m w i t h 2 b y t e c h e c k s u m e r r o r d e t e c -t i o n . E a s i l y r e l o c a t e d , c a n e i t h e r s t a n d a l o n eo r b e u s e d a s s u b r o u t i n e s . R e q u i r e s p r o g r a m m -a b le t im e r 1/0.
C o p i e s : A b o u t 1 2 , ju s t i n t r o d u c e d .P r i c e : $ 2 2 . 5 0 +1.0 0 s h i p & h a n d . $ 3. 0 0 e x t r af or K IM c a ss e tt e.I n c l ud e s : A s s e m b l e d a n d t e s t e d i n t e r f a c e , c o m -m e n t e d l i s t i n g s , s u g g e s t e d c h a n g e s t o r u n o n T I Ma n d o t h e r s y s t e m s . C a s s e t t e h a s s o f t w a r e r e c o r -ded a t H Y P E R T A P E a n d s t a n d a r d K I M s p e e d s p l u s 8 Kt e s t r e c o r d i n g u s i n g ZI P T A P E .O r d e r i n g I n f o : W i t h o r W i t h o u t t a p e .A u t h o r : L e w i s E d w a r d s , J r .A va il ab le f ro m:
L ew is E dw ar ds1 45 1 H am il to n A ve nu eT r en t on , N J 0 86 29
N a m e : F O C A L ' ( 'DE C T r a d e m a r k )S y s t e m : A p p l e I IM e m o r y : N o t S p e c i f i e d .L an gu ag e: A ss em bl erH a r d w a r e : A p p l e I IDe s c r i p t i o n : T h i s i s a n e x t e n d e d v e r s i o n o f t h eh i g h - l e v e l l a n g u a g e c a l l e d F O C A L . F O C A L w a sc r e a t e d f o r t h e DE C P DP - 8 . It i s s i m i l a r t oB A S I C . F C L 6 5 E , a s t h i s v e r s i o n i s c a l l e d , i sn o w a v a i l a b l e f o r t h e A p p l e I I .C o p i e s : N o t S p e c i f i e d .P r i c e : A p p l e I I f o r m a t c a s s e t t e - $ 2 5 . 0 0
M i ni - Ma n ua l - $ 6 .0 0F C L 6 5 E U s e r ' s M a n u a l - $ 1 2 . 0 0C o m p l e t e S o u r c e L i s t i n g - $35 . 0 0
O r d e r i n g I n f o : S p e c i f y p a r t s d e s i r e d .A u th or ( s) : N ot S p ec if i ed .A va il ab le f ro m:
T h e 6 50 2 P r og r am E x ch an g e2 92 0 M oa naR e n o , N V 8 9 5 0 9
N a m e : W A R L O RDSS y s t e m : A p p l e I I ( P E T v e r s i o n u n d e r d e v e l . )M e m o r y : N o t S p e c i f i e dL an gu a ge : N ot S pe c if i edH a r d w a r e : A p p l e I I
De s c r i p t i o n : I t i s t h e Da r k A g e s , i n t h e k i n g -d o m o f N e r d , a n d a l l i s c h a o s . K i n g M e l v i n h a sd i e d w i t h o u t a n h e i r a n d a d i r e p o w e r s t r u g g l ei s t a k i n g p l a c e t o s e e w h o w i l l e m e r g e a s t h en e w K i n g . Y o u a n d t h e o t h e r p l a y e r s a r e t h eW A R L O RDS , a n d y o u w i l l h a v e t o d e c i d e w h a t c o m -b i n a t i o n o f m i l i t a r y m i g h t a n d s k i l l f u l d i p l o m -a c y w i l l l e a d y o u t o v i c t o r y .C o p i e s : N o t S p e c i f i e dP r i c e : $ 1 2 . 0 0O r d e r i n g I n f o : S p e c i f y A p p l e I I V e r s i o nA u t h o r : N o t S p e c i f i e dA va il ab le f ro m:
De a l e r s w h o c a r r y s o f t w a r e f r o mS pe ak ea sy S of tw ar e L TD.
N a m e : R e a d / W r i t e P E T M e m o r yS y s t e m : P E TM e m o r y : 8 K R A ML a n g u a g e : B A S I CH a r d w a r e : S t a n d a r d P E TDe s c r i p t i o n : P e r m i t s u s e r t o k e y i n t o m e m o r yh e x c o d e s b y t y p i n g h e x s t a r t i n g a d d r e s s a n dt h e n t y p i n g t h e h e x d i g i t s i n s e q u e n c e d e s i r e d .Di s p l a y m e m o r y a s b o t h h e x c o d e s a n d a s s e m b l vl a ng ua ge m ne m on ic s ( t ra ns la t es r el at iv e a dd r es s
i n t o a c t u a l h e x a d d r e s s ) . S t o r e s m e m o r y o n t a p ea n d l o a d s m e m o r y f r o m t a p e i n t o a n y d e s i r e d m e m -o r y l o c a t i o n . E x e c u t e s m a c h i n e - l a n g u a g e p r o -g r a m s .C o p i e s : J u s t r e l e a s e d - 32 s o l d f i r s t d a y .P r i c e : $ 7 . 9 5 - p o s t p a i dI n c l ud e s : C a s s e t t e t a p e; c o m p l e t e i n s t r u c t i o n s( i n c l u d i n g u s e o f R O M s u b r o u t i n e s t o i n p u t a n do u t p u t m e m o r y f r o m k e y b o a r d a n d t o s c r e e n ) .O r d e r i n g I n f o : F r o m a u t h o rA u t h o r :
Do n K et ch um31 3 V a n N e s s A v e n u eU p l a n d , C A 9 1 7 8 6
( De al er I nq ui ti es I nv it ed )
N a m e s : E / 6 5 a n d A / 6 5S y s t e m : A n y 6 5 0 2 b a s e d s y s t e mM e m o r y : N o t S p e c i f i e dL a ng ua ge : A ss em bl yH a r d w a r e : T e r m i n a l . C a s s e t t e o p t i o n a l .De s c r i p t i o n : E / 6 5 i s p r i m a r i l y d e s i g n e d t o e d i ta s s e m b l e r s o u r c e c o d e . L i n e o r i e n t e d c o m m a n d ss p e c i f y i n p u t / o u t o r t e x t a n d f i n d s p e c i f i cl i n e s t o b e e d i t e d . S t r i n g o r i e n t e d c o m m a n d sa l l o w t h e u s e r t o s e a r c h f o r a n d o p t i o n a l l y
c h a n g e a t e x t s t r i n g . A l s o c h a r a c t e r o r i e n t e dc o m m a n d s a n d l o a d i n g a n d d u m p i n g t o b u l k d e v i c e .A / 6 5 i s a f u l l t w o - p a s s a s s e m b l e r w h i c h c o n f o r m st o M O S T e c h n o l o g y s y n t a x . A f u l l r a n g e o f r u n -t i m e o p t i o n s a r e p r o v i d e d t o c o n t r o l l i s t i n gf o r m a t s , p r i n t i n g o f g e n e r a t e d c o d e f o r A S C I Is t r i n g s a n d g e n e r a t i o n o f o b je c t c o d e .C o p i e s : N o t S p e c i f i e dP r i c e : $ 1 0 0 e a c hI n c l u d e s : O b je c t f o r m o n p a p e r t a p e o r K I M t y p ec a s s e t t e . L i s t i n g s o f s o u r c e c o d e a r e a v a i l a b l ef o r $ 2 5 . 0 0 e a c h . F u l l d o c u m e n t a t i o n o n t h e i n -s t a l l a t i o n a n d u s e o f e a c h p a c k a g e i s p r o v i d e d .A u t h o r : N o t S p e c i f i e dA va il ab le f ro m:
C OM PA S - C om pu te r A pp li ca ti on s C or po ra ti onP . O . B o x 6 8 7A m e s , I A 5 0 0 1 0
T h e M I C R O S o f t w a r e C a t a l o g i s a c o n t i n u i n g f e a -t u r e o f M I C R O . I f y o u h a v e a n y 6 5 0 2 b a s e d s o f t -w a r e f o r s a l e ( o r e x c h a n g e o r f r e e ) , p l e a s e s e n da c o m p l e t e d e s c r i p t i o n w h i c h i n c l u d e s A L L o f t h ei n fo r ma t io n l i st e d.
N a m e o f p r o g r a m :6 50 2 s ys te ms :M em or y l oc at io ns r eq ui re d:L an gu ag e ( BA SI C, A ss em bl er , . .. ):H a rd w ar e r e qu i re d :De sc ri pt io n o f p ro gr am :N u m b e r o f c o p i e s s o l d t o d a t e :P r i c e :W h a t i s i n c l u d e d i n p a c k a g e ( c a s s e t t e , l i s t i n g s ,
p a p e r t a p e , . . .) :O r de r in g i n fo r ma t io n :A u th o r( s ) :C o m p a n y N a m e a n d A d d r e s s :
T h e M I C R O S t a f f w i l l n o t w r i t e u p e n t r i e s f o rt h e M I C R O S o f t w a r e C a t a l o g f r o m o t h e r m a t e r i a l st h a t y o u m a y p r o v i d e . F i r s t , w e d o n o t h a v e t h et i m e t o d o t h i s . S e c o n d , s i n c e w e a r e n o t a sf a m i l i a r w i t h y o u r s o f t w a r e a s y o u a r e , w e c a nn o t h o p e t o p r o v i d e a s m e a n i n g f u l a w r i t e - u p a sy o u c a n . C o v e r a l l p e r t i n e n t i n f o r m a t i o n , b u tk e e p t h e w r i t e - u p t o a r e a s o n a b l e l e n g t h . M I C R Or e s e r v e s t h e r i g h t t o r e je c t o r e d i t a n y
m at er i al s ub mi tt ed f o r t hi s c ol um n.
S e n d t o :
M I C R O , P . O . B o x 3, S . C h e l m s f o r d , M A 0 1 8 2 4
THE MICRO HARDWARE CATALOC
A C a l l f or I nf or ma ti on
S t a r t i n g w i t h t h e n e x t i s s u e o f M I C R O , w e p l a nt o r u n a H a r d w a r e C a t a l o g s i m i l a r t o t h e c u r r e n tS o f t w a r e C a t a l o g . I n f o r m a t i o n f o r t h i s c a t a l o gw i l l c o m e f r o m s u p p l i e r s o f t h e h a r d w a r e : t h em a n u f a c t u r e r , d i s t r i b u t o r o r d e a l e r . T h i s w i l lN O T b e a "P r o d u c t R e v i e w " n o r w i l l i n c l u s i o no f i n f o r m a t i o n i n d i c a t e e n d o r s e m e n t o f t h e p r o -d u c t b y M I C R O . W e w i l l n o t k n o w i n g l y i n c l u d e
p r o d u c t s w h i c h d o n o t m e e t t h e f o l l o w i n g g u i d e -l i n e s :
S ug ge st io ns f or H ar dw ar e C at al og i nf or ma ti on :
1 . C o v e r a l l o f t h e i m p o r t a n t f e a t u r e s o f y o u rp r o d u c t , b u t b e c o n c i s e . M I C R O r e s e r v e s t h er i g h t t o e d i t s u b m i s s i o n s w h i c h a r e t o o l o n g .
2 . A " p i c t u r e i s w o r t h a t h o u s a n d w o r d s" a n d
d o e s n ' t c o s t y o u a t h i n g . S i n c e i t i s a l o tm o r e w o r k t o i n c l u d e p i c t u r e s i n t h e c a t a l o g , w ea r e n o t s u r e t h a t w e w i l l b e a b l e t o u s e t h e m ,b u t i f i t i s p o s s i b l e , w e w i l l .
3. S u b m i t s e p a r a t e p r o d u c t s a s s e p a r a t e i t e m sf o r t h e c a t a l o g . F i r s t , w e w i l l n o t p r i n t c o n -g l o m e r a t e l i s t i n g s . S e c o n d , y o u g e t m u l t i p l ee xp os ur e w it h s ep ar at e l is ti ng s.
4 . Do n ' t w a s t e y o u r t i m e o r o u r s s u b m i t t i n gm a t e r i a l w h i c h d o e s n o t d i r e c t l y r e l a t e t o t h e6 50 2 f am il y.
1 . T h e p r o d u c t m u s t b e d i r e c t l y r e l a t e d t o 6 5 0 2i n t e r e s t s . F o r e x a m p l e , a g e n e r a l p u r p o s ec o d i n g f o r m w o u l d n o t q u a l i f y .
2 . T h e p r o d u c t m u s t b e c u r r e n t l y a v a i l a b l e :A . S o m e u n i t s m u s t h a v e a l r e a d y b e e n
d e l i v e r e d .B . De l i v e r y o n n e w o r d e r s s h o u l d b e n o m o r e
t h a n s t o c k t o f o u r w e e k s .
3. T h e p r i c e m u s t b e i n c l ud e d , a l o n g wi t h a n yo t h e r p e r t i n e n t i n f o r m a t i o n a b o u t d i s c o u n t s ,s hi pp in g c ha rg es , e tc .
M I C R O r e s e r v e s t h e r i g h t t o r e je c t a n y i t e ms u b m i t t e d f o r i n c l u s i o n i n t h i s c a t a l o g .
t h e d a t a f i e l d a r e pr o c e s s e d a s s t a n d a r d h e xv a l u e s .
B R El I T h i s c o m m an d a l l o w s t h e u s er t o i n se r ta b r e a k p o i nt a n yw h e r e d e s i r e d i n h i s p ro -
g r a m . W h e n t h i s p o i nt i s s u b se q u e n t l y r e a c h edd u r i ng e x ec u t i o n o f h i s p r o g r a m, c o n t r ol w i l l b ep a ss e d t o l ey b o a r d Mo d e o f DE BU G a n d f u r th e re x e c ut i o n of th e u se r p r o g r am w i l l ef f e c t i v e l yb e t e m p o r a ri l y d i s c o n t i nu e d . A l s o a t t hi s t i m et h e u s e r a r e a wi l l b e r e s t o re d t o t h e o r i gi n a lc o n f i g ur a t i o n e xi s t i n g a t t h e t i me o f t h e br e a k -p oi nt i ns er ti on .
A D[BUGGI.G A I D -F OI l T H E 1111-1
A lb er t G as ps r305 Wsll StreetHebron, CT 06248
I np ut S eq ue nc e:
P r e s s K e ys
4 Da t a C h ar a c t e r s B "A D"
S e e on Di s p l a y
4 c h a r B 1
DE B U G i s a p r o g r a m d es i g n e d t o as s i s t t h e u s e ri n d e bu g g i n g a n d m a ni p u l a t i n g p r o g ra m s . I t r e -s i de s i n m e m o r y l o c a t i o n s 1 7 8 0 - 1 7 E 6 a n d pr o -v i d e s a m e a n s f o r i n s e r ti n g b re a k p o i n ts i n au s er - p r o g r am , m o v i n g b l oc k s o f by t e s t h r o u g h o utm e m o r y , f i l l i n g m e m o r y w i t h r e p e t i t io u s da t a ,a n d c al c u l a t i n g b r a n c h v a l u e s . I t u s e s s e l e ct e dK IM m on it or s ub ro ut in es .
O pe ra ti ng H od es
DE B U G h a s t h r ee o p e r a t i ng m o de s :
1 . K e y b o a rd M o d e : DEB U G r e m a i n so ;1 n a w ai t l o o pa n ti c i p a t i ng k e y bo a r d en t r y w h i c h w il l b e r ec o g -n i ze d a s e i t h e r d a ta o r c o m m a n d ch a r a c t e r s.Th i s mo d e i s in i t i a t e d ei t h e r ' b y u s i n g t h e K I Mm o ni t o r t o s t a r t a t l o c a t i o n 1 7 8 E , o r b y t h eex e c u t i o n o f a p r e v i o us l y i n se r t e d b re a k p o i n t i na u s e r p r o g r am .
2 . E xe c u t e M od e : DE B U G e x e c u t e s l o gi c to s e r -vi c e a u s er c om m a n d . Th i s mo d e is co m p l e t e d i n
m i cr o s e c o n ds a n d w i l l n o t b e no t i c e a b l e b y th eu s e r .
3. N o n - C o n t r o l M od e : DEB U G r el i n q u i s he s c o n -t r o l w h e n t h e u s er ke y s i n "R S", o r "S T " d u r i n gK e y b o ar d M o de , o r u s es th e C O N T I N UE C o m m a nd .
T o s ta r t , t h e u s er m u s t f i r s t l o a d "B 5 " i nt o1 7F E a n d "1 7 " i n t o 1 7F F us i n g t h e KI M . T h e n t h eu se r b e g in s DE BU G b y s t a r ti n g a t l o c a ti o n 1 7 8 E .T h i s p u ts DE B U G in t o K e y bo a r d M o d e. T h e u s e rt h e n k e y s i n c o m bi n a t i o n s o f t h e 1 6 d a t a c h a r -a c t er s a v a i l a b l e o n t h e k e y b o a rd . In p u t d a t a i sd is p l a y e d i n a m a n n e r s i m i l a r t o t h a t o f t h e K I M- f ro m r i g h t t o l e f t - ex c e p t t ha t o n l y t h el e f t - mo s t f i v e d i s p l ay p o s i t io n s a r e u t i l i ze d( ex ce pt io ns a re n ote d b el ow ).
T h e u s er m us t c o n ti n u e t o k e y in ch a r a c t e r s u n -t i l h e i s s a t is i f i e d t h a t t h e r e q u i re d d a ta isi np u t . T h en o ne o f t h e s e v er a l C o mm a n d c o d ec h a r a ct e r s a va i l a b l e ( B , C , D, E , o r F ) i s ke y e di n. A t t h i s p o i n t , or a t a n y t im e p re v i o u s tot hi s , i f t he i n p u t i s n ot c o r r e c t an d t h e us e rw i s he s to c h a n g e t h e d i s p l a y , he me r e l y c on t i n -u es t o e n t e r da t a u nt i l t h e d i s p l a y s t r in g i sc o r re c t . W h en t he d is p l a y c o n ca t e n a t i on i s sa t -i sf ac to ry ( ei th er 2 o r 4 d at a c h a ra c t e r s a n d 1C o m m a n d c h ar a c t e r ) h e k ey s i n "A D". No w DE B U Gw i l l g o i n t o E x e c ut e M o d e ( w i th o u t e ch o i n g t h een t r y o f "A D") an d im m e d i a t el y e x am i n e s t hel a s t p r e vi o u s c h a ra c t e r in p u t . I f th i s c h a r -ac t e r i s n o t a l e g i t i m a te C o m m a nd c h a r a c t er ( B ,C , D, E , o r F ) , DE B UG b e c o me s c o n f u s ed a n d wi l lt r a n sf e r t o u np r e d i c t ab l e m e mo r y l o c a ti o n s .T h u s t h e u se r i s h e l d wh o l l y r e s p on s i b l e fo r th eva l i d i t y o f h i s i n p u t . H e s h o ul d a l w a ys c h e c kt h a t e i t h er h i s k ey e d - i n d a t a i s c o r r e c t b e f o r eh i tt i n g "A D", o r t h a t h i s C o m m a n d w a s i n d e ed e x -e c u t ed . N o te : i f a k e y o t h e r t h a n "A D", t h e 1 6d a t a c h a r a ct e r s , "RS ", o r "S T " i s d e p r es s e d , i t sh i gh o r d er 4 b i t s a r e s t ri p p e d a nd t h e r em a i n i n gl o w o rd e r 4 b i t s a r e d is p l a y e d a n d e v a l ua t e d a sw h a t ev e r t h e c o m b i n a ti o n h a p p e ns t o r ep r e s e n t .
As s u m i n g t h a t t he c h a ra c t e r in p u t i m m e d i a te l yp r i o r t o "A D" i s a l e g i t i ma t e C o m m a n d c h a r ac t e r ,DE B U G - s t i l l i n E x e c ut e M o d e - w il l p r o ce s st h e d a t a w h i c h w a a i n p u t p r i o r t o th e C C l Dl Da n dc o d e ( ei t b e r 2 or 4 c h ar a c t e r s ). N o t e t h a t t h ee c - a n d va l u e s ( B , C , D, E , o f F) i f f o u nd i n
Th e 4 Da t a C h a r a c te r s de f i n e t h e B r e a k p o in tl o c a t i o n d e s i re d . T h e B R E A K C o mm a n d sa v e s t h eus e r b y t e a t th e B re a k p o i n t a n d d e p o si t s a B R K
in s t r u c t io n i n p l a ce o f i t . T h u s , t h a t u s erar e a s h o u l d n o t b e a l t er e d by t h e u s er w hi l eDE B U G is i n N o n- C o n t r o l M o d e a n d a B r e a k p oi n t. 1 s e m in e n t , o r t h e B r ea k p o i n t r e t u r n w i l l no tw o rk . M or e t h a n o n e B r e a k p o i nt c a n b e e m in e n ta t o n e ti m e ; h o w ev e r s i n c e DE B U G w i l l st o r e o n l yo n e b y t e a t a t i me , m u l t i p l e s i m ul t a n e o u sB r ea k p o i n t s s ho u l d b e a p ~i e d o n l y a t u se r l oc a -t i on s c o n t a i ni n g t h e s a m e i n s t ru c t i o n . Th i s w a yi t i s i m m a t e ri a l wh i c h B R K t r i g g e rs a r e tu r n t oDE BU G - t h e u se r a r ea w i l l b e pr o p e r l y r e p l a c e d.
T h i s C o m m an d i n c l u de s 1 o f 2 i ns t a n c e s w he r e t h es i x t h d i s p l a y p o s it i o n is u s e d . If t h e s i x thp o s i ti o n c o n ta i n s a 1 , t h e C o mm a n d h a s b e e n c or -r e c t l y p ro c e s s e d . If t h e p o s i t i o n c o n ta i n s a n yo t h e r v a l u e , i t i n d i c a te s t h a t d e p r e s s i on o f t h e"A D" k e y h a s c a u s e d m ul t i p l e b ou n c e s a nd t h e
b y t e s t o r ed b y DE B U G w it h i n i t s el f i s n o w "0 0 " -n o t t h e o r i gi n a l u s e r b yt e . T h u s DE B U G w i l ls t i l l fu n c t i o n c or r e c t l y b u t w i l l n o t c o r r e ct -l y r e s t o re t h e u s e r p o s i t i o n w h e n a B r e a k p oi n tre t u r n i s i n i t i a te d . T h e u s e r mu s t re s t o r e t h el o c a t i on ma n u a l l y ( u s i ng K I M ) a ft e r t h e r e tu r nh a s b e en p e r f o r m e d - o th e r w i s e "0 0 " w i l l b e l e f tin t h e l o c a t i o n .
C O N TI N U E T h i s C o m m an d ca u s e s DE B U G t o p a sse x ec u t i o n t o a u s e r s p e c i fi e d l o c a -
t i o n . I t i s s i m i l a r t o t h e p a ss i n g o f c on t r o lt hr o u g h K I M a n d e i t h e r me t h o d m a y b e u s e d t o e x-e c u te u s e r c o d e .
I np ut S eq ue nc e:
P r e s s K e y s
4 Dat a C h a r a c t er s C "AD"
S ee o n Di s p l ay
4 c h a r C O
T h e 4 Da t a C h a r a ct e r s de f i n e t h e a dd r e s s tow hi c h c o n t r ol i s t o b e p a s s e d . T h e a b o v e d is -p l a y i s on l y m o me n t a r y s in c e c o n t ro l i s i m m ed i -a te l y p as s e d t o a u s e r ar e a ( N o n - C o nt r o l M o d e )T h e p u r p o s e o f t he C o n t i nu e C o mm a n d w i l l u s u al l ybe t o e x e cu t e t o a p r e v i ou s l y in s e r t e d B r e a k -p oi n t . W h e n t h i s o c cu r s , a s p r e vi o u s l y s t a te dc on t r o l r e t u r n s t o l e y b o a r d Mo d e , o f DE B U G :A t t h i s p o i n t . t h e l e f t . oa t 4 d ia p l a y d ig i t sw i l l c o n t a i n t h e a d d r ea a a t wb i c b t be B r e a k po i n twas l o c a t e d . Se e O v e ra l l No t e s '1 f o r a c o n -t in ua ti on w ar ni ng .
HOY! T h i s C o u l a n d w i l l m o v e a b l o c k o f u p t o2 5 6 b y t e s t o a n o t h e r m e m o r y a r e a . I t i s
n o n - d e s t r u c t i v e ( u n l e s s , o f c o u r s e , a s h i f t i sperformtKl)•
I np ut S eq ue nc e:
P re ss K ey s S e e o n Di s p l a y
4 Da t a C h a r a c t e r s F "AD" 4 c h a r F O( F f o r From)
4 Dat a C h a r a c t e r s D "AD" 4 c h a r D O
(D f o r De s t i n a t i o n )2 Da t a C h a r a c t e r s E "AD" X X 2 c h a r E O
( E f or E xe cu te )
T h e 4 Da t a C h a r a c t e r s a b o v e r e p r e s e n t t h e l o c a -t i o n s o n e l e s s t h a n t h e l o c a t i o n s , r e s p e c t i v e -l y , f r o m w h i c h a n d t o w h i c h t h e d a t a i s t om o v e d . T h e 2 Da t a C h a r a c t e r s a b o v e r e p r e s e n tt h e h e x v a l u e o f t h e n u m b e r ~. b y t e s t o b em o v e d . If t h e u s e r d e s i r e s t o m o v e 2 5 6 ( d e c ,)b y t e s , h e m u s t i n p u t "0 0" i n t h e "E " C o m m a n d ."F " a n d "D" e x e c u t i o n m a y b e i n p u t i n e i t h e ro r d e r _ "F " t h e n "D" o r "D" t h e n "F".
M O V E w i l l c o r r e c t l y m o v e b l o c k s o f b y t e sf r o m o n e a r e a o f m e m o r y t o a n o t h e r . H o w e v e r i tw i l l c o r r e c t l y s h i f t b y t e s o n l y i n a n u p w a r dd i r e c t i o n . A t t e m p t i n g d o w n w a r d s h i f t s w i l l r e -
s u l t i n t h e r e p e a t i n g o f a s m a n y o f t h e l a s tb y t e s i n t h e o r i g i n a l b l o c k a s t h e r e i s a d i f -f e r e n c e i n t h e b l o c k p o s i t i o n s . F o r e x a m p l e -s h i f t i n g a b l o c k o f ' s a y ( n ) b y t e s s t a r t i n g a t0 2 0 0 t o a n e w a r e a s t a r t i n g a t 0 2 0 2 w i l l c o r -r e c t l y s h i f t t h e ( n ) b y t e s u p w a r d 2 l o c a t i o n s .A t t e m p t i n g t o s h i f t a b l o c k o f ( n ) b y t e s s t a r t -i n g i n 0 2 0 2 t o a n e w a r e a s t a r t i n g i n 0 2 0 0 w i l lr e s u l t i n t h e l a s t 2 b y t e s o f t h e o r i g i n a lb l o c k t o b e r e p e a t e d d o w n w a r d f r o m t h e i r o r i g -i n a l l o c a t i o n s c o n t i n u i n g t o 0 2 0 0 . T h i s m a y n o tb e c o m p l e t e l y u n d e s i r e a b l e s i n c e - 1 ) n o r m a l l yt h e u s e r w i l l b e i n t e r e s t e d i n e x p a n d i n g a na r e a , n o t i n c o m p r e s s i n g i t (for e x a m p l e , t o a d di n s t r u c t i o n s ) ; a n d , 2 ) t h i s s e r v e s a s a u s e f u lt o o l t o p r o v i d e f i l l e r b y t e s i n m e m o r y w h e nd e s i r e d .
B R A N C H T h i s C o m m a n d a s s i s t s i n c a l c u l a t i n gB ra nc h v al ue s.
I np ut S eq ue nc e:
1 . E n t e r t h e n e c e s s a r y 1 2 b y t e s o f B r a n c h O v e r -l a y , e i t h e r t h r o u g h K I M o r b y t a p e o v e r l a y .( T h e s e w i l l , o f c o u r s e , h a v e t o b e r e s t o r e d t ot h e o r i g i n a l c o n f i g u r a t i o n w h e n t h r o u g h w i t hB R AN C H) .
1 . P u t DE B U G i n t o K e y b o a r d M o d e .
P re ss K ey s
2 c h a r / 2 C h a r . E "AD"
S e e o n Di s p l a y
2 c ha r/ 2 c ha r/ D- VA LU E
T h e f i r s t 2 c h a r a c t e r s a r e t h e 2 l e a s t s i g n i f i -
c a n t v a l ue s o f t h e B r a n c h A d d r e s s . T h e n e x t 2c h a r a c t e r s a r e t h e 2 l e a s t s i g n i f i c a n t v a l u e s o ft h e B r a n c h t o A d d r e s s . T h e" E" s t a n d s f o rE v a l u a t e . T h e c o r r e c t Di s p l a c e m e n t V A L U E w i l la p p e a r i n t h e 5 t h a n d 6 t h d i s p l a y p o s i t i o n s .T h e d i s p l a c e m e n t i s c a l c u l a t e d a s s u m i n g t h a t t h et w o a d d r e s s e s a r e i n t h e s a m e p a g e . F o r p a g eo v e r l a p , e n t r y w i l l h a v e t o b e d o n e t w i c e . W eb e l i e v e t h a t d i f f e r e n t u s e r s w i l l h a v e d i f f e r e n tp r e f e r e n t i a l a e t h o d s f o r d o i n g t h i s , s o o u r o w nm e t h o d , w h i c h 1 s s o m e w h a t i n v o l v e d , i s n o td e s c r i b e d . I f b o t h e n t r i e s a r e o n t h e s a m e p a g eb u t a r e s e p a r a t e d b y a d i s t a n c e g r e a t e r t h a n t h es t a n d a r d b r a n c h r a n g e , t h e v a l u e c a l c u l a t e d w i l lbe i n c o r r e c t . I t i s t h e u s e r ' s r e s p o n s i b i l i t yt o c b~ k f or . ou t- ol '- ra II &ev al ue s.
O ve ra ll N ot es
1 . W h e n a B r e a k p o i n t h a s b e e n e x e c u t e d , DE B U Gd o e s n o t s t o r e a n d t h e n r e s t o r e a c c u m u l a t o rr e g i s t e r , a n d s t a t u s v a l ue s . T h u s , t h e u s e;m u s t t a k e c a r e i n c o n t i n u i n g f r o m a B r e a k p o i n ti f a n y o f t h e s e p a r a m e t e r s h a v e a s u b s e q u e n tb e a r i n g i n f u r t h e r u s e r p r o g r a m e x e c u t i o n .( T h o u g h t h i s a n d o t h e r o m i s s i o n s a r e g l a r i n g d e -f e c t s , n o a p o l o g y i s m a d e - t h e r e w a s ju s t i n -s u f f i c i e n t m e m o r y a v a i l a b l e f o r i n c l u s i o n o f a n yr e f in e m en t s . )
2 . W h e n r e t u r n i n g f r o m a "B R K" i n s t r u c t i o n ,DE B U G p u l l s t h e s t a t u s r e g i s t e r i n f o r m a t i o n f r o mt h e s t a c k a n d i g n o r e s i t . I f t h i s DE B U G v e r s i o ni s u s e d i n c o nju n c t i o n w i t h a n i n t e r r u p t s y s t e m ,l o c a t i o n s 1 7 F E - 1 7 F F m u s t c o n t a i n t h e a d d r e s so f t h e u s e r i n t e r r u p t h a n d l e r . T h e b e g i n n i n g o ft h e h a n d l e r m u s t b e s i m i l a r t o t h a t s h o w n o np a g e 1 4 4 o f t h e K I M P r o g r a m m i n g M a n u a l . T h el o g i c l i s t e d i n e x a m p l e 9 . 7 m u s t b e u t i l ize d a ss h o w n . "B N E B R K P " w i l l p o i n t t o t h e DE B U G l o c a -t i o n d e f i n e d b e l o w . I f t h e u s e r h a n d l e r d e t e r -m i n e s t h a t t h e i n t e r r u p t w a s c a u s e d b y "B R K",t h e n t h e h a n d l e r m u s t ju m p t o l o c a t i o n 17 B 5 .DE B U G w i l l t h e n o b t a i n t h e "B R K" a d d r e s s a n dp e r f o r m s u b s e q u e n t l o g i c t o r e t u r n t h e u s e r b y t et o i t s o r i g i n a l c o n f i g u r a t i o n a n d c o n t i n u e o ni nt o K e yb o ar d M o de .
3. T h i s v e r s i o n o f DE B U G u s e s p a g e ze r o l o c a -t i o n s 0 0 0 0 , 0 0 0 1 , 0 0 0 2 , 0 0 03, a n d 0 0 0 4 , b u t o n l ya s s c r a t c h a r e a s d u r i n g K e y b o a r d a n d E x e c u t eM o d e s . T h e u s e r c a n u s e t h e s e a r e a s a s t e m p o -r a r y s c r a t c h a r e a s w h e n DE B U G i s n o t b e i n g e x -e c u t e d .
4 . Du e t o l i m i t e d i n s t r u c t i o n s p a c e , DE B U G i sp a r t i c u l a r i l y s u s c e p t i b l e t o k e y b o u n c e . T h eu s e r s h o u l d r e m a i n w a t c h f u l o f s u c h o c c u r r e n c e s ,e s p e C i a l l y d u r i n g B R E A K e x e c u t i o n a s p r e v i o u s l yd e s c r i b e d .
5 . M y g o a l h e r e w a s t o f i t a s m u c h DE B U G p o w e ri n t o l o c a t i o n s 1 7 8 0 - 1 7 E 6 a s p o s s i b l e - n o t t ow r i t e a g r e a t b r e a k p o i n t / m o v e / b r a n c h c a l c u l a t er o u t i n e . ( T h a t h a s a l r e a d y b e e n d o n e b y o t h e r s )
T h u s DE B U G h a d t o b e w r i t t e n i n r e l a t i v e l y c o n -c i s e a n d t i g h t c o d e , u s i n g d a t a a s i n s t r u c t i o n s ,i n st ru ct i on s a s d at a, o v er la pp in g i ns tr uc t io ns ,u s i n g t h e s a m e c o d e t o d o d i f f e r e n t t h i n g s ,i ns tr uc ti on m od if ic at io n, p OS it io n i ns tr uc ti on si n p r e s c r i b e d r e l a t i v e l o c a t i o n s , u s e o f "w r i t e -o n l y - m e m o r y", e t c . I d o n o t a p p r o v e o f t h i st y p e o f p r o g r a m m i n g - i n f a c t I s t r o n g l y r e c o m -m e n d a g a i n s t i t . H o w e v e r , i n t h i s c a s e I h o p et h e g o a l I h a d ju s t i f i e s t h e m e s s t h a t DE B U G h a st u r n e d o u t t o b e . I n a n y e v e n t I w o u l d l i k e t op o i n t o u t t h a t a s t i g h t a s t h e c o d e i s , i t i ss t i l l p o s s i b l e t o a d d o t h e r f u n c t i o n s h e r e a n dt h e r e . F o r e x a m p l e t h e v e r s i o n I u s u a l l y u s ed i s p l a y s t h e v a l u e o f t h e a c c u m u l a t o r i n d i s p l a yl o c a t i o n s 5 a n d 6 w h e n r e t u r n i n g b a c k f r o m aB r e a k p o i n t . A t t i m e s I a l s o u s e a n o t h e r v e r s i o nw h i c h d o e s n ' t r e q u i r e t h e "B R K " i n s t r u c t i o n a t
a l l . T h i s i s c o n v e n i e n t w h e n d e b u g g i n g i n t e r -r u p t p r o g r a m s s i n c e n o a d d i t i o n a l i n t e r r u p t i sn e e d e d f o r DE B U G . H o w e v e r , b o t h v e r s i o n s p e n a l -i ze m e i n o t h e r a r e a s , w h i c h m a k e s i t a l l at r ad e -o ff d e ci s io n .
[E d it o r ' s N o t e : G a s p a r s e e m s t o b e s u g g e s t i n ga c o l l e c t i o n o f s p e c i a l i ze d DE B U G p r o g r a m s ,e a c h c u s t o m i ze d t o p r o v i d e a p a r t i c u l a r s e t o fc a p a b i l i t i e s w h i l e r e s i d i n g i n m i n i m a l m e m o r y .U s i n g h i s c o d e a s a s t a r t i n g p o i n t , a "p r o g r a m -w i s e" r e a d e r s h o u l d b e a b l e t o c o n s t r u c t h i s o w ns e t o f , DE BU G a i ds .]
~ i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i , ~ ~ (!i~ C ! ) i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i l
ZER O •ON E •TW O •TH R EE •FO U R •
I N H •PO I NT L •PO I NT H •
RE T UR N •
T BL O FF •J UM P ER •
IN I TI •S C AN DS •G E TK E Y •
1 7 80 B 1 02 E XE C1 7 82 91 001 78 4 8 81 7 85 DO F91 7 87 9 81 7 88 9 5 F31 7 8A A 5 F B1 7 8C 9 5 F41 7 8E 2 0 8 C 1 E S T AR T1 7 91 2 0 1 F 1 F1 7 94 DO F 81 7 9 6 2 0 1 F 1 F K EY1 7 9 9 F O F B1 7 9B 2 0 6A 1 F1 7 9E A 6 0 41 7 AO C 9 1 01 7 A2 F O 301 7 A4 8 5 0 41 7 A6 A 2 0 41 7 A 8 O A1 7 A9 2 6 F 91 7 A B 2 6 F A1 7 A D 2 6 F B1 7 A F C A1 7 B O DO F 6
1 7 B 2 8 5 F 91 7 B 4 F O D817 B 6 3817 B 7 6 81 7 B 8 6 81 7 B 9 E 9 0 21 7 B B 8 5 F A1 7 B D 6 81 7 B E E 9 001 7 C O 85 FB1 7 C 2 A 2 OC
1 7 C 4 E 6 F 91 7 C 6 A O 0 01 7 C 8 B 1 F A1 7 C A 9 D DC 1 71 7 C D B D DB 1 7
1 7 DO 9 1 F A1 7 D2 A 2 O D1 7 D4 A 4 FA1 7 D6 B D D4 1 71 7 D9 8 D DD 171 7 DC DO FF1 7 DE E A1 7 DF E61 7E O 0 61 7E 1 A 91 7E 2 A 21 7E 3 A91 7E 4 6C FA 0 0 C
$ 00 0 0 L OC A TI O N 0 0 00$ 0 0 0 1$ 0 0 0 2$ 0 0 0 3$ 0 0 0 4
$ 0 0F 9 K I M DI SP L AY P O IN T ER S$ O O F A$ O O F B
$ 1 7B 5 I N TE RN A L ADDRE S S
$ 1 7D4 TA B LE O FF S ET$1 7DD I N TE RN A L A DDR ES S
$1 E 8C KI M IN I TI A LI ZE R O UT I NE$ 1 F 1 F K IM S C A N DIS P LA Y RO U TI N E$ 1 F 6A K IM G ET K E YB O AR D CH AR A C T E R
DANDF
L DA IY TW O GE T C H A R TO BE MO V EDS TA I Y ZE RO M OV E I TDEYB NE EX EC C O NT I NU E UN T IL DON ET YA GE T T O OR F R OM A DDR ES SS TA ZX $0 0F 3 ST O RE IT I S SC R AT C HL DA Z P O IN T HS TAZX $0 0F 4J SR I NI T I SE T F LA G S AN D I N IT .J SR SC A NDS DI SP L AY B U FF E RB N E ST A RTJ S R SC A NDS NE W C HA R AC TE R IN P UT ?B E Q KE Y N O, C ON T IN UE T O DI SP LA YJ SR GE TK E Y YE S, GE T T HE C HA R AC T ERL DXZ FO UR PI C K UP L A ST C HA R . I NP U TC MP I M $1 0 I S TH E NE W C H A R. n A Dn ?B E Q PR O C E S YE S. P RO C ES S C U R RE NT C O MM A NDS T AZ FO U R NO . S TO R E I TL DXI M $0 4 AN D S HI F T I T I NT O T HE DI SP L AYA S L AR O LR OLR OLDE XB N E
S T AB E QS E CP L A
S H I F T
I N H SH I FT T H E DI SP L AY L EF TP O I N T LP O I N T H
SH I FT DO N E SH I FT I NG
I N H YE S . A DD NE W C H A R TO DI SP L AYST A RT UN C ON DIT I ON RE T UR N
I GN OR E S TA TU SPL A G ET n FR O Mn A DDR ES SSB C I M $0 2 S UB T RA C T 2ST AZ P OI H TL DIS P LA Y LO W OR DERPL ASB C I M $0 0 S UB T RA C T C AR R Y, IF AN YS T AZ PO I NT H DIS P LA Y HI O R DE RLDII M $O C C H E AT ON R I
I NC IN H C O U NT K EY BO U NC E SLDYI M $0 0L DAI Y PO I NT L G ET U SE R B YT ES T AI $1 7 DC S TO R E I TLDAI $1 7 DB G ET "BR I "
S T AI Y PO I NT L S TO R E I N U SE R A R EALDXl H $O D CH EA T O N R I
P RO C E S L DY Z PO IN T LL DAI TB L OF F PR EP A RE T O G O T O C O M MA ND L O GI CS TA $1 7 DD AL T ER IN S TR U C T I ONB NE JU M PE R JHp T O C O M MA N D L O GI CN OP FU T UR E EI P AN S IO N
T A B L E = $E 6 BR A NC H TO "B "= $0 6 BR AN C H TO "C "= $A 9 BR AN C H TO "D"= $ A 2 B R AN C H TO "E"= $ A 9 BR AN C H T O "F"JH I P O IH T L 0 0 O R ADDRE S S U SE D A S "B R I"
1 7 8 0 38 E X E C S E C I N I T I A L I ZE S U B T R A C T1 7 8 1 A 5 F A L DA Z P O I N T L1 7 8 3 6 9 F D A DC I M $ F D C O R R E C T I O N C O N S T A N T1 7 8 5 E 5 F B S B CZ P O I N T H1 7 8 7 8 5 F 9 S T A Z I N H S T O R E R E S U L T I N DI S P L A Y1 7 8 9 4 C 8 E 1 7 J M P $ 1 7 8 E J U M P T O S T A R T
E x a m p l e s
1 . L o a d DE B U G . L o a d "B 5 " i n t o 1 7 F E a n d "1 7 "i n t o 1 7F F .
2 . S t a r t e x e c u t i o n a t l o c a t i o n 1 7 8 E .
3. De p r e s s i n g a n y o f t h e 1 6 k e y b o a r d c h a r a c t e r sw i l l c a u s e t h e 5 l e f t m o s t d i s Dl a y d i g i t s t os h i f t l e f t a n d t h e n e w c h a r a c t e r t o b e i n s e r t e d
i n t o t h e f i f t h p o s i t i o n .
4 . A s s u m e t h a t t h e r e i s a p r o g r a m i n 0 2 0 0 - 0 2 5 0 .N o w , t o e x e c u t e f r o m 0 2 0 0 - 0 2 4 0 :
o 2 4 0 B A D
o 2 0 0 C A D
Di s p l a y i s 0 2 4 0 B 1
0 2 0 0 C O
0 2 4 0 X X
W h e n t h e u s e r p r o g r a m e x e c u t e s t o l o c a t i o n 0 2 4 0 ,i t w i l l r e t u r n t o DE B U G w h i c h t h e n w i l l r e p l a c et h e o r i g i n a l b y t e a t 0 2 4 0 a n d w i l l r e t u r n t oK e y b o a r d Hod~.
5 . U s e r w i s h e s t o a d d a 3 b y t e Lnst r-uot.Lonin
0 2 4 1 - 0 2 4 3. T h u s h e m u s t s h i f t h i s p r o g r a m f r o m0 24 1- 02 50 t o 0 24 4- 02 53.
o 2 4 0 B A D
o 2 4 0 F A D
Di s p l a y i s 0 2 4 0 B 1
0 2 4 0 F O
( R e m e m b e r t h a t H O V E r e q u i r e s a d d r e s s e st h a n t h e a c t u a l v a l u e s . )
l e s s
X X 0 E A D Di s p l a y i s X X 1 0 E O
( 1 0 = 0 2 5 0 - 0 2 4 1 + 1 )
6 : 2 8
T h i s s h i f t s b y t e s i n 0 2 4 1 - 0 2 5 0 t o 0 2 4 4 - 0 2 5 3.U s e r c a n n o w i n s e r t h i s 3 n e w i n s t r u c t i o n s i n t ol o c a t i o n s 0 2 4 1 , 0 2 4 2 , a n d 0 2 4 3.
6 . U s e r w i s h e s t o l o a d N O P i n t o l o c a t i o n s 0 30 0 -0 3F F . L o a d "E A " i n t o 0 3F F u s i n g K I M . R e t u r n t oD E B U G .
o 3 0 0 F A D
o 2 F F 0 A D
o 0 E A D
Di s p l a y i s 0 30 0 F O
0 2 F F DO
X X O O E O
( M o v e 2 5 6 d e c i m a l b y t es . )
7 . U s e r w i s h e s t o c a l c u l a t e t h e v a l u e r e q u i r e df o r a H E R E B C C S T A R T ·w h e r e H E R E = 0 2 0 4 a n dS T A R T = 0 2 5 0 .
F i r s t , l o a d o v e r l a y ( 1 2 b y t e s )D E B U G .
a n d r e t u r n t o
o 4 5 0 E A D Di s p l a y i s 0 4 5 0 4 A
T h u s t h e b r a n c h v a l u e i s 4 A a n d t h e b r a n c h i n -s t r u c t i o n w i l l b e B C C 4 A .
R e m e m b e r t h a t i f f u r t h e r DE B U G u s a g e i s p l a n n e d ,t h e o r i g i n a l 1 2 b y t e s s t a r t i n g a t 1 7 8 0 h a v e t ob e r ep la ce d.
P ro gr am N ot es
1 . T h e i n s t r u c t i o n l i s t i n g s a t 1 7 B 4 a n d 1 7 E 4a r e N O T e r r o r s a n d m u s t b e p l a c e d i n m e m o r ye x a c t l y a s s h o w n .
2 . L o c a t i o n s 1 7 E 7 a n d 1 7 E 8 a r e u s e d b y t h e K I Mm o n i t o r f o r t a p e c h e c k s u m . H o w e v e r , t h e i r u s a g ei n DE B U G w i l l not i n t e r f e r e w i t h K I M s i n c e t h et w o p r o g r a m s d o n o t , o f c o u r s e , u s e t h e m a t t h es a m e t i m e .
6502 INTER FA CING F OR B EG INNER S:ADDRESS DECODING II
M ar v i n L. D e J o n gD ep t . o f M at h- P hy s ic s
T h e S c h o o l o f t h e O z a r k sP o i n t L o o k o u t , M O 6 5 7 2 6
t a b l e d e s c r i b e s t h e a c t i v i t y w h i c h t a k e s p l a c eo n t h e a d d r e s s b u s a n d t h e d a t a b u s w h i l e t h ep r o g r a m i s r u n n i n g . I t i s o r g a n i ze d b y c l o c kc y c l es , e ac h o ne m i cr o s ec o n d l on g , s t a r ti n g w it h
t h e o p c o d e f e t c h o f t h e C L C i n s t r u c t i o n .
I h o p e y o u d i d n o t t u r n a n y e x p e n s i v e i n t e g r a t e dc i r c u i t s i n t o c i n d e r s w i t h l a s t m o n t h ' s e x p e r i -m e n t s . W e w i l l b e g i n t h i s m o n t h b y c o n s i d e r i n gt h e q u e s t i o n s r a i s e d i n t h e l a s t c o l u m n . Y o uw i l l n e e d t o r e f e r t o t h e c i r c u i t s , t a b l e s , a n dt h e p r o g r a m d e s c r i b e d t h e r e . T h e f o l l o w i n g
C Y C L E A DDR E S S B U S A 1 5 A 1 4 A 1 3 DA T A B U S C O M M E N T S
0 0 2 0 0 0 0 0 C L C o p c o d e P i n 1 o f L S 1 4 5 i s l o w b e c a u s e a d d r e s sl i n e s A 1 3- 1 5 a r e l o w .
0 2 0 1 0 0 0 S T A o p c o d e L E D w i l l g l o w w h e n c o n n e c t e d t o p i n 1 ,b u t n o t t o o t h e r p i n s .
2 0 2 0 1 0 0 0 S T A o p c o d e A l l o t h e r p i n s o n L S 1 4 5 a r e h i g h .
3 0 2 0 2 0 0 0 X X L o w o r d e r a d d r e s s o f s t o r a g e l o c a t i o no n d a t a l i n e s .
4 0 2 0 3 0 0 0 6 0 H ig h o rd er a dd re ss o f s to ra ge l oc at io n
o n d a t a l i n e s .5 6 0 X X 0 a c c u m u l a t o r L E D w i l l l i g h t f o r 1 m ic r os ec o nd if
c o n t e n t s c o n n e c t e d t o p i n 4 o n L S 1 4 5 .6 0 2 0 4 0 0 0 B C C o p c o d e P i n 4 h i g h , p i n 1 l o w . L E D w il l g l o w
o n p i n 1 o n l y .7 0 2 0 5 0 0 0 F B o ff se t 6 5 0 2 i s n o w d e t e r m i n g i f a n d w h e r e t o
b r a n c h . B r a n c h i s t o 0 20 1 b ec au se8 0 2 0 6 0 0 0 g a r b a g e c ar r y w a s c l ea r .
I n t h e p r o g r a m l o o p a d d r e s s l i n e s A 1 4 a n d A 1 3 g oh i g h o n l y d u r i n g c y c l e 5 . T h u s , f o r s i x c y c l e so u t p u t 0 ( p i n 1 ) o f t h e L S 1 4 5 i s l o w . T h e L S 1 4 5i s a n o p e n c o l l e c t o r d e v i c e a n d a c t s l i k e as w i t c h t o g r o u n d w h e n t h e p i n i s i n t h e L s t a t e ,a l l o w i n g c u r r e n t t o f l o w t h r o u g h t h e L E D. Du r -i n g c y c l e 5 , w h e n t h e a d d r e s s o f t h e s t o r a g e
l o c a t i o n i s o n t h e a d d r e s s b u s , p i n 4 i s i n t h el o w s t a t e a n d w i l l c a u s e t h e L E D t o g l o w . E a r t hp e o p l e d o n o t p e r c e i v e o n e m i c r o s e c o n d f l a s h e ss p a c e d s i x m i c r o s e c o n d s a p a r t , s o t h e L E D a p -p e a r s t o g l o w r a t h e r t h a n f l a s h . S i n c e t h e m a -j o r i t y o f t h e l o o p t i m e i s s p e n t ·w it h p i n 1 a tl o g i c 0 , a b r i g h t g l o w i s o b s e r v e d o n t h i s p i n .C h a n g i n g t h e i n s t r u c t i o n f r o m S T A t o L DA h a s n oe f f e c t s i n c e t h e a d d r e s s b u s g o e s t h r o u g h t h es a m e s e q u e n c e f o r a L DA a s i t d o e s f o r a S T A .C h a n g i n g t h e s t o r a g e l o c a t i o n f r o m 6 0 X X t o s o m e -t h i n g e l s e w i l l c a u s e a n o t h e r p i n o f t h e L S 1 4 5t o g l o w . T h e r e s u l t s o f t h e L E D t e s t s h o u l da g r e e w i t h t h e t r u t h t a b l e g i v e n f o r t h e L S 1 4 5 .
u s e d o n m e m o r y e x p a n s i o n b o a r d s . I n t h e p r e s e n tc i r c u m s t a n c e I h a v e d e c i d e d t o m a k e a t r a d e - o f fb e t we e n w a s t in g a d d r es s s p a ce a n d m i ni m i zi n g t h en u m b e r o f c h i p s o n t h e b r e a d b o a r d . O u r p u r p o s eh e r e i s t o c o n f i g u r e s o m e 1/ 0 p o r t s a s s i m p l y a sp o s s i b l e .
T h e d e c o d i n g c i r c u i t i s s h o w n i n F i g u r e 1 . At o t a l o f e i g h t d e v i c e s e l e c t p u l s e s a r e a v a i l -a b l e f o r e i g h t 1/ 0 p o r t s . N o t e t h a t o n e o f t h e8 K s e l e c t s ( 8 K 4 ) f r o m t h e L S 1 4 5 e n a b l e s t h eL S 1 38 w h i c h d e c o d e s t h e t h r e e l o w - o r d e r a d d r e s sl i n e s . A l l o f t h e 8 K 4 s p a c e i s u s e d t o g e te i g h t 1/ 0 p o r t s . U s i n g a 7 4 L S 1 5 4 i n s t e a d o f t h eL S 1 38 a n d d e c o d in g o n m o r e a d d r e s s 1n e w o u l dg i v e 1 6 1/ 0 p o r t s i n t h e e v e n t w e n e e d m o r e . O rw e c o u l d t a k e a n o t h e r 8 K s e l e c t t o e n a b l e a n o t h -e r L S 1 38 o r L S 1 4 5 , g i v i n g u s 8 o r 32 p o r t s , r e -s p e c t i v e l y . T h e r e i s n o d o u b t t h a t a d d r e s ss p a c e i s b e i n g w a s t e d , b u t f e w u s e r s u s e a l l6 4 K , o r e v e n 32 K , s o t h e w a s t e m a y b e ju s t i f i e d .I n F i g u r e 1 , a d d r e s s l i n e s A O - 2 a r e e x t e n d e dd o w n w a r d t o i n d i c a t e t h a t t h e y c o u l d b e d e c o d e db y o t h e r d e v i c e s s u c h a s a n L S 1 38 o r L S 1 5 4 .
T h e p u l s e f r o m t h e d e c o d e r w h i c h o c c u r s w h e n i tr e s p o n d s t o a p a r t i c u l a r a d d r e s s a t i t s i n p u tp i n s i s c a l l e d a d e v i c e s e l e c t p u l s e o r a n
a d d r e s s s e l e c t p u l s e . T h e L S 1 4 5 p r o d u c e s al o g i c 0 o r a c t i v e - l o w d e v i c e s e l e c t p u l s e , s o m e -t im es s ym bo li ze d b y" '1 .. -J '"r Os. T h i s p u l s e i su s e d t o s e l e c t o r a c t i v a t e o r e n a b l e a n o t h e r d e -v i c e i n t h e c o m p u t e r s y s t e m s u c h a s a m e m o r yc h i p , a n 1/ 0 p o r t , a P I A c h i p , o r a n o t h e r d e c o -d e r . A s m e n t i o n e d i n t h e l a s t c o l u m n , t h e d e -v i c e s e l e c t p u l s e f r o m t h e L S 1 4 5 c o u l d b e u s e dt o e n a b l e a 7 4 L S 1 38 w h i c h w o u l d t h e n d e c o d e a d -d r e s s l i n e s A 1 0 - 1 2 , d i v i d i n g a n 8 K b l o c k i n t o 1 Kb l o c k s . S u c h a s c h e m e i s v e r y s i m i l a r t o t h ee x p a n s i o n c i r c u i t s u g g e s t e d i n t h e 1 C1M-1 U SE RM A N U A L , p a g e 7 4 . S i m i l a r c i r c u i t s a r e a l s e
T h e a d d r e s s e s w h i c h e n a b l e t h e d e v i c e s e l e c tp u l s e s 0 5 0 - 7 a r e g i v e n i n F i g u r e 1 . N o t e t h a ts i n c e n o t a l l s i x t e e n l i n e s h a v e b e e n d e c o d e d t op r o d u c e t h e p u l s e s , t h e a d d r e s s e s s h o w n a r e n o tt h e o n l y o n e s w h i c h w i l l w o r k . F o r e x a m p l e , d e -v i c e s e l e c t p u l s e 0 w i l l b e p r o d u c e d w h e n e v e rt h e c o m p u t e r r e a d s o r w r i t e s t o 8 X X O o r 9 X X O ( X Xm e a n s a n y h e x n u m b e r s ) . T h i s s h o u l d c a u s e n od i f f i c u l ty u n l e s s w e t r y t o p u t o t h e r d e v i c e si n t o t h e 8 K 4 b l o c k , i n w h i c h c a s e w e c o u l d s i m -p l y d e c o d e s o m e o t h e r l i n e s . I f y o u r s y s t e md o e s n o t b u f f e r t h e a d d r e s s l i n e s , y o u s h o u l db u f f e r t h e m w i t h t h e c i r c u i t s h o w n i n F i ~u r e 2 .
De c o d i n g C i r c u i t t o S e l e c t I / O P o r t s .I S e e t e x t f o r d e t a i l s .
C o n s t r u c t t h e c i r c u i t s o f F i g u r e s 1 , 2 , a n d 3.I m a n a g e d t o g e t t h e m o n o n e A P c i r c u i t b o a r dwi t h n o d i f f i c u l t y , w i t h r o o m f o r s e v e r a l m o r ec h i p s . I a l s o f o u n d t h a t t h e A P b r e a d b o a r dju m p e r w i r e k i t i s v e r y h a n d y f o r m a k i n g n e a tl a y o u t s . C o n n e c t o n e o f t h e d e v i c e s e l e c t l i n e sf r o m t h e L S 1 38 t o t h e f l i p - f l o p p r e s e t i n p u t( T e s t C i r c u i t , F i g u r e 3) a n d a n o t h e r d e v i c e s e -l e c t l i n e t o t h e c l e a r i n p u t . A p u l s e t o t h ep r e s e t i n p u t w i l l c a u s e t h e Q o u t p u t t o g o h i g h ,
l i g h t i n g t h e Q L E D, w h e r e a s a p u l s e t o t h e c l e a ri n p u t w i l l c a u s e t h e Qo u t pu t t o g o h i g h , l i g h t -i n g t h e Q L ED.
t h e d e v i c e s e l e c t o n t h e a d d r e s s b u s w h i c hp r o d u c e s t h e p u l s e w h i c h f l i p s t h e f l o p . O n em o r e e x p e r i m e n t : c o n n e c t t h e R / W l i n e f r o m t h e6 5 0 2 t o t h e G 1 i n p u t o n t h e L S 138 a f t e r r e m o v -i n g t h e c o n n e c t i o n f r o m G 1 ( p i n 6 ) t o p i n 1 6 .N o w t r y t h e p r o g r a m s a b o v e , u s i n g f i r s t a L DAi n s t r u c t i o n , t h e n a S T A i n s t r u c t i o n . Y o u s h o u l df i n d t h a t t h e p r o g r a m w i t h t h e L DA i n s t r u c t i o n
+5v
T o t e s t y o u r d e c o d i n g c i r c u i t w r i t e a o n e s t a t e -m e n t p r o g r a m , f o r e x a m p l e :
I .
A 0"'"I I, .r-..AO
A ' - -. . 74LS367 5 .r-..A1
A 2""",
7 .r-..A2
A1310 ,
~A13
A 14::::IJ. II
. r- -. A 1 4
A 15 r"o.
1 4 13 .r--..A15
Gl G2
' l _ ! . W ' 5
- = E = -F i g u r e 2 .
0 2 0 0 AD 0 0 8 0 L DA DS O
If t h e l i n e l a b e l e d 8 0 0 0 i s c o n n e c t e d t o t h ep r e s e t o f t h e t e s t c i r c u i t , t h e Q o u t p u t w i l l g oh i g h , l i g h t i n g t h e L E D, w h e n t h e p r o g r a m i s r u n .R u nn in g t he p ro gr am :
0 2 0 0 AD 0 4 8 0 L DA DS 4
w i l l c a u s e a s w i t c h o f t h e f l i p - f l o p i f t h e . li n e8 0 0 4 i s c o n n e c t e d t o t h e c l e a r i n p u t . Y o u
s h o u l d t e s t a l l 8 d e v i c e s e l e c t l i n e s f r o m t h eL S 1 38 w i t h t h e s e p r o g r a m s b y c h a n g i n g t h e c o n -n e c t i o n s a n d t h e a d d r e s s e s . N o t e t h a t n o d a t ai s b e i n g t r a n s f e r r e d s i n c e w e h a v e m a d e n o c o n -n e c t i o n s t o t h e d a t a b u s . I t s h o u l d a l s o b e a p -p a r e n t t h a t t h i s s c h e m e c o u l d b e u s e d t o s w i t c ha m o t o r , l i g h t , c a s s e t t e r e c o r d e r o r o t h e r d e -v i c e o f f a n d o n i n a c o m p u t e r p r o g r a m . E u r e k a !W e h a v e m a d e a s i m p l e I / O c i r c u i t .
T o c o n t i n u e a l i t t l e f u r t h e r , r e p e a t t h e a b o v ee x p e r i m e n t s w i t h a S T A i n s t r u c t i o n r e p l a c i n g t h eLDA i n s t r u c t i o n . T h e r e s u l t s s h o u l d b e i d e n t i -c a l b e c a u s e i n b o t h c a s e s i t i s t h e a d d r e s s o f
B uf fe ri ng t he A d dr es s L in es .T h e a r r o w s p o i n t i n g i n t o t h e c h i p a r e t h el i n e s f r o m t h e 6 5 0 2 , w h i l e t h o s e p o i n t i n g
a w a y g o t o t h e c i r c u i t i n F i g u r e 1 .
6 :30
\ : : " ' " - - - - - - - - - ~ ~ ~ c a (!) i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i i~
0 2 0 0 A D 0 7 8 0 S T A R T LDA DS E V E N I N I T DS 7 DE V I C E S E L E C T P U L S E0 2 0 3 A 9 F F LDA I M $ F F I N I T T I M E R0 2 0 5 8 D 0 7 1 7 S T A T I M E R S TA RT DI V IDE -B Y -1 02 4 T IM ER F OR 2 5 60 2 0 8 A D 0 7 1 7 B A C K L DA C L K R DI C Y C L E S , N O W C H E C K T O S E E I F IT0 2 0 B 1 0 F B B P L B A C K I S F I N I S H E D. I F N O T , C H E C K A G A I N ,0 2 0 D A D 0 1 8 0 L DA DS O N E O T H E R W I S E T R I G G E R DS 1 .0 2 1 0 A 9 F F LDA I M $ F F0 2 1 2 8 D 0 7 17 ~~ 'A T I M E R S T A R T T I M E R F O R S E C O N D H A L F O F0 2 1 5 A D 0 7 1 7 A G N L O A C L K RDI C Y C L E . I S T I M E R R E A DY ?0 2 1 8 1 0 F B B P L A G N N O , C H E C K A G A I N , O T H E R W I S E J U M P0 2 1 A 4 C 0 0 0 2 J M P S T A R T T O S T A R T O V E R .
6 :31
\.: ~~C! l [ ;J®
+ 5v
s
Q ,S
. ; / ®J
,[>CKc
2PR
o ' S n =-JCLR
D S m 0 " , , ,~ K
. ; /@476
I)
~
F i g u r e 3. T e s t C i r c u i t .
w o r k s , t h a t i s , t h e l i g h t s c a n b € s w i t c h e d f r o mo f f t o o n a n d v i c e v e r s a , b u t t h e S T A i n s t r u c -t i o n d o e s n o t w o r k . W h y ?
K e e p y o u r c i r c u i t , a s t h e m a t e r i a l i n t h e n e x tc o l u m n w i l l r e f e r t o a n d m a k e u s e o f t h e c i r c u i ty o u h a v e ju s t c o m p l e t e d .
A N o t e A b o u t F i g u r e 1 : T h e * l i n e s i n F i g u r e 1s u g g e s t t h a t s o m e t h i n g s h o u l d b e d o n e w i t h t h e m .F o r t h e e x p e r i m e n t s d e s c r i b e d a b o v e , n o t h i n gn e e d b e c o n n e c t e d t o t h e s e l i n e s , h o w e v e r w h e n
A n A dd it io na l E xp er im en t
T h e a d d r e s s d e c o d i n g c i r c u i t o f F i g u r e 1 p r o -d u c e s a o n e m i c r o s e c o n d n e g a t i v e g o i n g o n e - s h o tp u l s e w h e n a L DA i n s t r u c t i o n a d d r e s s e s o n e o ft h e l o c a t i o n s s h o w n i n F i g u r e 1 . T h i s o n e - s h o tc a n b e u s e d f o r a v a r i e t y o f p u r p o s e s , o n e o fw h i c h i s t r i g g e r i n g t h e f l i p - f l o p s h o w n i n F i g -u r e 3. T h e p r o g r a m l i s t e d b e l o w m a k e s u s e o f a ni n t e r v a l t i m e r ( K I M - 1 s y s t e m a d d r e s s e s ) t o p r o -d u c e a s q u a r e w a v e . B y v a r y i n g t h e t i m e l o a d e di n t o t h e t i m e r , t h e f r e q u e n c y c a n b e c h a n g e d ,
w e t r y t o p u t d a t a o n t h e d a t a b u s t h e s e l i n e sw i l l b e c o m e i m p o r t a n t . W h a t y o u d o d e p e n d s o nt h e s y s t e m y o u a r e u s i n g . S i n c e t h e K I M - 1 i sp r o b a b l y t h e m o s t p o p u l a r s y s t e m a m o n g t h e r e a d -e r s a n d s i n c e m y o w n s y s t e m i s a K I M ( e x p a n d e dw i t h a R i v e r s i d e K E M a n d M V M - 1 0 2 4 ) t h e f o l l o w i n gd e t a i l s w i l l b e o f m o s t i n t e r e s t t o K I M o w n e r s .O w n e r s o f o t h e r s y s t e m s w i l l h a v e t o d i g i n t ot h e i r m a n u a l s t o m a k e s u r e t h e y a r e n o t d e - s e -l e c t i n g t h e i r o n - b o a r d d e v i c e s , o r m u c h w o r s e ,s e l e c t i n g t w o d e v i c e s t o p u t i n f o r m a t i o n o n t h ed a t a b u s s i m u l t a n e o u s l y . T h e K I M - 1 h a s a 7 4 1 4 5d e c o d e r o n - b o a r d w h i c h d e c o d e s l i n e s A 1 0 - 1 2 ;l i n e s A 1 3- 1 5 a r e n o t d e c o d e d . C o n s e q u e n t l y , t h e
l o w e s t 8 K O b l o c k i s a l r e a d y d e c o d e d , a n d t h e d e -v i c e s e l e c t p u l s e f r o m t h e L S 1 4 5 i n F i g u r e 1s h o u l d e n a b l e t h e d e c o d e r o n t h e K I M f o r a l l a d -d r e s s e s i n t h e 8 K O b l o c k . T o d o t h i s S i m p l yc o n n e c t t h e d e v i c e s e l e c t p u l s e f r o m p i n 1 o nt h e 7 4 L S 1 4 5 i n F i g u r e 1 t o p i n K o n t h e a p p l i -c a t i o n c o n n e c t o r o n t h e K I M , m a k i n g s u r e t h a tt h e g r o u n d c o n n e c t i o n i s f i r s t r e m o v e d . A 1 0 Kp u l l - u p r e s i s t o r b e t w e e n p i n 1 a n d +5 V w i l l a l s ob e n e c e s s a r y . T h e d e v i c e s e l e c t p u l s e f r o m 8 K 7s h o u l d e n a b l e t h e d e v i c e c o n t a i n i n g t h e r e s t a r ta n d i n t e r r u p t v e c t o r s . I n t h e c a s e o f t h e K I M ,p i n 9 o f t h e L S 14 5 i n F i g u r e s h o u l d e n a b l e t h e6 5 30 - 0 0 2 R O M b y c o n n e c t i n g i t t o p i n J o f t h ea p p l i c a t i o n c o n n e c t o r . N o p u l l - u p i s n e c e s s a r y .
N e x t i s s u e w e w i l l e x a m i n e t h e o t h e r p i n s o n t h e
6 5 0 2 w h i c h w i l l b e u s e f u l i n c o n f i g u r i n g 1/0p o r t s , n a m e l y t h e b i - d i r e c t i o n a l d a t a b u s , a n dt h e c o n t r o l s i g n a l s . H o p e f u l l y w e s h a l l f i n i s ht h e c i r c u i t r y n e e d e d t o m a k e a n o u t p u t p o r t ( 8b i t s ) , c o n n e c t s o m e L EDs t o i t , s e e i f i t w o r k so r s m o k e s , a n d m a y b e t h i n k o f a u s e f o r i t .
A c o u p l e o f p a r t i n g s h o t s : F i r s t , t h e r e i s av e r y g o o d e d u c a t i o n a l s e r i e s o f a r t i c l e s i nK I L O B A U D m a g azi n e c a l l e d K I L O B A U D K L A S S R O O M .It a s s u m e s l e s s e x p e r i e n c e t h a n I h a v e a s s u m e ds o f a r . S e c o n d , I h o p e y o u h a v e o b t a i n e d a "T T LDa ta b o o k " f r o m e i t h e r T e x a s I n s t r u m e n t s o rN a t i o n a l s o t h a t y o u c a n s t u d y t h e t r u t h t a b l e sa n d o t h e r s p e c i f i c a t i o n s o f t h e c h i p s w e a r e
' \. U Si ng .
a n d t h e d u t y c y c l e c a n b e c h a n g e d . T h u s , w eh a v e p r o d u c e d a s i m p l e f u n c t i o n g e n e r a t o r w i t hp r o g r a m m a b l e p e r i o d a n d d u t y c y c l e . T h e L EDsw i l l s h o w t h e r e s u l t s a t l o w f r e q u e n c i e s . T r yt h i s p r o g r a m a n d w a t c h t h e L E Ds . A m p l i f y t h e Q
o u t p u t a n d c o n n e c t i t t o a s p e a k e r ; n o t i c e t h ee f f e c t o f c h a n g i n g t h e t i m e , t h e d u t y c y c l e , t h ew a v e s h a p e ( b y f i l t e r i n g ) o r w h a t e v e r e l s e y o uc a n t h i n k o f . N o ~c e t h a t I u s e d d e v i c e s e l e c t s8 0 0 7 a n d 8 0 0 1 .
Richard f. Suitor166 iTremont StreetNewton, MA 02158
This article consists of two parts. The firstis a brief discussion of the colors of the Appleand their relationships to each other and to thecolor numbers. Some of that information is usedin the second part to generate a random colordisplay according to certain principles sugges-ted by Martin Gardner in his mathematical gamescolumn in Scientific American.
The Color of Your Apple
The color of your Apple comes from your colorTV. The video signal has many components. Hostof the signal carries the brightness informationof the picture - a black and white set uses thispart of the signal to generate its picture.Superimposed on this signal is the "color car-rier:, a 3.58 MHzsignal that carries the colorinformation. The larger this signal, the morecolorful that region of the picture. The hue(blue, green, orange, etc.) is determined by thephase of the color signal. Reference timingsignals at the beginning of each scan line syn-chronize a "standard" color signal. The timeduring a 3.58 MHzperiod that the picture colorsignal goes high compared to when the standardgoes high determines the hue. A color signalthat goes high when the standard does gives or-ange. One that goes low at that time givesblue. Signals that are high while the standardgoes from high to low or from low to high give
v~et and green. (This, at least, was the in-tention. Studio difficulties, transmissionpaths and the viewers antenna and set affectthese relations, so the viewer is usually givenfinal say with a hue or tint control.)
The time relation of the color signal to thestandard signal is expressed as a "phase angle",is measured in angular measures such as degreesor radians and can run from 0 to 360 degrees.This phase angle corresponds to position on acolor circle, with orange at the top and blue atthe bottom, as shown in Figure 1.
The perimeter of the circle represents differentcolors or hues. The radial distance from thecenter represents amount of color, or satura-tion. The former is usual! y adj usted by thetint control, the latter by the color control.Acolor that can be reproduced by a color TVcanbe related to a point in this circle. The angu-lar position is coded in the phase of the 3.58MHz color carrier signal; the radial distancefrom the center is given by the amplitude of thecolor carrier.
The numerical coding of the Apple colors can beappreciated using this circle and binary repre-sentation of the color numbers. The low orderbit corresponds to red (10. The second bitcorresponds to dark blue (12), the third to darkgreen (14) and the high order bit to brown (darkyellow, 18). To find the color for any colornumber, represent each 1 bit IH3a quarter-piepiece centered over its respe~t~e color, as in-dicated in Figure 1. The brightness or light-ness of the color corresponds to the number ofpie pieces and the color corresponds to thepoint where the whole collection balances.Black, 10, has no bits set, no pie and nobrightness. White, 115, has four bits set, thewhole pie, is of maximumbrightness and balancesin the center of the circle at neutral. Orange,
19 or 1001 in binary, has pie over the top hemi-sphere and balances on a point between neutraland orange. The 15 , binary 0101, has two sepa-rate wedges, one over red and one 'over green.Since it is symmetric, it balances at the cen-ter. It represents a neutral gray of intermedi-ate brightness. So does the 110. The 114 haspie over every sector except the red one'. It-Lsbright and balances on a line toward forestgreen. It gives a light, somewhat bluish green.
O~~E
YELLOW RED
6:33
GREEN
1000 0001 ,--+ VIOLET
EU-
TRAL
0100 I 0010
MID BLUE
FORESTGREEN
DEEP
BLUE
Figure 1.
Color circle shows relations ofcolor to color number bit position.
A diagram representing the relations of all thecolors is given in Figure 2. Each of the one,two and three bit numbers form planes, each cor-responding to a color circle. One can think ofthese positions as points in space, with bright-ness increasing with vertical position and hori-zontal planes representing color circles ofdiffering brightness.
The colors of the Apple are thus coded by thebit patterns of the numbers representing them.You can think of them as additive combinations
of red, dark blue, dark green and brown, whereadding two colors is represented by ORing thetwo numbers representing them. Subtractive com-bination can be represented by ANDingthe lightcolors, pink, yellow, light green and lightblue. The more bits set in a number, thebrighter; the fewer, the darker. The bit pat-terns for 5 and 10 have no 3.58 MHz componentand so generate a neutral tone. At a boundarybetween 5 and 10 however, this pattern is dis-turbed and two bits or spaces adjoin. Try thefollOwing program which has only grays dLap-played:
10 GR20 FORI = 0 TO 930 COLOR 540 HLIN0,39 AT 2.1
50 VLIN20,39 AT 2.160 VLIN 20,39 AT ~I+2170 COLOR 1080 HLIN 0,39 AT2·1 + 190 VLIN 20,39 AT2.1 + 1100 VLIN20,39 AT 2.1 + 20110 NEXTI120 RETURN
The top hal f of the display has HLIN's, al ter-nating 5 and 10. The bottom half has VLIN's,alternating 5 and 10. What do you see? The bitpattern for a number is placed directly on thevideo signal, with the four bits occupying onecolor carrier period. When two bits adjoin at a
0 1 1 1 - - - - - - - - = - - - - - - - - - •L I G H T B L U E 1 1 1 0
L IG HT G RE EN
__.!QOl-.~
0 0 1 . ______ - 1 0 1 0 1V I O L E T 1 0 1 0
0 0 0 1R E D
GRAY -- -1 0 0 0 / 'B R O W N
0 1 1 0LU E
0 0 1 0 ------'"1.-----------_ •DAR K B L U E 0 0 0 0 0 1 0 0
B L A C K DA R K G R E E N
F i g u r e 2 .
C o l o r s p a c e l o c a t i o n s o f t h e A p p l e I I c o l o r s .E a c h h o r i zo n t a l p l a n e f o r m s a c o l o r c i r c l e
o f d if fe re nt b ri gh tn es s.
5 , 1 0 b o u n d a r y , a l i g h t b a n d i s f o r m e d . W h e n t w os p a c e s a dj o i n , a d a r k b a n d i s f o r m e d . T h es l i g h t t i n t s a r e d u e t o t h e b o u n d a r i e s h a v i n gs o m e c o l o r c o m p o n e n t . C h a n g i n g t h e 5 , 1 0 o r d e rr ev e rs es t hi s t i n t.
N o w i s , e r h a p s a g o o d t i m e t o c o n s i d e r ju s t h o wl a r g e a 3. 5 8 M Hz p e r i o d i s . T h e A p p l e t e x t i s
g e n e r a t e d w i t h a 5 x 7 d o t m a t r i x , a c o m m o n m e t h o do f c h a r a c t e r g e n e r a t i o n . T h e s e s a m e d o t s c o r -r e s p o n d t o i n d i v i d u a l b i t s i n t t . o : !i g h r e s o l u -t i o n d i s p l a y m e m o r y . O n e d o t i s o n e - h a l f o f a3. 5 8 M Hz p e r i o d a n d c o r r e s p o n d s t o a v i o l e t (13)o r g r e e n (112) c o l o r s i g n a l . T h i s i s w h y t h et e s t i s s l i g h t l y c o l o r e d o n a c o l o r T V a n d t h eh i g h r e s o l ut i o n d i s p l a y h a s t w o c o l o r s ( o t h e rt h a n b l a c k a n d w h i t e ) , g r e e n a n d v i o l e t . ( B u ty o u c a n m a k e o t h e r s , d u e t o e f f e c t s s i m i l a r t ot h o s e s e e n i n t h e B A S I C p r o g r a m a b o v e . )
( T h e d e s i g n o f c o l o r T V h a s f u r t h e r i m p l i c a t i o n sf o r t h e d i s p l a y . T h e v i d e o b l a c k a n d w h i t e s i g -n a l i s l i m i t e d t o a b o u t 4 M Hz, a n d m a n y s e t sd r o p t h e d i s p l a y f r e q u e n c y r e s p o n s e s o t h a t t h ec o l o r s i g n a l w i l l n o t b e o b t r u s i v e . A s e t s od e s i g n e d w i l l n o t r e s o l v e t h e d o t s v e r y w e l l a n dw i l l p r o d u c e b l u r r y t e x t . S o m e c o l o r s e t s h a v ea dju s t m e n t s t h a t m a k e t h e s e t i g n o r e t h e c o l o rs i g n a l . S i n c e t h e c o l o r s i g n a l p r o c e s s i n g i n -v o l v e s s u b t r a c t i n g a n d a d d i n g p o r t i o n s o f t h es i g n a l , a v o i d i n g t h i s c a n s o m e t i m e s i m p r o v e t h et e x t r e s o l u t i o n . A l s o r e d u c i n g t h e c o n t r a s te s p e c i a l l y a n d t h e b r i g h t n e s s s o m e w h a t c a n h e l pw it h t ex t m at er ia l. )
T h e c o l o r T V d e s i g n a t t e m p t s t o . .e m o v e t h e c o l o rc a r r i e r f r o m t h e p i c t u r e ( a f t e r d u l y p r o v i d i n gt h e p r o p e r c o l o r ) , b u t y o u m a y b e a b l e t o s e et h e s i g n a l a s 3 o r 4 f i n e v e r t i c a l l i n e s p e rc o l o r b l o c k . T h e y s h o u l d n o t b e a p p a r e n t a t a l li n t h e w h i t e o r b l a c k o r e i t h e r g r a y ( e x c e p tp o s s i b l y o n a h i g h r e s o l u t i o n m o n i t o r ) .
T a n i s B e t w e e n B r o w n a n d W h i t e
T h i s s e c t i o n p r e s e n t s a b r i e f a p p l i c a t i o n o f t h ec o n c e p t s o f t h e r e l a t i o n s h i p s i n c o l o r s p a c e o ft h e A p p l e c o l o r s . M a n y o f y o u , I s u s p e c t , a r er e g u l a r r e a d e r s o f M a r t i n G a r d n e r ' s "M a t h e m a t i -c a l G a m e s" c o l u m n i n S c i e n t i f i c A m e r i c a n . Is t r o n g l y r e c o m m e n d i t t o t h o s e o f y o u w h o h a v e
n o t a l r e a d y b e e n i n t r o d u c e d . I t p u b l i c ize d"L i f e " ( M I C R O 5 : 5 ) a n d m o t i v a t e d "A p p l a y e r"( M I C R O 5 : 2 9 ) , a n d w a s t h e m o t i v a t i o n f o r t h i sp r o g r a m . T h e r e ' s a l o t o f g o l d i n t h e m i n e y e t .
I n A p r i l , t h e c o l u m n d i s c u s s e d t h e a e s t h e t i cp r o p e r t i e s o f r a n d o m v a r i a t i o n s o f d i f f e r e n tk i n d s . T o s u m m a r ize b r i e f l y , t h r e e k i n d s a r e :
W H I T E E a c h s e p a r a t e e l e m e n t i s c h o s e n r a n d o m l ya n d i s i n d e p e n d e n t o f e v e r y o t h e r e l e -m e n t . C a l l e d "w h i t e" b e c a u s e a f r e -Qu e n c y s p e c t r u m o f t h e r e s u l t s h o w s a l lf re qu en ci es o cc ur e qu al ly , a Qu al it at iv ed e s cr i pt io n o f w h it e l ig h t.
B R O W N E a c h s e p a r a t e e l e m e n t i s t h e p r e v i o u se l e m e n t p l u s a r a n d o m l y c h o s e n d e v i a -t i o n . C a l l e d "b r o w n " b e c a u s e B r o w n i a nm o n t i o n i s a n e x a m p l e .
1 /F S o c a l l e d b e c a u s e o f i t s f r e q u e n c ys pe ct ru m, i nt er me di at e b et we en " wh it ena nd " br ow n" .
T h e c o l u m n p r e s e n t e d a r g u m e n t s , a t t r i b u t e d t oR i c h a r d V o s s , t h a t 1/ f v ar ia ti on s a re p re va le nta n d a e s t h e t i c a l l y . . re s a t i s f y i n g t h a n "w h i t e"( n o t e n o u g h c o h e r e n c e ) o r "b r o w n " ( n o t e n o u g hv a r i a t i o n ) . An a l g o r i t h m w a s g i v e n f o r g e n e r a t -i n g e l em e nt s w i t h 1/ f r an do m v a ri a ti on s . B ri ef -l y , e a c h e l e m e n t i s t h e s u m o f N t e r m s ( t h r e e .s a y ) . O n e t e r m i s c h o s e n r a n d o m l y f o r e a c h e l e -m e n t . T h e n e x t i s c h o s e n r a n d o m l y f o r e v e r y o t -
her el_ent. The next is chosen randOllly' forevery fourth ele.ent, and 80 forth.
With the Apple, one can experiment with theseconcepts aurally (hence Applayer) and visuallywith the graphic displays. Color is a dimen-sion that was not disc ussed much in the col UIIIIl.This section presents an atteDIpt to apply these
concepts to the Apple display.
Most of us know what "white" noise is like onthe Apple display. An exercise that many try isto choose a randOll point, a random color, plotand repeat. For example:
10 GR20 X = RND(40)30 I = RND(40)40 COLOR RND(16)50 PLOTX,I60 GOTO20
Dispite the garish display that results, this isa "white" type of random display. Except forall being within certain limits, the color ofone square has no relationship to that of its
neighbors and the plotting of one square tellsnothing about which square is to be plottednext.
To implement the concept of "l/f", I used thefollowing:
1. X and I are each the sum of three numbers,one chosen randomly from each plot, one every 20plots and the third every 200.
110 RETURN120 Z=IE.125 L= RND (5)-2130 U= RND (9~:V= RND (9)147 FOR B=1 TO 10
150 R=U+ RND (9):S=V+ RND (9)155 IF PEEK (-16286»127 THEN GR
160 K=K+L: IF K)16 THEN K=K-Z165 IF K(O THEN K=K+Z
2. A table of color numbers was made (DIM(16)in the program) 80 that color numbers near eachother would correspond to colors that are neareach other. The choice given in the programsatisfies the following restrictions:
a. Adjacent numbers are from adjacentplanes in Figure 2.
b. Noangular change (in the color planes)
is greater than 45 degrees betweenadjacent numbers.
3. The color number is the same for 20 plotsand then is changed by an amount chosen randomlyfrom -2 to +2. This is a "brown" noise genera-tion concept. However, most of the displaynormally has color patches that have been gene-rated long before and hence are less correlatedwith those currently being plotted. I'11 claimcredit for good intentions and let someone elsecalculate the power spectrum.
4. Each "plot" is actually eight symmetricplots about the various major axes. I can'teven claim good intentions here; it has nothingto do with llf and was put in for a kaleidoscope
effect. Those who are offended andIor curiouscan alter statement 100. They may wish then to
make X and I the sum of more than three terms,with the fourth and fifth chosen at even largerintervals.
The program follows. A paddle and push buttonsare used to control the tempo and reset the dis-play. If your paddle is not connected, substi-tute 0 for PDL(O).
170 COLOF:=A(K)180 0=( PDL (0)/2) 2
190 FOR 1=-0 TO 0: IF PEEK (-16287»127 THEN 200: NEXT 1
200 FOR 1=1 TO 20210 X=R+ RND (6):Y=S+ RND (6): GOSUB
We are the APPLE experts when it comes to software. We are professionalsand not just hobbyists. Data Processing is our business.
Most programs are done in Integer Basic to allow user modifications. Thefollowing programs require 20K or more of memory, All programs useparallel port printers.
BUSINESS INVENTORY ($160.00 for package)o PROGRAM 200 ($50) Completely maintains inventory file.o PROGRAM 205 ($20) Fast machine language sort on Part No.o PROGRAM 210 ($50) Prints sales slips, updates inventory file.o PROGRAM 220 ($50) Generates reorder report by manufacturer code.
APPLEDITOR ($50) A word processor that takes care of all your letterand document needs. In two versions, 39 charactersand 79 characters.
APARTMENT RENTAL PROGRAM Prints bill and labels. Maintains arrearsfor each unit.
MACHINE LANGUAGE SORT FOR THE FOLLOWING PROGRAMS ($20)UNIVERSAL DATABASE ($60) You define your database once for each use
you have in mind.DAILY CALENDAR ($50) Search your future or past appointments.
HOME IMPROVEMENT FILE ($50) Store all your improvements on file for fuHOME INVENTORY FILE ($50) Store all your home furnishings on tape forinsurance purposes.
EXPENSE ACCOUNT FILE ($50) Maintain all your travel, meals and businesor personal expenses on tape.
VENDOR FILE ($50) Store all your vendors on file.FILING SYSTEM CROSS REFERENCE FILE ($50) Now you can find everything
in your files.MACHINE LANGUAGE SORT FOR ANY RECORD UP TO 255 CHARACTERS ($20)GAMES: CAR RACE PROGRAM IN HIGH RESOLUTION GRAPHICS ($7.50)
BINGO FOR 36 PLAYERS ($10) Uses printer to print Bingo cards.
For further information about above programs, send $1.00 for postage and
handling to:
DARRELL'S APPLEWARE HOUSE17638 157th Avenue, S.E.Renton, Washington 98055
No C.O.D. Allow two weeks for personal check to clear. Washingtonresidents add 5.4% sales tax. For orders under $100.00 please add$2.00 for shipping and handling. Dealer inquiries welcome.
W i l l i a m Di a l4 38 R o s l y n A v e n u eA k r o n , O H 4 4 32 0
335 . S m i t h , S t e p h e n P . " 6 5 0 2 Di s a s s e m b l e r F i x ", DDJ 3, N o . 2 3, I s s u e 3, P g 3 ( M a r c h 1 9 7 8 )R O R a n d R O L i n s t r u c t i o n s w e r e o m i t t e d i n t h e p r e v i o u s l y p u b l i s h e d d i s a s s e m b l e r -
DDJ 3, I s s u e 1 . T h i s o f f e r s a s i m p l e f i x .
336 . K I M - l U s e r N o t e s , I s s u e 9 / 1 0 , ( J a n u a r y - M a r c h 1 9 7 8 )B u t t e r f i e l d , J i m "Di c e y " p a g e 1 7 . A p r o g r a m t o r o l l u p t o s i x d i c e .B u t t e r f i e l d , J i m "T e a s e r " p a g e 1 7 . J u m b o v e r s i o n o f B o b A l b r e c h t ' s "S h o o t i n g S t a r s ".L e w a r t , C a s s "C o r r e c t i o n f o r L a n c a s t e r ' s T V T " p a g e 2 0 .O l i v e r , J o h n P . "C o m m e n t s a n d C o r r e c t i o n s f o r S U P E R D U M P / L O A D" p g 2 1 .
337 . Qu o s i g , K a r l a n d S u s a n "I n p u t / O u t p u t ", P e r s o n a l C o m p u t i n g Z, N o . 4 , p g 8 ( A p r i l 1 9 7 8 ) .C om me n t s o n P E T p r o b l em s .
338 . B i s h o p , R o b e r t J . "R o c k e t P i l o t ", K i l o b a u d N o . 1 3, p g 9 0 ( J a n . 1 9 7 8 )A n d i n t e r a c t i v e g a m e f o r t h e A p p l e I I .
339 . O S I - S m a l l S y s t e m s J o u r n a l Z, N o . 1 ( J a n u a r y - F eb r u a r y 1 97 8 )A n o n . "W h a t ' s a U S R F u n c t i o n ". V i a t h e U S R f u n c t i o n , o n e c a n h a v e a 6 5 0 2 B A S I C p r o g r a m
w h i c h w o r k s i n c o n ju n c t i o n w i t h o n e o r s e v e r a l m a c h i n e c o d e p r o g r a m s .A n o n . "Qu i c k i e " . A 6 5 0 2 B A S I C p r o g r a m f o r c o n v e r t i n g d e c i m a l t o b i n a r y n u m b e r - s,G l a s s e r , Da n i e l "C h e s s b o a r d ". P r o g r a m i n 6 5 0 2 B A S I C f o r a c o m p u t e r c h e s s b o a r d w h i c h
m o v e s p i e c e s a n d d i s p l a y s t h e n e w b o a r d . N o t a c h e s s p r o g r a m .A n o n . "DO S C N T R L ". A B A S I C p r o g r a m t o p e r f o r m t r a n s f e r s t o o r f r o m O S I ' s n e w h a r d
d is k d ri ve .A n o n . "T r a c k Ze r o W r i t e r ". A M a c h i n e l a n g u a g e p r o g r a m t o m o d i f y t r a c k ze r o .A n o n . "9 Di g i t B A S I C ". A c o n c i s e m e t h o d f o r m o d i f y i n g O S I 9 Di g i t B A S I C f o r a n
e n d - u s e r 9 Di g i t B A S I C .A n o n . "O S - 6 5 U P e r f o r m s ". A d e s c r i p t i o n o f a n e w s y s t e m s a i d t o b e a n e w s t a n d a r d f o r
m ic ro co mp ut er o pe ra ti ng s ys te ms .A n o n . "5 0 0 / 5 1 0 B r e a k p o i n t U t i l i t i e s ". A b r e a k p o i n t p r o g r a m .A n o n . "5 1 0 T r a c e r ". A t r a c e r p r o g r a m w h i c h p r i n t s a d i s a s s e m b l e o f t h e n e x t i n s t r u c t i o n
t o b e e xe c u t e d .
34 0 . B i s h o p , R o b e r t J . "F i e n d i s h N e w QU B I C P r o g r a m " , 7 3 M a g a zi n e , N o . 2 0 9 , p g 7 8 ( F e b 1 9 7 8 ) .
A n a t t e m p t a t p r o d u c i n g a n i m p r o v e d v e r s i o n o f t h e o r i g i n a l Qu b i c p r o g r a m .
34 1 . R o s n e r , R i c h a r d "Da d d y , I s I t T h e P E T ?", R O M . 1 , N o . 9 , p g 2 6 ( M a r / A p r i l 1 9 7 8 )De s c r i p t i o n o f m a n y f e a t u r e s a n d o p e r a t i o n s o f t h e P E T , i n c l u d i n g m a n y "h o w t o "i n s t r u c t i o n s .
34 2 . B i s h o p , R o b e r t J . "L O G A N - A L o g i c C i r c u i t A n a l y s i s P r o g r a m ", I n t e r f a c e A g e - " N o . 6 ,p g 1 2 8 ( M a y 1 9 7 7 ) . A n A p p l e I B A S I C p r o g r a m f o r a n a l y zi n g n e t w o r k s o f l o g i c g a t e s .
34 3. B i s h o p , R o b e r t J . "A p p l e S t a r T r e k " , I n t e r f a c e A g e - " N o . 6 , p g 1 32 ( M a y 1 9 7 7 >.S t a r T r e k w r i t t e n i n A p p l e I B A S I C .
34 4 . C h a m b e r l i n , H a l "M i c r o c o m p u t e r I n p u t / O u t p u t ", P o p u l a r , ;: l e c t r o n i c s . 1 3,N o . 5 , p g 8 6 ( M a y 1 9 7 8 ) .C o m m e n t s o n t h e K I M ' s m e m o r y - m a p p e d I / O s y s t e m .
34 5 . P e o p l e s C o m p u t e r s ~, N o . 6 ( M a y / J u n e 1 9 7 8 )J o h n s o n , R a l p h "L e t t e r s ". T h e U n i v e r s i t y o f C a l i f o r n i a a t S a n Di e g o p l a n s a P a s c a l
s y s t e m f o r t h e 6 5 0 2 .C o l e , P h y l l i s "A p p l e I I ". A r e v i e w o f t h i s 6 5 0 2 b a s e d m i c r o .V o r o s , T o d d L . "S k e t c h c o d e ". A t e c h n i q u e t o m i n i m i ze e r r o r s a n d s i m p l i f y t h e p r o c e s s
o f d e b u g g i n g . L i s t e d i n 6 5 0 2 a s s e m b l y c o d e .O f f e n , Da v e "K a l e i d o s c o p e ". A c o n t i n u o u s l y r u n n i n g g r a p h i c s p r o g r a m f o r , t h e P E T .H o f h e i n t z, M . C . "T i n y G R A P H I C S ". A s h o r t g r a p h i c s p r o g r a m f o r t h e P E T .
34 6 . G o r d o n , H . T . "E d i t h a ", DDJ 3, I s s u e 5 , N o . 2 5 , p g 34 ( M a y 1 9 7 8 ) . A r e v i s i o n o f t h eF y l st r a K I M - l E d i t o r p r o g r a m "S W E E T S " p u b l i s h e d i n B Y T E .
34 7 . T u l l o c k , M i c h a e l "P E T F i l e s ", P e r s o n a l C o m p u t i n g 2., N o . 5 , p g 2 0 ( M a y 1 9 7 8 ) . T h i n g s y o u ru s e r ' s m a n u a l n e v e r t o l d y o u a b o u t P E T . H o w t o u s e f i l e s .
348. O ' R e i l ly , F r a nc i s J . "I ns t r u c t io n Se a r c h ", B yt e 3, N o . 5 , p g 1 53 (M a y 1 9 7 8 ). Di s c u ss i o no f 6 5 0 2 o p c o d e 2 7 a nd t h e s e a r ch f o r o th e r a s y et u n d ef i n e d i n s t r uc t i o n s .
349 . C ar p e n t e r, C h a r le s R . "T i n y B A SI C S h o rt c u t s ", l i l o ba u d , I ss u e 18 , pg 4 2 ( J u n e 19 7 8 ) ~S u g g e s ts m e t h o ds t o e x p an d t h e c ap a b i l i ti e s o f To m P it t m a n ' s T i n y B A S I C fo r t h e 6 5 0 2 .
350 . O ' Ha v e r , T . C. "M or e M us i c fo r t h e 65 0 2 ", By t e 3, N o . 6 , p g 1 4 0 ( J u n e 19 7 8 ) . A m us i cc o m p o si t i o n a n d g en e r a t i on pr o g r a m.
351 . O ' Ha v e r , T . C . "A ud i o P r oc e s s i n g wi t h a Mi c r o c o mp u t e r ", B yt e 3, N o . 6, p g 1 6 6 ( J u n e 19 7 8 ) .A d d in g a v ir t u a l t a p e l o o p. U se s a 6 5 0 2 p r oc e s s o r.
352 . E a to n , J o h n "L o w C o s t l e y b oa r d - II ", 73 M a g a zi ne , N o 2 1 3, p g 1 0 0 (J u n e 1 97 8 ) . P a r t I Iof a n a r t i cl e on t h e lo w - c o s t ke y b o a r d. S o ft w a r e i s d e s ig n e d a r ou n d t he 6 5 0 2.
353. S wi n d l e , Da v i d "A S en s i b l e E xp a n s i o n: A tw o o d M e m or y fo r y o u r K I M", K i l o ba u d , Is s u e 1 9 ,p g 6 0 ( J u ly 1 9 7 8 ) . Des c r i p t io n o f a lo w c o s t m e t ho d t o a d d m e mo r y t o K I M .
354 . M I C RO , Is s u e 4 ( Ap r i l i ~y 1 97 8 )C ar p e n t e r, C . R . "V a r ia b l e s C h a r t". C h a r t t o l a yo u t a n d k e ep t ra c k o f s tr i n g a nd
n u m e r ic a l v a r i ab l e s f o r A p pl e I I A p p le s o f t B AS I C .F lo t o , C ha r l e s "T h e P E T V e t E x a m in e s S o m e B A S I C I di o s y n cr a s i e s ". I nc l u d e s s u gg e s t i o ns
a n d m o d if i c a t i on s f o r a M a i li n g L i s t P r o gr a m b y R i c h a rd R os n e r .DeJ o n g , Ha r v i n L . "A C o m p le t e M or s e C o de S en d / R e ce i v e P r o gr a m f o r t he K I M -1 ". C o nv e r t s
A S C II f r o m a k e y b o ar d t o a M or s e c o d e d i g it a l s i g na l a n d a l s o c o n v e rt s a Mo r s e c o ded i g i t al s i g n a l to a n A SC I I c od e f or d i sp l a y o n a v i d eo s y s te m .
O 'B r i e n "PE T So f t w a r e f r o m C o m m o do r e ". N e w s e l e c t ed A p p l ic a t i o n n o t e s f r o m C o m mo d o r e .Fl o t o , Ch a r l e s "Ea r l y PE T - C o m pa t i b l e P r o d uc t s ". A r e v i e w o f s e ve r a l n e w a cc e s s o ri e s
fo r t h e P E T .R o w e, H i k e "T h e M I C R O So f t w a r e C a t a l og ". A c o n t in u i n g c a t a lo g o f s o f t wa r e a v a i l a bl e
f o r 6 5 02 b as e d s y s t em s .C a rp e n t e r , C . R . "A p p l e I I P r i n ti n g U p d a te ". U p d at e d i n f o rm a t i o n a n d m o di f i c a t io n s o f
th e s y st e m d e s cr i b e d pr e v i o u sl y in MI C R O N o .3.C h am b e r l i n, H a l "St a n d a r d 65 0 2 A s s e m bl y S y n t a x?". A p l e a f o r s t an d a r d iza t i o n .
R o w e , M i k e "A W o r m i n th e A pp l e ". Di s cu s s i o n o f s o m e p r ob l e m s e n c ou n t e r e d i n i n t er -f a c i n g t he A p p le t o o t h e r d e vi c e s s u c h a s t h e 6 8 2 0 P I A .
Je n k i n s, G er a l d C . "4 KI M B e e pe r ". A s h or t b la s t o r t w o o f a u d i o f o r l o a d e r ro r s ,e nd -o f- li ne , e tc .
A ur ic ch io , Ri ck " A n A p p l e I I Pr o g r a m me r ' s G u i d e". S o m e o f t he p r e vi o u s l y u n d is c l o s e dd et a i l s of t h e A p p l e M o n it o r .
35 5. O ' C on n o r , C li n t "B oo k R e v ie w : P ro g r a m mi n g a M i c ro c o m p ut e r : 6 5 0 2 ", K i l o b au d , Is s u e 2 0 ,p g 8 ( A u g u st 1 9 78 ) . A v er y f a vo r a b l e r e v i ew o f C a x t o n C . F o s t er ' s bo o k .
35 6 . G r o ss m a n , R ic k "K I M P l us C h e s s E q u a l s Mi c r o c he s s ", K il o b a u d , I s s u e 20 , p g 7 4 ( Au g u s t 1 9 7 8 ).' A c ha l l e n gi n g g am e o f C he s s ca n b e p l a y e d i n K I M ' s. 1 K o f m e m r oy u s i ng M i c r o C he s s byP et er J en ni ng s.
35 7 . P a le n i k , L e s "F I NA N C - A H o me / s m a l l- B u s i ne s s F i n a n ci a l P a c ka g e ", K il o b a u d , I s s u e 20 , p g 8 4(A u g u s t 1 9 7 8 ). Pr o g r a ms in c l u d e C a l c ul a t i o ns o n i n v e s tm e n t s , Dep r e c i a ti o n , Lo a n s , e t c.
35 8 . B r a un , L u d wi g "Co m m o d or e P E T", C r e a t iv e C o m p u ti n g ~, N o . 4 , p g 24 ( Ju l y / A u gu s t 1 97 8 )
359 . C r ea t i v e C o m p u ti n g ~, N o .4 ( Ju l y / A ug u s t 1 9 78 ) .B r a u n, L u d w i g "C o m mo d o r e P e t ". A n e q u i p me n t p ro f i l e wh i c h st r e s s e s t h e v a l u e o f t h e
P E T as a t ea c h i n g ma c h i n e.N o r t h , S t e v e ' "A p p l e I I C o mp u t e r ". A n e qu i p m e n t p r o f i le p Oi n t s o u t t h a t t he A p p le i s
n ot a m ac h i n e f o r t h e cl a s s r oo m o r f o r t h e S - 1 0 0 h ar d w a r e b uf f bu t i s on e o f t h em o s t v er s a t i le m ic r o s o n t h e m ar k e t .Da w k in s , G a r y D. "H i g h - Re s o l u ti o n Gr a p h i cs f o r t he A p p le I I ". Al l o w s u s er t o d r a w a
s h a p e i n h ig h - r e so l u t i o n g r a p h ic s mo d e fr o m th e k e y bo a r d .A h l , Da v i d H . "A ta r i V i d e o C o m pu t e r S y s t e m". A n e q u ip m e n t p r o f i le o f a 6 50 5 b a se d
36 0. M IC R O, I ss ue 5 ( Ju n e/ J ul y 1 9 78 )C ov i tz, F ra n k H. "L i fe f o r yo u r PE T ". L IF E w ri t te n i n ma c hi n e l an g ua ge fo r t he PE T .R oc k we l l I n te r na ti o na l ""R oc kw e l l ' s N e w R6 5 00 / 1". T he 6 5 00 / 1 i s a s i ng l e ch i p N M OS
m ic r oc o mp u te r , 1 or 2 MH z, f u l l y c o mp a ti b l e wi t h t h e 65 0 0 fa mi l y.De J on g, Ha r vi n L. "65 0 2 I n te r fa c in g f o r Be g in n er s : Ad d re s s De co d in g I". Th e fi r st
i n st a l l me n t i n a co n ti n ui n g s er i es .R ow e, Mi k e "Ha l f a W or m in t h e Ap p l e ". M o re o n t he co nt r ov e rs y o n in t er f ac i ng th e
A p pl e t o PI A' s . S e e a l s o EO N H a y 2 0 , 1 97 8 .S an de r -C e de r l o f , B ob "A Sl o w Li s t f o r Ap p l e B A SI C ". P r og r am s l ow s d ow n th e l is t
pr oc e ss s o i t c an b e m o re ea s il y r ev i ew e d.
Ro w e, Mi k e "Th e M ic r o S o ft w ar e C a t al og : II ". Th e se o on d p ar t o f t h is co n ti n ui n gs e r i e s .
Sy n er t ek In c . "S y ne r te k' s V IM -1 ". A go o d d e sc r ip t io n o f th e ma n y f ea t ur e s o f t he6 50 2 b a se d V IM - 1 . S i mi l a r t o a nd co mp a ti b l e wi t h KI M -1 w i th so m e n ew fe a tu r es .
Su i to r , R ic h ar d F . "A pp l ay e r M u si c I n te r pr e te r ". A m u si c i nt e rp r et e r w r it t en in6 50 2 a s se m bl y l a ng u ag e f o r t he A pp l e, bu t c an b e us e d o n ot h er 6 50 2 sy s te m s.
Di a l , Wi l l i am "6 5 02 B i bl io g ra p hy - P ar t IV ". Th e fo ur t h pa r t o f t h e c on t in u in gb ib l io g ra p hy of th e 65 0 2 l i t er a tu re (o f wh i ch t hi s i s th e fi f th p a rt l ).
Wi l l i a ms , J . C . "A B l oc k He x Du mp an d C ha r ac t er Ha p ut i l i t y P ro g ra m fo r t he KI M -1 ".A f ul l y r el o ca t ab l e ut i l i t y p r og r am w h ic h w il l du m p a sp e ci f ie d bl o ck o f m e mo r yf ro m a K IM to a t e rm i na l i n s e ve r al f or ma t s.
R o ck w el l In t er n at i on a l "R o ck w el l ' s A I M i s Pr e tt y G oo d ". R o ck w el l 's AI M 6 5 is a na ss e mb l e d v er s at i l e m i cr o co mp u te r s ys te m o n o ne b o ar d pl us ke y bo ar d . It ha s a2 0- c ha ra c te r di s pl a y an d a 2 0- ch a ra c te r th er m al p ri n te r , 4 K R OM m on i to r , 1 K R A Me xp a nd a bl e on b o ar d to 4K . A p pl ic a ti o n a nd E xp a ns io n c on n ec t or s a r e f ul l y KI M -1
c om p at ib l e. T T Y a n d A ud i o C a ss e tt e , DE B UG / MO N IT OR / R OM o r E P RO M o n bo a rd u p to1 6K . 8K B A SI C w il l be av a il a bl e i n R OM .C a rp e nt e r, C h u ck "A pp l e I I A cc e ss o ri e s a n d S o ft w ar e". I te m s re v ie w ed in c l u d e a
r en u mb er a n d ap p en d pr o gr a m, a s er i al i n te r fa ce b oa r d, a MO DEM , A pp l es o ft II ,a nd t he "A PP L E I I B A SI C Pr o gr am m in g H an u al .
Mc C an n , Mi ch a el J . "A B AS I C 65 0 2 Di s as se m bl e r f or A p pl e a nd P ET ". A cc e pt s m a ch i nel an gu a ge -o bje ct c o de - an d pr o du c es a s y mb ol i c r e pr e se n ta t io n t ha t r es e mb l es a na ss em b l y l is ti n g. O ri g in a l l y wr i tt e n i n C o m mo d or e BA S IC , i t w i l l wo r k w i thA p pl e so f t B A SI C a s w el l .
PROGRAMMING A MICRO-COMPUTER: 6502
by C a x to n C . Fo s te r
( R e v i e w e d by Ja m es R . Wi t t, J r .)
F o r t ho s e o f y o u i n th e c om p ut i ng w or l d wh o ha v ere c en t l y p ur c ha s ed o r co ns t ru c te d a m i cr oc o mp u -te r b a se d o n th e 65 0 2 mi c ro p ro c es s or ( th e K IM - 1f it s th is d es c ri p ti o n) a n d c a n' t p ut it t o re a -s o na b l y p r ac t ic a l us e , t h en p er h ap s y o ur h ea d -ac h es ar e o v er I P ro gr am mi ng a M ic ro -C om pu te r:65 0 2 b y C a x to n C . F o st e r m ay be e xa c tl y w ha tyo u n e ed to h al t y ou r f r us tr a ti o ns . F o st e r pr e -s e nt s t he re a de r wi t h a c om bi n at i on o f re fe r en c ema n ua l f or pr o gr a mm in g a nd a n i nt r od u ct i on to6 5 02 sy s te m s, s pe c if i ca l l y u si ng th e KI M -1 a s am o d e l .
"Ke yb o un c e", "A C o mb i na t io n Lo ck ", a nd "Dig it a lC l o ck " am o ft g o th e rs . Se v er a l o f t h es e p r og ra m sa r e co mp l et e l y l e g it i ma t e a nd f ul ly o p er ab l e.
As n o te d b e fo r e, Fo s te r m ov e s a t a s wi f t pa c e.A t ce r ta i n po in t s, v ar i ou s i n st r uc t io n s a ndKI M -1 a na to m y a r e c o nd e ns e d i n to a m er e p ag e o rt wo . B as i c u nd e rs ta n di n g o f di g it a l e l e c tr o ni csi s as su m ed o ft e n an d m ay be re q ui re d b ef o ref u l l y d ig e st i ng s o me of th i s m a te r ia l . Th e set w o mi no r we ak n es s es m a y t en d t o bo g gl e th e m in dof th e n ew c om e r an d h i nd e r hi s c om p re h en s io n oft h e pu r po s e' p ro g ra m mi n g a n d i ts m a ke - up .
S u gg e st i o"s : F o r t ho s e wh o a re n e wc o me r s to th e"s po rt " of co m pu t in g a nd di g it al e l ec t ro n ic s,y o u m ay w an t t o co ns i de r s o me ot h er pr el i mi n ar y
i ns t ru c ti on s B EF O RE un d er ta k in g t hi s bo o k. Ify o u h av e s o me s e ns e o f d ig i ta l , b ut l it t l e k no w -l e dg e o f mi cr o s, y ou s ho u l d t a ck l e i t , b u ts ho u l d m a ke no t es o f i mp or t an t i te m s th e fi r stt im e th r ou g h e a ch c ha p te r, a nd th en r e re ad t hec h ap t er t o p ul l th e o dd s an d en d s t o ge t he r . Ify o u h av e w r it t en s im p l e pr o gr am s b u t h a ve a nap p et i te f o r mo r e c o mp l ex pr o gl e m- s ol v in g , t he nP ro g ra m .i ng A M 1 cr o -C Oi l pu t er : 6 5 02 w il l be ade f in i te ai d a nd r es ou r ce in sa t is f yi n g yo u rh u n g e r .
T h e m o ti v at i on b eh i nd F o st e r' s wo r k i s pr ac t i-ca l i ty . R ig h t f ro m t he be gi n ni n g o f t h e fi rs tch a pt er a hy p ot h et ic a l s i tu a ti on i s i n tr o d uc e d ,ci r cu ms t an c es t ha t o ne m ig ht f ac e in t h e o o ur s eo f a n a ve r ag e d ay , a nd t he mi c ro c om p ut er i s s ug -ge s te d as a s ol u ti o n. In i ti a l l y, a S i mp l e pr ob -l e m i s i nt r od u ce d, a pr o bl em on e w ou l d no t e x-p ec t a c om pu t er t o so l ve d u e to i ts s im p l i c it y .Y et , t h is e n ab l es th e re a de r t o g ra s p th e ba si co p er a ti o n o f r un n in g a n u n cl u tt e re d p r og r am s uc -ce s sf ul l y. Po s si b l e re a so n s as t o w hy a ce rt a inp ro g ra m fa i l s ar e pr o vi d ed t o l es se n c o nf u si o n.
W i th s u cc e ss f ul c o mp l et i on o f o ne pr o gr am , th ea u th o r w as te s n o t im e m ov i ng o n t o n ew s i t ua -t io n s. T h is ma y se e m s om e wh a t f as t an d co nf u s-in g t o t ho s e w ho g r ee t m i cr os a s a t ot a l l y n ewe x pe r ie n ce . Y et t h e si t ua ti o ns d o b ec o me mo r ei n te r es t in g an d mo r e c ha l l e n gi n g t o so l ve byco m pu t er s o ft w ar e . S u ch p r og r am s i n cl ud e :
Pr o gr am . iDg A M1 o ro - C o . pu t er : 6 50 2 , by C a xt o nC . Fo s te r , pu b l i s he d b y A dd is o n- W es l ey , 1 9 78 .
I f y ou a re a su b sc r ib er t o HI C RO , t he n t h e co d ef ol l ow i ng y ou r n a me o n th e m a il i ng l a b el is t hen um b er of t he l a s t i ss u e y ou r cu r re n t su b sc r ip -t io n c o ve r s. I f yo ur co d e i s 0 6 , t he n th i s isy ou r l as t i ss ue . H IC R O wi l l NO T s en d o u tr en e wa l no ti c es . S o , i f yo ur n u mb e r i s co mi n g
u p, ge t yo u r su b sc r ip ti o n r e ne w al in s o on . an d,p l e a se c h ec k y ou r l a b el fo r c or r ec t a dd r es s a n dn o ti f y u s o f an y c o rr e ct io n s o r c ha ng e s.
N a m e :
A d d r :
C i t y :
s t a t e : Zip:
C o u n t r y :
A m o u n t : $H I C R O i s c u rr en t l y pu b l i s he d b i -m o nt hl y . T hef ir s t i s su e wa s OC T /N O V 1 97 7 . T he s i ng l e co p yp ri c e i s $ 1 .5 0 . Su b sc r ip t io n s a r e $6 .0 0 f or s ixi ss u es i n t he U S A. S i x is s ue s u bs c ri p ti on s too t he r co u nt r ie s ar e l is te d b t~o w.
[Pa y me n t mu st b e i n U S $.]
S tar t H IC RO #:
B ac k I ss ue s:
Yo u r n am e a nd ad d re s s wi l l b e ma d e a va i l a b l e t ol e g it i ma te de a l e r s, su p pl i er s , an d o th e r 65 0 2in t er e st s so th at yo u ma y b e ke pt in f or m ed o fne w pr o du c ts , cu r re n t d e ve l op me n ts , a nd s o f or th_ u n l e s s y ou s pe c if y th a t yo u do ' n ot w i sh y o urn a me r e l e as e d t o th e se ou t si d e so u rc e s.
$ 7 . 0 0$ 8 . 0 0
$ 1 4 . 0 0$ 1 4 . 0 0$ 1 2 . 0 0$ 1 6 . 0 0
S ur fa ce : C an ad a/ He xi coAl l o the r co unt rie s
A i r Ha i l : E u ro p eS ou th A me ri ca
C en tr al A me ri caA ll o th er c oun tri es
I s s u e s # 1, 2. 3, 4, a nd 5 ar e av a il a bl e w hi l et he s up p l y l as t s. T he p ri c e is $ 1 .5 0 p er co p y- US A , C a na d a o r - H ex ic o . Ot h er co u nt r ie s a dd$ .5 0 p e r co p y su r fa c e or $ 1 .2 5 pe r co p y a i rm a i l .
Se nd pa ym e nt t o:
HI C RO , P . O. B o x 3, S . C h e l m s fo rd , M A 0 1 82 4 , US A
4 . W ha t k in d of ar t ic l es do yo u wa nt t o s ee i nM I C R O :
W i th th i s ' .l i xt his s ue of M I C R O , we c o me t o t hee nd o f M I C R O' s fi r st y e ar . W e a re q u it e pl e as e dw it h t he g ro w th o f M IC R O, w i th t h e s up p or t weh av e r ec e iv e d f r om au t ho r s a n d a dv e rt i se r s, a n dw it h th e g e ne r al l y p o si t iv e f ee d ba c l C f ro m o u r
r ea d er s . Wh i l e i t is a l wa y s ni c e t o r e ad nl o vel e t t e r sn , w e w ou l d l ik e t o ge t s o me s pe ci f icin f or m at i on a bo u t yo u a n d y ou r i nt e re s ts in t he65 0 2 wo r l d . P l e a se t a ke a f e w m i nu t es t o a n sw e rth e fo l l o w in g qu e st i on s . Yo u r a ns we r s w i l l v e ryd ef i ni t el y e ff e ct t h e f u tu r e co u rs e o f M I C R O .
1 . P l e as e de s cr i be y o ur cu r re n t 6 5 02 ba s edeq u ip m en t in de t ai l : t yp e , a mo un t of m em o ry , a ndso f or t h:
~. A ss u mi n g t h e si ze s t ay e d t h e sa m e, w o ul d yo ul ~k e to s e e M IC R O p u bl i sh e d m o nt h l y ?
6. Th e c u rr e nt pr i nt in g fo r ma t o f M IC R O - th eh ea l y s to c k an d t hr e e ho l e pu n ch i ng - c o st smo r e t ha n a s t an d ar d m a ga zin e fo r ma t . I t wa sd es i gn e d s o t ha t r ea d er s c o ul d t ak e t h e jo ur na la pa r t an d s a ve ar t ic l e o f in t er es t in no t eb o ok s.W e w i l l c on t in ue t h is f or ma t if e no u gh r e ad er sfe el st ro n gl y a bo u t i t. Pl e as e c ir c l e o n e:
Ke ep Fo rm at Pr ef e r Don ' t P re f ero r E l se l C u rr e nt Re a l l y N o rm a l
Fo r ma t . C a r e. Ma g azi ne
F o r m a t .7. P l e a se ra t e y ou r s ki l l l e ve l in m i cr o s:
H a r d w a r e : B e g i n n e r I n t e r m e d i a t e E x p e r t
So ft w ar e : Be g in n er I n te rm e di a te E x pe r t
8. W ha t w as y o ur fa v or i te M I C R O ar t ic l e?
2 . Des c ri be p ro d uc t s y o u wo u l d l ik e t o p ur ch a sein t h e n ex t y e ar , wh e th e r or n ot th e y c u rr e nt l y
ex is t , a nd w h at y o u w ou l d c o ns i de r a re a so n ab l ep r i c e :
3. De sc ri b e t h e us e s y o u h av e o r fo r es e e f ory ou r 65 0 2 b as e d e q ui p me n t:
Th an k y o u f or ta k in g t he t im e . S e nd th i s s h ee tto :
HI C RO , P .O . B ox 3, S . C h el m sf o rd , HA 0 1 8 2 4
C a l E. M e r r i t tR . 1 , 4 R i c h f i e l d l a n e
D a n v i l l e , I N 4 61 22
I used one of the existing PET 5 vol t sources.The easiest way to steal the video and drives isto carefully scrape clean the foils next to themonitor plug and tack solder a twisted pair toeach signal and to the closest ground buss.Other variations would work equally well.
To avoid metal shavings and such falling on themain board, I removed the back cover from themonitor (Power OFF) and mounted a BNCjack twoinches to the right of the brightness control
The circui t is very silaple and oan be put to-getber with a wire wrap tool in a tew .inutea.
Video monitors seem very tolerant and tbe twounits I have used work tine. Tbe only problemencountered was in attempting to do all white
screen or very dense graphics which caused synctear in one of tbe monitors. Nol'llal or denselistings worked well.
OUTPUT WAVEFORM
-
1--
--- VIDEO_____.
DOTS-----I-I-L....
-o volts
( HORIZONTALj/SYNC PULSES
~VERTICALINTERVAL
and fed it with a twisted pair. I mounted theboard under one of the bolts that hold the mon-itor to the main chassis and attached the drivetwisted pairs to the existing ones for the mon-
itor. -This circuit provides composite vldeo outputfrom the PET. I have used the output to drivetwo different video monitors with good success.
All three monitors I tried worked with this vid-eo output. The appearance of the video will bea function of the quality of the monitor. Someof the scrapped out commercial units availablewith the 10MHzand more bandwidths look excel-lent with the PETvideo. I have had a number ofpeople comment that my 12" commercial monitorlooks better than the built-in unit. The add-ondoes not alter the existing PETdisplay in anyway.
Kar1 E. i)Josig2038 Hartnell StreetUnion City, CA94587
6:42
~ - - ~~~~~ . .
It is by now well known that the PET has nosource of power for use outside of itself. Theonly source available is at the second cassetteInterface. This +5 YDCline will not sourcevery muchcurrent; in fact, it will not even runa second cassette recorder. Also, all the +5YDCregulators inside the PET are already run-
ning quite warm. If you want to experiment withthe PET, say with the Parallel User port (MosTechnology 6522 YIA), then where do you get thepower without a complicated power supply inter-face? The answer is simple. I found the fol-lowing inside the PET. One, the bridge recti-fier is good for 3 Amperes. Two, the PETdraws1.5 Amperes worst case load't. Conclusion: itshould be possible to get 1 Ampere out of thePETwithout straining a thing.
To do this, all weneed to do is run a line fromthe + (positive) side of the PET's filter capac-itor and make it available at the rear of thePET (I put a test lead jack between the Paralleland IEEE Ports). This is +8 YDCUnregulated andby attaching a 3-point Regulator (see diagrambelow), say at our project board, we have plenty
of power for all sorts of home projects. As anexample, I brought all of the Parallel User Portpinouts down a 24" -r-Lbboncable along with the+8 YDCline to a chassis which has the +5 YDCregulator and other circuitry, and terminatedthis on a homebrew mother board comprised of
Radio Shack
TRB·SDcommodore
PETEITHER WAY.•. We've got software for youlYou can find out what our customers already know-Personal
Software consistently offers great software products. Check out the
programs below-they each represent many man-months of expert
programming effort. We're sure you'll be pleased with the results.
1502 ASSEMBLER IN BASIC byDen Fyl.tre for 8KPETs: Accepts all
standard 6502 instruction mnemonics, pseudo-ops and addressing
modes. Evaluates binary, octal, hex, decimal, and character
constants, symbols and expressions. Assembles object programs
anywhere in memory. Includes one and two pass versions of the
assembler, text editor and disassembler, with a 30 page manual and
PET machine language programming hints $24.95
MICROCHESS 1.5 by Peter Jenning. for 4K Levell and II TRS-80s: InZ-80 machine language, easily-loaded from cassette using the
CLOAD command (TBUG is not needed). Uses standard algebraic
chess notation to describe moves,and checks every movefor legality.
Handles castling and en passant captures. You can· play white or
black, set up and play from special board situations, or evenwatch the
computer play against itself! With 3 levels of chess play .... $19.95BRIDGE CHALLENGER by George Dul.men for 8K PETs and 16K
Level II TRS-80s: You and the dummy play four person Contract
Bridge against the computer. The computer will deal hands at random
or according to your criterion for high card points. You can review
tricks, swap sides or replay hands when the cards are known. No
longer do you need four people to play! $14,95
ORDERS: Check, money order or VISA/Master Charge accepted;
programs and cassettes guaranteed. Our catalog describes many
other great software products, including anASTROLOG Yprogram, aFOOTBALL game, a GRAPHICS utility package andmany others. For
your free copy, send a letter giving your PET or TRS-80 serial number,memory size, and your most wanted software product.
22-pin edgecard connectors. I can now experi-ment with things such as noise makers, joy-sticks, etc. and have plenty of power for them.
I believe this should be of great benefit forthose of you who like to mess around with thehardware. Warning 11: If you are going to
drill a hole in the PETas I did, disconnect allconnectors (very, very gently) to the PET's MainBoard and remove it before going to work. Cleaninside thoroughly before re-installation.Warning 12: In your projects, do not connectinductive loads directly to any output of thePET. Inductive loads must be fully buffered.
rM
+S(UNREGI p---cv II.M-309K I ·5 (REG '
l Ao MAX I I1[AI
Of
2I,~~O~F :::
r :P(T J~50vO~F: : : : ~ ~~t:::::
l iN PET!
COM COM
r ' - I ' v
PET SCH·EMATICSAnother First From "PET-SHACK".For only $34.95 you get:
24" x 30·' schematic of the CPUboard, plus oversized
schematics of the VideoMonitorandTaj)ttRecorder,
plus complete Parts layout-all accurately and
painstakingly drawnto the minutest detail.
PET ROM ROUTINESAnother Breakthrough From
"PET-SHACK"For only $19.95 you get:
CompleteAssembly listings of all 7 ROMs,plus iden-
tified subroutine entry' points; Video Monitor,
Keyboardroutine, Tape Recordand Playback routine,
RealTimeClock,etc.
Toentice youweare also Includingour ownMachine
LanguageMonitorprogramforyourPETuslng,thekey-
board and videodisplay.
You can have the Monitor program on cassette for only
S9.95 extra. N ow H. C . s V I S ASend check ormoneyorder
TO: PE:T-SfHttCKOftw... Ho.... P37Marketingand Research Co.
W A R N I N G 11: T he r o u t i n e m u st be p la c e d i n c or ew h e r e i t w i ll n o t o v e r w ri t e i ts e l f d u r i ng t h eP a c k. Th e s t a rt o f t h e r o u t in e m us t b e a b o veH I H E H ( e .g . i n t h e hi g h r e s ol u t i o n d i s pl a y r e -
g io n ) o r $ 1 7 A + 4. N + W be l o w th e s t ar t o f t h eB A S I C p r og r a m , w h e re N i s t h e n u m be r o f r ou t i n e ss t o r e d a n d W i s t h e t o t a l n u mb e r o f w o r d s i n a l lo f t h es e r o u ti n e s . A l s o , t h o se ro u t i n e s t ha ta re hi g h e s t i n m e m o ry s h o ul d b e pa c k e d f i r s t t oa v o i d o v e rw r i t i ng d ur i n g pa c k o r r e st o r e . O th -e rw i s e i t i s n o t n e c e ss a r y t o wo r r y ab o u t o v e r -w r i ti n g d ur i n g t h e re s t o r e p r oc e s s; on l y $ 1 Aw or d s ju s t b el o w t h e B A SI C p r o g r a m a r e u s e d.
W A R N I N G 12: Do n o t a t t em p t to e d i t t h e p r o gr a ma ft e r c al l i n g H K UP . I f e d i t in g i s n e c e s s ar y ,R U N o nc e t o u n p a c k , t h en e d i t a n d c a l l H K U Pa g a i n .
APPLE INTEGER BASIC SUBROUTINE PACK AND LOAD
R ic h a r d F . S u i t or1 66 T r e m o nt S tr e e tN e wt o n , MA 0 2 1 5 8
T h e r o ut i n e w or k s a s fo l l o w s . I t f i r st p a c k st h e r es t o r e r o ut i n e ju s t be l o w t he B A S I C p r o -g r am . I t t he n p a c k s o t h e r r o u ti n e s as r eq u e s t -e d , w i t h f i r s t a d d r e ss a nd n um b e r of b y t e s( wo r d s ) . W h e n S i s g i v e n , i t p a c k s i t s el f w i tht h e in f o r m at i o n to r e s t o r e L O H EM a n d t he b eg i n -n i n g o f th e B A S I C p r o g r am . T he f i r st $ 4 6 wo r d so f t h e r o u t in e f o r m a B AS I C s t at e m e n t w h i c h w i lli n i t ia t e t h e re s t o r at i o n p r oc e s s wh e n R U N ' i st y p e d .
I f a p a r t i cu l a r H I H E H i s n e e d e d b y t h e p r o g r am( e . g. f o r h i g h r e so l u t i o n p r o g r am s ) i t m u st b ee nt e r e d b e fo r e L O ADi n g. T h e L O M E H w i l l b e r e s e tb y t h e r e st o r a t io n p r o c es s t o t he v al u e it h a dw h en H K U P w a s c a l l e d .
I d o n o t h a v e a S W E ET 1 6 a s s e mb l e r , h e nc e a ll oft h os e o p c o d e s ar e li s t e d as t a bl e s o f d at a . I nt h e l i s t i ng , c o mm e n t s in d i c a t e w h e re c on s t a n t s
a n d r e l a t iv e d i sp l a c e me n t s ar e d i f f e re n c e s b e -t w ee n l a b e l s i n t h e r o ut i n e .
S om e c on v e n i en t l oa d an d e nt r y p o i n ts a r e :
B A S O ( l o a d) H K U P ( e n t r y )h ex h e x d e c i m a l
8 00 8 80 2 1 7 6A 9 0 B l0 2832
1 0 4 C 1 0 C C 430 02 0 50 2 0DO 8 4 0 03054 30D4 1 2 5 0 0
6 : 4 5
E d it o r ' s No t e : W h i l e we e n co u r a g e t h e u se a n dd i s tr i b u t i on o f t h i s s u br o u t i ne , we d o r e q u es tt h at p r o p e r c r e d it b e g iv e n . P le a s e p la c e t h efo l l o w i ng n o t i c e o n a n y c o pi e s th a t y o u m ak e :
"T h is P A C K & LO AD Su b r o u ti n e wa s w r it t e n b y :R i ch a r d F . Su i t o r an d p ub l i s h ed i n H I C R O 1 6 . "
[A I t h o ug h t hi s a r ti c l e i s C o p y r i gh t e d b y T h eC O HP U T E R I ST , I nc . , a t t h e a u t h or s re q u e s tp r e m i ss i o n i s h e r e b y g i ve n t o u se th e s u b ro u t i n ean d to d i st r i b u te it as p a r t o f o t he r p r o gr a m s . ]
Th e f i r s t i s s u e o f C O NT A C T , t h e A pp l e N e w s l et -t e r , g a v e a s ug g e s t i on f or l o a d in g as s e m b lyl a ng u a g e r o ut i n e s w i t h a B AS I C p ro g r a m . S i m p l ysu m m a r i ze d , o n e d r o p s t h e p o i n te r o f th e B A S ICbe g i n n i ng b e l o w t h e a s s em b l y l a n g ua g e p o r t i on ,a d ds a B AS I C i n s tr u c t i o n th a t w i l l re s t o r e t h ep o i n t er a n d S A YE s . T h e p r o c ed u r e i s si m p l e a n def f e c t i ve b u t h a s t w o l i m i t~~i o n s . F i rs t , i t i si n c o n ve n i e n t i f BA S I C a n d t h e r ou t i n e s a re w i d e-ly s e p ar a t e d ( a n d is v e ry t r i c ky i f t h e r o u t i ne ss t a r t a t $8 0 0 , ju s t a b o ve t h e d i sp l a y p o r ti o n o fm e mo r y ) . Se c o n d , a p ro g r a m s o s a v ed ca n n o t b eus e d w i t h a no t h e r H IM E H , an d i s t hu s i n c o n v en -i e n t t o s h ar e o r t o s u b m it t o a s o f t wa r ee x c h a n g e .
Th e su b r o u t in e p r e se n t e d h e re a v oi d s t h e s e d i f f -
i c u l ti e s a t t h e ex p e n s e o f t h e e ff o r t t o i m p l e-m e nt i t . It is co m p l e t el y p o si t i o n in d e p e n de n t;i t ma y b e m o v e d f r o m p l a c e to p l a c e in c or e w i t ht h e m o ni t o r m o v e· co m m a n d a n d us e d a t th e n e wl o c a ti o n wi t h o u t m od i f i c at i o n . I t m a ke s e x t e n-s i v e u s e of S W E ET 1 6 , t h e 1 6 b i t i n t e r p re t e r s u p -p l i e d a s p a r t o f t he A p p le M o ni t o r RO M .
T o u s e t he r ou t i n e f r o m A p p l e I n t e g er B A S IC ,C AL L HK U P , w h er e H K UP i s 1 2 8 ( de c i m a l) p l u s th ef ir s t a dd r e s s o f th e r ou t i n e . T h e p r o mp t s h o w ni s " @ " . R e sp o n d w i t h t h e h e x l i m i ts o f t h e r o u -t i ne t o b e s t o r ed , a s B B BB . E E E E ~BB B B is t h e b e -g i n n i ng ad d r e s s , E E E E i s th e e n di n g; t h e s a m ef or m a t th a t t h e m o ni t o r us e s ) . S e v e r al g r o u p sma y be s p ec i f i e d o n o n e l i n e se p a r a t ed b y s p a ce so r s e v e r a l l in e s . Ty p e S a f t er t h e l as t g r o upt o c om p l e t e t h e p ac k a n d r e t u rn t o B A S IC . Th e
p r o g ra m c an n o w b e s a v ed .
T o l o a d , e n t e r B A S I C a n d L OAD. W h e n c o m pl e t e ,R U N . T he f i r s t R U N w i ll m ov e a l l r o u t in e s b a ckto t h e i r o r i gi n a l l o c at i o n a n d r e t u r n co n t r o l t oBA S I C . I t w il l n o t R U N t h e p r o g ra m; s u b s e qu e n tR UNs w il l.
A L I S T of t h e p r o g r am a f t er c al l i n g H K UP a n d b e -f o re t h e f i r s t RU N w i l l s h o w o n e B A S IC s t a t e m en t( wh i c h in i t i a te s t he re s t o r at i o n p r o c e s s) a n dg i bb e r i s h. I f t h is i s d on e , R E S E T f o ll o w e d b yC T RL C wi l l r e t u rn c o n t r o l to B A S I C .
0 0 1 0 : I N T B A S I C S U B R P A C I ( 8. L [ ] A D0 0 2 0 : C A L L B AS O +1 28 ( DE C >0 0 : 3 0 A C C L •DL 0 0 0 00 0 4 0 B S O L •DL 0 0 0 20 0 5 0 T A B L • DL 0 0 0 40 0 6 0 T B C L •DL 0 0 0 60 0 7 0 H I M S : . DL 0 0 0 8 S Y M B [ ] L T A B L E
0 0 8 0 L M R T . DL O O O A A C C L 0 0 0 0
0 0 9 0 B P R 6 •DL O O O C B S O L 0 0 0 2
0 1 0 0 F R M L . DL O O O E
T A B L 0 0 0 4
0 1 1 0 N E ' y °T •DL 0 0 1 0 T B C L 0 0 0 6
0 1 2 0 B P R 2 •DL 0 0 1 2H I M S 0 0 0 8
01:30 P T L L •I l L 0 0 1 4 L M R T O O O A
0 1 4 0 i < T A B •DL 0 0 1 6B P R 6 O O O C
0 1 5 0 S K P L •DL 0 0 1 8F R M L O O O E
0 1 6 0 M []DE •DL 0 0 3 1 N B Y T 0 0 1 0
0 1 7 0 y S A . . .. .•DL 0 0 3 4 B P R 2 0 0 1 2
0 1 8 0 P R M P . DL 0 0 3 3 P T L L 0 0 1 4
0 1 9 0 L M M L •DL 0 0 4 A ~ ~ : T A B 0 0 1 6
0 2 0 0 H I M L . DL 0 0 4 C S K P L 0 0 1 8
0 2 1 0 L M I ..L •DL O O C C M[]DE 0 0 3 1
0 2 2 0 E : B S L . DL O O C Ay S A . .. . . 0 0 3 4
0 2 : 3 0 . J S F i : L. DL O O C EP R M P 0 0 3 3
0 2 4 0 K ; : C 2 •I l L E O O : 3 B A S I CL M M L 0 0 4 A
0250 B U F F . DL 0 2 0 0H I M L 0 0 4 C
0 2 6 0 6 T N M •DL F F A 7 L M l o . I L O O C COE~70 P B L 2 . DL F 9 4 A
B B S L O O C A
0280 C [ ] U T . DL F I l E D S S : R L ( l O C E
0 2 9 0 B E L L . DL F F 3 A B S C 2 E 0 0 3
0 30 0 f : i T L N . DL F D 6 7 B U F F 0 2 0 0
031 0 S I. •I 1 6 . DL F 6 8 9 G T N M F F A 7
O:3 c ' 0 : B A S I C I N S T . T [] R E S T [ ] R E P B L 2 F 9 4 A
0 : : : : : 0 0 6 0 0 0 0 0330 E : A : S : . H S 4 6 0 0 0 0 6 4 B 1 0 1 C [ ] U T FDED
0 : : : : : 0 : : :4 B 1 0 1 B E L L F F 3 A
1 ) : : : 0 6 0 0 6 5 1 : : 7 034 0 . H S 0 0 6 5 B 7 4 C O O 0 3 6 4 B 2G T L N F D 6 7
O:=:UE 020065 0350 . H S 0 2 0 0 6 5 3 8 2 E 3 F B 2 C AP T B K ( 1 8 4 6
0 : : : :1 3 : : : : : 2 E 3 F P T 0 2 0 8 4 9
0 : : : ' : 1 B 2 C A P T 0 4 0 8 7 0
1 ) : : : : : 1 6;:,7212 036 0 . H S 0 0 7 2 1 2 B 7 4 6 0 0 7 2 1 F M I < U P 0 8 8 00 : : : ' : 1: : : ' B 7 4 6 0 0 1 ' 1 1 < 2 1 0 8 8 2
0 : : : : : 1 C 2 1 F 1 ' 1 1 < 2 2 0 8 B 3
0 : : : : 1 E 1 : : 2 0 0 0 1 037 0 •H S . : : 2 0 0 0 1 0 3 6 4 B 3 0 3 0 0 1 ' 1 1 < 0 1 ( l 8 B 4
( ' : : : : : 2 13 6 4 E : : : : : : M K 0 6 ( l 8 C A
1 ) : : : 2 4 0 : : : : : 0 0 M E R R 0 8 D l
0 8 2 6 65:;:E:2E 0:380 . H S 6 5 3 8 2 E 3 F B 2 C B 0 0 7 2M K 0 5 C l 8 D E
0829 : : : : : F B 2 C B t 1 1 < 0 2 0 8 E l
OG:2C 00721 ' 1 \ 0 ' 5 1 0 8 E B
0 8 E : E 1 2 3 8 2 E 039 0 •H S 1 2 3 8 2 E 3 F B 2 C A 0 0 7 21 ' 1 1 1 5 2 0 8 F 5
0 ~ : : 3 1 : 3 F B 2 C A S M 0 2 0 9 0 9
0~:34 0 0 7 2 S M 0 3 0 9 0 B
0 836 1 2 B 7 4 6 0 4 0 0 . H S 1 2 B 7 4 6 0 0 7 2 1 5 B 2 0 0 M K 0 9 0 9 0 C
O : 3 : 3 ' = ' - 0 0 7 2 1 5 M K 1 1 0 9 1 A
0 : : : : : 3 C 2 0 0 1 ' 1 1 < 1 2 0 9 1 B
0 : : : : : : 3 E1 7 2 0 3 0 4 1 0 •H S 0 1 7 2 0 3 4 D B I 0 I 0 0 0 1M K I 0
0 9 3 20 8 4 1 4 D B I 0 l S M 0 4 0 9 4 6
0 8 4 4 0 0 0 1 P T L P 0 9 5 2
0 4 2 0 : I N I T . R E S T [ ] R E []P P L P O 0 9 5 5
0 8 4 6 D8 0 4 30 P T B K C L D P L P l 0 9 5 A
0 8 4 7 A 2 0 1 0 4 4 0 L DX 0 1P L P 2 0 9 6 6
0 8 4 9 B 5 C A 0 4 5 0 P T 0 2 L DA . B B S L , X S T 1 6 0 9 6 A
0 8 4 B 9 5 0 2 0 4 6 0 : : ; : T AB S O L , X0 8 4 D B 5 4 C 0 4 7 0 L DA . H I M L . X0 8 4 F 9 5 0 8 0 4 8 0 S T A ~ I M S , X0 8 5 1 C A 0 4 9 0 DE X0 8 5 2 l O P S 0 5 0 0 B P L P T 0 20 8 5 4 2 0 8 9 F 6 0 5 1 0 . J S R S I I I 1 6
A P A R T I A L L I S T O F P E T S C R A T C H P A D M [M O R Y
G a r y A. C r e i g h t o n625 Orange Street, No. 43
N e w Haveh, CT 0 6 51 0
A f u n c t i o n a n d a s y m b o l d ~ r i n e d :D E F F N I N D( L O C ) = P E E K ( L O C ~ t ) . 2 5 6 + P E E K ( L O C )
W h i c h s p e c i f i e s a n I n d i r e c t a d d r e 5 5 i n t h e f o r m : L O C + 1 = ( P a g e )L O C = ( I t e m )
MeLOe)
H e o lF N I N D( 1 )M ( j)
M ( S )fN INn'S)
H(10-8g)
M(90-98}
M (9' )M e g a >FN H ID {"3 }
fN IND(115)FN IND( 122)
FN IND{ 124)
I : ' I i IND( 126}
FN IND(128)
FN HID(130}
FN INOC1j2)
FN rND('3~)P H I N O {l 36 )F H l N D( 1 3B )FN IND( PIO)
f 'N I NP (1 42 }FN IND('4~)
P H IN D(1 11 6)P H 1 11 8)M(PI9)
FN HD( 150)
P N I N D( 1 5 2 )M{ 156)
PH IND(151)
M ( 1 5 1 - 1 6 1 )M e 163-165)PM INDC16Q)M{ 166-170}Me 171-175)
M( 176-181)
M(181)
M(1Sll-1S9)H(192)
Me 194-217)
s p e c i f i e s c o n t e n t s o f a m e m o r y l o c a t i o n .
JMP instructionU ~H jump l o c a t i o nP r e s e n t 1/0 De v i c e N u m b e r (suppress printout)POS f u n c t i o n stope
A r g u m e n t s Of c o m m a n d S ~i t h r a n g e 0 t o 65535( P E E K . P O K E . W A I T , S r S . a O T O , G O S U B , L l n e Number.RAM c h e c k )I n p ut . B uf f&r
F l ~g 5 t o r MISHATCH t O i s t i n g u i s h i n g b e t w e e n s i m i l a rs u b r o u t i n e s , e t c .1 9 n o r e C o d e V a l u e a n d d o d i r e c t ( b e t ~e e n q u o t e s ; e t c . )(0 IMPUr. 6~ G E T / G E r " 152 READ) F l a gT r a n s r e ~ Nu~ber p o i n t e r
N u m b e r p o i n t e rB e g i n B a s i c C o d e pOinter
B e g i n V a r i a b l e s p O i n t e rV a r i a b l e L i s t p o i n t e rE n d Variables p O i n t e rL o w ~s t S t r i n g V a r i a b l e s p o i n t e rH i g h e s t S t r i n g V a ~l a b l e s p o i n t e r~i r s t F r e e A f t e r S t r i n g s p o i n t e rP r e s e n t L i n e N u m b e r (if M ( T37)= 255. n o l i n e n u m b e r )L ine Nu ru be r a t B RE AKC o n t i n u a R u n p o i n t e r (if M ( 1 ~1 ) =O , n a n ' t o o n t i n u e )Line N u m b e r o f P r e s e n t DATA l i n eN e x t DA T A p o i n t e r ( f o r R E A D )
Next Da t a / I n p u t A f t e r L a s t C o m m a p O i n t e rCoded ,~t C h a r a c t e r of Last Variable
C o d e d 2 n d C h a r a c t e r o f L a s t V a r i a b l eV a r i a b l e p o i n t e r (all variables)V a r i a b l ~ pointer
C o m p a r i s o n S y m b o l A c n u m u l a t o r « = »P oi nt er t o P N p O i n t e rN u m b e r S t o r e / W o r k a r e a ( S Q H )J H P ( F N I N D( 1 6 4 »F u n c t i o n J u m p a d d r e s sN u m b e r S t o r e / W o r k a r e a ( T r a n a c e n d e o t a l s ( n o t E I P ) & S Q H )N u m b e r S t o r e / W o r k a r e a ( T r a n s c e n d e n t a l s & S Q R )M a i n N u m b e r s t o r e / W o r k a r e aNlJmbe r Sign
S e c o n d a r y N u m b e r S t o r e / W o r k a r e aL e n g t h o f t h i n g s 1 n I n p u t B u f f e r HelD-B9) o rLen gt h o f t h i n g s i~ O u t p u t N u m b e r MC2 56 - ) . .. o t h e rS u b r o u t i n e : P o i n t t h r o u g h c o d e o n e a t a t i m e , R t S w i t bc o d e v a l u e 1 n accumulator a n d Garry Flag Clear i fo if e n d o f l i n e . I g n o r e S p a c e s . l S C {O - 9 }
C o d e P o i n t e rH u m b e r S t o r e / W o r k a r e a ( R N D)S c r e e n M e m o r y R o w locat1onS o r e e n C o l u ~ n p o s i t i o n
Mo~. M••or} (fro. or to) pointerQ u o t e t l a l ( 0 e Dd q u o t . ) ( 1 b e l 1 f t q u o t e )Leoltb or P11e Da•• a f t e r SlV8VIRIPI e t c .r i l e ,1/0 O p t l 0 D (0 ~••d. t vrlte~ 2.rite/EOT)Device' (0 keyboard. 1 tapel't 2 t p a e l 2 , 3 s c r e e n )Vraparouod r l s g ( 39 siDsle l i c e . 7 9 2 n d DC d o u b l e l i n e )T a p e ' 1 o r fa B u t t e r p o I n t e rScreeD R o w (0 - 2 q )
L Q a d i n t o l V o r l l y f r o m ? S a ~ e I n t o p o i n t e rI n 5 e r t C o u n t e r ( INST)MiDUS sliD o r S p a c e ror O u t p u t N u m b e rOutput K u . b f t r ISC Digits til a Null (0) orT a p e R e a d V o r k 1 o g S t o r a g eS t a c k a r e aTI clockO n l y O n e V a l u e p e r k e y p u a h r l a lS6IFT flag (0 no 8hltt. , sbitt)I I U p d a t e I n t e r r u p t C o u n t e rB it C a n c e l I : e y sT u r n s b i t e orf u n d e r
Ho1
2
32 i
56
7
t h e following
DE C I M A L ,2 5 4253251
247239
r u l e s :
I.I..lR i S
s p a c e M o r e t h a n o n e k e y
~ a y b e p u s h e d at once.t o p(Done)
De c i m a l , I s B i n a r y
e q u i v a l e n t .
191
1 2 7
V E R I F Y / L O A D C l a g ( 0 L O A D, 1 V B R I F Y )ST Status
l e y P u s b e d C o u n t e r ( M O D 1 0 )R V S f l a g ( 0 HV S o f f t 1 R V S o n ) - o r a n y k e y p u s h e d ]I n p u t Run BuCfer (keys stored d u r i n g a RONI n t e r r u p t V e c t o r ( o o r m a l l y a t : S t o r e K e y p u s hB R K i n s t r u c t i o n V e c t o r ( U s e r l o a d e d > i n I n p u t R u n B u f f e r )( e y b o a r d I n p u t C o d e(Stays equal to Input c o d e t i l f i n g e r o r f key,M a t o h e s u p one t o o n e w i t h " ( 5 9 2 2 8 - 5 9 3 0 7 ) w h i c h 1 sK e y b o a r d I n p u t C o d e t o A S C C o d e Table)B l i n k C u r s o r rlag (It 0 (no key p u s h e d »C u r s o r B l i n k Du r a t i o n c o u n t e r ( 2 0 i n t e r r u p t s )S c r e e n V a l u e o f I n p u t C b a r . w h e n C u r s o r m o v e s o nI n s u r e n o C u r s o r Breadcru.bs lert b e h i n dScreen Page lrray I a1nlle or double Line flagsFl1e' or one D r 10 fllesDevice' of one o r 10 filea1/0 o p t i o n o n e o r 10 r 1 1 e aInput fro. soreen/Input f r o . k e y b o a r d f l a g