micro 6502 journal november 1979

68
8/3/2019 Micro 6502 Journal November 1979 http://slidepdf.com/reader/full/micro-6502-journal-november-1979 1/68 APPLE II HIRES Picture Compression

Upload: cubemanpdx

Post on 06-Apr-2018

228 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 1/68

APPLE II

HIRES

Picture Compression

Page 2: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 2/68

a.nmodore

-.~-- ; ~~."' . '" -. ~. . , -.

2001 - 32N $129:500

2001 - 8N $79500 PET to IEEE Cable $3995

2001 166 $99500 IEEE to IEEE Cable $4995

2001 - 16N $99500C2N CASSETIE $9500

8K DIAGNOSTIC KIT $3000

2001 - 326 $1295°0 DISKETTES:

16/32K DIAGNOSTICKIT $22500 DYSAN [Business Quality] 5/$2450

AUDIO AMPLIFIERPET $2995 VERBATIM 10/3195N DENOTES GRAPHICS ON LARGE KEYBOARD

B DENOTES NO GRAPHICS ON LARGE KEYBOARD

BUSINESS SOFTWARE

OSBORNE - CMSGeneral Leqger Disk $29500

Accounts Payable Disk $19500

Accounts Receivable Disk $19500

Word Processor 16/32K Disk $9900

Inventory Control Disk $19500

[Available 12-1-79]

Mailing List Disk $9500

Payroll Disk $29500

[Available 1-15-80)

Word Processor Tape $2495

CBM - MISGeneral Ledger DiskAccounts Receivable Disk

Accounts Payable DiskPayroll Disk

$12000

$12000

$12000

$12000

Inventory DiskJob Cost/Bid Disk

Customer Information[Mailing List] Disk

$12000

$12000

CBM - MIS Complete 7 Module Set $79500

All 16N/168 Upgrade to 32K $3-1000

Ship computer and check to:

H Dm E C r:Jm pU TEA S1775 E_Tropicana

(Liberace Plaza)

Las Vegas, NV 89109702/736 - 6363

$12000

FREE Software

LAS VEGAS series with any PEr

computer purchase or upgrade

to 32K, 'Ialued at $20000

ormore, including other software.

Page 3: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 3/68

SUPERK IMIN DU STR IA L C ON TRO L C :O MPU TE RHere isa powerful microprocessor controlsystem development tool and a completereal-time multitasking microcomputer inone package. There is no need to buy apower supply, motherboard, memoryboards and separate I/O boards when yourrequirements may be satisfied by a SUPER·KIM_ You may only need a couple of wire-wrap sockets and a few LSIchips installedin the big 3" x 10" onooarc prototype areato accomplish the required memory ex-pansion and interface with the real world.

SOmesingle chip interface devices available

