micro 6502 journal december 1978

52
8/3/2019 Micro 6502 Journal December 1978 http://slidepdf.com/reader/full/micro-6502-journal-december-1978 1/52 The Magazine of the APPLE. KIM. PE'T and Other @If!lc!)~ Systems Apple I)'" PET<M KIM 1

Upload: cubemanpdx

Post on 06-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 1/52

The Magazine of the APPLE. KIM. PE'T

and Other @If! l c ! )~ Systems

Apple I)'" PET<M

KIM 1

Page 2: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 2/52

microsystemsP.O. Box 687 224 S.E. 16th Street

515/232-8187

DB/65

A complete hardware/software debug system for the Rockwell, Synertek, MaS/Technology 6500microprocessor family.

Ames, Iowa 50010

Features

* Prom resident debug monitortandard in-circuit emulator

Hardware breakpoints

Single step mode

Eight software breakpoints

Real-time software breakpoints

RS232C or current loop terminals

Symbolic disassembly of user program

Serial/parallel load capability

Program trace of instructions and registers

* Software history of instruction addresses

* 2K ram standard with sockets for additional

6K if required

* Scope sync output

* User NMI and IRQ vectors supported

* Write protect

* User program may reside in high memory

SINGLE QUANTITY PRICE $1450

Page 3: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 3/52

t).."

D EC EM BE R 1 97 8/ JA NU AR Y 1 97 9

I SSU E N UMBER EI GH T

I N T HI S I SS UE . ../ NO TE S • •./ MI CR OB ES

6502 Interfacing for Beginners: Buffering the Bussesby Marvin L. De Jong

LIFE for your Appleby Richard F. Suitor

C om pu te r- De te rm in ed K in et ic P ar am et er s i n T he rm al A na ly si sby Dr. L. S. Reich

Continuous Motion Graphics or How to Fake a Joystick with the PETby Alan K. Christensen

, St or ag e S co pe R ev is it edby Joseph L. Powlette and Donald C. Jeffery

An Apple II Program Relocatorby R ic k Au ri cch io

S YM-l Ta pe D ir ec to ryby John Gieryic

Inside PET BASICby J im B ut te rf ie ld

An Apple II Page 1 Map

by M. R. Connolly Jr.

6502 Bibliography - Part VIIby William R. Dial

Advertiser's Index

A B C om pu te rsC O MP A S M ic r os y st e msC om pu te r C om po ne nt s

The C om pu te ri st , In c.C o m p ut e r l a n dC om pu te r S ho pC o nn e ct i cu t m i cr o Co m pu t erD ig it al D yn am ic sE nc l os ur e G ro upF or et ho ug ht P ro du ct sH. Geller Computer Systems

26 NEECOIFC Newman Computer Exchange

2 Optimal Technology

10 Personal Software43 Pet Shack Software House4 4 Pl ai ns man Mic ro sys te ms20 Q ix S ys te ms34 Soft side SoftwareBC Speakeasy Software Ltd.28 Synertek Systems Corp.48 The Think Tank

35

II

15

23

29

31

35

39

41

45

lBC2110

22273728198

3 8

9

MICRO is published bi-monthly by:Th e CO MPU TER IST, In c. ,P.O. Box 3, S. Chelmsford, MA 01824

Co nt ro ll ed C ir cul at io n p os tag e p aid at :Ch el msf or d, MA 0 18 24 .

Pu bl ic at ion N um be r: CO TR 3 957 70 .Subscription in US: $6.00/6 issues.Entire contents copyright 1978 by:

The COMPUTERIST, Inc. ~

Editor/Publisher

Robert t~. Tripp

A s s' t E d it o r/ P ub l is h erGary W. Dozier

B us in es s M an ag erDonna M. Tr ipp

A d mi n is t ra t iv e A s si s ta n tSusan K. Lacombel ea se a dd re ss a ll c or re sp on de nc e,

s ub scr ip ti on s, an d a dd re ss c ha nge s t o:MICROP.O. Box 3, S. ChelmsFord, MA 01824

C ir cu la ti on M an ag er

M ag gi e F is he rDistribution

Ei leen M. Enos

M ic ro -S ys te ms L abRobert J. Gaudet

GoferF re d D av is

Page 4: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 4/52

SYSTEMS *Apple II 16K RAM5119500 • Commodore PET 8KRAM579500 • Commodore KIM I 517500

svnertek VIM 526900• Microproducts super KIM 539500

* Delivery on most systems is usually stock to 2 weeks. call or write for specific information.

SET FOR APPLE IIAll Chips tested and burned in. Chips are 200ns. and are guaranteed for 1 year.

ONLY $11900

5200.00

5189.00

5180.00

WORKSHOPS: Call for details.KIM-2nd saturday of the Month • PET3rd Saturday Of the Month

APPLE-4th Saturday of the Month

CLASSES: Apple Topicsoffer a series of free classes on Apple II to aquatnt owners with some of the unique features and capabilities

system. Topics covered are APPle Sounds, lOW Res. Graphics, Hi Res. Graphics, Disk Basics, and HOw to useYour Reference Material. Sessions are held every Thursday Night at 7:00 p.rn,

SOFTWARE HARDWAREAPP LE II H ARDWARE :, programmable Printer Interface (parallell

on board eprom printer driver, full nanosnake logic , driver program forCentronics, Axiom, T.!. 5WTPCPR·40,and otners assembled & tested 580.00

• Power contrOl Interface (From T.W.C. Products)Up to 16 channe l s of A.C. control per card. Controlled from BASIC. s acncnanne t capab le o f 12 amps at 110V.Opt ical ly iso la ted from A.C. l ine. A.C.ioaos are switcMed via a low D.C. VOltage on a ribbon cable tcaoreinCluded), Complete system equipped for 4 A.C.c ircu its .m... .%mAssembled. . .. . .5135.00Addi tiona l 4 c ircu it A .C.Power ModUlesKit. 535.00Assembled. . .555.00

• Joystick WltM 3 swt tcnes 'I

Great for Apple Games like' star wars. Includes trimmers to calibrate forfull deflection 535.00

, upper & Lower Case BoarelNow you can display botn upper and lower case cnaracters on your v ideowitM

tneApple II. Includes assembled circuit board and sample

software ... .549.95

, Apple Disk II' . 5595.00

Wenow have a complete software catalog.

.515.95.9.95

.. 10.00.19.9512.95.9.95. 10.00.19.9510.0019.9524.95.7.507.50

.. 15.00r c a n for details)

39,95

125.00.50.0030.00.29.9524.9519.95.49.95

, APpiesoft ROM carel' ..

, Heurtstlcs Speechlab ..

, Apple High Speed serial Interface' .

, APple communications Card' 5180.00

, Apple Pratotyplng Boarel .524.95• we are assuming mar mess items will be available f rom stock by tne time

trus is oueusnec.

P EY HARDWARE, Beeper.. 524.95

, Petunia-for computer generated sounds . .529.95

, Videa Buffer-to put your pet'S pictures on a television set ormonitor 529.95

, Memory Expansion-16K + 2 Parallel 110 5435.00

• Dual Drive Floppy Dlsk-200K user storage IAvaiiable oec.z r . 51295.00

, Commodore Hardcopy Prlnter-Iavailable MarcM ?l.5695.00

Page 5: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 5/52

IN THIS ISSUE ..•

This is the last bi-monthly issue of MICRO.Starting with the February 1979 issue, number 9,MICRO will be published monthl y . The increasepublication frequency is due to high volume andhigh quality of the articles being submitted forpublication. Our backlog of good articles is

growing too large. Also, with the addition ofthe Synertek SYM-l and the Rockwell AIM 65, weant ic ipate a flood of new material to servicethese devices. The size and shape of MICRO willremain essentially unchanged: 8 1/2 x 11 formatand 52 pages (or more) per issue. The subscrip-tion rate will remain the same: $1.00 per issue.Subscriptions will be accepted for any period ofsix issues or more. Another plus of monthl ypublication is that there will be a shorter de-l a y be twe en r ec eip t of m at eri al an d p ubl ica ti on.Th~s will permit us to print current club notes,special activity notices, end so forth.

Continuing his tutorial on "6502 Interfacing forBeginners", Marv in L. De Jong this month pre-sents "Buffering the Busses". Earlier sectionsdiscussed the logic of the Address, Data andControl Busses. This article goes into some ofthe necessary detail on actually using these inr ea l s ys te ms .

In the June/July 197B issue of MICRO, Dr. FrankCovitz presented "LIFE for your PET". Now allof the App1e owners get an equal opportunity toplay "LIFE" with Richard F. Suitor's "LIFE foryour Apple" (A suggested title of 'LIFE IN yourApple' was rejected as implying worms!). Thisprogram combines a BASIC program to setup theinitial pattern with assembl y language code top erf orm th e nu me rou s te st s a nd tr ans for ma tio ns.While it is okay to have fun and enjoy this pro-gram, you are expected to learn about using yourdisplay at the same time.

No one will mistake the article by Dr. L.S.Reich as a game. "Computer-Determined KineticPar ame ter s in The rma l A na lys is" p re sen ts a se ri-ous use for an Apple II in a lab analysis situ-ation. This is definitel y not a "beginners"article, but we hope it will help induce othersto present some of their "real" uses for theirm i cr o co m pu t er s y st e ms .

Alan K. Christensen shows how to overcone SU'''e

shortcomings in using BASIC on the PET for real-time control with his "Continuous Motion Graph-ics of How to Fake a Joystick with the PET". Inthis article you will learn something about howthe PET interpreter gets keyboard input and howyour program can "hook" into this mechanism.The result is a keyboard style "joystick" w!}i_challows you to easil y move around the display.A table is included which shows the relationshipof the keycaps, screen value, and keyboard hex

value. This table should be an aid in a varietyo f PE T/ Di sp la y o ri en te d p ro gr am s.

Powlette and Jeffery have updated the materialp re se nt ed b y M ar vi n De Jong ~n the Dec 77-Jan 78issue of MICRO with "Storage Scope Rev isited".With a modified hardware circuit and a correc-tion to the program, they produce results whichare of quite high quality.

Rick Auricchio, to whom Apple owners are already,in debt for his "An Apple II Programmer's Guide'in MICRO number 4 and "BREAKER: An Apple II De-bugging Aid" in MICRO number 7, has now come upwith "An Apple II Program Relocator" to further

assist the Apple II community. This program,whose utility will be obvious to any programmerwho does much in assembly language, also showssome techniques for using the SWEET-16 utility.

John Gieryic has wasted no time getting into

action with his SYM-l as ev idenced by his needfor a "SYM-l Tape Directory" facility which hepresents in his article. This complete programpermits the user to examine his cassette tape tofind what information is located on the tape.Since numerous calls are made to the SYM-l moni-tor, it is a good guide to using monitor sub-routines.

Jim Butterfield, widely known for his contribu-tions to the KIM via "The First Book of KIM",has written a couple of programs which both aidand instruct the user of PET BASIC. One programallows a BASIC program to be searched for a par-ticular data string with all lines which containthe string to have their line number printed. Asecond program permits a BASIC program to be re-sequenced, including fixing up GOTOs and otherfunctions which reference the line numbers. His

explanation of the workings of the programs willaid in the user's understanding of how BASIC isstructured.

M. R. Connoll y Jr. makes life easier for theApple II user who is trying to work with the on~screen text by providing "An Apple II Page 1Map" and a chart of the interpretation of valuesstored in the screen text buffer. Given thisinformation, it becomes relatively easy to workon the display using PEEKs and POKEs.

.•. AND NOTES

"Attention SYM-l and AIM 65 Users!!!! The SanFernando Valley KIM-l Users Club is expandingits membership to include these two new and ex-

citing microcomputer systems. We meet at 7:30 IPM on the second Wednesday of the month at 20224C,?hasset No. 16, Canoga Park, CA 91306. CallJ~m Zuber at (213) 341-1610 if you have anyquestions."

"This is to inform you of:

Ap ple U se rs Gr oupNeil D. LipsonPhila. Area Compo Soc. (PACS)29 S. New Ardmore AvenueB ro om all , PA 1 900 8( 21 5) 3 56 -6 1B 3 ( ho me )(2 15) B2 5-3 800 x 278 ( wor k)

For anyone owning an Apple computer."

"I am interested in starting an Apple User Group

in the Cincinnati, OH area.. John B. Anderson5707 Chesapeake Way, Fairfield, OH 45014" '

"Lincoln Computer Club is a non-8rofit schoolclub that is made up of about 6 seventh andeighth grade students. We have a PET that weuse for instruction and games. We would like toexchange programs with other PET users. Send as el f-a ddr es sed , s ta mpe d en vel ope f or in fo t o:

P ET S of tw ar e E xc ha ng eL in co ln C om pu te r C lu bL in co ln S ch oo l750 E. YosemiteMan tec a, C A 9 53 36

8: 3

Page 6: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 6/52

MICROBES

Boy, is our face red. An entire chuck of COdE!from "BREAKER:An Apple II Debuggins Aid" endedup on the "cutting room floor". [MICRO 7:5J

Weapologize to the author, Rick Auricchio, andto anyone who has lost hair and/or sleep tryine:to get BREAKERworking. The missing code Ls

printed below. Youcan tell from the PCcounterwhere it should be inserted into the originalmaterial. This is our biggest goof to date. We

are moving to new quarters right now, and willhave space to keep our microcomputers availablefor testing programs, so this should not happenagain.

7E667E687E6A7E6C7E6E7E707E727E737E757E777E79

7E7B7E7D7E7F7E81

91 40A5 2EC9 9DFO 16A5 2FFO OF6ABO 06AO 02B 1 3E91 40

AD 01B 1 3E91 I~O

4C 69 FF

STAIYLDAZCMPIMBEQLDAZBEQRORABCSLDYIMLDAIYSTAIY

ADDLEN2 LDYIMLDAIYSTAIY

CMDRET JMP

*

A3LFORMATX'9D'ADDBRCHLENGTHCMDRET

ADDLEN22A2LA3L

1A2LA3LMON

STUFF ADDRESS INTO JMPGET INSTRUCTION FORMATI S F OR MA T= BR AN CH ?=>YES. MORE TO DOLENGTH=1?=>YES. DONELENGTH=2?=>YESLENGTH=3jMOVE 3RD BYTE TO BTEGET INST 3RD BYTEAND MOVE TO BTE

LENGTH=2jMOVE 2ND BYTE TO BTEGET INST 2ND BYTEA ND ~ 10 VE TO ·B TE

DONEj BACK TO MONITOR!

*

* - - - FOR BRANCHES, WE'VE GOTTA ADD A JMP FOR THE 'TRUE'* CONDITION (SINCE WE MOVED THE BRANCH 'WAY OUTA THE PROGRAM!

ADDBRCH LDYIMLDAIYCLCADCIMADCZSTAZLDAZADCI~STAZ

NOPLDAIMSTAn

LDYIMLDAZSTAIYINYLDAZSTAIYCLVBVC

1A2L

2

A2LA2LA2HoA2H

4A3L.7A2LA3L

A2HA3L

CMDRET

SET FOR 2ND BYTEGET DESTINATION OFFSETAND ADD 2 BYTES TOCONSTRUCT ABS ADDRESS

ADD TO SUBJECT-INST ADDRESS

CARRY IT

(PL AC E- HO LDER W AS TE H ER E)TRUE-BRANCH TO +4PUT INTO NEW OFFSET

GET JMP ADDRESSMOVE IT TOTHEBTE FORTHE 'TRUE' JMP

SN EAK Y BR ANC HTO EXIT

It is very difficult for us to get listings ofthis sort correct. There are just too many waysto make mistakes, even with careful proofing.

Weare going to have to insist on computer gen-erated listings for all articles from now on.If possible, authors should submit their sourceon cassette tape and let us list it on our owncomputers.

Henry Chow of Bloomfield Hills, MI pointed outthe following typos in the "Design of a PET/TTYInterface" by Charles R. Husbands[MICRO 6:5].

LDACOUNT 893 173 251 03

TAX 901 171

INC 857 904 238 89 03

STA 857 927 141 89 03

LDA SAD 951 173 79 232

And now a first: Amicrobe in the 6502 Bibliog-raphyl Randall Julin writes that his article onthe "Video Mixer" should have indicated " ...vid~o signals put out by the PET's ParallelUser's Port, not the IEEE 488 bus."

7E847E867E887E897E8B7E8D7E8F7E917E937E957E967E987E9A7E9C7E9£7EAO7EA17EA37EA57EAn

AD 01B1 3E1869 0265 3E85 3EA5 3F69 0085 3FEAA9 0491 40AD 07A5 3E91 40C8A5 3F91 40B850 D9

8 :4

Page 7: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 7/52

()'-~,;

6502 INT[RFAC ING FOR B [GINN[R S:

BUFF[R ING TH[ B USS[S

Marvin L. De Jon~Dept. of Math-PhYS1CS

The School of the OzarksPt. Lookout, MO65726

The address bus is the set of 16 conducting

lines interconnecting the 6502 and numerousother integrated cir.cuits in the computer systemsuch as memory chips, PIAs, decoding circuits,

etc. O n my 8K memory board the address bus isconnected to 64 memory chips. The address buscarries the addressing information from the 6502to the other components in the system. It is,consequently, a one-way bus, in contrast to thedata bus which carries signals both ways.

The control bus is a set of conductors whichconnect the 6502 control ~!sn;:tls (0 , R/W,SYNC, RST, NHI, IRQ, RDY, and SO) with the othercomponents in the microcomputer system. Somecontrol signals originate in the 6502 and theseare bussed to the system. Other control signals

e.g. NHI and IRQ, originate somewhere in thesystem and are bussed to the 6502. None of thecontrol signals use a bi-directional bus likethe data bus.

Finally, the data bus is a set of 8 conductorsconnecting the 6502 and the other devices in thesystem. It presents a special problem becauseit is required to carry information two ways,hence the name nbi-directional data bus. n On aWRITEcommand the data bus carries an 8-bit word(one bit on each line) from the 6502 to a memorylocation, while on a READcommand the data buscarries information from a memory location tothe 6502. O n my 8K memory board each data lineis connected to 8 memory chips.

W H Y B U F FE R?

There are two reasons for buffering uni-direc-tional busses like the address bus and the con-

trol bus:

1. The address and control pins on the 6502 arerated to drive one standard TTL load. In any butthe simplest computer system there will beheavier loading than this.

2. Every conductor including those which makeup the busses has some capacitance. Capacitorsrequire time to charge and discharge and ndis-tortn rapidly changing waveshapes. Buffer chipscan drive a much larger capacitance than the6502, and consequently may be inserted to pre-serve the integrity of the waveshapes of thesignals.

In addition, the data bus requires a special

k1nd of buffer. Recall that the microprocessoris capable of reading data from any of 65,536

devices. But only one at a time, please. Allthe others should act as if they are not there,which means they should be disabled somehow. Iftwo devices are both attached to a data pin, onetrying to raise it to logic 1 and the other try-ing to lower it to logic 0, not even a prophetcan predict the result. The third reason forbuffering applies only to bi-directional bussesand may be summarized:

3. Buffers must be capable of isolating the busfrom all of the dev ices on the bus except thosewhich have been addressed (for example, the 6502and an input port) and between which data is be-ing transmitted.

BUFFER/DRIVERCHIPS

We mentioned earlier that all the bus pins onthe 6502 are rated to drive one standard 7400series TTL load. This means that you could con-

nect a.bout four 74LSOO series chips to a busline, but if you tried to hang additional chipson these lines the circuit would probably notoper-ate , For the address bus and the control

bus t.he solution is to connect the 6502 pins di-rectly to two 7404 inverters (or 74LS04's). A

7404 can drive 10 standard TTL loads and about40 LS loads, while a 74LS04 can drive 20 74LSOOseries loads. This should provide adaquatedrive for most systems, provided the bus lengthis not to great. If you have a KIM-1 schematicyou will note that both R/Wand 0 are bufferedin this manner, but that none of the address

lines are buffered because the KIM-1 system issmall enough to not require buffering. Howeverif you expand, the address lines will also re-quire buffering. As an example, see KIMUSER

NOTES, Issue '7,8 where Jim Pollock gives a KIM

to 5-100 circuit.

There l~e other chips called Bus Buffers/Driverswhich can be used either on uni-directionalbusses or the bi-directional data bus. Theycome in packages of four (quad), six (hex )oreight (octal) buffer/drivers to a chip. If youwant to look up the specs on some of these chips

here are a few of the more popular ones.

741.5125 quad

741.5126 quad

LS367 hex

8T97 hex

DM8093quad

DM8094quad

DM8097hex

81LS97 octal

All of these except the 81LS97 are readily

available (Jameco, Godbout, Jade, etc.). The

onl y place I have been able to find 81LS9'ts isHamil ton-Avnet. They are a bit more expensiveand come 'in a 20 pin package, but they are nicebecause they can handle eight lines. Note that

we nave already used the 74LS367 to buffer ad-dress lines. Refer to the last several col umns

of thi~1 feature.

The truth table and logic symbol for a typical

buffer/dr.iver are given in Figure 1. Carefullyfocus your- beady eyes on the function of the G(gate) input.

Note that when G is low the output follows theinput logic level. The device is then doing itsthing, namely driving the particular bus line to

which 1t is attached. The inversion circle in-dicates that the buffer/driver is active (works)when the gate Signal is a logic O. Some buffers

have no inversion circles ,and they will beactive when the gate is at logic 1. Perhaps themost important feature is the third state of theoutput in the truth table, which we have label-led "dlsabled. n When the gate is high the de-vice behaves as if it were disconnected from thebus, that 'is just as if a switch in series withoutput were opened. This property is the reasonfor calling these devices "three-state buffer/

dr-Iver-s" or" or nTRI-STATE buffer/drivers."(TRI-STATE is a trademark of National Semicon-ductor. )

Page 8: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 8/52

Figure 2 shows how an LS 125 might be used on

the bi-directional data bus. Only two bus linesare shown for simplicity. During a WRITE in-struction the R/W line is low, enabling the buf-

fers which drive the signals from the 6502 to

the external devices. The other buffers whichdrive the 6502 are disabled. Analyze what would

happen if they weren't disabled! During a READinstruction the R/W line is high, it is inverted

by the LS04, and it enables the buffers drivingthe signal from the external devices to the

6502.

The scheme shown in Figure 2 is not the only

possibility. For example, the S-100 bus would

not have pins 3 and 5 connected, nor pins 8 and12 connected. Instead, the data bus is dividedinto two separate busses at this point. The buslines connected to pins 3 and 8 become a "dataout" bus, while the lines connected to pins 5

and 12 become a "data in" bus. I am not awareof all of the advantages and disadvantages of

this scheme, so we will not pursue it further.

ANEXPERIMENT

Connect an LS125 as shown in Figure 3. Notethat RESETwill very likely cause all the LEDsto 1 ight. Now run the following program:

0000 4C 00 00 START JMMPSTART

This is an infinite loop. Do not try to relocatethe program or the experiment may not work. Youshould observe that the LEDs on DO and D1 are

off while the other two are one. Can you ex-plain why before I do?

Analyzed by clock cycles the activity on the

data bus may be summarized as follows:

The LEDs connected to D3 and D2 get a pulse onceevery three clock cycles, which the eye inter-

prets as a continuous glow. Now connect theI gates (pins 1,4,10,13) to +5V instead of ground.None of the LEDs light. Why?

ANOBSERVATION

Refer to Figure 1 in the "INTERFACING .... "

col u m n in MICRO1 1 7 . The input port ill ustrateshow a buffer/driver isolates the data bus.

Note that the device select pulse is connectedto the gate of the LS367. Thus, only when theaddress lines select the input port and the 6502

is in the READstate does the LS367 control the

data lines. Otherwise it is disabled and the6502 gets its data elsewhere.

The output port of the same circuit illustratesanother point. Suppose we had say eight output

ports. Data lines DO-D7would each have eight

LS inputs hanging on them, and the 6502 wouldI probably be unable to drive them. The solutionwould be to buffer the data lines from the 6502to the output ports. In this case one wouldprobably connect the R/W line to the buffer/driver gates.

I

ANAPPLICATIONAgain ref'er to Figure 1 in this column in MICRO# 7. Recall that the data lines were to be con-

nected tc the D inputs of the LS75 to completethe output port, replacing the switch. A com-plete 8-bit output circuit, with buffering, is

shown in Figure 4. The dev ice select circuitryis not repeat.ed here. Up to eight output ports

can be implemented using the device selectpulses from the LS138. All you have to have

are LS 75s. The buffering $hown in Figure 4would be more than adaquat e for eight ports.

The 8-bit port with LEOs attached can be

used as a debugging tool among other things.

At a point in a program where you suspecttrouble, and want to see the STATUSREGISTER

,for example, put a BREAKcommand. The last

thing on the stack after a break is the statusregister contents. So, the interrupt vectorshould point to a program which pulls '

the last word off the atac k and loads it atthe address of the output port, STA $BoOF . A

little panel could be made which indicatesLEDgoes IIi th which flag.

The ec heme just mentioned can obviously be

varied to indicate the contents of any of theimportant registers. One could get very elegant

and use four ports to indicate X , Y, accumulatorand status register simultaneously. Better

yet, use the information you have learned todisplay the contents of X , Y,A, and P while thec oa p ute r is in the single-step mode.

~a t 's ne:xt? I hope to go into a keyboard inputport in a little more detail, then look at a

lIlemory interface, unless I get some other:ideas that is. Anyway~you ought to step out fromamong the trees to get a look at the forest by

taking a long ~d studied look at Figure 1.1 ofthe MOS n:CHNOLOGYHARDWAREMANUAL,the first

figure in the book. A lot of the ideas we havebeen discussing are summarized there in a dia-gr'am of the microcomputer system as a whole.

Parts list of components used for the experi-ment s ,

AP C;lrcuit Board

(ho.l.da 8, 16-pin DIPs)1 coil, 122 wire8 LEDs'

1 Edge connector for KIM-11 74LS'452 74LS1381 74LSc>41 74LS::M

2 74LS752 74LS1251 74LS76

2 4.7K to 10K resistors2 DIP switches

Page 9: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 9/52

RW

Figure 2.

I~I .

~~~~I

l.S125

pin14 +5pin 7 Gnd

1

An l.S125and LS04in a bi.-directional data bus buffering circuit. Only

two data lines are shownbuffered. Four LS125swould be required forall eight data lines. UI this scheme the "write" buffers and "read"buffers are alternately d~sabled by the R /W line. Sometimesthey are

also disabled by device select pul.aes ,

To Memory , I/O Ports,

Timers, etc.

+ 5 V

+ 5 V

5

V - _ _ _ 2 _@ i _ " ;> - - = 1 = 2 ' - - 1

74l.S125

Buffer/Driver

74LS

125Buffer/Driver

ID91r>-

IDlr>-

D2t>-74l.S125

7

r 5 V

. . _ . . _ . . 5 . l _ 1 _ _ . . ,

7

Figure 3.

Circuit to demonstrate data bus

buffering. See text for details.

1 6

7411375

il~D2

BistablejlLatch ~D3

1~

7411375

BistableLatch

1 2

·'v~:,>--Jl_ ~

Device Select Pulse An S-bit output. port. D S r t is from an 74LS138andl.S04 inverter. The buffers could d:!."ivemoreports.

Figure 4.

Page 10: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 10/52

W A T F IN E

M P U T E R S T O R E S

SPEAKEASY SOFTWARE LTD.

BOX 1220, KEMPTVILLE, ONTARIO

KOG 1JO

***************************NOWAT MOST APPLE-II DEl\LERS

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

kidstuff

Page 11: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 11/52

"

(' .~

-'.-.J

ThE Think TankPO BOX 1199. PORTSMOUTH, NH 03801

Th ey'r e A LL rus hing t o buy thelatest BO OKS on 650 2 micro's!

Here a r e a few suggestions ..•

~~~2tK!J1.by Butt erfi eld" o ckex :s, s R eh nke

S tep- by-s t2p in stru ctio ns o n w riti ng KIM

prolJ:...l.TJS , il Iuetu:e t;inqvaluable techniques.

A1sc, 110 ' " t o adapt :::heasic KIM-1 for home

and b~sj~~ss use. $9.0 0

proq ra~T ci~q £ M icroc ompu ter: ~by F oster

How t o program a mi cro in mach ine 1 nngu age.

W el l- wr it te n a nd c le ar ly o rg an iz ed , s ui ta bl e

for self-study or classroom. Emphasis on

pr oble m ID , sol utio n, a nd algo rith ms t o

solve the problem. $9.0 0

Microcomputer proqramminq-6502

by Zaks

How t o p rogr am mic ropr oces sors with 650 2:

arithmetic, input-output, peripherals, inter-

rupts. Educational text requ~r~ng no prior

knowledge - for any 650 2 micro. $9.95

Send your name, address and check or m.o.

or charge to VISA or Master Charge (incl.

number, expo date, and interbank no.)

A SK F OR O UR HUGE MA IL OR D ER CA TA LOGUE

A VA ILA BLE IN LA TE JA NUA RY, 197 9

ThE Think TankPOBOX 1199 • PORTSMOUTH, NH 03801

DON'TFORGET

T H E S E A R E G R E A T

C H R I S T M A S S G I F TS U G G E S T I O N S ! ! ! !

Page 12: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 12/52

TM

The COMPUTERIST® how to expand your system four,wayswith one multi-purpose pc board --

• 8KPower STATIC RAM

• 8KEPROM logic (INTEL 2716/TI 2516)• EPROM PROGRAMMER• 110-Versatile Interface Adapter

2 8-bits ports + serial/parallel shift register+ timers

• On-Board VOLTAGE REGULATORS• Switch Selectable Address for RAM and ROM• All ICs are socketted• AIM 65 / SYM-l / KIM-l Compatable• Assembled -Tested - Burned In• Hundreds in use around the world• Reasonable Price - $245(without EPROMs)• Free Connection Cables with this AD.

The COMPUTERIST® is a leading producer of productsfor the AIM/SYM/KIM (ASK,m) family of micro-computers. Send for your copy of our catalog whichdescribes our current and soon-to-be released productincluding:

VIDEO PLus,m, MOTHER n.us-, POWER PLus,m;PROTO PLus'm and other ASK hardware; PLEASE,m.HELP'm and other ASK software; Enclosures for theAIM, SYM, and KIM.

POBox J. So. Ch~/msford. Mass.OI,J4.6J112,.JU9

Stepping on board MICROfrom PERSONALCOMPUTINhas been quite an experience during the fewshort weeks I've been here. Thank qcodne ss Ihave at least one microcomputer at home thatis 6502-based! During the wlnter and spring of'79 I plan to add an APPLE II and a SYMto theOSI Challenger, making my intentions relativelxsolid in promoting the versatile world of t6502 microprocessor.

I entered the micro world in April of '76 as anentrepreneur/hobbyist. My sixteen years inprinting, advertising and publishing, alongwith several college courses and special aca-

demic projects in computer programming combinewith a minimal writing/editorial backgroundto round out my qualifications.

MICRO has several positive changes ahead overthe next year, and I look forward to beInq apart of those changes.

Those of you who are manufacturers or soft-ware houses are reminded to submit (in lOUformat) information on your products forlisting in ourSoftware Catalog and HardwareCatalog.

The circulation has been steadil y growing andalthough rates for advertising will be .in-creasing, it won't be at the same rate ascirculation.

Articles are starting to come in at a good pace,but we are always looking forward to new copydescribing your 6502 application in hardware orsoftware. Sophistication or simplicity, 'thearticle YOUwrite may bring in further inquiriesor commentary from other 6502 users. This kindof dialogue proves to be very stimulating tomost of us, so put that pen to paper and etartwriting!

MICROwill grow with its readers; just let l

know what you want and we will try to please. W wwant to continue to be Number One in the 6~)Qworld!

we-••"..... ....-I, .... , 'OIG,III', Z-IO,.502, '''.1, 1.0l.The EP·2A·79 will program the 2704, 2708,

