micro 6502 journal august 1979

60
8/3/2019 Micro 6502 Journal August 1979 http://slidepdf.com/reader/full/micro-6502-journal-august-1979 1/60 APPLE ME,MORY MAP The Magazine of the APPLE, KIM, PET Systems nd Other , .. ~ r_j .-~~-"~ "J 1j,1i!I.,,-. f I o 15 12.00

Upload: cubemanpdx

Post on 06-Apr-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 1/60

APPLE ME,MORY MAP

The Magazine of the APPLE, KIM, PET

Systemsnd Other

, . .~r_j

.-~~-"~" J

1 j , 1 i ! I . , , - . f

II

o 15 12.00

Page 2: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 2/60

PIE T EX T ED IT OR M ach in e L an gu ag e, I

curso r-based tex t ed ito r fo r 16K Apple .• Features fo rm at capab ilitie s o f m ost tex tedito rs . .

.' A ll comm and 's a re con tro l cha racte rs .• Enab les you to define your ow n functioncommands .

O rd er P IE . un Casse tte : _ • .. . $19 .95On D iske tte , , $24 ..95

H IG H RESO WT lO N CH A.R ACT ERG EN E RA TO R M achine language p rogram

16K Apple .D efine you r ow n charac te r set and g raph icshapes .C om ple te Eng lish up per/lo wer case ch ata r set.C om ple te G reek A lph abe t w ith up per/Ie r ch arac te r se t.S cro ll, v ary w in do w s iz e, in vert ~h."r.~tpT'

sw itch back and fo rth betw een tw o

NEW !

H i -R e s C h ar . Gen . o n m ske tte ,$19 ,.'95 '

SARG ON fo r 24K App le• F lip back and forth be tw een board andtex t w ith ESC ..

• C orrect w ro ng m ov es• A naly ze y ou r p ositio nO rd e r SARGON on Casse tte ... .. $19 .95

FAS TGAMMON

A high quality , cha lleng ing gam e fo r youa nd th e c om pu ter.

O rd er FA ST GA M MO N o n C assette . $19 .95On D iske tte __ • .. $24 .95

Call o r w rite today fo r your FREE App leS oftw are C atalo g. W e w elc om e B /A -V IS Aand M aste rcha rge. Sorry , no COO s. Please

ad d $1 .25 sh ip ping and hand ling . C alifo r-n ia res id en ts ad d 6% Sales T ax .

W e sh ip prom p tly on rece ip t o f your p re -p aid orde r. O rder d irect from :

o ANIMATION

Def ine a 3-0 l a- re s s h ap e .• A n .im a te w ith f u l l perspective.. ' Includes 3 d em o s ha pe s.

Order 3- D A NIM AT IO N on d is ke tt e . $2 4. 95

Page 3: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 3/60

POWEB§OF~ INC.P. O. BOX 157

PITMAN, NEW JERSEY 08071

(609) 589-5500

products for the

APPLE II

APPLESOFT II UTILITY (Diskette Only) $12.45

The Applesoft II Uti lity program provides the user with the following features. a) Complete automatic renumbering of any Applesoft II

program. b) The creation of an EXEC File for subroutine file creation. This feature allows you to incorporate the same subroutine in various pro-

grams. c) No modification of the program in machine memory (RAMl. d) Automatic running of the program. No programmer should be without

this excellent utility program. REQUIREMENTS: Disk II, Applesoft II, 16K of memory.

REAL ESTATE ANALYSIS PROGRAM $14.95

The Real Estate Analysis Program provides the user with three features. a) A powerful real estate investment analysis for buy/sell decisions

and time to hold decisions for optimal rental/commercial investments. b) Generation of complete amorization schedules consistent with banking

practices and schedules. c) Generation of depreciation schedules for selecting the best depreciation schedule for your useand a determination of

optimal switch over points to straight line to maximize depreciation. All three features are designed for video screenor printer output. In addition,

the program wil l plot; cash flow before taxesv s.

years, cash flow after taxesv s,

years,adjusted basisv s,years,capital gains

v s.years, pre-tax pro-

ceeds v s. years, post-tax proceeds v s. years, and return on investment (%) v s. years. REQUIREMENTS: Applesoft II, 16K of memory without DOS

or 32K of memory with DOS (Disk II).

ADDRESS FILE GENERATOR $19.95

A professional piece of software which allows the user to create four different types of address files: a) Holiday File, b) Birthday File,

c) Home Address File, and d) Commercial Address File. The program contains a menu of sevenmajor commands: 1) Create a File, 2) Add to File,

3) Edit File, 4) Display File, 5) Search File, 6) Sort File, and 7) Reorganize File. Most of the major commands havesubordinate commands which

adds to the flexibility of this powerful software system. We doubt you could buy a better program for maintaining and printing address files.

REQUIREMENTS: Disk II, Apple Printer Card, 32K of memory with Applesoft ROM Card or 48K of memory without Applesoft ROM Card.

SUPER CHECKBOOK $19.95

A totally new checkbook program with a unique option ... Bar Graphs. These bar graphs, outputed to a printer or video screen, provide

trend analysis data on code expense, income, expenses,or gain/loss on a month by month basis. The program contains a total of fourteen options:

1) Check/Deposit Entry & Modification, 2) Reconciliation of Checksor Deposits, 3) Sort by Check Number, 4) Sort by Code for Year,5) Sort by

Code for Month, 6) Output Year to Date, 7) Output Month Activity, 8-11) Printer/Video Plot Trend Analysis-Bar Graphs, 12) Account Status,

13) Reconciled Check Status, and 14) Quit. An excellent program for maintaining your checkbook, or that of a small business. REQUIREMENTS:Disk II, 32K of memory with Applesoft ROM Card or 48K of memory without Applesoft ROM Card.

$14.95UNCTION GRAPHS AND TRANSFORMATIONS :~-r-\]~~-~D ,

. .C D \

C D

CDr---------~~~----~r--+

This program uses the Apple II high resolution graphics capabil ities to draw detailed

graphs of mathematical functions which the user defines in Basicsyntax. The graphsappear in a

large rectangle whose edges are X and Y scales(with values labeled by up to 6 digits). Graphscan be superimposed, erased, drawn asdashed (rather than solid) curves, and transformed. The

transformations available are reflection about anaxis, stretching or compressing (changeof scale),

and sliding (translation). The user can alternate between the graphic display and a text display

which lists the available commands and the more recent interactions between userand program.

Expected usersare engineers,mathematicians, and researchersin the natural and social sciences;

in addition, teachers and students can use the program to approach topics in (for example)

algebra, trigonometry, and analytic geometry in a visual, intuitive, and experimental way which

complements the traditional, primarily symbolic orientation. REQUIREMENTS: 16K of

memory with Applesoft ROM Card or 32K of memory without Applesoft ROM Card.

. .CD

\ III

CD

!

-488' ., ' 4 ..

Available at your local computer store

Call or write for our free SOFTWARE & ACCESSORIES CATALOG

DEALER INQUIRIES INVITED

• Check or Money Order

• Include $1.00 forshipping and handling

• C.O.D. ($1.00 add'tl. charge)

• Master Charge and VISAorders accepted

• New Jersey residents add5% salestax

POKTEH§OFT~ INC.P. O. BOX 157

PITMAN, NEWJERSEY 08071

(609) 589-5500Programs Available on Disketteat $5.00 Additional

Apple II isa registered

trademark of Apple Computer, Inc.

Page 4: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 4/60

inc .

BOX 120

ALLAMUCHY, N.J. 07820

201-362-6574

forgot to say lines can also be moved around

and deleted. ThIS Isn't the complete list of

FODS editor commands, Just Ihe ones that

immedi at el y come to mind,

Another very powerful feature of the sys-

tem is the abi li fy to actual ly execute atue con-

taining a string of commands. For example,

the newsletter mailing l is t is now being stored

on dISC. When Iwant to make labels, Iwould

normally have to load each letter file and run

the labels printing program. But with FODS, I

can build up a "JOB" file of commands and

execute it.The job file In turn cal ls each lel tered label

fil e in and runs the label pri nt er auto-nat.cat-

Iy. The way computers are supposed to oper-

ate right?

Here's a listing of the job file I use to print

mailing labels:

:LIS PRTLBL

0005 LOD A:RUN %LABELLOD B:JMP.EOOO·

LOD CJMP.EOOO:

0010 LOD D:JMP.EOOO:LOD EJMP.EOOO:

LOD FJMP.EOOO:

0015 LOD G:JMP.EOOOLOD .fUMP.EOOO

LOD I:JMP.EOOO:

0020 LOD J:JMP.EOOO:LOD KJMP .EOOO:

LOD L:JMP.EOOO:

0025 LOD M:JMP.EOOO:LOD MC. JMPEOOO:

LOD N:JMP.EOOO:

0030 LOD O:JMP.EOOO:LOD P.JMP EOOO:

LOD R:JMPEOOO:

0035 LOD S:JMP.EOOO:LOD T:JMP EOOO

LOD V:JMP.EOOO:

0035 LOD S:JMP.EOOO:LOq T.JMP .EOOO:

LOD VJMP.EOOO:

0040 LOD W:JMP.EOOO:LOD XYZ: JMPEOOO:

0045 LOD EXCH:JMP.EOOOLOD COMP:

JMP_EOOO·

Remember the MOS/ARESCO assembler I

reviewed several i ssues ago? Well HDE went

and fixed up all the problem areas that I

mentioned in the review and then took it

several steps further. The HDE assembler is

an honest t o goodness two-pass assembler

which can assemble anywhere in memory us-

Ing multiple source t iles f rom the disc. The as'

sembler is an optional part of the system.

If you're the kind of person las I ami who

enjoys having the abili ty to customize, modi-

fy and expand everything you cwn - you'll

enjoy the system expansion abilttiec FODS

has to offer. Adding a new command .s as

Simple as writing the program, giving it a

unique thr ee letter name and saving it to disc

Whenever you type those three letters the

system wil l f ir st go through i ts own command

table, see that its not there and then go out

H U D S O N D IG IT A L E L E C T R O N IC S IN C .

THE HDE DISK SYSTEM.

HERE'S WHAT ONE USER HAS TO SAY • •REPRINTED BY PERMISSION FROM THE 6502 USER NOTES - ISSUE NO. 14

JOHNSON COMPUTER PLAINSMAN MICROSYSTEMS

LONG ISLAND

COMPUTER GENERAL STORE LONE STAR ELECTRONICS

PRODUCT REVIEW of the HOE DISC SYS-

TEM by the editor

A number of you have asked for details

about the HOE full size disc system

The system is based around the SYKES 8"drive with the 6502 based intel ligent control-

ler

This drive ISsoft sectored,lBM compat ible,

and single density which lets you store about

a quarter megabyte of da ta on a disc.

The system software, cal led FODS (File Ori·

ented Disc System). manages sequential f iles

on the disc much the same way files are writ-ten on magnetic tape - one after another.

When a file IS deleted, from a sequentially

managed file system, the space that the file

occupied is not immed ia te iy real loca ted. as in

some disc operati ng syst ems. As it turns out,

this can be an advantage as well as a disad-

vantage since deleted files on the FODS sys-

tem can be recovered after the file has been

deleted. (This has saved my sanity more than

once!) Of course when you want to recover

some of the disc space taken up by a number

of these deleted fi les, you can simply re-pack

or compress the disc and all the active files

wil l be shi fted down unti l there are no deleted

files hanging around using up space.

FODS has this ability to repack a disc.

When saving and loading In FODS you work

with named files, not track and sector data or

1.0. bytes. This makes life a lot easier. I've

seen some disc systems where you have to

speci fy track and sector info and/or I.D.bytes.

What a pain that can bel

If you just want to save a sour ce fi le tempor-

arily, you can do that on what's known as

"scratch-pads". There are two of these on adisc, "scratch-pad A" and "scratch-pad B",

each of these temporary disc fl ies can hold up

to 16K or if "B" IS not used, "A" can hold one

file up to 32K Inlength. The only fi les that can

be tempor ar ily saved on scr at ch pad are fi les

that have been built using the system text

editor.

Being a dyed in the wool assembly lan-

guage programmer. I really appreciate the

FODS text editor! This line oriented editor is

upwards compat ible with the MOS/ARESCO

editor but includes about everything you

cou ld ask for Ina li ne editor . There is a full and

semi-au tomatic l ine numbering feature. l ines

can be edited while they are being entered or

recalled and edited later, strings can be lo-

cated and SUbstituted, the line numbers can

be resequenced, the file size can be found.

the hex address of a line can be known and

comments can be appended to an assembly

file after it has been found correct. OOPS I

and read the disc directory to see if It can find

it. If i t's on the d isc i tw il l r ead i t in and execu te

i t. Simple r ight? I've added several commands

to my system and REALLY appreciate havinq

trus ability. Some of the things I·ve added

include a disassembler, an expanded ver-

sion of XIM (the extended machine language

monitor f rom Pyramid Datal, Hypertape, and a

number of system utilities which make life

easier By the way, to get back to the system,

all you need to do ISexecute a BRK instruc-

tion

HOE also provides a piece of software thatlets you Interlace Microsoft 9 digit BASIC to

the" disc system The software allows you to

load the BASIC interpreter Itself from disc as

wel l assavingand loading BASIC Programs to

and from the disc. Ttus parti cular version at

the software doesn't allow for saving BASIC

data but HOE mentioned that this ability may

be possible wit h a futur e version.

The first thing I do with a new piece of soft-

ware after I get used to uSing it is try to blow it

up. I did manage to find a weak spot or two In

the very fi rst version of FODS (a pre-release

version: but the later. release version has

been very t ight .

The standard software that is included wi th

the system consists of the disc driver soft-

ware, the system text editor and the BASIC

software i nt er face. Several command exten-

sions may also be included Al l the necessary

stuff l ike a power supply, the KIM-4 Interface

card, and all cables and connectors are in-

cluded. It took me about 45 minutes to get

things up and running the first time I put the

system together.

Admi ttedly, a dual full Size disc system from

HOE ISp robably beyond the means of most

nobbytsts but If you or your company is look-

109 for a dynamite 6502 development sys-

tem, I would recommend this one. I've used

the Rockwell System 65 while I was at MOS

and feel that dollar for dollar, feature for

feature, the HOE system comes out on top

The only place the HDE system falls short

when stacked up next to the System 65 is In

t he ar ea of packaging. At this point. there IS no

cabinet tor tne disc drives available from HOE

So far. I've got nothing but good things to

say about HDEand their products. Everything

I've received fr om them has been industr ial

qual ity. That Includes thei r documentation

and pr oduct suppor t. I 'm very impressed wIth

what I've seen from tn.s company so far and

quite enthusiastic over what my KIM hasbecome Since acqui ri ng the disc system and

its associated softwareERIC

THANK YOU MR. REHNKE!

HOE PRODUCTS - BUILT TO BE USED WITH CONFIDENCE

AVAILABLE DIRECT OR FROM THESE FINE DEALERS:

Box 523

Medina. Ohio 44256

216-725-4560

Box 1712

Auburn. Ala. 36830

800-633-8724

ARESCO

PO. Box 43

AudUbon. Pa. 19407

215-631'9052

103 Atlantic Avenue

Lynbrook. NY 11563

516-8B7-1500

Box 4BB

Manchaca. Texas 78652

512-282-3570

Page 5: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 5/60

Page 6: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 6/60

I.. .. ~ IISeeifYOUqualifY~OracclofOCP/Fcard PETTM•11~ and get great discounts on selected

purchases for your APpleand PET.

we have the Most Complete Stock of APPLEandPETSoftware in Southern California.

(Send for our Catalog - $1.00)Reference Books For APPLE and PET Ownersprogramming the 6502 , .9.95PETUserManual (Newfrom Commodore) . , .. 9.95MOSTechProgramming Manual(6502) . , .. 12.00MOSTech Hardware Manual . .. .12.00Hands On Basic with a Pet , , ,14.95

32 Basic Programs for the Pet , , .. ,14.95

6502 Applications Handbook. . .. , .12.95

Pet Machine Language Guide , .. , 9.95

CLASSES:Apple TOpicsWe offer a series of classeson Apple II to aqualnt owners with some of the unique features and capabilities

of their system. roplcs covered are Apple Sounds, Low Res.Graphics, Hi Res.Graphics, DiskBasics,and How to Use

Your Reference Material. Sessionsare held every Thursday Night at 7:00 p.rn.HARDWARE FOR APPLE II PET HARDWARE

16K RAM CHIP SET FOR APPLE IITested & Burned InOnly . . . . . . . . ..... $95.00

WORKSHOPS: Call for details.• PET3rd Saturday of the Month

• APPLE-4th Saturday of the Month

• Telecommunications Line for AppleUsers with Modems, 714-898-1984.

• upper & Lower Case BoardNow you can display both upper and lower case characters onyour video with the Apple II, Includes assembled circuit board

and instructions. 49.95

• programmer Aide. . . . , .550.00

PRINTER SPECIALS FOR APPLE AND PET

• TRENDCOM 1DD with interface for APPle or PET

• LITE P EN used with TV or monitor screen ..

• ALF MUSiCSynthesizer Boards

• APPLEDisk Uti li ty (DOS3.2).

• supertaiker .

• APPLEClOCk

• Anadex DP'8000 with tracterS" paper width and Apple interface

$450.00

34.95

265.00

25.00

. .279.00

. 195.00

51050

• PET 2001-8 Computer Standard PETw ith integral cassetteand calculator type keyboard SK bytes of memory17167 net) .. $795.00

• PEr 2001·16N Computer PETwith 16K bytes of memoryand large keyboard with separate numeric pad andgraphiCS on keys . External casset te optional115,359 net! ,. .. $995.00

PEr 2001-168 Computer ASabove but has standard tvoe -writer keyboard No graphic keys .. $995,00

• PEr 2001-32N Computer Identical to 2001-16N with 32Kbytes of memory. 131,743 nen..... . $1295.00

• PET 2001-328 Computer Identical to 2001·32B with 32Kbytes of memory 131,743 nen.. . ... $1295.00

PERIPHERALS

• PET 2022 Printer SO column dot matrix printer With plainpaper or forms handling tractor feed. Has full PETgraphics. . . $995.00

• PET 2 023 printer SO column dot matrix printer. Plainpaper printer with full PET graphics .... $849.00

• PET 2040 Dual Drive Mini FloPPY Disk' Dual drive intelligentmini floPPY system. 343K net user storagecapacity. $1295.00

'Retrofit kit required for operation with PET2001-S,

S OF TW A R E F OR PE T

Mirrors and Lenses. . 19.95The States 14.95Real Estate 1 & 2. . 59.95Momentum and Energy .. 19.95projectile Motion,.. .19.95Mortgage. .14.95Dow Jones. . . . . . . 7.95Petunia Player Sftwr .14.95

checkers and Baccarat. 7.95

Chess. ... ...19.95Series and Parallelcrrcurt Analysis 19.95Home Accounting. .9.95BASIC Math. . . 29.95Game PlaYing With BASICVol. I. II, III.. .9.95 each

• Centronics 779-2 fOr Apple IIWith parallel interface

SOFTWARE FORAPPLE II

51245.00

WHY SHOULD YOU BUY FROM US?Because we can help you solve your problems and answer your questions. We don't claim to know

everything, but we try to help our customers to the full extent of our resources.-Prices subject to change.-

• PASCAL from Programma.• FORTH .• LISP-from Apple Software Bk NO.3 ..• LISA-Interactive disk assembler. . .• WHATSIT--Excellent conversational data basemanager .. 32K 100.00

• SARGON-Champ of zno west Coast Computer Faire• APPLE PIE-Excellent text editor.• FORTE-MUSIC editor in hires .• FASTGAMMON-Excellent backgammon gamewith graphics , . . . . . . . . Tape 20.00 Disk 25.00

• APPLE 21-Excellent blackjack game . 9.95• BRIDGE CHALLENGER-Computer bridge. ..14.95• FINANCIAL MANAGEMENT SYSTEM• Accounts Payable • Ledger Processing• Accounts Receivable • payroll• Inventory Control • 5S00 Complete• 5200 Each package • 510 for Manual

49.9549.95

...... N/C.. 34.95

4SK 125.00.... 19.95.24.95

. . . 19.95

e '

COMPUTER COMPONENTS OF ORANGE COUNTY6791 Westminster Ave., Westminster, CA92683 714-891-2584Hours: Tues-Fri 11:00 AM to 8:00 PM-Sat 10:00 AM to 6:00 PM (Closed Sun, MOn)

Master Charge, Visa, 8 of A are accepted. No COD.Allow 2 weeks for personal check to clear.Add 51.50 for handling and postage, For computer systems please add $10.00 for shipping, handling and

insurance. California residents add 6% SalesTax.

-

Page 7: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 7/60

APPLE II Serial Output Made Simple

Is the APPLE II simple serial output as easy to lmple-ment as everyone claims? Almost! But a few helpfulhints gleaned from this designer's experience may getthat output port into service quite a bit sooner.

When Apple sent the new Apple IIReference Manual (January 1978), Ijumped at the article on page 114, "ASimple Serial Output". A printer outputwas badly needed in my system. I builtthe RS·232 output as described,typed in the program, borrowed a ter-minal from my place of business andstarted things up.

An oscilloscope on the RS·232 outputdisclosed that the signal was reaching+ 12v, but going only sl ightly negative.

The printer did work correctly, but I wasconcerned. Examination of the RS·232Cspecif ication disclosed that the printeron the data receiving end must have 3Kinput impedance. The printer manualstated only that the impedance was "atleast" 3K. Since the Apple circuit wasuses a 2.2K resistor to - 12v, the sourceimpedance, when negative, is much too

high. I replaced the Apple circuit with asingle inverter (74LS04) driving anRS·232 driver integrated circuit manu-

factured by Motorola (MC1488L). Thisworked fine.

The only other hardware problem relatedto page 115 in Apple's manual. The state-ment, "The signal output connects topin 3 of the OB·25 connector", is con-fusing. I t is correct i f you are connectingit to a OB·25 connector, which is to beused with a standard RS·232 cable with

the other end of the cable connected tothe printer. The cable connects pin 3 atthe source end to pin 2 of the receivingend. If you are connecting directly to theprinter, use pin 2, not pin 3.

Now the fun began. The printer I usedcan be operated at 110 baud, 150 baud,or 300 baud, front panel switch select-able. Apple's program was al l writ ten for

1 0 R E M P R I N T E R T E S T A N D M O D I F Y P R O G R A M I N A P P L E S O F T B A S I C1 5 C A L L - 9 3 6: P R I N T: P R I N T2 0 I N P U T · 1 1 0 O R 3 0 0 B A U D " ; A

3 0 I F A = 1 1 0 T H E N 7 04 0 P O K E 8 6 8 , 105 0 P O K E 8 8 2 , 785 2 P R I N T : I N P U T " 2 0 0 O R 0 M S C A R R I A G E R E T U R N D E L A Y · ; M5 4 I F M : 2 0 0 T H E N M = 2 5 56 0 P O K E 8 4 3 , M7 0 P R I N T : I N P U T " H O W M A N Y C H A R A C T E R S T O A L I N E · ; N8 0 P O K E 7 8 7 , N9 0 P R I N T : P R I N T1 0 0 P R I N T N ; " C HA R A C T E R S T O A L I N E "1 1 0 I F A = 3 0 0 T H E N 2 2 01 2 0 P O K E 8 6 8 , 1 11 3 0 P O K E 8 8 2 , 2 1 51 3 2 P R I N T : I N P U T " 2 0 0 O R 0 M S C AR R I A G E R E T U R N D EL A Y " ; H1 3 4 I F M : 2 0 0 T H E N M : 8 81 4 0 P O K E 8 4 3 , H2 2 0 P R I N T : P R I N T : I N P U T " C H A R A C T E R S T O B E P R I N T E D " ; A $

2 30 P RI NT : PR IN T: PR IN T A $2 4 0 P R I N T : P R I N T : P R I N T " O U T P U T I S N O W G O I N G T O T H E P R I N T E R A T A · ; A ; · B A U DR A T E ·2 5 0 C A L L 7 1 82 6 0 F O R J = 1 T O 1 02 7 0 P R I N T A $2 8 0 N E X T J3 0 0 C A L L 9 1 43 1 0 P R I N T : P R I N T3 2 0 I N P U T " C O N T I N U E ( Y O R N ) · ; B $3 3 0 I F 8 $ = " Y · T H E N 2 3 03 4 0 E N D

August, 1979 MICRO - The 6502 Journal

Donald W. Bixby5 King Philip TrailNorfolk, MA 02056

110 baud. Naturally I wanted the fastestspeed. For any speed higher than 110baud, 1s top bit is used instead of 2. Thisis easily changed by writing location$03C6 with OA .

The routine TTOUT4 causes a 9.091msec. delay (1/110 baud = 9.091 ms).For 300 baud, I needed 3.333 ms. Thiswas accomplished by changing location0304 from 07 to 4E.

The printer will now work at 300 baudwith three problems remaining. The firstwas simple, the second took two weeksto figure out and the third was minor.

When a carriage return is transmitted,the program sends the carriage return tothe printer, then automatically sends aline feed to the printer, then waits 200ms for the carriage return to be com-pleted. My printer requires the 200 ms.dealy, but others wil l be different. For ex·ample, the OECwriter requires no delay.After speeding up to 300 baud, I was notgetting enough delay. I changed location03AC from 58 to FF, an arbitrary choice,and this problem was fixed.

The program is supposed to detect whenthe next column to be printed, COLCNT,exceeds the number of columns avail-

able, WNOWOTH, and then transmit anautomatic CR, LF, and delay. It won't,it can't and it didn't. The intention of theApple program routine, FINISH is tomake CH equal to 39 and' then depend onthe system monitor rout ines to generatethe CR, LF and delay. This doesn't work.

I have modified their program to makethis happen within the TTY routines. IfCOLCNT equals or exceeds WNOWOTH,the program branches to RETURN. Thiscauses a carriage return and thenbranches to AUTOLF, the same sectionof program used for automatic line feedand delay by Apple.

The last problem encountered involvedgetting out of the printer routines andback to the video display. New code waswritten to solve this problem.

The new program, shown here, has beenrelocated to addresses 30A through3A2. With all the components, I believeit is self explanatory. I also wrote anAppleSoft BASIC program to modify andtest the machine language program.

15:5

Page 8: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 8/60

FOR

AIM/SYM/KIM

8K STATIC RAM P;~~R

Sockets for 8K Eprom

6522 110Port

ON BOARD REGULATORS

EPROM

PROGRAMMER

MEMORY PLUS: 52()()OO FULLY ASSEMBLED AND TESTED

AIM/SYM/KIM

UPPER ll ower case ASCII

128 Additional user PrGgrammable

Characters: GRAPHICS-

SYMBOLS-FOREIGN CHARACTERS

Programmable Screen Format up to

SOCHARACTERS· 24 UN ES

KEYBOA~D and LIGHT PEN Inlerfaces

Up 1 0 4 K DISPLAY RAM

P ro vis ion t or 2 K EPROM

Provision to I Idd 6502 lor

STAND·ALONE SYSTEM

ASSEMBLED AN DTESTED

WITH 2K DISPLAY RAM

VIDEO PLUS: $24500

FOR

ADD UPTO FIVE ADDIT IONAL BOARDS

AUDIOfTTY CONNECTIONS

POWER TERMINALS

APPLICATION CONNECTORS

AIM/SYM/KIM

FULLY BUFFERED

FULLY DECODED

KIM·4 Bus Structure

MOTHER PLUS: $8000 FULLY ASSEM BLED AND TESTED

~ ~ l ! J ~ t mFO R

AIM /SYM /K IMS ame S IZE a nd SHAPE a s K IM/ SYM

P r o fe s si o n .J . 1 QU i II l it . ,.

Ooublt Sided, PI,J.I~ through Half'S

TwnSeb o f GOLD P ia l ed OUo iI II 22 F inRerl

DHi lned for WIR[ WRAP or

SOLDER Conneclions

Pr ov is io ns l or 4 0 14116 pin !loOcbls

"24140 p i n ! lo O c ke l i

:3 voltage regulators P RO TO P LUS: S4 ()O O

617/256-3649

PO Box 35 Chelmsford. rnA 0182.,

15:6

M I C R O - W A R E A S S E M B L E R 6 5 X X - 1 . 0 P A G E 0 1

- 3 7 2 : 7 D- 3 7 2 : 4 E] P O KE 8 82 , 2 1 5] PO K E 8 8 2 , 78

( F O R 1 1 0 B A U D )( F O R 3 0 0 B A U D )( F O R 1 1 0 B A U D )( F O R 3 0 0 B A U D )

R S- 23 2 D R I V ER R OU TI NE SR E V I S E D 3 - 3 0 - 7 9 B Y D ON A L D W . B I X B YR E V I S E D 6 - 6 - 7 9 B Y M I C R O S T A F F

T O C A L L T T I N I T F R O M S Y S T E M M O N I T O R : - < 3 0 A GT O C A L L V I D I N I T F R O H S Y S T E H M O N I T O R : - < 3 9 2 G

T O C A L L T T I N I T F R O M F P B A S I C : C A L L 7 7 8

T O C A L L V I D I N I T F R O M F P B A S I C : C A L L 9 1 4

T O R E A D F R O H T A P E :T O W R I T E T O T A P E :

- 3 0 A . 3 A 2 R- 3 0 A . 3 A 2 W

T O H A K E C H A N G E S :

T O C H A N G E W I N D O W W I D T H :

- < 3 1 3 : 4 8- < 3 1 3 : 5 0] P O K E 7 87 , 7 2] PO K E 7 87 , 8 0