are: UARTS,16 cnanner-s bit analog to digi-tal data acquisition systems, floppy diskcontrollers and dot matrix printer con-trollers. Furthermore, you will shortly beable to buy single 5volt supply pseudostatic 8Kbyte (that's right, you read it right,8Kx 8 bits) memory chips in a single 28 pinpackage. These chips use the same tech-nology developed for the 64Kbit dynamicRAMsnow being manufactured by TI,MOTOROLAnd others. Just five of thesechips and four 2732EPROMsn the socketsalready supplied in the SUPER K IM will yielda fully populated SUPER K IM with 44KbytesOfRAM,16Kbytes of EPROMwith serial and

parallel I/0 ports, and enough room left-over in the prototype area for a LSIflOPPYdisk controller chip.Zilog already has,on themarket, a 4Kbyte version of this memorychip that is pin compatible with the 8Kbyteversion; no need to rewire your socketswhen the larger memories become avail-able. Put in 24Know and upgrade laterto 44K.

If you started with a KIM-1,SYM-1or AIM-65and tried to expand it to the basic capabili-ties of the SUPERKIM, you would need apower supply ($601,a motherboard ($1201,a prototype board ($301,a memory board

($1201,and an I/O board ($1201or a totalcost of from $620in the caseof the KIM-1to $825in the caseof the AIM-65.Youstillwould not have real time multitaskingcapabilities.

Multitasking isa situation where the micro-computer appears to be doing more thanone job simultaneously. For example, the

FILTER

CAPACITOR

5VOlT

lAMPREGULATOR

K",·,

AUOOTAPE

INTERFACE

I1VOLT Ii!.

REGULATOR

RS2J2

INTERFACE

FULlYDECOOED

MEMQRlSPACE16. ~KBLOCKS.

WITHWIAEWAAP

CONNECTOR PINS

..a5:Z:ZVIA'sWITH WIREWRAP

CONNlCTOR P INSa.COUNTEAm,IER5

4-SHIFTAEGISTERS6-IIOtRECTlONAL

DATAPORTS

KIN·,

EDGECAADCOHNECTOA HGHOUALTY

T~i~!~~!~~:~~KGOLOPlATEO

PC BOARO02S"5QUAREPIH

RIBBON

CABLE;gLN~EC10R

microcomputer could be sending data to aprinter, accepting analog data from ats-cnaunel data acquisition system andpresenting data to an operator monitor-ing a LCDor LEDdisplay, all the while keep-

ing track of time.Multitasking isaccomplished on the SUPER-KIMby useof vectored priority interruptsand a r :!altime clock. This real time clock isimplemented using one of the four on-board (j522programmable tone generators.

The SU ~ERK IM . with its keyboard, displayand ROMmonitor, can be usedasasystemanarvzer for troubleshooting hardwareand software in-the-field or during systemdevelopment asan in circuit emulator. Themonitor can stop the CPUat any pointin the program, step through the program,chance the contents of the systems'

memorv and CPUregisters, and record theCPU'sn~gisters during a selected portion ofthe program. It offers one of the mostcowerut combinations of developmentand di,lgnostic tools available on themarket today.

All of tile above is unavailable on any othersinglet oarc computer at any price.

) rnic::ropraducts2107 ARTESIA BOULEVARD· REDONDO BEACH, CA 90278· (213) 374·1673

Page 4: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 4/68

compQ fD )mic rosys tems

P.O. Box 687

224 S.E. 16th Street

Am es, Iow a 50010

DA lm

DAIM isa complete disk operating system for the ROCKWELL INTERNATIONALAIM 65. The DAIM system includes a controller board (with 3.3K operating system inEPROM)which plugs into the ROCKWELL expansion motherboard, packaged power

supply capable of driving two 5 1/4 inch floppy drives and one or two disk drives

mounted in a unique, smoked plastic enclosure. DAIM is completely compatible in

both disk format and operating system functions with the SYSTEM 65. Commandsare provided to load/save source and object files, initialize a disk, list a file, list a disk

directory, rename files, delete and recover files and compress a disk to recoverunused space. Everything is complete - plug it in and you're ready to go! DAIMprovides the ideal way to turn your AIM 65 into il complete 6500 developmentsystem. Also pictured are CSB 20 (EPROM/RAM) anclCSB 10(EPROMprogrammer)

which may be used in conjunction with the DAIM to provide enhanced functional

capability. Base price of $850 includes controller board with all software in EPROM,power supply and one disk drive. Now you know why «e say -

There is nothing like a

DA lm Phone 515-232-8187

Page 5: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 5/68

i

J

Page 6: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 6/68

Skyles Electric Works

The Skyles PAL-80™ is a high speed thermal printer

offering the combination of text printing at 80 charac-

ters per line and continuous graphics at 60 dots per

inch, In the text mode, upper and lower casedata are

printed at 40 characters per second. The 5 x 7 charac-

ters provide clear readable copy on white paper; no hard

to find, hard to read aluminized paper.

In the graphics mode, sevenbits of each byte correspond

to the sevendots in each of the 480 print positions per

line. Since the computer driving the printer has full con-

trol over every print position, it can print graphs, bar

charts, line drawings, even special and foreign lanquagesymbols. Despite its low cost, the Skyles PAL-80 isa

PAL ·80™

• 80 characters per line

• 8% inch wide thermal paper

• Full graphics at 60 dots/inch

• Interfaced to PET• Works with all PET peripherals

• 40 character per second rate

• Microprocessor controlled

• Bidirectional look-ahead printing

• Quiet operation

• No external power supplies

• Only two driven parts

• High reliability

• Clear 5 x 7 characters

• Attractive metal and plastic case

true intelli lent printer with full line buffering and bi-

directional look-ahead printing.

High reliab lity isdesigned in: The thick film thermal

print head las a life expectancy of 100,000,000 charac-

ters. Two [ ICstepping motors provide positive control

of the prin head and the paper drive.

The Skyles PAL-80 operates directly from a 115V 60 Hz

line (230V 50 Hz available). No external power supplies

are require I.

It comes CI mplete with an interface for the PET: a two

and a half oot cable plugs into the lEE E interface at

the back o your PET.Works with all PET models andPET or Sk v les peripherals.

Pleasesend me Skyles PAL-80 printerlsl

complete with 2% foot interface cable to attach to my

PET at $675.00 each* (Plus $10.00 shipping and hand-

ling). I also will receive a test and graphics demonstra-

tion tape at no additional charge and over 150 feet of

8 ' 1 2 inch wide black on white thermal paper $ _

I would also like to order rolls of 8% inch wide

by 85 ft. long thermal paper (black ink) at $5.00 each

$_----

____ 10 roll cartons at $45.00 $ _

VISA, Mastercharge orders call (800) 227-8398

California orders call (415) 494-1210

'California residents add 6 to 6%% sales tax

where applicable.

PAL-80 SP~CIFICATIONS

TEXT

Format

Print speec

Line Feed

80 characters per eight inch line

6 lines per inch nominal

40 characters per second

50 milliseconds nominal

Character: .et 96 Characters, including upper and

lower case,numerals, and symbols

GRAPHICi

Format

Print Speei

COMMON

Paper

Dimension

Weight

Skyles Electric Works I

TM PAL-80 Printer on A Leash, a trademark of Skyles Electric Works Inc.

480 print positions per line

240 print positions per second

8 ' 1 2 inch wide thermal paper, available

in 85 foot tolls. black image on white

12"W x 10"0 x 2%"H

8 Ibs (3.6 kg)

0301 Stonydale DriveI:upertino, CA 95014 • (408) 735-7891

Page 7: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 7/68

Dual Tape Drive for SYM·1 BASIC

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .If you want to make your SYM . 1 BASIC work witll twotape recorders and manage tape cassette files, here iswhat it takes. A few important observations about theBASIC are presented that could save you grief .

.. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _ ....

\11

I

When I bought my SYM-1, I had no in-

tention of buying BASIC for it. However,

after not being able to show off my new

computer to my friends and relatives in a

way they could understand, I decided to

go ahead and get the BASIC ROMS.

Then I purchased a book of BASIC

games and copied several of them onto

tape. The need to have a convenient

means of copying tapes to make backup

copies became apparent. Also, I

discovered that the tape routines do not

work after BASIC has been interrupted

and reentered with a "GO" command

(warm start). After I recieved the tech

note from Synertek describing how to

put trig functions in BASIC, I found out

how to fix this problem. The tape

routines use system RAM to pass infor-

mation from BASIC and apparently the

call to "ACCESS" was omitted during

the warm start.

To make the second tape recorder

work, I added five components to one of

the buffered outputs to make it look like

the audio cassette remote control con-

figured for type IV (see figure 3-3, pages

3-7 of SYM reference manual). This is the

set up required for one of the recom-

mended recorders, Radio Shack CTR-40.

Refer to SYM reference manual figure

4-5A, pages 4-12. Note that pad 1 is

located between pads 2 and 6. The

following connections were made to buf-

fer PB4:

Install 470 OHM at location R5.

Install 2N2902A transistor emitter to pad

6 base to pad 9

collector to pad

1.

Install 1K resistors between pads 6&9.

Install 1N914 diode anode to pad 1

cathode to pad 6

Install 1N914 diode anode to pad 19

cathode-pad 16.

November, 1979

Install subminiature phono plu~ tip to

pad 6,

shield to pad 1.

My first tape recorder (General Elec-

tric model M8455A) is connecte-d to the

normal remote control con fig rred for

type V. The audio out (LO) goes to the

MIC input. I discovered a trim pot on the

inside of the recorder which, if turned

completely counter-clockwise, makes

the recording ideal for the SYM com-

puter (terrible for voice though. Also, I

found it necessary to align the heads of

both tape recorders before I could get

reliable operation. The GE recorder is us-

ed normally to save files and the Radio

Shack recorder is used with special

routines to load files. The assembly

language program was written at a loca-

t ion just before the trig function routinesand includes two sets of exec lite com-

mands for cold and warm starts to

BASIC that are compatible with the trig

functions and include a call to "AC-

CESS" so that the tape routi res will

work after a warm start.

The hex dump of the tape drive routine

plus the trig functions (from :: ynertek

Systems Corp. Tech Note 53) ca 1be us-

ed to enter the code into your system.

Use the same verify command a rd com-

pare checksums to check your work. I

save this file on tape using an II) of $31

which can be loaded and saved from

BASIC as file "1".

The sample run-stream illustrates how

to make it all work. First, a cold start toBASIC was performed with the monitor

execute command (E E5A;. SYM

responds with everything down to line

100 which was entered to excer else the

trig functions and provide something to

save on tape. After running tho single

line BASIC program, it was saved on

tape with the file name "T". "NEW"

erases the program to indicate :hat the

tape will do a real load. The "US," com-

MICRO -- The 6502 Journal

George Wells

1620 Victoria Place

La Verne, CA 91750

mand to hex address 8035 takes us out

of BASIC and back to the monitor. To get

back to BASIC use the execute corn-

mand (E E95). The response includes

everything down to the word "list".

Since nothing was listed, this shows

that the previous program has been

erased. It is loaded back in by transfer-

ring the cassette from the "save only"

recorder (in my case the GE) and putt ing

it on the "load only" recorder (Radio

Shack) and pushing the rewind button. If

this is the first time that the load only

recorder has been used since the SYM

was reset, then the recorder will start

rewinding immediately. Otherwise it will

wait until the "LOAD T" command is

entered. When the tape is rewound, the

play button is pressed and the recorder

stops automatically when the file isloaded. Listing and running the program

show it to be the same as before.

The way I use routines to manage files

is through the use of three identical

cassette tapes each storing one copy

each of all my BASIC programs. I use a

fourth tape for temporary storage of a

program I am currently working on.

When I want to make a copy of all the

programs on tape, I put that tape into

the LOAD·ON LY or READ-ON LY

recorder, and push the PLAY button.

Then I put the tape that I want to copy to

in the SAVE-ONLY or WRITE·ONLY

recorder and push the PLAY-RECORD

buttons. I also keep a directory on paper

of the program files ID's on tape. Its a

simple matter to type a sequence of

BASIC commands ccnsistinq of a series

of LOAD A, SAVE A, LOAD B, SAVE B,

LOAD C, SAVE C, etc. If I want to insert a

new program from my temp tape, I just

swap tapes in the READ-ONLY recorder

to get the new program out, and then

swap back to continue with the old pro-

grams.

18:5

Page 8: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 8/68

.E E5A

.J 0

MEMORY SIZE7 3674

WIDTH? 80

OKPOKE202,169:POKE203,14:POKEI96,I04:POKEI97,15

OK1 0 0 P RI N T $ I N( 1) , CO S( 2 ), T AN ( 3) , AT N (4 )

RU N.841470985 -.4161468:36 -.142546543

OK

SAVE TSAVED

OK

NE'~

OKi'U"sR(: !:"80:3~", 0>

CB6Dd.E E'35• (, 0

OK7USR (II<" 8 B8 6", 0 )

o

OKLIST

OK

LOAD TLOADED

OK

LET

100 PRINT SIN(1),CO~(2),TAN(3),ATN(4)OK

RUtl•;341470~85 -.4161468:36 -.142546543

OK

As a matter of habit I then read the

tape I havejust written to verify that it isO.K, and use it to copy into my third per-

manent tape. Then I repeat the process

going from the third tape back to the

original one. Finally, I read the originaltape to verify it. If at any point I detect a

bad load, I know that I will always have

an available on one of my tapes a copy

of the file in good condition, that hasn't

been overwritten yet.

Small changes can be made in anyprogram file by copying it onto the temptape with the changes (I usually make

two or three copies on the temp tape)

and then rewriting the file on eachof thepermanent tapes by reading the file Irn-

mediately before the one I want to

change to find where to start, andreloading from the temp tape before ac-

tually saving the changed file.

Three Other Observations

1.Twowords havebeenomitted from the

list of reserved words on page 9 of theBASICmanual: "GO" and,"GET". "GO"

allows you to spell "GOTO" as "GO TO"if you want; not really a good idea since

it takes three bytes of storage instead of

only one, "GET" must bea leftover since

it always generates an FCerror,

2.Page Co2of the manual states that 6

bytes of storage are used for eachvariable: 2 for the name and 4 for the

18:6

1.32581766

1.32581766

OE'5R 4A 30

OE'5C ODOE5D 33 36 37 :34

OE61 OD

OE62 38 30OE64 14 OD

OE66 50 4F 4B 450E6A 32 30 32 2C

0E6E 31 36 , 3 9 : 3A

0E72 50 4F 4B 45

0E76 :32 3 0 33 2COE7A 31 34 3A

0E7D 50 4F 4B 4' 5OE81 31 39 36 2COE85 31 30 34 3AOE89 50 4F 4B 45

OE8D 31 39 37 2COE91 31 35OE93 OD 00

OE9'5 47 30

OE97 OD

0E98 3F 55 53 52

OE9C 28 26 22 38OERO 42 38 36 22

OER4 2C 30 29

OEA7 OD 00

OEA9 84 FD

OERB A9 09

OEAD 20 A5 89OEBO 20 2E 83OEB3 20 9C 82

OEB6 A9 10OEB8 8D 02 AC

OEBB 8D 00 ACOEBE 20 7B 8C

OECI A9 00OEC3 8D 00 AC

OEC6 60

value, In fact, 5 are usedfor the value,br-inging the total to 7, This is what gives

SYMBASIC its 9+ digit resolution, The

disadvantage is that every simplevariable (including integer and string

variables which only needtwo and threebytes respectively for their values) usesmore bytes than are usually needed. ln-

cidentally, there is a memory saving

when using integer or string arrays.

However, Microsoft BASIC converts in·teger values to floating points before us-

ing them, which takes longer than using

floating points in the first place,Therefore, as a general rule, integer

variables should only be used in arrays,

and only when it is necessary to con-

serve memory space,

3.Don't make a mistake when typing aline that prints a hex-formatted number,If you don't follow the format exactly,

BASIC hangs up in a loop, printing

zeroes. If this occurs, you can recover by

doing a reset and going back to BASICwith a warm start. Your program will still

be there, but as with any error, the pro-

gram cannot be continued,

' 1 SS E I1 B L' fL A NG U AG E P R OG R AM

MODE E(!U $F D

CONFIG EUU S89ft5

ZERCK E (! U S8 :3 2E

P2SCR E(!U S829C

DDR3B E(!U SAC02

OR:3B E('U SACOO

LOADT E('U S8C78

AIIR SE5A

A::CII

BYTEA:'CII

B','TE

A " C I I

BYTE

'JO" BA'SIC COLD 'OTART COMMAND

SOD CARRIAGE RETURN

":3674" ~lEMORY SI:E'IiOD CARPIAGE RETURtl

'80" LItlE I,,'IDTH

SI4,SOD CONTROL T, CARRIAGE RETURN

CHANGE TAPE LOAD VECTORA:'CII "'POKE202, 169:POKE203, 14:

CHANGE TR IG "ECTORAoCl1 "'RO~",EI96.104:POKEI9;-.15·

B\ TE SOD,SOO CAPPIAGE RETURN. END EXECUTE

A:,CII "",0" I : A: : :I C , 'A RM S T AP T C O MM A ND

B') TE SOD CAF:RIAGE RETURt'

JUMR TO MONITOR ACCESS SUBROUTINEA',:CII " ?U::F> (:!," 8BB6" • 0 ) ,

B', TE

51 'l

LI A

J:SR

J:SR

.J:SR

UA

:I A

SI AJ'SR

UA

SI ARE

MICRO -- The 6502 Journal

lOD,iOO CARRIAGE RETURN. END EXECUTE

MODE DO CUSTOM INITIALIZE FOR READ RECORDEP

"9CONFIG

ZERO:

P2'SCR

~~~·~00010000

DDR3B BIT PB 4 OF VIA '3 S ET O UT RU T

OR3B TUPN ON READ TAPE RECORDERLOADT+3 LOAD TARE BUT SKIP INITIALIZE;~~,~OOI)l)l)OI)O

OR3B TURN OFF READ TAPE ~'ECOPDER

November, 1979

Page 9: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 9/68

HE:< DUMP

•\.' E5A-FFF

OE5A 4A 30 OD 33 36 37 34 OD,68

OE62 38 30 14 OD 50 4F 4B 45,20

OE6A 32 30 32 2C 31 36 39 3A,BA

OE72 50 4F 4B 45 32 30 33 2C~AA

OE7A 31 34 3A 50 4F 4B 45 31,A9

OE82 39 36 2C 31 30 34 3A 50,63

OE8A 4F 4B 45 31 39 37 2C 31,40

OE92 3~ OD 00 47 30 OD 3F 55,'?A

OE9A 53 52 28 26 22 38 42 38~61OEA2 36 22 2C 30 29 OD 00 84,CF

OEAA FD A9 09 20 A5 89 20 2E,lA

OEB2 83 20 9C 82 A9 10 8D 02,23

OEBA AC 8D 00 AC 20 7B 8C A9,D8

OEC2 00 8D 00 AC 60 OB (bB3,A5

OECA 83 BD D3 79 IE F4 A6 F5,DE

OED2 7B 83 FC BO 10 7C DC IF,3F

OEDA 67 CA 7C DE 53 CB Cl 7D,26

OEE2 14 64 70 4C 7D B7 EA 51,C9

OEER 7A 7D 63 30 88 7E 7E 92,69

OEF2 44 99 3R 7E 4C CC 91 C7,6E

OEFA 7F AA AA AA 13 81 00 00,7F

OF02 00 00 A5 B6 48 10 03 20,55

OFOA 36 DD A5 Bl 48 C9 81 90,EO

OF12 07 AS' 72 AO D7 20 C5 D8,36

OF1A A'3 C7 A4 C5 88 20 (2 DD,S6

OF22 68 C9 81 90 07 A9 "35 A4,21

OF2A C5 20 06 D6 68 10 03 4C,A9

OF32 36 DD 60 81 4'3 OF IA A2,71

OF3A 7F 00 00 00 00 05 :4 E6,5F

OF42 lA 2D lB 86 28 07 -B F::;:,E,';,

OF4A 87 '39 68 89 I)1 :37 ~::::3':1, SA

OF52 DF E1 86 A5 5D E7 :8 :::3,34

OF5A 49 OF DA A2 Al 54 "6 :::F, D2

OF62 13 8F 52 43 89 CD (0 7<':.'31

OF6A FO 4A 90 41 CO (b f-O 92,54

OF72 20 80 D9 A9 00 8':1 1E. A5, B6OF7A C5 48 A9 85 48 A5 (5 4:::. EB

OF82 A9 B5 48 60 A2 9E flO DO,Dl

OF8A 20 8A D'3 A9 A7 AD "0 20,64

OF92 58 D9 A':" 00 :35 BE. fl5 C5, E3

OF9A 48 A'3 A7 4:3 A5 16 ,,::: A5, 6B

OFA2 C5 48 A'? E7 4:3 6 0 ~I'? '3E!IF7OFAA AO 00 4(: C5 D8 A'3::5 A4,02

OFB2 C5 20 lD D6 20 C2 11'3A'3,3E

OFBA 59 A4 C5 A6 BE 20 I:D D8,1'3

OFC2 20 C2 D9 20 :32 DA fl'O' 00,F9

OFCA 85 BF 20 0'3 D6 A'3::A A4, (3

OFD2 C5 20 06 D6 A5 B6 ',8 10,37

(lFDA OD 20 FF D5 A5 BE, :::0 0'3,(C

OFE2 A5 16 4'3 FF :::5 16 ,:0 36,CO

OFEA DD A9 3A A4 (5 20 ID D6,FC

OFF2 68 10 03 20 36 DD fl'33F, '32

OFFA A4 C5 4C (:2 DD (11, E:7

BOE7

§( ! J IlU ( ! J , [ D (B o rPRESENTS IT'S

U T I L I T Y P A C I I

CHECKBOOK UPDATE TO DOSAN EXEC FILE WRITES OVER YOUR CHECKBOOK

PROGRAM TO AUTOMATICALLY UPDATE IT TO DOS

INDEX FILE UPDATEAUTOMATES BISHOP'S INDEX FILE

F IND C ON TRO L C HAR ACT ERWILL DISPLAY CONTROL CHARACTERS ON ANY

CATALOG OR PROGRAM LISTINGSLOW LIST

FULL STOP & START CONTROL WITH EXIT. WORKSWITH APPLESOFT OR INTEGER BASIC

LIST HEADERSPUT HEADERS ON YOUR LISTINGS WITH NO LINE

NUMBERS OR REM STATEMENTS. AP II

A UT O W RI TEA UT O W RI TE I NST RU CT ION S

USE EXEC FILES TO APPEND, ADD SUBROUTINES,

OR EDIT PROGRAMS. CONVERT INTEGER TO APPLE-

SOFT. DELETE ILLEGAL LINE NUMBERS ETC. ETC.

E XE C R EAD ERREADS TEXT FILES FOR ABOVE

DI SC S PAC ECOMPLETELY WRITTEN IN APPLESOFT. WORKS

IN 3 SECONDS. GIVES FREE SECTORS AND BYTES

WITH LISTINGS AND DOCUMENTATION, PRICE $ 1 9 , 9 5

• • • • • • • • • • D I S C M A N A G E M E N T S Y S T E M • • • • • • • • • •EIGHT PROGRAMS ON DISK TO PROVIDE THE USER WITH A

COMPLETE UNDERSTANDING OF THE DISK DRIVE COMMANDS

PLUS A UTILITY PACKAGE TO INDEX & CATAGORIZE ALL

PROGRAMS WRITTEN FOR THE APPLE II COMPUTER. THESYSTEM PROVIDES FULL SEARCH, EDITING AND DATA

T RA NS FE R C AP AB IL IT IE S.

A TWENTY-SI~ PAGE BOOKLET PROVIDES DETAILED,

EDUCATIONA~ TEQUNIQUES GIVING A THROUGH UNDERSTAND-

ING OF THE JOS COMMANDS.

SYSTEM REQUIREMENTS: DISK II & APPLESOFT TAPE OR ROM

PRICE $19.95 ON DISK FOR EITHER OF ABOVE

[PROCESSED & SHIPPED WITHIN 4 DAYS)

SEND CHECK OR MONEY ORDER TO:

SOFTOUCH

P .0. BOX 511

LEOMINSTER, MASS. 01453i.

November, 1979

DISK DRIVE WOES? PRINTER INTERACTION?

MEMORY LOSS? ERRATIC OPERATION?

DON'T BLAME THE SOFTWARE!

c.ISO·'

Povrer Line Spikes, Surges & Hash could be (he culpr it !

Floopies, printers, memory & processor of ten in terac t '

Our unique ISOLATORS eliminate equipment interaction

AN J curb damaging Power Line Spikes, Surges and Hash.

·IS:JLATOR (ISO-1 A) 3 filter isolated 3-prong sockets;

intE'gral Surge/Spike Suppression; 1875 W Maximum load,

1 KW load any socket $54.95

·ISOLATOR (ISO-2) 2 filter isolated 3-pronll socket banks;

(6 sockets total); integral Spike/Surge Suppression;

1875 W Max load, 1 KW either bank , $54.95

·SlIPER ISOLATOR (lS0-3). similar to ISO-1A

except double filtering & Suppression . . .. $79.95

·ISOLATOR (lSO-4), similar to ISO-1 A except

Jnit has 6 individually filtered sockets. .. $93.95·ISOLATOR (lSO-5). similar to ISO-2 except

.rni t has 3 socket banks, 9 sockets total .. $76.95

·CIRCUIT BREAKER, any model (add-CB) Add $ 6.00

·Ct:T BRKR/SWITCH/PILOT any mode]

I-CBS) Add $11.00

• PHONE ORDERS 1-617-655-1532 - = -1£7Electronic Specialists, Inc.

MICRO -- The 6502 Journal

171South Main Street. Nalick. Mass. 01760Deptmi

18:7

Page 10: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 10/68

T H I C o M P U l I R f O REVERYONE ON YOUR XMAS

LIST. .. INCLUI::JING

Y O U

C 1 P M F : $995! First f loppy disk based computerfor under $10001 Same great features as the Ct Pp lus more

memory and instant program and data retr ieval. Can be

expanded to 32K static RAM and a second mini-floppy.

It also supports a printer,

modem, real t ime clock,

and AC remote interface,as well as 08-650

V3.0 development

disk operating

.systern.

C 2 ·8 P : $ 79 9! The personal class computer thatcan be expanded to a full business system. Has all thefeatures of the C2 ·4Pplus an

8 slot BUS (3-time:; greater expansion

ability than the G -4P). Can be expanded

to 48K RAM, dual floppies, hard disk,

printer and bus iness software.

F : $1533 ! I t'sa big personalcomputing mini-floppy system at a special package

price. Contains the famous C2-4P microcomputer

with 20K static RAM, 5" mini-floppy unit for instant

program and data loading, R8-232 circui try

(for opt ional modem and printer), land disket tes

featuring excit ing games, personal,. business and education

applications.

C 1 P : $3 49 ! A dramatic breakthrough in price and per-

formar ceo Features OSI's ultra-fast BASIC-in-ROM, full graphics

displa, capability, and large library of software on cassette and

di .k, including entertainment programs, personal f inance,

sm 3 1 1 business, and home applications. It's a complete pro-

gram nable computer system ready to go. Just plug-in a video

rnon.tor or TV through an RF converter, and be up and running.

15K total memory including 8K BASIC and 4K RAM -

expandable t08K.

INRI ACK&WHIIE

C 2·4P : !The professional portable that has over 3-times the displaycapability of 1P's, Features 32 x 64 character display capability, graphics, full

computer type keyboard, audio cassette port, and 4 slot BUS(only two used in

base machine). It has 8K BASIC, 4K RAM, and can

be expanded to 32K RAM, dual mini-floppies anda printer.

C 2·8 P D F : $ 2599 !A ful l business system avail-

able ata personal computer price I The system includes the

pc werful C2-8P microcomputer (32K RAM expandable to

48K), jual8' floppy unit (stores 8-times as much information

as jmini-floppy), and 3 disks of personal , educat ional and

: imall business applications sof tware. Has all the capa-

AND COLOR bilitiesof a personal system including graphics plus

16 C OLO BS the abi li ty to perform Accounting, Information Manage-

The C4P and C8P offer a brilliant array of 16colors including ment, and Word Processing tasks for smal l business.

black available in both alphabetics and qrephics, TheC4P and C8P have execution speed that is twice as

~~~:sT~WE iiI:n~~~f~s~~~~~;~:O~ ~~~e B I I T T H I R U S H - O R D E R N O l iisplay than other personal computers _ ~I I. '. •. App le I I Commodo re PET TRS-SO end Atan 800a re reqr st ered t red e name s 01Apple Compu ter I ec .. Commodo r' !.~u_ :;~~ ,: ss ~~ L n e s L~d.:.,F ! . d . d _ I O :,n_dck. , Atan, r.!sp~_t!vely. __- !. . . i i i i i i i i i i I - - . . . . . . . , _

- - - - - - - - - - - - - - - c : Send me a $ enclosed

Name

Address

Payn en! by SAC (VISA) _Master Charge _

City _

BostonState Zip 590Comm.Ave.

(acrosstramBU)Phone 247.0700

compUTEASHOPUmo n N .H Cambridge Expir ~s'"e. lb~ 288NortolkSI. ----603-473-2323 (nearMH.) TOT!I LCHARGED OR ENCLOSED

66t-2670 All or lers shipped Insured UPS unless crnerwise requested

Cred tCardAccount 1 1 _

Page 11: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 11/68

Some Useful Memory Locations andSubroutines forOSI B;ASIC in ROM.

S.R. Murphy

201 N. W. 48th

Seattle, WA 98107

If you want to know more about YI)ur 051 BASIC, lntor-

mation is presented which deta Is the use of RAMScratch Pad Memory and shows where some of themost important Support Subroutines reside.

MICRO has published very little on

OSl's BASIC in ROM system. One can

only guess that fewer OSI owners are in-clined to explore their machines and

bend their functions to their own uses in

contrast, perhaps, to owners of other

6502 systems. This is a pity because, in

contrast to what I read about PET, for ex·

ample, the BASIC ROM's and the

EPROM's that support BASIC, keyboard

polling, and the MONITOR are all easily

accessed by PEEK or through the

MONITOR.

This note may stimulate other OSI

BASIC in ROM owners to try some soft-

ware ideas for custom uses. The follow-ing listing of BASIC pointer and

subroutine locations make it possible to

modify programs written for other

MICROSOFT 6502 BASIC interpreters for

use with OSI.

MICRO, number 6, pages 49·50, gave a

"PARTIAL LIST OF PET SCRATCH PAD

MEMORY", by Gary A. Creighton. Since

November, 1979

MICROSOFT supplied the BASIC inter-

preter for both OSI and PET, ' principle

of parsimony suggests that thure should

be a strong similarity betwee i the two

systems even though OSI USI is a more

primitive cassette I/O syster i withoutthe fi le commands.

Table 1 represents the essence of thissimilarity in parrallel to the PET table.

The notation is essentially thu same as

Mr. Creighton's except for tie use of

Hex rather than Decimal.

IND (XY) is an address with the low

byte in location $XY and the high byte in

location $XY + 1.

M(XY) is the content of mernory loca-tion $XY.

The description also follows the

original with the appropriate rnoditlca-

tionsfor OSI operations. The t.ible is not

complete, but, to the bes t of my

knowledge it is accurate.

MICRO -- The 6502 JOllrnal

Finally, in MICRO, number 11, page

37, Don Rindsberg presented an irn-

pressive BASIC renumbering program. I

have not yet converted the program to

OSI because a BASIC renumbering

capability is not one of my favorite

needs. However, for OSI owners who

would like to "roll your own" following

Mr. Rindsberg, Table 2 is presented as a

substitution for his Table 1 on page 38

that lists the BASIC subroutines needed

in his program. The subroutines in Table

2 can, of course, be used for other pur·

poses. $B95E is an excellent Hex to

Decimal converter that can be called

with a simple machine language pro-

gram. Similarly, $A77F can be the basisfor Decimal to Hex conversion. $A8C3 is

a general purpose message printing

routine that is easily incorporated into

any program. Finally, $A24D makes it

relatively simple to modify BASIC pro-

grams under computer control.

18:9

Page 12: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 12/68

IND(01)

IND(06)

IND(08)IND(OB)

M(OD)

M(OE)

M(OF)

M(11-12)

M(13-5A)

IND(71)

IND(79)

IND(7B)

IND(7D)

IND(7F)

IND(81)

IND(83)

IND(85)

M(87-88)

M(89-8A)

IND(8B)

M(8D-8E)

IND(8F)

IND(91)

M(93-94)

M(BC-D3)

IND(C3)

M(AF-BO)

M(FB)

M(100-107)

M(1FF)

M(200-20E)

M(212)

M(213-216)

18:10

Table 1

A Partial List of OSI BASIC

in ROM Scratch Pad Memory

(Ref. MICRO, No.6, Pgs. 49 - 50)

Initially, address of cold start ($BD11).

Replaced by warm start ($A274).

USR INVAR address.

USR OUTVAR address.USR program address.

Number of NULL'S selected.

Terminal character count.

BASIC terminal width.

Arguments of statements such as PEEK,

POKE, GOTO, GOSUB, line numbers, etc.

Input buffer.

Scratch pad address for garbage collec-

tion, line insertion, etc.

Address of beginning of BASIC code.

($0301)

Address of beginning of Variable Table.

Address of first array entry in Variable

Table. If no arrays, end of Variable Table.Address of end of Variable Table.

Lowest string address.

Scratch pad string address.

Address, plus one, of highest allocated

memory.

Present BASIC line number.

Line number at BREAK.

Pointer to BASIC code for CONT.

Line number for present DATA statement.

Address of next DATA statement.

Address of next value after comma in pre-

sent DATA statement.

ASCII code for present variable.

Subroutine: Points through code one

byte at a time, RTS with code value in A

and carry clear if ASC(O - 9); otherwise,

carry set. Return A = 0 if end of line. Ig-

nores spaces.

Code location pointer for above

subroutine.

USR input variable storage.

MON ITOR keyboard control flag.

( = 0 for keyboard).

Storage of conversion of floating point

number to ASCII.

Top of BASIC stack.

Temporary storage for CR simulator

subroutine ($BF2D).

CTRL C flag.( =$01 if CRTL C off).Temporary storage, keyboard polling pro-

gram (#FDOO).

Table 2

I)SI BASIC Routines Needed for

BASIC Renumbering

(Ref. MICRO, No. 11, Pg. 38)

$A24C ::lrint an error message from the message

:able. Enter with X containing the location of

he message relative to $A 164. Message ter-

ninator is ASCII having bit 7 on.

$A24D 3ASIC line insertion routine, Enter with line

assembled in the line buffer $b013-$005A with

)0 as line terminator. Also, character count

nust be in $005D and the line number(hex) at

~0011/12.

$A77F :valuate an expression whose beginning ad-

iress is in $00C3/C4. ·Use this subroutine to

convert from ASCII to binary, with the result

appearlnq in the floating accumulator:

~OOAC/AD/AE/AF.

$B7E8 :;onvert fixed number in $OOADlAE to floating

lumber. Enter with the result appearing Irr

he floating accumulator: $OOAC/AD/AE/AF.

$B408 :;onvery binary value, such as line number, in

loating accumulator to two-byte fixed

lumber and place in $0011/12.

$B96E :;onvert floating number at $OOAC/AD/AE/AF

o ASCII and place in string starting at $0101,

ireceded by a space or minus sign at $0100

md terminated by 00.

$A274 3ASIC warm start. Prints "OK".

$A8C3 Jrints message. Enter with ADH in Y, ADL in

\. Message is ASCII string ending with 00.

$B95E Jrint the decimal integer whose hex value is

n registers A and X, for example, a line

lumber.

13ESTof MICRO Volume 2is available now.

All of the lrr portant material from MICRO issues 7 through 12(Oct/Nov 78 to May 79) presented in convenient book form. The

book is 8'/ by 11 inches, 224 pages, and the material is

organized t,y major computer type: AIM/SYM/KIM, APPLE,

PET 'anc GI:NERAL material. This is a companion volume to

BEST of MI'~RO Volume 1 which covered issues 1 to 6.

BEST of MI ::RO Volume 2 is available at your local computer

store for $C.OO, or may be ordered directly from MICRO with

delivery an} where in the world at:

$9.00 Suface Mail, or,

$13.00 Ai Mail.

BEST of M CRO Volume 1 is still available from you local

dealer for $ ).00 or by mail from MICRO at:

$7.00 Suface Mail, or,

$10.00 Ai Mail.

Send orders to:

MICROP.I). Box 6502

Ct elmsford, MA 01824

MICRO -- The 6502 Journa I November, 1979

Page 13: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 13/68

A Tape Indexing Systeml for the PET

A solution is provided for the PET cassette tape prob-lem. Using inherent capabilities of the PET, a procedureis presented which permits use of the recorder's fast tor-ward and fast rewind facilities to rapidly index and por-tion of the tape.

A frustrating problem for PET owners

occurs when it becomes necessary to

load a program or read a data file that

has been written in the middle of a

cassette tape. Since Commodore chose

not to include a cassette recorder with

an index counter, the user is left with the

following options:

1) Load only one program per tape.

(This can make personal computing un-

necessarily expensive for the hobbist

with hundreds of programs.)

2) Let the PET slowly search through

the tape until it finds the correct file

name. (This process is much too slow,

since it can take up to 30 minutes tosearch one side of a 60 minute tape.)

3) Guess where the program might be

on the tape and run the tape to this point

using the fast forward speed on the

recorder; then let the PET begin to

search for the program. (This guessing is

no fun. One often runs past the desired

program and wastes even more time).

I decided that there must be a better

way to use the PET for reading multiple

files. An index finder on the recorder

WOUld, in essence, permit me to use op-

tion 3 above, but with the guesswork

reomved in positioning with the fast for-

ward speed. I contemplated implemen-

ting a photodetector and an LED as anindex counter, but this would require

modification of the recorder plus hard-

ware for counting and displaying. A

much simpler solution would be to

develope a software index counter that

would take advantage of existing

recorder switch-sensing and motor-

control car-abilitles of the PET. The

machine language program, described

below, uses an index number correspon-

ding to each program position on the

November, 1979

tape. Also given is the methoc for deter-

mining the correct index nu Tiber cor-

responding to each program 011 the tape.

Indexing Approach: Theory

A successful tape positicning pro-

gram can be implemented if tr e fast for-

ward speed of the recorder is run for the

correct length of time and if H is correctlength of time can be determ ned for a

given program.

The first requirement can be met easi-

ly by using the PET's ability t J sense if

the recorder buttons are pressed and to

stop the recorder under progra 11 control.

The tape of interest is simply loaded intothe recorder and rewound; the correct

time constant for the desired ~ rogram is

then entered into the PET. ThE' position-

ing program instructs the user to press

"fast forward." The program watts until

a recorder button depre ssion is

detected, then begins timing until a time

corresponding to the index time has

elapsed, at which point the recorder

motor is stopped. A prompt cr aracter isoutput to the PET screen indicating that

the tape is posttioned at the beginning

of the desired program on tape and that

the user should now pres the "stop" but-

ton. Upon sensing the depress ion of the

recorder stop button, the induxlnq pro-

gram places the recorder under manualcontrol for subsequent use in loading

the program from tape and then exits to

the operating systems monit Jr. If this

machine language positioninq program

is stored in a safe memory such as the

cassette number 2 buffer (M826-M1023)

when the PET is powered LIP, it will

always be available for positioning pro-

grams and data files with no time lost in

loading the program each time it is need-

ed.

MICRO -- The 6502 Journal

Alan R. Hawthorne

611 Vista Drive

Clinton, TN 37716

The second requirement for im-plementing an indexing system, that of

determining the correct time constant

for a given program, is more demanding.

Not being able to read the tape header

while the recorder is running fast for-

ward, one must find another means of

determining the fast forward time re-

quired for posltloninq a tape. A related

time that can be obtained easily is the

amount of time required to rewind the

program tape. The PET can detect when

the rewind button is depressed and can

count time until the user presses "stop"

when the tape is rewound. This time can

be directly, although not simply, cor-

related with the fast forward time re-

quired to position to the beginning of the

program to be entered. Of course the

problem in relating the rewind speed to

the fast forward speed occurs because

the tape speed (ern/sec pass the

recorder head) varies even though the

drive speed (revolutions/sec) is the same

in each direction. (That the drive speed

is the same fast forward as rewind is

easily proven by measuring the time

taken to run through a complete tape in

the fast forward mode. This time can be

compared with the time taken to rewind

the tape. The two times should be ap-

proximately equal. )

With the forward and reverse drive

speeds the same, the following integralequation can be used to relate the re-

wind time (tr) and the fast forward time

(tf) in terms of the minimum tape radius

(ro), the rate of radius change (c), and the

time (tm) required to rewind the tape

from the end to the beginning.

t t{ f (rO + ct)dt = { r frO + c(tm - t)]dt

This equation can be solved for the fast

forward speed:

18:11

Page 14: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 14/68

Listing 1.

970 20 DO D6 JSR 54992

973 A9 10 LDAIM 16

975 2C 10 E8 WAITl BIT 59408

978 DO FB BNE WAITl

980 AO 02 02 NEXT LDA 514

1 1 0 3 CD 02 02 WAIT2 CMP 514

986 FO FB BEQ WAIT2

988 C6 08 DEC 08

990 DO F4 BNE NEXT

992 c6 09 DEC 09

994 10 FO BPL NEXT

996 A9 34 LDAIM 52

998 8D 07 )2 STA 519

1001 A9 3D LDAIM 61

1003 8D 13 E8 STA 59411

1006 A9 5F LDAIM 95

1008 20 D2 FF JSR 65490

1011 A9 10 LDAIM 16

1013 2C 10 E8 w AIT .., BIT 59408,1016

FO FB BEQ WAIT3

1018 A9 00 LDAIM 00

1020 8D 07 02 STA 519

1023 60 RTS

tf = (2tm\ + k2+ 2ktr - \2)'12 - k

where

tf - tr

The value for k can be determined for

tapes of various lengths (15 min., 30

min., 60 min., etc.) by running fast for-

ward for a time, measuring the rewind

time, and evaluating equation 3. This

should be repeated for several different

times and an average value obtained for

k.

Program Implementation

Using the techniques outlined, atape

indexing program can easily be im-

plemented for the PET. Listing 1 gives a

machine language program that will run

a tape fast forward for a given time and

stop the cassette motor. The program is

run, after the correct tape has been load-

ed and rewound, by calling the user

function X = USR (TC) where TC, the in-

dex time constant, is the number of jif-

fies required to position the tape cor-

rectly. Time is evaluated in jiffies

because the PET has a jiffy counter

which is convenient to use and the tim-

ing resolution provided is quite suffi-

cient.

The program uses several features of

the PET's operating system. The

subroutine at M54992 converts the argu-

ment of the USR function from the

floating accumulator to a 16-bit integer

with the LSB in M8 and the MSB in M9.

Bit 4 of M59408 senses the status of the

recorder switches. If any switch of the

recorder is pressed, the content of this

bit is 0; otherwise it is 1.

The jiffy counter, which the PET uses

as a part of its real-time clock, is located

in M514 and is incremented 60 times a

second by the operating system. The

cassette flag is located in M5HI. A 52

must be loaded in order to control the

recorder motor using the progra m and

then restored to 0 before exiting the pro-gram, leaving the recorder under rnanual

control. With the cassette flag set cor-

rectly, the recorder can be stop Jed by

the program by loading the value 61 into

M59411. Finally, the subrout ne at

M65490 is used to display a prompt on

the video screen informing the US3rthat

the tape is positioned and that the

"stop" button should be pressed

The positioning program can be called

either from a BASIC program or b~fdirect

command. Listing 2 is a BASIC proqrarn

for loading the machine Ianquaue pro-

Listing 2.

gram into memory when the PET is

powered up. The program is stored in the

upper portion of the number 2 cassette

buffer and will remain loaded until the

user writes over the memory or the PET

is reset. This location leaves available

protected memory from M826 to M970

for other machine language programs.

Listing 3 is a BASIC program called

TAPE capable of providing several

useful functions for a tape indexing ..

system. The program, as currently

dimensioned, indexes 10 tapes with up

to 10 programs per tape. The functions

are available by entering various com-

mands. To position a tape for reading

program number k on tape number 1.,enter R. (The machine language program

of Listing 1 is assumed to be loaded.) To

update a program name or index time

constant in the index, enter a U.The tape

number and program number will be re-

quested by the program.

To determine the rewind time and fast

forward time for a program number k,

enter a T. The tape containing the pro-

gram to be indexed should be positioned

so that it is at the end of the program. If

the tape is not at this point it can bepositioned by verifying, using the pro-

gram name (i.e., VERIFY "program

name"). This will position the tape cor-

rectly, even though a verify error will oc-

cur. The time constant measured and

displayed using the T command is ac-

tually the index time for the program

k + 1 and is automatically entered into

the index by the T command, so that the

U command is not needed.

To look at the index of a given tape,

enter I and the tape number. The index

will appear on the PET screen with the

program number, name, and time cons-

tant displayed. To save the index data

file, an S command is entered. The indexfile should be saved if any tape index

was updated or added to by using the T

command. The data file is placed direct-

ly following the BASIC program TAPE on

the tape. This is done by verifying TAPE

before writing the data file. If the index

data file has never been written on tape,

the TAPE program should be entered at

10200 (i.e., RUN 10200) instead of 10000

since the first thing the program does is

read the data file.

The most important part of the TAPE

program is the index time constant

00

1020

3040

5060

7080

90

REMDATA

DATA

DATA

DATA

DATA

DATA

FORPOKE

END

TAPE POSITIONING PROGRAM, X=USR(TC)

32, 208, 214, 169, 16, 44, 16, 232, 208

251, 173, 2, 2, 205, 2, 2, 240, 251

198,8,208,244,198,9,16,240,169

52,141,7,2,169,61,141,19,232

169, 95, 32, 210, 255, 169, 16, 44, 16

232,240,251,169,0,141,7,2,96A=970 TO 1023: READ B : POKE A,B : NEXT

1, 202, : POKE 2,3

Page 15: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 15/68

should try to press "stop" as soon as

the tape is rewound, since conslderabla

error can be introduced if the rewind

t ime is not measured consistently.

Final Comments

determining routine. In order to use the

machine language positioning program,

all that is needed is the time constant.

If one simply writes the time constant

by the program name on his tape label,

there is no need for the TAPE program to

be used each time a specific program is

to be read. Instead, TAPE will most likely

be read when index editing or surveying

is desired. The pertinent lines for obtain-

ing the index time constant are

14100-14700. The values determined for

tm and k in equation 2 were 6000 jiffies

and 5000 jiffies respectively, for a 60

minute tape.

Although the constants for a 30

minute tape were somewhat larger than

half the 60 minute tape constants, the

relatively low degree of accuracy re-

quired to position within the 10 second

buffer written by the PET prior to each

program allows considerable freedom in

the selection of the constants. Line

14400 uses the PET BASIC function

WAIT to monitor the recorder buttons in

measuring the rewind time. The user

Listing 3.

10000 DTM TN$(10,10),TM(10, 10)

10050 OPEN1,1,0,"TAPE INDEX"10070 FORJ=lT010

10100 FORI=lT010:INPUTH1,TN$(J,I),T$:TM(J,I)=VAL(T$):NEXT:NEXT10150 CLOSE 1

10200 PRINT"R:READ,U:UPDATE,T:TIME,I:INDEX,S:SAVE"

10250 PRINT"TAPE II & COMMAND":INPUTL,C$10300 IFC$="R"THENGOSUB12000:GOT01020010400 IFC$="U"THENGOSUB13000:GOT01020010500 IFC$="T"THENGOSUB14000:GOT010200

10600 IFC$="I"THENGOSUB15000:GOT01020010700IFC$="S"THENGOSUBll000:GOT01020010800 PRINT" 111" :GOT01020011000 PRINT"TAPE REWOUND":INPUTY$11100 VERIFY"TAPE":WAIT59408,16

11200 POKE243, 122:POKE2lI4,2:OPEN 1,n,"TAPE INDEX"11300 FORJ= lT010

11400 FORI=lT010:T$=STR$(TM(J,I»:PRINT#1,TN$(J,I)","T$:NEXT11500 NEXT

11600 CLOSE1:RETURN

12000 PRINT"ENTER PGM II ":INPUTK

12100 PRINT"TAPE ";L;" LOADED & REWOUND":INPUTY$

12200 PRINT"PRESS P - r . " :X=USR(TM(L,K»12300 RETURN

13000 PRINT"ENTER PGM II TO UPDATE (0 TO EXIT)":INPUTK13100 IFK=OTHENRETURN

13200 PRINT"NEW TITLE":INPUTTN$(L,K)13300 PRINT"NEW TIME":INPUTTM(L,K)13400 GOT013000

14000 PRINT"PGMII &

TITLE":INPUTK,TN$(L,K)14100 PRINT"ENTER 1 FOR 30 MIN TAPE, 2 FOR 60 MIN~

14200 INPUTZ:MX=3000'Z:TK=2500'Z14300 PRINT"PRESS REWIND"

14400 WAIT59408,16,16:T=TI:WAIT59408,1614500 T= TI-T:PRINT"REWIND TIME = ";T

14600 TM(L,K+l)=INT(SQR(2'MX'T+TKf2+2'TK'T-Tr2)-TK)14700 PRINT"FAST FORWARD TIME = ";TM(L,K+1)14800 RETURN

Perhaps a word of caution is in order.

The user should avoid placing programs

that may require extensive revisions in

the middle portion of a tape, since the

revised program might then exte-nd on to

the next program on the tape. However,

once a program has been developed, the

use of multiple files per tape is oftenquite convenient.

After implementing the tape ndexing

and positioning programs, I find that I no

longer dread the thought of h avinq to

read a program from the mlddle of a

cassette. In fact, reading the seventh or

eighth program on the tape takes only

slightly longer than reading the lirst pro-

gram. Hopefully, other PET entnuslasts

will find the program useful. In any case,

discovering and utilizing some of the

"hidden" powers of my PET was half thefun.

.. 15000 PRINT".",""'TAPE ";L;" INDEX"'":PRINT15100 FORI=lT010:PRINT"#";I;TN$(L,I);TAB(32);TM(L,I):PRI~T:NEXT15200 RETURN

aidm;lchins lanm.t1l'lOeprogrammer. More

30 routinel?are fully detaHrd so'hereadercanppt them.to use

$pecify old()rn~w$6,95 plus .75 for . postag.e,or. Ma5terchargeaccepted:pack gU;;Irantee (,10 days);

Page 16: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 16/68

A Warning: _

T he MACAOTEA™is for ProfessionalProgrammers - and VerySerious Amateurs - Only

Now: a machine language pro-gramming powerhouse for the

knowledgeable programmer whowants to extend the PET's capa-bilities to the maximum. TheMacroTeA, the Relocating MacroText Editor.Assembler from SkylesElectric Works.

Subroutlne Paramete rPassing

Mark Swanson

177 Hastings Mill Road

Streamwood, IL 60103

A technique that makes it easy to pass parameters to

subroutines is presented. While this method has beenknown and used for many years on the big computers, itmay be new and useful to many microcomputerists.

Passing information from a main pro-

gram to a subroutine is usually done by

either pushing it on the stack or storing

the information in an area common to

both routines. An alternative method in-

volved having the parameters after the

subroutine call.

When a jump subroutine is executed

the return address is stored on the stack

and control is passed to the subroutine.

If we put our parameters after the jump

subroutine instruction, the return ad-

dress on the stack will now point to this

data. The subroutine can now pull the

return address off the stack, fetch the

parameters useing the return address,

increment the return address to skip

over the parmeters, and use this new ad-

dress to return to the calling proqram,

Here is an example of using this

method of parameter passing to print a

character string. The program MAIN

contains a jump subroutine 1:0 the

subroutine PTRSTR. The address of the

beginning of the string follows the JSR

M A I N P R O G R A M

5678

The Skyles MacroTeA is a superpowerful text editor. 26 powerfulediting commands. String search andreplace capabil ity. 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.

The Skyles MacroTeA is an enhanceMonitor. 11 powerful commands toease you past the rough spots ofprogram debugging.

The Skyles MacroTeA is a warmstart button, Over 1700 bytes ofprotected RAM memory for your objectcode.

There's no tape loading and nooccupying of valuable RAM memoryspace: The Skyles MacroTeA puts 10Kbytes of executable machine languagecode in ROM (from 9800 to BFFF-direct ly below the BASIC interpreter).2K bytes of RAM (9000 to 97FF).

Like all Skyles Products for the PET, it's practically plug inand go. No tools are needed. And, faster than loading anequivalent size assemblerleditor from tape, the MacroTeA isinstalled permanently.

The Skyles MacroTeA: 13 chips on a single PCB. Operatesinterfaced with the PET's parallel address and data bus or withthe Skyles Memory Connector. (When ordering, indicate if the

MacroTeA will interface with a Skyles Memory ExpansionSystem. You can save $20.) Specifications and engineering areup to the proven Skyles quality standards. Fully warranted for 90

days. And, as with all Skyles products, fully and intelligentlydocumented.

VISA, Mastercharge orders call (800)227-8398(Except Calif.)@ ~ California orders please call ( 4 15) 494 -12 tQ .

o~!r.!!~Dri~C~~~~~~'~~!:.~S

J S R P R T S T R

$78$56

==

instruction. The end of the string is

marked by a zero byte. The routine first

references the stack to get the return ad-

dress and stores this in a temporary zero

page location (locations zero and one).

Using this address we now can access

the string starting address located after

the JSR. The string starting addrss is

moved into a temporary zero page loca-

tion (locations two and three). Using in-

direct indexed addressing we load a byte

of the character string, call a routine

which prints a single byte, increments

the Y register, and loops until the zero

byte is found. After the entire string is

printed, we increment the return address

by two to skip over the string address

parameters. We can now return to the

calling program via an indirect jump to

the temporary return address locations

(locations zero and one).

This method of parameter passing

can be very useful when dealing with

subroutines that are called frequently or

which pass large amounts of data.

J U M P T O S U B R O U T I N E T O P R I N T A S T R I N G

L O W P O R T I O N O F S T R I N G A D D R E S S

H I G H P O R T I O N O F S T R I N G A D D R E S S

R E T U R N H E R E T O C O N T I N U E P R O C E S S I N G

= " P R I N T T H I S M E S S A G E "

$ 0 0 H E X Z E R O T O M A R K E N D O F S T R I N G

Page 17: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 17/68

0 2 3 A

0 2 3 A

0 2 3 A

0 2 3 A

0 2 3 A

0 2 3 A

0 2 0 0

0 2 0 0 0 8

0 2 0 1 B A

0 2 0 2 E 8

0 2 0 3 B D 0 0 C I l

0 2 0 6 8 5 E O

0 2 0 8 E 8

0 2 0 9 B D 0 0 C I l

0 2 0 C 8 5 E l

0 2 0 E 9 A

0 2 0 F E 6 E O

0 2 1 1 D O 0 2

0 2 1 3 E 6 El

0 2 1 5 A D 0 0

0 2 1 7 B l E O

0 2 1 9 8 5 E 2

0 2 1 B C 8

0 2 l C B l E O

0 2 1 E 8 5 E 3

0 2 2 0 A D 0 0

0 2 2 2 B l E 2

0 2 2 4 F O 0 6

0 2 2 6 2 0 3 4 1 2

0 2 2 9 C 8

0 2 2 A D O F 6

0 2 2 C 1 8

0 2 2 0 A S E O

0 2 2 F 6 9 0 2

0 2 3 1 8 5 E O

0 2 3 3 9 0 0 2

0 2 3 5 E 6 E l

0 2 3 7 6 C E O

P RI N T S T R IN G S U B R OU T I NE

M AR K S W A NS O N

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

Z E R O *O N E *T W O *T H R E E *S T A C K *P U T C H R *

$ O O E O

$ O O E l

$ 0 0 E 2

$ 0 0 E 3

$ 0 1 0 0

$ 1 2 3 4 S O M E P R I N T C H A R A C T E R S U B R O U T I N E

O R G $ 0 2 0 0

P R T S T R C L D C L E A R D E C I M A L M O D E

T S X T R A N S F E R S T A C K P T R T O X R E G

S I N C E P O I N T E R A L W A Y S P O I N T S T O N E X T P O S I T I O N

A V A I L A B L E , I N C R E M E N T B Y O N E

I N X

L D A X

S T A

I N X

L D A X

S T A

T X S

I N C Z

B N E

I N C

S T A C K

Z E R O

S T A C K

O N E

Z E R O

O V E R

O N E

L D Y I M $ 00

L D A I Y Z E R O

S T A T W O

I N Y

L D A I Y Z E R O

S T A T H R E E

O V E R

L O A D L O W P O R T I O N O F R E T U R N A D D R E S S

S A V E

I N C R X T O N E X T S T A C K E N T R Y

L O A D H I G H P O R T I O N O F R E T U R N A D D R E S S

S A V E

R E S E T S T A C K P O I N T E R

A D D R E S S O F F B Y 1 , S O N O W W E

I N C R E M E N T I T

H I G H A D D R E S S T O O , I F N E C E S S A R Y

Z E R O Y R E G I S T E R

L O A D F I R S T P A R T O F S T R I N G A D C R E S S

S A V E

B U M P P OI N T ER

L O A D S E C O N D P A R T O F S T R I N G A C D R E S S

S A V E

S U B R O U T I N E N O W H A S T H E S T R I N G A D D R E S S

N O W P R I N T S T R I N G U N T I L A H E X 0 0 I S F O U N D

L O O P

L D Y I M

L D A I Y

B E Q

J S R

I N Y

B N E

$ 0 0

T W O

F I N I S H

P U T C H R

L O O P

Z E R O

$ 0 2

Z E R O

E N D

O N E

Z E R O

Z E R O Y R E G I S T E R

L O A D A C H A R A C T E R O F S T R I N G

I F E D U A L T O Z E R O , F I N I S H E D

S O M E S U B R O U T I N E T O P R I N T A

I NC R E ME N T P OI N T ER

U N C O N D I T I O N A L

C ~ A R A C T E R

j

F I N I S H C L C

L D A

A D C I M

S T A

B C C

I N C

J M I

C L EA R C A R R Y

I N C R E M E N T R E T U R N A D D R S S S B Y

T W O T O S K I P O V E R

S TR I N G A D D RE S S P AR A M ET E R S

D O N E I F N O C A R R Y

B U M P H I G H A D D R E S S I F C A R R Y

J U M P I N D I R E C T T O R E S U M E M A I N P R O G R A M

To Order P R O G R A M M E R 'ST O O L K I T or M A C R O T E A -Custom designed to plug into your PET. So, when ordering, please indicate if yourToolkit:

[ 0 E N D

... will be used with the Skyles Memory Expansion System, or

.. will be used with the ExpandaPet , or Expandmem... will be used with the PET 2001·8 alone(We furnish connectors to the memory expansion bus and to the second cassette interface.

... will be used with the PET 2001·16, ·32 (chip only)

$80.00'

$80.00'

$80.00'

$50.00'

. .. will be used with Sky les MacroTeA

Your MacroTeA. Cus tom des igned for your PET. So specify your PET model when ordering.$395.00·

(Important Savings: If it's to be used with a Skyles Memory Expansion System, the MacroTeA can

plug directly into the Skyles connector. So you save $20. The Skyles MacroTeA is only $375.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 (415) 494-1:210.)

Ten Day Unconditional Money-Back Guarantee on all products sold by Skyles Electric Works, except chip only.Califorma residents: please add 6·6V2 % California sales tax.

Skyles Electric Works 10301 Stonydale Drive, Cupertino, CA 95014, (408) 735-7891

$50.00'

Is Programming Fu~l

Have More Fun,Make Fewer Errors,Complete Programs MuchFaster ... with the

B A S IC P R O G R A M M E R 'S

T O O l K I T ™

Now you can modify, polish, simpli fy,add new features to your PET pro-grams far more quickly while reducingthe potential for error. That all adds upto more fun . . . and the BASICProgrammer's ToolKit.

The magic of the ToolKit: 2KB ofROM firmware on a single chip with acollection of machine language pro-grams available to you from the timeyou turn on your PET to the time youshut if off. No tapes to load or tointerfere with any running programs.And the Programmer's ToolKit installsin minutes, without tools.Here are the 10 commands that can

be yours instantly and automatically

... guaranteed to make your BASICprogramming a pleasure:

AUTO RENUMBER

HELP TRACE

OFF APPEND

FIND

DELETE

STEP

DUMP

Every one a powerful command toinsure more effective programming.Like the HELP command that showsthe line on which the error occurs... and the erroneous portion isindicated in reverse video:

HELP

500 J = SQR(A ·B/(I3)

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 his

associates at Palo Alto ICs.So, if you really want to be into

BASIC programming - and you wantto have fun while you're doing it, order

your BASIC Programmer's Toolkitnow. We guarantee you'll be de-lighted with it.

Page 18: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 18/68

Presents

Software and H ard ware for v n u r APPLE

SALES FORECAST provides the best forecast using the four

most popular forecasting techniques: linear regression, logtrend, power curve trend, and exponential smoothing. Neil D.

Lipson's program uses artificial intelligence to determine thebest 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 logcurve 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 a graph of the result. By Dave Garson. $9.95

PERPETUAL CALENDAR may be used with or without a

printer. Apart from the usual calendar functions, it computesthe number of days between any two dates and displays sue-

cessive months in response to a single keystroke. Written by

Ed Hanley. $9.95

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

game of intergallactic combat. You fire on the invader afteraligning his fighter in your crosshairs. This is a high resolution

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

ROCKET PILOT is an exciting game that simulates blasting offin a rocket ship. The rocket actually accelerates you up and

over a mountain; but if you are not careful, you will run out ofsky. 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 resolutiongraphics and full color. $9.95

MISSILE ANTI·MISSILE displays a target on the screen and athree 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 anti-rntsslte controlled by paddle O . DaveMoteles' program offers high resolution and many levels ofplay. $9.95

MORSE CODE helps you learn telegraphy by entering letters,

words or sentences, in English, which are plotted on thescreen using dots and dashes. Ed Hanley's program also

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 permitsthe operator to enter his own equation. Dave Moteles' programwill plot the equation on a scaled grid and then flash a table ofdata points required to construct a similar plot on paper. $9.95

UTILITY PACK 1 combines four versatile programs by VinceCorsetti , for any memory conf igurat ion.

POSTAGE AND HANDL ING

Please ad d $1.00 for the first itemand $.50 for each ad ditional item.

• Prog rams accep ted for p ub lication

• H ighest royalty paid

o Intl!ger to Applesoft conversion: Encounter only thosesyr tax errors unique to Applesoft after using this program

to convert any Integer BASIC source.

o

Disk Append: Merge any two Integer BASIC sources into asingle program on disk.o Intl!ger BASIC copy: Replicate an Integer BASIC program

from one disk to another, as often as required, with a

single keystroke.o 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

BLOCK.~DE 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 direc-

tional vectors and adds additional information such as star-

ting address, length and position of each shape. Murray Sum-mers' Applesoft program will 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 colormay be reversed many times, and there are also suddenreverses of luck. You can win with a single move. Vince Corset-

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

flipping pieces. $9.95

SINGLE DRIVE COpy is a special utility program, written by

Vince Corsetti in Integer BASIC, that will copy a diskette uSing

only one drive. It is supplied on tape and should be loaded ontoa diskette. It automatically adjusts for APPLE memory size

and should be used with DOS 3.2. $19.95

SAUCER INVASION lets you defend the empire by shootingdown a flying saucer. You control your position with the pad-

die while firing your missile at the invader. Written by Bob

Bishop. $9.95

HARDWARELIGHT PEN with seven supporting routines. The light meter

takes intensity readings every fraction of a second from 0 to588. The light graph generates a display of light intensity on

the screen. The light pen connects points that have beendrawn on the screen, in low or high resolution, and displays

their coordinates. A special utility displays any number ofpaints cn the screen, for use in menu selection or games. andselects a point when the light pen touches it. The package in-

cludes a light pen calculator and light pen TIC TAC TOE. NeilD. Lipson's programs use artificial intelligence and are not

confused by outside light. The hi-res light pen, only. requires48K and ROM card. $34.95

TO ORDER

Send check or money order to:

P.O. Box 273

Ply mou th Meeting , PA 1946 2

PA residents add 6% sales tax .

U.S. and foreig n d ealer and d istrib utor inq uiries invited

All p rog rams req uire 16 K memory u nless sp ecified

Page 19: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 19/68

APPLE II Hires Picture Ocmpreselon

Every APPLE owner is aware of the wonderful picturesthat can be made with the HIRES graphics. A v 1 e r y ln-teresting technique is presented which allows greaterefficiency in encoding picture information, and whichleads to some additional special effects.

Almost every APPLE II owner has, by

now, seen examples of how the APPLE II

can display digitized photographs in its

HIRES graphics mode. These images

consist of 192 x 280 arrays of dots all ofthe same intensity. By clustering these

dots into groups (such as in "dithering"),

it is even possible to produce pictures

having the appearance of shades of

gray. Several "slide shows" of these

kinds of pictures have been created by

both Bill Atkinson and myself and are

available through various sources, such

as the Apple Software Bank. A typical

"slide show" consists of about 11 pic-tures on a standard 13-sector disk. Why

only 11 pictures? Because that's about

all that will fit on a 13-sector disk.

Each HIRES picture must reside in

one of the two HIRES display areas

before it can be seen. The first area,

$2000-$3FFF, is called the primary

display buffer; the second area,

$4000·$5FFF, is called the secondary

display buffer. It is obvious that each of

these display areas are 8-K bytes long.

Consequently, HIRES pictures are usual-

ly stored as 8-K blocks of data, exactly

as they appear in a display buffer. But

do they have to be stored that way?

If you look closely at a HIRES picture,

you can almost always detect small

regions that look very similar to other

small regions elsewhere in the picture.

For example, HIRES displays usually

contain regions of pure white or pure

black. In the case of dithered pictures,

the illusion of gray may be caused by

micro-patterns of dots that are similar to

other gray patterns somewhere else.

Clearly, HIRES pictures tend to contain

November, 1979

a lot of redundancy. If there was some

way of removing this redundancy then it

would be possible to store HIRES pic-

tures in less than the customary 8-K

bytes of memory.

Suppose we were to divide the display

into small rectangular clusters, each 7

bits wide, by 7 bits high. Then a picture

wou Id consist of 24 rows of 1 hese pic-

ture elements ("pixels"), with 40 of them

per row. (Note the resemblance to the

APPLE II's TEXT mode of 24 llnes, 40 col-

umns per line!) The total number of pix-

Bob Bishop213 Jason Way

Mountain View, CA 94043

els that would be needed to define a

HIRES picture would then be 40 times

24, or 960. However, not all 960 pixels

would be unique if there was redundan·

cy in this picture.

To tryout these ideas, I used Atkin-

son's LADY BE GOOD picture (from the

Apple Magic Lantern - Slide Show 2)

shown in Figure 1, and wrote a program

to extract all the different pixels. I found

that only 662 of the 960 pixels were uni-

que. This meant that almost one third of

the picture was redundant!

Figure 1: (Max errors/pixel = 0)

MICRO -- The 6502 Journal 18:17

Page 20: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 20/68

Figure 2: (Max errors/pixel = 3)

The next question that came to mind

was: of the 622 unique pixels, how 'uni-

que' were they? Was it possible that

there might be two or more pixels that

were almost the same, except for maybe

one or two dots that differed? If so, then

it could be possible to regard these as

being identical 'for all practical pur-

poses' since the error in the resulting

picture would hardly be noticed.

At this point we are allowing half of the

dots to be wrong. Since total black and

total white are always included in everypixel set (to prevent black or white areas

from becoming dotted), pictures with

MAX ERRORS/PIXEL greater than or

equal to 28 can always be composed of

no more than two pixels, namely the

black and white pixels.

To examine this possibility, I modified

my program to extract only those pixels

that differed by more than a specified

MAX ERRORS/PIXEL. Table 1 shows the

results. If we allow, at most, 1 dot to be

wrong in anyone pixel, then we need on-

ly 492 pixels to define the picture, which

is only about half of the original 960 pix-

els! As we allow more and more errors

per pixel, the number of pixels required

to reconstruct the picture decreases ac-

cordingly, until we reach 28 errors/pixel.

Suppose we now try to reconstruct the

original picture from our extracted pixel

set. Clearly, the fewer pixels we have

available for synthesizing, the poorer the

result will be. Figures 2 through 5 show

the results of synthesizing LADY BE

GOOD with MAX ERRORS/PIXEl. of 3, 7,

14, and 28. The number of pixels used in

each case was 245, 75, 15, and 2, respec-

tively. Notice that the difference in quali-

ty between Figures 1and 2 is not all that

objectionable. The advantage that Figure

2 has is that it can be stored in IE!SShan

Figure 3: (Max errors/pixel = 7)

3-K bytes of memory! (245 pixels at 8

bytes/pixel, plus 960 bytes to define

which pixels go where.)

Thus it is clearly possible to store an

8-K HIRES picture in considerably less

than 8-K bytes, if you are willing to ac-

cept a little loss in the image quality. By

using this principle, I have produced a

"Super Slide Show" containing 33 pic'

tures on a single disk. (Copies may beobtained from Apple's Software Bank.)

S ' T ' f I D J L . l - H E : L E

BIU) 8 8 f 1 1 3

B L U r 0 f : 1 . J

L U P E MP-i -'' '•• . t,. _ . .. .. ;

H E l lI 1 3 E ! ~ : ! ~ :

O V E R 9K~:1 .GOO l ) 9l)-:·r

L - l . _ : : . ; .

F .: C O N e£; :~}~i

R L U P B P 9 CL O O P et~q4·

c o r n £ 1 S e ?

IN C e E : c ?S E N l ) e B D . ~ ~NUro CIPC·1

\J~'I . . . . . .

R E T eE~F~f 1 0 V E l1f~l:~t 1 L L l P 1107CO i ' 1 P 11':;-'-"

.Lt-"_

C L U P 'I1·:·'~......l..:...

P R E P 1 1 5 4

I N I T 'I"C(.:·" ~ " " . , . . I ' , . . /

S T O F . : 1'j,;i';i."'_" ..'

> { 4 1 3" . - , . - " - ,

J

....J-I__

; ' { A T e0fi j~1I T I A T eflti~.Z A T 0 f H d 2: , ( T I J e e !32' T I TO e~l~l.:).

~ " - ' =

2 T O eH05S C ! ) f \ : 0 f j ! : ! ; : .

; ' { f 1 A . \ ; : Befj?

' T l r ' 1 A : ~ ! 3 0 ~ ; e

: > ~ T r 1 ' 0fJ09' T ' T M P 0 J 3 0 i : :

B E S T 0f1fe

A T 9 6 f l CTO e0l2j~

E R R e f 1 1 J i

x I N 1 3 6 1 : 1 .

' T ' I N 001 :2P R O f . ; 001?H G R L e C J : y j

H G P . ' r I 0 C { i l ; :

BITS 10 !~UB E L L F F 2 : H

E N D 1 2 6 : 1 .

Page 21: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 21/68

TheCompression Program

Listings 1 and 2 show the compres-sion routines (andsome associated data

tables), and require an APPLE II with at

least 32-Kbytes of memory.The routines

consist of two basic parts-the

"analysis" portion, and the "synthesis"portion.

The analysis routine ($OBOO)earches

the primary HIRES display buffer

($2000-$3FFF)and compares each pixelthere with the pixels in its own currentpixel table (which starts at $0600)look-

ing for a "match". If it finds a pixel inthe

table that matches to within thespecified MAX ERRORS/PIXEL(location

$10),it calls a match and proceeds to the

next pixel in the picture. If it fails to finda match, it adds the pixel to its current

pixel table and then proceeds.

Thesynthesis routine ($OB80)works inthe other direction. It first compares

each pixel of the primary buffer with

each pixel in the pixel table to find the

best match. It then places this pixel in

the corresponding location in the secon-

dary HIRESbuffer, thus synthesizing thebest approximation to the primary pic-

ture as it can by using the pixels in itspixel table.(Since the analysis routine

doesn't know where its pixel tableoriginated, it is possible to synthesize

one picture from another picture's pix-els! The result is usually surprisinglygood.)

The routines are very easy to use.

Simply load the picture to be compress-ed into $2000-$3FFF, set MAX ER-

RORS/PIXELinto $10, and then call the

routine at $OBOO.When the routine

returns, locations $07 and $08 contain

the number of extracted pixels in the

form: NUMBER= 1+ (contents of $07) +40' (contents of $08).

To synthesize the picture from the ex-

tracted pixels, simply call the routine at

$OB80.When the routine returns, thereconstructed picture will be in the

secondary HIRESbuffer ($4000-$5FFF).

If you have a 48-KAPPLE and a disk,

you can use the BASICprogram shownin Listing 3.This program calls the com-

pression routines (Listings 1 and 2)in a

more user-oriented way so that they are

eveneasier to use.The program displays

a menu of options that let you:

L-Load a picture from disk intothe primary HIRESbuffer

1-0isplay the picture currently inthe primary HIRESbuffer

2-0isplay the picture currently inthe secondary HIRESbuffer

A-Analyze the primary picture(create the pixel table.)

S-Synthesize the primary pictureusing the current pixel table.D-Issue disk commands.

)

November, 1979

Figure 4: (Max errors/pixel =14)

X- Trans fer the compressedpicture to disk drive number 2. Concluding Remarks

While the methods in this paper workpretty well, they may not represent theoptimum w'ayof compressing APPLE II

picture data. For example, my choice of7x 8 dot pixels was somewhat arbitrary.

Is it possible to get better compression

ratios bychoosing smaller (or larger) pix-

el sizes?

None of the selections require you tohit RETURN;just hit the correspondingcharacter. When specifying "L", the pro-gram will ask you for the nameof the fileto be loaded. Whenspecifying "A", you

will be asked for the minimum error per

pixel that you will allow. (This does re-

quire a RETURN.).The "0" command

will give a colon (:) as the prompt

character and will allow Y O ' J to issue

disk commands. It will continue in thismode until you give it a null command

(hit RETURN)at which time it will return

to the menu. The "X" command savesthe compressed picture (960bytes) and

its corresponding pixel table (up to'2K

bytes)onto a disk file. (Iwill leaveit uptothe interested reader to figure out howto "un-compress" this data.)

Another interesting question is:Given

a picture that was reconstructed from a

givenset of Npixels, is it possible to findanother set of N pixels that gives a bet-

ter result?

I hope that these unanswered ques-

tions will help motivate someone else in-

to joining the investigation of HIRESpic-ture compressing methods.

Figure 5: (Max errors/pixel = 2 8 )

MICRO-- The 6502Journal 18:19

Page 22: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 22/68

500 max errors number ofper pixel pixels

0 6621 4922 3343 2454 178

400 5 1356 1007 758 53

CI) 9 44. . . . .

1 0 34L IJ

~1 1 29

300 1 2 24IL . 1 3 180 1 4 15a : : 1 5 11L I J1 1 : 1 1 6 10

: : E 1 7 7;:, 1 8 7~

200 1 9 620 522 424 426 428 2

100

0 5 10 15 20

MAX ERRORS/PIXEL

: AListing 1. 0E:34 ; !~ '3ef~j .~ J 3 2 ~ 3 f J J S F . : f 1 0 V E

OOi0 : B U I L D pn~E.T A B L E 0837 A 5 f ) . : : ~ 8 2 9 ( · 3 L D R * : ) ~ T O0 0 · : > 1 ; : - IdK;9 f~5Jj7 K 1 ( - ) ! : J S T A * > : : f 1 A > : :. . .. . _ 5

0I:n0 . O f . : OB t ; H m : n B A : 5 - ! ; f 4 K~1 . o L D ! i * V T O0BOO ~:B9J: i. l e~}';i·f:i B I l . D J S F . : HUT 0B:~f! :~~5~~B e : · ~ : : . ~ J 3 S T R * \ ' t 1 P . : > ;

. T u

080.3 AS l e H 9050 L e l A H H ~1B:iF Ef;~~g K r : : ' ( 1 G O O D lN C : f : : ~ ~ f · ; " r

eBre 8500 0 0 6 ( - ) S T A * > ; F 1 T 084:~ F ! 5 ! ? l : j Ri' l · ( · j L D A : { < ; > : : A T

e8e? 8 5 0 1 - 9r:F'0 S T A * ~ ' f i T 0843 C : 9 ? H e ~ ? ' 5 ! : ) C M P · · . . - .I_. ~.f;.'

0809 A 9 9 1 0 1 3 8 0 l e l A &~'i 0845 D I ; n - l 13.~:60 B r · l E 8 L U PJ",-

0BBB 85e2 00913 S T A * Z R T ~1B47 H g e H 0 3 : ·7{. j L e I R ~~ ! 3

0800 A 9 3 . ; ; 0 1 ~ 1 1 3 L D A H 3 0849 8 5 f . i r : ~ e~f[!j:J S T R : + : : ~ A T

080f 8585 8 1 1 1 3 5 T R * Z T O € 1 E : 4 B E6Hl 0J9f ) I N C * ~ I A T

0811 A 9 0 H e1·J~' B L U F ' U ) A H e fiB4f.' A~-e~i 04013 L f , I A * ~ ' A T. . . . . . . . .

0813 "58- 91313 5 T A * > I T O 0B4F C : 9 1 . 8 0 4 1 1 : : 1 C t 1 P 1 B. _ .j

0815 8 5 9 4 0 1 4 1 3 5 T R * ~ ' T O 0851 [ : { i C E 0 4 · 2 J 3 B N E E U J P

0817 2 f 1 2 3 1 1 ; · 0150 L U P E J S R C O M P 0B53 4 J : 3 A F t - ~ l 3 4 2 H J f 1 P B E L L081t1 ASi0 916H U ) R * E R R 944e

081C C 5 9 6 017f.f C M P * S C O R 9 4 5 H : R E C O H S T R U f . - : n O , . 1

081£ Bt~F 0 1 8 1 3 B C S G O o e l 8468

0B20 A 5 8 3 0 1 9 1 3 L D A * > - . ' 1 0 9478 . O R 08800R?2 C~7 92ee C M P * X M A > { 0BBe A g e e 948H R C O N L e ' A s a0S24 D e 9 6 9 218 B N E , . E X T eB82 8 0 5 9 C 0 94ge 5 T A $C0S0

0826 A 5 e 4 9228 U )A * ' r ' T O 0BS5 8 0 5 2 C 1 6 0 S 8 H S T A $ces~~0B28 C 5 9 S 9230 C J ' I P *\'f1A.~ f l B 8 : 3 8 D 5 S C 0 0 5 i H S T A $ 1 : ; e 5 5

0 B 2 A F e e s 9 2 4 0 S E Q O V E R e B e s 8 D 5 7 ( : 1 3 es~~13 S T A $C057

0 B 2 C 2EJ19B 8 2 5 e N E X T J S R t - I J TO 088£ 8503 e 5 z e 5 T R * X T O0 B 2 F D e E 6 826e Bf£ L l P E 0Bge 8594 9 5 4 1 3 S T R * V T O

08 3 1 28=188 8 2 7 0 O Y E R J S R N J T O 0892 A5~P gCC.··l L D A r o.J.JI:J

18:20 MICRO -- The 6502 Jou rn al Nov e m be r, 1979

.•. _ •.••• , .L..

Page 23: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 23/68

08940896f 1 B 9 ' a

0B9A089C1 ! . 1 B 9 f~ : . 1 B R 1 30BA2~ 1 B H 4

1 ! . 1 B R ?1 ! . 1 8 R 9

0 E : A B1 ! . 1 B R Of 1 B P F

0Bf:t1 ! . 1 [ ; B : . ~ :~jBB5~1BB?

f 1 E : B 9

0f:~8PJ ! . 1 f 3 e D~1Brtl 1 f . : : C i

1 ! . 1 B C 3~ . : . 1 [ : C ~ :

~ 1 B C 71 ! . 1 D C : i~ 1 B C 8f j B U : '~Jf . ! cr~ 1 S D : i _

1 ! . 1 B t ; ; : : ' ~( 1 E : D 5

~ 3 B 1 Y ?

1 ! . 1 t ; [ ; 9€ 1 B D B

0 B D D0BDFqJ:,[.)~.i.J ~

~1BE50B£80BEA0BEC0BtE

0BF10BFS0BF50BF70BF90BFBf 1 B F D

0BFF

8 s e E . ~A g e H8 5 f } H

E ! s e 1 .;:.i~;,:, j~.' ::;,;.

E : 5 H 5

A 5 H tC 5 e Bf : : H O Hf .~5t~F~C:.f.~l.~, · 1 · _ ·· _ ··. -

~:;5H9A5ttjf ~ 5 t : J : ~ :

R5f}~~~C~St:~?r o , l~~!:f;l.' ._••.••••

f~5JJj.

c~:Jj~'1 - 0 5 : ' ! : ~

F . f J : { · ~f ' : ~ _ : : f F

C : 9 : ~ t ; : ;

r'~9{~!:'~: ~ ~ 5 ~ ~ Q :t~E:;i:~tf)HP~.

A ~ ) ~ = ~ : : . ': ; ' : : 5 1 3 0A 5 1 : ~ P

f : s e : f .AQj:P• \ J.

f . ! 5 f 1 ~ S

~~t~~~}:"i.~ t

: ? f 1 e H : U .2eFl !3Cf i5H4

C918D W : : B4C~f !FF

E6e3~JnC 9 " 2 Hf l O O t :Age085fjJE f . e 46H

November, 1979

S T R * Z A TRL IJ P U)A 0FF

LC l f J P

S T A * B E 5 TL l ) A 00S T R * : ) ~ H T

5TH *V HTL D F I f hC.TA *Tm"r~ a . . . ~ . _ ~

. J S F . : !:f) f i~f '

L D AC f 1 P

* 5 C O R*Pi=CT&...&,.~ •• I t

E :C 5 C O N T

5 TR *BE,TL D A * > {A l5TH *>{Tt'lPL D A * w nS T R : ~ f 1 i T " t ' i f '

C O N T L~)fi* ~ ~ ~ 1 1 T( : f ' l F : : 1 : > ~ t · · i R : : <B to 4E IN CLt)A :.~~if:-!·C t 1 F ' :+ : ~ ft :· tH : ~ <

B !:O S E r '~ D"ft.ir·_ . _ , ,.. . IN C : . ! < : : . ! { ~ )-f

,••: I

Ll)f;~ : ~ ( : ; : : f 1 T, ..t4P · · · u · "'.J1 " ,.:.':.:

t ; ! · i E · : L f ) ! J F ~L[:I!~6~)":TQ.. : ,!

I N C *t , . IATt • ; ~

L O O P:¥ .l~n '~F': t : : ) ~ f i l '

* V T t ' 1 P

*l. , . iATI ~ 1 I

e ~ :

5 T A

LN~

5 T AL D AS T R * 21 0JS~~ S T O F . ~

. J S F . : t 1 ( ~ ' / EJS~~NUTOU ) A - v r oC M P 1 8B N E R LU PJ M P B E L L

N U T O 1 N C * l { T O

L D A * XT OCMP 28B N E R E TL O P . a sS T R * > I T OINC * \'TO

R E T R T S

:1.10131101.111321102110411@7

11£191113811001:1.9F1111111111.151:t:i71~.t3l : : i . : t B:t:t1C111£- 1 .; ·ir_ o " . ,. : . .. . : : . . l

:ll.2G·i r,')-'I...~,.. t. '-....:..

11231:1.2411251:126

1:1.2"1112 '11112C112£11381.1321134113611:38113911SC113£11413

1142114411461148114R114C1140114F11~

: : : 8'4~;

98482 f ; 5 4 1 . : 1 .A 4 f W l

f ! j . . f ~ CA4939HlEA 5 8 f )

6 9 H 4E : S e D

A 5 f 3 Ff . : 9H 4E~S€f'

e R

po00"

,1 8

9 f!48

2 1 : f j 4 3 . 1Agee85%A 4 f j f j

B l e eA 4 f . l i~ ; 1 f . 1 E297FA 88ge010

656685H6A 5 £ < t '

6ge4850!)A50F690485eFC AD e D F

68A S

MICRO -- The 6502 Journal

11')1~. . . .11sH1 1 4 1 3115131 1 6 1 31 1 7 1 31 1 8 i 2 l1 . 1 9 1 3

1 2 1 3 0

1 2 1 01~'2t~12~O'1~?4H:i25fiL\601 2 ' 7 ! 3i~'!~:!f:J12901 . 3 1 3 ( - 31 .2 1 J 313:~~('J123:0

1 3 4 · 1 1j.Z5i;j

i 3 6 e1~?!313 : :~01~Ql:l•• J_.....

1 4 H ! J14HJ14·~ ' i314 :30144~ : )1'~~)J:3

l 461J14?t114H! j1 4 9 1 3

1 5 6 0

15tH1 5 2 1 315~fi1 5 4 1 31 5 5 £ 11 5 6 1 31 5 7 1 31 5 B 0

1 5 9 1 31 6 H 01 6 1 . 1 31 6 2 9163(3164Jj165f}166131 6 7 0

P H RnlA

P H AJS~: PPEr- '

t 1 1 . U P l . D ' T ' * > ~ f n

L D A ( A T ) . ' \1L L W * X TO5TA (TO ); ~t

L D R * F lT + ! 3 1A D C o ; ~ ·5TH :f:F ;T +0lL [ ) H : + :T O +01Ht)C: {~3~·

S T A * T O + B 1r,f,:ll"J••;1

ti'~iH:~-1 t; ••••••,

PtRT R VPi ~I :.. IJ

T R : : - (f : T S

= C C ~ f t i P A ! ; ~ E P I : ; < E L: FiT X /F., wrr, 2 ' H T

: T O : ~ ·~ : T O. { l TO , l Z T O

C O ~ 1 f J T : : - ~ f ~

P H An'AP'H~. .J5F.~P~~EP

5 T A : i ; S C O Pu. I F ' L I ) I . , ' * : i : : f 7 1 -

L D R ( A T ) ; 'T '

i o v * } : : T OE O R ( T O ) ; 'r lA N D 7 FT~ 'L D R B 1 T ~ . } vA D C * S C O ~ ~S T R * S C O PL D A * A T + £ 1 1

A O C 0 4S T R * A T + e 1U ) A * T O + 0 1A O C 0 4S T A * T O + £ 1 1

D E XB N E C l.U PP l AT A Y

18:21

Page 24: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 24/68

:1 .15111521 . 1 5 3

11541156115711581159l1SA

11SC1 . 1 5 £: 1 . : 1 6 1 31161116211631:1641:166116:3: 1 . 1 6 H116B116C

: 1 . . 1 6 1 )j.16 £1171Li'l1117611lS: 1 1 . 7 F 1117e117E1 1 . 7 F110011:3j~1182

1185118?11~110Cl1SE1 1 9 1 31192

119311961 L Q 8

1198

119£11At1 1 A 4fiR?l1RAl1ro11001 1 8 21 1 8 4

18:22

A A6H

A $ . 1 2

6AE ; A6AE : P:?96e

8 S e ! )H 5 f . i 5E J {6H61if ;A2 9 6 ( 1

!:~~1&f"

R 5 e i1 3 RO R

H A

Hf:E!f)06f,(:

~~5HCE!i)f~0ti[)")(~#i ~(:.••."1

6 5 € i i )

8~:6t!f i 5 H 4

A AE:t!0fH)~