TMS 2708, 2758, 2716, TMS 2516, TMS 2716,TMS2532, and 2732. PROM type is selected by

a penonali ty module which plugs into the front

of the programmer. Power requirements are 115

VAC, 50/60 HZat 15 watts. It issupplied with a

:JO.inchribbon coble (14 pin plus) for connecting

to microcomputer. Requires 1\-'2 I/O ports.

AIHmbled and telted $145, PlUI$15-25 for

each personality module. Specify software.

O P T I M A L nCHIOlOG', .IC•. . . . . . .. . 1 2 7 , hriyl"., V • • 2 2' 3 •

. . . .. 1 0 4 . ' 7 3· 5 4 .2

8:10

Page 13: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 13/52

LIFE FOR YOUR APPLE

Richard F. Suitor166 Tremont St.Newton, MA02158

A listing of LIFE for the APPLEII is describedlbriefly here (see MICRO#5 for a pet version anddiscussions) • Because my experience with gener •.ation time in BASICparalleled Dr. covitz', the

generation calculations are in assembly lang •.uage. The display is initiated in BASICand theroutines are called from BASIC, which will slo~,down the generation time if desired.

The entire (40x48) low resol ution graphics disp •.lay is used. An unoccupied cell is 0 (black).An occupied one is 11 (pink). During the first.half of a generation, cells that will die ar-eset to color 8 (brown). Those to be born are setto color 3 (violet). During this stage, bit :Iset indicates a cell is alive this generation;:bits 0 and 1 set indicate a cell will be aliVE!the next). During the second half (mop-up) partthose with bits 0 set are set alive (color 11)"

the rest are set to zero.

The BASICprogram allows one to set individualcells alive, and to set randomly 1 inN alive in

a rectangular region. The boundries (X = 0 and39; Y = 0 and 47) do not change, but may be in •.

> L I S T1 TEXT2 G EN =2 08 83 MO P=2 26 55 D I M A $ (7)7 K 1 =18 1 <2 =1

1 0 C A L L - 9 3 6 : V TA B 5 : TA B 9 : PR I N T. ' "C O N W A Y ' S G A ME O F L I F E"3 0 V TA B 1 5 : PR I N T "I N I TI A TE PA TTER N

B EL O W . X<O W I L L S TA R T"3 5 PR I N T "TH E L I F E PR O C ES S . A Y <O

l ,J IL LG IV E A "4 0 PR I N T "R A N D O M PA TTER N W I TH O N E I

N X A L I I I E"SO V TA B 2 2 : I N PU T "R ETU R N TO C O N TI N

U E " , A $9 9 G O TO 1 0 0 0

1 0 0 R EM1 " 13 2P O KE - 1 63 0 2. 01 0 3 G O l D 1 3 01 0 4 F O R 1 =1 TO K 31 0 5 C A L L G EN1 0 7 F O R K =l TO K l : NEXT K .1 1 0 C A L L MO P1 1 2 F O R K =l TO K 2 : N El <: T1 <1 2 0 NEXT I1 3 0 R EM1 3 1 K X= PD L ( 0) - 1 01 3 2 I F K X>2 4 0 TH EN K X=K Xl1 3 5 I F K X<O TH EN I<X=O1 4 0 K l = K X + 61 50 · K2 =K X+ 2

. . .1 5 5 K 3 = 5 0 0 / ( K l + 5 0 ) + 1

J~/ 1 6 0 G O TO 1 0 4

itialized. At the start of the program, NOPAD-DLEINTERVAL?s requested. If during the pro-gram the paddle reads close to 255 (as it will

if none is connected) the number input here will

be used instead. Zero is fastest, several gen-erations per second. Entering 200 gives a fewseconds per generation.

WhenX and Y coordinates are requested, put inthe coordinates for any cells to be set alive.Anegative X terminates this phase. Sett:rng X=N'and a negative Y will initialize a rectangularregion to 1 in N randomly occupied and terminatethe initialization. The boundaries of the rect-angular region must be input and maybe anywherein the full display. A glider gun can be fitvertically in the display. However, don't init-ialize for Y 40 (other than random) for thescrolling during initialization input will wipeit out.

Before RUNning the BASIC program, set LOMEM:2500 to avoid overwriting the subroutines.

1 0 0 0 1 3 1 ' :

1 0 1 I) C A L L - 9 3 E.1 0 2 0 m p U T "t ·m P A D D L E TH 1 E H i TEF . : ' ·. .L "

•K:X:l1 1 0 0 C O L O R = 1 1 : H l F ' U T "I NPU T : ": ,' "

1 1 0 5 I F \' (0 TH EN 1 8 0 0

1 1 1 0 I F X(O O F . :\' (0 TH EN 2 5 0 01 1 2 0 I F X)3 9 O F . :\' )3 9 TH EN 1 1 0 01 1 3 0 PL O T X,\,: G O TO 1 1 0 01 8 0 0 I N PU T "X D I F . : EC T I O N L I MI TS "

. 1 1 . 1 21 8 1 0 I F 1 1 (0 O F . :1 2 )3 9 O F . :1 1 )1 2 TH EN

1 8 0 01 8 2 0 H 1 PU T ". . . . .I REC TI ON L It HT: S: "

,._l l,_12

1 8 3 0 I F J l (O O F . :J 2 )4 7 O F . :J l )J 2 TH EN1 : 3 2 0

2 0 0 0 C A L L - 9 3 6 : G R2 0 0 1 PO K E - 1 6 3 0 2 , 02 0 0 2 C A L L - 1 9 9 : : :2 0 0 5 F O R 1 =1 1 TO 1 22 0 1 0 F O R . _I =J lTO . _l 2 :C O L O R =l l : I F

R N D (X) TH EN C O L O R =O2 0 2 0 PL O T I , J2 0 :30 ~ j E) <: T_I2 04 0 t 'f E: ><: T2 1 0 0 G O TO 1 0 02 5 0 0 PO K E - 1 6 3 0 2 . 02 5 1 0 C O L O R =O2 5 2 0 F O R K =4 0 TO 4 72 5 3 0 H L I N 0 , 3 9 A T K2 54 0 ~ jE :" :T(2 5' :;0 0O TO 1 009 0 0 0 Et ·m

Page 14: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 14/52

!A

0800

0:::02

0:::04

0:::06

0:::0:::

0:::09

O:::OB

0 : : : OIl

0:::OF0::: 11

CI:::l:~:

0 : :: 15

A505

:::5 O : ~ :

A504

:::502

1':'_,

6'380

:::504

A505

6'300C90:::

DOCIC

A504

0:::19 C'352

0: : :H: 100:::

0:::1II :::504

0:::1F A'304

0:::21 :::505

0:::23

0:::24

0:::25

0:::2E,

0:::2:::

0:::2B

0:::2E

0 : : :: :: : 0

0 : :: : : : : 1

0::::33

0:::34

0:;:::'::5

1':'_ ,

60

BOFC

20CAO:::

20(1)0:::

9001

60

AO?7

Aft

001

002

01)::::

004

005

O O ' = : ,

007u

00:::0

00900100

0110

0120

01::::0

1"141"

15

16

17

1 : : :19

u20 )

021

022023

024

025

:LIFE F:OUTHiES

: EtHEF: AT GEt"i0

: 20:::::: At·m 2265

o LU'i .I1L 0002

t-i. • . 1Ui • IlL 0004

AND MOPO ALTERNATELY

I1EC. RESP.

OLII HOF:I Z LI t-iE

t·iEl.J LINE

SUMl .I1L 0006 ~ OF o c c . CELLS IN

SUM2 .I1L 0007 1,2 FOR OLD,NEW

BUF 1 • IlL 0'340 40 VERT. OCC. ~~:~:

BF1P .I1L 0'342BF1M .I1L 09:;:F

BUF2 .I1L 0970

BF2P •DL 0'372

BF2t'1 • IlL 09E,F

NXLN LDA +NWLN+Ol