( F O R 7 2 C O L U M N S )( F O R 8 0 C O L U M N S )( F O R 7 2 C O L U M N S )( F O R 8 0 C O L U M N S )

T O C H A N G E C A R R I A G E R E T U R N D E L A Y :

- < 3 4 B : 5 8

] PO K E 8 43 , 8 8

T O C H A N G E N U M B E R O F S T O P B I T S :

- 9 6 1 1 : O A- 3 6 4 : O B] P O K E 8 6 8 , 10] P O K E 8 6 8 , 1 1

( F O R 1 S T O P B I T )( F O R 2 S T O P B I T S )( F O R 1 S T O P B I T )( F O R 2 S T O P B I T S )

T O C HA N G E T H E B A U D R A T E :

0 3 A 3 W N D W T - $ 0 0 2 1 F O R T H E A P P L E I I0 3 A 3 C H - $ 0 0 2 4 C U R S O R H O R I Z O N T A L P O S I T I O N0 3 A 3 C S W L - $ 0 0 3 6 C HA R A C TE R O U T S W I T C H L O O R D E R0 3 A 3 C S W H - $ 0 0 3 7 C HA R A C TE R O U T S W I T C H H I O R D E R0 3 A 3 Y S A V E - $ 0 3 0 80 3 A 3 C OL C N T - $ 0 3 0 7 C O L U M N C O U N T L O C A T I O N0 3 A 3 M A R K - $ C 0 5 80 3 A 3 S P A C E - $ C 0 5 90 3 A 3 W A I T - $ F C A 80 3 A 3 R T S 1 - $ 0 3 0 90 3 0 A O R G $ 0 3 0 A0 3 0 A 1 9 2 1 T T I N I T L D A I H $ 0 0 2 1 E Q U A L S T T O U T - 7 6 8 P O I N T E R T O0 3 0 C 8 5 3 6 S T A C S W L R S - 2 3 2 R O U T I N E S , L O W B Y T E0 3 0 E A 9 0 3 L D A IH $ 00 03 E Q U A L S TTOUT/256

0 3 1 0 8 5 3 7 S T A C S W H H I G H B Y T E

0 3 1 2 A 9 4 8 L D A IH $ 0 04 80 3 1 1 1 8 5 2 1 S T A W N D WD T 7 2 C O L U M N W I N D OW W I D T H

0 3 1 6 A 5 2 4 L D A C H0 3 1 8 8 D 0 7 0 3 S T A C O L C N T P R E S E N T C O L U M N

0 3 1 B A 9 6 0 L D A IM $ 0 06 0

0 3 1 D 8 D 0 9 0 3 S T A R T S 1 S T O R E C O NS T A N T

0 3 2 0 6 0 R T S R E T U R N F R O M T T l N I T

0 3 2 1 4 8 T T O U T P H A S A V E C HA R A C T E R O N T H E S T A C K

0 3 2 2 4 8 P H A0 3 2 3 A D 0 7 0 3 T T O U T 2 L D A C O L C N T

0 3 2 6 C 5 2 4 C H P C H C H E C K F O R A T A B

0 3 2 8 6 8 P L A R ES T O R E C H A R AC T E R - .3 2 9 B O 0 3 B C S T E S T C T I F C A R R Y S E T , N O T A B

Q 3 2 B 1 1 8 P H A

MICRO - The 6502 Journal Augu~t. 1979

Page 9: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 9/60

Page 10: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 10/60

032C A9 AO032E 2C 09 030331 FO 030333 EE 07 030336 20 5F 030339 68033A 48033B 90 E6033D 49 OD033F OA0340 DO OD0342 8D 07 030345 A9 8A0347 20 5F 03034A A9 58034C 20 A8 FC034F AD 07 Q30352 FO 070354 E5 210356 BO 300358 AD 07 03035B 85 24035D 68035E 60035F 8C 08 030362 08363 AO OB

365 18366 48367 BO 05369 AD 59 co36c 90 0336E AD 58 CO371 A9 D7373 48374 A9 20376 4A377 90 FD379 6837A E9 0137C DO F5

37E 6837F 6A380 88

381 DO E3383 AC 08 03386 28387 60388 A9 8D38A 20 5F 0338D A9 0038F 4C 42 03392 A9 FO394 85 36396 A9 FD398 85 3739A A9 2839C 85 2139E A9 003AO 85 243A2 60

LDAIH $OOAO PRINT A SPACETESTCT BIT RTSl IS CHARACTER A CONTROL?

BEQ PRNTIT IF SO, BRANCH TO PRINT !TINC COLCNT IF NOT, INCREMENT COLUMN COUNT

PRNTIT JSR DOCHAR PRINT THE CHARACTERPLA RESTORE CHARACTERPHA AND PUT BACK ON THE STACKBCC TTOUT2 DO MORE SPACES FOR TAB CHAREORIM $OOOD CHECK FOR CARRIAGE RETURNASLA ELIMINATE PARITYBNE FINISH DONE UNLESS HAVE CARRIAGE RETU:

AUTOLF STA COLCNT CLEAR COLUMN COUNTERL DA IH $ 00 8AJSR DOCHAR PRINT A LINE FEEDL DA IM $ 00 58JSR WAIT 200 MS DELAY FOR CR LF

FINISH LDA COLCNTBEQ SETCS BRANCH IF COLUMN COUNTER = 0SBC WNDWDT ELSE SUBTRACT WINDOW WIDTHBCS RETURN RETURN IF IN THE MARGINLDA COLCNT

SETCS STA CH STORE NEW VALUE IN CHPLA RESTORE THE STACKRTS RETURN FROM TTOUT

DOCHAR STY YSAVE ROUTINE TO PRINT APHP CHARACTERLDYIM $OOOB FOR 11 BITS

CLC (2 STOP BITS)T TO UT 3 P HA

BCS HARKOULDA SPACE SEND A SPACEBCC TTOUT4

MARKOU LDA MARK SEND A MARKTTOUT4 LDAIM iOOD7 DELAY 9.091 HS FOR 110 BAUDDLYI PHA

L DA IH $ 00 20DLY2 LSRA

BCC DLY2PLAS BC IM $ 00 01BNE DLYl

PLARORADEY

BNE TTOUT3LDY YSAVEPLPRTS

R ET UR N L DA IH $ 00 8DJSR DOCHAR PRINT CARRIAGE RETURNL DA IM $ 00 00JHP AUTOLF

VIDINI LDAIH $OOFO POINT TO VIDEO DISPLAY ROUTINISTA CSWL LOW ORDER BYTEL DA IH i OO FDSTA CSWH HIGH ORDER BYTEL DA IM $ 00 28STA WNDWDT 40 COLUMN WINDOW WIDTHL DA IH $ 00 00STA CHRTS

O L TA BL E 20 00 20 9COLF 0342 CH 0024L 0036 DLYQ 0373ISH 034F HARK C058URN 0388 RTSQ 0309TCT 032E TTINIT 030AUTS 0366 TTOUTT 0371WDT 0021 YSAVE 0308

C OL CN T 0 30 7DLYR 0376M AR Ke U 0 36 ESETCH 035BTTOUT 0321HDINI 0392

N EX T B ITD EC RE ME NT Y

IF Y IS NONZERO,DO THE NEXT BIT

R ET UR N F RO M D OC HA R

S ET H OR IZ ON TA L C UR SO RTO 0 AND RETURN FROM VIDINIT

CSWHDOCHARPRNTITSPACETTOUTRWAIT

0037035F0336C0590323FCAS

MiCRO - The 6502Journal

[;J(!r!ll~~ ~ (!.!-!!)~ tm

. : : 1 ~:!l,;)~~ ~ ~"~4All I nc lude the Fol lowing Fea tu re s:

ALL M ETAL HEAVY DUTY CASE

ON/OFF SWITCH and PILOT L IGHT

11S /60Hz o r 2 ]0 /5OHz INPUT

GROUNDED THREE·WIRE

POwER CORD

P OW ER PL US 5: + 5V at SA, = = l2V at lA $7500

P OW E R P LU S S UP ER 5: + 5V at lOA, = = l2V at lA $9500

PO W ER P LU S 5124: + 5V at SA, + 24 at 2.5A. ± l2V at lA 59500

SPECIFICALLY DESIGNED FOR THE AIM 65

s nu ll E nou !! " 1 0 F il ln si de t he AIM Enc lo su re

E no ug h Powe r f or t he AIM &SFu ll y L oa de d

pl ul a n Additional Board

works on 11SVf60Hzor 230V/5OHl

Provides Rel!lulaled + SV at SA .lind + 2 4V. t 1 '"