B S H EBDe~3~j l)291Ff . s e F85eFft~e860

2 O C 0 f ' ! CA 9 7 FB 0 0 1 s e8f)!.)164

8De1t .~S8001( 'C8001708001?4Wei?SSW1?GA9008 ' 5 £ 1 8Age1

16f}H1 6 9 01 7 & . 31 7 1 . 01 7 2 1 31 7 S ! 3

1 7 4 01 7 5 i 31 7 6 017("0

1 7 B 01 7 9 1 31 8 H 0i8j.fl18;)~"B"'~....'t:~i 8 4 !~118~.lH18601 8 7 H1H801 8 g e

1gef .~i9~i .131 . 9 ~ : ' J }';Q":~I~. .J. ~" \ • •' _

j . 9 4 { 3

1 9 5 1 3196~J19::'01 9 8 0' " ' ;:QJ :i~ . . . . -. '..'

P L AT A : <~:T5

L D A * Z A TR O RR O RR O R

R O RA N D 6 e5 T R * A Tl O A * 2 T OR O RR O ~ :

F . : O RR O F . :AND 6eS T R * T OL D A * ~ t P .T

R S t .fiSt.A S t .

+ 0 1

+01

T A : ~ {L O A H G R L xS T A * A TL O A H O P ! - ; ; > ~AN I) 1FADe *ATS T H =nL D A * VT O

+ 0 1+01

f f S L

A S LfiSt.T A > ~L f . t H H G R L X

S T f I * T OL D A H GR H ; > ~A N !) 1 . FA D C * T OS T A * T OLD>{ 08R T S

+0 1+01

I N l T J S R $ e C C ~ iL O A 7 Fe T A $rn'-~•. . ; J . . °t:'t!t,J.,

S T R ! 6 4 e l

S T A $ 6 8 0 1S T R $ 6 C ~ i lS T R ! 7 ¥ ' J 0 1S T R $74~1S T A $?801S T A $7ee1LDA 005 T A * ' I f ' ! f ! XL D A 0 1

1 1 8 61188

12001 2 1 M1 2 0 212941·..11-.;:I;t.

1 2 J 3 B1 2 8 F :1,)·"1',~.'!)t.

1 2 ' 1 j f "

12H1·..· - ·. : : . . : : .

12141 2 1 61218. ; ·1' !i=1. . ~ a :. .. .& . , ~

12:tC1 2 : 1 1 :j22H

1",)-:"~,""' .'12;?512271229:i:;'2f~-i '::":f.'. .. .. ... .. ' 10 . ~ '

122C1 : ; ; ' 2 E1 2 3 0 ,

1 2 : ? . 2

: 1 2 3 41236123ei23P: i2~:C: 1 : ; : ' : : ; E12 4 01 . 2 , 1 2

124412 4 61 2 48121m124C12 4E1 ~ ? 5 I 3

125::1254lZ£1258125f!l~"SC125£12fJ3

85876 9

9848A 5 e 1b~l1A s e 4~'122~~~(:1.;~'ASi]b ' 5 0 El BASH6 9 E : 6£ ~ ! ; - e ~ -

A S t l e lssnQC.iA·'!1 ' . . . ·• . . . . . . . . . .

E : 5 1 ~ · :

f 1 ~ ; t . : : :P ' ! . 3 f ' 6

9 1 . 0 Eco'.J.....

( ~ : f 3~ : . C . ; ; · : . l~ 1"":": ••

HU?~ } f 1 : q >

: :~£~ . , ?

f1~Sl.,~~1 3 6 1 2; 2 6 1 4

6 6132 6 1 4 -6 5 1 3~:~~".~, . " . _ . _ . _ , . . . ..

A S ! 4E;gef~

H 5 1 4fiSHf~5]J.~~;51~~F 1 5 1 469~08 5 1 4

6H

M IC RO -- The 6 502 J ou rna l

,

· ' . · : t · : ) I . : ~. . . . . ~. . . . . .

2 l f · f ~ r · : :

~:'I-:;'~!~?

2 5 " H ' : i.~(:;r.:~::;'-, ..

~'~)el:.~25~~:fe~· · U : s ' . : ; t '. : ;. . . ' '..

26:::~r~~ : 1 : : ~ . : ; : 1 ~ ~

2 6 " ~ f · i 3

STR·~R T S

O R 1 2 0 £ 1S T O R T V A

P H RL D A * XT OS T A * > ~ H lL D A * V T OS T R * ' r 'H JJ S R > { 4 0U ) A * P R O D + f f € ~S T A * T O + 0 0

e t CL D A * P f t ~ O { H 0 1A D C s a5 T A * r o + E . 1 1L ! ) A * > { AT

5T!~ *X INL D A * t . l P T5 T A : { < 1 ' r ' J N.J~.F~)~:.:}~:

L!)f: : f : ! : ' I P O { )L[)t/ t~~:~~

CTO_;j f

U)e5 T RA9. .~~OLA S : : f f" .. ';..

: ' ; · : F f ~ C f { )

'il;,·_ '·c'

: { - :F t f . ; . ' ~~ . i f ~ I .~ . I ?.

: {-:ppri~)

;{.:t::i.~l1P, ....: ; { - 1t 1··..•.....·".'....

:{a:!:lrtnr·:I j ' _

R ~ : : L : { · :F~~{~C;

ROL :~P~'PC"f0:1.

ASL * f-1i~O~)~ :OL *PRCfH·~ t1AD( : :~P~~C~~: 'S T R : ( < P ~ ~ O r : 'LI)A :f;t'R~Jr)~·f~lA ! ) C 0 f !

S T R * P P O D + ' ~ ~ 1 .L D F :R C t e

5 T HL D Rf l OC5TRR T S

* F ' f . ~ C f [ )* ; ; : ; I N*r..'!;·i,i·;, '

* f - R O f : ' + f t t€~f i* P E : m : H · ~ ~ : 1 .

N ov em be r, 19 79

Page 25: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 25/68

2 8 ] : J e ~

2 ' B : 1 . f ~; ? a ~ : ' l ; : )

2 8 3 ] : 5

2 B t ~ : . ~ : ~28~:~~~286028?~~2 B B P.~\-..':''::O_'~1

29f t~~2 9 1 . H')Q'::O~1 0 - _ ', . . ' -"· ) Q - : : · t : ~. . _ . _ .

2 9 4 1 32 9 5 H296f i2 97 029~~'2 9 9 @3800

30 j . 0- ' 8 ' - " ' ".. , . ...,. z- _.

~,:~-tt- I :: ,j

Z T ( l

S~~(Jfi~: ; { M r · ; ; · ;~ l r 1 A ; - : :

'~!j'MC'tir i tl

V T r 1 F '

B E S TA TT O£ K : F . :: 1 ; ! N

V I Npori;',t , .

HG~:HB I T S

B E L LE N D

1 3 0 : ' ; 1 . : -

9 D 4 ( - 1 -

13048-0 D 5 I 3 -I!.lfr5f-0 D 6 1 : J -0D68-0 D 7 H - 'e[I{8-

m ! B ! 3 -

0DS:~-I~I'IQ!~-·Ul·'..I'.i

W : ! ; ~ : : : : :

ef~~??C " ~ C - : ' c : ~_ . ._ _ .

L f S ~3'~J?S 'n c : ~ , , ' , : : ,...._ '_"_ '..'i'

D~;0e :0 : :~D S 0:~:?i::O S H(lf';~05 0fl1f~C rL 9 :0 :1 .1

DL 001~:l)' !A I ?, , ! - .~1 . -' _ . _. '. -:• .• .

05 0Cf':~~! ) : : I e[)~ii?o s : 1 ~ ~ ; ~ . :

1 3 1 ) 9 8 ' "

~ 1D f ! ! 3 - "0 [ : f H 8 -0 D B t ; } -HD f : f ; : · ,

1 J j ! j r 3 -

1 1 3 1 3 ' ( : : "

1 1 3 1 0 - '~W:18-1 e 2 1 3 - -. 1 . . 1 3 2 8 - -

1 1 3 3 H - "1 H J B - '1~3 4 0 - '1 . 1 3 , i 8 -1 1 3 5 1 . : ; -10SS;. .

1068-H¥;3-

1 1 3 7 1 3 -

1 e - n ; -

O SE N

!:::~?~l, t "_: ~

Listing 2.

0000-1~1\o1C,J::Jl"lfXI-

1 3 0 1 1 3 -13018-e02 t3 -0D28-1 3 0 3 0 -

28 24 28 :?C2 6 2 4 2 8 2C:21 25 292 1~ '2 ~'6 :?A22 ~~6; ~A23 27 2B

~:3 : z r~~It1~r~tz . : 1 3 ; ~ ' 4

. . . . . - .

.; .:~-eo_

.:l'J1

34

'~'i:''.:ti

2( :3 C3 D3 !)

3£~~~!E3B 2F

3 :8 :.~F:'v "~i '"'Jl._~ .J••••

3 D3£3 E7 1 = '","I

2 B. . , . . , .-: . . ;.

f~ e 01. l 3 : 1 1 3 2 0 i e~~1;~I)]1 3 1 0 ~ 1 13 ;~ 1 3 3 f}~ ft3 f(3 f J 4

f:i g~:1 3 2 ( .( ; : 0 2 ' f~2 K ~ 1 3 4f;2 e .? 133 ~ :j4 fi J f ' - 1 € '4 0 50~ 0;;:: ! 3 ; ? (E £ Q e . ; ; ; ~ c 84H2 0 .?: 133 fH m f~ 4 1M 051 3 2 I n 1 3 3 ~)l:- e : s 1 6 4 1 ! 1 4 0 503 04 1 3 4 H~ ::H4 05 ~j: J 61 3 i €q ! 3 2 1 3 2 0 2 f C fC 0 4

1 3 2 ~ i 3 1 3 3 1 3 4 02 : 0 4 E 1 4!}2 03 133 1 3 4133 134 134 05

0J 04 € 1 4 0504 0~~lj5 1 3 6

< ) . ,{. . . .••••_ e .~ 1 3 3 H 4 0 3

1 3 4 ( , ) 5 e 4

1 3 4 05 0 43 041 3 4 0 5 1 3 : 5 136 0 5

Listing 3.

e R H ' ! t ~ R I T T E N E V :10 o HI A$'::4 {D2 e

130 PRwrR E F F .:O t1

1 4 0 P R H I T P R HIT" AC T U F £ H IT O P n~£LSII

150 PRWT P R I N T II 5 9 rINTHESIZEP IC T U R E F R O f '! P l: < E L S 1 1

16 0 PRm T P R I N T " 1IG H IA L P IC TU R E "

1 7 a P R IN T P R IN T II 2 - D I ~ , p L H ~ 1 S ~ !N T H £ 5 I Z E D P I C T U R E "

-)Q. . . . . . .

?C ',~.. .

P R I N T " M £ N !_I"

PR I N T " - - - - - - - " . P'i;'l ~lT1 · .. .. .. " 1. 1

P R I N T II

I) ISK"L L O H C t P I C T U

A N A L~ 'Z f P I

DI 5 Ftf! ~' OR

Page 26: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 26/68

1 8 1 3 P R W T P R I N T II D I S : : J _ l E D 1 5 KC O M r 1 R t - H ) ~ 1 I,t ... 1 . _

i - Q J 3 P R H l T PR-V( II X S A \ , ! E C O M P R.~,Ecce-i' P I C T U E : E T(' C l1 5 K II_:_f ...~} , . . . .]

i - Q 5 \ l T AB : ~ t J 3 : I P R I N T I I S £ L E C T I O N : II

2 e l 1 R " · v.: l > f o l " " I J E < , w r ,. . . .. . . r l ••• ~_ I." 1°•• _ t .. . . . . , I~·.W

2 1 8 Cl-'ilR~ PEl K (-1 _6 -j84 )

2 2 1 3 I F CHJ ~!~·:~<3 -rHE·~!~t1J3

2 3 0 POKE -t6- ..8 · ;- :- -! j£ ;03 0 P 1 D = f 1w

3113 TI: CH!: ! f~~: .ASC("L It l T H E N TI'I: : :1_I , J.I./ _\.

3 2 1 3 I F Cf--::~~~~~:·~~C("fIll ) T I - f [ r - l 1r-i::~').Jol. "-_

3 ] 3 Tj:" CHf~~~~-::;!Ci-'(IICli ": ; T r - ; E : r ) iP;... . 0 : -J , , , _»v r '. _, ~" . . . . . . . .

3 4 1 3 " - 1 = CHf:fF~~::A : : - : C : ( ill.H) Tpq .i J . D : : : ~ l. ;1,.1 ...1'.

3 5 1 3 ','j:" CH ! : i F . : ~ : : A : : : : C : ( n -: : _s ff ; - T i - i E } , f T r " I · - C .;. , .:.i.·-··.. ,

3 f J 3 IF CH:~!~~l~'{:'::i D II ) Ti-!~t.l Tt\--C,.,t .•o• J. t. ," 4 " ~ _ .

3 m I F e~~ff i i \~:: A : : . C : ( n: ,, {t t ) T H E [ " ~ 1n : = 7 - -J o " f

Ii

1 1 3 5 0')1'lI:i'1~t;.IQI;.

2 8 1 1 3

295e G O TO 1 1 3 0 I

. , .M I : : t \,ITAB ' )l lWTAI:. ! 1') ' P " I N T II~Ltt.ITHI:. ';::1•..)I!"JfJI!' •• C I_I:;)· r:~ ..... ~". t _1.4 ~._ ..

Z E Ple TI E"":'th~ prwj:" 1L"j.~ ;t Q P • ! ( " j : ' - 1 - - . . - - ,~.,; ~lf'.... _. o-.RIt:~;t,l: 'lI..r. - ...0~:!.;',

9: V TAB 22: rat. -958

3910 FOR K=1 TO 508; r £ X T ' K3928 IF flAG THEN385€13 9 3 0 V T R B 2 2 . : P F ~ I N T " T f £ R E A R E N O P IXas D E F I N E D ~rT!"

