micro 6502 journal april/may 1984

84
8/3/2019 Micro 6502 Journal April/May 1984 http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 1/84 NO. 71 PRINTER CONTROL $2.50 $3.00 for the Serious Com~uterist ...J o II: I- Z o o II: W I- Z * Double Vision * Micro Mouse * Easy DOES·IT * The Accurate Printer * HiRes Screen Dump o

Upload: cubemanpdx

Post on 06-Apr-2018

228 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 1/84

NO. 71 PRINTER CONTROL $2.50$3.00

for the Serious Com~uterist

...J

oII:I-ZooII:W

I-Z

* Double Vision

* Micro Mouse

* Easy DOES·IT

* The Accurate Printer

* HiRes Screen Dump

o

Page 2: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 2/84

his is just 1 qf

0 pages of theewest and biggestyles catalog, hot

ff the press.

e know you'llant this page, in

ts full 7 x 10lendor, andnother 19 pagesperipherals,

oftware and bookshat will make your

or VIComputer evenicer to live with.

i f we missed

sending you yqurvery own copywithin the la~(f~w

weeks, .c~ltl.~~fl~.'

(800l~~7-~~~'1(unless y o p l & r ~i n Ccd ifQ rn ia ~ "'iQ

which ..case-call(415)

·965·~.,":J5~

From Skyles

Electric·gWorks.'ii;. , • . c . . . '

oldest ..~ ( < i fprofessionalspecialists

business.

1

kyle s E lec tric Wo rks.231-E S.Whisman Road

:.MQuntain View,Califomia 94041

Page 3: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 3/84

CAD / CAM ! DON 'T SPEND 25k, 50kr $500 ,000 BEFO RE YO U SPEND $79 00

book w ill provide m anagers,

n ee rs , ma nu fa ctu rin g p ers o nn elany in te rested persons ans ta ndin g o f th e fu ndamenta ls o f

ute r A ided Design [C AD] and

e r A idedm anu fac tu ring [CAM]icat ions and techno logy.

p rogram w ill expose you to the

us CAD/CAM te rmino log ies used.

re a nd softw a re c omparis on sexp lo red w i th heavyemphas is on

advan ta ges and d isadvanta ges .jus ti fi ca ti on and imp lemen tat ion

p re sen ted u s in g case s tu die s .

O SHOULD

course is designed fo r but no t

to :T ho se m an age rs , e ngin ee rs an d

ch pro fess iona ls assoc iatedwi thmanu fac tu ring indus tr y.

Personne l from Product, Too lign , P lan t Layout and P lan t

ineering w ho are in te rested in

D RESULTprogram wil lenablepartic ipants to:

r n bas ic CAD /CAM Vocabula ry .te r u nde rs ta nd th e var io u s ha rd -

e a nd so ftw a re c ompon e nts u s-

in a ty pic al C AD w ork s ta tio n.

e lect the exis ting CAD/CAMs te m mos t appro priate fo r cur-

t a nd p ro je cte d n e ed s.

e a n e ffe ctiv e c os t ju stific atio nto W hy they SHOULD or

HOULD NOT implement a

CAM sys tem .

5 . Apply a ndu se compu te r g ra ph ic s a s

a p roduct iv it y t oo l.

PROGRAMCONTENT1 . In troduction

a . H is to ry o f C AD/CAM

b . Imp orta nc e o f CAD /CAM

2 . G r aph ic s wo rk s ta tio n pe rip he ra lsa. lnput

b . Ou tp ut

c . Ad van ta ges and d isadvan ta geso f in pu t a nd o utp ut d ev ic es .

3. Compute r G r aphic s Systems

[Hardware]a . M i cr os

b . M in is

c . M a in F rame s

d . Tu rn key G raphic s sy stems

4 . So ftw a rea . Ope ra tin g systems

b . G r aphic s Packages

c . G r aphic s Module s

5 . C ompu te r A id ed De sig na . Geome t ri c De fin it ions

[Po in ts , L ines , C i rc les , ETC. . ]

b . Con t ro l f unc tions

c . Graph ics Man ipu la ti ons

d . D ra ftin g Func tio n s

e . F i lingfunctions

f . App l ica tions

z~

~

CONT INU ING EDUCAT ION FDA BETTER

C A D I C A M :A P R O D U C T I V I T Y

~ E N H A N C E M E N T T O O L

6 . Imp lemen tat iona . De te rm inin g need s

b . Pu rchasing and Instal li ngc . Ge ttin g S ta rt ed

7 . C o st J us tific atio n a nd Surv eya. C os t co mp aris on s o f tw o an d fo urw o rk s ta tio n s ys tems.

b. P re sentation o f re cent survey of

C AD s ys tem u se rs

ZANIM SYSTEMSMAKESTH ISSPEC IAL

OFFER: IF YOU BUY CAD/CAM: A

P~IODUCTIVITY ENHANCEMENT

TOIOL BEFOREAPR IL 1 5T H, WE W ILL

INCLUDE F R E E O F C H A R G E T H E S E T W O

PAPERS PUBLISHED NATIONALLY BY

Z AN IM SYS TEMS CAD /C AM EXPER T.

" . "C re atio n o f a Large D ata B as e f or

a Sma ll G r aphic s System"

C ~ . " Sh orte st P ath A lg orithm Us in g

Compu te r Graph ics "

O f course you could spend as m uch as

$495. $595 o r $695 for a s im ilar 3 day

s ern inar even though th is book is n ot a

co rnpu te r p rog ram.

W E! te ll you April 15th fo r a specia l

reason ... t h is product may be tax

deductib le depending on your fie ld or

needs, This 1 70 p ag e c ou rs e w ill s atis fy

any of your CAD/CAM needs . W e

gua ran tee i t.

P le as e s e nd $ 79 to :

ZAN 1M SYSTEMS

CAD/CAM GROUP

P.O. BOX 4364

FLINT IMI 48504(313) 233-5731

Q U AN T IT Y D IS C O U N T S A V A J L AB LE F O R C O LL EG E S ,

U N IV E R S IT IE S A N D /O R S EM IN A R U S E .

Page 4: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 4/84

There are three ways to learn 6502 Assembly Language on your Apple Computer:

Hard Easy Easiest., ).0 '1r

,0 \ ... . , , .I ..

OTHERASSEMBLERS LISA v2.6 LISA ED PAC

Page 5: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 5/84

MICROP.O. Box 6502

Chelmsford, MA 01824617/256-3649

Publisher/Editor-in-ChiefRobert M. Tripp

Associate PublisherCindy Kocher

Production ManagerJennifer Collins

Technical EditorMark Morano

Advertising ManagerCindy Kocher

Sales ManagerC. Skip Bentle

Circulation ManagerLinda Hensdill

Customer ServiceKim Dundas

Contributing EditorsCornelis Bongers

Phil DaleyDavid Malmberg

John SteinerJim StrasmaPaul Swanson

Richard C. Vile, Jr.Loren Wright

MlCRO is published monthly by:

MICRO, Chelmsford, MA 01824.

Second Class postage paid at:

Chelmsford, MA 01824 and additional

mailing offices.

USPSPublication Number: 483470.

ISSN: 0271·9002.

Send subscriptions, change of address,

USPS Form 3579, requests for back issues

and all othe fulfillment questions to:

MICROP.O.Box 6502

Chelmsford, ;';1A 01824

or call 617/256-3649.Subscription Rates: (per year):

U.S. $24.00or $42.00for two years

Foreign surface mail: $27.00Air mail: Europe $42.00

Mexico, Central America, Middle East,North Africa, Central Africa $48.00

South America, South Africa, Far East,Australia, New Zealand $72.00

Copyright © 1984by MICRO.

All Rights Reserved.

No. 71 - April/May 1984

for the Serious Computerist

20 The AccuratePrinterRichard Marmon

Reproduce Ataricharacters on your Epson

29 A Low Cost Mousefor the Vic·20 (orany computer)Robert LMartin

Build the latest computerdevice for inputting data

32 Double VisionCata log for 40 or80 ColumnsAlan and Valerie Floeter

List your CATALOG in twoor three columns

35 A New Variationon an Old Theme:Replace Your 6502Ron M _ Battle

A new R65COOfamily hasinteresting enhancements

37 Spec Box: 16KColor ComputerMike Hamilton

Generate PMODE 4 HiResgraphics on the CoCowithout Extended BASIC

40 Easy DOES-IT(Not DosPlus), Pt.4Michael KeryanAdd new utility functionsto a Commodore 64

47 Four Techniquesto Make YourPrograms FastChris Williams

Become the fastestprogrammer in town

49 Talking to YourPrinterDick Buchanan, Jr., et al

A printer control program

and Generic BASIC notes

S5 HiRes ScreenDump for theEPSON MX·80Robert D_Walker

Subroutine for dumpingApple II hi-res graphics

E;2A Timely InterruptMike Hamilton

Make an accurate timer

with just a few POKEs

Ei3Disk Abuse: A TrueStoryMark S. Morano

The sad confessions of adisk junkie

6 Editorial

8 Letterbox112Reviews in BriefE ;4 CoCo Bits66 Interface Clinic7'1Commodore Compass7'3 From Here to Atari7'4 Hardware Catalog7'7 Review Index7'9 Listing ConventionsB IO Advertiser Index

MICRO

,~

tI

II

3

Page 6: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 6/84

NEG 2050 '999.00

NEG3550 ·1679.00

PERCOMITANDOMDISK DRIVES

5 v . . " 320K Roppy

5 Meg Hard w /Con trol le r.

10 Meg Hard w/Contrul ie r .

15 Meg Hard w/Controller

20 Meg Hard w/Cont roit er ..

AMDEK310A Amber MonltDr '169.00

QXY100 Rotter '59900

ColorII '399.00

'229.00

CALL

CALL

CALL

CALL

AST RESEARCHSix Pak P lus . . fr omCombo Plus 11. f rcm

Mega P lus, . from

11 0 Plus .. fran

.'279.00

. '279.00

'309.00

'139.00

VISICORPIBM APPLE

Vis lCalc 1159.00Vis iCal c 4 '159.00VisiCalc Advanced '269.00ViSiWordISpell '24900

Visitrend/Piot '199-00 1199.00Visil.Jnk '169.00VislFile '199.00 1169.00

Vis lSchedule '19900 '199.00

v r s r o e x 1159.00

ViSiAot '135.00VisiTerm '75.00

Desktop P lan "9900 '169.00

Bus Forecast Model '75.00 '75.00

StretchCalc 17500 '75.00

VislTutor Calc '59.00 '59.00

ve'roro- Advarced '75-00 '75.00VislTutor'V\la'd '259.00 '59.00

Vlsl-Qn Calc '289.00VIS I-On Graph ' 179 DOVlsl-On Word 1275.00Vls l-On Mouse 115900VISI -On Host 131900

pfsIBM APPLE

Wnr.e '8900 '79.00Graph '89.00 '79.00Report '79-00 179.00

Fi le '89.00 '79.00Soictrms" as low as '1600 '16-00

* C a lf O n T i tl es

MONOGRAMDo ll ar s an d Se nse

LOTUS1-2-3 '399.00

PROFESSIONAL SOFTWAREPC PIL5iThe Boss. ,_.... '349.00

SYNAPSEFileMeneqer. '89.00

SOFTWARE ARTSTK Solver ,,'189.00

QUADRAMQuadl ink

Quadboard as low as

Quad 512 P lus . .as IQV.Ias

Quadcolor. as IQV.Ias.

Chronograph

Parallel Interface Board

64K RAM Chips Kit

MICROPRO

1479.00

...... '289.00

1249.00

'219.00

'8900

'8900

'59.00

VI/ordStar/MalMerge.

InfoStar

SpeUS ta r

Cae Star

'349.00

'29900

'159.00

.... ·9900

Crosstalk

MICROSTUF

MICROSOFT

'105.00

Multiplan ...,'159.00

ASHTON-TATEdBASE II

Friday!

'38900

1185-00

IUSEasyWnter II .1249.00

EasySpeUer '119.00

EasyFiler ..... '229.00

CONTINENTAL SOFTWARE' lsc C lass Mal /Form let ter

Horne Accomtarc Plus

.. '79.00

188.00

PRINTERSAXIOM

AT-100 Atan l raerfece

GP-100 Parallel InterfaceAT-846 Interface

'239.00

. '199.00

'8900

BMC401 Letter GUality ..

BX-80 Dcx. Matr- ix

CENTRONICS

'589.00

'26900

122 Paral le l

739-1 Paral le l

73 9- 3 Se r- ra

.... '299.00.. '199.00

'249.00

C.ITOH'209.00

'379.00

'59900

'56900

..,1929.00

'999.00

'1499.00

COMREXCornwrrter IILetter GUality

DIABLO620 Letter ClJality '949 00

630 letter Quality 1174900

DAISYWRlTER'999_00

Tractor Feed 110900

._.1499.00

EPSONMX-80FT.MX-100.RX-80. RX-80FT,

FX-80 , FX-100

IDSPrism 80 For Contrqc-accns CALL

Prism 32 .For Configurations CAU

MANNESMAN TALLY160L

180L

NEC2010/2030

8023 Do t Matnx . .

8025 Dot Mat rix . .

3510 Seria l/Letter- t lJal ity

3530 Paral le l/Le tter Qua li ty

7710/7730 Ser ia l/Pa ra ll el . .

OKIDATA82. 83, 84, 92, 93 , 2350, 2410 . .

SMITH CORONA

'899.00

'37900

'669.00

'1449.00

.'1499.00

'1949.00

TP-2 '399.00

..... '119.00aco- Feed.

SILVER REED500 Letter Quality

550 Let te r- GUa li ty

STAR

'469,00

'699.00

Gemin i 10X

Germra P15X

Delt a 10

Senal Board

'299.00

'399.00

'559.00

.175.00

1350.

TOSHIBA

TRANSTAR

'1699.00

120P ..

130P.

._'499.00

... '689.00

1499_0015 Color

APPLE INTERFACECARDS & BUFFERS

CALL

Choose from PKASO, Orange Micro, MPC,

Microrvtax. Tymac, Quadram & Pr-accioe!

Penpner -el s PRINTER CABLESare avelabe for most all computers on the

ma rk et . We sup pl y a ll yo or c omput er ne ed s.

PAPER SUPPLIES

M8C 1100..

FD O 3200-32[ K D riv e

M8C 1150

M8C 1200

FOO 6400-64('K Onve ..

MBC 1250.

PR 5500 Pnnu!r .

APPLE/FRANKLINDI5iK DRIVES

MICRO-SCIA2

A40.

A70

.'219.00

.'299.00

1319.00

.'79.00

..... ·8900

RANABite 1 1279.00

Bite 2.. . .. '389.00

Bite 3 .. . ..... ·569.00

APPLE He STARTER PACK64K App le l ie . D i: ;k Onve & C(TIt rd le r, 80 Cdumn

Card, 1\I1(T1itor II s OD S 3.3

COMPLETE ....• _•_ . _ , CAll.

ACE 100 0 Col or Comput er

ACE FamJi y Pack Sys tem

ACE PRO PLUS Sys tem

ACE 1200 Office Mgnt_ System

"Not lie Exoensrve'

TIERMINALS oTeleJideo14

924

925

950

970

'56~00

.... '689.00

'739.00

'929.00

'1039.00

CCJMPUTERSTeleport Por-teble

800A..

802.

803.

802H

806/20

816/40

1602 ...

1603

.CALL

11099_00

. '2699.00

ANCHORMODEMS

Volksmodem

Mark IL.

Mar k V II (A ur o I ~ns ./ Aut o Di al]

Mack XII[1200 Baud].

TRS-80 Color Compu te r

9 \otJl tPowe r SLpp ly . .

HAYESSmarrmodem 31)0

.'59.00 NOVATION179.00 J-Cat '9999

.. 1119.00 SmartCat 103 .. 1179.00

'299.00 SmartCat 103/212 '399.00

.. '99.00 AuroCat 121900

.... '9.00 212 AuooCat :1549.00

App le Cat II 1249.00

'209.00212 Apple Cat '56900

App le Cat 21 2 Up gr ad e '30900'499.00

Cat '13999'449.00'26900 ZENITH.'299.00 ZT-1 1339.00

._...... ·8!:1_00 ZT-10 130 9 DC

.'199.00 ZT-11 '369.00

CALL Mic romo :i em l ie

Micrcmodem 1(10 .

Sme-t Com II

Chronograph

AMDEKMONITORS

PRINCETON GRAPHICS300 Green .

300 Amber_ .

310 Amber ..

Color 1

.1149.00

... 1159.00

.... . 1169.00

..1279.00

1299.00

.... '399.00

.'419.00

. ._... '349.00

'699.00

HX-12 RGB '51900

SAKATA

TAXAN100 126900

210 Color AG8

400 Med-Res RGB

415 Hi -Re s RG8

420 H,-ResRGB[IBM]

100 12" Green

105 12" Am~r

'29900

1319_00

'439_00

5489.00

112500

113500

Color 3.

Color 4 .

BMC1 2' " G ree n . . . .. . ' 8B .99

.1119.99

'249_00 '99.99

'11999

'149_99

$ ~39 9 9

'269_99

USI2'" Green Hi-RI!s_.

9191- 13' " Col o'

GORILLAPI 1, 9 '" Green.

PI 2, 12" Green

Pi 3, 12" Amber

Pi 4. 9" Amber

1400 Color

12" Green ..

12" Amber

'88.99

... 195.99

NEC QUADRAMJ8 1260 Greer ..

J8 1201 Greer

J8 1205 Ambe-.

Quadchrome 8400 '549.0C

ZENITH

Page 7: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 7/84

(:: commodoreCBM 8032 •..•••••••••...•••••·599CBM 4032 .••••••.•..•••••••••599

'34900

'599_00

'S69 00

..'999.00

'76900'269.00

'299.00

..'949.00

... 11199_00

'379.00

.'5S9_00

'1399.00

'499.00

'69900

'199DO

112500

'15900

PROFESSIONAL

SOFTWAREWord Pro 2 Pius '159.00

'189.00

. '279_00

'179.00

... '39900

'7900

Ward Pro 3 PiL5

Word Pro 4 Plus/5 Plus. each

InfoPro

Administrator

Power

SX-64PORTABLESS39

VIC 20 ••••••••••••••••••••••••••ALL

CBM 64•••••••••••.••••••••••••199C 154 1 Disk Drive ....'249.00

,'6900

'129.00

'219.00

'29900

...·249.00,14.99

..'11.99

'5900

... ·S9OO

'49.00

'39.00

...·59.00

'4900

.... '65.00

'39.00

'75.00'49.00

'499_00

'459_00,154.00

'49.00

'34.95

C1530 Datasette

C1520 Color Printer/Plotter.

M-80 1 Do t Matrix Printer.

C1526 Oat Matnx/Senal

C1702 Calor Monitor

C1311 Joystick

C1312 Pa dd ie s . .

C1600 VICModem

C1650 Auto Modem

Log o 6 4

Pilot 64

Qui ck Br-own Fox

MCS 801 Cdc- Pnnter

OPS 1101 Daisy Printer

MagiC Voice Speech Morule .

Desk O rgan izer Lock.

vldtex T eeco-mwncaucos

We stock a full inventory of software for Commodore. such

as: Artworx. Broderbund. Commercial Data. Creative Soft-

ware. EPYX. HES. MicroSpec. Nufekop. Romox. Sirius.

Synapse. Thorn EMI. Tronix. UMI. Victory. Spinnaker. Rain-

bow & Timeworks!

ATARISOFTINFOCOM ISM/AP CS4N1C

Zork 1,2,3 (AT/AP/CBMIIBM] ,'29.00 PacMan '29.99 '3799

Deadl ine (AT/AP/CSMnSM]. '32.95 Cent ipede '29.99 '37.99

Enchanter (AT/AP/CBMIISM] '32.95 D ig D ug '29.99 '37.99

F1..,etfall [AT/AP/CSMnSM]. '3295 Donkey Kong '29.99 '3799

Witness (ATfAP/CBMI!BM) '3295 Defender '2999 '37.99

Starcross [AT/APfCBM/IBM] '2900 Robotron '29.99 '37.99

Star Gate '2999'37.99

CMO'S PORTABLE CORNER

[h~

41CV ••••••••••••.••••..•••.•••199··41CX ••••••••••••••.•••.••••...249 ..HP 10C

HP 11C

HP 12C

HP 15C

HP 16C

HP 75C

'51.99

'69.99

'88.99

'S8.99

'B8.99

'749.99

'98.99

'35999

'143.99

'6399

'6399

T,mex/Sinc lar 1000

PC-S201·599

NECPC-8221 A Thermal Printer

PC-8281 A Data Recorder . .

PC-S201-0S SKRAMChps

PC-S206A 32K RAMCartridge.

...'14939. ·S9.00

'105.00

'32900

-HARPPC-1500A .•..•••••·165BSPC-1250A ••••••••.•.·SS88CE-125 Printer/Cassette

CE-150 Color Printer/Cassette

CE-155 8K RAM

CE161 16K RAM

CE-500 ROMUbrary

WHILE SUPP'LIES LAST!

ATARI600XL$149'7400 SOOXL•..........•••..• ·299'249.00

1200XL ........•...•. CALL34900

'30900

1400XL ..•••......••• CALL'11900

. '33900

[ ~ E ~ a ( J M I12.00

·S00

,'6400

'4800AT SS-S1 '36900

'105.00AT SS-A1 '259.00

'22900

ATSS-S1 PO '44900,'4700AT 8S-00A '11900

'33.00RFO 40-S1 '44900

'2900RFO 40-A1 '26900

'29.00RFO 40-S2 '699 00

'15900RFO 44-S1 '53900

'7900RFO 44-S2 'S69.00

'S9.00TEXAS INSTRUMENTS

'7500 TX 99-S1 '27900'33.00

'3300 RANA'39.00 1000 '32900

'3500 TRAK'3900 AT02 '3S9OO

'7900 INDUS'3900

GT-Omoe 137900'3900

'39_00 MEMORY BOARDS

101 D Recorder

1020 Co er Pnnter .

1025 Oat Matn( Printer

1027 Letter Qua li ty.

1030 Direct Connect Mocem..

1050 Oisk Dr ive.

CX30 Paddle. .

4013 Asteroids

5049 ViSiCaic

7079 Logo

7101 Entertaner

7102 Arcade Chemp.

S026 0;9 D.J9.

8030 E T_Phone Heme

8031 Oonkey Kong.

8033 Rabotron

8034 Poe Posit ion

8036 Atan Wn te r

8040 Donkey Kong, J r

8043 Ms. Paanan

8044 Joust

DISKEnESMAXELL

5"·' MD·1

5"·' MO-2.

S" FO·1 (SS/OO]

S·· FO-2 (OS/OO]..

VERBATIM

'2900

'3900

13900

'4900

5"·· SS/OO.

s»: OS/DO'26.99

. '3699

ELEPHANT5~" SS/SD

5Y.." 55/00

5y." DS/DD.

'18_49

.'2299

'2S 99

HEAD5 Y4 ' Ihsk Head Cleaner .'14.99

DISK HOLDERSINNOVATIVE CONCEPTS

Bie-n-File 10 .. _.'399

Rip-n-File 50 .'17 99

He-n-Pi le (400;800 ROM]HoIder '1799

UKAtan Letter Perfect Oisk(40f80]

Atar i Letter Perfect ROM[40 colj.

Atan Letter Perf ec t ROM(80 cd ]

Atar i Dat a Per fec t ROM (80 col]Atar i Spell Per fect Disk

Atan Utllity/MailMerge

Appe Letter Perfect.

Apple Data Per-teet _.

Appe UK Uti li ty.

Apple lower Case Generator

179_99

'79.99

'79_99

'79_99'5999

Axlon 32K

Ax lm 48K

Axlon 128K

Int ec 32K

Int ec 48K

incec 64K

Intec Real Time Clock

'5900

'99.00

'29900

'5900

'8400

'9900

12900

ALIEN VOICE BOXAtanApple

'11900

'149.00

CONTROLLERS&JOYSTICKS

WICOJOYStiCk

3-way Joystick

Famous Red 8a11

Power Gnp

BOSS Joystick

ATARINIC Trak BallAppe Trak 8a11

Apple Adapter

Apple An, ;og

KRAFT

Atar l S lr lgle F ire

Atarl SWitch Hitter

Apple Paddles

IBM Paddles

IBM Joystick

AMIGA3100 Singl e

3101 Par

Joyboard

TGAtan Trek Ba ll

Page 8: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 8/84

Once Upon a MICRO

Once upon a time, MICRO began as a magazine topromote the 6502 microprocessor. At that time, back in

the murky mists of microcomputing, 1977, no one was

giving this marvelous chip any attention. You could read

many issues of Byte without even encountering it. We felt

that this chip, and the KIM-1 microcomputer that MOS

Technology had produced to demonstrate the abilities of

the 6502, deserved better treatment. The rapid growth of

MICRO showed that we were right!

Once upon a time, MICRO was more a 'community' of

6502 users than it was a 'publication'. MICRO's readers

were willing to tackle the new micros, solve the many

problems that were encountered, and share their

information with other readers. It was an exciting time ofexploration and experimentation. Many important

features were discovered, problems solved and projects

generated by the MICRO reader/ author.

Once upon a time, MICRO helped lead its readers into

new areas by systematically exposing them to other

microcomputers, microprocessors, languages, techniques,

hardware projects, and so forth.

Once upon a time, MICRO provided very rapid turn-

around on material submitted for publication. Articles

were typically published within two or three months of

initial receipt. This rapid tum-around was satisfying to the

authors and useful to the readers.

Once upon a time, MICRO was a small, over-worked

but happy staff that took pride in producing a top quality

product.

Once upon a time, MICRO was directed by an

individual who had experience in software - from

operating system design through applications, and

hardware knowledge - from simple interfacing up to

designing a complete disk-oriented microcomputer

system.

Once upon a time, MICRO provided an up-to-date

catalog of important hardware and software products, in a

standardized format that made it easy to use.

Once upon a time, MICRO had a panel of expert

reviewers who provided accurate, unbiased, and timely

reviews of new products.

Well, "Once Upon A Time" is now! While MICRO has

tried a lot of different ideas, particularly during the past

year, it has now returned to its 'roots'. We have worked

hard toget MICRO back on track as the premier magazine

for people who are serious about all aspects of the

650216809/68000 family of microcomputers. Some of the

obvious changes have included moving MICRO back to

Chelmsford, MA where it began, my reassuming the

active role of Publisher and Editor-in-Chief, and numerous

6

Editorial

changes in the staff to streamline and improve our overall

operation. In the past few months we have cleared the

queue of all out-of-date articles and reviews that had beenaccumulated, Lave re-established active dialog with many

key authors, have worked out internal procedures to

insure rapid response to all submissions, have developed

improved listing methods for both assembly and BASIC

listings, and much more. Other changes are underway,

some of which will take time to develop, all of which are

aimed at making MICRO work for you.

One new way in which MICRO will work is to present

material on diskette. Many program/ articles are received

that are 'too long' to print or to key in but are 'too good'

not to use. Rather than ignore this significant material, or

hold it for an eventual book/disk, MICRO will now offer

certain materials on disk. See the announcement on page80 of this issue for details on our first offerings.

If you are an author, MICRO guarantees that your

manuscript will be reviewed and you will receive

notification within two weeks of receipt. This rapid

response will serve to get your material into print quickly

with prompt payment, and will insure that the MICRO

readers are getting the most current information.

If you are a reader, MICRO invites you to become a

more active participant in the world of microcomputing.

Tell us, through the TuneReader Survey, what you want

MICRO to do for you. Send us your ideas, suggestions,

feedback. IWedo listen! The negative reader feedback that

we received on our 'new, improved' listing techniques inthe November and December issues made us find better

methods.) And, most of all, write articles to share your

knowledge and understanding with others. In this

fantastic world of microcomputers, nobody knows

everything, and everyone knows something.

MICRO is your magazine. Make it work for you.

Editor-in-Chief

This Month's Cover

When he looked at this windmill, Don Quixote saw

double. He fought an imaginary giant, and he lost.

In Double Vision,Valerie and Alan Floeter fight a real

giant ... the problem of one long listing using the

CATALOG routine. Unlike Don Quixote, the Floeters win

their battle. Now your listing can be condensed into two,

three, or four columns, but don't worry-your not

imagining it-you've got Double Vision.

MICRO No. 71 - April/May 1984

Page 9: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 9/84

Sent in a l 5 " s s / o d 10/ 1.8 0 50/ 1.75 100/ 1.65Sentinal 5" ds/dd 10/ 2.40 50/ 2.35 100/ 2.25

M S O D u a l S u p e r D is k f o r IE E E o r C 6 4 5 7 0 W e s to c k D ys a n d is k sr e la ce s 4 04 0 d riv e

HS : = ; CR : : : ; : E ~ EN ~M : : ; A ! i fK E ; ' :; R h 8 : : ; " OC o ~ l u ~ m n - : A - : "d a - - ' p t~ . r ~ fo ~ r1 " l I ' 6 T " 4.. . . , . 1 3 l 1 " l r ' 1

Prov ide b ig s cr een capab il it y f or b rs in e ss appl ica ti on s .

C o p y -W ri t e r W o rd P ro c e s s o r f o r C 6 4 4 9F ull- fe atu re d p ac ka ge w ith 8 00 lin es o f t ex t in m em or y.

Inc ludes double co lumn pr in t ing, graphic capabi li ty , fu ll pr in -

te r suppor t .

~P_~~_~~!_~~_~~~!!1_~!~!l~_~lt!rl t!!_~~~~!? _ ~V ICTORY Sof twa re f or V IC a nd C6 4

Metamorphosis 16 Creator's Revenge 16

Labyrinth of C reator 16 Galactic Conquest 16

Kongo Kong 16 Annihilator 16

Chomper Man 16 Grave Robbers 13

~~_~!y__I!~~!~! !~ ~~~~_P~~_~_~_~_~ ! _ ! !

PAPER C LIP Word Prucessor - CBM/C64 60

ORACLE Data Base from Batteries Included 89

SPINNAKER Sof twa re C6 4, A pp le . I BM , A ta ri

Computers First B ook of PET/CBM 11

POWER ROM Utilities for PET/CBM 78

WordPro 4+ - 8032, d isk, printer 285

VISICALC for PET, ATARI, or Apple 189

C om pu te 's F ir st B oo k o f 6 4 S ou nd & Graphics II

SM-KIT enhancod PET/CBM ROM UHllllos 40

PET Spacemaker II ROM Switch 36

Compute's First Book of Games 11

Dust C over for PET, CBM, 4040, or 8050 8

CmC In te rfa ce s ( ADA IS oo , A DA 1 4 50 , S AD I in s to ck l

Compute!'s Reforence Guide to 64 Graphics II

Computet's Machine Language f or Beginners 11

HES Saf twa re a nd Har dwa re i n s to ck

S P E C IA LS o n IN T EG R A TE D C IR C U IT S6502 @ 4 .9 0 6 52 0 @ 4.00 6522 @ 5.00 4116 @ 1.852532 @ 5.902716@ 4.456116 @ 6.454164 @

A n c h o r

A u t o m a t i o n

S i g n a l m a n

M O D E M SF RE E S OU RC E M EM BE RS H IP W IT H S IG N A LM ANA ll S ig na lman Mo dems a re D ir ec t Co nn ec t, a nd p ro vi de t he

b es t p ri ce -p er fo rman ce v al ue s. D ea le r a nd OEM I nq u ir ie sinvited

Volksmodem with computer c ahle 68

Mark VII Auto D ial/Auto A nswer 99

Mark X II Smart M odel 1200/300 279

i i c - i i A V i f S i i l i r t n i i i d e l i i - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2 1 " 9

~~--~-~~-~:.~~~~~-~~~-~~~~!~~-~-----------------------~~-~

P ROM QUE EN lo r C 64 o r V IC

App le Emul at or f or Commodo re 6 4

STAT S ta ti st ic s Pac ka ge f or C6 4

S olid O ak 2 Le ve l S ta nd lo r C 64 D r V IC

C64NIC Swit ch ( networ ki ng )B ACKUP V 1. O t a pe c op ie r l or C 64 D r V IC

CARDBOARD/6 Mo the rboard - V IC

CARDBOARD/ 5 Mo th er bo ar d - C6 4

CARD PRINT G P ri nt er I nt . w i th G ra ph ic sCARD PRINT B Pr in te r I nt er face- -C64NIC

CARDBOARD/3s Mo the rboard - V IC

CARDCO C64NIC Ca lcu la to r Keypad

CARDRAM /1 6 RAM Expan si on - V ICComp le te CARoCo L in e i n s to ck

C IE a nd V IE I EEE I nt er fa ce s i n s to ck

MSD D ua l S up erD is k fo r C 64 D r I E EEMAE Ass emb le r f or C6 4K oa la P ad T ou ch T ab le t-C 64 D r V IC

C BC 4 /1 2 A na log to D ig ita l 4 ch an/12 b it

MUL TI PL AN fo r C 64

D us t C ov er fo r C 64 o r V IC

G ra nd Mast er Ch es s f or C6 4C oMAL L an gu ag e f o r C 64

wi th sp ri te s , co lo r g raphi cs , s ound , t ur tl e g r aph ics.

BusCard II f rum Ba tt er ie s I n e luded

U LTRA B AS IC - 6 4 w it h T ur tle G ra ph ic s

S up er D is k U tility - C 64 - in du de s b ac ku p

M icro Che ss - C 64 - 8 lev els of p la yH ES MOD EM w llh s oftw are lor C 64

Commodore 64 Programmers Reference Guide 16WordPru 1-+ /64 w ith SpeUright S5

VIController (also C 64) - BSR C ontroller 50

COM VOICE S ynthesizer for C 64 or V IC 139

V IC p ro du ct s i n s t oc k - c al l f or e xt ra d is co un ts .

~!~~~_~ _ ~ _ a _ ~ _ ~ ~ _ ! ! ~_ ~ !_ !: ~ _ ~ ~ ~ _ s . ! ~ ~ : _

A P P L E -F R A N K L IN IT E M SF RANK LIN -c om ple te lin e in s to ck

0 1 1 ENTIN Dr ive s for Apple/Fr ank li n

Swapper Stopper

au toma ti c sw it ch be tween padd le s and joys ti ckKRAFT Apple Joys ti ck

K raf t Appl e Padd le Pa ir

Koala Pad Touch Table t -Apple /F rank lin

SPINNAKER Sof twa re i n s to ck

B rude rbund So ftware i n s to ck

1 6K RAM Car d f or A pp leMultiplao-Micrusatt

S olid O ak 2 L ev el S ta nd f or A pp le

Se ri al Ca rd for Apple

M PC R AM /8 o co lu mn ca rd fo r lie ( AP /T XT l

Z 8 0 Sof tc ar d a nd CP /M (M ic ro so ft )

RANA E li te I w it h Co nt ro ll er

Parallel Printer Interface/CableM ic ru te k a nd M PC In te rf ac es in s to ck

Grapp le r + I nt er face

DC Hay es M ic romodem I I, l ie w it h Smar tc omP FS : F ile o r P FS : R ep orf o r P FS : G r ap h

V id ex 8 0 Co lumn Ca rdApp le B lu e B o ok

[tcommodoreS e e u s fo r P e rs on a l. B u sin e ss . a a d E du c a t io n a l

r e q u ir e m e n t s_ E d u c a ti o n a l D i sc o u n ts a v a i la b le .

P - E T S - C A - t r r - - - - - - - $ 2 4 f b a s e - p r l c eA llo ws y ou to co nne ct up to 3 0 C BM /P ET C om pu te rs to

shared disk dr ives and pr in te rs . Comple te ly t ransparen t to the

u se r. P er fe ct f or s ch oo ls o r mu lt ip le wo rd p ro ce ss ir q c on -

f igu ra ti on s . Base conf igu ra ti on suppo rt s 2 compu te rs . Addi -

~ ~ _ ~ ~ _ ~ ~ p _ l ! ~ !_ ~ _~ P . . ~ _~ _ ! ~ ~ _ ~ ~ ~ ~ : _ _ _

DISKSPECIALS II

89

490

CALL

68 0

C A L LCALL

WRIT~ FOR CATALOG_ Ad d $150 p er o rd er fo r U nit ed Par ce l215-822- 7727 We pay b ala nc e o f UPS s ur fa ce s hi pp in g c ha rg es o n a ll p re pa id o rd er s

252 Bethlehem Pike A B Com pu ters (add e ra for m all APO /F PO , air) Prices Include cash discount

Colmar, PA 18915 Regular prices sl. llhtly higher P rices subject to change

C O M P A C K / S T C P $115I n te ll i g e n t T e rm i n a l P a c k a g e fo r P E T . C B M . C 6 4I nc ludes ACIA Hardwa re / STCPSo f twa re---------------------------------------------------

130

C an95

29

12920

64

56

7948

22

32

49

570

5075

17 979

6

2414

159

37

19

1745

F le x F i le lo r P E T /C B M /C 6 4 $ 5 9Da taBase , Repo rt Wr it er w i th ca lcu la ti on s , Ma il in g L is ts .

E as y t o u se , a n d c an b e mo di fi ed .

FlfIiTiTiDrPET7C64-fuli-FiG-;;;;;d;i-~-C~;9i~iRiI;;-5ii

includes al l FORTH 79 Standard extens ions , s t ructured 6502

a ss emb le r w it h n es te d d ec is io n macr os , s ta nd ar d 1 6x 64

sc reens , ab il it y t o r ead /wr it e BAS IC sequen ti al f il es , s amp le

p rog rams, i nt ro duc to ry + r ef er ence manua l.

Me ta campl il er f or F oRTH f or i nd ep en de nt o bj ec t c od e 3D

Floating PDint far FORTH 20

K M - M M P A S C A L - i V r i i; - - P E i 'i c B i 1 / C s T - - - - - - - - - - - - - - i 9Virtua lly fu ll Jensen-Wir th implementat ion is n o w sui tab le fo r

advanced placement courses .

EARL for PET/CBM Disk-based ASSEMBLER 65

S i i p e r G r a p - b l C i - _ : - S A i iC L a i i " i i g e - f i t e n s l O i i i - - - - - - - - 4 5Fast g raphi cs , s ound , t ur tl e g r aph ics r out in e s for PET /CBM.

i iA i i i T R t i M - - f ~ ; - P E T / C B M - - - - - - - - - - - - - - 4 K - $ 7 5 - 8 K $ 9 0

~~~~~~_~~~j~~!~!~~~~~~~~~!_~!~:~_~~=~==::J~CSM Public oomaia Software - C64 27 disks 75

1119

26

40

3090

5918 529

89

139

235

38 9

69

135

24595

209

19

STAT for P ET/CBM/C64 and Apple 95

Comprehensi le S ta ti st ica l Anal ys is Roul lae s

Inc ludes comple te f i le handl ing capabi li t ies , summary statis-

t ics , con fidence in te rvals , hypothesis tests , exponentia l mean

tes ts , mu lt ip le and power se ri es r eg re s si on , anal ys is o f va ri -

ance, h istograms, and non-parametric tes ts .

P i i e M l il 6 i fC o m i il a i ld W D r d P r u C i u o r - - - - - - - - - - - f t iFull -f ea tured package for a ll Commodore computers .F ull s cre en e ditin g, a nd s up po rts d is k, ta pe , a nd a ll

printers.

S co tc h ( 3M ) 5 " s s/ dd

S co tc h ( 3M ) 5 " d s/d d

S co tc h ( 3M ) 8 " s s/ sd

S co tc h ( 3M ) 8 " s s/ dd

1 0/2.10 50 /1 .9 0 1 00 /1 .8 6

10/ 2.65 50/ 2.45 100/ 2.40

10/ 2.20 50/ 2.00 100/ 1.98

10/ 2.80 50/ 2.50 100/ 247

W e s to c k V ER BA TIM D IS K SW r it e fo r D e a le r a n d D E M p ric e s _

Waba sh 5 " s s / s d

Wab as h 5 " s s/ dd

Waba sh 5 " d s/ dd

1 0/1.50 50 /1 .4 5 1 00 /1 40

1 0/1.8 0 50 /1 .7 5 1 00 /1 .6 5

10/ 2.50 50/2.45 100/ 2.35

W e s to c k M A X E L L [ I IS K SW r ite f o r d ea le r a n d D E M p ric es ,

D is k S to ra ge P ag es 1 0 fo r $4 H ub R in gs 5 0 fo r $ 6

Disk Library Cases 8 "-3.00 5"-2.25

H ead D is k C le anin g K its 1 2

AMARA Y D is k S to ra ge S ys tems i n s to ck

~ ~ ~ _ ~ ~ ~ ~ _ ~ ~ ~ _ ~ ~ P . . ~ ~ _ ~ _ ~ ~ ~ _ ~ ~ ~ £ ~ ~ _ ~ ~ ~ _ ~ ! 9 ! : ~ :

C AS SE TT E T A PE S-A GF A P E - 6 11 P RE M IU MC-l0 10/ .61 50/ .58 100/50

C-30 10/ .85 50/ .82 100/ 70

7'6"6 I datasystemsZVM-122A 99 ZVM-123G

ZVM-131 300 ZVM-135

Z I DO 1 6- hi t/ S- hi t S ys tem

Z29 Termi na l ( DEC and ADM compa ti bl e)

Z -1 5 0 IB M P C C OM P AT IB L EZ -1 60 PORTABL E PC

We s to ck e nt ir e z e ni th l in e.

U S I V id eo M on ito rs - G re en D r A MB ER 2 0 MHz h i- re s

_ _ _ _ _ _ _ _ _ _ _~!~~~_ !~!_ ! I_~_~_~~iu l~~_~~_ !~! !

WR ITE FOR iBM PCCOMPAT IB LEPR ICES

MuHIPlllI-lBM or Apple 179Quadboard for IBM avai lab le

KOALA PAD Tou ch Tab le ts -A pp le , A ta ri , I BM , CBMPllchtexl 5000 Sefuiare Package 199

P FS S of tw ar e lo r IB M a nd A pp le in s to ck

SPINNAKER Sof twa re C6 4/ VI C, A pp le . I BM , A ta ri

VOTRAX Personal Speech System 269BMC 9191 Color Monitor 229

BMC 12A 12" Green Monitor 79oynll (B rethe~ DX-15 Daisy Wheel Printer 469

Brallier HR-25 Daisy W heel Printer (25 cpal 749

Itoh P rowriter P arallel Printer 379

P lA ls oni c 1090 Pr in te r w H h Comspondence M ode 279

Gemini lOX 289

EPSON,Okidala, Star Micron ics pr in te rs in atock

USI CompuMOD 4 R F Modulator 29We S to ck AMDEK Mon Ha rs

A P Products 15% OFF

COMPUTER COVERUPS IN STOCK

BROOKS 6 Outlet SUllO Suppressor/Noise m er 54Surge Suppressor-6 outlet 29

Electrohome 1302-2 13" Hi-res RGB M onitor 335

Panasonic 12" Monitor (20 MHz) with audio 135Synerfek SYM-I M icrucomputer IS9

~:~~~~£~~~_~~~f~__D A T A S H IE L D B A C KU P P OW E R S O UR C E $ 2 6 5Ba tt er y back up Un in te rr up ti bl e PowerSupp ly w i th su rgeand

~~~~_!~~!~~_~~~~~~_~- '=~I~.x~~!l .~~_P!_~!~~_:_

A T A H I - W E S T O CK E N T IR E L IN ES P IN N A K E R a n d B r o d e rb u n d S o ft w a re i n s to c k .

Page 10: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 10/84

I A lCAO"LetterboxDear MICRO:

Some of your recent issues have had

parallel articles for the various

computers you cover. I like thisfeature. In fact, it is the main reason I

renewed my subscription. It is

frustrating to see neat programs written

for other computers, but not for mine.

Consequently, I was very

disappointed that the well-written

article on Fast Low Cost A/D

Converter, MICRO 69, did not have

listings for use of the converter with

the Atari Computers. No AID

converters are available for the Atari (to

my knowledge). This could have been

very useful. The Atari was also slighted

in the Adding Computer Senses to Your

Micro.

Your excellent Interface Clinic

suffers from the same problem. I

should think that there are other Atari

users who might also wish to have

routines useful for interfacing the Atari

with analog circuitry.

I hope you can extend this type of

article to include the Atari in the

future. Thank you for your

consideration.

Michael Soso

Seattle, WAYour points are well taken. The

generality problem discussed above is

even more prevalent when dealing with

the Atari. The BASIC used in the Atari

is somewhat unique. While there are

many minor differences between the

BASICs on the Apple, Commodore and

Color Computer - they do have a lot

in common. Atari is sort of out-in-left-

field. For this issue, for example, I went

to generalize the Talking to your

Printer.First I had to wade through the Atari

OPEN an d XIO commands to setup theinput and output, then had to

DIMension all of the string variables,

and then realized that due to the

strange way Atari BASIC handles string

concatenation - there was no way to

get the program to work!!! Talk about

frustration!

Some of the other programs you

mentioned could have been, and

probably should have been, converted.

If any Atarist has converted them, we

would be happy to print updates. Let

me make two proposals for future

articles. First, MICRO will make II

greater effort to perform Atari

conversions where possible/practical.

Second, if any Atari readers are

in teres ted in performing su eli

conversions, we will work with them,

pay a modest remuneration, and

provide program/projects to convert.

We can not do it all, but we can all do it

together.

Dear Editor,

read your edi torial /IIs It

Reasonable?" in February 1984 MICRO

#69 with interest. Many of yourthoughts and statements are true and I

agreed with them. I do think you

touched on a very important aspect of

the APPLE success (and failure). That is

"Third Party" vendors, which I'll

come back to in a moment.

I believe the success of the

microcomputer in the home and

workplace stems from the fact that W~

are trained to use tools of

"convenience", for example, log

tables, slide rule, electronic calculator

and the microcomputer. We must have

some knowledge of their function touse them successfully and effectively.

It is exciting to watch a human float

effortlessly in space, but the thoughts

of the details of what it really took to

put him there and get him back are

much more exciting. Some knowledge

of the intricate steps required is where

it is really at. So it is with the

microcomputer.

What Apple, Inc. did with the Apple

IIwas give the curious the opportunity

to learn the intricate details which

cause the IIto function, They produced

a Disk Operating System and Monitorthat was easily and quickly understood.

Your publication published a complete

understanding of the Apple II's

operating system. I think the way the

'Steve(s)' started made this

environment necessary. They needed

the support of the Home Brew

Computer Clubs, and also of Third

Party Vendors. If the software didn't

get written and published as fast as it

did, I believe Apple wouldn't be as

successful as it is. The resources

Robert C. Madden

San rose, CA

weren't available at the time. It is the

software vendors and publications such

as yours that contributed a

measureable amount of resources to

Apple's success.

It seems to me the Apple III, Lisa,

MAC, et al, will follow the path of the

TI-99 unless Apple will facilitate easier

learning of the Operating System. The

person in the business place may only

want applications software, but there

are orders of magnitude more at home

wanting to write their own software

hoping it will be of sufficient quality to

be published. Apple needs to loosen

their management philosophies

regarding the MAC and provide a

simpler operating system.I am a co-founder of a 170 member

Apple users group here in Silicon

Valley. We were fortunate to have

Apple's sales department demonstrate

the MAC the day after it was unveiled.

We had 300 people attend the

presentation - an exciting turn out!

Disappointment quickly set in when I

discovered the complexity of the

operating system. I decided the MAC

was not something I would be

interested in. I think MAC will follow

Lisa unless Apple wakes up and

provides a much simpler operatingsystem so the Third Party vendors can

contribute again.

I am now waiting for the new

650XX chip that has been reported in

various news releases. If it doesn't

satisfy the. simple Apple II operating

system concept with much expanded

memory, I will seriously look at the

Saybrook or QWERTY system again. I

suppose you have guessed what I think

is reasonable. It is a source of hardware

and information that will give our tools

of convenience a chance to be even

more so.

Sir

"The Applel I I had limited

capabilities ... "!! ??

Surely you jest' 256K of pure RAM:

what could be more versatile? An

operating system which BYTE

magazine called "the most

8 No. 71 - April/May 1984ICRO

Page 11: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 11/84

Whenyoleast expect it,

•••In a few mill ionths of a second, common electrical surgesand spikescan enter your data processing equipment and cause memory loss,

false logic and misregistratlon. Surges very often do permanent

damage to microcircuitry.

FUXlD.a Surge Suppressors catch surges and spikes before they

have a chance to. enter your equipment In billionths of a second

(Nanoseconds),FUXlD.a Surge Suppressors dissipate surges and

spikes from any side of the line (most protect only one side).

The multi-outlet unit is ideally suited to the computerized work-

station. It givesyou the advantage of circuit breaker protection with

plenty of outlets for data processor and peripheral equipment

No computer should bewithout the:protection of aFUXIDUCTSurge

Suppressor...apcdally yount Write or call for further information.Available from office products retailers,

® Su rge Supp ressors

a product of Winders & Geist, Inc. P.O. Box 83088 Lincoln, NE 68501 402/474--3400

No. 71 . April/May 1984 MICRO 9

Page 12: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 12/84

sophisticated operating system

available for an 8-bit machine". The

ability to run virtually all Apple ][

software. Can you seriously considerthis to be limited capability?

Now, there is no doubt that the / / /

had some early hardware problems,

which in tum discouraged software

developers from jumping on the

bandwagon. This, rather than "limited

capability" resulted in the lack of early

acceptance of the / / /. Apple has now

revitalized the / / /, set up specific

resources for it, and even published a

booklet (approximately entitled 'Will

someone tell me what you can do with

an Apple / / /! ') which lists a great

range of software available for the / / / .I develop software on the / / / for

both it and the I [. I also use the / / / for

all my other work: word processing,

data base, modem, Pascal, BASIC,

Assembly ... etc. I will gladly stack up

the capabilities of the Apple / / / against

any other 8-bit machine on the market,

regardless of price or manufacturer (and

even against some of the pseudo-16s).

Would you care to enumerate its

limi tations?Tracy Valleau

Pacific Grove, CA

I personally was unimpressed with theApple / / / when I saw it. I was at that

time completing development of a

6809 - based system that sold for $500

less than the basic Apple / / / and

offered almost eight times the disk

capacity, had a far superior keyboard,

included many hardware features and a

complete package of user- friendly

software. I really had expected a lot

more from Apple for the price - not

just more memory. I guess today I

would say it is perhaps a good

computer, certainly not a great one.

The next writer provides another

possible reason for the lukewarm

reception the Apple / / / got.

Dear Sirs:

Although this letter will refer to the

program by Joseph Kattan in MICRO

71, my criticisms are really directed at

MICRO's editorial policies, rather than

the specific program. The Credit

Register program looks like a good idea,

and I would like to run it on my

computer. However, it is written in

such a way that it is essentially not

transferable to any computer other

than the Atari. The GRAPHICScommands, as also the PEEKs and

POKEs are totally specific to the Atari,

and lacking REMs as to their function,

it is impossible to reproduce them On

another machine. If the program

involved something that had to be

hardware dependent, such as a hi-res

graphics presentation, there might be

excuse for this. However, the screen

presentation that is shown looks like

fairly straightforward printing, which it

should be possible to generate with

standard PRINT statements.

You are in a favorable position fOJinsisting on some kind of standard:

BASIC in your program listings, W

improve as far as possible the

portability of programs from one

computer to another. If this means that

all programs are restricted to ~.

minimum implementation of BASIC f ~ ,sort of lowest common denominator),

this is not necessarily a bad thing. It is

very elegant to use all possible bells

and whistles that are specific to your

computer, in order to get the most

sophisticated display; but if this is only

achieved at the expense of portability, ::believe it is a bad bargin.

Rolf B. Johannesen

Rockville, MDI agree with everything that you say.

except for the problem being one 0,(

'MICRO's editorial policies'! We

evaluate every article with machine

generality in mind. Literally hundreds

of programs/articles have been rejected

because they were limited to a single

computer. The ideal would be for every

program to work on every machine,

Unfortunately, there are a number of

factors working against this ideal. First,most authors have expertise on one

micro and are often not aware of what

is specific to their BASIC. Second, it is

easier to write machine specific BASIC.

Third, most authors do not have

multiple micros for testing various

versions. Fourth, it takes a great deal of

work to take a program that has not

been written with generality in mind

and generalize it. We have worked

many hours recently just to generalize

a few programs, including Smart

Modem, (converted for three additional

microcomputers), MICRO 68; Adding

Computer Senses, (converted for two

additional microcomputers),MICRO69; Least-Squares Curve Fitter and

PEEKing TOM, MICRO 70; Talking to

Your Printer, in this issue; and so forth.

Fifth, a generalized program requires

testing. It may require hardware

configurations that neither the author

nor MICRO possess. Sixth, errors may

be induced into the program during the

generalization process.

The Talking to Your Printer articleshows one technique that we use and

hope that other programmers will

adopt where possible. We plan to

describe other techniques in futureissues. Unfortunately we are not in a

position to insist: we request, and we

conjole, and we do reject.

Dear Sir,

I haven't been able to enter the

program Master Directory for the

Apple, MICRO 67/69 into my Apple

II+ with Language Card. My usual

procedure with Machine Language

programs is to convert to a Hex dump

but the Master Directory listing is one

that I have never seen before and it does

not seem suitable to this method,

Would you please advise how

could go about using this program.

Herman F. Schulz

Schenectady, NY

Mr. Hill's program was too long to

print and too good to ignore! We

normally print the object code along

with the source. In this case we

dropped the object code to save space.

Due to a number of letters and phone

calls, we planned to print the hex dump

in this issue. Turns out it would take afull four pages, four columns per page!

What to do! We have arrived at two

solutions: 1. We will provide a

complete listing including the object

code for $1.00 to cover copying and a

self - addressed, stamped - envelope;

or, 2. We will provide the assembler

source (in LISA format) and the binary

file (BRUN format) on a diskette, and

the printed listing, for $15.00, See the

MICRO Diskette Service

announcement on page 80

10 MICRO No. 71 . April/May 1984

Page 13: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 13/84

Page 14: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 14/84

IA lCAO~R eviews in B riefProduct Name: IDS, An Integrated Development

System for the Apple Il Plus

Apple II or II +

$85.00

Manufacturer: ARTSCI

5547 Satsuma Blvd.

North Hollywood, CA 91601

Description: Magic Memory bills itself as an electronic

address book. It is, in fact, a flexible way to create and

recall a variety of information. All entries can be cross-

indexed, easily updated, and printed. Files can be saved on

any disk, making it virtually impossible to run out of

storage space.

Pluses: Looking to future developments, the program is

entirely compatible with a hard disk drive and disk space

is reserved within a submodule for new utilities that may

be created.

Minuses: The copy-protected master disk cannot be

copied to a hard drive and the 70-column video driver can

only be used with a 64K system. Memory does not let you

carry a file format from one file to another; rather you start

each file blank and have to enter all data.

Documentation: A looseleaf manual provides ample

instructions and some technical information.

Skill level: Intermediate to advanced.

Reviewer: Mike Cherry

Product Name:

Equip. Req'd:

Super Text

Commodore 64 with one disk drive and

a printer

$100

Muse Software

347 N. Charles Street

Baltimore, MD 21201

Equip. Req'd:

Price:Manufacturer: R.R. Michaels, Inc.,

Box 565

Leesburg, VA, 22075

703/777-1933

Description: A utility package, written in 6502 machine

langauge, to support Applesoft programming. Allows for

the easy construction of screen displays for data entry, file

structures for record storage and retrieval of output

formatting for reports.

Pluses: The package is easy to use. It includes an editor

for constructing display screens, which are keyed to

variable labels; this permits the Applesoft programmer to

coordinate their variables directly with the input display

screen. Input edit checks can be performed to reduce the

chance of key-stroke error. The record definition system

permits easy storage and retrieval of both sequential and

randomly accessed files. Individual fields, as well as entire

records, may be stored or retrieved. One Applesoft

weakness is in the output of data, where it lacks a PRINT

USING capability. IDS permits the programmer a variety

of display formatting, including specified decimal places,

embedded commas and dollar signs and right justification.

The IDS system uses CALLS to reserved variable names

which perform each function [all of the calls begin with Z

to avoid confusion with other BASIC variables).

Minuses: The IDS package has a modest RAMN overhead

of a minimum of $2000 bytes. In addition, several of the

structure definition tables reside just below this address.

Thus, the user will sacrifice at least 8K to use the IDS

software, although many Applesoft routines are

eliminated, shortening the space needed for BASIC code.

Documentation: The manual is well written. It begins

witha tutorial on the use of the IDS routines, including

the construction and use of each of the three subsystems.

A reference section describes each command available.

Skill level: The package will be of most interest to theApplesoft programmer writing commercial grade software.

Reviewer: David Morganstein

Product Name:

Equip. Reqd:

Magic Memory J

Apple II +, IIe with one disk drive and

48K RAM

$100

Price:

Manufacturer:

Description: A word-processor with a software-based 80

column display, Super-Text is loaded with features:

creating/saving files, block moves, justification,

automatic page numbering, find and replace, tabs, andimbedded control characters. Also available are file merge,

on-screen help, word counting, and "autolinking" your

files to the printer.

Pluses: Super-Text provides several printer parameters

which can be adapted to fit almost any printer and

interface., The 80 column display is a "bonus" feature and

does not gobble up all your memory.

Minuses: Creating and editing text occur in separate

modes. Jumping from mode to mode will slow you down

and confuse you at first. Also, the screen will notPrice:

12 MICRO No. 71 . April/May 1984

Page 15: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 15/84

necessarily show the printer's format. You will need to

refer to a preview section to verify the printout is the way

you want it.

Documentation: A spiral booklet contains tutorial and

technical information.

Skill level: Beginner and up.

Reviewer: Mike Cherry

Product Name:

Equip. Req'd:

Computer Mechanic

Commodore 64 with disk drive or

cassette

$60Softsync, Inc.

14 East 34th Street

New York, NY 10016

Price:Manufacturer:

Description: A diagnostic program to help pinpoint

mechanical problems with your car. Mechanic also

teaches the basics of car maintenance and sets up a repair

history and maintenance schedule for any car.

Pluses: Mechanic will prepare a standard disk to accept

files giving you room for hundreds of records. The use of

the Commodore's graphics and color abilities is excellent

and the advice is sound and helpful.

Minuses: Error-handling is marginal. Data entries are not

adequately checked for proper input and error messages

may confuse the beginner. Mechanic's simple approach

limits the diagnostic advice/record-keeping to an

introductory level.

Documentation: A thin 6-page pamphlet provides

orientation but no technical information.

Skill level: Intermediate to advanced level. Poor error-

handling means a beginner may have trouble with this

program.

Reviewer: Mike Cherry

Product Name:

Equip. Req'd:

Delta Drawing

Apple II, II +, IIe with one disk drive &

48K RAM

$40

Spinnaker Software

215 First Street

Cambridge, MA

Price:

Manufacturer:

Description: A FORTH-based program geared towards

elementary school use lets you create drawings with

simple keyboard commands. Various configurations allow

for color fill , background color, preprogrammed patterns,saving and printing programs in text or graphics modes.

Pluses: Easy to learn, Delta Drawing is fast and pleasing.

Children will be able to create interesting pictures with

only a little practice, The "color fill" command is

especially fun to watch.

Minuses: Only the Grappler + interface is supported for

printing graphics; all else will print only text. Patterns

saved can not later be recalled and included in BASIC

programs.

Documentation: An excellent tutorial and separate 'flash

cards" illustrating various patterns are included.

Skill level: Beginner and up.

Reviewer: Mike Cherry

Product Name:

Equip. Reqd:

Mail ControllerCommodore 64 with 1541 Disk Drive,

1525 printer or other with interface.

Orbyte Software

Box 948

Waterbury, CT 06720

Manufacturer:

Description: An easy to use mail list program. Allows

over 2000 entries per disk with editing functions available.

Will print labels in one across format or print out on paper

stock taking advantage of your paper width. The program

allows formatting a new data disk in order to access more

records. This makes it possible to have extremely large

files across several d:.sks.

Pluses: The program is powerful and easy to use. All work

starts at the menu and the function keys are taken

advantage of to simplify work. A help screen is provided

for the New Disk and Data Entry functions. Mail

Controller may also be used as a small database for other

than mail lists, although the amount of information

storage is limited.

Minuses: There is a limit of 73 characters that may be

used for the fields in a standard mail list format. This

requires careful field setup.

Documentation: The 38-page manual is one of the easiest

to use that I have seen. Each function is made clearly

understandable.

No. 71 - April/May 1984 13ICRO

Page 16: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 16/84

Skill level: Anyone, from beginner to expert, would be

able to use this program.

Reviewer: Richard E. DeVore

Product Name:

Equip. Req'd:

Price:

Experiments inHuman Physiology

Apple II, II +, IIe$249 (Demo disk available for 30-day

preview)

HRM Software

175 Tompkins Avenue

Pleasantville, NY 10570

sort features are available for databsase manipulation.

Data entry is accomplished via quick entry screens

designed by the user. Up to 5 separate data entry screens

may be defined per logical record.

Pluses: Good flexibility in design allows for a wide variety

of applications. Subtotals, totals and averages can beautomatically caiculated in reports. Other user-definable

formulas can add versatility to the report writer feature.

The entire program is written in Extended Color Basic and

is provided as user-modifiable code. This allows the user

to make such things as printer baud rate settings a

permanent part of the program. Record segmentation

provides the ability to add fields even after records have

been entered. Select and sort features are quick and

efficient. Special menu format allows for end user input

with reduced menu, Password protection is available on

selected fields.

Minuses: The program does not provide for boolean

operations during report writing aside from the standard

selection process. The documentation claims that a field

name can be up to 15 bytes long, but the program would

allow only a 12 byte name. The program does not provide

any automated word procesing capabilities. While this can

be accomplished using the report writer, much manual

intervention is required during the printing phase.

Documentation: A 35-page manual is well-written and

easy to understand. It makes good use of examples and the

diskette also includes those same examples to give the

new user an established database to practice with.

Skill level: Intermediate. Programming skill is not

Documentation: Well written and clearly explaining the required, but some familiarity with computer records is

experiments. useful.

14

Skill level: Beginner; the hardware connections are Reviewer: Norman Garrett

clearly explained, although they probably should be done

by the teacher.

Product Name: HJL-57 ColorComputer Replacement

Keyboard

TRS-80 Color Computer

$79.95

HJL Products

P.O. Box 24954Rochester, NY 14624

Manufacturer:

Description: A combination of hardware and software to

implement a variety of experiments in Biology and Human

Physiology including: Psychomotor Response Time,

Calibration of Temperature Probe, Skin Temperature,

Respiration Rate, Heart Rate and Polygraph Testing. Auseful supplement ot a High School Biology class. All of

the experiments would easily fit into the classroom

curriculum, helping the student to further understand

basic functions by first hand experiments and encouraging

further exploration in this area.

Pluses: The experiments are simple but dramatic, giving

the impression of a "mini-laboratory". The students learn

by doing, gaining not only class work, but experience in

using computers as well.

Minuses: None.

Reviewer: Edouard Garcia

Product Name:

Equip. Req'd:Price:

Pro-Color-File 2.1

TRS-80 Color Computer$79.95

Equip. Req'd:

Price:

Manufacturer:

Description: A direct replacement for the standard Color

Computer keyboard, but unlike others on the market, it

has the layout and color scheme of the original with the

addition of a longer spacebar and four function keys (one

locking). It includes installation instructions, necessary

hardware and areplacement bezel. The keyboard is fully

shielded ahd has the connecting cable installed (the

purchaser must specify the computer version desired so

that the correct connecting cable can be determined). The

keyboard rests at about the same angle as the original,

Manufacturer: Derringer Software

P.O. Box 5300

Florence, SC 29502

Description: A database utility. File definition capability

allows up to 60 fields per record, to a maximum length of

1024 bytes. Fields can be defined as numeric or

alphanumeric. Report formatting capabilities include

math functions, report layout and definable work fields for

use in reports. Up to five distinct report formats may be

defined and invokable at anyone time. Search, select and

MICRO No. 71 - April/May 1984

Page 17: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 17/84

with the overall contour slightly modified. It comes with a

one year guarantee.

Pluses: The contour of the keyboard (the slight variation

of angle between rows of keys) is modified a bit to give it a

more natural feel. This is especially apparent with the

spacebar, which is much more accessible than on the

original. The texture and sculpture of the low profile keysare significantly improved. An additional benefit is the RFI

shielding included, which noticeably reduced the RFI on

my television.

Installation is straightforward. For a person who has

never opened the computer case, it would probably take a

maximum of 30 minutes. The only modification is to

shorten one plastic post. The unit rests on the original

posts. Manufacturer telephone response to questions is

good. The finished appearance is good, blending well with

the original and being truly a replacement and not a

modification.

Minuses: The effect of the locked PF2 key on other keys

needs to be explained [more explanation on the actual use

of the function keys in general would be helpful). This

would allow a programmer to better utilize the

programmed key functions.

Documentation: Consists of excellent, easy to follow

installation instructions, the decimal values generated by

the function keys, and a sample program which will

program your function keys as follows: Fl dumps the

current screen to the printer; F2 allows auto repeat of any

key IF2 locks); F3 flips between upper and all lower case;

F4 acts as a control key and subtracts 64 from the ASCII

value of any key.

Skill level: Installation requires no technical experience.

The instructions are geared to a non-technical installer.

Reviewer: Norman Garrett

Product Name:

Equip. Req'd:

Price:

Manufacturer:

Flight Simulator nApple II+ 48K, DiskDrive

$49.99

SubLOGIC Corporation

713 Edgebrook Drive

Champaign, IL 61820

Description: The long awaited sequel to Flight Simulator

1 . An incredibly well thought out product of real value to

pilots and fascinating to those not aviation minded. The

package includes maps of the four areas of the U.S.

modeled in detail on the main disk. The company

advertises the availability of other scenery disks. Care has

been taken to simulate the intricacies of communications

and navigation that are in real life the most demanding

tasks of a pilot.

Pluses: Sheer attention to detail. User variable weather is

a particularly valuable feature in that it brings home to the

user precisely how poor weather creates chaos with flying.

For the younger user, a World War I dogfight game is

included as a special option of the main disk.

Minuses: There really are not many. In places, the

instructions could be improved. There is a tendency toassume too much aeronautical knowledge on the part of

the user. The authors seemed to be aware of it, but were

not entirely successful in avoiding the problem.

Documentation: Overall, I was pleased with it. The

manual was printed in a professional manner, and the

incredible detail of t.ie product was handled nicely. Each

feature is explained without hype or unnecessary

enthusiasm.

Skill level: A novice computer user who follows the

manual should have no trouble using the product.

Reviewer: Chris Williams

Product Name:

Equip. Req'd:

Price:

Manufacturer:

The World of Counting

Apple II+ or IIe

$24.95

Educomp Enterprises

191North 650 East

Bountiful, UT 84010

No. 71 . April/May 1984 15

Description: Designed to teach counting principles to

learning-disabled class or regular preschool. Provides

examples, demonstrations, quiz questions, and a final

test, using hires graphics, music and sound effects for

reinforcement. Student scores and response times are

displayed at end of lesson.

Pluses: Lots of repetition and reinforcement. Program

written in Apple pilot - can be customized to meet user's

specific needs. Good graphics.

Minuses: Pictures are drawn very slowly Iinherentproblem in Pilot). Musical reward may be confused with

musical number prompt. Scores are not stored on disk for

later reference.

Documentation: 8-page pamphlet with excellent program

descri pt ion and directions. Software also shows

instructions.

Skill level: 3 to 6 year old [mental age); adult to start

program.

Reviewer: Mary Gasiorowski

MICRO

Page 18: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 18/84

Product Name:

Equip. Req'd:

Practicalc II

48K Apple II+ , lIe and compatiblecomputer

Price: $69.95

Manufacturer: Micro Software International Inc.

The Silk Mill44 Oak Street

Newton Upper Falls, MA 02164

Description: This is not another Visicalc clone although

it does have the same basic features; 80 column width,

scrolling, columnar movement! expansion, and all the

other spreadsheet "musts." It has some things that the

others are lacking, for instance database management that

enables you to do alpha and numeric sorting and

searching. There are also prompts for entry during

calculation and printing of list formulas.

Practicalc II was designed with the nonprofessional

user in mind. It certainly is capable of being used in abusiness setting but unlike most "professional" packages

it has some friendlier additions. For example, you may

not use a particular spreadsheet but once a month, so

chances are the next time around you won't remember

how you set things up. This is not a trivial matter when

you are dealing with columns and numbers. Practicalc II

This is a superb checkbook package evolving from over 3 years of

rigorous testing and usage. Stores up to 6,000 checks on one Disk.

Machine language where it counts!

• Easily and quickly enter checks [, deposits, wi th "Shorthand"

options. No waiting for disk with each entry. Entries are

automatically saved to disk when you return to the main

menu ... stores 1000checks in approximately 8 seconds.

• Payee and category entry up to 39 characters each. 255

different categories possible. Check No.·sup to 32766

• Powerful search feature. very fast. prints to screen or printer.

locates by all fields. Locate a range of Check No.'s! Dates! Even

payees or categories between dates. Totals all checks/deposits

located.

• Look atyour spending trends with Hi-Reschart ing

• Easily make corrections

• Checkbook balancing

• Up to 6 checking accounts per disk

• Userfriendly. menu driven. ful ly documented

-CHECK PRINTER MODULE: ---------

User· Def inable Check Forms arrows Printing $ 1 4 9 •5to a lmos t a ll compu ter checks. ( Include your

Checkbook Manager Serial No. when ordering.)

ORDER BOTH FOR $43.50

Add $1.50 Shipping &. Handl ing Ch9. to a ll prices.

J &M SOFTWARE Dept. E

P.O. Box 2132 • rn--j Programs for APPLE u + and

Athens. Texas 75751 ~ APPLElle· . with one o ; , w o~ disk dnves If'referebly twoj

(214) 675 ·8479 •APPLE is a r eg ist er ed t radema rk of App le Computer . Inc

16

saves a spreadsheet with the menu that contains all of the

printer settings and other pertinent information.

Pluses: Unlike the other spreadsheet packages you have

seen, the price for this one is only $69.95! Perhaps you

had previously found it hard to justify an expenditure ofseveral hundred dollars for something that you only

needed a few times a month. At this price intermittent use

is justifiable, particularly when you think of the time

saved and the frustration avoided.

One unique .md handy "extra" offered by Practicalc II

is that it includes a word processing package. It is your

basic WP but has a few nice additions not usually found.

One of these is the capability of typing columnarly -

newspaper style. This is a feature many major WP

packages do not have. It is one of those things that might

not be useful to most people on a regular basis, but when

you need it - what a blessing! The standards - insert,

delete, etc., are nicely implemented. When

deletinglinserting in newspaper-style typed text,correcting one column does not affect the other.

Besides the bargain price, Practicalc II has another

major difference - it is not copy protected. Microsoftware

hopes this feature will not be abused, but instead will aid

its customers by allowing them to have a copy of

Practicalc II on different diskettes. This certainly would

enable more facile use of their product and make life a

little easier for the user. Using 15K of memory, there is

plenty of room for other things. The actual code can be

accessed if you are willing to disassemble it [use BigMac)

and put the whole thing back together. I would suggest

you make a few copies for backup first.

Minuses: The one area in which Practicalc II is not asproficient is speed. The difference is minimal, most

noticeable when saving a spreadsheet. Because each sheet

is saved with a copy of the menu and its settings, it takes a

little longer to be stored on disk - a reasonable tradeoff to

most users. The scrolling and screen movement are not as

fast as its competitors, but again the difference is

negligible.

Documentation: The documentation for Practicalc II is

clearly writter with examples and logical steps for

procedures. It contains an Index and a good Table of

Contents - bot.a very useful. Future addenda should be

available to users for a nominal fee. Also available will be

diskettes containing new versions to help kill the bigger

bugs. These will sell for $5.00 a diskette.

Skill level: The level of expertise needed by the user

ranges from beginner to expert. The beginner can learn the

basics rather easily; the more advanced the user the more

options and features he! she will be able to utilize.

Reviewer: Mark S. Morano

MICRO No. 71 . April/May 1984

Page 19: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 19/84

SANYO MONITOR SALE!!

• 80 Columns x 24 lines

• Green text display

• Easy to read - no eye strain

• Up front brightness control• High resolution graphics

• Quick start - no preheating

• Regulclted power supply

• Attractive metal cabinet

• UL and FCC approved9" Data Monitor

• 15 Day Free Trial - 90 Day Immediate Replacement Warranty

9" Screen -Green Text Display *$ 69.00

12" Screen -Green Text Display (anti-reflective screen) *$ 99.00

12" Screen -Amber Text Display (anti-reflective screen) *$ 99.00

14" Screen - Color Monitor (national brand) *$239.00

*PLUS $9.95 for Connecting Cable.Display Monitors From Sanyo

With the need for computing power growing every day, Sanyo hasstepped in to meet the demand with a whole new line of low cost, highquality data monitors. Designed for commercial and personal com-puter use. All models come with an array of features, including up-front brightness and contrast controls. The capacity 5 x 7 dotcharacters as the input is 24 lines of characters with up to80 characters per line.

Equally important, all are built with Sanyo's commitmentto technological excellence. In the world of Audio/video, Sanyo issynonymous with reliability and performance. And Sanyo quality is

reflected in our reputation. Unlike some suppliers, Sanyo designs,manufactures and tests virtually all the parts that go into our products,from cameras to stereos. That's an assurance not everybody cangive you!

eSANVOOfficial Video F+oducts

01 the Lo s Angeles 7984 Olympics

• LOWEST PRICES· 15 DAY FREETRIAL· 90 DAY FREE REPLACEMENT WARRANTY

• BESTSERVICE IN U.S.A.· ONE DAY EXPRESS MAIL· OVER 500 PROGRAMS· FREECATALOGS

- - - - - - - - - - - - - - - - - - - - - - - ~ ~ -Add 510.00 for shipping, handl ing and Insurance. il linois residents'Ilease add 8% tax. Add $20.00 for CANADA, PUERTORICO, HAWAIIIIrders.WEDONOTEXPORTTOOTHERCOUNTRIES. I

Inclose Cashiers Check, Money Order or Personal Check. Allow 14'

Iays for delivery, 2 to 7 days for phone orders, 1 day express mail! IICanada orders must be in U.S.dollars. Visa· MasterCard· C.O.D. I

. .-------------------------.

PRDTECTDE N T E R P R I Z E S (WE LOVE OUR CUSTOMERS)

BOX 550, I~ARRINGTON, ILLINOIS 60010

Phone 312/382·5244 to order

Page 20: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 20/84

*STX·80 COLUMN

PRINTER-$149.00Prints full 80 columns. Super silent

operation, 60 CPS, prints Hi-resolution

graphics and block graphics, expanded

character set, exceptionally clear

characters, fantastic print quality, uses

inexpensive thermal paper! Best thermal

printer in the U.S.A.! (Centronics Parallel

Interface).

**DELUXE COMSTAR T /F

80 CPS PRINTER-$199.00The COMSTAR T /F (Tractor Friction)

PRINTER is exceptionally versatile. It

prints 8 ' 1 2 " x 11" standard size single

sheet stationary or continuous feed com-

puter paper. Bi-directional, impact dot

matrix, 80 CPS, 224 characters. (Cen-

tronics Parallel Interface).

Premium Quality-120 CPS

COMSTART/F SUPER·10X

PRINTER-$289.00COMSTAR T/ F (Tractor Friction) SUPER-

10X PRINTER gives you all the features

of the COMSTAR T/ F PRINTER plus a

10" carriage, 120 CPS, 9 x 9 dot matrix

with double strike capability for 18 x 18

dot matrix (near letter quality), high

resolution bit image (120 x 144 dot

matrix), underlining, back spacing, left

and right margin settings, true lower

decenders with super and subscripts,

prints standard, italic, block graphics

and special characters, plus 2K of user

definable characters I The COMSTAR T/F

SUPER-10X PRINTER was Rated No.1 ov

"Popular Science Magazine." II gives y o ; ,print quality and features found on

printers costing twice as much I! (Cen-

tronics Parallel Interface) (Better than Ep-

son FX80).

Premium Quality-120 CPS

COMSTAR T /F SUPER·15V:z"

PRINTER-$379.00

COMSTAR T/F SUPER 15'/," PRINTEf1has all the features of the COMSTAR TIl'

SUPER-10X PRINTER plus a 15\1," car-

riage and more powerful electronics

components to handle large ledger

business forms! (Better than Epson FX

100).

Superior Quality

SUPER HIGH SPEED-160 CPS

COMSTAR T /F 10 "

PRINTER-$489.00SUPER HIGH SPEED COMSTAR TIl'

(Tractor Friction) PRINTER has all the

features of the COMSTAR SUPER·10l(

PRINTER plus SUPER HIGH SPEEDPRINTING-160 CPS, 100% duty cycle,

8K buffer, diverse character fonts"

special symbols and true decenders, ver-

tical and horizontal tabs. RED HOT

BUSINESS PRINTER at an unbellevable

low price!! (Serial or Centronics ParallE'1

Interface)1---------------------------1I

dd $17.50 for shipping, handling and insurance. WE DO NOT EXPORT IIO OTHER COUNTRIES EXCEPTCANADA. I

IEnclose Cashiers Check, Money Order or Personal Check. Allow 14days I

Ior del ivery, 2 to 7 days for phone orders, 1 day express mail ! Canada Iorders must be in U.S. dollars. VISA - MASTER CARD ACCEPTED. WeIhip C.O.D. I~ - - - - - - - - - - - - - - - - - - - - - - - - - - ~

Superior Quality

SUPER HIGH SPEED-160 CPS

COMSTAR T /F 15V:z"

PRINTER-$579.00SUPER HIGH SPEED COMSTAR T/ F

15'/,' PRINTER has all the features of the

SUPER HIGH SPEED COMSTAR T /F 10"

PRINTER plus a 15'/, carriage and more

powerful electronics to handle larger

ledger business forms! Exclusive bottom

paper feed! I

PARALLEL INTERFACESFor VIC-20 and COM-64-S49.00

For All Apple Computers-S79.00

NOTE: Other printer interfaces are

available at computer stores!

Double

Immediate Replacement

WarrantyWe have doubled the normal 90 day war-

ranty to 180 days. Therefore if your

printer fails within "180 days" from the

date of purchase you simply send your

printer to us via United Parcel Service,

prepaid. We will IMMEDIATELY send you

a replacement printer at no charge,

prepaid. This warranty, once again,

proves that WE LOVE OUR

CUSTOMERS!

PRDTECTDE N T E R P R I Z E S !WE lOVE OUII CUSTOMEIISI

BOX 551~,BARRINGTON, ILLINOIS 10010Phone 3 112 1312 ·5 244to o rd e r

8UPER·10" ABCDEFGHXJKLMNDPQRSTUV~XVZ

ASCDEFGttJ.JKU1NDPCilRSTUYWXVZ::Z::S'4~.7E1.0

Page 21: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 21/84

EXECUTIVE LETTER QUALITY

DAISY WHEEL PRINTER SA,LE $37900

COMSTAR 13"

computer printer

COMSTAR 1~(' "DAISY WHEEL" POWER TYPE

PRINTER is typewriter friendly. It uses a simpledrop in cassette ribbon. Just turn on the COM-

STAR 13" "or Crip executive quality cor-

respondence at 18 CPS with a daisy wheel that

prints 96 power type flawless characters, bi-

directional. Designed for personal and business

applications. COMSTAR 13" carriage accepts

paper from letter to legal size, continuous com-

puter paper cr single sheets, you can set right

and left rnarqins, vertical and horizontal tabs,

LIST PRICE $59900 SALE PRICE 537900

oOLYMPIA "DAISY WHEEL" COMBINATION

PRINTER/TYPEWRITER SAl.E $48900

oOlympia (WORLD'S FINEST)

THE nOlympia COMPUTER PRINTER

ELECTRONIC TYPEWRITER is the ultimate for

Home, Office, and Word Processing. You get thebest Electronic Typewriter made and used by

the world's la'gest corporations (better than IBM

Selectric) plus a Superb Executive Cor-

respondence Computer Printer!! (Two machines

in one!) Just flick the switch for the option you

want to use. The extra large carriage allows

14';''' printer paper width. It has cassette ribbon

lift off correction. Baud rates, Jumper selectable

75 through 19,200 (serial or parallel interface)

LIST $79900 SALE 548900

• 15 DAY FREE TRIAL - 90 DAY FREE REPLACEMENT GUARANTEE

~ - - - - - - - - - - - - - - - - - - - - - - - - - ~Add $17.50 for shipping and handling!! II Enclose Cashiers Check, Money Order or Personal Check, Allow II4 days for delivery, 2 to 7 days for phone orders, 1 day express IImail! Canada orders must be in U.S, dollars. VISA - MASTER IIARD ACCEPTED, We ship C.O,D, I- - - ~ - - - - - - - - - - - - - - ~ - - - - - - ~

PROTECTOE N T E R P R I Z E S (WE LOVE OUR CUSTOMERS)

BOX 550, BARRINGTON, ILLINOIS 60010Phone 3121382·5244 to order

.:

Page 22: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 22/84

The Accurate Printer

Have you ever typed a program from a

book or magazine into your Atari

computer that used graphics characters

or inverse characters? Have you been

frustrated when you tried to list the

program on your Epson (or Epson-

compatible) printer only to have the

printer go crazy? If you have the

Graftrax or Graftrax-plus option for

your printer, then Accu-Print will solvethis problem for you - and give you

some added desirable features as well.

With Accu-Print in control of your

printing, your Epson printer will

faithfully reproduce each and every

character that the Atari line of

computers can generate on the screen

with no exceptions.

What Accu-Print Can Do

Figure 1shows a little nonsense listing

using Atari graphics characters and

inverse characters. If you type these

statements into your computer [using

the appropriate keystrokes to obtain

the special characters as described in

the Atari Basic manual) and then list

them to your printer, you will obtain

the results shown in Figures 2, 3, and 4

printed on three sheets of paper. The

printer will pretty much garble the

listing and seem to go crazy with form

feeds as it is printing.

This is because there is an

incompatibility between the ATASCII

20

codes used to represent the computer's

character set and the ASCII codes used

to represent the printer's character set.

Some ATASCII values representing

inverse characters to the computer

represent different Epson-style graphics

characters to the printer. In fact, the

special Atari graphics and inverse

characters just aren't included in the

Epson printable character set. And

some ATASCII values are interpreted

by the printer as special control

characters. Hence, the printer form

feeds when you don't really want it to.

This is quite a messy state of affairs!

I wrote Accu-Print in order to get

around these difficulties. It seemed to

me that the printer's graphics

capabilities could somehow be used to

form the special characters. After much

experimentation and some pain, I

finally succeeded, and now I'd like to

share the result with you. When Accu-

Print is controlling the printing, the

program shown in Figure 1will print on

paper exactly as it's shown in the

figure. As you can see, all Atari

characters can be printed.

Accu-Print System Description

In its usual configuration, printing on

the Atari computer is controlled by a

routine within the Operating System

ROM called the printer driver. Each

MICRO

by R ich ard M armon

time a character is to be printed, either

by a cartridge [such as BASIC or the

Assembler-Editor) or by an application

program (such as the Atari Program

Text Editor, APX Forms, or a user-

written one), the printer driver is

executed and sends the ATASCII code

for the character to the printer. The

printer then responds to the code

according to its internal character set,

not the Atari's. Under the Accu-Print

system, a new printer driver replaces

the one contained in the OS ROM.

Once loaded, the new printer driver

controls all subsequent printing by any

program. The new printer driver is

contained in an AUTORUN.SYS file

and is located automatically and

attached to the Operating System

during system startup. To use the

system, all you have to do is make sure

AUTORUN.SYS file is on your boot

disk and then start and use the

computer system normally. No

differences will be noticeable until

Atari graphics or inverse characters are

printed. Then, the special characters

will simply be reproduced on the

printer, although the printing will slow

down somewhat due to the use of the

printer's graphic mode.

There are basically two parts to the

Accu-Print system. The first is the

AUTORUN.SYS file which contains

No. 71 . April/May 1984

Page 23: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 23/84

Page 24: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 24/84

Listing 1

; A C C U - P R I N Tj

j T H I S R O U T I N E R U N S A S A N A U T O R U N R O U T I N Ej I T C A U S E S T H E O P E R A T I N G S Y S T E " T O U S E T H Ej N E N D E V I C E W R I " r E P O R T I O N O F T H E P R I N T E R H A N D L E R .

I C F C O R S S I C F Cj

" 1 0 Z I N I T E Q U S I D. . I E Z C H A R E Q U $ I E

8 8 I F Z S A V E E Q U S I F

j

8 2 F 4 C B A S E E Q U s e 2 F 41 0 1 7 N P T A B E Q U S I D I 7

II C F C A D I F D 8 B E G I N L D A S D 8 1 F C H E C K F O R O P T I O N K E YI C F F 2 9 8 4 A N D 1 $ 8 41 0 8 1 F 8 1 3 B E Q F I N I S

I F = D O N ' T U S E N E W P R I N T E R R O U T I N EI D 8 3 A 9 1 7 L D A I N P T A B j R E V E C T O R P R I N T E RI D 8 5 8 D I B 8 3 S T A s e 3 1 B1 D 8 B A 9 I D L O A I N P T A B

I D 8 A B D I C 8 3 S T A s e 3 1 CI D 8 D E E E 8 8 2 I N C S 2 E BI D I B E E E B 8 2 I N C S 2 E BI D I 3 E E E B 8 2 I N C S 2 E BI D l o b 8 F I N I S R T S R E T U R N

S U B R O U T I N E V E C T O R SI D I 7 9 E E E A D R S E E 9 E I O P E NI D 1 9 D B E E A D R f E E D B ; C L O S EI D I B 9 D E E A D R S E E 9 D j R E A DI D I D B 7 I D A D R P I 1 I R I T - I j N E i l W R I T EI D I F B 8 E E A D R S E E B B I S T A T U SI D 2 1 9 D E E A D R S E E 9 D ; S P E C I A LI D 2 3 4 C B Y T S 4 C ; J U " P V E C T O R T O

I D 2 4 7 B E E A D R S E E 7 B D E V I C E I N I T R O U T I N E

N E N D E V I C E W R I T E R O U T I N E;

I D 2 0 8 8 D W B Y T 8 ; D O U B L E W I D EI D 2 7 8 8 C H C N T B Y T , ; L I N E C H A R C O U N TI D 2 B 8 1 C H I N C B Y T 1 ; I N C R E M E N T F O R G R A P H I C SI D 2 9 5 1 L E N B Y T B I ; L I N E O V E R F L O W L E N G T HI D 2 A 8 8 F T B Y T 8 ; F I R S T T I " E I N D I C A T O RI D 2 B 8 8 I S B Y T 8 ; P R I N T E R I N I T S T R I N GI D 2 C 8 8 8 8 8 8 B Y T 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8

;; N O T E : D U E T O S P A C E C O N S T R A I N T S W E D O N O T L I S T O U Tj E V E R Y B Y T E S E P A R A T E L Y , I N S T E A D W E C O " B I N E T H E " ,; W E U S E T H I S C O N V E N T I O N P A R T I C U L A R L Y N H E N L I S T I N G T E X T;

I D 3 4 . . A S B Y T 8 j S P E C I A L C O N T R O L C H A R A L L O W

I D 3 5 . . 8 8 8 ' D D Y B , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , B , B , 8 , 8 , 8

I D 5 3 8 8 8 8 0 8 D B Y 8 , 8 , 8 , 8 , B , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8

I D 7 1 . . 8 8 . . D B Y 8 , 8 , B , B , 8 , 8 , 8 , 8 , 8 , B , 8 , 8 , 8 , 8 , 8

I D a F 8 8 8 8 8 8 D B Y 0 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , 8 , ' , 8 , 8 , 8 , 8I D A D 8 8 8 8 8 8 D B Y 8 , 8 , 8 , 8I D B 5 8 8 G R B Y T 0 ; G R A P H I C I N D I C A T O RI D B o 8 8 C O L C T B Y T 8 ; C U R R E N T C O L U " N O F C H A RI D B 7 B e F R E T B Y T 8 j F O U N D I S S ( C R ) I N D I C A T O R

22 MICRO

The OPTION Key

When the AUTORUN .SYS file

containing the new printer driver is on

one of your boot disks, it will

automatically control the printing

whenever you start your system using

that disk. However, there may be times

when you don't want the Accu-Print

system to handle the printing. Instead

of using another disk that doesn't

contain Accu-Print 's AUTORUN.SYS

file, simply press the OPTION key and

turn your computer on. Keep the

OPTION key depressed until the disk

drive stops and the startup operation is

complete. Now printing will be

controlled by the normal Operating

System printer driver. To use Accu-

Print again, just turn your computer off

and restart your system without

depressing the OPTION key.

Compatibility With Other

Programs

The Accu-Print printer driver uses 768

bytes of memory, which is subtracted

from the amount of memory available

for application programs. The

AUTORUN.SYS file, upon booting,

modifies the LOMEM pointer so that

application programs may be loaded

and run in conjunction with the printer

driver without overwriting it.

Since Accu-Print is designed to

coexist and run with other programs, it

is compatible with language cartridges

such as BASIC, PILOT and Assembler-Editor. It is also compatible with

standalone programs such as the Atari

Program Text Editor and APX Forms. It

is not compatible with any program

that has its own AUTORUN.SYS file or

that directly calls the Operating

System's printer driver routine. In

short, Accu-Print is compatible with

any program or cartridge that uses or

supports normal Atari Operating

System printing conventions.

Control Characters

The Epson (and Epson-compatible]printers, without software support like

Accu-Print, will not normally print

Atari graphics or inverse characters.

The reason is that while the Atari

computer will display graphics

symbols in response to certain numeric

values, the Epson printers will consider

those same values as control codes and

respond accordingly. For example, the

BASIC statement PRINT CHR$(12)

will cause a graphics symbol to appear

on the screen. However, the statement

No. 71 - April/May 1984

Page 25: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 25/84

LPRINT CHR$(12) will cause the

Epson printers to form feed.

When the Accu-Print printer driver

as created above is controlling the

printing, the only control character the

Epson printers will respond to is the

carriage return. All other control

characters will cause the printers to

print the same graphics characters that

would appear on the screen. For

program listings and other uses, this is

precisely what you want. However,

there are other applications for which

you would want your Epson printer to

respond normally to certain control

characters while responding to others

by printing the Atari graphics or inverse

symbols. For example, the Assembler-

Editor cartridge generates form feed

control characters when printing

assembly listings. But you might want

to put inverse characters in comment

lines for emphasis. Therefore, you'd

like to use the Accu-Print printer

driver, but not have it treat form feedsas Atari graphics symbols. The

Customizer program allows you to

customize the Accu-Print printer driver

for this type of use.

The Customizer Program

This program (Listing 1) creates an

Accu-Print printer driver that has been

customized for your use. As an option,

you may select among any of 24

typesty les allowed by the Epson

printers with Graftrax. All text except

graphics or inverse characters will be

printed in the typestyle you select.Note that you may not change

typestyles while you are printing with

the Accu-Print driver unless you select

a control code option.

A second option is the specification

of allowed control characters. You may

specify up to 128 control characters

which your Epson printer will respond

to normally. That is, the Atari graphics

or inverse characters corresponding to

these symbols will not be printed in

response to these control codes.

Instead, the printer will respond as

specified in its instruction manual.

Running the Customizer program is

simple. With the BASIC language

cartridge inserted, just load and run

CUST.BAS. After initialization is

completed, you will see a menu of

typestyle choices. Just type the number

corresponding to the typestyle you

want followed by the RETURN key.

You will then be asked if you want to

allow control characters. If you do, type

Y and RETURN in response to the

question:

No. 71 - April/May 1984

I D B B 8 5 I F P W R I TI D B A 2 8 I A E FI D B D A 8 t8

I D B F B C 8 5 I DI D C 2 B C B b I DI D C 5 B C B 7 I DI D C B C C 2 A I DI D C B D 8 1 3I D C D E E 2 A I D

I D D 8 B 9 2 B I D L O PI D D 3 C 9 8 8I D D 5 F 8 8 9I D D 7 A b I DI D D 9 2 8 C F I EI D D C C BI D D D 4 C D 8 I DI D E 8 A S I F G O O NI D E 2 2 8 8 A I F1 . D E 5 C 8 8 1I D E 7 F 8 8 3I D E 9 4 C B C I EI D E C E E B 5 I D I N C " PI D E F I B

I D F 8 A D 2 B I DI D F 3 b D 2 7 I DI D F b B D 2 7 I DI D F 9 C D 2 9 I DI D F C D 8 8 DI D F E A 9 9 Bl E 8 8 A b I Dl E 8 2 2 8 C F I EI E 8 5 A D 2 B I Dl E 8 B B D 2 7 I DI E 8 B A 9 I B C T R Ll E . D A b I DI E 8 F 2 8 C F I El E 1 2 A 9 4 Cl E 1 4 A C 2 b I Dl E 1 7 C . "l E I 9 F 8 . 2l E I B A 9 4 Bl E l D A b I D L D 7 bI E I F 2 . C F I EI E 2 2 A 9 e aI E 2 4 A b I Dl E 2 b 2 8 C F I El E 2 9 A 9 , .l E 2 8 A b I Dl E 2 D 2 8 C F I El E 3 8 A C B b I D B A C K

l E 3 3 A S I FI E 3 5 2 8 4 B I Fl E 3 B B AI E 3 9 C 9 9 BI E 3 B D . 8 5I E 3 D E E B 7 I Dl E U A 9 9 8l E 4 2 A b I D P U T Cl E 4 4 E E B o I DI E 4 7 2 8 C F I El E 4 A A 9 8 Bl E 4 C C D B b I DI E D 9 C 9 9 B

S T A Z S A V I :J S R . E F I I I

L D Y "S T Y G RS T Y C O W 'S T Y F R E TC P Y F TB N E G O O NI N C F TL D A I S , YC " P 18B E Q G O O NL D X Z I N nJ S R S T C H I ~I N YJ " P L O PL D A Z S A Y I :J S R C H R C I (C P Y 1 1B E Q I N C " PJ " P C " P A T ·I N C G RC L C

L D A C H I N ! :A D C C H C N l 'S T A C H C N TC " P L E NB N E C T R LL D A 1 1 5 5L D X Z I N nJ S R S T C H I !L D A C H I N ! :S T A C H C N TL D A I U BL D X Z I N nJ S R S T C H RL D A 1 7 6

L D Y D W

C P Y "B E Q L D 7 0L D A 1 7 5L D X Z I N I TJ S R S T C H I IL D A I BL D X Z I N r 'J S R S T C H I ~

L D A "L D X l I N nJ S R S T C H I ~L D Y C O L e r

L D A Z S A V EJ S R G E W .T X AC " P 1 1 5 5B N E P U T CI N C F R E TL D A 1 1 4 4L D X znnI N C C O L C TJ S R S T C H I ~L D A I BC " P C O L c rC " P . . 9 B

S T O R E A T A S C I I C H A R

; I N I T C O L U M N C O U N TI A N D I N D I C A T O R S

j F I R S T T I " E T H R U ?IB R A N C H I F N O T; B Y P A S S A F T E R T H I S

; C H E C K F O R " O R EIP R I N T E R I N I T C H A R SB R A N C H I F N O " O R EI N I T C H A R I N P R I N T E R

I P O I N T T O N E X T I N I TC H A R A N D G E T IT

; C H E C K F O R N O N - C O " P A T I B L E; C H A R A C T E R; B R A N C H I F I N C O M P A T I B L E; C O " P A T I B L E

S E T G R A P H I C F L A G

I N C R E " E N T LI N EC H A R C O U N T

; C H E C K F O R L I N E O V E R F L O W; B R A N C H I F N O O V E R F L O W

E L S E , S E N D C A R R I A G E R E T U R N

C L E A R C H A R C O U N T

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

C H E C K F O R D O U B L E W I D E

B R A N C H I F N O T

; C O L U M N C O U N T I N Y; A T A S C I I C O D E I N A; G E T C O L U M N V A L U D; P U T I N T O A; 1 5 5 I S A T A S C I I E O L

IS E T F O U N D 1 5 5 F L A G; S E N D A 1 4 4 I N S T E A Dj I N D E X I N T O P R I N T E R B U F F E R; S E T C L O U " N C O U N T; P U T C O L U M N V A L U E I N P B

MICRO 23

Page 26: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 26/84

I E 4 F 0 0 O FI E S I A 9 e eI E S 3 C O B 7 1 0I E S 6 F 0 6 1I E S 8 8 0 B 6 1 0I E S B A C 2 8 1 0l E S E A 9 0 8I E 6 0 A 6 1 0I E 6 2 2 0 C F I EI E 6 S A C 2 6 1 0

I E 6 B C 8 8 8I E 6 A F . 0 7I E 6 C A 9 0 8I E 6 E A 6 1 0I E 7 0 2 0 C F I El E n A 9 I BI E 7 S A 6 1 0I 7 7 2 8 C F I EI E 7 A A 9 4 CI E 7 C A C 2 6 1 0I E 7 F C 8 0 8I E S I F 8 8 2I E B 3 A 9 4 BI E B S A 6 1 0

I E B l 2 8 C F I El E B A A 9 8 8I E 8 C A 6 1 0I E 8 E 2 0 C F I EI E 9 1 A 9 8 8

I E 9 3 A 6 1 0I E 9 5 2 0 C F I EI E 9 8 A C B 6 1 0I E 9 B A S I FI E 9 0 2 8 4 8 I Fl E A . B Al E A l A 2 0 0I E A 3 C 9 9 Bl E A S 0 8 0 2I E A 7 A 2 0 8I E A 9 B AI E A A A 6 1 0I E A C E E B 6 I Dl E A F 2 0 C F I EI E B 2 A 9 0 8I E B 4 C D B 6 I DI E B 7 0 8 D FI E B 9 A 0 8 1I E B B 6 .I E B C A O 2 7 1 0I E B F 6 0 2 B 1 0I E C 2 8 0 2 7 1 0

I E C 5 A S I FI E C 7 A 6 1 0I E C 9 2 ' C F I EI E C C 4 C B 9 I E

B N E B A C KL O A 18

C " P F R E TB E Q O R OS T A C O L C TL D Y C H I N e

B S I L O A 1 8L O X Z I N I TJ S R S T C H RL O Y O W

C P Y "B E Q B S 2L O A 1 8L O X Z I N I TJ S R S T C H R

B S 2 L O A I $ I BL O X Z I N I TJ S R S T C H RL O A 1 7 6L O Y O NC P Y 18

B E g B S 3L O A 1 7 S

B S 3 L O X Z I N I T

J S R S T C H RL O A 1 8L O X Z I N I TJ S R S T C H RL O A IiL O X Z I N I TJ S R S T C H R

B K I L O Y C O L C TL O A Z S A V EJ S R B E T C LT X AL D X IS

C " P 1 1 5 5B N E O KL O X III

O K T X AL O X Z I N I TI N C C O L C TJ S R S T C H RL O A 1 8C " P C O L C TB N E B K I

O R O L O Y 1 $ ' 1R T S

C " P A T L O A C H C N TA D C C H I N CS T A C H C N T

L O A Z S A V EL O X Z I N I TJ S R S T C H RJ " P O R D

; B R A N C H I F N O T L A S T C O L U " N; I F F R E T S E T

N E E O T O R E P E A T C H A R

Z E R O C O L C T

P U T B A C K S P A C E I N B U F F E R

C H E C K F O R O O U B L E N I O E

, B R A N C H I F N O T; P U T I N A N O T H E R; B A C K S P A C E

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

B R A N C H I F N O T O O U B L E N I O E

; C O L U " N C O U N T I N Y; A T A S C I I I N A

C O L U " N V A L U EI N T O A

T E S T F O R I S 5B R A N C H I F N O T I S 5R E P L A C E 1 5 5 W I T H I IP U T C O R R E C T V A L U E I N AI N D E X I N T O P B I N XS E T C O L U " N C O U N TP U T C O L U " N V A L U E I N P B

j B R A N C H I F N O T L A S T C O L U " ~ I

R E T U R NI N C . C H A R C O U N T

; S T O R E C H A R I N P B; A N O E X I T

;; S T O R E C H A R I N A I N T O P B A T O F F S E T X; P R I N T I F B U F F E R F U L L O R C R .;

I E C F 9 0 C " 3 S T C H RI E 0 2 E BI E 0 3 E 4 I EI E O S F 8 1 6I E 0 7 B 6 1 0

S T A $ i 3 C 8 , XI N XC P X Z C H A RB E g L A S TS T l Z I N I T

; S T O R E C H A R

B R A N C H I F L A S T C H A R F O R P BU P O A T E P O I N T E R S

24 MICRO

ANY CONTROL CHARACTERS TOALLOW?

Then type the decimal value of the

control character you wish your Epson

printer to respond to normally followed

by the RETURN key. You will then be

asked:

A NY M ORE ?

Respond with a Y and RETURN to

specify more control characters, andcontinue in this way until you have

typed all the control characters you

wish to allow. You can specify up to

128 control characters in this manner.

You will then be asked for a file

name. This is the name of the file your

customized printer driver will be

written to. You may give any legal file

name and must give the complete

specifier, including the disk drive. For

example, this could be

Dl:SPECIAL.OBJ. Follow the file

specification with the RETURN key.

The file will then be written to thedisk. Next you will be asked if you

want to create another printer driver

file. Type Y and RETURN if you want

to create another customized printer

driver, or N and RETURN if you want

to exit the program.

To use your new printer driver, just

copy the file you created to the

AUTORUN.SYS file and reboot your

system with the disk containing it. You

should also turn your printer off and

then on again before you use a new

printer driver so it will be cleared of any

previous settings.You will probably want to create

several Accu- Print printer drivers for

different uses. For example, you might

have one using normal Pica type and no

control characters allowed for BASIC

program listings, another using Pica

type and allowing form feeds for

assembly listings using the Assembler-

Editor cartridge, and perhaps another

using Emphasized Pica type and

allowing several control characters for

word processing applications.

Additional Details

Pressing the RESET key will make the

Accu-Print printer driver inactive. You

will have to restart your Atari com-

puter system to use Accu-Print again.

Accu-Print uses the character

definitions stored inside your Atari

computer to generate the graphics and

inverse characters on your printer. In

fact, it uses the CHBAS Operating

System vector to find the character set

definitions in memory. Thus, if you

use the Accu-Print printer driver with

No. 71 - April/May 1984

Page 27: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 27/84

an application program that uses a

redefined character set, the redefined

characters will be printed on your

printer. This is useful for many special

applications, and can be the basis for

special graphics character screen dump

programs.

How Accu-Print Works

Listing 2 IS an assembly languagelisting-of the Accu-Print printer driver.

I've included it for those of you who

might like to understand how the

printer driver works. Additionally, you

might wish to modify it for your own

special purposes. I've tried to liberally

comment the listing to make it a little

easier to understand.

The basic idea behind Accu-Print is

to replace the normal Operating

System printer driver with one of my

own design. This is made possible by

two features of the Atari system. The

first is the capability to load and ex-ecute a program stored in an

AUTORUN.SYS file at system startup

after the system is initialized, but

before the user is given control of the

system. The second is the fact that the

Operating System uses RAM to store

pointers lor vectors) to input/output

control routines. Combining these

features, the system allows us to ex-

ecu te a program Icon tinued in

AUTORUN.sys) during system startup

that changes the print pointer from the

standard printer driver to our own.

Labels BEGIN through FINIS show

these operations. At system startup,

the entire AUTORUN.SYS file is load-

ed into memory and execution begin at

BEGIN. If the OPTION key is pressed,

the program simply exits and nothing

happens. Otherwise, the address of our

new printer device table (located at

NPTAB) is stored in locations $31B and

$31C, which contain the pointer to the

Operating System's standard printer

device table. Next, the LOMEM

pointer is incremented by 768 to make

sure the following code isn't overwrit-

ten by an application. The program

then exits and the user is given control

of the system. Only a few instructions

are executed at system startup, but the

effect is great! All printing will now be

vectored through our new printer

driver. The data for the driver starts at

DW and the executable code starts at

PWRIT.

Chapter 8 of the De Re Atari gives

more information about Operating

System vectors and device tables if

you're interested in more detail about

No. 71 . April/May 1984

l E D B F ' 8 1l E D D b jl E D E A 9 2 'l E E I A e Iil E E 2 B C 2 7 l Dl E E S 9 D C ' ' 3l E E B E Bl E E 9 E 4 l El E E B D e F B

l E E D A 9 . .l E E F B 5 l Dl E F l A E 7 F E El E F 4 A C B e E El E F 7 2 ' E b E El E F A 2 e 5 9 E 4l E F D A D 2 b l Dl F i e C 9 . .I F ' 2 F e e 5I F . 4 A 9 . .I F , b S D 2 A I Dl F 8 9 b .

I F ' A 3 Sl F e B C 9 9 CI F , D B ' 2 7I F , F C 9 9 Biru F' 2'l F 1 3 A . e e

l F 1 5 B E 3 4 l Dl F l S E I "l F 1 A F ' e 9I F 1 C D 9 3 4 1 D

l F I F F e 1 2l F 2 1 C Sl F 2 2 4 C 1 5 I Fl F 2 5 3 SI F 2 b C 9 7 Bl F 2 S B e ' Cl F 2 A 3 SI F 2 B C 9 2 1I F 2 D 9 1 ' 7l F 2 F C 9 b l

l F 3 1 F I 8 3I F 3 3 A I "l F 3 5 b eI F 3 b A j 8 1I F 3 S b.

I F 3 9 . .l F 3 A . .I F 3 B 8 8I F 3 C 8 8l F 3 D "

j

j C H E C K C H A R F O f I IC O " P A r I B I L I T Y W I T H

; P R I N T E R C H A R S E T . R E T I J R N Y = . I F C O " P A T l B L E ,j Y = 1 I F N O T . A T A S C I I V I 4 L U E S I N C O " P A T IB L E :

j 8 - 3 1 , 9 b , 1 2 3 - 1 5 4 , 1 5 b - 2 ' 5 5

;C H R C K S E C

C K P 1 1 5 bB C S S O N EC " P 1 1 5 5B E Q S Z E R DL D Y Ie

A N X T L D X A S , YC P X 1 8

B E Q N " D RC K P A S , Y

B E Q S Z E R DI N YJ " P A N X T

N " O R S E CC K P 1 1 2 3B C S S O N ES E CC K P 1 3 2B C C S O N EC " P 1 9 bB E Q S O N E

S Z E R O L D Y IiR T S

S O N E L D Y 1 1R T S

N E X TC R

B E Q C RR T SL D A 1 t 2 1L D Y IIS T Y C H C N TS T A " 3 C I , XI N XC P X Z C H A RB N E N X l

L D A It"S T A Z I N I TL D X . E E 7 FL D Y . E E B .J S R . E E E bJ S R . E 4 5 9L D A D WC " P IeB E Q O U TL D A IIS T A F TR T S

; B R A N C H I F C H A R I S E O L; R E T U R N

; C L E A R C H A R C O U N T F O R N E W L I N; P A D B U F F E R W I T H; B L A N K S

S E N D B U F F E R T O P R I N T E R

C H E C K D O U B L E W I D E

I B R A N C H I F N O T; F O R C Tj I N I T I A L I Z A T I O NI R E T U R N

} 1 5 5 - N E E D G R A P H I C S

= 1 5 5 - D O N ' T N E E D G R A P H I C S

; C H E C K F O R S P E C I A Lj A L L O W C H A R A C T E R Sj B R A N C H I F N O " O R E; C H E C K C H A R

; A L L O N I T I F E Q U A Lj P O I N T T O N E X T A L L O W C H A R; A N D C H E C K I

) 1 2 2 - N E E D G R A P H I C S

( 3 2 - N E E D S R A P H I C S

; = 9 b - N E E D G R A P H I C Sj D O N ' T N E E D G R A P H I C S

; N E E D G R A P H I C S

;I C O " P U T E C O L U " N V A L U E T O C O N S T R U C T C H A Rj A = A T A S C I I V A L U E O F C H A Rj Y . . C O L l I " N V A L U E T O C O K P U T Ej X z C O L U K N V A L U E O N E X I T

N X T

L A S T

O U T

;A N SA T V A LC V A LC L N U "I N F L G

B Y T •

B Y T 8B Y T IB Y T 8B Y T I

MICRO

j C O K P U T E R C O L U K N V A L U E; A T A S C I I C H A R V A L U E

I N T E R N A L C H A R V A L U EC O L U K N N l I K B E RI N V E R S E C H A R F L A G

,

1I

l~- iI.1

~.

25

Page 28: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 28/84

,.I'

I F 3 E 8 8 8 8I F 4 8 8 8 4 8 2 87

I F 4 8 8 D 3 A I FI F 4 B 8 C 3 C I FI F 4 E A 8 8 8I F 5 8 8 C 3 9 I F

I F 5 3 3 8I F 5 4 C 9 8 8I F 5 6 9 8 8 B

I F 5 8 A D 3 A I FI F 5 B 3 8I F 5 C E 9 8 8I F 5 E 8 D 3 A I FI F 6 1 A 8 3 1I F 6 3 8 C 3 D I FI F 6 6 A C F 4 8 2I F 6 9 8 D 3 F I FI F 6 C A D 3 A I FI F 6 F 3 8I F 7 8 C 9 b 8

I F 7 2 9 8 8 4I F 7 4 4 C 8 9 I FI F 7 7 3 8I F 7 8 C 9 4 8I F 7 A 9 8 8 6I F 7 C 3 8I F 7 D E 9 2 8I F 7 F 4 C 8 9 I FI F 8 2 3 8I F 8 3 C 9 2 8I F 8 5 B 8 F 5I F 8 7 6 9 4 8I F 8 9 8 D 3 B I FI F 8 C A AI F 8 D A 9 8 8I F 8 F E B B 8I F 9 1 F 8 B EI F 9 3 1 8I F 9 4 6 9 B 8I F 9 6 C AI F 9 7 9 8 F 6I F 9 9 E E 3 F I FI F 9 C A 9 8 BI F 9 E 4 C 8 F I FI F A I 8 D 3 E I FI F A 4 8 D B 6 I FI F A 7 A D 3 F I F

I F A A 8 D B 7 I FI F A D A . B 8

I F A F A E 3 C I FI F B 2 B D 4 8 I FI F B 5 3 9 3 E I FI F B 8 C 9 8 BI F B A F 8 8 AI F B C A D 3 9 I FI F B F 1 8I F C B 7 9 4 B I FI F C 3 8 D 3 9 I FI F C 6 C BI F C 7 C 8 B 8

C H B A S D B Y 8 ; C H A R S E T B A S E A D D R E S S" A S K S B Y T 1 2 8 , 6 4 , 3 2 , 1 6 , 8 , 4 , 2 , 1 ; " A S K S F O R C O l U " N S 8 T O

;G E T C l

;

I S E E ' N O T E ' I N F I R S T P A G E O F l I S T I N G

N C H A R

l 6 B

6 2 B

l 4 i

C S T D R

l O O P

l O O P l" O D I

C H E C K

S T A A T V A l

S T Y C l N U "l D Y 1 8

S T Y A N S

S E CC " P 1 1 2 8B C C N C H A Rl D A A T V A lS E CS B C 1 1 2 8S T A A T V A ll D Y 1 1S T Y I N F l Gl D Y C B A S ES T A C H B A S + ll D A A T V A lS E CC H P 1 $ 6 8

B C C l 6 BJ " P C S T O RS E CC " P 1 $ 4 8B C ~ l 4 8S E CS B C 1 $ 2 .J " P C S T O RS E CC " P 1 $ 2 8B C S G 2 BA D C 1 . 4 B

S T A C V A lT A Xl D A 1 8

C P X IIB E g C " P C lC l CA D C 1 8D E XB C C l O O PI N C C H B A S + ll D A 1 8

J " P l O O PS T A C H B A SS T A " o D l + ll D A C H B A S + l

S T A " O D l + 2l D Y 1 8

l D X C l N U "l D A " A S K S , XA N D C H B A S , Y

C " P 1 8

B E g C H E C Kl D A A N SC l CA D C " A S K S , YS T A A N SI N YC P Y 1 8

; S A V E A T A S C I I V A L U E; S A V E C O l U " N N U " B E R; I N I T I A L I Z E

I . B R A N C H I F N O T I N V E R S E

C O N V E R T T O N O N - I N V E R S E

; S E T I N V E R S E F L A G; G E T C H A R S E T B A S E; A N D S A V E I T

; C O N V E R T A T V A l T O

; I N T E R N A L C O D E

; B R A N C H I F < S 6 BE L S E , C O N T I N U E

B R A N C H I F < H 8

; B R A N C H I F ) = . 2 B

; S T O R E I N T E R N A L V A L U E; C O " P U T E A D D R E S S O F C H A R; D E F I N I T I O N .

; N O " O R E A D J U S T " E N T N E C E S S A R Y

; D E C R . I N T E R N A L V A L U E; S E E I F O F F S E T = 2 5 6; B U " P H I G H

S T O R E l O W B Y T E

; C O N T R O L S l O O P; I N D E X T O " A S K S; G E T C O l U " N " A S K; " O D I F I E D - W I l l P O I N T T O; C H A R . D E F I N I T I O N; B R A N C H I F C O l U " N B I T N O T S E T; E L S E , U P D A T E C O l U " N V A L U E

; A D D V A L U E T O A N D

26 MICRO

that area. To set the stage for

understanding the printer driver code

itself, let's notice that when a character

is to be printed, its ATASCIIcode will

be placed in the A-register and the code

beginning at PWRIT will be executed.

The driver first checks to see if this

is the very first time the printer driver

is being executed. If it is, then the

characters contained in the data string

starting at ISwill be sent to the printer

to initialize it. The particular character

string stored here is a function of the

typestyle selected when you ran the

Customizer program. The driver then

checks to see if the character to be

printed is a graphics or inverse

character. The subroutine at CHRCK is

used for this. If it is not a special

character, then subsequent code is

bypassed and the driver operates

exactly like the standard one.

If a special character is to be

printed, then some special processing

takes place. Each special character isprinted in bit graphics mode. This

means that data values corresponding

to the individual 8-dot columns of the

printed characters have to be sent to

the printer in addition to control

characters putting the printer into and

out of graphics mode. This accounts for

the slowdown while printing these

characters. For each special character

printed, 12 data characters have to be

sent. In addition, special handling has

to be given if a column data value

happens to be 155. The Atari system

will recognize this value as a carriagereturn and send a line feed character

after it. Since we really want this value

to be printed as a single 8-dot column,

the automatic insertion of additional

data is unacceptable. So if this value

occurs (as it does with an inverse A) the

driver breaks it apart, prints part of the

column, backspaces the printer, and

prints the second part. At any rate, the

code between INCMP and CMPAT is

devoted to sending data to the printer

that causes it to print the 8-dot

columns that form the graphics or

inverse character being printed. Afterthis data is sent, the printer is taken

out of graphics mode and the printer

driver is exited.

Two subroutines worthy of note are

CHRCK and GETCL CHRCK

determines when a character needs

special handling. It does this by

checking the character's ATASCII code

with the codes of the graphics and

inverse characters. Also, it checks the

character's code against the list of legal

control codes (i f any) you specified

-No. 71 . Apri l/May 1984

Page 29: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 29/84

while running the Customizer

program. The character string AS

contains those control codes. So it is

this routine which allows for passing

certain control characters intact to the

printer.

GETCL is the real workhorse of the

printer driver. It accesses the internal

character definitions and computes the

data values to send to the printer so it

can reconstruct the characters preciselyas the Atari defines them. The routine

is executed 8 times for each special

character, once for each 8-dot column.

The algorithm used is interesting, since

it has to translate between the row-by-

row internal character set definitions

and the column-by-column data

required by the printer. You can also

see why Accu-Print works with custom

character sets. It uses the standard

character set vector to find the

character definitions. Custom

character sets use this vector too! My

technique is probably not the mostsophisticated possible. An interesting

exercise would be to make it shorter

and more efficient. I have a feeling that

one of you whizzes out there can write

this subroutine using one quarter of the

code I did. Any takers?

Well, I hope this explanation of how

the code works will help you

understand some of the subtleties of

the Atari Operating System and of

assembly language. I highly

recommend De Re Atari and the

Technical Reference Notes for more in-

depth treatments of the techniques

used.

A Concluding Note

I've found the Accu-Print system to be

very useful in my work. I can now feel

free to use graphics strings in my

programs at will, particularly to

represent assembly language routines

where it saves me a lot of typing and

leads to faster execution times for

initialization. I don't get gibberish on

my printer anymore, and I find that

most programs work with Accu-Print

easily. I hope you find the system

helpful to you as well.

No. 71 - April/May 1984

I F C 9 D I E 7 B N E L O O P I j B R A N C H I F N O T D O N EI F C B A E 3 D I F L D X I N F L 6 H A N . D L E [ N V E R S EI F C E E I I I C P X 1 1I F D I D I . 8 B N E F I N j B R A N C H I F N O T I N V E R S EI F D 2 A 9 F F L D A 1 2 5 5 j E L S E , F L I P B I T SI F D 4 4 D 3 9 I F E O R A N SI F D 7 S D 3 9 I F S T A A N SI F D A A D 3 A I F F I N L D A A T V A L L O A D R E B S F O R E X I TI F D D A C 3 C 1 F L D Y C L N U "I F U A E 3 9 I F L D X A N S

I F E 3 6 . R T S

I F E 4 E N D

Listing 2

1 R E M A C C U - P R I N T C U S T O " I Z E R4 R E M1 . G R A P H I C S . : P O S I T i O N 1 5 , 8 : ? ' A C C U - P R I N T R2 0 P O S I T I O N 1 5 , 1 8 : ? " C U S T O H I Z E R "4 0 P O S i T I O N 5 , 1 5 : ? " { R E V E R S E O ! ~ } P L E A S E W A I T F O RI N I T I A L I Z A T I O N { R E V E R S E O F F } "5 8 R E M P U T A C C U - P R I N T I N S T R I N G& 8 O I H R S ( 7 4 4 1 : R E S T O R E 9 0 07 @ F O R 1 = 1 T O 7 4 4 : R E A D A : R S I L E I ~ ! R $ ) + 1 ) = C H R $ \ A J : N E X T I8 @ G R A P H I C S ' : P O S I T I O N 1 5 , 9 : ? ' A C C U - P R I N T ·9 @ P O S I T I O N 1 3 , 1 : ? " T Y P E S T Y L E i 1 E N U "1 0 0 P O S I T I O N 2 , 3 : ? " 1 P I C A "1 1 0 P O S I T I O N 2 , 4 : ? I 2 I T A L "1 2 0 P O S I T I O N 2 , 5 : ? I 3 P I C A E H P H '1 3 1 1 P O S I T I O N 2 , 6 : ? I 4 I T A L E H P H "1 4 0 P O S I T I O N 2 , 7 : ? ' 5 P I C A D S 'i 5 r . P O S i T I O N 2 , 8 : ? • 6 I T A L O S '1 6 0 P O S I T I O N 2 , 9 : 7 " 7 P I C A E H P H D S "1 7 0 P O S I T I O N 2 , 1 @ : ? ' 8 I T A L E I 1 P H O S ·1 8 0 P O S I T I O N 2 , 1 1 : ? " 9 C O N D P I C A "1 9 ~ P O S I T I O N 2 , 1 2 : ? " 1 0 C O N D ! T A L "2 0 . P O S I T I O N 2 , 1 3 : ? " I I C O N D P I C A O S ·

2 1 0 P O S I T I O N 2 , 1 4 : ? " 1 2 C O N D H A L D S ·2 2 . P O S I T I O N 2 0 , 3 : ? " 1 3 C O N D - E X P P I C A '2 3 0 P O S I T I O N 2 . , 4 : ? " 1 4 C O N D - D P I T A L "2 4 0 P O S I T I O N 2 0 , 5 : ? " 1 5 C O N D - E X P P I C A D S ' ;2 5 0 P O S l T I O N 2 0 , 6 : ? " 1 6 C O N D - [ I P I T A L O S " ;2 6 0 P O S I T I O N 2 8 , 7 : ' ' 1 7 E X P P I C A '2 7 0 P O S I T I O N 2 ' , 8 : ' " 1 8 E X P I T I ~ L "2 8 8 P O S I T I O N 2 0 , 9 : ? " 1 9 E X P P I C A E H P H "2 9 0 P O S I T I O N 2 0 , 1 0 : ? " 2 0 E X P ! T A L E H P H "3 0 9 P O S I T I O N 2 9 , 1 1 : ? " 2 1 E X P P I C A O S '3 1 @ P O S I T I O N 2 1 , 1 2 : ? " 2 2 E X P I T A L O S ·3 2 9 P O S I T I O N 2 0 , 1 3 : ? ' 2 3 E X P P I C A E H P H D S " ;3 3 0 P O S I T I O N 2 i 1 , 1 4 : ? " 2 4 E X P ! T A L E H P H O S " ;3 4 . P O S I T I O N 2 , 1 6 : ? " Y O U R C H O I C E " ;

3 5 @ I N P U T C H3b0 O N C H 6 0 T O 4 9 @ . 4 0 5 . 4 1 0 . 4 1 5 , 4 2 ' . 4 2 5 . 4 3 0 . 4 3 5 . 4 4 ' . 4 4 5 .4 5 9 , 4 5 5 , 4 6 0 , 4 6 5 , 4 7 ' , 4 7 5 , 4 8 1 , 4 8 5 , 4 9 9 , 4 9 5 , 5 0 8 , 5 9 5 , 5 1 9 , 5 1 53 7 @ P R I N T C H R S ! 2 5 3 1 ; : G O T O 3 4 .4 0 0 R E S T O R E 4 ' 1 : 6 0 T O 6 8 04 9 1 D A T A 2 5 54 ~ 5 R E S T O R E 4 0 6 : 6 0 T O 6 9 04 0 6 D A T A 2 7 , 5 2 , 2 5 54 1 8 R E S T O R E 4 1 1 : 6 0 T O 6 9 .4 1 1 D A T A 2 7 , 6 9 , 2 5 54 1 5 R E S T O R E 4 1 6 : 6 0 T O 6 . 84 1 6 D A T A 2 7 , 5 2 , 2 7 , 6 9 , 2 5 54 2 8 R E S T O R E 4 2 1 : 6 0 T O 6 8 .

l~

I

: - ~

MICRO 27

Page 30: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 30/84

1!

I

42 1 D A T A 2 7 , 71 , 25 5

4 2 5 R E S T O RE 4 26 : 60 T O 6 j j

4 2 6 D A T A 2 7, 52 ,2 7, 71 ,2 55

4 3 6 R ES T O R E 4 3 1 :6 0 T O 6 j 6

4 31 D A T A 2 7, 6 9, 2 7, 7 1, 2 55

4 3 5 R E S T O RE 4 3 6 :6 0 T O 6 8 6

4 36 D A T A 2 7, 5 2, 2 7, 6 9, 2 7, 7 1, 2 55

4 4 6 R E S T O RE 4 41 : 60 T O 5 4 8

44 1 D A T A 2 7 , 80 , 25 5

4 4 5 R E S T O RE 4 46 : 60 T O 5 4 .

4 46 D A T A 2 7 . 8 8 . 2 7 . 5 2 . 2 5 54 5 B RE ST O RE 4 51: 60 T O 5 48

4 51 D A T A 2 7, 8 6 , 2 7 , 7 1 , 2 5 5

45 5 RE S T O RE 4 5 6: 6 0 T O 5 4 6

4 56 D A T A 2 7, 8 6, 2 7, 5 2, 2 7, 7 1, 2 55

4 66 RE S T O RE 4 6 1: 6 0 T O 5 6 8

4 6 1 D A T A 1 5 , 14 , 25 5

4 65 RE S T O RE 4 6 6: 6 0 T O 5 6 0

4 66 D A T A 1 5, 14 ,2 7, 52 ,2 55

4 76 RE S T O RE 4 7 1: 6 0 T O 5 6 8

4 71 D A T A 1 5, 14 ,2 7, 71 ,2 55

4 75 RE ST O RE 4 76: 60 T O 5 6 1

4 76 D A T A 1 5, 1 4, 2 7, 5 2, 2 7, 7 1, 2 55

4 86 RE S T O RE 4 8 1: 6 0 T O 5 8 6

4 8 1 D A T A 1 4 , 25 548 5 RE S T O RE 4 8 6: 6 0 T O 5 8 6

4 86 D A T A 1 4 , 2 7 , 5 2 , 2 5 5

4 96 RE S T O RE 4 9 1: 6 0 T O 5 S .

4 91 D A T A 1 4, 27 ,6 9, 25 5

49 5 RE S T O RE 4 9 6: 6 0 T O 5 8 '

4 q 6 D A T A 1 4, 2 7, 5 2, 2 7, 6 9, 2 55

5 B 6 R ES T O RE 5 Bl :6 0T O 5 8 B

5 01 D A T A 1 4, 27 ,7 1, 25 5

56 5 RE S T O RE 5 B 6: 6 0 T O 5 8 6

5 66 D A T A 1 4, 2 7, 5 2, 2 7, 7 1, 2 55

51 6 RE S T O RE 5 1 1: 6 0 T O 5 8 6

5 11 D A T A 1 4, 2 7, 6 9, 2 7, 7 1, 2 55

5 15 RE S T O R E 5 1 6: G O T O 5 8 6

5 16 D A T A 1 4, 2 7, 5 2, 2 7, 6 9, 2 7, 7 1, 2 555 4 ~ R $ ( 4 b , 4 6 J = C H R$ ( 1 3 3 J :6 0 T O 6 6 B

5b ~ R $ ( 4 b , 46 J= C H R $ ( 67 ) :R $ ( 4 3, 4 3J ;C H R Si 1J :6 0T O 6 80

5 86 R S( 4 b , 4 b ) = C H R$ ( 4 1 ) :R $ ( 4 3, 4 3J = C H R$ ( I )

6 6 0 1 = 48

6 16 R E A D A : I F A = 2 5 5 T H E N 6 0 T O 7 6 6

6 28 R $ ( I , I ) = C H R $ iA J :I = I + l : 60 T O 6 1 1

7 0 B G R A P H I C S 0 : P O SI T I O N 1 5 , B : ? " A C C U - P R I N T "

7 1 0 P O S I T I O N 7 , 1: ? " CO N T RO L C H A R A CT ER S E L EC T I O N " :

P O SI T I O N 2 , 3 : 1= 57

7 2 0 P RI N T " A N Y C O N T R O L C H AR A CT ER S T O A L L O W " ;

7 3 0 D IM A $ ( I ) : I N P U T A $ : I F A S( I , I ) < > " Y · T HE N G O T O B 0 B

7 4 0 P RI N T " CO N T R O L C H AR A CT E R T O A L L O W : " ;

7 5 0 I N P U T A :R $ ( I , I ) = C H RS i A J: I = I + 1: I F 1 ) 18 5 T H EN 6 0 T O 8 B 0

7 6 B P RI N T " A N Y " O R E " j

7 7 0 I N P U T A $ : I F A $ i 1 , I J = " Y " T H E N 6 0 T O 7 4 B

8 0 0 6 R A P H I CS I :P O SI T I O N 1 5 , ' :? " A CC U - P RI N T "

8 1 6 P O S I T I O N 1 1 , I : ? " D I SK F I L E C R E A T I O N "

B 2 B P OS I T I O N 2 , 3: ? " F I L E N A " E: " j

8 3 0 01 " F $ ( 15 J : I N P U T F S

8 4 B O P EN 1 1 , 8 , 6 , F $

8 5 ' P O S I T I O N 2 , 5:? " { RE V ER S E O N } N O N W RI T I N 6 F I L E { RE V ER S E O F F } "

8 5 5 P U T 1 1 , 25 5 : P U T 1 1 , 25 5 : P U T 1 1 , 25 2 : P U T 1 1 , 28 :

P U T 1 1 , 22 7 : P U T 1 1 , 31

8 6 6 F O R 1 = 1 T O 7 4 4 : P U T 1 1 , A S C i R $ ( I , I ) ) :N EX T I

8 6 5 P U T 1 1 , 22 4 : P U T 1 1 , 2: P U T 1 1 , 22 5 : P U T 1 1 , 2:

P U T 1 1 , 25 2 : P U T 1 1 , 28

8 7 0 C L O S E 1 1

8 7 5 P O S I T I O N 2 , 7: 7 " CR E A T E A N O T H ER F I L E" ;s s e I N P U T A $: I F A $ i 1 , 1l = " Y " T H EN C L R : 6 0 T O 1 8

8 9 8 G RA P H I C S 6 : C L R : E N D

9 60 D A T A 1 73 , 31 , 26 8, 4 1, 4 , 24 0, 1 9, 1 69 , 23 , 14 1, 2 7

9 61 D A T A 3 , 16 9, 2 9, 1 41 , 28 , 3, 2 38

9 02 D A T A 2 32 , 2, 2 38 , 23 2, 2 , 2 38 , 23 2, 2 , 9 6, 1 58 , 23 8, 2 19

9 63 D A T A 2 38 , I S7 , 23 8, 1 83 , 29 , 12 8, 2 38 , 15 7, 2 38 , 76

9 64 D A T A 1 26 , 2~ :8 ,6 , 0 , 1, 8 1, 0 , 0 , i l,6 , 6 , 0 , 6 , 9 , 6 , O , 6 , 6 , °9 05 D A T A 6 , 0 , 6 , @ , 6, 6 , 6, 6, 6 , ~ , 6, ~ , 6, ~ 6 ,6 , 6 , @ , ~

9 @ 6 D A T A 6 , O ,6 , 6, 0 , 6, 6 , 6, 6 , 6, 6 , O , 6, 0 , 6, O , O , 6, 6 , 6, O

9 67 D A T A 0 , 0, 0 , 6 , 6, 0 , 0 , 6, 6 , 6 , 9, 0 " , 6 , 0, 6 , 6, 0 , 0

9 6S D A T A O , 6 ,0 , O , 0, 6 , 0, 0 , O , O , 6 , 0, O , O , 6, 6 , 6, O , 6, 0 , 0

9 69 D A T A 0 , 0, @ , 6 , 0 , 6, 0 , 0 , 0, 0 , 0 , 0, 6 , 0 , 0, 0 , 0 , 6"

9 16 D A T A 6 " , 6r 0 , 6, 6 , 0, ~ , ' , 0 , 6" " , 0 ,~ , 6, 0 , ~, 0 , B, 6

9 11 D A T A 6 , 0, 6 , 0 , il , 0, 0 , . , 0 , 13 3, 3 1, 3 2, 2 6, 2 39 , 16 0

9 1 2 D A T A 6 . 1 4 0. 1 8 1, 2 9 , 1 46 , 1 8 2, 2 9 , 1 40 , 1 83 , 2 9 , 20 4 , 4 2

9 13 D A T A 2 9 , 2~i! , 1 9 , 2 3 8 , 4 2 , 2 9 , 1 8 5 , 4 3 , 2 9 , 2 0 1 , 6

9 1 4 D A T A 2 4 0 , 9 , 1 6 6 , 2 9 , 3 2 , 2 0 7 , 3 6 , 2 0 0 , 7 6 , 2 B 8 , 2 9 , 1 6 5

9 15 D A T A 3 1 , 32 1 1 0 , 3 1 , 1 9 2 , 1 , 2 4 6 , 3 , 7 6 , 1 8 8 , 3 6 , 2 3 8 , I B l

9 16 D A T A 2 9, 2 4, 1 73 , 40 , 29 , 10 9, 3 9, 2 9, 1 41 , 39 , 29 , 20 5

9 17 D A T A 4 1, 2 9, 2 68 , 13 , 16 9, 1 55 , 16 6, 2 9, 3 2, 2 07 , 36

9 18 D A T A 1 73 , 4~ , 29 , 14 1, 3 9, 2 9, 1 69 , 27 , 16 6, 2 9, J 29 1 9 D A T A 2 ~ 7, 3 ~ , 1 69 , 7 6, 1 7 2 , 3 8, 2 9 , 1 92 , 0 , 2 40 , 2 , 1 69 , 7 5

9 2 0 D A T A 1 6 6 , 2 t , 3 2 , 2 B 7 , 3 0 , 1 6 9 , 8 , 1 6 6 , 2 9 , 3 2 , 2 6 7 , 3 ~ , 1 6 9

9 21 D A T A 0 . 16 6, 2 9. 3 2, 2 07 , 36 , 17 2, 1 82 , 29 , 16 5. 3 1

9 22 D A T A 3 2, 7 2, 3 1~ 13 8, 2 01 , 15 5, 2 6B , 5 , 23 8, 1 83 , 29

9 23 D A T A 1 69 , I H , 1 66 , 29 , 23 8, 1 82 , 29 , 32 , 20 7, 3 0, 1 69

9 24 D A T A 8 , 20 5, 1 82 , 29 , 26 8, 2 23 , 16 9, 0 , 2 05 , 18 3, 2 9

9 2 5 D A T A 2 4 6, 9 7 , 1 41 , 1 82 , 2 9 , 1 72 , 4 i I , 2 9. 1 6 9, 8 , 1 6 6, 2 9 , 3 2

9 26 D A T A 2 07 , 36 , 17 2, 3 8, 2 9, 1 92 , 6, 2 40 , 7, 1 69 , 8, 1 66

9 27 D A T A 2 9, 3 2, 2 67 , 30 , 16 9, 2 7, 1 66 , 29 , 32 , 26 7, 3 , , 1 09

9 2 8 D A T A 7 6 , 1 72 , 3 8 , 29 , 1 9 2, 6 , 2 4 0, 2 , 1 6 9, 7 5 , 1 66 , 2 9 , 32

9 29 D A T A 2 07 , 3~ , 16 9, 8 , 1 66 , 29 , 32 , 20 7, 3 0, 1 69 , 0

9 36 D A T A 1 66 , 29 , 32 , 20 7, 3 6, 1 72 , 18 2, 2 9, 1 65 , 31 , 32

9 3 1 D A T A 7 2 , 31 , 1 3 8, 1 6 2, 0 , 2 0 1, 1 5 5 , 26 8 , 2 , 16 2 , 1 1, 1 3 B , 1 66

9 3 2 D A T A 2 9 , 23 8 , 1 82 , 2 9, 3 2 , 2 07 , 3 0 , 16 9 , 8 , 20 5 , 1 82 , 2 9, 2 ~ B9 33 D A T A 2 23 , 16 0, 1 , 9 6, 1 73 , 39 , 29 , 16 9, 4 6, 2 9

9 3 4 D A T A 1 4 1, J 9 , 2 9, 1 6 5 , 31 , 1 6 6, 2 9 , 3 2, 2 0 7 , 30 , 7 6 , 18 5 , 3 0

9 35 D A T A 1 57 , 19 2, 3 , 23 2, 2 28 , 30 , 24 6, 2 2, 1 34 , 29

9 3 6 D A T A 2 0 1, 1 5 5, 2 4 6 , 1, 9 6 , 1 69 , 3 2 , 16 0 , 6 , 14 0 , 3 9, 2 9 , 1 57

9 37 D A T A 1 92 . 3. 2 32 , 22 8, 3 0, 2 08 , 24 8, 1 69 , 6, 1 33 , 29

9 3 8 D A T A 1 7 4, 1 2 7 , 23 8 , 1 72 , 1 2 8, 2 3 8, 3 2 , 2 30 , 2 3 8, 3 2 , 8 9, 2 2 8

9 39 D A T A 1 7 3 , ~ 8 , 2 9 , 2 6 1 , i I , 2 4 0 , 5 , l b 9 , 0 , 1 4 1 , 4 2

94 0 D A T A 2 9 , 9 i 1 , 5 6 , 2 0 1 , 1 5 6 , 1 7 b , 3 9 , 2 0 1 , 1 5 5 , 2 4 B , 3 2 , 1 6 0 , ~

9 41 D A T A 1 90 , 52 , 29 , 22 4, O , 2 4 0, 9 , 2 17 , 52 , 29 , 24 0

9 42 D A T A 1 8, 2 « 6 , 76 , 21 , 31 , 56 , 20 1, 1 23 , 17 6, 1 2, 5 6, 2 01 , 32

9 43 D A T A 1 4 4 , ! ' , 2 0 1 , 9 6 , 2 U , 3 , 1 6 0 , i I , 9 6 , 1 6 0 , 1

9 44 D A T A 9 6, 0 , 0, ' , 0 , 6 , 0, 0 , 12 8, 6 4, 3 2, 1 6, 8 , 4, 2 , 1 , 14 1, 5 8

9 4 5 D A T A 3 1 , 140 , 6 6 , 3 1 , 1 6 6 , 0 , 1 4 6 , 5 7 , 3 1 , 5 6 , 2 0 1

9 4 6 D A T A 1 2 8, 1 4 4, 1 1 , 1 73 , 5 8 , 31 , 5 6 , 23 3 , 1 28 , 1 41 , 5 8 , 31 , 1 6 0

9 47 D A T A 1 , 14 ~, 6 1, 3 1! 17 3, 2 44 , 2, 1 41 , 63 , 31

9 4 8 D A T A 1 7 3, 5 B , 3 1 , 5 6, 2 0 1, 9 6 , 1 44 , 4 , 7 6, 1 3 7 , 31 , 5 6 , 26 1 , 6 4

9 4 9 D A T A 1 4 4 , (I, 5 6 , 2 3 3 , 3 2 , 7 6 , 1 3 7 , 3 1 , 5 6 , 2 0 1 , 3 2

9 56 D A T A 1 76 , 14 5, 1 85 , 64 , 14 1, 5 9, 3 1, 1 76 , 16 9, 6 , 22 4, O , 2 4 0

9 51 D A T A 1 4, 2 4, 1 65 , 8, 2 02 , 14 4, 2 46 , 23 8, 6 3, 3 1

9 5 2 D A T A 1 6 9, ~ , 7 6 , 1 43 , 3 1. 1 4 1 , 62 , 3 1 , 14 1 , 1 82 , 3 1, 1 7 3 !6 3 , 31

9 5 3 D A T i l 1 4 1, 1 8 3, 3 1 , 1 60 , t i , 1 7 4, 6 0 , 3 1, 1 8 9 , 64

9 5 4 D A T A 3 1 , 57 , 6 2 , 31 , 2 0 1, 6 , 2 4 0, 1 6 , 1 73 , 5 7, 3 1 , 2 4, 1 2 1 , 64 , 3 1

9 5 5 D A T A 1 4 1 , ' )7 , 3 1 , 2 6 0 , 1 9 2 , 8 , 2 0 B ; ' 2 3 1, 1 7 4

9 5 6 D A T A 6 1 , 3 1, 2 2 4, 1 , 2 0 8, 8 , 1 6 9, 2 5 5 , 77 , 5 7 , 31 , 1 4 1, 5 7 , 3 1

9 57 D A T A 1 73 , 58 , 31 , 17 2, 6 6, 3 1, 1 74 , 57 , 31 , 96

28 MICRO No. 71 - April/May 1984

Page 31: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 31/84

Figure 1. The mouse in use on the VIC·20.

ALow Cost

Mousefor the

VIC-20

As most readers of this magazine are

aware, the "mouse" is a popular easy-

to-use device for inputting data to

computer or terminal. Many newly

designed computers, such as Apple'sMacintosh, are being built with mice as

standard factory equipment.

Having recently purchased a

VIC-20, and being unwilling to spend

several thousand dollars to get a new

mouse-equipped computer, I decided to

build a mouse which could be used to

upgrade my present system.

To begin this project I decided on

the objectives of the design. First, my

mouse should be a "hardware-only"

design. I don't enjoy programming and,

besides, it will be more of a challenge

this way. Second, if I do upgrade myhardware at some time in the future, I

don't want the mouse to be

incompatible with whatever it is I buy.

The mouse shall be usable with all

computer systems in existence or

planned. Third, the design should be

simple enough that anyone could make

a duplicate in one evening's time. And

fourth, it should not be expensive. As

you will soon see, these objectives

limit the performance of the final

product, but we do produce a mouse.

No. 71 . April/May 1984

b y Rob ert LMartin W B2KTG

Not wishing to be inconvenienced

by the care and feeding of a live mouse,

I decided to start with the next best

thing. A rubber mouse from the local

pet store looked great. The mouse Ibought cost less than two dollars. As an

added bonus, my mouse was available

in several colors.

A quick incision on the mouse's

lower abdomen [no anesthetic

necessary) with my trusty Swiss Army

Knife and a control port was available

for interconnecting cable insertion. Iused a telephone extension cord

with modular end connectors. The

connector keeps the cable from pulling

Figure 2. Detailed Illustration of the mouse.

MICRO 29

Page 32: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 32/84

out of the control port. The other end of

the cable is secured to the computer

with a suitable length of masking tape.

The assembly and checkout are now

complete.

Operating Hints and Suggestions

The mouse, used in conjunction with

the intensity control on the monitor, is

useful for varying the brightness of thevideo display. When the mouse is used

with the contrast control, the user can

adjust the luminous intensity ratio

between the screen characters and the

background. A little experimentation

with the mouse will quickly

demonstrate its other capabilities.

One caution--feline quadrupeds

sometimes find the mouse interesting

also

Some method was needed to hold

the mouse between operating sessions.

While chatting with the manager of our

local hardware store, I mentioned the

project and my need. He suggested

something which appears to be almost

designed for the job. He called it a

/Itrap. /I That seems to be as good a

name as any. The trap can be fastened

to the monitor, the wall, or even to

your computer table.

Future Trends

One industrial espionage agent, whom

I have done some business with in the

past, furnished me with a photographhe took in the secret research and

development laboratories of a major

computer manufacturer. Reportedly,

their new interface will be named the

"Hippo.' IOne distinguishing feature of

this advanced controller will be the fact

that it is wireless. Presumably it

communicates with the computer via

infra-red or uses some kind of R.F. link.

I hope you will have as much fun

building and using the mouse as I did.

After the novelty wears off, it can

always be used as a decoy for your nextmouse hunt!

Robert Martin may be corresponded with

at 45 Salem Lane, Lit tle Silver, NJ 07739,

or by ham radio at WB2KTG.

30

Figure 3. Mouse and feline

Figure 4. Mouse and mouseholder, sometimes called "trap."

Figure 5. Secret photograph of possible successor to mouse,

alias Hippo, an advanced wireless controller.

MICRO No. 71 . April/May 1984

Page 33: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 33/84

Raise your Apple's IQ

e Tintes AYear!

AOne Year SubscriptionBrings You 12 Issues With:

Over $500 of Programs for your Home, Business, Education

and Entertainment. Complete Program Listings with

Instructions.

Comprehensive Articles that show what each program does,how to use it and how to type it into your Apple, Franklin ACEor

other Applesott-compatible computer.

Regular Features for the Beginner and Expert.

On The Scene

The Latest New Software/Hardware Releases.

Products! inside and Out

Comprehensive Product Reviews.

Education Corner

Programs that help make Learning Fun.

Tips 'N Techniques

Little known programming Tricks you can Use.

Disassembly LinesAn Expert reveals the mysteries of Applesoft.

Utilities

Superchargers for Basic, DOS, Printing, and More.

Games

Arcade Fun you can Type and Run.

Noteo Domestic U.S. First Class subscript ion rate is $51.95

o Canada Air Mail subscr ipton rate is $59. 95

o Out side the U.S. and Canada Air Mail subscri pti on rat e i s $89.95

All payments must be in U.S. funds drawn on a U.S. bank.

©1983 by MicroSPARC Inc. All Rights Reser ved.

Apple" is a regls1ered t rademark of Apple Computer, Inc.

ACE' 15 a regist ered trademark of Fr anklin Computer, tnc.

No. 71 - April/May 1984

T ry a NIBBL.E!

Here's what some of our Readers say:

o "Certainly the best magazine on the Apple!"

[] "Impressed '!Liththe quality and content."

o "Programs remarkably easy to enter "

o 'I'llbe a subscriber for life!"o 'Your service isfantastic ... as a matter of fact, I'm

amazed!"

T ry a NIBBLIE!

NIBBLEis focused completely on the Apple and

Applesoft-compatible computers.

Buy NIBBLEthrcugh your local Apple Dealer or subscribe now

with the Coupor: or Order Card in this issue.

You'll want Hack Issues Too!

Here are some examples of programs you can get:

The Investor-Stock Tracking, Reporting, and Graphing.

Recipe Box-Kitchen/Menu Management made Fun.

The Librarian--Auto Logging and Retrieval of your Disks.

Designer/Illustrator-Art/Design Creation and

Composition with Graphics,

Machine Language Editor- Quick and EasyA id for 'Iyping

and Changing M/L Programs.

And Much ... Much More!

NIBBLEwill become a permanent part of your Reference

Library. Discover why 95% of NIBBLE Readers save every issue:

Join more than UO,OOO Apple/Ace users who say:

"NIBBLE IS TERRIFIC!"

S U BS C R IB E N O W A N D S A V E $ 1 2 . 0 0 O F F T H E C O V E R P R IC E !

r - - - - - - - - - - . ,bbl· • ~n l a We accept Mast er Char ge & Visa II

Box 325, Lincoln, MA 01773 (617) 259-9710 II'll try nibble!

IEnc lo se d is m y $ :! 6. 95 ( fo r1 2 is su es ) I( Ilu ts ld e U .S ., s ee s pe cia l n ote o n t his p ag e.)

Icheck 0 money order 0 bill me (U.S. only) I

Your subscript ion wi. l begin with the next i ssue published af ter receipt of your

Iheck!moneyorder. ICard # Expires -----

Pl EASE PR INT CLEARLY

ISignature IName _

IAddress I

I~ Itate Zip _1. .1

MICRO 31

Page 34: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 34/84

Double Vision CatalogDouble Vision Catalog

forfor

40 or 80 Columns40 or 80 Columns

As more people buy Apple lie's, we will

be seeing more software using 80

columns. It is something to be

expected. One logical usage of an 80

column width is in the CATALOG

program, using the other half of thescreen for listing file information. In

the past, several DOS patches have

appeared in publications to display two

columns of file information for the

normal 40 column display. Although

we generally use short filenames, [we

hate typing), the patches did shorten

the amount of information sent to the

screen. Now with a full 80 columns

available, the complete file

information can fit in two columns of

40 characters each.

When you think of it, most people's

printers already have 80 or 132

columns, so why not have the

CATALOG use all the available space,

whether there are 40, 80, or 120. Why

not take it even one step further and

allow the CATALOG to shorten the

filenames when wanted, printing

multiple columns of files?

With these dreams, we set out to

work on the CATALOG command for

DOS. We were not only successful in

the results we produced, but

accomplished them with a patch that

32

by A /an and Vel/erie F/oeterby A /an and Va/erie F/oeter

merely replaces the original

CATALOG. This saved valuable patch

space needed for other DOS

enhancements already published.

So exactly what does this

CATALOG patch do? Well,it dependson the number of characters your

output device has and whether you use

it in the normal or shortened mode.

The chart in Figure 1summarizes t.ais.

Figure 1: Number of columns of

filenames displayed

COLUMNS

40 80 120

Normal 1 2 3

Shortened 2 4 6

If you use the normal CATALOG

mode, 40 characters of information are

displayed per filename. In the

shortened mode, 20 characters are

displayed per file,since the end of the

filename is chopped off. If you send a

CATALOG to an Apple II and App.e 11

Plus screen (40 column width), you'll

see either one or two files per line

depending on the mode. If you sent a

CATALOG to an Apple IIe (80 column

width), or an 80 column printer, such

MICRO

as an EPSON MX-80, you will see

either 2 or 4 column files. Many

printers have at least 120characters per

line, enabling them to produce 3 or 6

columns of file information.

How Was This Done?When the Apple screen receives 40

characters, it automatically does a

carriage return and line feed. We used

this feature when we developed our

CATALOG patch to DOS. Since the

screen will take care of its own carriage

returns, we just keep sending it

information without telling it where

the next line starts. This way the patch

doesn't have to know how many

columns the device has available. This

CATALOG command sends out either

20 or 40 characters per file name

continuously, and the printer or screen

decides how much will fit on each line.

This works well for screens, but

some printers or their interface cards

might not be set up to send out a

carriage return when their line is full.

There is usually a switch on the printer

or the interface to do this, or some

specified control sequence will

accomplish this. If you are unsure as to

how your system handles this, just

follow the suggestions we will give

later.

No. 71 . April/May 1984

Page 35: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 35/84

One nice side benefit of this patch is

that you don't need to do any POKE's

toset up the number of columns. When

you send out a CATALOG listing to

two devices at the same time you will

get different listings. For example, if

you have a 132 column printer and an

80 column card and then enter

"CATALOG", your screen will show

two columns of filenames, while your

printer will produce three columns.

Entering the Patch

We have written the assembly

language routine topatch DOSfor you.

Enter the program, either into an

assembler, or enter the opcodes, and

save it to disk. Whenever you wish to

have this patch in your DOS, BRUN

the program. This could be part of your

HELLO routine.

How to Shorten Filenames

When you want to shorten the

filenames to store more information on

the screen, enter POKE 44561,10 and

POKE 44592,2. This will print 20

characters per file. To reset it back to

the full 40 characters per file, enter

POKE44561,29 and POKE44592,3.

DOS Warning

We always like to warn people about

using a patched DOS. This patch

doesn't use any of the patch space used

by some of the other DOSimprovements, so you shouldn't have

any conflicts with other patches, but

we can't guarantee it. Although we

haven't had any problems, whenever

you change a standard you can't predict

if someone else assumed that part

would stay the same.

Conclusion

Now you can utilize the entire line for

CATALOG's, whether it is 40, 80 or

120 columns. Not only will you make

better use of your display area, but you

won't have to tell your device howmany columns you have.

No. 71 - Apri l/May 1984

Figure 2. Sample CATALOGs for 40 and 80 columns.

C A T A L O GD I S K V O L U " E 2 ' 5 4A 1 1 2 H E L L O

Normal 40 Column T 8 8 1 P R I N T E I ~Screen A 8 1 3 T E X T - T i l - F O C U S

A e e 3 F O C U S - T O - T E X TA 1 1 9 B U C H A N I \ NA 8 8 3 F O C U S I ~ E I IA 8 3 9 B U C H - 2B 1 5 4 " A S T E R D I R E C T O R Y . LA 0 8 3 N E N F O C U SB l I B " A S T E R D I R E C T O R YB . 8 9 " A S T E R D I R / D I S P L A Y . LT . . 1 H I L I S T I : R . " ST 8 8 B B O O T " 0 I ' 2A 1 2 7 F L Y N NA 0 2 7 " I C R O I I L RB 8 1 b F L O E T E I ~A 0 4 1 B U C H I]

D I S K V O L U " E 2 5 4 Normal 80 Column

A 8 8 2 H E L L O Printer

A 8 8 3 T E X T - T O - F O C U SA 1 1 9 B U C H A N A NA . 3 9 B U C H - 2A 8 1 3 N E i l F O C U SB 8 8 9 " A S T E R D I R / D I S P L A Y . LT 8 8 B B O O T " O N 2A 8 2 7 " I C R O " L RA 8 4 1 B U C H I

T 8 0 1 P R I N T E R

A 8 1 3 F O C U S - T O - T E X TA 8 8 3 F O C U S N E WB . 5 4 " A S T E R D I R E C T O R Y . LB 8 ' B " A S T E R D I R E C T O R YT I l l H I L I S T E R . " SA 8 2 7 F L Y N NB 8 1 b F L O E T E R

Shortened 80 Col umn PrinterC A T A L 0 6D I S K V O L U " E 2 5 4

A 8 8 2 H E L L OA 1 1 9 B U C H A N A NA 8 ' 3 N E i l F O C U S

T 8 8 8 B O O T " D N 2A 8 4 1 B U C H I]

T 8 8 1 P R I N T E RA 8 ' 3 F O C U S N E WB 8 1 B " A S T E R D I R E

A 8 2 7 F L Y N N

A i 8 3 T E X T - T D - F O CA 1 3 9 B U C H - 2B ' 8 9 " A S T E R D I R I

A ' 2 7 " I C R O " L R

A 8 8 3 F O C U S - T O - T EB 8 5 4 " A S T E R D I R ET 8 8 1 H I L I S T E R . " S

B 8 8 b F L O E T E R

Listing 1 , P A T C H F O R B I ~ O L U " N C A T A L 0 6 F O R D O S 3 . 3j

, B Y A L F L O E T E R

8 3 1 8 O R 6 S 3 1 1;

t l B S I N D E Q U S B S

8 ' B 7 C O L I N T E 9 U S S 7

8 3 i 8 A 2 8 . L D X 1 81 3 1 2 B D 2 b 1 3 L O O P L D A P A T C H , X1 3 1 5 F 8 I E B E Q D O N E1 3 1 7 B 5 S b S T A I N D + l G E T H I O R D E R1 3 . 9 E B I N X8 3 1 A B D 2 b 1 3 L D A P ~ T C H , X1 3 1 D B S B S S T A I N D S E T L O O R D E R8 3 . F E B I N X. 3 1 8 B D 2 b 8 3 L D A P A T C H , X I G E T C O U N T1 3 1 3 S 5 B 7 S T A C O U N T1 3 1 5 E B I N X8 3 1 b A 8 8 8 L D Y I S

MICRO 33

Page 36: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 36/84

FLIP Listing 1 8 3 1 S B D 2 6 8 3 D O l T L D A P A T C H , X ; S E T B Y T E O F P A T C H

SORT(continued) . 3 1 B 9 1 S 5 S T A ( I N D ) , Y ; P U T I T M H E R E I T G

PLUS™O E S8 3 1 D E S m

Smo ke a cr ylic 8 3 1 E C S I N Ye ig ht d iv id e rs . 3 1 F C 6 S 7 D E C C O U N T ; D O N E Y E T

h old s 1 10 d is ke tte s 8 3 2 1 D . F 5 B N E D O l T ; N O$ 8 3 2 3 F 8 D D B E Q L O O P ; Y E S

THE8 3 2 5 6 . D O N E R T S

FLIP

;

I P i n C H A R E A I N O R D E R O F I

PAK™ ; ~ D D R E S S O F M H E R E T O P U T I T

Smo ke a cr ylicj I ~ U I I B E RO F B Y T E S T O 1 I 0 V E

h old s 1 0 d is ke tte s I P A T C H I T S E L F

e as el b ac k s ta nd;

8 3 2 6 A D A S P A T C H B Y T . A D , . A S. 3 2 S 8 6 B Y T 6

HEAD . 3 2 9 E A N O P

CLEANINC8 3 2 A A 9 a D L D A u a D j O U T P U T C R

KIT8 3 2 C 2 8 E D F D J S R . F D E D

2 cle an in g d isks 8 3 2 F A D C 3 B Y T . A D , . C 3non-abrasive 8 3 3 1 8 6 B Y T 630 c le a n in g s 8 3 3 2 E A N O P

$1 . 3 3 3 A 9 S D L D A U S D ; O U T P U T C R8 3 3 5 2 8 E D F D J S R . F D E D

FLIP 8 3 3 S A D E B B Y T . A D , . E B

SORT™ 8 3 3 A 3 8 S Y T . 3 8

Smo ke a cry lic8 3 3 B A 8 8 7 L D Y 1 7

fiv e d iv id ers8 3 3 D 8 A S H [ F T A S L ; F I N D A B I T

ho lds 70 d isks8 3 3 E 3 . 8 3 B i l l G O T l T

$19.958 3 4 8 S S D E Y8 3 4 1 D . F A B N E S H I F T

THE . 3 4 3 B 9 A 7 B 3 G O T I T L D A ' B 3 A 7 , Y j G E T P R O G R A " T Y P E

PAPER8 3 4 6 2 8 E D F D J S R . F D E D ; O U T P U T I T

BOSSTM8 3 4 9 A 9 A 8 L D A U A . ; S P A C E8 3 4 B 2 8 E D F D J S R . F D E D

B otto m cla mp in g 8 3 4 E B D E 7 B 4 L D A ' B 4 E 7 , X36" flex ib le arm . 3 5 1 8 5 4 4 S T A . 4 4

b eig e s te el 8 3 S 3 B D E S B 4 L D A ' S 4 E S , X ; G E T S I Z E

$19.95 8 3 S 6 S 5 4 5 S T A . 4 58 3 S S 2 8 4 2 A E J S R . A E 4 2 ; O U T P U T I T

o YES ! P lease rush m e the 8 3 S B A 9 A 8 L D A U A 8 ; S P A C E

item s I've checked above ! I 8 3 5 D 2 8 E D F D J S R . F D E D

am enclos ing my check or 8 3 6 8 A 8 I D L D Y I U D ; F I L E H A i l E S I Z E I . A

Charge Card in fo rmation and F O R 4 A C R O

I unde rs tand tha t you 'll pay 8 3 6 2 B D C 9 B 4 O L D O P L D A ' B 4 C 9 , X ; G E T N A " E

the s hip pin g! 8 3 6 5 C 9 A ' C l i P U A . ; C O N T R O L C H A R A C T E R

CA LIF OR N IA R ES ID E NT S P LE AS E A DD S AL ES T AX8 3 6 7 B 8 8 2 B C S N O

Name. 3 1 1 9 A 9 A A L D A U A A j I I A K E I T A A S T E R I SK

street. ;' 3 6 B A E 2 1 N O B Y T . A E , . 2 1

C ity s tate 8 3 6 D 8 1 B Y T 1

Z ip __ Phone8 3 6 E F 8 B Y T . F .

~ Ea I : i i C I E31:iiC8 3 6 F A E 2 F B Y T . A E , . 2 F

HOM E BASE SUPPLY. 3 7 1 I S B Y T 5

4 22 S oq ue l A ve nu e8 3 7 2 A 2 8 3 L D X 1 3 ; 3 S P A C E S ( 2 F O R F O

~ San ta C ruz , CA 95062 U R A C R O S S )

1 '.1 \ ( 4 08 ) 4 5 8 -1 3 77 8 3 7 4 2 ' 4 A F 9 J S R . F 9 4 A8 3 7 7 II B Y T •

IN CA OUTS IDECA 8 3 7 8 E N D180Q)824-3252 ( 8 0 0 ) 8 2 4 -3 2 51

3 4 MICRO No. 71 - Apri I/M ay 1 9 84

Page 37: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 37/84

ANew Variationon an---

Old Theme: ReplaceYour 6502

There are probably a lot of computer.

enthusiasts out there who have waited

for a high-performance successor to the

trusty 6502. Enter Rockwell's new

CMOS 6502 product line. Although not

the ultimate successor to the "old"

6502, the R65COO family has manyenhancements you might find quite

interes ting.

New Features

This new family of CMOS

microprocessors comes in 3 models:

R65C02

R65C102

R65Cl12

All three will be available with your

choice of operating frequency:

2 MHz3 MHz

4 MHz

by Ron M. Battle

Each uses a single 5 volt ± 20%

power supply drawing only 4 rnA per

MHz. By stopping the input clock, the

processor will go into a standby mode

and dissipate only 10 uW of power. In

addition, 12new instructions are added

to the instruction set plus 2 newaddressing modes.

Processor Description

Figure 1 has the pinouts of these new

chips and, as you can see, the R65C02

and R65C102 are pin compatible with

the 6502.

R65C02: This is a direct

replacement for the 6502.

R65C102: This new chip has

functions on pins not used by the

original 6502. No external time base is

needed when a crystal is connectedbetween pins 35 and 37, but the crystal

frequency will be divided by four.

Alternatively, you can input a TTL

level single phase clock signal topin 37

(XTLI)for compatibility with the 6502.

Pin 3 (Phase 4) is a quadrature clock

output used for peripheral timing. This

output clock replaces the Phase 1 on

the 6502. Pin 4 (MLJ,memory lock, isan output used by arbitration circuitry

so read-modify-write instructions are

not interrupted by external devices. Pin

36 (BE),bus enable, allows an external

device to tri-state the data, address, and

R/W lines by pulling this pin low. The

R65C102 would be an interesting

substitute for the 6502 so direct

memory access (DMA) devices could

be implemented easily.

R65Cl12: Designed as a slave

processor, this model is used in

conjunction with the R65C102 for a

master-slave configuration. Pin 37(Phase 21 is the input clock derived

from the R65C102 Phase 2 output. This

F ig ure 1

R65C02 R65C102 R65C112

VSS 01 40 f-RES VSS 01 40 RES VSS 01 40 RE S

RO Y 02 39 r~,(out) ROY 02 39 %,(out) ROY 02 39 N.C.

(out)S1; 03 38 f- :.0 . (outv.r. 03 38 S.O. N.C. 03 38 S.O.

IRQ 04 37 %o(in) IRQ 04 37 XTU IRQ 04 37 .0,(in)

N.C. 05 36 rN.C. ML 05 36 BE ML 05 36 BE

NMI 06 35 f-N.C. NMI 06 35 XTLO NM I 06 35 N.C.

SYNC 07 34 f-RIW SYNC 07 34 R IW SYNC 07 34 RIWv c e 08 33 rOO v e c 08 33 DO v e e 08 33 D O

AO 09 32 f-01 AO 09 32 01 AO 09 32 01

A1 10 31 f-02 A1 10 31 02 A1 10 31 02

A2 11 30 r03 A2 11 30 03 A2 11 30 03

A3 12 29 f-04 A3 12 29 04 A3 12 29 04

A4 13 28 r05 A4 13 28 - 05 A4 13 28 05

A5 14 27 f-06 A5 14 27 06 A5 14 27 06

A6 15 26 r07 A6 15 26 07 A6 15 26 07

A7 16 25 rA15 A7 16 25 A15 A7 16 25 A1 5

A8 17 24 f-A14 A8 17 24 A14 A8 17 24 A1 4

A9 18 23 rA13 A9 18 23 A13 A9 18 23 A1 3

A10 19 22 f-A12 A10 19 22 A12 A10 19 22 A1 2

A1 1 20 21 rV55 A11 20 21 VSS A11 20 21 V5 5

No. 71 - April/May 1984 MICRO 35

Page 38: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 38/84

Peripheral Support

To round out the R65COO family,

Rockwell has also introduced two

CMOS peripheral chips, the R65C21

PIA and R65C24 PIA with timer. Both

are low power versions of the 6521

Peripheral Interface Adapter which

offers the user two 8-bit ports with

handshaking. In addition, the R65C24

has a 16 bit timer on board for use in

timing applications. Initially, twoversions will be offered, 1 MHz and 2

MHz.Things To Come

A high performance microcomputer

system could be built using the 4 MHz

R65C102, a DMA controller and fast

arithmetic processor chip. With its bit

manipulation instructions and low

power consumption, the R65C02 could

make a high performance controller

utilizing FORTH. With the read access

time of the 4 MHz processor being 168

nanoseconds, it will work with the

newer 6116 CMOS 150 ns. memorychips. In fact, my next project is

converting my Ohio Scientific 2 MHz

micro to 4 MHz operation with the

R65CI02. Talk about computing in the

FAST land!!!

chip has DMA capability like the

R65C102.Table 1

Mnemonic FunctionNew Addressing Modes

Branch on Bit Reset

Branch on Bit Set

Branch Always

Push X Register on Stack

Push Y Register on Stack

Pull X Register from StackPull Y Register from Stack

Reset Memory Bit

Set Memory Bit

Store Zero

Test and Reset Bits

Test and Set Bits

BBR

BBS

BRA

PHX

PHY

PLXPLY

RMB

5MB

STZ

TRB

TSB

Indexed Absolute Indirect: This new 3

byte instruction takes 6 machine cycles

to execute. The new opcode is C7H and

new mnemonic is JMP[IND),X. In

execution, the contents of the second

and third bytes are added to the Xregister. The effective address is

pointed to by this 16 bit result. This

addressing mode comes in handy when

you don't have room in zero page for a

table of jump vectors or if you have a

table of jump vectors in Read Only

Memory [ROM).

Indirect: This new 2 byte

instruction takes 5 or 6 machine cycles

to execute. The second byte of this

instruction is a zero page address. The

zero page address points to the effective

address, stored as low byte first, then

high byte. This new addressing mode

works with instructions ORA, AND,

EOR, ADC, STA, LDA, CMP, and SBC.

so that individual bits can be set [I) or

reset (0), and program branching can be

controlled by the status of each bit.

These instructions facilitate coding for

microprocessor based controller

applications. The BRA, branch always

instruction, is a handy tool for

designing relocatable code and saves

memory and machine cycles. The

PHX, PHY, PLX, PLY instructions save

memory and machine cycles,

especially when used for interrupt

processing. The STZ, store zero

instruction, simplifies coding and will

also save memory and machine cycles

compared with alternate techniques.

New Instructions

Table 1 gives an overview of the new

instructions. Most notable of these are

the bit manipulation instructions.

Most of these work on zero page bytes

For more information on the R65COO

family, contact: Rockwell International,

Electronic Devices, P.O. Box C, Newport

Beach, CA 92660; 714/833-4700.

ZANIMSYSTEMS

P.O. Box 4364Flint, Michigan 48504

(313) 233-5731

(313) 233-3125

WE CARRY MANY VIC AND APPLE PRODUCTS. PLEASE SEND FOR A CATALOGUE.

CP/M BOARD BARE BOARD $29.00

128K RAM*• COMPATIBLE WITH ALL SATURN SYSTEMS SOFTWARE' BARE BOARD $29.00

80 COLUMN BOARD*• COMPATIBLE WITH THE VIDEX VIDEOTERM WITH SOFTSWITCH BUILT IN •

BARE BOARD $29.00

BUILD YOUR OWN ]APPLE PERIPHERAL CARDS

AND SAVE UP TO 80%

ALL BOARDS HAVE SOLDER

MASKING, COMPONENT LAYOUT,

AND GOLD EDGE FINGERS

WE WILL SUPPLY

THE IC LIST FOR

ANY BOARD

APP_E 11 IS TRADEMARK OF APPLE COMPUTERS. INC

cpn~IS REGISTERED TRADEMARK OF DIGITAL RESEARCM. INC

VIDEX IS REGISTERED TRADEMARK OF VIDEX INC

Page 39: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 39/84

D D D S p e c Box: 16K C O C O D D D

Mike Hamilton

Requirements:Any TRS·80C Color Computer

Have you ever wished you could have

Extended BASICfor one day, just to see

what high-resolution was like?

Vhether in text or high-resolution, themany modes of the Color Computer are

generated by programs controlling the

VDG (Video Display Generator). The

graphics of Extended BASIC are

programs stored in the Extended ROM

chip. The program for high-resolution

can easily be written in BASIC or

assembly language, as illustrated by the

following programs.

Three programs are provided, each

accomplishing the same thing; high-

resolution. FAST is for those that like

fast, complex programs written in

assembly language. LOADER is aBASIC utility program that loads and

stores the FAST machine-code data.

The second program, SLOW, is written

in pure and simple, but slow, BASIC.

The third, and my favorite, isHYBRID,

combining the simplicity of BASICand

the speed of machine-code to create an

efficient compromise. Use whichever

you prefer, or use them all! Please note

that only HYBRID contains a

demonstration of the high-resolution.

How it Works

Certain steps must be taken toprogram

the VDG for proper functioning. Eachdistinct step is documented in all the

programs to help in understanding.

The first step in programming the

VDG is reserving memory. This can be

done via the clear statement. Line 10of

each program 'clears' the required

amount of memory. Since FAST is

actually entered by LOADER, it does

not require its own statement to

reserve memory.

The second step is setting the

proper values to the appropriate

registers. This is the subroutine labeled

'PMODE 4' in lines 700-800 of FAST,1000-1030 of SLOW, and 10000-10030

of HYBRID.

The third is clearing the screen or

video memory. Lines 640-690 of FAST,

10040 of HYBRID, and 1040 of SLOW

accomplish this. As you can see in

SLOW, this takes considerable time.

HYBRID implements a machine-code

subroutine that takes about 1I5 of asecond. This is the only distinction

between SLOWand HYBRID.

All that's left is plotting-setting,

resetting, and pointing of a dot. Each

can be implemented by various logical

operations. Prior to the plotting in

SLOW and HYBRID, the correct values

of X and Ymust be put in the Xand Y

variables. If, after calling the point

subroutine, the variable PT is not equal

to zero, then the point is set; else, it is

reset.

FAST uses a slightly differentapproach. Before plotting, one must

place the corresponding values of Xand

Y into Xval and Yval and set the SRP

register. The SRP (setlreset/point)

register must contain a zero to set, 255

to point, and any other value to reset.

If, after calling the point subroutine, P

reg contains 0, the point is reset;

otherwise, a value of 255 means it's

set.

Now you're ready to start

experimenting with high-resolution. I

recommend you use HYBRID, since it

includes a demonstration and is

considerably faster than SLOW. Try

experimenting, such as changing the

value of 248 to 240 in line 1020 of

SLOW and line 10020 of HYBRID. If

you're really ready to experiment, read

section 4 of Getting Started with Color

BASIC.

There are many other modes

waiting to be used. Some are

unavailable even through Extended

BASIC, such as 192 x 64 resolution

with 8 colors available at once. Good

luck.

Mike Hamilton is a 15year old computerist

who lives in the small town of Checotah,

Oklahoma, where the computer revolution

is just starting. He has slightly over 3 years

of programming experience and has never

had a formal programming class. His

equipment consists of an Extended Color

Computer with 16K, a tape recorder, and

small printer.

iii;;;;;;;;;;;;;~=====iiiiiii

1 H Y B R I D U S E A L L L I N E S E X C E P T I . 7 0 Y = I N T ( R t S I N ( ( 9 0 - I ) . I ) . S I N ( 9 0 - 1 ) + 9 6 )S L O N U S E A L L L I N E S E X C E P T . t1 0 C L E A R 2 5 5 , 1 0 2 2 7 ' R E S E R V E M E M O R Y 8 0 G O S U B 1 0 0 5 ( 1 : N E X T I1 9 ' R E A D A N D S T O R E B I T P A T T E R N S 9 0 G O T O 9 02 0 F O R 1 = 0 T O 7 : R E A D A : V L ! I ) = A : N E X T I 9 9 9 8

,P M O D E 4 S U B R O U T I N E. . 2 9 ' R E A D A N D S T O R E C L S S U B R O U T I N E 9 9 9 9 ' S E T O F F S E T V A L. . 3 0 F O R 1 = 1 0 2 2 8 T O I 0 2 3 9 : R E A D A : P O K E I , A : N E X T I 1 0 0 0 0 P O K E 6 5 4 8 7 , O : P O K E 6 5 4 8 3 , O : P O K E 6 5 4 8 0 , 0

3 5 S O S U B I O O O O : S O S U B 1 0 0 4 0 1 0 0 0 9 IS E T V D G f l E GI S T E R4 0 P I = 3 . 1 4 1 5 9 : R = 8 0 1 0 0 1 0 P O K E 6 5 4 7 2 , O : P O K E 6 5 4 7 5 , O : P O K E 6 5 4 7 7 , 05 0 F O R 1 = 0 T O 2 t P I S T E P P I / 3 3 0 1 0 0 1 9 ' S E T C O N T f ! O L R E G I S T E R6 0 X = I N T ( R * S I N ( ( 9 0 - ! ) * B ) * S I N ( ! ) + 1 2 8 ) 1 0 0 2 0 P O K E 6 5 3 1 4 , ( P E E K ( 6 5 3 1 4 ) A N D 7 ) O R 2 4 8

No. 71 - Apri l/May 1984 MICRO 37

Page 40: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 40/84

1 0 0 3 0 R E T U R N 2 7 B O 3 9 S T O P R T S1 0 0 3 9 ' P C L S S U B R O U T I N E

. * 1 0 0 4 0 E X E C 1 0 2 2 8 : R E T U R N 2 7 B I 3 5 0 2 S E T P U L S A

. 1 1 0 0 4 0 F O R 1 = 1 0 2 4 0 T O 1 6 3 8 3 : P O K E I , O : N E X T I : R E T U R N 2 7 8 3 A A 8 4 O R A , X

1 0 0 4 9 ' S E T S U 8 R O l . l T IN E 2 7 B 5 A 7 8 4 S T A , X

1 0 0 5 0 S O S U 8 1 0 0 e O : P O K E L C , P E E K ( L C ) O R V L : R E T U R N 2 7 8 7 3 9 R T S1 0 0 5 9 ' R E S E T S U 8 R O U T I N E1 0 0 6 0 S O S U B 1 0 0 S O : P O K E L C , ( P E E K ( L C ) A N D ( N O T V L ) ) : 2 7 8 8 3 5 0 2 P O I N T P U L S A

R E T U R N 2 7 B A A 4 8 4 A N D A , X1 0 0 6 9 ' P O I N T S U B R O U T I N E 2 7 8 C 2 7 0 6 B E Q O F F

1 0 0 7 0 B O S U S 1 0 0 B O : P T = P E E K ( L C ) A N D V L : R E T U R N 2 7 B E B b F F L O A U F F1 0 0 8 0 L C = 1 0 2 4 0 + ( Y I 3 2 ) + I N T ( X / 8 ) 2 7 C O B 7 2 7 F O S T A P R E S1 0 0 B 5 V L = V L ( 7 " ( X - I N T ( X / B ) * B ) ) : R E T U R N 2 7 C 3 . 3 9 R T S1 0 0 9 0 D A T A 1 , 2 , 4 , 8 , 1 6 , 3 2 , 6 4 , 1 2 B

II 1 0 0 9 5 D A T A 7 9 , 1 4 2 , 4 0 , 0 , 1 6 7 , 1 2 8 , 1 4 0 , 6 4 , 1 , 3 8 , 2 4 9 , 5 7 2 7 C 4 4 F O F F C L R A2 7 C 5 8 7 2 7 F D S T A P R E G

2 7 C B 3 9 R T S

2 7 6 A

2 7 b A 8 b

2 7 b O 8 12 7 6 F 2 22 7 7 1 C C2 7 7 4 F O2 7 7 7 F 6

2 7 7 A 8 62 7 7 C 3 D

2 7 7 0 F 32 7 8 0 F O2 7 8 3 F 62 7 8 b C 42 7 8 8 4 F2 7 8 9 I F2 7 8 B F 62 7 8 E 5 42 7 B F 5 42 7 9 0 5 42 7 9 1 F 32 7 9 4 F O

2 7 9 7 A 62 7 9 9 3 42 7 9 D 8 E2 7 A O B 62 7 A 3 2 72 7 A 5 8 12 7 A 7 2 7

2 7 A 9 3 52 7 A B 4 32 7 A C A 42 7 A E A 7

S T O R E 2 5 5 I F O N

S T O R E 0 I F O F F

I M I K E H A M I L T O NI H Y B R I D

* A P R I L / M A Y 1 9 8 4 I S S U E 7 1I B I T P A T T E R N S

I

I S Y S T E M E Q U A T E S2 7 C 9 B O 4 0 2 0 1 0 D A T A F C B 1 2 8 , 6 4 , 3 2 , 1 6 , 8 , 4 , 2 , 1

I 2 7 C D 0 8 0 4 0 2 0 1

2 7 F A L O C E Q U 1 0 2 3 42 7 F C S R P E Q U 1 0 2 3 b 2 7 0 1 4 F C L S C L R A

2 7 F D P R E S E Q U 1 0 2 3 72 7 0 2 8 E 2 8 0 0 L O X * 1 0 2 4 0

2 7 F E X V A L E Q U 1 0 2 3 82 7 0 5 A 7 8 0 L O O P S T A , X + C L E A R T H E S C R E E N R A M

2 7 F F Y V A L E Q U 1 0 2 3 9 2 7 0 7 8 C 4 0 0 1 C M P X * 1 6 3 B 5 T E S T F O R E N D2 7 0 A 2 b F 9 B N E L O O P C O N T I N U E

O R S $ 2 7 b A 2 7 0 C . 3 9 R T S D O N E

2 7 F F P L O T L O A Y V A L C H E C K F O R I N V A L I D C O D E 2 7 0 0 B b F F 2 2 P H O O E 4 L O A 6 5 3 1 4

9 F C M P A 1 1 9 1 2 7 E O 8 7 F F C F S T A 6 5 4 B 7 S E T O F F S E T V A L

3 F B H I S T O P R E T U R N I F S O 2 7 E 3 8 7 F F C B S T A 6 5 4 B 3 O F F S E T

2 8 0 0 L D D 1 1 0 2 4 0 2 7 E 6 8 7 F F C 8 S T A 6 5 4 8 0 O F F S E T

2 7 F A S T D L O C S T O R E O F F S E T 2 7 E 9 8 7 F F C O S T A 6 5 4 7 2 S E T V O S R E S I S T E R

2 7 F F L D B Y V A L2 7 E C B 7 F F C 3 S T A 6 5 4 7 5 V O S R E G I S T E R

2 0 L D A * 3 2 2 7 E F 8 7 F F C 5 S T A 6 5 4 7 7 V . D S R E G I S T E RM U L F I N D Y B Y T E 2 7 F 2 8 4 0 7 A N O A 1 7 S E T C O N T R O L R E G I S T E R

2 7 F A A D D O L O C2 7 F 4 B A F 8 O R A 1 2 4 B

2 7 F A S T D L O C2 7 F 6 8 7 F F 2 2 S T A 6 5 3 1 4

2 7 F E L O B X V A L 2 7 F 9 3 9 R T S

0 7 A N O S * 7 F I N D I N D E X V A L U EC L R A

E N D

0 1 T F R D , X2 7 F E L O B X V A L

L S R B F I N D X B Y T EL S R B 1 ' F A S T L O A D E R

L S R B 1 0 C L E A R 2 ~ 5 , 1 0 0 8 9

2 7 F A A D D O L O C 2 0 F O R 1 = 1 C 0 9 0 T O 1 0 2 3 3 : R E A D A : P O K E I , A : N E X T I

2 7 F A S T D L O C 3 0 D A T A 1 8 i , 3 9 , 2 5 5 , 1 2 9 , 1 9 I , 3 4 , 6 3 , 2 0 4 , 4 0 , 0 , 2 5 3 , 3 9

8 9 2 7 C 9 L O A D A T A , H E T C H B I T P A T T E R N 4 0 D A T A 2 5 C , 2 4 6 , 3 9 , 2 5 5 , 1 3 4 , 3 2 , 6 1 , 2 4 3 , 3 9 , 2 5 0 , 2 5 3 , 3 90 2 P S H S A S T O R E O N S T A C K 5 0 D A T A 2 5 ( , 2 4 6 , 3 9 , 2 5 4 , 1 9 6 , 7 , 7 9 , 3 1 , 1 , 2 4 6 , 3 9 , 2 5 4 , 8 4

2 7 F A L O X L O C L O A D 8 Y T E V A L L I E 6 1 ) D A T A 8 4 , 8 4 , 2 4 3 , 3 9 , 2 5 0 , 2 5 3 , 3 9 , 2 5 0 , 1 6 6 , 1 3 7

2 7 F C L O A S R P C H E C K S E T / R E S E T / P O I N T 7 0 D A T A 3 9 , 2 0 1 , 5 2 , 2 , 1 9 0 , 3 9 , 2 5 0 , 1 8 2 , 3 9 , 2 5 2 , 3 9 , 1 2 , 1 2 9

O C B E Q S E T I F ° T H E N S E T 8 0 D A T A 2 5 ~ , 3 9 , 1 5 , 5 3 , 2 , 6 7 , 1 6 4 , 1 3 2 , 1 6 7 , 1 3 2 , 5 7 , 5 3 , 2

F F C M P A U F F 9 0 D A T A 1 7 ( , 1 3 2 , 1 6 7 , 1 3 2 , 5 7 , 5 3 , 2 , 1 6 4 , 1 3 2 , 3 9 , 6 , 1 3 4

O F B E Q P O I N T I F 2 5 5 T H E N P O I N T 1 0 0 D A T A m , 1 8 3 , 3 9 , 2 5 3 , 5 7 , 7 9 , 1 8 3 , 3 9 , 2 5 3 , 5 7 , 1 2 8 , 6 4 , 3 21 1 0 D A T A 1 6 , 8 , 4 , 2 , 1 , 7 9 , 1 4 2 , 4 0 , 0 , 1 6 7 , 1 2 8 , 1 4 0 , 6 4 , 1 , 3 8

0 2 R E S E T P U L S A E L S E , R E S E T 1 2 0 D A T A 2 4 ~ , 5 7 , 1 8 2 , 2 5 5 , 3 4 , 1 8 3 , 2 5 5 , 2 0 7 , I B 3 , 2 5 5 , 2 0 3

C O H A 1 3 0 D A T A 1 8 ~ , 2 5 5 , 2 0 0 , 1 8 3 , 2 5 5 , 1 9 2 , 1 8 3 , 2 5 5 , 1 9 5 , 1 8 3 , 2 5 5

8 4 A N O A , X 1 4 1 ) D A T A 1 9 7 , 1 3 2 , 7 , 1 3 8 , 2 4 8 , 1 8 3 , 2 5 5 , 3 4 , 5 7

8 4 S T A , X

MICRO No. 71 - April/May 19848

Page 41: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 41/84

• Gives names and locations of various Monitor,DOS, Integer BASIC and Applesoft routines andtells what they're used for• Lists Peeks, Pokes and Calls in over 2000memory locations

• Allows easy movement between BASIC andMachine Lanquaqe• Explains how to use the information for easier,better, faster software writing

This famous book now contains the most comprehensive description of firmwareand hardware ever published for the whole Apple 1 / family. A new section withguide, atlas and gazeteer now provides Apple lie specific lntormatlon.

This expanded edition is available at the new low price of only $19.95

For the 35,000 people who already own previous editions,the lie Appendix is available separately for just $5.00.

Page 42: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 42/84

Easy DOES·IT(Not DOSPLUS)

Part 4

by M ichael Keryan

DOES·IT .. Add new utillity

functions to a Commodcne64 by use of the RESTORE

key.

Editor's Note: It has been brought to our attention that Micro SystemSoftware, Inc. has manufactured a software package under the trademark ofDOS PLUS since 1981.We wish to make it clear that the programs included in'the four parts of this article are in no way related to that product and that, had

we been aware of the product, we would not have allowed the use of the name.To avoid further infringement on the trademark in question, we have renamed

the series "DOES-IT," because in almost any case, no matter what utility yourC-64 needs, this program "does-it".

This article adds two new functions to

the recently published utility program

(improperly named DOSPLUS in

previous issues). The first is a program

that allows BASIC programs to be

hidden under ROM and swapped with

the currently active BASIC program.

The second is a time and alarm routine.

This is the fourth in a series of

articles in which a number of machine

language utility programs have been

added to a Commodore 64. To access

these utilities, you press the RESTORE

key, which generates a Non-Maskable-Interrupt. The next key pressed

determines which utility program is to

be run.

The series of programs reside in

unused RAM starting at location

$C800. Called DOES-IT, they can be

loaded and initialized at the same time

as the DOS WEDGE [located at

$CCOO).In addition to the permanent

utilities, additional transient programs

can be called in from 'hidden' RAM

located in the same address space as the

40

BASIC ROM ($AOOO-$BFFF) and

executed at $COOO.

The framework was given to a.low

anyone experienced with machine

language programming to add their

own routines and assign unique keys to

access them. However, what if you

have a BASICprogram that you would

want instant access to? If we can tuck

away machine language program> in

hidden RAM, why can't we do the same

thing with our BASICprograms!

Hidden BASIC Programs

From the viewpoint of the computer's

memory cells, a BASICprogram is not

much different than a machine

language program; they both consist of

a lot of 8 bit binary numbers. The

procedure illustrated here can be used

to store any BASIC program into

hidden memory, provided that it can fit

into this area. The hidden program is

pulled out by the RESTORE key,

followed by the left arrow key. In

MICRO

addition to pulling out this program,

the BASIC program curren tly in

memory is transferred to the same area

of hidden RAM--the two programs

exchange places. Therefore, the

RESTORE, left arrow sequence can be

used to toggle between two completely

different BASICprograms.

Listing 1 is a BASICprogram called

DIRECTORY.PRINT that we will use

to demonstrate hiding BASIC

programs. The program is quite handy

for producing compact directory

listings on the printer. The directoryentries can be listed as-is (unsorted) or

sorted in alphanumeric order. The

number of columns for the listing can

be changed from the default of 3 by

changing line 1. Using three columns

(with the compressed mode of a

printer) allows the listing to be small

enough to be cut out and taped to the

front of a diskette jacket.

To store this program (or any other

BASIC program), proceed as follows.

First (with DOES-IT activated) load the

No. 71 . April/May 1984

Page 43: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 43/84

Listing 1

o : R E M M . J . K E R { A N 1 1 - 1 2 - 9 31 : R E M M I C R O # 7 1 - A P R I L 1 9 8 4, \ : R E M

9 : ~ I D T H = 3 : W D = W H : R E M W I D T H = C O L U H N S

1 0 D A T A " " * * * * ' . * * * * * . * ' * * * * * * * * * * * ' * *2 0 D A T A " * *3 0 D A T A " . D I R E C T O R l P R I N T E R •4 0 D A T A " . *5 0 D A T A " • • • • • • * . * * * * * * * . * . * • • • • • * * * • • •6 0 D A T A " * •6 5 D A T A " . ' S S O R T E D ' U ' U N S O R T E D *7 (1 D A T A " . ' N N O P R I N T ' Q ' Q U I T •

8 0 D A T A " ' *9 0 D A T A · • • * * • • • * • • • • • • • * • • • • • • • • * * * * • •1 0 0 P O K E 5 3 2 8 0 , 1 3 : P O K E 5 3 2 8 1 , 7 : P O K E 6 4 6 . 0 : D I M B $ ( 1 0 0 )1 1 0 F O R J = I T O 1 0 : R E A D A $( /): N E X T1 2 0 P R I N T " { C L E A R , D O W N 6 ) " : J = O : F O R I = I T O 1 0 0 :

9 $ ( ! ) = " " : N E X T1 3 0 F O R I = I T O 1 0 : P R I N T ' ( R V S ) " A $ ( ! ) " ( R V S O F F ) ' :

N E X T1 4 0 G E T 0 $ : I F 0 $ ) " " T H E N 1 4 1 )1 5 0 G E T O f : I F Q $ = " " T H E N 1 5 0

1 6 0 I F Q $ = " Q " T H E N C L O S E 1 5 : P R ! N l " { C L E A R ) " : E N D1 7 0 I F Q $ { ) " S " A N D Q $ ( ) " U " A N D Q $ ( ) ' N " T H E N 1 2 02 0 0 P R I N T " ( C L E A R ) ( R V S , S P A C E , 3 2 , R Y S O F F ) " : Z = - I2 1 0 B O S U S B 8 02 8 0 G E T # 1 , A $ , B $

2 9 1) G E H l . A $ , B t3 0 1 ) G E T # I , A $ , B $3 1 0 C = O3 2 0 I F A $ ( ) ' " T H E N C = A S C ( A $ )3 3 0 I F 9 $ ( ) " " T H E N C = C + A S C ( B $ ) * 2 5 63 4 0 Z $ = H I D $ i S T R $ ( C ) , 2 )3 5 0 I F L E N ( Z $ ) ( I T H E N Z $ = " "3 6 0 I F L E N ( Z $ ) = 1 T H E N Z $ = " " + Z $3 7 0 I F L E N ( Z $ ) = 2 T H E N Z $ = " " + Z $

3 8 0 B $ ( J ) = " " + Z $ + " " + C H R $ ( 3 4 )390 L Z = O4 0 0 G E T t I , B $ : I F S T O O T H E N G O T O 5 1 04 1 0 I F B $ O C H R $ ( 3 4 ) T H E N 4 0 04 2 0 G E T # I , B $ : I F B $ ( ) C H R $ ( 3 4 ) T H E N B $ ( J ) = B $ ( J ) + B $ :

L Z = L Z + I : G O T O 4 2 04 3 0 G E U l . B $ : I F B $ = C H R $ (32) T H E N 4 3 04 4 0 B $ ( J ) = B $ ( J ) + C H R $ ( 3 4 ) : I F L Z ) 1 5 T H E N 4 6 04 5 0 F O R J Z = L Z T O 1 5 : B $ ( J ) = B S ( J ) + " " : N E X T J Z4 6 0 C $ = " "4 7 0 C $ = C $ + B $ : G E m , 9 $ : I F 8$0"" T H E N 4 7 04 8 0 S S = S T : B $ ( J ) = B $ ( J ) t L E F T $ ( C $ , 3 )4 9 0 P R I N T " { R V S } " B $ ( J ) " C R Y S O F F ) " : J = J + I5 0 0 I F S S = O T H E N 2 9 0

5 1 0 B $ ( J ) = L E F U ( B $ ( J ) , L E N ( B $ ( J ) ) - I H " B L O C K S F R E E . "5 2 0 P R I N T " ( R V S } ' B $ ( J ) " ( R Y S O F F } " :

C L O S E 1

5 3 0 I F Q $ ( ) ' N ' T H E N 5 7 05 4 0 G E T Q $ : I F 9 $ > " " T H E N 5 4 05 5 1 ) G E T Q $ : I F 9 $ = ' l H T H E N 5 5 05 6 0 G O T O 1 2 05 7 0 I F Q $ = " U " T H E N 6 8 05 8 0 L 8 = 25 9 0 F O R I I = J - l T O L B S T E P - 16 0 1 ) I F H I D $ ( B $ ( I I - i ) , 7 , 1 5 ) < = M I D $ ( B W I ) , 7 , 1 5 ) T H E N 6 5 0

6 1 0 E U = B W I )6 2 0 B W I l = B W I - I)

6 3 0 8 $ ( 1 1 - 1 ) = E U6 4 0 F X = I I6 5 0 N E X T I I6 6 0 I F L B = F X + I T H E ~ 6 8 06 7 0 L B = F X + I : G O T O 5 9 06 8 0 O P E N 4 . 4b 9 0 P R I N T I 4 : R E M P R I N T T H E H E A D E R7 0 0 P R I N T I 4 , B $ ( 0 )

7 1 0 R E M T H E N E X T C O M M A N D S S E N D S C O N T R O L T O P R O W R I T E R7 1 5 R E M O R N E C - 8 0 2 J P R I N T E R S T H R U T Y M A C ' C O N N E C T I O N7 2 0 R E M T O S W I 1 C H -0 C O N D E N S E D M O D E A N D W I D E L I N E S7 3 0 I F W I ) 2 T H E N P R I N T * 4 , C H R $ ( 2 7 ) C H R $ ( 2 7 ) " Q " ; :

R E M C O N D E N S E D U O D E F O R > 2 C O L .7 4 1 ) I F W I ) 3 T H E N P R I N T * 4 , C H R $ ( 2 7 ) " N " C H R $ ( 1 3 2 1 ! :

R E M W I D E L I N E S T O P R E V E N T C R ' S7 5 0 R E M N O W P R I N T T H E D I R E C T O R Y; 6 0 R N = I N T ( ( J + l I D ) ! N i l7 7 0 F O R 1 = 1 T O R W : F O R N = I T O W I7 8 0 I F ( I + ( W - I , * R W ) > J T H E N P R I N H 4 . " { S P A C E 2 6 } " ; :

G O T O 8 0 07 9 0 P R I N T . 4 , B $ ( 1 + ( W - I ) ' R N ) ;

8 0 0 N E X T W : P R I N T . '8 1 0 N E X T I8 2 0 P R I N U 48 3 0 R E M S W I T C H P R I N T E R T O N O R M A L8 4 0 I F W I ) 2 T H E N P R I N T * 4 , C H R $ ( 2 7 ) C H R $ ( 2 7 ) " N " ; :

R E M I J N C O N D E N S E t '8 5 0 I F W I ) 3 T H E N P R I N T . 4 , C H R $ ( 2 7 ) " W " C H R $ ( B O ) ; :

R E M B A C K T O 8 0 C O L U M N L I N E8 6 0 C L O S E 48 7 0 G O T O 1 2 08 8 0 C L O S E 1 5 : O P E N 1 5 , 8 , 1 58 9 0 O P E N 1 , 8 , 0 , " $ 0 "9 0 0 I N P U T t 1 5 , E I , E 2 S , E 3 , E 49 1 0 I F E I ) O T H E N P ~ I N T " ( C L E A R , D O W N I O . S P A C E I 2 } ' E 2 $ :

C L O S E I: G O T O 9 3 0n o R E T U R N9 3 0 G E T N $ : I F N $ > ' " T H E N 9 3 09 4 0 G E T N $ : I F W $ = " " T H E N 9 4 09 5 0 6 0 T O 8 9 1 )

Listing 2

C O O O O R G $ C O O O.,0 0 0 1 R 6 5 1 D E Q U $ 0 1 : R O M S W I T C H0 0 2 0 V A R I A B E Q U $ 2 D ; V A R . P O I N T E R0 l ) C 6 N D X E Q U $ C 6 : K B D B F C O U N T0 2 7 7 K E n E Q U $ 0 2 7 7 ; K B D B U F F E R

C B 4 1 ~ E S E A 6 E Q U $ C B 4 1 j M E S S A G E P R I N TC B B O B f L M E Q U $ C B a D : F L A G;

C I ) O O A D B E c a B A S ~ I A P L D A B F L A 6 + l :1 5 F L A G = O 'C 0 0 3 C 9 0 0 C M P U O O

C 0 0 5 0 0 1 4 B N E S P E C L : N O . B R A N C HC O l ) 7 A 6 2 D L D X V A R T A B ; Y E S , O R I G P G M

C 0 0 9 8 E B D C 8 S T X B F L A G j V A R P O I N T E R

C O O C A 6 2 E L O X V A R T A B + I ; S A V E I T

C O O E 8 E B E C B S T X B F L A G + lC O l l E O 1 4 C P X * 2 0 ; (2Ij~'

C l l l , 3B O I S B C S S W A P S ; N G . L E A V E P N T RC 0 1 5 A 9 1 4 L D A * 2 0 ; Y E S , E X P A N D

No. 71 - April/May 1984 . MICRO 41

Page 44: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 44/84

C O l 7 8 5 2 E S T A V A R T A B + I Listing 3

C O l 9 D O O F B N E S W A P S ; B R A N C H A L W A Y SC O I B A E B D C B S P E C l l O X S F l A G ; 6 E T B A C K F L A G 0 3 4 0 O R S $ 0 3 4 0

C O l E 8 6 2 0 S I X V A R T A B ; R E 5 T O R E P N T R ;

C 0 2 0 A E B E C B l O X B F l A G + ! 0 . 3 1 4 C I N V E Q U $ 0 3 1 4

C 0 2 3 8 6 2 E S T X V A R T A B + I 0 4 2 0 T I M D I S E G U $ 0 4 2 0

C I ) 2 5 A 9 0 0 l O A 4 $ 0 0 ; S E T F L A G O Q 2 0 B O R D E R E G U $ 0 0 2 0

C 0 2 7 8 0 B E C B S T A B F l A G + I 0 2 8 6 C O L O R E g U $ 0 2 8 6

C 0 2 A A 9 A 7 S W A P B l O A U A 7 ; M A K E S U R E 0 4 1 8 S I O V O l E G U $ 0 4 1 8

C 0 2 e 8 0 4 7 C I ) S T A B A S I + 2 ; T H A T R O U T I N E 0 8 2 0 O I S C l R E G U $ D 8 2 0

C f ) 2 F 8 0 4 E C O S T A B A S 2 + 2 ; I S S E T - U P I N

D e 0 8 T E N T H S E G U $ O C 0 8

C 0 3 2 A 9 0 8 l D A # $ 0 8 ; C A S E O F R E E N T R Y O C 0 9 S E C S E G U T E N T H S + I

C 0 3 4 8 0 4 B C O S T A R A M ! + 2 O C O A M I N S E G U T E N T H S + 2

C 0 3 7 8 0 5 2 C O S T A R A H 2 + 2 O C O B H O U R S E G U T E N T H S + 3

C O . 3 A 7 8 S E I ; N O W S W A P O C O D C I A I N T E G U T E N T H S + 5

C 0 3 B A 5 0 1 l O A R 6 5 1 0 j

C O . 3 0 2 9 F E A N D U F E 1 ) . 3 4 0A D 0 0 D C T I M I R G l O A C I A I N T

C 0 3 F 8 5 0 1 S T A R 6 S I 0 0 3 4 3 2 9 0 4 A N D U 0 4

C I ) 4 1 A O O B l D Y # 1 1 ; I I B L O C K S 0 · 3 4 5 F O 0 3 B E Q B E G I N

C 0 4 3 A 2 0 0 l O X 1 $ 0 0 1 ) . 3 4 78 D F A 0 3 S T A A l F L A G

C 0 4 5 B O 1 ) 1 ) A 7 B A S I l O A $ A 7 0 0 , X 0 3 4 A A D F A 0 3 B E G I N l O A A l F l A G

C 0 4 8 4 8 P H A 0 3 4 0 F O 2 0 B E Q O I S T I M

C 0 4 9 B O 1 ) 1 ) 0 8 R A M I l O A $ 0 8 0 0 , X 0 3 4 F 8 0 F 9 1 ) 3 S T A D I S P F l

C 0 4 C 9 0 0 0 A 7 B A S 2 S T A $ A i O O , X 0 3 5 2 A 5 A 2 L D A $ A 2

C 0 4 F 6 8 P l A 0 3 5 4 6 A R O R AC 0 5 0 9 0 0 0 0 8 R A M 2 S T A $ 0 8 0 0 , X 0 3 5 5 6 A R O R A

C 0 5 . 3 E 9 I N X 0 3 5 6 6 A R D R A

C 0 5 4 D O E F B N E B A S I 0 3 5 7 2 9 O C A N D U O C

C 0 5 6 E E 4 7 C O I N C B A S 1 + 2 0 3 5 9 8 0 2 0 D O S T A B O R D E R

C 0 5 9 E E 4 E C O I N C B A S 2 + 2 0 3 5 C 2 9 C 4 A N D # $ 0 4

C 0 5 C E E 4 B C O I N C R A H I + 2 0 3 5 E 8 D 1 8 0 4 S T A S I O V O l

C O S F E E 5 2 C O I N C R A H 2 + 2 0 3 6 1 A 5 ( 5 l D A $ C 5

C I ) 6 2 8 8 D E Y 0 3 6 3 C 9 C 4 C M P # $ 0 4

C 0 6 3 D O E O S N E B A S I 0 3 6 5 D O ( 8 B N E O I S T I M

C 0 6 5 A 5 0 1 l O A R 6 5 1 ! ) : R E S T O R E B A S I C 0 3 b 7 A 2 C O l O X # $ 0 0

C 0 6 7 0 9 0 1 O R A U O I 0 3 6 9 8 E f A 0 3 S T X A l F l A G

C 0 6 9 8 5 0 1 S T A R 6 5 1 0 0 3 6 C 8 E F 9 0 3 S T X O I S P F L

C 0 6 B 5 8 C L l 0 3 6 F A D F 9 0 3 O I S T I N L O A D I S P F L

C 0 6 C 2 0 4 1 C B J S R H E S S A 6 0 3 i 2 F O ~ , ! ) B E Q T I H R E TC 0 6 F 9 3 B Y T $ 9 3 0 3 7 4 A D ( 1 9 D C L O A H O U R S

C 0 7 0 2 0 2 0 2 0 A S C ' P R E S S 0 3 7 7 A A T A X

C 0 8 1 1 2 B Y T $ 1 2 0 3 7 8 2 9 O F A N D U O F

C 0 8 2 5 2 4 5 5 4 A S C ' R E T U R N ' 0 3 7 A I B C L C

C 0 8 8 9 2 B Y T ' $ 9 2 0 3 7 B 6 9 : ; 0 A D C 1 $ 3 0

C 0 8 9 2 0 5 4 4 F A S C ' T O R U N ' 0 3 7 D 8 0 ; ~I 0 4 S T A T I M D I S + J

C 0 9 0 O D 4 3 4 C B Y T $ O D , $ 4 3 , $ 4 C , . 5 2 . $ O D 0 3 8 0 8 A T X A

C 0 9 5 ! 1 I I 5 2 B Y T $ I I , $ I I , $ 5 2 , $ 5 5 , $ 4 E , $ 9 1 , $ 9 I , $ 0 0 3 8 I 1 0 0 4 B P l l B l A

C 0 9 0 A 9 2 0 l D A U 2 0 0 3 8 3 A 2 ' : L D X WO

C I ) 9 F 8 0 n 0 2 S T A K E r O 0 3 8 5 1 0 0 2 B P l L e l a

C O A 2 A 9 2 0 l O A 1 $ 2 0 0 3 8 7 A 2 1 ) 1 L E L A l D X U O I

C O A 4 8 0 7 8 0 2 S f A K E Y O + I 0 3 8 9 B E : ! 6 0 4 L B l B S I X T I M O I S + 6

C O A 7 A 9 2 0 l D A U 2 1 ) 0 3 8 C A 2 : 1 0 l O X 1 $ 2 0

C O A 9 8 D 7 9 1 ) 2 S T A K E Y O + 2 0 3 8 E 2 9 . 1 0 A N D U I OC O A C A 9 1 3 L O A U 1 3 ; S T O R E S O N E 0 3 9 0 F O 1 ) 2 B E Q l B l C

C I ) A E 8 0 7 A 0 2 S T A K E Y D + 3 ; S T U F F I N T H E 0 3 9 2 A 2 :! J l D X 1 $ 3 1

C O B I A 9 I I l O A 1 $ 1 1 ; K E Y B O A R D 0 3 9 4 8 E 2 0 0 4 l B l C S T X T I M D I S

C I ) B 3 8 0 7 8 0 2 s r A K E Y D + 4 ; B U F F E R 0 3 9 7 A D I ) A D C L D A M I N S

C O B 6 A 9 O D l D A n O D 0 3 9 A A A T A X

C O B 8 8 0 7 C 0 2 S T A K E Y D + 5 0 3 9 9 2 9 O F A N D U O F

C O B B A 9 0 6 l O A # $ 0 6 0 3 9 0 6 9 ~ o A D C 1 $ 3 0

C O S D 8 5 C 6 S T A N D X O . 3 9 F 8 0 2 4 0 4 S T A T I M D I S + 4

C O B F 6 0 R T S 0 3 A 2 8 A T X A

; 0 3 A 3 4 A L S R A

C O C O E N D

42 MICRO No. 71 . April/May 1984

Page 45: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 45/84

Listing 3 (continued)

0 3 A 4 4 A L S R A 0 3 D 7 7 8 T H I H I T S E I0 3 A 5 4 A L S R A 0 3 D 8 A D 1 4 0 3 L D A C I N V0 3 A 6 4 A L S R A 0 3 D B A 2 4 0 l D X ' ( T l H I R Q0 3 A 7 1 8 C L C 0 3 D D 8 D D 5 0 3 S T A T l H R E T + I0 3 A 8 6 9 3 0 A D C 1 $ 3 0 0 3 E O B E 1 4 0 3 s n C I N V0 3 A A B D 2 3 0 4 S T A T l H D l S + 3 0 3 E 3 A D 1 5 0 3 L D A C I N V + l0 3 A D A 9 3 A l O A 1 $ 3 A 0 3 E 6 A 2 0 3 L D X I > T I H I R Q0 3 A F B D 2 2 0 4 S T A T J H D l S + 2 0 3 E B 8 D D 6 0 3 S T A T l H R E T + 20 3 8 2 A 9 O D l O A I $ O D 0 3 E B B E 1 5 0 3 s n C I N V + I

0 3 B 4 8 D 2 7 0 4 S T A T I H D I S + 7 0 3 E E 5 8 C L l0 3 8 7 A 2 2 0 L D X 1 $ 2 0 0 3 E F 6 0 R T S0 3 B 9 8 E 2 5 0 4 s n T J H D I S + 50 3 B C A D 0 9 D C l D A S E C S T I H E F U N C T I O N - - T O G G l E D I S P L A V0 3 8 F 2 9 0 1 A N D 1 $ 0 1 O N A N D C l F F - - A L A R M R E H A I N S A C T I V E0 3 C I F O 0 3 B E g S T C l O K 0 3 F O A 9 0 1 T I H E L D A 1 $ 0 10 3 C 3 8 E 2 2 0 4 s n T J M D I S + 2 0 3 F 2 4 D F 9 0 3 E O R D I S P F l0 3 C 6 A D 0 8 D C S T C l O K l D A T E N T H S 0 3 F 5 B D F 9 0 3 S T A D I S P F l0 3 C 9 A D 8 6 0 2 L I > A C O l O R 0 3 F 8 6 0 R T S0 3 C C A 2 0 7 l D X 1 $ 0 7 ;0 3 C E 9 D 2 0 D 8 l B l E S T A D I S C L R , X 0 3 F 9 0 0 D I S P F l B n $ 0 00 3 D I C A D E X 0 3 F A 0 0 A l F l A G B n $ 0 00 3 D 2 D O F A B N E l B l E j

0 3 D 4 4 C 3 1 E A T I H R E T J I f P $ E A 3 1 0 3 F B E N D

Listing 4

1 0 R E H f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f f2 0 R E H f f3 0 R E M f D O S + L O A D £ R H . J . K E R Y A N f4 0 R E H f H I C R O 1 7 1 - A P R I L 1 9 8 4 f5 0 R E M f N E N F E A T U R E S I N C L U D E f6 0 R E M ' T H E I I I R O U T I N E S : R E P E A T , f7 0 R E M f D I R E C T . P R I N T , F O R M A T P R I N T E R , •8 0 R E M ' S E T S U P T I H E , S U P E R M O N , K I l l •9 0 R E M f • • • f • • • • • • • • • • • • f f . f . f f f f • • • f f • •

9 0 0 I F P E E K ( 5 2 1 5 9 ) ~ 9 6 T H E N S O T O 1 0 4 01 0 0 0 l O A D I D + + + . H l ' , 8 , 11 0 4 0 S Y S 5 1 2 0 01 0 5 0 I F A = I T H E N 1 1 5 01 1 0 0 P R I N T " { C l E A R , D O N N 2 } N A N T T O U S E T H E T l K E R / A l A R H C L O C K ? ( Y / N ) " : A = I1 1 1 0 G E T A 9 t : l F A 9 t = " ' T H E N 1 1 1 01 1 5 0 I F P E E K ( 2 ) = 1 1 5 T H E N S O T O 1 4 0 01 2 0 0 P R I N T " { C l E A R , D O N N 2 } N A N T T O U S E S U P E R H O N " : P R I N T " A N D / O R F O R H A T P R I N T E R '1 2 0 5 P R I N T " A N D / O R P R I N T D I R E C T O R Y ( Y / N ) "1 2 1 0 G E T A S t : I F A S t = ' · T H E N 1 2 1 01 2 2 0 I F A S t · I N · T H E N 1 4 0 01 2 3 0 P O K E 2 , 1 1 5 : l O A D ' F P D P S H . H L · , 8 , 11 4 0 0 R E M . f • • • • • • • • f • • • • • • • • • • • • f f f f f f f f1 4 1 0 R E H ' f

1 4 2 0 R E H f U S R H E l P S C R E E N C A l l 8 Y f1 4 3 0 R E M ' R E S T O R E , U O R S Y S 5 1 2 6 5 f1 4 4 0 R E H f f1 4 5 0 R E H . f f f . f f f f f f f f f . f f f f f f f f f . f f f f * *1 5 0 0 P O k E 5 3 2 8 0 , 0 : P O K E 5 3 2 8 1 , 01 5 1 0 P R I N T " { S R E E N , C l E A R , D O N N l l ) ( R V S } P l A C E Y O U R S C R E E N H E R E { R V S O F F } "1 5 2 0 P O K E 5 3 1 2 8 , 4 : P O K E 5 3 1 3 1 , 2 3 21 5 3 0 S Y S 5 3 1 6 41 5 4 0 P O K E 6 0 3 9 2 , P E E K ( 5 3 2 8 0 )1 5 5 0 P O K E 6 0 3 9 3 . P E E K ( 5 3 2 8 1 )1 5 6 0 P O K E 5 3 1 2 8 , 2 1 6 : P O K E 5 3 1 3 1 , 2 3 61 5 7 0 S Y S 5 3 1 6 4

No. 71 - April/May 1984 MICRO 43

Page 46: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 46/84

BASIC program into memory. Then

save it todisk and get a directory listing

[by pressing @ then $]. Multiply the

required number of blocks by 256, then

subtract 1 (you should get l1x256 -1

2815]. Next, in immediate mode, type

the following:

F O R I = O T 0 2 8 1 5 : A = P E E K ( I + 2 0 4 8 1 : P O K E1 + 4 2 7 5 2 , A : N E X T

IIf you got a number other than 2815,

use it above.] Now load into memory

at $COOO the one-block machine

language program as shown in Listing

2. Use either an assembler, the

monitor, or a BASICloader that POKEs

DATA into memory. If your required

number of blocks was not 11, place

your number at $C042, add nine and

place this number at $COI2 and at

$C016. Then move this program to

hidden RAM also:

F O R I = O T 0 2 5 5 : A = P E E K ( I + 4 9 1 5 2 1 : P O K EI + 4 2 4 9 6 , A : N E X T

P O K E 4 0 9 9 1 , 1 : P O K E 4 1 0 2 3 , 1 6 6

Sofar, we've moved the one-block boot

program to $A600, the BASICprogram

starting at $A700, and set up table

pointers for the left arrow function.

Now press RESTORE, S to get into the

monitor and type:

. S II F P D P S H . H L D , 0 8 , A O O O , C O O O

This saves to disk the BASICprogram

as well as the other programs

previously hidden (printer formatting

and the monitor).

The machine language BASICbootprogram deserves some explanation

(refer to Listing 2). A flag (located at

$CBBE) is initially set to zero. If it is

zero, then the program BASWAP

knows that this function hasn't yet

been activated and our hidden BASIC

program is still hidden. If so, the

pointers to the beginning of the

variables table (located at $002D,

S002E)are saved in $CBBD, $CBBE. If

the current BASIC program is larger

than our hidden program, everything is

OK, but if it is smaller, then we move

the variable pointer table up to makeroom for the new program.

Next, the two basic programs are

swapped (or at least the first 11blocks

of the current program is swapped in

this example). A CLR command is

activated; then the option is given to

RUN the new program by pressing the

RETURN key. This is accomplished by

printing appropriate information on the

screen and stuffing carriage returns into

the keyboard buffer. A few spaces stuck

into the buffer guard against multiple

44

Listing 4 (continued)

1 9 0 0 R E H l l l l l l f l l l l l l f l l l l l l l l f l l l l f U f f1 9 1 0 R E H ' ,1 9 2 0 R E H I H E L P S C R E E N C A L L B Y I1 9 3 0 R E H I R E S T O R E , H O R S Y S 5 1 2 3 2 I1 9 4 0 R E H I I1 9 5 0 R E H l l l l l l l l l l l l f l l l l l f l l I l l I H t l l 12 0 0 0 P O K E 5 3 2 8 0 , 5 : P O K E 5 3 2 8 1 , 12 0 1 0 P R I N P C C L E A R ) C R E D , R V S ) C O H H A N D S U H H A R Y C R V S O F F l "2 0 2 0 P R I N T " D O S 5 , 1 D O E S - I T 1. 2 '

2 0 3 0 P R I N T " - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - "2 0 4 0 P R I N P C B L A C K ) C U P A R R O W ) P 6 H C B L U E } L O A D ~ R U N C B L A C K } R E S T O R E

C B L U E ) S T O P S C R O L L "2 0 5 0 P R I N T · C B L A C K ) / P 6 H C B L U E ) L O A D P 6 H ·2 0 6 0 P R I N T · C B L A C K } X P 6 H C B L U E ) L O A D H L P 6 H - - F O L L O W B Y : "2 0 7 0 I F A S $ · · N " T H E N P R I N T2 0 7 5 I F A S $ O · N " T H E N P R I N T · C 6 R E E N , B A C K A R R O W ,

B L U E ) P R I N T D I R E C T O R Y ·2 0 8 0 P R I N T M C B L A C K ) C B A C K A R R O W ) P 6 H C B L U E ) S A V E P 6 H C B L A C K ) A

C B L U E ) A P P E N D P 6 H S "2 0 9 0 P R I N T2 1 0 0 P R I N T " C B L A C K ) @ $ C B L U E ) - L I S T D I R C B L A C K ) B C B L U E ) B A C K 6 N D C O L O R "2 1 1 0 P R I N T " C B L A C K ) C C B L U E ) C H A R A C T E R C O L O R S "2 1 2 0 P R I N T · C B L A C K ) @ N O : N A H E , I D E C B L U E ) E D 6 E C O L C I R S "

2 1 3 0 P R I N T · F O R H A T D I S K ·2 1 3 5 I F A S $ ( > " N · T H E N P R I N T " C U P ) F O R H A T D I S K C S R E E N ) F

C B L U E ) F O R H A T P R I N T E R "2 1 4 0 P R I N T " C B L A C K ) @ R O : N E W N H = O L D N H D C B L U E ) D U H P T O P R I N T E R "2 1 5 0 P R I N T · R E N A H E D I S K C B L A C K ) O C B L U E ) P R I N T E R O F F "2 1 6 0 P R I N T · C B L A C K ) @ C O : N E W P 6 H = O L D P 6 H P C B L U E ) P R I N T E R O N "2 1 7 0 P R I N T · C O P Y P 6 H C B L A C K ) R C B L U E ) R E P E A T O N / O F F '2 1 8 0 P R I N T · C B L A C K ) @ S O : P 6 H H C B L U E ) H E L P ( T H I S L I S T ) '2 1 9 0 P R I N T · S C R A T C H P 6 H C B L A C K ) U C B L U E ) U S E R H E L P '2 2 0 0 P R I N T · C B L A C K ) @ I C B L U E ) I N I T I A L I Z E "2 2 0 5 I F A Q $ ( > · N I T H E N P R I N T · C U P , B L A C K ) @ I C B L U E ) I N I T I A L I Z E C B L A C K } T

C B L U E ) T I M E R / A L A R H "2 2 1 0 P R I N T · C B L A C K ) @ U I C B L U E } R E S E T C B L A C K ) N C B L U E ) N U H B E R C O N Y E R S N , '

2 2 2 0 P R I N T · C B L A C K ) I Y C B L U E ) V A L I D A T E "2 2 2 5 I F A S $ O · N · T H E N P R I N T " C U P , E L A C K ) I Y { B L U E > Y A L I D A T E ( 6 R E E N ) S( B L U E ) S U P E R H O N ·

2 2 3 0 P R I N T · { B L A C K ) @ Q { B L U E ) Q U I l D O S 5 , 1 ( B L A C K ) K { B L U E ) K I L L A L L ( R E S E T l '2 2 4 0 P R I N P < B L . A C K ) R E T U R N { B L U E ) C A N C E L I2 2 5 0 P R I N P { R E D ) P R E S S ( R V S H : E T U R N { R V S O F F ) T O C O N T I N U E " ;3 0 0 0 P O K E 5 3 1 2 8 , 4 : P O K E 5 3 1 3 1 , 2 4 83 0 1 0 S Y S 5 3 1 6 43 0 2 0 P O K E 6 4 4 8 8 , P E E K ( 5 3 2 8 0 13 0 3 0 P O K E 6 4 4 8 9 , P E E K ( 5 3 2 8 1 13 0 4 0 P O K E 5 3 1 2 8 , 2 1 6 : P O K E 5 3 1 3 1 , 2 : ' 23 0 5 0 S Y S 5 3 1 6 43 0 5 5 I F A S $ = · N · T H E N 6 0 T O 3 0 6 03 0 5 6 P O K E 5 2 1 7 9 , 8 9 : P O K E 5 2 2 1 1 , 2 0 7 : P O K E 5 2 1 6 6 , 8 9 : P O K E 5 2 1 9 8 , 2 0 7 : P O K E 5 2 1 5 7 , 0

3 0 5 7 P O K E 5 2 1 9 1 , 8 9 : P O K E 5 2 2 2 3 , 2 0 7 : P O K E 5 2 1 5 8 , 0 : P O K E 5 3 1 2 3 , 03 0 6 0 I F A Q $ = · Y · T H E N 6 0 S U B 5 0 0 03 0 6 5 G E ' r B $ : I F B $ · · · T H E N 3 0 6 53 0 6 6 P R I N T " ( C L E A R ) " : I F A Q $ = · Y " T H E N 6 0 S U B 5 0 3 03 0 8 0 P O K E 5 2 1 7 1 , 2 2 6 : P O K E 5 2 2 0 3 , 2 5 23 0 9 0 P O K E 5 3 2 8 0 , 6 : P O K E 5 3 2 8 1 , 1 2 : P O K E 6 4 6 , 03 1 0 0 P R I N T 1{ H O H E , D O W N 4 ) P R I N T ( F R E ( O ) + 6 5 5 3 5 1 { D O N N , L E F T I 2 ) B Y T E S F R E E " : P O K E 1 9 8 , b

3 1 1 0 P O K E 6 3 1 , 1 9 : P O K E 6 3 2 , 1 7 : P O K E b 3 3 , 1 7 : P O K E 6 3 4 , 1 7 : P O K E 6 3 5 , 1 7 : P O K E 6 3 b , 1 33 2 0 0 N E W5 0 0 0 F O R 1 = 8 3 2 T O 1 0 1 8 : R E A D A : P I l K E I , A : N E X T 15 0 1 0 P O K E 5 2 1 8 0 , 2 4 0 : P O K E 5 2 2 1 2 , 3 : : : Y S 9 8 35 0 2 0 P O K E 5 1 5 6 0 , 3 2 : P O K E 5 1 5 6 1 , 2 1 5 : P O K E 5 1 5 6 2 , 35 0 2 5 R E T U R N

MICRO No. 71 - April/May 1984

Page 47: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 47/84

RESTORE key activations which

sometimes occur when you press this

key. If you don't want to RUN the

program, press the cursor down key

instead of the RETURN key.

To go back to the original BASIC

program, hit RESTORE, left arrow

again. Now the variable table pointers

are restored [from $CBBD, $CBBE) and

then the swap is performed again. This

sticks our originally hidden programback in its hiding place and returns our

original BASIC program to the BASIC

workspace, unharmed.

Time Routine

In the December 1983 MICRO, a very

nice machine language time/ alarm

routine was described. Unfortunately,

this program is incompatible with

DOES-IT's since they both use the

same memory area at $02A7.

Therefore, Ian Adam's program was

shortened and revised somewhat to tie

it into DOES-IT.

The revised program is shown in

Listing 3. The entire program fits into

the cassette buffer from $0340 to

$03FB. The changes from the original

program are as follows:

The RESTORE, T key sequence is used

to toggle only the time display on and

off. This allows the alarm to remain

active even if the time is not displayed.

No SYScalls are necessary.

Only hours, minutes, and AM/PM is

shown in the upper right comer of the

screen. The seconds and tenths ofseconds proved to be distracting; they

were replaced by a blinking colon to let

you know the clock is still ticking.

The alarm function is nearly the same,

except the word ALARMwas left out to

save space. Function key F1 turns off

both the alarm and the display (but you

can reactivate the display with

RESTORE, T).

The characters used in the time display

always use the currently active

character color. This assures visibility.

A warning: never leave the timedisplay on the screen when you are

editing programs. It is very easy to

accidently edit the current time of day

into your BASIC programs. The time

and alarm setting is done through the

new DOES-IT boot program, DOS + .

Getting ItAll Together

The machine language routine DOES-

IT.ML must be changed to incorporate

the vectors for the Repeat and Kill

functions from Part 3 lor the required

No. 71'p~'!1""''' 1984

Listing 4 (continued)

5 1 ) 3 0 IN P U T' ( D ON N5 } IS IT N ON (R YS } A M {R '~ S O FF } O R {R YS } P M

(R Y SO F F } " ;A $ :IN P U T '{D O W N } T H E H O U R ';H

5 0 4 0 P R IN T " ( D O NN 2 } E N T ER T H E M IN U T E T O S TA RT T H E C LO C K "5 0 5 0 P R IN T ' ( D O W N }T H E C L OC K W I LL S TA R T W H E N Y O U H IT (R Y S }R E T UR N {R Y S O FF ,

D O W N } E N T E R T H E H IN U T E ':

5 0 6 0 IF H )1 2 T H E N A $ = 'P " :H = H ~ 1 2 :G O T O 5 06 0

5 0 7 0 IF H )9 T H EN H = H + 6

5 0 8 0 IF L E F U (A $ ,1 ) = " P · T H E N H = H + 1 2 8

5 0 9 0 C = 5 6 3 2 8 :P O K E C + 3 ,H :P O K E C + l,O

5 1 0 0 IN P U T M : " =M + IN T (M / l0 ) '6

5 1 1 0 P O K E C + 2 ,H IP O K E C ,O :S Y S 1 0 0 8 : P R IN T " [D O W N2 ,R Y S } IF T IM E N O T O K ,

P R E S S AN Y K E Y ,

5 1 2 0 F O R 1 = 1 T O 1 0 0 0 : I F P E E K (1 9 8 ) T H E N P O K E 1 9 8 ,O :S Y S 1 00 8 :G O T O 5 03 0

5 1 3 0 N E X T

5 1 40 P R IN T · { C LE AR ,D O W N 5 } W H A T T IM E W O U L DY O U L IK E T H E A LA R H {D O NN }" :

IN P U T "{ R YS } A M (R YS O F F} O R {R Y S } P H (R YS O F F} , , ;A i

5 1 5 0 A i= LE FU (A $ , I l : IN P UT '( D O N N } T H E H O U I< ·jH :H H = H5 1 5 5 IF H )1 2 T H E N A $ = " P ":H = H -1 2 : 6 0 T O 5 1 5 5

5 1 6 0 H = H - 6 ' (H ) 9 H 2 8 ' ( A $ : " P ') : IN P U T " < D O N tU T H E M IN UT E "; H : M H = H :H = H +IN T ( H I 1 0 ) '6

5 1 7 5 P O K E C + 7 ,1 3 6 :P O K E C + 3 ,H :P O K E C + 2 ,M :P O K E C ,I : P O K E C + 7 ,B

5 1 8 0 P O K E 5 42 7 3 ,9 9 : P O K E 5 4 2 78 ,2 40 :P O K E 5 42 7 6 ,2 1 : P O K E 5 4 2 B7 ,2 :P O K E 5 42 9 0 ,1 7

5 1 B 5 IF M " (1 0 T H E N P R IN T " ( C LE A R ,D O N N 2 } 'S P C ( 2 7 - H H / 9 .9 1 ;H H ; " {L E FT } : " ;

M M jA $ "H A LA R M ·:G O T O 5 1 9 5

5 1 9 0 P R IN T " { C LE AR , DO W N 2 } 1 S P C2 7 - H H /9 . 9 ) j H H ; " { L E FT }: " j

R IG H Tf ( S TR $ ( H H ).2 ); ' " A f" M A L A RM "

5 19 5 R ET U RN

6 0 0 0 D A T A 1 7 3 , 1 3 , 2 2 0 , 4 1 . 4 , 2 4 0 , 3 , IJ l l , 2 5 0 , 3

6 0 1 0 D A T A 1 7 3 , 2 5 0 , 3 , 2 4 0 , 3 2 , 1 4 1 ,2 4 9 " 3 , 1 6 5 , 1 6 2

6 0 2 0 D A T A 1 0 6 ,1 0 6 ,1 0 6 ,4 1 ,1 2 ,1 4 1 ,3 2 ,2 0 8 ,4 1 ,4

6 0 3 0 D A T A 1 4 1 , 2 4 , 2 1 2 , 1 6 5 , 1 9 7 , 2 0 1 , 4 , 2 0 8 , B , 1 6 2

6 0 4 0 D A T A 0 , 1 4 2 , 2 5 0 , 3 , 1 4 2 , 2 4 9 , 3 , 1 7 3 , 2 4 9 , 3

6 0 5 0 D A T A 2 4 0 , 9 6 , 1 7 3 , 1 1 ,2 2 0 , 1 7 0 ,4 1 . 1 5 , 2 4 , 1 0 5

6 0 6 0 D A T A 4 8 , 1 4 1 , 3 3 , 4 , 1 3 8 , 1 6 , 4 , 1 6 ; : , 1 6 , 1 6

6 0 7 0 D A T A 2 , 1 6 2 , 1 , 1 4 2 , 3 8 , 4 , 1 6 2 , 3 2 , 4 1 , 1 6

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

6 0 9 0 D A T A 1 7 0 , 4 1 , 1 5 , lO S , 4 8 , 1 4 1 , 3 6 . 4 , 1 3 8 , 7 4

6 1 0 0 D A T A 7 4 , 7 4 , 7 4 . 2 4 , lO S , 4 8 , 1 4 1 , 2 ; 5 , 4 , 1 6 9

6 1 1 0 D A T A 5 8 , 1 4 1 ,3 4 , 4 , 1 6 9 , 1 3 , 1 4 1 , M, 4 , 1 6 2

6 1 2 1 ) D A T A 3 2 , 1 4 2 , 3 7 , 4 , 1 7 3 , 9 , 2 2 0 , 4 1 , 1 , 2 4 0

6 1 3 0 D A T A 3 , 1 4 2 ,3 4 , 4 , 1 7 3 ,8 ,2 2 0 , m, 1 3 4 , 2

6 1 4 0 D AT A 1 62 , e , 1 5 7 , 3 1 , 2 1 6 , 2 0 2 , 2 0 8 , 2 5 0 , 7 6 , 4 9

6 1 5 0 D A T A 2 3 4 , 1 2 0 , 1 7 3 , 2 0 , 3 , 1 6 2 , 6 4 , 1 4 1 , 2 1 3 , 3

6 1 6 0 D A T A 1 4 2 , 2 0 , 3 , 1 7 3 , 2 1 , 3 , 1 6 2 , 3 , 1 4 1 , 2 1 4

6 1 7 0 D A T A 3 , 1 4 2 , 2 1 , 3 , 8 8 , 9 6 , 1 6 9 , 1 , 7 7 , 2 4 96 1 8 0 D A T A 3 , 1 4 1 , 2 4 9 , 3 , 9 6 , 0 , 0

MICRO 45

Page 48: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 48/84

Figure 1. DOES·IT Help Screen

DOS 5.1CCH1ANDllSlH1ARY

DOES--I T

APGM LOAD e . : RLN

/PGM LOAD PGMY.PGM LOAD ML PGM

+ - PGM SAVE PGM

@$ LIST OIR

@N 0 :NAME ,1 0

F ORMt 4T D IS K@Re :NEWI'I1=OL N " 1

RENAME DISK@C0:NEWPGM=OLDPGM

COpy PGM

@S9:PGMSCRATCH PGMINITIALIZERESETVALIDATEQUIT DOS 5.1

@I@UI@V

@Q

PRESS RETURN

RESTORE STOP SCROLL

--FOLL(JI.IY:+ - PRINT DIRECTORYA APPEND PGMS

B BACKGNO COLORC CHARACTER COLORSE EDGE COLORSF FORMAT PRINTERo DUMP TO PRINTERo PRINTER OFFP PRINTER CN

R REPEAT ON/OFF

H HELP (THIS LIST)U USER HELPT TIMER/ALARMN NUMBER CCJt.fJERSN.S SUPERM~

K KILL ALL (RESET)RETURN CANCEL

TO CONTINUE

POKEs should be included in the loader

program). However, it is desirable to

keep the Time function and the

transient programs as options sowe can

bypass loading and executing them if

we desire. Therefore the loader

program, now called DOS + , has been

changed, see Listing 4.

If the machine language portion of

DOES-IT from $C800 is not in

memory, the loader program will load

it (it is now called D + + + .ML) asshown in lines 900-1000. A SYS to

51200 is made to initialize DOES-ITand the wedge. Then you are asked if

you want the Time routine and the

transient programs. If you answer yes

to the second question, the 8K block

FPDPSM.ML is loaded into hidden

RAM at $AOOO-$BFFF,only if the flag(at location $0002) indicates that it is

not yet in memory

The HELP screen was changed to

reflect all the additions to DOES-IT and

will only print out those additions that

are actually loaded into memory. A

46

printout of the latest HELP screen is

shown in Figure 1 (but it looks better

on a color monitor).

If the time routine is desired, then

lines 5000 are run, in which the current

time and the alarm time are entered,

Ending the program leaves the time

display on, the program NEWs Itself,

then prints the available free memory.

The DOES-IT routines now consist

of three programs that can be copied to

copies to your other disks: DOS+ the

BASICboot program, D + + + .ML, the

permanent ML programs and tablesthat load into $C800-$CFFF [this also

contains the DOS WEDGE), and

FPDPSM.ML, the 8K block that loads

into hidden RAM ($AOOO-$BFFFJ.To

activate DOES-IT, type in LOAD

"DOS + ",8 then RUN.In general the routines are quite

easy to use. However, entering them

from the keyboard for the first time can

be confusing due to the complexity of

operations involved. For $10 (US),

MICRO will provide the DOES-IT

MICRO

routines from the four articles in this

series on disk, along with all the

assembly source listings. For foreign

reques ts, please send sufficien t

postage. For those hackers interested in

adding more functions, five blocks of

memory is unused in the hidden RAM

from $B200-$B6FF, eight block are

available from $EOOO-$E7FF,and all

sixteen blocks are available in the

hidden $DOOO-$DFFFarea.

ATARI48K * TRS C/C 32K

COMMODORE 64

747 FLIGHT SIMULATOR

•••• I IiJ l': ••••

I

• • • • •

1

- - - -

\ . • • • • 1

··.a••~1·I.aaa·1. . . . 1 • • • •

ACTUAL SCREEN PHOTOGRAPH

Superbly realistic instrumentation and pilot's

view in lifelike simulation which includes

emergenci es such as engine f ires and systems

failures. This program uses high resolution

graphicsto the full to producethe most realistic

flight·deck display yet seen on a home

computer. Thereare21 real dials and25 other

indicators., Your controls operate throttle,

ailerons, elevators, flaps, slats, spoilers,

landing gear, reverse thrust, brakes, etc. You

see the runway in true perspective. Uses

joysticks and includes options to start with

take-oft or random landing approach. A real

simulation, not just another game! Casselle

only, $27.95 (add 6% In Cali•.). Sole U.S.

distributor for D.A.C.C.Ltd., England.

F. Ashton

P.O. Box 7037

Chula Vista, CA 92012

No. 71 - April/May 1984

Page 49: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 49/84

Four Techniques to Makey ,A ssemb ly P rograms

-~~ASTby Chris W illiams

These four 6502 assembly languageprogramming techniques are designed withone and only one consideration in mind.Speed. Raw, unadulterated, eyebrow·lraising

speed.

These techniques are applicable to

any 6502 microcomputer. They have

nothing whatsoever to dowith graphics

or sound or anything else that would

require special machine-specific

arrangements. They are meant to be

entirely generic. In fact, the underlying

concepts are not limited to the 6502.

They are readily applicable to all 8-bit

machines.

A relentless pursuit of speed-of-

execution is perhaps the noblest of

activities for a programmer. While

speed isn't the only characteristic of a

fine program, it usually is the

characteristic most difficult to achieve.

As a result, when a programmer has a

finished routine that absolutely

screams through its task, he tends to

grin a bit wider and finds himself a bit

more anxious to show it off--especially

to knowledgeable friends who will

appreciate what they're seeing.

So, if you're sitting there now

nodding at the familiarity of that scene,

and if you suspect that your routines

could execute faster, then you'd bewell

advised to study the following

techniques carefully ...and use them!

Writing fast programs is a skill, not a

talent, and skills are perfected through

practice.

Counting Up or Counting Down

From the perspective of speed,

choosing to count up is the single most

common mistake in the typical

assembly language program. If you're

taking notes, write this down. In

general, counting up is slower than

counting down. Watch.

Suppose I have an application that

requires an index to count through a

No. 71 - April/May 1984

list of values. Here's how the typical

program does it:

L O Y # 0 : i n i t i a l i z e In d e xL O O P L O A ( L a C ) ,Y ; g e t v a lu e f r o l l l l is t

S T A P L A C E ;d o s o m e t h i n g w i t h i t

IN Y ; i n c r e i l le n t in d e x

C p y M A X V A L ; c h e c k t o s e e i f d o n e

B N E L O O P ; n o t d o n e ! lo o p

D O N E ,e ls e , p r o c e e d

Count the instructions. There's six,

four for loop management, two (the

LDA and STA)functional. That's about

the best we can do counting up.

Instead, let's arrange things to

count down.

L O Y M A X V A L ; in i t l a l iz e i n d e x

L O O P L O A ( L O C ) ,Y ; q e t v a lu e f r o m li s t

S T A P L A C E ;d o s O ll le t h in g w i t h i t

D E Y ;d e c r e m e n t i n d e x

B N E L O O P ; c h e c k f o r z e r o t o

f i n i s h

; e ls e , p r o c e edO N E

Five instructions this time. N o CPY,

which is a four-cycle instruction

[absolute addressing). So our loop here

is four machine cycles faster than w:

counting up.

This kind of thing is always true.

You are never better off counting upand checking a count. If MAXVAL is

256, you can eliminate the CPY when

counting up and achieve indentical

speed, but MAXVAL is rarely 256.

Count down!

Fast Double Precision

All 6502 microcomputers have a 64K

memory maximum, assuming no bank

switching. 64Kis 65536which is $FFFF

hex. $FFFF hex cannot be represented

by a single byte; it requires two.

MICRO

What this all means is that any

addressing routines you might need

have to be double precision (assuming

you're looking for more than just 256

bytes). Below is a fast, general

technique for doing additive double-

byte addressing. And below that is a

special case method for doing the same

thing even faster.

C L C

L O A $ L O C : g e t l e a s t s i g n i f i c a n t b y t e

A D C # V A L ; a d d i . m e d i a t e v a l u e

S T A J L O C , s t o r e r e s u l t i n L .S . b y t e

L D A $ L O C t l ; g e t M .S . b y t e

A O C # 0 ; a d d w i t h c a r r y z e r o

S T A S L O C + 1 ; s t o r e In H . S . b y t e

R T S

The carry from the least significant

.ryte operation flows into the most

significant byte operation. This results

in a nice, tight, double precision add.

If #VAL is equal to I, as it often is,

we can get even faster.

I N C $ L O C ; i n c r e m e n t L .S . b y t e

B N E O U T ;R T S u n le s s = 0 , f r o m

p r e v i o u s F F

IN C $ L O C + l ; o v e r f lo w f ro m L .S . b y t e

O U T R T S ; O U T , d o n e

Use Immediate Addressing

In general, immediate addressing is the

fastest way to get a value for just about

any purpose. In all instructions,

immediate addressing results in a two-

cycle operation as opposed to absolute

addressing which burns four cycles

doing the same thing.

Even if the value to be used changesoccasionally, you can still get away

with immediate addressing. The byte

in question always follows the op-code

of the relevant instruction and,

47

Page 50: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 50/84

therefore, has a fixed address. Simply

write to it using absolute addressing

when you c:m <lffmcito hp "low The

new value will then be there the next

time you need speed.

Be careful when you calculate

where to write or you'll clobber the

program.

Select Branches Wisely

When you have to do a compare and

branch, keep speed in mind when

choosing the type of branch. For

example:

L O O P L D X L a CC P X I T E S T V A LB e c O U TB C S L O O P

O U T ; c o n t i n u e

there should be no such thing--you'll be

glad you did.

This seems fine at first glance, cut

watch what happens if you simply

reverse the order of the branches.

L O O P L D X L O CC P X I T E S T V A LB e S L O O P

j c o n t i n u e

Mr. Williams is a frequent contributor to

MICRO with both articles and reviews of

new products. He can be contacted at 1165

E. Edgewood Dr. 10, Ogden, Utah 84403.

Please enclose S.A.S.E. with any questions.

There's no need for the BCC since

you continue execution anyway, so

don't put it in. Keep a sharp eye out for

this error. It seems so obvious that

programmers tend to devote inadequate

attention to it.

So, those are four good ones, and I

think that's plenty for now. Let me

once again admonish you to practice,

Use the techniques. Use them even

when you don't think you need them.

In the long run-sand for your programs

OS9APPLICATION

SOFTWAREPAYROLL

$499SMALL

BUSINESS

INVENTORY

$299

(405) 233-5564

2110 W. WILLOW - ENID, OK 73701

COMPLETE DOCUMENTATION $19.95OS9 & BASIC 09 ARE TRADEMARK OF

MICROWARE, INC. & MOTOROLA CORP.

ACCOUNTS

PAYABLE GENERAL

LEDGER

$299 with

CASH

ACCOUNTS JOURNAL

RECEIVABLE $399$299

SPECIALTY

ELECTRONICS

48 MICRO

SOPHISTICATEDTELE-COMMUNICATIONIS HERE

THE COMMUNICATORfor 4.0 Commodore Computers

JIM STRASMA'S REVIEW:

"THE BEST TERMINAL PACKAGE I'VE SEEN YET"By April 1 (maybe sooner) It Will Be Even Better

SPEEDSUP TO 9600 BAUDXON - XOFF

TRUE CTRL KEY (we do our own keyboard scan)

THE HARDWj"~E - A pri nted circuit boar d; easily installed in the CBM. II uses

no CBM connector s; gives a seri al port with true RS232C standard.

THE SOFTWIIAE -Emulates the ADDS Regent 100, ADM 31 and/or the

Telel 'i deo950.1 Or choose the VT100 model tor use wit h DEC and VAX

com~uters.Runs coresident with BASIC programs; lets BASIC

prog rams and p rogram on hos t computer communicate to deve lop rea l-

ly soph~ticated communication and control capabilities.

The pro'~ram is on ROM at either address; no disk loading

requ;"ed. Uses only 512 bytes of RAM; wil l relocate i tsel f a round any other

mac :t li ne language p rog ram at top o f memory.

Will uptoad and download and run BASIC programs. With BASIC

progl am w i. up load and download standa rd data f il es . 100 page manual

gives p rog ram l is ti ng tor BASIC prog rams.

Excellent te,t editor designed to work with THE COMMUNICATOR

THE COMMUNICATOR $200

Text Editor $40

1200 baud mode rns beg inn ing a t low , low $385 , and even less when purchased

with THE COMMUNICATOR

AMPLIFY, INC.2325 Mac:bride, Iowa City, Iowa 52240 319-337-83781 tr ademar ks Adds Regent, Inc., Lear Liegler, Inc . . Televideo Syst ems, I nc.

No. 71 . April/May 1984

Page 51: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 51/84

Talking to Yourl

Printer

Original Program byDick Buchanan, Jr.

IText by Mark S. Morano

Getting an electric typewriter to listen

to a piece of fruit is not easy. I f you own

an Apple and a printer you probably

know what we're talking about.

Regardless of what micro and printer

you may have you are probably familiar

with the difficulty of getting your

computer to talk to your printer. The

size of this program should give yousome idea of the scope of these

problems. But don't despair --in order

to use this program you are not

committed to keying in the entire

listing. It is an easy extract those

elements that are useful to you and

leave out those that are not. that are

not. For example many people will

never use the international style font.

They would simply leave out the

references to this style and the

accompanying code. The same would

apply to any other features you haven't

any use for.During the creation of this printer

control program many interesting and

frustrating problems arose. Hopefully

in examining these you will find a

solution applicable to your own

particular problems.

To begin with each printer has its

own set of printer control codes that are

composed of a combination of Escape,

Control and other keys, used separately

and in conjunction with one another.

Each printer has different control codes

No. 71 . April/May 1984

Editor's Note: The original printer

program was written by DickBuchanan for the Apple. The program

was then modified and enhanced by

Robert T. Tripp and Mark S. Morano.

- why make life simple. There were a

few codes that we did find in common,

so these we grouped together and used

for both the Epson and the Gemini. Of

course this looked fine in print but we

soon discovered that there was more to

it than met the eye. On the Epson youmust use Escape "WI" to tum Enlarge

Mode on. Looking at the manual it

seemed to be the same for the Gemini.

We discovered that the Gemini will not

accept the codes in the same form. It

needed an Escape "W" CHR$(I).

(Happily the Epson does accept the

form needed by the Gemini). This was

the kind of "obvious" bug that we ran

into time and time again.

Now to make matters more

complicated there is the problem of

upper versus lower case letters. The

printers make a distinction -the Appledoesn't. This fact was brought to our

attention when the printer only printed

out a line of garbled graphics. Tracing

through the code we found an Escape

combined with an upper case 'L' where

a lower case 'I' should have been.

Unfortunately, on the Apple II and II

there aren't any lower case letters. As

luck would have it the combination of

Escape and upper case 'L' was used by

the Epson to tum on the graphics

mode. Undaunted we set our variable

MICRO

to the ASCIInumeric for lower case 'I' -

CHR$(108). This solution proved to be

a great success, not only here but

elsewhere.

Working with different printers we

learned that within one machine there

were certain modes that, when inope:ration, automatically cancelled or

turned on other features. As additional

styles can be obtained by using various

combination of styles, it is important

to know which combinations are

compatible. Those styles that cannot

be used together vary with each printer

and should be noted so as to avoid

unnecessary aggravation. For instance,

wit.a the Epson, turning on the

superscript or subscript type activates

the double strike style, or when using

emphasized type - condensed,

superscript, and subscript are notavai.lable. Usually these peculiarities

do not cause any problems as everyday

pr ia t in g needs are not very

complicated.

Another "detail" to be aware of is

how your printer and computer are

connected. If they are connected

serially you should use PR#2 when

sending an output string to the printer

(ex: line 18). If you are using a parallel

cable then you would use PR#3 (which

is tow we set the program up). The

49

Page 52: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 52/84

only problem you will encounter if you

haven't made the right choice is that

your printer won't hear your computer

- rendering the program useless.

The use of output strings gives the

programmer greater and easier control

in matters of ports, varying differences

in control codes, etc. For a further

explanation of this technique read the

accompanying article - String Power.

StringPower

Notes Toward Generic BASIC

Concepts apply to all BASICsExample for Apple, Commodore, CoCo

and Atari

Probably the first thing everyone learns

about BASICis that:

PRINT"HELLO"

will result in the word "HELLO" being

printed on the display. Then they go

on to learn other ways of using the

PRINT statement. Unfortunately,

most of what is tauqht results in

BASIC programs that are difficult to

maintain, update, or convert to other

micro BASICs. A program written in

BASIC for one computer will normally

not run on any other computer without

some modification. This has been one

of our greatest frustrations at MICRO.

A good program submitted for micro X

could be converted to run on other

micros, but due to the eccentricities of

BASIC, is not worth the effort. Often

the differences are relatively trivial and

could be avoided entirely if the

programmer would use a few simple

techniques to generate more generic

code. We took the program submitted

by Buchanan as a sample case and

generalized it to run on several micros.

One of the techniques used, Output

Strings, can help you make your BASIC

better.

Changing the Printer Port

The original program was written in

standard BASIC using simple PRINT

statements. To output amaster reset to

to the printer, the Applesoft BASIC

statement was:

50

[ 30 PR# 7: PRINT ESC$; CHR$(64,1;:

PR# 0 J

which selected port 7 as the printer

output port, output the characters

required to reset the Gemini printer,

and reset the output device to the

display. Applesoft BASIC PRINTs to

the currently selected device. Each

time the device is switched between

the screen (device 0 always) and the

printer (connected as device 7 on thissystem) a PR# command must be

issued. Every time output was directed

to the printer, instead of the display,

the PR# 7 command was issued within

the print statement line. Changing the

printer port would require changing

every one of these print lines within

the program! That is a lot ofwork. And,

miss just one and your system will

probably 'hang'. If there was some W;lY

to have the printer port defined only

once in the program, then changing be

printer port would only require

changing one reference. There is a way.If every set of information that is

destined for the printer is turned into

an output string, then a subroutine that

will handle the output string can be

called whenever output is required.

The statement:

[ OS$ =ESC$+ CHR(64) J

defines a string variable OS$ that

contains the two characters required

for a master reset. This string is output

to the printer via a short subroutine:

[ 18 PR# 7: PRINT OS$;: PR# 0:

RETURN Jand is called as:

[30 OS$ =ESC$ + CHR(64): GOSUB

18 J

Every time the subroutine at line 18 is

called, it selects port 7 for output,

outputs the current value of the OS$

string, resets the output port to the

screen, and returns. All of the

statements in the original program that

generated output to the printer were

rewritten as output strings, using the

string variable OS$, and calling

subroutine at line 18 for the actualoutput. Now, if the printer is changed

to port 2, then only this single line has

to be changed. It is changed to:

[ 18 PR# 2: PRINT OS$;: PR# 0:

RETURN J

It is obviously much easier to change

the printer port when only one line

needs to be changed. This makes the

program a lot easier to use, maintain

and update. Output strings are defir.ed

within many of the 'working' lines of

the program. The basic printer control

MICRO

strings for the Gemini are defined in

lines 9100 through 9183, plus lines

9820 through 9890.

Changing Printers

The output string technique also

allows us to change printers. The

original program was written only for

the Gemini. To change the original

code to support the Epson, or any other

printer, would have required searchingout every direct PR# 7 statement and

changing those that were different for

the Epson. Since we rewrote the

program to use output strings instead,

all that was required was to redefine

those printer control strings that were

different between the Gemini and the

Epson. This is taken care of in the lines

9500 through 9583, plus lines 9000 to

9019 that allow us to choose between

the Gemini and Epson at run time.

Note that the Gemini and Epson people

were considerate and defined many of

the strings to be identical on the twoprinters. All of the definition strings in

lines 9820 through 9850 are the same

for these two popular printers.

If you wanted to modify this

program for another printer, all that is

required is to redefine these strings. No

other program modifications should be

required. If you want to key the

program in for only the Gemini or the

Epson, then the lines specific to the

printer that you are not using may be

omitted.

Changing Micros

The output string technique makes

going to another micro easier. The OS$

string is defined in the exact same way,

but the output subroutine is changed to

fit the requirements of the new micro.

In FLEX BASIC, on our FOCUS or a

CoCo, the print subroutine is:

[ 18PRINT #l,OS$;: RETURN J

On a Commodore 64 it would be:

[ 18PRINT# 4,OS$;: RETURN J

These two BASICimplementations are

quite different from the Applesoft

BASIC since they specify the printer

port as part of the PRINT command,

rather than changing the printer port.

On an Atari it would be:

xxxxxxxx

See the micro specific listings at the

end of the main program listing for the

details on using one of these micros

with this program.

No. 71 . April/May 1984

Page 53: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 53/84

Summary make your BASIC program more your BASIC more generic. Other

flexible. In the particular example, it techniques will be described in

The concept of using an output string made it easier to change printer port, to additional articles on this subject. If

instead of immediate printer change type of printer, and, to change you have discovered other techniques,

commands has been discussed, and it micro. This is but one of a number of we would like to hear about them.

has been shown that this technique can techniques that can be used to make

Listing 1

1 R E " P R I N T E R F O R " A T P R O G R A "

2 R E " O R I G I N A L A P P L E / G E " I N I 1 8 V E R S I O N3 R E H B Y D I ~ K B U ~ H A N A N4 R E " " O D I F I E D B Y R . " . T R I P P5 R E " F O R G E N E R A L P ! I C R O C O " P U T E R S A N Db R E P ! T H E E P S O N P R I N T E R

1 3 R E P ! P ! I C R O - " A R C H 1 9 8 4 - . 7 81 4 R E P !1 5 6 0 S U B 9 9 . 8 : R E P ! S Y S T E " I N I T I A L I A T I O NI b G O S U B 9 8 8 8 : G O l D 3 8 :

R E " P R I N T E R I N I T I A L I Z A T I O N

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• " i c r o c o l p u t e r S p e c i f i c C o d e t o •• S e r v i c e I n p u t / O u t p u t " u s t B e •• E n t e r e d H e r e . S e e " o d u l e s a t E n d •

• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •3 8 O S , = " R ' + " S ' : G O S U B 1 8 :

R E " O U T P U T T O P R I N T E R5 8 G O S U B 2 85 1 O S , = . A ) F O N T S T Y L E C O N T R O L S I + C R . :

G O S U B 1 95 2 O S , = I B ) F O N T P I T C H C O N T R O L S " + C R . :

G O S U B 1 95 3 O S . = I C ) S P E C I A L P R I N T " O D E S I + C R . :

G O S U B 1 95 4 O S . = . D ) S P E C I A L P R I N T E F F E ~ T S " + C R . :

G O S U B 1 95 5 O S . = I

5 b O S . = I

5 7 O S . = I

5 8 O S . = I

G O S U B 1 95 9 O S . = I I ) I N I T I A L I Z E P R I N T E R R E S E T " + C R . :

G O S U B 1 9b e O S . = I J) P R I N T P R E S E N T P A R A " E T E R S " + ~ R ' :

G O S U B 1 9b i O S . = I K )

D I S P L A Y P R E S E N T P A R A " E T E R S " + C R t + C R . :G O S U B 1 9

b 3 O S . = 0 X ) T O E X I T " + C R . : G O S U B 1 9

b 5 O S . = C R ' : G O S U B 1 97 8 O S . = S N . : G O S U B 1 9 : G O S U B 2 17 5 I F N . = II T H E N 7 .8 8 I F N . = " X · T H E N E N D9 . N = A S C ( N ' ) - A S C ( " a " ) :

I F N < 1 O R N > I I T H E N 7 .1 8 8 O N N G O S U B 1 ' 8 ' , 2 ' 8 ' , 3 " 8 , 4 8 8 8 , 5 " 8 , b 8 " , 7 " ' ,

8 8 8 ' , 3 ' , 3 8 8 , 4 8 8I I . G O T O 5 .2 8 8 R E " P R E S E N T V A L U E S2 8 5 G O S U B 2 82 1 . O S . = A A . + I " + B S . + C O . + B 3 . + C O . + A 2 . +

P T S + C R .

E ) L I N E F E E D C O N T R O L S " + C R . : G O S U B 1 9F ) F O R " F E E D C O N T R O L S " + C R . , G O S U B 1 9G ) V E R T I C A L T A B S " + C R . : G O S U B 1 9H ) H O R I Z O N T A L C O N T R O L S " + C R . :

2 1 1 O S . • O S . + C S t + C O . + C 2 . + C O . + D S . + C R .2 1 2 O S . = O S . + R S . + R t . + C O . + L S . + L e . + C R .

2 1 3 O S . = O S . + D 2 . + C O . + L F . + " • + L T . + " / " +

L B . + C H R . ( 3 4 ) + C R .2 1 4 O S . = O S . + P L . + F S . + C O . + P N . + F l . + C H R .

( 3 4 ) + C O .2 1 5 O S . = O S . + H L . + F 2 . + C O . + B L . + F 3 . + C R .2 2 8 R E T U R N2 9 9 R E H D I S P L A Y P R E S E N T V A L U E S3 8 8 C O . = . , . : G O S U B 2 1 8 : G O T O 1 8 :

R E P ! O U T P U T T O P R I N T E R4 8 8 C O . = C R . : 6 0 S U B 2 8 5 : 6 0 S U B 1 9 : 6 0 T O 2 1 ,

R E " O U T P U T T O D I S P L A Y1 8 8 8 R E " F O N T S T Y L E1 8 8 5 G O S U B 2 81 8 1 8 O S . = • 1 ) S E L E C T S T A N D A R D A S C I I " + C R .1 . 1 1 O S . = O S . + • 2 ) S E L E C T I T A L I C " + C R .1 . 1 2 O S . = O S . + " 3 ) S E L E C T I N T E R N A T I O N A L " + C R S :

G O S U B 1 91 . 4 8 O S , = S N . : G O S U B 1 9 : G O S U B 2 1 :

I F N . = I. T H E N R E T U R N1 8 4 5 I F N . < " I · D R N . ) " 3 " T H E N 1 8 4 .1 8 5 . I F N . = "l " T H E N O S . = I X . : G O S U B 1 8 :

· A A . • " S T A N D A R D A S C I I " : R E T U R N1 8 b 8 I F N . = " 2 " T H E N O S , = I N ' : G O S U B 1 8 :

A A . = " I T A L I C P R I N T " , R E T U R N1 8 7 8 I F N , < ) " 3 " T H E N 1 8 8 81 8 7 1 G O S U B 2 . : 0 S ' = " I N T E R N A T I O N A L F O N T S " + C R . :

G O S U B 1 9

1 8 7 2 F O R I = • T O A X :O S . = C H R . ( I + 4 8 ) + I = " + A X ' ( I ) + C R '1 . 7 3 G O S U B 1 9 : N E X T I1 . 7 5 O S . = S N . : G O S U B 1 9 : G O S U B 2 1 :

I F N . = II T H E N R E T U R N1 . 8 8 I F N . < " 8 " D R N ' ) C H R . ( A X + 4 8 ) T H E N 1 . 7 51 8 9 8 A A . = A X . ( V A L ( N ' ) )1 1 8 8 O S . = S I S + C H R ' ( V A L ( N ' ) ) : G O S U B 1 8 :

R E T U R N2 8 8 . R E " F O N T P I T C H2 8 8 5 G O S U B 2 .2 8 1 8 O S . = I 1 ) S E T P I C A S T A N D A R D ( " + P X . + 0)

I + C R .2 . 1 1 O S . = O S . + " 2 )

S E T E L I " r E S T A N D A R D I " + E x t + " ) " + C R .2 8 1 2 O S , = O S . + I 3 )S E T C O N D E N S E D I " + C I S + " ) " + C R .

2 8 1 3 O S . = O S . + " 4 )S E T E N L A R G E D I·+ E N . + " ) " + C R .

2 . 1 4 O S . = O S . + " 5 ) C A M C E L E N L A R G E D H O D E ' + ~ R S :G O S U B 1 9

2 8 5 . O S . = S N . : G O S U B 1 9 : G O S U B 2 1 :I F N . = II T H E N R E T U R N

2 . b . I F N . < "1 " O R N . , . " S · T H E N 2 . 5 82 8 b S O N V A L I N . ) G O T O : ! 1 1 8 , 2 1 2 8 , 2 1 3 8 , 2 1 4 8 , 2 1 5 82 1 1 8 O S . = P F . + E S . + C H R . ( 8 1 ) + P C ' : 6 0 S U B I S :

P T S = P I S

No. 71 - April/May 1984 51ICRO

Page 54: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 54/84

2 1 1 1 R C . = P C . : B S . = · P I C A " : R E T U R N2 1 2 8 O S . = E F . + E S . + C H R . ( 8 1 ) + E C . : s o s u e 1 8 :

PH = Ex t

2 1 2 1 R C . • E C . : B S . = " E L I T E " : R E T U R N2 1 3 8 O S . = C F . + E S . + C H R . ( B l ) + C C ' : S O S U B 1 8 :

PH = C U2 1 3 1 R C . ' " C C ' : B S ' = " C O N D E N S E D " : R E T U R N2 1 4 8 O S . = E " ' : S O S U B 1 B : B 3 ' = · E N L A R G E D " : R E T U R N2 1 5 8 O S . = E V . : S O S U B 1 8 : B 3 ' ' " " N O N - E N L A R G E D " :

R E T U R N3 . . . R E " S P E C I A L P R I N T3 . 8 5 G O S U B 2 .3 ' 1 . O S . = I 1 ) D O U B L E S ' r R I K E P R I N T " + C R .3 8 1 1 O S . = O S . + I 2 ) C A N C E L D O U B L E S T R I K E " + C R .3 ' 1 2 O S . ' " O S . + • 3 ) E " P H A S I Z E D " O D E " + C R .3 . 1 3 O S . = O S . + I 4 )

C A N C E L E " P H A S I Z E D " O D E " + C R . + C R .3 8 5 . G O S U B 1 93 . b . O S . = S N . : S O S U B 1 9 : S O S U B 2 1 :

I F N . = I I T H E N R E T U R N3 . 7 . I F N . < " l " O R N . > " 4 " T H E N 3 ' b 83 8 9 8 O N V A L ( N S ) S O T O 3 1 1 ' , 3 1 2 ' , 3 1 3 ' , 3 1 4 83 1 1 8 C S S = " D O U B L E S T R I K E " : O S ' = S O . : S O S U B I B :

S O T O 3 8 8 53 1 2 ' C S t ' " " N O N - D O U B L E S T R I K E " : O S ' ' " C D . : S O S U B I B :

S O T O 3 8 8 53 1 3 8 C 2 . = " E " P H A S I Z E D " : O S ' ' " S E . : S O S U B I B :

G O T O 3 8 8 53 1 4 . C 2 . = " N O N - E " P H A S I Z E D " : O S ' = C E . : S O S U B I B :

S O T O 3 8 ' S4 8 . ' R E " S P E C I A L E F F E C T S4 8 1 5 S O S U B 2 84 8 1 . O S . = I 1 ) U N D E R L I N E C H A R A C T E R S I + C R .4 1 1 1 O S . = O S . + I 2 ) C A N C E L U N D E R L I N E " + C R .4 ' 1 2 O S S = O S . + I 3 ) S U P E R S C R I P T " O D E " + C R .4 8 1 3 O S . ' " O S . + I 4 ) S U B S C R I P T " O D E ' + C R .

4 . 1 4 O S . = O S . + I 5 )C A N C E L S U P E R I S U B S C R I P T " O D E " + C R .4 . 1 5 a s . = O S . + I b ) U N I - D I R E C T I O N A L " O D E " + C R .4 . 1 b O S . = O S . + I 7 )

B I - D I R E C T I O N A L " O D E " + C R . + C R .4 8 8 . S O S U B 1 94 0 9 . O S . = S N . : S O S U B 1 9 : G O S U B 2 1 :

I F N . = I I T H E N R E T U R N4 1 " I F N . < " l " O R N . > " 7 " T H E N 4 . 9 '4 1 . b N = V A L ( N ' ) :

O N N S O T O 4 1 1 8 , 4 1 2 8 , 4 1 3 8 , 4 1 4 ' , 4 1 5 8 , 4 1 b 8 , 4 1 7 '4 1 1 8 O S . = U N . : S O S U B 1 8 : S O T O 4 8 8 54 1 2 8 O S . = U F . : S O S U B 1 8 : S O T O 4 . 8 54 1 3 8 O S . = " S U P E R S C R I P T " O D E " : O S ' = S S . : S O S U B I B :

G O T O 4 8 1 54 1 4 0 D S S = " S U B S C R I P T " O D E " : o S ' = S B . : S O S U B I B :

S O T O 4 8 1 54 1 5 ' O S . = " N O R " A L " O D E " : O S ' = S F . , S O S U B I B :

G O T O 4 1 0 54 1 b 0 0 2 . = · U N I - D I R E C T I O N A L " O D E " : O S ' = U D . ,

S O S U B I B : S O T O 4 8 8 54 1 7 8 0 2 . = " B I - D I R E C T I O N A L " O D E " : O S ' = B D . :

G O S U B I B : S O T O 4 8 8 55 8 " R E " L I N E F E E D C O N T R O L S5 8 1 5 S O S U B 2 .5 8 1 8 O S . = I 1 ) S E T L F T O 9 / 7 2 ( l I B ) I N C H " + C R .5 . 1 1 O S . = O S . + I 2 ) S E T L F T O 7 / 7 2 I N C H " + C R .

5 8 1 2 O S . = O S . + I 3 ) S E T L F T O 1 2 1 7 2 ( l I b )

I N C H " + C i R .5 8 1 3 O S . = O S . + I 4 )

S E T L F T O N 1 7 2 I N C H ( N = 1 T O 1 2 7 ) " + C R .5 ' 1 4 O S . = O S . + I 5 )

S E T L F T O N i " + H " ' + I I N C H ( N = 1 T O 1 2 7 )" + C R . + C R .

S ' b l S O S U B 1 95 8 7 . O S . = S N . : S O S U B 1 9 : S O S U B 2 1 :

I F N . = " ' T H E N R E T U R N

5 . 8 8 I F N . < " l " O R N . ) "S " T H E N 5 8 7 85 1 8 8 N = V A L ( N ' ) :

O N N S O T O 5 1 1 8 , 5 1 2 8 , 5 1 3 8 , 5 1 4 8 , 5 1 4 85 1 1 8 L T . = " 1 " : L B ' = " 8 " : 0 5 ' = L 8 . : S O T O I B5 1 2 8 L T . = " 7 " , L B ' = " 7 2 " : 0 5 ' = L l . : S O T O I B5 1 3 1 L T . = " 1 " I L B . = I b " , o S ' = L 2 . , S O T O 1 85 1 4 . I N P U T " E N T E R N ( 1 - 1 2 7 ) : " i P .5 1 4 2 I F V A L ( P . ) < 1 O R V A L ( P . )

) 1 2 7 T H E N S O T O 5 1 4 .5 1 4 5 I F V A L ( P . ) > , O R V A L ( P . )

< 1 2 8 T H E N L T . = P S : O N N - 3 S O T O 5 1 b l , s 1 7 8s 1 b 8 L B . = " 7 2 " : 0 5 ' = L 3 . + C H R . ( V A L ( P . ) ) :

S O T O 1 85 1 7 8 L B . = H " ' : O S ' = L 4 . + C H R . ( V A L ( P . ) ) :

S O T O 1 8b l . . R E " F O R " F E E D C O N T R O L Sb U S S O S U B 2 .b 8 1 ' O S . = I 1 ) S E T L I N E S P E R P A S E ( 1 - 1 2 7 ) " + C R Sb 8 1 1 O S . • O S . + I 2 )

S E T P A S E L E N G T H I N I N C H E S ( 1 - 3 2 ) " + C R .b . 1 2 O S . = O S " + I 3 ) S E T H E A D E R L I N E " + C R .b ' 1 3 O S . = O S . + I ( F I R S T L I N E P R I N T E D , I - l b )

I + C R .b 8 1 4 O S . = O S . + • 4 )

S E T " A X I ~ U " L I N E S F R O " B O T T O " O F " + C R Sb 8 1 s O S . = O S . + I T H E P A S E ( 1 - 1 2 7 ) " + C R .b 8 1 b O S . ' " O S l i + I 5 )

C A N C E L L I N E S F R O " B O T T O " S E T T I N S " + C R . + C R Sb 8 b ' S O S U B 1 "

b 8 7 ' O S S = S N ' i : S O S U B 1 9 : G O S U B 2 1 :I F N . • " " T H E N R E T U R N

b 8 8 8 I F N S < " l " O R N . > " S " T H E N b 8 7 8b 8 9 8 N = V A L ( N S ) :

O N N S O T O b l 1 ' , b I 2 8 , b I 3 8 , b I 4 8 , b I 5 8b l l 8 I N P U T " E N T E R L L P ( 1 - 1 2 7 ) : " j P 'b I l l I F V A L ( P S ) ( 1 O R V A L I P S ) > 1 2 7 T H E N b l 1 .sus F S S = P S : : O S S ' " F L . + C H R S ( V A L ( P $ ) ) :

S O S U B 1 8 : S O T O b 8 8 sb 1 2 8 I N P U T " E N T E R P L ( 1 - 3 2 ) : " i P S :

I F V A L i P $ ) < 1 O R V A L ( P S ) ) 3 2 T H E N b 1 2 '

b 1 2 s F l . ' " P ' : O S S ' " F l . + C H R . ( V A L ( P S ) ) :

S O S U B 1 8 : : G O T O b 8 8 5b 1 3 8 I N P U T " I : N T E R H L ( 1 - l b ) : " i P S :I F V A L I P . ) < 1 O R V A L ( P ' ) ) I b T H E N b 1 3 8

b 1 3 s F 2 . ' " P S : O S S ' " H D S + C H R S ( V A L ( P S ) ) :G O S U B 1 8 . : S O T O b 8 8 s

b 1 4 8 I N P U T " E N T E R L F B ( 1 - 1 2 7 ) : " i P .b 1 4 1 I F V A L I P . ) < 1 O R V A L ( P S ) ) 1 2 7 T H E N b 1 4 8b 1 4 s F 3 S ' " P S : O S S = S O . + C H R S ( V A L ( P S ) ) :

G O S U B 1 8 : S O T O b 8 8 s6 1 5 8 O S . ' " S X ' : S O S U B 1 8 : S O T o b " s78" R E " V E R T I C A L T A S S7 U S 6 0 S U B 2 '7 8 1 8 O S . ' " I 1 ) A D V A N C E T O N E X T T A S " + C R S

52 MICRO No. 71 - April/May 1984

Page 55: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 55/84

7 8 1 1 O S $ = O S $ + I (b , 1 2 , 1 8 , . . . ,b ' S T A N D A R D )• + C R t

7 8 1 2 O S $ = O S $ + " 2 )S E T N E N Y E R T I C A L T A B P O S I T I O N S · + C R t

7 8 1 3 O S $ ' " O S $ + I ( H A X I H U H O F 2 8 ) " + C R t7 8 1 4 O S $ ' " o S $ + C R t + C R t7 8 4 8 S O S U B 1 97 8 5 8 O S $ = S N $ : S O S U B 1 9 : S O S U B 2 1 :

I F N $ ' " II T H E N R E T U R N7 8 b 8 I F N $ = " I " T H E N O S $ = Y T $ : S O S U B 1 8 :

G O T O 7 8 8 57 8 b 5 J = . : I F N $ < ) " 2 " T H E N 7 . 5 87 8 7 . I N P U T " E N T E R T A B : " ; T $ ( J + 1 ) : J = J + 17 8 7 5 I N P U T " S E T N E X T T A B ( V / N ) : " i P $ :

I F L E F T $ ( P $ , I ) = " V " T H E N 7 8 7 .7 8 8 8 O S $ = S Y $ : O S $ = T S $ : F O R I = 1 T O J :

O S $ = O S $ + C H R $ ( Y A L ( T $ ( I ) ) ) : N E X T : S O S U B 1 87 8 8 5 F O R I = 1 T O J :

O S $ = O S $ + C H R $ ( V A L ( T $ ( I ) ) ) : N E X T7 8 9 8 O S $ = O S $ + C H R $ (8): G O S L I B 1 8 : G O T O 7 8 8 58 • • 8 R E H H O R I Z O N T A L C O N T R O L S8 8 8 5 S D S U B 2 88 8 1 8 O S $ = I 1 ) S E N D C A R R I A G E R E T U R N I + C R t8 8 1 1 O S $ = O S $ + I 2 ) S E T L E F T H A R G I N " + C R t

8 . 1 2 O S $ = O S $ + I 3 ) S E T R I G H T H A R S I N " + C R t8 . 1 3 O S $ = O S $ + I 4 )

H O Y E T O N E X T H O R I Z O N T A L T A B " + C R t8 . 1 4 O S $ = O S $ + I ( 1 ' , 2 ' , 3 ' ,

• • • S E T S T A N D A R D I + C R t8 8 1 5 O S $ = O S $ + C R t + I 5 )

S E T N E W T A B P O S I T I O N S " + C R t + C R t8 . 7 8 G O S U B 1 98 . 8 8 O S $ = S N $ : G O S U B 1 9 : G O S U B 2 1 :

I F N $ = II T H E N R E T U R N8 . 9 8 I F N $ < " I " O R N $ ) " S " T H E N 8 . 8 98 1 . 8 O N Y A L ( N $ ) G O T O 8 1 1 ' , 8 1 2 ' , 8 1 3 8 , 8 1 4 8 , 8 1 5 88 1 1 . O S $ = C R t : G O S U B 1 8 : G O T O 8 . 8 58 1 2 8 I N P U T " E N T E R L E F T H A R G I N : " ; P $ : L C $ = P $ :

O S $ = S L $ + C H R $ ( Y A L ( P $ ) )8 1 2 5 G O S U B 1 8 : S O T O 8 • • 58 1 3 . I N P U T " E N T E R R I S H T H A R S I N : " I P $ : R C $ = P $ :

O S $ = S R $ + C H R $ ( Y A L ( P $ ) )8 1 3 5 S O S U B 1 8 : G O T O 8 . 8 58 1 4 8 O S $ = C H R $ ( 9 ) : S O S U B 1 8 : S O T O 8 9 . 58 1 5 8 J = 88 1 5 5 I N P U T " E N T E R T A B : " j T $ ( J + 1 ) : J = J + 1 :8 1 b 8 I N P U T I S E T N E X T T A B ( V / N ) : " j P $ :

I F L E F T $ ( P $ , I ) = " V " T H E N 8 1 5 58 1 b 5 O S $ = T S $ : F O R I = 1 T O J :

O S $ = O S $ + C H R $ ( Y A L ( T $ ( I ) ) ) : N E X T8 1 7 8 O S $ = O S $ + C H R $ ( . ) : S O S U B 1 8 : S O T o 8 8 8 5

8 9 9 9 R E H I N I T I A L I Z A T I O N9 . . . R E H A P P L E Y E R S I O N9 8 1 8 S O S U B 2 8 : I N P U T " S E H I N I O R E P S O N [ G / E l : " ; T V $9 . 1 1 I F T V $ = " S " T H E N T V = 1 : S O T O 9 1 . 89 8 1 2 I F T V $ = " E " T H E N T V = 2 : S O T O 9 5 . 89 8 1 9 S O T O 9 8 1 89 1 8 8 R E H S E H I N I C H A R A C T E R S E T S T R I N G S9 1 8 1 D I H A X $ ( 8 )9 1 8 2 A X $ ( 8 ) = " U S A "9 1 . 3 A X $ ( I ) = " E N S L A N D "9 1 8 4 A X $ ( 2 ) = " G E R " A N V "9 1 8 5 A X $ ( 3 1 = " D E N " A R K "9 1 8 b A X $ ( 4 ) = " F R A N C E "

-

--

--E

M

IN

I

9 1 . 7 A X $ ( 5 1 = · S N E D E N "9 1 8 8 A X $ ( b ) = " I T A L V "9 1 . 9 A X $ ( 7 ) ' " " S P A I N "9 1 1 8 A X = 7 : R E H N l I H . I J E RF C O L I N T R I E S9 1 2 . R E " S E " I N I C O H " A N D S T R I N S S9 1 3 1 S I t = E S $ + " 7 "9 1 4 8 P F $ = E S $ + " B " ~ ' C H R $ ( 1 1 1 R E " P I C A H O D E9 1 5 . E F $ = E S $ + " B " , . C H R $ ( 2 1 : R E " E L I T E ~ D E9 1 6 8 C F $ = E S $ + " B " ~ ' C H R $ ( 3 ) :

R E H C O N D E N S E D " I I D E

9 1 7 . S S t ' " E S $ + " S · ~ , C H R $ (8):

R E " S U P E R S C R I P T H O D E9 1 7 1 S B $ = E S $ + " S " + C H R $ ( 1 ) :

R E " S U B S C R I P T H i l D E9 1 8 . S L $ ' " E S $ + " " " : R E " S E T L E F T " A R S I N9 1 8 1 S Y $ = E S $ + I p l : R E H S E T Y E R T I C A L T A B9 1 8 2 S R $ = E S $ + "g": R E H R I S H T H A R S I N9 1 8 3 H " $ = " 1 4 4 " : R E H H I S H D E N S I T V L I N E S9 3 8 8 S O T O 9 8 8 89 5 8 . R E H E P S O N C H A ~ A C T E R S E T S T R I N S S9 5 . 1 D I " A U ( 9 )9 5 8 2 A X $ ( ' ) = " U S A "9 5 8 3 A X $ ( 1 1 ' " I F R A N C E '9 5 8 4 A X $ ( 2 ) = " S E R " A N ~ "

9 5 . 5 A U ( 3 ) . . " E N 6 L A N [ I "9 5 . b A X $ ( 4 ) = " D E N H A R K "9 5 8 7 A X $ ( 5 ) = " S N E D E N '9 5 8 8 A X $ ( b ) = " I T A L V "9 5 . 9 A X $ ! 7 ) ' " " S P A I N "9 5 1 . A X $ ( 8 ) ' " " J A P A N "9 5 1 1 A X = 8 : R E " N U H E I E R O F C O U N T R I E S9 5 2 . R E " E P S O N C O " H A N D S T R I N 6 S9 5 3 1 S I t ' " E S $ + " R " : R E M S E T I N T E R N A T I O N A L9 5 4 8 P F $ = E S $ + I p l : R E " P I C A " O D E9 5 5 . E F $ = E S $ + " H " : R E H E L I T E H O D E9 5 b . C F $ = C H R $ ( 1 5 ) : R E H C O N D E N S E D H O D E9 5 7 . S S t = E S $ + " S " + C H R $ ( 1 ) :

R E H S U P E R S C R I P T M O D E9 5 7 1 S a . = E S $ + I S " ~ ' C H R $ (8):

R E " S U B S C R I P T M O D E9 5 8 . S L $ = E S $ + C H R t , ( 1 ' 8 ) : R E " S E T L E F T M A R G I N9 5 8 1 S Y $ = E S $ + I B " : R E H S E T V E R T I C A L T A B9 5 8 2 H H $ = " 2 1 b " : R E H H I 6 H D E N S I T V L I N E H O D E9 5 8 3 S R $ = E S $ + " g a : R E H R I 6 H T " A R S I N9 8 8 8 R E H S T A N D A R D f i T R I N 6 S9 8 . 1 A A $ = " S T A N D A R D A S C I I " : A 2 $ = " F O N T P I T C H I S "9 8 8 2 B S $ = " P I C A " : P T $ ' " " I ' C P I / 8 8 C P L "9 8 8 3 B 3 $ = " N O N - E N L A R S , E D " : C S $ = ' N O N - D O U B L E S T R I K E "9 8 . 4 C 2 $ ' " " N O N - E H P H A E I I Z E D " : R C $ = " 8 ' " : L C $ = "I "9 8 . 5 R S $ = " R I 6 H T H A R S I N S E T T O " ;

D S $ = IN O R " A L H O [ I EI

9 8 . b L S $ = " L E F T " A R G I N S E T T O " : L T $ = " I " :L B $ . . " b "9 8 9 7 D 2 $ = " B I - D I R E C T I O N A L H O D E " :

L F $ = " L I N E F E E D l S "9 8 . 8 P L $ = " L L P = " : P N $ = " P L = " : H L $ = " H L = " :

B L $ = " L F B = I

9 8 . 9 F S $ = " b b " : F l $ = " 1 1 " : F 2 $ ' " " 1 " : F 3 $ = " 8 '9 8 1 9 R E H9 8 2 9 R E H C O " H O N C O " " I A N D S T R I N 6 S - 6 E M I N I A N D

E P S O N9 8 2 1 H R $ = E S $ + C H R t ( b 4 ) : R E H H A S T E R R E S E T9 8 2 2 S R $ = E S $ + "g"~. C H R $ ( 8 8 ) :

R E M S E T R I G H T " ~ R 6 I N 8 .

sPE

CIF

IC

CooE

E

PS

oN

S

PE

CIF

IC

CooE

No. 71 - April/May 1984 53ICRO

Page 56: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 56/84

9 8 2 3 I N . = E S . + " 4 " : R E M I T A L I C O N9 8 2 4 I X . = E S . + " S " : R E M I T A L I C O F F9 8 2 5 E M . = E S . + " N " + C H R . l l ) :

R E M E N L A R G E D M O D E O N9 8 2 b E Y . = E S . + " W " + C H R . ( 8 ) :

R E M E N L A R G E D M O D E O F F9 8 2 7 U N . = E S . + C H R S I - l ) : R E M U N D E R L I N E M O D E O N9 8 2 8 U F . = E S . + C H R ' ( - 8 ) : R E M U N D E R L I N E M O D E O F F

9 8 2 9 N M . = E S . + " T " : R E M T U R N S C R I P T M O D E O F F9 8 3 8 U D . = E S . + " U · + C H R ' ( I )

R E M U N I - D I R E C T I O N A L M O D E9 8 3 1 B D . = E S . + " U · + C H R . ( ' ) :

R E M B I - D I R E C T I O N A L M O D E9 8 3 2 L 8 . = E S . + " 8 " : R E M 1 / 8 I N C H L I N E S P A C E9 8 3 3 L l . = E S . + I l " : R E M 7 / 7 2 I N C H L I N E S P A C E9 8 3 4 L 2 . = E S . + " 2 " : R E M l I b I N C H L I N E S P A C E9 8 3 ~ L 3 . = E S . + " A " : R E M 1 / 7 2 I N C H L I N E S P A C E9 8 3 b L 4 . = E S . + " 3 " :

R E M X / 1 4 4 G E M I N I , X / 2 1 b E P S O N9 8 3 7 F L . = E S . + " C " : R E M F O R M L I N E S9 8 3 8 F l . = E S . + " C " + C H R . ( , ) :

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

9 8 3 9 S O . = E S . + " N " : R E M S K I P O V E R P E R F O R A T I O N9 8 4 8 S X ' = E S . + " 0 " : R E M T U R N S K I P O V E R O F F9 8 4 1 V T . = C H R . ( I I ) : R E M E X E C U T E V E R T I C A L T A B9 8 4 2 S R . = E S . + " g " : R E M S E T R I G H T M A R G I N9 8 4 3 T S . = E S . + " D " : R E M H O R I Z O N T A L T A B S E T9 8 4 4 S E t = E S . + " E " : R E M S E T E M P H A S I Z E D M O D E9 8 4 5 C E $ = E S . + " F " : R E M C L E A R E M P H A S I Z E D M O D E9 8 4 b S D . = E S $ + " S " : R E M S E T D O U B L E S T R I K E M O D E9 8 4 7 C D . = E S . + " H " : R E M C L E A R D O U B L E S T R I K E M O D E9 8 5 8 H D . = E S $ + " R " : R E M H E A D E R L I N E9 8 9 8 R E T U R N9 8 9 9 R E M9 9 8 8 R E M S Y S T E M S P E C I F I C S T U F F9 9 8 5 E S . = C H R . ( 2 7 ) : R E M E S C A P E C O D E9 9 8 b C R . = C H R . ( 1 3 ) :

R E M C A R R I A G E R E T U R N / L I N E F E E D - -9 9 8 7 S N . = C R . + " S E L E C T : " : R E M S E L E C T M E S S A G E

• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• P r i n t e r I n i t i a l i z a t i o n C o d e , I f •• R e q u i r e d , M u s t B e E n t e r e d H e r e . •

• •.• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •• •• T h e f o l l o M i n g s t a t e l e n t s s h o u l d b e •• a l t e r e d a c c o r d i n g t o y o u r p r i n t e r . •

• A s w e h a d a n 8 i n c h p r i n t e r M e s e t •• 1 8 C P I / 8 8 C P L ( l i n e 9 9 1 2 - 9 9 1 7 ) •

• •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •9 9 1 1 P X . = "I' C P I / 8 8 C P L "9 9 1 2 P C = B 8 : R E M C H A R A C T E R S P E R L I N E9 9 1 3 E X . = " 1 2 C P I / 9 b C P L "9 9 1 4 E C = 9 b : R E M C H A R A C T E R S P E R L I N E9 9 1 5 C x . = " 1 7 C P I / 1 3 b C P L "9 9 1 b C C = 1 3 b : R E M C H A R A C T E R S P E R L I N E9 9 1 7 E N . = " 5 , 0 , 8 . 5 C P I "9 9 2 8 R E T U R N

EPSoN

&

G

EM

I

NI

modules

S u b r o u t i n e s f o r A p p l e II

1 8 P R ' 7 : P R I I H O S ' ; : P R ' 8 : R E T U R N : R E M O U T P U T T O P R I N T E R1 9 P R I N T O S " : R E T U R N : R E M O U T P U T T O D I S P L A Y

2 8 H O M E : R E T U I ~ N : R E M H O M E C O M M A N D2 1 I N P U T N ' : I I E T U R N

S u b r o u t i n e s f o r F L E X u s e d o n C o l o r C O l p u t e r

1 8 P R I N T " . O S ' ; I R E T U R N : R E M O U T P U T T O P R I N T E R1 9 P R I N T O S ! I ; : R E T U R N : R E M O U T P U T T O D I S P L A Y2 . P R I N T C H I I . ( 1 2 ) p R E T U R N : R E M C L E A R S C R E E N2 1 I N P U T I t , N ' : R E T U R N

9 9 1 8 O P E N " " , P R I N T . S Y S " A S 8 : R E M O P E N P R I N T E R D E V I C E

S u b r o u t i n e s f o r F L E X u s e d o n F O C U S

1 8 P R I N T " , O S ' ; : R E T U R N : R E M O U T P U T T O P R I N T E R1 9 P R I N T O S . ; : R E T U R N : R E M O U T P U T T O D I S P L A Y2 . P R I N T C H i ~ . ( 1 1 l ; C H R . ( 2 4 ) ; : R E T U R N : R E M C L E A R S C R E E N

2 1 I N P U T 1 8 , N ' : R E T U R N

9 9 1 ' O P E N " : U A R A L L E L C M D " A S 8

S u b r o u t i n e s f o r C O l l o d o r e b 4 / V I C - 2 8

1 8 P R I N T : t 1 , 0 S ' ; : R E T U R N : R E M O U T P U T T O P R I N T E R1 9 P R I N T O S . ; : R E T U R N : R E M O U T P U T T O D I S P L A Y2 8 P R I N T { C L E A R } ; : R E T U R N : R E M C L E A R S C R E E N2 1 I N P U T N . : R E T U R N

9 9 1 8 C L O S E 1 : 0 P E N 1 , 4 : R E M O P E N P R I N T E R P O R T

S u b r o u t i n e f o r t h e A t a r i

U n f o r t u n a t e l y t h i s p r o g r a l c o u l d n o t b e a d a p t e d t o t h eA t a r i . T h e p l ' o b l ! l a r o s e i n t h e o u t p u t s t r i n g s t h a t h a dt o b e c o n c a t e n a t e d . G i v e n h o w l a b o r i o u s l y A t a r i h a n d l e sc o n c a t e n a t i o n a n d h O M o f t e n i t M o u l d h a v e t o b e u s e d i nt h i s p r o g r a l , c o n v e r s i o n M a s l a d e v i r t u a l l y i l p o s s i b l e .

1tICRO'"

54 MICRO No. 71 . Apri l/May 1984

Page 57: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 57/84

graphics with the Epson MX-80

D Uequipped with the Graftrax option. For

M P those with a parallel interface capable

of sending 8 bits, this program worked

flawlessly, but slowly. Let's face it, the

Apple p-code interpreter is generally

faster than BASIC, but it is not

exceptionally fast. In addition, one

must realize that the entire HiRes

screen contains 53,760 pixels. Each

pixel must be processed individually,by Robert D. Walker this accounting for the slow execution

cf this program.

In this article I have included a fast

768 byte machine language subroutine

which dumps the HiRes screen to the

Epson MX-80. In addition to the usual

dot-for-dot format (see figure I), I have

i.acluded an optional format for

creating an expanded printout (see

figure 2).Careful examination of figure

2 will reveal that each screen pixel is

printed as a two by two dot matrix.

To demonstrate the method of

calling this machine languagesubroutine from your own BASIC

program, I have included a useful

HI·RES SCREENfor the

EPSON MX·80

A machine language subroutine for dumping high

resolution Apple II graphics to the Epson MX·80

printer which allows choice of screen dump size.

Figure 2 Expanded Size Sereen Dump

Requirements:Apple II with 48K

Epson MX-80 equipped withGraftrax

8 bit parallel interface

In the February 1983 issue of MICRO I

published a short article which

included an Apple Pascal program forprinting the Apple II HiRes

(abbreviation for high resolution)

Figure 1 Normal Size Screen Dump

Table 1Screen Dump Memory Locations

Location Location DefaultHex Dec Explanation Value

$9300 37632 call this location to dump the screen normal size$9303 37635 call this location to dump the screen expanded

size$9306 37638 screen page, for HiRes 32

page 1 use $20 (32), for page 2 use $40 (63)$9307 37639 left column of screen area to be dumped DIV 7 0$9308 37640 right column of screen area to be dumped DIV 7 39$9309 37641 top row of screen area to be dumped DIV 8 0$930A 37642 bottom row of screen area to be dumped DIV 8 23$9308 37643 number of spaces in left margin of normal size

dump 16$930C 37644 number of spaces in left margin of expanded size

dump 10$930D 37645 byte exclusive-ored with image, 0 = normal image,

255 = reversed image. 0

No. 71 - April/May 1984 MICRO 55

Page 58: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 58/84

Listing 2

10 R E M * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *1 1 RE M * *12 R E M * P RO I JR A H : A P P L E II : > E P SO N M . x 80 *1 3 RE M * H I RE S S C RE E N D U I 1 P *14 R E M * ,1 5 RE M * A U T H O R : R O B E R T D , W A L K E R *10 WI * I 1 A RI E T T A , G A *1 7 RE M * •1 9 RE M * •

2 0 R EM * * * * • • * * * . * * * . * * * * * * * * * • • • • * * * * * * • • • • * * .2 1 R E I 1 • • I N I T I A L I Z E • •

1 0 0 H I I 1 E H : 3 7 63 1

1 10 0 $ = C H RS ( 4 )

1 2 0 P RI N T D S; " BL O A O D BJ , D U H P , A $ 9 3 0 ~ ·

1 3 0 S C = 3 2 : RE H S C R E E N P A G E

1 4 8 L C = 0 : R E I 1 L E F T S C R E E N C O L U I 1 N

1 5 0 R C = 2 7 9 : RE I 1 R I G H T S C R E E N C O L U M N

1 6 0 T R = 0 : R E I 1 T O P S C R E E N R O W

1 7 0 B R = 1 9 1 : R E I 1 B O T T O I 1 SC R E E N R O W

1 8 0 II;:6 : RE P ! L E F T H A R G I N i N O R M A L S I Z E D U H P )

1 9 6 L 2 = 1 0: R E M L E F T I 1 A R 6 I N ( E X P A N D E D D U M P )

2 ~ 0 1 M =~0 : R E H I H A G E ( 0 = N O R H A L , 2 5 5 = I N V E R S E )

2 1 0 R EM * . 6 E T P IC T UR E • •

2 2 0 H O M E2 3 0 V T A B ( 3 ) : H T A B ( 8 ) : P R I N T " A P P L E I I - ) E P S O N H X - 8 0 "

2 4 0 H T A B i l l ) : P RI N T ' H I R E S S C R E E N D U M P "

2 5 0 V T A B ( 1 8 ) : I N P U T " F I L E N A H E - " ; F $

2 6 8 I F L E N I F S ) = 0 T H E N E N D

2 7 0 H O M E : F L A S H : P R I N T " L O A D I N G " j F $ : N O R H A L

2 8 0 P RI N T D S; " BL O A D " j F $ j D , A $ 28 8 S "

2 9 8 P O K E - 1 0 2 9 7 , 0

3 i ! i 0 P O K E - 1 6 3 8 4 , 0

3 1 0 P O K E - 1 6 3 8 2 , 8

3 2 0 F O R 1 = 1 T O 1 0 8 8: N E X T

. ) . :- 0 O K E - 1 6 3 01 , 0

3 4 0 V T A B ( 2 3 ) : P R I N T " H I T S P A C E T O C O N T I N U E " , " ;

3 5 0 6 E T A S

3 6 0 R E M • • S E L EC T S I Z E A N D P A R A H E T ER S . *3 7 ~ T E X T : H O H E

3 8 0 P RI N T " N I O R I 1A L S I ZE D U H P "

3 9 0 P RI N T " E i X P A N D ED D U H p ·

4 0 0 P R I N T : G E T A $

4 1 0 I F A $ ( ) " N u A N D A $ ( ) " E " G O T O 3 7 8

4 20 I F A S = ' N ' T H E N F 2 = 1 : G O T O 4 4 8

4 3 @ F 2 = 2

4 4 0 H O M E

4 50 P RI N T · SC R E E N D U M P P A R A I 1 E T ER S : "

4 6 0 P R I N T

4 7 0 P R I N T · 1 . S C R E E N P A G E " ; : H T A B ( 3 5 ) : P R I N T S C

4 8 0 P R I N T " 2 . L E F T S C R E E N C O L U M N ' ; : H T A B ( 3 5 ) :

P R I N T L C

4 9 0 P R I N T · 3 . R I G H T S C R E E N C O L U I 1 N " j : H T A B ( 3 5 ) :

P RI N i R C

5 0 0 P R I N T ' 4 . T O P S C R E E N R O W " ; : H T A B ( 3 5 ) : P R I N T T R

5 1 0 P R I N T " 5 . B O T T O H S C R E E N R O W " j : H T A B ( 3 5 ) :

P RI N T B R5 2 0 P R I N T ' 6 . L E F T H A R G I N " ; : H T A B ( 3 5 )

5 3 0 I F F 2 = 1 T H E N P R I N T L l : G O T O 5 5 8

5 40 P R I N T L 2

5 5 0 P R I N T " !. I H A G E " ;: H T A B ( 3 5 ) : P R I N T 1 M

5 6 0 V T A B ( 1 5 ) : P R I N T " E N T E R P A R A H E T E R N U H B E R T O H A K E

C H A N G E S . "

5 7 0 P R I N T · W H E N N O H O R E , H I T R E T U R N , "

5 B ~ V T A B m: G E T A S

5 9 8 A = A S C l A S ) - 4 8

0 8 0 I F A = - 3 5 G O T O 7 2 8

6 1 ~ O N A G O T O 6 3 0 , 64 0 , 65 8 , 66 9 , 67 8 , 68 0 , 71 0

62 ~ G O T O 4 4 8

6 3 0 I N P U T " S G R E E N P A 6 E - " j S C : G O l D 4 4 0

6 4 8 I N P U T " L E F T S C R E E N C O L U H N - ' j L C : G O T O 4 4 0

6 5 0 I N P U T u R: : G H T S C R E E N C O L U H N - " j R C : G O l O 4 4 0

66 0 I N P U T " T O P S C R E E N R O W - ' ; T R : G O T O 4 4 0

b i t I N P U T " BU n O I l S C R E E N R O W - " j B R : 6 0 T O 4 4 8

0 8 8 I N P U T u L E F T H A R 6 I N - " ; L6 9 0 I F F 2 = : . T H E N II= L : 6 0 T O 4 4 9

7 80 L 2 = L : G i n O 4 4 0

7 1 8 I N P U T " I r l A 6E - " j I H: G O lO 4 4 8

72 0 RE H U S E N D P A R A H E T ER S T O H A C H I N E L A N G U A G E R O U T I N E

7 3 8 P O K E 3 7 6 ; ;8 ,S C

7 4 0 P O K E 3 7 6 ~ 9 , I N T ( L C !)

7 50 P O K E 37048 , I N T I R C , : 7 l

7 60 P O K E 3 7 6 4 1 , I N T nR / 8 )

7 7 0 P O K E 3 7 M 2 , I N T i B R / 8 )

7 8 0 P O K E 3 7 6 43 , L l

7 9 0 P O K E 3 7 6 44 , L 2

8 0 0 P O K E 3 7 6 45 , I M

8 1 0 R E H U D I JH P I I t A G E T O P RI N T ER U

8 28 H O I 1 E : V T A B ( 18 ) : F L A SH : P RI N T " D U MP I N G I I1 A GE . ':N O R H A L

8 3 8 P R I N T " H I T E S C T O S i O P A T A N Y T I M E . . . I

8 4 9 I F F 2 = 1 T H E N C A L L 3 7 6 3 2 : G O T O 2 2 0

8 5 0 C A L L 3 7 6 3 5 : G O T O 2 2 0

Listing 1

i i . * • • • * . J • • • * • • • • • • • • i • • * • • • * * * • • * * * • •

i *; * A P P L E II-:;P SO N H I - B 0 j

; * H I R E S S C R EE N D U H P R O U T I N ES *

; * *j * R O B E R T D . W A L K E R •

j * M A RI Ei T A . 6 A *j' *i * ' • • * * * J • • * * i " ' * * ' * ' * " ' * ' , * . * • • • * • • f;

; • • • , * . * • • • • * • • * • • * • • • • • • • • • • • • • • • • * .i . S U B R O U f I N E W R I T T E N F O R T H E •

; * E P SO N ~ X - 8 @ W I T H G RA F T RA X O P T I O N *j * •; ' H I I I E M S H O U L D B E S E T L O W E R T H A N *i' 3 7 63 2 ( $ 9 3 0 0 ) F O R A 4 B K S Y S T E M •

i . * • • • * . * • • • * • • • * • • • • , . t ' . * " * * • • • • • t!

; Z E R O P A G E U S A G E0 0 F C B L K P T E Q U $ 0 0 F C

f . 0 F E T B L K P T E g U $ t 1 0 F E

; P O I N T E R T O B L O C K

; i E H P P O I N T E R T O B L O C K

; M I SC C O N S T A N T S A N D L O C A T I O N S

0 ~ I ( B E S C E ! i U W i 9 B ; I N T E R R U P T K E Y

C 9 0 0 K E Y D A T A E i i U $ C 0 8 0 ; K E Y B O A R D D A T A L O C A T I O N

C 0 1 0 K EY ST RB HlU S C 0 1 0 ; K E Y B O A R D S T R O B E L O C A T I O N

;

; P RI N T E R S L O i 1 1

C 0 9 8 P R O U T E Q U $ C 0 9 0

C 1 C I P R W A I T E Q U $ C 1 [ : 1

i P RI N T ER O U T P U T L D C A T I O N

; C H E C K I F P R I N T E R R E A D Y L O C

56 No. 71 - April/May 1984ICRO

Page 59: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 59/84

9 3 0 t l O R G $ 9 3 9 0

R O U T I N E E N T R Y P O I N T S9 3 0 0 4 C 2 2 9 3 J l t P D U l t P9 3 0 3 4 C 9 8 9 3 J M P D U l t P E

j P A R A M E T E R S9 3 0 6 2 t l S C R N P 6 B Y T $ 2 09 3 ~ 7 ~ 0 l e O l B Y T $ 0 0

9 3 0 8 2 7 R e D l B Y T $ 2 79 3 @ 9 0 0 T R O W B Y T $ 0 i9 3 9 1 \ 1 7 B R O W B Y T $ 1 79 3 0 £ 1 HI U 1 A R 6 B Y T $ 1 09 3 0 C ~ A L l t A R f i E B Y T $ e A9 3 0 0 ~ ~ I M A G E B I T $ 0 0

; T E l ' I PS T O R A 6 E9 3 0 E 0 0 R O W B Y T 09 3 ~ F ~ii C O L B Y T 09 3 1 0 0 t l B l K R O W B Y T it9 3 1 1 iii! B l K C O L B Y T "9 3 1 2 ~iI E X B Y T E B Y T it

9 3 1 3 ~0 T I l l E B i T @

9 3 1 4 ilil l ' I U L T I B I T 01 1 3 1 5 ~0 H U L T Z B Y T iI

9 3 1 6 0 0 ~iI P R O D B Y T 0 , i l9 3 1 8 0 i ! iii! D U T S B Y T i I , 09 3 1 A i l i liii! i l 0 B l K T A B B Y T 0 , i I , 0 , 0 , 0 , i 1 ! 0 , ~

j •••••••••••••••••••••••••••••••••••

; . D U l t P T H E H i R E S S C R E E N , D O T F O R .j' D O T - - N O R M A L S I Z E •j,••••••••••••••••••••••••••••••••••

9 3 2 2 A 9 B B D U M P9 3 2 4 2~ 77 9 59 3 2 7 A D 0 9 9 3

9 3 2 A 8 0 i l E 9 3

L D A l $ i l BJ S R L I N E 5 P Cl D A T R O WS T A R O W

; L I N E S P A C I N Gj - S D O T Sj S T A R T A T T O P

P R I N T O N E R O W O F B l o n : - -; I . E . B R O W S O F D O T S

9 3 2 D 2 i l 6 4 9 5 P R O W J S R C H K K E Y9 3 3 e A D i l B 9 3 L O A U 1 A R 69 3 3 3 2 ~ 8 9 9 5 J S R T A B9 3 3 6 A D i l 7 9 3 L D A L C O L9 3 3 1 1 S D ~ F 9 3 S T A C O L9 3 3 C 3 8 S E C9 3 3 0 A D i t s 9 3 l D A R C O l9 3 4 0 E D i l 7 9 3 S B C l C O L1 1 3 4 3 B O 1 4 9 3 5 T A H U L T I

9 3 4 6 E E 1 4 9 3 I N C I I U L T I9 3 4 9 A 9 0 7 l D A 1 $ 0 79 3 4 B 8 D 1 5 9 3 S T A I I U L T 29 3 4 E 2 0 4 4 9 5 J S R I t U L T P L Y9 3 5 1 2 0 B b 9 5 J S R P D O T S9 3 5 4 A D 1 0 9 3 L D A P R O D9 3 5 7 2 0 ' I F 9 5 J S R P R C O U T9 3 5 / \ A D 1 7 9 3 L D A P R O D + l9 3 5 D 2 i l 9 F 9 5 J S R P R C O U T9 3 0 i l 2 0 C 0 9 4 P B L K J S R C A L C B L K9 3 6 3 2 ~ A 3 9 4 J S R R O T B L K9 3 6 6 A 2 0 0 l D A 1 $ 0 09 3 6 B F D I i i 9 3 P C O l l O A B l K T A B , X

No. 71 - April/May 1984

I N T E R R U P T ?L E F T K A R 6 I N

S T A R T A T L E F T

C O I I P U T E R 1 D O T SI N O N E R O M

T E l l P R I N T E R D O T S I N R O W

; C A L C A D D R E S SR O T A T E I l t A 6 E

G E T B Y T E

MICRO

S A F E W A R E S M n su r an c e p ro v id e s f u ll

r e p l a c e m e n t o f h a r d w a re , m e di a a n d

p ur c h a s e d s o f tw a r e a ft e r a l o w $ 50 d e d uc ti b le .

A s l i t t l e a s $ 3 5 /y r c o v e r s :

• F ir e • T h e f t • P o w e r S u r g e s

• E a r t h qu a k e • W a t e r D am a g e • A u t o A C C id e n t

S e l e c t t h e c o ve ra g e y o u w a n t f r o m t h e t a b le .Amount or Insurance Annual Premium

u p 10 $ 2.000 $ 3 5$ 2,0 01-$ 5.0 00 $ 60

$ 5 ,001 -$ 8 . 000 $ 75

$ 8 . 0 0 1- $ IJOOO $ 90

$11.001-$14,000 $105

Ca ll f or h i gh e r c ov er ag es .

N O I a v a n InI - K . o c . H I . K Y . \. , I I F ' > IS .) I V , S C . O r W Y .

C a l l fo r immed iat e p ro tect ion .

l -S00-S4S-3469(In Ohio cat l l-BOO-84B-2112)

@ a n E ll IR E )C O LU M B I A N A T I O N A L G E N E R A L A G EN C Y

Subscribers .Check Your Labels !

As part of our recent

reorganization, we have changedsubscription fulfillment houses.

As programmers, you can

appreciate that any change such

as this, no matter how carefuUy

done, is likely to cause some

errors during the transition

period. This is especially true

with the foreign subscriptions.

While the new system uses a

better method of generating

country information, we had to

make some guesses in

converting from the existing

labels.

Please examine your

subscription label on this issue

of MICRO. If you find any

problems - wrong address,

incorrect spelling, incorrect zip

code, etc. - please notify us

immediately.

MICRO CirculationP.O. Box 6502

Chelmsford, MA 01824

57

Page 60: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 60/84

Applesoft program for loading and

printing HiRes pictures.

The Machine Language Subroutine

Listing 1shows the assembly listing of

the screen dump subroutine. In this

listing the subroutine was assembled to

reside in memory locations $9300

through $95FF, just below DOS for a

48K system. Table 1 shows the

important memory locations for calling

this subroutine.

As shown in Table I, the area of the

screen to be printed is determined by

four parameters: left ($9307), right

($9308), top ($9309), bottom [$930A).

These parameters require special

consideration.

The left and right parameters are

each divided by 7. Assume,for

example, that the entire screen is to be

printed. The far left column would be

0, while the far right column would be

279. Dividing both of these numbers by

7and taking the integer portion yields 0

and 39, respectively. Thus the value 0

would be stored in location $9307. In

addition, the value 39would be stored

in location $9308.

The top and bottom parameters are

each divided by 8. In keeping with the

Applesoft standard, the top row would

be0, and the bottom row would be 191.

Dividing both of these values by 8 and

taking the integer portion yields 0 and

23, respectively. In a similar manner,

the value 0would be stored in location

$9309, and the value 23 stored in

location $930A.

This technique of dividing the

parameters by 7 or 8 significantly

shortens the size of the screen dump

subroutine. The one drawback,

however; is that the screen area to be

printed cannot be specified exactly.

Instead, it is specified in blocks of 7

dots horizontally and 8 dots vertically.

Another feature of this subroutine is

the ability to terminate the screen

dump at any time simply by pressing

the escape key. Pressing this key willreturn control to the calling program.

The following instructions show

the steps required in creating a binary

disk file containing this object code.

1. Protect memory locations above

$92FFby setting high memory pointers

to $92FF (37631). While in Applesoft

type "HIMEM: 37631".

2. Enter the monitor by typing "CALL

-151" .

9 3 6 B 4 D 0 D 9 39 3 b E 2 0 9 F 9 59 3 7 1 E B9 3 7 2 E 0 0 79 3 7 4 D 0 F 29 3 7 6 A D 8 F 9 39 3 7 9 C D 0 B 9 39 3 7 C F 0 8 09 3 7 E E E 0 F 9 39 3 8 1 4 C 6 0 9 3

9 3 8 4 2 0 9 B 9 5

9 3 8 7 A D 0 E 9 39 3 8 A C O r J A 9 39 3 B D F 0 0 09 3 B F E E 0 E 9 39 3 9 2 4 C 2 0 9 39 3 9 5 4 C 7 5 9 5

E O R I M 6 EJ S R P R C O U TI N XC P X U 0 7B N E P C O ll O A G O lC l i P I I C O lB E Q I ~ E X R O WI N C C O LJ H P P B l K

N E l R O W J S R C R l F

C A L C U L A T E N E ) : T R O i ll O A H O WC l i P B R O WB E Q n O N EI N C H O WJ I I P P R O W

D O N E J I 1 P t ( E S E T P R

7 a n E S / B l K

j

D U I I P E l O A H 0 7J S R U N E S P Cl O A H C O lS T A ( O l

D O N E W I T H a u : ?

O U T P U T C R j I F

D O N E 'i

j R E S E T P R I N T E Rj

. ; • •• •• •• •• •• •• t • •• •• •• •• •• •• •• •• •• •• •

j ' D U I I P T H E W i R E S S C R E E N , E X P A N D E D •j ' V E R S I O N . E A C H D O T O N S C R E E N I S •" R E P R E S E N T E n B Y 4 D O T S O N T H E •

j ' P R I N T E R ( 2 D O T S l 2 D O T S ) . •; .

L I N E S P A C I N G= 7 D O T SS T A R T A T R I G H T

, P R I N T F A R R I E i H T D O T S I N O N E [ G L U Mj O F B L O C K - - ; ' C O l U I I N S O F D O T SP C O l R J S R C H K K E Y

l O A 1 . I 1 A R 6 EJ S R l A BS E Cl D A E : R O I r iS B C T R O WS T A ~ l l J L T 1

I N C , t U L T Il O A 1$10

S T A t l U l T 2J S R ~ ; U L T P l'j

J S R 1 ' D O T Sl O A F R O OS T A 1 i 0 T SJ S R F R C O U Tl O A P R O D + lS T A W T S + lJ S R P R C D U Tl D A l R O WS T A H O I I

P C O l R I J S R ( A l C B l K

I N T E R R U P T ?

l E F T I I A R G I N

C O M P U T E R D O T SIi \ O N E C O L

T E l l P R I N T E R D O T S I N C O L

S A V E ID O T S

S T A R T A T T O P

C A L C A D D R E S S

C R E A T E E X P A N D E D B Y T E S F R O I I 4 I I S B FB L O C K T A B L E , T H E N P R I N T

l O X H 0 0P C O l R 2 l O A 1 $ 0 8

S T A U B Y T ER O l E l K T A 8 , X

MICRO

D I S C A R D I I S B

58 No. 71 . April/May 1984

9 3 9 8 A 9 0 79 3 9 1 \ 20 77 ' 1 59 3 9 0 A D t i B 9 39 3 A 0 8 0 0 F 9 3

9 3 A 3 2 6 6 4 9 59 3 M A D ~ C 9 39 3 A 9 2~8 9 9 59 3 A C 3 B9 3 A D A D ~ A 9 39 3 8 0 E D 6 9 9 39 3 8 3 8 0 1 4 9 39 3 B o E E 1 4 9 39 3 8 9 A 9 1~

9 3 B B 8 0 1 5 9 39 3 B E 2 0 4 4 9 59 3 C l 2 0 B 6 9 59 3 ( 4 A D 1 0 9 39 3 C 7 8 0 1 8 9 39 3 C A 2 0 9 F 9 59 3 C D A D 1 7 9 39 3 D i I 8 0 1 9 9 3

9 3 0 3 2 0 9 F 9 59 3 0 6 A D 0 9 9 39 3 0 9 B D 0 E 9 39 3 D C 2 6 C 0 9 4

9 3 D F 1 \2 6 09 3 E l A 9 6 69 3 E 3 B D 1 2 9 39 3 E 6 3 E 1 1 \ 9 3

Page 61: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 61/84

9 3 £ 9 A ~ ~ 3 l D Y Uil3

9 3 E B B D I i i 9 3 P C O l R 3 l D A B l K T A B , X9 3 E E 2 A R O l9 3 E F 2 E 1 2 9 3 R O l E X B Y i E9 3 F 2 3 E l A 9 3 R O l B L K T A B . X

9 3 F 5 2 E 1 2 9 3 R O l E X B Y T E9 3 F 8 B 8 D E Y1 1 3 F 9 C i l ~ ~ C P Y Ui!i!

9 3 F B D ~ E E B N E P C O l R 39 3 F I i 3 E I i i 9 3 R O l B l K T A B , X9 4 6 i 1 2 E 1 2 9 3 R O l D B Y T E9 4 0 3 2 0 9 1 \ 9 4 J S R P l B Y T E P R I N T B Y T E9 4 i 1 6 2 ~ 9 1 \ 9 4 J S R P X B Y T E T W I C E !9 4 0 9 £ 8 I N X9 4 6 1 \ E 0 08 C P X U 08 D O N W W I T H I 1 L K ?9 4 0 C D ~ D 3 B N E P C O l R 21 1 4 0 E A D il E 9 3 L D A R O W D O N E W I T H C O L ?9 4 1 1 C D il A 9 3 C M P B R O W1 1 4 1 4 F i l ilb B E n P C O l R 49 4 1 6 E E i l E 9 3 I N C R O W9 4 1 9 4 C D C 9 3 J M P P C O l R I9 4 1 C 2 0 9 8 9 5 P C O L R 4 J S R C R l F ; P R I N T C R , L F

; P R I N T F A R l E F T D O T S I N O N E C O L U M N; O F B L O C K S - - 7 C O L U M N S O F D O T S

9 4 1 F 2 0 6 4 9 5 P C O L l J S R C H K K E Y I N T E R R U P T ?

9 4 2 2 A D i l C 9 3 L D A l l ' l A R G E l E F T I I A R 6 I N9 4 2 5 2 i1 8 9 '9 5 J S R T A B9 4 2 8 2 0 B 6 9 5 J S R P D O T S T E l l P R I N T E R D O T S I N C O L9 4 2 B A D 1 8 '1 3 l D A D O T S9 4 2 E 2 ~ 9 F 9 5 J S R P R C O U T9 4 3 1 A D 1 9 9 3 l D A D O T 5 + 19 4 3 4 2 @ 9 F 9 5 J S R P R C D l I T9 4 3 7 A D 0 9 l i 3 l D A T R O W S T A R T A T T O P9 4 3 i i S D i i E '1 3 S T A R O W9 4 3 D 2 0 C @ 9 4 P C O l L J J S R C i l l C B l K C A L C A D D R E S S

9 4 4 0 A 2 6 0

9 4 4 2 A 9 ~ii

9 4 4 4 8 0 1 2 9 39 4 4 7 J E l A t ;3

9 4 4 1 \ 3 E l A 9 39 4 4 0 3 E I i i 9 39 4 5 i 1 3 E l A 9 39 4 5 3 3 E l A 9 3

9 4 5 6 2 E 12 9 39 4 5 9 A i l ~ 3

9 4 5 1 1 B D I A 9 39 4 5 E 2 A9 4 5 F 2 E 1 2 9 3

9 4 6 2 3 E l A 9 3

9 4 6 5 2 E 1 2 9 3

9 4 6 8 S S9 4 6 9 C i l !iii9 4 6 B 0 0 E E9 4 6 D 2 0 9 1 \ 9 49 4 7 ~ 2 0 9 1 \ 9 4

9 4 7 3 E B9 4 7 4 E ~ 0 8

C R E A T E E X P A N D E D B Y T E S F R O I I 4 l 5 B FB L O C K T A B L E . T H E N P R I N T

l D X 1$00

P C O L l 2 l O A l $ i l 0

S T A E X B Y T ER O l B l K T A B , XR O l B l K T A B . XR O l B l K T A B , XR O l B l K T A D . XR O l B l K T A D . X

R O l E X B Y T ElilY IU 3

P C O l l 3 l O A B l K T A B , XR O LR O l E X B Y l ER O L B L K T A B . XH O l £ l B Y T ED E Y

C P Y UBiiB N E P C O l L 3J S R P X B Y T EJ S R P A B Y T EI N XC PX U ~ 8

D I S C A R D 4 I 1 S B

G E T 4 L S B

; P R I N T B Y T ET W I C E ~

D O N E W I T H B L O C K ?

No. 71 - April/May 1984 MICRO

:::. Enter the binary code into

locations $9300 through $95FF. For

example, the first 8 bytes would be

entered as follows:

9300:4C 22 93 4C AA 93 20 00

See page 44 of the Apple II Reference

M.anual for more detail.

4. Exit the monitor by typing a

control-B followed by a return.

5. Save the object file to the disk by

typing:

"BSAVE OBJ.DUMP,A$9300,L$2FF"

To use this subroutine as part of a

BASIC program it is first necessary to

protect all memory locations above

$92FF (37631). In Applesoft this is done

by the command HlMEM: 37631.

Second, the object code must be loaded

hom the disk. In this case one would

type "BLOAD OBl.DUMP ,A$9300" .

The subroutine is now ready for use.

The BASIC Program

Listing 2 is the BASIC program which

demonstrates the use of the screen

dump subroutine. This program

provides an easy means of loading,

d:.splaying and dumping HiRes

graphics.

The program consists of five main

parts. Lines 100 through 200 load the

object code and initialize the screen

dump parameters. Lines 210 through

350 prompt the user for the binary file

name. Line 280 will then load the

image into HiRes page 1.

The third section of this program,lines 360 through 710, allows the user

to select different screen dump

parameters. When first run, these

parameters are set to the default values

shown in Table 1.

Lines 730 through 800 pass the

screen dump parameters to the

machine language subroutine through

the use of POKE statements.

The final section, lines 810 through

850, calls either the normal or

expanded size screen dump subroutine.

Once the screen dump is complete or

terminated by pressing the escape key,control is once again returned to the

Applesoft program.

Concluding Remarks

I have used this subroutine since

August 1981, and have found it towork

quickly and flawlessly. I am presently

werking on linking this machine

language subroutine into an Apple

Pascal library unit. This will improve

upon the program published in Micro,

February 1983.

59

Page 62: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 62/84

9 4 7 6 D 0 C l i9 4 7 8 A D ~ E 9 39 4 7 B C D ~ A 9 39 4 7 E F 0 06

9 4 8 0 E E 0 E 9 39 4 8 3 4 C 3 D 9 49 4 8 6 2~ 9 8 9 5 P C O L L 4

B N E P C O L L 2L D A R O WC M P B R O WB E Q P C O L L 4I N C R O WJ I I P P C O L L IJ S R C R L F ; P R I N T C R , L F

; D O N E W I T H C O L ?

;; C A L C U L A T E N E X T C O L U I I N

9 4 8 9 A D 0 F 9 39 4 B C C D 0 7 9 39 4 8 F F 0 ~ 69 4 9 1 C E ! I F 9 39 4 9 4 4 C A 3 9 39 4 9 7 4 C 7 5 9 5 D O N E E

L D A C O LC l i P L C O LB E g D O N E ED E C C O LJ I ' I PP C O L RJ I ' I PR E S E T P R

; D O N E ?

; R E S E T P R I N T E R

; .; ' P R I N T B Y T E •; .

9 4 Q A A D 1 2 9 3 P I B Y T E9 4 9 D 4 D ~D 93

q 4 A 0 4 C Q F 9 5

L D A E X B Y T EE O R I I ' I A G EJ I 1 P P R C n U T

9 4 A 3 A~ ~7

'1 4 A 5 A 2 0 7

9 4 A 7 5 E I A 9 39 4 A A 6 A9 4 A B C A9 4 A C E 0 F F9 4 1 \ E D~ F7

9 4 8 0 4 89 4 B I 88

9 4 B 2 D ~ F I

9 4 B 4 A Z 0 6

9 4 B 6 6 8

9 4 B 7 9 D l A 9 39 4 B A C A9 4 B B E 0 F F9 4 B D D 0 F7

9 4 B F b tl

,; • • • • • • • • • • • • • • • • * • • • • • • • • • • • • • • • • • • •; ' R O T B L K - R O T A T E B L K T A B L E S O T H A •

; ' B I T S A R E ~ G T A L i G N E D F O R P R I N T - •: . I N G T O P O F I I ' I A G EA T T O P O F P A P E R .: . * • • • • • • • • • • • • • • • • • • • • • • • • • * • • • • • • • •

j

R O T B L K L D Y 1 $ 0 7R O T F L K I L D X 1 . 8 7

; 7 B I T S; 8 B Y T E S

9 4 C 0 A 9 0 09 4 C 2 8 5 F C9 4 C 4 A D 0 6 9 39 4 C 7 8 5 F D

C A L C F L K L D A U ~ 0S T A B L K P TL D A S C R N P 6S T A B L K P T + I

: B L K P T = S C R N P G

i M A K E B Y T E F R O I I L S B B I T S I N B L n A B

H A K E B Y T L S R B L K T A B , XR O RD E A

C P X I $ F FB N E I 1 A K E B ' I TP H A j P U S H B m O N S T A C KD E YB N E R O T B L K I

; M A K E N E W B L K T A B F R O M 7 B Y l E S; S T O R E D O N S T A C K

6 E T B L KG E T B T T E

; 7 B Y T E S; P O P B Y T E O F F S T A C K

; A = 1 ' 1 0 , 1 ' 1 1 , 1 1 3F R O W

9 4 C 9 A 9 a 0 L D A H80 ; B L K P , =

9 4 C B a D 1 4 9 3 S T A I ' I U L T I ; B L K P T + i i : $ B I 1

9 4 C E A D t i E 9 3 L D A R O i l

M A S K O F F A

9 4 D I 2 9 0 7 A N D »$67 ; M A SK = i 0 ~ ~ i l i l

9 4 D 3 8 D 1 5 9 3 S T A I I U L T 29 4 D 6 2 0 4 4 9 5 J S R H U L T P L Y9 4 D 9 1 8 C L C9 4 D A A S F e L D A B L K P ,9 4 D C 6 D 1 6 9 3 A D C P R O D9 4 D F 8 5 F C S T A B L K P T9 4 E I A 5 F D L O A B L K P T + I9 4 E 3 6 D 1 7 9 3 A D C P R O D + 19 4 E 6 85 F D S T A B L K P T + I

; B = 1 1 4 , 1 ' 1 5F R O W

9 4 E 9 A 9 2 8 L D A U 2 9 ; B L K P T =9 4 E A 8 D 1 4 9 3 S T A M U L T i ; B L K P T + 8 H 2 B9 4 E D A D ~ E 9 3 L O A R O W

;

j M A S K O F F B T H E N S H I F T T O L S B P O S I I O N

9 4 F ! I 2 9 18 A N D 1 $ 1 89 4 F 2 4 A L S R9 4 F 3 4 A L S R9 4 F 4 4 A L S R

9 4 F 5 B D 1 5 9 3 S T A H U L T 29 4 F B 2 i 1 4 4 9 5 J S R I ' I U L T P L Y9 4 F B I B C L C9 4 F C A S F C L D A B L K P T9 4 F E b D 1 6 9 3 A D C P R O D9 5 0 1 8 5 F C S T i i B L K P T9 5 0 3 A 5 F D L D A B L K P T + 19 5 t J 5 b D 1 7 9 3 A D C P R O D + I9 5 0 8 a s F D S T A 8 L K P T + 19 5 1 1 A 1 8 C L C9 5 0 B A 5 F C L D A B L K P T9 5 0 D 6 D 0 F 9 3 A D C C O L9 5 1 0 a s F C S T A B L K P T9 5 1 2 A 5 F D L D H B L K P T + I

9 S 1 4 6 9 0 0 A D C U 3 1 19 5 1 6 8 5 F D S T I i B L K P T + I

j B L K P T =; B L K P T + C O L

L D X U t J 6P L A

S T A B L K T A B , XD E XC P X I I $ F FB N E 6 E T B Y T ER T S

; * • • , . , . * • • • • • • • • • • • • • • • • • • • • • • * • • • •jf C A L C U L A T E B L K P T ( B L O C K P O I N T E R ) - •; ' B L K P T I S T H E A D D R E S S O F T H E T O P •j ' B Y T E I N T H E B L O C K D E F I N E D B Y R O W .; ' A N D C O L . •

; * • • * * * . * * * * * * * * * * . * • • * * * * * * * * * . * * * * .

; • • • • • • • • • • • • • • • • • • • • • • • • • • • 1 * • • * • • * .• S T O R E B B Y T E S O F B L O C K i B l K P T l I •• B L O C K T A B L E ( B L K T A B ) . T O P B Y T E •• I S S T O R E D I N B L K T A B , t J f

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

9 5 1 8 A S F C9 5 1 A 8 5 F EQ 5 1 C A S F D9 5 1 E 8 5 F F

S T O B l K L D A B L K P TS T A T B L K P TL D A B L K P T + IS T A T B L K P T + 1

; I N I T I A l ! i E; T B L K P T W I T H; B L K P T

60 MICRO No. 71 . April/May 1984

Page 63: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 63/84

9 5 2 0 A 9 ~iI L O A ' U t i ; S T A R T A T T O P9 5 2 2 S D 1 1 3 9 3 S T A B L K R O W ; O F B L O C K9 5 2 5 A 2 il 0 S T O B Y T E L O X 1 $ 1 3 £ 1 ;S A V E B Y T E I N9 5 2 7 A l F E L O A I T B L K P T , X ) , T E I I P L O C9 5 2 9 4 8 P H A9 5 2 A A O 1 0 9 3 L O A B U : R O W ; S A V E T E I I P9 5 2 0 A A T A X ; I N B L K T A B9 5 2 E 6 8 P L A9 5 2 F 9 D I i i 9 3 5 T A B L K T A B , A9 5 3 2 1 8 C l C ; T B L K P T =

9 5 3 3 A 5 F F L D A T B L K P T + l ; T B L K P T + $ 4 £ 1 £ 19 5 3 5 6 9 1 3 4 A D C 1 $ 1 3 4l I 5 3 ! 8 5 F F S T A T B L K P T + 19 5 3 9 E E 1 1 3 9 3 I N C B L K R O W ; C O U N T B Y T E Sl I 5 3 C A D 1 £ 1 9 3 L D A B L K R O W ; B B Y T E Sl I 5 3 F C 9 £ 1 8 C M P 1 $ 1 3 8 j T R A N S F E R R E D ?

9 5 4 1 O £ l E 2 B N E S T O B T T E9 5 4 3 6 £ 1 R T S

9 5 4 4 A 2 il S

9 ~ , 4 6 A 9 00

9 5 4 B B D 1 7 9 3

9 5 4 B £ l Ai i 5 4 C 2 E 1 7 9 39 5 4 F ! ! i E1 4 9 3< ; 5 5 2 9 £ 1 il q

9 5 5 4 1 89 5 5 5 6 D 1 5 9 39 5 5 8 9~ il3

9 5 5 A E E 1 7 9 39 5 5 D C A9 5 5 E D @ E B9 5 6 @ B D 1 6 9 395b~. bi l

9 5 b 4 A D ~ 0 C ~ 1

9 5 6 7 8 D H i C ~

9 5 b A [;9 6 09 5 b C 9 ~ 0 0

9 5 b E C 9 9 B9 5 7 0 D ( o £ 1 29 5 7 2 6 B9 5 7 3 6 89 5 7 4 6 0

9 5 7 5 A 9 0 C

; " " " " " " " " " " " " " " " " " "; ' B , B B I T I I U L T I P L I C A T I O N ,; ' P R O D = M U L T I ' I I U L T 2 ,

; " " " " " " " " " " ' , .

M U L T P l Y L D . X U 0 B

L D A 1 $ 0 0S T A P R O D + l

S H I F T L A S LR O L P R O D + 1A S L ! ' I U L T IB c e C H E C K e TC L CA O C M U L T 2B C C C H E C K C TI N C P R O O + l

C H E C K C T onB N E S H I F T LS T A P R O DR T S

; M U L T 8 B I T S; C L E A R I I S B P R O D

; C H E C K B I T; A D O T O P R O D

; O O N E ?

; •••• 1••••••• * * • • • * , • • • , • • • • • • • • , • • • , *; * S E r L I N E S P A C I N G T O N U I I B E R O F D O S '; ' P A S S E D I N A C C U M U L A T O R •

9 5 7 7 . • • • 'I•••••••••••••••••. " , . , . t • • •

9 5 7 7 4 B9 5 7 6 2~ 9 8 9 59 5 7 8 A 9 I B9 5 7 0 2 0 9 F 9 59 5 8 0 A 9 4 1

9 5 8 2 2 0 9 F 9 59 5 B 5 b B

9 5 8 b 4 C 9 F 9 5

9 5 B 9 A 89 5 8 A C 0 i l i ! !

9 5 B C F i ! l i ! ! 9

9 5 8 E A 9 2~

9 5 9 t i 2 0 9 F 9 59 5 9 3 8 89 5 9 4 4 C 8 A 9 59 5 9 7 6 0

9 5 9 8 A 9 e o9 5 9 1 1 2 i ! l 9 F 9 59 5 l 1 D 1 1 9 i ! l A

L I N E ~ ; P C F H AJ S R C R L FL O A U 1 BJ S R P R C O L I TL O A U 4 1

J S R P R C O U TP L AJ I I P P R C O U T

; P R I N T C R , L F; E S C

j 'A '

; # D O T S

,; • • • , $ • • • • " . , • • " • • • •• •• •• • •• • t•••

; ' m i D N U M B E R O F S P A C E S , P A S S E D •; ' I N A C C U M U L A T O R T O P R i N T E R ,i•••••• . , t l•••••••••••

,T A BS P A C E

T A l 'cp y 1 $ 0 0

B E Q R E H A BL O A 1 $ 2 £ 1

J S R P R C O U T

D E YJ M P S P A C E

R E H A B R T S

; R E T U R N; S P A C E

,; • • • • • ! , . " • • • , • • • • • • • , • • • , • • , • • • • • • ,.j' O U T P U T A C A R R I A G E R E T U R N A N D A •j ' L I N , : F E E D T O P R I N T E R ,~ • • • , • • , • • • • • • • * . ' • • 'l•••••••••••••••,C F : L F L D A U i D

J 5 R P R C O U Tl D A * i l i A

; A S C I I R

; A S C I I L F,j • ••••

I••••••••

. ' • • • • • • •• • • • •J • • •; ' S E . ~ : OC H A R A C T E R , P A S S E D I N A C C U I I. •; ' T O · [ H E P R I N T E R . S L O T = 1 ,; • • • • • 1 • • • • • • • • • • • • • • •• • • • • • • • • • • • • • •

;

;••l••••••••••••, • • • • • • • • • • • • • • • • •

; ' C H E C K T O S E E I F E S C K E Y H A S B E E N .; ' P R E S S E D . R E T U R N T O C A L L I N G P R O G • •j ' I F E S C H A S B E E N P R E S S E D , E L S E •; . C O N T I N U E . •

i•••••••••••••••••••••.,••••••,

C H n E Y L O A K E ' r ' D A T AS T A K E Y 5 T R BC l i P U B eB C C C O N T

C M P ' E S CB N E C O N TS T O P P L A

P L AC O N T R T S

; L O O K A T K E r B R D; C L E A R S T R O B Ej K E Y P R E S S ?

; E S C K E Y ?

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

,;•••" •••" ••••••••t ••••,., •••' ••" i

; ' R E S E T P R I N T E R T O O R I G I N A L L I N E ,; ' S P A C I N G , 1 2 D O T S ,; • • • • • • • • • • , • • • • • " • • • • • • • • • • , • • • • • • *

R E S E T P R L D A t 1 2

No. 71 . April/May 1984

9 5 9 F B D 9 0 C 0 P R C m r · S T A . P R O U T9 5 A 2 A 9 ilt. L O A I $ i t i9 5 M 8 D i3 9 3 S T i ! T I l l E9 5 A 7 C E 1 3 9 3 O E L A Y O E C T I . ~ E9 5 A A D i F B B N E D E L A Y9 5 A C A D C l C l W A I T L D I l P R W A I T9 5 A F 2 9 B 0 A N D 1 $ 8 09 5 B l C 9 0 0 C I I F 1$00

9 5 B 3 f i i l F 7 S N E W A I T

9 5 B 5 6 0 R T S

9 5 B 6 A 9 I B9 5 9 B 2 0 9 F 9 59 5 B B A 9 4 89 5 B O 4 C 9 F 9 5

9 5 [ ; 0

MICRO

; S E N D C H A Rj D E L A Y

; W A I T U N T i L; P R I N T E R R E A D Y; F O R N E X T C H A R

.;•••,•••••••••••4j••••••" ••••••••••,

; ' S E N I ' P R I N T E R E S C K T O S E T U P T O •; ' A C C E P T N U M B E R O F D O T S I N F O . •

;••••••••••" . t • •' . ' • •l••••••••. J

P D O T S L D A ' S l BJ S R P R C O U TL O A U 4 BJ M P P R C O U T

E N D

; A S C I I E S C

; A S C I I K

61

Page 64: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 64/84

"~A Timely Interruptla~

The Color Computer probably has one

of the most accurate and simple

interrupt timers available on any

microcomputer. All that is required to

use it is understanding of a few pointsabout the Color Computer hardware

and software.

The Video Display Generator

(VDG) displays an entire screen 60

times per second. After each screen

display, the VDG toggles its horizontal

synchronization line which is tied to

the interrupt input of a Peripheral

Interface Adapter (PIA).When bit zero

of the control register of this PIA is set,

the interrupt is enabled and is passed

on to the Interrupt ReQuest (IRQ) pin

of the 6809 MicroProcessor Unit

(MPU). When the MPU receives this

interrupt, it fetches the address of the

IRQ routine from memory locations

$FFF8 (65528) [high address byte] and

$FFF9 (65529) [low address byte]. This

ROM address is permanently set to

point to RAM location $OlOC (268)

which is a three byte JMP program that

we can easily alter to fit our needs.

The idea behind using IRQ as a

timer is simple: every interrupt from

the VDG, add one to a 16-bit register,

reset bit seven of the PIA control

register to enable the next interrupt,

and return to processing. Extended

Color BASIC does something similar

with its TIMER command. You can

check by comparing the TIMER value

with the 16-bit register at $0112 1274)

and $0113 1275)with this program:

1 0 P R I N T P E E K ( 2 7 4 ) f 2 5 b + P E E K ( 2 7 5 ) j

T I H E R : G O T O 1 0

62

by Milfe Ham ilton

Doing the same in Standard Color

BASIC requires a bit more

programming. Listing 1 is the short

BASIC program. Line 10 reserves

memory space for a short IRQprocessing machine language routine

that is POKEd into memory. The

assembly listing for this interrupt

processor is shown in Listing 2. Note

that the Data Direction Register of the

PIA at $FF03 (65283) must be read to

reset the IRQ interrupt. This is done by

the LDA $FF03. Line 20 changes the

JMP instruction at $OlOC1268)topoint

to the new IRQ routine. Line 30POKEs

the ML routine into memory. Line 40

enables the IRQ interrupt. Line 58 is

the DATA for the ML routine. Line 60

shows the timer operating.

Now, even if you erase the BASIC

program, the timer will continue to

operate. Resetting the computer will

reset the interrupt enable bit to its

normal value and the timer will stop.

Another way of stopping either the

'homemade' timer or ExtendedBASIC's TIMER is to:

P O K E ( b 5 2 8 3 ) , P E E K ( b 5 2 8 3 ) A N D 2 5 4

which will disable the IRQ interrupt. A

timer is one of the simplest uses of the

interrupt, but other tasks that require

constant updating, such as printing a

message in the comer of the screen, are

also easily implemented. Proceed with

caution though, because the more

elaborate and time consuming the task,

the slower the main program will

function, especially in BASIC.

Listing 1 BASICTimer

1 6 3 8 1

A most accurate timer for Standard Color BASIC,

Extended Color BASIC, or ML programs can be

made with just a few POKEs

1 0 C L E A R 2 5 5 , 1 6 3 6 7 R E 1 R E S E R V E M L S P A C E2 0 P O K E 2 b 9 , 6 3 : P O K E 2 7 0 , 2 4 0 R E M I R Q J M P V A L U E3 0 F O R 1 = 1 T O 1 2 : R E A O ~ : P O K E 1 6 3 6 7 + I : N E X T I E M P O K E M L4 0 P O K E b 5 2 8 3 , P E E K ( b 5 2 ~ 3 ) O R 1 R E M E N A B L E I N T E R R U P TS O D A T A I q O , 6 3 , 2 S 3 , 4 8 , 1 , l q l , 0 3 , 2 5 3 , 1 8 2 , 2 5 5 , 2 , 5 ~b O P R I N T P E E K ( 1 6 3 8 1 ) 1 2 5 6 + P E E K I 1 6 3 8 2 ) : 6 0 T O b O

T I M E E Q U $ 3 F F D

~ R G $ 3 F F O

3 F F O B E 3 F F D S T A R T . . X T I M E3 F F 3 3 0 0 1 . E A X I , X3 F F 5 B F 3 F F D s n T I ~ E3 F F 8 9 6 F F 0 2 I . D A $ F F 0 23 F F B 3 B ,H I

MICRO

Listing 2 IRQ Handler

A D D 1 T O T I M E

R E A D D D R T O R E S E TR E T U R N

No. 71 - April/May 1984

Page 65: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 65/84

D isk A buse

A True Story

by Mark S. Morano

The sad confessions of a disk junkie. Beware

lest you, too, fall upon this sad fate.

It is always uncomfortable broaching a

subject such as this. People would

rather not know, would like to believe

it's just a story, a rumor, a bad dream.

But we both know the truth - its a

nightmare.

I should know - I've been there. I

remember how it first started. You

know that first time always sticks with

you. Ithad been a long tense day at the

office. We had this package to get out

before a competitor, so we were

working pretty hard. The pressure had

been mounting and there were morebugs than mosquitos in a swamp. You

know how it is - seems like they're

breeding in an invisible subroutine

somewhere. About 3 a.m. I was alone,

huddled over my terminal when Error

13 - disk error, popped up on the

screen. Italways seems to creep out at

the worst time. But now it had made its

last interrupt. I was mad, raging like a

bull. I slammed my fist on the desk,

punched the disk drive open and ripped

that diskette into a thousand pieces.

No. 71 . April/May 1984

There I sat, tracks and sectors

everywhere. Then this strange sense of

relief, a calming came over me. The

kind of feeling you didn't want to let go

of ... but, inexorably, it faded and was

gone. I came to my senses and cleaned

up the mess before I was discovered by

the security guard, or worse yet - the

night janitor. Still shaken, I powered

down and called it a night.

At first I thought it was a one time

thing; I wrote it off to nerves, a bad day,

too much pressure. But then, it

happened again. Another late nightalone with my terminal. Feeling tired

and tense, thinking about a drink, but

knowing what I really wanted -- that

release. And there was only one way I

knew how to get it. Suddenly it was

upon me. I found myself jumping up

and down on a poor defenseless

diskette. Trampling it to bits, I couldn't

stop myself. After it was over,

surrounded with cardboard and tape,

that euphoric peace came over me. I

was caught in an infinite loop.

MICRO

No one knew for a while. A few

suspected in Purchasing when the

requests for diskettes started growing.

A box or two soon deteriorated into

cartons and cases. Being a group leader

I put the blame on my subordinates,

but I knew discovery was inevitable.

Then one day George came in to get

a diskette I had borrowed. You can

imagine the horror when he found itcovered with teeth marks. I said it fell

on the floor and I accidentally rolled

over it with my chair. Itwas run over

by a motorcycle, it ... he wasn't

:mying it. I confessed the truth was my

dog got a hold of it. That was my

slipup, George knew I didn't have a

dog. He just shook his head and walked

away.

My excuses wore thin - faulty

drive, bad lot - people stopped

believing. I found myself selling my

peripherals to support what was now a

SSOOa week habit - diskettes don'tcome cheap these days.

Well, now I'm out a job, my wife

and kids have left me and I sit around

thinking up mail order scams -- you

know, offering great games on diskette

for five dollars if you send a diskette.

They never see either again. And so it

goes, on and on. Someday I'll be able to

pass the local computer store without

getting the shakes. But right now I

can't; I just lie awake at night thinking

cf Winchester's. Its a hard way to go.

63

Page 66: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 66/84

I A l C A O mCoCo Bits

As promised last month, we are

going to take a closer look at BASIC09,

and its advantages for the CoCo user.

First, there is an omission in the

documentation about loading BASIC09

that has caused a few problems for

Tandy, and I am sure has frustrated

some users. In the documentation, the

only instruction to enable the user to

access BASIC09 is to type 'basic09'

ENTER. The user is then confronted

with an ERROR 216 (file not found).Putting the BASIC09 disk in drive 1

and entering Id1Ibasic09 causes OS-9

to display ERROR 214 (file not

accessable).

After some frustrating attempts at

circumventing the problem, I finally

resorted to calling my salesman at the

Radio Shack store. As it turned out, I

had called at just the right time, as his

morning mail that day contained the

solution to the problem in the form of a

technical note from Tandy. In case you

run into the problem with your OS-9,

here is the simple solution. Either usethe COpy command to copy BASIC09

into the command directory, so it will

be accessable from command level, the

way Tandy uses it in the BASIC09

manual, or use the LOAD command to

load BASIC09 into OS-9's workspace:

COpy ID1/basic09

IDOl cmd/basic09

LOAD ID1/basic09

Either choice works, but using

COpy to put BASIC09 into the cmd

directory is the most convenient for

future use. Create an OS-9 diskettewith basic-09 in the cmd directory, and

you will have it available as needed.

One of the questions I am most

often asked is what will BASIC09 do

that I can't do from Extended Color

BASIC. Programming in the highly

structured BASIC09 is quite a bit

different from working with Color

BASIC. BASIC09 is a much more

powerful language and, if you learn it

well, you will be able to create faster,

more powerful operating programs.

64

by John Steiner

Currently, it is the closest thing to a

full-fledged compiler CoCo users have

access to, in that the packed modules

are really compacted BASIC code

executed from a run time package.

Programs written in BASIC09 are

written in modules. Use the Edit mode

to enter your program. Type E

procedurename to open the edit file for

your procedure. At this point, the first

character of the line is expected to be

an edit command. To insert a line inyour procedure just type a space, t.ae

program line and the ENTER key. All

program lines must begin with a space.

The other edit commands are + [go

to next line), -(move back one line], L

(list current line) and D (delete current

line). One unique advantage of

BASIC09 over Color BASIC is that error

checking is done at the time each Iine

is entered. Syntax errors, and similar

line entry errors are trapped before you

leave the line. In addition, an error

check is done before leaving t.ae

procedure to check for undefined gatos,gosubs, etc. Also, if there is not enough

memory for your procedure and any

arrays, you will be warned at thatpoint.

After typing a space, your program

line can begin with a number if you

want. If you plan to use GOTO or

GOSUB to call the line you are typing,

it will have to have a line number.

Once you type a few lines you can list

the procedure by typing L·. Your

program will be listed with t.re

hexadecimal I-code address next to

each line. The I-code address is used torefer to individual program lines when

an error occurs, or for other reasons.

BASIC09 has four modes. We have

been working with the edit mode. T1e

system mode is used to save, load,

pack, rename and otherwi se

manipulate procedures from workspace

to disk, or vice versa. The execution

mode is entered whenever it is time to

run your procedures. There is also an

autorun feature that allows you to load

and run programs from OS-9. If an error

MICRO

occurs, BASIC09 automatically enters

the debug mode unless ON ERROR

GOTO has been implemented.

Debug is one of the most powerful

programming aids I have seen. It is

even possible to execute the procedure

one line of source code at a time. You

can even display the source code on the

screen while it is executing. Debug

mode is very powerful, and has much

more ability to assist with errors in

programming than Extended ColorBASIC.

BASIC09 will be a useful package

for you, if you can justify the $170.00

or so that the language will add to the

cost of your system. I hope to have

some practical BASIC09 programs for

you in the future. If you have hints or

techniques regarding either BASIC09 or

OS-9, send them in; we will pass them

along.

New Tandy Drives for COCO

The TEC drive which Tandy has sold

with the CoCo seems to have beenreplaced with a new unit Not many

people I have talked with have been

overly impressed with the performance

level of the TEC drive, so this is good

news. Tandy is now supplying the

same drive unit that is found in the

Model III and 4. A redesigned controller

to work with the CoCo 2 has also been

released, which doesn't require the 12

volt line that the CoCo 2 doesn't have

at the cartridge port.

The new package should be a

reliable addition to the CoCo line. The

redesigned controller uses phase lockloop technology for data separation,

which will also improve performance

and stability. The only minus is

Tandy's insistance on saving pennies

by not gold plating the contacts on

either the drive or controller cards. By

the way, if you have a multi-pack

interface, you can use the old drive

controller with the CoCo 2. Also,

Tandy still configures the cables, so if

you are mixing drives be aware of the

configuration situation.

No. 71 - April/May 1984

Page 67: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 67/84

Two Disk Utilities

I have received two utilities for review

that are useful for the person who has

to duplicate large quantities of software

for production purposes. I am

impressed with both of them.

Disk Manager by Elite Software

contains two programs that allow

copying to tape or disk Load eitherDTCOPY [tape) or DDCOPY [disk),

and RUN. Insert the source disk in

drive zero and press ENTER. The drive

will read the directory and list the title

of each entry by a number. Load the

destination disk or tape, and enter the

number of the programjs) desired. [e.g.

1,5,6, 12,14). The copy utility will

copy only those files on the destination

disk or tape. Entering ALL will cause

the entire disk to be backed up. The

disk version will make multiple copies

with only one entry, and will offer

Copy, and Abort options if a file is

already on the destination disk. Other

options include single drive operation,

and rearranging the order of files on thedestination diskette. The disk version

requires installation of a formatted

diskette.

FASTDUPE by Spectrum Projects

allows duplication and formatting of an

entire diskette. The only requirement

is that the size of programs on the

P.O. Box 4364 - G .Flint, Michigan 48504 ~V(313) 233-5731 \1

~~

diskette must be small enough for all of

them to fit in the 64K CoCo.

FASTDUPE will first read the source

disk and ask you to remove it. Install

unformatted diskettes in drives 0

through 4 and press ENTER.

FASTDUPE will then format and copy

all four drives in succession, and let

you install four more to do it again. If

you don't have four drives, it will workwith three, two, or even a single drive.

Any bad copies are flagged, and the

process continues. If you are just

reproducing diskettes with a few small

programs FASTDUPE will save you a

lot of time.

Z,ANIM

SYSTEMS

WE CARRY MANY VIC AND APPLE PRODUCTS. PLEASE SEND FOR A CATALOGUE.

A P P L E D U A L D ISK C O N T R O L L ER B O A R D

R S2 32 SER IA L IN T ER F A C E B O A R D

P A R A L L EL P R IN T ER IN T ER F A C E"CENTRONICS TYPE COMPATIBLE BOARD

EP R O M P R O GR A M M ER B O A R D(2708, 2716, 2732, 2764)

ALL BOARDS HAVE SOLDER

MASKING, COMPONENT LAYOUT,

AND GOLD EDGE FINGERS

No. 71 . April/May 1984

BI.IILD YOUR OWN

APPLE PERIPHERAL CARDS

AND SAVE UP TO 80%

$29.00

$29.00

$29.00

$29.00

WE WILL SUPPLY

THE IC LIST FOR

ANY BOARD

APPLE 11 IS TRADEMARK OF APPLE COMPUTERS, INC.CP(M IS REGISTEI1EDTRADEMARK OF DIGITAL RESEARCH, INCVIDEX IS REGISTE.REDTRADEMARK OF VIDEX INC

MICRO 6 5

Page 68: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 68/84

:

.

IAlCAO'"by Ralph Tenny

As promised in the last issue, we're

going to look at programming the 6526

CIA (Complex Interface Adapter) 110

chips in the Commodore 64. This is a

very complex IC which has a high

capability and a correspondingly

complex programming sequence to use

all the CIA features. Here's a list of the

110 assignments for the two 6526s in

the C-64:

SA:

PC:

FLAG:

U 1 . B ase A ddress $O CO O

PAO-PA7: Keyboard Column Strobes

Joystick BPaddle Multiplex

PBO-PB7: Keyboard Row Input

Joystick A

Fire Button/Light Pen

Shift Register #User Port

Count Input

User Port

Output Handshake Line

Not used

Input HandshakelInterrupt

Input

Serial Bus

CNT:

Timers

(2): System use

Time of Day Clock: Available for User

66

Interf,ace Clinic

U 2 . B ase A ddress $ 0 0 0 0

PAO·PA1:PA2·PA3:

PA4·PA7:

Memory Address Mapping

User Port

SR:

Serial Bus Control andDataShift Register #2110User Port

CNT: Count Input

User Port

PC: Output Handshake

User Port

FLAG: Input Handshake/Interrupt

User Port

Timers

(2): Available for User

Time of Day Clock: Available for USI~r.

When you add it all up that is 16 User110 lines. There are also two 9Volt AC

lines 5 VDC and four ground (power

supply common) lines. Of these 16110

lines only PBO- PBl on U2 program in

a completely straightforward manner.

If you have the HESMON 64 machine

language monitor cartridge or one of

the several monitors available on disk

(MINIMON, SUPERMON or others not

from Commodore) you can follow this

discussion more easily.

MICRO

The B port is addressed at $DD01

and the B Data Direction Register

(DDR) is at $DD03. The lines are set

for output on a line-by-line basis. For

example set Bit 0 of the DDR to logic 0

to make Bit 0 an input; otherwise set it

to logic 1for output. Once the direction

assignments are made simply write 0or

1 to output lines as needed or read

input lines.

Tum on your C-64 and enter the

monitor (with HESMON 64 plug in the

cartridge and tum on power). Assign

PBO-PB3 as input and PB4-PBl as

output by writing $FOto $DD03. Now

write 00 to $DD01 and try to read it

back. What do you read? If there are no

external connections made to the UserPort you will read back $OF. The

following lines illustrate that sequence

as performed with HESMON 64. [User

input appears in italics and the

HESMON response in normal

characters. J In HESMON memory

modification is performed by

positioning the cursor on a displayed

memory value then entering the new

value. In the display below this is

shown by having the new entry

No. 71 - April/May 1984

Page 69: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 69/84

immediately below the byte to be

changed:

W D D O Q { r e t !

: D O O O 9 7 F F 3 F F F F F F F F FF O ( r e t )

W D D O O i r e t !

: 0 0 0 0 9 7 F F 3 F F O F F F F F F F FO O l r e t I

H D D O O ( r e t )

: O D O O 9 7 O F 3 F F O F F F F F F F FAlthough it is possible to accomplish

the above experiment in BASIC the

nature of PEEKs and POKEs will

obscure the experiment's outcome.

Programming the User Port lines PBO-

PB7in BASIC is possible but the rest of

the lines are much more difficult to

program in BASIC.

Listing 1 demonstrates the

fundamentals of programming PA2 and

PA3 of U2 and Listing 2 does the same

for using the SP line in an assembly

language program. Listing 1 assumes

that Port A data direction assignments

made during the C-64 power-up

sequence have not been changed from

$3F in $DD02. In fact careless

modifications to location $DD02 can

crash the computer as can any

uninformed data manipulations

involving U1.

The required sequence for

controlling PA2 or PA3 of U2 is to set

tits high with a logical OR and to set

bits low with a logical AND operation.

If you merely wish to change the logic

level (toggle) the bit use an

EXCLUSIVE OR with the same bit

mask as the OR operation. Listing 1

lines 8 &. 9 gives the OR bit mask

which will set either PA2 or PA3 high.

The proper instruction sequence to

insure that PA2 is high is:

L D A 1 $ 0 4O R A $ D D O OS T A $ O D O O

; B I T H A S K F O R; B I T 2 = H I G H

Figure 1

r

--.-----.--------.-----tt'"- ..----- ..- - - - 11 - · - - · · · - - - · · · - - - - · - - - - · · - - - - - · · · · - · 1 - - - - - - - - · - - - - ,.-? ~~i~~_J___. ~ } - - ."""<-.--- g-.l --iJ..J:~.·~:1...-·····--··--·--·····-J-!::..a-I'L"-l.q_ .' l = l l . 'TL"';n-1 [ - J I '1'··":... PE:u :; _.d) I : : . . ' . J U " ! 1 . . - - 1 : : . + - . . . ~I·-.

' : . 1 . ._ ~":I :: 1= = - - - - L _ + : t _ . . _ . _ . _. ~ ~ - . - = = . .·~·~;~I~: .'--"if - --"- ~ ~ r '~ . ,· · · · · l._ E ; _ _ L-·--t----·------·--I-....- - + : : : . J - 1 · <~~.'-I I I L......- _ - . 1 - , . - . - . .1 · - - - - - - - f : t

m

il < : I I:

11k < ~· · - G R 1 f f i ~ ? - - - - - - - - · · - · · · I . - . . . - - . .- - - - - . - - - - . l . . .. .- · - · - · · · · - - · - - · - · · · · - - · : t - - - - t - · - · - · · - · - · - · - - - - - - - - - _ . _ . l . : : i : '_ u--_ ..._ .---t..___.--_.-___._---_._----_._....--------

11k

Listing 1

D D O O0 0 0 1O D 0 2

T H I S P R O G R A H D E H O N S T R A T E S T H EO N L Y S A F E W A Y T O C H A N G E P A 2A N D P A 3 O F C A l U 2 . U S E T H E S EL I N E A S O U T P U T S O N L Y . I T I SA S S U H E D T H A T P O R T A D A T AD I R E C T I O N S A S S I 6 N H E N T S R E H A I NA S I N I T I A L I Z E D B Y B A S I C .

; E Q U A T E SA P O R T E Q U $ D D O OB P O R T E Q U $ D O O IA D O R E Q U $ 0 0 0 2

P O R T L O C A T I C ' N S

No. 71 ..April/May 1984 MICRO 67

Page 70: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 70/84

I

/

D 0 0 3 B O D R E Q U $ 0 0 0 3 O n O l B P O R T E Q U $ O n O lD D O E T H R A C R E Q U $ D D O E D D 0 2 A D D R E Q U $ D D 0 2D D O F T H R B C R E Q U $ D D O F D D 0 3 B D D R E Q U $ D D 0 3

; D D O E T H R A C R E Q U $ D D O E; C O N S T A N T S D n O F T H R B C R E Q U $ D D O F

0 0 0 4 A 2 T O G E G U $ 0 4 ; B I T H A S K S ;0 0 0 8 A . 3 T O G E Q U $ 0 8 ; C O N S T A N T S0 0 4 0 S P T O G E Q U $ 4 0 0 0 0 4 A 2 T O G E Q U $ 0 4 ; B I T H A S K S

, 0 0 0 8 A 3 T O G E Q U $ 0 8; B U F F E R S 0 0 4 0 S P T O G E Q U $ 4 0

0 0 7 C S A Y ! E G U $ 7 C ,,0 0 7 E R E P C N T E Q U $ 7 E ; B U F F E R S

, 0 0 7 C S A Y l E Q U $ 7 CC O O O O R G $ C O O O 0 0 7 E R E P C N T E Q U $ 7 EC O O O A 9 F F L D A U F F ; S E T I O F R E P E A T S ;C 0 0 2 8 5 7 E S T A R E P C N T C O O O O R G $ C O O OC 0 0 4 A 9 0 4 I N L D A I A 2 T O G ; I N Y E R T P A 2 C O O O A 9 F F L D A U F F ; S E T . O F R E P E A T SC 0 0 6 4 D 0 0 D D E O R A P O R T C 0 0 2 8 5 7 E S T A R E P C N TC 0 0 9 8 D 0 0 D D S T A A P O R T C 0 0 4 A 9 4 0 I N L D A I S P T O G ; T O G G L E S PC O O C A 9 0 4 L D A I A 2 T O G ; I N V E R T P A 2 A G A I N C 0 0 6 4 D O E D D E O R T H R A C RC O O E 4 D 0 0 D D E O R A P O R T C 0 0 9 8 D O E D D S T A T H R A C RC O i l 8 D 0 0 D D S T A A P O R T C O O C A 9 4 0 L D A . S P T O G ; T O G G L E S P A G A I NC 0 1 4 2 0 l C C O J S R D E L A Y C O O E 4 D O E D D E O R T I 1 R A C R

C 0 1 7 C 6 7 E D E C R E P C N T ; C O U N T D O W N C O I 1 8 D O E D D S T A T H R A C RC 0 1 9 D O E 9 B H E I N C 0 1 4 2 0 l C C O J S R D E L A YC 0 1 S 0 0 B R K ; R E T U R N T O H E S M O N C 0 1 7 C 6 7 E D E C R E P C N T ; C O U N T D O W N

; C 0 1 9 D O E 9 S N E I NC O I C 4 8 D E L A Y P H A ; S A V E R E G I S T E R S C O I S 0 0 B R K ; R E T U R N T O H E S M O NC O l D 9 8 T Y A ;C O l E 4 8 P H A C O I C 4 8 D E L A Y P H A ; S A V E R E S I S T E R SC O I F 8 A T X A C O l D 9 8 T V AC 0 2 0 4 8 P H A C O l E ~ 8 P H AC 0 2 ! A 9 F F L D A U F F ; F U L L C O L I N T C O I F A T X AC 0 2 3 8 A T X A C 0 2 0 4 8 P H AC 0 2 4 4 A L S R A ; H A L F C O U N T C 0 2 1 A 9 F F L D A U F F ; F U L L C O U N TC 0 2 5 9 8 T Y A C 0 2 3 8 A T X AC 0 2 b C A S P I N D E X ; D E L A Y R O U T I N E C 0 2 4 4 A L S R A ; H A L F C O U N T

C 0 2 7 D O F D B N E S P I N C 0 2 5 9 8 T V AC 0 2 9 8 8 D E Y C 0 2 b C A S P I N D E X ; D E L A Y R O U T I N EC 0 2 A D O F A S N E S P I N C 0 2 7 D O F D S N E S P I NC 0 2 C 6 8 P L A ; R E T R I E V E R E G I S T E R S C 0 2 9 8 8 D E YC 0 2 D A A T A X C 0 2 A D O F A B N E S P I NC 0 2 E b 8 P L A C 0 2 C b 8 P L A ; R E T R I E V E R E G I S T E R SC 0 2 F A 8 T A Y C 0 2 D A A T A XC 0 3 0 b 8 P L A C 0 2 E b 8 P L AC 0 3 1 6 0 R T S C 0 2 F A 8 T A YC 0 3 2 E N D C 0 3 0 b 8 P L A

C 0 3 1 b O R T SC 0 3 2 E N D

Listing 2

; T H I S P R 0 6 R A M D E M O N S T R A T E S; H O W T O T O G G L E T H E S P L I N E S ,

Listing 3j B I T b O F T H E C O N T R O L R E S I S T E Rj P R O G R A M S T H E S H I F T R E G I S T E R ; T H I S P R O G R A M D E I 1 0 H S T R A T E S H O N T O; D A T A D I R E C T I O N S C O = I N ; I = ; U S E T L - 5 0 7 A I D C O N V E R T E R S , I T; O U T ) , T H E O U T P U T P I N S O E S ; I S A S S U M E D T H A T E A C H T L - 5 0 7 I S; T O L O G I C O N E N H E N S E T F O R ; P O W E R I N G A P O T A N D R E A D I N G T H E; I N P U T ( L O G I C Z E R O F O R O U T P U T l , j P O T W I P E R , T H E P O T P O S I T I O N I S; ; E X P R E S S E D A S A N U M B E R B E T N E E Nj E Q U A T E S ; $ 0 0 A N D $ 7 F , P R O V I S I O N I S H A D E

D D O O A P O R T E Q U $ D D O O ; P O R T L O C A T I O N S ; F U R C O N T R O L L I N G 8 T L - 5 0 7 P A R T S .

6 8 MICRO No. 71 . April /May 1984

Page 71: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 71/84

O D O O0 0 0 1O D 0 2O D 0 3

O C O EO O O E

0 0 0 20 0 4 00 0 4 0

0 0 7 C0 0 7 00 0 7 E0 0 7 FO O S O

0 7 7 0O B 7 0

C O O O

C O O O A 9 0 0C 0 0 2 S O 0 3 O DC 0 0 5 e o 0 1 O DC O O S A 9 4 0C O O A 0 0 O E D Cc o o n S O O E O CC O l O A 9 4 0C O l 2 O D O E D D

C O l 5 e o O E 0 0

c O l e A 9 0 0C O l A A 2 0 7C O I C 9 5 e oC O l E C AC O I F 1 0 F B

C 0 2 1 A 9 4 0C 0 2 3 4 D O E D CC 0 2 6 S O O E O CC 0 2 9 A 9 4 0

C 0 2 B 4 0 O E O CC 0 2 E S D O E D CC 0 3 ! A D 0 1 0 0C 0 3 4 S 5 7 DC 0 3 6 A O 0 0C 0 3 8 8 4 7 C

C 0 3 A A 9 4 0C 0 3 C 4 D O E 0 0C 0 3 F S O O E D OC 0 4 2 A 9 4 0C 0 4 4 4 0 O E D O

j N I T H T H E R E S U L T I N G C O N V E R S I O N Sj O I S P L A Y E O I N A L I N E A C R O S S T H Ej L O W E R P A R T O F T H E C - 6 4 S C R E E N .;j E Q U A T E SA P O R T E Q U $ 0 0 0 0B P O R T E Q U $ O D O !A O O R E 9 U $ 0 0 0 2B O O R E 9 U $ 0 0 0 3

S P ! S E T E 9 U $ O C O ES P 2 S E T E 9 U $ O O O Ej

; C O N S T A N T SL I M I T E 9 U 2S P I N I T E 9 U $ 4 0S P T O G E 9 U $ 4 0,,i B U F F E R SS A V Y E Q U $ 7 CH A S K E 9 U $ 7 0Y I N O E X E G U $ 7 EX I N O E X E G U $ 7 FB U F F E R E 9 U $ S O

N I N O O W E Q U $ 0 7 7 0~ I N C L R E Q U $ O B 7 0

O R G $ C O O O

j P O R T L O C A T I O N S

N U M B E R O F A I D S T E S T E D

j C O U N T B U F F E R A R E A

; F I R S T D I S P L A Y L O C A T I O Nj C O L O R R A i l

j I N I T P O R T S A N D P R O G R A MI N I T L O A 1 0 0 B P O R T = I N P U T

S T A B D O RS T A B P O R TL O A I S P I N I T S E T S P L I N E S L O NO R A S P 1 S E TS T A S P I S E TL O A I S P I N I TO R A S P 2 S E T

S T A S P 2 S E Tj

j C L E A R C O U N T B U F F E R SL O A 1 0 0L D X 1 $ 0 7 j I N I T I N D E X

N I P E I S T A B U F F E R , XO E XB P L W I P E I

j

; R E S E T A I D SN E W L O A I S P T O G

E O R S P I S E TS T A S P I S E TL O A I S P T O GE O R S P 1 S E TS T A S P 1 S E TL D A B P O R TS T A I I A S KL O Y 1 0 0S T Y S A V Y

,,; C L O C K A I OC L O C K L O A I S P T O G

E O R S P 2 S E Ts T A S P 2 S E TL O A I S P T O GE O R S P 2 S E T

J R E S E T L I N E H I G H

; T H E N L O N A G A I N

; 6 E T I N I T I A L I I A S K

; C L E A R C O U N T E R

C L O C K L I N E H I 6 H

A N D T H E N L O N

No. 71 - April/May 1984 MICRO

This sequence modifies only PA2

leaving all other bits of Port Aalone. To

insure that PA2 is low use:

L O A I $ F B ; O N L Y B I T 2 I S L O WA N D $ 0 0 0 0S T A $ 0 0 0 0

Study the sequence of operations in

Listing 1. This program toggles PA2

255 times with a delay between each

operation. This allows you to monitorthe action with a logic probe to verify

the activity. Note in the DELAY

subroutine that lines 26-30 save the A

Y and X registers during the delay

countdown and lines 39-43 restore the

registers after the delay. This was not

necessary for this program's operation

but is good programming practice ifyou

develop any routine which can be used

as a mini-utility in all your programs.

Listing 2 is quite similar once you

understand how to manipulate the SP

jne. This line is used to input or

output 8bits of synchronous serial data

using the shift register internal to the

6526 CIA devices. If the Shift Register

is set for input (Bit 6of the CIAControl

R Register A 0) the SP line goes high.

Conversely programming the Shift

Register for output (Bit 6 1) toggles SP

low. Listing 2 toggles SP high then low

255 times with a delay between toggle

operations. Note that exactly the same

programming techniques can be used

for SP1 [pin 5 of the User Port) by

addressing $DCOEinstead of $DDOE.

Both Listing 1 and Listing 2 were

generated using the Commodore

Assembler Development package (disk

based] with intention of using

HESMON 64 as a debugger. The BRK

instruction (line 38) causes our

program to stop by returning to

HESMON. These examples will get

you started on I/O programming on the

C-64. We have not yet dealt with serial

I/O using the Shift Register but we may

get to that next time. Note also that PC

and FLAG are not programmable

directly. PC strobes low and back high

automatically whenever Port B is

written to or read from, furnishing an

automatic handshake signal.

Whenever FLAG is pulled low bit 4 of

the Control Register ($DCOD on Ul

and $0000 on U2) is set high. If the

FLAG interrupt has been enabled an

interrupt will be enabled. Otherwise

you can poll this bit using:

L O A $ 0 0 0 0~ ' N O 1 $ 1 0B E Q N O T H I

; 6 E T I N T E R R U P T S T A T U S; T E S T B I T 4; B R A N C H T A K E N I F N O B I T

69

Page 72: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 72/84

C 0 4 7 8 0 O E 0 0C 0 4 A A 5 7 CC 0 4 C C 8C 0 4 0 8 4 7 CC 0 4 F : 3 0 D OC 0 5 1 A D 0 1 D O

C I ) S 4 4 5 7 0C 0 5 6 F O E 2C 0 5 8 A E 0 1 D DC 0 5 B 8 b 7 0

C 0 5 D A 2 0 0C 0 5 F 4 A B I T I DC 0 6 0 9 0 O SC 0 6 2 9 4 S OC I ) 6 4 2 0 7 1 C OC O b 7 4 C 3 A C OC 0 6 A E S N X T B I TC O b B E O 0 2C 0 6 D F O 8 2C 0 6 F 0 0 E E

S " A S P 2 S E TL O Y S A V Y G E T C O U N TH I Y C O U N T C L O C K P U L S E SS - Y S A Y Y A N D R E M E M B E R C O U N TB M I N E W S T A R T O V E R I F C O U N T ) 1 2 7L O A B P O R T R E A D A I D O U T P U T SE O R M A S K T E S T F O R A I D D O N ES E Q C L O C K N O N E ? C L O C K A G A I NL D X B P O R T R E A D P O R T A G A I NS - X M A S K M A K E T H I S N E W M A S kL O X . 0 0 C L E A R I N D E XL S R A T E S T W H I C H B I T H I G HB e c N I T B I T ; I F T R U E . N O T T H I S B I TS T Y B U F F E R , X ; I T W A S T R U E , S A V E C O U N TJ t ; R S H O W D I S P L A Y C O U N T SJ H P C L O C K T E S T O T H E R A I D SI H X C O U N T S H I F T SC P X * L I M I T A L L B I T S T E S T E D 'B E Q N E W A L L D O N E . S T A R T O V E RB H E B I T I D E L S E T E S T N E X T B I T

S T K K I N D E l S A V E V A L U E SS T Y Y I N D E X

L V X * 0 0 C L E A R I N D E X R E G SL i l Y * 0 0L V A B U F F E R , X ; G E T C O U N T V A L U EJ S R O U T P U T D I S P L A Y I TH I . P O I N T T O N E X TC P I * 0 8 T E S T F O R L A S TB e c R E A DL D X X I N D E X R E T U R N W I T H D A T AL l ' Y Y I N D E XR T S

Your own code to process the bit

received condition should follow

directly.

Last month's experiment was a

home-built single-slope AID converter

capable of operating from just two I/O

lines. The TL507CP is a very low cost

flexible AID converter with 7 bits

resolution (one part in 128) which is

excellent to read pot or joystick

position or two-wire sensors such as

thermistors. Figure 1 shows a test

circuit with two TL507s driven from

the C-64 User Port. Up to eight TL507s

can be controlled with this circuit and

the results are displayed in a line across

the lower one-fourth of the CRT. If

fewer than eight AIDs are connected

all eight buffer locations will display

but only those with data will change.

The TL507 is a single-slope AID

converter which contains a resistive

ladder and a digital counter to generate

the ramp. The ramp begins (count 0) at

.75 Vcc and runs to maximum (count

$7f) which occurs at 1.25 Vcc.

Although this is inconvenient for

converting DC voltages, potentio-

meters work very well. The TL507

works this way; the reset line (pin 8) is

set high and then low. The output (pin

4) then switches high. Next the clock

line (pin 2) is pulsed repeatedly until

the output switches low. Just as in the

experiment last time, the number of

clock pulses required to switch the

output is kept in a CPU register.

Listing 3 is the program whichexercises the circuit of Figure 1. SPI

drives the Reset line, SP2 drives the

Clock line, and the output lines of up

to eight TL507s are sensed by PBO-

PB7. It works this way: the TL507s are

reset by lines 58-60 and the output

lines all go high. This condition is

stored in MASK and a counter is

initialized. The clock lines are pulsed

(simultaneously) one time and the post

input pattern is compared to MASK

(lines 67-76). If any TL507 output

changes, lines 77-82 detect the change

and save this new pattern in MASK.Lines 83-91 identify the TL508 which

signalled Conversion Complete, save

the clock count and display the count.

This process is repeated until all input

lines have been switched low, or until

127 clock pulses have been issued.

Lines 93-104 control the display

process. If fewer than 8 TL507s are

connected, data buffers associated with

the missing converters are reported as/I 00' ,

.I

C 0 7 1 8 6 7 F S H O WC 0 7 3 8 4 7 E

C 0 7 5 A 2 0 0C 0 7 7 A O 0 0C 0 7 9 S 5 S O R E A DC 0 7 B 2 0 8 8 C OC 0 7 E E 8C 0 7 F E O 0 8C 0 8 1 9 0 F bC 0 8 3 A 6 7 FC 0 8 5 A 4 7 EC 0 8 7 6 0

;C 0 8 8 4 8 O U T P U TC 0 8 9 4 AC 0 8 A 4 A

C O S B 4 AC 0 8 C 4 AC 0 8 D 2 0 9 E C OC 0 9 0 2 0 A B C OC 0 9 3 6 8C 0 9 4 2 9 O FC 0 9 b 2 0 9 E C OC 0 9 9 2 0 A S C OC 0 9 C C 8C 0 9 D 6 0

S A V E D A T AG E T H I G H N I B B L E

P H AL S R AU ; R A

U iR AL ~ R AJ ~ i R C O H Y R TJ ~ R D I S P L YP L . AA ~ ' D U O FJ ~ : R C O N Y R TJ E R D I S P L YmR T S

C ~ P U O AB e C N U M B E RS E C

S B C U 0 9R T S

M A K E D I S P L A Y A B L E C H A RS H O W I TS E T D A T A A S I A NM A S K T O L O W N I B B L E

S P A C E B E T W E N B Y T E S

;C 0 9 E C 9 O A C O N Y R TC O M 9 0 0 4C O A 2 3 S

C O A 3 E 9 0 9

C O A 5 6 0 E X I T

A L P ~ A O R D I S I T '0 - 9

j A - F

j M A K E I T C - 6 4 S C R E E N C O D E

;C O A 6 1 8 N U M B E RC O A 7 6 9 3 0C O A 9 D O F A

; C O N V E R T T O A S C I I

B R A N C H A L W A Y S

C L CA D C U 3 0B N E E X IT

;C O A B 9 9 7 0 0 7 D I S P L YC O A E A 9 0 0C O B O 9 9 7 0 D BC O B 3 C 8C O B 4 6 0C O B S

P U T I N S C R E E N B U F F E RC H A R . C O L O R = B L A C KU P D A T E C O L O R R A MB U M P I N D E X

S T A W I N D O W , YL D A * 0 0S T A W I N C L R , YI N YR T SE N D

MICRO0 No. 71 - April/May 1984

Page 73: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 73/84

Commodore Compass

by Loren Wright

New Commodore Computers?

Commodore's CES announcement of two new computers

was at least partially withdrawn. It appears now that the

264, if it appears at all, will be introduced late in the year.

The 364 has been indefinitely postponed. It's probably just

as well. I, and a number of others, doubted the wisdom of

bringing out a whole new line just when the Commodore

64 had become established. The Commodore 64 finally

has a respectable assortment of software available, and it is

doing very well, I might add. The 1701 processor would

have been the biggest hurdle. It would have taken a while

to convert a significant amount of 6502/6510 software,

and Commodore would have started again with the same

problem it has always had with new computers - little, if

any software!

Side Scrolling Update

Because of space limitations in last month's issue, you

may have been left a little in the dark regarding how touse

the side scrolling routine. What the routine does is move

the screen contents, along with the corresponding color

memory, to the right or left. If the move is to the left, then

column 1 (actually the 2nd column) is copied into column

o. Column 2 is copied into column I, and so on, until the

move is complete. If the move is to the right, then column

38 is copied into column 39, column 37 into 38, and soon,

until the move is complete. The program allows you to

specify a range of columns to be moved. The left column

(LCOL)must be POKEd into 49152, and the right column

(RCOL)must be POKEd into 49153. On a left move LCOL

must not be less than one, and on a right move RCOL

must not be greater than 38. If there is a 0 in location

49154, then the last column copied will remain

unchanged--i.e., there will be two identical columns

No. 71 - April/May 1984

adjacent. Most of tl:e time, you will want that last column

replaced with spaces, and any number besides 0 POKEd

into 49154 will accomplish that result. The left move is

called with SYS49155, and the right move is called with

SYS49182.

It is a simple matter to add this feature to the screen editor

(MICRO 66:28). In addition to the subroutine provided

last month (70:59), only three lines are required:

5 COSUB 19000: LC49152: RCLC1: POKELC2,1

361 IFT$[ THEN COSUB 1000: POKELC,l: POKERC,H:

SYS49155: COT0200

362 IF T$] THEN COSUB 1000: POKELC,H: POKE

RC,38: SYS49182: GOT0200

The horizontal cursor position (H) is used to determine the

end of the screen move. This is the quick-and-dirty

implementation. It removes the two square brackets

characters from USt in a graphic, though. To get them

back, I would suggest using one of the unused function

keys (f4 and f8) to enter a command mode, which expects

another key to complete the command. This allows for

future expansion, st.ch as up and down screen moves, fill

routines, etc. To avoid errors, it would be a good idea to

have some audible or visible (flashing border?) indication

that another key is expected.

Communications Update

I was serious about including bulletin board listings and

information in this column. So far I only have one such

item (coming up next). I will also be checking my

CompuServe EMAILregularly, sofor those who missed it,

my CompuServe nu:nber is 70626,636. I won't always be

able togive direct responses to questions, but information

and news that you:hink would be of general interest is

welcome.

MICRO 71

Page 74: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 74/84

TPUG BBS New Number and Policies

The Toronto PET Users Group ITPUG)has a new numberfor its bulletin board service: (416)-429-6044, 24 hrs, 7days. The biggest change in policy is that users will nolonger be able to download programs from the club library.To get library programs you must purchase the club'slibrary disks or cassettes. However, the board may be usedto upload programs, and this use is encouraged. The club

librarians will go through programs so received regularly.Acceptable ones will be added to the library, and thecontributor of an accepted program will get to choose afree library disk.

TPU G Conference

The Third Annual TPUG Conference will be heldMay 26 and 27, 1984, at the Constellation Hotel inToronto. Features of the conference include two fulldays of lectures, workshops, and panel discussionsconducted by local, as well as out-of-town, experts.The preliminary schedule shows at least fivedifferent speakers going at once all day Saturday and

Sunday. Typical topics: Evaluating CommercialSoftware, Speech Synthesis, Hi-res Graphics on the

C-64, Networking, How to Use Spreadsheets, and aComputer Music Overview.

Some of the more popular sessions, such as JimButterfield's day-long machine-language workshop,may be filled, but there should still be a lot tochoose from. I enjoyed participating last year, andlook forward to it again this year. My topics will beSprite Programming Techniques (intermediatelevel), and C-64 Graphics: A Little Machine

Language Goes a Long Way(intermediate! advanced.).Other activities at the conference include easy

availability cf copies of club library disks, an exhibitarea for hardware and software vendors, an answerroom, a trader's corner, and an optional banquet.

I f you've never been to Toronto, I should tell youthat it is a beautiful city with a lot going on!Registration (required to participate in events) is$25. In addition, you must be a club member, whichcosts $30 (regular) and $20 (associate). Associatemembership is intended for out-of-town members.You still receive the club's magazine TORPET andhave access to the club library. The number to call

for more information is (416)-782-9252 (businesshours only).

FRANKL~N •

DERRYIERIPHERALS

COMPLETE PRODUCT LINES FOR

D.C. Hayes • HDE • Microsoft • Nashua • Okidata

We carry many products at competitive prices to expand these fine computers.Request Catalog No. AFP"

o·IAPPLE.

HOE •ealer

Inquiries

Invited

IBM·PC/XT

AIM SYM • KIMHOE hardware and software for ASK, OLC, OMNI-65 systemsKIM replacement modules (1K - 41<)and keyboardsAIM-65 (1K - 4K) and accessories. Request Catalog No. TASK"

COMPUTER REPAIR SERVICE

Perry Peripherals

Professional WorkmanshipGuaranteed RepairsQuick Turn-around

"Cataloqs

AFP $2.00 TASK $1.50

Catalog price refunded

with first order

Repair Center6 Brookhaven Drive

Rocky Point, NY 11778

Apple

AIM

• FranklinPET •

• SYM

•HOE

•Atari

KIM

OrdersP.O. Box 9:24 (516)744-6462Miller Place NY 11764 9AM-5PM Weekdays

72 MICRO No. 71 . April/May 1984

Page 75: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 75/84

From Here to Atari

by PaulS. Swanson

I recently added an Atari 800xl computer tomy collection.

The main differences between that system and the earlier

Atari 400, 800 and 1200xl computers is that no BASIC

cartridge is required. BASICis built in. I also noted some

differences in the keyboard. The Atari 1200xl keyboard is

still the best of the series and I use that system for my

word processing. However, the Atari 800xl keyboard is

close competition. The keys are non-glare type finish and

have shorter strokes than the ones on the Atari 1200xl

computer, which may be preferable to some touch typists.

What really impressed me about the Atari 800xl

computer was one of the details of the design. The

cartridge slot has two metal strips forming a double door

configuration, opening inward when a cartridge is

inserted. When the cartridge is removed they spring closed

again. The impressive detail is that there is no way to trap

your finger in it. This seems like a minor point until you

consider having a small child at the computer. The

configuration of the cartridge door looks like an ideal setup

for trapping small fingers, but after spending about 20

minutes studying the door, I concluded that there was no

way it could trap anything.

MYDOS UPDATE

Last month I reported a few bugs in MYDOS. Since then I

have been in communication with SWP concerning that

product. The updating of random access files has been

corrected in versions 3.012 and 3.17. I noted that other

minor bugs that I had uncovered have also been corrected.

The new version should be available by the time you read

this column.I also acquired an 80-track disk drive for my ATR8000.

Using MYDOS to configure it, the 80-track double sided

Qume disk holds about 734Kof usable disk space. That is

a little more than eight times the capacity of an Atari 810

disk drive.

TELECOM UPDATE

Nite Lite, the computer bulletin board I'm running every

night, has been a good source of information concerning

how people are setting their Ataris up for

telecommunication. If you have an Atari 850 interface or

No. 71 - April/May 1984

an ATR8000 you still have the widest selection. Any

RS-232 compatible modem will connect to either of these

devices directly.

There are many callers who do not have Atari 850

interfaces or ATR800C's connected to their systems. These

Atari owners use either the Atari 835 modem or the

MPP-1000. The Atari 835 is a little more expensive, but

connects along the serial bus like other peripherals. The

MPP-1000 plugs into a joystick port.

I have noted one problem with the MPP-1000C, which

is that it doesn't respond as device R: so no custom

software or any other software not specifically written for

that modem will work. That eliminates what seems to be

the most popular software on the Atari computer in this

area, which is a public domain program called AMODEM.

However, the MPP-lOOOcomes with software that is at

least comparable. The problem arises when you want todo

other things with the modem. For example, there are

several people who want to start their own computer

bulletin boards, which requires different software.

If you are looking for ways to get into

telecommunication with your Atari computer, without an

Atari 850 interface module or an ATR8000, the MPP-1000

is the least expensive route. Other than that one problem,

I have heard no complaints, so that modem seems to be

worthy of consideration. I will be looking into the features

of that modem and ways around the problem of interfacing

it to other software. This will be reported in future

columns.

Information such as this can also be found on Nite Lite

if you already have telecommunications capabilities at

either 300 or 1200baud. Nite Lite operates from 7:00 pmuntil 7:00 am, eastern time, at (617) 576-2426. I£you call,

leave me a message telling me that you got the number

from this column. You are, of course, welcome to leave

suggestions of issues for me to address in this column on

Nite Lite.

Telecommunications is a rapidly expanding area on

personal computers. As the number of callers increases,

the amount of information and entertainment available

from these computer bulletin boards increases

proportionally. There are also other new services opening

up that are accessible using the same equipment and

software required to access the free bulletin boards.

A\ ICRO"

MICRO 73

Page 76: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 76/84

IAlCAO"Hardware CatalogA Perfect 2nd Computer for the Three Useful Commodore Devices Inexpensive Atari Printer Interface

Apple Owner

MicroSci

2158 S. Hathaway Street

Santa Ana, CA 92705

714/241-5600

HAVAC [Homel Academic Very

Affordable Computer) is a transportable

[14.2 lbs), 64K RAM, 40 column

computer system compatible with the~Apple II family. Its designed around the

6502 chip and a new 5.25", 164K disk

drive. A stand alone drive is also offered

as an expansion product.

Over 1000 of the most popular

Apple programs have been successfully

run on the system. Each HAVAC is

shipped with an updated list of tested

programs, and any special instructions

needed to run them. These programs

include games, education and businesssoftware.

This computer is aimed at first time

users, but its low price of $850 also

makes it the perfect 2nd computer for

the two-computer family. That price

includes 64K RAM, 8K ROM; 164K

floppy disk drive; 62 Key detached

keyboard supporting upper and lower

case and 4 cursor keys, HiRES color

graphics; printer port, serial port, game

port and video hookup. Free software

includes HAVAC DOS, Typewriter,

Card File, Calculator, Utilities,

HAVAC BASIC and HAVACOM.

74

The C-64 is missing an importao.t

feature ...a reset switch. The only way

to regain control on a hung-up

computer is to tum it off and lose the

data entered already. A reset switch is

available which attaches with two

simple solder connections, either

externally in a separate box or through

a hole drilled in the computer cover.

With an enclosed software program, it

allows recovery of entered data, and

costs only $9.95.

An Interference Filter Kit solves the

problem of RF emissions from the

computer unit of older 64's. It requires

opening the computer and makingthree simple solder connections, but

can be done in minutes. Price is

$19.95.

A Monitor Cable with 5 - Pin Din Plug

with attach Commodore, Atari and

other computers to the new 1702

Commodore Monitor. The cable

packed with the monitor has an 8-pm

din plug that won't work with many

machines. This retails for $24.95.

Bytes &Pieces

550 N. 68th Street

Wauwatosa, WI 53213

MICRO

APE-FACE allows Atari computer

owners to choose from a variety of

standard printers, including Epson,

Okidata, Centronics and many other

parallel style printers. There are

currently two models: the 48P works

with the Atari 400 and 800 computers;

the XLP is for all Atari computers

including the new XLline. There is no

installation needed; simply plug in the

cable to the printer and computer. The

suggested price is $89.95.

Digital Devices Corp.

151Sixth Street

Suite 127, O'Keefe Bldg.

Atlanta, GA 30313404/872-4430

Modem Adapter for the Atari Serial

Bus

The R-Verter, Serial Bus Modem

Adapter for Atari 400, 600XL, 800 and

800XLhome computer systems allows

most modems and other RS-232Cdevices to be used directly without

using the Atari 850 Interface Module or

other interfaces. It comes with a

software package which includes a

smart terminal emulator and an RS-

232C device handler, and will work

with any RE-232C device which will

accept TTL-level inputs [the majority

will). The R-Verter requires no

modifications of the computer or other

peripherals and it does not use up a

No. 71 . April /May 1984

Page 77: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 77/84

joystick port. All circuitry is contained

in an RS-232C type connector to

minimize size.

Itcomes with a built-in 3 foot cable

and is available in either male or female

connector configurations. When used

with the A.LD. Interfast-l buffered

printer interface (not included), it

allows modem or RS-232C data to be

echoed to a printer without first storing

to a cassette or disk. Most common RS-

232C handshaking configurations are

available using internal jumpers. Price

with terminal and print echo software

is $49.95.

Advanced Interface Devices, Inc.

P.O. Box 2188Melbourne, FL32902

305/676-1275

The drives are different in size and

shape from typical OEM drives. This is

largely due to the horizontal clutch

carrier plate which is lowered via a

nylon coated, miniature steel cable and

activated by turning an ergonomically

designed knob. The new drives are

packaged in plastic housings and are

slightly larger than standard OEM

drives. According to the manufacturer,

product maintenance and cost of

maintenance is low due to fewer parts

and simpler manufacturing process.

End user pricing for the XL and XL80

are: $199 and $299.

MicroSci

2158 S. Hathaway StreetSanta Ana, CA 92705

7141241-5600

R-Verter

Serial Bus Modem

Adapter

~::::IID. . . . . '""~-" . . . . .~." . ~

Apple Compatible Disk Drives

Designed for End User

The XL and XL80 disk subsystems are

Apple compatible floppy disk drives

with capacities of 164K-bytes and

328K-bytes respectively. With access

times of 18msec, the 40 and 80 track

drives are useful for applications

ranging from software requiring 35

track, 100% Apple compatibility on

the small drive, to CP/M, PRODOS

and volume sensitive software on the

larger drive.

Parallel Interface Card for Apple

The UniPrint card is an easy-to-use and

inexpensive interface card for parallel

printers. It is compatible with the

Apple IT+ ,Apple Ile, and a wide variety

of printers. The purchase price of

$89.00 includes a Centronics

compatible cable and graphic transfer

capabilities.

UniPrint provides transfers of

HiRes graphics pages one and two,

expands and shrinks the images, or

rotates the images in any direction by

90 degrees. Color transfers are also

possible on the Dataproducts (IDS)

Prism printer.

The manual provides a step-by-step

procedure for installation of the

UniPrint and even includes pre-tested

configurations for the most popular

parallel printers avialable. Over 25

printers are listed, including: Epson,C-ITOH, Apple DMP, Anadex.

Videx, Inc.

1105 N.E. Circle Blvd.

Corvallis, OR 97330

503/758-0521

Data Line Surge Protection

The SurgeSentry offers data line

protection against power-induced

problems such as static, electrical

storms and other electrical interferenceproblems. When a modem transmits its

data signal via long distance phone

lines, high voltage spikes and

transients caused by storms, power

stations, etc. can't be avoided and are

carried along with the data being

transmitted.

The data line protector constantly

monitors the line as a passive device

and, when a voltage spike is detected,

clamps on the surge and absorbs the

power from the line. This two-stage

No. 71 - April/May 1984 75ICRO

Page 78: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 78/84

I' , '

1

,

i

suppression device was designed to

provide the fastest reaction time and

the highest absorption level, using

silicon avalanch diodes and gas

discharge tubes Ispark gaps).

The SurgeSentry plugs directly into

a household phone jack, and the

modem cable plugs into it, thus

protecting the line to the modern and

equipment connected to it. TheSurgeSentry retails for $89.50.

RKS Industries

4865 Scotts Valley Drive

Scotts Valley, CA S5066

408/438-5760

76

C64-fORTH/79New and Improved

for the Commodore 64

C64- Forth/79 T for the Commodore 64-$99.95• New and improved FORTH-79 implementation with

extensions.

• Extension package including l ines, circles, scaling,

windowing, mixed high res-character graphics and spr ite

graphics.

• Fully compatible floating point package including

arithmetic, relational, logical and transcendental functions.

• String extensions including LEFT$, RIGHT$, and MID$.

• Full feature screen editor and macro assembler.

• Compatible with VIC peripherals including disks, data set,

modem, printer and cartridge.

• Expanded 167 page manual with examples and application

screens.

• "SAVE TURNKEY" normally allows application program

distribution without licensing or royalties.

(Commodore 64 is a trademark of Commodore)

TO ORDER-Disk only.

-Check, money order, bank card, COD's add $1.65

-Add $4.00 postage and handling in USA and Canada

-Mass. orders add 5% sales tax

-Foreign orders add 20% shipping and handling

-Dealer inquiries welcome

PE R FORM ANCE M ICR O PR OD UCTS770 Dedham StreetCanton, MA 02021(617) 828-1209 -ISA-

MICRO

Surge Suppressor Outlet Strip

The LG20 Surge Suppressor Multi-

Outlet Strip offers small computer

owners protection against voltage

surges that can damage and even

destroy electronic solid state

components. Since this product caneasily be installed by simply plugging

into any 15A125V AC outlet, it is ideal

for home, business or office use.

This UL-listed 9 3/4" product

features four "U ground" outlets, an

onloff switch with pilot light, a six

foot cord with three prong grounding

plug, and a push-to-reset circuit

breaker which protects against power

overloads. The suppression circuit acts

as a shock absorber by limiting surges

or spikes without interfering with

normal current flow. The LG20 will

absorb surges up to 6000 volts or 6500

Amps in less than 10 nanoseconds. The

unit limits voltage to a safe 205 volts.

The LG20 sells for $34.95 plus $2

shipping and handling.

Gadgeteer

1524 Pine Street

Philadelphia, PA 19102

215/732-0965

NOTE: When you contact the

manufacturers about these

products, please be sure to tell

them "I saw it in MICRO." We

appreciate your support.

No. 71 - Apri l/May 1984

Page 79: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 79/84

Index of ReviewsJune 1983 through May 1984

Title

Magic Memory

Apple Record ManagerPersonal Finance ManagerFile-Fax

TGS: The Graphic Solution

Master Grades

Form Letter Writer

Mail ListData ManagerCareer Counselor

Homebase

C.C.Calc Disk VersionDisk Data Handler

Semi-DrawMail controller

Diary 64

Passive Solar Design for Horne

64 Mail ListHello Central!

Disk COLORCOM/E Smart Term.

The Color ConnectionBugByter

Ultra DisassemblerBASIC Debugger

Atari BASIC CompilerABC

DISKEDTSTARDOS 64

BASIC Aid

CCREAD Editor/Assmb/Debugger

Disassembler for 6809

Platinum WorksaverUltra 80CC

Computer Mechanic

SYSRESDe1ta DrawingExper. in Human Physiology

Flight Simulator IIWord AttackWatchwords & Wordisk Maker

Bumble Garnes

General ChemistryFace MakerMultiploy

Manufacturer Type Micro Issue

ARTSCICONN. INFO SYSTEMS

APPLE COMPUTER INCTMQ SOFTWARE

ACCENT SOFTWARE

MIDWEST SOFTWARE

MMG MICRO SOFTWARE

MMG MICRO SOFTWAREMMG MICRO SOFTWAREMMG MICRO SOFTWARE

HOMEBASE COMP. SYS. A

TRANSFORMATION TECH ACUSTOM SOFTWARE ENGIN. A

COMPUTERWARE AORBYTE A

COMPUTER MARKETING A

DON DANVLYK A

COMPUTER MARKETING A

HOWARD W. SAMS C

EIGEN SYSTEMS C

COMPUTE RWARE CCOMPUTER-ADVENTURE D

ADVENTURE INTER. D

MMG MICRO SOFTWARE D

DATASOFT DMONARCH DATA SYS D

SPECTRAL ASSOCIATI:S DSTAR KITS D

EIGEN SYSTEMS D

EIGEN SYSTEMS DGRANITE COMPUTER SYS D

PLATINUM SOFTWARE DSPECTRAL ASSOCIATE:S D

SOFTSYNC D

SOLIDUS INTERNATIONAL DSPINNAKER SOFTWARE: E

HRM SOFTWARE E

SUBLOGIC EDAVIDSON & ASSOCIJ!~TES E

MICROMEDIA SOFTWARE E

THE LEARNING CO. E

COMPRESS ESPINNAKER SOFTWARE: ERESTON PUBLISHING CO E

A

A

A

A

A

A

A

A

A

A

APPLE 71

APPLE 68APPLE 67

APPLE 64

APPLE 63

AP/PET 64

ATARI 70

ATARI 68ATARI 67ATARI 66

Type Key: Application, Communication, Development, Educational,

Forth, Game, Hardware, Language, Software, Tutorial,

Utility or Word processor.

No. 71 . April/May 1984 MICRO

COCOCOCO

COCO

COCOC64

C64

C64

C64

APPLE

COCO

COCO

APPLE

ATARIATARI

ATARIATARI

COCOCOCO

COCO

COCOCOCO

COCOCOCO

C64

C64APPLEAPPLE

APPLEAPPLE

APPLE

APPLEAPPLEAPPLEAPPLE

7067

61

6171

68

67

66

63

67

65

68

66

66

65637070

68

6867

62

61

71

677171

7165

64

64646362

77

Page 80: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 80/84

Title

Earl's Word Power: Homonyms

Decimal PracticePreparing for the SAT

Square Pairs

Turtle TracksWordraceMathmenu 1.0

Fundamentals of MathematicsC64-FORTHMickey in the Great OutdoorsShrinkPrintmate 99 PrinterPrintmate 150G Printer

RAM/EPROM Memory Board

APPLE Pin SaverUltra ROM Board/Editor

KoalaPad Touch Tablet

KoalaPadHJL-57 CoCo Replacement Kbrd.

CCP-l Serial/Parallel Int.Disk Interface/ROM Pack Ext.

RS-232/C Expansion Cable

Spectrum Stick

TRS-80 Model 100 Port. Compo

Interpod

Smart AsciiRobographics CAD-l

VoiceBox II

TYMAC Universal

Vanilla PILOTDataFax

Aztec C

ANA-ListMicro Illustrator

Money ToolModula-2

The Stripper

NEWTALKThe World of CountingCdex Training for VisiCalc

The Visible Computer: 6502

Discover BASIC

CoCoDisk Library

Insta-LDad

The Prime Plotter

Apple Mechanic

BASIC Commander

Pro-Color-File64K Disk Utility PackageDisk Utilities with RepairBank Street Writer

Super Text

Casual Writer

78

Manufacturer Type Micro Issue

GEORGE EARL

CONTROL DATA PUBL.

PROGRAM DESIGN, INC

SCHOLASTIC INC

SCHOLASTIC INCDON'T ASK SOFTWAREINTER+ACTION

STERLING SWIFT PUBL.COMPUTER MARKETINGWALT DISNEYSTAR KITSMICRO PERIPHALS

MICRO PHERIPHALS

JOHN BELL ENGINEERINGKEN BRANSCOME ASSOC.HOLLYWOOD HARDWARE

KOALA TECHNOLOGIES

KOALA TECHNOLOGIESHJL PRODUCTSBOTEK INSTRUMENTS

SPECTRUM PROJECTS

SPECTRUM PROJECTS

SPECTRUM PROJECTS

TANDY CORPORATIONOXFORD COMPo SYS.

MIDWEST MICRO ASSOCROBO GRAPHICS

THE ALIEN GROUP

MICRO

E

E

E

E

EE

E

EF

G

G

H

H

APPLE

ATARIATARI

ATARI

ATARIATARICOCO

C64C64ATARICOCOALLALL

Tape Interface MICRO-WARE DIST.

COMPUTER MARKETINGLINK SYSTEMS

MANX SOFTWARE SYS.SYNOPTIC SOFTWAREKOALA TECHNOLOGIES

HOWARD W. SA~:S

VOLITION SYSTEMS

EIGEN SYSTEMS

STAR KITSEDUCOMP ENTERPRISESCDEX CORPORATION

SOFTWARE MASTERSSTERLING SWIFT PUBL.

ISA SOFTWAREMODULAR MEDIA.EDEN II COMPCTING

PRIMESOFT CORP

BEAGLE BROTHERS

MMG MICRO SOFTWARE

DERRINGERSPECTRUM PROJECTSCOMPUTE RWAREBRODERBUND SOFTWARE

MUSE

E.N. PUBLICATIONS

HALLH APPLEH APPLE

H APPLE

H ATARIH COCO

H COCO

H COCO

H COCO

H COCO

H OTHER

H 64/20

H/C 64/20H/S APPLE

H/S ATARI

H/U 64/20

L 64/20S APPLE

S APPLES APPLES APPLE

S APPLES APPLE

S COCO

S COCOT APPLE

T APPLET APPLET APPLE

T C64U APPLE

U APPLEU APPLE

U

U

U

U

U

W

W

W

APPLE

ATARI

COCOCOCOCOCOAP/AT

C64

VIC

61

7067

67

676770

676766687068

627067

67

707168

68

66

63

67

68

676768

66

6570

707068

6866

68

667167

6664

6564

6463

61

637167626571

66

No. 71 - April/May 1984

Page 81: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 81/84

MICRO Program Listing Con"entions

Commodore

L I S T I N GC o m m a n d s

C 6 4 K EY B O A RD

( C L E A R )

( H O M E )

{ I N S E P T }

( D O W N }

{ U P }

( R I G H T )

( L E F T }

: ) , C L f . :

;:; j H O M E

ill:~~:l

~iU

IN S T

C R S R D O W N, C R S R U P

C R S R R I G H TI, C R S R L E F T

C o l o r s

C B L A C U(WHITE)

{ R E D }

( C Y N }

( P U R P L E )

( G R E E N }

{ B L U E ]

{ Y E L L O W }

( R V S }

{ R V S O F F }

•C T R L 1 B L K

= -C T R L 2 W H T

f~ C T R L 3 R E D

. . . C T R L 4 c v N

:i f C T R L 5 P U R

ii C T R L 6 G R N!':II C T R L 7 B L U0:Il

: ' I i C T R L 8 Y E L

~ C T R L 9 R V S O N

!! ! C T R L I) R V S O F F

( O R A N G E } ;~ =

( B R O W N } P J =",L

{ G R E Y 1 } ~, 7.j

{ G R E Y Ii :il = 4

( G R E Y 2} ~~ = 5(Ll G R E E N ) Ii = 6

ar BLUE} ~ = l( G R E I

. . , Ii. . . 8j I • •

F u n c t i o n s

{F 1 J • f 1

{F2} a " f2

{F3 :: !!n{F4} ~ ., f4(F 5} II f5

{Fed :d,.,

f6

(F7} II f 7{F8} II f8

S p ec i a l C h a r a c t e r s

(P I } 'I T Pi C h a r{ P O U N D } £ P o u n d Sign

{UP A R R O W } l Up A r r o w

( B A C k. A R R O I ~ } ~ Sac k A r r o w

Afar;

C o n v e n t i o n s u s e d i n A fA R I L i s t i n g s .

N o rM l A lp h a n u le r i c a p p e a r a s U P P E R C A S E . :

S A M P L E

R e v e r s e d A lp h a n u m e r i c a p p e a r a s lo w e r c a s e :

y E S ( y i s r e v e rs e d )

S p e c ia l C o n t r o l C h a r a c t e r s i n q u o t e s a p p e a r a s :

( c o m m a nd } a s f o l lo " s :

L i s t i n g

{ U P }

( f l O W N }

{ L E F T }

{ R I G H T }

{ C L E A R }

{ B A C K }

nAB}{ ! } E L E T E LINE}

{ I N S E R T LINE}

{ C LE AR T A B }

{ S E T T A B }

{ B E E P }

{ D E L E T E }

{ I N S E R T }

{ C T R L A }

C o l l t f l a r i d A f A R IK e y s

No. 71 - April/May 1984

E u r s o r U p E S C /C T R L -

C u r s o r D o w n E S C /C T R L =

C u r s o r L e f t + E S C i C T R L +

C u r s o r R i g h t + E S C ! C T R L *C le a r S c r e e n "I i E S C ! C L E A F :

B a c k S p a c e ~ E S C /B A C K SC l r s o r t o T a b . . E S C I T A B

D ~ le t e L in e [JE S c /S H IF T D EL E TE

liser t L i n e D E S c /S H IF T IN SE RT

C le a r T a b S t o p E ll E S c /C H L T A B

S . ~ t Iab s t o p ID E .S c/S H I F T T A B

B , ~ e p S p e a k e r ~ E S C iU R L 2D ,~ l e t e C h a r. U E S C i C T R L B A C K S

I n s e r t C h a r . IlE SC iC TR L IN S E R T

B r a p h i c C h a r . . . C T R L A

w i i e r e A i s a l iY 8 r a p h i c L e t t e r K e y

N o n - K e y b o a r d C o m m a n d s

{DIS" '}

i E N B = }

L L O W E R C A S e )

{ U P P E R C I1 S E J .

{'RETURN}

{DE L )

{SPACE}

N o t e s :

C H R $ 1 8 !

OIR$' '7 J

CHiH t 14 )

C H R $ ( 1 4 2 )

CHR$(14 i )

C H R $ ( 2 1 ) )

C HR $ (160 )

1. ., repr e se rt s SHI rT KEy

2 . ' " r e p r e s e 1 t s C o m m o d o r e K e y 1n

l o w e r l e f t c o r n e r o f k e y b o a r d

3 . C T RL r e p r ! s e n t s C r R L K e y

4. G r a p h i c s : h a r a c t e r s r e p r e s e n t e d

I n L l s t l n g by k e y s t r o k e s r e q U I r e d

t o g e n e r a t e t h e c h a r a c t e r

5 . A n U mb e r ,jir e c t I y ·3 ft ? r a t S 'I M l: i 0 L J

I n d l c a t e s m u l t l p l e s ot t h e ~ Y M 8 0 L :

( D O W N 6 } w o u l d m e a n D D ~ N 6 t I m e s

MICRO 79

Page 82: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 82/84

7

. ' 48

4,5

57

Advertiser's Index1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Coming in June

A B Computers

Amplify .

Computer Mail Order

F. Ashton

Horne Base Supply

J &M Software

JJWild .

Lazerware

MICRO Magazine

Nibble .

Percorn

Performance Micro Products

Perry Peripherals

As a special bonus to Micro readers, we are

including tile complete all-new Apple lie

Supplement toWhat's Where in th Apple.

We will also share with you the fruits of

someone's seven years of labor ... a Random

Number Generator that has endless possibilities.

For those unfamiliar with Macro's, we have an

informative article explaining what Macro's are

and how to incorporate them in your

programming. The musical minded will enjoy our

Musical Notes article putting a 5-octive range at

your fingertips.

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

3 4

.. 16

Inside Back Cover

... ... .. 2

39,57

11,31

Back Cover

........ 76

........... 17,18,19

. ..... 46

. . . . . .. . . .. . .. 7 2

Protecto

Safeware .

Skyles Electric Works

Specialty Electronics

Winders & Geist

Zanim Systems ...

Ins. Front Cvr

.......... 48

......... 9

1,36,80

WHERE'S THE

MicroCalc !

Those of you who took advantage of

our recent subscription promotionwhich featured a free copy of our newMicroCalc Screen-Oriented

Calculation Program - please bepatient a little while longer. Our

original plan was to make a few

'minor' improvements to theMicroCalc that was published inMICRO 68 (December 1983)' and

release it on disk. Well, once we gotinto making changes, we sort of got'carried away'. This has been theprimary cause of the delay.

The version of MicroCalc to be

released shortly has many majorimprovements and completely new

functions. These include:

o the ability to handle strings and

string functions as well as numbers,o program control functions for

looping and testing limits,o informative help screens,o disk I/O routines that allow forautomatic calling of subsidaryscreens from disk,

o printer routines for dumping the

display screen,

80

o printer routines for generatingformatted output,o plus an extensive manual,complete listings, and demonstrationscreens.

Due to these addit ional features, andthe extra effort that has gone intodevelopment of the MicroCalcpackage, the price has beenincreased from $14.95 to $29.95.

Those of you who have alreadyordered MicroCalc, or who are owed it

as part of your subscription, will notbe charged anything extra.

We are sorry it has taken the extra

time, but you will find that the timewas well spent. The Commodore 64version will be completed by the timeyou read this. The Apple version will

be available in May and the Atari andCoCo versions in Mayor June.

D i sk Se rv ic e

Now Ava ila ble .

In response to your requests, weare now offering selected

programs from recent issues ondiskette. We will expand this

MICRO

service, if there is adequatedemand. Each diskette will includeall of the programs in BASICand/or Assembly Source, plus

binary 'Ioad-and-qo' files. The priceincludes shipping and handling.

Master Disk DirectoryCharles HillApple II with diskMD·1 MICRO 67/69

Does-It Monitor

Michael Keryan

Commodore 64MD·2 MICRO 6 8 /6 9/7 0 1 7 1

Accurate PrinterRichard MarmonAtari with Epson PrinterMD·3 MICRO 71

Send us your requests. If there is

enough interest for any particularprogram, we will issue a diskette.

Please order each diskette by

Name and Number

Send $15.00 for each diskette to:

MICRO DiskettesP.O. Box 6502Chelmsford, MA 01824

No. 71 - April/May 1984

Page 83: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 83/84

Compu te r ' s

Choice .

PrimageIThe revolutionary oftice duty; letter quality

daisy printer system from Primcrqes.In word processing and datacommunications applications,where high quality printing at highspeed means higher computerproductivity- The Primage I daisyprinter by Primages is thecomputer's first choice.That's because Primage I,with

its PAGEMATE 1*sheet feeder,costs much less than any otheroffice-quality, high-speed daisy

printer. And because it's easyto interface with any micro-computer system .

• PAGEMATE is a trademark

of Pnmages, Inc.

Primage I features:

• 45 cps speed in heavyduty applications

• Word processingfeatures

• Consistent letterquality production

• Wide choice of fonts• Easy connection toyour computer

. i Easy to install sheetfeeder that handlesup to 11"x 14" sheets,either landscape orportrait

• Full 131/2"writing line

• Switch selectablemultiple languages

• Patented technologyfor greater reliability

Main Office: 163 Reservoir Street, Needham, MA 02194, (617) 449-5600

Branch Offices: P.O. Box 214, Rock Hill, CT 06067, (203) 529-9123

70 Oriole Drive, Bedford, NH 03102, (603) 472-2123

Page 84: Micro 6502 Journal April/May 1984

8/3/2019 Micro 6502 Journal April/May 1984

http://slidepdf.com/reader/full/micro-6502-journal-aprilmay-1984 84/84

That's right th e positively perfect PERC OM DATA 5Y4, floppy disk drive with a BUi lT - INPRINTER-PORT, for your Alari"' 400/800 IS now available!

Unltl now, Atarl computer Owners who wanted to hook a printer to their computer had only onechoice. spend about $220 fo r an Interface device. THOSE DAYS ARE OVE~. PER CO M DATA hasbuill a parallel printer-port right rnto its new AT8 8 PO model Now you can add a quality disk drive

system AN D have a place to plug in a printer .W IT HO UT B UYIN G an lnterfaceThe ATBS S1 PO"' disk drive operates In both Single density (88K bytes formatted) and double