STA +[lLUHOl

LIlA +t'lI..JU'I

STA +OLLN

CLC

AIIC :::0

STA +NI..JU'I

LIlA +NI..LI'I+ 01

AIIC 00Ct1P 08

Bt-iE :S:AI'1E

LIlA +t·il•JUi

.:,1.,,',:.

._1,··•._,

026u AIIC 27

0270 CMP 52

02:::0 BPL LAST

0290 STA +NWLN

0300 LDA 04

0310 SAME STA +NWLN+Ol

0::::20

0 : : : : : : : : 0

0::40

0':::500 : : : : ' = : , 0

0::70

0:::::::0

0390

0400

041

042

043

044

045

046

0837 9940U9 047

083A 99700g 04:::083D Bl02 049

083F FOOF 050;

0841 1006 0510

0843 FE4009 0520

0846 ~E7009 0530

:;'4 ': , t 29 ( 1 : : :

:::4B F (I (I::::

;::4Ii FE 4 (I (1 '3

54c-c-,_1.,_1

56

CLC

RTS:l RT:S:

LA:~:T SEC

BC:~: F:TS:1:GENERATE BIRTHS(COLOR=3) & DEATHS(COL=8)

I : : ; Et-iCl ._I:~:RHi!T

I : : ;Et-il ._ ISF' t'i::':Ui

BCC GEt'i2

:ALL DONE IF CARRY SET

F:T:~:

GHi2 LIlY 27

T'lA

TA::'::

: CD f 'l F' ',lERT nee ~~s1 :3 Et-i6 LIlA 00

S:TA BUFl ~'l:STA BUF2, ,.(LIlA (OLUD " YBEO 1 :3 Et'i::::

BF'L GEt'i7

I nc f:UF 1~xI t'iC: BUF2, : :<

At·m 0:::

:E:EO I : : ; Et'i3

I t'iC BUF 1, : :<Note: The stars in the operand indicatezero page mode.

8:12

Page 15: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 15/52

()

0:::5 (I Bl 04 0570 (:;Et"r::: LI!H (tjl,JLt"j":' ~v.I

O~=:52 FOOF 05::::0 BEO 1 3 E J 1 < S

0::::54 1 003 05'~ (I BF'L !3Et"14

0:::56 FE7009 0600 HjC BUF2~ r.

0::::59 2':;' 0::: 061 0 (:;Et"j4 At"1Lt 0:::

0:::5 B F006 0620 BED i::;Et"j~;

O::::5D FE7009 0630 1t"iC E:UF2~ ,:':.

O:::t,O FE4009 0641"1 I t"iC: BUFl' ,~? ",

0:::63 : : : : : : : Ot,5 t3Et"i~~DE\0t:t,4 CA Ot,E, DE>::

0:;:.:.5 1OCE 067 BF'L 13Er"~60:::67 A026 06::: LD\' 2t,

0:::69 F' OE,9 CLC_ ,

0:::6A ADE,709 070 LDA BUF1+270:::6D t,ItE,609 071 1- ADC BUF 1+2t,

0:::70 :::506 0720 :~:TA -surn0:::72 AD9709 07]0 LItA BUF2+27(1:::75 6D9E,09 0740 ADC BUF2+2E,

0:::7::: :::507 0750 STA .:~:Ut~2

07t,O .CDt'lF' DCC ~ ~ S : Hi :~:>:::~: , CHAt%E CDLDF:. : : . :

0:::7A 1o 077i 13t~LP CLC_,

0:::7B A50E, 07::: LItA .:~:Ut~10:::7D 793F09 079 ADC BF 1t~~\'

0::::::0 : : = : : : : 0:30 SEC0::::::1 F94209 0:::1 S:BC BF1P~ \'0::::::4 :::506 0:::2 STA -sumO::::::t, C903 0:::3 CI"'IP 0:30 : : : : 3 : 3 FOOE 0:::4 BEG! 13E~i90::::::A 9004 0:::51 Bce 13EN:::O::::::C C904 0:: :6 Ct~P 04O::::::E FOOE 0:::7 BEG! G~~1 00:::90 Bl 02 0:::::: GEt"~::: LDA (OLUD ~'l0:::92 FOOA 0:::9 BE(~ Gt-i1 00:::94 29::::F 090 At-m :::FO~::f3E, 5004 091 IJ E~'· lC: Gt-ut.0:::9::: Bl 02 0920 GE~i·:.1LDA (DLU-V ~'r

0:::9A 0930 0930 DPA 300:::9C 91 02 0940 (:;~i16 STA (OLUD ,l0:::':;'E 1o 0950 Gt-i1 I) CLC_,

0:::9F A507 0960 LDA .S:UM2O:::Al 796F09 097i ADC BF2M, " .. '

0:::A4 ·~':I 09::: SEC_ ' 1 _ '

0:::A5 F97209 099 :S:BC BF2F'~ 1 /

0:::A::: :::507 1 00 :S:TA .S:Ut~2O:::AA C903 1 01 c r ' w 03

oeAC FOOE 1 02 BEG! 13tH2O:::AE '3004 1 03 BCC Gt-il 1O::::BO C904 1 041 U'lF' 04

0:::B2 FOOE 1 05 BEG! 13t-11~:

O::::B4 £:1 04 1Ot, (:;("H 1 LDA o::t"il.n,t-1)~'l0:::.B6 FOOA 1 07 BEl) 13t-H3

::::B::: 2':;'F::: 1 0::: At"m OF:::: : : : F : A . 5004 1 0':;' svc 13r"H5::::BC Bl 04 1 1 I) I::;t"j1f: LDA 0 :: t"11.1L t"1)~I••

I

:~:BE O':"O:~: 1 1 1 OPA 0:3

Page 16: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 16/52

08CO 9104 1120

08C2 88 1130

08C3 F002 114008C5 10B3 115008C7 4C2B08 1160

08CR R904 1170

08CC 8505 118008CE R900 1190

08DO 8504 120008D2 8D6809 1210

O:::Ii5 :::D9:::0'O'O:::D::: 60

O:::D'O' 20CRO:::O:::DC 20000::::(I:::DF '0'0 (11

(I:::El 60(I:::E2 R027

O:::E4 BI02

(I:::E6 FOOR08E::: 297FO:::ER C91 (I

12201230

1240

1250

1260127012::::fI

12'0'

130131

132133134

O:::EC 3 I)02 135

08EE 0980 136

(I:::F I) 91020:::F2 BI04(I:::F4 FOOA

0:::F6 29F70:::F8 6A

1·-,~'':'1'

1:~::::

1~:'O'

140141 I

08F9 9002 142

08FB 0904 143

O:::FD 2AO::::FE '0 ' 1040900 ::::::

0901 FOD90':::'0:::: 10DF

14414514E,

14714:::

149

:::\'t'1BOL TAbLEOLUj 0002t·l1.iUl 0004'S:I_lr'l1 0 o 06

::Ut'12 0007

BUF'1 0940

BFl P 094;:::

E:F11'1 093F

BUF2 0'0'70BF2P 0972

BF2t'1 096Ft·t<Ln 0:::0 I)

::Ar'1E 0::::21PT:S:1 0::::;::4

LA~:T 0:::25

'3Etj(I

0:::::2:::13En1 0::::2BGEt'j2 0::::: 1

GEnE. 0::::::5

GEn7 0::::4 ':::'

GEt·n 0::::50

13Et"14 0:::5'3

GIH5 :STA (t·H,ILt·O !I 'r'

GI'H:;: DE'''''BEG' Gt'H4BPL Gt'lLP

13t'H4 --,t'W GErH

Hi IT LDA 04:s:TA * r'j1.,JLtH01

LDA 00

:S:TA *~jl",.ILr·j:S:TA BFIP+2E,

:s:TA BF2P+26fHS

:MOP up, IF CDLOP AnD 3 =0, PEMDVE(COL=Ol: OTHEPI!IEE, ALIVE (COL=1 D

nn P (I ._I:: F: r r - n Tr,lOP1 ._ISF: n:,-:;Uj

B ee t'1OF'2

PTS

r'1OP2r,mp::::

LD\' 27LIlA (OLL ""0 ,',('

BEG! r10F'5mm 7F

c r ' w 1 (I

Bt1I r' lOP4

IJF:A :::0

:S:TA <DLU'!) !I 'r'I_DA (r'jl,ILI'j) !' 'r'

BEn t'1DF?l"Ir·m OF7F.:DF:

B c e t'lOP6IJF.:A 04

POL:,:TA o::r"ll.,ILrj),'r'DE'''''BEG ' MOPIBPL r10P::::

"Er'j

r'lOP4r'1DPS

r'lOP7

I:3En5 0:::63!3tiLP 0:::7AGEn::: 0:::::90,:3Elj '0 ' 0:::::';<:::::I:3H1t, 1):::::9Ci3rH (I O::,';<E

Gnl 1 O : : : : : : 1 A

,:3n12 O:::::BC,;tH5 O : : : : : C O

l:;i'j1 _ : 0:::::C213Hl4 1):::(:7

WIT O::::CAr'mp 0 0:::::D9r ' 1 L J p 1 1)::::[1(:

t'1IJF'2 O:::::E2

r,mp::: 0::::E4i'lOP4 O::::FO

"mps 0::::F2

r'lOP6 O:::FDr'mp7 0900

Page 17: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 17/52

()

"" , ) '," ..\_'.-:~-

COM PUTER- DETERM INED K INETIC P ARAMETERS

IN THERMAL ANALYSIS

Dr. L.S. Reich3 WessmanDrive

West Orange, NJ C7052

INTRODUCTION

Two techniques employed in thermal analysiswhich are popular with chemists, chemical en-gineers, and other scientists studying the ther-mal degradation of various materials, e.g., tef-lon, are thermogravimetric analysis (TG) and

differential thermal analysis (DTA). An im-portant aspect of thermal analysis is the quan-titative estimation of kinetic parameters forthe material being degraded such as , activation

energy, E (cal/mole), and reaction order, N.

Prior to the ad vent of computers (and program-mable calculators), there was an understandabletendency to avoid accurate, sophisticated (buttime-consuming and laborious) methods of dataanalysis to obtain values of E and N. Graphicalmethods were employed to a large extent. Recent-

ly, the author reported an accurate,sophisticat-ed method (no graphics need be involved) wherebyraw conversion-temperature data could be rapidlyanal yzed by a computer (also, but more labori-

ously by a programmable calculator, e.g., HP97)

to yield values of E and N (Thermochim ~ ~9 (1978); ibid., 25,,367 (1978). (In these re-

ports, there was no description of the computerprogram used.) By employing an Apple II com-puter with Applesoft II Basic (20K) and the pro-gram listed in this article (ca. 10-11K freebytes required depending upon the amount of dataentered), the time required to estimate E and Nby the reported method, for the thermal degrada-tion of teflon via TG (as an example), beginning

with data entry to the display of preliminaryresults followed by one iteration to obtainaccurate final results, was only ca.4 min.

In this article will be described the computer

program which can be used with the previouslyreported method for the estimation of E and N

from data derived by thermal analysis.

SOMEBACKGROUNDNFORMATION

In the report previously mentioned (loc. Cit.),the following expression was derived (can beused for TGand DTA):

where, T(1)=(T:l.IT,)""; U(1)=T,T:t,IT,-T.t.); R = gasconstant (1.9872 cal/deg-mole); 0( denotes frac-

tional conversion; ~ Icorresponds to temperature(K), T" etc:

For two pairs of given val ues of « and T, i. e. ,<I, T,andwx, T!L, values of E/R can be calculatedfrom the above expression for various arbitrar-il y selected val ues of N. However, assuminguniqueness, only one pair of E, N values will besignificant. By using other pairs ofa( and T

val ues, other sets of values of E and corre-sponding Nwill be obtained. In all these setsthere should be only one pair of E, N values in

common. However, such values would rarely, ifever, be expected to be exactly equal in prac-tice due to experimental limitations such as,sample impurities, heat transfer effects, etc.Therefore, these values were taken to be thosewhose mean deviation (MD) was the least of all

of the MD's obtained for all the sets of valuesobtained. Although the above expression doesnot apply when N is exactly equal to unity it israre in practice for reactions to be exactlyfirst-order and hence this equation is consider-ed to be of general validity. When values of N

close to unity are used, the value of N may beset equal to 1.0001, for example, in order toavoid the error message, "division by zeroerror" (this technique was employed in this

paper). Once E and N have been evaluated, an-other parameter, the pre-exponential factor, mayalso be evaluated. This factor was not con-sidered in this paper.)

THEPROGRAM

The program listed has the following limita-

tions. The values of N should not be greaterthan 3 (termolecular reactions are extremelyrare, if they occur at all, during thermal de-gradations). Also, the data which is entered inline 8200, is limited to ca.44 data pairs (mostraw dat a do not contain so many data pairs ofconversion-temperature, but if necessary, the

number of such pairs may be increased by adjust-ing the DIM statement for A and T in line n).The val, ue of N cannot be equal to 1 exact! y,otherwise an error message will result. Thismay be circumvented by using N=1.0001, forexample. The Apple II screen will only accom-

modate ca.6 columns of E/R values (6IN-values).Nevertheless, more than 61N-'values may be used,even though the display may appear confusing.

about 10-11K free bytes will be required for theprogram, depending upon the amount of data en-

tered. Further, since subscripted variables mustcontain integer subscripts and since N usuallyvaries from .5-2, reac tion orders are given asN x 100. This increases the DIM statement and

consequently the number of bytes required by theprogram.

In the program itself, explanatory REMstate-ments are to be found in line #'s 8, 47, 70, 80,135, and 138. Prior to running the program,data pairs of conversion-temperature (K) must beentered (see line 8200). Then line #5 must bepr-oper-Ly adjusted. In this line n (see line 112)

Y denotes the initial order (x100), Z denotesthe final order (x100), and the increment isgiven by V (x100). Thus, for the teflon data

depicted in line 11200 (from TG), the initialorder will arbitrarily be .86 (Y=86) and thefinal order 1.11 (z= 111) while the increment

will be .05 (V=5) to yield 6 N-values. The pre-liminary results obtained using these values

were: E/R = 33091 ± 872 for N = 1.01 + - .05.Since the value of N was now established as ca.1more refined values were obtained using Y =97.01, Z = 101.01, V = 1 (the .01) was used toavoid a division by zero error message). Final

values now were:-E/R=32792:!. 822 for N=.98 '! .01.

Page 18: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 18/52

A s s t a t e d i n l i n e 18 , l i n e I's 1 0 - 4 0 a r e u s e d t of o r m a n M x J a rr ay o f c on ve rs io n -t em pe ra tu re ,A (M, J ). L i n e I's 4 8 - 7 6 a l l o w t h e c a l c u l a t i o n o fEI R (Z(N)), a c c o r d i n g t o t h e e x p r e s s i o n p r e -v i o u s l y m e n t i o n e d , f o r v a r i o u s o r d e r s a n d f o rv ar io us c on ve rs io n- te mp er at ur e d at a p ai rs . A ls o,SeN) ( l i n e 170 ) i s t h e s u m m a t i o n o f a l l ZeN)( E / R ) v a l u e s f o r a n y p a r t i c u l a r o r d e r , N , a n d i ss u b s e qu e n t l y u s e d t o o b t a i n t h e a v e r a g e E / Rv a l u e a n d i t s MD f o r a p a r t i c u l a r N (s e e l i n eI 1 2 5 ). L i n e I's 8 4- 11 0 a ll ow t he d et er mi na ti ono f t h e s u m o f a b s o l u t e d i f f e r e n c e s , D (N ), b e -t w e e n E/ R v a l u e s a n d t h e a v e r a g e E / R v a l u e f o r a

p a r t i c u l a r v a l u e o f o r d e r , N . Th e a v e r a g e E /R

v a l u e a n d i t s MD a r e c a l c u l a t e d f o r a p a r t i c u l a rN i n l i n e #1 2 5 . F i n a l l y , l i n e #' s 1 4 0 - 1 6 5 a l l o wt h e d e t e r m i n a t i o n o f t h e a v e r a g e E/ R v a l u e t h a tc o r r e s p o n d s t o t h e m i n i m u m MD a t a c e r t a i n o r d e rN . L i n e II's 1 3 9 a n d 1 6 0 a r e u s e d t o e s t i m a t et h e v a l u e o f N w h i c h c o r r e s p o n d s t o t h e "m o s tp r o b a b l e " E / R v a l u e . I n l i n e #1 7 5 , t h e m o s tp r o b a b l e E / R v a l u e (m i n i m u m MD ), i t s MD a n d c o r -r e s p o n d i n g N a r e p r i n t e d . A l o n g w i t h t h e p r o -g r a m l i s t i n g a r e g i v e n r e s u l t s o f a n a c t u a l r u nu s i n g t h e t e f l o n d a t a i n l i n e 1 1 2 0 0 o bt ai ne d b ym e a n s o f TG .

PROGRAMLISTING

PRINT "THIS PROGRAM ESTHlATES E /R VALUES FROM TG/DTA

DATA OF CONVERSION VS. TE:MPERATURE(K). THE PROGRAM

DOESN~T APPLY FOR REACTION ORDERS» 3."

2 PRINT"IN LINE # .5, y. INITIAL ORDER (x 100), Z. FINAL

ORDER (x 100), WHILE THE INCREMENT IS GIVEN BY V (x 100)."

3 PRINT"FOR EACH RUN, THE VALUES IN LINE # 5 WILL PROBABLY

NEED ADJUSTMENT. ABOUT lC1-11K FREE BYTES WILL B E REQUIRED."

4 PRINT"WHEN DATA PAIRS OF CONVERSION-TEMP (K) HAVE BEENENTERED AND LINE # 5 HAS B ENN ADJUSTED AND YOU ARE READY,

TYPE 'CONT' " : PRINT"REfoll STATEMENTS ARE IN LINE #'S 8,

47,70,80,135,138.11 : STOP

5 PRINT: Y.86 : Z..111 : V=5

7 DIM S(310), D(310), A(44,2), Z(310), U(44), T(44), C(310)

8 REM LINE #'S 10-40 FORM ARRAY A(M,J) OF CONVERSION-

TEMP DATA

10 FOR M=

15 FOR J..

TO 50

TO 2

20 READ A(M,J)

30 IF A(M,l)= 0 THEN 40

35 NEXT J,M

40 M=M-l

42 PRINT" E /R VALUES OF REAGTION ORDERS , N (x 100):"

43 PRINT

45 FOR K= Y TO Z STEP V: PHINT "N. "K" "; NEXT

46 PRINT

47 REM LINE #'S 48-76 ALLOWTHE CALCULATION OF Z(N) (E/R)

FOR VARIOUS ORDERS AND FOR VARIOUS CONVERSION-TEMP

DATA PAIRS

48 FOR !or 1 T O M-1

50 T(I). (A(I+1 ,2))1\2/(A(I'~~))1\2

Page 19: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 19/52

o

U'"

,

55 U(I). A(I,2)* A(I+l ,2)/(A(I ,2) ~(I+l ,2»

57 FO R N. Y TO Z STEP V

60 ZeN). LOG«l- (1- A(I,l»A(l- (N/100»)* T(I)/

(1- (1- A(I+l ,1»,,(1- (N/l00»»* U(I)

65 PRINT INT(Z(N»;" ";

70 SeN). SeN) + ZeN) : REM SeN) IS SUM OF ALL ZeN) (E/R)

VALUES FOR ANY PARTICULAR ORDEEt, N

72 NEXT N

74 PRINT

76 NEXT I

78 PRINT: PRINT npRESS A KEY TO CONTlNUEft'; I GET A$:PRINT

80 REM LINE #' S 84-110 ALLOWDE'l'ERMINATION OF SUM OF

ABSOLUTE DIFFERENCES (D(N» m:TWEEN E/R VALUES AND THE

AVERAGE E/R VALUE FOR A PARTICULAR VAlUE OF ORDER, N

84 FOR I. 1 TO M- 1

95 FOR N. Y TO Z STEP V

100 Z(N)- LOG«l- (1- A(I,l»,,(l- (N/l00»)* T(I)/

(1- (1- A(I+l ,1»1\(1- (N/l00»»* U(I)

105 D(N). D(N)+ ABS(Z(N)- (S(N)/(M- 1»)

110 NEXT N,I

115 PRINT

117 PRINT "AVG. E/R VALUES AND THEIR MEAB DEVIATIONS FOR

VALUES OF ORDERS (N X 100): N. "Y" TO nZit , INCREMENT "

V" AR E RESPECTIVELY: "

118 PRINT

120 FOR W. Y TO Z STEP V

125 PRINT S(W)/(M- 1)" + OR - "D (W )/(M - 1)

127 PRINT

130 NEXT 'f

134 PRINT: PRINT " PRE S S A KEY TO CONTlNu:E:!"; : GET AS: PRINT

135 REM LINE #' S 140-165 ALLOWDm'ERMINA'rION OF THE E/R

VALUE THAT CORRESPONDS TO THE MINIMUMMEAN DEVIATION

AT A CERTAIN VALUE OF ORDE R , N

138 REM LINE # 139 ALONG WITH # 160 ARE "JSED TO DETERMINE

VALUE OF ORDER, N, CORRESPONDING TO T:IE 'MINIMUM'

E /R VALUE

139 FOR J. Y TO Z STEP V : C(J)= J : NEr.~

140 FOR W. Y TO (Z- V) STEP V

145 FOR U. (Y+ V) TO Z STEP V

Page 20: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 20/52

1 4 7 I F D ( W ) < D ( U ) T H E N 1 6 5

1 5 5 Q. D(W): R . S e W ) : D ( W ) _ D ( U ) : S ( i ) . S ( U ) : D ( U ) - Q: S ( U ) . R

1 6 0 E- C ( W ) : C ( W ) . C ( U ) : C ( U ) - E

1 6 5 N E X T u , W

1 7 0 P R I N T : P R I N T " I F ~V E VALU ES RAV .~ A M IJI¥IJM , THE M O S T

P R O B A B L E V A L U E O F E / R , I T S M E A N D : M A T I O H , A D D O R D E R , N ,

ARE R E S P E C ' f l V E L Y : "

1 7 5 P R I N T : P R I N T T A B ( 5 ) ; I N T « S ( Y ) / ( M - 1 » + . 5 ) " + O R _ "

I N T ( ( D ( Y ) / ( M - 1 » + . 5 ) " F O R A V A J ~ U E O F li D " C ( Y ) / 1 0 0 " +

O R - " V / l 0 0

2 0 0 D A T A . 0 1 6 , 7 7 3 . 2 , . 0 8 7 , 8 0 3 . 2 , . 2 1 6 , 8 c ! 3 . 2, . 4 8 9 , 8 4 3 . 2 , . 6 6 3 ,

8 5 3 . 2 , . 8 2 6 , 8 6 3 . 2

5 0 0 D A T A 0

R E S U L T S F R O M A R U N U S I N G T E F L O N D A T A ( F R O M 'l'G)

C O M M A N D ' R U N ' _ . . . . : ; ,T A T E M E N T S I N L I m : # ' S 1 - - 4and " B R E A K I N 4 "

C O M MA N D ' C O N ' ! ' >" E / R V A L U E S O F R E A C T I O N O R D E R S I • (x 1 0 0 ) :

N . 8 6 N . 9 1 N . 9 6 N . l 0 l N . l 0 6 N . l 1 13 4 1 3 7 3 4 1 7 6 3 4 2 1 4 3 4 2 5 3 3l t292 3 4 3 3 1

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

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

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

P R E S S A K E Y T O C O N T I N U E ! Jt

C O M M A N D : K E Y P R E S S E D T O ~

" A V G . E / R V A L U E S A N D T H E I R M E A K D E V I A T I O N S F O R V A L U E S

O F O R D E R S ( N x 1 0 0 ) : N . 8 6 T O 1 1 1 , I N C R E M E N T 5

A R E R E S P E C T I V E L Y :

3 1 6 2 3 . 1 9 a + O R - 1 3 6 7 . 1 3 7 2 1

3 2 1 0 3 . 8 1 5 5 + O R - 1 1 4 4 . 0 6 2 2 63 2 5 9 3 . 0 1 7 + O R - 9 1 5 . 2 6 8 7 1 3

3 3 0 9 0 . 8 0 8 4 + O R - 8 7 2 . 2 0 6 7 6 9

3 3 5 9 7 . 1 9 0 5 + O R - 1 0 2 4 . 3 0 2 6 2

3 4 1 1 2 . 1 5 9 + O R - 1 1 7 9 . 6 9 2 6 5

P R E S S A K E Y T O C O N T I N U E ! "

Page 21: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 21/52

o

C OMMA ND :K EY PR ES SE D T O )

" IF ABOVE VALUES HAVE A M IlI IMU M, THE M OST PR OB AB LE

VALUE OF E /R , IT S MEA1 l DEV IAT ION , AND ORDER , N ,

ARE RESPECT IVELY :

33091 + OR - 872 FOR A VALUE 01' N . 1.01 + OR - .05 II

Another run was made using ii smaller increment, V. 1,

and Ys 97.01, Z. 101.01 (the .01 a'roids a "division by zero

error" message) to yield the more accurate tinal result:

" 32792 + OR - 822 FOR A V AL'JE OF N •• 9801 + OR - .01 "

These resuts are in excell,~nt agreement with results

obtained trom the same data by othl~r methods (non-computer)

which were laborious and time-consllming.

- - ~ - - - - - - - - - - - - - - - - - - - -

Nov you can giv! your PET micro-computer

real fiDe 'Point jra 'Ph1cs capab111'Cies ~

The Softside So:tware Graphics Pac will

quadrup Le your PEl":!IIvideo resolut ion. With the Graph Lea Pac you can 1I1dividually

control 4000 Doints on screen. Don It be I1m:1ted to th! 25X401000 point display

t.hat you cee using nov. Draw graph., plot mathematica Land scientif ic equations,

or draw pic Cures for tun SDd game e ,

[t':!II easy to u8e: Plot paints 1n d.mple X, Y DOtLtion. Two versions come

on t.he Graphics pae , One v ersion plots point 0,0 in t re upper left hand corner

and t.s suitable f.or gra-pbic p1.et.U1:1!8.The.ot.her ve:rsi)U su1.t .ed for graphing and.

plot. ting has point. 0,0 in t.he ceaeee of t.he eceeen so :hat. you can use all four

quadrants !!IO that. -40 X 39 and -25 Y 2 4.

Ail an ext.ra bonue, a third progr_ is. included on the tape. To tnt.roduce- you

ec the graphics pac.' s uees we have ineluded a high rea ,1nt i01l versi01l ot doodle ~All thia on a casset.t.e tor your l!:r for 2 ! ! !I . . .J . . . l: ~

2"BIlCEtI A S!MUl..\.ttON New, And Sophia :icat.ed, dee tfned to become

'- new claasic, SIKE is a challenging nell

sillllllat.ioa. rit.h all the element.s of t .he sc'rLd

oi ~ business. BIKE places you incharge of a campa lY t.hat. manufact.ures bicycles.

';lit.h lnflat.ion, boreakdoWIUII,nd t .he chaDginlJ seasons t. :ying to sap your business

savva 'l . you have Cobe judiciously handl ing prtces , .. !:!:rent .ory. workers , and ~

campaigns, keep your company in t.he black. BIn is ~lgerously ~. and just.

as fun, Once you '!IItart.you just. w1l.l 1lCIt.want . to s t.op, and tha t. ' s the trut.h. Well.

ycu never have t.o st.op! The game allClVs you to eeeee :he dat.a from vour same on a

rape , and ee cont. inUA where you left. off when you next. heve the time. Wort .h. s

:nillion dollars of fun we'll offer JUICE ~5

J"SUPER noODLE" ~;uper Doodle is perhaps the most. aophfacLc.aeed

pencil you \o7On' have t.o dra" wich! You cont ro L

CI C1U"scrthac: ca 1 be eeved in eighc direct. ions

leaving a t.rail of not. one. but. any of t.he Pet' s ,56 c iarae eeee, ;.wcn eoee sophist .ica-

ted than any regulaor vereion of Doodle, che Sofcside S"ftware version also has clear

ecneee i,a ret.urn to cenee'r key, and a ceLete key, th,! kids vill love te, in fact.

anyone will love being able to at. lana last. puc the PE:' s incredible graphic abilit.ies

to use. Why wast. e paper. use "lour P E ' 1 ' a.s·a sket.chpad. A deal at $ 9..95

Got a question? Feel free to drop a tee eee in tn! mail or give us a call. We

will do our best to help you.

Enjoy!!

8 : 1 9

Page 22: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 22/52

DAMveLlA PETDAMYOUR TRB-BD

DAM VDUI=IKIM

DAM VOUI~

MEASURE - RECORD - CON TROL

• TEMPERATURE• DIRECTIOI\J• PRESSURE• LIGHT LEVELS

• db• POLLUTION CONTROLS

• DARKROOMS

• HUMIDITY• LIGHT

DATA

ACQUISITION

MODULES

by

• ENERGY CONSERVATION EQUIPMENT

• GREENHOUSES

• SPEED• IIVEATHER STATIONS• NOISE POLLUTION

• pH• EARTHQUAKE TREMORS

• VELOCITY• ~CCELERATION

NOW YOUR COMPUTER CAN LISTEN TO THE

REAL WORLD. YOU GET 16 8 BIT ANALOG

INPUTS WITH OUR AIM16.

~WINO SPEED HUMIDrTY

W I N D D I RE C TI O N ~ : ; T U R ERAINFAll ER

?

CONNECTICUT microCOMPUTER

15 (JP ()CONO ROAD BROOKFELD, CONNECT ICUT 06804

/20.1) 115 ' :1659

Page 23: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 23/52

o

BUY FROM THE BIGGESTN C E / C o m p u M a r t. ' -

" " -" " ~~~~

SlIS

. .,

P E T$795

1250 North M ain Street, Departm ent MJC8P.O. B ox 8610 Ann Arbor, M ichigan 481 07

THE PETCONNECTION

· :..., "

.. : ,".

memory 1795.00

Second Cassette drive S99.95

AS-232 Printer Adapter -

assembled board $98.50

W th power supp y, case &

connecter $169.00

Beeper - PET controlled

beep nU5

':11.15

Hams! Add aPET to your rig.

Compuler ZI! you. Siailon WI "

Mcr oI roOCS " " -65 Ham Inenace

ano 'n clu ded so ftware YOu SI mp y

p lu g I he un" , ,' 10 you r " ,E T .I"I(J

you e rea d. , to (Jllp1 ay 1' .J" ,m l

and receoe e,lhe, CWo. RTTYal' ,u es up 10 100 WPM

ASSEMBLEO KITS

$99,95 .

SECOND CASSETTE

FOR PET-$99.95nus per lp he .a ' rom Commodor e

9'0 15)'OU IhlaD,IUylouSl!onelapE!

d e- cl ! l or " PU I an d One l or o ul Pl l1

copy h ies etc

KIM-1Theo"9Inallulf ye.pandablesongle

ooala cam pule!

$179wtll pO •• ' !IIPpl,

$209

1240.00

S2!K1.00

Cabln'lI S 3500

E.l PANDAPET . EconomIca 16K

memory • • p anSon l or I he PET (U1-

el udes 1 a aughlt or board) 1 435. 00

Without ( laughter DOard 1315. 00

E XPA ND YOUA K IM S YS TE M

1 1 . 1 l 1 l i 5 '

Assembed

Connector sel

" 0 0 4eJ<pilns,on OOlrd

M IC AO T EC H. P OWE R SU PP LY

Assembed 1J4.1JS

KIM ENCLOSURE

N et wo rk s h II oa em l or P ET

Anachls 10 OA A 5320 00

C.binet S 35.00

NEW ASCII INTERFACES'or Reader/PunchREADER/PUNCH~,LEVEL PAPER

TAPE/READERPUNCH

LOW·COST PRINTER

FOR PETThi S IS a camp le le i) r el ur bl Sh ed

T eet yp e K 51=1 -3 3 l e, rnU111 r ea dy 1 0

enaentc your PEr! ,ntlrlacl 10USe as iI ptu"lr

•••

Boards & Cabes

Parallel ,220

AS232 Serial USO

Board Caoe~ Power Supply

Para e S4f10

"15

BO.1rd Cables Po..... ' SUpply E~~I<nu,e

ParaUel '515

Serial 1710

Hazeltine1400

Now a 5th Generationin Terminals:

Introductory Sale Price -Immediate Delivery

• 24 x 80 displaye RS-232C interface• 110 to 9600 Baude 12" CRT Moni tor• Remote screen control• Uses 8048 microprocessor• State-of-the-ar t design

A ful l capabili ty terminal completely

assembled with a 90 day warrantyfor less than you'd pay for a kit.

s~~~t~....•

SANYO ...

MONITOR

CASHAVAILABLE

16L.,)(64 ehr. display_ 128plinabl.characters. software UART(ASCIIor eaudot ). 3 .ar'a' interf.c" &

cauen . 1 /0 . t r ue composi te v id eo .TTL compatbe , alilY po.... . con-

necnon .

T C-71 S ELE CT R IC T E RM IN ALS

.: ~~.~oV..;,;:_---,.--.qZ.

~.

!fi~'~~~~l~~~g' : : i7 : !e udes desk . 13 0 charmn.ASCII 'terslon amplOy. 6802lor tad. CQrl' ler3ro"_Sea ourCill.log lordelilils

ASCII

AefurbShed

Wontng

As·I!

-. . .. . . .mo

A SC II I NT E RF AC E F OR T C · 71J O da yd el rv i! f 't " 'r m al ly S ,g g NOW $169

Aco' JSIIC Couple r l or u n WI th ASCII Te-71 $159

• Co or grlph cs 0" yOUr TV

• MUllc and a ound tlynl h •• i ~. r

• Built·inca••• n_ tapti dli".

• Large 53·II ;.y _.yboard

• l'woioyltlc•• Inclucl"

• 14 Fr •• e•••• n ••• orth 1214• lEelu-BASIC cn.ana included• 8080 M croproc: ... or

• I I< R AM . ZII: RO MIf you can', d.cida b..... n a

sophlallcaled ,,/eI..o gam. Inda! tome compu t. r " ,. n 1 1 ' " Inl.r-

l ei Mod. 1 On. I . ' o r y ou . Hooi l"

' 0 y our eol or TV .n d yo . . • .. .. 9 01

bOlhl You e." pI.y o~ of ,,,.

g.m •• whiCh .r. Ineluded I, ••

or you e.n lo.d Edu- BASI C .nd

wril. your own g.m.s. (ou e.n

..... progr.m. 01 dll. u.ing

t he b ui ll -i n c •• •• n . I .pt I dr i . .. ..

a." of III you g. o".r 1214

wort" of Ir •• el •• e n • • inelud-

ing;

NOW!

Edu-B"S IC - Wr il . pr ogr lms

Conelnltilion - Th. ",.mory glme

Oog ll gh l - . .. er ia l b ll ll l!

" dd-Em Up - ... " llh geml

Bior hythm - P iol your Own

B lleiljle il - W.ge, .. idlo bueks

Computl -"-COIOr . .. .:EI lY grlph ies

Hlng" ln - T". wo,d gili ll

I (nocildown - ... di cs glml

MIZI - Computer miZ •

Rlglnl - R.c. you. ship

Showdown - Gunf ig ht

Page 24: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 24/52

TRS-BD PET APPLE

PLAY CHESS WITH YOUR COMPUTER!MICROCHESS is the culmination of two years of chessplaying

program development by Peter Jennings, author of the famous 1K

byte chess program for the KIM-1. MICROCHESS 2.0 for 8K PETs

and 16KAPPLEs, in 6502 machine language, offers 8 levels of play

to suit everyone from the beginner learning chess to the serious

player. It examines positions as many as 6 moves ahead, and

includes a chess clock for tournament play. MICROCHESS 1.5for

BRIDGE CHALLENGER by George Duisman for 8K PETs, Level II

16KTRS-80s, and 16KAPPLEs: You and the dummy play 4 person

Contract Bridge against the computer. The program 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 4 people to play! $14.95

ORDERS: Check, money order or VISA/Master Charge accepted;

programs and casset tes guaranteed. I f you have questions, please

call us at 617-783-0694. If you know what you want and have your

VISA/MC card ready, you can DIAL TOLL FREE 1·800·325·6400

P.O. Box 136-R10 Personal Soft~wareTMCambridge, MA 02138

4K TRS-80s, inZ-80 machine language, offers 31evelsof play (both

Level I and Level" versions are included and can be loaded on any

TRS-80 without TBUG). MICROCHESS checks every move for

legality and displays the current position on agraphic chessboard.

You can play White or Black, set up and play from special board

positions, or even watch the computer play against itself! Available

now at a special introductory price of only $19.95

STIMULATING SIMULATIONS by Dr. C.W. Engel for 8KPETs, 4K

Level I and II TRS-80s, and APPLEs with Applesoft II:Ten original

simulation games such asForest Fire, LostTreasure, Gone Fishing

and Diamond Thief, progressing from elementary to quite complex

with most suitable for schoolchildren. Includes a 64 page book

giving flowcharts, listings and suggested modifications ... $14.95

(24 hours, 7 days; in Missouri, dial 1-800-342-6600). Or you can

mail your order to the address below. Personal Sottwere'" products

are now ,AVAILABLE NATIONWIDE FROM COMPUTER STORES.

Look for the Personal Soitwere" display in your local store'

Name:

SUBSCRIP TION AID RENEWAL . INFORMATION

If you are a subscriber to MICRO, then the cod~

following your name on the mailing label is the

number of the last issue your current subscrip-

tion covers. If your code is 07, then this is

your last issue. MICRO will NOT send out

renewal notices. So, if your number is coming

up, get your subscription renewal in soon. and,

please check your label for correct address and

notify us of any corrections or changes.

MICRO has been published bi-montly since 1977.

Starting with the February 1979 issue, it will

be published monthl y. The single copy price is

$1.50. Suh~criptions are $12.00 per year in US.

Annual subscriptions in other countries are as

listed below. All payments in US $.

Surface: Canada/Mexico

All Other Countries

$15.00

$18.00

$30.00

$30.00

$25.00

$35.00

Air Mail: Europe

South America

Central America

All Other Countries

Addr:

City:

State: Zip:

countr-y :

Amount: $ Start MICRO II:

Send payment to:

MICRO, P.O. Box 3,S. Chelmsford. MA 018211, USA

Your name and address will be made available to

legitilDate dealers, suppliers, and other 6502

mter-eat.a so that you may be kept informed of

new pr-cduc ts , cur-r-ent developments, and so forth

_ unless you specify that you do not wish your

name released to these outside sources.

tl:22

Page 25: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 25/52

A\ ,

·0

\V

CONTINUOUS MOTION GRAPHICS OR

HOW TO FAKE A JOYSTICK ~ITH THE PET

A la n K . Ch ri st en3 en

1303 SuffolkAustin, TX 78723

When using the PET graphics to represent motionit becomes apparent that the BASIC supportedroutines are not fast enough to allow smoothmovement. If the keyboard and screen are ac-cessed directly the appearance of controlled mo-tion can be greatly enhanced. As an example Iwill use a short game written in BASICalthoughthe techniques can be used by machine language

programs with even better results.

Let me first describe the game and then explainhow the effects are produced. The initial ap-pearance of the screen is two walls at the right

and left sides of the screen with a ball andpound sign C ln which I will refer to as a bat

(see figure 1). The ball goes into motion andappears to bounce off the top and bottom of thescreen and the walls. Each time the ball strikesa wall it causes part of the wall to disappear.The ball will also bounce off the bat and theplayer is able to control the motion of the bat.This is done with the keys surrounding the num-

ber 5. As each key is pressed the bat moves inthe same relative direction as that key was tokey number 5 (see figure 2). For example if thenumber 8 is pressed the bat moves straight up.

If the number 1 is pressed the bat moves alonga diagonal towards the lower left side. The bat

will continue to move for as long as the key ispressed. The object of the game is to make theball strike the grey area of the left wall be-fore it strikes the grey area of the right wall.

Lines 5-100 of the program are init~alization. Aspecial input array is set up (more about thislater) and boundary conditions are set. Lines80-90 print the walls. If the walls were placeddirectl y on the screen the right wall could beone column further right and both walls could beextended one line. For this example I chose thesimplest method of initializing the screen.

The boundaries are memory locations 32768 thru

33727. The characters on the PET screen are re-lated directly to the values in memory locations

32768 thru 33767. The screen fills from left toright and is 40 characters wide therefore poking

a value into byte 32768 causes a character toappear in the upper leftmost (home) position,

byte 32768 + 39 is the upper rightmost postion,byte 32768 + 40 is the leftmost position of thesecond line and so forth until byte 33767 whichis the lower rightmost character position. Table1 gives the val ues for each character to causeit to appear on the screen. Lines 25 & 30 setthe conditions to keep the ball and bat from

moving off the top or bottom of the screen. Thegrey areas of the walls provide the boundariesfor the sides of the screen. The right greyarea is actually the reverse field (rvs) of the

left grey area therefore a peek (32768) would

return a val ue of key & = 38 + 64 (for shift) =102 while a peek (32768 + 39) would return 102

+ 128 (for rvs) = 230. This provides an easymethod of detecting when the sides of the screenare reached (and in this example an indicationthat the game is over).

To provide motion for the ball a horizontal andvertical displacement are used. This is so theball can move in directions other than up, down,

sideways, or diagonal. XOis 32768 + the columnand YOis the line number with 0 as top line. X

and Yare increments which are added to XO and

YO to get the next position. (PI is the nextpositim while P2 is the current position). If

the nect position is beyond the top or bottom ofthe screen the direction of Y is reversed and

the next position is set to the current posi-tion Ilines 120-125) this provides a bounce.

The ch.u-acter- on the screen at the next positionis now chec ked (line 155). If thi s is equal to

35, the pound sign, (line 160) then the bat hasstrucl: the ball and it bounces off at a newangle. The magnitude of vector (S, Y) is fix-ed at 1 so that the ball cannot outrun the bat.

If the next position has a screen val ue of 160(32+123 for rvs blank) the white area of a wall

was struck and the horizontal direction is re-

versed (line 180) but the new position is al-lowed to stand causing the ball to move into thewall. Lines 18'5-1gO chec k for the winning orlosing conditions. Finally in line 195 the nextpositi:m is poked to the screen and the current

positiJn is blanked out (line 210). The currentposit~.on is reset to the new position afterLoopfrig to line 105 and the ball continues tomove.

The ba~ is supposed to respond to the player andso a dlfferent movement scheme is used. The key-board input routines supported by BASICrequireone or more keys to be pressed and released foreach input val ue to be received. This requiresthe player to tap at the keys like a woodpeckerto cor trol motion. To avoid this problem theprogran accesses byte 547 of the operating sys-tem w(lrking storage. When the interpreter isr-unnfn.g the operating system places a uniquevalue In this byte for each key that is pressed.(table I also gives these values, they are notthe saae as the screen character values). Thesevalues are then translated to a displacement forthe ba t ,

The bat position is initialized and always kept

at thH actual address of the memory locationwhich corresponds to the bats screen characterpositiJn. Al contains the next position whileA2·contains the current position. In lines 35-45an array E was set up with displacements storedat inc.ex values matching the values which mayappear when any of the 8 keys surrounding number5 is pressed. All other values of E are zero. Byusing the value at Peek (547) as an index to Ethe proper displacement for that key is obtain-ed. For example when key number 2 is pressed,the vaLue 18 appears at byte 547 and E(18)=40which ~en added to the current position gives anext position one line lower(see lines 130-135)but if no key is pressed byte 547 contains 255and si1ce E(255)=0 the next position is the sameas the current position and no motion takesplace, The position is checked against the

bounda~ies (line 140-150) and the screen is up-dated (lines 200-205). The program is now fastenouglt for the motion to appear continuous.

One drawback to this input scheme is that eventhough the keyboard buffer is not used to con-trol tle bat, it still fills up. Lines 310 and320 shrv how the buffer had to be emptied beforeusing the BASIC input routines again in line370. When using the continuous keyboard inputfrom a machine language routine it is importantto leave the interrupt set to keyboard input orbyte 517 may not get updated.

Page 26: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 26/52

TABLE 1 (contl

KEY SCREEN KEYBOARD KEY SCREEN KEYBOARDVALUE VAL (547) VALUE VAL (547)

r : : . 2 7 7 5 9 2 8

\ 2 8 6 9 c 6 0 5

J 2 9 1 4 : 6 1 1

l' 3 0 5 9

>6 2 1 2

~ 3 1 7 5 ? 6 3 2 0

The screen character values for a shift-key is the value of the key + 64. To get a reversefield (rvs) of a character (including shift-key characters) take the character value +128.

Additional k ey bo ar d v al ue s:

U p, ' do wn c ur se rS id ew ay s c ur se rDel

7484

6 "6

736 5

(note pressing thi3 key will still stop the program)

Home

RVS

STOP

P RO GR AM L IS TI NG

5 PfM •• IIIA!,.LPEAK •• 115 PI = x O + 40 -II IN1IYO)

10 R fM Al.AN 1 < . CHRISTENSEN 120 IF" PI > H THnl V = - y Pl=P?

15 REM AUST IN, TEXAS 125 IF" PI < T IHEfJ V = - V Pl=~?

20 DI M E(2561 130 l'li = pEE.K (547)

25 T = 32768 135 Al = Al + E.( r%)

3n H = 33727 140 IF PEEK (A 1 ) > 1(10 THEN fll=A?

35 El5B) = -Itl E(SOI = -40 F"(57) = -39 145 IF" A}> H

THF'>JAl::A2

It II ((42) = - 1 f(41) = 1 150 IF Al < T THEIJ AJ=A2

45 C(261 = 39 [ ( 1 e ) = 40 F"(2S) = 41 155 P% = PEEK(Pl)

50 X O = 327H8 16() IF P% <> 35 THiN 180

55 YO = J 1 165 X = SGN(-X) -IIFiN!)(I)

60 Al = 33149 1 7 0 V = S ( ~ ~ ( I - X - II X ) - I I ' SGNIP2-A2)

65 PI ;: 331H9 175 PI = P c

70 X = RNO (II -.~I V = SQR (l-UX) J80 IF P~=160 THEN x = - x

75 ? 11 11 185 IF P% = I ! ] 2 THlN 3 0 G. tlr

IJ O FOR I = I TO 25 1~'l IF p", = 230 THeN 4 C i O

,tiS ? "~t~~I'5PCI331'~" 195 POKE: PI.87

rvs

'JU NEXT t ;lull POKE Al.35

lUO RE"l •• E.N') OF I N lT l A LI Z II TI O N -II. 'li5 IF Al<>A2 1H":II' POKE A2. :\?

] 1 1 5 A2 = Al P2 ;: PJ ?lll IF Pl<>P2 THEN POi'\E i'2,3?

11 " )(0 = ) ( I: + x : Y O = V O + y ,~15 G()TO 105

Page 27: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 27/52

Figure 1 Figure 2

Showing the placement of the w al l b ou nd ar ie s

at the beginning of the game

TABLE 1

KEYSCREEN KEYBOARD

KEYSCREEN KEYBOARD

VALUE VAL (547) VALUE VAL (547)_ _ _ _ _ _ .-- -_.

@ 0 15 blank 32 6

A 1 48 33 80

B 2 30 " 34 72

C 3 31 # 35 79

D 4 47 $ 36 71

E 5 63 0 /0 37 78

0F 6 39 & 38 77

G 7 46 Sintle' I 39 70quo e

H 8 38 40 76

I 9 53 41 68

J 10 45 * 42 33

K 11 37 + 43 17

L 12 44~omma

44 21

M 13 29 45 9

N 14 22 period 46 2

0 15 60 / 47 49

p 16 52 0 48 10

Q 17 64 1 49 26

R 18 55 2 50 18

S 1940 3 51 25

T 20 62 4 52 42

U 21 61 5 53 34

V 22 23 6 54 41

W 23 56 7 55 58

X 24 24 8 56 50

0y 25 54 9 57 57

Z 26 32 58 36

~~~~(!) 8 : 2 5

Page 28: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 28/52

PROGRAM LISTING ( c o n t )

310 GET A~

320 IF A$ <> "" THEN 310

330 ?"

+"SPC(12)"1'CONGRATUU,nO"'c;"

home rvs

3 4 0 F O R I = 1 T O 1 0 0 : N EXT I

350?" "SPC(12)"CONGRATULATIONC;"

thorne

3 6 0 F O R I = I TO 1 0 0 : N EXT J

310 G E T A$

"'131:H IF A$ = T H E N 330

390 G O T O ., l'

4()(}

R EM -0*" LOSER -0**

4 1 0 G ET A $

421) IF A~ <> i r t THEf\j 410

430 ?"A_1'SPC(12)"fSORRY.I. tTRY+ IAGAIN"'home rvs offfA rvs off'trvs

4 4 U F O R I = 1 TO i n o : N EXT I

45U ? "t"SPC(12)"SCRRY TRY "'GAIN"home

4 6 0 F O R I = 1 r o ico : N EXT I

470 GET A1 i

480 IF A$ = " " TH[N 430

490 GO TO 5(;

5 0 0 E N U

8 : 2 6

KIM-1

SYM -1 (V IM )

$161

$238

CASSETTE TAPESPremium Quality low noise in 5 screw housing

Perfect for PET, Apple, KIMC-10 (10 minute) 10/6.25

C-30 i30 minute) 10/8.00L 512 Power Supply

for KIM-SYM and extra memory

(with KI M or SYM $30)

$34

Soft plastic boxes with tape order 10/1.00

300 foot certified digital cassettes 5/9.75

Write for quantity prices

4 Part Harmony Music System

MTU 8 bit D to A Converter,

amplifier with example software

$35

KM8B from Problem Solver Systems $149

8K memory for KIM-SYM-AIM

Memory Plus from the Computerist $239

8K RAM, spacefor 8K EPROM,

EPROM Programmer, timers, and I/O

KIM Enclosure from Enclosure Group $23

Write for list of KIM and PET accessories

A B Computers

Programming a Microcomputer: 6502

6500 Programming Manual

6500 Hardware Manual

First Book of KI M

All Hayden books 10%off

8.95

6.50

6.50

9.00

• P.O. Box 104 • Perkasie, PA • (215) 257-8195

Page 29: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 29/52

o

PET-EXPANDOR PRINTER FROM PETSHACKP.O. Box 966

P R IN T E R P R IC Ew I TH PET I NTER FA C E $495

• Sm II s i z e o f 4.S"H I1Z% ''W 19 %" 0

• I m p ac t print ing • 3 capias

•Pm .. caUms wide• Print CyI nd ar . n o t a I I 1 I 1 r i x

• U s e s B~" p a p e r , pr8IU8 .. p i n feed

• E as y to m a i n t a i n yanaIf, .. ntUn to . .(1I II Iin Ia nB :e . .. . . . . . . . . . . ,

• R a tP a r Paper . C o a t a d p a p e r n o t fIIII*ad.· l 9 1 tL U a i g h 1 . 1 1 ~ . . . willi ...• E a s y to cary willi yaI . pc.tIbIa•Pm 1 0 daactersl* I 8 C C I I I d

• S in gl e C a s e 8 4 ClIne_ A S C I I ClIne_ Set

• Pin feed m a c : h a l i s m i n c l u d e d

• FuI Docunntat ion IncbIed

PET-SHACK Software House

Mishawaka, IN 46544

PET TO PA REL LEL INTER F A CEw i t h 5 V .8 A p o w er s up p l y . - -$ 7 4 . 9 5

PET TO 2 nd C A S SETTE I NTERPA CE. -- $ 4 9 . 9 5

This is 'he ideal. lou' cost, reliable. self maintained printer with which to complete your ,PET system.

S O F T W A ~ E P R O G R A " I L IS T - - - - - - P R IN T E D B Y T H E P E T E X P A N D O R P R IN T E R - - - - - -

N U ~ ~ E R A ~ A - N U M ': lE R G U E S S IN G G A M E ~ U S E D O f l j 'M A S lE R " ' IN D ' - - - - 5 · 9 5

S T A T E S - H E L P T H E K ID S !1 1 T H T H E IR G E O G R A P H Y . " 'A T C H S lA T E S ! C A P l lA L S . - - - - 5 . 9 5

I o I A T H T U T O R - H E L P Y O U N G S T E R S L E A R N M A T H IN A N E N J O Y A o L E W A Y . - - - - 5 . 9 5

6 5 0 2 D IS A S S E M 8L E R & P E E K - A - B O O - D IS A S S E M B L E R O M S & M A C H IN E L A N G U A G E

P R O G R A M S . D O U t lL E C H E C K Y O U R H A N D A S S E " ' t R E D P R O G R A , " ,S A N D

D IS A S S E M H L E T H E P R O T E C T E D B A S ~ C R O M S IN Y O U R P E T -

P E E K - A - t : lO O P E E K S A T Y O U R " 'E M O R Y A N D D IS P L A Y S 2 5 S U C C E S S IV E

A D D R E S S E S IN A S C I" H E X , D E C IM A L ' & A C T U A L C H A R A C T E R S . ---12.95

M A D L I r 3 S - P A R T Y F A V 0 R I T E l H I L A R IO U S S T 0 R I E S C R E A T E 0 • - - - - 5. 95

W O R L D C O 'IO U E S T - A D V A N C E D G A M E O F S T R A T E G y - - - - - 5.95

S H P T R t K - A lL '- T I " 'E F A V O R IT E W R IT T E N F O R T H E P E T 'S S P E C IA L G R A P H IC S . - - - - 5 . 9 5

I o I O R T A t - < - A O V A ~ C E D T E C H N I C A L G a M E IN V O L V IN G X -Y C O O R D IN A T E S A N D

A ~ G L E S T 0 D IR E C T T H E M 0 H T A H S H E L L T O T H E T A R G E T • - - - - 5 • g 5

P S Y C O A " lN IE - T E L L Y O U R P R O B L E M S T O P S Y C O A N N IE A N D G E T A N

IN T E R E S T IN G A N D P R O V O C A T IV E A N S W E R . - -- - 5.95

C O ~ P U T E R D E R B Y - E X C IT IN G D E R B Y W IT H F O U R E Q U A L L Y M A T C H E D H O R S E S .

U P T O F O U R P E O P L E C A N P L A Y . - - - - 5. 95

~ A IL IN G L IS T - F O R P E R S O ~ A L O R B U S IN E S S A P P L IC A T IO N S . V E R Y C O M P R E -

H E S S I V E 'w i I T H F IL E T O T A P E 0 R P R IN T E R . --- - 9. 9 5

H O M E U T IL IT IE S - L O A N S , S A V IN G S ' E L E T R IC IT Y , & " 'I L E S P E R G A L L O ~ . - - - - 9. 95

M A C H ' ' ' J f : L fI N G U A G E M ( ) N IT 0 R - ' " R , T E '" A C H I N E C O D E . S A V E O N T A P E . ----9.95

Page 30: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 30/52

6503 C O N T R O L L E RUse your bas ic KIMboard as a deve1opmen·t

system for the MIKcontroller board from

Qix Systems. Develop and check programs

on your KIM. 'rhen, load a PROMwith your

program and insert into the PROMsocket

on the MIK. You then have a non+voLatLle

programmed controller with the following

features:

'16 Programmable buffered I/O pins.

I512 or 1024 bytes of ROMand 128 byt.es

of RAMfor scratchpad and stack •

• On board clock, programmable timer in·:errupts. +sv voltage regulator,

debounce circuitry for nonmaskab1e Lrrcer rup+ and reset lines.

• Uses single unregulated supply with PROM's or an additional -svsupply with 2704 or 2708 EPROM's.

• 4~" by 6~" board with 44 pin edge connector •

• $109.95 assembled and tested (no PROM's included) •

• $69.95 for board with sockets for all Ie's.

SYSTEMS P . O . B o x 4 0 1 6 2 6 DALLAS} TEXAS 7 5 2 4 0 (21ft) 3 8 7 - 5 5 8 9

You can use the versatile new BETSIto plug the more than 150 S-100 bus

expansion boards directly into your PET*!

On a single PC card. BETSI has both interface circuitry and a 4-slot S-IOO motherboard. WithBETSI. you can instantly use the better than 150 boards developed forthe S-IOO bi s. Forexpanding your PET's memory and I. O. BETSI gives you the interface. The single boardhas both the complete interface circuitry required and a 4-slot S-IOO motherboard, plus an80-pin PET connector. BETSI connects to any S-IOO type power supply and plugs directlyinto the memory expansion connector on the side of your PET's case. And that's it. Youneed no additional cables, interfaces or backplanes. You don't have to modify your PET inany way, and BETSI doesn't interfere with PET's IEEE or parallel ports. And when you

want to move your system -BETSI instantly detaches from your PET.

BETSI is compatible with virtually all of the 5-100 boards on the market. including memory andI/O boards. BETS I has an on-board controller that allows the use of the high-density low-power~Expandoram" dynamic memory board from S.D. Sales. This means you can ex p and your

PET to its full 32K limit on a single S-IOO card' Plus, you won't reduce PET's speed whenyou use either dynamic or static RA M expansion with BETS!. Additionally, BETSI hasfour on-board sockets and decoding circuitry for up to 8K of 2716-type PROM expansion

(to make use of future PET software available on PROM). BETSI jumpers will address thePROMs anywhere within your PET's ROM area, too.

,\-TIIL ORDER.r.,'ARE

'\ORH4LL}1 SHIPPED

WITHIN 48HO[.'RS,

J'ISA AND MA.S"ER-

CHARGE ORDERS ARE

BOTH .4 CCEP TED ,

The BETSllnterface/Motherboard Kit includes allcomponents . a 1OOopinconnector . a no! completeassembly and operating instructions for SI 19.

The Assembled BETSI board has four 10~-pinconnectors. complete operat ing instructions and afull6-month Warranty for just SI65, .

FORETHOUGHT PRODUCTS87070 Dukhobar Road #0EURene. OrfRon 97402Phone (503) 485-8575,

BETSI iii rhe nt'w Interfu('t'/,Wotherhoardfrom Forefhourht

Produ('I.~-tht' makers of KI.Wsr"-which allows users of

Commodore\ PET Per,mnal Computer to ;nstant~' · work

with (he scores of memory and 1/ 0 hoards developed for the

S-IOO (Im.fjQi/.-lItair type) hU5. BETSI;s available from swell.

on a single 5/12" .r 10 " printed circuit card.

BETSI ;.\-available off-the-~helf.rrom your local dealer or (~f

they're out) d;rect~" from the manufacturer.

Ask about ourmemory prices, too!

Page 31: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 31/52

o

STOR AC E SC OP E R EV ISITED

Joseph L. PowletteDonald C . Jeffen

Hall of ScienceMoravian College

Bethlehem, PA 180.1.8

Marvin DeJong has written an excellent article

(MICRO, No.2, pp.11-15, Dec 11-Jan 18) which

serves to transform an or-dfnar-y oscilloscope in-to a storage scope. Wehave constructed severalunits for use in our laboratory and found them

to be very useful. However, we would like tosuggest a simple hardware change which will

improve the quality of the circuits performance.Figure 1 is a photograph of the storage scoperesponse to a triangular wave (14Hz and voltage

offset) using DeJong's circuit. The cause of

the irregularities seen in this figure was

traced to the second OP-AMPwhich is used as acomparator. The slew rate of theCA3140 is nothigh enough to adequately accommodate the suc-cessive appr-oxtmat.ron software routine. Figure2 shows the collection of data for the same wavewith the second OP-AMP changed to a 531 high

slew rate OP-AMP. The 531, which is readily

available, has the same pin-out (in the TO-5

package) as the CA3140 but pin 4 must be con-nected to -15 vol ts rather than ground poten-tial. Also, do not use a frequency compensation

capacitor with the 531 since this will only de-crease the slew rate of this OP-AMPin the com-

parator configuration. The 531 is not a FET in-put type and does not have the high input im-

pedance (1.5 T ) of the CA3140. If such a highimoedance is desirable, one can use a CA3140 in

the following configuration pr-ecedang the 531non-inverting voltage input.

One should also note that:1. There is a 1 bit version of the 1408 DAC.

Specify 1408L8 for the 8 bit converter.2. +5 volts should be connected to pin 13 of the

1408 (see MICRO, No.6, p. 4, Aug-Sept, 1918)

3. The flow chart. for the successive approxi-mation routine is not. cor-r-ect •

DeJong is to be commended for this storage scopeapplication. In fact, the performance of theprogram (with the above hardware change)

approaches that of commercial units.

F i g u r e 1

Flow Chart for

Successive Approximation

Analog to Digital Conversion

PAD = 8016 = 100000002PGZZ = 80

16= 10000000

2

Y E S

LOGICALSHIFT RIGHTPGZZ.

(Shifts all bi ts one bit

is

IPAD =

NO

C cr re ct io n t o· S uc ce ss iv e A pp ro xi ma ti on -

Mi cr o , N o . 2 , P . 13 D e c . 77 - J a n . I H

F i g u r e 2

8:2'1

Page 32: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 32/52

14 Hz Sine Wave(Voltage Offset)

De Jong's Circuit

14 Hz Sine Wave(Voltage Offset)

Modified Circuit

•THE ULTIMATE FOR PET --

EXS~CC··FLOP~lyDISKCONTROLLER

The :::XSlOO is both a SIOO ADAPTER and a FLOPPY DISK CO [TROLLER on a single beard .....

The EXSIOO can be used to interface the PS'r* to the 51)0 BUS, making available the s eemi ng Ly

infinite amount of S100 accessories ur ing the P :1* memory expansion connector.

S.,OO ADAPTER

up to three mini-floppy disks.

The EXSIOO board has a complete FLOPPY DO,3KCONTROLLER on-board a l L set up ready to control

s....OOADAPTER- $199 ASSEMBLEO TESTEO

The EXSIOO board built as a stand alone S100 BUS Adapter. (Floppy Disk Controller parts missing)

Ready to plug into any SIOO mainframe to expand the PETIf.

FLOPPY DISK PACKAGI: - S 799The EXSIOO boar-d, cable to the PET, SA400 MINI-FLOPPY DISK DRIVE, Pov er Supply, and Cabinet ..

A Disk System all ready to go, a disk system that can be later expa -rded into a full SIOO Mainframe.

S.,OOMAINFRAMEIDIS"~- S 1195-The EXSIOO board installed in a CGRS SlOO Mainframe. Complete ....Lth Sloe Pover- Supp Ly , and

a SA400 MINI-FLOPPY DISK DRIVE installed in the cabinet. This sys te n is not only a Dick C G R S MICROTECH!

System but a complete SlOO Mainframe ready to accept mere RAto1ROM,Pr lnte r , the ....orks .

• TRADEMARK OF COMMODORE

P.O. Box 368

SOUTHAMPTON, PA. 18966

(215] 757-0284

8 : 3 0

Page 33: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 33/52

A N APPLE II PROCRAM RELOCATOR

R ic k A ur ic ch io5 9 P ly m ou t h. Av e nu eMaplewood, NJ 07040

After writing an Assembly-language program, the

occasion often arises when one wishes the pro-gram to run in a different area of memory than

that for which it was originally assembled. Re-

locating a program requires changing all abso-lute references within the program, so that it

will run elsewhere in memory... this process istedious, time-consuming, and repetitive WORK.

ENTERTHE ELECTKONICBRAIN

Behold! We.have before us an electronic marvalwhich thrives on such repetitive work! Afterall, why not just write a program to relocate

others? Read on .

HERE'S WHATIT TAKES

When a Relocating Assembier creates object codeone of the items built is a Relocation Diction-

ary. This is actually a table of pointers tothe program instructions that have ab sol, ute ad-

dresses; it also contains some flags for use bya relocating loader &0 that the latter can ad-just the address references during the loadingprocess.

Unfortunately, we don't have such a luxury when

relocating most programs ... all we have is rawmachine language to work with. Our relocatorwill have to scan the subject program and find

all absol ute references which need adj ustment .

FUNCTIONALDESCRIPTIONof RELOC8

The RELOC8program will use the Apple's SWEET-16utility for all 16-bit data and address manipu-lation; use of SWEET-16 saves a lot of 6502 code

at the expense of some speed loss. In order todecipher the 6502 instructions of the subjectprogram, Apple's Disassembler is used. (Thedisassembler, by the way, turns out to be a

rather nice utility for things like this). Inorder to minimize user intervention, it was de-

cided that RELOC8 would be run as part of astandard Apple Memory-Move command. After load-ing the subject program in its "old" memory 10-~ation, one enters an Apple Move command to copyLt to the "new" memory location, followed byControl-Y (which starts RELOC8 after the Movecompletes) .

All absolute address references which lie within

the range of the subject program will be up-dated. References to addresses outside the sub-

ject program (e.g. for Monitor calls) need notbe changed.

USINGRELOC8

To r-el cca t.e a machine-language program thefollowing procedure is followed: load RELOC8

into the Apple and load the subject program intoits "old" location. Type an Apple Move command

to move t.he subject program to its "new" addressfollowed by a space and control-Y. The RELOC8

program Hill print all modified instructions andthen exi; when it's done. For example, to re-

locate a subject program from "old" location1500-1800, to "new" location 2AOO-2DOO onewould tn e the following command: '

• 2AOO<1500.1800M Yc

This is a standard "move" command, moving theprogram with the Apple Moni tor; however, wefollow t.ie "M" with a space and a control-Y so

~hat RELI)C8will be entered immediately follow-

ang the move command. 'lihen it is entered,

RELOC8 ~icks up the address ~alues from the"move" ccmmand. .

A FEWWORDSOFWARNING

There is something to watch out for while using

RELOC8. Since it scans the subject program forabsolute addresses, any data imbedded within the

program D.ay cause RELOC8to think the data is aninstruct jon . In that case, the data will be

.Dodified and RELOC8's opcode scan might get "outof sync" with the real instructions in the sub-ject prof;ram. It's best to try and keep dataseparate from instructions; if RELOC8does modi-

fy some c.ata , you'll have to fix. it before run-

~ing the relocated program.

«******~.*.****************** ** M A C H [ N E - L A N G U A G E ** P RO ' ;R A M R EL O CA TO R ** ** - - R E L O C 8 - - ** ** R I C K A U R I C C H I O 1 0 / 2 6 / 7 8 ** ** F O R TH E A P P L E - I I *

* ********.********************

** --- S o I E E T - 1 6 R E G I S T E R S

*A C EQ U 0 R O : A C C U M U L A T O R

O B EQ U 1 R 1 : 0 L D B A S E

O E EQ U 2 R 2 : 0 L D EN D

N B E Q U 3 R 3 : N E W B A S E

N E E Q U 4 R 4 : N E W E N D

R B E Q U 5 R 5 : R E L O C A T I O N B I A S

*

Page 34: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 34/52

00000000 ACL EQU 0

00000001 ACH EQU 100000002 OBL EQU 2

00000003 OBH EQU 300000004 OEL EQU 400000005 OEH EQU 500000006 NBL EQU 600000007 NBH EQU 7

00000008 NEL EQU 800000009 NEH EQU 9

••

0000F689 SWEET16 EQU X'F689' SWEET-16 INTERPRETER0000F88E INSDS2 EQU X'F88E' DISASSEMBLE WITHOUT PRINT0000F8DO INSTDSP EQU X'F8DO' DISASSEMBLE SINGLE INSTR.

•0000002F LENGTH EQU X'2F' DISASSEMBLED INSTR LENGTH0000003C AlL EQU X'3C' WORK BYTES FOR MONITOR0000003D AlH EQU X'3D'00000040 A3L EQU X'40'

00000041 A3H EQU X'41'00000044 A5L EQU X'44'

00000045 A5H EQU X'45'0000003A PCL EQU X'3A' PC LOW FOR DISASSEMBLER0000003B PCH EQU X'3B' ••TAKE A GUESS •••

• ENTRY IS VIA CONTROL-Y AFTER

• MOVING PROGRAM TO ITS NEW

• LOCATION IN MEMORY. THE

• VALUES FROM THE APPLE 'MOVE'

• COMMAND WILL BE PRESENT IN

• THE MONITOR WORK AREAS UPON

• ENTRY TO RELOC8.

•0300 ORG X'0300' ORG TO PAGE 30300 A5 40 RELOC8 LDAZ A3L MOVE OLD BASE

0302 85 02 STAZ OBL

0304 A5 41 LDAZ A3H0306 85 03 STAZ OBH

•0308 A5 3C LDAZ AlL HOVE OLD END (+1)

030A 85 04 STAZ OEL030C A5 3D LDAZ A1H

030E 85 05 STAZ OEH

•0310 A5 44 LDAZ A5L MOVE NEW BASE

0312 85 06 STAZ NBL

0314 A5 45 LDAZ A5H

0316 85 07 STAZ NBH

Page 35: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 35/52

** COMPUTE NEW END AND

* RELOCATION BIAS.

~*

0318 20 89 F6 JSR SWEET16 GO TO SWEETIE

03lB 23 LD NB

031C Bl SUB OB RELOCATION BIAS

031D 35 ST RB IS DIFFEREOCE

031E 22 LD OE

031F Bl SUB OB COMPUTE SIZE0320 A3 ADD NB ADD TO NEW BASE

0321 34 ST NE AND WE HAVE NEW END

0322 00 RTN 6502 MODE!

** SCAN THE PROGRAM FOR A 3-BYTE

* INSTRUCTION. ANY OTHERS DON'T

* HAVE TO BE RELOCATED. IF THE

* ADDRESS IS OUTSIDE THE PROGRAM,

* THEN WE CAN LEAVE IT ALONE.

* OTHERWISE, UPDATE IT BY ADDING

* THE RELOCATION BIAS.

*0323 AO 00 GETINST LDYIM 0 DUMMY INDEX

0325 Bl -06 LDAIY NBL GET OPCODE0327 20 8E F8 JSR INSDS2 GET ITS LENGTH032A A5 2F LDAZ LENGTH CHECK LENGTH032C C9 02 CMPIM 2 3 BYTES?032E DO 24 BNE NXTINST ->NOPE. SKIP IT.

** IF THE ADDRESS IS WITHIN THE

* PROGRAM, RELOCATE IT.

*0330 20 89 F6 JSR SWEET16 HI, SWEETIE!0333 E3 INR NB BUMP TO ADDRESS0334 63 LDD NB GET BOTH BYTES0335 Dl CPR OB >- OLD BASE?0336 02 2A BNC NllTI ->LOWER. NO CHANGE.0338 D2 CPR OE <- OLD END?0339 03 27 BC NXTI ->HIGHER. NO CHANGE.

** ADD RELOCATION BIAS.

*033B A5 ADD RB ADD BIAS

033C F3 DCR NB BACK UP TO033D F3 DCR NB ADDRESS AGAIN033E 73 STD NB STUFF BACK THERE

** ANNOUNCE THE CHANGE --- **

033F 23 LD NB BACK UP POINTER

0340 FO DCR AC TO OPCODE

0341 FO DCR FOR THE

0342 FO DCR DISASSEMBLER

0343 00 RTN BACK TO 6502 MODE0344 A5 00 LDAZ ACL MOVE POINTER

0346 85 3A STAZ PCL TO PCH/PCL0348 A5 01 LDAZ ACH FOR THE

034A 85 3B STAZ PCH DISASSEMBLER034C 20 DO F8 JSR INSTDSP PRINT MODIFIED INSTR.

034F 20 89 F6 JSR SWEET16 RE-ENTER SWEET16 TO

0352 01 OE BR NXTI CONTINUE •••

c e ~~~~® 8 : 3 3J . . .

Page 36: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 36/52

•• WE'VE GOT· A 1 OR 2 BYTE

• INSTRUCTION. UPDATE THE

• NB POINTER TO THE NEXT

• INSTRUCTION.

•0354 18 NXTINST CLC If '355 69 01 ADCIM 1 UPDATE LENGTH: 1/2/30357 85 00 STAZ ACL GET LENGTH0359 A9 00 LDAIM 0 HI-O035B 85 01 STAZ ACH035D 20 89 F6 JSR SWEET16 BACK TO SWEET16

0360 A3 ADD NB BUMP IT0361 33 ST NB PUT BACK THERE

•• CHECK TO SEE IF WE'RE DONE

• WITH THE PROGRAM YET.

•0362 23 NXTI LD NB GET CURRENT ADDRESS0363 D4 CPR NE OVER THE END?0364 03 04 BC DONE ->YUP. ALL DONE!0366 00 RTN ->NO. BACK TO THE0367 B8 CLV 6502 MODE FOR0368 50 B9 BVC GETINST MORE WORK!

•• ALL DONE. EXIT TO MONITOR.

•036A 00 DONE RTN 6502 MODE, PLEASE!

036B 60 RTS BACK TO MONITOR!••

03F8 ORG X'03F8' CONTROL-Y ENTRY03F8 4C 00 03 JMP RELOC8 ROLL STONE, GATHER MOSS .••

•END

A D VER TI S I N G I N "I [R D

MICRO is currently printing 1 0 , 0 0 0 copies fordistribution. 4 0 0 0+ will go immediately to

subscribers and dealers. The remainder will goto new subscribers and to replenish dealer stockthroughout the coming year - so you get a lot ofcoverage for your dollar, i n t o a readership thatis eager to know about 6 5 0 2 o ri en te d p ro du ct s.

DEADLINES: Issue - FEB MARCH APRIL

A d R es er va ti on : Jan 2

Jan 8

Jan 2 9 Feb 2 6

Feb 5 Mar 5d Copy:

The rates are very reasonable for the coverage:

Quarter PageHalf Page

(3 3/4 x 5)(7 1 /2 x 5 )(3 3/4 x 1 0 )

Full Page (7 1/ 2 x 1 0 ) $ 2 0 0 . 00

1 0 % discount on prevailing rate fors ix c on sec ut iv e i ns ert io ns .

. $ 7 5 . 0 0$ 1 2 5 . 0 0

Send Ad Copy to:

MICRO, P.O. Box 3, So. Chelmsford, MA 0 1 8 2 4

or call for i n f o or Ad reservation:

6 1 7 / 2 5 6 - 3 6 4 9

6 1 7 / 2 5 6 - 5 5 1 5

"COMPUTER CANOPY"DUST COVERS

POSTPAIDIN U.S.A.

.Ideal for the home or office• Attractive, heavy upholstery vinyl

• Protects against dust, dirt, spills

• Soft, Textured, Walnut color Delivery:Stock to 3Weeks

Covers for

$14.95$19.95

APPLE II

PET, ADM-3, H-9

M/C, VISA, M.O., C.O.D. TX residents add 5%tax

Add $1 for C.O,D,

Digital Dynamics, Inc.

DeptM

Post Office Box 27243

San Antonio, TX 78227512) 231·201 2

New24 HourOrder Line

Page 37: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 37/52

S Y M - I TAPE D I RECTO R Y

John Gieryic2041 138th Avenue N.W.

Andover, M N 55303

The SYM-1' s high speed tape format enables re,-

cording and loading of 1K of RAM in just a fell

seconds (185 bytes per second). This quick and

easy means of saving and restoring memory will

have you SYM-1 owners quickly wrapped up in

tape. With the possibility of 254 ID's (01 thru

FE) you may forget which ID' s you've alreadyused or where you stored a particular Ident irf -er. Maintaining records sometimes seems second-

ary when you are eagerly pursuing an idea.

This program will refresh your memory quickly.

When DIRECTORY "finds" a tape record it will ex-tract the ID, startind address and ending ad··

dress + 1. This information will be paraded

across the LED's in much the same format usedwhen you saved the data on tape. The program

will then continue its search for more records.

The process is terminated by pressing the RST

key.

The first part of the program (locations 20~j

thru 232) is taken from the monitor routine

LOADT. Since this is not a subroutine (ca.l Labl e

by a JSR) , I had to copy the necessary LogLc

into my program. The last part of the program

makes extensive use of subroutine calls to two

of my own subroutines and several of the moni-

tor's. Any newcomers to programming should take

time to trace througn this in order to see the

power of subroutines.

SYMTAPE DIRECTORY

High Speed Format Only: START: GO200 CR

TAPE FORMAT:

256 Sync Char * ID SAL SAH EAL+1 EAH+1

DATA I CKL CKH EOT EOT

This program will extract the tape identifier

(ID), the starting address (SAL and SAH) , the

ending address (EAL and EAH) and will "parade"

this information on the LED's. The program willthen go back to the tape and search for the next

record. The program is terminated by pressing

the RST key.

SYMTAPE DIRECTORY

SYMREFERENCES

ACCESSil $8B86

0 START II $8DB6

SYNC Ii $8D82

RDCHTX If $8DDE

RDBYTX Ii $8E28

RDBYTHI $8DE2

OUTDSPI, $89C1

NIBASC • $8309SCAND • $890B

DISBUF • $A641

DDRIN * $A002

VIAACR * $AOOB

LATCHL * $A004

MODE * $OOFD

ORG $0000

0000 00 ID = $00 TAPE ID LOCATION

0001 00 SAL = $00

0002 00 SAH = $00

0003 00 EAL = $00

0004 00 EAH = $00

0005 00 TEMP = $000006 00 LCNT = $00 LOWLOOPCOUNTER

0007 00 HCNT = $00 HIGH LOOPCOUNT

8:35

Page 38: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 38/52

0200 OFtG $0200 PR OG RA M O RI GI N

0200 20 86 8B BEGIN JSR ACCESS ENABLE SYM PROTECTED MEMORY

0203 AO 80 LIlYIM $80 SET HIGH SPEED MODE

0205 20 B6 80 JSR START INIT TA PE ROUTINES0208 AD 02 AO LIlA DORIN020B 29 BF AUDIM $BF

0200 80 02 A O SU DORIN0210 A9 00 LDAIM $0 0

0212 80 OB AO SU VIAACR

0215 A9 1F LDAIM $1F SET UP TIMER

0217 80 04 AO SU LATCHL

021A 20 82 80 FIND JSR SYNC SEARCH TAPE FOR RECORD

0210 20 DE 80 READ JSR RDCHTX GET CHARACTER

0220 C9 2A C 1~ PI M , . COMPARE FOR ASTERISK

0222 FO 06 BgQ TEST HATCH

0224 C9 16 CJ~PIM $16 TEST SYNC CHAR0226 DO F2 Bl~E FIND

0228 FO F3 BI&Q READ

022A A5 FD TEST LDA MODE

022C 29 BF AJtfDIM$BF

022E 85 FD S'!A MODE

0230 20 28 8E JSR RDBYTX GET 10

0233 85 00 S'!A 10 SAVE 100235 20 28 8E JSR RDBYTX GET SAL FROM TAPE0238 85 01 SrA SAL SAVE

023A 20 28 8E JSR RDBYTX GET SAH FROM TAPE0230 85 02 Sf A SAH SAVE

023F 20 E2 80 JSR RDBYTH GET EAL0242 85 03 STA EAL SAVE0244 20 E2 80 JSR RDBYTH GET EAH

0247 85 04 STA EAH SAVE

0249 A9 00 LDAIM $0 0 CLEAR OUT DISPLAY BUFFER024B 80 41 A6 STA DISBUF

024E 80 4 2 A 6 STA DISBUF +01

0251 80 43' A 6 STA DISBUF +02

0254 80 44 A6 STA DISBUF +03

025780 45 A6 STA DISBUF

+04

025A A5 00 LOA 10 TAPE 10025C 20 96 02 JSR DISPL SEND IT TO DISPLAY

025F A9 20 LDAIM ,- ASCII DASH0261 20 C1 89 JSR OUTDSP SEND IT TO DISPLAY0264 20 B5 02 JSR DELAY PAUSE

0267 A5 02 LOA SAH START ADDRESS HIGH

0269 20 96 02 JSR DISPL SEND TO DISPLAY

026C A 5 01 LOA SAL START ADDRESS LOW

026E 20 96 02 JSR DISPL SEND TO DISPLAY

0271 A9 20 LDAIH ,- DASH

0273 20 Cl 89 JSR OUTDSP DISPLAY IT

0276 20 B5 02 JSR DELAY PAUSE

0279 A5 04 LOA EA H END ADDRESS HIGH

027B 20 96 02 JSR DISPL

027E A5 03 LOA EAL END ADDRESS LOW

0280 20 96 02 JrSR DISPL:1283 A9 00 LDAIM $0 0 ADD 2 TRAILING BLANKS

0285 20 C1 39 .lSR OUTDSP

0288 20 B5 02 ~rSR DELAY

028B A9 00 LDAIM $0 0

0280 20 C1 89 .lSH OUTDSP

::>29020 B5 02 ~ISH DELAY

0293 4C 00 02 .IMP BEGIN GO TO NEXT RECORD ON TAPE

Page 39: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 39/52

, . . . . ,<E- <<o

> <~<.. JZo . .I - I C I)II I 1-1~O

.. J0. .CI )1-1o

( V ) 0 - . NC O C O 0

("Ij c : T \ NCO (0 0

1 0 < < < < 0 - . 0 0 0 1 0 0 - . 0 c: J 00C O\o\O\o\oN N N N<N N N N\o

\0 C O 0 - . < I I I U W ~ . . , . t - o - . I I II I I ~ ~

0 - . '" '" '" '" '" ' " < < < < < '0: I I I I I IN N N N N N N N N N N N N N N0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

tm tm tm

AIM KIM SYM OWNERS USE YOUR OWN BUS

++++++++++++++++++++++++++++++++++++++++++++++++++++

+ PREMIUM 8K RAM AT BELOW S - 100 PRICES +

++++++++++++++++++++++++++++++++++++++++++++++++++++

$ 169 !

•••••••••••• * • • * .HDE 8K STATIC RAM•••••••••••• ** •• *

::::::: :.:::::

3 for $ 465 !

:::::::::::: :

HUDSON DIGITAL ELECTRONICS (HDE) DM 8l6-M8-8K

Fully assembled: industrial/commercial quality 100

hour high temperature burn-in ; 90 day parts/labor

warranty : low power : KIM bus compatible pin for pin :

Super quality and reliability at below S-lOO prices

(COMMERCIALLY rated S-lOO 8K boards cost 25-75% more).

\fuen you expand your system, expand with the bus opti-

mized for 8 bit CPU's, the Commodore/MOS 22/44 pin KIM

bus, now supported by Synertek, MTU, Rockwell, Problem

Solver Systems, HDE, the Computerist, RNB, and others!

KIM-l COMPUTER $ 179 = = = = Krr1-4 MOTHERBOARD $ 119

HDE File Oriented Disk Operating System (FDOS) for KIM

& other 6502 systems: Powerful editor/disk commands :

two pass assembler & text editor compatible with ARESCO

source files: KIM bus compatible interface board:

simple, powerful disk interface uses parallel ports

Full size floppy disks - NO speed limitation whatsoever

in data transfer rate - 6502 handles transfer at maxi-

mum speed with well over 100% safety margin. Singledensity IBM format for high reliability. The best 6502

developement system available. (45 days delivery)

single disk $ 1995 dual disks $ 2750

Me/Visa, COD's, check, orders - add 5% for shipping.

Free shipping on orders prepaid with cashier's check!

Commodore

Plainsman Micro Systems P. O. Box 1712

- Auburn, Alabama 36830 Phone (205) 745 - 7735 -

OSIDE Compucolor Altos

CI )0-00HW~ . . J CI )W ~0 . .\0 W

E- <<W Z

: I : : 0~E -< 0 ~0 U > < W~W < E- <

E- < 0 . . . . J Z0< 0 0 .. 0ZZ 0 CI ) 0<H

.. J1-1 U

~S 0 > <E- < < E- <

.. J 1-1 :E . .J CI ). . J . . J Z > < W W. . J H H CI ) 0 E- <<UO

E- < 0. . J E-< E-< ZE- <E- <E- <E- < E -<

> < > < . . J ~ g a a C 3 a ~ a a b ' ~< HW.. J . . J ;3 : 0 ~ . . J : I : : C I). . J ~ : I : : : I : : ~ ~W W ~0 0 WO :E :E

Z 1-1 1-1W ~ HZ ; 3 ~ ~ ~ ~ g g ~ ; 3 ~ g g ~C I) E-<I - I1-1

. . . ,0 . . J C I)C I)""I - I I l l I - I . . J U I l l ~

E- < OW0 a:::E0 > < 1-1 > <~ a:: C l)E-< < E -<I I I E -< H .. J 1-10 Z : I : : r . . . W <CI ) W & 0 0 0 ;3 :

'"OO\Ot - I l l\Oo - . t - t -(V)~

O O O O O ~ O O O ~"' 1 0 1 0 0\00\01 0", 0 0C I l C O C O N W O W<U O\O

1 0 t - ' " I I I W O N ~ \OI C O <I I I I I II I I I I I I I IU U U U , U UN N N N N N N N N N N0 0 0 0 0 0 0 0 0 0 0

-THE BEST OF MICRO VOLUME 1-

Even though we had extra c opies of MIC RO printedwe could not keep u p with the demand fo r backissues. We have run out o f all back issues andall copies of "All of MICRO Volume 1". Since a

lot of people who are just finding out aboutMICRO or are just qet tinq int.o the 6 502 w?rldstill want the Inf'o rmat I cn whICh was cont aine din the first year .of MICRO, we have decided toprint "The BEST of MICRO Volume 1".

This w ill contain most of the articles but noneof the adver tising. A few articles which weretopical and are now out-of-date wi ll be dropp~dand all known microbes will be corrected back Inthe original articles. The book will beorganized by subject. Aside from these minorchanges, the content will be ide ntical to thatof MICRO numbers 1 through 6. If you alreadyhave them, y ou will not profit by getting t~enew edition. If you do not have them, then thISwill be the only way to get the information.

"The BEST of MICRO Volum e 1" is available now.176 pages plus five reference c ards, soft cov er.Price: $6.00 at your dealer or by surface mailanywhere in the world - $7.00.

Send your Check or Money Order to:

The BEST of MICROP.O. Box 3

So. Chelmsford, MA 0 1824

8:37

Page 40: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 40/52

In performance. In quality. In availability. OEMs, educa-

tors, engineers, hobbyists, students, industrial users:

Our Versatile Interface Module, SYM-l, is a fully-assembled, tested and warranted microcomputer board

that's a true Single-board computer, complete with

keyboard and display. All you do is provide a +5Vpower supply and SYM-l gives you the rest-and that

includes fast delivery and superior quality.

Key features include:

• Hardware compatibility with KIM-l (MOS Technol-

ogy) products.

• Standard interfaces include audio cassette with

remote control; both 8 bytes/second (KIM) and 185

bytes/second (SYM-l) cassette formats; 1TY and

RS232; system expansion bus; TV/KB expansion

board interface; four I/O buffers; and an oscilloscope

Single-line display.

To place your order now, contact your local area distributor or dealer.

OEMDistributors Techruco

Kierulff Electronics General Radio

Sterling Electronics (Seattle only) Western Microtechnoloqy

Zeus Components Future Electronics

Century/Bell Alliance Electronics

lionex

Hallmark

Intermark Electronics

Quality Components

Arrow Electronics

Personal Computer Dealers

Newman Computer Exchange

An" Arbor. Michigan

• 28 double-function keypad with audio response.

• 4K byte ROM resident SUPERMON monitor includ

ing over 30 standard monitor functions and userexpandable.

• Three ROM/EPROM expansion sockets for up to

24K bytes total program size.

• lK bytes 2114 static RAM, expandable to 4K bytes

on-board and more off-board.

• 50 I/O lines expandable to 70.

• Single +5V power requirements.• Priced attractively in single unit quantities; available

without keyboard/display, with OEM discounts for

larger quantities.

§

Synertek SystemsCOrporation.150·160 S Wolfe Road, Sunnyvale, California 94086

(408) 988-5690.

Technico

Columbia, Maryland

Computerland

Mayfield Heights, Ohio

RNB Enterprises

King of Prussia, Pennsylvania

Computer Shop

Cambridge, Massachusetts

Computer Cash

Anchorage, Alaska

Ancrona

Culver City, California

General Radio

Camden, New Jersey

Advanced Computer Product

Santa Ana, California

Computer Components

Van Nuys, California

Alltronics

San Jose, California

Page 41: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 41/52

I N S I D[ PET B A S I C

Jim Butterfield14 Brooklyn AvenueToronto, OntarioCanada M4M2X5

PET BASIC is pretty good: fast, powerful, and

flexible. Most of the time you can write pro.grams without ever needing to know what's in.side. But there are a few handy things that you

can't do without "dissec ting" BASIC. Let's taka couple of examples. Suppose you want to look

through a big program for some reason. You

might have a small bug: say a variable, X4,ends up with a wrong value, and you want to findout why. You could list the program, a screen-ful at a time, looking for every time X4 isused; bu eye fatigue starts to set in. Wouldn't

it be nice to have a utility program to do thescanning for you?

Program FIND

Program FIND will do the job for you. To writesuch a program, though, we need to know how

BASIC is built. The first line of your BASICprogram starts at address 1025 (or 0401 hexadec.

imal). That's where we must start our search.Each BASIC line will have the following format:

The first two locations contain a pointer to thenext line of BASIC; or if they contain zeros,

there is no next line and' this is the end ofyour program. The next two locations containthe BASIC line number. After that (starting at

the fifth location) we have the BASIC line it-self. It's mostly in ASCII code, but keywordssuch as FOR, PRINT, or SQRare stored as specialcodes known as "tokens". At the end of the line

we'll find the value zero.

Howdo we use this information to scan BASIC fora given expression? First, we set our address,

A, to 1025; that's where BASIC starts. Next, weskip over the first four bytes (pointer and line

number) and search from A+4 to the end of theBASIC line. We'll recognize the end-of -line bythe zero at the end. If we find the expressionwe want, we can output the line number by ob-

taining it from A+2 and A+3. It's in binary, sowe use the expression 256*PEEK(A+3)+PEEK(A+2) -printing this value will print the line number.

When we reach the end of the BASIC line, we mustgo to the next line, of course. It will beright behind the zero that marked the end of our

previous line; or we can use the pointer to jump

ahead with A=256*PEEK(A+1)+PEEK(A). If thepointer is zero, we know that we have come tothe end of the BASICprogram and can stop.

Program RESEQUENCE

Let's move on to something more complicated.

Suppose you want to renumber your BASIC program.Since we know how the line numbers are stored inBASIC, it seems easy; we'll just change them tothe new values. There is a hitch, however.

What happens if your program contains a GOTO300statement - and now line 300 is renumbered so

that it becomes line 380? Problems - that'swhat happens.

What we must do is search out all the GOTOsand

GOSUBs, including those included in ON. state-ments, and be ready to change the old line num-bers to new ones. One way of doing this is to

build a table of "old" addresses, match them

with the "new" line numbers, and then correct

them after renumbering has been accomplished.To help make things more complicated, we have

two different ways of using the THENstatement.If we have a line such as IF J=12 THEN Y=2,

there is no line number reference to correct.On the other hand, if we have IF J=12 THEN530,

we must be read y to fix up 530, replacing itwith a new line number if necessary.

More difficulties: if we have a statement whichsays, for example, GOTO5, and with the renum-

bering we want to change it to GOTO 100, wewon't have space I And making space isn't that

easy: you may recall that the lines of BASICare "chained" together with pointers; if we

lengthen a BASIC line, all the pointers willneed to be fixed upI This last problem is too

tough to resolve in a simple manner - let'ssidestep it by printing a warning notice if it

should occur.

How do we approach this job? We separate the

program in to three phases. Phase 1 looksthrough the program for line number references

and builds a table. Phase 2 does the actual re-numbering (the easiest part of the whole job).

Phase 3 looks through the program again and cor-rects the line number references. How do welook through the program? The same way as withprogram FIND. We're looking for three keywords:

GOTO (token 137), GOSUB(141) and THEN (167).

Sometimes we'll also allow a comma (44) so that

statements such as ONX GOTO100,200,300 will beallowed. You'll see this testing for tokens online 60220 of RESEQUENCE.

If we find one of these keywords, we must con-

vert the following ASCII numbers into a value Vcorresponding to the line number. During Phase

1, we build these line numbers into a table at6009!). Phase 2 is a snap. In lines 60030-60040we change the line number and then check to see

if the old number was in table V~. IF so, wefill in the cross-reference. Phase 3 is thelong one. Wemust repeat the search of Phase 1.Then, in 60110 to 60150 we must build the newline number (in ASCII) and insert it - with ap-

propriate tests and warning notices.

Making ThemWork

Both FIND and RESEQUENCEre written in BASIC.

That means that they will have to reside inPET's memory along with the programs they aredealing with. RESEQUENCEs constructed so thatit doesn't renumber itself, of course; and FIND

will examine itself, reporting any occurences ofthe search string. Another problem arises, how-ever: how can you get two programs into the PETat the same time? We need to load ei ther FIND

or RESEQUENCEogether with the program that isbeing processed. A normal PET load wipes out

the old program when a new one is loaded. You

could alsays add FIND or RESEQUENCEy entering

it at the keyboard; this would add the utili ty

program to the existing program in memory. Butsuch a procedure is lengthy and it would be easyfor errors to creep in. There must be a betterway. One good way is to use the screen as a"holding buffer". You could load program FIND,and list it onto the screen. Then load the pro-

gram you wand to search. FINDwill be wiped outof memory, but it's still on the screen - so you

Page 42: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 42/52

can m ov e th e c ur sor ba ck to dis pl ay ed li ne 9 000 ,and hi t RETUR N ei ght t im es. F IN D w il l be lr e-s to re d to mem or y, w her e i t n ow s har es sp ac e w .l tht he pr -o gra m to b e s ca nn ed. Th is do es n't w or kt oo we ll wi th a l ong er p ro gra m li ke RESEQ UEN CE,h ow ev er. Th e pro gr am i s t oo bi g t o f it on thes cr ee n - m uc h to o bi g. Th er e m ust b e an ot here ve n b et ter wa y. L ar ry Tess le r of S ph in x o pe ned

t he doo r w ith hi s pr ogr am U NL IST, w hi ch ma det rue pr og ram mer gi ng p oss ib le fo r t he f ir stt ime . Si nc e thi s bre ak th rou gh , an e ve n bet te rme th od ha s be en d ev ise d b y Br ad Tem ple to n o fToronto.

UN LI ST - A Pr oc edu re fo r Mer gi ng Pro gr ams

Her e' s how i t wo rk s. B e s ure t o fo ll ow t he i n-s tr uc tio ns ca re ful ly an d ex ac tly . Pre pa re t hep ro gr ams yo u wi ll w ant to me rge i n t he fo ll owi ngm ann er . Lo ad th e pr og ra m. Plac e a bl ank ta pei nt o y ou r c as set te u ni t. N ow t yp e:

O PEN 1, 1, 1: CMD l: LIS T

Wh en th e t ap e s to pe s, t yp e:

P RI N T# 1 :C L OS E 1

an d y ou r mer ge t pa e is re ady . At a la te r t~ De,whe n y ou wa nt t o m er ge th e pro gr am , h ere 's w ha tt o d o. F ir st , mou nt t he me rg e tap e yo u pr e' V' i-o us ly pr ep ar ed an d t yp e OPEN 1 . N ow c lea r t he.s cre en , gi ve ex ac tl y fo ur c urs or do wn s, a nd ty pet he fo ll owi ng , bu t D O NO HIT RETU RN :

P O K E6 1 1 , l : PO K E5 2 5 , 1 : PO K E5 2 7 ,1 3 : ?" h "

(h is cu rs or h ome; sho ws a s r eve rs e S ). D on 'th it ret ur n: pre ss cu rso r ho me a nd gi ve s ix (6)

cu rs or do wn s. NOW t yp e exa ct ly th e sam e l in e(tw o li nes b el ow t he fi rs t li ne) a nd th en hi tRETUR N. Th e tap e wi ll mo re; th e me rg e wi ll t ak epl ac e; and fi na ll y, a n er ro r n ot ice w il l pr in tb et w ee n th e t wo l ine s. Sto p th e t ape if i t ' sst il l goi ng , an d th en ty pe CL OSE1. Mir acu lo us lyth e m erg e ha s ta ke n pl ac e!

Ho w do es it w ork ? It' s a lit tl e c om ple x; but i fI hi nt ed th at PO KE 61 1,1 t hr ans fe rs c on tro l a.w ayf rom t he PET's ke yb oa rd to th e ca ss ett e t ape ,y ou 'd h av e pa rt of th e s to ry. A nd if I men ti on -e d t hat p ok in g 5 25 an d 5 27 s imu la te s a RET'U RNk ey be in g hi t , y ou' d hav e an ot her par t. But ,y ou don 't nee d t o k no w w ha t m ake s it w or k i no rde r t o u se it. Us e i t; b ene fi t fr om it; a nde njo y it .

t he f ol lo wi ng ,bUt DO N OT HIT RETU RN :

FI ND for PET

N ee d t o se ar ch a pr og ra m for an ex pre ss , a v ar -ia bl e, or a ke yw or d? S lip pr og ram FI ND in b e-h in d y ou r p ro gra m (i t' s no t ve ry lo ng) - th eni ns ert a li ne 1 to sa y w ha t t o s ea rc h f or . ..an d th e jo b' s d one . Eve ry lin e i n me mo ry wh ichco nt ai ns t he sam e ex pre ss io n as l ine 1 w ill b ere por te d. Th is inc lu de s li ne 1 it sel f, ofco ur se , and any l in es i n p ro gr am FI ND .. . aswe ll a s .t he p ro gra m y ou 're s ea rch in g. Thepr ogr am . is l is ted h er e s pa ced o ut f or rea d-ab il it y - ~l os e i n t he spa ce s wh en y ou i npu t t os av e s pa ce .

9 000 A=1 025 : X=PEEK(102 9) FO R J=l TO lE3 FO RK=A+4 TO A+8 3

g OOl P=PEEK(K) : IF P=X THEN G OS UB 900 5g 002 IF P<)O THEN NEXT K9 003 A =2 56' PEEK (A+l)+PEEK (A ) : I F A)O TH EN

NEXT J9 004 STOP9 005 FO R L=l TO 8 0 : Y=PEEK(10 29+L) : F I Y=O

T HE N? 2 56 'PE EK (A +3 )+P EEK (A +2 ); : R ETU RN9 00 6 I F Y=PEEK(K+L ) THEN NEXT L9 00 7 R ET UR N

Exam pl e: t o f in d al l FOR s ta tem en ts in a pr o-gra m; i ns er t FI ND (a bov e) an d t he n i ns er t l ine 1

1 FO R

N ow in vok e FIN D wi th RU N g OOO . The pr og ra m wi llpr in t 1 f oll ow ed by a ny pr og ram l in es co nt ai nin gF OR f ol low ed by 90 00 s o o o 9 00 5 (90 00 p rin tstw ic e bec au se it c ont ai ns two F OR s).

FO R i s a key wo rd , and do esn 't sto re as t hre ese pa ra te ch ara ct er s, so y ou wo ul dn' t f ind itif you s ea rc hed f or ch ar ac ter s F O. Th is ca n b eh a n d y : if yo u wer e lo oki ng fo r v ar iab le F you

w ou ld n't g et a ll the F OR s pri nt ed .

Mod if ica ti on s: if yo u sque eze d P=O jus t ahe ado f RETU RN on lin e 9 00 5 (i t's a ti gh t sque ez e) al ine n umb er w oul d pr in t o nl y on ce eve n whe n i th ad m ul tip le m at ch es; yo u m igh t or mi gh t notw ant th is fe at ur e .

IMPORTA NT: D on 't f or get to wi pe out lin e 1 andpr og ra m F IND w he n y ou 're fi ni sh ed wi th the m.

R ES EQU EN CE fo r PET

60 000 END60 010 TO= : D IM V%(1 00 ),W %(10 0) : GOS UB 601 60

F OR R=l TO lE3 : GOS UB 60 21060 020 I F G THEN G OS UB 60 090 : NEXT R60 03 0 GO SUB 6 01 60 : FO R R=l TO lE3 N=INT

(Ml256) : P OK E A - l, M- N '2 5 6600 40 POKE A ,N : V=L : GO SU B 600 70 W%(J )=M

G OS UB 6 01 70 : I F G THEN NEXT R600 50 G OS UB 6 01 60 : FO R n=l TO lE3 : GO SUB 60 21 0

: IF G THEN GO SU B 60 11 0 : NEXT H60 060 ?"'END '" : END60 070 J=O : I F T<)O THEN FO R J=l TO T : I F V%(J)

<) V THEN NEXT J : J = 06 00 80 R ETU RN600 90 IF V<>O THEN G OS UB 600 70 : IF J=O THEN T=

T+l : V %(T)=V6 01 00 R ETU RN601 10 G OS UB 60 07 0 : I F J=O THEN RETUR N601 20 W=W %(J ) ; IF W=O THEN ?"GO "i"L"iL i"?":

RETURN601 30 FO R D=A TO 8+1 STEP-1 : X=INT(W /l 0) :

Y=W- l0 'X+48 : I F W=O THEN Y=3 260 140 PO KE O, Y : W=X : NEXT 0 : I F W=O THEN

RETURN6 01 50 ? "I NS ER T" ;W %( J) ;" L" ;L : R ET UR N6 01 60 F=10 25 : M=9 0601 70 A=F : M:M+l06 01 80 F =P EE K( A) +P EE K( A+ 1) '2 56 : L =P EE K( A+ 2) +

PEEK(A+3)'2 56 : A=~+3 : G=L<6E46 01 g0 R ETU RN602 00 s=o60 210 V=O : A=A+l : B=A : C=PEEK(A) : I F C: :O

THEN GO SU B 6 017 0 : ON G+2 GOTJ 6 02 10, 60 1g 0602 20 If C<>1 31 AND C<>141 AN D C <>1 57 AND C<>S

GO TO 6 02 00

Page 43: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 43/52

6 023 0 A=A+1 : C=PEEK(A )- 48 : IF C=- 16 GOTO 6 02 306 024 0 I F c>=o AND C<9 THEN V=V·l 0+C : GOTO 602 3060 25 0 8+4 4 : A=A-1 : RETU RN

RESEQUENCE ca n si t qui et ly beh in d y our pro gr am .W he n you sa y RU N 60 01 0, yo ur pro gr am is r en um -be re d. RESEQ UENCE gi ves e rr or no ti ces if :

A . a GOTO o r GOS UB s ta tem en t wan ts to go t oa non -e xi sta nt l ine ;

B . t he re isn 't e nou gh ro om f or a n ew (hi ghe r)l in e n um be r.

I n b ot h cas es you 'r e gi ven t he (ne w) l in e nu mbe rwhe re t hi s ha ppe ns . RESEQUENCE do es n' t ru n fa st(a ll ow ab ou t a se co nd pe r li ne , mo re fo r l arg ep ro gr ams ), bu t i t's d ep end ab le an d ve ry u sef ul .

Prog ra m com me nt s: L in e 60 00 st ops t he us er pr o-gra m if i t ge ts her e. L ine s 6 00 10 -60 02 0 ex tr acta ll GOTO, GO SU B, an d THEN re fe ren ce s a nd bu il dt hem int o a ta ble . L ine s 60 03 0- 600 40 re num be ra ll li ne s, a nd cr oss -r ef ere nc es th e t ab le ifnee de d. Li ne 60 05 0 u pd ate s all li ne r ef ere nc es .

S ubr ou ti nes : 6 007 0 lo oks fo r an e nt ry in t hel ine num be r t abl e. 6 00 90 Inser-t.s a ne w en tr yi nto th e t abl e. 6 01 10 re vi ses a lin e n um be rr efe re nc e. 6 01 60 s ta rt s a n ew s ca n' o f th e u serp rog ra m; 60 17 0 con ti nu es t he s can w it h th e n ex t

l in e. 60 21 0 s ca ns th e us er pr og ram fo r G OTO s,etc. i va lu e S is us ed t o a cco mo da te ON A GOTO• .• t yp e s it ua ti on s.

AN APPLE II PACE 1 MAP

M . R . C o n n o l l y J r .5 0 0 9 R ic k\~ oo d C t . N WH u n t s v i l l e , A L 3 5 8 1 0

I n the Ap pl e I I, th e on- sc re en te xt i s st ore d inl oc at ion s $ 40 0 t hr ou gh $ 7F F. Tr yin g to de te r-m ine ju st wh er e a p ar tic ul ar sp ot res id es i nme mo ry i sn 't ea sy . Th e p ag e li ne s ar e st or edne ith e~ c on sec ut iv ely n or seque nt ial ly . TheAPPLE p age 1 m ap s how s in he x a nd d ec ima l th es ta rti ng an d en di ng lo cat io ns of e ac h lin e ont he scr ee n. An y g ive n li ne is s equ en ti al f ro ms pa ce ' thr ou gh s pa ce 4 0; e g, t he 2 0t h po si ti onof a ny lin e is equa l to th e be gi nn ing lo ca ti on+1 9 d eci ma l o r 1 4 hex .

The va l ue of t he p ag e m ap be co mes ap par en t wh enu se d wi th a li st ing of t he int er pr eta ti on of

num be rs s to red in t he m ap . A ny n orm al , i nve rs e,o r fl ash in g ch ara ct er , or wh it e blo ck , bl ac kb lo ck, o r cur so r b lo ck ma y b e po si ti one d me re lyby p ok ing th e co rr ect va lu e in th e lo ca ti onst or in g the pa ge po si tio n yo u r equ ir e.

Y ou m igh t p as s thi s of f as ju st "n ice t o kn ow "in fo rm ati on , b ut i t is v er y u sef ul if, fo r in -s ta nce , y ou ar e t ryi ng t o ma ke an im pr ess iv et it le pa ge fo r a pr og ram y ou' ve s pe nt we ekswr iti ng . R un t he f ol low in g sh or t p rog ra m, t he ntr y to du pl ica te it wi th out u sin g t he pa ge m apand the ch ar act er c har t. It i sn 't ea sy !

10 CAL L -9 36: FO R I = 1 20 5 TO 1 21 7: PO KE I ,32 : POKE I+ 51 2, 32 : NEXT I

20 FOR I = 13 33 TO 15 89 STEP 12 8: PO KE I ,32 : POKE 1+ 1 2,3 2: NEXT I3 0 PO KE 14 63, 14 1: POKE 14 65 ,9: PO KE 1 467 ,6 7: PO KE 14 69 ,1 8: POKE 14 71, 20 7

40 GOT a 40

M A P O F L I N E A N D S P A C E L O C A T I O N S F O R T E X T P A G E 1 , A P P L E I I C ( ) ~ 1 P I I T E R

L O C A T I O NS 7 8 0 - 7 A 7 1 9 2 0 - 1 9 5 9

L I N E H E X D E C I M A L 9 4 2 8 - 4 4 F 1 0 6 4 - 1 1 0 3

1 4 0 0 - 4 2 7 1 0 2 4 - 1 0 6 3 1 0 4 A 8 - 4 C F 1 1 9 2 - 1 2 3 12 4 8 0 - 4 A 7 1 1 5 2 - 1 1 9 1 11 5 2 8 - 5 4 F 1 3 2 0 - 1 3 5 9

3 5 0 0 - 5 2 7 . 1 2 8 0 - 1 3 1 9 1 2 5 A 8 - S C F 1 4 4 8 - 1 4 8 7

4 S S O - S A 7 1 4 0 8 - 1 4 4 7 1 3 6 2 8 - 6 4 F 1 5 7 6 - 1 6 1 5

5 6 0 0 - 6 2 7 1 5 3 6 - 1 5 7 5 1 4 6 A S - 6 C F 1 7 0 4 - 1 7 4 3

6 6 S 0 - 6 A 7 1 6 6 4 - 1 7 0 3 1 5 7 2 8 - 7 4 F 1 8 3 2 - 1 8 7 1

7 7 0 0 - 7 2 7 1 7 9 2 - 1 8 3 1 1 6 7 A 8 - i c F 1 9 6 0 - 1 9 9 9. _

~~~[;l~~ l,:,~

Page 44: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 44/52

1 7 4 5 0 - 4 7 7 1 1 0 4 - 1 1 4 3

1 8 4 0 0 - 4 F 7 1 2 3 2 - 1 2 7 1

1 9 5 5 0 - 5 7 7 1 3 6 0 - 1 3 9 9

2 0 5 D O - 5 F 7 1 4 8 8 - 1 5 2 7

2 1 6 5 0 - 6 7 7 1 6 1 6 - 1 6 5 5

2 2 6 D O - 6 F 7 1 7 4 4 - 1 7 8 3

2 3 7 5 0 - 7 7 7 1 8 7 2 - 1 9 1 1

2 4 7 D O - 7 F 7 2 0 0 0 - 2 0 3 9

N o t u s e d f o r o n- s c re e n d i s p l a y : 4 7 8 -4 7 F ; 4 F 8 -4 F F ; 5 7 8 -5 7 F ; 5 F 8 -5 F F ; 6 7 8 -6 7 F ;

6 F 8 -6 F F ; 7 7 8 -7 7 F ; 7 F 8 -7 F F

M A C H I N E I N T E R PR E T A T I O N O F V A L UE S S T O R E D I N $ 4 9 19 1. 7 F FA PP LE I I C O M PU T E R

F I G U R E N O R M A L I N V E R S E F L A S H F I G U R E N O R M A L I N V E R S E F L A S H

@ 1 2 8 . 1 9 2 0 6 4 1 6 1 . 2 2 5 3 3 9 7

A 1 2 9 . 1 9 3 1 6 5II 1 6 2 . 2 2 6 3 4 9 8

B 1 3 0 . 1 9 4 2 6 6 # 1 6 3 . 2 2 7 3 5 9 9

C 1 3 1 . 1 9 5 3 6 7 $ 1 6 4 . 2 2 8 3 6 1 0 00 1 3 2 . 1 9 6 4 6 8 % 1 6 5 . 2 2 9 3 7 1 0 1

E 1 3 3 . 1 9 7 5 6 9 & 1 6 6 . 2 3 0 3 8 1 0 2

F 1 3 4 . 1 9 8 6 7 0 1 6 7 . 2 3 1 3 9 1 0 3

G 1 3 5 . 1 9 9 7 7 1 1 6 8 . 2 3 2 4 0 1 0 4

H 1 3 6 . 2 0 0 8 7 2 1 6 9 . 2 3 3 4 1 1 0 5

I 1 3 7 . 2 0 1 9 7 3 * 1 7 0 . 2 3 4 4 2 1 0 6

J 1 3 8 . 2 0 2 1 0 7 4 + 1 7 1 . 2 3 5 4 3 1 0 7

K 1 3 9 ; 2 0 3 1 1 7 5 1 7 2 . 2 3 6 4 4 1 0 8

L 1 4 0 . 2 0 4 1 2 7 6 1 7 3 . 2 3 7 4 5 1 0 9

M 1 4 1 . 2 0 5 1 3 7 7 1 7 4 . 2 3 8 4 6 1 1 0

N 1 4 2 . 2 0 6 1 4 7 8 I 1 7 5 . 2 3 9 4 7 1 1 1

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

P 1 4 4 . 2 0 8 1 6 8 0 1 1 7 7 . 2 4 1 4 9 1 1 3

Q 1 4 5 . 2 0 9 1 7 8 1 2 1 7 8 . 2 4 2 5 0 1 1 4

R 1 4 6 . 2 1 0 1 8 8 2 3 1 7 9 . 2 4 3 5 1 1 1 5

S 1 4 7 . 2 - 1 1 1 9 8 3 4 1 8 0 . 2 4 4 5 2 1 1 6

T 1 4 8 . 2 1 2 2 0 8 4 5 1 8 1 . 2 4 5 5 3 1 1 7

U 1 4 9 . 2 1 3 2 1 8 5 6 1 8 2 . 2 4 6 5 4 1 1 8

V 1 5 0 . 2 1 4 2 2 8 6 7 1 8 3 . 2 4 7 5 5 1 1 9

W 1 5 1 . 2 1 5 . 2 3 8 7 8 1 8 4 . 2 4 8 5 6 1 2 0

X 1 5 2 . 2 1 6 2 4 8 8 9 1 8 5 . 2 4 9 5 7 1 2 1y 1 5 3 . 2 1 7 2 5 8 9 1 8 6 . 2 5 0 5 8 1 2 2

Z 1 5 4 . 2 1 8 2 6 9 0 1 8 7 . 2 5 1 5 9 1 2 3

C 1 5 5 . 2 1 9 2 7 - - - - - - - - - - - - 9 1 < 1 8 8 . 2 5 2 6 0 1 2 4\ 1 5 6 . 2 2 0 2 8 9 2 = 1 8 9 . 2 5 3 6 1 1 2 5

J 1 5 7 . 2 2 1 2 9 9 3 > 1 9 0 . 2 5 4 6 2 1 2 6

A 1 5 8 . 2 2 2 3 0 9 4 ? 1 9 1 . 2 5 5 6 3 1 2 7

1 5 9 . 2 2 3 3 1 9 5

( B LO C K ) 1 6 0 . 2 2 4 0 3 2 . 9 6 0 • •

~~~~(!) 8:42

Page 45: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 45/52

~u4K R A M C H I PS- - - - - - - - - - - -N • E • C • U P D 4 1 4 D

PL A S TI C C H IPS

1 - 5 SE T S / $ 4 8 . 0 0 S ET

6 - 1 1 S ETS / $ 4 0 . 0 0 S ET

1 2 - 2 4 S ETS / $ 3 2 . 0 0 S ET

2 5 - U P SE T S / $ 2 4 . 0 0 S ET

1 6 K R A M ca..,- - - - - - - - - - - - . . . . . .

N • E • C • U P D 4 1 6 DC ER A MI C C H I PS

1 - 5 S ETS / $ 1 2 0 . 0 0 S ET

6 - 1 1 SETS / $ 1 1 2 . 0 0 SET

1 2 - 2 4 S ETS / $ 1 0 4 . 0 0 S ET

2 5 - U P S ETS / $ 9 6 . 0 0 SET

TH ESE C H I PS A R E I N S O C K A N D R EA D Y F O RI MMED I A TE D EL I VER Y! O ME A N I G ET I EM !

F O R TH O S E W H O C A N N OT C O ME I N TO O U R S TO R E, U SE TH E S H I PPI N GS C HED U L E "A n F O R THE F I R S T SET 0 D ER ED A N D A D D 5 0 C ENTS F O REA C H A D D ITI O N A L S ET TH EREA FTER F O THE S H I PPI N G A N D I N S U R A N C E.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *A PPL E C O MPU TER I N C . S O F TW A R E MI C R O MED I A S O F TW A R E F O R A PPL E II

1 .C H EC K B O O K $ 2 0 . 0 02 . S TA R TREK / S TA R W A R S $ 1 5 . 0 03 . C O L O R D EMO / B R EA K O UT $ 7 . 5 04 . A P PL E S O F T I I / F . P . D EM O W / M A N . $ 2 0 . 0 C5 . R A M TES T $ 7 . 5 06. C O L O R M A TH / H A N G MA N $ 7 .507 .B L A C K J A C K / S L O T MA C H I N E $ 7 . 5 08 . B I O R Y Tl M/MA STER MI N D $ 7 . 5 09 .A PPL E I I C APA BI LI TI ES D EMO $ 20 .0 0

1 0 . F I N A O C E I ( 4 PR c x : ;R A MET) $ 2 5 . 0 011.~T P M O VE R /T E LE r o N :; $ 7 . 5 01 2 . A PP L E C O N TR I B UT ED P R OG R A MS

V O L . 1 & 2 ON D I S K $ 2 0 . 0 0

1 . K I rE T U F F2 . M I C R C Y I ' R I V I A3 . WA R LO R rE ( 4 P LA Y ER S )4 . B U L L S & B EA RS (8 PL AY ER S)

$ 1 2 . 0 0$ 1 2 . 0 0$ 1 2 . 0 0$ 1 2 . 0 0

1.SU PERMATEVTRU E-FAL SEQUIZ2 . G R A D I N G R t m I N E j O OA W I N G3 .VAR . MESS l\GE/ MA' IC HIN GUI Z4 .OONT F A L L / M EM C R Y A I D E5 . S T U D Y A I D E / K EY B C l M I DO O G A N

$ 1 2 . 0 0$ 1 2 . 0 0$ 1 2 . 0 0$ 1 2 . 0 0$ 1 2 . 0 0

S PEA KE AS Y S OM 'W AR E F OR A PPL E I IAN D PET

o VISA/BAC o MIC Expiration date: _Add handling and shipping charges as per schedule. Shippedby UPS unless specified otherwise. Delivery is stock on mostitems. No delay in shipment for payment by cashier's check,money order or charge cards. Allow three weeks for personalchecks to clear. Washington state residents ad ~.4% salestax. Availability, prices and specs may change without

notice. SHIPPING A. $2.00 C. 10.00 E. 3O.QO.

SCHEDULE B. 4.00 0.20.00· F. 40.00

Card#: --

Signatur.e:_~ _

Name (Print): _

Address: _

City: State: Zip:

1500 South 336th St .• Parkway Center, Suite 1

Tacoma (206) 927-8585 •

• Federal Way, Washington 9 8 0 0 3

(206) 8 3 8 ' : 9 3 6 3

(

Page 46: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 46/52

COMPUTER[SHOP

288 NORFOLK ST. CAMBRIDGE, MASS. 021 39

corner o f Ham pshire & N orfo lk S t. 61 7-661 -2670. ,)

N O W W E H A V E 0 S I A N D Y O U C A N G E T O N T O T H E B U S

C2-0 Soard assmb. S.rial 1/0 ROM Basic 298.00C2-1 above with Cabin.t &Pwr Supp ..•....• 429.00C2-4P Chall.ng.r II P Kbd & Vid.o 598.00CM- 1 4K lMHz. M.mory 125.00CM-2 4K 2MHz. M.mory 149.00

CM-3 16K 1.5 MHz. Ultra Low Pwr. M.m 450.00CA·7 1/0 Board 299.00480 Baclcp lan Motherboard 39.00all above are OSI products availabl. from us.VF8 4K M.mory assembl.d & t.st.d 129.00for low power RAM add 10.00

same in kit form 74.50

full set of sockets for Kit 10.00

V F8 Motherboard buffer.d for 4 Boards 65.00

Connector Assembly for KIM to VF8 20.008K S 100 M.mory Board with instructionsJ( 165.00sam. but fully assembl.d and t.st.d 199.00

CS 100 Cabinet cut out for KIM 129.00

3 Connector S100 Moth.rboard Ass.mbly 75.00CGRS S100 TIM Kit 129.00

C IS MC 0CGRS S 100 6502 CPU Kit 179.00

B A ,V A, N CGRS S100 Front Panel Kit 129.00

XITEX Video T.rminal Board 16X64.K 155.00

SI GN AT U RE , , '::~~1~ .. :.i.~~.~.~ ~.r.~.i.~~.I.~.~~.r.~.~~.:~.~.~~~CS 100 with CGRS,Xitex, 16KRAM, TV ,KB 1529.00

,.1AM E Same but Ass.mbled 1989.00

I~ pS·5 Pw S 5V5A9V1A.12V1A6 6X2 5

r upp. x 7 .00

IPS·5 Ass.mbled 90.00

A{)ORESS , Total of Ord.r .. Circle Items want.d.$. .

Mass. Residents Sal.s Tax 5% $ .., _ Shipping, 1%($2.00 min.) $ .

TY " STArE ZIP Totai Remittance or Charge $...........................

A L l : - I N - O N E Ohio Scienti f ic'sChal lenge r 1P is

H O M Et he easy-t o- use home compu te r.It d oes a lot m ore for a lot less!

F I N A N C I E RJu st c onne ct it to i

, your T V · and a

C A L C U L A T O R C~ f : : ~ ~ ~, That's all

T E A C H E R th ere is to it. T he re 's, nothing to build .

&Youcan crea te your own persona l p rog rams.Orse le ct f rom a whole l ib ra ry o f p rog rams on

V ID E O G A M E c~~~- t~~~~

M A K E REverything f rom teachinga ri thme ti c to spectacu la r

A T T H Evid e o games to b ala nc in q yo ur

checkbook. Something for eve ry

W O R L D ' S memberofyourfami ly.

L O W E S T P R IC E !

C H A L L E N G E R 1 PSP EClAL ! !! $425.00 with BK

and-4 game fapes

SPECIAL! !! $666.00 with 8K RAM

and 4 gam. tap.s

Why not switch to a compl.t. 6502 Syst.m

complete with an 8K ROM BASIC and 8K

of RAM. It al so has a k.yboard and a

Vid.o Display with 30X64 display of

upp.r and low.r cas. alphanum.rics and

gaming graphics

Page 47: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 47/52

6502 BIBLIOGRAPHYPART 'II

William R. Dial438 Roslyn AvenueAkron, OH 44320

380. Gordon, H. T •. "Use of MOPCODES as Executable Labels", Dr Dobb's Journal~ Issue 8 No 28pg 29 (Sept., 1978). Disousses the use of nopcodes in 650X devices. Classifies

these as monops (6 listed) and binopcodes (5 listed) and trinops (8 listed).

381. Swank, Joel "A Programmable IC Tester for KIM", DDJ 3 Issue 8 no 28 pg 33 (Sept., 1978)

With a 6820 PIA, some 7404 buffers and a ZIF 16-pin socket together with a program

KIM-1 can test IC's.

382. People's Computers_l_No 2 (Sept./Oot., 1978)

Zimmermann, Hark "Snooping With Your PET". A sophisticated Guide to PEEKing andPOKEing around in PET.

Gaines, John "Apple Hath". A math program tor the Apple h.

Cole, Phyllis "SPOT" (Tips for' P ET trainers) - Discussion of the slow documentationfor the PET. Program for lining up dollars/cents tabulations. PET listingconventions.

383. Conway, John "A Tape-to-Microcomputer-Hardware Interface Requires a Wealth of Micro-techniques". EDNAMo 6 pg 101-110 (March 20, 1978). EDN project Indecomp tape

interface hardware. Also the first hint of problems in interfacing Apple II witha PIA.

384. Hemenway, Jack E. "Add Floppies to Your Microcomputer to Form a Real MicrocomputerSystem". EDN ~Ho 12 pg 98-107 (June 20, 1978) reI May 20 EDH problems with tapehardware interfaces for Apple II. Also, EDH 23 discusses disk interface hardwar~

Final test to come.

385. Kilobaud IS8ue 23 (Oot., 1978)

Trageser, Jim "Budget System with KIM". How to expand your KIM system with ASCIIkeyboard, TVT-6 and assooiated software.

Ngai, Philip "Build a One-Chip Single Stepper". A debugging aid for home-brewed 6502systems.

Kurtz, Robert L. "World of the Brass Pounders: Receive Morse Code the Easy Way".This Morse oode reader is a good example of how the microcomputer oan serve the

radio amateur. Uses KIM-1.

Borland, D. "Financier/Mortgage with Prepayment". A pair of PET programs fromKilobaud's Instant Software line.

Beymer, Easton "Universal Humber Converter". A program in PET BASIC for oonvertingfrom one number base to another. Hot only hex, decimal, ootal and binary, butothers.

Grossman"Ri~k "Do It with a KIMSI". Use 8-100 boards with the KIM. A n evaluation.Bishop, Robert J. "The Remarkable Apple II". A description and evaluation of the

Apple II by a veteran 6502 programmer.

386. Palenik, Les "Formatting Dollars anu Cents". Byte 3 Ho 10 pg 68 (Oct., 1978) This program

for the PET rounds the monetary amount to the nearest cent and lines up the decimalpoints.

387. Bishop, Robert J. "Maze" Byte 3 Ho 10 pg 136-138 (Oot., 1978). This novelty programgenerates and displays a different maze about onoe a minute.

388. 6502 User NO+~8 12 (Hov., 1978)

Flaooo, Roy "Scope Lunar Lander--final installment". The last par-t, of a series in-

corporating graphios into the KIM-1 Lunar lander program.Allen, Miohael "TVT6 Etoh-A-Sketoh". A·sketch routine for the KIM/TVT6 said to

overoome the limitations imposed by a snowy screen during program exeoution.

Hooper, Philip K. "TVT6" - Some oheap, easy and helpful TVT6 hardware modifioations.Clem, D. "Expansion Deooding". One possible configuration of expansion deooding for

KIM is said to be designed with TVT6 in mind.Lewart, cass and Lewart, Dan "TVT6 Remarks". Hotes on improving the operation of the

K IM /T VT6 s ys te m.

Page 48: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 48/52

6502 User Notes 12 (Nov., 1978) con 't.

Kushnier, Ronald "Notes on the TVT6"i. Information on memory expansion, the TVT6/KIMas a term inal, assembly of the ~VT 6, the PVI-IK kit, KIM modification and useof the TVT6 with the Radio Shac~ keyboar d.

Brachman, Michael "Suggestions for ~Unning the TVT6". I ncludes a slight software

m od to display pages 02,03,00 cpn secutively filling the whole screen (24 line x64 character display . '

Anon, "FOCAL" S taff evaluation Oft'FOCAL for the 6502.Latham, Don J. "Letter to the Edito ". Comments on tape st orage problems, KIMSI,

XITEX, TVT6,Microsoft Basic, FC -65, etc.

Rehnke, Eric "The Cheap Vi deo Cookbook" - a book re view. Very favorable review ofDon L ancaster's latest book.

Marti n, Timothy " KIM Interval Timer~". Useful p recautions in using the KIM interval

timers are given.

389. MICRO, No 7 (Oct./Nov., 1978)

Auricchio, Rick " Breaker:An Apple I Debugging Aid". BREAKER is a soft ware routineto man age Break points, correctl resuming the us er program after hitting a breakpoint

Watson, Allen III "MOS 16K RAM for he Apple II. Speed codes used by 16K D ynamic RAM

manufac turers. The author advi es against using 300 ns access time chips.Creighton, Gary A. "PET Up date". Dsc ussion of the RND function, USR, Machi ne

Language Storing in Basic, Save and Load, etc.

De Jong, Marvin L. "6502 Interfacing for Beginners; The C ontrol Signals". The latest

article in this series discusse the theororetical basis and progresses to hard-ware and a program for experime ting with control signals.

Shryock, W illiam H ., Jr. "Improved tar Battle Sound Effects". Further improvem ents,based on th e orig inal article y Andrew H. Eliason in Issue no 6 of MICRO.

Green, J.S. "650X Opcode Seque nce Mktcher". A program that correl ates and poin ts

to parallel sequences of oPcode~, comparing the two sets and displayi ng thedifferences.

McCann, Michael J. "A Memory Test Pjogram for the PET". Program is written inCommodore BASIC and occupies th lowest 4K of me mory.

Rowe, Mike (Micro Staff) "The MICRO oftware Catalog: IV" Ten more programs arereviewed in this continuing ser es.

Schwartz, Marc "Apple Calls and Hex Decimal Conversion". How to acc ess machinelanguage routines by Ca lls and ow to use Apple in helping make the hex-decimalconversion.

D~al, W~lli am R. "650 2 BibliOg raPhY!: Part VI". The, 6502 literature,continu es to expand.Dlal, Wllli am R. "650 2 Information esources". A llSt o f the magazlnes used in c om-

piling the 6502 Bibliography an their subs cription pr ices.

Po wlette, Joseph L. and Wright, Charl es T. "KIM-I a Digital Voltme ter". Hardware and

Software to convert the K IM-1 t~ use as a digital readout voltmeter.Miller, Fred "Cassett e Tape contrOll!r". Contro l two tape units with yo ur KIM.Eliason, Andrew H. "Apple II High R ~o lution Graphics Memo ry Organizat ion". A useful

contrib ution toward better unde st anding of the App le II HIRES Graphics.DeJong, Marvin L., Riverside Electr nics Design 's KEM and MVM-1024: A User's Evalua-

tion". A generally favorable evaluation of the KEM expan sion board for KIM

and the keyboard /video monitor ~oard.Su llivan, Chris "A Digital Clock Pro ram for th e SYM-1". This 24-hour clock program

provides a good way for the new, S Y M owner to become familiar with the monitor

subroutines.He rman, Harvey B. "Peekin g at PET's! Ba sic". The PEEK function is used to look at the

B AS IC i ts el f.Te pperman, Barry "K1mbase". A program to conver t from almo st any number system to

another. Contains many useful ~ubroutines for multiplying, dividing and other

uses.

390. Anon, "Tone Routine for App le II". sout.heaater-n Software Newsletter Issue No 3 pg 6(Oct., 1978) The tone routine used ~ith A pple Integer Basic can be used with Applesoft

but must be relocated. I

391.

i

Haller, George "Storing and Recoving Dat~ in Applesoft II ".le tter Issue No 2 pg 4 (Sept, 1978) I Program for storing

A pp le so ft I I.

S ou th ea st er n S of tw ar e N ew s-and reco ving da ta in

Page 49: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 49/52

e

392. Call - APPLE.l. No 6 i

Will iams, Don "Key Klic ker Routi ne". A m~cnine language program to provide a cl ick each

time your silent keyboard is punched I

Anon, "Routin e to Find Page Length". A r utine to fill a page with repetitiv e materialor to d etermine the length of a scree page of pr int statements.

Anon, "Printer Driver Fixes". A snort pr ram to prevent problems when using theApple with a prin ter with more than 40 columns.

Anon, "Apple II Mini-Assembler". Discussion of the Apple II mini-asse mbler.Aldrich j Darrell "Use of Colo r Mask Byte i HIRES". Brief description of t his im-

portant aspect of Apple HIRES.Anon, "Memory Map-Apple II with Ap plesoft sic Loaded ". Convenient tabu lation of

memory p ositions. ~Anon , "List of Handy Calls". Sixteen call are listed for th e Apple II.Apple Computer Staff "System Monitor". Di cussion of how to get the most o ut of your

A pp le M on it or . !

Huelsdonk, Bob "Memory Test". A test fo r ~pPle memory by loading each location with55, testing, loading with AA and testifS ' Offending address will be shown.

393. Call - APPLE..L N o 7 (August, 1978)Golding, Val J. "A Disk U tility Program". I A pr ogram to record a group of programs on

tape from a disk. i

Backman, J. A. "Poor Man's HEX-DECIHAL-HEx!converte r". With this table and a sc ratch-

pad, conversions are a snap.~. 'Thyn g, Mi ke "Basic File Handling". Dis cus ion of the actual commands necessary to get

data to and f rom diskettes using the A p le wit h a PERSCI disk drive.

Appl e Comp uter Staff "System Monitor". Ca s ette I/O's, Memory Move a nd Verify, De-bugging Aids, S ingle Stepping, TraCing, using the Apple II monitor.

Anon "Applesoft Z ero Page Us age". Explanation of the functions residing in p age zeroof Apple II.

Huelsdonk, B ob "Routine to Print Free Byte s". Routine for Apple II with less than 32Kmemory.

Huelsdonk, Bob "A Patch for Double Loops". Discussion of precautions to use withwith double loops in Applesoft on the A PLE II.

Apple Computer Staff "Load ing Mach ine Langu e as Part of a Basic Program". Reprinted

f rom Contact No 1, May 1978. Provides a way to include a machine language pro-gram within a Basic Program.

394. Call

iI

- APPLE.1. No 8 (Sept., 1978) IAldrich, Ron "Convert". Prog ram Loads Inter er Basic Program f rom Disk, saves to a

text fil e on disk, then executes that f le in Appl esoft II.

Thyng, Mike "Arrays ". A description of the use of arrays with t he Apple.Chapman, Dan "Video Display Organization". A program to demonstrate the Video

Display organization. .

Anon "Routine to Save an Arra y". (reprint et from Appl e Stems Vol 1 No 2 July, 1978)A routine to save both integer or floattng point real numbers in an Applesof tI I a rr ay . I '

Lam, S.H. "Monitor Commands from Basic~ ThIS routi ne allows execution of 'Apple Monitorcommands from Basic with return to Basi .

Williams, Don "Linkage Routines for the Appl II Integer Basic Floating Point Packa ge".

A discussion of the Apple II ROM rout i n s.

Hill,. A lan G. "Return to TEXT from GraPhiCS"~' A handy routin e which permits the useof Control Y to return to Text from App e Graphics.

Anon "Integral Data IP 125-225 Driver". A light modification of the Apple Red Book

teletype routine for use with the In teg al Data print er.Huelsdonk, Bob "Pr inter Driver Fixes". Pro ocol to use a printer with more than 40

columns with the Apple. ;

395. Call - APPLE J. . No 9 (Oct., 1978) rC ook, John B. "Applesoft Tone Routines". Re ocation of the tone routines is necessary

for use with Appl esoft II on the Apple.Scott, Michael M. "A Brief History of Apple". An interesti ng account by the President of

a Apple Computer Co. I

., I

Page 50: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 50/52

Call - APPLE_.LNo9 (Oct., 1978) cont.

Anon, "Some Basic Entry Points". U'arious Call and JSR functions for Apple basic.

Huelsdonk, Bob "Sample File Handler". A program that demonstrates and will establish

files for data handling, using the DOSon Apple.

Golding, Val and Williams, Don "Apple II Integer Basic: Interpretation of Memory".

Tabular listing of pointers an tokens for Apple II Integer Basic.

Golding, Val "Applesoft II Tokens". Memory tabulation for to~ens and pointers

of Applesoft II Basic for the I\pple.

396. PET Gaz13tte..1... No 5 (Aug./Sept., 1978)

!lnon, "PET Standards". Standards re suggested for writing PET programs, graphics,

music listings, etc.

Louder, Mike "Dynamic Keyboard". Piscussion of methods to change lines in Basic

programs while the PET is runn ng.

Richter, Mike "Data Files". ReCOlDJDendedrocedures in preparing tapes for exchange.

Anon, "PET Memory Map". Map repri ted from the PET Paper.

Staebell, Jon "PET Hints". Miscel aneous hints for PETowners.

Modeen, Roger L. "Easy Auto Answer Originate Modem". Modemfor the PET.

Clark, Ken "Proposed Temporary Loc 1 Standard for LowSpeed Data Exchange by Modem".

Protocals for data exchange.

Cumberton, Dennis "File Manager". A program for reliable data reading and writingwith the PET.

Bendoritis, Bill "Renumber". A re~umbering program for the PET.

8:48

NOW AVAILABLE

PET Software In BASIC

Statistics:DistributionLinear Correlation and

RegressionContingency Table AnalysisMean and Deviationall four for only

$ 5.9p

5.9p

5.9p

5.9~18.9~

Financial:

DepreciationLoansInvestmentall three for only

5.9~

5.9~5.<;!J12.95

General: ,~

1lcTac ToeComplete Metric ConversionCheckbook Balancerallthree for only

4.CJ55.Cj5

4.Cj5

10.95

FOR THEKlM-l

A real-time Process Control OperatingSysteDl including a process language interpreter- (operates in the 1K KIM-1 RAM).

Assembly listingCassette tape and users manualSchematic for relay control board

$24.95

14.95

9.95

All programs on high-quality cassette tape. Sendself-addressed, stamped envelope for complete

software catalogue.

Send check or money order to:H. GeUer CODlputer SysteDls

Dept. MP.O. BOX 350

New York, New York 10040

(New York State res. add 8% sales tax)

Page 51: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 51/52

,J

$1295,00

MINI FLOPPY DRIVE WITH 100K PER DISK SIDE FOR TOTAL 200K ON LINE,U I t , ' " ' ' '' ' : U COMMERCIAL SPEED REQUIREMENTS ·FAST LOADING SPEED.

(DOS) AUTOMATICALLY REORGANIZES FREE DISK SPACE AFTERERASE.. ~ , . ' v . , . ~. IS R.ESIDENT IN ROM VIA DISK CONTROLLER BOARD PLUGGED INTO

ADDS 14COMMANDS TO BASIC INCLUDING DISK DATA FILES,COMMANDS SUPPORT COMMERCIAL PRINTER OFF PARALLEL

SUCH AS CENTRONICS 779.DISK SOFTWARE SUPPORT· FORTRAN & PLM COMPILERS THIS JANUARY,Y MANUFACTURER'S WARRANTY ON HARDWARE· READY TO USE ON

WITH FULL INSTRUCTIONS AND UTILITY DISKETTE,ITE FOR ADDITIONAL INFORMATION· INITIAL QUANTITIES LIMITED,

EM IS FULLY SUPPORTED BY SOFTWARE FROM THE MANUFACTURER.ARE NOW BEING ACCEPTED FOR DECEMBER & JANUARY DELIVERY,

DKH641

-DUAL DRIVE SYSTEM. COMPLETE WITH DISKMON

-DISKMON ASSEMBLER LISTING/DOS ..

-PET ASSEMBLER ON CASSETTE,

-PET ASSEMBLER ON DISKETTE (5.5 inch).

-AUTOLINK LINKING LOADER ON DISKETTE. , ,$49,95

-FORTRAN COMPILER ON DISKETTE (JAN'79) . $69,95

-PLM COMPILER ON DISKETTE iJAN·79). ,,$49.95

* * * BUSINESS PACKAGES STARTING IN Isl_QUARTER 1979* * *IS SYSTEM REQUIRES EXPANDAPET MEMORY (MINIMUM 16K-SEE BELOW)

,., $19.95

. $49.95

WHY N IOT BUY FROM THE BEST?8K PET ..... * NEECO IS A CUSTOMER ORIENTED. FULL SERVICE COMPANY,

* PETSRECEIVE 48 HR. 'BURNIN' BYNEECO BEFORE SHIPMENT,* FULL CUSTOMER SERVICE AND FULL PRODUCT SUPPORT.

* 48HR MAXIMUM 'TURNAROUND' ON PET WARRANTYSERVICE ON PETS PURCHASED FROM NEECO.

* FULL PRE·PURCHASE INFO AVAILABLE FROM OUR PET INFOPACKAGE - WE ANSWER CUSTOMER QUESTIONS'

* AUTOMATIC SOFTWARE/HARDWARE UPDATES VIA OUR PETOWNERS MAILING LIST - CALLIWRITE TO BELISTED'

* COMMERCIAL QUANTITIES AVAILABLE.* WE ALSO MARKET REPLACEMENT RAMS & ROMS. ETC,* OFF THE SHELF DELIVERIES (NO DEPOSIT REQUIRED).

SCHOOL INQUIRIES INVITED!

r-+-~~~~~~~

EXPANDAPETTM INTE R NA L ME MOR YE XPA NSION UNIT

·COMMERCIAL QUALITY KEYBOARD WITH METAL ENCLOSURE,·BASIC TYPEWRITER DESIGN FOR TOUCHTYPISTS.·SINGLE KEY FUNCTIONS FOR ALL CURSOR CONTROLS.SHIFT/RUN. INSERT. CLEAR SCREEN/HOME CURSOR. MORE,•FUNCTIONS SIMULTANEOUSLY WITH PET'S KEYBOARD.·PLUGS DIRECTLY INTO PET'S LOGIC BOARD,·DOES NOT USE USEROR IEEE·488 PORTS.·NPK·101 IS FULLY TESTED & READY TO USE,·ATTACHES DIRECTLY TO FRONT OF PET'S FRAME.·CAN BE USEDAS A REMOTE TERMINAL (SPECIAL ORDER),·30 DAYSTRIAL PERIOD· 90 DAY WARRANTY.·CALL OR WRITE FOR FULL SPECS·INITIAL QTY LIMITED.

ORDERS ARE NOW BEING $139 95ACCEPTED FOR DECIJANCUSTOMER DELIVERIES. •

NPK·101 IS A PRODUCT OF NEW ENGLAND ELECTRONICS.

•MOUNTS EASILY INSIDE YOUR PET·EASY TO INSTALL (15 MINUTES)·NO DEGRADATION OF PET SYSTEM·USES LOW POWER DYNAMIC RAMS·90 DAY PART&LABOR. 1 YR·RAMS.·30 DAY MONEY BACK GUARANTEE.·MOUNTING SLOTS FOR 4 BOARDS.·CALLlWRITE FOR ADDITIONAL INFO·DEALER INQUIRES INVITED,

EXPANDAPET PRICES

16K (+ 8K PET: 24K) $42524 K (+ 8K PET: 32K) $52532K (+8K PET: .oK) $615

OPTIONAL PLUG·IN BOARDS 32K UNIT ALLOWS' 8K OFSERIAL I/O BOARD $75 ASSEMBLY LANGUAGES·100 I/O BOARD $75 SUBROUTINES ACCESSED4K EPROM BOARD $50 VIA THE USR COMMAND.

EXPANDAPET IS A PRODUCT OF CONVENIENCE LIVING.

WECAN NOTLISTALLOF OUR SOCALLOR W RITE FOR OUR*FREE*

ARE AN D HARDWARE P RODUCTSFTWARE/H AR DWARE D IR ECTO RY

RONICS co.. INC.FIELD. MASS. 01103

, .. ." , s -r v: .er SA T 10·2, ES. T.

(413) 739-9626I,~. ~ ACCEPTED, ADD 3%~ ...... SERVICE CHARGE

$1995

Page 52: Micro 6502 Journal December 1978

8/3/2019 Micro 6502 Journal December 1978

http://slidepdf.com/reader/full/micro-6502-journal-december-1978 52/52

SYM--PLICITY

ENGINEERED SPECIFICALLY FOR MADE OF HIGH IMPACT STRENG .THTHE SYM-1 MICRO COMPUTER THERMOFORMED PLASTIC

• Easy Access for • Kydex 100·Adjustments • Durable

• Room for Expansion • Molded-In Color• Protects Vital Components • Non-Conductive

EASILY ASSEMBLED AVAILABLE FROM STOCK• Absolutely No • Allow Twoto Three Weeks forAlteration of SYM-1Required Processing and Delivery

• All Fasteners Provided • No COD's Please• Goes Together in Minutes • Dealer Inquiries Invited

ATTRACTIVE FUNCTIONAL PACKAGE

• Professional Appearance• Popular "Data Blue" Color• Improves Man/Machine Interface

- - - ~ - - - -TO ORDER: 1. Fillin this Coupon (Print or Type Please)

2. Attach Check or Money Order and Mail to:

NAME

STREET

CITY _

enclosuresgroup753 bush street.