3940 G 010 3060395e CAlL SYN~I :)~FlfIG=13 0 6 0 P O K E -16384+16; 03070 IF PEEK (-163S4){128 THEN 3 fq g

39Se IF PEEK (-16384)= A5C( 11111 ~I T H E N

2103&~ IF PEEK ( -16 3 :8 4)::: A 5 C ( 1 I 2 1 1 ) THE~~

2103$) 13 0m 1~ 3 0400ft POKE -,16 304 .. J 3 : POKE' - 1 6 3 ! ? : ~ · : ;

0: POKE - I t ; : : : : e 0 J e . POKE:-1629710

4 0 5 " 1 3 e c r o 2 1 3 05~313 POKE - :162134; 1 3 : POKE -16 .3 l~~: ;

0: POKE -16 ;~'5'9, 0: F'O I~:E-:1.6~:9?10

ssse !3 0m :2i3 3\ /TA8 ;~! 3 : T f1E~1~~ : CALL -9~:t!;P Ol ,,11' '1I\I(~I" r'!'lt(;M!4~li'fIi'·.4j~ r II _ o °0 " . _ o , ~ , 11;:Th"

P O K E - 1 6 : 5 H ~ ::_ ,1 3 : P O K E ·-j. f.~W?.'1 3

6 1 3 1 0

6 1 3 1 56K~j

I , l T A B ; ~ t : ~ I : I ~ ~ r : 'f J T II: I t . A ! 1 $ ·I F ' A $ : ! : H II T H E N 1f~€i

\ lT f ! B ; ~ ; ~ ': T A E ~ 2 : F'~:!r:~Tifi.; ft$

6(016 !34 0 130m E,Bl€ l" ? f i 3 ( 1 f ~ l T H F ;" 2 i 3 = T F ~ f ~ 1 ~ ~ = C F H _ L ·"9~-:i}?:

P R l ~ 4 T " 5 ' : t \ " £ - : C O M P PE 5 ~ .E D P I C:T!)~~Ei

o

7 0 4 07045

79 50 13 0m 10 !]7003 V TAE:;~2: IN PUT IIFIL E N F l t : 1 E :

J H $

71.365I F H i :::" II THEN 1Hi7 8713 CAL L PRESSlese \ l T AE : 2 ;2 : P ~ ~I~ !T E ; S A \ i E IIj R$. :

II A $ : = : ~ j ~ ' : . H ~ JIfi 9f0+2+8*NUf'1£H::.:IIJ D 2 "

7 8 9 1 3 e o r o 1 0 0

Ii

Page 27: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 27/68

\;

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .• •: Safl:ware far I;he Apple II ~~.:~:• <id 0 •

• •• •• •

• •• •• •.~ :1 •

• •• •• • •• •· :• •S C O R E : 1 0 S S C O R E : 1 0 S • •

ULTRA BLOCKADE- the standard against which

• DYNAMAZE-a dazzling new real-time game. You other versions have to be compared. Enjoy Block- •• move in a rectangular game grid, drawing or erasing ade's superb combination of fast action (don't be •• walls to reflect balls into your goal (or to deflect the one who crashes) and strategy (the key is •

•them from your opponent's goal). Every ball in accessible open space-maximize yours while min- •

•your goal is worth 100 points, but you lose a point imizing your opponent's). Play against another •for each unit of elapsed time and another point for person or the computer. New high resolution

• each time unit you are moving. Control the speed graphic:s lets you see how you filled in an area-or •

•with a game paddle: playas fast as ice hockey or use rev,ersibility to review a game in slow motion •

•as slowly and carefully as chess. Back up and re- (or at top speed, if that's your style). This is a •play any time you want to; it's a reversible game. game that you won't soon get bored with! By

• By Don Stone. Integer Basic (plus machine lan- Don Stone, Integer Basic (plus machine language); •• guage); 32 K; $9.95. 32 K; $9.95. •

• What is a REVERSIBLE GAME? You can stop the play at any point, back up and then do an "instant •• replay", analyzing your strategy. Or back up and resume the garne at an earlier point, trying out a different •

• strategy. Reversibility makes learning a challenging new game more fun. And helps you become a skilled •• player sooner. •

• •WORLD OF ODYSSEY-a new adventure game utilizing the full power of Disk II, which enables the player •

• to explore 353 rooms on 6 different levels full of dragons, dwarfs, orcs, goblins, gold and jewels. Applesoft II •

• 48K; $19.95 includes diskette. •

•• PERQUACKEY-an exciting vocabulary game which pits the player against the clock. The object of the ••game is to form words from a group of 10 letters which the cornputer chooses at random. The words must

• be 3 to 10 characters in length with no more than 5 words of any particular length. Each player has only •• 3 minutes per turn. The larger the words the higher the score. Applesoft II 16K; $9.95. •

• APPLESHIP-is a naval game in which two players enter their ships in respective oceans. Players take turns •• trying to blast their opponent's ships out of the water. The first player to destroy their opponent's ships •

• may win the game. A great low-res graphics game. Applesoft II 3:2K;$14.95. •

• •Available at your ProgramsAvailable on Diskette •

•local computer store at $5.00 Additional •

DEALER INQUIRIES I"IVITED• • Check or Money Order .'

Call or write for our free • Include $1.00 for

• SOFTWARE CATALOG POftTEH§tJFT. INC. shipping and handling •

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

•Apple II is a registered P. O. BOX 157 • Master Charge and VISA •

trademark of PITMAN, NEW JERSEY 08071 orders accepted

• Apple Computer, Inc. (609) 589-5500 • New Jersey residents add •

• 5% sales tax •. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 28: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 28/68

AIM/SYM/KIM

UPPER/lower case ASCII

128Additional User Programmable

Characters: GRAPHICS·

SYMBOLS·FOREIGN CHARACTERS

Programmable Screen Format up to

80 CHARACTERS· 24 LINES

KEYBOARD and LIGHT PEN Interfaces

Up to 4K DISPLAY RAM

Provision for2K EPROM

Provision to add 6502 for

STAND·ALONE SYSTEM

ASSEMBLED AND TESTEDWITH 2K DISPLAY RAM

VID E O P LU S : $24500

Page 29: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 29/68

A ssem bly L anguage

A p p leso f t R enum ber

Alan D. Floeter4333 N. 71 StreetMilwaukee, WI 53216

While there have been a number of programs publishedfor renumbering APPLE BASIC, most have been writtenin BASIC and have therefore been slow. Here is a ver-sion written entirely in assembly language . very fastand very easy to use.

Chuck Carpenter gave a program inthe May, 1979 issue of MICRO forrenumbering Applesoft programs.Although this is probably adequate formost needs, there were still severaldrawbacks. Among these are the follow-ing:

1. User must make changes in BASICinstructions when the new linenumber has more digits than theoriginal line number.

2 . I t is written in BASIC, so therefore,slower than a 6502 assemblylanguage program.

3 .The program will take up the sameamount of memory, rather thanreducing its size when it is possi-ble.

4 . User cannot specify only a portionof the program to be renumbered.

5 . The program did not work for alltypes of IF-THEN statements.

J

November, 1979

Being a software person, I found it dif-ficult to turn down the challenge toanswer these deficiencies. The resultsof my efforts are contained in the follow-ing assembly language program.

To load the program, type in the hexnumbers in the disassembled listing.This is written for ao32Kor larger APPLEsystem. If you have a smaller system,you can go through the effort ofrelocating the program by hand. If youdo relocate, be aware that the symboltable is stored at 7000 and continues asneeded, using two bytes per linenumber. (A cassette version is available

for $5 for any size system by contactingme. Make sure you state the amount ofmemory that you have. I will also giveyou a copy of this program at any otherspecial memory location if you have aneed for this.) Record from 6COO to6F9C.

To execute the renumberer, load yourApplesoft program, Hit reset and loadthe binary executable renumber pro-

MICRO -- The 6502 Journal

gram. Type: 6COOG.You will now see aflashing cursor. Enter the line number inthe Applesoft program where therenumbering will begin. Then enter thenext statement number you do not wantrenumbered. Final ly, enter the new linenumber to start with, followed by the in-crement between line numbers.

When the program is finished, (nor-mally under 30 seconds,) type: OG, andyour program is renumbered. You cannow record it, or continue developing itas normal.

An example of executing the program

is as follows:52 (Start at line number 52...)512 (And stopping before line

512...)60 (Renumber, start with line 60)10 (And go in increments of 10)OG (And carry onlj

18:27

Page 30: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 30/68

0(;00-

oCv",-

0(0:i-

oCU7-

oCO'l-oCUll-

oCOO-oCIO-

oC 13-

oClo-

oC 1 '1 -

oCIC-

oCIf'-

oC",2-

oC",:i-

OC",d-o(",ll-

oC",c-

oC31-

oC34-

oC31-

oC3A-

oC3U-

oC4U-

oC43-

OC40-

oC49-

oC4ll-

OC4t-

oC:,U-

oC:iL-

oC:i4-oC:,o-

oC:i'l-

Ay dU

tJu 103 01-

AY 00

tJ:i ,.. :C

Ay o ztJ5 HJ

20 ttJ oU

AU f4 01-

tJU 1 0 I 01-

AU f':i 01-

tlO I:ti Or

LU I::tJ oU

AU 1-'4 01-'bU f5 01-

AU I-? 01-

tJLJ to 01-

LO I::tl oU

AU I- 4 01-

aU r'1:: of

AU I-:i 01-

tJU f'1-' (JI-

",0 lOll oLJ

AU 1-4 01-

tJU r'C 01-

AU 1-5 01-

dU t'U Or

AY 30

dD tJ 01-

AY 10

b:i fl-

AY 00

d:i 1-1::AU 1-1: 01-

oU 1-0 or'

lUA

S T A

LUA

::.,fA

lUA

::.,IA

JS HlUA;:ijA

ll)A

Sf A

JS "

lUAS[A

lUA

::. ,IA

JS "lUA

S I A

lUA

;,IA

JSrl

luA;,jA

lUA;,jA

LUA;,j'A

LUA

::"]A

LUA

;:ij'AlUA

;,IA

IISb0

>01-1::3

#SUO

>1-1...

IISU",

>I-u

SoUl::b

>01-1- 4

>or'1: 1

SoH':'

>ol-to

SOUl:d

>ol-r 4>ol-t:,

So fl-:i

>ol-to

SOUl:b

>oi-l-4

>01-1' I::

SOl-r:i

>01-1-1-

SoUl::o

Sol -I - 4

.01-1-1...

Sol -I - ~

.0I-rl.J

1I.3U

Sol-1:3

IIS1U

I£>UO

sfl:>01-1-1::

>01-1- 0

EPROM PROGRAMMER

Model EP-2A-79

SOfTWARE AVAILABLE fOR r-e. 8080, 6800,

8085, l-80, 6502, KIM·1, 1802, 2650.

EPROM type is se lec ted by a pe rsonal it y module

which plugs Into the tront of the programmer.

Power requueme nts are 115 VAC. 50/60 HZ at 15

waits. It is supplied with a 36 inch ribbon cable

for connecting to microcomputer. Requires 11/1

I/O port'). Priced at $155 with one set of

so ftware. Persona li ty modules are shown be low.

Part No.

PM·O

PM-1

PM·2

PM·)

PM-4

PMoS

Prosrllmt

TMS 2708

2704,2708

27)2

TMS 2716

TMS 2532

TMS 2516,2716,2758

Optimal Technology, Inc.Blue Wood 127, Earlysvi lle, VA 22936

Phone (804) 973-5482

Price

S15.00

15.00

30.00

15.00

3000

15.00

ecsc-oC:,t:-

oCol-

0<;04-

oCo/-

oCoA-

eeoc-oCol::-

oC/O-oCIL-

oC/4-oC 10-

oC 11-

oC ld-

oC/A-

oC l!:l-

oC ru-oC/I:-oCtiU-

oCd.i-

oCtJ5-

oCoo-

OCbd-

oCol:)-

oCdU-

oCdE-

oC'IO-oCy3-

OCY4-

oCYo-

oC;I9-

oCYI:)-oCYC-

oCYI:::-

oCAO-

oCAI-

oCA3-

oCA:i-

oCA/-

oCAY-

OCAO-

oCAD-

oCtJO-

oC1:)2-

oC!:l5-

oCbo-

oCdY-

0"':00-

ecsc-oClll"-

oCCI-6CU-

oCC:i-

oCCd-

oCCtJ-

o"':CI:-

oCOI-

OCD4-

oC0:,-

oCul-

oCDd-

oCUA-

oCUll-

oCUO-

oCDI::-

oCUf'-

oCI:::I-

oC1::3-

oC1:5-

oCI::/-oC1:::9-

oCl::ll-

oCEC-

oCt:I::-

oCl::f-

oCI-O-

oCl-'l-

oCF2-

6Cf3-

oCF5-

oCf7-

oCF9-

oCl-tl-

oCFD-

AY ()O

oU I-d 01-

tJU I-Y 01-

AU fr' 01-

oU F 1 of

AS 01

d:i I-C

A: ' o C >

o:i I"U

AO 00

bl I-C

4d

CtJtil I-C

4tJ

I-U 00

Co

A", 00

01 I-C

Cu 1 : : 1 ot'

Cd

til I-C

I :: :D I :: tJ 01-

>10 41

db

tJl t'C

Cu I:::i of

Cd

dl I-C

I :: :U 1 ::0 01-

00 42

btJ01 fC

dil-l:::

Cd

t:o ft

bl I-'C

01 1-1:.

1::0 1-1:.

oo 0",

1: :0 1-1-

1::1:: fd 01-

UO vJ

1:1:: fy 01-

bd

AU Fo 01-

YI I-C

Cd

AD I- 1 of-

YI fC

IdAD Fool-

oU fC of

bU 1-0 01-AU 1 "7 01-

OU I-U 01-

so v t 01-otJ

b:i fLJ

OtJ

tJ: , r' .. .:

Id

YO ,I:i

ob

od

A:' 01tl5 t'C

A : ' Ob

b:i I-U

AO o u1:)1 Fc

3d

t::i r'c

AA

CA

CA

CA

CA

AO 04

01 fC

C9 t:l01-0 ",5

C>I AB

FO ",I

lUA

;,lA

::.,j'A

luA

SlA

LUA

STA

lUA;,jA

luY

lUA

f'riA

[1' YlUA

f'hA

bl:U

I" Y

lU,(

LUA

C " I f . >

IN T

LUA

:;,UC

bCC

UI:T

LLJA

L,;IVltJ

IN Y

lUA

;,dC

oCS

UI:::Yl0A:;,jA

I" T

j,~L

LUA

: , l A

li',C

oHI:

II'c

L<ed'il::

II'C

ul::tLUA

; , I A

I N Y

lUA;,[A

ClClUA

AUL

;,j'A

LUA

AuC

: :. , 1 A

f'lA

Sf A

f'lA

: : . , I A

ClC

oCC

i-'LA

f'lA

lUA

;:ilA

lUA

:;,TA

L U YLUA

;,I:::C

SllC

l A A

Uc,(

UI:::A

UI:A

UI::A

luY

luA

CMP

tJtQ

L ' ~ f . >

J:Jt::Q

*>00SOl-rb

>Orl-)I

.ol-H'SoH,,;

>01

Sr'C

>ob

St- L";00

(Si-C ), j

(SI-C J, (

$oCiJU

*SUO(>I-C), i

SOl-I:: ;

(Sf C), (

,ol-I:b

.OL.U4

(:;iI-C), (

sol-I::'

(SI-C), i

>01-1::0

SoCUU

(SI-C), Y

(S I- t: ,A)

$1-1:

( >1 -1. .. , (

(SI-I::: ,A)

SI-i::

SoCAl)

Sfl-

>ol-ro

SoCb:,

>01-1-'1

>01-1-0

(Sf C), I

sof-I-I

(. I-C), Y

~ol-ro

$ol-fC

Sol-I-a> 01 -1 - 1

501-I-U

>01-1- /

> o C I " ,

>0 I

sfC

>otJ

st'U

II~UU(Sf'C), '(

SFC

*.U4

(SI-C), Y

1I'5bO

>oU20

I I$Ad

>00LO

0(; FF-

oUOI-

0003-

oD04-

0005-

0001-

oOOti-oUOA-

oOOB-

oUOU-

ouOf-

oD 11-

oU 13-oU15-

oU 1/-ou I Y-

oDlll-

oUIU-oUIr'-

OU",O-

oULI-

oU",2-

0024-

oOL/-

6U2A-

oO.iC-

oU2U-

oO.iE-

6031-

oDj4-

oD31-

oD3A-

oOJC-

6DJI- -

oU42-

oD44-

oU40-

o04b-

oU4A-

oD4C-

004t:-

oU41-'-

oU5.i-

0054-

oDSo-OU:,y-

olJ:iB-

oU:,c-0051::-

oUoO-

ou02-ou04-

0005-

oUob-

oUod-

oUol::-

00/1-

oU14-

oU 11-oD/A-

oU1C-00/1--

oOtJ.i-

oUd:i-

oUd/-

OUbA-

oDtJU-

oUdF-

oUYO-

oUYI-0093-

00Y5-

OUY/-00y9-

6UYtl-

oUYC-

oUYD-

oUYf-

oUA.i-

oUA,)-

oUAo-

oUA/-

oUAy-

oUAC-

CY C4

1-0 IU

L.tJ

CA

UO 1: :1::

Yo

AO 01Id

O:i fC

d5 1-1...

vo 02

t:o r'U

tJl fC

UO UO

A5 00b:i oA

A:i Af

tJ:i Oy

00

Ctl

CA

1-0 t:3

",0 FO oU

AU 1::1:::of-1-0 CY

Yd

4b

AU I-'c 6f

dD Fo 01-

AU f'f of

dO 1 "1 01-

AY 00tlU fL 01-

bD f3 01-

AY 10

tJ5 fF

AY UO

b5 f't::

AU LlO

bl FI::

Ctl

CU f4 01-

uo U I

III 1-1::

CU f? of

I-U 47dd

1::0 f l: :

t:o fl::

UU 02

1:0 H'Id

A U fo 01-

oU f'C of

tJU Fe or'AI.) r ] of

00 fD 01-

bU Hf'

I::t f'L of

UO 03

1:1:: f 3 or'

AD F2 01-

CU Fd of'l . X . J C :,AU 1-3 01-

LD f'9 01-

DO oL lob

Ad

01 I-CL9 30

'Ill 4A

CY 3A

tJU 40

Cd

CA

l . J U I- L

4 1 . . . vi oU

20 3", of

od

Ad

A9 00

tJl.) I-' I 01-

AiJ 1-0 or'

L.MP

tJl::Q

[I'Y

UtAOIH:

1 Y A

lUYClL

AUC

;,fA

bCC

IiC

LUA

bl<l:

lJA

5TA

lUA

: : . , I A

Hb

I N Y

Ut..<btu

J5 K

lUA

tJtLl

lYAf'hA

lUA

STA

lUA

;,TA

lUA;,TA

STA

LUA

Sj'A

lUA::"[A

LUY

lUA

I,d

C,~Pbl,1::

lUA

CO I f . >

btw

UI:T

[IK

iNCbl,1::

11KC lC

lUA

AOC

STA

lUA

AUC

STA

INCbHI::

II',C

lOA

L.,~fJ

bNI::

LUA

L;~r'

bilE

fJlA

lAY

luACIM)

dl-L

CI~PoLS

Ir,Y

uU

b"t:

J",f'

J;,H

r'lA

l A Y

lUA

; ,TA

LuA

IISC4

>oU",O

>Ol-I - ?

SfC

>1-1...

sol) I j

SI-lj

(>I-C), Y

,oCI:: I

>oU

SoA

>Ai-

SOy

SoUU 1

>oUfO

SoH:::1::

SaCI-:'

Sol-I-I:

>ol-i-o

,ofl-I-

.01 -1 - I

";00SOl-I" '">01-1- ..l

liS 10

>1-1-

*SUO>1-i:

IISUO(.1-1:) , T

;of-r 4

,0L:itJ

(S I-t) , Y

>01-1-?

SoLJA",

sFI:

~r t:So004

>1-1-

>01-1- 0

>oJ-fC

e c+r o>ol-t' 7

>ol-ru

Sofr 1

Soh"2> o u / l -

sOI-t' 3

>01-1-",

so+r eS6J4C

>01-1- ..l

SOl-rY

>oU4C

(SI-C ), jII> JU

souto I

«» ..)A

SOUl: I

,0U<, I I

Souu I

Sol-J",

liS lY J

c o r-t- I

SOl-rU

Page 31: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 31/68

\j

oOAI--

oLltlO-

oOb3-

oObo-

OOtJd-

oUdA-

oLldU-

oUdl--

oU1..:2-

o O C ~ -

oUCo-

oUC'I-

ouCU-oLlCt-

oULlO-

oUU2-

00U3-

0000-

01)07-

oOUY-oOOb-

o!)OE-

0001'-

oOEI-

60U-

oUE5-

oOEd-

oOEB-

oOtt-

001-0-

01)1-1-

oLl1'2-001'4-

6I)f'-I-

oOFA-

oUI'I)-

oOl'F-

oEQ(}-

oE03-

OE05-

oE07-

oEO\l-

oEOC-OI:OOU-

oEIO-

01:013-

oElo-

oE 17-oEIA-

oEIU-

01:0E-ot:21-

oE24-

oE27-oE2d-

ot:2tl-

ot2E-oE2I-'-oE32-

OE35-

01:030-

0'::3\1-

0'::£-

61::3E-

oE41-

oE44-

oE45-

01:047-

oE4d-

oE4\1-

OE4A-

otAI..:-oI:04E-

oE~I-

oE~2-

01:::53-

oE54-

oE~~-oE~/-0t~-,I-

oE~A-

oE~C-

ol:::>I--

oEol-

3d

t:U I : : i : : 01-

bU 1"0 or-

IO u5

AY t'r

oU l-I 01-

1-0 00

20 03 or-

~o ~ I o c

bA

dO !:f' 01-

A2 00

tiU Ey 01-'I - ' Q 00

'II l-C

C d

CE Et' 01-

td

EO 05

DO I-'U

AU t::l- 01-

A Al : J 1 FC

CY 2C

LlU 03

4C 20 60

4C FloC

20 o+ fD

AU 00

Yd

4d

A9 00bU EE 61'

dU I-~ 01"

bO 1"4 o r

81 FC3b

Eu E3 o f90 42

CY OA

dO 3E

I::t I::E or-4d

2E 1'4 o f

2E t'~ of

AD f~ 01-'

4d

AU F4 01-'

4d

2E r 4 01-

2E r~ Dr~E f'4 01-

2E I- ~ o f

o b

00 1-'4 01-

80 1"4 Or

ob

00 1"5 o f

bO I-~ 01'

o d

00 F4 ot'

dLl F4 6l-

AY 00

00 F5 o+

oU 1-'5 of

C d

W do

08

A d

00

A~ dO

E\I 00

4C dU ot

Yd

4d

oA

4d

A~ Al-

b~ t'A

3d

t5 rC

oU r r. 01-

A5 dU

0:> I-lJ

: : i t : C

: O b l . .

: : i I A

O f ' L

lOA

olA

b!:O

J:iH

JS "fXA

: o f A

LUX

LuADtO

: o I A

IHi

ui::C

I N A

CPX

bNi::

LUA

lAX

L L J A

CIM'bNt::

Jlld)

J M f '

JSK

L U Y

T Y A

f'tlA

L U A: i l A

ST A:oIA

LUA

oEcS t l l . . :

d C C

e M f '

b C S

I N C

P i t A

HUl

fjLll

lOA

f'tlA

l l J A

P I i A

HUl

HLilHuL

nULf'lA

AUC

: : i r Af'lA

AUC

: i r A

f'lA

AUC

: i lA

LUA

AUC

: i T A

lrUbl.t

f'lA

r A ' r '

filSLUA

S d C

J/.,P

lYAf ' r l A

lAA

P r l A

lUA

o " f A

~EC

S b C

:oIA

l u A

: i r A

>ol-'::t:

,ol-I-u

ooL,bU

I1S1-1-

Sol-I- I

soL.C:>

,oh)3

so eb I

>ol-tl-

l1'UU

Sot't:Y, X, o u u o

(:;I-I..:),Y

#SO:>

,0UCo

,01-i::1-

(SI-C), Y

#S2C

,0uEd

SoU2u

,oC1-7

Sl-UOI-

«eco

#$00;.ol-d'

.01-F5

.01-1-4

(SI-C) ,i

sol-E3

.0l:47

RoUA

SoE41

:;ol-t:l:

.01-1-4

,6l-1- 5

.ol-I- ~

~01-l-4

Sol-l-4

sofl-:>'01-1-4

Sol-I- :>

SOl-I- 4

;'01-1-4

sor-r- bsobf5

;'01-1-4

s o+ r- 4#SOO

;.ol-I-~

sol-I- ~

SOUI-U

SbO

#:i ()(;

so cou

,AI-

St'A

,I-C

SOI-I-A

,dO

,1'0

oi::03-

ol:o:>-

otOd-

OEod-

oEot-

oEol--

oE /2-

oE/j-oE 11-

oi::/A-

oE/lJ-

oEIU-

ot:dO-Ot:b2-

oi::b4-

oEdl-

OEdY-

Ot:dtl-

oEoU-

otdl--

01::'11-

010\14-

oEYo-

otYb-

oI:OYA-

ot::YC-

oIOYU-

otYI--

oEAI-

01::A3-

o ' : : A ~ -

oEA/-ol:Ad-

Ot:AA-

OEAC-

ol:A!:-

ol::dO-

Ocd2-

oE83-

OEbO-

oEtJd-

ot:dtJ-

ocdO-

oECu-

01OC2-

ot:C3-

01::1..:4-

ol :OCI-o t l . . : d -

oEC\I-

o t C A -o'::Cb-

otCD-

oECF-

ot:UI-

ot:U3-

ol::Do-

oEOd-

ot::UY-

oEOd-

OI:OOC-

OEDE-

oEI::O-

oEl:2-

ot::1::4-

oct::o-

o I::t::d-

oEEA-

ot:t:d-

oEEU-

oEtl--

otrl-

ocr2-

6l:l-5-

oEt'l-

oEI-A-

oEFC-

0101'1--

01'01-

01"03-

01'04-

01'0~-

0l-07-

01'0'1-

c:> Fu

oU rd 01-

dC EI- 01-

AU I'A o f

..1d

!:U cl- or-e O I - ' A Dr

'10 03tot: I-d Or

I d

A5 Al-

uU t'0 of

d:> AI-b~ I-'d

AJ I-U 01-

..l0 C I

A:> dO

0'1 00

d::> dO

05 l-Y

AU I-Q of-

30 35

AU 00

bl l-A

'II Fd

3b

A:> I-A

tY 0 I

d~ r- A

t l O 02

Co f'o

3d

A~ I-d

!:Y 0 I

0:' I-d

b O 02

Co l-y

3d

AD I--A 01-

ty 0 I

dl1 r r; of

aU l1IJ

I..:E r- o 01-'

UO Uo

I d

o t l

oU I-U 01-

M

od

Ad

o uA:> fCtl5 t'tlA:> f-O

d5 Fy

AU 1-0 Dr

4Y FI-

10

0\1 01

I d

05 I-C

d5 r A

A5 1-1)

u\l 00

b:> t'b

i : l l FA

'II r o

Cd

lJO 04

l::o h

!:o t ' ' J

3d

AD I- A of

!:\I 01

dU r A of

dO E A

Cc ftl 01"

DO b

1-0 df'

Yo

40

AS l-C

d~ I-A

A~ F L J

: O b e

o fA

: o n

lUA

:ol:C

Soh;

~ r A

b C CI I ~ C

C l C

lOA

AUC

SfAolA

lUA

l : J " d

LUA

AUC

: o 1 A

:olA

Ll1A

u , . \ 1LLlY

lUA

:0 lA

S t : C

LUA

: O b C

:oIA

t ! C : i

Lli::C

:ot:C

LuA

: O d C

:oTA

t i C : i

utC

::ltC

LiJA

S b C

: : i T A

DC S

utC

tlNl:

eLC

f'lA

AOe

TAA

PlA

lA i

"I SLLlA

: i r AlUA

of A

LOA

tUK

c l C

AUC

e l c

AJC

: o I AlLlA

ALlC

"TA

LOA

ST A

I I , Y

buc

li'Cli,C

: o E C

LLlA

: i l : J C

S T A

bCS

uE Cdl~E

ritO

TYA

f ' r l A

LUA

STALl1A

,I-U

So r - r - b

'01-t:1-

'Ol-I-A

soFcl-

,ol-I-A

,ot7A

sol-F b

SAl-

$ol-I-li

SAl-,1-'0

,ol-l-U

;,0!:4A

SdO

110UU

S t l O

'1-'1SOrl-O

,0!:Cd

l1S()O

(;,I-A), i

(.1-0), Y

,I-A

#SOI

,l-A

so!:A-1

,I-b

SI-'d

#;.01

$Fd

,DEB"

sl-Y

so+r A

#$01

soFl-A

'OtYd

Sol-I- 8

,0t:Yd

Sol-I-O

sFC

,rb

sF U

,1'',1

$ol-I-li

#:;il-I-

#$01

sFC

;.I-'A

sl'Ll

iI:;i()O

sftJ

(~I-A), i

(SI-b),i

SOl:f I

:il-b

sFY

SofFA

#;,UI

$ol-l-A

:;0 !:Eo$orl-d

SO!:l:o

:;iol:1..:2

:iI'C

sf A

:;iFu

oFUtl-

01'00-

ot'OI--

ol- 11-

orl3-

01'14-

of 1:>-

01" 1/-

ofld-

ol-IY-

of IC-

ot'lt-

ol-Il--01-'21-

01'24-

01'20-

01'21-

01'2Y-

of2A-

0l-2C-

of2U-

ot'"I--

01-'30-

01-31-

01'32-

01'33-

0l-34-

or30-

01' 3d-

oF3d-

oF3C-

oF3t-01-41-

01'4..l-

of'40-

01'40-

01-'4A-

ol-"d-

0l-4t-

01'50-

01':>1-

0l-53-

01':>0-

0 l - 5 / -

o F 5 b -

o t = ~ A -

or:>lJ-

01-51"-

o F o l -

01-02-

oF04-

o f 0':>-

ol'ob-

ol'oA-

oFotl-

oFoC-oFoU-01-01'-

o f 71-

o F / 4 -

01'/0-

ol-'/d-ol-lA-

01- IU-

o l - / E -

OfbO-

0l-d2-

01'd3-

ordO-

01' tJO-

ol-dY-

oFdC-

oFdF-

01'90-

ot'91-

o f - , l 2 -

ol-Y,,-

o F 9 ~ -

or-vo=

Ol-Y 1-

oF9d-

o r Y \ l -

oFYA-

orYC-

d5 i t l

A() 0 I

oil-A

l-O Ie

4d

od

e l l - A

40

I d

00 rO 01-

'II fA

Cd

b I FAuLl 1-1 01-

'III-A

od

d~ I-A

od

05 l-d

I dYO t:0

od

Ad

u O

d A

"dAY 30

A2 04

'Ill tO y 01-

C A

10 FA

AU l-i or -d:> 1-8

ALl 1- '0 01'

05 I-A

AO 00

t:d

O'J '12 of

I-u II-

38

AS r'A

1--,1Y2 01'

4d

C d

A5 t'tl

I-Y 'I" or'

YO OU

0:> ftl

o b

05 l-A

db

I-t: tY or'

lJO to

Cd

u o

td

IJO DC

A2 00

DU E\I 01-

CY 30

UO OA

A9 00

:.>U I::Y 01"

t : t l

to 04

lJO i:: f

b A

dO FO 01-

AY 05

3b

to I-U 01-

bLl r O 01-

Od

A A00

10 .2.1

l:d

03

04

00

UA

00

UI 00

00

:01ALUY

llJA

Dt:O

PHA

uULUA

P r i A

ClC

AIJC

O I AIi.i

luAAUI..:

: i l A

PlA

: o l A

PLA

STA

ClC

t l l . . : l . .

P l A

lAY

K [ : i

TX A

r'HA

LO ALuX

SIAUd

dPL

LUA: o r A

lUA

: o T A

lOY

I . ' ALUA

btU

:OCC

LOA: i t l l . . :

r'r1A

I,. YLLlA

:ODC

bCCSTAf'lA

: i [ A

L J t : Y11Kbl~l::

I,d

f'LA

lliXai'll::

LO XLUA

CMf'

t i N ! : :

l D A

STA1 1 . , (

C P X

ON E

TAA

STA

llJA

S ! : : C

: o t i l . .

SlAP L A

IA,(

"fSb~L

L~ A

tit

t t ,bfo,

A : O L

U , , "UfiA

drO',

;;I-b

#,UI

(SrA), '(

,or2i-

.ol-l-U

hrA), '(

(.1-1\) , '(

SO!"'r I

(SI-A), r

SobOl-

11'..10

ItS04

,0rt:Y,,(

'01-30

.01-1- Isr- t l

.01-1-0

;;r'A

if~()U

SOI--,I" , iS O l - o r

,1- b

;;o1-Y 2, Y

,01-0A

Sl-b

Sl-A

' O l - ! : : ' J , A

' O l - ~ U

,01-4tJ

#SOO

;'Ol-!:Y, X

ifS3U

Sol-b2

11,()0

Sol-ty,,(

#S04

,01-11

,01-rU

#s05

Sol-I-li

.Ol-t-U

Page 32: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 32/68

Performing Math Functionsin Machine Language

If you are afraid to try doing mathematical functions inassembly language, then this article may help you getstarted.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Since addition, subtraction and shif-

ting are the only arithmetic functions

available in machine language for most

small computers, it becomes necessary

to find methods to perform other

mathematical operations using addi-

tion, subtraction, and shifts in combina-

tion with other commands available on

the programmer's microprocessor.

Multiplication is an example of an

operation that is commonly performed

in this way. Let's look at a particular ex-

ample. Suppose we want to multiply 187

by 345. It is obvious that we can clear a

register and add 187 a total of 345 times

to arrive at the answer, but we soon

discover that it is more efficient to per-

form the same function by combining

additions with shifts.

Using the shift command, we would

add 3 187s, then shift left, then add 4

187s, the shift left, then add 5 187s to ar-

rive at the final product. Thus, we have

replaced 345 additions with 12 additions

and 2 shifts. In the same way, repeatedsubtractions may be combined with

shifts to implement a division algorithm.

Division and multiplication algorithms

are often described in the programming

manuals that come with a computer. A

programmer soon needs other mathe-

matical functions and must find a way toperform them with a limited instruction

set and limited computer memory. If the

18:30

functions become too complicated, one

must add memory or go to a hiqher level

language, such as BASIC.

The purpose of this article is to

demonstrate the power of the lowly addi-

tion and subtraction commands by

developing an algorithm for extracting

the square root of a number. The al-

gorithm is described and a flow chart ispresented along with a 6502 lis,ting for

the KIM-1.

The square root algorithm to be

presented here is based on the equation:n

1: (2k·1) = n'; n an integer greatN than 0

k=1

which says, in English, that the sum of

the first n odd integers is equa.l to the

square of n. For example:

1 + 3 + 5 + 7 + 9= 25 = 5'

That is, the sum of the first 5 odd in-

tegers is equal to 52, or 25. This equation

is easily proven true for all positive ln-tegers by mathematical inducticn.

The method implemented here is to

subtract first 1, then 3, t hen 5, and so on,

from the number whose square root is

desired. The number of subtractions,

less 1, that it takes to reduce the orlqlnalnumber to a nonzero negative number is

the square root. For example, if X = 25:

25-1 =24; 24-3=21; 21-5=15

16·7 = 9; 9-9 = 0; 0-11 = 11

MICRO -- The 6502 Journal

Alfred J. Bruey

201 S. Gr innell Street

Jackson, MI 49203

Since it took 6 subtractions to reduce

25 to a number less than 0, the answer is

6 - 1 = 5. Notice that this method

gives only the integer part of the answer,

so if X had been any value from 25 to 35,

you would have arrived at the same

answer. Remember-when you take the

square root of a number, your answer

has only about half as many significant

digits as the number.

The original value (NUM) is placed in

the accumulator. The answer will be in

the Y register and also displayed on the

KIM's seven segment LEOs (POINTH).

Notice that the algorithm as described

below will not handle very large

numbers. To use this for practical pro-

blems, it will have to be extended to

multiple precision.

The coding to implement the routine is

given below. While the addresses are

given for the KIM-1, a few address

changes should make it possible to im-

plement this routine on any other 6502

based system. The number you want thesquare root of goes in location 0001,

then set the address to 0000 and GO.

The answer will be displayed in POINTH,

the left two LEOs of the KIM display. The

code given is probably not optimum-I

am a relative newcomer to machinelanguage coding. If you come with an im-

proved version of this routine, I'd ap-

preciate receiving a copy of it. The exam-

ple shown is set to take the square root

of $10.

November, 1979

Page 33: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 33/68

c o o c :U:1(,: SC:t;',i:<E ReGT t~CLTI~;[

( ;02C-'\

CCJ() : ALFl \EC J. DEny

c e L l c :c o s o : ecce C[;C 2crcceCGo:

COle: ( i o e e ~:Hf * S(CIA

CUO: e c c e POInL -', seenc e s c : cccr STAR1 * SlC(F

Cl00:

r : 1 C : OCCC t\ C J 1r- : ErClh LL\ 1:'i $ IC

C120 : COC2 AC Cl u'..':~, s r I01:0 : cr'C4 fE, L\ (''T-'" >[E::::..1~

( "01/.,-., • ('1"''''''- AC C O LGYT:' s e n. ,"T\ ... .. \,,-\;\.._i

C!5C:

~C16e: e C O F ~" L e e p SE Cc

(~17C: cor-. £5 11 \ :,BC :"Ui

C I E C : eCCE JC {:~ L ,,~ ':icrI.', J

019C ; COOD Cf Ii'Y

C2CC: OCGE E( III H1C ;· ;EL

0210: CC10 E6 lA ne ~:E';0220: 0C12. 4e o r e n Jm LOCP

enn:024(': C015 EL I FE STep STY rcn.ru02se: 0 0 1 7 4C 4F 1e J:·:r ~TA1·:T

ozcoID=

Flowchart

}

K IM /S Y M /A IM - 6 5 - 3 2 K E X P A N D A B L E R A M

D Y N A M IC R A M W IT H O N B O A R D T R A N S P A R A N T R E F R E S HT H A T IS C O M P A T IB L E W IT H K IM / S Y M /A IM - 6 5A N D O T H E R 6 5 0 2 B A S E D M IC R O C O M P U T E R S .

* PLUGCOMPATIBLE WITH KIM'SYM!AIM-05.MAY BECONNECTEDTOPETUSINGADAPTORCABLE . SS4+E BUS EDGECONNECTOR.

* U5 £S +5V O NL Y ( SU PPL IED FROM HOSTCOMPUTERBUS). 4 WATTS MAXIMUM.

* BOARD ADDRESSABLE IN 4K BYTE BLOCKSWHICH CAN BEINDEPENDENTLYI'LACED ON4K BYTE BOUNDARIESANYWHEf lE IN A 64KBYTE ADDRESSSPACE.* BUS BUFFEREDWITH 1 LS TTLLOAD.* 200NSEC4116 RAMS.* FULL DOCUMENTATION* ASSEMBL ED AND TES TED BOARDS ARE

G UARANTEED FOR ONE YEAR, ANDPURCHASE PRICEIS FULLY REFUNDABLE IFBOARD IS RETURNEDUNDAMAGED WITHIN14DAYS.

ASSEMBLED!

TESTED KIT

WITH 32K RAM ••••••.•...••.•••••..•• 14115.00 1459.00

WITH 16K RAM 1425.00 13B9.00

WITHOUT RAM CHIPS ...••.••••.•. " •• 1355.00 1319.00HARD TO G ET PARTS ONLY (NO RAM G HIPS) ........ 1180.00

BARE BOARD AND MANUAL •.•••• .......•••.... '" S8li.00

CONNECTS THE ABOVE 3 2 K E XP ANDABL E lAM TO A 4K ORBK PET .

CON TA IN S E XP ANSI ON IN TERFACE CAII :l E, B DARD S TANDOF FS ,

POWER SUPPLY MOOIACAl lON K IT AND I :8MPUTE INSTRUCT IONS,

BETA COMPUTER DEV ICES ~" ,~.,. ALL ASSEMBLED BOARDS AND MEM·

ORANG~.OC:L~;03~;J~A 92665 ~.; _,R' ~ : F _ ' . '>,.~~~;,;. = / ~ .; D RY C HIPS C ARRY A FU LL O NE Y EAR(114) 633 .72EO ' CJC JOe" /." (,I'C REPLACEMENT WARAMTY.

2716-450NSEC . . 149 .00

16KX I DYNAMICRAMT HE MK4 116 -3 IS A 1 6.3 84 BIT H IG H SPEEDNMOS.DYNAMIC RAM. THEYAREEQUIVALENTTO THE MOSTEK , TEXAS INSTRUMENTS. ORMOTOROLA4116·3.* 200NSECACCESSTIME. 375NSECCYCLE

TIME.* 16 PINTTL COMPATIBLE.

* BURNEDINAND FULLY TESTED.* PARTS REPLACEMENT GUARANTEED FOR

mIEYEAR.19.50 EACHII OUAITITIES OF8

MOTOROLAMEMORYADDRESSMULTIPLEXER -MC32421.

THE MC 3242A IS AN ADDRESSMULTIPLEXERAN D REFR ESH COUNT ER FO R 16 PIN . 16 KDYNAMIC RAMS THAT REQUIREA 128 CYCLEREFRESH.* CONTAINS MEMORY REFRESHCOUNTER.* MULTlPLEXE5.SYSTEM 14 BITADDRESSTO

THE 7 ADDRESS PINS OF THE RAMS.* COMPATIBLEWITH3 480 MEMORY

CONTROLLER* PARTIS GUARANTEED.

112.50EACH

MOTOROLAOUAMIC MEMORYCOITROLLEH·MC3480L

MEMORY CONTROLL ERDESIGNEDTOSIMPLIFYCONTROLOF16 P IN4KOR16KDYNAMIC RAMS.* GENERATESRAS!CAS AND REFRESHTIMING

SIGNALSFOR16KTO64KBYTEMEMORIES

* GENERATESMEMORYREAD/WRITETIMING.* D IRECT INTERFACE WITH MOTOROLA OR

INTEL 3242A ADDRESSMUX AND REFRESHCOUNTER.* PARTGUARANTEED.

113.95 EACH

6502 ,64K BYTEHAMANDCONTROLLERETMAKE 64K BYTE MEMORY FORYOUR6800 OR6502.THIS CHIPSET INCLUDES:* 3 2M 5K 4 11 6- 3 1 6K X1 . 20 0 NSECRAMS* 1MC3 48 0 MEMORYCONTROL LER.* 1 M C3 242A M EMORY A DD RESS

MULTIPLEXERAND COUNTER.* DATA AND APPLICATION SHEETS. PARTS

TESTEDAND GUARANT'OED.1 3 25 .00 PER SET

EPROM

Page 34: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 34/68

Hgh Resolution Light PenMlcromodem !I).C. Hayes)

12··B I W r eeeex MonitorCable from Monitor to Apple II

13·· Color TV C(lmpatlble withApPle II 290.00

Dmputar~ ~ i ~ ~ ~ ~ : ' ~ ; i ~ : r e . k N O l~ ~lSA-lnteractl11e disk assembler 34.95WHATSIT-Excellent conversational databasem anager 32K 100.00 48K 125.00SARCON-Chamj;lof 2nd west CoastComputer Fall"e 19.95APPlE PIE-Excl!lIent text editor 24.95FORTE-Music editor In hires 19.95FASTCAMMON-·Excellent backgammongame with g,.l ph lcs Tape20.00 Disk 25.00

APPLE21-ExCE lI en t t li ackJack game 9 .95BRIDGECHAllEUCER-Computer bridge 14.95FINANCIAL MANACEMENT SYSTEM

• Accounts Payable • ledger Processing

• Accounts Receivable • Payroll

: _ ~ n i o ~ n ~ ~ ' h~I~~~e : ~~~~~~f~~~~PRINTERSPECII~LSFOR APPU: AND PET

TRENDCOM100 with Interface forApple or PET

Apple IIReference ManualApple Soft Manual .. . .Programmer's Culde (Computer Station)Apple IIMonitor peeledSoftware Directory for Apple

• Business,Finance & Utility• cames, Demo, Utility.Best of Contact '78 . . . . . .. . ....programming In PASCALCrogono)

... $10.0010.00.. 5.95.9.95

4.954.95.2.50.9.90

INTERFACECARDSprototyplngi HObby CardParal lel Printer Interface cardCommunications card & oB1S

Connector CableHgh-speed Serial Interface Cardlanguage wsrem wit" pascal148KRAM& Disk IIReQulredlApplesoft IIFirmware Card,6 Input Analog Card

S 24.001S0.00

225.00195.00

495.00

200.0029500

ACCESSORIESDisk II-Drive OnlyDISk II-Drive & Control ler (32K Min.RAMRecommended)Vinyl Carrying CaseTape RecorderProgramrm!fS Aid No. 1. Firmware (For

us e with Integer BASICIClock ICalendar CardAutO-Start ROM Package (ForApple" Only'Dlglklt lzer Pad by 'taros

(Kltform) ..

495.00

595.0030.0040.00

50.00199.00

65.00

499.00

New for Apple Computer Ownersat Low ComputerWorld Prices8" Disk Drives with housing $1295.00 for single drive

199.00

379.00149.009.95

LITEPENused wit" TVor monitor

screen 3495ALFMusic Synthesizer Boards 265.00supertaner 279 00Anadex DP·SOOOwit" tracterS··paper width and Interface

to Apple 1050.00centrcmcs 779·2for Apple I Iwith parallel Interlace 1245.00

SOFTWARE(Send for complete SoftwareCatalOI) $1.001

Dow Jones ecrescuc Evaluator /Stock ocore RepOrter Disk 50.00Microchess 2.0Chess Disk 25 00Disk utility Pack with DOS3.2 25.00The controller rcenerar BUSiness

System I 625.00Apple post IMall lng List svsrerm 49.95Bowling Program mseene. 15.00TM cashier (Retail Store Management 250.00ceececcoe cassette 20.00Applesoft IILanguage & Demo

Cassette 20 00R'AMTest Tape wit" Manual 7 50

Finance 1·2 cassette Package 2500u a ta m o v er . re r e uc o a Cassette(Com. Card & Modem ReQ·dl 7.50

eroocness 2.0 Chess Tape 20.00Bowling Program Tape 15 00Pascal with Language System

148KRAM& Disk II ReQuired) 49500

$1895.00 for dual driveI_

2001·8 $7952001-16N .. $9952001-32N ... $12952001·32B .$1295Externalcassette . . . . . .$95PETto IEEECable .. $39.95

2001·168$995

-J o in N ow~ABecome a mem of ComputerWorld's RAYGAMCOComputer Discount ClUb.By being a RAYGAMCO Member you receive substantial discounts on every item you purchase,including all hardware, software, accessories, even books and paper! You will also receive amonthly newsletter with all the latest available for your particular computer system, and much,much more - exclusive to RAYGAMCO Members only!Here's how to join.!\lothing to buy. Simply complete the self-addressed postcard in this magazine with name,address, and your computer system. You'll receive your personalized RAYGAMCO Computer

Discount Club Membership Card in the mail with information on how to use your card whenordering for big savings!

Charter RAYGAMCOMembers' Special. Join now and receive 20% OFF of any purchase.*'200/0offer exp i, ," ; December 24, 1979. Offer is val id lor RAYGAMCO Members only.

A P RO FE SS IO N ALB U SIN E SS S YS T EM,.", CMB2022

V " C c i i M ~ ~CBM2023Printer.IEEEto IEEECable.

$849

$49.95

C8M 2040$1295

tlappk!'computar

Joystick for Apple II Only $39.95ComputerWorld's Complete Library of

600 Apple II programs Only $60.00

commcnore PETservice Kit .Beeper-Tells when tape IsLoadedpetunia-Play music with PET .Video Buffe,r-Attach another diSplay.Combo-Pel:unla and Video Buffer

SO FTWAR I: F OR PET

$30.0024.95.29.9529.95.49.95

Mirrors and Lenses 19.95TheStates . .. 14.95

RealEstate 1&2 59.95Momentum and Energy .. 19.95

ProlectlleMI~tlon.. . .. 19.95Mortgage 14.95DOWJones. . . . . . .. . 7.95Petunia Pla~erSftwr 14.95

Checkersand Baccarat .7.95Chess ... 19.95

series and parallelCircuit Analysis .. .19.95Home Accounting 9.95BASICMath ... 29.95Came Playing with BASICVol. I, II, III ... 9.95 each

ComRulerWorldA RAYGAM COMPANY

6791Westminster Ave.,Westminster, C~~92683 (714)891-2587

Page 35: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 35/68

WANTED: A T A R I ®••• FIND IT AT COMPUTERWORLD,

ATARI® 400™PERSONAL COMPUTER

SYSTEM

PR IC E I NC LUDES :

Computer ConsoleBASICLanguage CartridgeBASICLanguage programming

Manual (Wiley)400 Operator's Manual withNote BookPower SupplyTVSwitch Box

ATARI® 800™PERSONAL COMPUTER SYSTEM

PR IC E I NC LUDES :

Computer consoleBASICLanguage CartridgeEducation System Master CartridgeBASICLanguage Programming

Manual (Wiley)800 Operator's Manual with Note BookATARI 410 Program RecorderGuide to BASICProgramming Cassette8KRAMModule·power Supply.TVSwitch BOX

$99999

PER IP HERA LS AND ACC I:S SORIE SATARI':;J 820™

PRINTER * $S!J9.99

ACCESSORY CONTROLLERS

CX2C-D1 DRIVING CONTROLLER PAIRCX30·04 PADDLE CONTROLLER PAIRCX40·04 JOYSTICK CONTROLLER PAIR

S19.95/ea.

ATARI® 410™PROGRAM RECORDER $89.99ADD-ON MEMORY 1800 ONLYl

CX852 8K RAM MEMORY MODULE $124.99CX85316K RAM MEMORY MODULE $249.99

ATARP' 810™DISC DRIVE*DISKETTES

CX8100 BLANK DISKETIES'CX8101 DISK FILE MANAGER'

55.00/ea.

$749.99

SOFTWAREGAMES $49.99/ea. APPUCATION $69.99

CXL4002 ATARI BASICCXL4003 ASSEMBLER DEBUG"CXL4007 MUSIC COMPOSERCXL4009 COMPUTER CHESS' ,

ROM CARTRIDGES

CXL4001 EDUCATION SYSTEM MASTERCARTRIDGE 534.99KEY: iii = uses Joyst ick control le r

(Pi = uses paddle control le rIdl = uses driving control le r

CXL4004 BASKETBALL .CXL4005 LIFECXL4006 SUPER BREAKOUTTMCX4008 SUPER BUGTM"

1) 1

II I.tp)

« n 1) 1

EDUCATION SYSTEM CASSETTE PROGRAMS $39.99/ea.BASIC GAME ANDPROGRAM CASSETTES

CX4101 GUIDE TO BASIC PROGRAMMING'CX4102 BASIC GAME PROGRAMS'

S29.95/ea.

'OctOlJer Delivery , 'NovemlJer Delivery

CX6001 U.S. HISTORYCX6002 U.S. GOVERNMENTCX6003 SUPERVISORY SKILLSCX6004 WORLD HISTORY IWESTERNICX6005 BASIC SOCIOLOGYCX6006 COUNSELING PROCEDURESCX6007 PRINCIPLES OF ACCOUNTINGCX6008 PHYSICS

CX6009 GREAT CLASSICS IENGLISHICX6010 BUSINESS COMMUNICATIONSCX60'11 BASIC PSYCHOLOGYCX6012 EFFECTIVE WRITINGCX6013 AUTO MECHANICSCX6014 PRINCIPLES OF ECONOMICSCX6015 SPELLINGCX6016 BASIC ELECTRICITYCX6017 BASIC ALGEBRA -Prices subject to change.-

We Promise to Deliver!• We GUARANTEE ship dates on prepaid Computer System orders.*• If for reasons beyond our control we miss a ship date, WE WILL REFUND THE SHIPPINGAND HANDLING CHARGES TO YOU - PLUS GIVE YOU A 10% DISCOUNT ON YOURNEXT PURCHASE OF ANY ATARI SOFTWARE!• For prepaid Computer System orders, you'll receive an Accessory Controller of your choice.

'All prepaid orders must be for full amount by Cashier's Check only, payable to ComputerWorld. California residents. please add 6% sales tax.

ORDERING INFORMATION: TELEX 1822741. Type or print item(s) you wish to order.

2. If you pay by personal check: please allow 2 weeks for personal check to clear.

3. If you pay with bank card: We accept VISA, BankAmericard, lViasterCharge. Please include bank card number,

card expiration date, and your signature.4. Add 50· for postage and handling of books, manuals, catalogs, and magazines. Add $10.00 for shipping,

handling, and insurance for hardware and systems orders.

5. Send orders to ComputerWorld, 6791 Westminster Ave., Westminster, CA 92683. California residents, please add6% sales tax.

COInRulerWorldA R AYGAM COMPANY

6791 Westminster Ave., WestminstE~r, CA 92683 (714) 891-2587

Page 36: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 36/68

Q U IC K C H A NGE : A R T IS T R Y

ENGINEERED SPECIFICALLY FOR

THE KIM·1 MICRO COMPUTER

• Protection of Chips andOther Components• Viewing Angle of ReadoutEnhanced

• Improved Keyboard Positionfor Easier OperationEASILY ASSEMBLED

• Absolutely NoAlteration of KIM·1 Required• All Fasteners Provided• Goes Together in Minuteswith a Small Screwdriver

ATTRACTIVE FUNCTIONAL PACKAGE

• Professional Appearance• Four Color Combinations• Improves ManlMachine Interface

MADE OF HIGH IMPACT STRENGTH

THERMOFORMED PLASTIC

• Kydex 100 -: <• Durable• Molded-ln Color• Non-Conductive

AVAILABLE FROM STOCK

• Allow Two to Three Weeks forProcessing and Delivery• No COD's Please• Dealer Inquiries Invited

TOORDER: 1. Fill in this Coupon (Print or Type Please)2. Attach Check or Money Order and Mail to:

NAME the

enc losuresgroup

STREET ___

CITY _

STATE _ ZIP

Please Ship Prepaid --SKE 1-1(s)@ $23.50 Each

California Residents please pay$25.03 (Includes Sales Tax)

771 bush street, san francisco 94108

Color Desired blue 0 beige 0black 0 white [J

',' TM Rohm & Haas Patent Applied For

Page 37: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 37/68

TSAR: A Time Sharing Administrative

Routine for the KIM·1. "

If you think the KIM·1 is too small to do interesting jobs,then consider this program. TSAR is a super monitorwhich supports tlme-sharmg, opening the door to a widevariety of new capabilities. The techniques can easilybe translated for use on other computers.

The program presented here takesover supervisory control of the KIM-1,demoting the KIM monitor to the role of"just another program" sharing execu-tion time with a list of user programs.The monitor, with its display andkeypad, remains available while userprograms are running, permitting true"front panel" operation; examinationand even alteration of memory duringprogram execution. There is provisionfor inserting breakpoints into a programwhile it is running, as well as a TSAR-compatible breakpoint servicing routine.Although the system as presented isconfigured for six programs, in additionto the monitor and TSAR itself, it is easi-ly expanded to provide supervision foras many user programs as memory andstack requirements permit.

Introduction

Not long ago, if anyone had sug-gested to me that I should write a time-

sharing system for my KIM-I, I wouldhave objected on two counts: first, thatit would be pointless with such a small,single-user system; second, that itwould be far too compl icated to design,implement, and operate. I would havebeen wrong on both counts.

I had been working on a designproblem - the problem of providing aperfectly transparent operating environ-ment for my TVT-6 video board. This in-expensive and very versatile boarddraws its timing signals directly fromthe address bus of the MPU and can notfunct ion normally without the full, undi-vided attention of KIM, making its use

along with another program rather awk-ward to orchestrate.

When I had finally tamed the micro-seconds and sync pulses and had mytransparent display operational, I loadedmy LIFE program and settled back,regarding the result with satisfactionand noting how cooperative it all seem-ed, with the display driver and LIFE pro-gram sharing the time of the MPU. Andthen it hit me! This was already a

November, 1979

timesharing system. Moreover, leavingout the TVT-6 would let me streamlinethe system and also extend it to thesupervision of many "simultaneous"programs.

Before explaining the operation of thesystem, let me note resources the

system requires as well as some of thefeatures it offers. Its needs me few: anunexpanded KIM-1 provides sufficientmemory for overseeing the operation ofthirty-some programs; the supervisoryroutine, TSAR, resides in forty-four bytesof page twenty-three; a special , and op-tional, breakpoint routine occupiesanother fifteen bytes on thai: page; fif-teen page zero locations are required forstoring system variables under a six-user-program configuration (with twoadditional bytes needed for each pro-gram over six); and paqe one isdistributed as stack space for thevarious programs.

The only hardware expansion neededis a wire, or possibly a switch, allowingthe interval t imer to send an Interrupt tothe MPU. (See Figure 1.)A speaker, con-nected as in the Kim User M.~nual, canprovide dramatic examples of the sys-tem's use, but is certainly not essentialto its operation.

The most useful aspect of the systemis, in my opinion, provision fOI'a full hexfront panel. Under the KIM monitor, thekeypad and display are used almost ex-clusively to enter and initiate programs.Though individual programs may usethem for special purposes, they general-ly remain idle during program executton,

Under TSAR, however, the rnonitor istimeshared and becomes a monitor inthe full sense of the word, remaining ac-tive while other programs are executlnq,This permits the on-line examination(and even alteration) of any memorylocation, so that one can, for instance:watch a counter as it approaches zero,alter the value of a byte of data to deter-mine its effect on the program, or evenchange an instruction opcooe, all whilethe program is running! Essentially it

MICRO -- The 6502 Journal

Philip K. Hooper3Washington StreetNorthfield, VT 05663

brings full interaction to KIM-1, lettingthe user and running programs interactthrough the services of the monitor.

The cost of this continuous monitor-ing is time-the user programs run moreslowly when timeshared-but there areoccasions, as during certain program

development stages, where this can bean advantage. By using this system withfive dummy programs having large timeslices, we produce an interactive slow-stepper. By letting the programs modifyeach other's time slices (an unnaturalactivity recommended only for produc-ing unpredictable results) we can createan enormous variety of unusual timingpatterns.

The Timesharing Procedure

The 6502 provides ready access to andmanipulation of the stack pointer, andthis in turn permits the realization of afairly simple timesharing procedure. The

programs to berun are placed in a queueand are activated and recalled by TSARas it cycles through the queue. So TSARcan keep adequate track of these pro-grams, each has its own stack area,stack pointer, and time slice determin-ing how long the program will be activewhen its turn comes. The user selectsthe stack areas from page one, while thecorresponding stack pointers and thetime slices are kept in two page zerolists, STAX and TIMES respectively. Theindex number (position in the queue) ofthe program currently executing isstored in location INDEX. Figure 2 il-lustrates this procedure.

Assume that one of these programs,say P2, is running. Under TSAR, the in-terval timer will also be running, andarmed, loaded initially with the timeslice for P2 from TIMES +2. At "timeout," TSAR will be re-entered at location1780, via the NMI vector, and afterdisabling further interrupts TSAR willsave registers A, X, and Y on the stackreserved for P2. P and PC have alreadybeen saved there, as part of the interruptresponse of the 6502. TSAR will then

18:35

Page 38: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 38/68

Figure 1: Enabling the timer interrupts. A SPDT switch connecting

PB7 to elther NMI or IRQ permits the fullest realization of TSAR's

capability. The switch setting should not be changed without first

settlng both lnterrupt vectors to point to the monitor.

replace the stack pointer value for P2 in

STAX + 2, the second position of the

STAX list. This procedure is i llustrated in

Figure 3.

Disabling further interrupts at this

time has no effect on the minimal con-

figuration but is adviseable if there are

other devices that could pull IRQ low

connected to the system, to inhibit inter-

rupts from them during operation of the

supervisory routine.

and later recalled those programs cur-

rently enabled-those with non-zero

time slices; kept the monitor enabled;

and maintained STAX as needed. At any

rate, when INDEX = 2 does recur, the

time slice for P2 will be brought in from

TIMES + 2 and examined by TSMI. If this

is zero, P2 is disabled and will be passed

by. Otherwise, this time slice will be writ-

ten to the timer, to initiate another time

period during which P2 may execute.

Next, the stack pointer specific to P2

will be brought back from STAX + 2 andused to access P2's private stack, from

which the saved values of the V , X , and A

registers will be pulled. Finally, an RTI

Program 2 now remains idle until IN-

DEX again assumes the value of 2.

Before that occurs, TSAR will have look-

ed at six other INDEX values; activated

• TSAR: BY PHILIP K. HOOPER

• MODIFIED 7-19-79 BY MICRO STAFF

17BC COUNT • $0000

17BC X $0300

17BC INDEX • $OOEO

17BC TIMES • $OOEl

17BC STAX $00E8

17BC POINTL • $OOFA

17BC TIMER • $170E

17BC DELAY • $lED4

17BC INCPT • $lF63

1780 ORG $1780

1780 78 ENTER SEI PLEASE DO NOT DISTURB1781 48 PHA PLACE

1782 8A TXA ALL

1783 48 PHA REGISTERS

1784 98 TYA ON THE

1785 48 PHA STACK

1786 BA TSX G ET C UR RE NT STACK POINTER FROM MPU

1787 A4 EO LDY INDEX NOW, WHICH PROGRAM IS RECALLED?

1789 96 E8 STXZY S TU STASH STACK POINTER FOR INTERRUPTED PROGHAM

1788 A5 El LDA TIMES EXAMINE TIMING CONSTANT OF MONITOR

178D DO 02 BNE INDEC IF ZERO, MONITOR DISABLED - MUST RESTORE

178F cs El DEC TIMES RESET MONITOR TIME SLICE

1791 cs EO INDEC DEC INDEX DECREMENT INDEX TO NEXT PROGRAM

1793 10 04 BPL TINDX POSITIVE DENOTES VALID INDEX

1795 AO 06 LDYIM $06 OTHERWISE, RESET INDEX TO POINT TO THE

1797 84 EO STY INDEX GREATEST PROGRAM Q UEUE INDEX

1799 A6 EO TINDX LDX INDEX TENTATIVE INDEX OF NEXT PROGRAM

179B B5 E 1 LDAX TIMES FETCH PROGRAM TIME SLICE

179D FO F2 BEQ INDEC IF ZERO, PROGRAM DISABLED - PICK ANOTHER

179F 8D OE 17 STA TIMER DEPOSIT TIMING INTERVAL IN COUNTER - ENABLE INT17A2 B5 E8 LDAX STAX FET CH STACK POINTER F OR REACTIVAT IlD PROGHAM

17A4 AA TAX PUT STACK POINTER IN X REGISTER

17A 5 9A TXS AND DEPOSIT STACK POINTER INTO MPU

17A6 68 PLA BRING

17.7 A8 TAY IN

17A8 68 PLA REGISTERS

17A9 AA nx OFF

17AA 68 PLA STACK

17AB 40 LEAVE RTl RETURN TO THE PROGRAM

18:36 MICRO -- The 6502 Journal

will draw the status register and pro-

gram counter from this same stack, and

P2 will be off and running again, from

the very place at which it was inter-

rupted. If no other program interferes

with its storage areas, P2 will function

as though it were the only program in the

KIM, although a bit more slowly.

In a small system like this, without

software-in itiated memory protect or

disk-based page swapping, any unwant-

ed interaction between programs must

be prevented by the programmer. This is

managed through carefully planned

memory allocation and through the useof stack storage to make any shared

routines fully reentrant-using different

storage areas (stacks) depending on

which program is using the routine.

Therefore, whenever the monitor is in-

cluded as an enabled program, the

monitor subroutines which use RAM

temporary storage and those which

serve the monitor's keypad and display

routines should not be called by a user

program. The results would be unpre-

dictable and would probably prevent in-

teractive use of the monitor.

This sequence of execution, interrup-

t ion, dormancy, reactivation is followed

by all programs on the queue, includingthe monitor. Depending on its t ime slice,

each enabled program receives from 64

to 16320 microseconds of execution

time, minus TSAR's overhead, when its

turn arrives, while those disabled by a

null time slice are simply passed over.

With six programs enabled in addition to

the monitor, TSAR exacts roughly 80

microseconds to process each interrupt,

and each disabled program increases

this by about 20 microseconds to a max-

imum of 200 with the monitor alone

enabled. The more work the system has

to do, the more efficient it becomes! Of

the above times, 30 microseconds is

taken from the time slice of the program

being reactivated, so that a time slice of01, representing a single Sixty-four

microsecond portion, will actually pro-

vide thirty-four microseconds of execu-

tion time for the program, each time

around.

A time slice range of from 1024 to

261,120 microseconds can be installed

by replacing the value of the byte at

17AO with "OF", which starts the timer's

counter in the divide-by-1024 mode in-

stead of the divide-by-64 mode. Although

this reduces the relative time penalty

charged by TSAR, it also degrades the

response of the monitor somewhat.

Oddly enough, this is an example of

one of the peculiar charms of the TSAR

system. Some of the aggrevations that

TSAR introduces-monitor response an-

noyingly slow at times, startup routine

hard to remember, recovery from a crash

a major undertaking-all of these pro-

vide the peculiar sensation that one is

working on some sort of monster sys-

tem and not just a KIM-1 with 1K of

memory and a 50-odd byte timesharing

supervisor.

November, 1979

Page 39: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 39/68

,NDEX

I OOEO I

./~01

B0022 00E3 00E4 00E5 00E6 00E7

00E9 OOEA OOEB OOEC OOED OOEE

holds the number assigned to the program currently ac~ive

and is used as an offset to retrieve informati;)n from ...

which is a list of seven time slices, for six userprograns and the nonitor, and from ...

which is a list of the seven stack pointers for theseprogra.ns.

The code for this procedure is

presented in the listing. Note that thesections of code for the normal (inter-rupt to 1COO)entry and normal ("GO"-1DC8) exit for the ROM monitor are

closely related to the entry and exit code

for TSAR.Both involvestoring, and later

retrieving, the contents of the PCH,PCl,

P, A, Y, X, and SP registers, which to-

gether completely specify the internal

state of the MPU. However, while the

monitor stores these values in fixed,page zero locations, TSARplaces them

in a user stack reserved for the par-

ticular program which has just beenrecalled.

Using the monitor as the operatingsystem, the user can alter these zero

page locations holding register values,making it possible to exit from the

monitor to a different program, with a

different set of operating parameters,

than the program that was running

before. TSAR does this automatically,by pulling the register values from a dif-

ferent stack, the one corresponding to

the program about to be activated,

rather than from the stack for the pro-gram which was just recalled.

,NDEX

VALUES 00

TIMES

STAX

PARAMETERS

FOR:MON- PROG PROG PROGITOR 2 3

INDEX (OOEO)

TIMES (OOE 1)

S TAX (0 0E8 )

Fig ure 2: Use of pag e z ero me mory, OOEO-OOEE

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• SAMPLE PROGRAMS FOR EXERCISING TSAR •

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

• 1ST SAMPLE PROGRAM MERELY COUNTS, IN HEX, THE NUMBER

• OF TIMES IT IS ACTIVATED, STORING THE COUNT IN $0000,

• WHICH SHOULD BE PRESET MANUALLY TO ZERO

02EO ORG $02EO

02EO A9 00 START LDAIM $00 CLEAR ACCUMULATOR AND USE IT TO

02E2 85 E1 STA TIMES ZERO OUT THE MONITOR TIME SLICE02E4 A5 E 1 LOOP LOA TIMES FETCH THE MONITOR TIME SLICE, AND REMAIN IN

02E6 FO FC BEQ LOOP THIS LOOP AS LONG AS IT IS ZERO02E8 E6 00 INC COUNT RECORD THE CHANGE, WHICH INDICATES

CO MP LET ION O F AN OTH ER

02EA 4C EO 02 JMP START CYCLE THROUGH THE QUEUE, AND REPEAT

• NCTE: USING THE MONITOR TIME SLICE AS A FLAG TO

• INDICATE TO A PROGRAM WHEN IT HAS BEEN RECALLED

• AND THEN REACTIVATED IS A USEFUL TRICK, BUT

• AT A TIME

• 2ND SAMPLE PROGRAM ALSO COUNTS CYCLES, BUT IT

• DOES SO IN BCD, KEEPING THE LEAST SIGNIFICANT

• DIGITS IN OjFF, THE NEXT TWO IN 03FE,

• AND SO ON. IT CAN COUNT VERY HIGH.

0200 ORG $0200

0200 F8 START2 SED DECIMAL SPOKEN HERE

0201 38 STALL SEC SET CARRY SO ADDER WILL WORK PROPERLY

0202 A2 00 LDXIM $00 SET X REGISTER TO ZERO TO

0204 86 E1 STX TIMES ZERO THE MONITOR TIME SLICE

0206 A5 E 1 LOOP2 LDA TIMES CHECK MONITOR TIME SLICE AND,

0208 FO FC BEQ LOOP2 IF IT IS ZERO, KEEP ON CHECKIN'

020A CA NEXT DEX TO Fr, TO INDEX, INITIALLY, 03FF

020B ED 00 03 LDAX X GET CONTENTS OF 03XX020E 69 00 ADCIM $00 ADD 1, SINCE THE CARRY IS SET

0210 9D 00 OJ STAX X AND PUT IT BACK WHERE WE FOUND IT

0213 90 EC BCC STALL WITHOUT CARRY, ADDITION IS FINISHED

SO WAIT TILL NEXT TIME, OTHERWISE

0215 BO F3 BCS NEXT BACK U~ TO NEXT DIGIT & PROPAGATE CARHY

\

• NCTE: THIS PROGRAM MAY BE USED wITH THE PREVIOUS

• PROGRAM BY HAViNG ONLY ONE OF THEM MESS WITH

• TIMES AND HAVING THEM SHARE A RAM LOCATION AS

• A fLAG. ONE SETS THE FLAG, wHILE THE OTHER

• RESETS THE FLAG AND LOOPS.

November, 1979 MICRO-- The 6502Journal

02 04 063 05

LIST OF

TI ME S L ICE S

LIST OF

STACK POINTERS

PROG4

PROG

5

PROG

6

While the monitor uses a single loca-tion, 00F2, for storing its only stack

pointer, TSARmaintains a list, STAX,of

stack pointers, one for each program onthe queue. The six bytes of code from1788 to 1790were included as an after-

thought, after several foolish blunders

on my part had let the system escape

from my control. Theymerely guaranteethe monitor's presence by forcing its

time slice to "FF" if it is ever found at

"00". Resorting to reset, to restore themonitor, is fun the first few times only.

Nonetheless, these six bytes and the fif-

teen bytes used to service breakpoints

may be deleted without otherwise affec-

ting TSAR.

Bringing UpThe System

Managing the TSARsystem is quite a

bit more complex than running a single

program on the KIM, and several stepsare required to put it into operation. The

following sequencewill generate a func-tioning TSAR system.

1. Verify that P87 is connected toNMI (Figure 1).

2. load TSARinto 1780-178B,from

keypad or tape.

3. If loading was from the keypad,

verify correctness of code.

4. Set 17FA,B to point to 1780andset 17FE,Fto point to 17AC,pro-

viding the proper interrupt vec-

tors for TSAR.

5. load all locations from OOEOthrough 00F1with "00".

6. Press "RS", guaranteeing thestack pointer (monitor) at FF. If

you are planning to use the DE-

lAY subroutine from the ROM,

18:37

Page 40: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 40/68

N H r g enerated wh en the

timer times a ut Ois ab le in te rr ~

•I

Sa ve a ll r eg is ter s

~7.

I Store stack po~

~ 8.

I Protect monito~

•I

Select next program I

•r Load and arm t~

~

I Retriev e ne w pointer I

~r

Res tore all r eg ister s I9.

The activities of TSAR as

it supervises the system.

The monitor or' a

u ser program will

execute until its

time slice has b ee n

exha usted, at which

time the interv al

that is ena bled

timer g enerates an

in te rr upt w hic h

returns control to

TSAR, where the

current prog ra m is

retired and t he

"ext ena bled progra mRTt to next progra m on list-s a ct 'v atp ri

Monitor or user progra m

r unn in g un de r s uper vis ion

of TSAR.

Figure 3: Flow of control in the TSAR system.

Table 1

Register Value Storage by the TSARand by the KIM Monitor

TSAR

Typical User ProgramStack locations

KIM

Register Saved

Mon lt or

Dedicated KIMPageZeroRAMl.ocs.

01DA

010B

01DC01DD01DE

010F

YX

APPClPCH

I)OF4

I)OF5

I)OF3I)OF1

OOEF(OOFA)

OOFOOOFB)

Interrupt entry to TSAR (at 1780)or the Monitor (at 1COO)will store the MPU

registers in the locations indicated above. leaving TSARvia an RTIwill restore

these values to the MPU. leaving the Monitor by using 'GO' restores the MPU

from these RAM locations, except that the PCl and PCHare loaded from ()OFA

and OOFB(the pointer), respectively. To replace the original program counter into

the MPU,the contents of OOEFand OOFOare first transferred to 00FAandOOFBbypressing the 'PC' key, moving the Program Counter into the pointer.

Dnitial Initial In it ia 1 Initial Initial Initial

y X A flag PCL PCH

value value value values (EO) (02) ]0109 010A 010B OlOC 01DD 010E 010P

Figure q: Initialization of a user program stack. The stack pointer initially

points to 0109, but since it is increm ented before a ny values are pulled, the

contents of 0109 hav e no effect on the program.

18:38 MICRO-- The 6502Journal

remember that reset puts 17F3

to "FF". Also, if you are inten-ding to use either port A or portB for output, you must recon-

figure at this time, since resetconfigures all port lines as in·puts.

Examine address 00E1, the

monitor time slice. It will be"00",

Press "ST", NOT "GO"! we in-

tentionally interrupt the monitorat this point to raise the activity

to the TSAR system level. The

val,ue at 00E1 should now

become "FF" as the monitor pro-

tection routine leaps in. If this

does not happen, briefly addresslocation 170C, another way toget an NMI pulse, and return toview00E1.If it still does not read

"FF", reset and check the star-tup sequence.

Now, assuming 00E1is at "FF",

try to key in "00". If the systemrejects this, keeping "FF" In-

stead, timesharing is in opera-

tion. If "00" is accepted in OOE1,

generate another NMI (by ex-

amining 170C again) and verifytimesharing as above.

10. As a final indication that tlrne-

sharing is in operation, examine00E8, the stack pointer for the

monitor. Since the monitor is be-

ing interrupted, and not always

at the same place, the value of

OOE8should change, probablyflitting quickly from "F5" to "F7"

and back. Any sign of flickeringhere verifies that TSAR is in

charge and that timesharing isunder way.

11. Key in a user program, notingthat the monitor behaves as italways has. If you intend to loadany user programs from tape, doso before step 8, as the timing

changes under TSAR are not

compatible with serial 1/0.Assume that this first user pro-gram starts at location 02EO,as

does the first of the sample pro-grams, and that its stack ex-tends downward from 01DF,leaving 32 bytes for the monitor,

far more than it will ever need.

This is program 1(the monitor is

program 0), so its initial stack

pointer will go into STAX+1,

00E9.This stack will be access-ed initially by lines 17A6to 17AB

of TSAR.Since TSAR first pulls

register values for Y, X, and A,

and then (with RTI) pulls three

more values for P and PC, wemust provide these six values

immediately above the stackpointer. The values in the firstfour of these locations are used

for the initial register contentswhen program 1 starts running.

November, 1979

Page 41: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 41/68

As they are of no consequencefor the sample programs, theymay be set to "00" or left asfound. However, the final twolocations, 010E and 01DF, holdthe program counter for program1 and must, in this case, be in-itializ.ed to "EO" and "02"respectively, to provide the star-ting address, 02EO. Since thestack pointer must initial ly pointto location 0109, a "D9" is keyedinto location 00E9.

should be sensing it now. If ituses a counter, address thecounter and watch it move.Return to OOE2and vary the timeslice, noting how the programexecution speeds up and slowsdown. Change 00E1 arid note itseffect on the execution rate ofyour program. Enjoy it for awhile, and then brinn anotherprogram into the system. Theprocedure will be the same asabove, from step 11on..although

a different location must be us-ed for the stack, different in-itializing information must beplaced on the stack, and the newstack pointer must be stored in adifferent posit ion of STAX. Dis-able the first program; run either,both, or neither of them; playwith it!

12. Recheck the program code,stack values, and stack pointer.

13. Examine location ObE2 (TIMES+ 1), the time slice for program1, and change it to a non-zerovalue. If your program doesanything you can sense, you

You are MASTER of your own time-sharing system! The sample programsprovided do not represent the ful l rangeof TSAR's potential. For one thing, keep-ing the monitor on-line preventsprogram-generated information from ap-pearing on the display. With additionaldevices for output, the variety of in-teresting programs that can be rununder TSAR is increased greatly.

For example, a memory-mapped videooutput can provide a very .dramatic

visual demonstrat ion of timesharing.With a speaker connected as shown inthe Kim User Manual, several programsmay each toggle the speaker at ratesdetermined by DELAY, a KIM monitorsub-routine at 1ED4 used for serial tele-printer I/O but also useful whenever along software delay is required. Theymay also alter the DELAY parameters,

Y X A P PCL PCH XI

AI

P PCL1

PCIIVALUE A T 11S O liN FLAGS .EITHER T HE SE V AL UE S I IE RE S TO RE D THESE POINT TO THETHE TIME INDEX (00) B, Z, ETC B5 OR B7 (17) WHEN THE BREAK OCCURRED INSTRUCTION AFTEROF BREAK

I I

BREAK OP-CODE

./

Loa de d w he n tim er in te rr upts b re ak poin t r ou tin e.

Figure 5: Breakpoint stack contents. After recall, the pointer addresses the location below the Y value.

Loa de d w he n b re ak a ctu ally oc cu rs .

• 3RD SAMPLE PROGRAM h DVANCES THE POINTER (OOFA,B)

• TO DISPLAY SUCCESSIVE MEMORY LOCATIONS. IT

• INTERFERES SEVERELY WITH THE SIMULTANEOUS USE OF THE

• MONITOR KEYPAD AND DISPLAY.

0217 20 D4 1E START3 JSR DELAY (PRESET 17F2 AND 17F3 TO

DETERMINE RATE OF DELAY

021A 20 63 1F JSR INCPT INCREMENT THE POINTER, OOFA,B

0210 A 5 FA LOA POINTL GET THE LOW BYTE OF THE POINTER

AND USE IT AS THE VALUE

021 F 85 E4 STA TIMES +03 VALUE OF THIS PROGRAM, SHOWN AS 30221 4C 17 02 JMP START3 AND KEEP GOING

• NOTE: THIS PROGRAM BEHAVES UNPREDICTABLY. IT MIGHT

• DISABLE ITSELF, OR IT MIGHT SUSPEND THE ENTIRE SYSTEM

• OR IT MIGHT KNOT.

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

• BREAKPOINT SERVICE ROUTINE •

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• (ENTRY FROM IRQ VECTOR)

HAC ORG $17AC

HAC 48 BREAK PHA SAVE A

17AD 8~ TXA AND X

17AE 48 PHA ON THE STACK

17AF A9 00 LDAIM $00 CLEAR A

17B1 A6 EO LDX INDEX DETERMINE WHICH PROGRAM CAUSED BREAK

17B3 95 E 1 STAX TIMES AND DISABLE IT

1785 B5 E1 SLEEP LDAX TIMES SLUMBER IN A LOOP UNTIL

17B7 FO FC BEQ SLEEP RECALLED BY TSAR

17B9 4C A8 17 JMP GOBACK LET TSAR RESTORE X AND A BEFORE RETURN

• NOTE: THE RTl CODE AT $1788 (IN TSAR) IS EXECUTED

• TWICE AS A PROGRAM IS RE-AWAKENED AFTER A BREAK

November, 1979 MICRO -- The 6502 Journal

(17F2,3), modify each other's time slices,and toggle the speaker port between in-put and output, producing a type ofmayhem in the speaker that varies fromWWII soundtracks, to tuba contests, tobouncing ball bearings, to almost-human-sounding arguments. Using "OF"

to provide longer time intervalsenhances this cacophony.

With several input devices (joysticks,keypads, even push buttons), TSAR per-mits the user connected to each deviceto have apparently sole use of thesystem, timesharing in the tradi tional,multi-user sense. With suitable groundrules established, the users could evenplaya version of "core war" in whicheach tries to get his (no doubt self-relocating) program to destroy the otherprograms before getting zapped by oneof them. This has a vaguely evolutionary,survival-of-the-fittest undercurrent thatkeeps it from becoming too abstract.

Keeping It Up

One problem the TSAR system doespresent is that, lacking proper safe-guards, it is somewhat fragile. A Singleprogram, running amok, can bring downall of the others, including TSAR. For-tunately there are some methods for re-covering gracefully from crashes, andeven for avert ing many of them.

18:39

Page 42: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 42/68

If the system seems to be misbehav-ing, it is a good idea to locate and dis-able the guilty program before it can in-terfere with other programs, the monitor,or TSAR. It is easy to disable any pro-gram simply by setting its time slice tozero. A record detailing what program iswhere on the queue and where thevarious stacks and stack pointers arelocated is very useful here. Once a pro-gram has been deactivated, it may be re-placed on the queue with a different pro-gram, or it may be altered (repaired?)and then returned to service by a simple

time slice change.

If disabling the suspect program failsto correct the system, the best pro-cedure is to disable all user programs,and the faster the better. Then re-intro-duce them individually, testing them oneat a time with the monitor. An externallygenerated IRQ signal is the quickest,cleanest way to disable all user pro-grams, as it invokes the breakpoint ser-vice routine which disables the currentlyactive program in an orderly manner. Aninteresting alternative is to have aspecial "shutdown" program ready butdisabled. In case of trouble, enablingthis program sends it into action to dis-

able everything else and, finally, itself, inan orderly manner.

Triggering IRQ several times will nullthe time slices of all programs (monitor,however, remains, because it is not sus-ceptible to IRQ), leaving each in asuspended state from which it can bereturned to service by simply changingits t ime slice. This is a much less severeinsult to the system than a reset pro-duces, and it should be tried first, when-ever dysfunction is suspected. Ofcourse, if the system is hung in a loopwith the I flag set, IRQ will be ignoredand only a reset will affect the system.

If the system is 'hung', probably in-

dicated by a stable, partially- li t display,the only option is a reset. Then, examineINDEX (ODED),to determine which pro-gram was running at the time of thereset interrupt. Disable that programand, if it was the whole problem, a "hotstart" (set location ODEDto ''~O'' andthen examine location 170C) should re-kindle the system, minus the malfunctor.You can next locate the stack pointer forthe disabled program and use it to deter-mine the register contents (roughly)when it was last activated. Compare thiswith the response of the monitor atreset, which sets both the stack pointerand 00F2 to "FF", obliterating anytraces of stack activity.

Breakpoints

Unique to TSAR, the provision for in-terrogating the code of a program whileit is running can even be extendedthrough the use of breakpoints, whichthemselves may be inserted into the pro-gram while it is running. This featuredepends upon the coincidental good for-tune that each 6502 branch instructionends in a zero and can, therefore, be

18:40

shifted left to the break code "00"without producing any dangerous inter-mediate code.

Recall that the timesharing procedureprobably prevents entering, through themonitor, more than one hex characterper time slice. For example, keying thebreak code over the code "4C" wouldfirst produce the interim code "CO"which would create havoc if executedbefore the second zero could be keyedin, during the next monitor t ime period.Changing a branch code, "XO", to a

break code presents no such problems.Of course, there is the option of dis-abling the program, inserting the break,and reenabling it again; but inserting thebreak into "moving code" is more ele-gant and much more exciting.

When a break code is encountered anon-maskable IRQ is generated, vect~r-ing control to the BSR code, presentedin the listing. This routine first saves theA and X registers on the stack used bythe interrupted program. It then sets thetime slice of the interrupted program tozero, and loops on this condition untilthe current time slice expires and theprogram is recalled by TSAR. The usercan detect the occurrence of a break bywatching the location holding its timeslice, or he can provide a watchdog pro-gram to monitor this value and producea signal when it detects a zero, TSARwill bypass this program on subsequentcycles through the queue, because of itsnull time slice, so the idle program, itsbreakpoints, and its stack mal' be ex-amined and altered at leisure, until it isready to be run again.

At that time, merely keying in a non-zero time slice for the program signals~oTSAR that it is to bereactivated, whenIts turn comes. Although reactivat ion~eturns it to the loop where it wa.ssleep-Ing before recall, the loop condition

(time slice = zero) has been changed,so the program can escape from thisloop and reenter its old code at the nextinstruction after the break.

Since the procedure for bringing a pro-gram back from a break is somewhat in-volved, requiring as it does the unnest-ing of two different interrupts, a closerlook might be worthwile. First TSAR atline 1790, discovers that the pwgra"; isagain enabled, so its time slice is loadedinto the interval timer. Then the stackpointer for this program is brought infrom STAX. It will point to the locationjust below that where the Y register wasstored. Registers Y, X, and A am loaded

from this stack, and RT!restores the flagregister, in which the Z flag is SET, andreturns control at line 17B5 or 17B7 ofthe breakpoint routine. This is the stall-ing loop where the program idled fromthe break interrupt until its former timeslice expired and it was recalled byTSAR.

Now, however, its t ime slice has beenadjusted from zero, and when thls is dis-covered the loop is abandoned and con-

MICRO -- The 6502 Journal

trot goes once more to TSAR's exit rou-tine, this time at 17AB . The X and Avalues from before the break are broughtin, and the second pass through RTI re-stores P and PC, returning control to theuser program at the instruction follow-ing the branch/break code. This entireprocedure is carried out with no effecton the other programs operating underTSAR, except that each runs a bit moreslowly when this program returns to ser-vice and again requires a slice of theMPU's time.

Caveat ComputorBecause of significant differences

between operating under TSAR andoperating under the KIM monitor, a fewwarnings are in order. Although mosthave been mentioned before, they arecollected here for emphasis and elabor-ation. Programs running simultaneouslyunder TSAR, including the monitor, mustnot normally share RAM storage or usecommon subroutines unless they are ful-ly reentrant. This restricts user pro-grams from calling the keypad and dis-play routines if the monitor is enabledand monitor RAM locations, like th~pointer at OOFA,Bmust be scrupulouslyavoided. However, it is possible to bring

up the TSAR system without an enabledmonitor, permitting user programs touse the monitor utility routines. Simplyaltering the monitor protect code andthen disabling the monitor is an in-elegant but easy way to manage this. Itdoes, however, fill one place on thequeue with a dead monitor.

A better procedure is to set up all thestacks, time slices, and pointers in ad-vance, init iate the execution of a singleuser program from the monitor (with"GO"), and then use "ST" to leap up toTSAR. Although this approach sacri-fices interact ive control of the system,that may be prevented by giving up the

breakpoint routine and re-directing IRQto the monitor at 1COO.An externaldevice (switch?) that can deliver an IRQmight now restore the monitor on-line.Note that this procedure differs .rrorn arecall by TSAR, in that the registers ofthe interrupted program are saved inmonitor RAM instead of the programstack, meaning that the monitor has, forthe time being, replaced one of the userprograms on the queue. When themonitor is no longer needed, "PC"followed by "GO" will switch them backagain, putting the monitor out of and theuser program back into circulation.

A disadvantage of this procedure isthat, without additional control hard-ware, the program which is replaced bythe monitor will be selected by chance,and several attempts may be needed tolocate a suitable candidate, one you arewilling to have idle as long as themonitor is in use. To minimize repeatedblind interrupts and restarts of the sys-tem, disable all of the programs that youwish to keep running the first time youIRQ the system into the monitor. Thisgreatly increases the chance that, on the

November, 1979

Page 43: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 43/68

next interrupt, a non-essential programwill be replaced by the monitor, and thenthe disabled programs can be reenabled.I prefer, instead, to retain continuousmonitor presence and have my user pro-grams do their 1/0 through ports ratherthan through the keypad and displayroutines.

Because of the changes in timing in-troduced, serial 1/0 drivers, such as thecassette and serial teleprinter routinesin the ROM, cannot be expected tooperate properly under TSAR.

For more than six user programs,references to STAX, TIMES, and INDEXwill need to be changed in TSAR, to re-flect the re-organization of page zeromemory use.

One of the most bizarre malfunctionsthat can occur under TSAR is to havemore than one copy of the monitor con-currently active. Since the code is notreentrant, the multiple copies shareRAM locations and interact oddly, pro-ducing such symptoms as:

a. Keystroke double entry. Thismay be nice for bbookkeepers,

but it makes it very difficult toaddress location 0327 whenpresslnq the "3" key inserts twonibbles of "3", while the" +"key advances two cells at a time.

b. Total or sporadic failure to res-pond to certain keystroke com-mands, as one copy of themonitor receives the command;

but, before it can finish ex-ecuting it, the other copy garblesup the message.

An intriguing challenge, at this point,is to locate and disable the imposter-the marauding mock monitor-before itbrings down the system altoqether. Myrecord of two successes in five trys ismore impressive than it sounds.

The possibility of numerous heirarchy

violations exists under TSAFI because,in the absence of protectable memoryregions (ROM doesn't count here), anyexecuting program is considered theequal of any other. This permits a lowlyuser program, intention-ally or other-wise, to plunder page twenty-three andwound or altogether destroy belovedTSAR. He may even rnanaqe to wrestcontrol of the system, gainin!;1thereby asort of immortality, by prsventlnq thechanging of INDEX or by dlsabllnq allcompetition. The opportunities for suchexotic malfunctioning are vast, but theyare easy to avoid and the interest theycontribute far outweighs whatever minorannoyance they might occasionally pro-

duce. In fact, they can be a source ofvery interesting diagnostic oppor-tunities. For instance, imagiM trying toreestablish control in a sl tuat ion wheremonitor monitors monitor.

RTI

As I mentioned earlier, neither thedesign nor the operation of TSAR is over-

Iy complicated. In spite of the enormousincrease in capability that TSAR bringsto KIM, the system is really quite simpleto bring up and to operate. In fact, ex-cept for some flickering of the display,the monitor behaves as if it were incharge, rather than operating under thesupervision of TSAR. Moreover, I havefound that any apparent malfunctioningof TSAR could eventually be traced tocarelessness on my part-in running aflawed program or in failing to ini tialize

a pointer-stack combination properly.

I assume that this system is easilyadapted for use on other 6502 com-puters, and I would like to hear fromanyone who brings it up on an AIM, SYM,or other 6502 machine, or who finds in-terest ing, useful, or entertaining appli-cat ions for it . How about a memory map-ped display routine providing current in-formation regarding the system status,like: number of currently enabled pro-grams, disabled (i.e. available for use)INDEX values, percentage of runningtime alloted to each enabled program,maximum stack depth attained by eachprogram (could head off disasters). Of

course, this program would be on thequeue and would be reporting on itselfas well as on the others. With all that va-cant ROM space from 1A96 to 16F9, Iwish Iknew a way to hide TSAR upthere,out of danger from peasant programsand proletarian programmers, but readyto take command of a timesharingsystem when summoned.

T.D.Q.TAPE DATA QUERY

PET-8K SOL-IIA TRS-80-LEVEL II

.. FILE MANAGEMENT SYSTEM-Uti liz es Dual Audio Cassette Recorders

.. INTERACTIVE QUERY L.ANGUAGE=Engl ish-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 $50.00

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

INVENTORY CONTROL $35.00ACCOUNTS RECEIVABLE $35.00

ACCOUNTS PAYABLE $35.00ORDER PROCESSING $35.00CUSTOMER DIRECTORY $25.00APPOINTMENT SCHEDULING $25.00

Each With Cassette And Manual

NOW AVAILABLE

For SOL-llA and PET -8K

GENERAL PACK 1 $11.00

GENERAL PACK 2

(Checkbook Balancer, Tic Tac Toe, Metric Conversion)

$19.00

Send Self-Addressed Stamped Envelope ForComplete 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)

(Space Patrol, Biorhythm, Battlestar, One-Armed Bandit)

FINANCIAL PACK 1

(Loans, Depreciation, Investments)

FINANCIAL PACK 2

$13.00

$13.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)

$13.00AME PACK 2 - (children - educational)

(Arithmetic God, Addition Dic.e , Travel)

For the KIM-1

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

Page 44: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 44/68

BOX 120

ALLAMUCHY, N.J. 07820

201-362-6574

H UD SO N D IGITA L ELEC TRO NIC S IN C.

inc.

THE HOEMINI·OI!,K SYSTEM

VERSIONS

KIM

TIM

AIM 65 - 4th Otr. '79

SYM - 1stOtr. '80

SINGLE DRIVE

DUAL DRIVE

$ 795.00

$1195.00

Complete with all hardware.

Interconnecting cables, FODS,

text editor and user and instal-

lation manuals.

The HOE DM816-MD1 Mini Disk System is the per-

ipheral you have been waiting for. No longer bounded

by long and unreliable cassette saves and loads, your

cornputer becomes a sophisticated system for program

development or general purpose use. With the HOE

Mini-Disk you load and save programs in seconds, not

minutes or hours. And, since all transfers to and from

the Mini-Disk are verified for accuracy, the data will be

there when you need It.

The HIDE DM816-MD1 Mini-Disk has been "systems"

engineered to provide a complete and integrated capa-

bility. Software and hardware have been built as a team

using th e most reliable components ava ilab le . The sys-

tems software includes the acclaimed and proven

HDE File Oriented Disk System and Text EDitor, requir-

ing only BK for th e operating software and overlay area.Systems expanding programs available include the

two-pass HDE assembler, the Text Output Processing

System and Dynamic Debugging Tool. Hardware in-

cludes a Western Digital 1771 based controller In a

state-of· the-art 4'12 x 6'12" card size, Shugart SA 400 drive

and the Alpha power supply.

The storage media for the DM816-MD1 is the stan-

dard, soft sectored 5'/.' mini diskette readily available

at most computer stores, and HDE has designed the

system so that the diskettes rotate only dunng disk

transactions, favorably extending media life. A disk

formatter routine included with the system, formats the

diskettes, verifies media integrity by a comprehensive

R/W test and checks drive RPM. Addit ional utili ties

provide ascending or descending alpha numeric sort.

disk pc.cking, text output formatting, file renaming,

fi le addressing and other capabili ties.

HOE PRODUCTS. BUILT TO BEUSED WITH CONFIDENCE.

AVAILABLE DIRECT ORFROM THESE FINE DEALERS:

JOHNSON COMPUTER PLAINSMAN MICROSYSTEMS

LONG ISLAND

COV1PUTER GENERAL STORE LONE STAR ELECTRONICS

Box 1712

Auburn. Ala. 36830

800-633-8724

ARESCO

PO Box 43

Audubon. Pa. 19407

215-631-9052

103 Atlantic Avenue

LynbrooK. N Y 11563

516-887-1500

Box 488

Manchaca. Texas 78652

612-282-3570

Box 523

Medina. Oruo 44256

216-725-4560

Page 45: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 45/68

Interfacing the CI·812 to the KIM

I f you want to add 1 /0 capabilities to your KIM thenconsider the CI·812 1/0 board and its abilities. '

The Percom CI-812110 board contains

a full-duplex data terminal interface(RS-232) and a cassette interface that

can load and dump data at rates up to

2400 baud. The CI-812 comes with 8080

software and is useless to 6502 owners,

as is. I have interfaced a CI-812 to a

KIMSI 6502 to S-100 motherboard, and I

have written software that loads and

dumps to the CI-812 from a KIM.

There are several reasons why I

wanted to add this board to my I/O

library. First, under the r ight conditions,

data transfer can take place very quickly

compared to the standard 10 cps of the

KIM, and the rates are easily controlled

in the software.

Second, if the user is interested in

building a terminal to communicate with

a big computer or with another small

computer via a modem, all that is need-

ed additionally is a modem ($125 for a

Pennywhistle), a TVT-6 ($35), and a video

monitor ($150), or a converted black and

white TV, to turn the KIM into a full-

fledged intel ligent terminal.

Third, data received from magnetic

tape is self-clocked with a signal ex-

tracted from the data. Speed variations

in the tape drive and baud rate changes

are thereby eliminated as sources of er-

ror.

The KIMSI generates S-100 bus

signals and the decode enable from the

signals on the expansion connector of

the KIM. S-100 signals of the bus master

type used by the CI-812, in addition to

the tri-stated address lines and the DO

and 01 lines, include PWR, PDBIN, SINP,

and SOUTo PWR is an active low signal

denoting stable data on the DO lines,

PDBIN is an active high signal that

November, 1979

enables the 01 lines, while SINP and

SOUT are active high signals that in-dicate the addressing of an I/O device.

The CI-812 does not directly interface

with the KIMSI because of timing pro-

blems associated with SINP, SOUT, and

the DO buffer enable. Also, the 2 MHz

clock pulse required by the CI-812 is not

generated by the KIMSI. The procedure

for overcoming these problems is:

1. Jumper the 1 MHz enable from

finger 62 of the KIMSI to finger

49 of the KIMSI.

2. Bypass the first divide-by-two

stage of the clock by bsndlnq up

pin 5 IC9 of the CI-812 and jump-

ering pin 5 IC12 to pin 81C3.

3. Create a new signal, which I call

SNOUT, that goes high whenever

an I/O device is addressed. SNOUT

is available at pin 10 IC9 of the

KIMSI. Jumper it to flnqer 96 of the

KIMSI.

4. Bypass the OR-INVERT of SINP

and SOUT by the CI-8t2 by jump-

ering finger 96 of the KIMSI to pin

IC20 of the CI-812 and by bending

up pin 4 IC2 of the CI-8t2.

5. Permanently enable the DO buffers

by jumpering pin 12 IG14 of the

CI-812.

This completes the hardware revision

of the KIMSI and the CI-812. The CI-812

outputs bi-phase (Manchester) code con-

sisting of bursts of 2400 Hz square

waves for a logiC one and 1200 Hz

square waves for a logic zero. Impress-

ing unfiltered square waves on magnetic

tape and then reading them involves a

MICRO -- The 6502 Jeurna]

Jim Dennis

2305 Pinecrest

Nacogdoches, TX 75962

double differentiation process that can

cause errors at high baud rates. For thisreason, computer grade tape and baud

rates of not more than 300 are recom-

mended. Three hundred baud is known

as the Kansas City standard.

The program shown is a checksum

loader-dump routine which I have written

for the KIM-PERCOM-KIMSI combina-

tion.The KIMSI uses memory mapping to

address 110 devices, reserving address

range FOXX for 1/0 devices.

My PERCOM board is addressed at

FOEX; X = 1,2. The program follows the

format of the KIM cassette loader and

dump, loading block headers and EOT's

in Hex and all else in ASCII. No SYNcharacters are necessary. When a pro-

gram has been dumped, the monitor

takes over at address 0000. If a program

has loaded correctly, the address dis-

play will light at 0000 also. If an illegal

hex character has been encountered,

meaning that the tape has been read in-

correctly, the display will light at the

starting address of the loader.

For example, if two ASCII characters

are decoded to a J6, which is supposed

to be a hex byte, then the tape has been

read incorrectly. If a checksum error oc-curs, then the display will light with the

calculated checksum high or low byte

repeated twice in the address display.

The ASCII - hex checksum load and

dump routine for the KIM uses the

following KIM monitor subroutines: VEB,

INTVEB, CHKT, INCVEB and PACKT.

The CI-812 is addressed at FOE1 and

FOE2 in the program listing. The ASCII

- hex dump starts at 0000 and loads at

0070. To change to another location,

modify locations denoted by"'" to

reference the new page.

18:43

Page 46: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 46/68

SUBROUTI NE

OUTCHR

OUTBYTC

OUTBYT

L DASC I I

HEXTOAS

FUNCTION

L OADER BEG IN S H ERE

SET UP VES AS LOADER

008e FO 02 BEn GETBYT008E DO F7 BNE ROY?

0090 20 23 01* GETBn JSR ASClIHEX0093 CD F9 17 CMF' 10

0096 FO 02 BEQ GO

0098 D O F6 BNE GETBYT

009A 29 23 01*GO JSR ASCIlHEX

0090 20 4C 19 JSR CHKSUMOOAO 80 ED 17 STA VEB + 1

00A3 20 23 01* JSR ASCIIHEX

00A6 20 4C 19 JSR CHKSUM

00A9 80 EE 17 STA VEB + 2

OOAC A 2 02 G02 LoX IM 02

OOAE 20 32 ()l*GOI JSR LDASCIIINITIAL IZE VEB AS DUMP 00B1 C9 2F CMPIM EOT

00B3 FO 17 BEQ CONT00B5 20 00 :lA JSR PACKT

00B8 FO 03 BEQ VALASCOOBA 4C 4F J .C JMP START

OOBD CA VALASC DEX

OOBE D O EE BNE G01

OOCO 20 4C 19 JSR CHKSUM00C3 4C EC Ii JMP V EB

00C6 20 EA 19 JS R INCVEB00C9 4C AC 00* JMP G02

OOCC 20 23 01*CONi JSR ASCIlHEX

OOCF FO 03 BEQ C KOK?0001 4C 2B 19 JMP ERROREX

0004 CD E7 17 CKOK? CMP CHKSUML0007 FO 03 BEQ OK

0009 4C 2B 19 BADNEWS J MF' ERROREX

OODC 20 23 01*OK JSR ASCIIHEX

OODF CD E8 17 CMF' CHKSUt-t1

00E2 D O F5 BNE BADNEWS

00E4 A 9 00 LDAIM 00

00E6 4C 2B 19 JMP NORMEX

0100 20 4C 19 JSR CHKSUM

0103 A8 TAY

0104 4A LSRA0105 4A LSRA

0106 4A LSRA0107 4A LSRA

0108 20 13 01 * JSR HEXTOAS0108 98 TVA

OlOC 20 13 01 * JSR HEXTOAS

010F 98 TYA0110 60 RTS

0111 EA NOP

0112 EA NOP0113 29 O F ANDIM OF0115 C9 OA CMPIM OA

0117 18 CLC

0118 30 02 BPL CONV

OllA 69 07 ADCIM 07o 11C 69 30 C O N ' I ADCIM 30

o lIE 20 56 o o - J SR OUTC HR

0121 60 RTS

0122 EA NOP

0123 20 32 O:~* JSR LDASCII0126 20 00 1 1 1 J SR PACKT

0129 20 32 01* JSR LDASCII

012C 20 00 1A JSR PACKT

o 12F 60 RTS0130 EA NOP

LOADER U131 EA NOP0132 A9 01 LDAIM 010134 80 EO F C I STA UART

0137 AD E1 FO LOOP LOA UARTOUT

013A AD EO Fe> LOA FLAG

0130 29 40 ANDIM 40o 13F FO F9 8EQ LOOP

0141 AD E l Fe LOA DATA

0144 60 RTS

DUMPS ASCII CHR ON TAPE

DUMPS 1HEX BYTE AS 2 ASCI I OlR AND

INCREMENTS CHKSUM

SAME A S ABOV E BUT DOES NOT INC OlKSUM

LOADS 1 ASCII CHR

CONV ERTS 1/2 HEX BYTE TO ASCII

0000 A 9 AD

0002 80 EC 17

0005 20 32 19

0008 A 9 2A

OOOA 20 56 00*0000 AD F9 17

0010 20 03 01*0013 AD F5 17

0016 20 00 01*0019 AD F6 17

001C 20 00 01*001F AD ED 17 STRT

0022 CD F7 17

0025 AD EE 17

0028 ED F8 17002B 90 lA

0020 A9 2F

002F 20 56 00'0032 AD E7 17

0035 20 03 01*0038 AD E8 17

003B 20 03 01"003E A9 000040 85 FA

0042 85 FB0044 4C 4F IC

0047 20 EC 17 DUMP2004A 20 00 01'

0040 20 Eft. 19

0050 4C IF 00'0053 EA

0054 EA0055 EA

0056 48

0057 A9 030059 80 EO FO005e AD E1 FO005F AD EO FO CU:AR

0062 29 80

0064 FO F9

0066 68

0067 80 E1 FO

006A 600068 EA006C EA

0060 EAOG 6E EA006F EA

0070 A 9 800072 80 EC 17

0075 20 32 19(;J78 A9 4C

007A 80 EF 17

0070 A9 C6 *007F 80 FO 17

0082 A9 00 *0084 80 F1 17

0087 20 32 01* ROY?

008A C9 2A

18:44

LDAIM AD

STA V EB

JSR INTVEB INITIAL IZE VEB

LDAIM ASCII'* ' ASCII SYNCJ SR OUTCHR OUTPUT BLOCK HEADER

LOA 10

JSR OUTBYT OUTPUT 10 WITHOUT CHKSLOA SAL STARTING ADDRESS LOW

J SR OUTBY TC OUTPUT WITH CH KSUM

LOA SAH STARTING ADDRESS HIGH

JSR OUTBYTCLOA VEB + 1 GET CURRENT ADD. LOW

CMP EAL CMP WITH ENDING ADD. L

LOA VEB + 2 GET CURRENT ADD. HIGH

SBC EAH SBC ENDING ADD. HIGHBCC DUMP2 DO THEY AGREE?

LOA ASCII'/'YES, LOA ASCII SLASHJSR OUTCHR OUTPUT EDT

L OA CH KSUML G ET CH KSUM L OW

JSR OUTBYT OUTPUTL OA CH KSUt+l G ET CH KSUM H IG HJSR OUTBYT OUTPUT

LOA 00STAZ PO IN TL

STAZ PO I N THJMP START ALL OK, RETURN TO MON

JSR VEB PICK UP NEXT BYTEJ SR OUT BY TC OUT PUT

JSR INCV EB INC CURRENT ADDRESS4C STRT

NO P

NO PNO PPHA SAVE BYTE

LDAIM 03 LOA SELECT CODESTA CAS-SEL SEL ECT CASSETTE MO DELOll UARTOUT READ UART TO CLEARLOA STATUS READ STATUS

ANDIM 80 MASK STATUS BIT

BEQ CLEAR LOOP IF STILL TRANSMITPHA RESTORE BYTE

ST A CASOUT OUTPUT TO UART

RTSNO PNO P

NO PNO P

NO P

LDAIM 80STA V EB

JSR INTVEB INITIAL IZE VEB ASLDAIM 4CSTA VEB +3

LDAIM C6STA VEB + 4

LDAIM 00 LOADER RETURNS FROM VEBSTA VEB + 5 WITH JMP TO LOC. 00C6

JSR LDASCII LOOK FOR BLOCK HEADERCMPIM '* ' IS IT A SYNC?

MICRO -- The 6502 Joumal

YES, PICK UP NEXT 2 CHARAC.NO, LOOK AG AIN

G E T NEXT 2 C HAR. AN D C ON VERTIS IT THE RIGHT BLOCK?

YES, G ET FIRST CHARACTERNO, KEEP LOOKING FOR 10

G ET BYTE AND CONV ERT TO HEXINC CHECKSUM

STORE CHKSUM L OW

STORE CHKSUM H IGH

L OX CH AR. CO UN TER

G ET ASCI I CHAR.IS IT EDT?

Y ES, FIN ISH

NO, PACK ASCII AS HEX

BEQ VALID ASCII CHAR.

ERROR EX ITDEC. CHM. COUNTER

G ET 2ND CHAR.

IN C CH KSUM

MOVE SA TO VEB

INC. CURREN T ADD.L OOP BAK FOR MORE CH AR.GET CHKSUM

IT IT V ALID HEX?NO, EX IT

YES, COMPARE WITH CALC. CHKSCHKSUM LOW AGREES

C HKSUM l.OW DOES NOT AGREEGET C HKSUM H IG H

COMPARE W ITH C AL C. C HKSUMH

CH KSUM H IG H DOES N OT AG REE

CHKSUM ~,GREES

CAL C. C HKSUM

SAV E BY TE

SHIFT OUT LSB

CON VERT TO ASCI IRESTORE BYTE

OUTPUT MSB AS ASCI I

RESTORE BYTE

MASK MSB

CONVERT TO ASC II

OUTPUT AS ASCI I

READS UART

PACKS 2 ASCI I CHAR.AS 1 HEX BYTE

CODE FOR C ASSET TE L OADOUTPUT TO UART

CLEAR UA~~T

READ STATUSMASK STATUS BIT

IF NOT READY, WAIT

LOAD ASCII CHAR.RETURN

November, 1979

Page 47: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 47/68

)I

AMPERSORTAlan G. Hill

12092 Deerhorn DriveCincinnati, OH 45240

I apologize to MICRO readers for theerrors in the listing of AMPERSORTpublished in MICRO 14:39. The problemwas a result of including the first fivepages of an earlier version with the lasttwo pages of a later version to whichlines 3940 thru 3946 were added. This

caused, as many readers discovered; theobject address of some of the precedingcode to be incorrect. Attached is alisting of the correct object code.Anyone wishing to receive an improvedversion on cassette may do so by sen·ding $5.00 to me at the above address.

Several people have asked if AMPER-SORT can be used with Applesoft inRAM rather than ROM. With the follow-ing changes it can:

Routine ROM Addr. RAM Addr.

FRMNUM $D067 $156A

GETAOR $E752 $lF49GET8YT $E6F8 $lEEFSNER $OEC9 $16CC

The Applesoft RAM BASIC programmust also include fhefollowingstatements that must be executed priorto the first '&SRT' command:

POKE 2142,244: POKE2143,3

The specific changes to AMPERSORTfor Applesoft RAM are:

Address ROM Ver. RAM Ver.

$5269 67 6A

$526A 00 15$526C 52 49$5260 E7 1F$527A 67 6A$5278 DO 15$5270 52 49$527E E7 1F$52A9 C9 CC$52AA OE 16$5284 F8 EF$5285 E6 1E$52CO Fa EF$52C1 E6 1E

*520~.5589

5200- ~8 20 E6 5~.68A2

5208- 2C 55' DO ~6 2081

5210- 0 0;5.DO FJ·.A200

5218';: 20 Bl00 C92C 1;"0

5220- 72 55 E8 EO 10 DO5228~ 29 Cit. DD 72' 555230- 2-4 C9 25 DO . 15

5238- 80 11!7255.'1D524.0- 10 A9 02 85

52~8- DOA9 05

5250~. D O

5258- 73

5260- EC5268~ 20

5270.,.5278-

528.0-

528.8-

5290-

5298.-521\0,,,.

N:0teon CIl.l!rle.s. Husband'sS~ech PfQcetltlC)rtQr the. PET. . MICROJ6:4f

Readers intere:i)ted in obtaining addi-tipnalfnformationabolJt the. Dala-BQYSpeech Processor should contact JimAnderson at:

MIMIC ElectronicsBoX92f .Acton, MA 01720

- .53CO__ 8 2 55t3Cg ... DO 1. 4

53DO- B1 D8

53[18- c

536:0'-' C-4

90

C8DEa8

E6

30 OCB1DS

2.0 C1 5~~C

ni DC 90 2F

54 4C05 54

EF FO.06 C-4O F C-4 FO 90C4 Ef FO 0998 [15 E7 DO

D1 DC

5~

19

25FO

EE' AS EllE1 90 1.4DF .A5 DE C5))5 n 07 20£ IE 5 3 4C 5903 4C 6115~

88 B1

D648

DA

91

52E~:"

52ES-

52FO-

52FS-

5300-'

530IJ-

5310-

5318-5320-

S.32IJ-

5330-

533IJ-

5340-

5348--

53'50-

53:58-

536()-

5368-

5370:- 185378- AS D75380- DE 69

5388- 00 85

5390- VA 65

539B-00 85

53A-i1- DC CS

53Mi- FOOl53BO- D6' FO.

53B8- 4C,85

Page 48: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 48/68

rr::-h

t::Yal".lu:I[- .....)INTVIf'..a: IfOOUU

[X.....NDIJI. . O O U L l

The world we live in is full of variables we want tomeasure. These include weight, temperature, pressure,humidity, speed and fluid level. These variables arecontinuous and their values may be represented by avoltage. This voltage is the analog of the physical varia-ble. A device which converts a physical, mechanical orchemical quantity to a voltage is called a sensor.Computers do not understand voltages: They under-

stand bits. Bits are digital signals. A device which con-verts voltages to bits is an analog-to-digital converter.Our AIM16 (Analog Input Module) is a 16 input analog-

to-digital converter.The goal of Connecticut microComputer in designingthe DAM SYSTEMS is to produce easy to use, low costdata acquisition modules for small computers. As theline grows we will add control modules to the system.These acquisition and control modules will includedigital input sensing (e.g. switches), analog input sens-ing (e.g. temperature, humidity), digital output control(e.g. lamps, motors, alarms), and analog output control(e.g. X-Y plotters, or oscilloscopes).

Connec to r s

The AIM 16 requires connections to its input port(analog inputs) and its output port (computer inter-face). The ICON (Input CONnector) is a 20 pin, soldereyelet, edge connector for connecting inputs to each ofthe AIM16's 16 channels. The OCON (Output CONnec-tor) is a 20 pin, solder eyelet edge connector for con-necting the computer's input and output ports to theAIM16.The MANMOD1 (MANifold MODule) replaces the

ICON. It has screw terminals and barrier strips for all16inputs for connecting pots, joysticks, voltage sources,etc.CABLE A24 (24 inch interconnect cable has an inter-

face connector on one end and an OCON equivalent onthe other. This cable provides connections between theDAM SYSTEMS computer interfaces and the AIM16 orXPANDR1 and between the XPANDR1 and up to eightAIM16s.

ICON $ 9.95

OCON $ 9.95MANMOD1 $59.95CABLE A24 $19.95

~'nalognp ut M o dule

The AIM 16 is a 16 channel analog to digital converterdeslqned to work with most microcomputers. TheAIM16 is connected to the host computer through thecomputer's 8 bit input port and 8 bit output port, orthrouqh one of the DAM SYSTEMS special interfaces.The input voltage range is 0 to 5.12 volts. The input

voltage is converted to a count between 0 and 255 (00and FF hex). Resolution is 20 millivolts per count. Ac-curacy is 0.5% ± 1 bit. Conversion time is less than 100microseconds per channel. All 16 channels can bescanned in less than 1.5 milliseconds.

Power requirements are 12 volts DC at 60 maoThe POW1 is the power module for the AIM16. OnePOW1 supplies enough power for one AIM 16, oneMANMOD1, sixteen sensors, one XPANDR1 and onecomputer interface. The POW1 comes in an Americanversion (POW1 a) for 110 VAC and in a' European ver-sion (POW1 e) for 230 VAC.

AIM16 $179.00

POW1a $ 14.95POW1e $ 24.95

XPANDR1

The XP)!.NDR1 allows up to eight AIM 16 modules to beconnected to a computer at one time. The XPANDR1 isconnected to the computer in place of the AIM16. Up toeight AIM16 modules are then connected to each of theeight ports provided using a CABLE A24 for eachmodule. Power for the XPANDR1 is derived from theAIM16 connected to the first port.

XPANDR1 ... $59.95

TEMPSENS

This module provides two temperature probes for useby the AIM16. This module should be used with theMANMOD1 for ease of hookup. The MANMOD1 willsupport up to 16 probes (eight TEMPSENS modules).Resolution for each probe is 1°F.

TEMPSENS2P1 (-1oaF to 120aF) ... $49.95 !

Page 49: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 49/68

Computer Interfacesand Sets

For your convenience the AIM16 comes as part of anumber of sets. The minimum configuration for a usablesystem is the AIM16 Starter Set 1. This set includesone AIM16, one POW1, one ICON and one OCON. TheAIM16 Starter Set 2 includes a MANMOD1 in place ofthe ICON. Both of these sets require that you have ahardware knowledge of your computer and of computerinterfacing.For simple plug compatible systems we also offercomputer interfaces and sets for several home com-puters.

The PETMOD plugs into the back of the CommodorePET computer and provides two PET IEEE ports, oneuser port and one DAMSYSTEMS port. The PETMODisconnected to the AIM16 or XPANDR1with CABLE A24.The PETSET1 includes one PETMOD,one CABLE A24,one AIM16, one POW1 and one MANMOD1. To readand display a single AIM16 channel (N) using thePETSET1 the BASIC statements

are all that is needed.The KIMMOD plugs into the COMMODORE KIM ap-plications connector and provides one application con-nector and one DAM SYSTEM'S port. The KIMMOD isconnected to the AIM16 or XPANDR1with CABLE A24.Assembly and machine language programs for readingand displaying data are included. The KIMSET1 in-

cludes one KIMMOD, one CABLE A24, one AIM16, onePOW1 and one MANMOD 1.All sets come in American and Eurooean versions.

AIM16 Starter Set 1a (110 VAC) $189.00AIM16 Starter Set 1e (230 VAC) $199.00

AIM16StarterSet2a(110VAC) $259.00AIM16 Starter Set 2e (230 VAC) $269.00

PETMOD $ 49.95KIMMOD $ 39.95

PETSET 1a $295.00PETSET1 e $305.00

KIMSET1a $285.00

KIMSET1 e $295.00

Coming Soon

TEMPSENS-2P with other temperature ranges. Inter-faces for TRS-80, APPLE, AIM65. Light sensors. Out-put modules. Contact us for price and availability.

Dealers

Give your potential customers a reason for buying yourcomputers. We offer excellent discounts to legitimate

dealers. Contact us for our dealer pack.

Our Guarantee of Satisfaction

Our customers are our most important asset. Wewantyou to be pleased with whatever you purchase from us.We strive to offer top quality products at reasonableprices. We believe you should see an item before youspend your hard earned cash for it.Aslc for a demonstration at your local computer storeso you can be sure our products perform as you want

them to perform. Yourdealer is a valued source of infor-mation and advice.If you cannot see our products in advance, and order

direct from us, we offer a money back guarantee. If ourproducts don't perform as you expect, return the mer-chandise to us within 30 days, in its original condition,and we will refund the purchase price.Our standard warranty for all our products is 90 days.

Order Form

CONNECTICU T m icroCOM PU TER , Inc.150 POCONO ROAD

BROOKFIELD, CONNECT/CUT 06804

TEL: (203) 775·9659 TWX: 710-456·0052

QUAN TITY DESCRIPTION PRICE TOTAL

CTAL

ingand shipping-add per order $3.00

n o rde rs add 10% for A IR pos tage

ct icut residents add 7% sales tax

ENCLOSED

SUST

Handl

Foreig

Conne

TOTAL

NAME

COMPANY _

ADDRESS _

CITY

STATE

VISA 0 MIC 0 Expiration date _

___________ ZIP _

Card number _

Page 50: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 50/68

PEr Printer Adapter

The CmC ADA 1200 drives an RS-232 printer from thePET IEEE-488 bus. Now, the PET owner can obtainhard copy listings and can type letters, manuscripts,mailing labels, tables of data, pictures, invoices,graphs, checks, needlepoint patterns, etc., usingRS-232 standard printer or terminal.A cassette tape is included with software for plots,formatting tables and screen dumps. The ADA1200

sells for $169.00 and includes case, power supply andcable.

Order direct or contact your local computer store.

VISA AND .. /c ACCePTED _ SEND ACCOUNT NUMBER, EXPIRATION DATE AND SIGN ORDER.ADD $3 PEA ORDER FOR SHIPPING & HANDLING _ FOREIGN ORDERS ADD 10" FOR AIR POSTAGE

CONNECTICUT microCOMPUTER I Inc.150 POCONO ROAD

BROOKFIELD, CONNECTICUT 06804

TEL: (203) 775·9659 TWX: 710-456-0052

K IM One magazine publishes • APPLEmore information about

SYM • 6502 based systems, • PE Tproducts and programsthan all of the others

AIM • combined: • OSI

~~~~(!JMP_O. Box 6502

Chelmsford, MA 01824

Are you tired of searching throughcomputer magazines to find articles thatrelate to your 6502 system? MICROmagazine is devoted exclusively to 6502systems. Each month, MICRO publishesapplication notes, hardware and softwaretutorials, interfacing information andprogram descriptions with completesource listings. MICRO is not just fun andgames. It is the complete referencesource for all 6502 enthusiasts.

Youcan order twelve issues of MICROfor $15.00,or for $18.00

outside the United States.Air mail subscriptions cost $27.00in

Central America, $33.00 in Europe and South America, and

$39.00i~ all other countries.

MICRO has been published regularly since October, 1977.

Articles that appeared in the earlier issues of MICROmay be

obtained in two bound anthologies, BESTOFMICROVolume 1

and the companion collection ALL OF MICROVolume 2, both

available at computer stores or from the magazine.

ofts...u~~-80111;

W B i · · · p r o g r a m o ·1 GRAPHICS PAC 2 Quadruple your PET's graphic resotuiion. Why be

New Version stuck with the PET's cumbersome 25 ~ 40 1000 point

display. With Graphics Pac you can directly control(set and cte arj 4000 points on screen. It's great for graphing, plotting. and gaming. Graphics

Pee allows .YOu to plot Inany combination of twomodes: 4 Quadnnt graphing with (0.0) center

screen,.and Standard graphing with (0.0) plotted in the upper left hand corner. Complete docu-

mentation shows how you can merge this useful routine with any ofyour own programs with-

out retypin.~ ei ther one! All thi s on a high qua li ty Microset te for only $9.95.

2ASSEMBLER 2001 A full featured assembler for your PET rrucrocompu-

ter that follows the standard set of 6502 mnemonics

abilities of vour PET. Store and load Via~~;e,Yr~~~~~o~~~et~~~;~~~nJ~~ f~~~~~~~.~;s~t~~~

edit toowith this powerful assembler. Noother commercial PETassembler gives you all these

features plu s the abi li ty to look at the PET'S secret Basic ROMs all in oneprogram. This valu-able program IS offered at $15.95

3B::KE An exciting new sirnuteiion that puts you In

Charge of a brcycle manufacturing empire. Juggle

. Int Ia tion. breakdowns. seasonal sales variations.Inventory worker-s . pr-i ces machines . and ad campaigns to keep your enterpr is e in the

black. Bike IS dangerously addJctJ1.'e Once you s ta rt a game you wil l not want to stop. To

allow you to lake sh an rest br eaks. Bike lets you sto re th e data fr om your game ona tape

~oe~~~~r:~ :~~~t~n~~~~h;~e you lef t o ff next t ime you Wish to play. Wor th a mi ll ion in fun.

4PINBALL D

yn ami c usage of the PET's graptncs features

when combined wi th the fun of the number 1 arcade

game equal s an acr ron packed video spectacle for

~~~~a~o:eP~Il;~e~tU~~;s io~h~I\~s$;~fPers. free balls . gales . a Jackpot, and a h t tle luck

are unbeatable

*SPECIAL

~ MUSICAL MADDNESS ~add an exciting new dimension to your PET compu ter

w ith Soundware' s sound sa .r iona t music box

and somcsound sof tware f rom Sof ts ide & Sound ware

RTHE SOUNDWORKS RThe Sour:dware music box for your PETcomes complete with.controllable volume.an ea rphone jack. a demo tape with two

programs, an ins truct ion book. and a oneyear warranty. this sturdy unit is enclosedin an attractive plastic case. Notes tellhow to program your own sound effects.

All thi s dur ing our musical madness forjust 29.95

"'MUSICAL SOFTWARE'"ACTION PACK: Breakthru + Target

Csxterpitter. non stop graprnc action 9.9.'5

PINBALL: a VIdeoaction spectacle withreal time flippers. chutes gates. bumpers.tags etc. 9.95

CLASSICS: Checkers .. Backgammon

Board "Piano Player; checkers vs. com-puter or friend. Piano plays Minute Waltz

9.95MUSIC MANIA: Try to repeat a growingsequence of tones. With gra.phics. Chat,lenge to the best ear 9.95

WORDFUN: Speller: fun ways topracticespelling ..Scramble + Flashcards 9.95

PETWord Processor

81(,

a n d

16/32KPE"r

verslons

This program permits cornposlnq and printing letters,f lyers, advertisements, manuscripts, etc., using theCOMMODORE PET and a printer.Printing directives include line length, l ine spacing,

left margin, centering and skip. Edit commands allowyou to insert lines, delete lines, move lines and

paragraphs, change strings, save files onto and loadfiles from cassette (can be modified for disk), move up,move down, print and type.Added features for the 16/32K version include stringsearch for editing, keyboard entry during printing forletter salutations, justification, multiple printing andmore.A thirty page instruction manual is included.The emC Word Processor Program for the 8K PET is$29.50. The 16/32K version is $39.50.

Order direct or contact your local computer store.

VISA AND .. /c ACCEPTED - SEND ACCOUNT NUMBER, EXPIRATI ON DATE AND SIGN ORDER.ADD $1 PER OflDER FOR SHIPPI NG. HANDLI NG - FOREIGN ORDERS ADD 10 . . FOR AI R POSTAGE

CONNECTICUT microCOMPUTER I Inc.150 POCONO ROAD

BROOKFIELD, CONNECTICUT 06804

TEL: (203) 775-9659 TWX. 710-456-0052

*OUND

Page 51: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 51/68

SYM · 1 Baudot TTY Interface

Do not let the title fool you! This article has a lot more

than just TTY stuff. Some of the techniques presentedcan be applied in many other situations.

One major shortcoming of the KIM is

the inability to change the I/O routines

without duplicating large parts of the

monitor. In designing the SYM·1,

Synertek nicely handled that shortcorn-

ing by vectoring all I/O calls throughjumps located in SYSTEM RAM. Since

those jumps are alterable by the user,

almost any 1/ 0 device handler could be

written and used with no effect on the

rest of the monitor. That fact, coupled

with the low cost of the Baudot

Teletypes such as the Model 15 led me

to develope SYM·1 I/O handlers for a 60

word per minute Model 15. Since the

SYM· 1 allows additional ROMs to be ad-

ded to the board I placed these routines

in an INTEL 2716 EPROM, along with

some other system software. More on

that later.

BAUDOTTIY

First, some background on BaudotTeletypes: A Baudot teletype uses only 5

data bits (unlike the 7 used by the ASCII

Teletypes such as the Model 33) and

thus it can only generate at most 32 unl-

que code combinations. In order to ex·

pand that character set, two of the

codes have been assigned special car-

riage shift functions much as it is done

in a conventional typewriter. These two

codes are called letters (LTRS) and

figures (FIGS) and refer to the "lower-

case" and "uppercase" character sets.

Unlike a conventional typewriter, if a

Baudot teletype is sent a LTRS code it

stays in that mode until a FIGS code is

sent. As a result of this shift method of

operation, each key, except for some

special ones, can send two different

characters to another Model 15 TIY

depending on the last shift sent. The

receiver must of course remember what

the last shift sent was, and print each

succeeding key accordingly. While the

Teletype does that remembering

mechanically, it is obvious that a corn-puter could easily do it electronically.

That principle is the keystone of my sctt-

ware approach.

November, 1979

I mentioned that some keys or codes

are assigned unique meanings

regardless of whether a LTRB or FIGS

code was the last code sent or received.

In most Model 15 Teletypes those

special keys are:LTRS, FIGS, CAR RET (RETURN)

LINE FEED, SPACE, NULL (BLANK)

the net effect is that of the 32 code corn-binations, 26 have dual meanings. As a

result, 2 x 26 + 4 = 56 unique characters

can be printed on most Model 15

Teletypes. Note that I did not include

LTRS and FIGS in the abOVE! total, as

they are not really characters.

It should be obvious that with only 56

unique characters possible a 64, 96, or

128 character ASCII set cannot be

directly generated or prlnted by a

Baudot Teletype. The approach I used is

an indirect approach which, much likethe LTRS and FIGS codes, uses a se·

quence of codes to represent a

character.

Hardware

A few points about Baudot Teletypes

are appropriate before we be"in. First,

the electrical characteristics ot a Model15 are a bit different from those of a

Model 33 ASCII Teletype. Rather than a

20mA current loop, a Model 15 usually

has a 60mA current loop. Even more l rn-portantly, the supply voltage specified

for that loop supply is usually 150v or

more. Making a direct interface to the

SYM·1 at those voltage ane' current

levels would be disastrous. The answerto that problem is to use the conven-

tional 20mA interface of the SYM· 1, but

to couple it to the Model 15 through

opto-lsolators, The opto-Isolators will

protect the SYM·1 and allow easy con-

version of the signals to the Model 15

voltage in that the SYM·1 signal ground

can remain isolated from the Model 15

ground. Since Model 15s are notoriously

electronically noisy, the benefit of that

isolation is that the probability of noise

MICRO -- The 6502 Journal

Richard A. Leary

1363 Nathan Hale DrivePhoenixville, PA 19460

problems in the SYM·1 is sharply reduc-

ed.

The schematic of the interface I used

and the power supply I built are shown in

Figures 1 and 2. The only critical corn-

ponents in the interface are the selectormagnet driver transistor and the zener

diode. The voltage rating of the tran-

sistor must be high enough to withstand

the open circuit loop supply voltage. The

zener across that transistor must be

similarily rated, as its function is to

damp the magnet induced voltage

spikes (positive and negative) and thus

protect the driver transistor. The

transformer in the power supply is not

critical as long as it can supply 60mA

continuously. This is a good opportunity

to use one of the old "tube-type" power

supply transformers that you probably

have in you junk box.

The total resistance value of the

series dropping resistors in the powersupply may have to be altered if the open

circuit voltage of your supply is higher

than the approximately 190v put out by

my supply. Once the supply is built, the

variable resistor is adjusted to give a

60mA loop current when in the local

mode and when no key is depressed.

Second, not all Model 15s are the

same. There is a wide variety in code vs

character terms, as well as in speed. At

least three different speed Model15s ex -ist. For example, my machine was at one

time a "weather" Teletype and had a

special character set for most of the

FIGS shift posltlons. I converted most of

those keys and type elements to the

"standard" communications set. I did

leave in some characters which are not

standard, and hence a few characters

which I can print will have to be changed

for a standard machine. Those

characters are:

l' -on standard+ "on standard

Nul l on standard

The software changes required to ac-

comodate the standard code are minor.

18:49

Page 52: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 52/68

Finally, the Baudot machines have a

few good and bad overall points which

each user must consider before taking

the plunge. They are:

a. Cheap: $50· $100 or less should

get you a good Model 15. Insist

on a synchronous motor rather

than a governor regulated

motor.

b. Slow: 60 wpm translates to 45

Baud (6 char/sec) which is a lit-

tle bit faster than one half thespeed of a Model 33. The effec-

tive speed is even slower due to

the necessity to send LTRS and

FIGS shifts on an irregular

basis.

c. Reliable: The Model 15 is pro-

bably 70% steel and 20% cast

iron with a smattering of

nonferrous materials. It just

does not break if kept

lubricated. (Remember-the

Model 15 was the mainstay of

the 24 hour per day news wire

services.)

d. Heavy: All that iron!

e. Smelly: All that lubricant!

f. Repairable: If it does break,parts are available and the

manuals are complete and ex-plicit. I buy my parts from a

company called Typetronics,

Box8873, Fort Lauderdale, FL

33310. Prices are very

reasonable and the response is

nearly instantaneous.

NOTES:1. Resistors 'I .w,5%2. Open circles withnumbers are TTY in-ternal terminals.

A·S

A·U

HEP

S3021

POWER Figure 1: Interface Logic

1500

3A

SLO·BLO

~22

< J - - - - : - - - - - + : J117VAC

60H'

SYM·l

- +9V

390KBN

(NC)

53 41

A·T

6 LOCAL

NC

23

16

HYS·SYNC

2.2A

The most difficult part of the hardware

interface has already been described.

Once the interface hardware is built it is

connected to the standard current loop

I/O pins on the SYM-1. The only SYM·1

hardware change required is a jumper

change if you place the interface soft-

ware in an EPROM and mount it on the

SYM-1 as I did. Any of the empty ROM

sockets can be used. Which one '{OU usewill depend upon whether you may have

already installed the BASIC ROMs, the

EDITOR/ASSEMBLER ROM, or some

other device. I placed my 2716 in Socket

U21 and since I had set the stanlnq ad-

dress of the software to $9000, I remov-

ed two jumpers and added a new one to

enable U21 for $9000 to $97FF.

Regardless of what you do, the SYM

manual gives a complete description of

the jumpers and how to set them for

various ROM-Address combinations.+9V

Figure 2: Power Supply

HEP

Z0445

200V

60mA

46LOOP

-0 SUPPLY

NOTE:1. Signal and powerground isolated

Software

Given the character set limitations of

the Model 15, the first software design

requirement I had to address was how to

represent the full ASCII character set

when printing, and how to generate that

set when using the keyboard. Let's look

at the output case first.

The first decision was to convert all

lower case alphabetic characters (a to z)

to upper case. As the software will later

show, that is a simple step. Moreover

that approach does not create large pro-

blems in application, since the need for

lower case alphabetic characters is

limited unless one is doing word pro-

cessing. If that is the case I doubt that

the Model 15 is the answer in any case.

The second decision was to print

those characters not normally printable

by a Baudot Teletype as a four character

sequence, beginning and ending with a

period. For example, an equal sign ($30)

would be printed as the sequence .EO ..

In addition, of the :32 control codeswhich the ASCII can represent, I decided

to recognize only RETURN, LlNEFEED,

BELL, and NULL. All others are ignored.

The decision as to how to generate

the codes from the keyboard was a bit

trickier. The approach selected was to

use BELL as an escape character. This

simply means that once the character is

entered, the Iollowinq entry or entries

are handled in a special way until certain

conditions are met. While any key could

be used, BELL has the advantage of be-

ing seldom used as an input character

and thus its use as an escape character

is not a big loss. As will be seen later, it

is not a loss at all as I can still generatea BELL as an ASCII character.

In the software which I c reated, the se-

quenoe following the escape characteris only one or two key strokes in length.

In fact it is only two when a LTRS must

be entered between the BELL and the

operative key. To better understand how

this works, consider the following two

examples which show both an escape

sequence using a key, and the normal

mode for that key:

Page 53: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 53/68

USEP T'/PES fISC I I OU TF 'U T TO :;U F'EF :r'10 11

1 BELL

2 A

FIGSBELL

L TF . : := .A

Fi <$41::'

nOi-,e

r.or.e

none

SOH ($01::'

As the examples show, the BELL-(char)sequence generates the specialcharacter while the character by itselfgenerates that character. The completetable of both input and output charactertranslations is contained in the follow-ing table. LTRS and FIGS shifts are ob-viously required for some of the se-quences shown, but have been omittedfor brevity. Note that while lower casealphabetic characters cannot now be

generated, it would be easy to add a dou-ble escape feature in order to do that.

TF'At6LnT lOtI T,"iELE

ASCI I IrlFUT OUTPUT---.-----. -----_ - - _ .. - _ _ ._ ------_.---- _" _ .._ _ ._._- _"-

tlULL IIULL r~ULLSOH E : C : " " L A (

5T:": E:ELLe-,

)

Er< E:EL_~ ," .* BELL r _AS.

EOT E:EL.L [-I+ + +

ENe< SELL EAC K E:ELL F

BEL E:ELLc-

BELL~BS BELL H . . .HT BEll_ I 0 (, 0

LF LItIEFEE~' LItlEFEED 1 1

'...IT BELL ~: 2 2 :2

FF BEU_ L 3 -' .~

CR CAP FET ; : , = , F : I?ET 4 4 4

SO E:ELL tl 5~ c._ ' -'

51 E:El_L D 6 6 6DLE BELL P 7 7 7

\DCl E:ELL 0 8 8 8

DC2 E:ELL F: 9 '~ -; .

DC3 BELL S

DC4 BELL TNAt< E:ELL U < BELL - .LT.5'/t·~ BELL I) BELL .EO.

ET8 BELL 1 , . 1 > BELL + .GT.

CAt'l BELL,.

?.. ,

0 : : ': - : ,

E~l BELL1./ >i BELL &

.AT.SUE: BELL Z A t.o Z A t.o Z A to Z

ESC BELL BELL BELL .LB.FS E:ELL 1 . . . . . BELL .8S ..

CiS BELL L ] BELL ) • RB.RS BELL 3 r r ·t -

US BELL 4 BELL SPACE • Ut~.SPACE SF'ACE SPACE BELL $ .AG.

a t.o z A t.o Z

BELL .OT. ( BELL .LP.

II II II BELL, " , -. . . . = .. •

$ $ $ ) BELL • RP.

~ . . . : BELL .pc. BELL II ·TL.& & 8, DEL BELL t~ULL .DL.

Software Implementation Also, I use the following F:AM andSYSTEM I/O locations:

CHAR @$59 used like SW'ERMONdoes,TTYMDE @ $100 current shiftposition,PBDA @ $A402 1/ 0 port,PBDA + 1 1/0 port direction resister,SDBYT @ $A651 timing constant,

As the complete listings lndlcate, thetwo top level routines for input and out-put are ASCIN and ASCOUT respective-

I wish that I could report that the soft-ware is very compact and that it uses agreat deal of the SUPERMON routines.While the software is not large, at about1/2K it is not small. On the other hand,the only SUPERMON routines I use are:

SAVER @ $8188RESXAF @ $81B8RESALL @ $81C4DLYH @ $8AE9

November, 1979 MICRO -- The 6502 Journal

Iy. Each of these routines calls otherroutines to do the actual input with theTeletype. The functions of each routineand its general characteristics are sum-marized in the following chart.

18:51

Page 54: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 54/68

ASCHJ

R OU T I ~ '4 E F U t·4 CT I O f· j

ASCOUT

CHF:I f'4

CHROUT

TT . .. .OUT

HALF

FULL

EI21: .· inF 'u t for'

f"1_lll Ch.3t- · '::l2t

us .i rl E 12·: ; ··: ··=: : tF·e

·=·e·=lI_~ence

Fr int. ·::·pe':iaI·::·e·"luence·::· CiI'-'

dir-ect. ch.=::tr·

t . e < CHI?OUT forQutput.

get. he::!.' ec-h.:,

and con'.}er·t_.

t.o ASCI I

corl',)E-I'"·t. ASC I I

ch.ar t.1j Baudot.

anlj h.=::trld I2

mode c-han::JE-·:: .

output. B.;:'I_ldot_.

char

d e I a '-::I 11 rfl"::.

d e 1 a '-::I 2 2m '::,

Conclusion

I tWUT OLITF'UT

ASCI I

ch.::;r-' 11'1

A

ASCII none

ch.=::tt-· ir,

A

<TT'..-'1-:.12'::1)

ASCI I

ch·;:,r-· ir.

A

ASCI I nor,e

ch.:=.r-· ir-I

A

<TT\'

ch·::tt-· ir, t.':::IFe::'

A

AL TEF:::= : C FiL L5

::::A!.)ER

CHF:Irj

F:ES:::"lF

::::AI,lEF:

CHF:OUT

F:E5IiLL

f i LTUU r

R., F

TT'..-'r'l[:'E

CHAF:

~;AI)EF:

HALF

f~I_ILL

- "T ' /CiUT

~;til')Ef:

TT'/'i]UT

f<:EStiLL

F'E:[: 0A

F'BDfi+l

A.,F., :: <'y'., TT'/~lDE

.:':,

'..';", I)L'/H

I hope that you find this package

useful. If any questions need answering,

please feel free to contact me. And if

anyone would like the code translations

changed I would be glad to reassemble

the software and provide the revised pro-

0 0 1 . 3 1 : 3

1 0 3 0 1 - ) 0

0£1"]~1(1el.)~)

~]00Cl

(1(10C1

~3~~UJ[1

000(:1

~3(100

021021 '3'3

001 .31 .~1

00210(1

0(1(t(1

(1001.)

1.3000

001210

0 (16 "3(lu(n)

OOI.3"~1

0"30~~00(:1(1

0I ,:n30

1300(1

(10000021 '30

000(1e n . j ( n : : : 1

001 .2n)

0(n30

000(.1

(1021'3'3

0(n30

02100( '

€ lOGO00(1(1

1210(1(1

(1OJ.jO

' 3CKK1

18:52

;::;'·m-1 8AUL'ClT TT\ '

t'~ULL -=0

FII:: ;~lDE =0

BELL =7

ESC ='$lE:

FIGS =$lE:

LTPS =$lF

SPACE ;:::.-$2(1

LTF:~lUE =$20

DELETE ='$7F

CHF:E:I_IF =$F'3

TT'/r 'lDE =$1 '30

SDE:'/T -=t :A(.51

It-~!)EC : : :$I · i 66 : ;=1

OUTI ..IE:= =:$AI;:.:~,::

SAilER =J;:_'1'::;3

FES:,,:AF =$:,: 18::'

RE5ALL =$:,: 1C-I

DL'/H =$'=:;'iE'3

ACCES:; =$:':[::="e,

;I...[1 [:'':-'_.IJ.''':-';':::

"0 F 'AC:<:AGE

c+r.sr- .~;:t..er- buf"f,=~'

T T'r" ::. hl f ' t _ r(lo.j.:-

t lHli,1.E .:O;-,::.t : : : ' I - , t _

i ,F"U t_ . _iUilli';: ",-,~,:tOt

c.'l_r~.F u t __U!!u:: \ ,o::-,: ·t_.·: !r-

re:E 1 = - ~ _. -= - I' - . :. ~ '_ ; ': :' -

r es t0i- ~ ~~c eFt_ A&~

r 'e ~t 0r e t -e ~i ~t ~t -~

uri --F, crt =·~=·i_-'::-"l F.·i~r"1

9000 20:::E.:3E;

9003 A'32C'

90'35 80'51 At,90210: , : A9:,:5

'?00A 8D64H': ,

900D A990

900F 8C"S5A6

91312 A'3W9014 8[61A6

9017 A99'Z,

9019 8D62A6

901C E,')

901C>

90211[>

901D

90W

913W

901[>

901D 20E:881

9020 2eE8'30

9023 C';07

9025 [.~e189027 _2€rEE!"30

':;'02A eSI07

902C 0004

902£ fl51E:9030 De,!')

9032 C'SI(1I.~1

9034 Del049036 A":17F9038 D'; :IO:=:903A C~;20

903C 90E9

903E Afl

903F B[)459'3

9042 4CE::3819045 SF

9046 7C

MICRO -- The 6502 Journal

Note that SDBYT must be set to $20

before using these routines as that

parameter is used by DL YH as a timing

constant. For teletypes running at

higher speeds, either the value of SOBYT

or the loop values used in HALF and

FULL should be reduced. If your

machine is running slightly faster or

slower than mine the input or output

may not be completely reliable. If that is

the case, adjust SDBYT up or down as

appropriate, until all functions work er·ror free.

In my system the first routine in soft-

ware is used to set SOBYT and alter IN-

VEC and OUTVEC to point to the Baudot

routines.That is not absolutely

necessary, but does make the start-up

process somewhat easier. All I have to

do is enter G9000 CR on the SYM-1

keyboard and the Baudot 1/ 0 package is

up and running.

One point of emphasis-as written,

this software includes an internal echo

for each input. The input sequence is

echoed literally. This means that if an

escape sequence of BELL I is entered,

what is echoed is precisely that and not

the .PC. which would be output if theSYM output a %. It would of course be

possible to change that approach. A

translated echo would be a bit slower

since each escape sequence would be

echoed as six or seven characters due to

the .XX, sequence and the necessary

sh ifts.

gram in listing form for the cost of the

materials and postage, Good Luck.

8EGIH .1SP AC::C;':;

LC'A 1I$2l'

STI'l SUE:'iT

L['A IHiS,: ':'UT t·25,=

S TF I O UT I_ .IE r,:: 1 -1

L DA # JL -:C DU T - ~51:'"

5TA [I'-'T'.I£,:::.-;

' _ , 1 1 - , -~.-cr_ ::: ~= : r ;

L": !-"I_::.r-I_,j ,:. ~_.L.' ""~

T r.:_"._,:-11

ST i~ H~I)EC +-1

LDA #ASCn~- ~,:,,_,

5TFI HII' [C'2

F:TS

l 'i "' :: . .r '

;FISCI I Ir 'F"'_~t.I _ I . : ; e:: E:ELL ·3·~ E o : : : ., : - ~Fe L: r-'.~i·':'1': 7_ , = , , ' r,

; .EJener-at_.e f"ull A5C:ll :h,~,-5·.:.~_'~'

; ~ xc e ~' t, f o r - l00)~1 ':3:::2~~Ft-,~.

ASCltl .1SF: SAI')EF'

.JSF: CHF'IH

c.r'lP #E:ELL8tlE E":TAIH

ESCAPE J5F: CHF: I t 4

cr'1F' #BELLSHE t·jOTESC

L['A #ESC8tlE E", :TAUI

HOTESC U1P #tIULL

E:t·1E t·mH)EL

U,A #DELETE

SHE E)<TAHI

t ·10TC,EL cr' lP SPACE

8ee ESCAFE

TA~<

i r r.c. t ~:C~;_

t_.he;-: ,- - =f _ _ rr i-'I

.= let ::'"2':: " :< ; -1 '' : . _: _,

1 - , - - 1 . : , 7 _ C'[:__L

t_.j-lerl _"_~f",F

~et_ E SI-:: : ,:'d ~

.and t--ef .. i_Jr-n

if no t- t · ~ I _ J L ; _

e L 'se .=jet- ['E:_

.;jnd .-et_'_il·r,

1f 1~ :::: t_ h.~rl

lc,de:

L[~A ASCI 1..> < arl,j ;lo;- t_ t.: ~r,::;, 1 ::,;_-::1-,

E::<TA I t·~ Jr'lP ~:ES::<AF r e-:=_.,~,.-e -~r -I' j r , : . -t _ , . . .rr.

ASCII .B'lTE $5F.,$-;-'C:.·(1.$7E)$I=,~=1_-0 ..- - f > - J . · j . . -l'::~

November, 1979

Page 55: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 55/68

"-j

91:::14( ~l_1

9048 7E

904'3 60

904A 00

9048 40904C -...-,

904D 5E:

904E 5D

904F 00

9050 3E

9051 7D

9052 3C'3053 7'8

9054 25

9055 009056 lC

9057 W

905:=:IE

905'3 lF

905A 0['

''105E:0

905(" I2U3

9(15D (1~J

905E [1~3

'0l05F3D

906"3 5C:

9 ~ 16 1 12 1 '1

90 ':.2 12 112 1

9('163 [1~=1

912164 ~3(1

9065 (113

906E. 0190E·(, ~)2

91216 3 ~= 13

9069 ~34

906A ':'5906E: ('6

906C 07

906D 0;3

906E 0'3

": '06F OR

9070 ('B

9071 [1C

''1072 0D

'3€f7'3 (1E

9074 0F

'312175 l~J

9076 11

912177 12

91217:3 13

907'3 14

9 12 17 t= t 1 5

' ::IO'?E: 1':-

':; 'Cf(,C 17

·~~1.)7D1:3

907E l'j

'~O;-F tH9(1::::(1 C~ O

':;'(:1:::: 1 ~JO

'30:::;~ ~ : : : 1 C I

'3~=1:::3 2A

'3~3:::40(1

\j/

'~~=1:::5

'3(1::::5

'30::::5

' 3 ~ : : : : 1 : : : 5

9 1 . : : : : 1 f : 5

'3~~t=:5

9(1:35

90859 0 :3 5 2 (1 :: :: :: :: :: ::

91.~1:::::~:297F

9088 82-:-·(1

'31218C DDE:3'3~1

9(1::::F F00R

9031 A0C13

9(1'33 C:A

9094 3~}lA

90'36 8:3'3(1'37 ()(1FA

'30'3'3 F~JF1

'31.398 R01.j29'39[:, 2(1E6'j[1

90A1. ) E'=-

9 0R l E:D83 9C1

9(1A4 2(14F'jl

9(1A7 8:0:

90A:=: DOF6

' :; '0AA 20Et: .'3C1

' 'lOAD 4CC481

9080 4C54'319083

.8'lTE eSSE;"$5[' ..0..$3E, $;"[:' .. $3C, $;"E:" $':5

.B'.-'TE= :, '3, lOA, $E:., $C, $D., $L $F

;I::~~i~I1 1::::I_ltr='_d

;= IU t.F'.li,:: ,: -r , _: :1 1 ' : :: 0' : ' _ ~!-::: :I''':-t·I"._j~ :-:,.:,t_

!-"I--- J.:_·I~.~j t,,::! E:;:,I_;L::=iT TT,. ' - ' - - l , _ ~ ; : : .

,:rL;:jr-_::;I'::-~_'::';_ ~-=-=1I_~'::-I-i,..:-e ,":,j' t_,

'::!. ~ ) _ j _ :rt~:2r- ,:i-,_:'t-~,..:t ..2r " : 1 0

A St: :: -C ,U T _ T~ F: Si=j i)C;:;:: ;;: - -3 ' , -= - 'e-i:ll:: ~_~;_

H t ~ [ ' #.t , - : ' 1 · " 7 " , ~ ::_~;, ':"_.if_ ;" :_

L[<:- ; ' #L__:'T~,,;:-Hl.L Tl-t'' '=:'~!_':' _: j . , : . : - . f ~-~-~-:-_

TSTI:HF' .: r 'IF' PIULT I '

EEl] CIUTsr:;: '

L[".' #3

l'I'WtlTF' [E·:

BI'l I HTFt~[ ,

roE','m'iE ~'l',.Ft~T;:;

E:EC! TSTCi-Il'

CtUT'STF: LUi # : . : :J '.3 F' P RD OU T

~-f<TOI_IT Ire:

L[:OA ~IUL r I,JSF' CHF:ClI_.'T

['E','

ENE t·I:<TOUT

J5P PP[: 'OUT

JI'IF' F'ESALL

tHFHD .H'W AL TOUT

t ' 1U l. . . . . TI • E :'-,-'TE .' "C~T

November, 1979

t.e : - + _ ' : :- ' -1-: '1

if ill'::' t.c i) ee.r.ci ;:~4

e e. '·.~F t.c

l>_F_ 1,° ; I ' ' : : ' ,n-~ ~__:l -I _ " _. r. II ·=

,~':::,ur,t_ ,j,.:,t,lj·-1

·.Ji·,!_-il I'" 1'.'- = 1.-.2:.=-

t j-I~f, ...:IU t,,;;-.t_ i--Ie.

::'~·'--id "2 '_ , -\. :='I-

= - - = - J - " j = o:?t--l'_,,:";

.~i-"j : : - ' = : - 1 ' : : ; i :

l'':Ii:,F ,_ir(!"_ j_ 1

_~11 :_~';--I f_

:::?,-Id i~~'-I.,.:"jt_.;- I~ '- I r -. ;?r ___-+!'n

_"_HIll::: f,:(t- = . .i.,--di,,:

9004 51

'3085 5490BE, .L.')

'3087 5,:1

'308:3 4~;

9"~1B'=,2t1''10BA4,

''lOBE:

91-38C 3C

90B[:'4(:

''lOBE5'1

90E:F 3)

'=,0CO 4~)''10Cl5:,

';:'''JC2 3t::'30C3 4~~

';'''JC4 54';'OC5 40

90C6 41

'=' [1C7 5,; .~

90C3 SF:

90(:9 4C

90CA 4::

';'I2IC8 5C

'=,0CC 4::

9€tCD 5c :90CE 50

90CF 52

90013 42

9001 5F

9002

9003

91304

9OC'5

9006

'30D79008

9009

900A

9008

900C

9000

900E

900F

9eE0

9eE1

geE2

90E3

geE4

9eE5

90E6

9eE6

90E6

9eE6

90E8

9eEB

90EB90EB

90EB

90EB9eEB90EB

30EE

geF0

90F2

90FS

90F7

90FA

90FD

90FF

91131

9104

91137

9103

91eA

9100

9100

91eE9110

9112

9113

9115

9117

9118

9118

911C

911E

9120

9122

9125

9128

55

4E

6 1 2 1

41

47

7B4C

50

7C

56

53

7D5250

7E54

4C

7F

44

4C

A92E

4C4F91

208881

A900

8'5F9

2C02A4

5eF8

2002'32

2C02A4

5eF3

AG07

200692

2C02A4

18

5001

38

66F9

88

OOFIA5F9

4A

49FF

291F

48

2121E091

68C91F

0008

A920

S[!OO(ll

4CEE''j('

C918

MICRO -- The 6502 Journal

912A 0004

• B'nE ·";FC

• E"/TE ...· .AS

• 8'/TE .:~ T

• B','TE =EC'

• B'lTE' >GT

• B'/TE [ ' r::•1 . . . . . : . . . '

• E:'/TE ". E:S"

.8'lTE .' JRB'

•B '/TE .' _ut-r

• B'lTE "'AG

• B\'TE' eLF"

.8','TE :,."'::'

• 8','TE ; F:P

.B'lTE "TL

L5TSO • B','TE DELETE

.B'lTE . CoL'

;OUt_-Fut Per ' iod

PR(,OUT LDA II.

J~If' CHF.:OUT

. . : :Ie ~_- r = e r - - l·:"

ac do 1

;Char·.acte-r IrlF-utG e t o ' : : : , 1nF-ut frCl(LL E :AU (, 'O T k : ,E " .: = 4t ": I. :; :" j,j

arid con' ....er-·t_.:. t_.I:' ASI"=:I ~ and e,:r-.():

c 'h ar - ·; :, cter--.

CHF.:Hj

AGAItI

.J5F: 5A')EF.'

LDA I ItjULL

STA CHF.:E:UF

BIT F'SDA

8 1 .) ( : U :: :U :: :l t:.

JSF.: HALF

8 I T F'E;[:'F,

8 1 . ) ( : LC lO~

LD'i #7

NXTHj JSF: FULL

BIT PSDA

CLC

8'.)C 5AI )E

SEC

SA'')E F.'OR CHRBUF

[lEl

8HE tl::TIflLDA CHRE:I_IF

L5R A

EDR IItFF

At· ll' #$lF

PHA

JSR TT\'OUT

F'LA

CI1P i lL TF.'S

8t· jE t ·IOTL TF~

L[:'A i lL TF' I'I ['E

SEHIDE STA TT\'r-I['E

J~If' AGAIH

t,ClTL TF' C1'1F I IF I G'O,

m'IE HOTFIG

= ..~-..'e ("-e::ll =-~_ r : : : - I '

t:1o : - · - : : t r - t'l..~ff :;1

iri F~Ant_.~:;;.t_- f':'1 :.t-::;r-t_

:I.r- not. 1001=

el~~ wal~ ~Ialf blt

and t_.o?:; ,. t-~_;:j-3i,-.if f".: :Jl :;·e :.t_ : : : t l ~ . ' _ e"'e;-

.=Ie t. : ·e ' -_ - 'en t,i_ . : :

l•.~ i . t,it t_ l'(lo,;.

t_ .: : :- - ::_t.irlFut_

o 1 f ".:' 0' .,f 1 '.1

: : : , _ ~ ' _ _ 'O : : - 1 f c : : : 1

el '" " 1:-h if ·+ .. l l- 't _. ,. = t.oI_~( f .:rcl:,urli_ ,j':"_,.il-'

1O'':',F 1 f [1"1': '1'- 2get- ch-:::tl--;:,n,j r'iu :r, :-r,l·-~.

t_ .herl e,:h•:,

r -e -; t_ ': I1 -- -2 ' :~ ,~ I

if riot L T : '; : :: = :

t_ .r l~ r, _ itm .F

..::IE-t LT;'; ::S u.c.oe :,:,:JI?

~nd s e-t rll\.:"j.::-

t_ ;-J E-r, tr--s .ss s ir-i-f' not_ F I : ' : : _ ' = :

18:53

Page 56: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 56/68

'312C F!9(1(1

912E F0F2

9130 18

9131 6D0001

9134 85F99136 A25F

9138 8D8e'31

9138 2',3F913[) C5F9

913F F00A

9141 CA'3142 10F49144 A5F9

9146 4'320

9148 4C3491

9148 8A914C 4C8:381

914F914F

914F

914F

LDA #FIClr'lDE get_, FIGS mode code

8EC! 5ET~1[:'E and setHOTFIG CLC clear' c.:.r~-··::I

AOC T1'/t'lDE con'·.'et-·t. t.o t.bIeTF~'/OTH 5TA C:HF~8UF <::Ind ~·aJ·.·'e

Lc.::<#95 number-' char· - 1

5EAF:CHL[:'A E:AI_I[oI:'T,': ",,..f_. t .•to 1e "'nt.~·,,,

At-t[) #$3F l ool-. at. mode+data

Cl"lF' CHFE:UF if S.aUIE' a ' = . b'jf'f'"er'

BEG! FOUt'~D t.hen f'ound

D E > : ; eo · : ; . " = c·ol.lnt dOI..In

BPL SEfiRCH and 1Q()F' ur.t. i1 all te-::-~_,e,j

LDA CHF:E:UF ",,..t ch.•rEOF #LTF.:t'l[:;E com=-I ewerzt- r llo, je

Jt'lP TR'/CITH and tr-"::I .agan

FOUt'l[o T:":A "'Co'.'eASCI I to A

Jt'lP RES>':AF and r,..t.u'YI

;Ot~t.F"I_~tSingle ASCI I :::har·'act.el"·

Con", .:or·t.·:,. t.o 8AU()CIT and rldr-,.Jle-';:'.

; mode change'=. ~6 r-e'=:juir'.;,:"d ..

914F

914F 20,8:'::81 CHF:OllTJSF~SRI)EF: ~.~L·)Eo re a i:.t2r--::

9152 2'37F RHO #$7F r ild:.t"' . out. r il :: .b

9154 C96~3 AL TOUT Cr'lF' #$1::.(1 if UFF·E'(· c~::.e

9156 gen:12 BeC UF'F:CSE :.h:.. F C" ' : ln ' ...o?t--t

915:3 23[)F Rt·~O#.$DF el::.e rl-l.o~;.e UFFE'I'-

915A AA UF'F:CSETA;< rn..h,.. c-h... Foil-·,t_.et-

9158 8081391 LC'A BAUDOT.,< :3et BAUDOT915E C9'3,] n1F' 11$':::0 if' msb= 1

9160 8018 BC5 t-lOPF:tH do r.ot, F~·i,-,t_.

9162 C94e cr'1P lilA'" 1f" next- bll.=O9164 9014 BeC NOr'T[,'E rio m':llj~ch.::in~e

9166 48 PH A el=.e =.•..''' c-~,.r-9167 2920 At·l[:, ilL TRI'lDE l'x~,.t ",ode bi t_9169 CD0001 G1P T1'/I'l[>E if' ~..r , , ,916(: F008 BEO t-lOCHt·lG then r.o cr.an:3e

916E 800001 STA TT'-.-'t'1DE el ~e ·=.a'.....9171 4A LSR A mO.·.·IE" to

9172 4A L5R A c-o~.,--e,,·t

9173 4A LSR A = os itior,'3174 0'~18 ORA #FIGS con' ....r--t. to crJ.~r

9176 20E0'~1 JSR T1'/IJI_IT and=.end

9179 68 HOCHt-lGPLA "'e I_ . c-h.•~· b.•c l-.

917A 20E091 tKrt'lC'E JSR TI\'OUT send i I_ .

917D 4CC481 t-lOFRtH JMP RE,5ALL and ret-'_..-n

'3180 60' BAUDOT. 8'.-'TE $60., $FF., $FF.' $FF ..$FF ~$FF ~$FF~$4':59181 FF9182 FF

9183 FF9184 FF

9185 FF

'3186 FF91:37 45

9188 FF .8' ....E $FF_.$FF ..2,$FF~$FF.,8..$FF~:iFF'318'3 FF918A 02

'3188 FF918(: FF

918D 08

918E FF918F FF

'31913FF •B·...E $FF.•$FF~$FF~$FF~$FF. •$FF~$FF~$FF9191 FF

9192 FF

9193 FF

9194 FF

9195 FF9196 FF

9197 FF

9198 FF .8'/TE $FF., $FF., $FF., $FF ~$FF ~$FF ~$FF., $FF9199 FF

919A FF

9198 FF919C FF

9190 FF

919E FF919F FF

91Ae 04 .B'YTE 4~$4D~$FF,$54,$4'3,$FF,$5A~$4891Al 4D

91A2 FF

91A3 54

91A4 49

91AS FF

91A6 ~91A7 4S

91AS 4F

91A9 52

91AA FF91AB 5191Ae: 4(:

91AD 4091AE 5C

91AF 5D

91813 569181 57

'~lB2 539183 41

9184 4A9185 50

9186 559187 47

9188 46

9189 58

918A 4E9188 5E

918C FF

9180 FF

918E FF

91BF 59

91C0 FF

91Cl 63

91C2 79

91C3 6E

91C4 69

91C5 61

91C6 6091C7 7A91C8 7491(:9 66

91CA 6B

91CB 6F91CC 72

91CD 7C

91CE 6C

91CF 78

9100 769101 77

9102 6A

91D3 659104 70

9105 67';:Ill)b {.t:.

9107 73

91D8 7D',lD9 75

91DA 719108 FF91De FF9100 FF

91DE 43

910F FF

91E091E091E0

91E0 A2:21391E2 8E1c13A491E5 291F91E7 09'S(1

91E9 49cF

91ES 38

91EC 2A

91ED A00':::91EF 4A

91F0 4891Fl A900

91F3 9t1I0291F5 0'32(1

91F7 8002A491FA 6E:

91F8 2'eOS'3291FE S;:

91FF DelEE

9201 6el

92029202

921329202 A2a892134 0002

';'206 A2169208 2CilE98A

9208 48

920C 6H

9200 en920E DOF8

92113 60

3211

18:54 MICRO -- The 6502 JO~lrnal

• B\'TE lAF., $52~$FF., $51 ..$4::, $40.·$51:.,$5['

•BVTE $56 ..$57., $53., $41 .'$4A., $5~:1..$55_,14-;-'

.8'.-'TE $46, $5::::,$4E., tSE., $FF.,$FF, $FF, $5'?

• S 'v 'TE $FF ~$63., $79., :lEE., :Sf,'?, $61 $E.[;.,$7A

,8'/TE $74., $66., $EB.,$EF..$72, $7(".'$6(".,$7:3

• BVTE $7E,-'t7'7 ~$6A., $65., $?\Z1! $67 ..$7E.,173

;8AUDOT Out·F"ut.

TT'/OUT LN'; 11$20

srx PE:OA+1

AtlD 11$1 = -

OF:A #$I"~.j.:l

EOF: IISFF

SE':F:eL A

L[:o',' II:::

:..5F: A

FHA

LOA 11(1

8CC OUTCtlE

OF:A11$::0

STI~P8['A

FLA

J5F.: FULL..

DE'.,.St·lE tl::TE:ITRTS

N~<T8IT

OUTOt·lE

HALF LU:: 1111

8.lE TIf'lLCtPFULL Leo:,:1122

TH1LOP JSR [)L'/H

PHA

FLA

OE>':St'lE TIt'lLOFRT5

•EI,['

E.e t_ . F ': 'I - r_ t . , _ ,

.:d_J"t_·F._.It l"f;c"j.,:.

10~,k ~t. ~~t~ ~lt~

3d,j . 2 : :. t_ .: .p t.'ll_

':':'U'F ler'·I'::·(-lt

·~et_ -:;t.3r I_ ,- .'; _J_

:._et.UF rc.. .: L . . , ; .

rIK".'E' ls.b t , : : . ,

;-~.)-= ,:-h.~I·-

': 1e ~t-- fcr ZE't"- < : . '

if I ...:' C·~r--i· '-I _,r.,F

-:01: '0:- :-et- bi t_:;.-=t-,d f _ . , : . F:'r-f_

~ . : - r _ . ch.;:~r b.::..,:~-:.

, j . : = - 1.~:;I · _ : , r , o : ; . til. t_

trl.:-r·l < : 1:1'_~nt_ .j':,I.,.WI

if i(10 ;-- -= U - -, E' n 1 ,: :" ': _ .F

'I? 1 ;'.0:- -lU i~~

h.~ 1 f F·er- lC,j d0 2 l . a· : : I

~c' do 1

full FE'r l,:!.j

d e l- ;; '· := I I re - s

1'111

':-':'I_Jnt_. ,jc.I..1rl

and l':":'F

ur.t, 11 ,jc·n.:-

November, 1979

Page 57: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 57/68

The MICRO Software! Catalog: XIV

Mike Rowe

P.O. Box 6502Chelmsford, MA 01824

Software Catalog Note

This regular feature of MICROis provided both as a service to

our readers and asa service to the 6502industry which iswork-

ing hard to develop new and better software products for the

6502 based system. There is no charge for listings in this

catalog. All that is required is that material for the listing be

submitted in the listing format. All info should be included.We reserve the right to edit and/or reject any submission.

Some of the submissions are starting to get much too long.

We might not edit the description the same way you would, so

please, be brief and specific.

)

Name:System:Memory:Language:Hardware:

Environment for KIM BASICKIM running Microsoft BASIC1.2KMachine languageany KIM that runs BASIC

Description: This software package provides the follow-ing utility programs for use with KIM BASIC: Renumber,Range Deletion, Append, Character-Oriented LineEditing, Automatic Line Number Prompting, Controlled

Listings. The package is configured to interface itselfautomatically with any version of 9-digit KIM BASICupon execution. There are no restrictions on length ofinternal references in lines; you can renumber from1,2,3, to 63000,63010 and back again. Renumberstypical 200 line program in less than 10 seconds. Rangedeletions (i.e. Delete 100-950) take approxomately 5seconds per 100 lines deleted. One POKE makes thenext LOAD an APPEND and then restores regular LOADstatus. All functions have complete error checks beforechanging your original program and report errors usingBASIC's own error messages. Page length can bevariedduring listing or command mode at any paint. Edit modeallows moving lines in the program or changing one sec-tion of a line without retyping the complete commented

source listing.

Includes: KIM format tape, source, manualPrice: $20.00 plus $1.50 shipping and handl-

ing. California residents add 6%sales tax.

Author: Sean McKennaAvailable from:

Sean McKenna64 Fairview Ave.Piedmont, CA 94610

Name:System:Memory:Language:

MEM·EXPLORERCommodore PET8K or moreMicrosoft PET BASIC with 6502machine·language subroutinePET 2001·8, 2001·16, or 2001·32ardware:

Description: MEM·EXPLORER gives the PET owner a"window" into his computer, to give an understandableview (If memory contents-both user (RAM) and lnter-

preter/OS (ROM).When the program is run, you are ask-ed for a starting location. MEM·EXPLORER thenpresents information on 20 bytes of memory, startingwith the location you specified. In the left column is theaddress of the byte, while columns to the right hold thedecimal value of its contents, the character equivalent(or BASIC token, if appropriate), and two different two-byte values (address, integer). By specifying the area inRAM where the BASIC program is stored, you can ac-tually see the program "listed" vertically in thecharacter column, and tell exactly where everycharacter or token is stored. MEM-EXPLORER includesroutines that allow it to be combined with your pro-grams automatically.

Many$7.95 (quantity discount available)Cassette in Norelco-style box,description, operating instructions,and zip-lock protective package.

Designer: Roy BusdieckerAvailable from: Better computer stores, or directly from

Micro Software SystemsP.O. Box 1442Woodbridge, VA 22193

Copies:Price:Includes:

November, 1979 MICRO -- The 6502 Journal 18:55

Page 58: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 58/68

Name:System:Memory:Language:Hardware:

Space Shuttle Landing SimulatorAPPLE II48KAssembly and Applesoft II6HIRES color APPLE and Applesoft IIROM card

Description: Modeled after the real Shuttle MissionSimulator, this program is a real flight simulator. TheHIRES screen shows the "out-the-window" view using

animation, projective geometry, and high speedassembly language graphics to display the image of therunway, sky, mountain, clouds, etc. In text below thescreen is the flight data plus warnings and messages.Real flight algorithms are tailored to the ShuttleOrbiter's f light characteristics providing realistic stickresponse using the game paddle. Functional featuresare: full stall capability, ejection, landing gear, speedbrakes,and wheel brakes on roll out. Runway stripes onroll out give a speed indication. The instruction manualis 10 pages, over 3500 words, and provides a brief in-troduction to guiding flight.

Copies:Price:

Just Released (20 Aug 79).$15.00 ppd. New Mexico residents

add 4% sales tax.John Martellarouthor:Available from:

Harvey's Space Ship RepairP.O. Box 3478University ParkLas Cruces, NM 88003

Name:System:Memory:Language:

Hardware:

XMON, an extended monitor for TIMany version of TIMminimum 512 bytes6502 assembly

Mimimum TIM plus 2708 addressingand comparitor with 5 discretes; op-tional LED and 2 discretes.

Description: Nine commands from terminal provide: fillmemory with constant; move, compare memory blocks;search for string; go execute with breakpoint and singlestep trace; exit to TIM monitor; load and dump KIM for-mat cassette at 4K1min. All functions externallycallable; suitable for calling by TINY USR function.Standard version resides ECOOthrough EFFF.

Copies: Just ReleasedPrice: $28.00 for standard version, Add

$7.00 for relocation.

Includes: 2708 PROM, comparitor anddiscretes, instructions, schematics.Author: Phil LangeAvailable from:

206 Santa Clara Ave.Dayton, Ohio 45405(513)278-0506

Name:System:Memory:l.anquaqe:

APPLE II Sweet 16 AssemblerAPPLE II16K RAM, Cassette DeckMachine and Sweet 16

Description: This system is a co-resident, two passassembler for Sweet 16, the 16 bit software processorresident in the APPLE II Rom. The assembler has fullcursor editing capabilities identical to those ofApplesott, English Language error messages, and line

length up to 255 characters for extended programdocumentation. Commands are included to read andwrite the text file to tape, display the input format,renumber lines, list text file, return to APPLE monitor,and to assemble. The assembler supports pseudo OPSto determine ASCII strings, define hex strings, labellocation, and define program origin. The assembler listsaddresses, object code, source code and symbol table.Included with the program is full documentation for useof the assembler, plus a full description of all Sweet 16OP codes and16 bit registers and short programs il-

lustrating each operation.

Copies:Price:

Author:Availabile from:

Just Released$15.00

Steve Cochard

Scientific SoftwareP.O. Box 156Stowe, PA 19464

Name:System:Memory:Languaqe:

AMPER·SORT IIAPPLE32K minimumAssembler

Description: AMPER-SORT " is an enhanced version of

the AMPER-SORT routine published in MICRO, number14.Two major enhancements improve sort speed and in-crease its versatility. The Shell-Metzner algorithmreduces sort time and a capability to sort two-dimensional character string arrays enables AMPER·SORT II to be used easily with programs such as FILECABINET, an Apple Contributed Software Bank pro-gram. FILE CABINET with AMPER-SORT II will sort 100records of 3 10-byte-average fields in :3 seconds com-pared to 7 minutes using the original BASIC sort code.AMPER·SORT II will sort integer arrays, floating pointarrays, and one or two-dimensional string arrays. It alsoteaturee an easy-to-use BASIC interface to pass arrayname and sort parameters.

Copies: Just ReleasedPrice: $15.95. (California residents add 6%sales tax)

Author: Alan G. HillAvailable from:

PROGRAMMA INTERNATIONAL, Inc.3400Wilshire Blvd.Los Angeles, CA 90010

18:56 MICRO -- The 6502 Journal November, 1979

Page 59: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 59/68

B r in g in g M

VISIT THE APPLE DEALER NEAREST YOU AND ASK FOR A

DEMONSTRATION OF MMI'S MICRO COMPOSER ™The MICRO COMPOSER LETS YOU-

• Play up to 4 simultaneous voices

• See all 4 voices at the same time you're hearing the music-a

must for music editing!

• Enter music notes by a fast, simple and well-tested coding

system.

• Program the pitch, rhythm, and timbre of the music. Tempo is

varied by the Apple paddle.

• Choose 7 different tone colors for each voice or create your

own tone color.

• Compose, edit, display, and play music through an interactive,command-driven language that's easy to learn.

• Save your music on disk or cassette.

• Hear quality music sound at low cost through the MICRO MUSIC ™DAC card. No amplifier needed! Designed for MMI by Hal

Chamberlin and Micro Technology Unlimited.

• Select from future MMI music instruction software to accompany

the MICRO MUSIC DAC_

Ask your local dealer for information on MMI products, or contact:

i c H o m e

Being a spectator is great___but why not participate?

• Sing along

• Compose• Play

• Learn from Specialists

The MIC:RO COMPOSER is an APPLE II® compat ibile, low-cost

music system designed by the folks at MMI. Our music software was

designed by leading experts in music education. A simple step-by-

step instruction manual leads you through entering, displaying,

editing, and playing music with up to four voices-soprano, alto,

tenor, and bass. You can choriqe the sound of each voice to reed,

brass, string, or organ sounds and you can even color your own music

sounds!

HAV E M ICRO COM POSER comes complete with an instruction manual.

software di,;kor cossette-in either Integer or Applesalt R OM B AS IC , and the MICRO

M U SIC D A(: musiccord. Just plug the M ICR O M U SIC DAC into the APPLE extension slot

and connect the oudio coble to a speoker.Suggested retail price $220.

1 '1 1 '1 0_WL _N

M icro M u sic In c 309 Beaufort, University Plaza, Normal, IL 61761APPLE I I IS a trademark of Apple Computer Inc

Page 60: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 60/68

\.:

One of the most common re-

quests I receive from our readers is

that MICRO provide reviews of hard-

ware and software products. One of

the most common types of articles

MICRO receives is the product

review. Why then, you may

reasonably ask, hasn't MICRO

printed lots of reviews? The answer

is simple. While some othermagazines print product reviews as

filler material, I feel that a product

review is a very special trust and

must be handled in special ways. I

feel that any review printed in

MICRO should be as accurate, un-

biased, and complete as possible,

and that the qualifications and

potential "conflicts of interest" of

the author should be known.

Unsol icited Reviews

Think for a moment about the un-

solicited reviews MICRO receives.

Why did the author write the

review? Probably for one of two

reasons:He loved the product, or,

He hated the product.

Name:

MICRO Reviewer

In either case the author is biased.

An even more serious problem with

the unsolicited review is that an

author could have a vested interest

in a product. He might be a friend of

the manufacturer of the procluct, or

could even be the manufacturer

himself! Another problems that

the coverage of the possible pro-

ducts is going to be very spotty.Since every author is free to choose

what he is going to review, some

very good products will be overlook-

ed, and some bad ones, too.

A Plan

I have come up with a plan which

feel will permit MICRO to obtain

the types of reviews it wants and

which the readers require. Phase 1

of the plan entails getting a list of

qualified, unbiased reviewers. This

panel of reviewers would each fill

out the attached form and submit it

to MICRO. Authors would then be

selected from this group to review

products. Since the form provides ameans by which the basic qualifica-

tions of the authors may be deter-

MICRO Reviewer Qualifica11ion Form

mined, and since the selection

would be made by MICRO, not the

individual authors, both the

qualification and bias problems

should be solved.

Reviewer Qualification Form

Why should you become a reviewer

for MICRO? I can think of a number

of good reasons. First, you will geta chance to try new products, often

before they become generally

available. Second, you will get a

chance to help fellow computer ists

by providing the detailed informa-

tion they need to help decide on the

merits of various products. Third,

you will have your review published

under your "byline". Fourth, you

will be paid by MICRO for the

review. Fifth, you will normally be

able to purchase the product you

reviewed at a substantial discount.

If you would like to become a

reviewer for MICRO, please com-

plete and return the attached form.

Address: .

City: _'" __. . . . . . .. State: Zip: .

Phone: Days: Evenings:

List all 6502 Hardware you own or have 'unlimited' access to: .

List Programming languages you are qualified in and can use on your equipment: .

List types of 6502 applications you are interested in: .

List any special equipment which your system uses/supports: .

List A L L companies, stores, etc. with which you have any relationship other than as customer, and A N Ycompany, store, etc. whose products you do not feel you should review for any other reason:

Write a brief biography which may be published with your reviews which gives the reader a summary of

your interests and qualifications: .

I declare that the above information is complete and accurate.

Signed: Date: .

Please complete, using additional pages if necessary, and return to : MICRO, P.O. Box 6502, Chelmsford, MA 01824

Page 61: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 61/68

Alarming APPLE

Paul IrwinP.O.B. 1264, Station BOttawa, Ontario K1P 5R3

Canada

Here is a way to program you APPLE to respcnd to

errors with an alarm and keyboard lockout.

)Instead of using the CTRL·G beep on

your next program, here's an alarm

system written to assist in performingerror recovery on the APPLE II. When thealarm system is used, your program will

react to an error by immediately lockingthe keyboard, sounding a continuoustwo-tone alarm, and forcing theoperator's attention to an error recoverysubroutine. No way will recognizable er·rors escape your edits once they meetthe Alarming APPLE!

To use the alarm system, start witheach of your subroutines clearly definedas either error detecting or error correc-ting. This means that you will classifymost of your "normal" routines as errordetecting routines. Arrange to have allof your rout ines invoked by a mainline.Then the mainline can invoke error cor-recting routines, as well, and stil l remain

in control. This is illustrated by the pro-gram shown here.

In the BASIC listing, the one errordetecting routine is called TASK, whilethe error correcting routine is TRAP. Themainline is free to decide what to doafter recovery: whether to continue thesame error detecting routine or to takeany other action. An intelligent mainlineof this sort can avoid, most errorrecovery hassles.

November, 1979

The key to the error recovery pro-cedure is a machine langua(je routinecalled ALARM_ It is invoked trom BASICby executing a CALL 3529 and frommachine language by executing a JSR

$OC9_ The alarm routine will thengenerate a two-tone alarm continuously.At the end of each cycle, it exa.mines thekeyboard for a CTRL-C. If 110ne wasfound, it cont inues sounding the alarm.But when a CTRL-C is typed, the soundwill stop and the routine will return. Theeffect is to produce a continuous sound,ignoring any input, until a CTRL-C isentered.

You may have your own icleas as tohow the alarm should sound. The dura-tion of the first tone is in $OA2 and itsperiod is in $090. The second tone hasits duration and pitch stored in $OBFand $OBA. The two that I employ are

quite noisy, but you can experiment withother parameter pairs. Those periodsthat are relatively prime - having nocommon factor - will produce discord.They will be loudest when matching theAPPLE's speaker resonance.

When loading the routines, rememberto set LOMEM greater than $000, thehighest location in the alarm routine, sothe two won't overwri te each other. TheBASIC routine shown here will run as it

MICRO -- The 6502 Journal

appears, and will invoke the machinelanguage routine. If you are not bother-ing with the BASIC, simply JSR $OC9_

After you run the Alarming APPLE and

decide to use it for error recovery in yournext program, consider these ideas:

Organize the program into error detec-ting routines, one or more error recoveryroutines, and an intelligent mainline.

Use an error flag in the recoveryroutines to inform the mainline.

Use a status flag iinthe error recoveryroutines to indicate success or failure ofthe recovery procedure to the mainline.

Let the mainline make all decisionsregarding what to do next.

For instance, if you are heavily intostructured programming, you might con-

sider a mainline centered on a computedGOSUB with the returns of each routinesetting a status number pointing to thenext routine. Or you may want to use IFsand GOSUBs tofether in the mainl ine aseach case is decided. The importantthing is to route all control decisions -decisions that answer the question:"What next?" - through the mainline.Including error recovery decisions. Infact, especially errol' recovery declsions.

18:59

Page 62: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 62/68

:l "~EM2 FEM

]. REM

4 TFtSK=1(llll21

113 OFF=13: TFtSK=2(1121TRAP=112!e; ALARM=3529

95 REM

E:ASI C CALL SEQUENCE

FOR ALARM PROMPT ROUTINE

96 RE~ l

97 REM

98 REM

99 REM

11311ERR=OFF· C,OSUB TASK: IF ERR THEN GOSUB

MAIN L WE SEQUENCE

TRAP

101 REM

1£12 REl1 .

110 GOTO :,2767

120 REM

121. REt' !

122 F:El'!

212113NPUT ERR. REl'! . USE FOR TEST

210 REM

21:l REM PUT ER"~OR DETECTING TASK HERE212 REM REPLACING LINE 20e;

213: REt' !

22fl RETURN

2:.~7 REM

298 RE M

2~~9 PEt'1

3 : (Ill POKE 5,,1,127· PF~rr-1T "Ei<ROR"; POKE 51),255

PRINT" TYPE A CTRL/C": CALL ALARl'!::10 REt'1

::2(1 REt'1 PUT ERROR RECOVER'" ROUTHIE HERE::::0 RE~1

::4(1 RETUF:N

Figure 1: Example of a BASIC program invoking the

alarm routine in Fig. 2. 3529 is $DC9.

P V E N T U R E

GAMES OF HIGH ADVENTURE

FOR THE APPLE II FROM

1 SYNERGISTIC SOFTWARE

· i 5221 120th Ave. S.E.

Bellevue, WA 98006

The Apventure games combine the exciting graphics andsound effects capabilities of the APPLE II with the fas-cinating complexity of a mythical adventure game.Monsters, hazards, obstacles , weapons, magical devicesand evil powers confront the player at every turn asyou gather treasure and try to reach your goal. Two

adventures are now avai lable:

DUNGEON CAMPAIGN· Full color graphicssubterranean adventure. 16K required.

CASS, $12.50 DISK $15.00

WILDERNESS CAMPAIGN· HIRES graphicssurface adventure. 48K required.

CASSo $15.00 DISK $17.50

GET BOTH ON ONE DISK FOR $30.00

(WA Res. add 5.3% sales tax)

IijDE:1- FF ·n·~·

0D82- FF .-,.-,.-,

0083- AO 30 Cll LrJA SCB1l1

0086- :::8 DE'"0087- 0121135 8NE Sl108E

1::)089- (:E 82 ao DEC $lIDE:2

OOSC- FB (19 8EL~ SOD97

0D8E- CA DE;~0DE:F- Oll F5 8NE SBD86

~iD91- AE 81 BD LO.I.( S(ID81

£ID~"4- 4(: :::: 1 2 1 0 JMP SllDS3

0D97- t:~121 RTS

(ID98- Ata(10

LD'"#SlCtl,1

ft09A- A2 138 Li);< #$I)ll

(109(:- AS ' 47 LDA #$47

otlD9E- 8D :::1 0D 5TA S0D81

tIDA1- 1 " 1 9 AI2I LOA #$AICI

tiiOtB- 80 :32 1)0 5TA $ICIO:32

I:':IDA6- 20 81 e o ' ] 5 R SICI081

IOIDA9- 2C 1:':1e;C13 8IT SCIC10tii

0DAC- HI 07 8PL $tl085

IjOAE- AD 1010CI) LOA $(:1)0121

ICID81- 2C 113 CI:':I BIT S(:I):l1C1

13D84- 61;) RT5

(1085- A0 1313 LD'T' #$60

1:1087- A2 13101 LO~< #$(1(1

1:':1089- AS' 6~1 LDA #$6(1

IJD88- SO ::::l L ) [ ) 5TA S(1081

ICID8E- A9 A0 LDA #SAe;

101D(:£I- :3D :::2 ICI[) STA $130:32

ODC::- 2(1 83 (I[) J5R S~1083

,,10(:6- 4(: 98 oo ·Jto1P Stl098(11)(:9- 2(1 9:: : 1 2 1 0 J5R S(I098

1~ID(:C- (:9 : : c Cl'!P #$E:J:

I2tDCE- 06 F9 E:~~E S(10C9

tlDD(I- 6~t RT5

Figure 2: Machine language routine to

sound two·tone alarm until ctrllC is

typed. All other input is ignored. To

demonstrate, type DC9G to the APPLE II

monitor.

Put 'Yourself inControl with theAPPlETHROTTLE

That's riuht! The N'PLETHROrnf willtum

your game paddles into a speed controller.Bysimpt~ pushing a button, you can stopyour computer for as long as you want.Release the button, and your computerenters a slow-motionmode with onepaddle controlling the speed. And ifthatisn't enough, look at these additionalfeatures:

• Plugs nto any slot• Works with machine language, IntegerBASIC,and Applesoft

• Normal· slow. stop

• Use to UST,"TRACE,RUN,etc.

• NO SOFTWAREo load=APPLETHROTTLE• Unveilprogram secrets

And there's more! Nomore multiple UST commands to viewsmallprogramsections. With the APPlETHROTTLE, you' ll be able to list or trace longprograms whilewatchingyour program flowin slow-motion, So get incontrolwith the A.PPlETHRO TTLE and order yours today!

PROTOBOARD,with over 1300holes on 0.1 centers for designingyour owncircuits.APB·1 Protoboard .... $17.95

APPLE:TIME,a RealTime ClockfortheAppleU. Plugs directly intoanyslot and keeps time even whencomputer is off. Features 12/24Hour, BCD/ASCIIdata format, andAC/CtyStal time base selection.Includes software examples formachine language and BASIC pro-grams. Completely assembled andtested.APT·1 RealTime Clock $79,95

VERBATIM 5W' DISKETTES

S of t- Se cto r B ox . of 10 ... $34,50(plastic file case included)

. .

Page 63: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 63/68

6502 Blblloqrapny; Part XIV

Will iam R. Dial438 Roslyn AVenUE!Akron, OH 44320

491. Rainbow 1, Number 4 (April, 1979)Minch, David "Review: Electronic Index Card", p1.

This program by BobBishop emulates a card index filebut the reviewer doesn't think it offers substantial ad-vantages.

Editor, "Pascal", p2.

The editor discusses the Pascal Language soon to beavailable to Apple owners.

Simpson, Rick "Introduction to Assembly Language Pro-gramming" pgs. 4-19.

A tutorial article on this important subject.

)

Watson, Allen "HI-RES Color" pg. 10.

The relationship between the color subcarrier frequen-cy and the color dots; also why there are gaps in ver-

tical and near vertical vectors in colors other thanwhite.

Minch, David "Firmware Review - Programmer's AidROM"pgs.11-12.

The reviewer feels the ROM is a mixed blessing, of

limited utility. The Operating Manual is very good.

492. KBMicrocomputing No 30 (June, 1979)Lindsay, Len "PET Pouri" pgs. 6-12.

Discusses a way to protect software, evaluation ofcassette quality, new hardware and software,periodicals with PETinformation, list protection, Traceprogram, and disabling the STOPkey.

Anon.,"Ohio Scientific's Small System Journal"pg.8-11Discussion of Microcomputer Information Manage-ment systems.

Van Dyke,James A. "A Sneaky Interrupt for the 6502"pg.97.

A novel interrupt using the SO input pin.

493. Creative Computing 5 No 5 (May, 1979)

Kelley, Derek "Beyond the Text Editor"pgs. 32-33.Program that searches for words, etc., on the Apple.

Hunter, Jim "Peripherals Unlimited Text Editor" p.46.

Upper and Lower case word processing with the Dan

Paymar lower case adapter for the Apple and this TextEditor.

}

Yob,Gregory "Personal Electronic Transactions"pgs. 122-127.

I/O on the PET, Notes on PET Graphics, includinghigher resolution, a list of PET I/O lines.

November, 1979

494. PI!rsonal Computing 3 (June, 1979)Zimmermann, Mark "Line Renumbering Renumbered"pg.7.

Modifications to the earlier program published inMarch, for the Apple.

Zimmermann, Mark" 'G' is for Graphics" pgs.38-41.

An educational picture book for the kids on the PET.

495. Cider Press 2 (May, 1979)Anon. "Apple Tape BeepsTranslated" pg.3.

Why the beeps areon the leader and at the end of pro-grams.

Anon. "May DOM" pg. 2.

The May Disk of the Month has a good mix of pro-

grams of different categories; games, utilities,business, etc. Apple.

Hertzfeld, Andy "An EasyWay to USE!Text Page2"pg.3.

Add text to page two graphics usin!;!these instructionson the Apple.

Aldrich, Ron "Split Catalog" pg.4.

Split your catalog print-out on the Apple Disk, printingtwo titles across the page.

Kamins, Scot and Guarriques, Chris "Mini-Word Pro-cesser" pg.4.The Cider Squeezer was specifically designed to aidApple users to write short articles.

Draper, John T. "Textwriter's Creation" pg.5.

Discussion of how a word processor evolved.Apple.

Espinosa, Chris and Wyman, Paul "CALLS, POKESandPEEKS" pgs. 6-7.

A convenient listing of these important routines for theApple.

Silverman, Ken "Filling your Memory Cells" pg.7.

An updated listing of the various 16K dynamic RAMsnow available together with speed designations, etc.Beware of units of 300NSor evensllowerspeed.

Nareff, Max J. "Matrix Simulation with the Apple, PartIII" pgs. 8-9.

Anothar installment in this continuing series.

SuHivan,Charles Jr. "Meeting with Sargon" pg.9.

Chess 4 by the author and the wll known Sargo II fightit out on the chess board. Apple.

MICRO -- The 6502 Journal 18:61

Page 64: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 64/68

Anon. "Appl ibrary" pgs. 10·11.The Apple Core Library now lists 274 programs in 13different categories, for the Apple II.

496. Call -Apple 2 No 4 (Apr./May, 1979)Smith, Ken and Scharen, Rosalie "Analysis of the GreatHello Program", pgs. 4-7.Analysis of the tricks in this interest ing program.Apple.

Golding, Val J. "Integral Data IP 225 Printer: A Review"pgs. 8-11.

How to use this printer with the Apple. A Printer Driverroutine by Darrell and Ron Aldrich is given.

Aldrich, Ron "Ron's Page" pgs. 12-17.HI-Res Screen Dump Routine, Split Catalog Routine, etc.

Suitor, Richard F. "Apple Disk Operating System" pg.17A discussion including some insights into the details ofthe new Apple Disk DOS 3.2.

Winston, Alan B. "The Multi lingual Apple" pgs 18-19.Discussion of languages other than Basic for the Apple:PILOT, FORTH, FCL65E, XPLO, Pascal.

Aldrich, Darrell "Monitor Calls, Cross References andMemory Map" pgs 20-23.

Important calls and addresses based on the authorsresearch.

Aldrich, Darrell "The Apple Doctor" pgs 30-31.How to save a shape table along with an Applesoft Pro-gram.

Golding, Val J. "Routine to Center Tit les" pg.31.A simple integer Basic Utili ty.

497_MICRO No 12 (May, 1979)Morganstein, David 'Real-Time Games on OSI" pgs 31-33How real-time games can be written for Challengersystems which use a serial terminal run from the ACIA.

498_Rainbow 1, Issue 5 (May, 1979)Memory Enterprises "Color-Killer Module" pg.6.

An easy to install module to add the color-killer function toearly model Apple lis.

Watson, Allen III "Another Review of the Programmer'sAID #1" pgs. 7-10.A description of the features of this accessory ROM.

Anon. "An Interview with Phil Roybal of Apple Corp"pgs 11-13.Phil Roybal, market ing manager for Apple Corp., revealsthat coming soon is an "auto-start" monitor ROM that willpower up the Apple directly into Basic, or upon hittingreset, also a stop list feature, easier cursor control, etc.

499. Calculator/Computers 3 (Jan./Feb., 1979)Bobek, Frank "Vats Right" pgs 41-45.A program to aid physics students studying velocity and

acceleration phenomena. For the PET.

500. Calculator/Computers 2 (Nov./Dec., 1979)Oglesby, Mac "Sinners" pgs 36-38.Three of Satan's Fiends fight against a group of sinners.For the PET.

501. Dr. Dobb's Journal 4, Issue 6 (June/July, 1979)Colburn, Don "EXOS-A Software Development Tool Kitfor the 6500 Microprocessor Family" pgs. 29-31.A tool to efficiently and effectively both generate andmodify 6500 assembly language programs.

Monsour, Fred J. "Kim Renumber" pg. 47.A program to renumber KIM-1 Microsoft Basic listings.

502. stems From Apple 2, Issue 5 (May, 1979)Armstrong, Kevin "Numeric Sort Routine" pg.2.A sort program written in Applesoft II.

Reed, Hon "Paddle Speed Control" pg.3.Conlrol a slow list or program execution with the Applepaddles.

Hoggatt, Ken 'Ken's Korner" pgs 4-5.A series of tutorials for the Apple user including the use ofGET A or GET $A, the use of the mini-assembler, Yes andNo statements, etc.

503. Rel:reational Computing 7, Issue 39 (May/June, 1979)Feniger, Bob "A Different Way to Float" pg. 6.A dif ferent version of an earlier program for the PET.

Carpenter, Chuck "PILOT for the Apple - ,!I,nExtendedMlcnO-PILOT Interpreter" pgs 28-31.An interpreter in Applesoft.

Saal, Harry "SPOT" pgs. 52-55.Notes for PET users include information on new models ofthe PET, a review of Cursor cassette magazine, new bookson the PET, and a graphics program listing calledCASCADES.

504. crsatlve Computing 5, No 6 (June, 1979)Badgett, J. Tom "Strings and Things: Basic String Man-ipulations" pgs. 86-90.Tutorial on String variables, etc.

North, Steve "ALF/Apple Music Synthesizer" pgs 102-103ReviE!Wof the new Accessory for the Apple which makespossible high-quality computer music.

Soft-One "Apple Graphics Programs" pg. 143.High Resolution Graphics Utili ty Set, including characterset, lower case, shape vector table assembler, etc.

505. MIC:RONo 13 (June, 1979)Putney, Charles B."Harmonic Analysis for theApple" pgs 5-8.

A program in Applesoft Floating Point BASIC lets the Ap-ple do Fourier Analysis calculations.

Pytlik, William F. "Case of the Missing Tape Counter"pg.11.How to locate your f iles on the PET Cassette.

Taylor, William L. "The Basic Morse Keyboard" pgs 13-15.A Ham program implemented on an OSI system to make anASCII keyboard act as a "Morse Keyboard."

Rinard, Phillip M. 'A SYM-phony in Stereo" pgs 17-19This music program uses the 6532 and the 6522's of theSYM to generate stereo music.

Foote, Gary A. 'Sort ing with the APPLE 1 1- Part I"pgs.

21-26.The first installment presents some backgroundmaterial and compares three sorting techniques andgives a program for the SHELL-METZNER sort.

Cass, James L. 'Streamlining the C2-4P" pg.28Three modifications for the OSI C2-4P to raise itsspeed, increase cassette through put and add reversevidec to the display.

18:62 MICRO -- The 6502 Journal November, 1979

Page 65: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 65/68

~IJr l TI1IS 1J~(][I~flrnII] E r l f [ l r [ J r . f r . i r l mrn L J [ l I ( ] U Jar [ I ( ] f ( ] r n r . i lL J ( ] " ,

~I] .nsu turn[II] ~ [ I [ J [ l i l l [ l f r . [ 1 J ] [ I r s ( ] r l r . 1

[ I ( ] r n l J I J f [ l r [ l r . f r . I ( ] ~

~I] E r I [ J ·

UJflll []IHlfl! lJ~:~ · . r T H E . , I~

Follow this simple program and you will receive lcmLIIi~mMII~'M'I!1II" "

The Personal Computer Catalog. The one refer- t t l ~1JW~~&.~ence book to f!ne quality personal computers, I : . : .software, supphes and accessories. i : : fThis valuable catalog is FREE so mail your order ........ 11___

today.

1 - - - - - - - - - - - - - - - - - - - - .ame _

Address __

City State Zip _

Do you own a computer? What type? _

Do you use your computer for: Business? _

Personal? Education? Other? _

- - - - - - - - - - - - - - - - - - -

Page 66: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 66/68

A I M 65 BY ROCKWELL INTERNATIONAL

AIM 65 is fully assembled, tested and warranted. With theaddition of a low cost, readily available power supply, it'sready to start working for you.

AIM 65 features on-board thermal printer andalphanumeric display, and a terminal-style keyboard. Ithas an addressing capability up to 65K bytes, and comeswith a user-dedicated 1K or 4K RAM. Two installed 4KROMS hold a powerful Advanced Interface Monitorprogram, and three spare sockets are included to expandon-board ROM or PROM up to 20K bytes.An Application Connector provides for attaching a TTY

and one or two audio cassette recorders, and gives exter-nal access to the user-dedicated general purpose I/O lines.Also included as standard are a comprehensive AIM 65

User's Manual, a handy pocket reference card, an R6500Hardware Manual, an R6500 Programming Manual and anAIM 65 schematic.AIM 65 is packaged on two compact modules. The

circuit module is 12 inches wide and 10 inches long, thekeyboard module is 12 inches wide and 4 inches long.They are connected by a detachable cable.

THERMAL PRINTERMost desired feature on low-cost microcomputer systems ...• Wide 20-column printout• Versatile 5 x 7 dot matrix format• Complete 64-character ASCII alphanumeric format• Fast 120 lines per minute• Quite thermal operation• Proven reliability

FULL-SIZE ALPHANUMERIC KEYBOARDProvides compatibility with system terminals .. .• Standard 54 key, terminal-style layout• 26 alphabetic characters• 10 numeric characters• 22 special characters• 9 control functions

• 3 user-defined functions

TRUE ALPHANUMERIC DISPLAYProvides legible and lengthy display .. .• 20 characters wide• 16-segment characters• High contrast monolithic characters• Complete 64-character ASCII alphanumeric format

PROVEN RI5500MICROCOMPUTER SYSTEM DEVICESReliable, high performance NMOS technology ...• R6502 Central Processing Unit (CPU), operating at 1MHz. Has 65K address capability, 13 addressing modesand true index capability. Simple but powerful 56instructions.

• Read/Write Memory, using R2114 Stat ic RAM devices.Available in 1K byte and 4K byte versions.

• 8K Monitor Program Memory, using R2332 Static ROMdevices. Has sockets to accept addit ional ;2332ROM or2532 PROM devices, to expand on-board Programrnernoryup to 20K bytes.

• R6532 RJ~M-Input/Output-Timer (RIOT) comiJinationdevice. Multipurpose circuit for AIM 65 Monitor functions.

• Two R65:22Versatile Interface Adapter (VIA) devices,which support AIM 65 and user functions. Each VIA hastwo parallel and one serial 8-bit , bidirectional I/O ports,two 2-bit peripheral handshake control lines and twotuily-proqramrnable 16-bit interval timer/event counters.

BUILT-IN EXPANSION CAPABILITY• 44-Pin Application Connector for peripheral add-ons• 44-Pin Expansion Connector has full system bus• Both connectors are KIM-1 compatible

TTY AND A,UDIO CASSETIE INTERFACESStandard interface to low-cost peripherals ...• 20 mao current loop ny interface• Interface for two audio cassette recorders• Two audio cassette formats: ASCII KIM-1 compatibleand binary, blocked file assembler compatible

ROM RESII)ENT ADVANCED INTERACTIVE MONITORAdvanced leatures found only on larger systems ...• Monitor-!~enerated prompts• Single keystroke commands• Address independent data entry• Debug aids• Error messages• Option and user interface linkage

ADVANCE!) INTERACTIVE MONITOR COMMANDS• Major Function Entry

• Instruct ion Entry and Disassembly• Display/Alter Registers and Memory• Manipulate Breakpoints• Control Instruction/Trace• Control Peripheral Devices• Call User-Defined Functions• Cornprehenstve Text Editor

LOW COST PLUG·IN ROM OPTIONS• 4K Assembler-symbolic, two-pass $79.00• 8K BASIC Interpreter $99.00

POWER SUPPLY SPECIFICATIONS• + 5 VDC ± 5% regulated @ 2.0 amps (max)• + 24 VDC ± 15% unregulated @ 2.5 amps (peak)0.5 amps average

PRICE: $369.00 (1K RAM)

Plus $4.00 UPS (shipped in U.S. must give street address),$10 parcel post to APO's, FPO's, Alaska, Hawai i, Canada,$25 air mail to all other countries

We manufacture a complete line of high quality expansionboards. USI~reader service card to be added to our mail inglist, or U.S. residents send $1.00 (International send $3.00U.S.) for airmail delivery of our complete catalog.

2967 W, Fairmount Avenue

Phoenix AZ. 85017

(602)265-7564

Page 67: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 67/68

••••••••••••••••••••••••••••••••••••••• *t NOW PRESEN T IN G . · · ...

• •t Software for A pple®11 :t for your Entertainment" Business" Education ~

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

SIll'A II'IIdiMS:FI LEM A STER 2 program s: FORMAT & RETR IEVAL comprise

a powe rfu l d ata file m anager. G reat for e ve ry thing from phone lists

to le gal ab stracts. N ee ds 3 2K . De sign your own d ata stru ctu re . U p

to 50 0 characte rs pe r re cord . U p to 15 searchab le fie lds in any corn-

b ination. On Disk . .... .... .... ..• ... .... .. $34 .95

SPA CE M u lti-face te d sim ulation of life in inte rste llar socie ty . You

and oppone nts m ust m ak e life & d eath d ecisions. K ee ps track of

y ou r progress from one gam e to ne xt. Ne ed s 4 8K and Apple soft

ROM . Disk $29 .95

Pot O'G oid I or our All New Pot 0 ' G old II A collection of 49 pro-

gram s for 16 K Apple . Eve ry thing from Logic to action gam es. Only

a buck a gam e . Specify I o r II. Price each: Tape $49 .... Disk $54

ADV ENTU RE Fight off pirate s and v iciou s d warfs. 700 trave l op-

tions, 14 0 locations, 6 4 ob je cts. Ne ed s RO M & 48K . Disk . . $29 .95

16 K CA SSETTE INV ENTORY U se ite m nu mbe r, d escription,

stock am ou nt, reorde r am ou nt, restock date , cost & s ell price . H old s

up to 14 0 item s. Tape $35

3 2K DISK IN VEN TORY: U se stock num be rs d escription, v end or,

record of pu rchase and sales d ate , am ou nt on hand , cost & s e ll p ri ce ,

total value . Hold s up to 3 00 item s. Disk $40

With Parts Explosion: Disk $50

3 2K DA TA BA SE Cross file for phone lists, b ib liographie s, re cipe s.

Run up to 9 lines of 40 colum ns each. Search by item anywhere .

Disk $20

24 K HI-RES LIFE SIM U LA TION Conway 's equations on 2 96 x180

scre en. A m athe matical sim ulation to d em o popu lation growth with

birth, death and su rv ival as factors. Tape $10

16 K CIRCU IT LOG IC DEV ELOPM ENT AID Ev aluate circu its of

up to 255 gate s, includ ing AND, OR, NOR, NAND, XOR, XNOR

and INVERTER. Tape $10

16K M O RSE CO DE TRAINE R Learn M orse Cod e , and transm it or

receive 0 v er rad io. T ape . . . . . . . . . . . . . . . . . . . . . . . $10

16 K DEV IL'S DU NG EON: A dv enture through d ark passage s whe re

m onste rs, d em ons, poisonou s gas, d ropoffs thre ate n _ . . all to d isco-

ve r fantastic treasu re s. Com es with instru ction book . Tape ... $10

16 K PA CIFIC A: Discov er the floating island and re scu e the b eau ti-

fu l princess. To win you m ust recov e r the enchanted crown, bu t you

face the threat of m agic spells and d emons. Tape $9 .95

Don't see what you've been looking for, here?

Then write for our FREE SOFTWARE CATALOG.

We're saving one just for yout

To ord er software , ad d $2 shipping. To transfer tape ve r-

sions to d isk add $5 . California re sid ents ad d 6% sale s tax.

Sorry , we can not ship to P. O . Boxe s. V ISA /M A ST ER CHA RG E

Welcomed!

RA IN BOW'S CA SIN O 9 gam bling gam es: Rou le tte , B lack jack ,

C raps, H orse race , and a fe w originals that V egas hasn't he ard ab ou t.

Needs 16K . Tape $29 .95

16 1< SPACE W AR: You in your space capsu le battle against the

compu ter's saucer in hi-re s graphics. Tape $12

16 1{ M EM ORY V ERIFY Diagnostic rou tine to che ck range of m ern-

orv . Ind icate s fau lty ad dre sse s, d ata in m em ory ce ll, and fau lty d ata.

Tape $516 1{ A PPL EODION M u sic sy nthe sis com pose s orig inal Irish jig s.

Ente r your own m usic and sav e on tape or d isk . Includ es 3 Bach

fuquas. Tape $10

16 1K A PPL EV ISIO N D em o for Hi-Re s graphics and m usic.

Tape $10

32 1K COM PU -READ 5 program s to te ach v ou spe ed read ing, in

stage s. Inclu de s sy nony m and antony m id entification. You control

you r rate of speed , or k e ep up with the com pute r's pace .

Disk $24 .9 5

48K PERCEPTION I,ll, III random shapes and siz es m ust be

m atche d, In III, you control form at and d isplay tim e and ge t

we ighted score s. Need s R OM . E ach Disk $24 .95

32K STORY TELLER U se you r b izarre im agination and input k eywo rd s for fantastic and fu nny tale s. N ev er the sam e story twice .

Tape $12 .95

3 2K W AR/RESCU E Engage in 10 b attles with y ou r infantry against.

the A pple rob ots. Calcu late A pple 's strate gy and win m ore b attle s

than the compu te r. Tape $12 .95

2 4K PO LA R PLO T Plot polar equations in Hi-Re s G raphics.

Tape $10

32 K SHA PE SCALER U tility to ge ne rate and anim ate Hi-Re s

graphic shape s. Sim ple rou tine prov id ed to inspe ct position of

shape s, and spe cify pre cise X /Y coord inate s and scale . N ee ds R OM .

Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $13 .9 5

32K Z INTAR/PROPHET G reat party gam e. U nde r control of the

m ighty Z intar's ed ict y ou tak e a ve ry special trip to the world of

K rintar. Heightened v isu al graphics. Ne ed s ROM .Disk .. .. $16 .95

AP'PLE M ONITOR PEELED Eve rything you wanted to k now about

the A pple M onitor bu t couldn't figure ou t. U se r-writte n m anu al in

plain English clears your confusion. Only $9 .95

Gard en Plaza Shopping Cente r, Dept. 11 A

9719 Resed a Blv d ., Northridge , Ca 91324

Te lephone : (213 ) 349 -5560

Page 68: Micro 6502 Journal November 1979

8/3/2019 Micro 6502 Journal November 1979

http://slidepdf.com/reader/full/micro-6502-journal-november-1979 68/68

APPLE [email protected] & EXPANDA·PORT

E VERY A PPLE 'II OW NER S H O U LD H A VE O N E !

JOYSTICK $49.95

The PROGRAMMA JOYSTICK is an input peripheral that

attaches to the APPLE 1 / Computer's game 1 /0 Port. The

JOYSTICK is a must for the serious game player, and it

offers a degree of linearity not currently available with other

joysticks. The ease of manueverability and the availability

of the "functional" switches make the PROG RAMMA

JOYSTICK a much needed enhancement to any APPLE 1 /

Computer System owner. The PROGRAMMA JOYSTICK

comes completely assembled and tested, including a User's

Guide.

The PROGRAMMA EXPANDA-PORT is a multi-port ex-

pander for the game 1 /0 port of any APPLE 1 / Computer

System. In addition to aI/owing expansion for up to sixdevices, the EXPANDA-PORTcontains a built-in speaker

that replaces the function of the Apple" 's speaker. The

switcheson the EXPANDA-PORT aI/ow for the selection of