GroundMi Thr~Wi~ Power (o,d

POWER A PLUS: $5000ON/OFF Swi tc h a nd Pi lot l ig ht

'~~W!jlil ~11[!!J~tm

ALL THE POWER A

KIM-1/SYM·1 NEEDS

Nt'at , Compact, Economical

Thouwndl in U~

INPUT; 115Vf&OHz

OUTPUTS: Regulated + 5V a t 1 .4A

+ 12V all.0A

Unrqulaled + 8V upto 4.3A

+16V up to 1.0A

will Pawl" 01 kIM·'fSYM., and ooe

Add it iona l B (l ar dS uc h a s MEMv~Y PLUS o r VIDEO

PLUSOWER PLUS: $4000

SUPERSCOPE C-190

by Marantz

A Hlgh Qua li t, . C .u se tt e Recorde r

wi th a ll o f the FeOltures Required

fOI M ic ro lomputer Sys tems :

VU Me te , Di spi av i Re co, di ng L ev el

110V AC 0' 6#VDC or Battery OperOllion

Tape lQl:ation Counter

Thr ee Recording Methods

Var iabl e Speed Con lr ol : ::!: 20% SUPERSCOPE (-190: $9000

Remote Ccnteol LeaeesEledroniC!! ON

617/256-3649

PO Box 35 Chelmsford. mR 018'2"

August, 1979

Page 11: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 11/60

Extending the SYM·1 Monitor

A program relocator, a program listing utility and aselective, extended trace routine illustrate how truemonitor extensions can implement additional functions

and commands.

When Synertek wrote the monitor for

the SYM-1, they left it open-ended byvectoring many of the major functionsthrough a system RAM-vector table. Bychanging the addresses in the vector

table, it is relatively easy to implementadditional functions and commands.

Thethree routines described in this ar-ticle are almost permanently resident inmy system. They have been coded as

true monitor extensions in that they useonly addresses already allocated to the

monitor and could easily be put intoROM.

The programs are not complex orlarge, but that is also one of their goodpoints. I have them sitting up in high

memory where they are out of the waybut available when needed.

The first program is a modified ver-sion of one that appears in The FirstBook of KIM. It is a program relocatorthat adjusts all the branches, jumps, and

absolute address locations in a programso that you can relocate it. It is really thenext best thing to a relocating loader.

The second routine is a little programlister that prints your program, putting

one instruction on each line. This iseasier to read and check than the stan-dard Verify or Papertape formats.

Finally, there is an extended traceroutine that displays the valuesof all theregisters, and additionally allows you to

specify that only a portion of your pro-

gram is to be traced. Did you everwonder what was happening to theregisters when one of your subroutines

is executed only five times in a two thou-sand repetition loop? This utility lets youdetermine just that. There is a price thatis paid, but I will get to that later.

If you have looked at the program

code yet, you may havewondered at theunusual address. After all, who everputsan extension in low memory? When I

decided to write this article, I intendedto use addres $COO, where I have it on

August, 1979

my system, but then I decided to changeit to low memory.

Almost everyonehas scratch memorythere to work on a program. After youenter it, check the memory dump, and

run a few tests; you can use the programto relocate itself!

Actually, what you have to do is blockmove the program to the desired ad-

dress and use the new UO command toperform the relocation on the new copy.Tell it the correct FROMandTOaddress,but make the program starting address

the new location. There are three loca-

tions that must be changed manually,and you are all set up.

Nicholas Vrtis5863 Pinetree S.E.Kentwood, MI 49508

Before I go into a discussion about. the programs, Iwould like to mention the

interfaces to the SYMmonitor that areused, and a few that aren't but are sortof handy anyway. The programs them-

selves are not complicated, and I try tokeep them pretty well commented.

TheSYMmanual contains a small ex-

ample showing how to add a commandto the monitor, but isn't really clear

about how it works. For one thing, themonitor uses the unrecognized com-mand vector for more than just the UO

through U7 user commands. It does a

jump via this vector whenever it en·counters a command it cannot process,

or a character that is non-hex.

M IC RO -W AR E A SS EM BL ER 6 5X X- l. 0 P AG E 0 1

0 01 0 :0 02 0 :0030:0040:0050:0060:0070:0080:0090:0100:0 1 10 :0120:

0130:0140:0150:0160:0 17 0 :0180:0190: 02000200: 0200 530210: 0201 440220:0230:0240:0 25 0: 0 20 2 320260: 0203 320 27 0: 0 20 4 430280: 0205 2C0290: 0206 410300: 0207 360310: 0208 360 32 0 : 0209 44

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •" S YM -l U SE R M ON IT OR F UN CT IO N E XT EN SI ON S

"" MODIFIED 7/3/79 BY MIC RO STAFF "" u o - R E LO C AT E P RO G RA M "" Pl = F RO M A DD RE SS "" P2 = T O A DD RE SS "" P3 = S TART O F P ROGR AM "" Ul - M IN I- PR OG RA M L IS TE R "" Pl = P RO GR AM S TA RT IN G A DD RE SS "• P2 = P RO GR AM E ND IN G A DD RE SS "" ---- USER TRAC E ROUTINE Y-X-A-FLAGS-STACK "• A626 = I NC LU SI VE T RA CE S TA RT IN G A DD RE SS "• A62C = E XC LU SI VE T RA CE E ND IN G A DD RE SS "

"• SYM COMMAND 'E 200' WILL SET UP VARIOUS AD DRESSES •• A ND VALUES F OR T HESE EXTENSIONS "• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

ORG $0200INITCO = $53 STORE "SD" USER ROUTINE VECTOR

$44

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• CHANGE THE FOLLOWING WHEN RELOCATING THE PROGRAM "• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

$32 STORE "22C" AND C HANGE$32 IF ADD RESS CHANGES$43$2C STORE" ,A66D "$41$36$36$44

MICRO - The 6502 Journal 15:9

Page 12: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 12/60

020A OD020B 4D020C 41020D 36020E 35020F 380210 OD

0211 310212 380213 OD0214 530215 440216 38

0217 30. 0 2 18 4 30219 30021A 2C021B 41021C 36021D 37021E 41021F OD

0220 530221 44

0222 330223 340224 310225 2C0226 410227 360228 370229 34022A OD022B 00

0 :

0 :

0 : 0 22C0 ; 0 22C; 0 22C

0 ; 0 22C

0 ;

0 :

=

$OD$4D$41$36

$35$38$OD

$31$38$OD

$53$44

$38

$30$43$30

$2C$41$36

$37$4 1$OD

$53$44

ST ORE " SD "

STORE "MA658" AND C HANGEM AX R EC OR DTO BETWENTY-FOURB YT ES L ON G

ST ORE " 18 "

SET TRAC E VEC TOR

S TO RI NG S TR IN G " SD 80 C O, A6 7A "

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• CHANGE THE FOLLOWING WHEN RELOCATING THE PROGRAM •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

$33 STORE "341" AND CHANGE IF ADDRESS CHANGES

$34$3 1$2C STORE ",A614"$4 1$3 6$3 7$3 4$O D$00 ZERO IS END OF EXEC REQUEST

• •• •• •• •• •• •• • * * • • •• •• •• • * * • •• •• •• •• •• •• •• •• •• •• •• •• ••• PAGE ZERO AD DRESS LOCATIONS •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

CURAD •

CURADn •ADJUST •ADJUSH •

$OOFE SYM-l "OLD ADDRESS LOW ORDER$OOFF AND HIGH-ORD ER$OOFC SYM-l PAGE ZERO SCRATCH AREA LOW-ORDER$OOFD AND HIGH ORDER

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

• BY JIM BUTTERFIELD (SEE "THE FIRST BOOK OF KIM") •

• MODIFIED BY N. VRTIS TO RUN AS MONITOR •

• EXTENSIONS ON THE SYM-i •, .• THIS PROGRAM ADJUSTS ABSOLUTE AND RELATIVE •

• ADDRESSES OF A PROGRAM SO IT CAN BE RELOCATED •, OR EXPANDED ,

• »»> NOTES: ,• 1- PAGE ZERO REFERENCES ABOVE $8000 WILL NOT •• BE CHANGED UNLESS SPECIFIED AS ABSOLUTE •

• THREE-BYTE INSTRUCTIONS •• 2- ANY REFERENCES ABOVE $8000 WILL NOT BE •

• CHANGED •, 3- PROGRAM STOPS WHEN IT FINDS AN ILLEGAL ,

• OPERATION CODE (CAN USE $ FF) •

• 4- DON'T RELOCATE DATA •,• INPUT PARMS: ,• PARM 1 - RELOCATE FROM A DDRESS •

• (FIRST OPCODE THAT W ILL M OVE) •, PARM2 - RELOCATE TO ADDRESS (WHERE PARMl ,

• WILL BE MOVED TO) •• PARM3 - PROGRAM START ADDRESS (FIRST •, INSTRUCTION I N PROGRAM •. ..,. . . . . . . . " . .." . , " , . , " " " " ' , . , . . ." . . . . . . . . . .,

022C CD 57 A6 CMP LS TC OM S EE I F C OMM AN D T ER MI NA TE D PR OP ER LY022F FO 02 BEQ UO YES -- SEE WHICH COMMAND0231 38 COMERR SE C ELSE SET CARRY AS ERROR FLAG0232 60 RTS AND RETURN TO MONITOR FOR ER XX

0233 c9 14 UO CMPIM $14 M AK E SU RE IT IS " u o "0235 FO 03 BEQ UOC OMM BRANC H IF IT IS

MICRO - The 6502 Journal

This means that it gets used for a lotof junk in addition to the defined user

commands. It also means that you canuse characters other than Un as com-

mand extensions, if you want, as long as

they are not used for valid SYM com-mands with the same number of para-

meters.

Themcnitor saves the command valuein a location called LSTCOM. When a

carriage return is entered, the monitor

reloads the command into the A registerand loads the number of parameters intox .

So , the first thing our monitor exten-

sion should do is check the character inA against the value in LSTCOM. If they

are the same, the program was called

after normal command termination. Ifthey are different, the command was not

terminated properly and we want to

make sure the carry is set and returnwith an RTSinstruction .

This will cause the monitor to print thestandard "ER xx" message and return to

command mode.

Once we know that the command wasterminated properly, we have to deter-mine which command it was. As I men-

tioned earlier, the monitor does notverify the command character as it is

entered, so we could be here for any-thing, including a "valid" command with

the wrong number of parameters.

Finally, if we are on the right com-

mand, and if it was terminated properly,the last check is to makesure that exact-

ly the correct number of parameters hasbeen entered. If not, there wil l be miss-ing information, or information will be in

the wrong place. For any errors, all the

extension has to do is guarantee thatthe carry is set and return to the monitorwith an RTSinstruction.

As an aside, the command processor

does not initialize the stack register, andso, if you are debugging an extensionand stop it before the RTS to themonitor, you can quickly use up a lot of

the stack area. This only hurts if you

have a routine or two located there, as Iusually do.

Themanual claims that locations $F8

through $FF are reserved for monitoruse. Did you everwonder what they are

used for? Unfortunately, these locationswerenot assigned a variable name in themonitor assembly, so there are no crossreferences to them in the listing. I have

tracked down most of the applications,but I don't guarantee that I didn't miss

one.

The most used locations are probably

$FE and $FF. These are the locations

August, 1979

Page 13: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 13/60

that the monitor uses for almost all ofit's indirect addressing. If you look atthe

command descriptions, this is where the"OLD" address is kept.

These programs use it in the same

manner that the monitor does. It's im-possible to display these locations viathe monitor commands directly, but do-

ing a Verify or Memory will show youwhat they are pointing to. Also, if you

plan to use them, none of the monitorroutines will change them, but almostany command will.

Another important pair of locations is$FAand $FB. Thesecontain the address

of the next byte to be obtained as inputwhen processing in the execute mode. Ifyour program modifies these locations,

it can't be invoked from the execute

mode.

As another aside about the executemode, all input comes from RAM, so ifyou do a JSR INCHR and expect to get

keyboard input while in execute mode itwon't work. Theexecute command is the

only one that modifies these addresses.The other locations are pretty much

scratch locations; you can probably usethem without affecting command opera-

tion, but I would not count on them be-ing the same after any call to monitor

service routines.

The cassette routines use $FC and$FD,as does the block move command.

Terminal input uses $F8 as a characterbuildup area, and terminal output uses$F9 to hold the character as it is beingoutput. There may be a few other uses,but I would stay away from these unlessyou are really desperate for page zerospace, or you are writing monitor exten-

sions.

TheSystem RAMareas are much bet-ter documented in the monitor listing.They have also been assigned names,and therefore appear on the assembly

cross reference list. These programsonly deal with two main areas. This is$A630 through $A63F, and they aremonitor scratch areas.Thetwo bytes us-ed here are not used by the monitor, ac-cording to the cross reference lists.

The locations $A64A through $A64Fare the addresses where the monitor col-

lects input parameters. Each is a twobyte parameter area, and all three areas

are initialized to zeroat the start of com-mand processing. The problems beginwhen you find that the labels P1,P2and

P3 are a little misleading. The monitorstarts collecting parameters in the P3area, and rotates the whole area 16bits

left for each new parameter. It works outall right for three parameters, but twoparameters will end up in P3 and P2,

while one ends up in P3.

August, 1979

1110: 0237 4C DE 02

1120: 023A EO 03

1130: 023C DO F31 1 4 0 :

1150:1160 :

1170: 023E 381180: 023F AD 4C A6

1190: 0242 ED 4E A61200: 0245 85 fC1210: 0247 AD 4D A61220: 024A ED 41 ' A6

1230: 0240 85 I'D1240:1250:1260:

JMP U1 GO TRY AS U1 COMMAND

UOCOMM CPXIM $03 MAKE SURE HAVE THREE PARMS

ENE COMERR BRANCH FUR ERROR IF NOT

• N OW C O~ jP UT E T HE A DJ US TM EN T l NC HE ME NT

SEC SET B ORROW

LOA P2L GET LOW-ORDER "TO"ssc P1L CALC DIfFERENCEST A ADJUST SAVE IN PAGE ZERO LOW- ORD ER

LOA P2H SAME FOR HIGH-ORD~RSBC P1H

STA ADJUSH 11 ' GOES INIO PAGE ZERO ALSO

* NOW PUI PROGRAM POINI~R Tu PAGE Z E R O

1270: 024F 20 A7 82 JSR P3SCH1280: •••••••••••••••••••••• I f •••••••••••••••••••••••••••••••

* GET AN apCODE HERE• • • • • • • • • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • • • • • • • •• • • • • • • • •

0252 20 24 03 GETUP JSR

0255 30 07 BMI0257 FO 2A BEQ

D ET LE N. F IN D OP CO DE LE NGT H AN D T YPE

TRIPLE MINUS IS LENGTH 3 OR BAD TYPEBRANCH ZERO IS A BRANCH

* • • • • • •• • ** •••••••••••••••••••••••••••••••••••••••••••* HER~ WE HAVE TO SKIP FORWARD TO NEXT oPcaDE •••••••••••••••••••••••••••••••••••••••••• **.** •••• ***.

0259 20 1A 03 SKIP1 JSR ADVANO

025C fO f4 BEQ GETOP AND THEN GO GE~ THE NEXT apCODE

• • • • • • • • • • • • * • • • • • • • • • • • • * • • • • • • • • **.** ••• ** • • • •• • • * • •

• GOT A 3 BYTE apCODE ! ILLEGAL! OR END (SPECIAL) *••••••••••• ** ••• * • •• • ** •••••••••••••••••••••••••••••••

1 2 9 0 :

1300:1310:1320:

1330:1340:1350:1360:1370:1380:

1390:1400:

1 4 1 0 :1420:1430:1440:

1450:1460:1470: 025£ c81480: 025F fO OF1490:1500: 0261 20 15 8j

1510: 0264 20 42 831 52 0: 0 26 7 A D 001530: 0269 B1 FE

1540: 0268 20 FA 821550: 026E 181560: 026F 60

1570:1580: 0270 c8

1590: 0271 Bl FE1600: 0273 AA1610: 0274 c81620: 0275 B1 FE1630: 0277 20 86 0210=02

0010:0020: 027A 91 FE0030: 027c 880040: 0270 8A0050: 027E 91 FE

0060: 0280 4C 59 020070:0080:0090:0100:0110:0120:

0130: 0283 c80140: 0284 A6 FE0150: 0286 A5 FF0160: 0288 20 B6 02

0170: 028B 8E 30 A60180: 028E A2 FF0190: 0290 Bl FE0200: 0292 180210: 0293 69 020220: 0295 30 01

TRIPLE INY BUMP Y BY O~EBEQ FIX3BY IF NOW ZERO IT IS A 3 BYTER

QulTDli J SR CRLFSZ OUTPUT LAST ADDR~SSJSR SPACE FOLLOWED BY A SPACELDYIM $00 AND THE OPCODEL DA IY C UR AD

JSR OUTBYTCLC CLEAR THE CARRYRTS AND RETURN TO SYSTEM

FIX3BY INY MAKE Y=1 NO W

LDAIY CURAD LOW-ORDER PART JF ADDRESSTAX PUT INTO X

INY NOW M AKE Y =2LDAIY CURAD HIGH-ORDER PART OF ADDRESSJSR ADJST GO CHANGE ADDRESS IF NECESSARY

STAIY CURAD PUT HIGH-ORDER BACKDEY

!XA

STAIY

JMP

MAKE Y= 1LOW-ORDER TO A

CURAD PUT IT BACK ALSO

SKIPl . G O SKIP FORWARD TO NEXT OPCODE

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• GOT A BRANCH - HAVE TO CHECK• BOTH "TO " AND "FROM" ADDRESSES• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

BR ANC H IN Y MAKE Y= 1LDX CURAD GET CURRENT LOCATION LOW-ORDERLDA CURADH AND HIGH-ORDERJSR ADJST FIX IT IF NECESSARYSTX SCRD SAVE LOW-ORDER FOR NOWLDXIM $FF SET FLAG FOR BACK REFERENCELDAIY CURAD GET RELATIVE BRANCH AMOUNTCLCADCIM $02 ADJUST THE OFFSETBMI OVER BRANCH IF BACKWARDS BRANCR

MICRO - The 6502 Journal 15:11

Page 14: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 14/60

Page 15: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 15/60

possible by the subroutine DETLEN. Ihaveto give credit to Jim Butterfield andThe First Book of KIM for that routineand for most of the relocate program.DETLENnot only determines the instruc-

tion length, but also classifies it as oneof four types: a branch (Y= 0) an ab-

solute address reference (Y= FF)an "in-valid" instruction (Y= FE)and all others(Y=number of bytes in the instruction).

The invalid opcodes detected are onlythose with bits 0and ion. This is not all-

inclusive, but it does cover quite a few of

the undefined opcodes. Thenormal pro-cedure for operating the program is toinsert an FFafter the last program state-

ment, since the relocate program stopswhen it encounters an "invalid" opcode.

This sometimes catches anattempt torelocate a data area instead of a pro-gram, which is a definite no-no.Thepro-gram can't tell the difference between

most data and instructions, so make

sure you stop it before it tries to "fix"the "addresses" in your data. If you getinto the habit of collecting your data

areas inone place, your programswill be

easier to relocate.

If you follow the code, you will seethat there is a lot more work involved in

relocating a branch instruction than infixing an absolute address reference.This is because the program has to com-pute the effective FROM and TO ad-

dresses before it can determine whetherthe relative byte count has changed.

I havealso included a routine to verify

that the sign (bit 7)of the new displace-ment is the same before and after therelocation. This routine was added

shortly after the first time I relocated abackward branch into a forward branch,

by overflowing the sign, and started ex-ecuting one of the 6502's INMI instruc-tions (INMI = Ignore Non-Maskable In-terrupt).

The program lister was really easy todo with subroutine DETLENavailable. Ihave a CRT running at 1200baud, so I

set the program up to list a screenfull oflines at a time, and then wait for any keybefore continuing with the listing. If you

have a printer, or run at a slower baudrate, you might want to ignore the MAX-RCcount, do a call to INSTATafter eachline, and only stop when the break key is

entered. Remember, INSTAT returns

with the carry set if the break is entered,

and clear otherwise.

The extended trace routine isprobably the hardest to understand. Italso requires one hardware change asoutlined in the SYM manual. Thatchange is the installation of jumpersW-24 and X-25 . These enable softwarecontrol of the debug flip-flops, but onlyup to a certain point.

August, 1979

1010102010301040:1050:1060:

1070:1080:1090:1100;1110:1120;

1130;1140:

1150;1160;

1170:

1180:1190:1200:1210:1220:

1230:1240:1250:1260:1270:1280:1290:1300:1310:1320:1330:1340:

1350:1360:1370:1380:1390:1400:1410:1 4 2 0 :1430:1440:1450:1460:1470:1480:1490:

1500:1510:1520:

1530:1540:1550:1560:1570:1580:

1590:1600:1610:1620:

ID=03

0010:0020:0030:0040:0050:0060:

0070:0080:0090:0100:0110:

0120:

0130:0140:

C UR RL P LD AI Y C UR AD

JSR OUTBYTIN YCPY BYTES

02F4 20 42 83 CUROP JSR SPACE LEADING SpACE02F7 20 24 03 JSR DETLEN MAKE SURE GOT CURRENT LINE LENGTH02FA AD 00 LDYIM $00 INIT Y T O ZERO

G ET C UR RE NT OP CO DEOUTPUT ITBUMP TO NEXT BYTESEE IF DONE

BNE CURRLP LOOP FOR CURRENT NUMBER OF BYTES

JSR ADVANC ADVANCE TO NEXT INSTRUCTIONBCS PGMDON SEE IF TO ENDDEC COUNT ELSE DECREASE LINE COUNTBPL LISTLP GOT MORE TO DO IF POSITIVE

JSR INCHR WAIT FOR ANY CHARACTER

BEQ PGMDON EQUAL MEANS C/R AND HE WANTS QUITSBNE LISTER ELSE CARRY ON. * .

• END OF PROGRAM ENCOUNTERED - RETURN TO MONITOR

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

PG MD ON C LC

R1S

CLEAR CARRY FOR OK RETURNA ND R ET UR N

02FC Bl FE

02FE 20 FA 820301 c80302 CC 32 A6

0305 DO F5

0307 20 lA 03030A BO DC030C CE 31 A6

030F 10 EO

0311 20 1B 8A

0314 FO 020316 DO D3

0318 18

0319 60

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• AD VANC E TO NEXT INSTRUC TION••••••••••••••••••••••••••••••••••••••••••••••••••• t•• *

031A AE 32 A6 ADVANC LDX031D 20 B2 82 ADVILP JSR0320 CA DEX0321 DO FA BNE0323 60 RTS

0324 AD 000326 Bl FE

0328 A80329 A2 07

032B 98032C 3D 82 03032F 5D 89 030332 FO 030334 CA0335 DO F4

0337 BC 99 03033A sc 32 A6033D BC 91 030340 60

BYTES GET BYTE COUNTI NC CMP BU MP C UR RE NT A DD RE SS

D EC RE AS E C OU NTADVILP LOOP UNTIL ALL BYTES ARE COUNTED

R ET UR N H ER E

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• D ET ER MI NE TH E I NST RU CT IO N L EN GT H* * • • •• **•••••••••••••••••••••••••••••••••••••••••••••••

DETLEN LDYIM $00 IN!T Y TO ZEROLDAIY CURAD PICK UP CURRENT OPCODE

• ENTER HERE IF "A" ALREADY HAS OPCODE IN IT

D ET LNl T AYLD XIM $07

SAVE IN YGOl SEVEN TABLE ENTRIES TO CHECK

C HK LOP T YAANDXEORXBEQDEXBN E

PUT OPCODE BACK INTO ATABOUT -01 REMOVE THE DON'T CARE BlTSTABTST -01 TEST THE REST

FOUND BRANCH IF FOUND THE MATCHELSE TRY NEXT ENTRY

CHKLOP UNTIL ALL ARE LOOKED AT

FOUND LDYX TABLEN GET LENGTH FROM TABLESTY BYTES SAVE THE LENGTHLDYX TABTYP NOw LOAD THE OPCODE TYPERTS AND R ETURN

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• ALTERNATE USER TRAC E ROUTINE

•• BY: NICK VRTIS -- LSI/CCSD F EB RU AR Y 1 97 9

•• ALTERNATE TRAC E ROUTINE TO PRINT AD DITIONAL D ATA

•• W IL L P RI NT P RO GR AM C OU NT ER -Y -X -A -F LA GS -S TA CK• ONLY PRINTS FOR PROGRAM ADDRESS IN RANGE OF ADDRESS

• SPECIFIED BY:• A62C - EXCLUSIVE ENDING ADDRESS

• (SYM DEFAULT IS 0 000)

MICRO - The 6502 Journal 15:13

Page 16: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 16/60

0690:0700:0710:0720:0730:0740:0750:0760:0770:0780:0790:0800:0 81 0 :

0820:0830:0840:0850:0860:0870:0880:0890:090009100920

0150;0160:0 17 0 ;0180:0190:0200:0210:

• A626 - INCLUSIVE STARTING ADDRESS• (SYM DEFAULT IS 0 000)• TRACE VELOCITY IS IGNORED IF TRACE IS NOT IN RANGE• KEYBOARD IS CHEC KED AND RETURN• IS TO MONITOR IF KEY OR BREAK• RE GARD LESS OF AD DRE SS

When I started writing this routine, itwas only going to bea one night project.It turned out to be a project all right, butit was more than one night. In the mean

time, I found the program bug that caus-ed me to write the extended trace in thefirst place. It has been useful on a

number of later projects, though.

Let me tell you some things about theSYM implementation of hardware

debug. It all starts with a non-maskable

interrupt which is generated at the com-pletion of each instruction that is not a

SYMmonitor address, provided that thedebug flip-flop is set. The6502picks upthe address contained in locations$FFFA and $FFFB as the interrupthandler. Do to wiring "mirrors", $FFFA

and $FFFB are actually $A67A and$A67B, which are system RAM ad-dresses.

Normally, this vector contains the ad-dress of SVNMI,which is the usual traceroutine. Thefirst thing the monitor doesis unprotect system RAM,and then save

all the registers, flags, and programcounter in the user register savearea in

system RAM_It then resets the debugflip-flop sothat it isoff. Forthe extended

trace, this vector is changed to point toanother SYMmonitor routine that doesthe same things, but exits via an indirectjump through system RAM locationTRCVECto the user trace routine.

In theory, this means that the user

routine should be able to do just aboutanything the monitor can do. The hardfacts of life are that the debug key

bounces, and the monitor does not de-bounce it before you get control, but itdoes reset the flip-flop.

This is no problem if I am in the

monitor (say, waiting for input) when Ipress the debug key. Since the monitor

does not get interrupted, by the time aninterrupt Isgenerated, the key is throughbouncing, and only the interrupt isgenerated.

If, on the other hand, a user programis executing and I press the debug key,

the extended trace routine get controlbefore the key has finished bouncing.This means that an interrupt is

generated within the extended trace andit starts traclnq itself.

At first glance, the solution would

seem the same as for any other bouncy

input; namely,to wait for it to settle. Theonly problem is that the extended tracegets only ONE instruction done before

the routine is interrupted. Thebest that Icould do was check to see If it is tracingItself and exit gracefully to the monitor ifso. Unfortunately, the register save areadoesn't contain any more useful infor-mation, but then, there is a price foreverything.

August, 1979

,

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •0220:0230: 0341 AE 59 A6 USRTRA LD X USREGS ALWAYS EXEC UTES SO X IS OK0240: 0344 AD SA A6 LD A USREGS +01 A WILL BE OK IF SELF TRACING0250:0260:0270:

0280:0290:0300:0310:0320:0330:0340:0350:0360;0370:0380:0390:0400:0410:0420:0430:0 44 0 :0450:

0460:0470:0480:0490:0500:0510:0520:0530:0540:0550:0560:0570:0580:0590:0600:0610:0620;0630:

0640:0650:0660:0670:

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• C HA NG E T HE F OL LO WI NG I NS TR UC TI ON

• TO HIGH-ORDER OF PAGE LOCATED ON• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

0347 C9 03 C MPIM $03 SEE IF TRACING MYSELF0349 FO 35 BEQ RETURN034B CD 2 D A6 CMP THIGH + 01034E DO 03 BNE HI0350 EC 2C A6 CPX THIGH0353 BO 28 HI BCS NOT RAN BRANCH IF TOO HIGH

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• IT IS LESS THAN THE UPPER LIMIT• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

0355 C D 27 A60358 DO 03035A EC 26 A6035D 90 lE LO

CMP TLOW +01 CHECK AGAINST LOWER LIMITBNE LOCPX TLOWBC C NOT RAN BRANCH IF NOT IN RANGE

• IT IS IN RANGE - OUTPUT GOODIES

035F 20 4D 83 JSR CRLF START ON NEW LINE0362 20 E E 82 JSR OUTPC0365 A2 0 5 LDXIM $050367 BD 5A A6 D SPREG LDAX USREGS + 01036A 20 42 83 JSR SPACE OUTPUT LEADING SPACE036D 20 FA 82 JSR OUTBYT NOW THE D ATA AS 2 HEX0370 CA DEX0371 DO F4 BNE DSPREG0373 EC 5 6 A6 CPX TV C OMPARE 0 TO TV0376 FO 08 BEQ RETURN EQUAL WILL ALSO HAVE C ARRY SET

• PERFORM THE DELAY ACC ORDING TO TV VALUE

0378 20 SA 83 DODELA JSR DELAY037B BO 03 BC S RETURN IF KEY WAS D OWN - D ON'T C HECK AGAIN

• NOT IN RANGE - C HEC K FOR KEY DOWN ANYWAY

037D 20 86 83 NOTRAN JSR INSTAT CHECK FOR KEY DOWN

• RETURN WITH CARRY ON FOR RETURN TO MONITOR• CARRY OFF TO C ONTINUE TRACE

0380 4C BB 80 RETURN JMP DBRTN RETURN WILL CHEC K CARRY

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• TABLES FOR D ETLIN• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

0383 DC0384 1F0385 OD0386 87

0387 1F0388 FF0389 03038A DC038B 19038C 08038D 00038E 10038F 200390 030391 02

TABTST

$OC$lF$OD$87

$lF$FF

$03$OC$19$08$00$10$20$03$02

MASKS TO REMOVE D ON'T C ARE BITSABOUT

TABTYP

MICRO - The 6502 Journal

Page 17: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 17/60

Now that we have that explanationout of the way, on to a discussion of themechanics of the trace routine. Actually,

the hardest part is making sure the carrygets set or cleared, before returning to

DBRTN,so weeither continue tracing orexit to the monitor. If the program is

tracing itself, or if the trace velocity is

zero, the return is executed immediatelyafter a compare instruction that resulted

in an equal condition which sets thecarry.

If the trace velocity was not zero,then

this routine uses the DELAY routine toslow down the execution rate. DELAYeven checks the keyboard, via INSTAT,

for a break key and sets the carry ap-propriately. The check of the carry is

made after the jump to DELAYso thatthe program doesn't check the keyboardtwice. The second check would probably

get the opposite results if the keypadwere being checked, since KEYQ de-bounces the keypad.

You should also note that even if theaddress is not in the requested range,the program does a call to INSTAT,any-

way, to check for a key down or thebreak key. This is soyou can interrupt aprogram outside your requested trace

range. Remember, the debug key isalready causing the extended trace to be

invoked, so you can't stop the programwith that.

Thefinal thing to remember about thetrace routine is that even for those ad-dresses you have not selected, there are

an awful lot of instructions executedbefore that fact is determined. Effective·Iy, your cycle time has slowed drastical-

ly when debug is on, and I mean byorders of magnitude. This can be sur-prising at times, especially when the

code you are bypassing initializes a twothousand byte array.

Last but not least, I would like to ex-plain the strange code that appears at

the start of the program. It comprisesthe ASCII commands that set up theuser command vector, the MAXRC bytecount, and the extended trace routineaddresses. By putting them there, lonlyhave to remember one address insteadof half of a dozen. By using the SYMex-

ecute command, all the addresses getset up for me.

Don't forget to change the addresses

referenced in the execute commands

when you relocate these routines. Alsoremember that the addresses must be inA~CII, not in hex.There is also one place

in the extended trace routine that mustbe changed to equal the high order byteof the address the routine resides at.This is so the routine can tell if it is trac-

ing itself. It also means the programwon't trace any other program on thatpage.

August, 1979

0930 0392 FF $F F

0940 0393 FF $F F

0950 0394 01 $0 1

0960: 0395 01 $0 1

0970: 0396 00 $0 0

0980: 0397 FF $F F

0990: 0398 FE $F E

1000: 0399 02 TABLEN $02

1010: 039A 03 $0 3

1020: 039B 03 $0 3

1030: 039C 01 $0 11040: 039D 01 $0 1

1050: 039E 02 $0 21060: 039F 03 $03

1070: 03AO 03 PGMEND $0 31080:

1090: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •1100: • SYM SYSTEM ROUTINE ENTRY POINTS AND RAM ADDRESSES

1110: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •1 12 0 :

1 13 0 : 0 3A 1 DBRTN • $80BB CHECK CARRY & TRACE O R MONI TOR

1140: 0 3A 1 ERNOCR • $8177 nERXX" W/ O CR/LF -- JUMP TO ONLY1150: 03Al P2SCR • $829C PUT npARM2" INTO "CURAD"1160: 03Al P3SCR • $82A7 PUT "PARM3" INTO "CURAD"

1 17 0 : 0 3A l INCCMP • $82B2 BUMP nCURAD" & COMPARE TO PARM31180: 03A1 OUT PC • $82EE OUTPUT USER P ROGRAM COUNTER

11 90: 0 3Al OUTBYT • $82FA PRINT A (TWO HEX DIGITS)

1200: 0 3A 1 CRLFSZ • $8316 OUTPUT CR/LF AND "CURAD"1210: 0 3A 1 SPACE • $8342 OUTPUT ONE SPACE1220: 03A 1 CRLF • $834D O UT PU T C R/L F

123D: 03Al DELAY • $835A DELAY ACCORDING TO TV

12'0: 0311 INSTAT • $8386 GET KEY STATUS (BREAK

1250: OR ANY KEY DOWN)1260: 03!1 UiCHR • $8A1B GET ASCII CHAR V IA " IN VE C"1210:1260: • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •12410:1300: 03!1 TLOW • $A626 TRACE LOW ADDRESS1310: 03J,1 THIGH • $A62C TR ACE HIG H ADDR ESS

1320: 03J,1 SCRO • $A63D SYSTEM SCRATCH AREA 0

r13O: 03A1 SCRl • $A631 SYSTEM RAM SCRATCH AREA 1

nile: 03J,1 BYTES • $A632 SYSTEM RAM SCRATCH AREA 2

1150: 03'-1 COUNT • SCRl USE SCRATCH AREA 1

nllo: 03'-1 P3 L • $A64A INPUT PARAMETER VALUES

l370: 03A1 P3H • $A6I1B

1 380: 0311 P2 L • $A6I1C

1390: 0 3A 1 P2 H • $A6I1DIlWO: 03A1 PI L • $A64E

111m: 03A1 P1H • $A6I1F1420: 0311 ENDAD • P3 L ENDING ADDRESS IS IN P3 AREA

11130:

11140: 03A1 TV • $A656 T RA CE V EL OC IT Yl.li50:03! 1 LSTCOM • $A657 C OM MA ND E ND I ND IC AT ORllf60: 03A1 MAIRC • $A658 MAX IMUM RECOR D/BYTES FOR OUT PUT111:10:03'1 USREGS • $A659 TRACE HOLD OF USER REGISTERSID:

S YM BO L T AB LE 20 00 21C8ADJST 021>6 ADJUSH OOFD ADJUST ODFC ADVANC D31AADYlLP 031D BRANCH 0283 BYTES A632 CHKLOP 032BCOHERR 0231 COIlNT A631 CRLF 834D CRLFSZ 8316CURAO OOFE CURlDH DOFF CUROP 02F4 CURRLP 02FC

DBR'l."N80BB DELAY 835A DETLEN 0324 DETLNQ 0328DODEL! 0378 DSPREG 0367 ENDAD A64A ERNOCR 8177Fr ISBY 0270 FOUND 0337 GETOP 0252 HI 0353lliCCKP S2E2 INCHR 8A1B INITCO D200 INSTAT 8386l.ISTER 02EB LlSTLP 02Fl LO 035D L ST CO M A 65 7

KAIRC A658 NOrRAN 037D OUTBYT 82FA OUTPC 82EE(lin 02CD OVER 0298 PGMDON 0318 PGMEN D 03AOPQII A6JlF PQL A611E PR n A611D PRL A64CPRSCR 829C PSH A611B PSL A64A PSSCR 82A7QU ITDO 0261 RE'lURN 0380 SCRP A630 SCRQ A631Sl GNCH 02CE SIGNOK 02DD SKIPQ 0259 SPACE 8342IABLEN 0399 !ABOUT 0383 TIIBTST 038A TABTYP 0391TESTR 02C2 THIGH A62C TLOW A626 TRIP LE 025E

tY A656 UP 0233 UPCOM M 0 23A uQ 02DED(,ERR 02E6 DQSTRT 02E6 USREGS A659 USRTRA 0341

MICRO - The 6502Journal 15:15

Page 18: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 18/60

uter : I III I I

rumllill

BUSINESS

EDUCATIONAL

PERSONAL

(213) 921-211_1

14052 EAST FI RESTONE BOULEVARD . SANTA FE SPRINGS, CALIFORNIA 90670

(714) 739-0711

Apple II Softwarefor

the

We do not claim to have the largest selection of APPLE II software available, however, we do have a good selection and it is growing larger every

week. This is a partial list of the software that we normally have in stock. To get a complete list of all our software, send for our new APPLE II

software catalog that will be available next month. This catalog will give you descriptions of most of the software listed so that you can tell whatthe program will do before you buy. Due to the ease of copying software, we cannot give any refunds for any software. Should something be

wrong with the media that the software is on, we will exchange it for a good one. Starting with this ad, we will pay all shipping and handlingcharges for orders over $25.00 in the continental United States. Orders under $25.00 add $2.50 for shipping & handling. Orders outside the U.S.

add 10% or $10.00 whichever is more.

001-00015

001-00021001-00036001-00042001-00057

001-00063001-00079

DOl-00090

001-00106

001-03813

001-03829

001-03834

001-03840

001-03855

001-03861

001 -03877

002-00112

002-00128

002-00133

002-00149

002-00154

002-00160002-00176

002-00181

002-00197

002-00203

002-00219

002-00225002-00230002-01473

002-01489002-01495002-01571

002-07123002-07138

002-07144

002-07159

002-07165

D02-07~71

002-07186

002-07192

004-00343

004-00337004-00358004-00364004-00370

004-00385

004-00391

004-00406

004-00428

004-00433004-00449

004-00454

$20. 00

$15. CO

$ 7.50$20.00

$ 7.501 7.50

s 7.50

s 7.50

$25.00~12. 00$12.00~12. 00

112.00

$12.00

110.50

116.50

IH.95

1 9.95

I 9.95

$24.95~24. 95

S 9.95

s 9.95

$ 9.950:: 9.95

~ 9.95$14.95s 7.45

I 9.95

$ 9.95

$ 9.95

$ 9.95

$19.95

$ 9.95

$14.95

1 7.45

1 9.95

$ 9.95

114.95

I 9.95

1 9 95

$39.95

$39.95

$ 9.95

$ 9.95

$19. 95$39.95

s12.95$19.95$1S. 95

$12.95$12.95

f 19.95

APPLE CHRCKROOK

STARWARS/STARTREK

COLOR DEMOS/EREAKOUT

APP1ESOFT !I

R J I J i l . TEST

BLACK JACK /S LOT , .. ACHINf.

B I ORH'tTHM/MASTERMIND

DATA MOVER/TELEPONG

DOW JONES

BULLS AND BEARS

WARLORDS

MICRO'TRIVIA

KIDSTUFF

S P( )RTS ' :' RIVIA

TRANSAC ': 'IONAL A~AL' tS IS

FINANC IAL ANAL 't SI S

SWARMS

APPLF DERBY

APPLr CASINO

FILE EDITOR

A~SEMBLBR

FINANC IJl L WIZARD-I

FINP..NC:AL WI ZARD-J I

FINANC IAL WIZARD-I II

FINAtKIAL W:ZARD IV

CVBn:

STAT::: :STICS I

MEMORY mlMP

SPACE ¥ .. 1I .ZE

ROCKE7 P ILOT

sxucrs IY"VASION

STAR WAR

APPLE II ORGM

WWP l. ;' S HVNT

A l. 'TOMOTIVF DIAGNOSIS

PROGRAM UNLOAC

BAS IC STATISTIC .s

ELE e~ . ENG INF FR ING

FUNCT ION GRAPHS

VECTOR ANALYSIS

RADAR :;-NTF·RCEPTIO~

INSTANT LIBPARY (TAPE)

INSTANT LIBRARY (DISC)

MUSIC KALFIDOSCQPE

BOMBER

INDEX-CARD FILF

BEST-OF-BISHOP

TALKING CALCUL)l.TOR

APP:"E-LIS I!"FR

AJlP:.r.TALKER

STAR "t vARS /SPACE M}. ZF

ROCKET PILOT/SAUCER INVASlmj

TIC -' I'AC-TA: ., }< '. r:R/SPEC 'l 'RUf "I ANA :; "

004-07214

004-07220

044-C7235005-00460

005-00476

005-10502

005-00481005-00497

005-03904

009-00706

009-00712009-00728

009-00733009-00749009-00754016-01195016-01238016-01259016-01314

016-01271016-01356016-01399016-01410035-03626

035-03631

035-03647

035-03668035-03674

035-03689035-03695

.035-03700

035-03716035-03722

035-03737

035-03743

035-03758035-03764035-03770035-03785

035-03791035-03807035-06955035-06961

035-06977

035-06982035-07004

035-07010

035-08087

Q35-08233

0)5-08249

035-08109

015-08109

035-08~15

$19.95$'14.95

s r 4. 95$19.00$15.00

$19.00$14.00s E. 95$14.95

s 9.95

s 9.95s 9.95

s 9.95$ 9.95

$".95

$13.50

113.50

113.50

$13.50

113.50

139.95

113.50

113.50

$ 6.95

$ 9.95

$15.95.$ 9.95

1 9.95

1 9.95

1 6.95

$ 9.95$ 6.95

1 6.95

1 9.95

$ 9.95s 9.95$ 9.95115.95

$ 9.95

1 6.95

115.95

$ 9.95

1 6.95

$ 9.95

1 9.95

$15.95

$ 9.95

I 9.95

$15.95

f19.95

I 6.95

IE.95

1 6.95

SCRr:EN MAO! INf

B"'.CKGJlJ.~.MO~

APPLY' 21'PROCRAM CATALOr . ( [, ISe )

NM'E s ADDRES ,C ( TA PE ;

NA.MF & ADDRESS (DISC)

HANGPAN hT/460 HORDE"

M.n;L' ASSORTMENT

MAGAZ INE F ILFS

PERSONAL EXP. RECClPD

BIAC KJAC K '!'U'IOR

FOP.EIGN L[GION/COMt1ANDO

ROADRACE/SPACEt~AR

WORDSMITH/WAMPllS

CODEBREAKCR/SF.CT"lF':' \JRI'II l' lC

PRESCHOOL IQ-BlTILD rR

ANALOGIE~

VOCABULARY BLOR .

VOCABULARY BLDR. II

NUMBER S~RIES

STEP BY STEP

WORD MASTER /S TORY Bt 'l LD FR

MEMORY Bt'ILDER

FOOL'S SPOOL

CONEY I SLAND

DEPTH CHARGE

COUNTR' t DF. IVFR

KALFIDOSCCPF

CROSS CHASF

LEAP FROG

CHASE

ECHO

SUB COMMAND

FOOTBALL

MATCHWITS

LASFR TURRFT

TAf tO T CARDS

3-:;1 DOCKING

GALACTIC BA' :' 'I "LF

TIHE CLOC"K

PHASOR ZAP

FLYSWATTFR

QUARTERHORSE RAe t;

GUNFIGtlTER

MAGIC SQUARF:S

BATTLES TAR I

PIRATES

ACK ACX

I CHING (TAP:Cl

I CRING (DISC)

KING

"K.lNG

SCRJllffil,F:

035-06940035-03652035-068910.35-06907035-069130)5-06929

035-06934

035-06998035-07031035-07047035-070520)5-07068

035-0707403~-07089

035-07095

035-07'01

035-07117035-08093

035-08121035-08136035-08142035-08157

035-08163

035-0879

035-08206

035-08212035-08228

035-08276035-08281

035-08297

0~3-(13485033-03491033-03501033-03513

033-03529033-03534033-r,3540033-03555833-03561

033-0357703J-03582042-04420

042-04435

042-04441

042-04456

042-08763

042-08779

032-03368

032-03389032-03400

015-01152

$ 9.95

$ 9.95

$ 9.95

$15.95

$19a 95$ 9.95

$ 9.95

119.95

$19.95

$24.95

$19.95

119.95

$19.95

$19.95$15.95$29.95

$19.95

$ 6.95

$34.95149.95

$19.95

$24.95

I 9.95

$15a 95$,5.95

1 9.95

$19.95

fl9.95

1 9.95

$69.95

$12.95

$17.95$12.95

$12.95

$17.95$ 9.95

112.95

112.95

$17.95

1 9.95

$49.95

$59.95$39.95$29.95$19.95

$24.95

$39.95

$14.95

$14.95

$19.95

$19.95

SUR VIEW

STAP DODGER

PERPr :TUA~, CALFNDl>,R

SUPFT< STARlIo-'ARS

INCOMF TAX 1978

CCLOR STARTFfK

SUB D:CTECT

BGSINFSS & FiNA......crPROGR~.MJl. IS ThLl\ItlG DISC

3-D A" '\ IMAT IO t; DI SC

AuDIO FNGINEFP DISC

EDITOR ASSFMBLER nrscDATA BASE " orscPl >' .. 1I .I L MAI I. .nX~ LABL£S DI SC

STRATO l J\ SEF

COMPUnEAD DI SC

ANALYST DISC

RETFEJ..T

APPLFFORTH 1.2 (TAPF)

APP1EFORTE 1.2 (DISC)

APPLE PIE 1.0 (TAPf.)

APPLE PH: 1.0 (DISC)

H O M E ' ACCOUNT ING ( TAP F: )

HOto- '. .EACCOUNTIK (; (DIEC)

SUPER OTt lF :LLC

1,t;NARSCAPE

FOOTBALL PREDICTIONS

STA':'ISTICS

BIOTHYRHM

ASM/65 EDITOR ASSEMB:":CP ~. 0

TANK WAR

17-DRAW

~.AZf G A M E

ESCAPE

TEXT EDITOR

NUMBP·R CRllNCHF,R

MUSIC ROX

SIDF SHOWS

ELECTRIC CFlt YON

CHR ISTMAS CAROL fR

DR. ME}fORY

TEXT F .D ITOR

MAILING LIST (DISC)

MF .MO CALFNDAR (DI SC)

SI y. ;G LE DI SC COpy

DANS DISC UTILITY

DANS DISC UTIL/SNGL DISC Cpy

STIMULA~ING S IMULATIONS

BRIDGE CHALLENGER

MICROCHESS

FASTGAMMON

,(t~,.:""( · · ' · " F ~ "'~_:_:y

• BUSINESS

• EDUCATIONAL• PERSONAL

'4052 East Firestone Blvd,

Santa FeSprings, CA 90670(213 ) 921 -2111 • (714) 739-0711

DESCRIPTION PRICE QUANTITY AMOUNT

NAME

SubtotalADDRESS

Y... youm.y c .f"QtI i t . '

j " @ " T ii"·Calif. Residents 6% tax

CITY STATE Expiration Date _

Card H _

SignatureIP PHONE

Shipping

TOTALAMOUNT ENCLOSED

-

Page 19: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 19/60

Replace that PIA with a VIA

Sound effects, timed interrupts and a versatile shiftregister are a few of the benefits offered by this useful

hardware equipment.

E.D. Morris, Jr.3200Washington StreetMidland, MI 48640

If your microcomputer board uses the Table 1: 6522 Register Address List6520 Peripheral Interface Adapter for an

1/ 0 port, you might consider replacing itRS3 RS2 RS1 RSO FUNCTIONwith a 6522 Versatile Interface Adapter.

For the two dollars increase in price you

get all the functions of the 6520 plus two L L L L 110 port Btimers, a shift register, input data latch- L L L H 110port Aing, and a much more powerful interrupt

L L H L Data direction Bsystem.

A block diagram of the VIA is shown in L L H H Data direction A

Figure 1_The 6522 appears to the CPU as L H L L Timer 1 counter low bytesixteen memory locations, compared to L H L H Timer 1 counter high bytefour for the 6520. Table 1shows how the

various registers are addressed using L H H L Timer 1 latch low byte

the register select pins. In some cases, L H H H Timer 1 latch high byteaccessing a register triggers another H L L L Timer 2 low bytefunction such as resetting an interrupt

H L L H Timer 2 high bytef lag or start ing the timer.

The timers are loaded with data and thenH L H L Shift register

decremented at the system clock rate to H L H H Timer and shift register controlcreate a delay, This can be used to H H L L 1/0 handshake controlgenerate interrupts at preset intervals.

H H L H Interrupt flags

H H H L Interrupt enables

H H H H 1/0 port A

~

~

D a t aB u s -

I n t e r r u p t

~

I S h i f t R e g . r •I C o n t r o l_ C o n t r o l

Figure 1: Block Diagram of the 6522

August, 1979

Another use is to connect an amplifier

and speaker to the shift register output

By storing a 11110000 or 11001100 in the

shift register and placing it in the free

running mode, square waves at audio fre-

quencies are produced. BASIC can then

POKE constants to timer 2 to produce

various audio tones. You can create elec-

tronic music, or add sound effects to

those mute game proqrarns. In fact, thisscheme is used for the PET sound

sttects.

The timers can be set to cause interrupts

at equally spaced time intervals. This

saves the CPU the chore of keeping timeor chasing its tail in loops to create

delays. I found the timed interrupt very

convenient in writing a single-step

machine language debugging program.

The timer is set so the CPU can just

escape from the monitor and execute

one step of the main program before

another interrupt forces it back to the

monitor. A recent issue of MICRO gives

details of using the 6522 timers with a

SYM computer.

MICRO - The 6502 Journal

So how do you install this super chip in

your system? Figure 2 compares the pin-

outs of the 6520 and the 6522. Thirty-six

of the forty pins are identical, so that is a

good start However changes must by

made to your circuit board at pins 21, 22,

37 and 38. The 6522 needs 4 address

lines compared to 2 for the 6520. I

jumpered RSOand RS1to address lines 2

and 3 somewhere on the CPU board. To

reduce foil cutting, I left RS2 and RS3

connected to address 0 and 1. You will

have to make your own list of register ad-

dresses depending how you connect the

RS lines to your address buss. IRQ andR/W must be re-jumped to the proper

pins. My CPU board did not use CSO, so

this was no loss.

I made this modification on an OSI 500

CPU board (Kilobaud March 1979). After

reading the Trouble Shooter's Corner

(Kilobaud September 1978), I was very

apprehensive about taking on this proj-

ect However the OSI board has no

"bogus" clock pulsus running around,

so I had no trouble.

15:17

Page 20: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 20/60

Any of seven events can cause as inter-rupt and set a flag in the interrupt flagregister. The shift register rate is con-trolled either by timer 2 or by an externalclock. Two control registers allow selec-tion of the many options available in the6522 VIA. More detai ls of the 6522 can beobtained from Synertek, P.O. Box 552,Santa Clara CA95052.

So what does the 6522 gain you as far as

programming? Well, the shift registercan be used as a serial output port todrive a Teletype or printer. The baud rateis software controlled by the constantstored in t imer 2.

V S S 4 0 C A 1 V S S 4 0 C A 1tA O C A 2 P A D C A 2

P A 1 I R Q A P A 1 R S O **P A 2 I R O B P A 2 R S 1 **P A 3 R S O P A 3 R S 2P M R S 1 P A 4 R S 3P A 5 R E S P A 5 R E S

P A 6 D O P A 6 D OP A 7 0 1 P A 7 D 1P B O 6 5 2 0 D 2 P B O 6 5 2 2 D 2P B 1 0 3 P B 1 D 3P B 2 D 4 P B 2 0 4P B 3 0 5 P B 3 0 5P B 4 0 6 P B 4 0 6P B 5 0 7 P B 5 0 7P B 6 S 2 P B 6 B 2P B 7 C S 1 P B 7 C S 1C B 1 C S 2 C B 1 C S 2C B 2 C S O C B 2 R / W **V e e 2 0 2 1 R / W V e e 2 0 2 1 I R Q **

1/0 Port

Handshake Control

Register Select (Address)

= Reset

Data Bus

Chip Select

Interrupt

PA,PB

CA,CB =RS

RES

DCS

IRQ

Figure 2: Pin-outs of the 6522 VIA and 6520 PIA

T .D .O .

T A PE D A TA OUERY

PET-SK SOL-UA TRS-SD-LEVEL II

* FILE MANAGEMENT SYSTEM-Utilizes Dual Audio Cassette Recorders

* INTERACTIVE QUERY LANGUAGE

-English-Like Commands-Powerful Info Retrieval Capability

* COMPUTERIZED BUSINESS & PERSONAL RECORDS-Customize Your Own File Structures

-Create & Maintain Data Files

-No Programming Experience Required

* IMPLEMENTED IN BASIC

T.D.Q. CASSETTE WITH MANUAL & REF. CARD s50.00

The Following Pre-Defined T.D.Q_ File StructuresAre Available To Solve Your Data Processing Needs:

INVENTORY CONTROL $35.00ACCOUNTS RECEIVABLE $35.00ACCOUNTS PAYABLE $35.00ORDER PROCESSING $35.00CUSTOMER DIRECTORY $25.00

APPOINTMENT SCHEDULING $25.00Each With Cassette And Manual

Send Self-Addressed Stamped Envelope For, Complete Software Catalogue. ,Send Check Or Money-Order To:

H.GELLERCOMPUTERSYSTEMSDEPT. M, P.O. BeX 350NEW YORK, NY 10040

(New York Residents Add Applicable Sales Tax)

15:18

N OW AVA ILA B L E

F o r S O L - llA an d PET -8K

GENERAL PACK 1

(Checkbook Balancer, Tic Tac Toe, Metric Conversion)

GENERAL PACK 2 $19.00

(Space Patrol, Biorhythm, Batt l e s tar , One-Armed Bandit)

FIN.<\NCIAL PACK 1

(Loans, Depreciation, Investments)

FINANCIAL PACK 2 S13.00

(Mortgage & Loan Amortization, Future Projections,

Risk Analysis)

STATISTICS PACK 1 $19.00

(Mean & Deviation, Distribution, Linear Correlation &

Regression, Contingency Table Analysis)

GAME PACK 1 $20.00

(Basketball, Object Removal, Bowling, Darts, Gopher)

GAME PACK 2 - (children - educational)

(Arithmetic God, Addition Dice, Travel)

$13.00

For the KIM-l

PCROS - A Real-Time Operating System in the

IK KIM RAM

Includes: Assembly listing; Cassette with user's

manual; Schematic for relay control board

$50.00

MICRO - The 6502 Journal August, 1979

$11.00

$13.00

Page 21: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 21/60

PET Cassette 1 /0

No more lost files, missing data or elusive end of file

marks! Now that great cassette 110 capability can beput to work.

At first glance it would appear that

cassette data storage on the Com-

modore PET would be a snap. Upon try-

ing it, you soon discover otherwise.

Three major problems soon emerge to

frustrate the uninitiated. The PET does

not read back all of the data you wrote on

the tape. It misses the end of file mark,

causing the system to crash, and occa-

sionally it even refuses to find a file

which you have written.

The first two problems are related. An

end of file mark is, after all, data, so if the

PET is skipping data it could (and does!)

just skip the end of file mark. Fixing the

problem of skipping data will fix the

problem of missing the end of file.

The PET writes data onto the cassette

tape in blocks of 192 characters, in-

cluding carriage returns. The cassette

motor is turned off in between writing

blocks. Before writing the next block the

motor must be turned on, and time allow-

ed for the tape to come up to its steady,

proper speed. Apparently, when the PET

operating system was written, the

cassette decks came up to speed much

faster than the cassette units supplied

with production PETs.

Because of this, the pause (interblock

gap) is insufficient. When the PET at-

tempts to read the block back, data

starts before the tape is up to speed, re-

sulting in the first few bytes of the block

being garbled. Unfortunately, those few

bytes are what identify the block as

data rather than noise. As a result, the

block is ignored completely and the PET

keeps searching until it comes to the

next block. Of course, the tape is at its

correct speed by now, so this block is

100 HEM PRINT NUMERIC

110 PR$ = STR$(PR)120 REM PRINT STRING

130 LN% = LN% + LEN(PR$) + 1

140 IF LN% = 191 THEN LN% = 0 GOSUB 1801 50 P RI NT /I 1 ,P R$160 RETURN

170 REM INTERBLOCK GAP180 DT = TI

190 POKE 59411,53 : IF DT + 10 = TI GOTO 190200 RETURN

August, 1979 MICRO - The 6502 Journal

Ronald C. SmithP. O. Box 1125Reseda, CA 91335

read properly. The bottom line is that

you lose every other block of data!

To solve this problem you need to funnel

all of your output to tape through a

subroutine. The subroutine counts how

many characters have been written andplaced into the tape butter. When it

detects that the 192nd character is about

to be written, it should reset its counter

to zero, start up the cassette motor, and

pause 116 second before allowing the

character to be written. To start cassette

#1, POKE 59411,53. For cassette #2, it's

POKE 59456,207.

Use of this subroutine will eliminate the

problem of skipped blocks. It will also in-

sure that the end of file mark is not

missed.

The problem of unrecognized files is

another operating system idiosyncrasy,

fortunately much simpler to fix. Ac-

cording to Commodore, upon occasionthe system will not properly initialize the

tape buffer before opening a file. This

causes the data to be placed in the

wrong place in the memory or buffer. The

system can't recognize the data when it

opens for input because it just can't find

it! The fix is simple. For tape unit #1,

POKE 243,122; POKE 244,2 before open-

ing the file. For tape unit #2, POKE

243,58; POKE 244,3 before opening.

These POKEs initialize the pointers and

eliminate the problem.

The subroutines shown illustrate one

way to use the methods just described.

Set PR or PR$ equal to the variable

which you wish to print and jump to the

approriate subroutine entry point. Do not

forget to write an interblock gap before

closing the file.

Please note that even though you have

stored numbers as ASCII strings on the

tape, this is what the PET does anyway!

You can still read it as a number. This in-

formation should help you employ the

great file handling capabilities built into

your PET.

15:19

Page 22: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 22/60

Tokens

E. D.Morris Jr.3200Washington StreetMidland, MI48640

,

-The speed and efficiency of Microsoft BASIC resultfrom aninsightful software design technique.

FORX= 768TO781PRINTPEEK(X)NEXTX

TheBASICline will look like this:

Microsoft BASIC used in the PET and

OSI computers is fast and memory effi-cient. One reason for this is that theBASIC commands are abbreviatedthrough use of tokens. For example, if

you write the BASICprogram:

10 IFA=BTHENGOSUB99

you will not find the words IF, THEN orGOSUBshould you PEEKinto the BASIC

program. If OSI owners with BASIC inROM run the following in immediate

mode:

o 143100138651716616014057570

So let's try to pick this apart and seewhat happened. The leading and trailing

O's are delimiters to separate BASIClines. The "14 3" in the second and thirdbyte means the next BASIC line starts at

151152

153154155156157158159160161162163164165166167168169

170171172173

Table 1:051 BASIC Token Index

PRINTCONT

LISTCLEARNEWTAB(TOFNSPC(THENNOTSTEP

+

128129

130131132133134135136137138139140141142143

144145146147148149

150

*

I(powerof)ANDOR

>=<SGN

ENDFOR

NEXTDATAINPUTD IMREADLETGOTORUNIFRESTOREGOSUBRETURNREMSTOPONNULLWAITLOADSAVED EFPOKE

174175

176177178

179180181182183

184185

186187188189190191192193194195197·211

INTABS

USRFREPOSSQRRNDLOGEXPC OSSINTANATNPEEKLENSTR$VALASCCHR$LEFT$RIGHT$MID$B AS IC E rr o rCodes

MICRO - The 6502 Journal

memory location 14 + 3·256 = 782

(decimal). The "10 0" in the next two

bytes indicates this is BASIC line 10 +0*256 = 10. If you look in a table ofASCII codes, 65,66and 57are the ASCII

values for A, Band 9.

Thus our code deciphering so far yields:014310013865 1716616014057570

\ 1\ \ I / 7/7 8 2 #1 0 A B 9 9 E N D

A little inspection of what is still missingindicates that somehow, "138" means

IF, "171" means EQUALS, "160" means

THEN and "140" means GOSUB. Theseare the tokens used inMicrosoft BASIC.

The following program will decode

tokens for OSIusers.

10 REM20 INPUTX30 POKE773,X40 LIST10

Start the program via "RUN 20" to skip

over the first line. Then input a numberbetween 65and 195.For example, if you

INPUTa 138, line 10will now contain anIF.

Table 1 is a list of tokens for the OSI

system. Thiswill help in PEEKing aroundyour BASIC programs. You could evenwrite a program that rewrites itself. PETowners: Don't worry, I haven't forgotten

you. To look at the first line of the BASIC

program, run in immediate mode:

FORX = 1024TO1037PRINTPEEK(X)

NEXTX

Line 30 of the token decoder program

should bechanged to:

30 POKE1029,X

Youwill find the PETtokens are not tden-tical to OSI's. So I leaveit to you to build

your own list.

Editor: Thanks to Alvin L. Hooper, 207Self St., Warner Robbins, GA 31093 whosubmitted an equivalent table of OSI

BASIC tokens.

August, 1979

Page 23: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 23/60

faster than a speeding m;n;Able to leap tallm;cros

;na s;ng'e4K RAM8KROM

Ir'$

$279Oh io Sc ien tific

Superboa rd . the

computer on a board ·

even inc ludes a keyb oard

and in terface fo r v ideo

d isp lay and a cassette

recorder.

O F288 Norfolk St. (Cor. Hampshire St.)

Cambridge, Mass. 02139

617-661-2670

590 Commonwealth Ave.

Boston, Mass. 02215

617-247-0700

Route 16B

Union, N.H. 03887

603-473-2323

Page 24: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 24/60

A Better LIFE for Your APPLE

An enhancement to LIFE makes it easy to establish aninitial pattern, monitor successive generations, and

modify the pattern at any particular generation. Thisinput technique is cursor oriented and keyboard driven

to facilitate entering complex patter_ns.

II was a distinct pleasure to seeRichard

F.Suitor's article, Life For Your Apple in

MICRO 8:11. Since my introduction tothis mathematical game through a pro-gram written by an associate, I havede-rived a great deal of pleasure from

watching the evolution of many "life"forms. Iwas quite taken by the executionspeed of Mr. Suitor's program, but I feelthat his method of designating a living

cell is awkward,especially for large com-plex patterns.

I would like to pass on to other MICRO

readers a technique employed by W.P.Hennessy in that very first LIFEprogramI used. While I have made sustantialchanges to make the program easierand

a little more versatile, the technique re-mains the same.

Instead of using the inconvenient INPUTX,Y, the operator may move a cursor

about the screen, depositing or erasingcells, ormoving without disturbing cells.he cursor is a single white "brick"hose motion is controlled by depress-

ing one of the keys described below:

KEY DIRECTIONOFMOTION

N,U Bottom to TopE,R Left to Right

S,D Top to BottomW,L Right to Left

he keys N, E,W, and S have a verydif-

erent function than the U, D, R, and L

L. William Bradford

7868 Naylor Avenue

Los Angeles, CA 90045

keys, since the former move the cursor

without affecting the screen, while thelatter cause a cell to be deposited or

erased from the screen. In every case,the cursor moves one space per

keystroke.

The U, D, R,and L keys are used in two

modes, the "write" mode and the"erase" mode, with "write" mode beingthe default. As anexample, suppose that

the program is in the default mode,andthe operator depresses the U key. Thecursor will move one space up, leaving alive cell in the square just vacated. The

erase mode is entered bydepressing theESC key, and the write mode re-enteredby depressing the0(as in orange)key.

Assuming that the cursor is centered ona live cell, and that the program is in the

erase mode, depressing the U key willcause the live cell to be deleted and thecursor to moveup. There is no effect on

unoccupied cells. If this sounds com-plicated at first, it is nonetheless simple

in practice.

Once a pattern has been entered, theRETURNkey is depressed to start theprogram. I haveretained the heart of Mr.

Suitor's BASIC program which sets upthe timing loops and calls the machinelanguagesubroutines. I havemadesome

slight changes to his routine to generate

a random pattern by setting up a default

MICRO - The 6502 Journal

grid size and using a different ran-domization.

In the present version of the program,ex-ecution will stop briefly after somenumber of generations. The number of

generations is a function of the defaulttimer loop interval which the operatordesignates. During the pause, the pro-

gram will be examining the keyboard,looking for certain keys. Thesekeys andtheir functions aredescribed inTable 1.

The duration of-the pause can be con-trolled by changing the value of the

variable JK at statement 315. If the usershould wish to pause after each genera-tion, the following statements will effectthat change:

306 GOSUB315:NEXTI

350 RETURN

366 IF IN = 82THENRETURN

The program also allows the operator torun without any pauses provided that heanswers in the affirmative to the ques-

tion at statement 14. In general, this isthe way that I run the program.

The APPLE LIFE fan will find that the

code presented here,when coupled withRichard Suitor's excellent machine

language code, will provide many hoursof entertainment andmental stimulation.John Conway's game of LIFE is surelyone of the moreexciting uses of the per-

sonal computer.

August, 1979

Page 25: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 25/60

Table 1: Single Key Functions

KEY FUNCTION

P Stop execution and waitK Stop and clear screen, get new pattern

X Exit to BasicM Stop to allow modification of pattern

G Restart execution

o T F .X T : G O TO 21 Qa PEE r. (-16384 ): IF Q<127 T I'F :r1

1 :Q=Q -121 l: rO KE -1636 8,0: rET I'"t '

2 CA LL -936 : V TAB 9: TA E l 15: P ro lr'T

"** L IFE ... . II: pp .lr!T : PR lt!T

3 PR I - r r " A VER S I o r ' n F JO H tl cm ''''A Y

's GA I'E O F L IF E": PR IIIT

4 TA B 10: P r-IIIT " \ 'H UTTE rI FO R TH E APPLE I I "

5 V TA B 15: PR IN T" A SSE llSLY LM IGUA

GE RO UT IN ES W R IT TEN E lY R ICH ARD

F SUITO R AND PUB L ISH ED III IS SUE

"6 PR IN T "tlO . a O F 'n ICRO ' CO PYR IG II

T 1978": PR I In "B A S I C RO UT lllES 8

Y L .IL URAD FOR [) 1978"7 V TAB 22: IIIPUT "DO YOU liM IT IIIST

RUCT lO llS ?" , X $

:: CA LL -936

9 IF X $="Y " TH E ti 2000

10 TEX T : G r.12 2Z=014 I I IPUT " D O YOU liM IT T ilE PR OG RM 1 T

o n u n III THOUT EX TEr.IIA L CD t't 'M ID

s" X ~15 IF ' X $I"Y " A IID X ~ #"ll" TH E Il 14

: IF ):S = "I!" TH E Il 20: I F X ~ ·

"Y" T lin l ZZ . . l

20 CA LL -93621 II!P l'T "H !TH '. D EFA l'L T VM I'F . F rr T

It':E R I t IT ErW A L", x x i32 IIIPUT "( '\0 Y OU l'IA tlT A R AI!f '01 'L Y (J C

C UPIE l) 5PA CE",X ~

33 IF X $I"Y " M ID x ~ * " r : " TH E I! 32: I F X ~ ." tI" T IIE II lUO

40 IIIPUT " STM IDA P.D G R ID S IZE (U (X <

39,0<Y(47) ",XS41 IF X S I"Y " titlD X ~ #"ll" T IIE II 40

: IF X S ""II" T IIE I: 54

42 Jl= 1:J2=4u :Jl= 1:1 :':= 3!;: G O T ()

59

54 IIIPUT "EIIT E r. . , D IRCCT IO Il L II ',IT 5(0 TO 39)" , I 1, I 2

55 IF 11<0 O R 12)39 T IIE I) 51!

56 It!PUT "E IIT E r. Y D IR ECT IO I) L lt 'lT S

(0 TO 47)11, J1,J257 IF J1(0 O R J2 )47 T IIC I! s s59 51" n u o (4)+1:5 J· R IID (3)+1

60 G R : rO KE -16302 ,0

61 CA LL -199862 FO r. 1=11 TO 12 STEP 51

63 FOr. J= Jl T n .12 ~ T EP ~J

64 CO LO r.=11:X = 1 ;:!(1 (2)+1:X =X *(

" : : ( 1 (2))+1: i r r.r'f' (X) T"J :~I

CCll .0P.=U

E .S PL (1T I,J

(;6 r :F .X T "[, 7 IIEX T I

u e LO TO 29210 0 GR : PO KE -16302,0

101 CO LO r.=O105 FO R JK -O TO 39: V L IN U ,47 A T

Jt ~

106 t~ F .X T JK

110 L I V E= ll: [)CA (J=O : CURS=15: T EnP=

L I V E115 CO LO R=O : FO r. X =l TO 33: V L III

1 ,46 A T X : I !EXT X120 X =18:Y ·23125 SC1= SCR rJ(X , Y )

128 CO LO R=CUR 5: PLO T X ,Y

130 (j05US 1

132 IF Q=27 TH E rl T E llP=O : IF 0.=79TH E Il T E tlP=11: IF Q=27 O R Q=

79 T IIE II 130

133 CO LO R=T EI1P134 IF Q=G 9 OR QaG7 O R Q=B 3 OR

Q=78 T IIE Il CO lO r,=SC1

136 PLO T X ,Y

140 IF Qa13 T IIE II 2~ 0

142 IF Q=32 T IIE I! 200144 IF 0."69 or . Q=1l2 T IIE I: 200

146 IF 0.=87 O r. 0.=76 TH E r! 21011;8 IF 0.=83 O R 1"!=6 8 TH E r' 220

150 IF Q=7C or. 0.=35 T IIE tl 230

16 0 FO R JZ=1 TO 10161 J= PEEK (-16336 ): N EX T JZ

162 G O TO 125200 X "X + 1: IF X )38 T IIE II X =38: G O TO

12 5210 X =X -!: IF xc i TH E Il X =l: G O TO

12 5220 Y =Y +1: IF Y >46 T IIE I! Y=46 : G O TO

12 5230 Y =Y -1 : IF v c i TH E Il Y=l: G O TO

12 52 90 COLO R=O : PLO T X ,Y

292 GO TO 307

294 FO R 1=1 TO K3

296 CA LL 2088298 FO R K= l TO K l: IIEX T ~

300 CA LL 2265302 FO R K= l TO K2: tlEX T K

306 nEX T I30 7 r,x" p rL (0)-10

308 IF KX )Z40 T IIE I! KX =r.~ ~

309 IF KX <O THE il K X =O

3 10 K 2·K X *2:K l= KX *63 11 K 3= 50 0/(K l+ 50)+ 1

312 IF ZZ=l TH E I! 294

315 JK "lO O320 FO R 1111-1 TO JK325 lI!a PEEK (-16 331"330 IF 11 !)127 T llE I! 360

335 PO KE -16368 ,0

340 IIEX T Nt!352 GOTO 2~ 4360 III-I 1'-12l)36 5 PO KE -16368,0

369 IF 111=77 T IIE lr 120

3 7 0 I Fi l l = 7 5 T it E II 10

372 IF 111-71 T IIE rl 294

37 3 I F ir 1= a 0 TH E I! 400

374 FO R IJ=1 TO 20

3 7 5 K Y . - PEEK (-16336 )

376 ilEX T IJ

380 I F I u-as T IIE II 10U O

400 I~= PEEK (-16384)

August, 1979 MICRO - The 6502 Journal 15:23

Page 26: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 26/60

Page 27: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 27/60

EPROM fo r the KIM

Circuits and suggestions for the selection, installationand utilization of EPROM. This fully buffered EPROM

board is easy to build and use. I t requires no specialinterfacing.

One of the handiest additions for the ex-

pansion-minded KIM owner to consider

is an EPROM board. There's nothing

like being able to summon your favorite

programs as soon as the computer is

turned on. Most people think of PROM's

in terms of holding BASIC or an operat-

ing system, but there's no reason your

favorite games and utilities shouldn't

be there too. The most heavily used rou-

tines in my 2708s are Hypertape and

Browse, both from the The First Book

of Kim, and the XIM Teletype utilities.

Tiny BASIC will go in PROM as soon as

I can find time to relocate it. QUICK, a

reaction-time game from The First Book

of Kim, is there too; it's fun, and a nice

way to show off the computer.

There are lots of articles from which one

can build EPROM programmers, and

some of these are specifically for use

with KIM. The most EPROM for the

money currently seems to be the 2708.

Prices in the $6 range for 1K 8-bit words

(650 ns access time, fine for KIM) are

hard to beat for any type of computer

memory. Just one of these things holds

as much as the entire user RAM' 27081

2716 programmers are also available as

kits or assembled from dealers, but most

are quite expensive. An exception is

Optimal Technology's unit, which is in

the $50 range; that's what I have, and itworks beautifully. Incidentally, their

programming software can be relocated

easily by hand, and it now resides in a

PROM too.

There seems to be considerably less in-

formation available on using PROMs

with KIM. Most of the commercial

boards and construction articles are for

the S-100 bus, which doesn't help the

-5v

tantalu!Ileach (two)

August, 1979

KIM owner a bit unless he already has a

KIMSI or similar interface. Fortunately,

a fully buffered EPROM board with ad-

dress decoding is very easy to build and

use with KIM with no special inter-

facing. My unit is shown on the accorn-

panying schematic. It was wire-wrappedby hand on a small piece of Vector perf-

board, using sockets held in place with

G.E. silicone cement, and contains ad-

dress decoding for up to 16 EPROM's

beginning at address COOOhex.

Two type 8T97 hex buffers are used to

buffer the lower ten address lines, since

all the EPROM's are in parallel across

this part of the address bus. Two sec-

tions in the second 8T97 were left over,and were used to buffer KIM's lines

AB14 and AB15 rather than let them be

unused; substituting a 74LSOO in place

of the 7400 would provide a similar load

on the address bus, but I wanted to buf-

fer as many address lines as I could to

make further expansion easier. The

74LS154 four-to-sixteen line decoder

provides the CS signal that gates a dif-

ferent EPROM for each 1K of memory

space, and the NAND gate activates

this decoder when bits 14 and 15o f the

address bus are both high (address ~

COOO).

The vector-fetch and decode-enable sig-

nals required by KIM are generated in

my system by expansion RAM boards;

you will have to provide them yourself

if you don't already have some form of

memory expansion. Although not shown

on the diagram, 0.01 or 0.1 mf bypass

capacitors were used from + 5V, + 12V,and - 5V points to ground on most ICs.

A LM320T-5 IC regulator provided -5V

for the 2708s from my existing power

supply.

MICRO - The 6502 Journal

William C. Clements, Jr.

Department of Chemical

and Metallurgical Engineering

University of Alabama

University, AL 35486

There is a beneficial side-effect from

using EPROM's which is not enough

talked about. Use of these devices pro-

vides a strong encouragement toward

cleaning up and refining your program-

ming habits! If you are not already care-

ful that your program contains "clean"

or non self-modifying code, you will

quickly get into the habit if you have

any kind of ROM board.

A certain amount of ingenuity can often

show you how to adapt other's sott-

ware to PROM. If a table in page zero

needs to be initialized before running a

program, just append your own short

program to move the data block from

PROM down to page zero, and thentransfer control to the start of the main

program. I like to write short driver rou-

tines like this when PROMming a pro-

gram that requires register init ial ization

from the keyboard to run different cases.

If the program is going to be kept in

PROM for years, it is easy to forget

which numbers go where and at what

times. I'd rather just have to remember

a single starting address for each sepa-

rate case, and let my driver program do

the initializing. For instance, I begin

Microchess at one address for super-

blitz play, at another for blitz, and at a

third for regular play. These addresses

set the proper constants for each level

of play; the original version required

changes of instructions in the program

itself, which is not possible in ROM.

If a program is self-modifying, and you

can't figure out how to fix it without

starting over, don't despair; put it as is

(unrelocated) into PROM, along with a

little routine that copies it into lower

memory and then transfers control to

it there.

Using such a routine, the program ap-

pears to the user as though it is execut-

ing directly from PROM except, of

course, that the lower memory is not

available for other uses during execu-

tion. If that is not a problem, you could

even store all your programs in PROM,

preceded by a move routine, and be

spared the work of relocating or modi-

fying any of them! If you have lots of

expansion RAM, this is probably the

most hassle-free way to go. However,

you choose to do it, relocating and run-

ning direct from PROM, or moving and

running an unmodified program, using

EPROM's will be a lot of fun. And think

of all the tape you'll save!

15:25

Page 28: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 28/60

t o

e

a

I

a

o

t s

M

busDB7

- E8I

o

o

(E-M)(E-N)

( E - P )

(E-R)

I M

-

o AO

M

o A I . . .

-5v +12v +12v

MICRO - The 6502 Journal

- 5 v +12v

(A-N): T : +12v

(E-21) "'---:2~+--]j" '-. . . .. .. +5v100 uf, 15v

lt t t t t (E-22) -c TT

21 19 21 19 21 19

- 8 8 t------c - 7 7 1------

2708 2708 2708- 6 6 1------

-5 5 5 1------(COOO - (C400 - (C80D - I

-4 II 4

E---3

C3FF)3

C7FF)3

CBFF)

- - _ .. . to c., .rroes2 2 2 pond~ng- 1 1 1 F - - - address

-3 23 23 --- lines

-2 22 22 (A O to Ag)9

- 9 9 i------1 .0 cor-r-es-0 10 10 i------ ponding-1 11 11 ~ . - ,---- data out-13 13 13 ~--- lines-11 1 11 1 4 f------ (01 ',0 0e)

-5 15 15 f------

)-16 16 16 i---- --

-7 17 17 '------8r--- 21 1 r--- 21 1 r-- 21 1

8 12 18 20 12 18 20 12 18 20

- 1 - J . - b . J : . 1 ~~- -+5v

'---+5v +5v

(E-X) indicates K I M ( A- X) I nd ic at es K I M

7415154 Expansion Connector A pp li ca ti on C on ne ct or

pin X pin X ,1 ~

23 222

321

20 --'--- -----. . 711LS154 out put s 4- 15 on pins 4-11 and

r4

----------+ 13-17 to C S (pin 2 0) oth er 2703s12 18 19

17on

-sv

rI

1

I3 2

I7400 (pin 7: gnd, pin 14: +5v)

li

81971

. , 8T97AB S

II~

L J j)14 ( E - F )

AB 62 14 \_

( E - H )

~II~ 13

to AS3

to A6-

4

L J 0

12AB 4 II( E - E ) AB 7 t •

( E - J )5

.,to A7 -

_5 _ J ~ '~I 11 to Alj AB 8 6 10

-AB 3( E - K )

7 96

L J L J10

~tOA9E - D ) to AS

7 To KIM To K I M9

to A3address addressbus

~lt .16

bus

.Ls .Lis 116

AB15(E-T)

AB1~( r - S )

AB9'(E-L.)

s.+5v

August, 1979

Page 29: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 29/60

***** A I M - 5 5 *****

E X C E R T I N C O R P O R A T E DPIN Qt~ 1-9

A65-l AIM-65 w/1K RAM $375

A65-4 AIM-65 w/4K RAM $450

A65-A Assembler ROM $85

A65-B BASIC ROMS $100

E XCER T has concentrat ed on th e AIM -65 to guar ant ee Y OU that th e prod ucts weoffe r ar e fully c ompatib le. We kno w ho w th ese prod ucts wo rk since th ey are

used in our systems. E XCE RT c an h elp you get the sys tem Y OU want !

pIN

P RS1 + 5V at 5 A, +24 V at 2. 5A,+1 2V at 1A (do es not fit

ins ide EN C1) $9 5

PR S2 +5 V at 5A , +24V at 1A(mounts i nsi de ENC1 )

A C C E S S O R I E S

$ 50

ENC 1 AIM -65 case w/s pac e fo rP RS2 and M EB1 or MEB 2or VIB 1 $4 5

NEW! E NC2 ENC 1 w/P RS2 ins ide $100

T PT1 Appr ove d The rmal PaperTa·pe . 6/165' roll s $1 0

NE W! MC P1 Dual 44 pin Moth er C ardt ake s MEB 1, V IBl , PTCl $8 0

MEB1

N EW IP T CI

VIBI

N EW! MCP 2

MEB2

N EW ! PGR2

8K RAM, 8K Prom so cke ts,

6522 and pr ogr amme r for5 V Eproms (27 16) $24 5

Pr oto type card s ame sizeas K IM-I , M EB1 . VIB1 $4 0

V ideo bd w/12 8 c har, 128

use r char , up to 4K RAM,lig ht pen and A SCII keybdi nte rfac es $ 245

S i ngl e 44 pi n ( KIM -4s tyl e) M othe r c ard takesM EB2, P GR2 and offers 4K

R A M sockets $J19

w/4K R A M $16916K R A M b d takes 2114 's $ 125

w/8K R A M $225

w/16K R A M $325

Pr ogr amme r fo r 5V E proms

w/ROM fir mwar e. up to 8

E pr o ms s i mu l ta n eo u sl y

w / 4 tex tool skts

$195

$245

S Y S T E M S

"ASSEMBLED & TESTED"

All AI M-65 syst ems are s elf cont ained and

have t he power supply ( PRS 2) mounted

i ns id e ENC l.

" ST AR TE R" S YS TE MS

pIN

SB65-1

SB65-4

SB65-4B

A65 -1 in E NC2 $ 475

A65 -4 in ENC 2 $ 540

Same Pl us B ASIC $ 640

" EX PA ND ED " S YS TE MS

" B " " c " " 0 "M EBI MEB 2 VIB I

E 65 -4 A65- 4, E NC2,

w /o ne M EB l, ME B2 ,or VI B1 $ 775

E 65-4 B S ame P lus BAS IC $87 5

$855

$955

Hi gher quant itie s and systems wi th o the roptions quot ed upo n reque st!

Hai l Ch eck or Mo ney Orde r T o:

E XC ER T, I NC OR PO RA TE DAt tn: Laurie44 34 Th omas Ave nue S outhM inneapo lis , M innesot a 554 10

( 61 2) 9 20 -7 79 2

A dd $5 .00 for s hipping . insurance , and

handl i ng.

Mi nnes ota resi dents add 4% sal es tax.

$775

$875

Page 30: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 30/60

Presents

Software and H ardw are for your A PP LE

SALES FORECAST provides the best forecast using the four

most popular forecasting techniques: linear regression, log

trend, power curve trend, and exponential smoothing. Neil D.

Lipson's program uses arti ficial intel ligence to determine the

best fit and displays all results for manual intervention. $9.95

CURVE FIT accepts any number of data points, distributed in

any fassion, and fits a curve to the set of points using log

curve fit, exponential curve fit, least squares, or a power curve

fit. It will compute the best fit or employ a specific type of fit,

and display agraph of the result. By Dave Garson. $9.95

PERPETUAL CALENDAR may be used with or without a

printer. Apart from the usual calendar functions, i t computes

the number of days between any two dates and displays sue-

cessive months in response to a single keystroke. Written by

Ed Hanfey. $9.95

STARWARS is Bob Bishop's version of the original and best

game of intergallactic combat. You fire on the invader after

aligning his fighter in your crosshairs. This is a high resolution

game, in full color, that uses the paddles. $9.95

ROCKET PfLOT is an exciting game that simulates blasting off

in a rocket ship. The rocket actually accelerates you up and

over a mountain; but if you are not careful, you will run out of

sky. Bob Bishop's program changes the contour of the land

every time you play the game. $9.95

SPACE MAZE puts you in control of a rocket ship that you

must steer out of a maze using paddles or a joystick. It is a real

challenge, designed by Bob Bishop using high resolution

graphics and full color. $9.95

MISSILE ANTI·MISSILE displays a target on the screen and a

three dimensional map of the United States. A hostile sub-

marine appears and launches a pre-emptive nuclear attack

controlled by paddle 1. As soon as the hostile missile is fired.

the U.S. launches its antl-mtsslte control led by paddle O . Dave

Moteles' program offers high resolution and many levels of

play. $9.95

MORSE CODE helps you learn telegraphy by entering letters,

words or sentences, in English, which are plotted on the

screen usinq dots and dashes. Ed Hanley's program stso

generates sounds to match the screen display, at several

transmission speed levels. $9.95

POLAR COORDINATE PLOT is a high resolution graphics

routine that displays five classic polar plots and also permits

the operator to enter his own equation. Dave Moteles' program

will plot the equation on a scaled grid and then flash a table of

data points required to construct a similar plot on paper. $9.95

UTILITY PACK 1 combines four versatile programs by Vince

Corsetti, for any memory configuration.

POST AGE AND H ANDLINGP leas e add $1 .00 for the firs t item

and $.5 0 for e ach additional ite m.

• P rogram s acce pte d for publication

• H ighes t royalty paid

o Integer to Applesoft conversion: Encounter only those

syntax errors unique to Applesoft after using this program

to convert any Integer BASIC source.

o Disk Append: Merge any two Integer BASIC sources into a

single program on disk.

o Integer BASIC copy: Replicate an Integer BASIC programfrom one disk to another, as often as required, with a

single keystroke .

• Applesoft Update: Modify Applesoft on the disk to elimin·

ate the heading always produced when it is first run.

o Binary Copy: Automatically determines the length and

starting address of a program while copying its binary file

from one disk to another in response to a single key·

stroke. $9.95

BLOCKADE lets two players compete by building walls to

obstruct each other. An exciting game written in Integer

BASIC by Vince Corsetti. $9.95

TABLE GENERATOR forms shape tables with ease from oirec-

tional vectors anti adds additional information such as star-

ting address, length and position of each shape. Murray Sum-

mers' Applesoft program wil l save the shape table anywhere in

usable memory. $9.95

OTHELLO may be played by one or two players and is similar

to chess in strategy. Once a piece has been played, its color

may be reversed many times, and there are also sudden

reverses of luck. You can win with a single move. Vince Corset-

ti's program does all the work of keeping board details and

flipping pieces. $9.95

SINGLE DRIVE COpy is a special utility program, written by

Vince Corsett i in Integer BASIC. that will copy a diskette using

only one drive. It is supplied on tape and should be loaded onto

a diskette. It automatically adjusts for APPLE memory size

and should be used with DOS3.2. $19.95

SAUCER INVASION lets you defend the empire by shooting

down a flying saucer. You control your position with the pad-

die while firing your missile at the invader. Written by BobBishop. $9.95

HARDWARELIGHT PEN with seven supporting routines. The light meter

takes intensity readings every fraction of a second from 0 to

588. The light graph generates a display of light intensity on

the screen. The light pen connects points that have been

drawn on the screen. in low or high resolution. and displays

their coordinates. A special utility displays any number of

points on the screen, for use in menu selection or games. and

selects a point when the light pen touches it. The package in-

cludes a light pen calculator and light pen TIC TAC TOE. Neil

D. Lipson's programs use artificial intelligence and are not

confused by outside light. The hi-res light pen, only, requires

48K and ROM card. $34.95

T O O RDER

Send check or m oney orde r to:

P.O . Box 273Plym outh M eeting, P A 19 462

P A res idents add 6 % s a le s ta x.

U.S. and fore ign de ale r and dis tributor inquirie s invite d

A ll program s require 16K m emory unless spe cifie d •

Page 31: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 31/60

What's Where in the APPLE

Professor William F. LuebbertDartmouth CollegeHanover, NH 03755

Whether you are programming in BASIC or assemblylanguage, a memory map helps save time, reduce pro-gram size and improve performance. This is the mostcomplete and up to date APPLE memory map everpublished. .

To get the most out of an APPLE, or

any other computer with limitedresources, it is important to know a good

deal about the hardware and software

environment.

When one graduates from simple pro-grams to more ambitious programs in-volving careful control of man-machineinteraction, analog to digital or digital toanalog conversion, extensive use of

computer graphics, the control of exter-nal devices, database management,

sorting, word-processing or any of awide variety of interesting tasks, this

knowledge tends to becomemore impor-tant. When (and if) one gets into real

time programming, adding his ownspecialized interfaces, performs ac-tivities where one must get the absolutemaximum speed or gets into other situa-tions where machine language program-

ming is appropriate, It becomes critical.

Not every serious programmer needsto become amachine language level pro-

grammer. However, good programmers

know that when the computer is runningtheir programs there is a good deal ofmachine language code in the machine

providing an operating environment fortheir programs. This operating environ-

ment typically includes the systemmonitor, a BASIC interpreter andpossibly a disk operating system (DOS)andlor extra ROMpackages.

When one looks at interesting pro-

grams described in magazines and usergroup newsletters, he finds that theseprograms often contain PEEKs, POKEs

and CALLs. These are commands which

are extensions of BASIC(or other higher

August, 1979

level languages). They are provided toallow one to interface with the computerhardware, operating environment soft-

ware, and other machine language pro-

grams or subprograms.

PEEKs, POKEs and CALLs all refer tomemory locations which are identifiable

as to what they contain or what they do.

a PEEK examines the contents of aspecified memory location and allows

one to use that content in a program.POKE changes the contents of a

designated memory location to somespecified value. It can beused to changeparameters of the operating environ-

ment or to set up or change pieces of

program or data. A CALL transfers pro-gram control to a particular memory

location and sets up a return linkage fortransfer back to the CALling routine in

the user's program.

Pieces of the monitor or some otherparts of the operating environment can

often be accessed via CALLs, POKEs

and PEEKs to modify system operationor to perform desired functions without

the necessity of additional code. Usuallythis code has been carefully written in

machine language and optimized bygood programmers, so it runs faster and

takes less space or less computer timethan the same function would require if

programmed totally by the user.

A programming manual intended for

serious programmers should supplysome sort of memory map and informa-tion about the most important and fre·

quently used PEEKs,POKEsand CALLs.A good memory map can show the user

where he can get information from the

MICRO- The 6502 Journal

computer, what potentially useful soft-

ware is available but perhaps hidden

away inside the computer, and the

"hooks" provided to perform a widevariety of functions bymeans o-fCALLs,

POKEs andlor PEEKs. Often it becomesthe most well-worn section of the

manual. Once programmers begin usingit as a source of information, they begin

to wish for a more complete atlas which

will let them find more and more infor·mation and guide them in their own ex-

plorations inside the computer and its

software.

The memory map presented here was

developed initially as a programming aidfor my own personal programming. lrn-

portant sources of information for its

creation included the APPLESOFT /I

Manual, the APPLE Reference Manual,

WOZPAC and various Issues of MICRO,

Cal/·Apple and NEAT as well as my owninvestigations Inside the computer.

The map is being circulated for com-

ment, correction and modification bymany of the more active members of the

New England Apple Tree User's Group.They have suggested valuable changes,corrections and additions. Inevitably

there will sti ll be errors and omissions.For these I beg your indulgence.

This memory atlas is stored on-line onthe Dartmouth Timeshare System in adatabase which can be used for selec-

tive retrieval and report generation usingstandard database management soft-

ware. The author would appreciate cor-rections or suggested changes or addi-

tions. Please mail them to him at Hin-

man, Box 6166, Dartmouth College,Hanover, NH 03755.

15:29

Page 32: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 32/60

Page 33: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 33/60

LUEBBERT'S COPYRIGHT APPLE MEMORY ATLAS - MICAo MAGAZINE VERSION

HEXLOC DECLOC

$0083-$0084 131-132

$008~-$009C 133-156

$0095

$009D-$00A3 1~7-163

$00A4 164

$OOA5-$00AB 16~-171$OOAC-$OOAE 172-174

$OOAF-$OOBO 175-176

$OOBI 177

$00B1-$00C8 177-200

$00B7 183

$00B8-$00B9 184-185

$00B8-$00B9 184-185

SOOC9-$00CD 201-205

$OOCA-$OOCB 202-203

$OOCC-$OOCD 204-205

$OOCE-$OOCF 206-207

$OODO-$OODF 216-223

$OODO 216

$OODE 222

$00EO-$00E2 224-226

$00E4 228

$00E5-$00E7 229-231

$00E8-$00E9 232-233

$OOEA 234

$00FO-$00F3 240-243

$00F3

$00F4 244

$00F4-$00F8 244-248

$00F5 245

$00F7 247$00F8 248

$00F9 249

$OOFC 252

$0100-$01FF 256-511

$0200 512

$0200-$02FF 512-767

$0300-$03FF 768-1023

$0300-S03F7 768-1015

$0300. $03AF 768-943

$0320-$0321 800-801

$0322 802

$0323 803

$0324 804

$0325 805

$0326 806

$0326 806

$0327 807

$0328-$0329 808-809

$032A 810

$03DO 976

$03DO 976

$0303 979

$0306 982$0309 985

$03DC 988

$03E3 995

$03EA 1002

$03F8 1016

$03FB 1019

$03FE 1022

$03FE-$03FF 1022-1023

$0400-$07FF 1024-2043

$0478+S 1144+S

$0478+S 1144+S

$04F8+S 1272+S

$04F8+S 1272+S

$0578+S 1400+S

$0578+S 1400+S

$05F8+S 1528+S$0678+S 1656+S

$0678+S 1656+S

$06F8 1784+S

$06F8+S 1784+S

$0778+S 1912+S

$0778+S 1912+S

$07F8+S 2040+S

$07F8+S 2040+S

$0800 2048

$0800-$09FF 2048-25~9

$0800-$OBFF 2048-3071

NAME

PICK

PROGRAM POINTER

CHRGOT

TXTPTR

PPL~PPH

PVL~PVH

ACL~ACH

SIGN

X2

M2

S16PAGXl

Ml

E

IN

XOL~XOH

YO

J3XSAV

HCOLOR

HNDX

HPAG

HPAG

SCALE

SHAPXL"'SHAPXH

COLLSN

995

1002

USRADR

NMI

IRGADR

BRATE

STBITS

STATUS

J3YTE

PWDTH

NBITS

FLAGS

USE

POINTER TO THE LAST-USED VARIABLE'S VALUE

GENERAL USAGE

MONITOR MEMORY LOCATION 'PICK'

MAIN FLOATING-POINT ACCUMULATOR

GENERAL USE IN FLOATING POINT MATH ROUTINES

SECONDARY FLOATING POINT ACCUMULATOR

GENERAL USAGE FLAGS/POINTERS

POINTER TO .END OF PROGRAM. NOT CHANGED BY LOMEM:

CHRGET SIR CALL - GETS NEXT SEGUENTIAL CHR OR TOKEN

CHRGET ROUTINE. CALLED WHEN A-S WANTS ANOTHER CHARACTER

CHRGOT SIR CALL. CHRGET INCREMENTS TXTPTR. CHRGOT DOES NOT

PTR TO LAST CHAR OBTAINED THRU CHRGET ROUTINE

TXTPTR - POINTS AT NEXT CHAR OR TOKEN FROM PROG (CIA DEC 78)

RANDOM NUMBER

BASIC START-OF-PROGRAM POINTER

BASIC END OF VARIABLES POINTER

BASIC ACC

ONERR POINTERS/SCRATCH

POKE 0 TOCLEAR ERROR FLAG

WHEN ERROR OCCURS'" ERROR CODE APPEARS HERE

HI-RES GRAPHICS X~Y COORDINATES

HI-RES GRAPHICS COLOR BYTE

GENERAL USAGE FOR HI-RES GRAPHICS

POINTER TO BEGINNING OF SHAPE TABLE

COLLISION COUNTER FOR HI-RES GRAPHICS

GENERAL USE FLAGS

MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'SIGN'

MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'X2' (EXPONENT 2)

ONERR POINTERS

MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'M2' (MANTISSA 2)

SWEET-16 MEMORY LOCATION 'SI6PAG'MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'Xl' (EXPONENT 1)

MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'Ml' (MANTISSA 1)

MONITOR ~ FLOATING POINT ROUTINES MEMORY LOC 'E'

SUBROUTINE RETURN STACK

MONITOR ~ MINIASSEMBLER MEMORY LOCATION 'IN'

KEYIN (INPUT) BUFFER

AREA CLOBBERED BY EITHER MASTER OR SLAVE DISKETTE BOOT

OFTEN FREE SPACE. NOTE COMPETING USES OFTEN FREE SPACE CONSTRAINTS

DECWRITER PRINTER OUTPUT (IF BLOADED FROM DISK)

HI-RES GRAPHICS- PRIOR X-COORD SAVE AFTER HLIN OR HPLOT

HI-RES GRAPHICS YO - MOST RECENT Y-COORDINATE

HI-RES GRAPHICS 'BXSAV'

HI-RES GRAPHICS COLOR FOR HPLOT~ HPOSN

HI-RES GRAPHICS HNDX - ON-THE-FLY BYTE INDEX FROM BASE ADDRESS

POKE 32 FOR HI-RES PGl PLOTTING~ 64 FOR PAGE2

HI-RES GRAPHICS MEM PAGE FOR PLOTTING GRAPHICS $20 FOR PGl ~$40 FOR

ON-THE-FLY SCALE FACTOR FOR DRAW~ SHAPE~ MOVE

START-OF-SHAPE-TABLE POINTER

COLLISION COUNT FROM DRAW~DRAWI

DOS RE-ENTRY POINT (3DOG)

INITIALIZE OR RE-INITIALZE DOS (3DOG)

DOS 3. 1 HARD ENTRY POINT

DOS 3.1 ENTRY POINT FOR I/O PACKAGE

DOS 3. 1 ENTRY POINT FOR RWTS

DOS 3. 1 ENTRY POINT TO LOAD Y~A WITH ADDRESS AT END OF SYS BUFFER

DOS 3. 1 ENTRY POINT TO LOAD Y~A WITH ADDRESS OF IOBLK

DOS 3.2 ENTRY POINT FOR ROUTINE THAT UPDATES liD HOOK TABLES

CTL-Y WILL CAUSE JSR HERE

NMI'S VECTORED TO THIS LOCATION

MONITOR MEMORY LOCATION 'IRGADR'

IRQ'S VECTORED TO ADDRESS WHOSE POINTER IS HERE

SCREEN BUFFER (HARDWARE PAGES 4-7) (LOW-RES GRAPHICS ~ TEXT PAGE 1)

SERIAL INTERFACE BAUD QUANTUM RATE. $1= 19200 BAUD, $40=300 BAUD

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT ~S

SERIAL INTERFACE: CONTAIN NUMBER OF STOP BITS (INCLUDING 1 PARITY BIT

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT ~S

SERIAL INTERFACE: PARITY CHECKSUM OPTIONS (SEE MANUAL)

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT~S

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT ~SSERIAL INTERFACE INPUT OUTPUT BUFFER

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT ~S

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT #S

SERIAL INTERFACE PRINT LINE WIDTH (# CHARS PER LINE)

SERIAL INTERFACE NUMBER OF DATA BITS PLUS 1 FOR START BIT

SCRATCHPAD MEMORY BYTE FOR PERIPHERAL IN SLOT ~S

SERIAL INTERFACE OPERATION MODE

INTERRUPT RETURN MEMORY BYTE FOR PERIPHERAL IN SLOT ~S

DEFAULT INTEGER BASIC LOMEM

AREA CLOBBERED BY EITHER MASTER DR SLAVE DISKETTE BOOT

SECONDARY SCREEN BUFFER (TEXT & LOW-RES GRAPHICS PAGE 2)

August, 1979 MICRO - The 6502 Journal 15:31

Page 34: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 34/60

LUEBBERT'S COPYRIGHT APPLE MEMORY ATLAS - MICRO MAGAZINE VERSION

HEXLOC DECLOC NAME

$0800-$COOO 2048-491~2

$OBOO-LOMEM 2048-LOMEM

$OCOO 3072

SOC00-$1 FFF 3072-8191

$OCF2 3314

$lBOO-$3FFF 4000-163B3

$lBOO-$4000 6912-16384

$2000-$3FFF 8192-16383

$3000-LOMEM 12288-LOMEM

$3F3-$3F4 1011-1012

4000-$4520 16384-17696

$4000-$5FFF 16384-24575

4~00 17664

4500-4520 17664-17696

5600-$8000 22016-32768

9600-$9853 -27136--26541

600-$9700 -27136--26880

-26879--26622

801-$9853 -26623--26541

9010-7 -25328-'?

-25229--25561-29159

-25011

9E7E -24962

-24140

AIB9 -24135

-24130

AIDC -24100

-24082

AIFC -24068

-24064

A200 -24064A208 -24056

-24052

A223 -24029

-24010

A278 -23944

-23828

-23769

-23760

-23643

A476 -23434

A48D -23411

-23387

A4BO -23376

A4E4 -23324

-23295

A50D -232B3

AS31 -23247

A54F -23217

A~66 -23210-22560--22439

BCD-SA980 -22323--22144

-22122--22121

998-sA999 -22120--22119

9A3-SA9A4 -22109--22108

9B~-SA9B6 -22091--22090

-22005

-21953--19762

3EF-SB642 -19473--18878

BOOO -17152

-16384

-16384

COOO -16384 KBD ~ IOADR

OOO-sCOOF -16384--16369

-16384--12289

COI0 -16368 KBOSTB

-16368--16353

-16352 TAPEOUT

-16352-16336 SPKR

-16320

-16304 TXTCLR

-16303 TXTSET

-16302 MIXCLR

-16301 MIXSET

-16300 LOWSCR

-16299 HISCR

-16298 LORES

-16297 HIRES

USE

RANGE OF POSSIBLE SETTINGS FOR HIMEM (DEPENDING UPON MEM SIZE~ DOS

PROGRAM STORAGE FOR ROM VERSION OF APPLESOFT IDEFAULT LOCATION FOR START OF SHAPE TABLE AS SET BY HI-RES SHAPE LOAD")

OFTEN FREE SPACE

TO CNVRT AIS PROG FM ROM TO CASSETTE: LOAD PROG~ CALL 3314~LIST~SAVE

THIS REGION OF MEMORY IS CLOBBERED BY A SLAVE DISKETTE BOOT

RAWDOS (VERSION OF DOS USED WITH MASTER CREATE - FROM DISK)

HI-RES GRAPHICS PAGE 1

PROGRAM STORAGE FOR RAM VERSION OF APPLESOFT

DOS 3. 1 - POKE TO ZEROS TO REBOOT HELLO PROGRAM

NORMAL LOCATION FOR KAPOR 'SHI RES TEXT SET

HI-RES GRAPHICS PAGE 2

CALL FOR INVERSION BY KAPOR'S ROUTINE

SIR WI KAPOR'S HI-RES TEXT SET TO INVERT WHITE TO BLACK ~ VICEVERSA

DISK OPERATING SYSTEM (0053.1)

DOS 3. 1 USER BUFFER III

DOS 3. 1 USER BUFFER IIIDATA BUFFER

DOS 3. 1 USER BUFFER 111 - LIST OF SECTOR & TRACK NUMBERS USED

DOS 3, 1 USER BUFFER 111 - FILE NAME & MISC DATA

STARTING ADDRESSES FOR VARIOUS DOS3.1 TASKS

SYSTEM SECT ION OF DOS 3. 1INITIALIZE OR RE-INITIALIZE DOS

ROUTINE WHICH HANDLES DOS INPUT HOOK

ROUTINE WHICH HANDLES DOS OUTPUT HOOK

ADDRESS FOR DOS3. 1 PRII COMMAND

ADDRESS FOR DOS 3.1 INIICOMMAND

ADDRESS FOR DOS 3. 1 MON COMMAND

ADDRESS FOR DOS 3.1 MAXFILES COMMAND

ADDRESS FOR DOS 3. 1 DELETE COMMAND

ADDRESS FOR DOS 3. 1 LOCK COMMAND

ADDRESS FOR DOS 3. 1 BSAVE COMMAND

ADDRESS FOR DOS 3. 1 UNLOCK COMMANDADDRESS FOR DOS 3.1 VER IFY COMMAND

ADDRESS FOR DOS 3.1 RENAME COMMAND

ADDRESS FOR DOS 3.1 APPEND COMMAND

ADDRESS FOR DOS 3. 1 OPEN COMMAND

ADDRESS FOR DOS 3. CLOSE COMMAND

ADDRESS FOR DOS 3. BLOAD COMMAND

ADDRESS FOR DOS 3. BRUN COMMAND

ADDRESS FOR DOS 3. SAVE COMMAND

ADDRESS FOR DOS 3. LOAD COMMAND

ADDRESS FOR DOS 3 1 RUN COMMAND

ADDRESS FOR DOS 3. 1 CHA IN COMMAND

ADDRESS FOR DOS3. 1 WR ITE COMMAND

ADDRESS FOR DOS 3. READ COMMAND

ADDRESS FOR DOS 3. INIT COMMAND

ADDRESS FOR DOS 3. NOMON COMMAND

ADDRESS FOR DOS 3. FP COMMAND

ADDRESS FOR DOS 3. INT COMMAND

ADDRESS FOR DOS 3. 1 EXEC COMMAND

ADDRESS FOR DOS 3. 1 POSITION COMMANDDOS COMMAND TABLE

DOS ERROR MSG TABLE

DOS INTERNAL HOOK ADDRESS TO OUTPUT A CHARACTER

DOS INTERNAL HOOK ADDRESS TO INPUT A CHARACTER

LENGTH OF BLOADED FILE

STARTING ADDRESS OF BLOADED FILE

START OF LIST OF POINTERS TO SECTIONS OF DOS 3.1 110 PACKAGES

DOS 3.1 110 PACKAGE

DOS 3. 1 SYSTEM BUFFER (FOR CATALOG ETC. )

ROUTINE WHICH READS IN DIRECTORY OFF DISK

VOL NO OF CURRENT DISK

HIGHEST RAM MEMORY ADDRESS

DEFAULT INTEGER BASIC HIMEM (WID DOS~ 4BK MACHINE)

READ KEYBOARD. IF VAL>127 THEN KEY WAS PRESSED

KEYBOARD INPUT SUBROUTINE

ADDRESSES DEDICATED TO HARDWARE FUNCTION

CLEAR KEYBOARD STROBE. POKE 0 AWAYS AFTER READING KBD.

CLEAR KEYBOARD STROBE SUBROUTINE

MONITOR MEMORY LOCATION 'TAPEOUT'

TOGGLE CASSETTE OUTPUT

PEEK TO TOGGLE SPEAKER

OUTPUT STROBE TO GAME 110 CONNECTOR

POKE TO 0 TO SET GRAPHICS MODE

POKE 0 TO SET TEXT MODE

POKE 0 TO SET BOTTOM 4 LINES TO GRAPHICS

POKE=O TO SELECT TEXTIGRAPHICS MIX (BOTTOM 4 LINES TEXT)

POKE TO 0 TO DISPLAY PRIMARY PAGE (PAGE 1)

POKE TO 0 TO DISPLAY SECONDARY PAGE (PAGE2)

POKE TO 0 TO SET LO-RES GRAPHICS

POKE TO 0 TO SET HI-RES GRAPHICS

MICRO - The 6502 Journal August, 1979

Page 35: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 35/60

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LUEBBERT'S COPYRIGHT APPLE MEMORY ATLAS - MICRO MAGAZINE VERSION

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - .._ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ ....- . _ - - - - ~ - - -

HEXLOC DECLOC

$C058 -16296

$C059 -16295

$C05A -16294

$C05B -16293

$C05C -16292

$C05D -16291

$C05E -16290

$C05F -16289

$C060 -16288

$C060/8 -16288

$C061 -16287$C062 -16286

$C063 -16285

$C064 -16188

$C064/C -16188

$C065/D -16187

$C066/E -16186

$C067/F -16185

$C070 -16272

$C07X -16272

$C08X -16256

$C09X -16240

$COAX -16224

SCOBX -16208

$COCX -16192

SCODX -16176

SCOE8 -16152

$COE9 -16151

$COEX -16160

$COFX -16144$C100 -16128

SC100 -16128

SC200 -15842

SC300 -15616

SC400 -15360

$C500 -15104

SC600 -14848

SC700 -14592

$C800-SCFFF -14336--12289

SC93D -14109

$C941 -14105

SCSOO -16384+256*S

SDOOO -12288

$DOOO-SD3FF -12288--11265

SOOOO-$D7FF -12288--10241

$DOOE -12274

SD010 -12272

$0012 -12270

SOlFC -11780

$D2F9 -11527

SD30E -11506

SD314 -11500

.D331 -11471

S0337 -11465

SD33A -11462

S03B9 -11335

$D4BC -11076

SD4F2 -11022

$0535 -10955

SD6DD -10531

SD6E7 -10521

SD717 -10473

$D800-$DFFF -10240--8193

SDD67 -8867

$DEC9 -8503

.EOOO -8192

$EOOO-.E7FF -8192--6145

$10003 -8189

SE36B -7317$E51B -6885

SE6F8 -6408

SE800-.EFFF -6144--4097

SEE68 -4504

SFOOO-.F7FF -4096--2049

.F11E -3810

SF666 -2458

.F689 -2423

.F800 -2048

SF800 -2048

.F80O-.FFFF -2048--1

August, 1979

NAME USE

0 TO CLEAR GAME 1/0 OUTPUT ANO

0 TO SET GAME 110 OUTPUT ANO

0 TO CLEAR GAME 110 OUTPUT ANI

0 TO SET GAME 110 OUTPUT ANI

0 TO CLEAR GAME 1/0 OUTPUT AN2

0 TO SET GAME I/O OUTPUT AN2

POKE

POKE

POKE

POKE

POKE

POKE

POKE 0 TO CLEAR GAME 110 OUTPUT AN3

POKE 0 TO SET GAME 110 OUTPUT AN3

TAPEIN MONITOR MEMORY LOCATION 'TAPEIN'

STATE OF 'CASSETE DATA IN' APPEARS IN Bl1 7

PEEK TO READ PDL(O). IF ~'127 SWITCH ONPEEK TO READ PDL(I) PUSH BUTTON SWITCH

PEEK TO READ PDL(2) PUSH BUTTON SWITCH

PADDLO MONITOR MEMORY LOCATION PADDLO

STATE OF TIMER OUTPUT FOR PADDLE APPEARS IN BIT 7

STATE OF TIMER OUTPUT FOR PADDLE APPEARS IN BIT 7

STATE OF TIMER OUTPUT FOR PADDLE 2 APPEARS IN BIT 7

STATE OF TIMER OUTPUT FOR PADDLE 3 APPEARS IN BIT 7

PTRIG MONITOR MEMORY LOCATION 'PTRIG' iPADDLE TRIGGER)

PTRIG TRIGGERS PADDLE TIMERS DURING PHI-2

DEVICE SELECT 0

DEVICE SELECT

DEVICE SELECT 2 DEVICE SELECT 2

DEVICE SELECT 3

DEVICE SELECT 4

DEVICE SELECT :5

ADDRESS TO POWER DOWN DISK IN SLOT 6

ADDRESS TO POWER UP DISK IN SLOT 6

DEVICE SELECT 6

DEVICE SELECT 7CALL -16128 IS EGUIVALENT TO PR.l FOR INITIALIZING SERIAL

STANDARD CHARACTER 110 SUBROUTINE ENTRY POINT FOR SLOT .1

STANDARD CHARACTER 110 SUBROUTINE ENTRY POINT FOR SLOT ~2

STANDARD CHARACTER 110 SUBROUTINE ENTRY POINT FOR SLOT .3

STANDARD CHARACTER lI D SUBROUTINE ENTRY POINT FOR SLOT #4

STANDARD CHARACTER 1/0 SUBROUTINE ENTRY POINT FOR SLOT .5

STANDARD CHARACTER 110 SUBROUTINE ENTRY POINT FOR SLOT ~6

STANDARD CHARACTER 1/0 SUBROUTINE ENTRY POINT FOR SLOT #6

INTERFACE

SETHRL

PIN 20 ON ALL PERIPH CONCTRS GOES LOW DURING PHIO ON READ OR WRITE

SERIAL INTERFACE BATCH INPUT ROUTINE. A1&A2 SPECIFY MEMORY RANGE

SERIAL INTERFACE BATCH OUTPUT ROUT[NE - Al & A2 SPECIFY MEMORY RANGE

TRANSMIT ASCII CHAR IN ACCUMULATOR OUT VIA SERIAL INTERFACE IN SLOT S

HI-RES GRAPHICS INIT SIR CALL (ROM VERSION)

HI-RES GRAPHICS ROM

ROM SOCKET DO

HI-RES CRAPHICS CLEAR SIR CALL

HI-RES GRAPHICS 'BKGNDO (HCOLOR! SET FOR BLACK BKGND)

HI-RES GRAPHICS MEMORY LOCATION 'BKGND' (ROM)

HI-RES GRAPHICS FIND SIR CALL: PARAM=SHAPE~ROT~SCALE

HI-RES GRAPHICS POSN SIR CALL PARAM= XO~YO~COLR

HI-RES GRAPHICS PLOT SIR CALL PARAM= XO~YO~COLR

HI-RES GRAPHICS LINE SIR CALL PARAM= XO~YO~COLR

HI-RES GRAPHICS BKGND SIR CALL PARAM= COLR

HI-RES GRAPHICS LINE SIR CALL: PARAM=XO~YO~COLR

HI-RES GRAPHICS DRAWl SIR CALL: PARAM= XO~YO~COLR~SHAPE~ROT~SCALE

HI-RES GRAPHICS SHLOAD SIR CALL

INTEGER BASIC PA~l APPEND PROGRAM ENTRY

TO CONVERT AIS FM CASSETTE TO ROM- LD FM <::ASS~CALL-!lC22~LIST~SAVE

INTEGER BASIC PA~l TAPE VERIFY PROG ENTRY

INTEGER BASIC PA.1 RENUMBER PROG ENTRY (WHOLE PROG)

INTEGER BASIC PA~l RENUMBER PROG ENTRY (PART PROG)

INTEGER BASIC PA.I MUSIC PROG ENTRY

ROM SOCKET D8

FRMNUM SIR. EVALS FORMULA EXP. INTO FLOATING PT ACCUM

SNERR SIR. PRINTS "SYNTAX ERROR" AND HALTS PROG

ENTER INTEGER BASIC

ROM SOCKET EO (INTEGER BASIC)

ENTRY 2 OF INTEGER BASIC

INTEGER BASIC MEMORY FULL ERRORINTEGER BASIC DECIMAL LPRINT SIR

GETBYT SIR. EVALS FORMULA 8, CONVTS TO I-BYT VAL IN X REG

ROM SOCKET E8 (INTEGER BASIC)

INTEGER BASIC RANGE ERROR

ROM SOCKET FO (II'.INTEGER BASIC~ 1 I'.MONITOR)

HI-RES GRAPHICS 2-BYTE TAPE READ SETUP

TURN ON MINIASSEMBLER

SWEET-16 INTERPRETER ENTRY

MONITOR SIR PLOT A POINT (LO-RES) AC:Y-COORD Y:X-COORD

MONITOR SIR PLOT A POINT. AC:Y-COORD~Y: X-COORD

ROM SOCKET F8 (MONITOR)

HCLR

BKGNDO

BKGND

BASIC

BASIC2

MEMFUL

RNGERR

ACADR

PLOT

PLOT

MICRO - The 6502 Journal 15:33

Page 36: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 36/60

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ . _ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ ' - . - - - - .LUEBBERT'S COPYRIGHT APPLE MEMORY ATLAS - MICRO MAGAZINE VERSION

HEXLOC

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' - - - - - - - - - - - - - - - - - - - - - - - - - - _ . _ - - - - - - - - - - - - - _ . _ - - - - - - - - - _ . _ - - - - -

..80C

.FSOE

..BI9

.F819

.F81C

.F826

.F828

.F8:31

.F8:32

.F8:32

.F8:36

.F8:38

.F8:3C

..847

.F8:56

.F85F

.F864

.F871

.F871

.F879

..87F

.F882

..88E

.F89B

.F8A5

..8A9

.F8BE

..8C2

.F8C9

.F8DO

.F8D4

.F8DB

.F8F5

.F8F9

.F910

.F914

$F926

..92A

.F9:30

..9:38

.F940

..941

.F944

$F948

$F94C

.F94C

..95:3

.F954

$F956

..961

..962

.F9A6

.F9B4

..9BA

.F9CO

..AOO

..A4:3

..A4E

..A 78

.FA7A

..A86

.FA92

.FA9C

..AA 5

.FAA9

..AAD

.FAAF

..AB9

..AC4

.FAC5

..ACD

.FADI

..AD7

.FADA

..AE4

.FAFD

.FBOB

..Bll

.FBI9

..BIE

..B25

DECLOC

-2036

-2034

-2023

-2023

-2020

-2010

-2008

-1999

-1998

-1998

-1994

-1992

-1988

-1977

-1962

-1953

-1948

-1935

-1935

-1927

-1921

-1918

-1906

-189:3

-1883

-1879

-1858

-1854

-1847

-1840

-1836-1829

-1803

-1799

-1776

-1772

-1754

-1750

-1744

-1736

-1728

-1727

-1724

-1720

-1716

-1709

-1708

-1706

-1695

-1694

-1626

-1612

-1606

-1600

-1536

-1469

-1458

-1416

-1414

-1402

-1390

-1:380

-1371

-1367

-1363

-1361

-1351

-1340

-1339-1331

-1327

-1321

-1318

-1:308

-1283

-1269

-1263

-1255

-1250

-1243

NAME

RTMASI'.

PLOTI

HLINE

HLINEI

VLINEZ

VLINE

RTSI

CLRSCR

CLRSCR

CLRTOP

CLRSC2

CLRSC3

GBASCALC

GBCALC

NXTCOL

SETCOL

SCRN

SCRN

SCRN2

RTMSKZ

INSDS!

INSDS2

IEVEN

ERR

GETFMT

MNNDX!

MNNDX2

MNNDX3

INSTDSP

PRNTOPPRNTBL

PRMNI

PRMN2

PRADRI

PRADR2

PRADR3

PRADR4

PRADR5

RELADR

PRNTYX

PRNTAX

PRNTX

PRBLNK

PRBL2

PRBL3

PCADJ

PCADJ2

PCADJ4

RTS2

FMTl

FMT2

CHARI

CHAR2

MNEML

MNEMR

STEP

XQINIT

XQl

XQ2

IRQ

BREAK

XBRK

XRTI

XRTS

PCINC2

PCINC3

X,JSR

X,JMP

X,JMPATNEWPCL

RTN,JMP

REGDSP

RGDSP 1

RDSPI

BRANCH

NBRNCH

INITBL

RTBL

PREAD

PREAD2

USE

MONITOR MEMORY LOCATION 'RTMASI'.'

MONITOR MEMORY LOCATION 'PLOTl'

HLINE SIR (SEE CALL-APPLE NOVIDEC 78 PG4)

MONITOR SIR TO DRAW A HORIZONTAL LINE (LO-RES)

MONITOR MEMORY LOCATION 'HLINEl'

MONITOR MEMORY LOCATION 'VLINEZ'

DRAW A VERTICAL LINE

MONITOR MEMORY LOCATION 'RTSl'

CLEAR SCREEN - GRAPHICS MODE

CLEAR LOW RES GRAPHICS SCREEN!

MONITOR MEMORY LOCATION 'CLRTOP'

MONITOR MEMORY LOCATION 'CLRSC2'

MONITOR MEMORY LOCATION 'CLRSC3'

MONITOR SIR TO CALCULATE GRAPHICS BASE ADDRESS

MONITOR MEMORY LOCATION 'GBCALC'

MONITOR SIR - INCREMENT COLOR BY 3

MONITOR SIR TO AD,JUST COLOR BYTE FOR BOTH HALVES EQUAL

SCRN SIR (LO-RES GRAPHICSl(SEE CALL-APPLE DEC78)

MONITOR SIR TO GET SCREEN COLOR. AC.Y-COORD~Y: X-COORD

MONITOR MEMORY LOCATION 'SCRN2'

MONITOR MEMORY LOCATION 'RTMSKI'

MONITOR MEMORY LOCATION 'INSDSl'

MONITOR SIR - DISASSEMBLER ENTRY

MONITOR MEMORY LOCATION 'lEVEN'

MONITOR MEMORY LOCATION 'ERR'

MONITOR MEMORY LOCATION GETFMT

MONITOR MEMORY LOCATION 'MNNDXl'

MONITOR MEMORY LOCATION 'MNNDX2'

MONITOR MEMORY LOCATION 'MNNDX3'

MONITOR ~ MINIASSEMBLER MEMORY LOCATION 'INSTDSP'

MONITOR MEMORY LOCATION 'PRNTOP'MONITOR MEMORY LOCATION 'PRNTBL'

MONITOR MEMORY LOCATION 'PRMNl'

MONITOR MEMORY LOCATION 'PRMN2'

MONITOR MEMORY LOCATION 'PRADRl'

MONITOR MEMORY LOCATION 'PRADR2'

MONITOR MEMORY LOCATION 'PRADR3'

MONITOR MEMORY LOCATION 'PRADR4'

MONITOR MEMORY LOCATION 'PRADR5'

MONITOR MEMORY LOCATION 'RELADR'

MONITOR S/R- PRINT CONTENTS OF Y AND X AS 4 HEX DIGITS

MONITOR MEMORY LOCATION 'PRNTAX'

MONITOR MEMORY LOCATION 'PRNTX'

MONITOR MEMORY LOCATION 'PRBLNI'.'

MONITOR S/R- PRINT BLANKS: X REG CONTAINS NUMBER TO PRINT.

MONITOR MEMORY LOCATION 'PRBL3'

MINIASSEMBLER MEMORY LOCATION 'PCAD,J'

MONITOR & MINIASSEMBLER MEMORY LOCATION 'PCAD,J2'

MONITOR MEMORY LOCATION 'PCAD,J4'

MONITOR MEMORY LOCATION 'RTS2'

MONITOR MEMORY LOCATION 'FMTl'

MONITOR MEMORY LOCATION 'FMT2'

MONITOR ~ MINIASSEMBER MEMORY LOCATION 'CHARI'

MONITOR ~ MINIASSEMBLER MEMORY LOCATION 'CHAR2'

MONITOR ~ MINIASSEMBLER MEMORY LOCATION 'MNEML'

MONITOR ~ MINIASSEMBER MEMORY LOCATION 'MNEMR'

MONITOR S/R- PERFORM A SINGLE STEP

MONITOR MEMORY LOCATION 'XQINIT'

MONITOR MEMORY LOCATION 'XQl'

MONITOR MEMORY LOCATION 'XQ2'

MONITOR S/R- IRQ HANDLER

MONITOR SIR - BREAK HANDLER

MONITOR MEMORY LOCATION 'XBRK'

MONITOR MEMORY LOCATION 'XRTI'

MONITOR MEMORY LOCATION 'XRTS'

MONITOR MEMORY LOCATION 'PCINC2'

MONITOR MEMORY LOCATION 'PCINC3'

MONITOR MEMORY LOCATION 'X,JSR'

MONITOR MEMORY LOCATION 'X,JMP'

MONITOR MEMORY LOCATION 'X,JMPAT'MONITOR MEMORY LOCATION 'NEWPCL'

MONITOR MEMORY LOCATION 'RTN,JMP'

MONITOR SIR TO DISPLAY USER REGISTERS

MONITOR MEMORY LOCATION 'RGDSPl'

MONITOR MEMORY LOCATION 'RDSPl'

MONITOR MEMORY LOCATION 'BRANCH'

MONITOR MEMORY LOCATION 'NBRNCH'

MONITOR MEMORY LOCATION 'INITBL'

MONITOR MEMORY LOCATION 'RTBL'

MONITOR SIR TO READ PADDLE. X-REG CONTAINS PADDLE NUMBER 0-3

MONITOR MEMORY LOCATION 'PREAD2'

_ ' , , ' , ' , ' , '' )

15:34 MICRO - The 6502 Journal August, 1979

Page 37: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 37/60

----------------- ------------ ------,--- ------------------ -------,----------------------- ------ --_. _ . ---- . ------.---- -LUEBBERT'S COPYRIGHT APPLE MEMORY ATLAS - MICRO MAGAZINE VERSION

- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - - - - - - - - -- - - - - -------

HEXLOC

$FB2E

$FB2F

$FB39

$FB40

$FB4B

$FB5U

$FB60

$FB63

$FB65

$FB6D

$FB76$FB78

$FB81

$FB84

$FB86

$FBAO

$FBA4

$FBAF

$FBB4

$FBCO

$FBCl

$FBDO

$FBD9

$FBE4

$FBEF

$FBFO

$FBF4

$FBFC

$FBFD

$FC10$FC1A

$FC22

$FC24

$FC2B

$FC2C

$FC42

$FC46

$FC58

$FC62

$FC66

$FC70

$FC76

$FCBC

$FC95

$FC9C

$FC9E

$FCAO

$FCA8

$FCA9

$FCAA$FCB4

$FCBA

$FCC8

$FCC9

$FCD6

$FCDB

$FCE2

$FCE5

$FCEC

SFCEE

$FCFA

$FCFD

$FDOC

$FDIB

SFD21

SFD2F

$FD35

$FD3D

$FD5F$FD62

$FD67

$FD6A

SFD71

$FD75

$FD7E

$FD80

$FD84

SFD8E

SFD92

SFD96

DECLOC

-1234

-1233

-1223

-1216

-1205

-1189

-1184

-1181

-1179

-1171

-1162-1160

-1151

-1148

-1146

-1120

-1116

-1105

-1100

-1088

-1087

-1072

-1063

-1052

-1041

-1040

-1036

-1028

-1027

-1008-998

-990

-988

-981

-980

-958

-954

-936

-926

-922

-912

-906

-B84

-875

-868

-866

-864

-856

-855

-854-844

-838

-824

-823

-810

-805

-798

-795

-798

-786

-774

-771

-756

-741

-735

-721

-715

:'707

-673-670

-665

-662

-655

-651

-642

-640

-636

-626

-622

-618

NAME

RTS2D

INIT

SETTXT

SETGR

SETWND

TAUV

MULPM

MUL

MUL2

MUL3

MUL4MUL5

DIVPM

DIV

DIV2

DIV3

MOl

MD2

MD3

MORTS

BASCALC

BSCLC2

DELLI

DELL2

RTS2B

STOADV

ADVANCE

RTS3

VIDOUT

BSUP ~ CURSUP

VTAB

VTABZ

RTS4

ESCI

CLREOP

CLEOPI

HOME

CR

LF

SCROLL

SCRU

SCRL2

SCRL3

CLREOL

CLEOLZ

CLEOL2

WAIT

WAIT2

WAIT3NXTA4

NXTAI

RTS4U

HEADR

WRBIT

ZERDLY

ONEDLY

WRTAPE

RDBYTE

RDBYT2

RD2BIT

ROB IT

RDKEY

KEYIN

KEYIN2

ESC

RDCHAR

NOTCR

NOTCRICANCEL

GETLNZ

GETLN

BCKSPC

NXTCHAR

CAPTST

INSTDSP

ADDINP

CROUT

PRAI

PRYX2

USE

MONITOR MEMORY LOCATION 'RTS2D'

MONITOR S/R- SCREEN INITIALIZATION

MONITOR S/R- SET SCREEN TO TEXT MODE. CLOBBERS ACCUMULATOR

MONITOR S/R- SET GRAPHIC MODE (GR). CLOUDERS ACCUMULATOR

MONITOR S/R- SET NORMAL WINDOW

MONITOR MEMORY LOCATION 'TABV'

MONITOR MEMORY LOCATION 'MULPM'

MONITOR S/R- MULTIPLY ROUTINE

MONITOR MEMORY LOCATION 'MUL2'

MONITOR MEMORY LOCATION 'MUL3'

MONITOR MEMORY LOCATION 'MUL4'MONITOR MEMORY LOCATION 'MULS'

MONITOR MEMORY LOCATION 'DIVPM'

MONITOR S/R- DIVIDE ROUTINE

MONITOR MEMORY LOCATION 'DIV2'

MONITOR MEMORY LOCATION 'DIV3'

MONITOR MEMORY LOCATION 'MOl'

MONITOR MEMORY LOCATION 'MD2'

MONITOR MEMORY LOCATION 'MD3'

MONITOR MEMORY LOCATION 'MDRT~'

MONITOR S/R- CALCULATE TEXT BASE ADDRESS

MONITOR MEMORY LOCATION 'USCLC2'

MONITOR MEMORY LOCATION 'BELLI'

MONITOR S/R- SOUND BELL (BEEPER)

MONITOR MEMORY LOCATION 'R1S2B'

MONITOR MEMORY LOCATION 'STOADV'

MONITOR S/R- MOVE CURSOR RIGHT

MONITOR MEMORY LOCATION 'RTS3'MONITOR S/R- OUTPUT A-REGISTER AS ASCII ON TEXT SCREEN 1

MONITOR SIR TO MOVE CURSOR LEFT (BACKSPACE)

MONITOR SIR TO CURSOR UPMONITOR S/R- PERFORM A VERTICAL TAB TO ROW SPECIFIED IN ACCUM ($0-$1

MONITOR MEMORY LOCATION 'VTABZ'

MONITOR MEMORY LOCATION 'RTS4'

MONITOR S/R- PERFORM ESCAPE FUNCTIONSMONITOR SIR TO CLEAR FROM CURSOR TO END OF PAGE. CLOBBERS ACC ~< Y-RE

MONITOR MEMORY LOCATION 'CLEOP1'MONITOR SIR TO HOME CURSOR & CLEAR SCREEN. CLOBBERS ACCUM & Y-REG

MONITOR SIR TO PERFORM A CARRIAGE RETURN

MONITOR SIR TO TO PERFORM A LINE FEED

MONITOR SIR TO SCROLL UP 1 LINE. CLOBBERS ACCUM & Y-REG

MONITOR MEMORY LOCATION 'SCRL1'

MONITOR MEMORY LOCATION 'SCRL2'

MONITOR MEMORY LOCATION 'SCRL3'

MONITOR SIR TO CLEAR TO END OF LINE

MONITOR MEMORY LOCATION 'CLEOLZ'

MONITOR MEMORY LOCATION 'CLEOL2'

CALL FOR WAIT LOOP

MONITOR MEMORY LOCATION 'WAIT2'

MONITOR MEMORY LOCATION 'WAIT3'MONITOR SIR TO INCREMENT A4 (16 BITS) THEN DO NXTAI

MONITOR SIR TO INCREMENT Al (16 BITS). SETT CARRY IF RESULT :>=A2.

MONITOR MEMORY LOCATION 'RTS4B'

MONITOR MEMORY LOCATION 'HEADR'

MONITOR MEMORY LOCATION 'WRBIT'

MONITOR MEMORY LOCATION 'ZERDLY'

MONITOR MEMORY LOCATION 'ONEDLY'

MONITOR MEMORY LOCATION 'WRTAPE'

MONITOR MEMORY LOCATION 'RDBYTE'

MONITOR MEMORY LOCATION 'RDBYT2'

MONITOR TWO-EDGE TAPE SENSE

MONITOR MEMORY LOCATION 'RDBIT'

GET KEY INPUT FROM THE KEYBOARD. CLOBBERS ACC ~ Y-REG

MONITOR S/R- MONITOR KEYIN ROUTINE

MONITOR MEMORY LOCATION KEYIN2

MONITOR MEMORY LOCATION 'ESC'

CALL TO READ KEY & PERFORM ESCAPE FUNCTION IF NECESSARY.

MONITOR MEMORY LOCATION 'NOTCR'

MONITOR MEMORY LOCATION 'NOTCR1'

MONITOR SIR TO PERFORM A LINE CANCEL (\)MONITOR SIR TO PERFORM CARRIAGE RETURN AND GET A LINE OF TEXT

MONITOR SIR TO GET LINE OF TEXT FROM KEYBD. X RETND WI # OF CHARS

MONITOR MEMORY LOCATION 'BCKSPC'

MONITOR MEMORY LOCATION 'NXTCHAR'

MONITOR MEMORY LOCATION 'CAPT5T'

MONITOR SIR TO DISASSEMBLE INSTRUCTION AT PCH/PCL

MONITOR MEMORY LOCATION 'ADDINP'MONITOR SIR TO PRINT A CARRIAGE RETURN. CLOBBERS ACC~ Y-REG

MONITOR MEMORY LOCATION 'PRA1'

MONITOR MEMORY LOCATION 'PRYX2'

August, 1979 MICRO - The 6502 Journal 15:35

Page 38: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 38/60

Page 39: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 39/60

POIVEH§OFT

products for the

APPLE IISYSTEMS SOFTWARE

Memory Dump ...

Program Unload ..

File Editor

Assembler.

(Assembler Requires File Editor)

APPLICATIONS

Automotive Diagnosis .

Basic Statistics .

Electr ical Engineering I

Statist ics I .. ..

Vector Analysis .

FINANCIAL

Financial Wizard.

Financial Wizard II .

Financial Wizard III

Financial Wizard IV

GAMES

Apple Casino .

Apple Derby .

Apple II Organ .

Cubik " .

Radar Interceptor .

Rocket Pilot .

Saucer Invasion .

Space Maze .

Star War .

Swarms .

Wampus Hunt ..

$ 7.45

7.45

24.95

24.95

$14.95

9.95

9.95

14.959.95

$9.95

9.95

9.95

9.95

$ 9.95

9.95

19.95

9.95

9.95

9.95

9.95

9.95

9.95

14.95

9.95

Available at your local computer store

Programs Available on Diskette at $5.00 Additional

See Our Full Page Ad in This Issue

• Check or Money Order

• Inelude $' .00 forshipping and handling

• C.O.D. ($1.00 add'tl charge)

• Master Chargeand VISAorders accepted

• Naw Jersey residents add

5% salestax

POJITEH§OFT~ INC.P. O. BOX 157

PITMAN, NEW JERSEY 08071

(609) 589·5500

It's lDGIC@ l l i l [ Q ) for graphics!

NEWASSEMBLY LANGUAG E

3 D G RA PH IC SFOR THE APPLE II ...Our 3D packages allow you to animat e 3D or

2D data bases created wi th s tanda rd XYZ coor -

dinates. The two use rs manua ls (90 pages total )

are wri tten a td i fferent technical leve ls to give all

App le users a quick understanding of access

and uses f rom BASIC and assembly

language. The small BK memoryrequirement lets you use the

sub rou tine w ith most of you r

educational , scienti fic. and

game programs.

545 [ava ilab le August 25 ,

1979). Disc and reloeat-

able cassette aptian

available.

DISK DRIVE WOES7 PRINTER INTERACTlON7

MEMORY LOSS7 ERRATIC OPERATION?

DON'T BLAME THE SOFTWAREI

e:l.~

,-'.-"'1

~~~'2

Power Line Spikes,Surges& Hashcould be the culprit!

Floppies, printers, memory & processor often interact!

Our unique ISOLATORS eliminate equipment interaction

AND curb damagingPower Line Spikes,Surgesand Hash.

"ISOLA TOR (ISO·1AI 3 filter isolated 3-prong sockets;

integral Surge/Spike Suppression; 1875WMaximum load,

1 KW load any socket .........•..... $49.95

"ISOLATOR (ISO·212 filter isolated 3-prong socket banks;

(6sockets total]: integral Spike/Surge Supp"';ssion;1875 WMax load, 1KWeither bank. • . . . .. $49.95

"ISOLATOR (ISO-ICB/-2CBI15A Circuit Brkr $57.95

"ISOLATOR (ISO-ICBS/-2CBSI Brkr·switch/lite $62.95

"SUPPRESSOR/FIL TER (SFK-331 three 3-prong sockets,

1250Watt Maximum load . . . . . . . . . . . .. $32.50

"SUPPRESSOR/FILTER (SFK-311 3-prong socket;

KW . . . . . . . . . . . . . . . . . . . . . .. $24.50

• PHONEORDERS 1·617-655-1532

Dept.mi

.1£7 Electronic Specialists, Inc.17! SouthMainStreet,Natick,Mass. 01760

Page 40: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 40/60

Page 41: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 41/60

(203) 775·9659

CONNECTICUT microCOMPUTER, Inc.

150 POCONO ROAD BROOKFIELD, CONNECTICUT 06804

rr:::h~RS-232

INTERFACE MODULE

PET INTERFACE

nIMMOD

CiJjOKIM INTERFACE

rr::h

L:_JJGPIB (lEEE-488)INTERFACE MODULE

J;\TR9MOD

TRS-80 INTERFACE

ETC,

@ ] O O l l i TBVSTEMS

~

sRS-232PRINTER

CABLE ~OWJA POWER

MODULE

G~ANALOG INPUTMODULE

~ q : : = : ~NALOG

MANIFOLDMODULE

SENSORS

• TEMPERATURE

• VELOCITY

• PRESSURE

• db

• pH• ACCELERATION

• HUMIDITY

• LIGHT LEVEL

• FLUID LEVEL

• ETC. ..

MANUAL ANDDISPLAY MODULE ~ : : : ~XPANDER

MODULE

DAM SYSTEMS bw Cme

II cO IlP le h sv stn o f lIo du le s 1.0 le t ~ ou r ~ o "p u te r lis ten

1.0 th e re il w o rld .

DAM SYSTEMS components

AIM161 - Ana!og Input Module

16 8- bH iIIo lo ol in Hlt. - 100 .k ro se«llld co ov er.illl h .. -

3 .t..le o u l. 11 lt - e MU ir . . Ill. 8-b H ~ ler D Ill.11ltM lI 't

f or c oo te ol on d on e 8-bH ~ le r inp u t P trt fo r dau,

AIM162 - Analos InFut. Modu!e

lis i Ib !M! ~ Iu .: .r ea le r acctJI''''''' - !la Id ~ la led C IIl~ ts -

p ilo t Ii" 't - sw i t .c h . . IK tab l •• w t. en a b le an d re a dY

POlari i ies .

paWl - Power Module

Supp l i e s PDWII ' fo r me A I" !. o o O Ol e,

ICON - Input Connect.orF o r C I Il I1 OC ti n ~ an a lo o l i np u ts t o Ii1e A I~ 16 - 2 0 p in c ar d... C IIlA K to r . so llE r' P .lO !le ts ,

OCON - Out.put Connector

F o r c o o n. d in s Ii1e A IIU . t o • ~ ler - 2 0 p in c ar d e O ! I e

C IIln Kto r - s ollE r' _ lo t.,

MANMODl - Manifold Module

U s e in p la ce of ICI lN , S c r e w le r .in il b ar rio r .L ri .. fo r

r D Il AK ti n l . io \ Is ti cb . polenUIlE\er •• vo l US e s ou rc es . e tc ,

Ellllin.iK IiIe noed fo r so ld !rin ~, P lu ~ in to Ii1e AI " l • •

ANAMANl - Analog Manifold Module

U s e in p lac e of IC IlN , C o r I n K h !W I S I ' S T E I I S S E H S I J ! S to IiIe

A IM ! . w iU lo ut s old !r in ~ - <en . . . . c ab le s .A I.t p lu l in , P lu !lS

into Ii1e A II U" o r the 1WK I l I! ,

SENSORS

S e n s o r s fo r l.e Ifo r im . P re ssu re . f 1 011 , hu aidH ~, le vo lrP H , I O ti ll l, e tc .

COMPUTER INTERFACESFo r the P E T , K IK , T R S- f O , ek . U s e in p la ce of lilli,

El illin.iK the need f or s old !r in 9 o r 5 I'e Ci.1 c oo .L ru ch lll.

PETMOD - PET Interface Modu!eGive s I .w o IE EE P o rt., o ne u se r P ort ' a n d lIle 1M S YS TE lIS

i nt .e rf ac e P o rt . Saws we a r a n d lear III Ii1e P E T ' 5 prinled

c i rcui t b oa rd . A I . . . ca l led Ii1e P E T S A I I R .

DAM SYSTEMS PRICE LIST

KINMOD - KIM Interface Module

Gi. . . . . o n e . .. .. 1 ic .h lll co on Kto r K f't a nd .... !W I S Y S T E l I S

i nt .e rf ac e P o rt .$1.79.00

CABLE "A" - Interconnect Cables

C II ln ec t. C II OP II le r in le rf ac e t o A I II I6 , IWfDISlr XPl¥t l fl l ,

ek .

TBA

$249.00 CABLE A24 - InterconnecL Cable

2~ i n c ll c i lb l e wi III i nl er fa ce c oo n Kt .o r III Ill' en d a n d an0 C (J f . .. . i..en t III Ii1e oLhe r ,

$:1.9.95

$ :1 .4 . . 9 :: :. iMANDISl - Manual and Disp!aw Module

Conne c t . be Ii1e AIKI " iIId Ii1e C< » ll le r i n le r hc e .

A 11015 1 o r C IIO PII le r co n tro l o f Ii1e A l lU " . D i ~ la - ;s

chaMtl nuober iI1d dat a ,$9,'75

GPIB MOD - GPIB (IEEE-488) Interface

AI IOI5 the IW 1 S Y SI BtS I Il IU E S to be u s e d "i l l l I . h o GP IB b u s

i n . 1Hd of • CI IOP I I le r '. o L h e r 11 0 Port s .

RS232 MOD - RS232 InLerf.ce Module1111015 the I W 1 S Y S IB t S IIIIU.ES to be u s e d w i t . h . . R S - 2 3 2

port o r !erl l ine l .

Tl'<A

XPANDRI - Expander Module

Al JOI5 U' to 1 28 8-b it an .lo s in Hlts (8 A IIII" I bk Ile s) to

D e COAAK l e d t o OM '!lSlet.

TBA

TBADAM SYSTEMS sets

TBA

AIM161 Start.er Set

Inc ludts me A I K1 "1 , . .. . P O ll . Ill. ICI lN i I IO . . .. 0 C C f / ,

AIM162 Start.er Set

I nc l ude s on e 111"162 . DI1f P O lI o l Il e I CI lN an d Ill! (D)f,

~'2:",;900

TBA

f'ETSETla

ln clu dts .... P E T l I I D . Ill. C A I l . E A 2 ~ . lI le A IK I"" .... PO ll an d1110W t I O D 1 .

KIMSETla

I nc lu d es l Il e K I I K I I , lIle C A I l . E A 2 4 , 1110AIK161 . Ill. P O ll i II O

lIle 1 W t I O D l .

Page 42: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 42/60

Page 43: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 43/60

Get a pressure transducer and use

your AID converter to monitor pulserates and measure blood pressure

automatically. Processing analogsignals with digital techniques, averag-

ing, filtering, etc. is also an interestingarea for experimentation. Finally, docu-

ment your experiment and send it away

to be published in one of the hobbymagazines, such as MICRO, so the restof us can benefit from your work.

Reference:

Lancaster, D., CMOS Cookbook,Howard W. Sams & Co., Inc., In-

dianapolis, 1977.

SPEECHLABTM, Heuristics, Inc.,

900 N. San Antonio Rd., Los Altos,CA 94022.

Pressure Transducer Handbook, Na-

tional Semiconductor Corp.,Santa Clara, CA95051.

Analog-Digital Conversion Handbook,

Analog Devices,' Norwood, MA02062, 1972.

MIC RO -WA RE A SS EM BLE R 65X X- l.0 P AGE 0 1

0010: * A I D C ON VE RT ER D EM ON ST RA TI ON P RO GR AM0020: * MODIFIED 7/~/79 BY M IC RO STAFt"0030: 032D SCANDS • $lt"lF0040: 032D PAD * $17000 05 0: 0 32 D PBD * $17020060: 032D PBDD • $17030 07 0 : 032D INH • $00F90 08 0: 0 300 ORG $03000090: 0300 A9 07 START LDUM $07 A I D CONTROL PINS SET TO

0100: 0302 8D 02 17 STA PBD LOGICAL 0 VIA PBO-2 WHEN0 11 0 : 0305 8D 03 17 STA PBDD DIREC TION REGISTER IS ALSO SET0120: 0308 CE 02 17 AG N DEC PBD TOGGLE STRT PIN TO INITIATE0130: 030B EE 02 17 INC PBD CONVERSION0140: 030E A9 05 LD AIM $ 05 ACTIVATE BSEN TO CHECK BUSY0150 : 0310 8D 02 17 STA PBD0160: 0313 AD 00 17 BACK LDA PA D CHECK BIT 7 ON PAD (BUSY) TO0170 : 0316 10 FB BPL BACK SEE IF CONVERSION IS COMPLETE0180: 0 318 k9 03 L DAI M $0 3 SET HBEN & LBEN TO LOGIC 1 TO0190: 031A 8D 02 17 STA PBD PUT DATA ON THE LINES0200: 031D AD 00 17 fINISH LDA PAD DIGITAL DATA IS NOW IN0210: 0320 85 F9 STA INH AC CU MUL AT OR K IM- l US ER S M AY0220: 0322 20 IF IF JS R SC ANDS WISH TO D ISPLAY THE RESULT0230: 0325 A9 07 LD AIM $07 I NI TIA LI ZE C ON TR OL PIN S T O ZERO0240: 0327 8D 02 17 ST A PB D AND TH EN0 25 0: 0 32A 4C 08 03 PRGEND JMP AGN S TA RT A NO TH ER C ON VE RS IO NID =

-1'

SYMBOLAG NPA DSCANDS

TABLE03081700

lF1F

200 0 20 3CBACK 0313PBDD 1703START 0300

F IN IS H 0 31 DPBD 1702

INH 00F9P RG EN D 0 32 A

-lOV

DB'i12

ANAIillo----J"~~- IN DBa11

I N 0- 10V lK G ai n A dj us tDB9posgive)

AD7570J BUSY

a-BIT STHT

A /D C ON V. ESm

LB m:2 «15V

HBEN ~

QA

12 2- CLK COMP

7

P ; +1:2V

OUTl

7490

OOT2 5

AGNO 6

O O t I D

' : ; b D - G N D-GNDA-Glm

- J : - , l r : -LE2 J-=.17!__ :2 PAt'I cc

DB3 l6 _0}. PA1

D B;' 15 3 _ z . . N2

DB5 14 __ 2 _ t l _ PA)

DB6 1l 37 PA4

~~---- ---- ---- -~ - P A ~

_ _ _ _ _ 3 : . . : : 5 PA6

3 4_ P A7

MCS6530

- - . - - - Y ri--'-'....& D-GND

Figure 1: Interface circuit. An LM311 voltage com-parator is recommended instead of the LM318 op

amp. D·GND is short for digital ground, and

A·GND stands for analog ground. The 6530 is

assumed to be part of a microprocesor.

Page 44: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 44/60

SYMple Memory Expansion

An 8K SYM from a board small enough to fit in theSynertek logo area of a standard enclosure? This in-teresting modification may violate good engineeringpractices, but it is difficult to argue with the designer'sresult.

Synertek states in their SYM-1

manual, "it is believed that most usersof the SYM-1will ultimately usea TTY". I

disagree. Most users, l ike me, will pro-bably use some type of CRT terminal.

The full power of the SYMmonitor is not

really appreciated until you connect it toa CRTor TTY. No wonder that Synertek

made such a statement in the manual.The addition of a terminal turns the SYM

into quite a little computer!

There is only one drawback to addingthe terminal. Once you have it con-

nected, you'll need to expand the SYM'smemory to keep up with the larger pro-

grams, interpreters, andassemblers thatyou are sure to come up with!

Tiny Basic

One of the easiest and least expen-

sive additions that can be made to the

SYM, after the addition of a TTYor CRT,is Tom Pittman's Tiny Basic. It is only

$5.00 in paper tape format from him at

Itty Bitty Computers, POBox 23189,SanJose, CA95153.Several ASK dealers sell

i t on cassette for $10.00. Get Version

V.1K for the 6502that starts at 0200hex.It will f it from $0200to $OAFF, leaving$OBOOo $OFFFavailable for programs.

Since the SYMalready includes a BreakTest routine in Its monitor, it is even

simpler to interface Tiny Basic to theSYMthan to the KIM.Make the following

patches:

0206 4C 1B 8A JMP INCHR

0209 4C 47 8A JMPOUTCHR

020C 4C 3C 8B JMP TSTAT

I also made the following optional

15:42

changes to my copy:

020F 08 Changes the character

correction code to the

ASCII backspace code.

0210 40 Changes the line cancelcode to the "@" sign.

0971 2A Changes the prompt char-

acter from "colon" to"asterisk".

Memory Limitations

Tiny Basic is a very good interpreter,for its size, but only 1024bytes are left

out of the SYM's 4K RAM for Tiny Basic

programs. Ihad anextra pair of 2114sonhand after Igot Tiny upand running, anddecided to see if there wasn't some way

that I could make use of them.

I removed 2114s U12 and U13 fromtheir sockets, mounted the extra two

2114s on top of them in the so called"piggyback" fashion, and soldered all

pins of the extra 2114s to the same pins

on the originals, except that the pin 8swere left unconnected.

I attached 30GAwire to these pins onthe two added 21145, making sure thatthey were well insulated from the pin 8s

of the original 2114s. The original ICs

were then plugged back into the SYMand a memory test was run. So far, sogood.

U1, a 74LS138, is a decoder thatdivides the first 8Kof the SYM'smemory

into 1K blocks. The signals from it thatcorrespond to the first four 1K blocksare used as the chip select signals for

the original 2114s. The wires from pin 8of the two added 2114swerewired to the

MICRO- The 6502 Journal

John M. Blalock3054West Evans Drive

Phoenix, AZ 85023

fifth signal from U1,which is at pin 11of

its package.

Repeating the memory test, I had 5Kof memory! I had just doubled the

memory space available for Tiny Basic!

Could it be expanded further? Perhaps,but not this way. The 2114s were too

close together and got hotter than Iwould like to see them get.

Bumble Bees Can't Fly

The address and data lines from the6502are only guaranteed to drive up to 1TTL load and 130pf of capacitance. No

buffers exist on the SYM to reduce the

loading. Adding up the capacitance ofall the devices already on the SYMthat

are wired to the data and address buses,and adding a conservative figure for the

capacitance of all the PC traces them-

selves, shows that the 6502 is beingpushed to its limit already.

But those values of capacitance from

the spec sheets are maximum values,while the 130pf is a minimum. Let's try!

The goal is to fit it in over the logo andSynertek name.

I built up a small perf board with IC

sockets and wired them together using awiring pencil and 36 GA solder strip-

pable wire. Nine sockets were on theboard, and an 18·pin homemade DIP

plug plugged into the SYM's U19socketto pick up most of the required connec-tions.

Additional wires were run to the data

lines. at U12, and to the chip selectsignals from U1. It worked! I had an 8K

SYM! And the board was small enough

August, 1979

Page 45: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 45/60

o fit inthe area of the Synertek logo andname, between U1 and the original

memory chips.

Several other SYMowners were veryinterested in my design, even though it

violates good engineering practices.Enough interest was shown to committhe schematic of Figure 1to an artwork

and make up a few dozen copies of theboard. This version is much neater than

the prototype.

The board is double sided and has

plated through holes. Two 16-pin DIPjumpers connect from it to the SYM'sU12and U19sockets. (Evertry to buy an18-pin jumper?) Four wires run from the

board to pins of U1. U12,U19,and eightother 2114smount on the final board.

None of the copies built to date have

failed to work satisfactorily, nor doesanoscilloscope show any degradation ofthe 6502's signals. My SYM has U20,

U21,U22,U23,and U28installed, so it is

close to a worst case. I havehad severaldozen blank PCboards madewhich Iwill

make available to other SYMowners for

$5.00each, with instructions. Please in-clude a self addressed stampedenvelope.

Results

I will have to admit that the added

board is an expansion to the SYM,but it

certainly doesn't expand its size bymuch, does it? Tiny Basic now has 5K

for its programs, a pretty respectableamount of memory. Synertek's BASIC,which is excellent, has 7679bytes free,

at initialization, instead of 3585.Many ofthe applications that I had only con-

pins 11,13,

pins

~ A E W A M A S S O C I A T E S SH0RTYY.

24000 BeS1;emer Street C-10 CASSETTESWoodland Hills, Ca. 91367

• Tarbell Quality

• "SCOTCH" brand high out-

put/low noise "POSI-TRAK"

back treated tape

• Spring loaded pressure pad

• 5 screw take-apart shell

• Exclusive E !A label

Stock No. EAC-10 $13.50/10

CASSETTE LABELS

$26.00/20

56211·6 Blank Fanfold 6 Linasllnch $5.90/100

5626·8 Blank Fanfold 8 Llnesllnch 5.90/100

CLB-R Blank Sheet 15/Sheet 6.201 90

5626-B Blank Pack 4.00/100

EA-EBEA Printed Pack EALabel 5.50/100

CLP-R Printed Sheet 15/Sheet 7.501 90

MAILING LABELS4815-1 2';'_ 15116 Fanfold $4.40/1000

5615-1 3V,.15/16 Fanfold 4.40/1000

VOLUME AND DEALER DISCOUNTS AVAILABLE

STOCK NO. QUANTITY PRICE TOTAL

Name Cal .:Tax 6%1-__--1

Address L.....----

City .State Zip

Exp. Date Bank No. _

Card No. _

Signature _

PREPAID ORDERS SHIPPED POSTPAID

~D. 0August, 1979

sidered running on my KIM (29+ RAM!)system are now being run on the SYM,due to the faster tape interface, suffi·cient memory, BASIC in ROM, and the

capabilities of the SYM's monitor.It was certainly worth the trouble to

try, even if bumble bees can't fly!

pins 1, 2, 3, ~, 5, 6, 7, 15, 16, 17, 18 -

pins 11, 12,13, 1~ s .

U1

pin 11

U l U1

pin 7U1

pin 10 pin 9

Figure 1: W7AAY Sym-1 Memory Expansion

Figure 2: The 8K SYM.

MICRO - The 6502 Journal 15:43

Page 46: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 46/60

A Warning:

The MACROTEA™is for ProfessionalProgrammers - and VerySerious Amateurs - Only

Now: a machine language pro-gramming powerhouse for theknowledgeable programmer who

wants to extend the PET's capa-bilities to the maximum. TheMacroTeA, the Relocating MacroText Editor:Assembler from SkylesElectric Works.

The Skyles MacroTeA is a superpowerful text editor. 27 powerfulediting commands. String search andreplace capability. Manuscript featurefor letters and other text. Text loadingand storage on tape or discs. Supportstape drives, discs, CRT, printers andkeyboard.

The Skyles MacroTeA is a relocatingmachine language assembler with truemacro capabilities. A single nameidentifies a whole body of lines. Youwrite in big chunks, examine, modifyand assemble the complete program.And, when loading, the MacroTeA goeswhere you want it to go. Macro andconditional assembly support. Auto-matic line numbering. Labels up to 10characters long.

There's no tape loading and nooccupying of valuable RAM memoryspace: The Skyles MacroTeA puts 9Kbytes of executable machine language

code in ROM (from 9COO to BFFF-irectly below the BASIC interpreter).

Like all Skyles Products for the PET,t's practically plug in and go. No toolsre needed. And, faster than loading anquivalent size assemblerleditor fromape, the MacroTea is installed per-

Define HI·RES Characters

for the APPLE II . .. 'his program makes it easy to generate and modifyHI·RES characters on the APPLE II.

Robert F. ZantDepartment of Accountingand Information SystemsNorth Texas State University

Denton, TX 76203

The user contributed library of pro-grams, Volumes 3, 4, and 5, recently reoleased by the Apple Computer Company,contains a machine language routine forgenerating characters using the HI-RESfeatures of the APPLE II. The packagealso includes a character table that con-tains 128 predefined characters.

The characters are represented in the

table in a coded, reverse image format.The code is based on a 7 by 8 dot matrixrepresentat ion for each character. Theformat for an "L" is depicted below.Note that a border is left at the top andside so that characters wil l be separatedon the screen.

.....•.

.....•.

.....•.•

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

The coded table entry is derived from theformat by substituting a zero for eachdot and a one for each asterisk. Eachline of the matrix is thereby coded intoone byte. The high order bit is set to zeroin each byte. Eight bytes are requiredto encode each character. The code forthe "L" depicted above would be

The Skyles MacroTeA: 11 chips on a single PCB.Operates interfaced with the PET's paral lel addressand data bus or with the Skyles Memory Connector.

(When ordering, indicate if the MacroTeA willinterface with a Skyles Memory Expansion System.You can save $20.) Specifications and engineeringare up to the proven Skyles quality standards. Fully

warranted for 90 days. And, as with all Skylesproducts, fully and intelligently documented.

Skyles ElectricWorks10301 Stonydale Drive Cupertino, CA 95014

(408) 735-7891

.02,02,02,02,02,42,7E,00

The following program assists in defin-ing characters and substituting theminto the character table. Each characteris defined in a regular dot matrix format,rather than in reverse image. The pro-gram automatically calculates the binarycode for the equivalent rotated version.

The letter "L" would be entered as:

.•.....

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

Note that the dot matrix must remainintact, and must contain only dots andasterisks. The command to store thecharacter, the CTRL S, must be enteredafter the matrix, on the ninth line. Acarriage return is required after each

command.At the beginning of the run, the operatorspecifies the table posi tion (0 to 127) forthe first character to be defined. There-after, characters are automaticallystored at succeeding locations in thetable. Separate runs of the program canbe used to define characters in non-contiguous table locations.

ASSEMBLE LIST

([)1(/)(/)MOVE TBL 1 TO TBL2(/)11([) . BA $4([)([)

(/)4([)([)-AI ([)B 0120 LOOP LOY #([)([)

([)402- B9 0B 04 (/)130 LOA T8L1.Y0405- 89 ([)B 05 014([) STA TBL2.Y(1)4([)8- C8 ([)150 INY([)4([)9 00 F7 ([)160 BNE LOOP

017([)

0411J8 01811JTBL1 . OS 256

0508 11J19([)BL2 DS 256([)200([)210 EN

LABEL FILE 1= EXTERNAL

TBL1= 0408TART= ([)4011J LOOP= (7)402TBL2 = ([)5(/)B11([)(/)(/)0.06I1JB.([)6(/)8

Page 47: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 47/60

S €I P E r' 160 P EM A SSUM ES C H ARAC TER T ABLE78 R EM B EGIN S A T $6888

: ~ 0 P E r' 19€1 PEI'1

~08 TE ~ T : C AL L -9362,"1,"1 ··,'TAE:' P I' :I NT " E NT E F: C · EC H1 A L E OU I ', , iA LE N T":00 PPI NT "OF F IRST 'ASC II' C HA RAC T ER"351<:1 F ' F. : I NT n ' 1 A: <H 1 U t' 1A L UE O F 127>"

4€10 INPUT B

425 IF 8)=0 RND 8<128 THEN 450: PRIN T "PE- ENTE R": GOT O 48845(1 El:...;;26624+8· ...3

'3~::)~~1ALL -9::6

680 PRI NT "C H ANGE T HE ~ )TS IN THE FOLL OWIN G MA TRI~ "7~::)€1 PRI NT "T O ASTE RISI ;S T O D E SC F: IBE A F IC iU RE. "75(1 PR INT "U SE'E SC C "., E SC 0 '. "->' ANC , '..- T O E C ·IT "775 PR INT " (LEA VE D OTS T HAT A RE NO T REP LAC E O )"808 PRI NT "EN TER A 'C TI ':L S' TO STOR E T HE FI GURE . "9~XPI':INT "EN TER A .'TRL I)' TO OU IT. "

1880 R EM PRIN T M ATRI Xi . i .oo '·/TAB91200 FOP 1-0 TO ,1.::(10R INT ". .140(1 N E > ~ T I1508 VTA8 : ; : 0

2000 R EM GET INPU T C HARA C TER2 1 . £1 0 C AL L - 6 5 7

2200 I F PEE K (51.2)~147 THEN 30882 300 I F PEE K (512)-145 THEN 908025(113 (,OTO 2130~~1::1<:100 F ' : E I '1N C O C , E C H A F ' :A C T E R::£150 A =8 : F ': Er '1A "l E B E( ,IN N IN G O F C HA F. :A CT ER3100 REM LOO K THRU MAT RIX3200::25(1::::131<1

:A00

:;5~r8

F OR 1=1064 TO 1.968 STEP 128C =(IFO R .]=1:;)

I F PE ELI F P EEl'::

:::680C=C+2 .-.

:::.7;:18 NE:·<T.r

TO 6(1+,])=174 THEN ::788

(1+,])<>170 THEN 4000

J

3800 PC ~ E 8.C:8=8+1.

:900 ~ lE:'~ T::950 GOTO 100(1

4 008 REM ER ROR IN MATR I~

41.0~:::1 \ITAB 284200 PRIN T " MATR IX C O NTAI N~ INVA LIO C HARA C TER "4250 P RI tH " F': E- EN TE P"-8=A4~00 FO R 1=0 TO 1.990' NE~ T4409 VTAS 2 0: C ALL - 9 S845(1(1 1::l,)TO 1.50(1

9000 ENC'

To Order PROGRAMMER'S TOOLKIT or MACROTEA-Custom designed to plug into your PET. So, when ordering, please indicate if yourToolkit:

. .. wil l beused with the Skyles Memory Expansion System, or

... wil l beused with the ExpandaPet, or

.,. wil l beused with the PET2001-8alone

$75.00'

$75.00'

$75.00'(We furnish connectors to the memory expansion bus and to the second cassette interface.

$50.00'..wil l beused with the PET2001·16,-32

... will be used with Skyles MacroTeA $50.00'

Your MacroTeA. Custom designed for your PET.So specify your PETmodel when ordering.$295.00·

(Important Savings: If it 's to be used with a Skyles Memory Expansion System, the MacroTeA canplug direct ly into the Skyles connector. So you save $20. The Skyles MacroTeA is only $275.00when interfaced with the Skyles Memory ExpanSion System.)

Send your check or money order to Skyles Electric Works_ VISA, Mastercharge orders may call(800)227-8398.(California residents: please phone (408)735-7891.)Ten Day Unconditional Money·Back Gua '! !_ nt ee o n all products sold by Skyles Electr ic Works.

"All prices complete, including shipping and handl ing. Please allow 3 weeks_California residents: please add S-SIh"1 0 California sales tax.

SKYLESELECTRICWORKS 103IJ1Stonydale Drive,Cupertino, CA 95014,(408)735-7891

Is Programming Fun?

Have More Fun,Make Fewer Errors,Complete Programs MuchFaster ... with the

BASICPROGRAMMER'S

TOOlKIT™Nowyou canmodify, polish, simplify,add new features to your PET pro-gramsfarmorequickly while reducingthepotential for error.That all addsupto more fun . . . and the BASICProgrammer'sToolKIt.

The magiCof the ToolKit: 2KB ofROMfirmware ona Singlechip with acollection of machine language pro-grams available to you from the timeyou turn on your PETto the time youshut if off. No tapes to load or tointerfere with any running programs.And theProgrammer'sToolKit installsin minutes, without tools.Herearethe 11commands that can

be yours instantly and automatically

... guaranteed to make your BASICprogramminga pleasure:

AUTO RENUMBERHELP TRACEOFF APPENDFIND UNLIST

DELETESTEPDUMP

Everyone a powerful command toinsure more effective programming.Like the HELPcommand that showsthe line on which the error occurs... and the erroneous portion isindicated in reversevideo:

HELP500 J = SQR(A' B/[eJ)

READY

, .. Or the TRACE command thatlets you see the sequence in whichyour program is being executed in awindow in the upper corner of yourCRT:

The Programmer's ToolKit is aproduct of Harry Saal and hisassociates at Palo Alto ICs, a sub-sidiary of Nestar Systems, Inc. Dr.

Saal is considereda leading expert inthe field of personal computers andthe NestarSystemis considered to bethe ultimate multiple microcomputerprogramstorage system,So, if you really want to be into

BASICprogramming- and you wantto havefunwhile you'redoing it, orderyour BASIC Programmer's ToolKitnow. You'll be able to enjoy it verysoon. We guarantee you'll be de-lightedwith it: if, for any reasonyou'renot, return it within ten days. We'llrefundeverypenny,And no questionsasked.

Page 48: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 48/60

SY M-l, 6 502-B ASED M ICR OC OM PUT ER• FULLY-ASSEMBLED AND COMPLETELY INTEGRATED SYSTEM that's

ready-to-use

• ALLLSI Ie'S ARE IN SOCKETS

• 28 DOUBLE-FUNCTION KEYPAD INCLUDING UP TO 24 "SPECIAL"

FUNCTIONS

• EASY-TO-VIEW 6-DIGIT HEX LED DISPLAY

• KIM-I' HARDWARE COMPATIBILITY

The powerful 6502 8-Bit MICROPROCESSOR whose advanced

architectural features have mode it one of the largest selling "micros"

on the market today.

• THREE ON-BOARD PROGRAMMABLE INTERVALTIMERS available to

the user, expandable to five on-board.• 4K BYTE.ROM RESIDENT MONITOR and Operating Programs.

• Single 5 Volt power supply is all that is required.

• 1K BYTES OF 2114 STATIC RAM onboard with sockets provided for

immediate expansion to 4K bytes onbaard, with total memory expan-

sion to 65, 536 bytes.

• USER PROM/ROM: The system is equipped with 3 PROM/ROM ex-

pansion sockets for 2316/2332 ROMs or 2716 EPROMs

• ENHANCED SOFTWARE with simplified user inter face

• STANDARD INTERFACES INCLUDE:

-Audio Cossette Recorder Interface with Remote Control (Two

modes: 135 Baud KIM- l " compatible, Hi-Speed 1500 Baud)

-Full duplex 20mA Teletype Interface

-System Expansion Bus Interface

- TV Controller Board Interface

-CRT Compatible Interface (RS-232)

• APPLICATION PORT: 15 Bi-directional TTLLines for user applicationswith expansion capability for added lines

• EXPANSION PORT FOR ADD-ON MODULES (51 I/O Lines included in

the basic system)

• SEPARATE POWER SUPPLY connector for easy disconnect of the doc

power

• AUDIBLE RESPONSE KEYPAD

Synertek has enhanced KIM-I- software as well as the hardware. The

software has simplified the user interface. The basic SYM-l system is

programmed in machine language. Monitor status is easily accessible,

and the monitor gives the keypad user the some full functional capabili-

ty of the TTY user. The SYM-l has everything the KIM-I' has to offer,

plus so much more that we cannot begin to tell you here. So, if you wont

to know more, the SYM-l User Manual is available, separately

SYM-l Complete w/manuals $269.00SYM·l User Manual Only 7_00SYM-l Expansion Kit 75_00

Expansion includes 3K of 2114 RAM chips and 1-6522 I/O chip.

SYM-l Manuals: The well organized documentation package is com-

plete and easy-to-understand.

SYM-l CAN GROW AS YOU GROW. Its the system to BUILD-ON_ Ex-

pansion features that are soon to be offered:

• BAS-18K Basic ROM (Microsoft)~KTM-2 TV Interface Board

$159.00349_00

'We do honor Synertek discount coupons

QUA L ITY EX PAN S IO N BOARD S D ES IG N ED SPEC IF ICA LLY FO R K IM -l, SYM -l & A IM 65 _ ... i'These boards are set up for use with a regulated power supply such as the one below, but, provisions have been mode so that you can odd .onboard regulators for use with an unregulated power supply. But. because of unreliability, we do not recommend the use of onbaard

regulators. All I.C.'s are socketed for ease of maintenance. All boards carry full 90-day warranty.

All products that we manufacture are designed to meet or exceed industrial standards. All components are first qualtiy and meet full

manufacturer's specifications. All this and an extended burn-in is done to reduce the normal percentage of field failures by up to 75%. To you,

this means the chance of inconvenience and lost time due to a failure is very rare; but, if it should happen, we guarantee a turn-around time of

less than forty-eight hours for repair.

Our money bock guarantee: If, for any reason you wish to return any board that you have purchased directly from us within ten (10) days after

receipt, complete, in original condition, and in original shipping carton; we will give you a complete credit or refund less a $10.00 restocking

charge per board.

VAK-l 8-SLOTMOTHERBOARD

This motherboard uses the KIM-4' bus structure. It provides eight (8)

expansion board sockets with rigid card cage. Separate jacks for audio

cassette, TTYand power supply are provided. Fully buffered bus.VAK-l Motherboard $129.00

VAK-2/4 16K STATIC RAM BOARD

This board using 2114 RAMs is configured in two (2) separately

addressable 8K blocks with individual write-protect switches .

VAK-2 16K RAM Board with only $239.008K of RAM (l-l populated)

VAK-3 Complete set of chips toexpand above board to 16K

VAK-4 Fully populated 16K RAM

$175.00

$379,00

VAK-5 2708 EPROMPROGRAMMERThis board requires a + 5 VDC and ± 12 VDC, but has a DC to DC

multiplyer so there is no need for an additional power supply. All

software is resident in on-board ROM, and has a zero-insertion socket.

VAK-5 2708 EPROMProgrammer $269,00

VAK-6 EPROMBOARD

This board will hold 8K of 2708 or 2758, or 16K of 2716 or 2516

EPROMs. EPROMs not included.

VAK-6 EPROMBoard $129.00

VAK-7 COMPLETEFLOPPY-DISKSYSTEM(May '79)

VAK-8 PROTYPINGBOARD

This board allows you to create your own interfaces to plug into the

motherboard. Etched circuitry is provided for regulators, address and

data bus drivers; with a large area for either wire-wrapped or soldered

IC circuitry.

VAK-8 Protyping Board $49.00

POWERSUPPLIES

ALLPOWER SUPPLIES are totally enclosed with grounded enclosures for safety, AC power cord, and corry a full 2-year warranty.

FULLSYSTEMPOWERSUPPLY

This power supply will handle a microcomputer and up to 65K of our

VAK-4 RAM. ADDITIONAL FEATURES ARE: Over voltage Protection on 5

volts, fused, AC on/off switch. Equivalent to units selling for $225.00 or

more.

Provides +5 VDC @ 10 Amps & ±12 VDC@ 1 Amp SYM-l Custom P.S. provides S VDC@ 1.4 AmpsVAK-EPSPower Supply $125.00 VCP-l Power Supply

j~ N B E N T .E R P

'KIRMis alPraSductEof MOSS Technology

2967 W. Fairmount Avenue

Phoerux AZ. 85017

INC 0 R P 0 RAT E 0 (602)265-7564

KIM-I' Custom P,S.provides 5 VDC @ 1.2 Amps

and +12 [email protected] AmpsKCP-l Power Supply $41.50

$41.50

Page 49: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 49/60

Page 50: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 50/60

H IC RO -K AR l A SS EM B~ ER 6 5X X- l. 0 P AG E 02

AO GO LDYIM $0020 2C FE JSR $FE2C GSE t-10NIT0E ~~OVE ROUTINE

3 8 SEC C OM PU TE D IS PL A CE ME NT1'9 A5 68 LD A $006E 1'0 A RRAYS

['0· 69 SBC $0069!

85 lC STA EL

1;F A5 5 c LDA $005C

E5 D,~ SBC ~OO6A85 1D STA li B

60 HTS Bt . CK TO BP.SIC

•A5 1,\ RECALL LDA CL fH€NTRY no - RECALL

85 ~c STA AlL SET UP MOVElB LDA CH

85 3D STA A1H

A S 18 LDA DL85 6F STA $006F ~ :T AR T C F S TR IN GS

62 85 3 1 1 STA A2L

64 A5 1S LDA DH66 85 70 STA $0070

85 3F STA A2H

A 5 69 LDA $0069 S TA RT O F N UM ER :: :: :: ~

85 ~2 STA A4L

6E A5 6A LDA $006A85 1 1 3 STA A4HAO 00 LDYII1 $0020 2C FE JSR $FE2C U SE M ON IT OR MOV' : : %l111NE

18 CLC C OM PU TE S TA RT78 A5 69 LDA $0069 OF ARRAYS7A 55 lC ADC EL

85 6B STt. $006B7E A5 6A LDA $006A80 65 lD ADC EH

85 6C STA $006C84 38 SEC COMPUTE END OF NUMERICS85 A5 6F LDA $006F

E5 lA SBC CL85 6D STA $006D

8B 1.5 7 0 LD.~ $00708D E5 lB SBC CH

85 6E s r A $006E T EM P S TO RA GE18 CLC"C 6D LDA $OO6D,"65 69 ADC iG059

96 85 6D STA $006D TE~:P VALUE.~ ' ) 6 < : : LDA $C06E65 6A ADC $006A85 6E STt. $006E 'fEl'1t'ALUE

A 5 6fl LDA ~.005D SUETRACT ONEDO IJ~ BNE 1.2"< 6F : DEC $006E END OF NUMERICS"",

c:6 [I) A2 DEC $006D1 ; ; 60 RTS BACK TO 1:f,-" 1 C

SYMBOL TABLE 2000 205AAQ 032t. AQH 003D AQL 003C AR 03A4ARB 003F r,RL 003E HE 0043 AT L 0042CH 0013 CL 001A DB 0019 DL 0018E H 001D EL OOlC F.ECALL 0356

15:48

L E A D E R IN

C O m p U T E R E D U C A T IO N

INTRODUCES THE 6502 SERIES

~OGRAmmIHG THE 6502

By Rodney laks320 pp, retC202 S10.95

An introductory programming

text for the 6502. Does not

require any prior programming

knowledge. From arithmetic

to interrupt-driven input-output

techniques. It has been de-

signed as a progressive, step

by step course, with exercises

in the text designed to test the

reader at every step.

6502 GAmES

By Rodney laks

retG402 S13.95

From Piano to tic tac toe, in-

cluding many popular games,

and how to program your own.

To be published.

6502APPLICATIONS BOOK

6502 APPLICATIONS BOOK

by Rodney laks275pp, ret 0302 S12.95

Presents a series of practical

(hardware & software) applica-

tions for any 6502 board.

Appl icat ions can be used as

experiments - or implemented

at minimal cost. A few ex-

amples: morse generator, elec-

tronic piano, digi tal dock,

home alarm systems, traffic

controller .... and more!

TO ORDER

.yphone: 415848-8233, Visa, M.e .•

American Express.

• y lINI'h Include payment.

Shtpp'''' _,...: add 65¢ per book

41hclass - al low 4 weeks ~or $1.50

per book for U.P.S. Ov ersecs odd

$3.00 per book.

'ax: inCalifornia odd lax.

AVAILABLE AT BOOKSTORES. COMPUTER. AND

ELECTRONIC SHOPS EVERYWHERE

82020 Mllvla StreetBerkeley, CA 94704

Tel415848-8233 Telex 336311

NAM"-- ,POSITION _

COMPANY __

AOO R E~ _

CITY STATE/ZIP

Ocharge my: OVisa OM.C. OAmerican Express

OC202 00302 OG402Number Exp, date _

Signature

MM

MICRO - The 6502 Journal

oSend FreeCatalogue

August, 1979

Page 51: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 51/60

OG1D:0020:0030: I ROUTINE TO S~VE AND ReCALL

0040: II C O I· ! HC NV A RI A EL E S F O R n : 1E G ER Bf.SIC

0050: I PROGRAMS ON THE APPLE II

0060:,

cove . II WRITTEN 03/16/79 B Y RO BE RT F. ZANY

0080: II MODIFIED 7/4/79 BY MICRO STAFF

0090: I

0100: C318 CL

•$OOlA

0110: 0318 CH • $OOiB0120: 0302 ORG $0302

0130: 0 3 0 2 'IC OF 03 JMP RECALL IlItfENTRY7700140: 0305 00 BRK0150: 0306 1 1 5 CC LDA $OOCC "'ENTRY 774 - SAVE VARIABLES

0160 : 0308 85 lA STA CL SAVE END OF0170: 030A A5 CD LDA $OOCD VARIABLE TABLE0180: 030C 85 lB STA CH

0190: 030E 60 RTS BACK TO B ASIC0200:0210: 030F A5 lA RECALL LDA CL ENTRY 770 - RECALL VAR:ABLES(1220: 0311 85 CC STA $OOCC RESET END OF

0230: 0313 A5 lB LDA CH V AR IA BL E T AB LE0240: 0315 85 CD STI $OOCD0250: 0317 60 RTS BACK TO BASIC

Classified AdsO PTI MI ZE AP PL ES OFT pro gr ams: s ho r-

ten variable names; remove remarks& e xt ra co lo ns ; con ca te na te l ine s;renumber; list variable cross refs.

Two 1.3K programs for 16-48K APPLE

II's. Cassette $15, disc $20 from:S en si bl e S of tw ar e

P.O. Box 2395Dearborn, MI 48123

MACRO ASSEMBLER and TEXT EDITOR:for PET, APPLE II, SYM, KIM, other.Macros, conditional assembly, 27

comma nd s, 2 2 ps eu do- op s. Ca sse tt e

and manual for $49.95 ($1.00 forinfo). C.W. Moser

3239 Linda DriveW in st on- Sa le m, NC 2 710 6

ADVERTISE in MICRO for B mere $101

A olassified ad such as the onesabove may be run in this new ad

section for $10.00. Ad may notexceed ,ix 11nee. Only one ad perper,on or oompany. Must be prepaid

and must relate to the 6502. You

will reach more than 6502 readersI

BAD REYIEW

What's worse than g etting a complaint about

MIC RO that is not v alid? Getting one th at

is! I received a telephone call from D r.

Rodney Zaks the other d ay concerning a review

wh ich was pub lish ed about h is book Programming

~ 6502 in an earlier iss ue of MICRO. His

complaint was not that the review was unfavor-

ab le to his book, but t hat the "r eview" went

beyond th e bound aries of a review and made a

number of unwar ranted accusat ions ab out t he·techniques, motiv ations and v alues of the

entire product line offered by SYBEX, the

publish er of Dr. Zaks' book. I t old Dr. Zaks

th at I didn't really remember th e r eview, that

it was against MICRO's basic policy to print

anyt hing of that nature, but th at I would look

into the mat ter and if he was cor rect, I would

print an apology and try to rectify t he matt er

as much as poss ible.

Well, when I read the "r eview" I was s urpr ised.

I agree with Dr. Zaks. Wh ile th e fir st part

of the review is critical of the book, it is

within t he rig hts of a r eviewer. Th e second

part of the "review" should not h ave been

print ed. It does not provide any us eful in-formation to th e read er and its negat ive as-

sert ions ar e unjus tified. Since I was both

Editor and Publis her at t he time th e rev iew was

printed, I take full blame for its appearance

in MICRO, and apolog ize to Dr . Zaks and SYBEX

for its appearance.

Since it is ag ains t MIC RO's policy to print

such material, how d id it get print ed? All I

can figure is th at it "fell through the crack".

With t he very small staff we h ad at the time,

most of our effor ts were s pent on gett ing the

major ar ticles int o sh ape for pUb licat ion:

technical edit ing, typesett ing, proofing ,

pasting-up, and so for th. Very little time was

left for a careful analys is or r eview of t he

small "filler" material, and t he "review" nev ergot th e attent ion it sh ould have, and so "s lipped

in". I s ugges t that all readers ignore t he neg-

ative implications of the s econd half of the r e-

view. With th e enlarg ement of the MICRO s taff t o

include a full time editor as well as ot her s up-

port pers onnel, we hav e more time and similar

problems s hould not occur.

MICRO has printed very few reviews to dat e:

t hree book rev iews and only a couple hard ware

or software reviews. The reason for this is

t hat we feel th at unsolicited rev iews tend to

b e biased. The auth or is writing b ecaus e he

either loves or hates a pr oduct. We are working

on a plan by which MICRO can estab lish a panel

of reviewer s and actively s tart doing productreviews which are both fair and th oroug h.

Informat ion about th is plan will appear in

.'CRO 'hO'~ ' J ! 1 . ~

August, 1979 MICRO - The 6502 Journal 15:49

Page 52: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 52/60

APPLE HI-RES GRAPHICS: TheScreen Machine by Softape

Open the manual and LOAD the cassette.Then get ready to explore

the world of Programmable Characters' with the SCREEN MA·

CHINETM. You can now create new character sets- foreign alpha-

bets, electronic symbols and even Hi-Has playing cards, or, use the

standard upper and lower caseASCII character set.

The "SCREENMACHINE" lets you redefine any keyboard character.

Just create any symbol using a few easykey strokes and the "SCREEN

MACHINE" will assign that symbol to the key of your choice. For

example: create a symbol, an upside down "A" and assignit to the

keyboard 'A' key. Now every time you pressthe 'A' key or when the

Apple prints an 'A' it will appear upside down. Any shape can be

assignedto any key!

The "SCREEN MACHINE" gives you the option of saving your

character symbols to disk or tape for later use. There is no cornpli-

cated 'patching' needed. The SCREEN MACHINE is transparent to

your programs. Just print the new character with a basic print state-

ment. The "SCREEN MACHINE" isvery easyto use.

Included on the cassette are Apple Hi-Res routines in SOFTAPES

prefix format. You can use both Apple's, routines and the SCREEN

MACHINE to create microcomputing's best graphics.

Cassette,and Documentation, acomplete package $19.95

24 23 22 21 20 19 18 17 16 15 14

MY MOVE 13,8 13,11 •

MICROGAMMON 1.0 Learn, practice and inhance your Backgammon

ability with a true competitor $14.95

APPLE·LlS'NER Voice recognition Software. Create your own pro-

grams which 'listen' and understand 31 spoken words - English or

Foreign. No hardware needed $19.95

APPLE TALKER Your Apple's voice. Create programs which talk toyou in English or Spanish or any language $15.95

JUPITER EXPRESS Command your ship thru the hazards of the

Asteroid belt between Marsand Jupiter $9.95

FORTE' A music language,written like basic, you use line numbers

for your notes. You can trace line numbers or notes. You can even

print the words of any song.Saveyour songto your Disk . $19.95

FORTH J[Is the creation of Wm. Graves. This language gives you

faster execution of programs than basic and iseasierto program than

machine language.Our 100 pagemanual will teach you everything

you will need. FORTH ][comes complete with demo programs on

one Apple diskette . . . . . . . . . . . . . . . . . . . . . . . . . $49.95

WHERE TO GET IT: Look for the SOFTAPE Software display in

your local computer store. Apple dealers throughout the United

States, Canada, South America, Europe and Australia carry theSOFTAPE Software line of quality products.

If your local dealer issold out of SOFTAPE Software you can order it

direct from us by check or Visa/Master Charge.If you haveany ques-

tions pleasecall usat:

I . V / S A 11-213-985-5763Or mail your order to the addressbelow. We'll addyour name to our

mailing list for free literature and announcements of new products.

SOF T A P E=TM-

0432 Burbank Blvd. • North Hollywood, CA 91601

BRIGHT PEN What is the difference between a light and a Bright

Pen?Intelligent Software and extensive documentation .... $34.95

Page 53: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 53/60

Page 54: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 54/60

PET SPEC IA LSU S T S A L E

P E T 1 6 K $ 995 $ 8 6 0P E T 3 2 K $1295 $ 1 1 2 5P E T 8 K $ 795 $ 6 9 5P E T 2 0 4 0 D u a l D i s k $1295 $ 1 1 2 5P E T 2 0 2 3 P r i n t e r ( pr es su re f ee d) $ 849 $ 7 5 0P E T 2 0 2 2 P r i n t e r ( tr ac to r te ed ) $ 99 5 $ 8 6 0

K IM -1 $159M emory P lu sS EA -1 6 N e w 1 6K S ta tic R AM

Seawe ll M oth erb oa rd -4 K RAM s pa ce

SYM -1 $ 229$ 199$ 325

$ 9 9

( F O RKI M

S Y M

AIM)

3 M " S c o t c h " 8 " d is ksV e r b a tim 5 " d is k e tt e s S A L E

10/$31.0010/$28.50

211 4 L 45 0 ns 4K Static RA M2 7 16 EPROM (5 v olt)P ro gramm in g th e 6 5 02 (Zaks)6 5 02 Ap p lic atio ns Boo k (Zaks)6 5 00 P ro grammin g Manual (MOS)6 5 00 Ha rdwa re Manual (MOS)Firs t Book of K IMProg ramm ing a M icrocompu te r :6 502 (Foster)

$ 6 .9 5$ 45

$ 9 .90$11.90$ 6 .50$ 6 .50$ 8 .90$ 8.90

C a s s e t t e s ( al l t ap es g ua ra nt ee d)

P re mium q ua lity, hig h outpu t low nois e in 5 s cre whou s in g w ith la be ls :

C -10 1 0/5 .95 5 0/25 .00 100/48 .00C -30 1 0/7 .00 5 0/30.00 1 .00/5 7.00

W R IT E F O R 6 5 0 2 A N D S · 1 0 0 P R O D U C T L I S T

1 1 5 E . S t u m p R o a dA B Computers M o n tg om e r y v i l le , P A 1 8 9 3 6

1 2 1 5 ) 6 9 9 - 8 3 8 6

..... .. M....... _ •• H......... H ...._W......... ........._.. ..,

M O R E I N N O V A T IO N S !F R O M

P.S. SOFTWARE HOUSEFORMERLY PETSHACK

PET'" INTERFACE SNEW!

PETto CENTRONICS INTERFACEPET 10 PARALLELINTERFACEwith 5V .BA power supplyPET 10 2nd CASSETTEINTERFACE

$98.00$74.95

$49.95

PET'" SCHEMATICSFORONLY $24.95YOUGET:24" X 30 " schematic of the CPU board. plus oversized schematics of the VideoMonitor and Tape Recorder. plus complete Parts layout • all accurately andpainstakinglydrawn to the minutestdetail.

PET'" ROM ROUTINESFORONLY $19.95YOUGET:Complete Disassembly listings of all 7 ROMS. plus identified subroutine entrypoints; Video Monrtor.Keyboard routine. TapeRecordand Playback routine.RealTome Clock. etc. To entice you we are also including our own MachineLanguageMonitor program lor your PETusing the keyboardand video dispfay.Youcan have the Monrto r programon cassettelor only$9.95exira.

SOFTWARE:6502 DISASSEMBLER $12.95MAILING LIST· For personal or business applications. $9.9 5

MACHINELANGUAGEMONITOR·W,;te Mach;n. Code.Saveon tape $9.95BUDGET - NEW - Keep-track 0 ' Bil ls and Checks. Update asneeded $14.95STARTREK - All -t ime favorite wri tten for the PET's special Grephtcs $7 . 9 5

Send for ou r " " SOFTWARE BROCHURE. Dealer inqui rieS welcome.

P.S. SOFTWARE HOUSE

P.O.Box 966 Mishawaka,IN46544

III Tel: (219) 255-3408 = m eJ _ ~::::-- •.,~::;I~._ _ ............

Put Yourself in Control with the... - APPLETHROTTLE

That's r ight! The APPI.ETHROTTLE wil l tum

your game paddles into a speed control ler.By simply pushing a button. you can stop

your computer for as long as you want

Release the button, and your computer

enters a slow-motion mode wi th one

paddle cont rol ling the speed. And i f thatisn't enough, look at these addit ional

features:

• Plugs into any slot

• Works wi th machine language, IntegerBASIC. and Applesoft

• Nonnal . slow . stop

• Use to UST . -mACE. RUN, etc.

• NO SOFTWARE to load-APPLE.THROTTLE ... .. $88.95

• Unveil program secrets

And there's more! No more mul tiple US T commands to view small programsections. Wrth the APPLE THROTTLE, you'll be able to list or trace longprograms while watching your program flow inslow-motion. So get in controlwith the APPLETHROTTLE and order yours today!

PROTOBOARD,wfth over 1300

holes on 0.1 centers for designingyour ow n drcuits.APB·1 Protoboard .... $17.95

APPLETIME,a Real Time Oock

for the Apple D . Plugs directly into any

slot and keeps time even when

computer is off. Features 12/24

Hour, BCD/ASOI data format, and

AC/ Cryslal time base selection.

Includes software examples for

machine language and BASIC pro-

grams. Completely assembled andtested.

APT·1 RealTime Oock $79.95

VERBATIM 5'/.0" DISKETTES

Sc f t - S e c t o r B ox of 10... $34.50(plastic file case included)

/s..., west side electronics((lr? po.Box 636, Chatsworth. CA 91311

k.-:-~l ' ', ",);, We pay ott shf{J{Jmg 1'"1 Corninernet US.A.

I " '- ;- -- Others add' O%. Caflfornla resldemsadd6%la>:

ill]

DOYOU OWN A PERSONALCOMPUTER?

A PET? AN APPLE II?A SORCERER? A VIP?

If SO, then you need the ARESCO

newsletter specifically dedicated to

YOUR personal computer system.

One of the ARESCO newsletters is

tailored to meet your computer's con-figuration-for $15.00 you can find

out what's new with the rest of the

folks who purchased machines just

like yours. Your $15.00 buys all ten

issues of the current volume of one

newsletter-you won't miss a single

issue!

Just tell us which computer you own

or which newsletter you need:

• The PAPER- for the Commodore PETtm

• The RAINBOW- for the APPLE IItm

• The SOURCE-forthe SORCERERtm

• The VIPER- for the RCA Vlptm

Send an SASE for further information-or send515 (cash. check, MCIVISA) and get your subscnp-tion s tarted at once. Non·USA subscr ibers add510.00 for airmail postage.

ARESCOBOX 1142

COLUMBIA, MD 21044301·730-5186

Page 55: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 55/60

Page 56: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 56/60

Page 57: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 57/60

when Booting DOS", pg. 6.Helpful in diagnosing 'What Happened?'

Wozniak, Steve "Auto Repeat for Apple II Monitor com-mands", pg. 7.How to automatically repeat Monitor Commands.

Watson, Allen III "Add a Color-Klller for Clearer TextDisplay", pg. 9·12.This simple modification is now being incorporated inproduction Apples.

Dubas, Andy "Hires Graphics Plotting Program", pg. 14·16.A plotting program that will solve and plot almost any

polynamial equation. For an Apple (48K) with AS ROM andDOS.

Watson, Allen III "Integer Basic Square Root", pg. 18.Simple program for this omission from Integer Basic.

469. The Paper 1 Iss 7 (Sept., 1978)Sokel, Ralph J. "Looking at Basic ROM", pg. 6.How to examine the Commodore PET Basic ROM.

Garst, John F. "Renumber", pg. 7.A modified program.

Anon, "Intro to Basic: Strings", pg. 8·12.Tutorial article with examples on PET basic.

Smith, Ron "Cassette 110" , pg. 20·21.All about PET Cassette format.

470. The Paper 1 Iss 6 (Aug., 1978)

Alexander, Frank "Demo for ARCOS(X(", pg. 6.A short demo for PET.

Schwartz, Glenn "Tone on the PET", pg. 11.A short program and hardware for producing tones.

Martin, Russell "Interfacing an Audio Cassette Deck to theCassette I/O Port", pg. 16.How to hook-up two cassette recorders to the PET.

McCarthy, Charles A. "PET Basic Documentation", pg.18·21.Discussion of float ing point numbers in PET Basic.

471. Dr. Dobbs Journal 3 Iss 6 No 26 (June/July, 1978)Herzfeld, Andy "Lazarus", pg. 31·33.A program to resurrect BASIC programs on the Apple II.

477. Softalk 1 Issue 1 (Apr., 1979)Smith, Wm. V.R. and Depew, Wm. H. "Transferring Apple-

talker to Disk", pg. 1.Detailed instructions from Softape on modifying theirtapes for disk. SOFTALK is a newsletter published bySoftape, 12 issues $5.00.

Anon, "Talksaver, a Disk Save for Appletalker", pg. 2·3.Procedure and software listing to allow Disk II owners tosave the data tables created by Appletalker to a nameddisk file.

Anon, "Append Procedure for Prefix Programs", pg. 4.Detailed procedure for appending prefix programs to tapeor disk programs.

Anon, "How to Save Any Program in the Apple's Memory",pg.6.Many programs contain subroutines which interface withsaving the progrm to tape. Here is a way to overcome this.

Anon, "Apple Memory Map", pg. 5.Map showing just how Apple Talker and Apple-lls'nerare Situated in memory.

473. Dr. Dobbs Journal 4 Issue 4 No 34 (Apr., 1979)Prigot, Jonathon M. "OSI Basic for the KIM·1", pg. 37·39.How to adapt the OSI Basic to KIM.

Lentezner, Mark "Improve Your OSI Resident Editor", pg. 46.A simple program to fix a problem with OSI's resident.

475. Creative Computing 5 No 4 (Apr., 1979)Milewski, Richard A. "Apple-Cart", pg. 22·23.

August, 1979

All about the EXEC command of the Apple DOS. Withexamples.

Yob, Gregory "Personal Electronic Transactions", pg. 28·32.Discussion of the PET Clock with example, PET files,etc.

Zorn, Michael d. "Superose", pg. 98·99.A rose program for the PET.

475. MICRO No 11(Apr., 1979)Hill, Alan G. "An Apple II Program Edit Aid", pg. 5·7.A basic program to locate all occurences of a variablename, character string or Basic statements.

Stelly, J. "Lifesaver", pg. 9·11.This program makes it easy to save LIFE patterns tocassette, run Life at dif ferent rates, etc.

Vrtis, Nicholas J. "Corrected KIM Format Loader forSYM·1", pg. 12·14.Program helps overcome the SYM·1's KIM tape "2F"problem with a corrected loader.

Hoyt, Bruce "A Close Look at the Superboard II", pg. 15·18.In addition to an overview report on the Superboard II,there is presented a cassette save/hex memory dumpprogram and a very useful table of memory usage.

Sensicle, Andrew V.W. "SKIM or MAXI·KIM", pg. 19·20.An extended monitor supports a PC decrement funct ion,as well as "open up" and "close up" modes to move

blocks of data to make room for adding code and a branchcalculator to help determine the relative branch ad-

dresses.

Stein, Robert A., Jr. "A Cassette Operating System for theApple II", pg. 21·23.Program makes it possible to load programs into theApple by typing the name of the program and the cassetteoperating program goes looking for it and if it is found it isloaded into the Apple.

Tripp, Robert M., PhD "Ask the Doctor-Part III-Bits andBytes", pg. 25·26.Problems and fixes discussed this month include a cor-rected AIM SYNC program, a patch for the AIM·Dis·assembler, Sym Tape evaluation, and comments onSynertek Basic (8K) V1.1.

Rowe, Mike (Micro staff) "The Micro Software Catalog:VII", pg. 29·30.Ten more entries.

Gieryic, John "SYM·1 6522·Based Timer", pg. 31·32.A tutorial article on the timer and the working of the 6522versatile interface adapter.

Chalfin, Edward "The TVT·6; A User's Report", pg. 34.A user's impression of this inexpensive method of gettinga video signal out of the KIM·1.

Dial, Wm. R. "6502 Bibliography-Part X", pg. 36.Forty more references to the 6502 literature.

Rindsberg, Don "The Ultimate PET Renumber", pg. 37·47.A major program for the PET.

476. The Paper 1 Iss 5 (July, 1978)

Oakes, Peter L.A. "Routines for Finding Arcsin and Arccos",pg.4.Improved routines for the PET.

Laudereau, Terry "PET Files", pg. 5.Discussion of PET files and the commands, OPEN,CLOSE, INPUT#, GET#, etc.

VanDusseldorp, Dean "Pause Routins", pg. 7.PET program to provide pauses in a program.

Anon, "Simple Memory Test for PET", pg. 9.Program runs until a bad Ram is found.

MICRO - The 6502 Journal 15:55

Page 58: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 58/60

Page 59: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 59/60

Page 60: Micro 6502 Journal August 1979

8/3/2019 Micro 6502 Journal August 1979

http://slidepdf.com/reader/full/micro-6502-journal-august-1979 60/60