Page 1


.. ..... =

~u-ELLPRO

.....l•• to ... ••uilt£ for die Commodlwe 64

.

M .-111 die .,.,.10 l*folm ,.....~ ,.die

MOl nW.nonlca.

... ,.

64

Is an easy to use ~lling checker w.lh A s.uncbrd dicuonMy exp~n<bble words SpeUPro b4 qUickly !M.lto vour per·sortal voc~,...,..; 1.0 add and

edit documenu to correct worcll and ouqNC liau of urrKOifllncl worda to printer or screen SpeltPro 64 was Mlllfled to work with the WordPro Serlc!s•and odwr wordprCKIISiinc proararm lA.,. the WordPro file format $69.ts the

M

.. 11'1 lblolucely lndllpentlble . . to

.~~::':~OfM!Odlm l'elident BASIC with dozens of n - .uper

ueeful commands Ike MERGE. UNDO. mT l!1d DISK II w.a ... die olcl

UINibl'l tueh as 1\ENUM and SEARCH & RIPLAa lncludol MorePower 6't S6f.tl

NOW SHIPPING!!!

TOOLBOXM

Is the ulti!Nre pro~r 1 utility ~

packqe Includes Pal 64 asaembler

For Your Nearest Dealer

Poww 64 BASIC 'OUJMIP ktt aH

toaether "' one futly Jntqrared and

KOIIOIIIIcll paclcap

Sl2t.tl

Call

(4t 6) 273-6350 c.,..,.~

.. '-4 ••1d("mltniQ:hlrf'l

.... u.d.n

h

CommodOA a..s>nn& I'!Khll!" In< • Pr,.•ncly rnarklle<ll>)' Profn&IOfOI SofiW~<e kiC Spoc ,,,...,..,... ...lojo<'l In • twncr wchoO« noace

PRD·LINE -··IIIISDFTWARE •

l-il6\ 273-6350

~n Tl* QU£ENSWAY EAST. UNIT I,

I'IISSJS.'iAUGA ONTARIO. CANADA, l:4Y 4CS


I

for c the c commodore o64

challenge the asteroid field, maneuver the caves of Ice, experience the thrill, plalf laser strike.

a ••er strike, written In full machine language tor the Commodore &4. Commodore 64 is a registered trademark of Commodore Businen Machines Inc. In U.S. C.ssette$24.95

Disk 129.911 Isla Hathor Digital Production• 6164 Verdure Ave. Goleta, CA 931 17 18051 964·6335

&dd $2.00 postage and handling CaiHomla residents add sales tax

*

•'*'

Ask about Laser strike posters

I'IS HATHOR DIGITAL PRODUCTIONS

In U.K. Cassette£ 9.00 VAT Included Disk £1V.V5 VAT included Isis Hathor U.K. Andrew Barrow Royden, Perkslane Prestwood, Gt. Ml. . .nden Bucks, lnglancl HP11 OJD 02406-3224 You will be billed for postage and handling


I

DO SPEND 25 50 0 or $500,000 BEFORE YOU SPEND $79째 OBJECTIVES This book will provide managers, engineers, manufacturing personnel end any interested persons an understanding of the f\XIdamentals of Computer Aided Design (CAD) and Computer Aided manufacturing (CAM) applications and technology.

PROGRAM DESCRIPTION The program will expose you to the various CAD/CAM terminologies used. Hardware and software comparisons will be explored with heavy emphasis on their advantages and disadvantages. Cost justification and implementation are presented using case studies.

WHO SHOULD PARTICIPATE The course is designed for but not limited to: - Those managers, engineers and research professionals associated with the manufacturing industr'Y. - Personnel from Product, Tool Design. Plant layout and Plant Engineering who are interested in CAD/CAM.

ADVANTAGESEND RESULT This program wiU enable particip~ts to: 1. Leam basic CAD/CAM Vocabulary. 2. Better lllderstand the various hardware and software components used in a typical CAD work station. 3. Select the existing CAD/CAM system most appropriate for current and projected needs. 4. Make an effective cost justification as to Why they SHOULD or SHOULD NOT implement a CAO/CAM system.

5 .Apply and use computer graphics as a productivity tool.

PROGRAM CONTENT 1 . Introduction a. History of CAD/CAM b. Importance of CAD/CAM 2 . Graphics work station peripherals a. Input b. Output c. Advantages and disadvantages of input and output devices. 3. Computer Graphics Systems (Hardware] a. Micros b. Minis c. Main Frames d. Turnkey Graphics systems 4. Software a. Operating systems b. Graphics Packages c. Graphics Modules 5. Computer Aided Design a. Geometric Definitions [Points, Unes, Circles, ETC.. ] b. Control functions c. Graphics Manipulations d. Drafting Functions e. Rling functions f. Applications .. _,_,..,_

---..

~

6. Implementation a. Determining needs b. Purchasing and Installing c. Getting Started 7. Cost Justification and Survey a. Cost comparisons of two and four work station systems. b. Presentation of recent survey of CAD system users

ZANIM SYSTEMSMAKES THIS SPECIAL OFFER: IF YOU BUY CAD/CAM: A

PRODUCTIVITY ENHANCEMENT TOOL BEFORE APRIL 15TH , W E WILL INCLUDEFREE OFCHARGETHESETWO PAPERS PUBLISHED NATIONALLY BY ZANIM SYSTEMS CAD/CAM EXPERT. 1. "Creation of a Large Data Base for a Small Graphics System'' 2. ''Shortest Path Algorithm Using Computer Graphics'' Of course you could spend as much as $495, $595 or $695 for a similar 3 day seminar even though this book is not a computer program. We tell you April 15th for a special reason ... this product may be t ax deductible depending on your field or needs. This 170 page course will satisfy any of your CAD/CAM needs. We guarantee it.

Please send $79 to:

CONllNUl NO EDUCAnDN I'OR erntR

r~ .,r:l

CAD I CAM: A PRODUCTIVITY ENHANCEMENTTOOL

ZANIM SYSTEMS CAD/CAM GROUP P.O. BOX 4384 FUNT, Ml 48504 [313) 233*5731 QUANTITY DISCOUNTS AVAILABLE FOR COLLEGES, UNIVERSITIES AND/OR SEMINAR USE.


SOFTWARE FOR VIC * COMMODORE 64 * PET FROM KING MICROWARE

• s D COPY FAST EFFICIENT SINGLE DISC COPIER FOR THE 1541 • WORDS & CALCS SPREAD SHEET FOR THE C-64 ALLOWS TEXT • CHART PAC 64 FINEST CHART MAKER AROUND • SMARTEES ACTION PACKED MAZE GAME t\E-'f'l\ THE BANKER THE FINEST CHECK. BOOK RECONCILIATION PROGRAM ON THE MARKET

• DAISY -

DATA ADAPTABLE INFORMATION SYSTEM -THE DATA BASE WITH A DIFFERENCE -ALLOWS YOU TO CALCULATE BETWEEN FIELDS

• ASTRO POSITIONS FIND THE STARS AND CAST

$19.95 $42.95 $42.95 $22.95 $38.95 $39.95

$43.95

YOUR HOROSCOPE

LOOK AT THE LANGUAGES WE HAVE '(E.S\ WE HAVE PASCAL

$52.95 $42.95 $22.95 $22.95 $36.95

uLTRABASIC WITH TURTLE GRAPHICS AND SOUND TINY BASIC COMPILER TINY FORTH FIG FORTH IMPLEMENTATION EDIT/ASM COMPLETE EDITOR ASSEMBLER PACKAGE 64-BUDGETEER 64-CRIBBAGE SKIER-64 64 QUICK-CHART

SYNTHY-64

VIC TINY PILOT VIC BUDGETEER VIC VIGIL VIC CRIBBAGE GRAPHVICS

SCREEN DUMP SPRITE-AID VIC HIRES VIC JOYSTICK PAINTER

VIC I-CHING

We are actively seeking SOFTWARE AUTHORS. WHY NOT SEND US YOUR PROGRAM FOR EVALUATiON .

Dealer Inquiries Invited Write for our FREE Catalogue for VIC and C-64 Canadian manufacturer aod distributor for ABACUS Software Products

Suite 210, 5950 COte des Neiges Montreal. Quebec H3S 1Z6


·······--·-·---- - - --

----------

Volume 5 Issue 02 Circulation 40,000

----·---------------·--------------------------------------------·--~

The Transition To Machine Language News BRK . . . 6 Letters The f<ttttcnct a

l t.lt\~ ('l !lf !~ Com t n ~!

8(•SI Of fl·~ Tr,u ·~H:ll)l IIIli!~

tfl

lt<.ut I)U.:U\biY Otd CI~

16

II' lfpd,.tiug Pu' i• ~

(.ommooorc lnlemJtlonol M n'l\lnecs New \(1 ~.., .. f d i iJII d t ' t '

Bits and Pieces

A; i l l Rr-l ...Jt>tl ~. Jllt Wttl l rJ.r.....,, \"'\

<.,.ommoctorc Heetl'tt.~ Kovil: w.1rrorn

Kcrnul 3 For 11lc Com modore 64 Cyli n~er Screen

C'•J1r1C>I~It-t ~ IW! \V! tllrl~ r.tu l~r-',1 '

w n.u

Jio:1, l<:nella lt 3nd mMon 1\0" ' i'ui>Mh!OR So!1wor~ ~.,,..-, PP.T1 J,t·•·~ u rp .ttul lin· '1,..' ?F.T i1.t,.·ltr I utort~l Ul:.kCIIC f'~r l l\e Sui>>~P&1 !lor' ~"' u• mint( Tlw PF.T t t.R\1 I tlt M~d>l nc l..'ll'i\lill:e B.,.,~ F'<;r The Commodore b·l ' lllt' A t \(J11J.Ifl} ()fil tt" ( IJU\U:W ll lll!f" M

s,

18

Mnehinc Language FTOUTSM <liHaZAMARAing Stop RUN/ STOP C:ursr~c'l

l urnmoc1orr. l.ur.>Or!

Sorry. But That DOES O:lmpute tuw-Rt:s S<:r\1\ln CullY

N,....,.,, .1 0 v.." ;.,,,

Upoens -.:-h.anfl<CI o: CommuniC.'ltl¢'"

orr..!,

A Ri!inhm\ ~ r u1uun. ~.,.., IJI~kOVtl'\' t:arly M 3th l'l'¢il73 111.' .'\ 0

• • • ••

Down Scroll (;4 FTOUTS!.I Wi lli Cnlollr l\'l!ld~

I hr /\nato-JtW Uf i'hc 1.; 11 Ut&.k Um·c \l o\STI'R-A·I j 0~ ~~ • 1\ New I'JO~ I OnlctltnR l<JilRU ~~ AI•p~k•••M-111 ~~hw111r' Fm m F01ltl11~rth"'l ~USJ ( t'HJa ueiiOll ~CI V lt<) Fl ,~, i tit liw

5

Exisling Lost Copy. (more on ProRram Generators)

JJcpattmcm rrR

Fl ~;t..- i.otr ,.,._,• ,_

Un- products? (C64 Keyboard & Drums Synthesizer) Responst:? Respo11se: (Auto l.iuer Rl:'visiled)

v.,r.• u... :1 .~1 n 0 1

" ··h\,( ! ;I!lit ,,, P Htll!f"'JI I:<It <'no~n nlul lflf('

Editorial

Eep Eep 1\·l irmr

Tu, 1)f" "l'• •)'i~t nt l .l •

I coctu:"S &sK Computer t.:ont'tptS •H,,....., mn·· H~ , , ...,.. R.-tt t ' Hr~ rt dij 1111f•i• !! 'l: •ft •·t~~t ~

R:~m Scan Cry~t;~f

l-o:nmodf>r( M M ~mc><" t(xp:~Mer 'Ril"it tnlAw•' n;. . k Rt~,;dnotl N,ti,_...- F,, ,_t", ~r\01 Cornrnunt<:o:lhOil'· in~erl\!Ce sno:1 Pnmer 1'\dJp:.er f lt'1 ·1•w sit F'u llo_:ll'"l p•: ul At t.d1.) '-1' St.-, ur lly ~f.liolttt'll

Number ll.ase Conv erter

The. Un- f.nrsm

Con1puKii1ks . . . . . . . . . . . . . . . . . . . . . . . . . 24

The MANAGER Column ............... . Review: MailPro 64 • • • • • • • • • • • • • • • • ••• Perspective: To GET Or Not To GET ...... . All About Commodore Abbreviations .... . Messing With The Stack ............... . The Un-Token Twins • • • • • • • .. . • • • Merging BASIC Programs • • • • • • • • • • • • • • An Introduction To The Tools And Techniques Of Machine Language ... . Your BASIC Monitor .................. . Finding Pi Experimentally ............. . Translating A BASIC Progrruu To Machine Language • • • • • • . . . . . . . . . . . A Few Of The Stranger 6502 Op Codes Explained • • • • . . .. . .. . . . . Getting BASIC To Communicate With Your Machine Code .............. . CIA Tilners • • • • • • • • • • • • • • • • • • • • • • • • • • 65 26 Time Of Day Clock . . . . . . . . . . . . . . .. Joycursor • • • • • • • • • • • • • • ••• • • • • • • • • • • Butterfield: SX64 Enudator • • • ••• • • • • • • •

..

.

CD

,r:.

....

Advertising Section Advertising Index !

Ill

27 34 36

37 49 51

s:1

55 58 63 66

72 76 83 86 90 91

• • • • • • • •

. . . . . . . . . . . 92

•• • • •

.......... . 104

• •

=======--=====::=::::::-:-:------=-========= ----·- ---·---··--------------·· --.Jl 3·-·---· -·--···---· ·v-o

:::1

The Tron u~ctor

-·-·----···-..--· --· .-. ..

...-

..--····-·-·.............................

l.-...~~==~---------- ·--------___;~-----·-·-

~~ m -.;-5;1ss-u~ ~i'-l


- -·- -------- ----------------··---- --·-·- -

________

·- -···--.....

- ' - -- '·'-' - - - '•'-' -. . . , . . , . . . _ _ . . . , ..

-'-'-,

Progrom U.stlng~ In The Transactor All programs listt.'l.i in Th!l Tra n~acto r will app<.•ar a.s they would on your scr~n in Upper/Lower case mode. To c.larify two potential character mi x~ups, zeroes will appe<1r as '0' <:~ nd lhe lt:llllt ''Q'"will ul cou•~e lw in low~r ca.~. SP.mndly, thP lower r n:>P. I. (T) hns fl f111t top 11.~ Ofl[)I1 <.P.<11o thP nnmhf'r I wh!<:h 1\a~ an

Managing Editor Karl J. 11. IIii don

angled top.

Editor

Many programs will contain reverse video characters that represent cursor movements. c<>lou rs. or funclion keys. These will alw be shown exadly as they would appear vn yuu1 ~ue~o:n , Lutllt..:v're lisl~ hf"rf' tm relnf'nr,; AI!IO rememher· CTill.-q wtthin fJIIOte~ is irl enhcal to a Cur~or Ut\wn. et al.

Ridli;Hd Ev~r~

Advertising Mnnager Kdly M. George

OccasionalI}' programs will contain lines that show conSE't~utive spaces. Oftrn the numhP.r of ~pllt'P.s ynn insen wi ll 1101 be critical 10 correct operation of the program. When it Is. the required number of spaces will be shQwn. Pu 1 ex. . ,nple:

4 16 82(; l (j (j2

Art Director Juh 1t Most<rl:d

Subscriptions Mandy Sedgwick

pr im"

flush right ·

Contrihuling Writl':rll Eric Armson

Cur&Or Charact~n l'or E'ET I CBM I VIC I 64 ------------·----------.:........:~---

Duu 8~11 Mit.: had RtJJt 1d.nu

-I

Down

-·-·

Up RI.Qbt

Dnniel llrngamon Brnd 8jorndahi Jim Butterfield Eliz;;hetr. Deal n nrnP.nir f)p,fmnr ism

- [Ut]

Left

KVS RV.S OH-

Bob Drake 1\.Uke Foran i

~

lu~rt

~I

I:J>t,IO!Ie_

-

a~-.ar Scm -

BJack

-- ~

Phil Hon~ i nger

R<!d

- .

Mike Pann inf!

Cyan - [Cynj J:>urpJc - IPuri

G•h!)tn s

Wblt..-

Dove Gzik Hn wy f'11rkrn~ Glen Pcnrcc

Green -

Louis f. Sander

8

Blue - . Yellow- IYelj

Geurue Shirinian OarrPn .I Spruy1

Colin Thompson Mike Todd Vikash Verma

HOOI.C

-~

STUt'

-

Orangr. Brow11 l.t. Red

Lt. Green 1.1. llluit -

G)·e y 3

F2 - D F3 - D

P7 -

ProdocUon

F1 - IJ

FS -

tid.

-

Greyz

Chris Zamara Typtc~~lli ng

-

C.o!'eyl

·-------·--------·hmc:1ion Keys h.lr VIC I 64 FI - IJ F!I-

James Whrte-woo<i

Allit

I

Colour Cbarac.t~rs.For VlC I 64

Jell G<Jebd M..-l i.~~~~

prin t· [sp11c:e Hl] fln~h right "

- would bl' shown as -

~-

- [O.r3J

I

II

PrintluJl f•nruerl tn (Jln~~c111 hy

Macl..eaJ' H11 nter Printmg The l'ran:wctor is puhlishe{.l hr-rn nnlhly h.y Tr~~n~IH'lnr l'nhhshmg ln t: It t.\ in ttu wa.y contt~dt!d w iLlt Conuuudure Busiues:. Ma.<.: hine:. LLJ . IJ[ Coi ltl't'to·

II S A rttslrthtttm· Pr~lnf" News. 2404 WP.~t Hrrsrh. Cl1ic~o.IL, 60622, (3 12)384 5350

dorc lncorporate<l. Commodore and Commodore product names (PET. CUM . VI C, l)4) Me regt~tere<i fmdt>mllrk~ of \.ommodorl' lnr .

Volu me 5 Subscriptions- C(\lllld<~

~: 15 Cc:in

W11nt to ariverlt$t' 11 prorlH<:1 or S('Ntce? C11 tl or writP. for mort': mformAI inn

Se;:onrl f'!11ss f\·l11tl

Editorial contriblH1 ons are always wetcorne 3nd wili appear in the issue tmmt'<itafl'l}' lnll ~wtng rt>rPtpt. RP nHtnf':rilti n.~ is .:!>40 pt'r r:rin tf'cl pagP.. P1 dt:1u!d m~1<1 ~~ 2G3 l , 4040. 80SO. Ot 82,,0 dtskettes wrth WordPro. WordCr.1lt. Surwnocri pl. or SEQ ceJ-n files. Program listi ngs over 25 !ines ~hn tt lrl he prnv irlf!rl on <1i ~k nr tarP.. M l\ntt~t'rirt5 .'\hnutd he t~pc'writl f'n , duubl~ svcrced. with ~pecidl ch<tr il~~ters or formats de¥1y rm rked. Pho~os of authors or equipmem. and Illustrations will be included wilh articles rlP.fH~ n<1ing on CJ•m lity Di)>keiiPS, IHflt'!S and/ o r photos will be return~)d o n request.

Pt!rtnil P~nuiug..

U.S.A.

$15 L:S_ t\ll o1hcr $18 l:S.

Send all subscri~Lions to: Tt1 c Transactor. Subscriptions Departmem. 500 Steeles Avr: nue. Millon, On111rrn, \ .l lnlldll, 1.9T ~P7, 4l fi R76 4741 . Fmm Tu1o11 to <:<~.H 826 1662. Note: Subscriptions a•~< handled at this addres.s ONLY. Back Issues: $11.50 each. SOLD OUT: The Best ol The Tra nsactor Volum f' :\, VnlumP. 4, I~Sil P.S 4 , !), ,~ 6 no lon ger ilVIltlllhle.

i\11 materi al ar~epted h~r.nme:<t the prop{~rly of Th e TrAnsactor_All material is coprright by 1i·ansactor Publicati ons Inc. Reprodu<:tion in any form wlrhOLtl permission Is in violation ol applicable laws. Please re-mnlirm anr pP<mis:\i nn~ ~ran tPd rrior to thi~ nn!irt>, Snlic'itPd materiAl is arcr.ptrd on iln all riRh ts basts o nly. Write to the subscriptions address above for a writers

Qtt antity Orde r~ : A~n~:>:> Cvlt tjJUI~!l s~ l vice;

Cu u)jJuLit

6308 Magnetic Drive

PO Bo:-: 352

l l ownsvrew, CJn111rro. MJI 2l.4

Port C:olluitlAm. Af.

60•1 1161122 1

Dealer Inquiries ONLY:

I ROO 2f>R 12:\R Subscri ption related inquiries arc handled ONLY at Milton HQ

___

....... ·-..... _.... _______________ _--

~------------- :....,

L·-- Th• TronJoCictor

packafle.

v::;c ,l KG

(416) '136 4402

.

.

The opi nions ex pressed in contr ibuted articles are not neces~a rily those of The Transactor .. Ailho ugh accuracy is a major oiJj~::cti vc. The Trau~oc:lor can not assumr liabili ty for erro rs in art ides or programs.

4

·----·----·----------------' ---------- ----..- - ---------J 'o'I?.~'!.~~~L.t~~~~~_?


.-------------------------------···-·-·· --~

The Transition To Machine Language

fn my opinion, a students' first taste of computer programming shvuld lJ~ a generous helpi ng of machine language. With no prior experience of the high IP.vP.I npproa<'h, they woutd have nothing to compare against, and the apprehension would be eliminated. Only th~ ft:cu or the unkuown must then be overcome. which is true for IP.arning anyrhing new. After assembling a month or two of simple machine language efforts, unveil the high level interpreter aud suddenly they gain new appreciation for progrilmmlng. " RI!N, you mean all I have to do is say RUN?" nut with the order reversed, several new fears dt:vt!luJJ. Suuuenly it's 110 Iunger possible to just sny 'RUN', and the learner rctrcnK

Why are so many afraid of Machine Language? Even the name Is intimi datin~. like it's the dialect spoken on some silicon based planet in another galaxy or something. Perhaps we should give it some other name. Somehow I feel this wouldn't ~ eno11gh, though.

-

So what is it? rs it rhe concept of reaching inside that thing called the microprocessor'/ Agreed, programming in raw he;'<adedmal can be a painlul experience, one which nobody should be subjected to and still be expected to mai ntain enthusiasm. No, pokinR ht:X codes 11ligli l be ok for lhe firS( r.:ouj)!e of 51Jyle programs, l.Jut anv more and you'll soon be turned off. J

·- ····---- - - ------....,

ExiJO~tJrt.l to Cl.l>li\mrbling machine language instills

other disci-

pli ne:.<; ton; pr~>-planning, variable definitions, correct structurinjl, and clear commenting and documentation. to name a few, are all necessary ingredients for machine language. They're lmportilnl in BASIC too, but how many of you have deemed them 'unnecessary' at one time or another. Then, 6 mo u!l"r~ lalt:Jr. you u~~u to add a variable to that program hut clon't know if it's .1lrr.arly been used Or you can 't remember what that silly looking subroutine does at liue 53427! High level euvironments lend themselves nicely to sidr.-!ltc~ppi ng. Th ose rhllt Acquire a little machine language disci· pJine early will naturally apply it when the time comes to \\•rite in BASIC. And when that machine language subroutine just can't be substituted, it wi ll be treated like a natural step toward s completion, rather than a job to be procrastinated as lvu~;: as iJossilJit!.

U!>ing a good Asseu1bler will takt: the sli11g away. Mw;t orter 6 ehflrllctr.r lnhr.ls on vflriahlP.s nnrl snhrominPs. Cnlling n suhm11tine by its name is much more practical than remembering its number. Still, most say even assembly language is too unsophisticated... no error messages, no string handling, no floating point variables, no this, no thai. .. you have lo do everything yourseiC! Ok, l admit, there are thinRs you can do in BASIC that would be hiucously 111ind u~mliug irs rm11.:hir te lar1guagt!. Mulli~Jii<.:atiun anti rli vi.~itln or fracrions is one tnsk I woulrl rringP. over, ~arne with triginometry, and worse. calculus! Hut nobody said you should use machine language all the time. In fact BASIC is perfect when you neerl only a few calculations, a bit of file handling, and most printers can't go faste r than BASIC anyways.

I urj:le you to try your hand at machine l angu~e or assembler.

Read through tile lis lings i n tit is issue or disa:;seml;le soure <:ode in

a progrnm you're ttsing. St111r~rmon has il rlisas.s~>mhl er in it and it's Except there are things you just can't accomplish within reason· able time in BASIC. lrnagi ue a ten field, ~ascade sort. . . will! enough daHl you wouldn' t sec tht~ re!;ults In your own lifc:limc! T his is where machine lanRuage truly makes its mark. Moving tex t iUUliiiU i~ a llalurallur llliid rim~ <:Odt!. Auu you Llotr'llleed to 'reinvent the wheel'. Thr.rr. nrc lo t ~ nf <;(')rt m111int>:o; Flnd orhP.r machine language utilities around that you can usually just slip into your BASIC. and the crafty soon learn how to use ROI\·1 subroutines for some particu larly nasty jobS. Even ~vriting them yoUI·sell can oflen save you time in the tong run. I don't need to rcrnlnd you, machine language is lightning fast!

There's nothing as <.:uustanl as <:hauge.. . ur1lil next issue, I rr.rnai n,

With the right luob, mixing r11ad riue l<111guag~ with BASIC is nut only cn..~y. hut th~ results ilrf' much morr mwnrcling. Yet we still avoid it. I believe one problem is the process which humans seem to naturally enjoy learning. that is. the easy way first. And too often thP M sy mrry is determined for us.

Karl J.H. Hildon

available from TPUG and most dub libraries.

Yom mmputer is n crei'llurE' of machine language. BASIC is there merely to tame the creature. Well it's time to cast away the protective shield and confront the creature on its own turf. YoLr'll find the ct1allenge of the microprocessor is is no jlreater than any other challenge, and once you conquer il, you'll ue dassifyi11g BASIC as an unworthy opponent!

Managing Editor, The T1ansactor When I first learned to ski. I was taught how to 'snow plow'. Then when I tried parallel skiing, I found myself constantly revertin~ to snow plowing. ll took a Ions time to break that habit. I thiuk the same is true hctwccn RASIC: ;mel asscmhlr.r. " J.rarn RASIC: firm, it'll give you a feel for programming'', we're told. Then we get too cuurfurtable irs BASICs' <:are-free envirormrent.

The Tran5actor

Post Script: Notice our circulation h~ures? Almost double our last IJU tuber! Co11se4ueutly we <:oul<.lu't get euough Con<:or<.le book papr.r in timP for this is.sur. so it hacl to be printed on this shiny stuff. \'o,'e were disappointed too, but we'll be back printing on the quality stuff next issue!

5

Volu~.• 5 1 lnue 02

J


r----------------------

NewsBRK

\\.

'

T ransactor New s Please uu uot subtuil ur<.l~r:. yet. This time we plan to print enough so th ere will be plenty to go around. Finc1l ul:!taib, incltJdillg cprantlty or<krs, will be released i n our nex.t issue (Augu~ t '84).

The Reference Transactor Is Comin g!

We'w. bccu gelling :.u

over The l<eference Issue (Volume 4, Issue 05) thol we've :.i1111Jly run ou t trying to meet the t11'milnc1. Refr.rence ls.o:uc " Users" have report~ uuyiug every copy in the store jusr ro havr rxrras when one wears out. Others have spent several dollars Hf'lling P.vl'ry pngl' lnmlnatcd. On behalf ul The T., I'd like to thank everyone for th(>ir I'OmplimP.nts rcgart..lin~ l~u e 05 and particularly those who have for.varded corrections and sugge~tio n s fur it tlpluvement5. II IUCh 1 e~ponse

Oe•t Of The Tran sactor Vo lume 3 SO I.O O UT! Our c.:urrcut bubscr iption cards show a space ror ordenn~ "The Best Of The Transactor Volume 3". Please do not complete thts srrtlon ns they too are all sold out. A " Be~l Of Ti re TrausdCtur VolumPo; 1 to 4'' hn.o; hrc-n ronsldcrcd, bul no flrrn plans have beerr set for •ts production so, once again. ple11~P clo not ~uh ml t orders yet. It may also sport a diskelte of prowams contai ned within . Jctdib to follow next i:.sue,

Although we will nor hi' f('·prlnti ng Volume 1. Issue 05. the NEW Referen ce Transactor is alrearlv in morion. .Srhrdulcd to be re • leased around September I st. 1984, il will be offPrPrl ns a srpnratr item lrurrr Transactor 1-'ubhshrng Inc. and wrll therefore not be Included with a regular :.ulJM:ri[JLiuu. The book will be printed on fin r C[Wlllty * 1 book paper and ''ring bour 1<.l' ' :.u it will lie lid! when opened to any pngf' r.ov~r pages will be made of a thicker stock to prevent untimely wear. Several nr w SC'r.ti ons arc plan ned includ i ng a complete list of I 'Et::.K and POKE proct>ch 1r<>.~ for all ol llll!lltury. an expanded Ulossary and book ltsl, drsk tnemory maps, plus all memory lllii[JS aml v~rtinent data for the new Commodore l'qllipmcnt that should be 011 the market then.

Bnck l ss ue Quantity Orders

-

!'lease note that back issues are to he ort1Prf't1 from Th<' Transactor hl:ad office in Milton, Ontario, and the current is ue frnm om <.lil>triuulu t neare~t you. The current issue becomes a back issue as soon as the next issue i:; rclc<llit:d. At this !)Oin t our distributors rr tmn the unused portion of their shipme11t , Tlrerdurt: you ca11 on ly gPt lhPm from us

uy

Kecently we've been recervinR several orders for quantitir.<i of hark bl>UCl> !rom US retailers. llowever, between shrpprnR char!tes, the quantity Ui~CUUIII, om] cu:-,tu111:. SCI ViCe charges, we actually lose on the transaction. In 1igt1t of this situ<~ tiul t, qudntity o•ders !rom rhr ll.SA for hnck Issues will bt~ costed at 25% of ft!loil valut: vl us MO 00 for postage, hanrlling, nnd customs surcharges.

The prrce will be somewherl' hrtwl'f'n S12.!li and S24.95. A rather lar~e spread I agree. The reason? We may inrl uc11' n clisk l'!t~ sewn i11tu tile cover of every book. The disk would contain copies or any utility ly[Je suuroutim:l> ii!>h:d in~ide, plus a whole batch of programs that gel a lot of use c~ruunJ The Tra11sactor development departmf'nt Programs lll<r Superman (versions fo r all uruuels). assembler~ and un-a_sPrnhlNs rlisk monitors, file readers. data generators, tnlelligen t directory readers, gnml'.<; tllilirics. son rou line~. cupy programs, programmers aids, communica t ion~ soh· wan;, text c<.litur:-.. plu:. anything else we can dr!l up that comes in h::lfldy when you need il rnust. Ami with some 7 years ot collecting thPSI' progm ms, we'll h:Jvc plenty to dig through!

The Transactor

Subs<:rlp tion Prob lems If you have a problem with rel:eiving mag<Ui ne5. we want it fixed ns <111irkly as you do! To help speed the prol:e:.!>. pled!>e write u:, with 1:1 comp1e>te ~x rt nnntlon of the situation. If you 1-> aiu Ly cheque, send us a copy • not that WP. rlon 't hl'lkvC' yo11 'vc paid. it iu~>l helps us find you eas1er and track the problem to the som r r .

6

Vol ume S , I ssue 02


-~--------------------------------,

If you have rent!wed your subscription and find you are receiving

home markr.r, thr \.ornmol1orl:' 16, featuring 16K bytes, or 16,000 rhArl'lCtPr.~ of built-in user RAM, and the Commodore 2G4, the series name for a 64K microcomputer that ws originally introduct:<.l at the Consumer Electronics !:>hvw iu Leis Vt.'!,las, Ncv<~<.la in ea'rly January.

two of each issue, then you've prohably heen entered twic:r. in our mailing li~t sy<;tl'm In thi~ rAsP your suh<~eriptlon has been duplicated when it should have been extended. This is our m1stake, but if not reported, you w11l recetve less is~ues than you are entitled to. II you're currently receiving duplicate issue!> that you haven't ordered. plei!Se inform Ul> w Wt! can correct it. And please keep the duplicates with our apologies.

Among primers and othl'f nrrcssori('s introduced at the Hannover FAir wPre four new printers desiRned for the VJC-20, the Commodore 64, and the new 2G4 senes. These include a low co~t dot matrix printer, a higher-end dot mcttrix vrinter, a colour tlot matrix printer. c111d a luw cul>t tlaisy wheel printer.

Uepa rtme ot 'TK' Each atltlre~ given ir1 the News BRK section will now include the line, '"Dept. TR." Please include this In the nddr~s should you write for mort' informnrion on 11 produrt li'>tf'd here It saves you the trouble of noting where you found the imhal product mformation (which we appreciate nonetheless} and it also gives the lllauulc~cturer (or ruilyue votential advertiser?) an itlea of how much rt!Sponse The Transactor rnisht generate for them (which we also appreciate).

F'inally, ('_ommodorC' nlso introducNithreP new accessories for the fi4 , inrlucling a touch screen, a liRht pen and the Commodore CAT, a mouse-hke devtce. All ~rotlucls. cxcevt the two business systems, will be avallablc during the last half of \ 984 , while dclivNy dmes for the business systcm.G will he nnnmmrrrl . C.nntnrt· Mr. Steven A. Ureenberg 30 Kockeleller Plaza NEWYORK, N.Y. 10 11 2. (212) 216 1000

Commodore News Commodore U.S. Updating Polley To r<'rl'ivl' nn uprlntr for nny of C.ommorlore's sofrware, send $5.00 U.S. plus the original diskette, alonR with the replacement d1skette card or a receipt to,

Commodore Receives Royal Warrant Commuuorc Busill\ISl> Madtines (UK) Limited, the leading microcomputer manufacturer. has become the fi rst manufnrturing company to he grnntrd thP RoyAl Warrant of Appointment by Her Majesty The Queen of EnRiand for computer busrness systems.

Commodore Disk Replacemeut 1200 Wilson Drive Wrst C'hf'StPr, PA I!l~AO

(.jenera! Manager of Cotnrnodure liK. Mr. Howartl Stanworth. said: "As il high technolo~ company with a gro\\~ng manufacturing and ancillary supplier base in the UK we nrc clP.Iightecl and honoured to rrrrivC' thP Roynl Warrant of Appointment to Her Majesty The Queen "

Commodor" lutermttional Announces New Microcomputers And Related Pe rlpbera.l Devices NF.W YORK, NY - \ommo<tore International Limited (NYSE:CBU) introduced a new line of mtcrocomputers. related pertpheral dev1ces and accessones, many ol which have never been shown publicly. The n~w intr ouuctiuu~ were lllatle at t1tt! Harmover Fair in Hannuv~;r, West Germany.

The Warrant carries the legend "By Avvoinlrmml to Her ~1ajt!Sty Tht: Queen, rn<tnufi!clurers of Computer Business Systems. Commodore Business ~lachines (UK) Llmircd Slotrgh" and is for an initial period of rrn yenrs

Among the n~w prm1llrts p1 1hllrly ~hown ror the very first time anywhere in the world were two new microcomputer systems for the business market.

Commodore UK is based at A1ax Avenue, Slough, England and has a factory at Corby, Northants, which produces nron:: than 5,000 microcompult:rs a day.

Ti re first ~>)'stem i~; a 16- uil, Z8000 microprocessor based computer system which features a Unix orlentc>d opcrntlng system, 2SfiK bytl'S, or 2.1o,OOO rhnmrrrrs of huilt-in user RAM, or random access memory, 80 column colour graphics, and built-in dual floppy dJsk drtves. Optional hard d1sks and printers will also be a\•ailable for this new system.

The Company r urrcnlly rmploy.~ 1'1 totAl of more than 300 people nne! II'IIPr this yPiH will create up to 1000 jobs when it opens 1ts European manufactunnf.l and distribution headquarters at Corby. Its best known pr oduct~ include tht! Couuuodore 8000 series systems. the VIC 20 home computer and the Commodore 64. recently voted " Home Computl'f of the YI'N" hy 11 numh<>r of lntNnl'ltlonnl rompii!Pr journals For further information. please corttact:

The second system. a 16 bit, 8088 mlcroprocc.~o;or based Commodore PC, is atransportahll' systl'm with softwarP compatibility with the IBM Personal Computer, and also includes 256K bytes of built-in user RAM. Thts system has more features and will be sold at a lower price than the IHM Personal Computer ,

~1 r.

Wu Yhee Ming (Managing Systems Technology Pte. Lttl. 119 Rochor Road '"01 I 0 Fu Lu Shou \omplrx Singapore 0718

In addition to the rwo new business systems. other computers shown at Hannover wert' two mirroromp11tl'rs clesigm~cl ror the

The Tran1actor

7

Di r~tor)

Volume 5, luue 02


.------··----~

General News

povular home and l>u~ii n es~ microcomputers, including the Apple lie, Maci ntosh, IBM PC and PCjr, Commodore 64, Atari 800XL and othcJs. Intr.re.stcd parties shn11ld contact Carl Cro~ or Ian Chadwick at (416) 255-4491 during normal business hours.

Computer Song Writing Contest Vince Fleming of Strangeland Music (ASCAP) and Dan Seitz of A l~p lt-Baz~ Musk (BMI) have announced they will join the panel of judges for EnTech Software's Fin;t Atlllual Co111puh:lr Suug Writing Comcst. AJeph- Baze and Strangeland are music publishing compnn iP.5 in the Lo~ Angeles area. Other contest judges will be named soon, and may possibly include executives from CRS and (:apitot J{ecords. EnTech's Computer Song Writi11g Contest. Lite first of its kind, will awards 1,000 and free studio time to the best musical composition written on thP. Commodore 64 with £nTech's "Studio 64''. Studio musicians, an arranger, and a producer will help turn rhe winner's composition mto a hit song. Contest entry blanks are available at ]Ji:lrtidpatiug deah:m;, aud entries will be accepted through November I, 1984. For more information , ront;lct:

Holt, Rinehart and Wi nston of Can ada, Limited Devt 'TR' 55 Horner Avenue Toronto, Ontario M8Z 4X6

SuperPET News SuperPET User•• Group and the SuperPET Gazette The SuperPET User's Croup, with members from Canada, the U.S., and Europe, has commenced publication of "The SuperPET Gazette''. This newsletter aims to provide valuable information on using the Su!)erPET. Fur exa lll vl~. tiL~;: Se]JlemlJt:r 1982 i~ue included articles on the following subjects: WatP.rloo microBASIC: The Keyhoarc1 nnd its Cocies Using BASIC Procedures in Immediate Mode SuperPET News

Mathew Stern ENTECH Computer Song Writing Contest PO Box 185 Dept 'TR' Su n Valley, CA 91353

A free \:OPY of the Septeml.>er bsue, which contains information on how to become a SuperPET User's Group member, can be obtainP.cl hy sending n reqnec;t Rlong with Fl U.S. 20-cenr stamp 10:

8 18 768-6646 .

Holt, Rine h..-t and WimJtou Now Publlahing Software Canadian hook publisher Holt, Rinehan & Winston has made the move to publishing softwMe; onP. of the flrst o f the large publishing firms to do so in this country. Already a distributor of CBS software, as well as Compute!, Hayden Books and dilithium Press computer books and software. HRW is going to develop, manufacture and sell software here in Canada. ''Whar we inrenn to offer", said \..-'l rl \.rM.~. Vice Pre5idcnt of the Trade and Professional Division, "are quality products for the home educational and business applications market. We don't want any 'Lhree month wonders'; we're looking at solid items with a longer selling lire cHid strong IJacklistvuleDlial. Carl also said that, while HRW'R P.mphasis would he on Cnnadlan authors and conten t, they would also be looking for software which has potential for international marketinR, particularly in the United States where their connections with CBS guarantee them a large mark et rcad1.

The Editor SuperPET Gazette PO Box 1 11 Dept 'TR' Harterns, NC 27943

Tutorial Diskette For The SuperPET This product contains five tutori al files divided into 19 sections. cle:<;r.rihing a varil'ly of a5rects of the ~1 1 pr.rPF.T r.ar ahi litil's. The most central facility of the SuperPET is the microEDlTOR, but unfortunately it is also the facility which is least well documented. This tutorial disk dis<:usses all uses and commands ol the editor cllld coulu be con~i d~ red an equivalent to the ]Jrograuu aing- language examples supplied by Waterloo on the tutorial disk. This tutorial also r.ontni ns much rcfcmnrc material not provinP.<l by Waterloo or Commodore. Many of the facilities described will only work under version 1.1 (and hopefully any later versions) of the Waterloo software.

HRW lntcnds to bring out tts first product, alre.-:~dy under development inhouse, in emly S11mmP.r of this yP.ar. Others will follow throuRhout the year. They are currently assembling a staff to manage the projects and have hired lan Chadwick, former editor of lnfoAge Magazi ne, freelance writer and author or "Mapping the Atari", as Software Et.li tor.

This diskette contains this DESCRIPTION fil e. a CONTENTS file which ts a table of contents for the tutorial sections; TUTORIAL fi les numbered \ through 5 containing the actual tutorial: and a UCENSE file which explains the product warranty and conditions of use. In addition there are some public-domain programs distrib· uted as a courtesy. All the contents of the disk are briefly described iu the DIRECTORY lilt!.

Rather than hiring a large StAll bAse or progrAmmers Anc1 clevelopers, Holt will work with a wide variety of talented, outside resource people. They are i nterested m discussing projects wi th an}'· canadian programmers, authors, teachers or developers who r~el they can w ntriiJu te tu tht! develupelllellt of :;ultware lur the

The topics in rhe tutoriAl fileo; r1re not presentffi in any pRrticlllar order, except to some extent from more Reneral to more 'techni· cal'. It would be possible to read the enttre 5 tutorials in order, (although with I OUOO + words it would take some time I but a IJt!tlt!r d!J!Jroad• might be to :;larl with the tu]Jics uf knuwn iut~ rc,l

8 :::.:.lu=.:.m!_SrJ_!Jue 02 - - - ---------·--·---· · - - __________V.~o

I


ilnd ddve into the others as the nt:t!\.1 ari:.es. You might want to extract out into other files or print out some subsets of the tutorials for quick reference. If you have the Waterloo !Help! facility (nod ;-. dual drivt>) you coulrl use it to automatt> ~rolling through the tutorial hies.

understand the operarion of the procr.â&#x20AC;˘;sor. ThP Mnrhine Language Book For The Commodore G4 is scheduled for release 10 Apnl in sottcover tor SI!:UJ:>. AvailaiJie front your local dealer or directly from Abacu:. SuftwartJ.

The CONTENTS file shows the file uame and exact lint! nuliii.Jcr of eadr s~tio11 header. You can go to a particular section by just typing this llne number after GETting the file, or of course you cnn t~ l w;-.ys find the next ~ection header with n +/SF.\ romm1md. Of course you should try out the various edit facilities while you are going throuRh the tutorial - you will learn to use the !iuperPt:T facilities by USINU them. Naturally you should start by creating a backUjJ COIJY of the tutorial disk udort! you do anything else (copy programs are supplied for that purpose).

AI.Jacus Software PO Box 721 1

nrrt 'TR'

Grand Rapids, 6 16 24 1-55 10

~II

49510

Tiae Auatumy Of The Commodore 61 Thl' Anatomy Of ThP Commodore 64 is aimed at the Commodore 64 owner who wants to better understand hts micro. It is a 300 page detarled gurde to the lesser known featurtJ:. of th~ 64. Here's an outline of the couttJnts;

We wish you the best of luck in mastering your Commodore SuperPET. lt rs one of the most sophisticated micro systems available and an excellent vehicle for learning to compu te. Do try to UO what you l:illl 011 your OW II, UUI you sltould f~j free tO call On help. The BIBLIOGRAPHY file will lead you to some groups and other sources as well as books. Fed fmc ro wrilr. to this acfcfrr.~s if you hAvr (]uesrions:

I. Machine Language Programming On The l.nmmodore 64 2. Thl' Next StPp- Assembler Language ProRramming 3. A Close-Up Look At The Commodore U4 4. Mustc Synthesizer Programming 5. Uraphics Programmi11g 6. BASIC From A Different Viewpoint 7. Comparison Of The VIC- 20 And The- \.ommonnrP 64 ft lnptll Anrl Output Control 9 ROM Listings

Uyadic t<esources Corporation PO Bux 1524. Stu. 'A'. Dept 'TR' VanrouvC'r, B\ V6C 2P7

Those readers that need to delvt! d~vly into their computer. we've inclu<.le<.l a fu lly commented listing of the ROMS. Here's nn authmitative source for Commodore 64 informntlon.

Books Programming The PETI CBM

The Anatomy Of The Commodore G4 rn soltcover S19.!:15. Available from your local dealer or directly from Auacus Software.

The IlK rni tion of 'Programming the PF:T/CRM' is available in the US (after Compute! discontinued printinR) from this address:

The Anatomy Of The 1541 Disk Drive Holford Enterprises 6065 Ru:.wcll Ruad Suite 1398 Dept 'TR' Atlant<~ , GA 30328

The Anatomy OfThl" I 541 ()i~k nrive is aimed at the Commodore 64 owner who wants to better understand hts dtsk drive. It is a 300 + page detarled guide that explains the mysterie:. of using the floppy disk. Here's an ouUine of the w nh:11ts:

1. Getting Started

2. Storing Progmm~ On

The Machine Language Book For The Commodore 64

3 nisk Commands 4. Sequentral Data Storage 5. l~elative Uata ~torage 6. Disk Error Messages 7. Dir~t Access Commands 8. Overview Of DOS Opcmtion !l StmrturP Of A Diskette I 0 . Uttltty Programs II . I541 ROM Lrstings

The Machine I .nnguagr. Rook For ThP Com monore 64 is ai med at the Commodore 64 owner who wants to proRress beyond DASIC.If the reader wants to write programs that run faster, use less memory or perlorm functions that are not available in BASIC. then this book will help him under:.taml machine language. This Is a 200 1 page detailed guidP to thl' compiPtP instruction set of rhr 6510 prorP~$Or of the Commodore 64 The book is filled with examples of machine lanRua!{e routtnes so that the reader can learn from workmg programs. These examples are geared specifically to arch itecture of the CommodortJ 64.

If you've u~11 w nfused about using

Those readers that need to delve dt:eply into tlleir disk <.lrive, we've included a fully l:OIIIlllented listing of the 151 I ROMS. Here's the authoritative wurce for I 511 Disk Drive lnformntion.

'

The Trantoctor

Iiles on the 1541 then this

guide clearly explains their usc with mnny r.xn mrl P.~. Wr.'ve also lndtlcfecf li ~ring,-; of mflny useful utilities that you can use including a DISK MONITOR.

Included in these pages arc listings of three full lr.ngt h rrograms One Is n working il.'l$P.mhler so the reader can create his own m11rhine lAnguage programs. The second is a workmg disassembler so the reader can tnspect other machme language programs. The thrrd is a G:i 10 simulator so that the reader ca11 bt!Lter

I

Di~k

9

VolumeS, luuo 02


The Anatornv Of The 1S41 ])l!;k Drive scheduled for March 1984 In softcover $19 95 Available from your local de11ler or direr.rly from Abacus Software.

screen oriented nature of the language is that possible without special hardware.

-

JOSEF is a robor who usP.~ rhe screen of an ordinary terminal or microcomputer as a geographical map of his world and can be programmed to perform natural everyday tasks. He can move on the map, write on it, manipulate user-created objecls, communi· ca te. sense information at,out the map, and so on. The program con tains a map editor which allows rhe user to create his/her own maps.

MASTER-64 MASTER-64 rs simply the best. most comprehensive professional aVPiicatiun program development package. No other software package offers 11ear the features uf MASTER-64 . MASTER-64 has commands for programmer's aid. screen management, superior indexed file rnanagcmcn1, high multiprccision arithmetic, mnchine la.nguage monitor and murh more. Anrl softw11re thar you develop using MASTER-64 can be distributed without paying royalties.

JOSEF is intended for people who want to learn about program· ming in an interesting and natural way, children, but also lor mature programmers looking for something dlffert!ut. JOSEf' is ideetl for edu~.:atiun, particularly because of the increasing empha· sis on teaching Pascal i n high school programs.

MASTER -61 adds almost 100 new commands to BASIC H1al include:

The program nms on a number of computers with enou1o1h mem· ory and sufficient disk drive capacity. The cost is $45 for individual users and $65 lor schools (permission to make multiple copit:s).

SCREEN MANAGEMENT - define, input, edit and output dat<l in exacting format to/from screen. Save, load or swap predefined screen. ISAM FILE SYSTEM - complete suwort of UJ.J to 10 indext:d sequential files. Data packing gives up to '10% more data storage. Fr~~t indexed or sequential retrieval. PR INTF.R GENERATION- <iefine anct format printer pagP.s similar to screen management. BASIC EXTI::NSIONS - multi-prec1sion (22 digits) arithmetic, di· reel disk access. date control. more. PROGRAMMER'S AID - auto, renumber, th~lete. IJ-f int uliing, fim.l, if then else, trace. dump. error. etc. BASIC 4.0 COMMANDS - for compatibility with other Commodore micros. Includes relative record access MAC! liNE LANGUAGE MONITOR - built into MASTER- 64 for added usefulness.

A textbook for the language called The rirst Book of JOSEF' (list price $13.95) by Ivan Tomek and publi~hcd hy Prcntirc-Hnll is fwailahiP in hookstores and from Kobetek Systems.

~ouular

Kobetek Systems 1113 Commercial Str., NP.w M ina~ Dept 'TR' Nova Scotia, U4N 3Eo ~02 678-7771

Application Software From Fabtronlcs Utiltiy File - VIC 20 ( + 3K)/C64 - Tape/Disk $27.95 (formerly "Energy Master"). Extensive ener8Y consumption data processing prograrn tu \:alculate. display, stvre, print out data indutli ng d<1ily averages/totals and cost projections lor any number of days. F.IP,C'Irir.: K.W.H. Water: Gals/cu- ft (automatic conversion) Cas: cu- fll meters Oil: Ual:>/litres Propane: Pounds

JOSEF - A New Programming Language

JOSEF is a new powerful edut:atioJJill prograll uuing language for microcomputers which combines the spirit of the Logo Tunic with rhe st m r tlJTP. of Pasr.nl. With rhc Tunic it sha rP-~ P.XtP.nrlahilitY • (programs become new language words), the challenging yet toy-like and natural programmin~ environment with visual orien· tation, and the possibility to execute commands directly wi thout lh~:: n~::cd tu write JJW!::rarns.

S[lP.c.ial Fcaturc>.s- prior meter readi ngs are retrieved within automatically, also any utility not applicable is bypassed. Utility r'ile ll - Cu4 lJisk S/:!7.9!>. A commercial version of above with i!~;\:uuuts JJayable induding :;tateJnents cmd billing on sclet:ted commercial forms.

.IOSF.F ha~ srandard programming fcmurcs sur.h .1s variable. assignment and i/o statements, control structures, procedures and functions with parameters and recursion, as well as un usual constructs such as programmable interru pts allowing the writing of games controlled fr om the keyboard. A consequence of the

~

))istributed by:

BOP IXO

MASTER- 6-1 Software& Manual on diskette $84.95. Available now from your local dealer or directly from Abacus Software

·- .

Designed by; Systems 82 POB 1456, Wolfville, Nova &otia, Canada

For serious programming development. nothing comes close to the power of MASTER-64. MASTER- 64 comes complete wi th a comprehensive 160 page user·.~ manual in th reP-ring bincler, the l\•I ASTER-64 development system and the MASTER-64 runtime package.

The Transactor

is

The latest Version 1.1 contains a built-in interactive tutorial that allows the user to Jearn the language directly from aud iu interaction witl 1tl1e t:ompulcr.

Software News

!

p~e11rlo-graphics

Fill-A-Form- VIC 20/C64- Tape Sl 7.95 Disk $19.95. A numer· ous selection of in house plain paper business/commercial forms to help the private enterpreneur. Printer require<!.

10

--·--· ........


T~mmt

of Tnll.~ical progmmming for the Commodore 64, up 10 and including complete interactive soundtracks for software. I have written for bill bands, rock bands, school bands, dub bands, brass quintets, woodwind ensembles, soloists. and now computers. I have playt:d pri ut:i!Ja.ltruu i!J~I with tit~ St. Pul ( hij!IJber Orchestra. the San·Jose Symphony. and the Marin Symphony, played on records with Davr. Brubeck and r h~ Sr. P«ul Chamhf'r Orche.•Hrll , and pl11yed on many TV and r&dio shows and commercials, I have lauflht for the University of Minnesota and Macalester College, given clinics and master classes, and taught hundreds of private students.

File- Vlt 20/C64 - Tape/Disk $19.95. Maintain a record on each tenant with 22 fields of information including: active or dosed, name, re ntal rate, rent due day, unit 111 tenant in, sotial st:.>Curity ff , residence phone", business phone "· auto yr/ make, plat~!"'· th ivt!r lit.: 11 , :;~. UI:!IJ ;unl paill :;~ . dt!J date pai<.l. s~.llt!V amt returned. retention reason. date moved in, date moved out. * of bad checks, condition of unit on move In, condition of unit on move out, comrnen ts/in formarion pertinent to tenant or file

!\ental Manager- C64- Disk $47.95. Spreadsheet & data records for rtmtal awlicatiuns utc o1il:lnted tracking/ biJiing and recording of payments. Alw prints statements will support the following emries: accounr *, rate. unit or item "· payment schedule. due dat(>, d~posit~. pnymr.nts (10 per mo), utility charges, misr.. rhrg.s. dates in. dates out, name of occupant or user

If you would like an audio tape demonstrating a wtrlcty nf different kinds of mw;k that r11n he prot11tced on the Commodore 64 . send S4.00 to Tom Jeffries, 2915 Harrison, Oakla nd, CA 946 1l . 17urther intormalion:

Fab Mail- VIC 20/ C64- Tape $1G.\J5 Disk $19.95. A super user friendly mailing list with features others wisl l they had thought cz select/ edit, user selection of gemini l Ox and similar printer nhilities, also grcnr for cmalogi ng/fil ing/ sorting.

or.

Tom Jeffries

2915 Harrison fkpt 'TR' Oakland, CA 946 1I 415 451 -3314

Fab Business- C64 - Disk $47.95. A mail order or small business must. Easy invoice/ packi ng list/label all in one, supports charge t:ard data and allows quick sell:letion of items when used with " inventory d base"program. "fab··Mail" data also quickly retrieved. Plain rnpr.r or selected comm. forms.

Flexldraw•s New 3.0 Version Opens Channel Of Communir.ation

Inventory D-Base - C64 - Disk $27.95. A stand atone proR"ram that is also compatible with tab-business. Allows quick selection ol items during invoit:ing.

San Diego, CA - Inkwell Systems increased the versatility of Flexidraw; graphics software and liglll ven, to includl:l a t:Oiliu iulli· caliott progrnJII wliid 1 enables two C- M owners to send and receive graphics and text created b}' Flexidraw vin modem.

Printing on all progrnms whNc npplic.ablc nrc c.omp,11ihle \vith commodore 1525. MPS801 , Epson, Gemini. Prowriter. C-ltoh, Epson .MX/ RX/ FX 80-1 00, Okidata 82/ 83/ 84/ 92/ 94, Axiom GP/ 1OU, Gorilla Banana and similar printers when properly interlaced.

This program, titled TranSRraph, is ea.'!ily accessed from a light pen driven menu and implemented by a series ol on-screen user-friendly prompts. Any Flexidraw file can b~:: Sl:!u! or received using the VIC ur HES lllotlem, :;aved to disk and printed at botb locations.

welcome uo tiurdl<~rge - all pric~ U.S. funds - (cash)o.d. to U.S. only add 52.00. NY ndd sales tax

S&H S3.00 -

Vis<~ I MC

Sherry Kuzara, President of Inkwell Systems said "Transgraph represents a major step in the evolution of affordable business and personal communication ." According to Kuzara, the net'lvork cavabililies of Trausgravh coupled will! tile "print out" feature can fill 111a11y business and personal needs. previously only available in systems costing thousands of dollar!>.

Mu•k ProducUon Service

l am iutrudm:iug

pruft:ssioual lltuoil: !JfUllut:Liun stJrvk:e lor educational and game programmers at all levels who are interP.sred in putting togNher th~ mo.s1 anmrtive possihle software for the Commodore 64 in order to stand out in todays's competitive market. <1

Flexidraw will still retail for $149.95. Re~istered owners wtll be ' notified by mail and can update their Flexidraw 2.1 version for a nominal ree. Disttibutor and d~::aler illtjUirit:!S CiJ.JI Ut! c.lirt:cl~ !Q Inkwell Sy~tl!n ls:

Mul;ic i:s apuwerfultovl lor comwuni~o;<1tlvn. ThiJtk of llt~ nmjtlstk main theme from the "Star Wars" epics. or of Woody Woodpeck · cr's laugh at thr. beginni ng of a cartoon. Ohviously mu~ic cnn provide an emotional response as immediate and as strong as a visual display alone, and when the two are combined, the effect which resulls can be potent.

Mr. Ryrnr. F.llinn/M~ . Sherry Ku1.11ra

Inkwell Svstems • P.O. Box 85 I 52 Yll:l29U 7770 Vickers St.. *202 Dept 'TR'

The sound capability of the Commodore M is extensive. However,

San Diego, CA 92138

without expertise in digital sound synthesis, three- voice harmony and coun terpoint, specialized systems of intonation, musical copyright law, composition, and arran[.linq, it can be difficu It to produce high quality music.

0 19 268- 8792

Fle.xidraw 3.0 Offers A Rainbow Of Colours San Diegu. CA - !\·larch 20. 1984. lr tkwell System!; lias expanded the capabilities of f'lexidraw: graphics software and light pen combination. to include an interactive high resolution colom

With 20 years of ex!Jt)rieru::e a:; a cumj.lu~>er/arranger. perrorming musician. and music ed ucator. I can help with virtually any aspect

I

.The Tran~~actor

11

Volume 5, lssu~ ~~


_________

..,...

-------------------·-~------------------,

vr ogr<~.m.

Graphics previously created WJih f-'lex1draw can now be painted in a l.laaling array ol 16 high-resolution colours.

by mid-June, 1984. The suggestPd RPtail Price for cii~k ve-rsions of c1ther program 1s S29.95. Dealer and distributor enquires are welcome. Write to:

C.ompkrrly light ~n and menu driven. the new addition to

Flexidraw version 3 0 cnti tlr~rl P~n Pillrltc. fr.arurcs a similar scret:n/menu format as Flt'-x.idraw With the Pase of an artist using a paint brush and palette, the user chooses colour combinations frolll a ~et itJ~o Ol~.>aint pots located on the menu and applys these colours to art!as 011 the wurk scret-n using the light ,>en. Special fPilturcs found on Pcm Pah:rte Include: two demonstration J)tograms illustrating colour animt'llion rapahilirir_q, and the abilily to save colour hies to d1sk or re-load using ttw light pt'O dtivPn

International Publishing &Software luc. 394& ChC'.sswood Drive Or.pt 'TR' Downsview. Ontario \'13J 2W6 41GG3ti-9409

!

Turtle Toyland Jr. Teaclw-..tt Raak Cnmputer ConceptA

IIICIIII Sel~t~Jr.

f'or cluldren aRe<~ SIX and up, the challenAe of learnin~ about

f'lcxidraw will still retail lor $149.95. R~ogistered owners will tit! norifirrl by mnll ilnd can update their Flexidraw 2.1 version for a nommal rec. Distributor and dP.lllN inquiri~~ (',1n ~ olrccrcd 10 Inkwell Systems.

New Dlakovery Early Math Prugr.,••• lnternCtliMl Publishing & S<lftw.1rc. Inc.., announces the releas-e of TAKE-AWAY ZOO and The ADDING MAC'HINF.; two early math learning programs lor 4 lo 8 year olds. Take-Away Zoo and Adding Machiuc arc the l<ttt::>t additions to I.P.~.'s successful lJISKOVERY LearninR Works liue. Bolls use humorou~o graphics. sound and colour to create the run and excitement Hee<.icl.l tu insUJe high srucllmt intrrc~<;t nnd long lasting learning.

I

These two new p rogram:; each consist ()fa sctrlf three different but r dated adivit i~:~> designed to help the child become more successful ill aritl uu~tic al S\:hm)l. As the child IHdps tht! "animal-master'' move animals in and oul of their <.:C:t!Jc~;, lte/shtJ learns and prM'ticr.s addiiiM and subtraction.

has been made easier, and a lot more fun. with the inlrol.luctiou of Turtle Toylam.l Jr. l>y Hu1r1<111 Enginc<!rcd Software of Brisbane California, am.! distributed by .'vlinon Dl!>trlhuting. comvuter~ ond computer concepts

Ava1lable for the Commodore 64, 113M l'l!rsonal C't.1mputer and Coleco sy~tems, Turtle Toy~and Jr'. operates with just a jQysllck, teachiug dtill.lrcucomvuter wnrtlvts by moving a l\Hllt> ae ro:>~ the computer screen to build film strips.

TuriiP Toylnnc11r is an idP.al immrlucrton to rr~mlvP. progmmming for young ch1ldren. Because the proRrarn translates a child's jo}•stick movements into reproducible turtle graphtCS, chtldren learn pwgrauuniug concepts and techniques. To nchicvc the bc.c;t rcsuiL'i rrom the game it is recommended that a carE'fully rlesigned Sf'f:Jllf'-Of'e of arriviti<~s is followed. hnginning w1th a playground to discover how ltJ move th~ turtle and draw images. From this introduct!Jry phase, chsldr~m mow~ on to turtle tt·aiJdJ 1g and then on to the Crossroads to decide where to !W next.

Alter a stop in Training Land. children tan try fou r tllher

I l

j

Each a~pect of each activity is user cMtrollt'd ro 111low the child to l>l!l the pace of the learning. These math activ1t1cs are designed to give every ~:hild a succe.ssful addition or subtraction leammg experience. While the a<.:tivilil$ are luu dlld exciting to play. they

st~

I'}Hrnrr_<;: Music- L<ln<i , Sprilf! Land, the Roybox and Input/Output Land. In ~iusic Lant1, childrPn cnn I("Arn ro wriiP. rh~ir own musir USIO!{ the IOVSIICk to control notes from a piano. horn. guitar and rlute. The music c.reatc<l can be stored in the Tovbox.

provide a con~;tant challenge for the children. ADDING MACHINE and TAKE>AWAY 7.00 ff!i'llllrf' !hr. DfSKOVERV ELECTRIC f~EPOf<T CAHO. This ltSer- transpMent spt.. cial ft:ature 1tllls the teacher or parent tor child) the acth:1hes the

Children in Sprite Land fill in squares with the turtle lo draw srrirrs, which nrc tlflimilted drawings. Sprites can also be stored in th(: Toyhox In Input/Output l .nnr!, s<wccl files In the Tclyhox can bt'! called up and played again.

lht: )JJUblem:S 3fl&Wert>d incorrectly), llnal score and percentage ri~ht. Th~:: ELECTRONIC REPORT CARD is on. constantly providing complete up-to- date

Tu1tltl Tllylttud Jr. Wd~ d~veloped jvintly by t-1uman Engineered Software and Childware Cof}XJratiu. au innovative ~;oft ware devel-

information on the c:-h ilcfs progre>ss 111 11ny rim<': r.vcn in the m iddlc

opmcm group.

dtild USeU. l!JfOtS

II

llliltlC (a\.'lually :.!towing

of an act1v1ty.

Ea<.:h program teaches. tt:l;ll;, r~vicws ami :.cu1es in an €!:<citing game format which helps and em:ouragt:s children to J.JI aclice school subjt'c·ts at horne.

DISKOVEHY l....<!arni n~ Materials /Ire writtPrl and dcsign<'d hy leadi11g elfl•<:ators ensurinB thttt each ~ k i ll t au~h t matches the sdwul cur·riculwn.

These and other innovative educational programs are dislributed through Micron U1strrbuhng or can be round at your local com-

puler ~tore. Micron Distributing 40!) Qu<:cn St. West.

Dl'pt 'TR' Toronto, Ontano, \ ISV 2A5

41 G!i9:J-9aG2 TAKE-AWAY ZOO ;md THE ADDING ~1/\C H INE a1e nureu tly avnilahlE' for thP Commorlorc 114 nnd the Timex Sinclair 2068 computers. Apple II and liE and TRSBO vNsions will IX' avililahlc

TheT~!_~J~.__:_::______________________________~12~--------------------·--------~YV~I~~-~·~S,~I~u~u~•~0~2~J


'Horses OTB': Horse Race Handicapping Software Hrm>P-" OTR fs a thornughbrr.<l hM!ir: r<~tc hllnilir.applng pmgrllm. Thls proflram can be used for off track betting (OTB).

StatisUcs from a large number of races are combined with com· puler siruulatiuo 111ethods to calculate opti111u m !Jeuiug s lralegie.o>. Data complied from over I 000 races shows superior performance fro m this sys1crn.

The program is easy to use. The computer asks questions about each horse in each race. The user needs lo obtain the "L>aily Radng Fvrm" aud au:.w~r lilt:! \{ue:.tiu iiS u:.ing lilt:: data hun1 the form. The computer ,.,.ill tell the user which horse~ to bet on. No judgcmenr or comr>arison of odds is neccss;:Jry and the user does nor nP.ed ro knl\'•" thP.trnrk orlrl.~ .

$139.95. Complete instructions are included with each producr. AH products are covered by a 90 day w<m nmy on part<; and lnhor ::m<i or rours0. satisfActio n is gunrante«i wi thin a 15 day return period. LETCO wilt soon announce the ultimate expander lor lhe 64, Lhal w.ill allow LII> tu 256K bytes of expansion. Of course, current products will be compatible and pricing is cxpcclcd ro bl~ obolll $1 40 pr.r fi4 K h)'l<' moc1uiP-.

tETCO is currently working with many popular software S~lppliers to incorporate these added capabilities to their current and fulure wl~ast:s. J usl thiuk uf the vower til at ca11 be aJ ul'<.l to your word processer or spreadsheet programs. All products arc available directly from: LETCO

The complete instruction manual includes an explanation on how to us~'! Hurs~s OTB. Jacls on all input dala needed and how to correct any mistakes on the <.lata enlere<.l. The rnanu;d <tlso contains 1ips on money managemem and presents si mulated results of th~ mon~y m:m~gcmcru trrhn i<p1r.<>.

Leader Electronic Technology Company

7310 W~lls Rolld Dept 'TR' Plain City, OH fi\4 $173-44 10

43064

llorses OTD sells for $34.95 and is available on disk lor the

Commodore 64. ll can be ordered by mail or th10ugh local dealer&.

'BU Scrubber': Disk Re~~iuual Noise EraHer

Or coutac.:l:

Jim C.olt~ 3G Company, Incorporated RT3. Box28A Dept TR'

Gastou, Oregou 97119 503 662 ··1192

Commodore 64 Memory Expander The uuexvandable mernory wnfigura tivn of the Commudore 64 is no longer unexpandable! LETCO, the pioneer of the popular 64K memory expander for I he VIC 20, announces rhe adapwr {Model n4KVA) to IISC with thr>ir 64KV ml'mory r.xpiln<kr on rhP C':om modore 64. When used on the C-64, the addresses from $8000 to $9fFF w ill have 8 separate blocks of 8K !t:~cations, each block selected by a single poke instruction. Current owners of the G4KV Oitly neeu the auaJ)ter to use their Ulelllory 011 the C-61.

Now ·- Wake up that old pile of diskettes you don'1 want to til row ~way ' F:vr.ry r.omplltr.r hns a rorn mon purpose-kn owledge stored in program format. But when dealinf.! with Jlip,a and mefia kilobytes of data, one single bit erroneously entered can render a program useless, create frustration. time delay and profit loss. Editing a pru!Jrcuu clso ~f:!! 1~nate~ 011-di:;k ruagneli(; duller causing a di ~play of "error messages". "disk overload", etc. In addition, power supply fluctuations and disks remaininp, in the computer during system power down. produce a magnetic field around the drive head corresponden t to these currents, Bene1ating evtm 1110re nojl;tl. When tin~ htMd ;jllt.mtpl:; lo re(:!d/ write <.la~ a from this portion of the disk, it cannot. and eventually this aifects the

entire iii~. normal use, as a data file is revised, the head erases previously stored data and replaces it with new data. This erasing Durin~

process is not perfect, always leav illg a trace uf magnel it.: noi~;e. Afl er i nany write/erase operations, this noise level justifies thor·· ough disk erasure. Disk storage medi.a replacement is expensive and time consum· inR. for these reasons, Techstar, Inc. has developed the "Bit

Scrubber". The fastes t and most positive method to magnetically '\ :le<m'' and sl<l! Ju<mlize built new ctnu u~d diskelles. The "Rit Srruhhr.r" rnn rPstme use<i and noisy disks to their original magnetic quality, providing a cost efficient method of "error- free" stora~e eliminatmg lhe expense of purchasing new lloppy disks.

The ''Bit Scmbber" can reclaim and maintain "SSSD" (single· -~idcd,

The adapter (Model 64KVA) is priced at ~.29.95. The memory (Model 64KV) for use on lhe VIC 20, is priced at SI09.95. The combi nation (Model u4KVA) for use on the C-G4 , is priced at

"

I

'

. .

The Tr o n $0

single d(~nr.ity}, "SSDIY (si nglc.-sirlr.rl, dot1hk dr.nsi ty), 'TJSf)O" (double-sided, double density), "SSQD", "OSQD'', etc:. and any other Lype of commercially available 1lOPP}' dJsk. When used periodically, the " Bit Scrubber''

~-to_ r__ -·-·-·-·········--·-·-·······--·······--------···_.....-· -·.......·····--·-·-·--· .. _~· ._......•!.~·-·-- ....... .

vreve11L~ 1 10i~e an:u-

·-·-····-·-· ..•.• ·-·. . • • •. . .

. . ··-···---···----···-~~lu'!!• 5, lnue 02

I

I


ldentix makes a compu ter terminal that verifies a person's identity by means of encoding a fingerprint. The terminals will be used to protect buildings and computers from unauthorized entry.

mutation on the disk, assuring reliable data storage and extending the life of this costly recording medium. • "Bit Scrubber" will clean 8", 5 I I 4" and the new mini diskettes. • Patented high energy magnetic "gap" insures uniform particle orientation. • Shielded magnetic circuit protects programmed disks. • Dimensions: 9" x 4" x 1-3/4", Weight: Sibs.

The Identix terminals are based on a patented design by the company's founder, Randall C. Fowler. Although ldentix is 19 month~ old, the technology goes back about 12 years, when Fowler developed a device to record fingerprints on F.B.I. cards. Within the last several years, the costs of computer chips have decreased sufficiently to allow microprocessors to perform fingerprint analyses. Identix is using the Motorola 68000 chip - widely used in personal computers- in its fingerprint terminals. Production models of the terminals are being manufactured now.

$49.95- plus $4.00 shipping and handling charges (Fla. residents add 5% sales tax) Techstar Inc. 865 1 N.W. 56th Street Miami, FL 33166 Dept 'TR' 305 592-020 I

Identix forsees that its termin als will be used in a number of applications: (I ) to con trol access to buildings and laboratories and (2) for verification of persons involved in financial transactions such as automatic teller machines (.A:fMs). The banking and financial industries will be a major target of ldentix's marketing effort.

SADI Communications Interface and Printe r Adapter

Another large market that ldentix foresees is in computer access control. An ldentix terminal can positively identify a person who wishes to gain access to a compu ter. With the secu rity of corporate computers being a major issue, the ldentix terminals provide much greater assurance than passwords - which are the primary safeguards at this lime.

The cMc SADI is a microprocessor based interface designed to allow communication between Commodore PET and CBM computers and a wide range of devices including serial and parallel printers, CRTs, modems, acoustic couplers, hardcopy terminals nd other computers. SADI's two independent ports (one serial in/ out and one parallel out) give the Commodore computers tremendous flexibility as controllers and as dumb or smart terminals. Data can travel between the computer and one or both ports or between ports.

In addition to company president, Randy Fowler, the management team includes: Ken Ruby, vice president of engineerin g; Dave Larin, vice president of marketing; and Frank Fowler, vice president of sales. Randy Fowler was formerly vice president and general manager of Flow Industries, Energy Division. Ruby was chief engineer at Motorola's Mechanical Laboratories in Phoenix, Arizona. Larin was formerly vice president of marketing at Reticon Corporation in Sunnyvale. Frank Fowler (not related to the company president) was formerly vice president of marketing at Redwood Software, San Jose.

General features include true ASCII conversion, cursor move conversions for program listings, and automatic insertion or deletion of linefeeds. The SADI can also issue a form feed or any number of blank lines. The device address is switch selectible (0-1 5). Serial features include II baud rates (75 to 9600), selectible parity and a 32 character input buffer with x- on I x- off feature. For the parallel device the 'busy', 'ready' and 'data' polarities are selectible.

Randy Fowler ldentix Incorporated 2452 Watson Cou rt Dept 'TR' Palo Alto, CA 94303 4 15 858-1 00 I

The SADI is easily programmed using BASIC commands, and is compatible with Wordpro, VISICALC and other software. It comes assembled and tested with case, PET IEEE cable and power supply. Thirty day money back trial period. Retail price in USA $295.00, optional 230 V power supply $30.00. Shirley Fletcher Connecticut microComputer Inc. 36 Del Mar Drive Brookfield, CT 06804 Dept 'TR' 203 775- 4595 Twx: 710-456-0052

Electronic Fingerprint Analysis Security System ldentix Incorporated has recently completed two rounds of venture capital funding totaling $2.25 million. The lead investors are Citicorp Venture Capital of New York and Genesis Capital Ltd. of Bellevue, Washington.

The Transactor

14

Volume 5, Issue 02


Letters

Un-products?: I am writing this letter in reference to The Transactor issues for January and July 1983. In these two issues, two products - a synthesizer keyboard and a drum synthesizer for the Commodore 64 were described. I've heard nothing of these products since. I was wondering if you had any more information as to the release of these products or even if they have been cancelled. As \veil, is there any other information that you might be able to send on computer music and interfacing instruments to the C64?. R. C.ooper, Thornhill, Ontario J'm afraid both the synthesizer keyboard and the drum synthesizer haoe been shoved to Commodores back bumer as it were. Too bad coo. Designer Paul Higginbottom, as I recall, spent many long nights working on that project and the l.!ersion I saw last was fiteral~y swnning. I think Commo路 dore's "reasoning " is that it takes 3 SID chips to make one keyboard, so for every keyboard they make, they could have made 3 C64s. Cet rhe picture? There are seoeraf Music packages out now for the 64 which one is best is hard 10 say unless you're a musician AND a hacker. See News BRK for more info on this. Perhaps Ron Jeffries would have some aduise for you. Instrument inrerfacin.f!. is another swry. 1 know Chris Zamara was workinp, on an idea, but said that problems with rhe SID chip (nasty clicks) hod his ambition somewhat cooled. Anyone out there with further Sllf{!{estions are inviled 10 write in. ~

ing efforts. I have been unsuccessful in getting it to run in practise. This letter incidentally, is by a golden ager (myself) with a "B.S.W'' on a C64+ 1541 + 1525 chain. Your very excellent journal lends itself admirably to the untutored neophyte in the occult art of plu nking. Please be kind! I am as a village "G.P." reading about the fine points of open-heart surgery in a medical treatise. I know naught, but it is fun trying to figure it all out. Your magazine format is just great for my 3-ring binder. I could almost pun on the use of that word in this context. So, to the point; not being Jim B., I gotta ask, 'What is the correct reply to the prompt: "auto: start, increment"?'

It is probably a blunder on my part. I have been condltioned to wait a couple of months before attempting programs appearing in the media . It keeps the blood pressure down to have the expected errata in hand before transcribing a long program It must be a gimmick to sell magazinesl After the botch-up that Commodore have made of their user manuals - even I could see the goofs after a weeks trial. Closer to home, I would love to know how to put the " Function Key" thing to workt Pardon! I am ~etting carried away. See you in your next edition. Keep the Ads out of the way. The "Star" would never dream of puttln~ 1\路fom's cross-word on Dad路s sports page s.o you are thinking right. Sincerely, Ralph McKnight, Hudson, Quebec

M.Ed.

Response? Response: The program listed above has become very familiar torn<>, chiefl y th rough my proof-rc.1d-

[

The Transactor

The prowam "above" is referrin.r? ro the profvam "Auto Liner" lhOI appeared in The T Volume 4, Issue 06. However, !he bltJnder rons on Otir parr, S[>ecificn/ly my pnrr. YlJII.<;f'e, in my ntrP.mprs In puf>lish versions of programs fnr euPYy

Volume

s, Issue 02

]


·~-·--

Commodore model, I go1somewhat hasty with Auto-Liner. The f'EEK address in line 60040 of the 80 rol11mn neroon starts with the second space of the third line domn ie. the screen start address. plus 3 times 80, plus 1, equals 33009 For the C64 version I rook the screen start address (/ 024) and added 3 lines plus 1. But I IOfROt the finPs are only 40 characters long. So ,rhe result was acltrnlly 6 fines, nnt .1. Oops. Some orher errors also s/fpped by. Since then, a mister Keith Preston has sent us a new and impmoed urm;ion that we 'ue reprinted in this issues' Bits and PiPces SP.rJion.

kry, and depending how many dis!< erron; you gel. you 'II smJC yourself a lot of Lime. As for magazine selliflg gimmicl<:.. I'd lil<e to third~ tltat ea ors in listings reduce repeal sales uf u mugcu.ine. I suppose c!rrors are u fact uf life, but we do try to be <.weful. Lastly. I agree. .. Cornrrwdure's User Manuals du leave somet11ing to be desired, IJutspulliflg "botch- ups" is w1 elfective learning process. Tlu:ir Prugrummers Reference Uuides, thot1gh. are uctua!ly quite guotl. 77wnlls for writing and /hanks for the cumplimefiiS. - M.Ed.

Auto Liner's purpose in life was to rPdiJrPn little of the work involved in transcn'bing programs (although I admit. the first 64 uersion doesn rdo that very well-tongue in r:hPek- by the way, for those reading, the 80 column 11e~ion wnrk.<> as shown in Issue 06). It pn·ms a linP numhrr, tum.c; on the cursor, and enters that fine for you mhPn you hit Retum. After that, the next line number is printed for ynu to continue. So to answer your first question, thP response to ·~<start, increment" is your choice for the firstlinP. numht!r yrw Wl~'>h to start you program with, followed hy thPamount tn arid to each previous line number to !{lve you the np.xt. For e.xnmpiP., if you 're entering a pro_qrom thor shows lines nsr:ending by 10, your increment is therefore ! 0. "Srnrr" ic; simply the fi~t line of the program. You probohly would hmK! figured this out had the program worked - os i was, no r.ombination of "start,incremenr" would have .'fOI you .o,ning.

Existing Lost Copy: I am a relatively new subscribe! to your magazine. I recently received111y first issue and copied several of the programs, the must rt:(;t:llt of which was "A Simple Disk Copier For The Conuuut.IUit: (:W' by Jim l:iulterfield.

In the text, Mr. Butterfield states, lhat when the program is run, "You'll be asket.l for the file ty!Je. . . Next, you'll be ao;ked for the name of lhe vrograru or file yuu wish to copy.. . If it can't find the file it will revly 'NO UO', otherwise it will ao;k OTHER DISK READY? ... ek". All the program due:; for fire b copy itself on the disk, and when run agin it displays a disk error 'FILE EXISTS' and I have another useless program. Perl taJJs I have done something im:orredly. I admit to ueing a uovice at this, but I am trying to learn and I find this vt:Jry frustrating. Millu11 Reidt, Brooklyu, New York

I've used Aulo Liner myself, exrPpt wifh onr1 minor modifica· tion. fn between the variable S and the semi-colon on line 60010, I inserted the word DATA within quotes. Now Auto Liner prints the line number, fol/ou~ed by "DATA "so chat alii need do is enrer the n11mbers nnrl mmmns contained on each data line. Convenient. .. , when it works.

The prugram you ellfered was actually a program generator for COPY FILE 61. (By now you l1ave p1obably seen the directory tflut sflaws this prugrum flame) Once tl1e generator program is RUN. lite generalur itself becomes virtually use· less. .. yuu need 110/ even ~~ VE it. A LOAD of the directory will show u new file tlwt you yuurself never put there with a SAVE commu11cl - tfte generator clicl it! '11te next step is:

The Function Key program (I assume the one by Darren Spruyt) is a pro_qram thor nflnw.c; ynu to define what will appear when you hit o funrtion kPy. 7'hi.c; you pmbaiJ!y know, bur usinP. it is a molter of nr.crssity. For example, if you find yourself repeatedly PEEKing at some memory locations, you need not type PRINT PEEK( etc. every time. Just define a fnnclinn key appmpn'ately, and when yuu need this informalion, press only onr kPy instrad of retyping the whole shot Of course you nP.Prl Darrrn :., program in order to define !he function keys initially. It also wurks guud fur reading thP. error r:hnnn e! with:

LOAD "COPY FILE 64" .8 Wlten tltat finislles, you am L/~T COPY f1U:.' 64 and see the prugrum llwt wus "generated': RUN this program and follow lite on'giaa/ instructions. Perhaps this was a btlle unclear in the article. Just remember that a program "generator" is a program that writes another program which must be subsequently L.UAVed to be used. After this is done once. tile generator is ofoo fuTther use, but the program you have now, "COPY FILl:: 64 ': will be ol much furth er use I'm sureM.t:cl.

opon 1,8.15 : for j = 1 to40: sys43906 #1 ,e$

: printe$;: if sl -0 then nexlj (Rosie 2 0 " ·" " sys.S /844, VIC20 use sys52098) Imagine typing thl~'> PVP.f)l time you uxmf to reud u dis!< <!rru1. Will? DnrrP.n :c; wility (for the Commodore 61 u!tly), defiue an F

Ttl. Trantoctor

16

Volulfte S, luue 02


Bits and Pieces

Kernal3 For The Commodore 64

Cylinder Screen Commodore has relea ed Kernal 3 - a new retro fit ROM for the C64 . ih~ " Kernal" is one of 4 ROMs found inside the 64 . lr's mllcrl thl' Kernnl hccnusl.' it handles the fundamental or "innrr most" op<'Yt~tions of the mnchinc Reportedly, fixes over Kcrnal 2 arc:

For an interesting but useless screen effect on your 8000/ 9000 路eries machine, try this POKE from Dave Gzik of Burlington, Ontario: POKE 59521 40 I

1) The IN PIli rommand has been fixed o that the I 'PUT prompt is 路not Included with the response when the prompt is weater than 40 characters.

2) The prohlcm with m:r .ctinR the last chnracter of the last line on the scr('('n has bct'n corrected. Recall, if you start typi n~ on the last line of the screen for 80 characters such that the screen scrolls twice, and then use DEL to move back and delete the 80tb character, the CIA that lies above the colour table is disturbed and becomes very unfriendly. Now eliminated. 3) A problem was found in the RS-232 routines that occurred with either even or odd parity enabled that could result in inaccurate status reads 4) Serial Bus Timin~ has been sliRhtly modified to allow for several chained peripherals. When too many peripherals were connected on the serial bus the system would occasionally misbehave To test for Kernal 3, PRINT PEEK(65408). Details of price and availability are not yet available -call your local dealer or Commodore Service.

When the video chip recovers from this punch you'll notice that your screen has bee twisted into a cylinder. Reset or PRINT CHR$(14) will restore order.

Down Scroll 64 Another of Murphy's unwritten laws states that "while trying to accomplish a specific task you will always accomplish some other task that brings you no closer to your original goal". Paul Blair of l lolder, Australia has reconfirmed this law with the following submission. ..... came across this while doing something else - all the best discoveries happen that way. The routine will scroll the Commodore 64 screen down starting from line D ie. from the top line with D- 0, second line with D = l , etc. Colour changes from line to line are also allowed. At the end of the routine, some pointers are left a bit untidy, so use with caution. A PRINT or two on the end seems to restore order ... thought you might like it- regards. Paul Olair".


~-·-··----------------------· ..

oo

- ····- -------------------~

o:

1 d= x = 2 11 : v = 15 : a"" 53280 110 poke a 1 : poke a + 1, 3 120 print " '' 130 read : v = v- 1 : poke a, v : if a$ "" "end " then end 140 p rint" • 150 for t = 1 to 10 : p rint a$;d : next 160 for t = 0 to 14 : poke x + 3 , d : sys 597 49 ; next 170 print ; for dl = 1 to 2000 : next : d "" d + 1 : goto 130 180 data ··sc roll down w ith this pg m '' 190 data · it's really v ery -easy to use · 200 data · in crude it in gam es and so on " 2 10 data · list the pgrn .to see the set up· 220 data ·see how you can select scroll start? • 230 data ·have fun . . ... . paul b lair ·

240 data "end " Equ ivalent VIC 20 and BASIC 2.0 routines have not heen investigated but presumably would work depending on their ROMs. Fat 40 and 8000/ 9000 series m achines don't n~ed

a routine like this- use PI~! NT CHR$(153) instead.

FTOUTSM With Colour Mods

Remember FTOUTSM? ~For Those Of Us That Smoke M- -? Originally written by Benny Pruden of Norristown, PA, it has since been updated by Louis Black of Oshawa, Ontario to include colour on the C64. A VIC 20 version would not pose too big a problem . , . just swap out the number s that reflect the screen w idth and address locations, as well as the

l

POKEs in line 4 for border and background colours, and swap in the appropriate VIC 20 equivalents, Line 1 and 3 must be entered using abbreviated keywords on at least some of the commands to make them fir on one line. If abbreviations are new to yoli, see l-ouis Sanders' article this issue on Commodore BASIC Abbreviations.

advises that danger to mental health increases geometrical!}' with the number of FTOUTSM iterations. And as they say on the 20-Minute Workout, "do not over FTOUTSM yourself". And Murphys' first raw says, "if something can go FTOUTSM, it w ill". A nd Mr T. says "jus try it, fool" 1000 rem machine code ftoutsm 1o·1o for i =49152 to 49330 : read x ·1020 po ke j , x : ch "" ch + x : next 1030 if ch <> 2467 1 then print " checksum error " : end 1040 sys 49152 : goto '1040 1050 data 76, 9; 192, o, o. 32, o, 9 1060 data SO, 160, o, 32, 129, 192, 169, 32 1070 data 141, 5 , 192, 169, 1, 141 , 6 , 192 1080 data 32. 52, 192, 32. '129, 192, 165, ·197 1090 data 201 , 63, 240, 10, 238, 6, 192, 173 H OO data 6, ·192, 20·1, 42, 144,234. 169, 0 5, 192, 73 1 110 data 141 , 33, 208, 96. 173, 1120 data 128, 141 , 5, 192,169, 0, '141 , 3 1 130 data 192, 32, 82, 192, 238 , 3 , 192, 173 ·t t 40 data 3 , 192, 205, 6, '192 , 240, 242, 144 1150data240, 96, 24, 173, 3, 192, 105, 0 4 , 133, 254 1160 data 133, 253, 169, 0 , ·lOS, 1170 data 173, 5. 192. t 45, 253, 32 , 169, 192 1·t 80data 24,165, 253, 109, 6, '192, 133, 253 1190 data 165, 254 , 105, 0 , 133, 254, 201. 7 ·1200 data 144, 230, 165, 253, 201, 192 , 144, 224 12'10 data 96, 169 , 0 , 133, 25 1, 169, 216, 133 1220 data 252, i73, 7, 192, '145 , 25"1. 230, 25 1 1230 d ata 208, 2, 230, 252 , '165, 252, 20 1, 2 19 ·1240 data 144, 239, 165, 25 1, 20'1, 232 , 144, 233 1250 data 173, 33,208, 205, 7, 192,208, 0 1260 data 96, '174 , 8, 192,234, 234, .234, 202 12 70 data 208 . 250, 96

I

1 \

amaZAMARAing 0 p rint " " 1 c = 32:forn = 1 to4 1 :gosub3 :c ;::< 192- c:fora =Oton :forb ""' 1024 + ato2024step n:pokeb,c:nextb ,a,n 2 end 3 x -== int(15* rnd(1)):y = in t('1 5>~< rnd CI )):poke53280,x : poke5328 1 ,y tori "" 1to '100 :next:return

{Sorry Chris- I jus! couldn't re-.s!st it) Here's another blitzoid

screenzler: Timescroll for the C64 from Chris 7.nmnra of Downsview, Ontario. Notice how the ill ne- ls !ladded with spaces in two spots? Chan?,e the number of these spaces lor different effects. Line 20 details the exact number 10 sttlrt with. You can also change variable R to 53280 (the border colour n:·~ister) for madded adness.

Machine Language FTOUTSM 10 a,., O:b .,.. 1:r - 5328 1 :tori - Oto1 stepO In keeping with our theme this issue, here's F"rOUTSM fn machine language for the 64 . Writer Chris Zamara said he had to insert a delay loop into the code because it was just

too fast to have any adverse effect on your brain. Although it's still faster than ·the BASIC version, you will also notice that it's much smoother. Once again, the Surgeon General

l.-..--- - - -

C~!~~J!;~~~;.or__ ----·- ~-~--~--==

. . . . _____

poker,a:

poker,b:next

.20 rem step0:3 spaces poker,a: 7 sp aces poke etc .

Quick No.te! The VIC 20, matched taJ&k for taak, is the

~

foot""' of tho Commoclnre=1=-~

__,lJ!..... -- ·-···--·-·· ........ ··· . .. .......·-~------- - -Y,-o-lu_m_•_S,-1-••_u_• -02...........,


POKE 204, 1 : POKE ?07, 0

Stop RUN/ STOP Most of you have no doubt seen at least one RUN/STOP disable for the C64. The following POKE was published several issues ago. It disables RUN/STOP (and RUN/ STOP-RESTORE) without affecting the Tl clock, but don't try LOADing or SAVing and expect normal results! POKE 808, PEEK(808)-16

belore exiliug lh~ iuput routine ensures a rC'Iurn to normal cursor function. The accomvanyiug short routine iltustmtC'S the technique and should b~ us~u to replace "Auto LinN". A number of other minor errors in that program havC' nlso been corrected." 60000 input " start, incrernenl " ;s,i 600 10 prrnt " "; s;:poke204 ,0 60020 geta$ : it a$ = •• then 60020 60030 poke 207.0. print a$; : if asc(a$)<>13 then 60020 • 60040 p- peek(11 '15 + len(str$(s))) : if p- 32 or p = 160 then 60010 • 60050 print • s = • s + i ": i .. "i • :goto600 '1 60060 poke631 ,13 : poke632,13: poko1!)8, 2 60070 poke 20L1. 1 : poke 207. 0 : end

Therefore, this should on ly be used after the program has been LOADed and only with program that do not LOAD subsequent software modules. This next routine is by James Whitewood of Milton, Ontario. It does everything the above POKE does without messing up LOAD and SAVE: 10 lo= 12 • 4096 20 c = int(lo/256) : b - lo-c• 256 30 for i -::lo to i + 4 : read a : poke i,a : next 40 poke 808, b : poke 809, c : end so data 169. 255, 133, 145, 96

60000 rnput • 4.0/2.0 auto: start incrernont" :s,i 60010 prrnt • · ; s;:poke167,0 60020 get a$ : rt a$"" • • then 60020 60030 poke 170, 0. print a$;: if a!:ic.:(; r$)<>13 then 60020 60040 p = peek(33009 + len(sl r$(s))) · if p- 32 or p = 160 then 60010 GOObOpnnt "s= "s+t " :i= " i " :goto6001 • 60060 poke 623 .13 : poke624, 13 : poke 158, 2 60010 poke 167, 1 : poke 170, 0: cnci

The address computed in line 10 as variable LO can be any available memorv• ie. the cassette buffer will host this routine just fine. Notice how line 30 uses the loop variable I in the calculation " 1+4 " to specify the end of the loop. This is quite legal since I is set to LO and entered in the simple variables table (just like any other variable) before BASIC interprets the TO operative. However, you might also notice that 4 is one less than ~he number of DATA items. In situations like these, inclusive logic must be used to deter· mine the number of loop iterations.

Abo hav~ a look at Elizabeth Deal's nrticlc, ''To GET Or Not To Ut:T", liiler in this issue - Eel.

Cursed Commodore Cursor! Keith Preston of Ottawa, Ontario, has these comments on invoking the built- in cursor routines whtle a program is running, as detailed in The T.

Sorry, But That DOES Compute crtlesl Bliisdtke of Sudbury, Onrario hns these comments:

"Several articles in Volume 4, Issue 6 suggest that a flashing cursor, the neophyte's comforter. may be retamed during a Commodore GET by invoking POKE 204. 0. These are "Auto Liner" on page 18, "Subroutine Ehmmators" on page 37 and "Three GET Subroutines" on page 38. When using the C64, however, the single POKE does not guarantee a flashing cursor for more than the first character of an input strin~ (as requested in "Auto Liner''). furthermore, the cursor may disappear upon hitti ng RETURN! To prevent this, simply add:

"In tile ~.:onun~rdal world , .,,,e all have hcnrd the phrase: "Sorry, llte computer rnilclC' a mistake'"· We know, of course, thai it is the programmer ann nor rhc computer that made lhe mblake. Computc>rs cion'! mnkc mistakes. Right?

Well l~ l 111e show you that your computrr will make mistakes and will logically contradirJ itsC'If YN, not all is lost. A progrdlllrner should know the ('omputNs' weaknesses and keep it from milking lrtiC' mistnkc.s. Typ~

POKE 207, 0

PRINT 5 t 8

in any line after the GET. A further:

I

11Ht TI"'nMador

in to your computer the rlirrct rommand·

19

Volum• 5, luu• 02


r--------------------------------------

·- -- -----···--- ·----------------------,

The reply will be 390625. The computer hns in fact produced the correct value which Is 5•5•5•5·~ .. 5· 5•5

Low- Res Screen Copy If you've ever attempted to do a low rel>olution screen dump of a screen containing graphics, you've seen that the printer leave!> a little hurlible space on carriage returns. This leaves the printout looking like it went through a shredder. But by using " LOW RE.S COPY", you can eliminate that space on the printout The program itself is on ly 14 lines long, somewhat shurtl:!r than the 22 lines of "!:icreen Copy" in the VIC 1525 ust!r's manual. I find this program to be a very handy utility when the time arises I hat you need a tme low resolution snee u copy. Brian Dobbs. Timmins, Ontario.

Now enter the followi ng small program: 10 if 5 t 8 "" 390625 then print • tr110 " 20 if 5 t 8 <> 390625 then print • fAlse "

Type "RUN" and the computer will print "false", contradicting its previous statement that 5t8 =39062S. You probably know that your complltl'r will reply with - 1 to a true statement and with 0 to a fnlsr. onl'.

100 si$ chr$( 15) : bs$ = chr$(8) . d or 1024 : open4,4 11 0 for a= d to d + 39 120 print#4 . s1$: 130 b =peek(a) 140 it b>- 1 and b<32 then e$ ""' chr$(b + 64) 150 if b>31 and b<64 then e$ "" chr$(b) 160 it b>63 and b<96lhen e$ "" chr$(b + 32) 170 it b>95 and b<128 then e$- chr$(b + 64) 180 pnntN4 , e$, 190 next 200 pnnt/14 , bs$ 210 d = d + 40 , 11 d>1984 then 230 220 goto 110 230 end &:::

rt you aren't sure about this, try·

The computer replies with -1 (true). PRINT (2•2=5) will result in 0 (false). However, even LJsing this approach, the computer stubbornly dcniC'.s its own findings that 5t 8;::: 390625. PRINT (5t8 = 390625) will reply with 0. false.

So what happened? The problem is that the computer calculates 5t8 in floatln~ point arithmetic and due to roundoff errors thinks the result is slightly greater than 390625. For pri nti n~ . It "rounds off" rh r~ value in memory to the correct 3n0625 However, equality te~ts fail since the mmputer perceives the tmc result to be larger, and therefore unequal.

EepEep

Eep Eep is a short interrupt driven routine that uses the c.:ursor countdown liming register to drive the CB2 transducer (it's not really a speaker so it's called a transducer). Eep Eep only wo1ks on BASIC 4.0 machines but could be modified to drive the SID or VIC 20 sound registers. However, it's only good for two things really. one, it demonstrates the concept or pre-interrupt code. Notice the first 9 numbers in the D..XIl\ statements - you can almost read them without a dissassembler. They go LDA with 13 1. STA in location 144, LOA with 2. STAin location 145, and RTS (~6). ~ times 256 plus 131 equals 643 which is where the actual pre-interrupt program begins (LOA w1th 16 right after the RTS). This is one of the most common methods to engage a pre-interrupt routine. and the qutckest ways to spot one- something to remember when you find some old listing lying around.

There are whole sets of prohle.ms where it is essential fm the pro~ rammcr to avoid this pirfall in order for the con1puter to do its task reliably. Rf'aring potential roundoff errors in mind, the programmer should have typed: PR INT {INT(St 8) .. 390625) This would rc..-ult with the - 1 or true response. Of wurse this is limited to numbers that can be anticipated tu have no fractional content. For numbers with magnitude to the right of the decimal point, the progrnmmer should cousider mavin~ the dC'Cimill point right by multiplying !Jy some multipk of 10, say 100 or 1000, or as many sig11ifkaut digits as desired. Then tnke the INTeger portion of tl1is numbel' and divide by the same multiple of 10.

At the end of line 1090 are three 234's. These are NOPs. It means si mply No OPeration or NO oPeration, whichever you prefer. The reason the5e are here is to accommodate the three POKes in line 1035. Line I 035 can be left out for a different cep £ep. RUN the program as is, then remove I 035 and t<UN again.

I hope to hnve convinced you may not blindly trust everythlnR that apprnrs on the srreen or ronsider your mmputcr's logk infnlihlc."

(

TIM Tronaodor

20

V.Jume 5, latve 02

I

l'i


Line 1100 contains the code JMP to location $E455. This is the regular interrupt routine that the computer usually goes to '"''hen there is no pre-interrupt code- another way to spot pre-interrupt routines. Eep Eep plays with the same chip responsible for LOADs and SAVEs. It's suggested you purge your machine of Eep Eep before continuing with more serious work. Oh ya, the ot her thing E:ep E:ep does effectively is drive you bonkers. Just hook your computer up to your stereo, start Eep Eep, and tell no-one to touch your equipment. Then leave. 1000 rem eep eep - rte 1984 1010 for j = 634 to 676 : read x 1020 poke j, x : ch = ch + x : next I 030 if ch <> 6 145 then print· checksum error" : end 1035 poke 671 , 238 : poke 672, 147 : poke 673, 2 1040 sys 634 1050 data 169, 131 , 133, 144, ·169, 2 , 133, 145 1060data 96, 169, 16, 141 , 75,232 . 169, 20 1070data141 , 74 , 232 , 165, 168,141, 72, 232 1080data 160, 0 , 200. 208, 253, 169, 0 , 141 1090data 75, 232, 141 , 74,232,234,234, 234 1 I 00 data 76, 85, 228

1050 data 169, 131 , 133, 144, 169, 2, 133, 145 1060 data 96, 162, O, 160, 255. 189. 128 1070 data 153, 208 , 134, 136, 232, 208, 246, 238 1080 data 137, 2, 206, 140, 2 , 173, 137, 2 1090 data 201 , 132,208, 233, 169, 128, 14 1, 137 1100data 2, 169,134,141 , 140, 2. 76, 85 1110 data 228

o.

The C64 version is a little longer due to colour table servicing required for Kernal 2 machines. However, it stops working after a Clear Screen is done, until the POKE in line J040 is given. C.an someone help us here? It's probably just some silly oversight that we can't seem to spot because of the clouds between us and the screen - you know the ones we mean, they're made of clear air? Hmm. 1000 rem mirror 64 - rte 1984 10 10 for j = 828 to 900 : read x 1020 poke j, x : ch == ch + x : next 1030 if ch<> 8190 then print · checksum error" : end 1040 poke 53281 , 493- peek(53281) : sys 828 1050data 169, 7 1, 141, 20, 3, 169, 3,141 1060data 21, 3, 96,162, 0, 160,255, 189 1070data o, 4, 153,232, 6, 189, o. 184 1080 data ·153, 232, 186, 136, 232, 208 , 240, 238 1090 data 77, 3, 206 , 80, 3 , 238, 83, 3 11 data 206, 86, 3 , 173, 77, 3, 201 , 6 1110data208,221, 169 , 4, 141 , 77, 3,169 1·120data 6 , 141 , 80, 3 , 169, 184,141, 83 1130 data 3, 169, 186, 141 , 86, 3, 76, 49 1i 40 data 234

oo

Mirror

Mirror is another pre-interrupt routine also written by Richard Evers. It was written for no other reason but to see it work.

Ram Scan 1000 rem mirror 40 - rte 1984 '1010 for j = 634 to 682 : read x 1020 poke j, x : ch = ch + x : next 1030 if ch <> 67 10 then print · checksum error" : end 1040 sys 634 1050 data 169, 131 , 133, 144, 169, 2, 133, 145 1060 data 96, 162, 0 , 160, 255, 189 , 0 , 128 1070 data 153, 232, 130, 136, 232, 208 , 246, 238 1080 data 137, 2. 206, 140, 2. 173, 137, 2 1090data201 , 130, 208,233, 169,128,1 41 , 137 1100data 2, 169, 130, 141 , 140, 2, 76, 85 1110 d ata 228

Ram Scan might be useful to somebody out there. Once engaged, it continually displays as many bytes of memory as will fit on the screen. Positioned over Zero Page, it will show the various timers, etc, i n action. Same with the VIA and PIA registers up at $£800. To move the display use the cursor keys- cursor up/ down moves it by one line of bytes, cursor left/right by one byte at a time. The STOP key puis you back in BASIC. Other than this, it too will give some pretty eye crossing patterns, something Richard seems to enjoy inflicting. Try moving the display around just below, and then above the first screen address.

1000 rem m irror 80 ·- r1e 1984 10 W for j ""634 to 682 : read x 1020 poke j, x : ch = ch + x : next 1030 if ch <> 6696 then print· c hecksum error· : end 1040 sys634

1000 rem ram scan 80 - rte 1984 10 10 for 1 = 634 to 72 4 : read x 1020 poke j, x : ch = ch + x : next I 030 if ch <> '1 1974 then print " checksum error· : end 1040 sys 634

._[_ :T.:."=· ...:.: Tr'-= a::.:. n::: aa:.::. ct:.: o:.:... r - -- - - - - - --

- -- - -2 =-1:..._..__________,., __.__ .. __ .. _ -----·-·-·---·-----'Y.'-= o"-'i~""-;;,"" ·-.,_,·s'-L.·;·~i~;::.,~·u::-=~:...::0:.= .2_.._,1


..".

,-------··-~··--. --------------------------------,; ,

>•

1050 data 165 , 151 . 20 1, 255, 240, 43, 166, 152 1060data224. 0,208, 10, 201 , 17,208, 16 1070data238 , 178, 2, 76, 171, 2,201 , 17 1080data20 8, 16, 206, 178, 2, 76, 171, 2 1090 data 201. 29, 208, 6, 238, 177, 2, 76 11 00 data 171 , 2, 20 1, 29, 208. 3, 206, 177 1 110data 2 ,1 60, 0, 174, 178, 2, 185, 0 1 120 data 255 . 153, 128, 200, 208, 247, 238 1130data 178, 2, 238, 181 , 2, 173,181 , 2 1140 data 201 . 136, 208, 234, 142, 178, 2, 169 1 150data 128 .141 , 181 , 2,165,155, 201, 239 1 160 data 208, 166, 96

o.

I

i

1000 rem rarn scan 40 10 10 for j = 634 to 744 : read x 1020 pol<e j, x : ch ""'ch + x : next 1030 if ch <> 14739 then print" checksum err<.)r • : (~nd 1040 sys 634 1050data 169 ,147, 32, 210, 255,165,151 , 201 1060 data 255 . 240, 41 , 166, 152, 208, 10, 20 1 1070 data 17, 208, 16, 238 . 199, 2, 76, 174 1080data 2 , 20 1, 17, 208, 16,206, 199. 2 1090data 76 ,174, 2, 201 , 29, 208, 6, 238 1100data198, 2, 76, 174, 2, 201 , 29, 208 1110datt'l 3 , 206, 198, 2, 173, 198, 2.133 1 120data251, "173, 199, 2, 133,252, 169, 19 1130 data 32, 210, 255, 32, 23, 2 15, 160, 0 2, 185, 0,255, 153, 5 1140data 174, i 99, 1150 data 128, 200, 208, 247 , 238, 199, 2. 238 1160data202, 2, 173, 202 , 2, 20 1, 132, 208 1170data234 , 142, 199, 2, 169, 128, 141 , 202 1180data 2. 32, 225, 255, 76, 127, 2

1000 rem rarn scan 6 4 101 0 for j= 828 to 916: read x 1020 poke j, x : ch = ch + )( : next 1030 if ch <> 10348 then print· c hecksum error " : end I 040 poke 53281 , 493-peel~(53 28 1 ) : sys 828 1050data 165 . 203, 20 1, 64,240, 42, 174, 141 106 0data 2. 208, 10, 201 , 7,208, 16,238 1070data115, 3, 184, 80, 27.201, 7. 208 1080data 16,206, 115, 3,184, 80, 17,201 1090d.ata 2 . 208, 6, 238, 114, 3, 184, 80 1 100data 7, 20 1, 2, 208, 3, 206, 114 , 3. i 110data 160, 0, 174, 115, 3, 185, 0,255 1120 datu 153 . 0, 4, 200, 208, 247, 238. 115 1130data 3,238, 118, 3 ,1 73.118, 3,201 1140data 8,208, 234, 142,1 15, 3, 169, 4 1 150data 141.1 18 , 3, 32 , 225,255, 184. 80 1160data 167

Crystal '

"

..

•· :i

Crystal is just a short little program that draws a crystaline pnttcm on your screen . Aside from that it demos how very litrle. corlc> ir mkr.s to get something happcninp, - somcthinR like a game layout, a gnmc intro, or nn attroc.t mode for a game y•ou may have just finished and tho1Jght you didn't have room for an attract mode feature.

'·i

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

c

,'

Crystal abo derrmns.trat.es •~ techniqtJe that all programmers should he us~<j to or else get used to ·- portability. Some programs nren't suited to he nm on all machines, but those t hat cou ld potPntlally be run on any machine should include for the IJser all m~:essa.ry conversion information. lt doesn't take long anri it's a courtesy that adds an extra professional

~

• ;~ ·. ,.,,; :~ •...S( ·~

,

:l

:~,

.

• <

. .

touch

.. .. ,. ."' .

100 mm crystal

110 rem 800019000 series 120 rem 4000 + c64 130 mm vic 20 140 rem 4.0 basic

: sw = 80 : sw-40 : sw = 22 : ss ""32768 : ss .. 1024 (defaull) : ss= 7680 (default)

,,

'

~

~

150 rem c64 160 rem vic 20 170 rem sw ... n width : ss ... screen start 180 print" ·· ;: ss ... 32768 : sw-80 : rem .. place your var.iables here 190 x ... 1:y ... 1:dx -1 :dy - 1 200 poki~SS !· X ·f SW"'y,81 : pOkC;lSS + X •!· sw•y,91 210x "" x + dx : it x = Oorx'"' sw .. 1 ~hendx = ... dx 220 y '"' y + dy : if y - 0 or y ... 24 then dy ... -- dy 230 s "" peek(ss + x + sw•y) : ifs "" 91 thendx..,. -dx : poke ss + x -+ sw•y, 86 : goto21 0 240 goto 200

'

;·:

.

" "'. "

~~

... ~

.

,,

'·.'..'

.,

'''. ;:

i-

.. " '.

......

..,

Number Bose Converter

"

l:

'

""<

This next program works on BASIC 4.0 mnch i n~:s only hccausc it uses some internal R0M routines of the ht 1ilt in Machine l .anguagc Monitor whk h the other m<~c.h inr.s rlon't hnv('. Quite si mply, it will convert numhcrs from one~ number base to another that arc in hcxadec im<:~l. dcdrnt1l , or hinarv. •

'

Them or~ two internal ROM routines uscrl herP.: thf! first, SYS HD (where Hn =55124). inputs a hexndec.imal num lx~r from the 1\cyhoard and places its high order and low order components in locn1ions 252 and 25 t. The program tnkcs ov£~r from there and uses variable NO to build a dccirnnl rcprcscnrntion (line 12 or I :3),

.,"

. .

,•

'• ''

"

"

_ _ __ _ _ _ _ _ _ __ _ _,_

_

.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ J ··

,. --....- ·- -- - - - - -- - - - - - - - - - · - - - - - - - - -·- - · - - - - - - · .. -· -"-·------·-..-·Yo ~-·.~ u··m ····...·;,-· , ·,-..~ •-••-. ...0•...,. 2.. --·· 1.·.:. .....,_, Th ""•e....:li~ ro~n,_,MI ~c""t~~ o '-------........................._____ ...______...________ 2_2- · - -

._1

~

--

_


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

-------------------------------- - - -

The scconci, SYS OH (whcr<' OH = 55063), is the MLM routine for outputing a hex;uiccimal number whose high order and low orclC'r componf'nts arc in locations 252 and 251 (1inC' 1~or 19).

1050 data 169, 131,133.144. 169, 2. 133. 145 1060 data 96, 165, 170, 201 . 1 . 240, 4 1. 169 1070 data 128, 133, 88, 169. 0. 133 , 8/, 168 1080data177, 87, 73, 128. 145. 87 .200,208 1090 data 24 7, 230, 88, 165. 88. 201, 136, 208 t100data239, 238, 134 , 2, 173. 134. 2. 201 1110data 2, 208, 5, 169, 0. 141 , 134, 2 1120 data 76, 85 , 228

0 rern S<.tvo • @O:hox/dec/bin conv" ,8·verify • O:hex/dec/bin conv • ,8 1 rem .. ricllard evem n1arch 8th 1984 ··· 4.0 only • 10 input " " ;q.$ 11 print = • B ·then input • ecimal • ;no: 12 tf q$- b "then print " val • ;:syshd :no ... peek(251) + 256• ·goto1 6 13 if q$- • h " Itum p rint · x val • ;·syshd : printpeek(251) + 256 • pcck(25?):goto 10 14 if q$ ... • H • or q$"" • D • then input • inary number" ;bn$ : goto17 1S 1nput" al " ;a:b=ir lt(a/256):c•a ?56*b .poke251 ,c: p oke252,b:systlh :goto10 16 print: a= 32768:forc = 1to16:b- int(no/a):printb; :no= no- b • a:a ~ a/2:nextc:gotn1 0 17 a= O:c = 1:forb== len(bn$)to1 stcr 1 :a= a+ val(mid$(bn$,b .1))• c:c- c•2·ncxtb 18 ilq$"" • D "then print " decimal" a : golo 10 19 print"$" ;:b- inl(a/256):c- a 256•b :poke251 ,c: poke252 ,b:sysdh:goto 10

1000 rem un-cursor 40

101 0 for j - 634 to 692 : read x I 020 poke j, x : ch = ch + x : next 1030 if ch <> 7652 then print· checksum error • : end 1040 sys634 1050 data 169, 131. 133, 144, 169, 2, 133, 145 1060data 96, 165, 170.201, 1,240. 41 , 169 1070data128,133, 88, 169, 0,133, 87 , 168 1080data177, 87, 73, 120, 145. 87,200. 208 1090 data 24 7, 230, 88, 165, 88. 20 1, 132, 208 1·tOOdata239,238, 134, 2.173. 134, 2, 201 1110data 2,208. 5,169. 0, 141,134 , 2 1120 data 76, 85, 228

1000 rem un- cursor 64 10 I 0 for j - 828 to 888 : read x 1020 poke j, x : ch = ch + x : next 1030 if ch <> 6949 then print · checksum error • : end 1040 sys 828 I050data169, 71 , 141, 20. 3, 169. 3, 141 1060 data 21 , 3, 96. 165, 207. 201, 1, 240 1070data 41 , 169, 4,133, 88,169. 133 1080 data 87, 168. 177, 87, 73, 128. 145. 87 1090 data 200, 208, 247, 230, 88. 165, 88, 201 1100data 8, 208,239, 238, 74, 3, 173, 74 11 10data 3, 201 , 2, 200, 5, 169, 0, 141 11 20 data 7 4, 3, 76, 49, 234

The Un- Cursor Still another pre- inlermpt rout inC' Is this one called Un- Cursor. As the name might imply, tln- C.ursor flashes everythiug on the screen except the spare at the r ursor position. AI leah! that was the original intention - thl' rral cursor seellls to slip in au appearance (~vc~ ry onrr~ in il while.

o.

Tlu:!se pre- interrupt routines we've hC'en hombnrdinf{ you with 111ay have no plaee in your utilitirs library, hur they do serve one vital purpose. By giving you seveml t•xnmplcs we bt:lieve we au:om~,l ish two things - eliminating I hi' fCilr ilnd avvn!lumsiun of messing with the fundamen tal operation of the 111ae.: hine is an important step towards bN'oming profi. cieut with your computer. And second, whC'n you come up with your owu idea for a pre- interrupt program, we hope one or th~e tiXaruples will serve as a guide to compiC'ti ng your task.

1000 rem un- cursor 20 10 10 fo r j - 828 to 888 : read x 1020 poke j, x : ch - ch + x : next 1030 if ch <> 7141 then print • checksum error· : end 1040 sys 828 1050data 169, 71,14 1, 20, 3, 169, 3. 141 1060data 21, 3. 96, 165, 207, 201, 1, 240 1070 data 41, 169, 30, 133, 88, 169, 133 1080data 87 . '168, 177, 87, 73, 120, 145, 87 1090 data 200. 208, 247, 230, 88, 165, 88, 201 1 100 data 32, 208, 239, 238, 74, 3, 173, 74 111 0data 3,201 , 2,208, 5, 169, 0.141 1120data 74. 3, 76. 191, 234

o.

1000 rem un-cursor 80 10 10 for j -= 634 to 692 : read x 1020 poke J, x . ch ""ch + x : next 1030 1f ch <> 7656 then pnnt • checksum err or • : enci 1040 sys 634

23

Vohmte 5, luue 02

I


I

..

..

l

'

.' .

CompuKinks.

,.,

••.

., ... ". •'

•'

.,•

• ·:~

:-..

.. '•

.·.."

'I.' '•

......

..

.·.• -~

:·; ·::

-·.• "

'• '•

.·." ·-· ,•

·--.--· -· ....

' '\ '.

...

., :-1.

J

All right Earthling, turn around slowly and keep your hands up I

He'9 the new shop assistant. He seems to like it here, but I don 't th:lnk he's gonna work out.

.• .


1, .....---·------··----------------- - - ----- - ---. ' 0 5 1 /fli.R II'Iv reo Pt. TRos"'y I o

h

I

l

[ ·Jh• Tranaactor

-

25

Volume 5, 1ss.!'e 02

]


I

...

-...

--COMPUTE'A

.,.,..

-...

~

GENIUS

/

/

ROOTIM:. ATW~IV£S, S~.Af.LilfNb FOR AN

STeP.lf. C{)IJJJEQ'IM.; J:NTCR.fA(.£ fo!<. l.:ffB?NA/ ANA(J')&llf llvPUr ()SIN(, CW/y

A SOLDff{JN6 IMN AND

iii&H KEJJSrAtKE

el<.GONOJtlit_ l.tSEil..- JIYTdfAlf

--· FOR rtJ6

T£1£fM?!Yf

svSI'E.m •••

-

\ -

-

t

. . .. . . .

--- . . -....-

-- --·. .

.

- .\

---""'-

·-

--

-

·- ...

1

I ' / . ;1 II !

.~

,_,.

- ·- - -- __.. ....

_,.


,..---------- ----------- - - -------··-·--·- ---.. - ··------------,

The

r:lfH~fl(jER

Column

Don BeD Milton, Ontario

I

I Letters to the Manager

!

Many subscribers have written to me about their frustration with the manual and their desire to find more documentation for the program. Instead of writing everyone on an individual basis, I will use this column as my way of answering all your letters. First off, make sure you have the latest version of the '64 MANAGER, i.e. version 1.0Gb. Secondly, I am not awar~ of any other sources of documen· tation for the '64 MANAGER other than the manual and what you can glean from my columns. If I feel there is sufficient demand and 1 have the time and energy. I will attempt to put together a booklet of additional documentation. Subjects covered in previous '64 MANAGER columns are as follows: Vol 4 Issue 03

overview of '64 MANAGER technical details on the screen file

Vol 4 Issue 05

Gift {Mailing) List part I designing a screen in CREATE/ REVISE option creating a file entering records

Vol 4 Issue 06

Gift(Mailing} List part 2 Potential Benefits of this Application Review of Screen Format Tricks for Entering Records Quickly Searches

Vo\5 Issue 01

Cift(Mailing) List part 2 Designing Reports Using Report Generate

'f1Mt Tran.actor

·-

Nelson r'uug of Di.tllas, Texas wants to know how to modify the program to !Jroduce an 80 c:olumn printout. The Commodore '64 ib a 40 column computer so you will never be able to gt!t au 80 column display or rf'pnrl on the screen. However. yuu ccut get 80 column reports on n printer. In the l<eport Uenerate option, specify output to printer. line lcnRth 80, liueb !Jt!r page 66. Of course, your rf'rort must be designed dS an 80 column report. Whf'n rlC'scribing the LISTLONE the colu mu uumi.Jer references must rcncct the starting column vosilions uf each print nrr.a in rhc I.IST ZONE. A Jew answers for Pete Musselman of Royerford, PA. No you cannot use two 1541 disk drives. Tlte section on 'Accumulate' on page 14 of lht! rmmual has an example of nn arithmetic file. Oo not let it throw you, it's just an example. The ·accumulate' function can only ue used if you h:wC' used the 'AI<ITHM ETIC' uptiuu to create an arithmetic file. f'or example. in this issut! lltt!rtl is a checkunok application . In order tor the applicatiou tu calculate a ru nning halanr~. we had to do some arithmetic. Tltis arit hrt1etk was r.rcntr,<i in AKITHME'I'lC OPTION and store<J in an arithmC'tir fi le. Now when we re4ue~l 'accumulate' in the ENTF.R/ Ef)IT option, the program will 4uickly read through all the r(',. cords, select records satisfying the stlarclt critPria, perform the anthmetic on these r~un.b, aud display the balance nt the screen location specified iu Arithmetic:.

A.W. Lauer ol Fredericksburg. VA wauts to know how to begin a search at a particular rtlcurd tiUIIIUer. Unfortunately, the only direct way of doing th is is uy i11serting a numerir field for the record nurnber iu your scn~en design. Then using the search string editor (F5). iudicate records greater than a specitied record number. Allutlter way around this problem might be if there is a date fit!h..l and records ar<~ usually entered in order of dattl. Sort uu lhe date field. then

_______·-----------------------~2~7------------------------------~Vo~l~u~m~•~s~:~•·=•~u•~0~2~l


the scnrrh r rirNia will be greater than a specific date. If you hnvc nn nlphnhctiral key you are sort i n~ on, then you could spcrify rcrorc1s grrntl'r than • •• for example Wnrren Knighton of Wassau , WI. had problems with the RNrrnngr a Filr function i n the MANIPULATE files option. This is the fu nrtion you will use if you want to change your file rlcsign . lln fortunatr.ly, I've :~lso hac1 several problems with this option as welL If the progr<lJTl stops hcfore completion, hdorr tryi ng it again do the followinR Load the Emer/ P.rlil option nnrl sr.c how many of the records got transferred from thr olc1 fiiC' to the new filr. If most of them are there, then you mny he OK. The next prohlem is that they may appear to hr thNc, hill when you do a search for specific rccorrls they don't show up. To correct this problem use the Fix:~ Fllr function In the MANIPULATE FILES option. Rirh;mi Roisvcrt of Woonsocket, R.I. has been usinR the '64 MANACiF.R as n rlcrr:r.tive for the Woonsocket Police Departmrnt . F:arh rrrorc1 in his fi le has 6 fields In which to list stolen objects When a stolen object is recovered he wants to search all 6 flrlc1s at once. Refer to the section of the manual on thC' 'hunt ' option in the search criteria (p.27). The importnnt points nrr (1) the use of complex search criteria (FS); (2) thr usr of 'H' to specify hunt for the object anywhere i n the field; and (3) use of the loRical operator 'OR to include many c1iffcrrnt searches. To locate a stolen ob ject (e.g. Atari gamr ) whlrh coulrl be at any location in any of the 6 fields, yo11 wottlrl usC' the following complex search criteria (F'S). Hl 'ATARI' OR H2'ATARI' OR H3'ATARI OR H4'ATAR1' OR H!l'ATARI' OR H6'ATARI'. You can also Ret more complex sC'nrrhrs hy looking for a number of objects at once. Hl'A· TARI OR H J'SHOTGU ' OR H2'ATARI' OR H2'SHOTCiiJN' .. If the description of an object is ambigu· ous or you c1irl not always describe it in the same way, you rnulc1 ngain 11se the 'OR' statement to hunt for the object uncicr c1iffrrC'n t rlcscriptions, e.g. HI 'WALKMAN ' OR H 1'CASSP.TTF:'

ever you are doing a search. accumulate or report. the search criteria select relevant records. then the Arithmetic file operates on those records calculating new amounts and displaying them at predefined places on the screen. In the ARITHM ETIC option you define bins or registets where you want to store numbers. You can perform arith· metic on numbers in the registers and you can display the contents of the registers at any location on any of your screens. Why would you want to use ARJTIIM ETIC? You might want to accumulate a total of the amount fields in our records. We might want to know subtotals as well as totals at break points in our reports. Sometimes it is desirable to transler data from one screen to another. There are of course limitless reasons for wanting to use Arithmetic to create new information about your file.

Checkbook Application With ARITHMETIC

I have chosen to do a checkbook apphcahon as the Arithmetic logic is fairl y simple. You may have noticed the checkbook application in the back of the '64 MANAGER manual. It has a nice-looking colourful screen and includes most of the information you want to store about your cheques. Initially I was just going to use the application as is, go over how to copy the screens, reports and arithmetic. l lowever. once I got working with it on a practical level (I always try to make an application work in the real world!), I found it had several limitations. The way it works, it could only handle 2 kinds of transactions cheques and deposits. What about withdrawals, bank charges, loan and bill payments? Another problem is that the balance just shows up in the middle of the screen without any heading indicating that it is indeed the balance. Of course, like the other applications included on the disk, there is no indication of how to use the appltcation.

An Introduction to ARITHMETIC

Oon't hC' frightencci nway by the description of the ARITHMF.TI\ option in the manual. I know at first it looks like advanrcd math, hut once you grasp some basic concepts it's fairly simple. Th e search criteria and the Arith mNir work together to give you very powerful ilccumulate and report possibilities Us· ing the i\rlthmNir r.rlitor in the ARITHMETIC option, you can dr.srrihr. wh.11 c-alrulations you wnnt to <1o on fields in you r rerords. Upon exiting thC' option, n sperial file (AR.filename) is created where your arithmC'I ir is stored. When-

This article is an attempt to overcome the deficiencies of the original checkbook application. This application should provide a workable tool for verifying your bank statement, balancing your checkbook, and generating numerous re· ports about your bank account. Screen Design

I have redesigned the screen to enable the distinction between 5 different kinds of account transactions - bank charRes, loan payments, cheques, deposits and wit h· drawals In accordance with these modifications, I have also

The Tran10ctor 28 Volume 5 , lnue 02 ~~~~~~---------------------------------------=~----··------------------------~~~~-~~~~


redesigned the 'aritluuelic' tlial calculates the balance. The balance is displayed in the screen heading nexllo the title "BALANCE" so you'll know what it is when it magically appears. I dropped the fiekl "Signed By" as I uu nul hav~ a joint account. If you have a joint account, you may want include it.

ROYAL CHECKING DON BELL

ACCOUNT"' BALANCE

S03-209-9 $

OUTSTANDINC(Y/N) DATE AMOUNT flA] [t 6N t] ($t 7N t] TRANSACTION [lA) B- BANK CHARGE C - CHEQUE 0 - DEPOSIT L;;:; LOAN PAYMENT W "" WITHDRAWAL

While on tile subject of screen design. let me give you some reasons for my screen design. One of the big factors to consider is a desig11 that facilitates minimal keystrokes. For example, uot all records require eBlries in the fields for CHECK'", WRI1TEN TO and DE.':iCRJPTJON. Therefore I put them al the bottom ol the screen so the user would not be furce<lto cursor over these fields if they are not relevant.

EXPENSE TYPE

[t2At) AUTO CASH CLOTHING CONTRIBUTIONS

Secoudly, lields that need to be updated or revised should also be near the top of the screen. The OUTS'IJ\1 DING field will havt! Lo !Je uvdated each lime you gel your bank slatem~::nt (i.e. change the status of transactions from outstand ing to not outstanding). Thus I chose to make OUTSTANDING tile first field in the record.

POOD MORTG./RENT INSURANCE REPAIRS MEDICAL TAXES UTILITIES MISC. TELEPHONE WRITTEN TO [t 25A

CHF:CK"' [t 4N t ]

DF.SCRIPTION 38A

[t

A third fad or in screen design is the visibility ol the most imvortant pieces of information - in our case the balance and the amount. These 2 pieces of information were place in very prominent positions in the tov ldt corner of Lite scr~ n .

t] t]

Checkbook Arithmetic Load the ARITHMETIC ovtiou fro111 tl tt! 111aiu meuu. You are uow goiug lo iudicate lhal yuu wcml tu have only one display position 011 the screen where the resull of your aritltmetil: (the l:>alauce) wilt be displayed. You wilt also describe tile exact screen location and leugllt of the Jisplay vosition. In our case. we waJJt Lo t.lisplay the I.Jalauce fur our account uext tu the lille 'BALANCE' in line 3 uf our Euler/Edit screen. Complete the screen as below:

Another factor iu screen design is the correlation between the ::;equence uf data entry un lhe screen and the sequence of ittformation in the sourc~ document. In l11 is case a compromise had Lo ~ made to accommodate the other factors. The sequence of eJJtering data ou the screen is almost the satne as reading it fro111 your checkbook with t11e excevtion of AMOUNT.

ARITHMETIC Finally, the screen should be visually pleasing to look at. Text and fields should be easily read, and spaced for clarity. Field promvts should not be ambiguous. The items on the screen should be well-balanced, re flecting I he rules of good picture composition. Follow your creative insti ncts to brighten the screen up with color. There are too many dull computer screens out there alr'eady!

[

NO. OF DISPLAY POSITION ON SCREEN 1? 1

1. LINE?3

COLUMN? 31

LENGTH? 0

The EnterI Edit Screen

Press back arrow(+-)

The following illustration shows the Enter/ Edit form that was designed in the CREATE/ REVISE option. Field lengths and field types (A - alphanumeric N - numeric) are shown. Note; there is no field under the title 路~ALANCE'; this place (starling at tine 3, column 3l)is reserved as a display posi路 tion for the account balance.

We only use one register, !U, to store the current balance in our account. The object of our arithmetic is simply to calculate the current balance, move it into the register Rl where it is stored and then display it next lo the title 'BALANCE' on the screen.

The TranJGctor

29

Volume 5, laaue 02


2 requires a 6 dip,it number for the date ln the form YYMMDD, e.g. 840404 for Apri l 4, 1984 . One letter codes (e.g. iJ == IJF.POSIT) Jrc cntcrcci in the Trt~nSC~ction field. 'fwo-lettc:r codr.s arc cntcrcci in the Expense TYpe ficlci (e.g. Al l = AI/TO). Rr.memhr.r to ttsr. F~ to rl11plic:Hc an entry in rhe previow; rcr.orrl , or Shift 'F:' to duplir<ltr. ;m r.ntirr. rerorrl :1 lrr.ady on thr. srrr.C'n. OftC'n it is f<tstN to rlupliratc a similar rr.conl yo11 haw~ ot lrr.aciy crr.atr.rl and then morlify it, then it is to type in a whole new record.

When calculating the balance in our account, we nrr. c1ealing with several different kinds of tmnsnr.tions - ckposits, checks, wlthdrawals, h;mk ch;,rgcs, etc. When looking at all transactions as a group, they all do one of two th ings- they either add to the balance or they subtrnct from it The only transaction that nrtds to the hnl:mr.r. is n rlr.posit. All other tr<Jnsactions Jrc suhtrJrtr.d from the haloncc. Now you orr. in the EDIT MODE of Arithmetic. You will enter thr. nrithmr.tir logir for r.alr.ulating the balance. Complete thr. screen ns hclow. Only cleposits are added to the balance, all ot her trans11c.tions are s11htrac:ted. Therefore our logic is that if the transaction is a deposit (if field 4 =!0') then arlo the am01mt in field ~(N3) to Rl , ELSE (otherv..ise) suhtrac:t the amount in field 3 (N3) frou t Rl. The ENDIF is required to complete the previous IF statement. Note: all Jines beginning with ';' are documentary comment Jines not req11ired t.o execute the Arithrneti<.:.

Setting Up the File Using A Bank Statement Record 1 must have starting balance for your hank account in the 'amount' rield. Begin with your last bank statement balanc:c. Enter the. 'Rala nc:c Forward' amo11nt from the"' previous statement as the 'amount' in record "' I and record the transaction as 'D' for deposit. Then enter all the subsequent transa<.:tions on tlte bank statement. As the ban k knows about all these transactions they will all be entered as NOT outstanding (i.e. field 1 will always be 'N') . Don't forget I.Jauk charges, loan payments, withdrav,•als, etc. NSF cheques are lreate<l just as they are on your bank statement i.e. tltey are entered twice - first as d t equ~ and then as tle(Josits siuce they are relume<l to your account. (We' re goiug to first check are arithmetic against theirs.) When you've made all the entries exactly like theirs, then try an accumulate. Tlte final balance should be the same as on the llcwk state111ent. 1£ there is a proulelll, dteck the records ami the arithmetic. It's unlikely their computer ntade att error, but it is possible. If worse comes to worse, cl teck lite statement with your calwlatur.

;CALCULATE BALANCI::

;IF A DEPOSIT ADO IT TO Kl IF(f4='D')THEN Kl + N::>TO Kl '

;SUBTKAC:I' ALL OTHEK TKANSACTI ONS ELSE Rl - N:3 TO Rl .

' ENDJF

. •

;MOVE THE BALANCE IN Rl TO DISPLAY ; 1-'0~JTIO ! 1 WITH 2 DECIMAL PLACES 1\1 TO :lDl

Now using your checkbook, enter all outstanding transactions that have not appeared on any or your bank statements. Make sure field l is ·y· fur all tltt~se trausactious. You will nuw have entered in your file all relevant tran::;adions since your (JTevious bank statement.

EDIT MODE Pr~s IJa~,;k

arruw

CHECKING STRUCTURE ARE YOU SURE(Y/N)'! Enter 'Y' <RETURN> STORING MATH

If you wish lu get the current balattce in your bank account, do an 'accumulate' willt 1w search uiteria. 1£ you wislt to lest the bank statement balance again now that you have entered all lhe transaction records to date, do an 'accumulate' svecifying only trausactiuns th<il are nul uutstamJi11g (i.e. Fl = 'N' is the search criteria).

Making f"ield Enlries in the Enter/ f:dit Option

Updating the f'ile t:acb Month

On the Enter/ Ed it menu at the bottom of the screen 'E' is for entering/ adding a new record. If you want to change a record you fir st have to get the record ('<..i') then change it ('C').

1. When you get your next bank statement is a good time to update the file. Start by entering all new transactions rwm your checkbook('Y' for OUTS'li\NDIN<..i). Make sure you include all checks. deposits and withdrawals.

Field 1 {OUS'IJ\ OING(Y/ N) requires a 'Y' or 'N' enhy. Field

2. Now enter into your MANAGER file any transactions that

1: : Th~ Tr~n~actor

30

Volumo 5, lssuo 02


:l[)pcar on your bank statement that are not in you r check路 hook, e.g. bank charges and loan payments. They are entered as NOT OUTSTANDING in field 1. Your MANAGER file shoulrl now r.ontain all transactions to date. ~-

Now you are goi ng to search for all out'itanding transactions in you r MANAGER file that also appear on your bank statement. If an outstanding transaction in you r MANAGER fil e also appears on your bank statemen t, then you will have to change the status of the record to NOT OUTSTANDING. Note: during th is process the balance shown on the screen will not be correct. Do not worry about it. While in the Enter/ Edit option: Place cmsor in field I PrP_<;s S (for search) Enter 'Y' in field 1 Press F3 (indicates a position depenuent search) Press back arrow. (to execute the sean:h) You will now be presented with the first outstand ing transac路 lion. If it appears on your bank statement, check mark it on the statement and do the following: Press 'C' for change Change 'Y' to 'N' for OUTSTANDING. Press hack arrow to store the revised record Press space hilr to find the next outstand ing tr1msac:tion

do an 'accu mulate' with no search r.riterin. Thi~ will <Jccumulatc amounts in all rec.ords in the file. Note: 'Accumulate' rapid ly executes the scarr.h criteria and the arithmetic without forcing you to exami ne each record in detail. It is very handy for accumulati ng a total nmount.

Use ful Searches One of the !.Jig advantages of having your checkbook electronically filed is that you can rapidly searc.h for and find individ ual transactions. For example, you might wanr to look for all checks written for your auto maintcmmc:c. In the Enter/ Edit mode press'S' for search, enter 'au ' as expense type, press P3 for a position inciependent search , press hack arrow. Press space bar to get the next record, ancl so on. Similarly, you could search for any other expense type. You will also notice that the balance displayed will he the ac:cumuIated amounts of the search as a neg<Jiivc amount . If you only want the total amount spent for 41 particu l r~ r expense type, specify 'acr.umulate', then enter yom se,Jrch criteria, then press back arrow.

If a transaetion does not appear on your bank statement, it is

Using the searr.h string editor ymt r.an srccify more romp lex searches. For example all chN".ks written to someone after , rertai n date. Press 'S', FS (for sc<Jrch stri ng editor), enter search c:ritcriil, then press hack arrow. For exnmplc, to search for checks written to 'VISA' after the last dny of rebruary, the search criteria WOIIId he:

still outstanding. Do not change anyth ing. Press space bar to view the next outstanding transaction . . .and so on.

F7 ='VISA' and N2>R40229.

Keep repeating this updati ng process until all the transactions in your MANAGERfile that are also on your bank statement have an 'N' instead of a 'Y' in field I.

Generating Cheekbook Reports I have designed two report formats, one for the screnn anrl one fo r the printer. Using these basic report formats yo11 vvill be able to generate numerous rcr orts simply hy changing the search criteria and header description of rhc report . Reports that you might want to generate could inc:lude: a listing of all outstanding transactions; a su mmary of one or more expense types for a certain time period ; a list of all checks writtc~n to one company.

Verifying the Bank State me nt ow you can verify the bank statement balance using your MANAGER file. While in the Enter/ Edit option do <:m 'Accumulate' specify路 ing on ly transactions that are not outstanding (i.e. search criteria is Fl = 'N')

Refer lo the previous MANAGER Column (Vol. S issue 01) for more details on using the Report Generate option.

Type 'A' for accumulate Press F5 to access the search string editor. Type Fl = 'N' Press back arrow

Re porting to Screen

Getting the Current Balance in Your Account

I uesigned my 40 column screen report on graph paper to look like this:

If you wish to get lhe t:urreut I.Ja.lam.:e i11 your bank account,

I

The Transactor

31

Volume 5, luue 02


Column#

1

13

6

32 35

22

HEADER ZONE ROYAL CHECKING ACCOUNT11 504-209-9

line #J

2 LIST ZONE line #J

RECN :23 BALANCE :$ 250 OATE:849508 AMOUNT :$ 75 TRAN:CH TYPE : AU TO :BENDER AUTO PARTS CAR REPAIR

N2 #J

#4

•s

OS:Y

(Pri nt Areas 1-4) (Print Areas 5-8) (Print Areas 9-12) (Print Areas 13- I 4} (Print Areas 15)

*6 Line 5 of the LIST ZONE has no title. It is the description of the transaction in field 8. The List Zone has a total of 6 lines and 17 print areas. Here is a summary of relevant entries for the LIST ZONE. Use the defaults for the remaining entries.

Print Area" I 2

3 4 5 6

7 8 9 10

11 12 13 14 15 16 17

Data Type

T R T D T F T F T F T F T

Sub- Text/Title script REC~

101 BALANCE:.$

1 I

5

F

7 8

F

1

1

1

6

9 9

1 1 1

13

DATE:

5 6

AMOUNT:$

9 7

TRAN

5 I

1 2 2 2 2 3 3

9

TYPE

2 TO :

Col N

5 3

1

2

F T

Line,~~

3

OS:

3 4 4

Area Length

5

25 38

3 3 4 4 5

22

32 35 l 6

13 22 1 6

13

22 1 6 I

ReportiniJ to the Printer A sample heading in your header zone might look like this:

ROYAL BANK CHECKING ACCT"' 504-209-9 OUTSTANDING TRANSACTIONS

The TraniCictor • '*

32

Yolu~e 5, 1uue 02

I


Here is a one line LlST ZONE format that i ncludes all fields except description. (TR. =Transaction OS • OUTSTANDING?)

6

REC* DATE

t Subscript RIO I or source

t N2

Column" 23

13

17

TR.

CHK"' WRITTEN TO

t

t F4

t

t

53

OS

TYPE AMOUNT BALANCE

t Fl

F7

N6

49

58

65

t N3

t

FS

t Dl

field

In order to produce the printer report format above. make the followi ng screen entries in the REPORT GENERATE LIST ZONE. Print Data Sub- Text/Title Area* Type script

1 2 3 4

5 G 7 8 9

R F

F F F F F F D

Area Length

Line• Cot• Center

of Dec.

I 6 I3

0 0 0 0 0 0 0 2

I0I

REC.t~

4

I

2

DATE TR. CHK" WRITTEN TO OS

6 I

4 6

7 I

5 3 I

TYPE

2

I I 1 I I I

AMOUNT BALANCE

7

I

9

I

4

25 I

17

23 49 53 58 65

N

N N y N N y y y

11

2

More Complex PoS8lbUitiet

' l' - Enter 'N' in field l - Press back arrow - Prompt:

As you enter more and mor~ transactions into your MAN·

Change Field Number - Press back arrow - Prompt: Accumulate- Enter in field 1 as the search criteria- Press F3Press back arrow - see manual p. I5).

AGER checkbook file. it will take longer and longer to accumulate the balance. A way around this problem is to create a new status for the OUSTANDINGFIELD for transactions that are on you r current bank statement. Instead of being labeled as •y • or 'N' in the OUTSTANDING field, you could temporarily label them as 'S', indicating they are on your cu rrent bank statement. In record I enter 'S' for OUT!:i'li\NIJING, the Balance Forward from the previous statement as the 'Amount' and ·o· for a deposit transaction . Then change the status of all transactions in your file that are also on your statement from to Now you can do an 'accumu late' specifymg 'S' in field I as your search criteria. The final balance should be the same as your bank statement. Hyour balance is off from the statement balance use the search function to track down transactions by check", amount or outstanding status.

·y· ·s·.

Once you've got Y9.(!! bank statement verified, you can change records with in the OUTSTANDING field to 'N'. Globally update all 'S' status records to 'N' in the outstanding field . {Press Shift 'C' - Prompt:Change Field Number- Enter

·s·

·s·

If you r last bank statement verified correctly, you can now get you r current balance by entering the final balance on your bank statement into the amount field in record 1 and the status as ·y· for outstanding. Then do an accumulate specifying field 1 = 'Y'. , .,

.

This application could be revised to keep track of a credit card account instead of a bank balance. •

DON'T PHONE -WRITE! If you have questions re~arding this application or you

would like to submJt your own " terrific" application, plea5e write me a legible, coherent letter. If you submit an apr lication, send It on disk or at least send screen dumps of the ENTER/ EDIT screen, a hand- drawn report chart and any math and sample data. I will attempt to answer letters in this column. Write to: Don Bell, c/o The Transactor, .500 Steele5 Ave., Milton, Onmio, Canada, l.9T 3P7.

-


MAILPRO 64: A Review

Mai lpro is a file management program for use on the C64 and 154 1 disk drive. Written by Steve Punter, author of the WordPro series, Mailpro is ideally su ited for keeping m ailing lists (as its name suggests), telephone numbers, or similar lists for home or small business. Mailpro allows such lists to be created, updated, and printed in any format, and in any order. Data (or a list may be en tered using Wordpro, and Mailpro \Viii read the Wordpro file: a time saving feature for Iong lists. First, the documentation. The man ual is packaged in an attractive and stu rdy little vinyl bi nder like the other PRO-LINE software products. My main critisisrn of the manual is its lack of a reference section containing a summ ary of all single key control functions. Using the package for the first few tim es may be a bit frustra ting, since you will have to keep skimming through the text to find out how to access special functions while outside the main menu. The manual is, however. reasonably well or~an ized , with separate mai n sections dedicated w creating, updati ng, and printi ng a file. The text itself is generally understandable, but muddled i n some sections. I would rate the manual a 6 ou t of 10. As for the pro~ra m itself, it should fi rst be realized what Mailpro's intended use is. This packaRe does not have the features and flexibility of a full-blown database mana~e­ ment system, but it is not desif!ned as such. The documentation claims Mailpro to be a " simple to use but soph isticated mai lin~ list program approaching a full fl edged data base i n capability''. l t ~oes on to suJJ,gest that name and address lists are a "natural" application of Mailpro . For this nppl ication,

Chris Zamara Downsview, Ontario

Mailpro lives up to its claims, and certainly does everything you could ask from a mailing list program. Mailpro will not, however, generate complex reports and process data con¡ tained within fields, nor wi ll it do any sort of automatic updates on any records. Mailpro has all of the capabilities one can expect from a package at its price- around $70.

I told you what it doesn't do. Now w h at does it do? The mai n menu gives 12 options, including creating a file, entering records, recalling specific recor.ds, and setting up a print format. The file create editor allows ~ record to be set up i n the format that data will be enter~Ct (this is not necessarily the output format of the record). Tnls editor is very easy to use, and works like Word pro, allowi ng full cursor control. Labels up to 12 characters long can be entered, and the position, length, and type o f fi elds are defined. The label length limitation is not so bad, si nce these label s are on ly used as a reminder of which fi eld is which wh en enteri ng the data into each record. ''Add New Record" mode allows new records to be entered into the file, usi n ~ a similar free-form cursor ori ented editor to fill in the fields. A control key s ubmits~ record to the file once you are satisfied with its contents. ~

In " Recall a Record" mode, a specific record can be search ed for using any "sort" field as a key. The next record or previous record in alphabetic sequence can be viewed by pressi ng control k eys. Record~ can also be deleted and â&#x20AC;˘

IL--'Th :.:.:e=.li :::.r=c a ::.:; nMJ = ' .:.:: fo::.:r_ _ _ _ _ _ _ _ _ _ _ _ _ __ __c3 :o_4~--------------------

Volume 5 , luue 02 .

I


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

updated in this mode. Deleti ng or updating a record takes a while, but the slowness probably has more to do with the speed of the 1~ 41 disk drive than with Mailpro. Thr. fcnrurr. I w::~s most imprr.ssr.d with is the "Setup F.ditor" mot1c. Th~ sr.tup crlitor allows yon to r.nstom tililor thr. output of thP. rr.r.ords in a filr., and it givr.s total flr.xihilily. A sr.tltp file is created using a very Wordpro- like editor to position labels and rields an}"vhere on the print page. The sr.rr.r.n scrolls lr.ft ami right with the cursor, allowing text 11p to 1nO characters wide on a page. All record fidrls nlllst be rlefined as left or right justified, or compressed. Once a field is defined, scrolling over the field with the cursor will reveal the field type in a status line at the top of the screen. Very nifty. A heading of any number of lines to top each page can be provided, along with a page number, if desi red. Record numbers can also be printed anywhere 0 11 a page. Additional inforJIIation about the output records, such as width, height, how 111any anoss 01 1a page, etc. uut also be sup!Jiied frOIII this mode. Up to l~ ll 1-Jriut~::r Sâ&#x201A;Źlup fil es may ue stort:d along with a file. Overall, the output formatting is the most flexible and powerful feature iu Mailpro. When a<.:tuaily printiug records (IJy selecting "Outvut to Printer" from tht: main rmmu), uooleall ti&isiuus Cdll IJe made to selectively print records (inclusive, exclusive. inside a range, or outside a range). For example, you could IJrillt all records with the s~:com.l field IJegiuniug willt "z", or print all r~::con.l:s in settuem;e fro111 "a" to "l.". Tlu::re are many nice lillie features incorporated as well, such as giving a printout of input record formats or setup files, and the use uf default inforn1ation in entering records. Lots of features, however, also 111eans rernetnbering lots of cuutrol set~uences. or frantically scanning through the manual to find out how to do something. l suppose though, like any complete software package, it just takes a little more time to become totally familiar. â&#x20AC;˘

4) Disk operations ran <;omr.timrs knvc you wnirinp, a lonp, timF.. Mililpro acici<; rr.-rorcis to the file in !l b<ltch !lftcr you have entered all rcr.ords (up to 127 at <1 time), not one at il time as they an~ r ntercrl . The mnnuill states th<lt writing 127 reeords to a complex filr. r.ou lrl takc up to 2 homs.

If some' of the ahovc gripes sound like nit-picking to you , then that's goorl. They mr the th ings that bothered me most ahout using Mailpro. Some F.xcept ionally Good Points Worth McntioninR: 1) The "Setup Editor" for setting up thr. output form at is fantastic. It's very easy to liSP., and allows total flcxihiliry in formatting your output. The on ly limitation is a maximum length of 2~ lines for each mcorcl, but that shouldn't bP. <t problem in most cases. The fact that you can save liP to ten setup files with each fil e is also a nice feature.

2) Mail pro is designed to be compatible in many ways with Wordpro, and data from a Wordpro file can be tJsed to fill mailpro records. Conversely, the outrHJt from Mai lpro can be sent to disk instead of printer in a format such that Wordpro can use the data as variables. Thus, if Mailpro holds you r mailing list, you can print form letters to selective members of the list with Wordpro. The disk ot1tp11 t feature could also be used to transfer data from one Mailpro fil e to another.

3) The " Index" function gives a list of all Mai lpro fil es on disk, and nothing else, so you can use a disk with all kinds of stuff 011 it a11d on ly see what you need to from Mailpro. Overall. Maii!Jro is gout.l for keeping track of any household or small business lists you rnigiiL have, and great at generating fancy selective printouts of !he lists. It is fairly easy to use. and if you are fatuiliar witlt Wordpro, it's use is quite natural. For the price of around $70.00, Mailpro is a good buy. and may gel you lu finally do all of those things you wanted to with your computer, like store your recipes, record collection, telephone numb~::rs. ..

A Few Miscellaneous Uripes: 1) After certain operations, such as adding records, the dri ve error light remains blinking. The manual says this is normal. but it drives me crazy wondering if it is a serious error and l have lost all of the data I have entered {which happened to me once).

2) When creating a new file, an old file of the same name will be replaced without any warning. This could be disastrous! 3) As mentioned previously, the multitude of control features in different modes could be confusing. at least at first, and there is no summary of what does what in which mode.

The Transactor

35

Volume 5, 1uuo 02

]


PERSPECTIVE:

Elizabeth Deal Malvern, PA

To GET Or Not To GET. ..

How Useful A Trick?

INPUT or GET? Each is useful in its own way. Each needs to be used intelligently, match ing the best features of the command to the task at hand. Much was written about the ho r ror~ of droppi n~ ou t of INPUT on the PET when you ~m i ke Rf:TURN While this feature makes I PUT unsuitable for many serious applications, it is one of the nicest features in debu~~~n~ or in a quick run of a utility program: you can get out at any time. Consider the "improved" INPUT in the VIC or the C64 Unless you carefully code (see article v4 â&#x20AC;˘6 p36 , for instance) all possibilities (null entry, escape sequence) even for the most trivial , tiny, routine, you're stuck in the input loop. Porever.

guide, subsequently repot Led i11 COMPUTE and rnost rr.cently in The Transactor v4 .. 6 JJ:>7) JJUSl! hazanb of whirh you may not be aware. L.et's look at it a IJiL lllur~ dosely. rOKC 167 was meant to put the cut SO l on the scr~e u <.luring a GET-type of input. A little fiddling wi th litis trick shows that it only works 1n fonvard typing. You cau't <.ll!lcte/curr~l your input and you can't go up or down to. vcrhaJ.Js. iuJ.Jul from a different line on the screen. It leaves REVERSE FOOTrRINTS all over the screen at. seemingly. unJJre<.lictable moments. Useless. The reason behind the failure of POKE 167 is that t hen~ is much more to the function ing of a cursor than just switch i ll~ it on or ofr. A careful reading of the Butterfield memory maps, or even a superficial reading ol the IKQ s~rvke routine in the computer reveals that enabling a cut sur 111usl be done IN Ti lE RIGIIT PLACE and AT THE I<IUHT TIME. Poke 167 ignores that second, vital. cond1hon.

Prrss RESTORE/STOP you say? Sure. Now the screen is hli nrling hluC' so you type all the nasty POKEs to turn the blue off Utilities have disconnected, so you type all sorts of corlc to hook them up a~ain . Your carefully defined characrc-rs arC' gnnc, so you connect them back. The bit-mapped oisplay sC'tur is gone. so you poke some more. The sprites you hnrl on rh~ scrC'cn arc gone, you gotta bring them back. The intNrupt vector you chan~ed is back to normal. so you rhnnH(' that . An alternate BASIC lan~ua~e you con nected is gon~ . so yo11 hook that up ... some improvements we cou ld do without.

You may wish to look up an old 1ssue of CO~WUTE in which Timothy Striker addressed th1s problem and introduced a wo nderful routine which puts the cursor on the screen at t h~: right time and takes it off at the right time. It's well worth typing in. There is one typo there, but you shou ld be able to fix it after you understand the article.

UnhrC'aknhiC' input routines nre vital in many instances, of ronrsC' Mnny gnorl ones h t~v~ been written and are in rirrulntion . ThC'y nrC' nccrlcrl when the fcotures of INPUT do not matrh what you nC'~rl oonC' Most I'll PUT simulators use GET in somC' fnshion, wirh n grarhir chamrtl'Y used for the missing rursor. A wcll-{icsignrd GF:T routine is capable of trarking ynnr typing in nil oirC'ctions Other routines may ne<~d to prr.vrnt I hr. llSI'r from ly()infl, Si'ly, up or clear¡ screen. It all clC'pr.nrls on I hr. Oi[)()lirntinn . Rut tht" key feoture of goou routines is that thr.y work.

Last, but not least, don't forget that the old screen and keyboard inputs can do wonders. The pomt tS to use etther one as a file, as in: OPEN 1,0 or OPEN I ,3 ; INPUP' I ,I$: CLOSE! It flts numerous applications quite well and is machineindependent. IL is up to you to decide if you can get away with that or if you must go the. more complicated. but foolproof, GET route.

On the> orh~r hnnrl, rrirks surh ns thC' old POKE 167 (originally introdurC'rl, I hC'IiC'VC' in lhC' Oshorne's PET

The Tranaador

36

Volume 5, lnue 02


All About Commodore BASIC Abbreviations

Louis F. Sander Pittsburgh, PA l

Many Commodore owners know that some of their BASIC keywords can be abbreviated to ease the work of program entry. T hose who know about the abbreviations oft en don't use them extensively, because it's hard ro find them listed together in one place. Furthermore, they aren't all constructed in the same way, and i t's ha rd to remember the difference, for instance, between the abbreviations for RESTORE and RETURN. This article will end the confusion. lt provides alphabetized tables of all known abbreviations, including versions for all ROMs and charactet· sets. F'or folks just learning about Commodore abbreviations, it contains a tutorial on their use. Except for the familiar question mark used for PRINT, all Commodore abbreviations consist of one or two unshifted letters from the keyword, plus one SHIFTed one. Table 1 shows the screen display for keywords and their abbreviations when the graphics character set is enabled. Tables 2 and 3 show rhe same display when the 'lower case' character set is enabled for oriRinal PETs and for newer machines. T he keystrokes used to produce each toble arc exllclly rhc same; as long as the proper shifted and unshifted keys are pressed, ir doesn't matter what comes up on the screen. We have printed several tables only to make abbrcvinting c.nsier for you - use whichever one you finrl mosr convr.ni0.n1. We've also listed the BASIC 4.0 rlisk comm:mrls c;r.rnriltr.ly in Table 4. to keep th i n~s simple for rhosr. who c1o not usr. them. Now look closely at the tables and notice th!lt moc;r nhhrr.vintio ns consist of kcyworcl's firsr lr.trN, tmshiftN I, plus irs second IC'rtcr, c;hiftcrl . OthNs h:wr. rwo unsh iftNl lr.ttr.rs

before the shifted one; this happens where the first two letters of several keywords are identical, as in STEP and STOP. Some statements in the tables, (e.g. COS). are followed by a double dash. We know of no abbreviations for these, in spite of having searched dilip,ently for them. (Let us know if make any discoveries) and look carefully at the abbreviations for SPC and TAB. They are actually abbrev iations for 'SP(' and 'TAB('. If you put tA(20) into a program line, it will be interpreted as tab((20), and you'll get a ?SYNTAX ERROR when the line is exe<-uted. It's not widely known that many abbreviations also have longer forms. For these, you can type as much of the keyword unshifted as you'd like, then shift the next letter and stop. The computer will recognize your intent and fill in the blanks accordingly. You can verify th is for you rself by enterl n~ 'r-i-shifted-~' instead of the more familiar 'r-shifted- i'. and seeing that both forms produce a 'riRht$' whe.n listed. We hnven'r tested this on every kcy•vorrl , hut we hnvC'n't ever foun<l it ro !ni l. Now for somethinR about using the t~bbrcvint i o ns. They work equally well in direct or program morlc, ns most of l iS know from om r.xp~rienr~ \Vith '?' as usr.cl for PRINT. Usi ng th~m in rrogmm linr..c; dm:s NOT sav~ any memory, in spite of whM you mt~y hnv0. r<~arl 0.lsewhere. It only saves keysr·rokc.s :mel spncr. on the line originally entered . F:nter a short progrnm wilh , ;md then withou t, ahhrr.vial ions, PRINTing PRP.(O) ~ar h time to prove it ro yourself. When your mac.hine LIST.c; a program line that was entered with abbreviations, it spells the l<eywords out. in ful l. This

The Tro n5ac; t or 37 Volume S,-:..!.!!~~-' luue 02 '-__:c ··-----···-----···-··· ----·------------------------~-------------..!=~~


principle should also be familiar to anyone who has used a question mark as shorthand for PRINT. What may not be familiar is best illustrated by an example. Enter one 60-80 character program line containing many abbreviations. such as

If you entered the sam~ COillfltaml iu its abbreviated form, the character you lyp~ willi t h ~ shift key will have a valuP exactly 128 greater than the sa111~ dtaraclt!r 'un-shifted'. The mterpreter detects the 1~8 diff~rt!uce ami 'thinks' it has come to the end, so go on to lh~ uexl step.

I0 a - 5:?a:?a:?a:?a:?a:?a:?a:?a:?a: ...

lnotherwords. it doesn't nlallcr which character is responsible tor the 1~8 difference wllt!ll lh~ m rupare is perfonnr.cL See Mike Todd's article. " Huw BASIC Works" for more details on this anomaly.

Be su re the line you enter fills most of two screen lines (one for 8032"s, four for VJC's). Now LJST your program. Surprise! The long line now fills far more than 80 spaces on the screen. RUN your program and observe that it executes perfectly, even though it seems to exceed the SO-character limit on line length. You can use this idiosyncracy to your advantage when trying to pack a lot of statements into one line. If what you want doesn't fit, just abbreviate some of the statements, so that the abbreviated line fits into 80 spaces or fewer. When you LIST the line, it will expand enough to spell out all the statements in full, but it will RUN perfectly. Do not attempt to edit any of these long lines after they have been entered. The screen editor will enforce the SO-character limit as soon as you use it, and you r line will be truncated to 80 spaces on the screen. If you fail to allow for this, you"ll find yourself puzzling over vanished parts of your cleverly-squeezed-in proRram lines. That's about all there is to know about keyword abbreviations. Knowing about them has made my programming life a liule bit easier, and my fingers a little less fatigued. I have fastened a copy of Table 3 to the front pa nel of my PET, where it serves as an easy reference to the abbreviations I hAvt>n"t committed to memory. If you do the same, you路n bask in the' benefits of usi n~ abbreviations.

The general rule ol thumb. lhou~ h . i:. lhe fi rsl l~tte r followed by the sh1fted second letter. unle:s:. lhi:. matches something else ftrst. then tl's the shifted third letl~r. Two character commands like IF and FN have no abbreviatiou. Recall I said this 'feature' is actually a IJug. K~lly. the e<.lilur should force you to type the entir e keywur<.l (exceJ.!L ? for PRINT). Try entering a keyword with the LAST character shifted. Try for example: 10 nexT Since the last character of 'nexT' will have the sante value as the corresponding character in the table. no rnalch will he fou nd. The interpreter enters 'nex' onlu liue 10 as though it were the beginnmg of a variable. The shifl ~u 'T' is lost because the editor doesn't allow shifh::d lullers uut:sid~ quotes (except on REMark lines, another anomaly). Once you know how the keyword table is constructed, all kinds of neat (but useless) tncks can be played. lu the keyword table, "NEXT' is trnmediately followed by 'UAIA'. Try entering:

Editor's Note The abbreviations phenomena is actually the result of a bug!

A quite harmless bug, but a bug just the same. Each k~j'\.,.ord is held In ROM in a 'table'. The table is simply each keyword spr.ll ~rl o11t, one after the other. Naturally, the interpr<'IN must know where one starts and the next begins, so the last letter of each keyword is OR'd with 128 (ie. Bit 7 S<'l)

When yoLJ ~n t er :1 rommand in its long form, the interpreter begins compAring lcners to those in the table. The inter路 pret<'r rontinue.c;; romparing 11ntil n mismatch is found. Assuming it wns spPIIcd correctly, when the interpreter gets to comparing the lasr letter, there will be a difference of exactly 12R. A difference of 128 (Rit 7) siRnals the interpreter that a complete match has hccn mnc1~ . so go on to the next

10 nexTdaT The interpreter finds the 128 diflerence on comparing the second 路r-. The string is replaced by the corresponding token, and LIST will show;

10 next Try adding:

20 returN 30 gosuD Now LIST and see if you can tell what the interpreter has done.

Sl~p .

IL~ nN ~J~~ ~ nM ~C~ to~r________________________________ 3 8

Volume 5, lnue 02

J


Table 1 ABS

D H1

INP UT# 1/

ON

END

JNT

UP£ N

RND

AI A/

AS C

A.

r >;P

L E FT $

ATH

AI

H•

LEN

FOR • FRE

LET LI ST

LL...,

PQI(E

LOAD

U"

PRINT

O IR$ Cl CL.n SE ct.r

CLR

CL

GET

CMO

C' ,

emiT

cr

GtT# GO SUB GOTO IF .

CQS

DATA DEF

~- --

l

OR

INP.UT

p-

TAB(

T+

TAH f I

T IW tl

SAVE

s•

TO

SGN SIN

Sl

USR

5 -,

VAL

u• v•

'., I

VU~1 1- Y

v-

PRINTft

S P C( SQR

Se

WAIT

Wf!

PEEK

I. OG

--

Ol

RIGHH R.., RHO R/ RUH R,

Pr

cr-·

J1I li$

M,.

READ

STEP

NEW NEXT

--

REM

tr

RES TORt

STOP S TRS

HIJT

1-lr

RETURN

SYS

R I GHTS R l RNO Rn

TAB( TAN

Ta.

RUN

Ru

SAVE SGN

Sa. Sg

THOI TO

H --

USR

U:o

5T H

S i

VAl

V-.

Sp Sq

VERIFY Ve

sr

S l

Table2 ABS

Ab

Ul N

r> i

I NPUT# I n

ON

flt~D

A11

DID

En

OPEH

ASC ATH

Az

f:XP

Ex

HIT U:FH

At

FN · FO R •

CHR$

OR

PEEK

L EH

LET LI ST

F ,,

Ch CLOS E r.L o CLR Cl CMD Cm

GET#

CONT cos

Co

GOSUB l..Os GOTO Go

DATA

Da

OEF

[)~

-

LEf

FRE GET

Fr

Ge --

LOAD

1

Op

--

L.e U

P OKE P OS

Lo

PRINT PRIHTit

p,..

SPC< SQR

Re

STEP

Sh

s ·r uP

st

STR$ SYS

STr

LOG 11T D $

Mi

READ

-Ne

RLI1

IF

NEW NEXT

INPUT --

NOT

No

.

')

..

RESTORE REs RETURN REt

MAlT

Wa

S~:~

TableS

...s

dim

dI

input# iN

011

and

a.H

t'nd

o?H

t nt

open

.I<SC

aS

E' X P

i'

atn c hr $

aT

fn

.... H

f o r·

fO

ht

C I OS I!

Ire

c 1r c: md

cl O cL cl'l

get

fR qE

9 <> t tt

--

r.:o n t

cO

qosu b

g Q$

9ot o

gO

c os iiilt .~

do;i

·1 A dE

I

f

i

TI P IJ

t

--

tA

tan

--

ru n

rU

pE

t H

s a v<>

sA

t ""' n

p0

S<JD

sG

to us r

us

st n

s l

,;:pc(

.,. p

" '" \

s .q r :. te p

oP

--

leF

or

lE

P1"9k pnkl'

lt.; t

l 1

P OS

load

to

prin t

"')

p r int#

pR rE

left$ l e 11

X

tab <

d

rl r-N

ri ght $

--

--•

loq rni<J$ n ew

mt

TIE!' '>I f'

no t

t" ll

re m

stop

nF.

n: ::: t o r e rt?5

s t r~

s G! st;E sT s t 1-<

nO

r .. lurn

~Y S

sY

r,.a.d

r·e T

vA •.Jerif<J v E

wa.it.

mfl

Table 4 APPEND

AI

COPY

BF;Cit: li P

B.

CGLL[ CT COL.

[1C L OSE 0lH RLC T ORY 01._ DLO RC• DL

CCJNCAT

DOP E ~>!

L l~

I H L U I.> t.: f!

COl

(•i

DSAVE HEADER

D• H-

<> Pil' E:' Tid

aP

t.. '" '- k uf'

bA

RECORD

RE -

c atal o q

cA

J< rt lllMF

"'[' - . .'/

...

r: .1ll,.;t' t t'l i

coP dc. l;) S~ dC d i r& c t o 1"'.1 d i R n 1 , , .; n ·1,

SGRAE.H

~-

r:onc·.t:

d ·)P E-n

-

--

co:-u

;jCJ

d~a v·s:·

as

h >? :.1. rj ..- r·

hE

r"o:ort!

r~ C'

a· o? 11 .~ m.:. s c t· .a t c:

;· ~ H

n :; c.


How BASIC Works

Mike Todd

Kent, England

replaced by diagnoslic routines which arc of very limited use to rnust owners. Therefore, a MLM progrt~m han to be loaded iutu RAM to obtain this fariliry. Lik!!wis(' on the VIC and 64, however <:artridges are available too that contai n this progra111.

Mike Todd is a member of the Independent Commodore Products User Group of England. Tfus article originally appeared m the club newsletter some four years ago. Essen· lially not much has changed smce /hen. Commodore has added here and taken away /here, but the fundamental operaliOn of all their machines (excluding the 8 and the new 264) is still the same. You m1ght consider having your memory map on hand as you read through this article. As you become more familiar with your machine you'll find that writing new and more complex programs becomes easier and easier. M.Ed.

At the heart of the machines is the microprocessor which ar switch-on starts to execute the ROM software at an address placed at the end of ROM (SFF'FC/D). This routine initializes all registers, in!)ulloutput chips, BASIC pointers 11nd vectors (a vector is an add re~ ht:dd in RAM for f1rture u~ and which • ipdicates the entry point of a routine held somewhere in memory). It clears the screen and checks RAM by writing a number into every localion and confirming that it is rr.11cl back correctly. It does this twice for every loc;1tion ancl :\5 soon as il dete<.is an error it a'isurnes that it. has run out of RAM and sets the end of RAM pointer accordingly. The greeting messiJtle is printed using this inform11tion to indicate the number of bytes free. Then the READY message is printed, the cursor is flashed and a holding loop is enrr.rcfi wailing for you to type something.

It was difficult to decide at what level to aim this article, and I have attempted to keep it fairly simple (and consequently omit a lot of detail - for which I apologise in advance). The only requirement is that the reader understand the princi· pies of machine code programming and have some knowl· edge of simple terminology such as RAM, byte, stack, hex notation and so on.

The Inside Story Inte rrupts The firs consideration must be to sort out the organisation of the massive amount of software m ROM . There are three main divisions:

While waiting. the microJJrucessor is far from idle. Every I / 60th of a second, a pulse is generated and fed to the lnllmupt R~quest pin (IRQ). When the pulse is received, the 6502 (651 0 in the 64} stops whatever it is doing, saves the status register and returu atldre~ and starts executing code at the address given in SFFrE/F. Th is routine saves the registers, do~s some huuseke~ping and then uses the IRQ vector to jutii!J to the main interrupt routine. Since this vecto1 is in RAM. the user {;au alter it to point to his own interrupt routine - the only reslridion being that it should end with the same code that the regular interrupt routine uses. Here the registers are restored Lo their previous conditions, followed by a ~eturn fro111Iuterrupt instruction (RTI).

I) The Operating System - is the section of KOM dealing with cassette. keyboard, screen and IEEE input or output. It is written specifically to match the hardware. 2) The BASIC Interpreter - written by Microsoft, this is tl1e program which allows you to write lines of program, edit them, and execute them. It was onginally written in general terms for use by different computers and is customized by Commodore for use on their machines. In fact. most of the interpreter is identical to that in other machmes such as the APPLE..

The first task ot the main interruvt routine is to e.xecute a subroutine that updates the Tl clock and sets a flag if the STOP key is pressed. Bypassing t11is subroutine (by changing the IRQ vector to enter the interrupt routine just beyond this JSR) is one of the ways in which the stop key can be disabled. I lowever. this also stops the Tl clock.

3) The Machine Language Monitor- although not really part of the normal operation of the PET, this program provides facilities for manipulating machi ne code programs using hex codes and for saving and loading machine language programs from disk or tape. On OASIC I PETs. this is

I

TheTran.;ctor

-

40 •

VoluMe 5, luuo 02

I


- - - -- -- -- - -- - -- - -- - - - -- - - - - - -- -·-·-- - - - -- - ------, The inrcrrupt routine then looks alter the cursor on the screen: if a cursor is requir~ (fl~h cursor flag "" 0, see your memory map) a countdown is maintained and on every 20th inrcrrupt, the character under the cursor is inverted, making the cursor flash 3 tin1es a second . The cassette h11ttons are then checked a11d the motors turned on or off as required. This is n ec~sary since the motors are totally under software control and need to be switched on and otr to allow wind or unwind to function correctly.

RESET Initialize Input/Output Registers

Set u p Variable Pointers, etc.

Finally, a11d probably tile most important interrupt function, the keyboard is scanned and if a key is pressed, the ASCII value fur the key is found in a table and placed in the keyboard buffer. This buffer is I0 bytes long (which can be altered in most models), and a count is kept of the number of characters in the buffer. If this count goes over 9, the buffer is full and the interrupt routine stops accepting characters. By holding characters in this way, the user can type while a program is executing some task. Then when the program comes to an INPUT or GET statement (or direct mode), the keyboard buffer empties its characters onto the screen ready for use.

Test RAM, Output Number of Bytes Free

Print 'READY.'

Get charactPr and put it tn buffer

character -

Tl1is process continues nearly all the time. However, an instruction is available (S£1) to turn this interrupt off and this is done now and again whenever time is critical. In addition, cassette input and output uses a different interrupt facility and keyboard servicmg is bypassed altogether.When the cassette has finished with the interrupt, it restores the vector. In PET/ CBMs the vector is restored to the main interrupt routine, which means if the user has altered the IHQ vector it wilt require "re-altering". VIC and 64s restore the vector to its previous location even if it was altered by the user.

'Return'?

YES Uow many characters'?

SOMC First char

a dig11'?

R~ad

Crunch Keywords to BASIC Tokens

Line Number

Find Line In T~xt and Delete it.

First Byte a Token?

Any Text Following Uue Number

YES

NO

Perform 'LET'

Crunch Keywords to BASIC Tokens

Perform Command

lnsert iu Text

The Traneactor

41

-

--- ----------:-:-~------.,

Volume S, luue 02


• .Ready and WaiUng

Armed with this information we can now rejoiu the maiu holding loop just after KEAOY ha~ beeu priute<.l out. The first thmg that has to be done is to accept d rdraders from the keyboard (more precisely, from the keyboard buffer) <mtl print them to the screen along with a lla~hi u g ~ursor. Wlteu you press the RETURN key, the chat acters un the st:reett are read one at a trme (by the subroutine at $FFCF) and placed in an 80 character input butfer for analybiS. This cuusists of a check for a digit at the start of the line which indicates a BASIC program line- a non-digit at the start would be takeu to mean that the line was a direct command. If the line rs a BASIC program lme (and ol course that includes a null hne which indicates a line to be deleted from the program). the number at the start of the line is read aud converted into an integer of two bytes. The remainder of the line has the keywords identified and converted into single byte tokens, and then the entire line is inserted into the BASIC program. In actual fact. BASIC is searched for the line number given at the start of the lrne. That line is then deleted from the program. If only a lrne number was given the routine returns to the holding loop. If the hne number is followed by text. it is inserted into the program 111 RAM as a BASIC line. Since the remainder ol the program nrust be "shifted" up or dow n in memory to accommodate tlie alterations, another ROM routine is called that regenerales the lin k addresses for the entire BASIC program. The link address is simply an address that tells the system where the next line or BASIC text rs located. £very line has a link address. This allows the interpreter to skrp over lines. for example, when a GOTO is encountered. This way the interpreter can look at the line number. compare it to the target line number, and jump directly to the next line if they don't match. Imagine the time consumption if the interpreter had to look through the entire line to find the next line number. Also, when insert ing or deleting lines, the editor can determine immediately how many bytes to open up or take out. Although these links consume memory. the advantages are well worth the 2 bytes. Direct command lines (with no number at the start) also have keywords changed to tokens; however. the BASIC program pointer is altered to point to the input buffer instead of the BASIC program, and the line is then interpreted in exactly the same way as a normal program line. Let's return to the keyword to token conversron; th1s is quite a time-consuming task - one reason why it is done when the line is entered and not during program execution. IS the delay during a run would be intolerable. The other principal

.. a one byte token saves

reason is onl' of space saving ' several hytl'~c; ovl'r keywords such as " RESTORE"! All these keywords are helct in n rnhle startinf.! near the beginning of ROM with the last charactl'r in each havinf.! bit 7 (the most siguificant bit) set to 1. Thr ··crunch'' routine, as it is so111etimes called, soms the keyword table character by character for a march wi th the .first character in the text. Wlte11 th is is fonnci, succcssiv~ characters are checked until a lllislllatd t occurs. and if this mlsmo tch is only bit 7 then a cont[Jlete keyword has hcrn fou nd and is replaced in the Lexl uy a token generatC'ci from a pumber givi n~ the table position of the keyworci with hit 7 set If the mismatch is other than bit 7 then the prorrss is repeated through each keyword i11 the table and if no mntch is found. the next character i11 the text is usect as thl' startinH point for the next table scau. Tlte fact that a mismatch in hit 7 is all that is required to Lenninate the checking seqnf'nrl' givrs us a clue as to why keywords carr be shortened. For instnncc "nE" can be used insleau uf 'next', since the 'E' is thl' same i1S 'e' but with bit 7 set arru this forces the match to ml' mac1r But, of course, the match will only be valid for thr first match in the table thus, 'rrext' occurs bclorc 'nrw' anc1 \Viii he the first match for 'uE'. Si111ilarly. 'read' orcrrrs before 'restore' and will be ret:ognised if "rE" is used - rl'~c;lo rr would have to be auiJreviatetl to 'reS'. Tire IIIUSt im!Jortant direct r.ommanci wh ich will be interpreteLI is tlte RUN command, for this is the command that irrstructs the interpreter 10 stan l'xecutlon of the BASIC prugra111 that you have built up. Thl' interpreter checks to ~ee if you have given a linl' numhl'r, anc1 if you have, performs a CLR followed by CiOTO rhr line number specifieLI. Otlterwise it resets all pointers 10 thl' swn of BASIC text, adivates a dear and then retu rns ro thl' mnin interpreter which uuw has had its pointers reset , ancl rxccu tion starts at the begi11 11i11g uf the program.

The Interpreter

The core of the iuterpreter first chrrks if thl' stop key is press\!d (iu wlrkh case it performs thl' STOP command automatically). It then lraullles the BASIC. linl' poinrrrs; it checks for the end uf lhe [Jrogri:llll (which is markeci hy lhrrc consecutive .!ero bytes) a11d exits if found; it also hanciiC's thl' occu rrence of tile end of a line (a si 11gle zero hyte) hy movinp, the poi nte1s past the liue tiU II tber a11d forwarc1 pointer of the next lint:. The ~ I art of tlte curreut st ai Prn r~nt is savrcl (if not in direct mode) :,u that CONT will k11ow whPn' to pick up from if execution is slovved fur any reasou.

c==~~an~cto~r___________- ______________________4~2~----------------------------~~= ol~u~m~•~5~1~1•=•=u~ • ~0=2~


A

OO .W .

(

- ·---.;r:

J::xe<:ute _Loop

=)

~opK~....

YES

'"'-.._ Pressecl?

a pointer which is incremented as soon as the routine is entered and then a character is retrieved from that location. If the character is a colon or a zero-byte (both of which signify the end of a statement) then the zero (Z) flag is set - if it is not a digit, the carry (C) fl ap, is set. If the character is a space then the routine ignores it and reads the next non· -space character.

Perform 'STOP'

End of

Getting Characters

Line?

This routine, which starts at $0070 ($0073 in the VIC and 64), is often referred to as the CHRGET routine (pronounced "char-gl:'t") and, being placed in RAM, is easily modified to allow additional commands to be added as in the Program· mers Toolkit. Other user functions can also be imple· mented, and a variety of techniques are used to patch into this importan t routine. As well as using the CHRGET routine at $0070, the interpreter will often enter at $0076 ($0070 in VIC/64) instead. This entry (somet irnes referred to as the REGE.T or CHRGOT rou tine) does not increment the character pointer and is used to fetch a chMvCI('r from text that the interpreter already GOT once and needs to GET ap,ain .

YES

·'""-

End.of

~Y ES

Program'/

Per!orrn '£1\ IY

NO Get Next 1.i n~ Nu mher

I

Set Poilllt!r to Next Line Execute Statement

Variables Flowchart Of The Main Execution Loop It is also worth exa mining how BASIC stores its variables. The simplest arc the ordinary numeric variables. These are storcrl nt the end of BASIC 'text, cnch tnking seven bytes. Without describing the complex technique of " offset expo· ncnt, normalized bi nary floatinp, point" storage, it is worth. poi nting out that all numeric operations are performed in this formal. Rvcn i mcgcr vnriablcs (stored l n two byte fixed point formnt) nrc converted hack ro floating point whenever they arc ac-ccs!;crl . There is .1 flonti ng point <lC<'urnulntor in RAM c.onsisting of 6 hyt r~~ - thl' first is the exponent, thG nrxt 4 arc- thr mant i s~O'l . <1nrl the 6th is the sign which is rccovcrcxl from the storccl form of the number. There ,Jrc adrlitional floating point accu mulators which arc used as workspace when eval11ating expressions. The principal ncc.urnulator (FPACC* 1) stores intermediate results and is also the ar.r.urnulator upon which the trigonometric funr.tions operate .

Tokens The stntcmcnt is I hen intcrprN~cl. H er~ . the fir~r hyte of the line is chcckC'd to sec if it is a toi<Pn (ic. if hit 7 ""' 1). If it is a valid command token {and not something like SIN or TH EN), bit 7 is removed, and the resulting numhN (which is the position of the kcywor<i in the tahlf~) i~ u ~ccl to access the start ~ticl rc.c;.s of th~ r.ommnnrl rout ine from a table of addrC'sses in ROM clire<'.tly above the keyword table. T he interpreter thcn jumps to the approprinl0. rou ti ne. It the kcyworo is GO, then a chcd< is made for TO (since fiOTO is the only kcyworcl that r;:m he split into two words) and if fmmcl, the (;OTO routinP is P.ntered. If the first byte is not a keyword , tlw interpreter assumes that a 'LET' operation is rcc1uirecl (since LET c:an of cou rse be omitted) and I he LET routin~ is 0.ntcrt"cl. Anv invalicl start to the line will result in • the interpreter pri nting the SYNTAX ERROR message, flagging that an error has occurred, and then entering the main holding loop after printing READY.

Numbers in arrays are stored in a similar format (except that integers use only two bytes instead of seven and floating point numbers five instead of seven) - l>ut there is a header to each array which contains the array name, the number of bytes in the array and information about the dimensions of the array. However, these are stored after ordinary variables wllid t rueaus that every tillle a new ordiuary variable is ud ine<.l, the eutire array table has lu IJe shifted up severt bylt!S.

Everything else that the machine does is under control of the keyword com mand set and consequently some of the more important commands will be examined in detail. However, all cmmnands requ ire the aiJility to retrieve a charader from lite BASIC program text dlld t1 ruulintl is !Jruvitled S!Jeci[ically fu r this purpose. WithiJJ this rou tine is

43

Volume 5, I awe 02

]


BASIC RAM Memory Allocution ~ASIC

0

'I't!XI

Elltply s)pat:~

Vana lJI1:! Tault::

Arrays s>pat~

t Start of Variables $2A,2B $2D,2E

t t Start of Arrays End of Array $2C,2D S2E,2F $2F,30 S3 1,32

s, In ng .;pace s

000

t Stnrt of BASIC BASIC 4/2路 $28,29 VIC/C64 : S2B,2C

t t Bottom of Strings Top of Memory $30,31 S34,35 $33,34 537,38

BASIC Text Line Structure

I0 I L IH I L IH IIi ne text

t f'nc1 nf prf'vious lin拢'

t

t

j 0 I L IH I L IH IIi ne text

line" '--- pointer to next line - - J

Variable Contstruction Floating Point

ININI t It rnshI I IshI t ( N) exponent ... 128 narn~

Integer

[JjJ jH IL!o lulu l name' (JJ %)

V;)IIIC

I tntiSC'c1

[s [u I name (SGS)

String

I L I H Io I o]

rt

t

start address of string length of string in bytes

Strings arrays. Ordinary string variables are also stored in seven bytes, although only three are actually used for string information. These three bytes are called a string descriptor, with the first byte holding the number of characters in the string and the other two the add ress of the first character in the string. If a string is defined in a program (e.g. A$ - "TEST STRING"), the string is already in RAM and the descriptor will point to the characters within the text area. However, as soon as strin~s are manipu lated they need to be stored somewhere else, otherwise a strin~ operation could actually corrupt the BASIC program text! . This problem is overcome by usin~ the empty space after the nrrays. But since the arrays are moved up each time a new variable is defined and of course the end of arrays will chan~e if a new array is created, stri n~s cannot be placed immediately after the arrays. If they were, the strin~s would have 10 he movf'c1 up ns variahlcs were created, and all string drscriptors modificc1 accordingly- a mammoth task. lnstrad, strings arc huilt stnrtinR at the end of RAM. A pointN is set to the end of RAM, and whenever a string is created this pointer is moved down by the number of characters in thr st ring anc1 the strinf! stored starting at that point. llnforrunntP-Iy, if anothrr st ring is c1cfincd, this pointer is moved down yC't ng;1in , until it rcnrhrs th ~ rnc1 of rhc

[

The Transactor

44

Garbage

When this pointer crashes mto the top of the arrays, there are two alternative solutions. The first is to abort and print an OUT OF MEMORY error- a defeatist answer!. The other solution assumes that there will be strings in this area which are no longer of use- in other words the origmal descriptor for that string has been changed because the variable has been redefined and has therefore been rewritten elsewhere in the string storage area. Thus the string storage area contains garbage, and so a routine, referred to as "garbage collect" is invoked to weed out all those unreferenced strings. It does so as follows: A pointer is set 10 the end of HAM (and so the top of st ring space)- all string de criptions are checked (in both ordinary and array string variables) to find which pointer is closest in value to this garbage collection pointer. The position of the final character of the string is calculated by adding its length to the start of the stri ng and the string is moved up to fill any unused space- the string descriptor is then updated and the string space pointer moved down to the start of the string. All strinp, variables are then cheeked for the next string

Volume S, l11ue 02


------~--·-·---·--------------------------------,

descriptor below this pointer aml tit~ same pruce!is repeated until all strings have been checked aml111uved up to take up the space occupied by the garl>age thend.Jy rdeasiug space for more strings. Only when the garbage collect ruutiue f<tils to release enough space does the OUT OF MEMORY error

oec:ur.

CHH$(10)- liue feed- is iguured wtteu sent to tape to avoid it interfering with tile uata v.•hen is is read back. Whenever the $Ft'D2 output routine is called. it is assumed that not on ly has $130 been set coned ly, bulthal a channel has been opened to the cassette or IEJ::E bus. This ensures that IEEE or cassette protocols have been observed and the data is sent to a valid device.

In other words, the striug space is sca nm~d from top to bottom; all uuused strings are deleted and all used strings moved up to overwrite tlu:m1.

Keyboard

MinuteK or Hours

In a similar way. there is an input routine at $1-'FCI-' which

Unfurl uw.tldy, if a la1ge number

or strings are being used

(especially if a lcuge string array is ddined) lheH lbe garbage collect ruuti11e has a lot of work to do. Fur instance. if the o11ly strings in use are all the elements of a 100 element array, tlieu tile slring space will have lUO strings in it and there will have to be 100 searches l hrough all string descriptors - i:lmuunling lo 10000 descriptor checks! II there are mure tll<m 1000 strings then ovet a million checks will have to ue tlor'ie as w ~lt as I 000 string moves and updates - no wuuclt!r garbage collect can take several minutes (or even huursl! !). BASIC 4 (which is supplied in the new 4000 and 80()0 series PI::Ts and is available as an upgrade for older PETs) ll <:~s solved this p10blem by adding two bytes extra to each string; these are used by a much improved garbage collection routi ne to an acceptable level.

Input & Output 1:3efore going on to consider a lew BASIC commands, it is worth considering how the operating system handles input and outpu t. There are three main types of output routines directing characters to the screen, the cassettes or the IEEE bus. All have their own separate routines, but can be accessed through a single output routine at $FFD2. This routine checks the contents of location $80 ($9A in VIC/G4 - olten relerred to as the CMD output device number) and uses th is to access the appropriate output routine. If set to device number 3. the screen output routine is used. This routine handles all ASCII characters (i ncluding d ear-screen, cursor movements etc.) and places the character on the screen. updat.mg the screen pointers.

IEEE Management If the CMD output device is greater than 3 then the IEEE handshake routines are called, while any other value is assumed to be a cassette operation and the character is placed i n the appropriate cassette buffer. The buffer pointer is incremented and if it is 192 the entire buffer contents are w·ri tten to tape and the buffer reset. It is worth noting that

uses SAF {$99 on VIC/64) to indicate the device number from which input will be taken. If it is zero, then the keyboard is taken as the input device although strictly speaking the input is taken from the screen. As soon as the routine is entered {and $At.. '!':' 0), the cursor is set flashing and the current position ot the cursor logged as the stal'l or the line (thereby avoiding any prompts being accepted as part of the input). Thereafter characters are read from the keyboard buffer and placed on the screen until the KETUKN key is hit at which time the routine is !eft , returning the fi rst character on the line. Subsequent calls to the routine do not set the cursor flashing, nor do they allow fwther input to be accepted. Instead they retu rn successive characters on the li ne until the last character is read. The next call ol the routine starts the process over again. Like the output routine, the input routine assumes that all necessary protocols have been handled (normally through the OPEN command). Characters from cassette are read from the cassette buffer until such time as the buffer pointer reaches 192 at which time the next data block is read from tape. Alternatively, the IEEE routine simply handles the necessary handshaking on the IEEE bus. Error Messages

Unfortunately. this is not the full story, since there are occasions when output to the screen has to oe suppressed. A flag exists which is used to suppress screen output This flag is at $10 ($13 in VIC/64) and contains the logical file number of the most recently accessed input and output files. Therefore if $10 is zero, both input and output are normal and this allows INPUT error messages for instance to be printed. If either is off normal (i.e. if an INPUT"' or PRINT*' command has just been obeyed) then these error messages a re suppressed. Alt hough mention has been made of the INPUT routine at $FFCF, there is another routine at $FFE4 which collects a single character from the specified device. In the case of cassette or IEEE input this is no diHerent to the usual input

·- - - - -·- ·-··-· -------'


.--- -- - -- - -- - -- - - - -- - - -- - - - -·----------------

. - - - - - - - - - - -- - - - ,

In the case of uu111eric results, the final result will be !Jiacetl

routine. But for kcyhonrc1 inrmr il has the effect or GET where only a single charllctcr is fctrhed frnm the keyboard buffer. no cursor is flashed nor are the tyred characters placed on the screen .

in the main fl oating point accu mulator. Tile result is then converted to 1he appropriate form fur storage (e.g. l11e floating point result converted to a11i11teger) aHd the11 storeu at the target variaule locatiuu.

LET Command FOR- NEXT The first BASIC commanc1 to he considered is the LET command . As <Ji rr.:-~rly mcntionr.c1, this is the only time wl1 ~ 11 a statement does not need to start with a keyword token. Althou~h in principle the command rou ti ne is very simple, the evaluation of the cxprr.ssion on the right hand side of the equal si?,n is extremely complex and the details cannot be described fttlly hr.rc. Any standard reference work on computer compilers will dcsrrihr. rhr. tN~hn ique or evaluating arithmetic expressions.

The next COIII!IIaltu to IJe exall tilled is the FOR con unaud , wh ich together \vitlt NEXT allows i:l simple mellwd of IOUIJ cuutrul. As with all other commands, FOR has its own rou ti11e and its first task is to JJerfonuthe LET routine on the FOR variable. This sets the iuitial cuutlition fur the luuv. The stack is the11seart:hed to find if there is already a FOR loop active using t!te sa111e vari1:1ule. lf tl1ere is, lheu it and all FOR IOOJJSuedared after it are uel ~ ted front the st a~.:k .

The firs t task of the LET routine is to ascertai11 which Arter check.iug to see if the stack can hold the r'OI< en try (if it variable is the tnrgr.t variable on the left of the expressiuu canHot, all OUT OF MEMORY error is [Hinted), lhe text is and then sr.nrr h the variable table or array table fur it - scaunetl for the start or the next BASIC statement after the setting $44/f1 ($47/~ in VIC./n4) to point to the variable. If . FOR command and the pointer lo this statement and line not found , th ~n i"l routine is called which creates a variable llulllber are JJUShed unto the slack. The routine then con(or Mrny) as rC'qi Jircd . ln additiou, a note is JJ tatle at tltis finns Lltat "TO" is tile next token in Lhe text and the ex!Jre:>siuu following it is ~valu ated. The resu ll (the final point of the variable type. value fur tile loop) is then JJUShed unto the slack. Next. the After ('On firming that " =" follows the variables, the inter- text is cltecked fur l11e STEP tuken and if present, the STt:P preter enters n rou tine which evaluates the expression after exJJre:>siun is evaluated. If STt:P is not present the STEP it. This rol ttinr. is made more complex by the need to handle value is set to I . The sign or the STt::P value is then placed on the stack follo wed by the absolute value (ABS) of the STEP. string expressio ns as well as numeric exJ.Jressions. The pointer to Lhe 1-"0f{ variable is then pushed onto the To evaluate an expression, il can be cousith=reu c.s individ- stack a11d finally lite FOR Loken {$91) is pusl1ed on the slack ual terms (i.e. a numher. a variable or "pi") seJ.Jarateu l>y as a marker. opNators (such as + - / • etc.). The expression is scauued for the highest priori ty operator - Ute expuneuliation operator - The interpreter continues execution of BASIC text until it and the terms either side or it are J.Jlacetl in the two main reaches a NEXT command. If a variable is specified, th e floating point accumulators. Hone or the terms is a brack- variable table is searched lor and the pointer to the variable eted expression, the ev1:1luatioll ruuti11e is re-en tered to comparee! with the variable pointer of all FOR entries on the evaluate the expression in IJrackets. Tlie11 lite exvunentia- stack. If not found then NEXT WITHOUT F'OR is printed. If tio n routine is caJied and tilt! inlt:lrn tetliate r~::su ll saved on found, then the current value of the FOR variable is rethe slack. This is tlune fur all overators working down from trieved from the variable table, the STEP value is added and the highest JJriority to the lowest priority (addition) which the resu lt compared with the TO value. If greater, the FOR will result in all operators being assigned their correct order entry is removed from the stack , together w·ith any GOSUB or FOR entries that were declared after the current entry and or precedence. Experts will poi 11L out that this is not precisely what hap- execution continues normally. pens, but it serves as cUt example. In l'act, the process is sig1tifica1Jlly mur~ cumJJiex tllan this but the lundamentals However, if the result is equal or less than the TO value, the pointer and line number are taken from the FOR entry on are the sdme. the stack (they point to the first statement following the FOR St ring expressions are evaluated rather more simply, with command) and execution of the program is resumed at that ill Len lletliate striug results being placed (in descriptor form) point. If the STEP is negative, it is subtracted from the FOR on a Jescrivtor stack until a final descriptor is computed. variable. and the loop terminates if the new value is less Tile result is passed back as a pointer wh ich points to the than the TO value. final descriptor. -

1 The Transactor

''

"

46

____ _ ...

.

Volume 5,1nue 02

I


- ------

command. The OATA command routinr. is then enter('(! which scnns to the enrt of the cu rrent statcmcnt, urclatcs I he pointers aceorclingly ann resumes r.xec:ution at that point.

'FOR' Stack Entry

LO

Pointer to first

HI Ill

statem~nl

----

-LO -

--.

'

in loop

Line number of fi rst

CONTINlJF.

stntemcnr in loop CONT is another routine which updates the program pointer (which is the pointer held in $77/ 8 iu the CHRGET

M4

M3 M2

--

routiue). This lime, however, th ~ rrew valu~ is r~lrieveu from $3A/B ($30/E in VIC/64) where it was stored wheu the program was stopped. Tlte couleuls of $38 are fi rst checked to see if il is zero ·· if it is theu the address pointed lu • must be $00xx and the last <:U illllld.lld !HUSI have ue~ll a direct curBmarrd (if au error occurs s:m is alsu set to zero).

'TO' v:-~htc

Ml

EXP -

Sign of 'STEP' M4

M3 -

.

------------- - -

If this is the cast!, the inteq.Jrt~l e r does uol allow the J.nograru to contiuue. T lte reason fur tlri::s is twofold. Tire fir.;t i::s tlial, in '

HI

Pointer to

direct mode, the slaternent is ueing execule<l in the input buffer allli if the statement has l!t!ell stopped, il is possible that it will havt! uet!ll over wrillen by a new line of input, in which t.:ase CONT would try Lo resume a puhmtially nonsensical slat~ rue nt. Tire ollrer reawn is• that an error cau occur at any point during lh~ e.ltt:.'Culion o! a slctlement and can leavt! tile BASIC pointers and vectors in an indeterminate stale - therefore, wlril~ CONT might rejoin llASIC al the correct point, tltt!re is nu guararrlee that execu tion would continue corrt!ctly due to the po:>sible corruption or lhe BASIC pointers. H CONT is allowed, the CHRGET puiuler and line number are restur~d and execuliou conliuues from

LO

'UOSUB' statement

that point

Ill

Line Number of

LO

'GOSUB' statement

Havi ng mentioned that CONT during <.lir~:d !lioll~:: could cause conflict in the ust! of Li re illJJUI buffer anu i,s cunsequeutly ulsallowed. it is worth allding lhal this is the same reason why the INPUT or GET culi!Hlands are not allowed in direct ruude. In liollr cases, the input burler is used to hold a string of t:haracter:; which would overwrite the dii eCt mode statement alrt!ady in the buffer auu cause great confusion to

M2 •

- ·

'STEP' value

Ml

-

EXP HI Pointer to . -'FOR' variable LO $81

TOR' Token

'GOSUR' Stack Entry ---·-

-

$~0

'GOSU!l' Token

GOSUB & REnJRN

the interpreter!. Since it also uses !he stark, GOSIJB will now be described. On entry to the GOSUB routine, the staek is checked to see it it can hold the entry and thf!n the current pointer ar1<J liu~ number are pushed onw the stack, followed by the GOSUB token ($8D} as a marker. The rou tine then joins the GOTO routine which reads the line number, converts it into a two byte integer, scarchrc'i for the line number ill the text and then sets <Ill the pointers to m ntinue execution fro111 that point. RETURN slmply checks the stac:k for the latest active GOSUR entry (ddcting :-~ny FOR entries on the wayl) and resets the poinwrs whirh then point to the middle of the GOSUB ' - - - - - - - - - - ----·- -- ------ .............

[., -TheTransactor

Pointe rs

Before goiug on Lu look al the final commands of SAVE and LOAD, it is worth examining briefly the pointers which iudicale the var ious sections of memory used by the inlerp r~ ter. The fir st is the start-oi-J;ASIC pointer (at $28/9, $28/C in VIC/61) whicll iti ah.,·ays sel to the start oll:lA::iiC text space. This ac.klr~ss varies from machine to machine. but it always points lo the first byte of the first lines' header wltich contains the pointer to the next line a:s well as the line

nurnber. •

.

:

47.


•.

The VERIFY command operates identically to LOAD, except that bytes are compared with those in RAM rather than being stored.

The next pointer ($2A/B, $20/E in VIC/64) indicates the start of the variable table and normally points to the first byte followins the three consecutive zero bytes indicating the end of the BASI.C program. As well as indicating the start of the variable table it is also used as an end-of-BASIC

.

In direct mode (and that includes a LOAD using the shifted RUN/STOP key}, once the program is loaded, the start-of· -variables pointers is set to the end address of the loaded program. In order to avoid problems of trying to read variables from a now corrupte<j variable (and array) table, a CLR is performed (whicti sets the start of arrays and end of arrays to the end of program pointer and resets the lower limit of string storage to the upper limit of RAM). This is followed by the recalculation of all the link addresses at the beginning of each line of the BASIC program. Finally, the main waiting loop is rejoinoo at the point at which READY is

pointer.

The start of the array table is held in $2C/D ($2F/30 in VIC/ 64). and the end in $2E/ F ($3112} which is also used to show the end of RAM u1iage (working up from the bottom of RAM). It is this pointer that the strings, which work down from the top of RAM, must not pass. The lower limit of strings is held in $30/31 ($33/34) and it is the comparison of this with $2E/F that instigates the garbage collect routine. ' The last pointer is $34/5 ($37/8). which gives the Top of Memory. This can be lowere<j to allocate some memory for assembler routines for example. Note that if this is done, a CLR instruction should follow the two POKEs.

printed.

In program mode, LOAD operates rather differently. The actual mechanism remains the same, but the .End of BASIC/ Start of variables pointer is left untouched. This allows the newly loaded program to access the same variables as the program which loaded it. However, if the loaded program is longer than the calli~g program, the variable table will be over-written by the end of the new program and cause no end of problems. This is why programs loaded from within a BASIC program must always be shorter than the calling

SAVE When you use the SAVE command, the limits of RAM to be saved are indicated by the Start-of-BASIC pointer and the • Start-of-Variables pointer. If the device is one of the cas. settes then a header is created with the start and end addresses included together with the program name. This is then written to tape followed by the complete program. However, if an IEEE device is specified, the program name is sent first (used to open a channel in the device} and the program is sent byte by byte - the first two bytes sent being the start address of the program.

program.

Once loaded, BASIC is reset to continue execution at the beginning, arid a partial CLR performed which deans up the stack to remove any outstanding GOSUB and POR entries and executes the RESTORE command routine. Unlike LOAD in direct mode, LOAD in a pro~ram does not perform the regeneration of the link addresses.

LOAD

.. .And Beyond LOAD is rather different, however, and its operation depends ori whether or not you are operating from within a program or in direct mode. If from tape, the header of the specified program is searched for (if none is specified, the first program header read is used). This header contains the start and end addresses of the program and it is the fate of these which differs from program to direct mode. If an IEEE LOAD is performed , the program name is sent to the IEEE • bus (to allow the device to find the program- for instance on the disk unit) and the first two characters received are taken as the start address of the program. When program LOAD is complete the IEEE bus signals the fact and the address of the last byte loaded used as the end address, since this address is not explicitly saved as part of the program.

..., '

That then is our look inside BASIC - or at least as much as time and space wiH allow. Further investigations can be made with the use of a simple disassembler (wh ich converts the machine code back into assembly language, but without labels or variable names). With the information given above, and the details given in tables of ROM onrl workspace RAM , most readers should be <lhlc to oclve a little deeper under the bonnet. Armed with a deeper uno(.!rstand· ing of the software processes involved in the RASIC interpreter, mariy users have been able to make their Commodore computers sing a nodance far in excess of what their creators ever imagined!

------------[ 'I'M hn10etor

41

......

--- --


Messing With The Stack

S\Jruclilltt:S il woulu Ut: nkt: to UC ai.>Je tO ll;!ave a suuroutine bv• a GOTO statement rather than the usual RETURN statcmcnl. Doing

Garry G. Kiziak Burlington, Ont.

225 sys clear : rem where clear "' 46610 on 4.0 PEn ;mel 50583 on 2.0 PETs

so is usnatly ronslderr.<1 'pMr programming prar.ticP.'. However. !here are times when it can be useful (e.g. implemen tin~ an 'escape key' featu re in an mput subroutine} Th~

most prel>sit t ~ reason why one should avoid this programming tech niquc. aside from the fact that it encourages ·bad programming habits', is thi-li il does tf'rrihlf' things with lht:' sw·k

This 'SYS' command accesses a !<OM routine which is part of the 'CLR' command and errectively clear~> the ~ l ack each tiJU~ it is call\ld. Now ~; im:r.: thl! !il;,ck is 110 lo t l!)~r allowed to fill up, the program stwuld run ro its conclusion printing 'HERt: I AM ACAIN.' 50 timr..~ fo llowN1 hv 'F. I JRF.KA IT WORKS.' • The CLE.AR address for the Commodore 64 is 42622, and for the VIC 20 it is :i0~ 14. However, as is well known (See The Transaclur VolA lbl.ue 3 lJo!,le 26). it HO longer worko. This is sornewhal

Try the followm ~ program.

100 go:;ub 200

puzzling, especially when you lool< OJL the disasscmble>d machine code on each of rhr: marhinr_~ i'-lnn find rhar they nre idP.ntical P.XCP.pt rnr .smne <'~ddr~>ss thl.lrlges which are necessary because the routines are located in different places on each machine.

11 0 prin t "eureka, it works!· 120 end 200 if i = 50 then ret LJrt1 2l0i .-. i+ l 220 print i, " . here i am again.· 230 goto 100

Here is the disas~;t:: mbled l:uue uJL the Comr HoJore 64. 01 Sa67e 68

Program I. The program will print out the messa~e " I IERE I AM AGAIN." twen ty three times and then stov with an '"? OUT OF MEMORY

ERROR IN 200", In fact th err Is rlenry of mr.mnry <IY<lilnhlc. Whn t hll5 hnppcnN1 i ~ that each time li ne 100 is executed. 7 bytes are placed on the stack (5 tJ! these bytes tell the computer wh ere to return to when il encoun ters the ' KETURN ' statement and the other two bytes are Si ner. the 'RETURN' statement in llnr. 200 doesn't get CX(~C'LJtr:d until f - fiO, rhe .~tack C')Uit'kly fill <; up (the stack can contain a maximum of 255 bytes, but much o f that is used by the operating system). When it is lull the 'OUT 0 1--· MEMORY' error occurs.

The Transactor

..

-~---

07 Sa685 98

1)'3

tav ' pla ldx ... ~;fa ;place $ta. in the stack pointer tx~

'

;restore the two bytes s-aved ;above

phll

09 Sa687 a9 00

Ida •$00 ;do some house cleamng

I0 $a689 85 3e

sta oldtxt + I

I I Sa68b 85 10 12 $a68a 60

sta subrlg

ru;

;return to the command interpreter

aM ut the 6502 (or 651 0) processor, and how it works in conjunction witl1 the JSR statement. Namely, that each time a JSR statement is e,-.:~,;cuted. the ptoces~or autun,atically ~Jl <u.:t!s l wu byl~ outu the sta.l:k. These two i>ytes tell the processor where it should continue executing instructions from when it encounters nn RTS statement. On C'XC:tuting the HTS sintf'm r.nt. these 1wo hyte.s are

Lhc following line.

--

plra

;:<>ave t h ~ 2 hytr.s rnost rP.t('ntly ;pushed onto the stack

Bdor!' I r.xplnin how rhi.~ works. ll•t me recall one imporran t fact

Fortu nately there is a :;irnple way out of this problem, simply add

!L---·-------·

02 Safi7!i aS 03 :Sa680 68 04 ~a68 l a2 fa 05 Sa683 Ha 06 Sa684 '18 OR St'\11.'\n 4.'\

plact!d there fur iulernaltedsun~) -

clear pla

·-·--.---·----

--------49

--------------Volume 5 Issue 02


~--·-----------------------------------------------------------------------------------------------------

removed !rom the stack and execution cont1r)ues from that add res.~ - actually that address plus one.

Hr rt> ic; how thr \.LEAR routine works. First it sav~

Nnw whPn thf' RTS is c>nrounrrrr.<i in SF.1 ::i!i of rhl' SYS rolllinr. there is no le~itimate return addrec;s on the stack, ~o it rakes two meamngless bvtes and returns to heaven knows where.

th~

last two bytes that were pushed onto rhc> stnrk in rlw A ;'IJ1d Y register Oines I to 3). Th1s 1s ne-cessary because this routinP is normally raiiNI hy a JSR command in the 'command mterprctcr'. These two bytes rherclollJ tell the ~mx:e~5or where to return to. (Un a Commodore 64 these two !Jytes are SA7 and $£9 w tlttl 1etu.rn address is :SA 7EA). l.ln<'!.c; 4 ro 5 place $FA in the 5lack p<>illtt:r. This in dft:ct clears the stack sin.cr rhis is rhr valur p111 rhNc hy the computer on power up. Lines 6 to 8 replace tile two hyrc>s savcc1 ahovr. so thrH the RT:> in line I2 can return con trol to the command interpreter

If YOU UnderstOOd lhe CIOO'i~, lhe :,o)utiOII IO the jJIOIJit:rll ~ IIOW quirr. simple. Instead of SYSing directly to the ROM routine. SYS to your nwn ro111inr whrrl' you firsr rrrnovl' rho~!' rwo cxrra hyti'S from the stack and then jump to the ROM rn ut iru~ For

lh~

Commodore l.i4

PLI\

PLA PI .A JMP SA67E

Since this code is virtually identical ou all machines, why doesn't it work on the Commodore 61 or the VIC 20. Wdl. the proble111 doesn't lir in rhis rontinP. Instead it lies In the routine that executes the 'SYS command.

r'or the VIC :LO

PLA

J\1P $l.fi7E

On the Commodore (j4, the followmg 13ASIC loader added to the ue~illllillg of Progrdrtl I willlllakt: tlldl tJIU!lt<l lll work p ropedy.

10 r lrnr = P.2A · for k = r ll'ar ro rll';'lr 1 iJ : rl'ncl j : po1<c k,j : next k 20data 104.104,76,126.166

A11 extr alet~lu r ~ has been incorporated into the 'SYS' command on the Com111odure 6'1 a111J tile VIC 20, rtalild)' Ihe ability to set the A, X. Y, and status registers before enterill!l till: actual maclli 11c

On a VIC

lilng11Agr ro11tinr.. These registers are set by poking vC~Iu es into locations 780-783 before SYSing to rhr. rrrJulrN1 routine. In order to accommodate th1s extra feature the code I hat exl'<'utes th ~ SYS commdnd must be diHerent. Here's what 11 looks hke on the

:w, replace line :.w with.

20data 101.101.76. 126.1 98) Of course you must still inch rdr linl" 225

Commodore 6,1. 0 I Se 12n 20 Aa ad jsr 02 Se 12d 20 r7 b7 jsr O:J Sci:JO a9 el Ida 04 Sc 132 4!:! ph a OS Se 13~ a9 116 Ida 06 ScI :~5 ~8 pha 07 SrI ~n nd Of m Ida 08 Se 13!) 48 pha 09 Se 13a ad Oc 03 Ida 10 Se 13d ae Od 03 ldx II Se 140 ac Ot! 03 Illy I 2 Sc 113 28 pip I~ Sr 144 & 14 00 jmp 14 Se 147 08 php 15 Se 148 8d Oc 03 sta IG Se l4b He Ud o:J stx 17 $el 4c Sc Oe 03 ~ty 18 $c15 I 68 pia 19 Sc' I !i2 Ad Of 03 sta 20 S.el55 nO rts

frmnum :get address alter sys command gNnc1r :ronvr.rt it to an Integer "$e l ;put address 5e 147-1 ;on the stack so rts m .. $46 :u!>er's rouline w ill continue :ex~uliou ;;t Su 147 S030f ;get status register from :7R~ anc1 !li1V!! on stack !!o030c ;get <HegistPr from 7AO $030<1 ;get x-rcfllster I rom 78 1 S030e ,get y-register from 7g:L ;gel :-,tatu~ r~g llac.: k fr om stack (linnum) ;jump to the user's routine ;~nvr stntus register on stack :&030<: ;store a-rf'gisrrr in 7M $030d ;store x-rcgi~ter in 781 $030e ,slore y-rcgistcr in '/8 2 ;gel slatUi> r~gb tcr uack $030{ ;store it in 783 ;rerurn to command interpreter

Notice that the routine is completely relocatdlJic. so you e<~rt !JUI it in any (so'lfC') placr. that you like.

POP For The Commodore 64 The CLEAR routine does its job just fine. Huwtl\'er. it nt<J}' abo du mmr rhnn you rr.ally want. Its purpose is to clear the entire srack · of RETURN 11t1<1w.sses. of FOR . . NF.XT loop p<lintr.rs, nnl'l anvthmR else that may be on the stack Yet there may be timt><; when all you want to do is ·pup· the last HETURN address off the ~t<st.:k . Tht! following routint: will do ju:.t that on the Commodore

6'1. I 0 pop- 82~ : for b:. pc1p 1o pop+ 24 : rC'Ml j : pnkc lcj : next k

20data 104, 104,169,255,133.74,32 .1 38, l fi3. 154.201,141,240,S JO data 1G:l, I V li,SS,I l.i4, 104, IU4, LO<I, I 04. 104,96

Replace li rt~ 10 ;.J.mJ 20 of the IJfo~ra111 aWI'U wil1 1l hcse two linel> ancl rl'placc line 225 with:

r\otice that the A, X, Y, and status registers are loaded from 1ocatiom. 780-783 (lines 7 to 12) before the actual machtne language routine is enter~ (lim~ 13). Abo uutic.:e that two extra hyrr.c; arr pushed onto the stack before entering the M/ L routine as well (linf's 3 ro fi) Thc>.sr arc· put onto thE' stack so that when an RTS ts encountered in the M/L routine. ron rro1 will rr.rmn 10 SE 14 7 where the A, X, Y, and status reRisters are put back in 1orlll ion ~ 780-783 udore returning to the command mlerpreter.

225 sys pop

You will lt~ liM th~ program works just as well. Thts time however the tmtirc slack is uot dcan:d, ju~t th~ la~t RETURN nddrcss. Also like the normal RET URN stateme1tl. <lilY <sctive F'OR . . 'JEXT loop!l wirhin the subroutine will be removed by the POP. Notke that this rou ti ne> isalso rc>lorn1ahJ (' ~n ir rnn hr pl;1rr.d In ;'111)' 'sate' place.

Thr.sC' r.xtrn two bytes are the cause of all our proule111s. For wht:ll the CLF.AR rowinr is l'nlled by SYS CLEAR, these two bytes are saved in tead of the two hytr-os thar will rr.111 rn it ro thl' command interpreter. End result? When the RTS is enrou ntf'rl'rl in thl' CLEAR routine, control returns to SE 147, and the stack is clear.

'-..:. !.he ~ Transactor

50

Volume S, lsaue 02

J


The Un-Token Twin's

Richard Evers

The purpose of the ·un-token' twin's is to supply you with a unique method to list programs from memory, or from disk. Normally this task would be considered a rather anti- cl imatic event, but the programs demonstrate how one can make use of information already liv i n~ inside your machine.

For now, that is al! that is to be said about the ·un-token twins'. If you find further methods in which to make them even better. please send us a note telling of your tec hn ique. We are always looking lor reader support, and will not hesitate to print what is sent to us if given the chance. Whenever you feel creative, please keep us in mind.

Similar programs released in the past have usually kept their ke}'\¥ord table in a stack of data statements somewhere within the program. Til is fact alone has made these programs quite large in size and fairly painful! to key in My program uses the basic ROM table of keywords lor its token/ keyvvord conversion. With this change of direction, a lot of space has been saved in memory, and a fair bit of time and trouble trimmed off the keying in procedu re. Hopefu lly, less code will mean less mistakes. As a bonus, the link address for the following line is printed before the line number. If you find this totally useless to you, simply remove it ... the link address is held in variable 'C'. As the program progresses, it does a number things. The first is to actually get the character to be printed. The value is checked to see if it is a quote. If so, the program flo•v will change direction a tad to avoid any trouble with tokenization of capital letters and reverse case characters. If not, the program will plod ahead to check if the value encountered ,,,.as a keyword. If so, 128 is subtracted from the ASCII value, and an keyword array variable is assigned to it. In this manner, all of the kc)'\vords match up exactly with their token values. After this, if the value was not a keyword, but the 'in quotes' flag has been set, then the value is OR'd \Vith 64 to get rid of any strange reverse case characters that might be pretend· ing to be control characters. Control characters, or pseudo control characters quite often make a reaJ mess out of the screen when they are printed . The 'quick OR with 64' will re<luce the chances of this happening. When all of this has been performed, the character is finally printed to the screen, and a test or two is done to keep the flow going. Notice the line numbers in each version . The disk version has been written with successive line numbers because it will probably be alone in memory. The RAM version has somewhat larger line numbers. Since this program must co· exist with the program you wish to un-tokenize. the larger line numbers were chosen to make room for the other program. Hopefully it \Viii not have line numbers that will interfere with 'un-token memory'.

[

The Tra nsactor

10 rem + un- token memory - richard evers 15 rem + will list a basic program in memory 20 rem ...... ~ ......... 4..... . ........... 4•>i'+ il >!>+ >t- •to+wo!o " >f>~<!o+ 25 rem 30 rem 35 rem 40 rem

• 4.0 basic ts = 45234 : te = 455 79 : sb = 1025 • c64 ts = 4 ·1118 : te = 413 73 : sb = 2049 • ts + te start and end of rom keyword table + sb = start of basic

=

63900 print chr$(147); : clr: ts = 45234 : te "'45579 : sb= 1025: ps=sb: rem • 4.0 basic+ • set up your variables lor your particular machines here 63901 dim kw$(90) : kw = 0: for a= ts tote : k = peek(a) & th~array k\.v$(90) will hold all keywords, the loop will bring them in ~

63902 if k<128 then kw$(kw) = kw$(kw) + chr$(k) : next : print ch r$(14 7) : goto63904 >~< if the value peeked was belov.• 128 ascii, then it is just part of keyword 63903 k = k- 128 : kw$(kw) = kw$(kw) + chr$(k) : print kw$(kw), : kw =- kw + 1 : next : print chr$(147) >~<end of token encountered- subtract 128, add to strin~ and adjust pointers 63904 c = peek(sb) + 256•peek(sb + I) : d::;; peek (sb + 2) + 256•peek(sb + 3) : if c = 0 then 63910 * 'c' and 'd' hold the link address and line* respectively 63905 print c:d: : fore = sb + 4 to c-2 : I = peek(e) : f$ =- ch r$(~ : if qt then 63907 " print ·c· and 'd', then loop throughout tt1e entire line to print 63906 iff> 127 then I$= kw$(f- 128) • if keyvvord encountered, subtract 128 then assign array variable to it

----~5~~------------------------------~ Vo ~l~ u~ m~•~~llsue 02


63907 if qt then f$ = chr$(asc(f$)or64)

85 gosub 140 : ps = asc(a$) : gosub 140 : ps = ps + 256•asc(a$)

* if quote flag set, 'or' the value with 64 to get rid of control

* get the low and high bytes of the start address from disk

characters

90 if sb<>ps then print" not a basic program " : close 5 : end

63908 print f$; : if f = 34 then qt = not q t

* print the string, check if the value was a quote and flip

* if the address is higher or lower than basic as set, reject

QT if so

and end 63909 next : print : qt = 0 : sb = c : goto 63904

* next the loop, drop a line and re- adjust pointers to

95 gosub 140 : c = asc(a$) : gosub 140 : c = c + 256•asc(a$) : if c = 0 then 150

continue on

* get the low and high bytes of the link address from disk 63910 print : print" program size" sb- ps" bytes" : end

* program complete ! show the size of program and end

100 gosub140: d=asc(a$): gosub 140 : d = d + 256•asc(a$)

* get the low and high bytes of the line number from disk 105 p rint c;d;

* un-token disk- richard evers * will list most basic programs from disk 20 rem ** * ** * * • * • * * * * * * * ** * * ** * ** • * *"' * 25 rem * 4.0 basic ts = 45234 : te = 45579 : sb = 1025 30 rem * c64 ts = 41118 : te = 41373 : sb = 2049 35 rem * ts + te = start and end of keyword table in rom

*print the link address followed by the line number - adjust to your taste

10 rem 15 rem

110 gosub 140 : z = asc(a$) : if qt then 120

* main routine to get the contents of the line - is quote set, skip ahead

40 rem * sb = start of basic 45 rem

115 if asc(a$)>127 then a$= kw$(asc(a$)- 128)

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

* obviously out of quotes, is it above 127 ascii ? - if so, it is a keyword

50 printchr$(147);: clr : ts=45234 : te=45579 : sb = 1025 : qt = o

* this one has been set up for 4.0 basic - re-adjust to suit

120 if qt then a$ = chr$(asc(a$)or64)

* if within quotes, 'or' the value with 64 to rid it of control

your needs

characters 55 dim kw$(90) : kw = 0 : for a = ts to te : k =peek(a)

* array kw$(90) will hold the basic keywords

125 p rint a$; : if z = 34 then qt = not qt

* print the value and flip the quote's flag if the char was a quotation mark

60 if k<128then kw$(kw) = kw$(kw) + chr$(k) : next : goto 70

130 sb = sb + 1 : if sb + 4<c then 11 0

• this checks if end of keyword has been encountered

* increment the start of basic pointer and go for more is we 65 k = k-128 : kw$(kw) = kw$(kw) + chr$(k) : print kw$(kw}, : kw = kw + 1 : next

haven't hit top

* value is beyond 128 ascii so the end of keyword has come - act accordingly

135 print : qt = 0 : sb = c : goto 95

* drop a line, re- adjust the pointers and continue at the top . agam

70 print chr$(1 4 7) + "program file name " ; : input pn$ : if len(pn$)>16 then 70 75 input" drive number" ;d$ : if d$< "0" o r d$>" 1 " then 75

140 g et#5, a$ : a$= left$(a$ + chr$(0) ,1) : if st = 0 then return

* a one line method to get a character from disk and check if

* routine to get the program name and drive number

st set

- nothing special here 80 print chr$(14 7); : open5,8,5,"" + d$ + " :" + pn$ + " "

145 close 5 : print : print " p rogram size" sb- ps" bytes" :end

• open the file on drive H d$ with file name pn$

* close the file, display the size of program and end

The Transactor

52

Volume 5, Issue 02


Merging BASIC:Progran1s

Glen Pearce Randbttrg, South Africa

St't..eru.' M~m~ le-cllrrrqu""> hwti! lttrl

publtsfu~d

if! Jhe

l 'a~l.

tna

(J,r1111 's vro~ram eltmirrvll!> rt1~ !Wed fo1 US1 im~ slie prorjiUrrr ID D tope m uisl.f. filcJ ifl unler to ~~~~IJW(' it I!JI this f l/)ei 'OiiOII - M Er.J An~'l'o'.l)l, l w'l<'~ lo

tlw 11'\Prgr> pr11Srilrn White tl1e m!ll~"h inP-Cc.dl:' pro~rum m the [) ..!\lA statements $..q beH1f.l: I'OJC£d mto memon , a runnioQ ioti\1 (tf !he va lue:> ))~;:!ins t'UKt:d i.'! ke[..tL !:ihoukl l he lolal '>·aJue o1 U:\t:: D.;T:.'\ ~ldlt:ll l~::nl~ NOT 1.'. \1ual U1d l 111 liu~.J I 40. Jlr'..!

r m ~u·~ most of you hav~ ar O.fl(' 1Jme or al')otl\~r b~n laetd \\.'1th. Ihe ne<.-"<1 !o "merge'· one gr morl.! u~clul ~ubro .JIJnE;>S mlo a IIASJC pmgraJTt thai you are writing \Ve all build up a Jibr;uy ot routin~ vv{lc the ye.;1rs .u1d h k!v l t ;,IJI~· havu tv l>"Jii the wlwlo routfn~ In agn1n r])Ch time we wish to use u In a new program. Wlth progmm rlC'!\'PlOf>rllr.nt t llt!C' hemming it"i t!X Jl<! 11.~kv~ i\.', il hr1!> ltlll"ly, f d.IX idf'l'l to wrile R prn,qram whirh W>'"lulrf aut<~:JmBlicriUy "mi?rseo"' a praRram slured 011 dJsk w1lh the one curren Uv held m the computer's IHt:tJroty - aftet

dH, LIUJ.l'':. .,.,.hal C:IJmpul t:JS are Jor, di..:J r't

take the t..lrudgery 1.1 u! Qr uu r livl!~~ I

hnw~

.'lilppli.f'ti tv;.,

mPr!tt' progrnf'n<l -

mc~sagc 'CH E:CK.~VM E.RROR' mcnnlng thnt you l:r.yrilln onr. tor mn.rt') of thr dam ~tlllrmrnl'!i irMnrr«lly lf ;rll gorfi \\'~1. <1 mffi~<lgt> on hnw to use ~h~> merge proRram will be d i.; pb yC{I and th.f' SAS.IC J>I'OWilm Wi ll be <e-l1J:t<ed

prv~r;m1

wiJl be C~ltorW·:J with 111c

b:l-

thtl 'NI.:W' 1.:uu1tn.ind JJl l111e l 7!j (::.u en~u rc yvu'vc !i\Vt:J the pmgr<llm <~.wa::; Ll:.{urc n umi11.g itn. Tin.! rn« ld.J it'-l:udc lllt'rgc 1.m.>gr.am will nnnaiu availat1Je for use unlil puwer· down or the top

the~ - 10

ur memory poimr.rs.:m• ~I1.111Jf'tl. nn!" f()r lhf' Fi4 rmd ttnl" for

To merge two programs together pnx:t:£'<1 as fo.llows:-

the prof.essi onal range of Commodore romput.ers (tht 40'-10 and 800D :>err~~l To \I mphl v tht! entl'}o' tlf tt1c merQ:t> pro::u11m~. I 1:\~\tt­ ~oadvd tho;; r11achmu-wdc pari ol lh\! pro(jrillm· m UAH\ ~olalcrm.:n l~> wh id 1 a r~ si111ply 'POKEd' i ut~; mt.mu;ry 1;1)' the BASIC' ~ion of the program.

b) L.o ..~.D the nl'sl BASIC pmgr;un jnto memory In 1he normal mannt'r:

The lltachln.e-.:odt! me rgt: pr~r.u.m res.1dt'!~ m~ar the 1op oJ rn~lll· on'. As the CBM opemlm~ ~yst~m aho us(3 1his ~trea to ~ore ~-ariilb~o:>-5 . v;e will lvnoe to prote<1 lh!.' mer~e prOJtt<)m m some- ~'~iJ.Y Hl'i~. IIi(• l!'V>l!! -) lk~l idly UJIIUlllH.JlJtlt Ul~t<-illttlj 1>)'1-ot\JI Il Wlllt!~ h.t our ald. By simply chan;gln~ 1he value of 2, locatklns ln memory. \,,•• rnn lu\vN thr· mp o f m4'mury pnl nrc:r!i !~· hnwrvrr tn1 1rh ''~ li!c(' T he CB[I,I locat1o~

~>on II

the[)

c.l)

lhl' lk1drdis ~ptci lil'd m t~hc-:se ~1 ernorv and ig nore any memory

f'l

above thai address, thus protec1i ng the machine-code merge proWctm Loukitlllf <1l th~ CouruiUI..!on:• 64 psogram LJduw. tlu:! l wo locatlu us :Jr~ 55 o10d S6 l.otJI!Orl 56 huld!> t ill! HI b'rlto addrus.o, of t hr. rop nf mf'niO'lrf ttnd loNrlmn :l5 l'lolct., tnr. 1.0- hyte Onn' t

l i l

I\'~ m

the lilc n.nl1lf' of tht

s·r

PROGRA 'v1

proo/<~m

you wt!lh to mNq<· w 1l h ihP h.t one you loaued and pre~s .1\ETUt.:N. Jl yv..l'tc u:.i f\g a Uual dbh drive, _I 011 ~huuld spccify !he dtivl! I.Jllll\l K· r on wllld t lhl! tmJ~fdlll ri;!Md~;; ;,1..~

c·nr'OJ)Iit•fttf'lt 11s it'i <w'llllll]~ By multiplyinR tt1oP 'pe-ek <)f]lXlllton 56(111-h)'te) by 256 1\l:ld .'\[)DING llH I lhe value i11 lv~ir m 5.:> (L.O-b} le}. \\ 1: <~:r dH~ .rt l he ll l\llll1JI ~ lvcaltiJfl l11.r.l i~ r]w TOP OF MF'~\fORY won y , lhi:;. i<:"rtt

tile P IUflllJI 'IS I

LOADED?

re~md

as lhe ne.,. Top of

'JYpe ' \'' Il l rtt.)JO!Ibl' IQ

V.:l'll ~~· I :PRGNAME);

il'i

II ..,ll !.lvef. well lhe ln'C.Io~i1!\lt 'M[ ROI:: UK' wtU !!.ppear o 11 the M..ro:~n \Jii.,:l,;! I h ~ l'uv.r bit! i:o. W IHJJl\Jh-d .mt! I he r un ipli,;!lli! u r~r !-lt.:d pr L~lr dill will uuw r~-"Sitll:' 111 tht' cumt>LJ ter'~ memory (whert'UPVfl )'OLI liM> mergE' fu rt her llfOE!ilffiS lnl'l 11 i( you ,,.;ish by r.imply rf'Jle1lin8 the !!r•~l'" fm m {h} through (ti) rrhtWr)

\1nw M/1'1}' tirn" lkY m nii('C' thr v;,ll.ll' In lnt·:-uion 56 hoy <1NP. We! luwer the l~ o( memory b)· 256 t.yk~ jrernetnbt-r - 56 llold~ lite Tll-bvte value). We 'II lrJr~~tnboul thaJ1Hi n~ locat1on 55 tor 1he hrnc bem~- suHsce to say 1hal, b) r~hJ~.:ing va!u~ Ill vi l li~IIIIJI} 1' iII W. lv1•, l:'rt:U.lr,;· ) ls;·Je.

It em l.!rrar 1s. det:<."''.'led (c_lf hie nol tound. Head error, dC.J the I lleS~~ ·~il lRI.il A!j01U1:l)' will be prmted v ii lhU(;Ie"<:n.

5.j bv ONJ:.. lhe lcp

~ OTE:

i

l

1\ n important pomt to remember is thal any line numbers whlt'11 an' drlpll(':lrro In lhf' I\''"' prngm m~ hdnB mr:rgf:cl will r :nl 'lf• l ht' l ine lrl ! II~ SECOND pr6~rt~o1 to ow•Wt.Jte the ltn c m th~ n RSf

NO'fE: THE AC I1JAL ME MORY LOCATION SPI-: CrFIEO BV THF. AOllRF.SS IN 55 IS AlSO 'p;AOTJ::CT.£0 .

prvgram. Th(>5tatemen tlo:;,wering the Top of 1\.lemorYJX~intm$ ~hould .i!lw;\y~ u~ Ulu 1·1R:ST bldlem~ H iu )'\}Uf ,I.Hll£lldU1 and li lt' [ II;() '[..l(Jkt:!. II LU.:>l be- iollowed l>y il 'ClR' camr:nand as this iru;tt·urw the operatlr~,g systt:sn 10 bring other rncmary pointers inlt> lirw \\•.ith the TOfl vf

J\ u~tl ul ft~luru uf the merg·• prii~I~III i:. its ,abilJiy tu uwry.: programs wrltte:n on dlffercnt model~ ol Commodore computer

i'.f, ·mnr.l'' l,lfrinr''~""

41iltr>rr• llr

(Ihis tS IHH 1nL1!l>' i mpn~~bl t: ,Js BASl.C JHt>,gtarn~ .i'llrt' ~ .wr<l from

.53

'lrir.l rP'i~

nn 1h t· riifil' 11' nr 111t\!1l>lc;)

Volume 5 1 I'S1ve 0 2


100 r~rn merge 4.0 110 poke 5.1, 1?5 · poke 52. 0 : clr 1?0 tor j "'32000 to 32476 : read x 130 poke;, x: ch=ch+x; next 140 if ch <> 51:d:.-JO then print" check.surn ~r rur " : end 150 pnnt "merge baste programs -lJasic 4.0 160 pnnt "load lht:l fust program 1nto ram 170 p1 int • typ~ sys 32000 and follow i n~tn1ctions 175 11t:tw :rem caution savP. Mfore running 180 data 169, 0 , 1.1 3, ?09, 169. 147. 32,210 190 dn!A 255, 162, 0, 32, 79, 126. :J~ . 228 200 data 255. 201 . 89, 240 , 1, 201. 78. 208 ?10 data 245. 76. 255, 11':J, 162, 73, 32, 79 220data 12o, 32. 207 . 255. 201. 20. 2110. 18 230 data 20 1, 13. 240. 111. 166. 209. 224. 16 240data240.231 , 157, 131 , 2. 232. 134 , ?0!'1 250data208.231 . 166, 209, 240 2t9, 169, 44 260data157.131. 2, 232, tnO, 80 157, 131 270 data 2, 23?. 134 ,209. 169, 13, 32,2 10 2BOdatA?55, 1n9. 13, 133, 2 10, 133,211, 1G9 290data a. 133, 2 12, 16Y. ~. 1 33.2 19, 169 300data131 , 133, 21B. 32. 99. 245. 162. 13 3 10 data 32, 11~. 247. 32. 57, 126, 32. 57 320 data 126. 32, 228. 255, 208, 24, 32, 228 330 data255. 208. 22. 162 . 103. 32, 79, 1?o 340 data 169, 13, 32. 226. 242. 32, ?04, ?55 350data 32, 233, 18t 76. ?55 . 179. 32, 57 360 data 126, 3? , f-17 126 133. 17. 32, ol 370 n:1tn t?fi, 133. 18, 160, o, 32. ol. 12(3 380 data 153. 0 , 2, 240, :3, 200. 208. 245 390data200. 152, 24, 10o, 4, 133. 5. 32 400data 163. 181 . 144, 68.160. 1, 177. 92 41 0data 133. 32. 165. J12. 133. 31.165. 93 420data 133. 3J1 , 165. 92. 136 . 24 t . n:>. ?4 430data 101. 42. 133, 42, 133 . 33.165. 43 440 data 105. 255. 133, 43 , ??9 93. 170. 56 450datn 165, D?. ??9. 42 , 168, 176. 3. :d:J£ 460 dntn 1D8 34 . 24, 101, 3 1, 144, 3, 198 470data 32, 24, 177, 31, 14o, 33,200.208 480 data 249, 230. 3£, 2::10. 34 , 202. 208. 2'1 2 490data 32,255, 181 . 32. 182. 180. 24 . 165 oOOdata 42,133. 87. 101 . 5 . 133. 85. 164 510data 43 .132. 88. 144, 1. 200, 132 Ro 520data 32, 80. 179.165. 17. 164, 18, 141 530 data 254. 1. 140. 255. t . 165, 46, 164 540 data 47, t33, 4? . 13?. 43. 164, 5, 136 550 dam t85, ?fl? , 1 145. 92, 136, Hi, 248 560 data 32,255, 181 , 3£. 1~2 . 180. 76. 113 570 data 125, 32, 22U, 255, 166. 150. 2J10. 13 sso data 32,£04, 25G, 162, 11t1. 32, 79, 126 590 data 104. 104. 76. 128. 125. 170. 96, 189 GOO data 91 , 126. 240. 6 . 32. 210. 255. ?.1? 610 data 208. 245, 96. 13. t3. 18, 71 . 65 620 data. 80. 32. 80, 82. 7C'J , 71. 82. 65 630 doto 77, 3?, 77, 69, 82, 71, 69. 32 640 lifliA 45 3?, 71 , 65, 32, 80. U9. 65 650 rlAta 82. 67. 69, 32, 4o, 32, 56. 51 660 data 48, 53, oO, oO, 146. 13, 13. 73 670 data 83, 32, 49. 83. 84. 32. 80. 82 680 data /9, 71 , 82. 65. 77. 32. 76. 79 ~Odata 65. 68. 69. 68, ~ . 32. 40 . AA 700data 47. 78. 41. o. 13, 1.1. 68 82 710 data 73. 86. 69, JS, 3?, 38, 32, SO 720dat<J 78, 68, 3?, 80, 82. 79, 71, U2 730datn as, 77, 32. 78. 65. 77, u~. U3 740 rlAlA 32, 0, 13. 13, II , 69, 82, 7 1 750 data 69, 32, 79, 7o . o. 13. 13. 77 760 data 69. H2, 71, 69. 32. 65. 66, 79 7 4. 69. 68. The Tranncter

100 rem rnerye c64 110 poke 56. 125 poke 55. 0 ctr 120 for j- 3?000 to 32467 : read x 130 JIOke j, X ' Ch - Ch +X : next 140 '' ch <> 5 1230 then pnnt " checksun 1er ror " : end 150 print ·merge baste programs- curnrnodorc 64 160 pnnt • Joad the first progr at n .nlo ram 1 70 pnnt · type sys 32000 and follow in!;rruciiOns 175 new :rent ~,;aut1on savo hofnre running 180tlata 169. 0. 1.13, 183,169,147, 32,210 190data255. 16?, 0 . 32, 79. 126, 32,228 200 data 255, ?01 , 89. 240 . 7. 201. 78. 208 210tifliA?45 76134. 227, 162, 73, 32. 79 ??Odata 126, :32,201,25!:1, 201 . 20,2t10, 18 230 data 201, 1:.-J, 240, 14 . 166. 183.224. 16 240 data 240,231. 157. 60. 3. 232. 134, 18::! ~00data208 . 231.166.183 . 240, 2 19, 1fi!'l . 44 2GO data 157. 60. 3. 232. 1fi9 . 80 157, 60 270 data 3. 232 , 134, 18.1, t fi9 13, 32, 2 10 280 data 255, t fi!'l, 13, 133, 184, 1:33, 1Uo, 169 290 dntn 8 , 133, 186, 169, 3, 13J, 188. 169 300 OfliA 60, 133 , 187, 32, 192, 255. 162. 13 31 o data 32. 190, 2oo. 32. 57. 126. 32. 57 320 data 126, 32, 228. 255. 208. 211 . 32, 228 330 data 255. 208. 22. 162, 94, 32, 70, 1?o 340 data 169, 13 , 32. 195, 255, 32, ?04, 255 350 data 32. 89. 166. 76. 1::!4, ??7 , 32, 57 360 <.Ja1a 126, 32. 57. t?fi, 133. 20, 32, 51 370 data 126. 13.1, ?1. 160. 0, 32. bl , 1:::'G 380 dolo 15.1, 2. 240. 3 . 2ou. 20H. 245 3!'l0 nata 200. 152. 24. lOb. 4. 133. 11 . 32 400data 19, 166, 144, 68. 160. 1. 177, 95 410data 133, :J~. 165, 45,133, 34. 165, 96 420data 133 , 37,165. 95.136,24 1. 95. ?4 430 data 101, J15. 133. 45. 133. 36 165. 46 440 data 105. 255. 133, 46 ??9, 96 . 170, 56 J150 dala 165. 95, ??9, 45, 168, 176, 3, £:32 460 data 198, 37, 24, 101. 34 , 144, 3, 198 470 datA 35, 24.177. 34, 14o, :36,200.208 480 rlAta 249. 230. 35, 230, 37, 202. 208. 2'12 490data 32, 99, 166. 32. 51 . 165. 24. 165 500 data 45. 133. 90. 101 . 11 , 133. 88. 164 510 data 46. 132. 91, 1'1'1. 1, 200, 132, 8!'l o20data 32. 18J1, 163,165. 20. 164, ?1, 141 530 data 25t1 , 1. 140. 255, 1, 165, 49, 164 5J10dala 50. 133. 45 . 132. 46, 164, 11 , 136 550 data 185. 25?. 1. 145. 95, 136, 1U, 248 560 dnrA 3? 99 166, 32. 51 , 165, 76, 113 5 70 nAta 125, 32, 220, 2oo, 1Clll. 144 . 240. 13 SAO data 32, 204, 2o!:>, Hi2, 105. 32. 79, 126 590data 104, 104 , 76.128. 125, 170. 96. 189 600 data 91 , 126. 240. 6. 32. 210. 255, 23? 6 10oala208.245. 96. 13. 13. 18. 7t , 65 620 data 80. 32. 80. 82. 70, 7 1. 82, 65 630tlata 77 . 32, 77. f\9 82. 7 1, 69, 32 640 data 45. 3? 71 . 65 32. 80. U9, G5 650 dotn 8? 67 69, 32, 45, 32. 5G. 51 660 rlAia 48, 53, SO, 50, 14G, 13. 13 , 73 fi70 data 83, 32, 49, 83, 84. 32. 80, 82 680data 79, 11. 82, 65. 77. 32. 76. 79 690 data 65, 68. 69. 68. 63. 32. 40, 8!1 100 data 47. 78. 11 1. 0 . 13. 13, 50, 78 710 data 68. 32. 80. 82. 7!'1. 71 . 82. 65 720 J ala 77, 32, 78, f\fl . 77, 69. 63. 32 730 data 0 , I::\, I :1 77 69, 82. / 1, UY 740dala 3?, 7!1, 75, 0 13, 13. II . G9 750 rlntA 8?, 71 , 69, 32, 6o, UG, 79. 82 7f\O data 84, 69. oB, o

o

Volum• S, lnue 02


An Introduction To Tools & Techniques For Machine Language Programming

The special lure of writing machine langua;1e programs or subroutines is the fantastic speed that can be attained in program execution. We can do things with machine lanp,uage programs thnt sometimes iust cannot be done in BASIC. For example, I have a digital music synthesizer keyboard hooked up to my 64 through the user port. I am usin,g it for real-time playi[lf{ of music, but for th e system to react fast enough to my playing on the keyboard, I had to use machine lanp,uage. The BASIC prototype program would miss too many notes if l playe<.i too fast.

Writing in machine language brin~s with it new problems of program design and testing Since we are operating nt n much more detailed level, •we must make sure that we clot our I's and cross our T's (so to speak) or the programs jusr simply will not work. When then· is a bug (a mistake) in :1 machine language pro~ram, it can sometimes he VF.RY diHicult to find and correct, and the frustration of seeln~ dawn appear, and your program STILL not vmrking riRht, is unbelievable.

Phil Honsinger Kitchener, Ont.

Reference Manuals The 64 uses a 6510 micro-processor chip that is functionally equivalent to the 6502 chip, and there arc lots of books on the market for 6502 programming in machine lnngu(lgc. If you are <1n accomplished programmer nnd have workcrl with machine lanF(Ul\flC before. the books for you nrc rhc more clinical 'this is how ciich instruction works' type of book. If you are just startinR out, then some of the books arc designed as a teachinp, tool that will step you through the language and ils syntax, with plenty of cxnmplr~'i . You coulct even stcnl programs from rhc hooks for (dare I mention it) the APPLE (6502 ch ip agnin). The APPI.F. progmms woulrl hove ro hnvc adrlrcsscs, etc. convcrr<~cl to 64'csr., and this area is where a goocl rdcrcncc hook will he! prir.r.less. If you can get the TRANSACTOR's special reference issue (Vol. 4, Issue 05)- everything yoll wanted to know, including a list of Commodore related programming books.

An ASSEMRI.f.R

Fear not, oh brave souls 1 There me many tool~ ancl tP.r.hniques that can be borrowed from the professional pro~mm­ mer's arsenal of tricks that will help us write code thM is more accurate from the start, and thtJt will hdp us to finrt and correct our bugs much faster. As i1 professional programmer, I have many tricks- of-rhc-lrndr. Here nrc some that we can use at home:

An ASSF.MRI.ER is actually another program that allows you ro ctevelop the machine language programs iu the symbolic asscmhler language. The assembler wlll then translate the symbolic program into the exeeutable machine language r.odC' th;)t I he fi5 1() r.hip understands. This abstractness is what rnal«'.'i the assembler so valuablt:!. You Lleal i11 the higher level syntax, and this means the program:; will ue easier to develop (and umlerslaml) a11U tllili tra11slates into faster program development.

• • • • •

I have been using the PROGRAMMER'li TOOLBOX fru111 PRO- LINE software. AntOIIJ5 olht:r things, lbis softw are pad\age has a very good osseml>ler called PAL. Alter lhis introcll JCtion 1 \viii go into more detail on Assemulers. ur more specifically. The Two-Polis Asseml>ler.

reference manuals an ASSEMBLER pro~ra m a MONITOR program structured programmin~: and tE'sting techniques other programs and programmers

[' "jh~Ji'!!!!.c:!ct~r: - - - - - - - - -- - - - - - ·.::.5~ ...5 ·-·_ · ·__:__:_._::_::_ _ _ _ _ _ ·.. ·-···· ~ vo~l~ um :.!!.e~s,~~~::::l~~ "•~.o~2~


,- - - - - - - - - - - - - - - - - - - - - - - - - A MONITOR Program A MONITOR is another !Jrogran tlhat you will use for testing you r utad tim: lcmguage prograu ts. Jt allows you to interrupt tile execution of lhe machine language program at any point aml exa111ine I he 65 1Os registers. check utemory locations for proper resulls, and even manipulate data fur the express pu rposes of testing your application program . I have ueeu using Jim I:Mterfield's SUPERMON.

Structured Programming and Testing Techniques This is a very big topic among data processing managen;. Programmers who use these techniques will develo]J progrants faster and ntore au:urately than those who don't. What is this mysterious subject. you ask'? Wdl.

~ imply

JJUl. it is a way of thinking. You design your programs so that the more general logic can be written and tested functionally betore you get deeper and deeper into the dark details of the important processing. You can code aud test file opening, memory location in itialization. or even a cu rso1 IJOSitioniug routine as un its that are somewhat "stand-alone". Once you are satisfied that these units are working correctly on their own. then they can be incorporated into the larger program. and forgollen about until changes are re4uired iu these functional areas. You could then re-t~l the uuit witlt tlte changes on its own, and/or back in ll1e main JJWgrarn. There are, ol course, perlormance trade-ofrs to this kind of programming. Subroutine calls require process] ng overhead by the micro-processor, and you have to decide if the design is appropriate to the application. A real-time, high speed game wou ld need as lillie code as possible to keeJJ ltle program reaction lime to data changes as fast as required.

-~----------路----------------,

An assembler is a program rhat accepts mnemonics and parameters ac; inpttt, anrl g~ n ~mrcs n.o:; output the machine cnde program that the mncmon ir.o:; represent. Tile input coding is called the SO!IRCF. corlc. It is the Jnput

data to the assembler. Tile output generated by the assembler is calkrl the OBJECT code. This is tile machine language code thM will nrtually he ext:cuted at some l <~ter ti me. It is the actual machine l<tnguage program that the source mrlc symbolically represeuts. There may also be adclitional output from the assembler when it generates the object r.ocle, such as something called a SYMBOL TABLE. So as nol. to contradict its own purpose. the assembler is u ~ u ally another machine language program . Usu;:~lly an assembler will have been coded in it's own somr.r. cone fon11at, so we can use one version of the assr.mhlr.r to !JfOlluce the 11ext version (enhancements).

ll is inle re~tiug to leam how an assembler actually generC~ tPs lite o!Jject code from the source code, and 1hat's the topic of thi~ JJart of the article. I will describe, in gr.neml tP.rms, SOJilelltittg called a Two- Pass Assembler. A Two- Pass Assembler does exactly that . .. two pnsscs of the source code. The first par.;s is used to huilci something called the symbol table. The second pa<;s uses th~ sourer. code <H td the symbol table generated in the first pass to !Jrod uce the final resu lt. .. ynur nbjec:t code. The olJjcd cutle can I.Je stored in many ways: directly in I! ten tory (at the location that YOU tell it to); as a file on a ciisk drive lo IJe loaded in memory and executed later; or even just to the printer fm checking. The last option would be used when you are in the design stage of a project . .. like LISTing a ~AS IC program lu your printer that yo11 haven't actual ly RUN yet.

Other Programmers and Programs

Steal as much knowledge and experience as you can. Join computer clubs, read books and mags (like The Transactor). and experiment.

Now fo r a quick descriptiou of what is contained in the

source code.. .. Above all don't forget to "SAVE OFTEN", and have ru n. OPCODES aud OPERANDS (LOA H$()0, for example) (also called MNEMONICS and PARAMETERS)

The Two-Pass Assembler Working directly with machine language code is a very demandmg and arduous task. All you have to work with is hexadecimal numbers. To assist the programmer in generating machine language programs, special programs called ASSEMBLERS have been written.

LA.BEL.S

(lo symbolically represeut an

COMMeNT::;

address or lite localion of an ins! ruction) (Sdllll::! CIS ill BASIC)

And special statements for the assembler run

The Transactor

56

:

Volume 5, luue 02


The SYMBOL and INSTRUCTION TABLES are really the key " to the asS€mbler's success. The SYMBOL TABLE. is built from the source code and the INSTRUC1'10N 1"ABL£. The first pass decodes each statement, and bac;ed on the known leugth of the machine language instructions being generated, creates entries in the symbol table with the symbol's name, and its calculated address where it will appear in the object code. The second pass of the source code by the assembler takes any references to symbols (as a label, or in the parameters) and inserts the corresponding value into the actual object code generated.

Pass one would have generated the SYMBOL 'IJ\BLE. You would not normally see any111ing happening at this lime. Pass two would display a listing ot the assembled code. and the object code. The listrng (or display on the screen) usually contains the object code address for each of the sou rce code statements. along with the source code printed right beside its object code values. Each assembler will have different control statements and assembly options. but they will usually all conform to the same standards for the format of the actual source code statements. At some point, you can optionally print the SYMBOL TADLE.

Symbol tables can be printed after the assembly has been done, and are very useful in debugging a program. which can be done from the source code. or from the object code using a monitor (another special purpose program).

When we are developing programs we will be working with the source code and testing the object code, but after development is completed only the object code is used. You will, of course, keep the source code on file (a diskette, maybe) so that future changes can be made to the program just as easily as you created it in the first place.

Here's a simple example;

100 .OPT P,OO 110 •=$COOO 120 START == • 130 LOA "'00

The object code can be optionally stored on disk, and to run this machi ne language program, you would load i!, like any BASIC . program, and execute it. The only di fference is instead of 'RUN' you would enter the 'SYS' command followed by the program start address in decimal:

140 STA POINTER

150 RTS 160 POINTER = 170 .END

$00FB

This would produce a symbol table with 2 entries: SYS 828

$COOO START POINTER $00FB

... tells the computer to begin executi.ng amach ine code program that starts at location 828 decimal. Some Assemblers have the facilltv to combine BASIC and ASSEMBLER programs in the same source code file . Very handy! The SYS command could be included with the object code so that 'RUN' would execute the 'SYS' which would execute the machine code.

and would produce the object code as a string of l 's and O's, which in hex notation would be:

-

850095FB60 Related to addresses, it looks like :

I hope this somewhat general article has helped you to understand how an assembler works. If you are interested in doing machine language programming, then buy an Assembler... you won't be sorry!!

$COOO 8500 (LOA ¥QO) $C002 95FB (STA $00FB) (RTS) $C004 60 Running the program would load hex zero into location $00FB and do a subroutine return. The object code would be Inserted directly into memory starting at location $COOO. The .OPT P,OO is a special control statement that does not ~et translated into the objfft code. Ditto with START == •. POINTER "" $00FB, and the statements starting with ; (comments only).

••

fhe Trantoctor

S . 7

Volume 5 1 Issue 02

)


Your BASIC Monitor

Bob Drake Brantford, Ont.

This firs t of 3 parts describes a monitor program, \Vritten in BAS[C, that performs most of the functions of a machine language monitor such as TINYMON . The second part will implement a disassembler, and the third an assembler. The programs are written for the Commodore 64. Modifications for the VIC-20 are given. Changes for other computers should be relatively minor as odd programming structures are documented.

The program makes heavy use of some simple string techniques and peeks and pokes. A little simple disk and tape fi ling is thrown in for good luck and completeness. The program has several commands which correspond to the commands as implemented on most monitors for Commodore computers. All are accessed by single key presses. The menu display is one I have used before to keep the program commands on the screen. Pressing or holding 'RETURN' will erase the screen and bring back the menu.

Wby A Monitor In BASIC? Many of the students I teach have problems with the concepts or a low level language. What's a low level language you ask? BASIC is considered a 'h i ~h level' lan~ua~e because it is very close to ordinary English. Words like PRINT, TAB, FOR, NEXT are nice, simple, easy to understand words. Most high level languages (COBOL, LOCO, FORTRAN) share this property. Some, like APL, don't. A h igh level language does a lot of things for you automatically. PRINT " HI THERE · has the computer figure out what the word PRINT means, what the quotes mean, set up a loop and print the characters in order in the next locations on the screen .

Displaying Memory Pressing 'M' for 'Memory' djsplays the contents or the computer's RAM . This is a first look at the inside of a program and machine language. I usually start teaching this with someth ing like: for i = 2048 to 3000 : print peek(i), : next i and we get a list of numbers. We're 'peeking· or looking into those memory locations to see what's there. My favorite spots to look begin (on the C64) at 1024 for the screen, 2048 for BASIC, and 58543 for the power up message. We also type a lot entering that line again and again and again and . .. so it makes sense to create a small program:

Low level languages (usually referred to as machine language (!'.IlL) or assembler) bear IJttle resemblance to any living language. If we work with numbers (A9, FF, 4C), in base 16 (hexadecimal) we call that machine language or i'..'IL If we use ·assembler then we get to ~''Ork with neat words like LOA, STA. DEC. ROL, ROR which are called mnemonics (noo- mon- iks (Creek for memory aid)).A program that lets us write machine language in mnemonics is also called an assembler.

10 input " from" ;f 20 input" to ";t 30 for i = f to t 40 print peek(i}, 50 next i

and to clean up the presentation I also find there are problems with the concepts and use of I 0 input " from • ;f

PEEK and POKE. String handling is not much fun either. The capper on all this is a monitor written in machine language. There are monitor programs available for most computers but the average student has an aversion to them. This is a pro~ram they can't see (because it isn't written in a language they can read, let alone see), don't understand and wh ich crashes for almost no reason at all . The BASIC Monitor was written to ny to solve some of these problems.

LThe Tronsoctor

20 input" to

• ;t 30 for i = f to t step 8 35 for s 0 to 7 40 prin t pcck(i + s): 45 next s 46 print 50 next i

=

58

Volume 5, luue 02

]


Now we get a more or less ·normal' display. Not a terribly neat display since the numbers may be one, two or three dif.lits lon~. but 'normal'. Normal means this is what you usually get with a Commodore monitor program, eight bytes or characters.

Thus 163 "" $A3. Usually a dollar sign is written in front of hex numbers. So 163 = $A3. Sometimes you will see hex numbers written with an II preceding. So J 63 = SA3 ..,. hA3. To do the conversion from decimal to hex on the computer, I use a little subroutine.

I also like to show my studems what those numbers mean. So we add a line like:

110 h$- • 0123456 789abcdef • 111 by% - by/ 16 :rem quotient without decimal :rem remainder 112 r ;; by- by%•16 113 f$- mid$(h$,by % + I ,1) :rem first hex digit :rem second digit 114 s$ = mid${h$,r + 1, 1) :rem 2 digit hex number 115 by$.-. f$ + s$

44 print chr$(peek(i + s)); and better to control the printout,

Unes Il l to 115 can be condensed to:

44 print chr$(34) chr$(peek(i + s)) chr$(34); CHR$(34) is the quote ( ·) and keeps the display under control when you hit a clear screen command or some other screen com mand.

7020 byS - mid$(h$,by/ 16+ 1,1) + mid${h$,by-int(by/ 16)• 16 + 1,1)

H$ contains all the symbols for hex. The correct fi rst digit is found with the MID$(H$, BY %+ 1, 1). BY% includes an INT function to get rid of the decimal after dividing. You need the + I because hex numbers start at zero and I I$ doesn't have a zeroeth character but does have a first character. We get the second character the same way using the remainder.

If you've followed me to hcrr nnd tried this out you probably have one awful screen display. Nasty things happen too. Colours change; the screen clears: you ~et up and down cursor movements. All sorts of horrible things happen. I've even broken into the ML monitor on my PET doin~ this. VERY nasty.

HEXADECIMAL Let's clCJn up that displny F'irst, we'll fix the numbers. As humnns, we usf' df'rimnl nrithmf'tic. That means we count from 0 to 9 nnd thf'n stnrt rrusing thosf' symhols to form 10, 11 and so on. Probably we usc dccimal because we have ten fingers. Most microcomputers usf' hcxndccimal arithmetic. They cmmt from 0 to 1S. (1cion't know whflt thnt snys about the numbrr of fingrrs they haw~ .) Now rmmring from 1 to 10 is easy. How lh<' heck cfo wr. count from 0 to 1.1? You m<~y think all you flo is count from 0 to I fi (I mr.nn tiirln'r I jnst do rhnr'?) htll thl' m l~s of numhrrlnf{ say you can only hnvc one symhol for <'nrh nt tmhr r in thr h<~sr scr. For example zero ls 0, one is 1 <~nrl so on hut 10 rcquirr.s a 'ZNO ann none. We're fine till we hit l 0 through I fi and thcn wr. start rr.ttsing our symbols. Well, to rou nt rom 0 to 1S WC' nl'ecl 11) symhols. Zero through 9 are nl r<'ncfy okny. Now wr. only nccc1 6 more. The symbols usually userl nrc A, R, r., n, F'., nnrl F'. A is I 0, R is 11 and so on. F is 15. The method of converting a number from 17 to 255 from decimal to hex is simple. Divide IJy 16. The quotient is the first digit, the remainder is the second . So... I 63 becomes: 163/ 16

=

10

Memory Display ... Again

To fix up the string display, we have to remember that certain peeked numbers will cause trouble. They are:

I3 = $00 is a carria~e return 20 = $14 is the delete character 34 = $22 is a quote 14 1 = $80 is a shifted carriage return You cnn tnkc rare of the peeked values like this. 11 50 tS= •" I I flO for s = 0 to 7 1170 hy = prl'k(m • s) 121 0 if by = 1~ or hy = 20 or by-= 34 or by= 141 then by= 32 : rem convert to spnccs 1220 tS=tS t rhr$(hy) 12~0 nl'xt s 1240 rrint q$ t$ q$: rem q$ is a quote

= SA TS is a string of eight rharartNs we huild out of the peeks. It is "nulled" or emptied in lint' I I !10. RY is the valuE> peeked.

with a re111aiuder of 3.

The Tranaactor

These subroutines can be called directly from the monitor by pressing C for Calculator. Enter a number and it is converted to hex. If the number starts with either $ or h, then the hex value it represents is converted to decimal.

59


,----------------------·-·--··----··---- ------··--··--------·--·---

Notice that 1210 changes the iliP..gal charactrrs to sparr.s and 1220 nppcncls ir ro T$ Linr. 1240 prints the string between quorr.s so th!ll all the ch<~ rartF.rs ofT$ print.

nu mhcr 0 to 9) and minus one if m I represents a letter (A to F).

7410 m$ = righ t$(" 0000" + m$,4) 7420 m = O 7430 fori= l ro 4 7440 ml =-as('(mid$(m$, i,1 )) 74SO rn =m t (ml-4~ t 7""({m I >64)));r. J6t(4-i) 7460 next i 7470 return

Registers

1

The registers arc memory locations in the \.PIJ or central processing unit that the m rnputer w;es for addition, counting, and transferring data. They are referred to on the ()500 series of r.h ips ns thl'! accumulator (AC), the x register (XR), the y register (YR) and the status register (SR). Commodore makr.s it easy to look at these in the \.64 and VlC 20. Copies of their va lue~; are stored in locations 780 to 7&3. Just peek them, convert to hexadecimal and print.

Poking Memory Poking memory is sort of a first step to writing mach ine language_ Poking is the reverse of peeking. Instead of looking at a spot in RAM and seei1tg what IIUJttuer!'i are there, you cledde what numbers you want put into RAI\1 and poke puts them there. Tltose numbers t an represent in· stru d io11s (like PRINT, only !'iimpler) ur tlala (like '' HI THERE "). At this level of the program you have to know tlte numbers and what each dues. You coulu fo r example say: Put a 5 into the accumu lator$A9 05 (169 5) Add 2 $69 02 (1 0.5 2) Stop - retum to BASIC $60 {96)

The suhroulincs at 4000 and 4500 save a range of pe-eked vt~lucs as a rape or disk file. Disk errors are checked in lines 4R00- 4R70.

GO RUNning a mach ine language program from BASIC is easy. .Just type SYS (the same way you \vould type RUN) anc1 the a<.ltlress (location in memory) where ynur rnar:hine language progrant starts. SYS is the ML eqttivalent of RUN, rxccpt RU will start with the first line of BASI\. unlr:ss you specify another (eg. RUN I 00) - SYS \viii not default to an arhitrary location, it must have an acldn~ss spr.cificd . Thnt's ;)II the subroutine at line 5000 does.

PRINTER

To do this poke 169.5, I05,2,96 iuto 5 rnemory lucatiuns aud then rurt that progra111. The BASIC Moui!or allows you to poke lhe values in hex, tlte way tl1ey an~ nunually listetl a1 td ruu the program frurn the monitor. Just press P for POKE. pick a spol tu put your program ($~3C is prelly good) aud \:!Iller uytes $A~ 05 69 02 60 as you r prvgraut alt{lfilllh~;;: resl of the line with 00 (stop). You can ru n the program by vressiug U fur GO. Within lhe program . we can re-use our mernory display to see what i~ already in memory. \Vhen we poke values \·\'e need them in decimal. The references you find for machine language are in hex. We must convert l1ex to decimal. All we do is take the first digit. multiply by J6 and add the second digit. This subroutine is a little fancier than 111at. It accepts hex numbers I, 2. 3. or 4 digits long. lo make it work. I force the hex number to be 4 digits long by adding • 0000" (leading zems) then taking the four right hand characters. Line 7440 looks at the number the computer assigns to the tirst letter of the hex number. Line '1430 is the fancy line. It converts this ASCII va.lue to a nu mber from 0 to 15 and mu l tiplies by the appropriate power of 1G. The + 7 •((m l >64)) is zero if m J>64 is false (i.e. m I represents a

The Tran1octor

SAVING And LOADING

'

I wanted printer dumps of the memory peeks ancl registP.rs. The subroutine at6000 and the PR!NT*PR, in the routine nt line 1000 accomplish this in a simple mann er. It's not terribly fast, but it works easily. That's pretty well iL You might try ruuning this little pro· gran1 as well as the one given auove. By the way, be sure to check tlte registers i11 the oue above to JJtake sure you get sev~::: n . Slarliug at $3:3C, poke values of 20 ·H E5 60. You should deai lhe scn~eu uu your C6 11. (Us~:! 20 5F E5 60 on your VIC ~0). Press RE'l'URN to get back to the menu.

The program listing follows. The comma.ud tlJ ~uu shows selections that a1en't available yet. Don'l let L11atthrow yuu. Jn the next part of this article. we'll add the Disassembler and alter that the Assembler. Use the line numbers as shown. If you don't, the additions and changes to come won't tall into place. ~ee you then!

60 .

Volume

$, la&ue 02


~------------------------------------------------------------------------~·-

11 10 t$- ... 1120 fur s .. 0 to 7 1130 by- pcck(m + s) t 140 oosub 7000·rem 2 digit nex 1150 printHpr, by$ • • ; 11 o1 rem v1c•replace 11 50 wrlll, 1152. 1153 JJ1illl "8 " ::rf pr • 2 n1cn printtfpr, • " 1152 If s/2- tnl(s/2) 1153 pr ir1t# pr. by$;" • 1160 if by- t 3 or hy ~ 41 or by "' 20 or by - 34 then by ... 32 I 170 t$ - t$ + chr$(by) 1171 rf s<> 7 then t$ ""t$ + • • :rem v1c •add th1s line 1100 next s 1190 pnntNpr, q$ t$ q$.rem vic• prmiiiJJr," • q$1$ q$ :rem 4

100 rem baSIC monitor• copynght 1964 • r.drake• free to copy- not to sell 101 '~"' • U11s l)royrarn lishny un;lud~~ I.Juth the commodore 64 and v1c 20 10? rem • ver<~10ns of the basic monitor program 103 rem .. the overall program is that for the c64. 104 rem • changes lor the v1c are carefully notated w1thm the hsttng. 105 rem tv enlt:ll the c6, version. ju~:>t lyl)e i11l1 1 ~ lishny iynor~ng 106 rern • lines referenced by vic• 107 rem • to I'JntP.r the vic ver~ion. P.nter the rep.lacement lines as noted 100 rem • hne numbers on the f1rst lines ot changes are 1mportant, 109 rem • second hnes are not. do not ent~:~r linel:i 101- 109 110 n$ - • 0123456789abcdef • 120 q$ • chr$(34) : cr$ '"'chr$( 13) 130 open 1,3 · rem screen 140 open 2,4 . rem printer 150 p = 1 pnnter ott 160 print • 170

spac~t>

1200 next pr 121 0 if pcck(65~) rhen 1210 rem look ror shift key 1220 get a$ :if a$<>crS then 12!:10 :rem took tor return key 1230m= t 1 240 goto 1250 1250 next m 1255 il 111>1 then gel a$ : if n$<" • then I ?55 1260 return 2000 rem re,aisters 2010 pnnt "lldlsplay regrslers " 2020 tor pr .- 1 top 2030 for m - 0 to 3 201\0 I.Jy • peek(m 1 780): rem not IWAiiAhfe on pet 2050 ooouh 7000 2060 print#pr,mid$( • ac:xr:yr:sr: • ,m•3 + 1,:;)by$, 2070 next m 2080 pnnt#pr 2090 next pr 2100 relur 11 3000 rem pokr. memory 3010 print" l poke memory " 3020 i-0 3o:;u pnnt 3040 rnput · from· :m$ 3050 QOt>UU 7120 30601-m ~070t - f+ 7 3080 pnnt 3090 gosub 10UO 3100 fork31 10 inl)ul " • ;rn$ :rem vic.. 3 up r:msors 1 ·I k): m$; • ·: 3120 print :1 1? 1 rP.mvic+reptace3120with3122, 23 3122 if kl2<>int(k/2)then print 3 123 print lab(o + k•2);m$; 3 130 pnnt .rem VIC• print chr$(13): 3140 gosub 7120 3150 poke f 1 k.m 3160 nnxt k 3170 1nput ·more yf31efls]" ;a$ 3 1BO rf a$<>· y" then return :;1YOI=t+ .. 3200 plint" 3210 yolo 4000 rom GOVC 4010 print "l save • 4020 s$- "w " 4030 qosub 4280 : 11t = -1 then goto 4130 4040 gosub 4380 . 11 f1$ - • • then yolo ~ 130

180

190 ror ... to :rem vic+ use 22 ror 40 200 pnnt • • • ; :rem shift- • 2 10 next 1 220 I$ - • XI IH iJSfQ•t: • 230 r - lun(r$) 240 got n$ 250 if a$ = " • or a$ ..... cr$ then goto 160 260 If 8$ "' mor r ,1) then QOIO :;QQ 270 r = r- 1 280 1f r - 0 then goto 230 290 yolo 260 300 if r< > I then 350 310 CIOSF! 1 320 close 2 :;:;u pnnt "lend" 340 end 350 on r yv~:>ub 0,1000.2000.3000,~ 000. 4140.5000.6000.7500 360 11 -0 370 goto 230 1000 rem memory 1010 pnnt • rloconl::.v rru:omnrv • to stop· 1020 pnnt 1101:u to l)auw. lr~:~tur 1021 rern v,,.,.. 1020 wrth lrne 1022 to stop· 1022 pnnt • hold to paus~ r 10::\0 [JOSI Ih '+ r'no 1040 11t< - f then t- f + 7 1O!JU 11 t<O or t<O or 1>U 5 ~35 or 1>6!:>535 then 1260 1060 tor m - I to I step 8 1070 f01 IJI ... 1 to 1J 1080 "- rn 1090 gomrh 703D·mm r.onverr to hex 1100 print#pr. by$· · · :

"I ' ·1";

l m11

Tho Transactor

61

Volume S, Issue 02

I


6040 goto 6070 6050 p=2 6060 print "l printer on" 6070 return 7000 rem 2 digit dec to hex /010 by$ = m1d${h$, by/ 16 + 1.1) + mid$(h$.by- int(by/16)• 16 + 1. 1) 7020 r~IUIII 7030 rem 4 digit dec to hex 7040 hy$= ... 7050 n- nl 4096 7060 fori= 1 to 4 7070 n% - n 7080 uy$"' uy$ + c;hr$(no/o + 55 + 7•(n%< 10)) 7090 n •(n n%) .. 16 7 100 next ' 71 10 return 71 20 rem hex to dec 7130 m$ - right$(" 0000" + m$,4) 71400 1= 0 7150 fori= 1 to 4 7 160 m 1 = a~c(m irl$(m$,i, 1)) . 7170 m = m + {m1-48 + 7•((m1>64)))$1 6t(4- i) 7180 next i 7190 return 7500 rem calculator 751 0 print 7520 in rut· numhm" ;n$ 7530 ifleft$(n$,1)= "$" orleft$(nS.1)- "h" then 7580 7540 n ,_ val(n$) 7550 gosub 7560 print • " ., "$ • by$:ren I vi~,;• f.)ri11t l3b(7) • $" IJy$ 7570 goto 7580 m$ = m ta:t>ln:t.. .~ 7590 gosub 7600 print • • ..m :rem vic• print tab(O) m 7610 return

4050 open3,dv.2.fiS 4060 go~ u b 4 460 4070 print#3. f;cr$;t;cr$; 4080 tori = f to t 4090 print#3, peek(i) cr$; 4100 next i 4 110fl - 1 4120 gosub 4460 4 130 return 4 ·t 40 rem load 4150 print "l load" 41 60 s$= • r • 4170 gosub 4380 4180 Of..l~l13.dv. 2,fi$ 4 190 gosub 4460 4200 inputit3 ,f, r 421 0 for i - f to t 4220 inputH3.a 4230 poke i.a 4240 next i 4250 II "" 1 4260 gosub 4460 4270 return 4280 rem from- to 4290 rnput "from" ;m$ 4300 gosub 7120 43 10 1=rn 4320 print " • .. 4330 input to ;m$ 4340 gosub 7l20 4350 ' "" m 4360 il 1<0 "'-1<0 or 1>65535 or 1>65535 then print ' a-values out of range" :f = - 1 4370 return 4380 rem file name & d 4390 dv$ = • " : input· or ";dv$ 4400 ti$ "' • " : dv "" 1 "" • d "" " " then 4420 4410 ir1pu1 · file narne " ;li$ 4420 il l iS= • " then print" aborted" : relur n 4430 it lP.n(fi$)> 16 then 1i$ = lcft$(fi$, 16) 4440ifdv = Bthenfi$ = "0: " +fi$+ · .s. • +s$ 4450 return 4460 rem d rsk status 44 70 if II -= 0 t11en open 4 .8.15 4480 inpul#4 ,b$.b$ 4490 print " disk stntus: " b$ 4500 if II = 0 then return 4510 ctose3 4520 c1ose4 4530 return 4540 slop 5000 rem go 5010 print "l run ml program .. 5020 input" address" ;m$ 5030 gosub 7120 5040 input" are you sure" ;a$ 5050 if a$"' then sys m 5060 print "lldone 5070 return 6000 rem printer 6010 if p '"" 1 then 6050 6020 p = 1 6030 print • l printar off "

:.:J :

The Transactor

62


- --- ----'--- - -- - - - - - - - - - - - - - - - - -- -- - ---·-- -, Finding PI Experimentally Michael Bertrand

-----

Madison, WI Miclwel Bertrand hnlrls on MA in Mmhemarics from tl1e Urtiuersity of Wismnsin. Hr.rf' hPpresents a new approach to ilwt uge old puzzler. 100 for i"" 1 to n : gosub200 110 if ut2 + vt2 < 1 then c - c + 1 120 nexti:end 200 gosub300 : u = s : gosub300 : v = s 210 return 300 s-197•s : s=s-int(s) 310 return

Cu111pulers have opened up the possihilily of doing experi· mental mathernalics. Su ppos~. for cxnmpk, we wish to kuuw the area of a ci rcle of raciilJs onr. Fit the circle snugly ius ide a squc:~re of side twn (see fi gme I). Pnstr this picture to the Wd ll amJ ra11uomly throw darts <Jt it, maki nR sure that they always fall im;iue the square (hut nor nrc~ssa rily the drde - a few darts will land in rhr corners outside the cirde). We expect the proportion of dans landinp, inside the ~.:ir cle to t!lJUiil approximately the ratio of rhr arr11 of the circle to the an:!a of the square. That i.o;: II

Subroutine 300- 310 is a random number generator - I don't trust Commodore·s. Keep in mind that a point (u,v) in the unit square is within the quarter circle if and only if u2 + v 1 < I - this is line 110 - and the "hits" ar e countetluy variable C.

darts falli11g inside drde _ nrrn of rircl ~ total ff of tliirls thrown nrc'.a of SfJllilr<'

This works fine, but is slow - about 7 trrals per second. I rewrote the program in machine language on the Commodore 8032, improving run time by a factor ol l ~i (auoul 90 trials per second). My strategy must be identical to t>ASIC's, si nce the machine language gives the same result as the above BASIC program every time. I depend heavily on the floating point accumulator ROM routines for numerical operations, as BASIC does. The actual value of pi, correct to 7 decimal places, is 3. 141 592. II ere are the results of the program for a seed value of s = .49032371 :

Now the areii of the square• - 2J "" 4. so: area of circle ,. 4 •

* nf darts falling insklC'.C:jrclc total,.. of ciarts thrown

Two French rnatllernatidans, rhr. Comtr de Buffon (1707 - 1788) iind Pierre l.apl01rr. (1749- 1R27), wl'rc the first to di!>L1JSS problems like this. Intrepid f'XpcrimrntNS took up the challenge over the years with mixed rr.sults With a COOIJJUler. however, the physical experi mr.nr r 01 n he si mulatcu with ramlulll nunrbers. 1\n<.lunll~ss you ran throw 00 darts per seconu , the computer doe.o; it fastrr.

1,000,000

=

1,000 10,000 I00,000 1,000,000

Now the art~d uf a circle of riidius one Lo; pi•! ~ pi - in fact tlri:> coultl serve as the dc•finition of pi. Thns finding the area of a circle is identical to finding the valu<' of pi. Prugrdlllllling this experiment is facilitatNi hy mnrcn tratin ~ on the uwer right haml tJUiirter of figurr. I - sr.C' figmc 2. Tilt! analysis for figure 2 is similar to thnt nhovr., since we have !>Caletl tlown both cirdc• ancl squam hy a fnctor of 4. Thus:

variance from actual value

3.128 3.1332 3.13572 3.1 40852

- .01359 -.008::$9

tl

-.UU51H

-.00074 3lt.......-s.,

If we knew the radius of the earth and the last value here were used for pi in the formula: circumference - 2•pi •radius.

pi = ·1 •(<u ea of quiirler circle) = 4 o( darts faiJj]lg in utr rirr lr. lolol 11 or tliirts thrown

then th e value given for the earth's circumference would be ' off by less than Gmiles.

*"'

Running experiments is not a very efficient way of calculat· ing pi compared to evaluating power senes expansions. rv1y purpose is rather to present an understandable example ol computer simulation, or what is aptly called the " Monte Carlo" method. The technique is of great value when alter-

In our cu111puter experiruenl the "dart.o;" arr. of ronrsc just rando111 nu111bers. If s = iill initial sped Vilhrr hf'rwr.rn 0 and I. and n the nu111ber of triiils, then the following RASIC program performs the experilllenl 11 tir11es:

=

Tho Tronaoctor

approximation of pi

63

--

Volumo 5, lque 02

svw\1V"


native analytical methods are unknown or prohibitively

difficu lt. Following is a short annotation of the ml program:

. This program shows how to put BASIC's floating point ROM routines to work without BASIC's overhead. Run time is generally improved by factors of I 2 to 15. It thi.s is what you need for number-crunching applications, then check out those floating point ROMs.

$033c-0340: floating point work area 0341-0345: temporary storage of (random value)2 0346-034a: 197 in floating point format: (136,69,0,0,0)

decimal .

Figure 1 .

034b-034f: 1 in floating point format: (129,0.0,0,0) deci-

-----··------~\ ,')

mal 0350-0352: total 11 of trials (n) in 3-byte format - ie, base

'

256 11

of "hils" in 3-byte format~ ie, base 256 0356-037b: subroutine to put new random vaJue in $033c and (random valuer in fpacc'~l 0353- 0355:

037c-03d6: main routine to do compari son n times and

count "hits" The bit of code at $03cd-03d3 allows interruption of ml execution by pressing the up arrow ($5e ASCII). I flnd this invaluable in debugging ml programs. It doesn't hurt in the

final version either: additional run time is minimaJ , and program execution can be resumed · from BASIC with

"goto180" since all necessary values are saved. .....

....

I I

N

1\

1.)

:J VI

!....------- - - - - - - - - - - The Transactor

Figure 2.

______..____

......_ -·--·---·-·------·----~·---·

:: :

::

:

:

::::

-~----~--

Volt!:J:n• 5, laaue 02

I


lOrem •• ~•••••••• • ~••• ••••••• • •••• • •••• ••••••• •••••••• ... 15 rem • 20 rem • • pi program -calculates pi experimentally. • 25 rem+ machine language depends heavily on the • 30 rem+ floating point accumulator rom routines. 35 rem • BASIC 4.0 ONLY 40 rem • + press the up arrow to interrupt ml execution execution can be continued with 'goto180'. 45 rem • 50 rem • 55 rem • • data/prg at $033c-$03d6 (828-982 dec) 60 rem • 65 rem • + + + + by michael bertrand + + + + + 70 rem •

.. ..

80: 90 print • ·; 100 input number of trials • ;n : print 102 if n> 16777215 then print" -M of trials must be < 16777216 • :print:goto 100 l l 0 input · seed (between 0 and 1)" ;s : print 11 2 if s< ::;;; 0 or s> ;;;: 1 then print • seed must be between 0 and l " :print:goto 110 120 m = 828:gosub200 :rem • puts seed, in fp format, into (828,829, ...) 130 s..;.. 197:m ""' 838:gosub200 :rem • puts 197, in fp format, into (838, 839, ...) 140 s =1:m;; 843:gosu b200 :rem • puts 1, in fp format, into (843, 844, . ..) 144 n 1=n-1 :d3 == int(n l /65536):n 1 :;;: n 1-d3•655.36:d2 "" int(n 1/256):d 1 - n l-d2 •256 148 poke 848, d3: poke 849, d2: poke 850, dl 170 for i "" 851 to 982 : read x : ch ~ ch + x 175 poke i, x : next : if ch<> 13424 then print ·data error· : end 180 sys 892 184 c = 65536•peek(85 l) + 256•peek(852) + peek(853) 188 pri nt "approximation of pi = • 4•c/n : print : end 192: 194 rem + subroutine 200-230 puts real numbers, I 96 rem • in floating point format, into memory 198 rem • locations [m,m + l,m +2,m +3,m+4] 200 e "dnt(log(s)/log(2)): p(O) = 129+e 210 p = (s/2te-1)+128:p(l )- int(p):r = p-p(t) 220 for i = 2 to 4 : p =r•256 : p(i) = int(p) : r = p-p(i) : next i 230 for i "" 0 to4 : poke m + i, p(i): next i : return

232 : 300 data 0, 0, 0, 169, 60, 160, 3, 32, 216, 204, 169 310data 70, 160, 3, 32, 94,203, 32, 66,205, 32, 2 320data206, 32, 137,201, 162, 60,160, 3, 32, 10, 205 330data169, 60, 160, 3, 32, 94, 203, 96, 32, 86, 3 340 data 162, 65, 160, 3, 32, 10,205, 32, 86, 3, 169 350 data 65 , 160, 3, 32, 157, 201, 169, 75, 160, 3, 32 360 data 145, 205, 20 I , 255, 208, 19, 238, 85, 3, 173, 85 370data 3, 208, 11 ,238, 84, 3, 173, 84, 3, 208, 3 380 data 238, 83, 3, 173, 82. 3, 72 , 206, 82, 3, 104 390 data 208, 21, 173, 81 , 3, 72, 206, 81, 3, 104, 208 400data 11, 173, 80, 3, 72,206, 80, 3, 104,208, I 410 dato 96 , 32, 228, 255, 201, 94, 240, 248, 76. 124, 3

[

The Tran1odor

65

Volume 5, IIIU!_~_ I


Translating a BASIC Program Chris Zamara Downsview, Ont. Into Machine Language

Did you ever write a nifty and clever ~.ame in BASIC, only to discover that once you added all the features yOLI wanted, the game was no fun to play because it was too slow? Did you then vow that ·someday· you'd write that prow am in rnach ine language, putting it off indefin it~ly, because, while understanding the basics of machine langu~e. you didn't know where to start? Well, if you are in a similar predicament with any sort of BASIC proRram, fe<n· not: it cun sometimes be very easy to translate a program into machine language, or at least use machi ne languaRe subroutines to speed things up. Read on and see how the humble little BASIC program in Listing I went on to become the machine language program in Listing 3. While you're at it, try typing the programs in on your Commodore 64 . They graphically illustrate some physical laws of motion, and can be fun to play around 'Nith. Using the BASIC interpreter built Into the C64 is t~n Qxccllcnt '· way to develop a program. Programs are easy to enter, modify, and de-bug. Many programs can be used in their final form as BASIC code, but for real-time simulations or similar applications. BASIC just Isn't fast enough. When this is the case, we have to go to machine language, or m lcac;t use one or more machine lnngunge su hrolllincs wi th the BASIC code.

Even if you plan on using machine languap,e right from the beginning, it is usually conv e nh~ n t to usc RASIC to get the logic of the prop,rnm working right , ;mel then 'transliltc' the BASIC program into mnchinc langmgc. Many peoplr. arc fam iliar with the hasic concepts of machine language, hut fear the jump from the world of BASIC, lntimirlatcd hy machine lanp,uage's lack of flonti.ng-point vnrinhlc$, mll ltiply and divide functions, etc. Fortunately, yon can ust1nlly g~:'t around the above limitations. without using routines from ROM , anrl wirho11t writing lengthy .sutmmtim~s. The

kind of program that requires the speed of machine ian· guage is usually a simple computer model , or simulation. of some kind (such as a game)_Such a program lends itself well to machine languap,e, and can usually be written usinp, simple integer operations, or usinp, tablE:>-lookups for complex functions.

Rocket Simulator Example Conversion To illustrate conversion of a BASIC program to machine language. I v.•ill use the relatively short proRrarn " ROCKET" in Listinp, l . This program simulates the acceleration of a rocket (represented by a sprite) under the influence of its engines (pushing it U'P), and gravity (pulling it down). When the program is runninR, pressi.nf, the space bar turns the rocket's enp,ines on. and releasing ir Ct1ts them . The rocket • accelerates ns it wou ld under these conditions, ncgletting wind resistance. The rocket's thrust and the strength of gravity <1re variable. Further, this prop,rarn has n few e~tras, allowi nR you to try to l[mci the craft without rrnc;hing (the minimum crash VC'Iodty is also lldjustnblc). To c.hnngc nny of the thrcc> pnrnmcrers. displnycci nr thc> rop of the scrcc>n ' . while the progmm· is running, p rc~ss RREAK, r.hangr. the vnlucs to whntcvcr you want. then press RF.TI JRN. Note that <1t fastcr rocket c;pP.C'rls, rhc sprite's movement is somewhat jerky . This is hcrnuc;c the srritc> is moving morc thnn one line nr n time', ro make it move faster. To mnkc tht• sp rite movP j11st as quickly, hut only one line at a time for smooth motion , we have to go to machine lang11age.

Rcforc we stnrt translating the program to machine lan g11agc, nn cxplnnation of how it works: First the program loads sprite ddi nitio ns for the sh ip, two types of engine flames, and the 'nash' shape into sprite pages 200- 203 (you can define your own sprites, or type in the program i11 listing

- - -- - - - - -·-·--

I

Th• Tronwdof'

66 Volume 5, luue 02 ·--·------·-·------- - - - - - - - -- - --==---------·------__:,;==..:::.L.=::.:::..:::..::..__;


,..------- - -- --------- - - 2 to create the sprit~ l.lt:fiuitiou file_If you arf~ thf' imparicnt type, delete line I 90 diiLI Llou't bother with the sprit~ defmilton for now; you r 'ruck~t' will look funny, hill the program will still work)_ Then some sprite parameters are PUKt::d into lh~ VIC II viLieu chip_ The main progmm loop begins at line 410_ The variaule 'VELOCITY' is thr. speed of the rocket. and actually im.liUttes how many Y villncs will be sktpped on each tnuveuu:ml of the sprite. Eilrh tim<' through the loop. '(jt<AVITY' i~ aLILicLI to this variahl<', am1 if the space bar is pressed, 'THRUST' (the strength of thr. rocket's engines) is subtracted fro tH iL GRAVITY A~m THRl JST remain constant unless ma11ually changed by first stopping the program_ The rocket's 'flames' are also turned on and fltckered tf the space bar is vr~ : tile name sprite is enabled. and the two lldtue shapes allemately sPIPrlf'ft The vanable 'VELOCITY' is tlteu added to the Y position of the sprite, and ·y· is stored in the svrile':; Y rt!gister. The flame's Y register is also updated (~0 un its uelow the rocket). Additional logic stops the ship at the tuv aml uottom of the screen, and indicates a crash or good landiu~. These extra features will not be incurvoratt!tl iu our machine langnagr translalton. but left as an ex~rcbe lor the ambitious reader.

the way I wrote the original version of the program, using a word 10 store the abovementioned vanables. The variables increased so quickly. though, that a vety long delay was needed each time through the loop to keep the rocket's speed reasonable. The sprite's Y value ended uv bei n~ increased by more than one unit at a time. so I decided to use three bytes per variable. In hnes 2 I 0-240 of Listin~ 3, you can see three bytes allocated to the important voriables_ Now, when we use the most significant byte ol 'ROCKY', we are actually dividing the variable by 65,5:36! This Rives us very good accuracy, and even at very high rocket velocities. the sprite only moves one line at a time.

What about negative values? We certainly need negative vCllucs in this program, since the velocity IS positive when the rocket is going down, and negative when rismg. Luckily for liS, the 6502 deals with numbers represented in two's romplcment form, so that we can represent negative values. In two's complement, a negative value always has its most significant bit (MSB) set. Using a single byte variable as an f'Xample, negative I is represented by 255, negative 2 by 2.=i4, etc. Inverting all bits in a byte and adding I will make a Translatmg the tirst part ol the vrogrant, st!lting up the sprite nrgCllive number positive, or a positive number negative. In parameters (lines 21U-280 in Listing I) i:; no problem_ this wny, a byte can hold values from -128 to + 127. Two POKEs are replaced by LUAs and ~nt\s. This is done in lines bytes can store values from -32768 to + 32767, and three 320-440 in the assembler program of Lisliug :t I decided to bytrs, whllt we are usinR in this program, can store values add sound effects for the blasting of the rocket's eugine in from ilroond minus to plus 8.4 million. Thus. no special the mach1ne language ve1sion, so a few SIO dti!J varamelers roof' has to be written to deal with negative values; we can are set up in lines 4G0-520. So far, so good. !Jut uuw come; simply aoo and subtract numbers freely, regardless of their • stgn. the hard part. How do we deal with the variables'? The main variables used to simulate the rocket's utution are TI IRUST, GRAVITY. VELOCITY, and Y. In the HASIC program, these variables are floatmg pomt, and a!>:>ullle fractional values. I low do we handle this in machine lan~uagt!'? Well, the easiest thing to do IS to use large integers for all calculations (we can use more than one byte fur a siugle variable), and then divide Y down by a large amount to gel the sprite's Y value, which must be between 0 and 255 . Did I say divide? In machine language? Egad! Actually, we <.:<m divide by powers of 2 very easily. just by shifting a byte (using LSR or ROR) right one or more limes. 1M if we are using two bytes to store a value (tvvo bytes is a wurd). it's even easier if v:e want to divide by 2SG. All we have to do is use the most significant byte. For example. if ·y• (called 'ROCKY' in the machine language program) rs stored as a word, the first byte in the word is the least significant byte. and the next byte is the most significant byte. The most significant byte increases by I when the least significant byte generates a carry, i.e. it gets bigger than 2S!J. If we use the most significant byte as theY value for the sprite, we have effectively divided the variable 'ROCKY' by 25G. This is

[

To add or subtract th('SC three byte variables, we have to add onE' hyrc at a rime. For example. see lines 640-7 40 in Listing ~ where gravity is nddcd to velocity. When an addition is pe rform~ in the 6502 via the ADC instruction, the value of thP cilrry flag is always added to the result (ADC is an acronym for Arid with Carry). The reason for this will b~corne apparent. Rcforc addi n~ the least significant bytes of the variab!e_r.; tog~:thrr, we clear the carry flag with the CLC instruction. The ilddition is then performed, in this case ~turi ng the result bark into 'VELOCITY'. If the result of this addition causes a carry past the most siRnificant bit, the carry flag will br set. Thus, when we add the next most si~uificant uyte of the vnriahlcs (without clearing the carry llag !irsl). lhe carry will he adrlN1 in. Llkewise for the final, must sigrlificant byte. We r.onlrl arlo together any number of byt~~ in this manner, reprC'-<;cnting huge integer values, or very at:tu rate floating point values. Now that the basics of how to h;mcllc the main variables have uet::n ueterrnilled. let's !ranslatr. rhc nctual code. Keep in mind that this will be a very 'Ions<'' tn:.l nslation: the

'J'h. Transa!·.:.: •o ::.:r_ _ _ _ _ _ _ __ _ _ _ __ _ _ _6::.;7:...-._ _ __ __ _ _ _ _ _ _ __ ....: Y-= o.;.;: fu=--· S,

11-_!»L_j


wastes about I I 00 cycles, or about I ms.

sequence of some events may be mixed up, some features will be added, others dropped. Added will be the rocket engi ne sound effects. Dropped will beY value ranRe checking, so that in the machine language version, the rocket will come up through the bottom of the screen after it exits the lop, and vice versa

The main loop in the BASIC prof4ram (Listi np, I) is in lines 410-520. This translates to the main loop in thC' :-~ ssc mhiC!r listing (Listing 3), lines 580- I 290. The BASIC statement, VCLOCITY ... VELOCITY + GRAVITY translates to the code in lines 640-740 of Listing 3. In line 760, the keybonrd is checked, and if the Fl key is pressed , the program return~ ro BASIC with an RTS. This is so that thrust and Rr<Jvity val11es can be changed if desired. If the space bnr is not pressed, the thrust portion of code is skipped. This is equivalent to line 440 in the BASIC listi np,, IF PEEK(KEYBD)<>SPACF. THEN 480. In the BASIC proRram, th ree things hnpp~n in rhr. thrust po rtion of code. which is executed if the spacr. har is pressed. First, thrust is subtracted from velocity, then the flames is flickered by switching it's shnpr., and finally, the Oame sprite is ennbled in li ne 470. Moving ro the assembler listing, the flame is turned on and fli ckered in linC'S ~ I O- R60. ' The sound for the flame is also turnerl on hy garing voi c1~ I in lines 870 and 880. Finally, thrust is suhtmrJr.d from velocity in lines 900- 1000. Note that when subtracting multi-byte variable.-;, the cnrry fla g is first set with the SEC instruction . If the spnre h:-~r is not pressed , the flame is turned off, the sound disnbled, and som~ time wastC!d so that the loop takes the same amount of timr. '"'hether the space bar Is pressed or not. This latter feature, implemented in lines I 09 1 nnd 1100, is to prevent the rocket frorn goiug slower than it shoulrl whC!n thC! spare har is pressed.

Well, there you hnvc the trnnslntcli progmm, \vrittcn in n~semhkr . If you wi~h ro SC'!C'! rhe program in a<'! ion, you r .1n type in th~ somcr. anti assemhlr. it, or if yo11 lion't have <m i'ISscmhiC!r yon c.1n r.nter and R!JN thr. RASIC': loadP.r program in Listing 4. 'fhr. new mar.hine l;:mguage vr.rsion is slightly rliffcrr.nr from thC' RASIC onr., hllt it hand lr.s the~ rocket's :-~cc~lr.ralion in thr. samr. way. What ahoul r.hangi n.g gravity and thrust? Well, if you recall , pressing rh~ PI key ca11 ~es a rr.turn to RASI\. from thC! progmm. Wr. migh t as wr.llnsC'! RASI\. to ncrl'('lt nC'w valtrc•s, POKP. them into the ('nrrc:rt addrc~s~es , and re- exr.rutc thC! mnchine 1:-~ngnagr. program . Si nce speed isn't critical \vhen it r.omc:.c; to entering the values, it's better to use BASIC, si nr.C' wr. can more easily change the prompts, and we don't h;wr. to call INPilT routines from machine language. The short BASIC program in listi ng 5, when run with the ma chine language rode in memory (at $COOO), will do the trick quite nicely. To change thrust and gravity parameters while you're flying the rocket, just press Ft , and reply to the prompts that appear on the screen. If you later want to change values again , the original values remain on the sr.rC'C'!n ro he modified, kept, or changed entirely.

A ft~w addit ional tips for converting 111ore l:Ornplex programs, while sti ll l<eeping the machine langua.ge fairly simple:

1) If you need to rn11ltiply a variable uy a cottstant, write a specific purpose multiply rou tine, eg. a routine that multiplies a given variable by 10. A IIIUlliply uy 10 cuulu ue accomplished quickly !Jy sl!ifliug ll1e variaule left 5 limes (with ASL or ROL) lo multiply it by 32, then storing ll1al value ami shifting the origi t1al variai.Jk ldt 3 limes to multivly it lJy 8. Adding lll ~:;e two rt:sulls will give Lhe numuer 111ulliplied !Jy 40.

Next in the BASIC progmm, vP.!ority is added to Y. This is done in lines 11 fi0- 1240 of the assembler listing.

2) Coruplex ruuctions. such as Sll , CO.S, etc. can often be looked up iu a lalJle. A table uf 25ti SIN values ranging from -128 to + 127 could be stored in memory beforehand by a HASIC program, and looked up as needed. This technique can also be used lor multiplicatio n or division by a constant, wlten.! the range ol mullivliers is known, and reasonably

The fina l code in the BASIC program loop is the Y v<tlut! rangC'! cher_king: the rocket is stopped al the lop of the screen, anri if it hits the bottom, either a crash or a good lnnr1ing is inclir.atr.d. The_se features are not irnpleuu~nted in thr. machine language version, so that you ca11 adu lhem yourself as an exercise, if you like.

small.

The last thing in the rnachi11e language version's main loop is a rlC'Iay. Even though the varia!Jie 'ROCKY' has to read1 6.1,S3n before the sprite moves just one liue. the ruckt:l moves too quickly, even with very low values of gravity and thrust! This gives an idea of how 1nuch speed we gain by

Now that you have a few tricks under your belt, go to it! Convert lhat nifty game to n1achine language and watch it fly. You might also want to use some ol the code from 'KOCKET' as the basis tor another program: maybe make the ship rotate, thrust in the X direction, fire, add some landscape on the bottom of the screen . ..

going to machine la11guage. TIH:!delay. in lines 1260-1280,

l

The Tr an sactor

••

Volume 5, lnue 02


l.iAIIniJ 2

U atlniJ I

1oo got.o 190 110 •• • ••••• • ••••••••• ••••••••••• 120. "ROCKET " • 130. simulates a rocket under • 140. lnflucnrc of thrust and gravity • I !'\0 • 11~r spnr.- hnr ro thmst; hrPnk • 160 .. program to change parameters ,.

100 rem • • create spntes lor • rocket • 11 0 rem ,. • if using a casoelttt insll:lad 120 re~n •• of disk drive. 130 rem goto 230 140 rem • also. if using cassette, this 150 rem • program must be run before 160 rem • execultng the ma1n rocket program 170 open1,8, 12. "O.rocket.sprl.p. w • 180 print# 1, clu $(0)clu $(50); 190 lor i - 0 to 1 step 0 200 roM A ·if a> = 0 then prlntN1 chr$(a); :next 1 210 dose1 : end 220 : 230 rem • cassette version starts here • 2110 for 1 ,..,. 12800 to 13056 250 read a : poke 1. a : noxt 1: cnrt 1000 natA o. 1n, o. o. 56. o 1010data 0, 56, 0, 0, 124, 0 1020data 0,124, 0, 0, 124, 0 1030 data o. 68. o. 0. 116. 0 1040daia 0 . 108. 0 . 0. 108. 0 1050data 0.108. 0. 0. 124. o 1060 dnln 0, 124. O, 0, ::»54 , 0 1070 data 1. 255, 0 , 1. 255. 0 1080 data 1 . 255. o, 1, 21 !J, o 1090 data 1. 187. 0. 1. 1. 0 1100 data 1. 1, 0, 0 . 0. 0 1110tlata 0, 0 . 0. 0, 0, 10 1120dntn 4, o. 0 R 0, 8 11~0 data 0. 16, 8, 48, 8, !3 1140data 96, 4, 72, 192, 2, o 11!:10data 2. 1, o. 4, 0, 1 1160 data 24 1. 211, 3. 216. 12. 6 1170 tla l<:~ 248. o. 247. 0, 0. 246 1180data 0, 112, sn. o. o. 63 1100data128. 0.127.192. 16,251 1200data 198, 49,241 , 199, 11, 225 1210 data 238, o. 0 , 124, 0. 1 1220 data 255, 0. 3. 215. 128, 3 1230tlata 187. 192, 3. 147, 128. 1 1240data 147, 128, I, 2 11, M , 1 l ?fi0c1Ata199, 0, 2, 199, o. o 2, 71, 64, u 1260data 199, o, u, 109, o. o 1270 data 11U, o, 1280 data 109, 0. 0, 111 , 0, 0 1290 data 56, 0. 0. 56, 0. 0 1300 data 16, 0, 0, 16, o. o 1310c1ota 16, 0, o. o 0 0 1320 data 0, 56, 0, 0. 254. 0 1330 data 1, 2 1!>, o, 1, 199, 1(18 1340 data 1, 211 , 0. 0. 199. 0 1350 data 0. 206. 0. 0. 238. 0 1360 data 0. 120. 0. 0. 1 12, o 1370data 0,172, o, 1 , 1~? o I ~ AO dAtA 1, 36, 0, 1, 96 0 0, 0, 16, u 1390 data 0, 144, 1400 data 0, o, u, o, o. 0 1410 data 0, 0. 0. 0. 0, 0 11120 data O, 0. 0. 0, 64. 0 1430 data 1

I "{() .,

185 rt!m • delete line 190 if using 186 rem • cassette. 190 II "" nm fl · if II rhPn lo;ul. rOC'krr ~>prt • .R,I ·rem • load sprite shape definitions •

200 : :liU rem• sprite/ variable initialization

220 vic - 13••1096 230 poke vic i 21 , I ; rem • enable sprite 0 '

240 rok(~ 2040, 200 : rem .. rO<·ker shnpco 250 poke vir , I :\0 · rem • x c0ordin<Ut' 260 poke vic t- 39, I : poke vic + 40, 1 270 poke vic + 2. 150 ; poke vic+ ::1, 2 !1~ :l~O ~u ke vic +41.7 : poke vic+ 4:l.~

290 kcybd o: l 97 : space=60 :mo bourn • 229 : rem " bottom of S<"rrrn 310 gr;wily "' !'\ · thrust ... 1 4 · crash .- 5

320 :

330 rem • take-oft mitialization • J40 y - bottm : velocity- 0 350 pok!! + J,y 360 print • - • gravity • : thru'it • " thn1s1" • • · l'ril!lh "" : r ont 370 get g$ : if g$<> • "then 370

380 poke 2040, 200 4UU .

410 : r~::1n ... rudi u louv ,.,.

120 velocity ... velocity 1 gravity 430 pokl' vir 1 21 . I : rPm • turn off flamr 440 if Jll'l'k(keyM)<>spact' then 480

450 · velocity - veloc1ty-thrust 4GO . II "' not II . poke ~04 1 , :W:l-11

470 . J,IUI-.t! vic+ 21, 3 : rem • luru 011 fldiiiC 480 y =- y + vl:'lodly 490 if y> t)ottrn th<~n y "'hnrtm : if vP.Inriry>1lrhen 560 500 if y<5fl I hen y - 50 · velocity - 0 5 10 poke vic+ I , y : poke vic+ 3, y ~- 20 520 Jtoto420

540 . 550 rc111 * t.:ra.:;h or good landing • 560 poke 198, 0 : rem • clear kbd buffer • 570 pokl' vir ...- I , honm 580 if velocity>crash then poke2040, 20 1 . goto340 : rem • draw ~;Kplc)SICm • 5!;10 pnnt • • •good landing! .. • · 600 lor - lu 800 : nt:xl d!!lay 610 print · • : poke 198,0: goto 340

L

Th. Tranaoctor

69

Yolu111e 5, law• 02


LlaU.na 3 100 sys700 : refn written on pal 64

1'10 .

' ; "ROCKET" ;simulates a rocker under the ;1nt1uence ot thrust and g ravrty. ;press space to thrust, 11 to :u-t ranye thrust and gravity. •' .opt n,oo • - $cOOO :.tOO jm p start 210 thrust .byte 14.0.0 220 g ravity .byte 5,0,0 230 velocity .byte 0.0,0 240 ro~ky .hyto 0,0 , 100 250 flame .byte 202 ;flame shape pointr 260 sprty =$d001 270 vic "'$d000 280 sid ,. $d400 290 sound=$d4 12 300 keybd "" 197 3 10 start "" .. 320 ;spri te set- up stuff 330 tda #1 340 sta vic+ 21 . sta vic+ 39 350 Ida # 7 : sla vic+ 40 860 Ida #200 : stn 2040 370 Ida #150 380 sta vic : sta vic + 2 390 Ida # 100 : sta VIC+ 1 4001da # 120 : stavic+3 410 Ida #0 420 stn vic 1 16 : sta vic 1 23 430 sta vic+ ?.9 : sta vic+ 2R 440 sta 53281 : sta 53280

120 130 140 150 160 170 180 190

450; 480 :sound set-up stuff 470 Ida #15 : sta sid + 24

530; 540: #0 : sta velocity velocity+ 1 : sta velocity + 2

570; 580 loop= • 590 Ida rocky+ 2 ;use msd of ship's y 600 sta sp rty ;pos'n as sprite y coord 6 10 clo : udc #20

6?.0 SIR srrty + 2 ;flnmP.'S y f'..O--ord.

630 •

640 ;add gravity to velocity 650 clc 660 Ida velocity 670 adc g ravity 680 sta velocity 6.90 Ida velocity + 1 700 adc gravity+ 1

1....-----------------·· ·~-

...

750 : 760 Ida keybd 170 cmp 114 ;check for f1 key 780 beq exit

790 t:rnp #60 800 bne 810 ida 820 sta 830 Ida 840 eor 850 sta

:oht:~ck

ror l),pace

nospace #3 vic+ 2 1 ~turn on ·flame · fl ame H1

!lame ;make flame flicker

860 t>la 2041 870 Ida If 129 880 sta

sound ;turn on sound

890; 900 ;subtract thrust trom velOCity 910 sec

920 Ida velocity 930 sbc thrust 040 Rrfl velociry 950 Ida velocity+ 1 960 sbc thrust+ 1 970 sta velocity+ 1 980 Ida velocity+ 2 990 sbc thrust+ 2 1000 stA velocity + 2 1010; 1u:w jmp spcdone 1030 nospace ... * 10~ 0 Ida H1 1050 sta vic+ 21 :turn off flame I 060 lrl~ tf 128 1070 sta sound ;tL'rn off sound 1080 ;waste time to equalize loop time 1090 :whether space pressed or not

10911dy #10

480 Ida #0 : sta sid ·t- 14 490 ldB #4 : ~ta sid + 15 soo Ida #9 .. 16 + 10: sta sid + 19 ;aid 5 10 Ida H11 •16 + 8 : sta sid + 20 ;sir 520 Ida #128 : sta sid + 18 ;ungate

550 ldn 560 sta

110 sta veloc;ty + 1 720 Ida veloctty + 2 730 adc g ravity+ 2 740 sta velocity 1 2

1100 waste d~y : brte waste

1'110• ' 1120 spcdone .- + 1130; 1140 ;add ve1oc1ty toy pos1t1on 1150 clc

1160 ldCI rocky 1170 adc velocity 1180 sra rocky 1190 Ida rocky+ 1 1200 adc velocity + 1 1210 sta rocky+ 1 1220 Ida fOCky + 2 1230 adc velocity+ 2 1240 stn rocky ~ 2 1250: 1260 ;delay (loop 100 times) 1270 ldy H100 1280 td dey . nop : nap : nop : bne td t 290 jrnp lvup 1300 : 131 0 exitrts 1320 .end

_______. . . . .._. . . .. . . . ... •'"

.. ::::: :::: = :::: .::::::. . : :::Y.olu•• 5;t1Sue02 J


.------------- - - -- - - - -- -- - - -----------------·------'"-\ U sting 5

Uatlng 4 100 rem • data loader for • nOCKCT. • 110 120 cs- 0 : rem • checksum 130 us= 49152 : rem • object start 140 : 1!'iO rP.arl b : if b<O th en 1 BO 160CS-CS+b 170 poke OS, b : OS"" OS + 1 : gotO1!:>0 180 : 190 rl cs< >31815 then pr irrt • • liht:lvk::;um error • •

100 rem • basic code for rocket program 11 0 rem • macllim:llany uayt:liOCk~t routine 120 rem • starts at $c000 (49152) 130 : 140 J1 = 49152 · p rint · s· 141 rem • for cassette use. delete 142 rem • line 14!3 and tirst run the 143 rem • sprite create pr<Jyran l 145 il 16 then land" rockct.sprt • .B, 1 150 pnnt • spaco 10 lhn tsr. " 160 rrrn1 • pres.r; f1 to change thrust and gravity · 170 sys(p) • clear kbd butter • 100 poke 190 1nput' • .th 200 11 liJUl • yr 21 0 poke p ~ 3, nnd 255 : J')OkA p + 4. th/256

200: 240 ond 1000data 76, 16, 192. 14. 0. 0 1010data 5, o. 0, 1020 data o. o, 100, 202. 169, 1 1030 data 141 , 21 . 208, 1t!1 , 39.208 1040 data 169. 7, 141 , 40. 208. 169 1050 data 200. 141 , 248, 7, 160. 1so 1060 data 141, 208, 141 , 2, 208 107 0 data 169, 100, 14 1, 1, 208, 169 10130 data 120, 141, , 3, :wu, H.i~ . o 1090data 141, 16,208, 141 , 23. 208 1100<.Jata 141 . 29.208,141 . 28,208 1110 data 141. 33. 2oa, 141 . 32, 2oa 11?0dAtA 169, 15, 14 1, 24 ,212, 169 1130data 0,1 41 , 14,212,169, 4 1140 data 141 , 15,2 12, 169, 1!:>4, 141 1150data 19,212, 169.184, 141, 20 1160 data 212. 169. 128, 141 . 18. 212 1170data169, 0 ,1 41 , 9 , 192,141 1180dAIIl 10,192,1 4 1, 11 , 192,173 1190data 14, 192,1 41, 1, 208, 24 1200data105, 20.141 , 3,208, 24 1210data 173, 9, 192, 109, 6, 192 1220data 141, 9. 192, 173. 10.192 1230 data 109, 7. 192, 141. 10, 192 1240 doto 173. 11. 192. 109, R. 192 1?!'i0data 141 , 11.192. 165,197,201 1260 data 4, 240, 110. 201 . 60. 208 1270data 52, )69, 3, 141, 2 1.208 1280data 173. 15, 192. 73. 1.141 1290data 15.192.141 . 2~9. 7. 169 1300dntni29. f41. 18 , ?1?, !'>6 , 17~ 13 10data 9. 192. 237, 3, 192, 141 '1320data 9 , 192: 173, 10, 192,237 l330data 4 , 192,141 , 10, 192, 173 1340data 11 . 192. 237, 5,192. 1'11 1350data 11 . 192. 76.230.192.169 1360da1a 1, 141 . 21 . 208. 169.128 1370rla1A 141. 18. 212. 160. 10.136 1380 data 208, 253, 24, 173, 12, 192 1390data 109, 9, 192, 141 , 12, 192 1400 data 173, 13, 192, 109. 10. 192 1410 data 141 , 13.192. 173. 1-1, 192 H 20<.Jata 109. 11 ,192. 141. 14, 192 1430 ciall'l !60, 100, 1:16, ?~ 4 . ?34, ~~4 1440 dAta 208. 250. 76, 11 3, 192, 96 1450data - 1

o.

o. o

220 pokA r + 6, gr ana 255 : poke p + 7. gr/256 230 goto 150

o.

I_

The lrontodOf'

--·---

71

Volume :~;::lsaue 02

l


A Few Of The Stranger 6502 Op Codes Explained

Richard Evers

For a large percentilge of n~$embly lt~nguage programmers, most of the 6502 instruction set is never actually used. Instructions like LOA, ~'lA, INC, UEC, UEQ, HNE, JMl-', JSI{ are usually all that are H!4uircd fur must ii)J~J l ic<~liom. What I want tu du lm.lCiy is go beyond these instructions and advance i nto the lesser known, or lesser understood op codes to try to shed some light on their workings

reached. A branch backwards works lhe same only in the opposite direction. The branch offset itsell is considered as locl!tion $FF, and is decremented from that poi nt backwards until the ue:;tina· tiou i::; reached. Tlte maximum branch in any direction is S80 characters, or a full page between the two directions. Beyond this you must usc a .IMP instrurtion.

The Overflow Flag The Car ry Flag Our nex t c.:undition to cover is tlte overflow fl ag. In this category are BVS - branch on overflow flag set, BVC - bran ch on overflow flag r.lcar, an<i \.LV - rl ear nvr.rflow nt~g. The overfl ow flag will be set when an arithmetic calculation exceeds 7 bits in magnitude.

Let's start off a lirtle slow. The term CARRY is used quite often within mnsr marhinc c.nrlc programs. ADC:- add with carry, SRC subtract with carry. SEC- set the carry flag, CLC- dear the carry flag, OCS- branch on carry flag set, and BCC- branch on carry flag dear, a re all of the instructions that fit i nto this category.

During signed bit arithmetic operations within l})e 65U2,·posiLive numi.Jtm; cue stored in true binary, with negative numbers stored in twos compliment binary. Two's compliment means-that all the hit~> hllt hit zero arc rr vcrscrl. A vahtP. of + 7 "' %'!}000 011 I where a val ue of ·7 9G 1111 1001. The high bit is used to signify the sil{n of the value. When an addition operation exceeds + 127, the high bit will be set, thus making it now appear to be a negative number. If testetl for, overflow would flag that a sign correc:Lion routine should be called. Essentially, the overflow fl ag works just like the carry flag except rflrry i~ set when a r.alculatinn exceeds 255, overflow is set when a calculation exceeds 127.

Carry is a flag that is set w one (on) when an arithmetic operation take.~ plar.c in whirh the r<'!iult generated goeil heyond the 8 bit maximum limit. Before an addition. carry has to be cleared wi th a CLC, so we can later tell if we have exce«::ed th e 8 bit maximum. When the carry flag has been set, the op code HCS - branch on <.:Mry set. will always l>UCc.:eed. On the other ham!. lhe iustrudiull BCC. branch on carry clear. wlll always succeed if the arithmetic operation hil$ not gone past the 8 hit limit Mrl r.;my is C'lr.ar.

=

Defore a subtraction operation is performed, the carry flag has to be set. This is due to the fact that if your resulting value is less than turo. wltic.:h i::; ueyoml the Suit rea.lm. the c.:arry n~ will be cleareu, and a test can be made of this condition with the BCC -- branch on rarry dcnr, ln~ t ruction .

The overflow f13Jl can also be set externally from a pin on the microprocessor c.:hip. ll's Hot Clrt interrupt w you must anticipate activi ty on this pin. therefore it's rarely used this way. But it's very fast, much fnstr r than nn interrupt whN~ you must MVP. ynttr regis ters before actual ly servici ng the interrupt. Commodore disk drives use this pin to signal 'data ready' from the read/write. head.

.

Ht·anching

A little IIOte tu slip ill uefore we go much rurtller. Confusion SI:!I:!JliS to run rampant about how a bram:h actually works. Below is a very useless program to demonstrate how a branch instruction calculates the address to flO to when you branch forward or backwards.

Tlte BJT ittslruclion is another u11e that alters tlte OVERFLOW flag. BIT will be covered later in this article. Tbe Zer o Flag BE(.1- branch if equal to zero (result true), and BNE- branch if not t:\lual tv teru (result (alw). What du lhese me41i1 to you? These instructions use the Z (zero) flag to test if 1rfe last operation performed was equal to zero or not. If you were to load the ilr.rum uliltor with 2!'i:i, then ro mpare ilto 40, they woulrl not he equal to each other_ In this operation, the Z fla.q would be set to zero to signify that the test tailed, or the result was false. The instruction BEQ would fail where BNE would succeed.

O:l7a here = .. '

027a b8 clv 027b 50 Qj bvc cvery·whcrc :branch forward to 'cw'!rvwhr.rr. · • 027d there - • '

027ll b8 clv 027e 70 fa l)\ls here

:I.Jrandt backwards tu 'lwrc'

.

Consider a simple loop routine as shown below. CPX (or CPY if you had used the Y register) is 001 required to test for 'Not Equal'. REQ anli RNE test the result of the last o~)eration performed.

02RO everywhere =

+

02HU b8 clv 0281 50 fa bvc there

;branch backwa tds to here

ldx "'0 loop irtc $8000, x inx bnc loop

As you ran see from the program above. a branch forward uses the n~xt addrf'_:..~ after I hr. branch line as location $00, and Increments th{' locillion from there until the hran\h lie~t i nation ha~ heen

!

The Transac-tor

72

Volumes; laaue 02

]


_______

.-------------------------------------···-...._.. No actual c:omparison was made, but the branch willsuGceed until the X rt'~g.ist('.r returns 10 a zero value. As I m~nrlonPd ('.<lflicr, BEQ and BNE test the results of the last operation performed. This can somEltimes give rather unexpected r<.-~sults, so the Compare op codes do have purpose too.

php ;push the processor status onio the st;1ck phn :push rhe contents of the acetimulator onto the stack tya ;transfer contents of y reg into the accumulator ph a txa ;transfer contenls of x reg into the ae(.;umulatur ph a t~x ;transfer the stack point to the x register

The Negative FlaK

rxn ;rrmisfer ('Ontents of x reg into rhe acru mulator pha

Two more branthes for your contemplation. BPL - branch if plus (negative fla~ set to zero), and BMl -branch on minus (negative

.

flag is s~t to one}. Hot h of these are very handy atlimt:s when a test to dct~rmiu~ the adu<tl va!u~ of ~.:haro<,;l~l~ cm;uuntcrcd i ~ ruquired. Take for exampte the little bit of code below:

As you probably know, the stack is a 256 byte area in RAM hdcl at $0100 lu~x to SOHI. The trick is that it is used for much more !han most can comprehend. That small block ol RAM s.eems to hf~ thf' <'E'Illre of nrrracrion fo r almost all of the computers functions. Not onty is the stack responsible for holding return addresses for vario.us functions, but it is also used tor most of BASIC's arithmetic c.alculalions.

loop jsr $ffe4 ;get a chatat'ter from the keyboard beqloop ;if no key pressed, H<l back to try again

sec liu~:

Jll·18

.....~-·-------------,

.. zero

1

: illit:~ l

bmi loop ;was b€Jow an ascii one

Further, hundreds of currently availnb!e m;lchine lr:mguogP. pro· grams make use of the stack ln St:lme pretty un-orthodox ways.

she "3 bpi loop :was above an ascii three • followed by your c:ode that uses the value bE~tween l and 3 •

Oec:fmal Mode

Sorpe of the most in:(!enious methods of program prolection known to date make use ot the stack as a special hideaway spot for tricky bits of cooe to lrap Ihe unwary hacker. Uule&S you are in the mood lor liorne pretty hairy protection techniques. stay away from this one. For the balance of masochist~ ln our rf'"'lding Ftttrlience, plow ahead 11nd creare your own versions of the spiral of death, as one particular technique has come to ~ known. Challenges like this seem to make life more interesting.

Enough of the brandt(!,..,, lets get into fur1her arithmetic iustruc:.tions. SED -· set che d<.><:i mal flag , and CLD ... clear the decjmal 'Uag,

Boolean Operations

In thb example. the test does a very good job ol allowing yuu to pick nnd rhoosc precisely what wall! from the keyboard.

refer to a mode t.hJ\t wilt allow you to utilize BCD, binary coded d~ci mal lnrrn of arithmetic calculations. In this mode, each nybble of a byte ho!ds a single decimal number, that. is 0 throug.h '9. A full

And now, lime for a bit of boolean fun. In our boolean lunchbox we have : ANO - and memory with the accumulator, ORA - or memory wilh l he accumulator aac..l EOR - do an exclusive or of memory and !he accumulator.

byte can have a value up to 99 dec.imal. AOC, S.BC, BCC and BCS <.1 ll wurk iiJ tfll;! ~alltt:! way witl t thi:s mode of operation, with carry being set if decimal 99 is exceeded. As before, carry has to oo set hf~fnrt> ~uhrracrinn, and dt>rtr~d h('fore addition.

For a lot of the examples in the rest of the article, I \"ill be refetrinj:l to values ln binary fo rmat. The reason for this will soon become apparent.

This mode of operation is not one in which Comrriodore have made great strides in using to any advantage. When your machine is first powe1cu up, a CLD instructiuJt is exe~.:utt!d lu ensure that all arithmetic calculations are performed in regular binary. On trance into the m;lchinc langu:1ge monitc:ir, the clecimal flag is nlso set to zero. as an added incentive to avoid the BCD blues. As it stand.s, not a single BASIC routine rakes advantage of BCD. . Perhaps in a luture \'ersion of CBM BASIC, BCD will finally be

en-

AND The dl.agwm below shows exactly how this instruction operates. accum. 1001 OliO/ I SO decimal

~

AND

1101 1101 I 221 dedmal

result

1001 0100 I 148 decimal

used. St~e:k Operatioo8

To AND a value with another, you simply matc..h bits up and determine which ones matched. T he rule is:

.

The next instructions just c1ying £or a little explanation are : PHA. vusll lhe at:~.:u rnulatur OHio the stat:k, PL.A. - j)Ull the <Kt:umulat.ur from the stac;k, PHP push the processor status onto the stack, PLP - pull the processor statu5 from rhc stack, TSX - transfer rhe SliKk pointer to the X n~gisl er and TXS ·- transfer the X register to the stack pointer. Except for TSX and TXS, these instructions are use(1 to either get characters from the stack, or store characters on th~ stack. Quite oftt:u, belure t:xc~.:utiuu vi a ruar.:.binc Jaul!luagc program. the current state of {lte computer should be saved for imurc usc. Below is a quick rourlnc to dcmons1ratc a mc1hod to snvt> evP.rvthi nll,, fm furure rP.I'rieval· J

AND: result le true ll one AND the other The hits that.wr.re ON in hoth values remain ON, the balance are set OFF. In th·is way, if you wanted to keep a certain calculation within your boundaries, you would AND the resuli with the highest value that you want. The result can be worth less or equal to the ANDed valu'=, but cannot ex<.:eed it.

- - - - -

L .Th.!..!~!!~ct.!::...'--·------·---·---·--·

73

_ _•••. . _••_ ._ _ _ _ _ _ _ _ _ __ . J

-· I

..


OR

One particularly useful method of using EOR is in the encryption of data within programs. If you want~d to h:~vc n pa~~worrl Acce..;s systP.m fnr your program, but didn't want anyone to be able to read the passwords, EOR them with a known variable before storing them away. When you read them back, EOI< them with the same val ue again to un-encrypl them fur usage, As lo11g as the EOR vetriaule is kept secret. the passwords ar e pretty secure. A little imagination at this point will help you design a very c1i ffir ult enrrypri on "Y~IP.m to hrea k. As I said before, EOR is very useful.

Ag<lin, rh e diilgr!lm helnw will show its nr lmllinn. accum. 100 1 0 J101150decimal OR I 101 1101 I :.!21 decimal result

11 0 I 1111 I 223 decimal

When you OR a value with another, every corresponding bit that is turned ON in either value is left ON in the final result. The rule:

Bit Shifter•

OR; reault ia true if one OR the other In this way you can stop a value from dropping below what you want. OR the value with the lowest value you want and the result wtll always be equal or higher. For all of you that can remember back a few il>/;Ueli, a couple articles appeared that mentioned a technique of OR'ing the characters rertrl from cli.~k files with 64 to heir stop the rur1c rr.mptntions of pseudo control characters. If you were to directly read in the contents of a program hie, and print those contents to your screen, every now and then a character will sneak in with the sole purpose in life to make your oety~ on earth difficult. Those charact~n; attempt to make you believe that they are contTol characters, and set 0 111 in their task of de11ring you screen, ~ett ing winnows anrl doing other equally rotten things. A quick OR with 64 will rob these imposters of their power and knock them back down into the ranks of the ot h e~s. A pretty long winded way to say how not to let the vetlue drop below 64 decimal.

ASI.: Shift memory or accumulator one bit to the left. accum. 1001 01101 150 decimal After an ASL, the result would be 00 10 11 00, or 14 decimal with the carry fl ag set. The carry flag being set represents the resu lt exceerling 255. Therefore the result of this o~rati o n "' 44 + 256 - 300, or double the oriRinal value. Thus we now have a way to multiply by two from within assembly code.

L.SR: Shift rnernory or accu mulator one bit to the right. accum. 1001 01 10 I 150 decimal

EOR

The next, and last, boolean operator is really a mixture of numer· ous boolean logic circles. and will take a little bit longer to explain.

After a LSI<, the result would be 0100 10 I I , or 75 decimal with the carry Ilag clear. This allows division by ywu in m adtiu~ cull e. If bit zero was originally ON, carry would be set after the operation to signify that a fmctlon wns encountered. Therefore, if the arr.um1 1lntor content was 0110 0 I 01 before the operation (I 01 decimal). after a L.SR the bit structure would be 00 1I 00 10 w1th carry set, which is equal to 50 plus carry, or SU with a remainder.

As before, lets break ll down into binary for the explanation accum. 1001 OJ 10 I ISO decimal EOR t iOI 1101 /22 1 dectmal result

0100 I 011 I

75 decimal

ROL: Rotate memory or accumulator and carry one bit left.

One step further will show that F.OR is incredibly powerful to use result EOR

And now, etway from bouleetn logic and into stranger bit beating for the enthusiastic programmer. Into thlc; category I Include ASL shift memory or arrnm11 lator nne hit to the left, LSR - shift memory or accumulator one bit to the riF(ht, ROL - rotate memory or accumulator and the carry Hag one bit left, and J{Q f< - rotate memory or accumulator and the carry £lag right uu~ bit. Each et pretty valuable instruction, and each worthy of some explanation.

As tht> name implies, this operalion is a rotate, not a shift. ROL rotat~s the bits around in a circle in a counter clockwise dtrection.

0100 1011 I 75 decimal (result from above EOR) I 101 I 101 I 2:.! 1 decimal (previous EOR val ue)

As usual. lets start with th~ accumulator holding the value IJeluw, but show carry as the left most bit of 9 bits. To start. carry is clear.

accum. 1001 0110 I ISO decimal (original accum. content) CArry Ar rumulatnr (start) 0 100 1 0110- I SOdedmalwithcarryclear

As the above diagrams have shown, EOR will perform a bit flip operation. The ru le here is:

After a ROL. the resu It would look like this:

EOR: re11ult i11 true if one OR the other, but not both

Carry Accumulator (result) I 0010 I I 00 = 44 rlcdmtll with carry set or ::100 rlP.rimal

E.ach pair of bits that do not match are turned ON, pairs that do match are turned Of'F. If a pair contamed two l 's or two O's, then they would be turned O FF. If the pair con tained 1 and 0, or 0 and I , the re.sult would b~ ON. When an EOR is !Jerformed agetin with the same original value, the bits would be returned to their prior state. The cu rsor is a good example of EOR In eHcct.

[

The Tranaactor

As can be seen, ROL is similar to an ASL, but with a ditference. The most significant bit becomes the cur rent carry ~;talus, aud the vrior carry slettus ~omes the le<llit slgniricant bit. Used in conjunction with ASL. some really heavy duty multiplication can be preformed. By ROL'ing cvcrytimc ASL gcncmtcs <'nrry, you roul<l

74

Volume 5, luve 02


double the original value, then repeatedly double the result each time. Dy stringing multiple ROL's together, calculations ot unbe· lievable length can be achieved.

028d 2a rol a 02~e bO 04 bcs spot 0290 c.:5 5b c.:mpuy 0292 90 03 bee ncxt-;por

ROR: Rotate memory or accumulator and c;ury one bit right. By now you probably know what this one can do for you. As ROL

was similar to ASL, ROR is s1milar to LSR with the added advan· lage of rotating the carry bit along with the rest.

0294 spot "" $ 0294 e5 Sb sbc by O:l9G :J!:I sec . '

0297 nextspot "" • As can be expected. ROR will rotate all the bits in a clock\,~sc ctirrr:tion moving the low hit into r<my, nnd the r.nrry hit into the high bit. A binary value of %0110 0101 with carry dear would become %0011 00 10 with carry s€1after a ROR is executed

0297

en

ctc.x 02!18 dO f1 bne loop 029a 26 59 rol loval 029c 83 Sa sta hival

029e 60 Below i~ a vrogram lu deiTIUIISII ale how ROR Call oe used fur multiplication of two 8 bit numbers to generate a 16 bit result. Bclnw 1hnr is nnothcr dcmnnstrntion pri'>grnm, this time for c1ivision or a sixteen bit numher by an eight bit number generating an eight bit result. This example uses the ROL instruction to produce its expected result.

; • "* lei'~ IIJUltipJy 87 * 16 • *" 027a a9 57 lcln " %0 101 0 1II ;87 decimal 027c 85 fb sta !oval 027e a9 10 Ida .oc%000 10000 ;I Gdecimal 0280 8;) fc sta hival

rts

The 8 bit result cnn be found in S!i!) with rh r. remAind er in $Sa.

Te.ting Memory and 'Hiding' Code

Our last instruction for today is the BIT iustruc.:tio11. BIT is really rather strallge. to say the least, for it does not alter memory in any way. it just changes three of the proccs~·r rcgimN fl ag~. The three flags involved are the Z - zero liaR, V - overflow, and N negation. The zero flag is set if the boolean expression accumula· tol' ANU memory [ails., or the zero flag is dt!<H if a~:w mulator AND memory .Sllt:ceeds. Bit 6 of the memory location of the BIT operation is transferred imo the V nag, and hit 7 of rh~: mr.mnry lor,·ulon i.s rransferrC'd i nro thP. N fin g. BIT is a pretty g<lod way to test if bit seven has been set in a specific memory location, or bit six if that is more to your liking. What ever the case. it really does have its good points.

0282 a2 08 ldx "8 0284 a9 00 Ida *%00000000 ;zero 02Rfi 18

l.'lc

0287 Ga

ror a

0288 028a 028c 028d

cur [oval

There is one more interesting usc for BIT. if you arc at all interested

bee spot

In program protection. As .lim Burrr.rfidclnnd 11 ho~t of thousands hnve already pointed out, an absolute BIT op code before a LOA instruction helps hide load instructions quite nicely. When disas· sembled, the code might look like:

. ' 0287 loop= • 66 fu 90 03 18 65 fc

cJc:. adc hival

028f spot = • 0::!81 ca. dex

027a 2,1 a5 77 bit S77a5 027d 48 phn 027e 20 95 02 jsr $0295

0290 10 15 l>pl loop 0292 85 fc sta hival 0294 nO r1~ The I G bit result can high byte)

oo found in

But in reality the code was written wi th this in mind: locations $1b

+ $fc (low byte/ 100 •=:S027a 11 0 11 fl 120 125

: '~'.,.divide

31587 by 227 .... ;:HS87"' %0111101! 0 110 0011

.

• 027a aY G::! Ida w%01100011 027c 85 59 sla loval 027e a9 lua '" %0111 1011 0280 85 Sa sta hival 02?.2 il9 r.~ lcta "'227

7u

0284 85 Sb sta by

.low byte of :16 bil valu~ :high byte of ; 16 bit value ;oivided by ;8 bit value

There are probably more instructions that you are unfamiliar with but. for todav. lhals all I intend tu cover. If •vou reallY don't • • ur1thm:aand a particular instruction, send us a letter and we'll attempt to answer il in one of 0 11r futu re": issues. !f we rr.cpivP. mnuntilins of CJIIP.c;tions, perhaps another article like this one will hit the pages of Transactor again. 'Till later. thanks lor allowing me to climb instde ~·our mind and iiggle your bits about.

02Sb loop = • 028b 26 59 rol !oval

nt. l!!!_niG=c~to~r~-----

pha jsr 50295 ;and do something else for a while

To enter this code. loc<~tion $027a is bypassed and location $027b is chosen instead. This different lnr:ntion of r.nrry will r. n ~mr. thnt th e mde is userl rorwcrly.

0286 a2 0.8 ldx ""8 0288 a5 5a Ida hival 028a 18 dt

-·--·----···- ··-·-·····-

.byte S24 ;b!t op c:odc Ida $77 ;get the low byte of basic from chrget

-75


Getting BASIC To Communicate With Your Machine Code

There are several ways of communicating to your ML program from BASIC and I wish to outline what I think are the most common, and best-liked. The first method is by the USR command, II allows one to pass a single variable into the floatinR point accumulator.., I . Second is the POKE/ SYS method, in which you POKE values into memory, and then your code loads the values back from memory. Thirdly, the SYS/WEOCE method, which allows about I 0-15 parameters to be passed by using the CHRGET pointer. And finally, the variable/sys method which allows an infin ite (realistically about 5428) amount of parameters to be passed. I have tried to have information for three machines - 64/ VlC/ PET-CBM - the information for the 64 is directly stated, the PET/CBM info is in square brackets '[ ]'. while the VIC info is in backslashes '//'.

Darren Spruyt Gravenhurst, Ont.

POKE ADO,INT(X/ 25G):POKE ADD+ 1,X-!Nl'(X/256)â&#x20AC;˘256 where ADD = memory location to POKE to and X is Ihe value to be transferred. The latter option may be slightly easier to use, but only ::$ parameters can be passed with a range of 0-255 and it only works on the C-64. In the G4 there are th ree locations in page 3. These are locations 780, 78 I and 782. The first is fur the accumu lator, the second for the X-register and the last for theY-register. If we POKE a value of 128 1n the location for the accumula-

tor, and zero in the others we can demonstrate the effect. Code in memory somewhere a BRK command. Location $4000 is a good place... and SYS to it:

The POKE Method The POKE method is quite simple and straight-forward. There are two options we can use with the POKE format. One involves a memory location (or several) which we write data into from BASIC, and later, read back from our assembly code. The other just involves POKES from BASIC. The first option involves POKEing a value to a location from BASIC and then retrieving it from ML with a LOA, LOY or LOX command. e.g POKE 8192, 100/LOA $2000. Of course the hex address used with the LOA, LOX, or LOY command must match the value Riven in the POKE command. i.e. $2000 is hex for 81 !>2 . This method is simple and easy to use. It has a few drawbacks: it is code consuming in BASIC if more than one parameter is to be passed; and to transfer large numbers, the number must be broken into smaller byte-si:zed pieces and is realistically limited to integer values. To transfer a value of 'X' in two byte unsiRned arithmetic (range 0- 65535) would require two pokes:

1

The Tro nJactor

-- --- -----¡

--

__ 76

poke 780, 128 : poke 78 1, 0 : poke 782. 0 poke 16284, 0 : sys I G384 (You will need a machine language monitor program installed first, like SupermonG4 , to get the proper reaction) If we now look at the register display (the info that comes up when a BRK is executed) we will see that the accumulator (ac) holds a value of $80 (hex for 128) and both X (xr) and Y (yr) will be 0. With this we can see that values POKEd into 780, 78 1, and 782 appear in the respective registers when control is transferred to an ML program. So we have an easier way to transfer 3 parameters (range of 0-255). We can also set what the processor status register will be the instant that control is transferred to our program. We do th1s by POKEing 783 with the correct value to set whatever flags we wish to have set. One note: When our ML program terminates with a RTS, the values that are in the accumulator, X-reg and Y-reg and the status register are then placed back into the same memory locations mentioned above so we can then examine them with a PE.EK command.

...:...;::;_

Volume 5, lu1.1e 02 :


We set tht: USR destination hy using the above POKEs, and wh~::nevt:r wt: <All it, it will rr.turn a value multiplied by I 0. e.g. PKINT USR(Il5) will result in '1 150' being primed.

The USR M ethod

The USR method uses one of BASIC's lesser known and usC'd comma nds: USR. An illustration:

The Wedge TechnJque

A - USR(IOO) This technique requires soml' hn.c;ic kr\Owled~e of the CHRGET routine. This routine@ $007::1 on VIC/ 64 and @ $0070 on PET/ CBM is a routine thnt is called everytime BASIC needs the next character in :-~ proRram to execute. Inside this routine is a pointer (S7A)-64/Vl C and ($77)-PE'Ii'CBM that points at all ti mes to the most recent character fetched from BASIC text spare.

The value of 100 is placed into the Floating Point Accu mulator '*I (FPACC,..l-this is a Rroup of 6 bytes in zero page in which BASIC performs all of its arithmetic operations) for your proRram to work on and when an RTS instruction is encountered from your code, the current value that is in FPAf.C"'l is then placed in the variable 'A' and control is retmnC'd to BASIC.

Consider a program with a line such as ' I 0 SYS 491 52:GOTO 1000'. As r.ontrol is tmnsferred to our ML program. the CHRGET pointer is left pointing to the next character tu bt: takeu from RASIC code. in this example the colon ':'. The pointer is not rhanged while our program is executiug. but we can r hangc it by callin~ some ROM routines. amllJt:iug able to do this can be very advantageous to us.

Unlike SYS, USR has no starting address indicated in 1ts format. However, the starting address in specified in the USR jmp vector: $0310-784 ($0000-0002) [$0000-0002] . The first byte of each is the jump opcode JMP or $4C. The next two bytes are the destination in the standard G502 format, destination lo and hi respectively. Here is an example of a computed-COTO routine: $2000 jsr $b7f7 [Sc92d]l$d7f7/ ;convert PPACC~' I to integer $2003 jsr $a613 [$b5a3]1$c6 13/;search for line $2006 bcs $200b ;carry set if found $2008 jmp Sa8e3 [$bf00]/$c8e3/ ;undefn'd statement S200B pia ;remove calhng address put on stack $200C pia ;by the ·uSR' routine $2000 jmp $a8c5 f$b850VSc8c5/ ;cont COTO routine

Maybe you have seen a program with nn SYS like this :'SYS 49l54,lo,hi', this program uses the wcrlRe technique for the ML prugralll tu oi.Jtaiu the two pammetcrs that follow the SYS. In the examplt: inuue<Jiately abovcc. the CHRCET pointer will be lert pointiug to the mmma (,) We can test for a comma by calling .JSR $AF'.PF f$BEPS-PET/CBM] /$Cf.l-"f-VIC/. If the com rna is present, control will return to us and the CHRGET pointer will he increased by 1; otherwise '?SYNl:t>.X ERROR' will result. ThC' nC'xt step would be to call the routine evaluate expression at SADDE [$B098] /Cl>9t::/. this will leave the type of expression in $00 [$07] / $00/ . A value of $00 means a numeric result, while a value of SFF me<ms it is alphanumeric or string. The numeric value woult.l be left in FPACC-il1, while a string value would occupy three bytes, poiml'cl to hy an indirect pomter at ($64) [($61)] and /($64)1. The orclr.r of these bytes are. length of the string, the low- byte of thC' address and the high-byte of the adllress of the string.

otC'· This routine does not return F'PACC"'l into the variahi€' hN·ause we do not return control to the USR ROM routine, instead we return control to the GOTO routine. Rrfore this code can be executed, The USR vector must be poimcd to it. This entails: pokC' 7~5 . 0 : poke 786, 32 (poke I , 0: poke 2, 32) [poke 1, 0 : poke 2, 32] This is just an idea of what can be done with it, however it can hC' used ro do anything you might require of it eg. data transfers through usP.r port/RS-232 or many other applications.

Once we have cupit:<.l the information that we needed Le. string length, desti11alion loami hi, w<~ must then dean the 'descriptor stack.' We do this by the following code: LDA $64/ LOY $65/J!)I{ $1:3608. If we do not clo this, we may eventually have a ' 1-"0KMULA TOO CO~PLF.X' l'rror. Note:this is only needed when worki ng with strings.

This last and simple' prof!ram usin~ the USR function just multiplies rhl' given value by 10. $2000 jsr $h<~e2 [Scc 18l/$dae2/;multiply FPACC"'l by 10 S2003 rts ;end of routine

Tho 'fr•n..ctor

Listing 4 shows us how tu retrieve a floating- point variable, where the syntax lor call i11g this routine is 'SYS~I92:EXP ' where 'EXP' is a numeric expres~ion . Listing !1 is an cx<1mple of crunchmg out an integer value from thl' expression· 77

Volume 5 , IIIUO 02


__________________ _ _______________________

,_

.....,

.... .._,_,......._........

syntax for this one is the same as above, but the allowable range is 0-65535. Listing 6 retrieves a single byte value (0-255) and prints it. Listing 7 is a psuedo POKE routine, where syntax is 'SYS8192;ADD,VAL' where ADD is the memory locatton to be POKEd to, and VAL is the value to be put there (0-255). Finally, Listing 8 will display a string expression using the wedge technique. If we wanted to transfer about six variables, we can alternate between the 'check for comma' and the 'evaluate expression' routines. The Variable Method

BASIC. in storing variables (simple, not arrays), uses seven bytes for each variable. The first two are the name and the next five are used differently for the different types. As more variables get defined, BASIC keeps adding them to a table that it keeps in memory, the start of this table is pointed to by ($20) (($2A)) / ($20)/ and the end is pointed 10 hy ($2P) (($2C)J /($2F)/. Lets examine the first two hyrcs rcprrsenting the name.

char

NEW < return> 1OA "" 100:8$ = " DARREN" :C% = 100 RtJN Now enter the monitor with SYS 8 [SYS1, PET/CBM]. Type: rn 002d 002<.1 < return> [$2A on PET/CBM] / $2l> on VIC/

MS0-2nd char

F- P INT

0

0

I

STR

0

FNCT

I

1 1 0

The pointer (S2D) l($2A)) /($2D)/ tells us wltere the simple variables list starts and ($2F') ($2C] /($:'.F)/ tells us where arrays start and variables eml. In our exomvl~: w~ should have seen:

.:oo2<.12o os 35m~ 35 08 ed 97 -64 .:002a 20 01 35 04 35 04 00 80 -PE'I/CBM Now type: m 0820 0835 <return> Display uf :

.:OR20 41 00 87 18 00 00 00 42 - P.t:.!ICBM is identical, .:0828 80 06 Of 08 00 00 c3 80 but at $0420 - 0435 .:0830 00 61 00 00 00 00 00 00 Perhaps it is easier if we break into groups of seven from the

beginning. lllantissa .:0820 11 00 87 48 00 00 00 uante

One character variables have a 7.ero plared in the secou<.l position, but the MSB is still manipulatC'd according!}'路

~/ e

muue leu lu lti unused .:0827 4:.! so oo or 08 oo oo name lli lu uuused .:082e c3 80 00 61 00 00 00

Variable Names plus their storage value_c; (hex) {Excluding functions) A -$41 and SOO, AB - $41 and $42 CS - S43 nnci $80, <"'.ZS - $4~ and SDA Z%- $DA and S80, 01 % - SC4 ami SBl

The Trantactor

When the last several hytf'~'> are not us<~d (string, integer) the not usrci ones are filled with zeros. Qut>-'>tion: Why the unused bytes in the integer and string variables? An~wer : to ~ able to use a constant seven additive to increase speed when sr.Mrhing through the variable tables.

A machi ne language monitor will I..K! nee<.letl, so LOAD it now if you don't already have one in the computer. Type:

In the PETSCH range that the characters occupy, the MSB (Most Significant BIT) is never touched sinre letters occupy the ranRe of 65- 93 ($41-SSA; %01000001 - %01011010) and numbers occupy 48-57 ($30-$~9; %00110000 %00111001). In both ranges, the MSR (bit 7) is never touched. BASIC uses the YISR, in hoth rharacter positions, to represent the fou r types of vmiahlcs (string, floating-r>oint, integer and function s). T:1ble 1 rcpmc;ents th is idea. Table 1 M~B-l st

F'loating-Poim: sign 1 exponent and four bytes of mantissa. String: length , string addrf'-'>S to, string address hi, last two not used . Integer: Villuc hi, value lo, last three not used.

A Real Example

There are two bytes used, and BASIC only rccogni?.C-" rhc first two characters of a variable. Now you s.1y 'How docs OASIC then tell a two character strin~ variable from a two character floating-point variable?' e R路 AA$ from AA. Wf'. know that the fifst character of a voriahlr is n ININ and th.11 the second character can be either a letter or number. B~<;;IC stores the variables' names usinR the PETSCH character value, but with a twist.

Typ~

The rest of thr 5 byte.'> remaining in rach variable type are used as follows:

- I st variable defined -2nd variable defined -3rd variable defined

With this information, we can now wnte Assembly language suiJroutines to access the BASIC vanables. Number II in the li~t uf KOM routiu ~. is the routine used to find a BASIC 71

Yolumo S, IIIU_! 02


variable. Listing I is an example of an assembly program to retrieve a string variable 'AD$' from memory. while Listing 2 retrieves an integer variable and finally, listing 3 retrieves a floating point variable. Well this is the end, and while I hope that everything is correct, it may not be so. Ir I find any problems (heaven forbid), I will try to get them into the Transbloopers section of the next issue. And finally, I hope that I have presented everything clearly so that all may be able to use these • new-found procedures. ROM Routines

In the following list, the values given outright are for the

·o·

are for PET/CBMs C-64 , while the ones in parenthesis (BASIC 4.0) and the ones in square brackets'[ )'are for the VJC-20.

1. JSR $AE.F7 ($BEEF) [$CE:r7) - tests next character of BASIC text for a right bracket ')'. 2. JSR $AEFA (SBEF2) ($CEFA) - tests next character of BASIC text for a left bracket '('. 3. JSR SAEFD ($BEF5) ($CEFD] - tests next character of BASIC text for a comma','. 4. JSR $AEFF (SBEF7) [$CEFF] - tests next character of BASIC text for the indicated character in the accumulator (using PETSCH codes). All of the above routines leave the next DASIC character in the accumulator and they exit leaving the Y-register at 0 and the X-reg unchanged.

5. JSR $879E ($C801) [$079E] - gets a one byte value (0-255) from BASIC text (through CIIRG£T) and return it in the X-reg. 6. JSR $81 8F ($XXXX) [$01 BF]- converts FPACC~l into a 2-byle signed integer at $64 ($XX) ($64) in the standard 6502 format-low then high values. 7. JSR $B7F7 ($C92D) ($D7F7]- converts fo'PACC" l into a 2-byte unsigned integer at $14 ($1 1) [ $14] 8. JSR $8391 ($C48C) [50391]- converts the integer in Y (low value) and A (high value) into a floating point value in F'PACC... l . 9. JSR $8807 ($CDOD) [SDBD7} - packs what is in FPACC *1 into a memory variable at X (low value) and Y (high value). X and Y point to the data of the variable, not the name. 10. JSR $BBA2 ($CCD8) [$D8A2j- unpacks memory variable into FPACC.vl where A is the low byte and Y is the hip,h byte. X and Y point as mention above (.#9). 11. JSR SBOE7 ($C187) ($DOE7]- find variable given name in $45 ($42) ($45] first character and $46 ($43) ($46) second character and returns variables location (start of the data, not the name) in Y (high value) and A (low Th Tran.aactor

79

value). also in $47 ($44) ($47] wllidt i::; to be used an an ind1rect index. i.e. LOA ($47).Y (LDA ($14),Y) and (LOA ($47),Y]. Indirect address SSF (S5C) (S5F] points to thr. start of the name of the vaJiai.Jie. It must be remembered that the h1gh bits or the uame 111ust be modified dependant on the type of variable b~ing searched for. e.g. to find van able 'AH %': LOA H$CI /SlJ\ $'15/ LDA "'Sf.2/ Sli\ $4G/JSR $BOE7- for lhe C- 64, will leave the abovf~ pointers set to the conect adures1ies fur 'AB% '. 12. JSR $A09E ($HD98) ($CD9Ej - Evaluate expression from where the CHI<Gt:T voiuter was pointed to. Resnlt type IS in $00-SUO means result was numeric and $FF' means result was a string. If result was numeric, the value ism FPACC'l , while is a string, $61 (S6 l) lS64 J as an indirect index - points tv a striug of three bytes of wh1ch the first is taken to be the length of the string anci the next two are the low-byte and lite high- byte of the location, in memory, of the striug. 13. JSR $AD8A ($8084) ($C08A] - Evaluate numeric expression. Calls $AIJ9E. but theu tests type of result, anrl 1f not numeric then a 'TYPE MISMATCH' error results. Used if a numeric value is wanted . 14. JSR $BDD7 ($CF8D) ($0007] - Print:, the number that IS currently in FPACC" l . To inl>ure it to work (on the C-G4), load the Y-reg with SOl I.Jelure calling (if not done. what is printed is the ai.J:,olute value). 15. JSR $A080 ($13087) ($CDI:>D] - cl1et:k input was numenc. I G. JSR $AD8F (SBD89) [SC08t']- ~:h eck input was st ring. Both This one and previous are t.:alled after Evaluatf~ Expression (If 12) is called. 17. JSR $8GIJH (SCSI I ) [SD6DB] - deans descriptor stack LOA $64 and WY $65 before ' alling (6,1/ VIC) or LOA $G I and LDY $6:l (Pl::'li'CBM) 18. JSR $841-'4 (SC59E) ($D4F4] - creates room for new string with length in accumulator. Location for string is at ($33)-64/VIC and (551-'}-PET/CBM.

Listings Before typing in most of th~ listiugs, you should have a machme language monitor inslallt:d like Supennou- 64. All of the listings presented here are fur th~ C-61. with the help of the ROM Routines section above. one should be able to modify them easily to work on the Pt::T/ CBM or VIC.

Listing

t: Assemble at $2000

$20001da $2002 sta $2004 lda $2006 sta $2008 JSr $200bldy $200d Ida

11 $4 1

$45 "'$c2 $4G $b0e7 ... $02 ($5f),y

;first letterI bit 7 =0 ;second letter/ IJil 7 = I .find variable, given na111e ,pointer to start ol varioble/ gel hmgl!J Volume 5, luue 02


..---·-···-··

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

S200f bcq $202b $2011 tax $2012i ny $20 I 3 Ida (SSn,y $2015 sta $14 $2017 iny $2018 Ida ($fif),y $201a sra $15 $201CSIX $2 100 $201f Jcly N$00 $2021 Jon ($14),y $2023 jsr Sffcl2 $2026iny $2027 r py $2100 $2029 bnc $2021 $2028 11S

of string ;length zero-go

$2006 sta $200B jsr $200b jsr s:woe tdy $2010 jsr $20 I 3 rts

• • •

; g~r addr~s

to

;save 11•

UaUng 4: Assemble at $2000: "$3b Saeff Sad8a '$01 $20Ua jsr $bdd7 $200d rts $20001da $2002 jsr $2005 jsr $200Bidy

.

·m •

;printed aJJ the chars ;no, get some more ;end of routine

:chr$($3b)- • , • ;lest chrget lor char in .a ;get numeric value into lpacc"'l ;.y-1

;print fpacc *I :end of routine

Listing 5: As Listi ng 4, but change as follows:

LiAtlng 2: Asscmhlt: at $2000

$!W08 jsr $b7t7 S~OOb ldx $14 $200dlda $15 $2001 jsr $bdcd $2012 rts

S20001nn *Sr i

: lst char -bit 7 = 1 ;save value $2002 sta $4fi $2004 Ina 111 St1 ;2nd char- bit 7 = I $2001) sta $46 •·save value $200R jsr $b0e7 ;fi nd variable $200hldy "'$00 :.y = () $200d Ida ($47),y ;get hi- byte $200f tax ;into .x .$2010 iny ;.y= .y+ 1 $20 I I Ina ($4 7),y ;get lo- byte ;into .y $20 I ~ tay $2014 txa ·••a = x $20 I!) jsr Sb3!H ;convert to floati ng- point variable in fpacc..#] s?.OI81ny •so1 ;.y "' 1 $20 In jsr $hdc17 ;print fpacc~ I S201 d 11s :end of routine

;convert lo integer ;.x -value in $14 ;.a.,.. value in $ 15 ;ptint .a• 25G + .x ;end of routine

LlsUng 6: As Listing 4. but change as follows:

$2005 jsr $b79e $2008 1da "'$00 $200a jsr Sbdcd $20Ud rts

;get 1-byte value ;.a .,... $00 ;print .a•2JG + .x :end of routine

Listing 7: As Listing 4, but change as follows:

$2008 jsr $b7f7 $200b jsr $aeld $~WOe

jsr $b79e

$201 1 lxa $2012 ldy lf$00 $20 14 sta ($14),y $201 G rts

Now, anytime this routine is t:alled (SYS B1n). it will print the current value of Lhe integer variable 'AI) %'. Note: we hac1 to r hangr the integer to floatiu~-poi 11t value bdote we roulci print it- this is the cause that make::; iuleger variables arr slower than floating- point. The BASIC in lhe 64 cannot handle integer arithmetic, it converts them to t-'-P's, then does the operation antllheu cu11verts the result back into an integf!r.

;convert to integer ;check for comma ;get t -byte value ;.a-:- ~x ;.y= $00

;put value into memory :end of routine

Uatiug 8: Assemble at $2000 $20001da "'$3b $2002 jsr $aeff $200S jsr $ad9e $2008 bit $0d $200a bmi $200f $200c jmp $ad99 $2001 ldy *SOO $20 I I Ida (SG4).y $2013 beq S202f

llstJng 3: Assemble at $2000

Tho Tranaoctor

$b0e7 Sbba2 "'SO l $bdd7

;save value ;fi nd variable ;transfer from memory to fpacc 11 I ;.y.,. I ;print fpacc ,..1 ;end of routine

Now, anytime this routine is called (SYS 8192). the floating- point variable 'A: will be printed.

:get address hi :save it ;save length ;zero y reg ;get a char from st ring ;print it

Now anyti rnc a cal\ to $2000 (SYS 8192) is executed, it will print th ~ cnrrent value of the string 'AB$'

$20001da *$11 $2002 sta S45 $20041da *$00

$46

;I sl char-uit 7 =0 ·save value • ;2ntl char- uit 7 = 0 10

;.a= $3b ;test chrget for char in .a

:evaluate expression :indicator for type ;if neg then string ;'type mismatch' ;.y=$00 ;get length of string ;if length = 0 then go


·······-· ····-·- - - -- - - - - - - - - - - -- - - - - - - -- - - - - - - - - - · · - ··-····--·-·····-,..--..·.,.-·-· --...,. --ww=••=

$201 S sta .$97 $2017iny $20 1~ lcia ($fi4),y $20 l asta .$14

;s;we l r~ngth ;.y =.y I 1 ;g1~t lo of string address ·*14.• ,-> ... ....

;.y = .y I 1 $20 1rllcia (S64),y ;get hi of string address $201f sta SIS :S1S= .a $2021 nop :at this point , the string is ;at ($ 14) and its length is in $97 $2022 nop

$201riny

$202~lfiy

N$00 :.y= soo $2025 lrl:t ($ 14},y :gel a chara<:tt~r of the string ;print r haracter $2027 jsr Sffd2 $202a iny :.y = .y + 1 $202b cpy S97 :compart! .y to length $202d bllf! $2025 :print anotlter character of the string :end of routiru~ $202f rls

l I

The String ln~~ert Program This program takes th rt!e inputs: posit inn at which to st;ut the insertion and two strings. the one lobe inserted and the receive tbe inst~ rt. This program is an exercise in retrieving values using the wmlge lt!dmique and also the variable tedmique. The program resides at SCOOO on a C- 64, but with modifications .could !Je made to fit anywhere else. The !>)'ntax for using is:

i

sys 491!;2:inscrt position, variableS. string The result is then left in 'variahle$'. e.g:

a$= • t.larren • : sys 49152: :i, aS. • ccc: •

will resull in AS I.Jeing • dam:c:reo • .

l

'!

$c000 Ida A'$3a $c002 jsr $aeff $cOOS jsr $t>70e $c008 txa ScOO!l bne $c00e ScOOb jmp $af08 Sc:OOe stx $1 5 $cO I 0 jsr $aefd $cO 13 jsr $ad9e $cO 16 bit $0d kO 18 bpi $c00b $cO 1a Ida S65 $cO 1c beq ScOOb .$cOle Ida $47 Sc020 sta $3f Sc022 Ida $48 Sc024 sta $40

.

sc02s Jdy •soo

:.v=O

Sc028 Ida ($64),y

;get length of string # I (remember that ($64) pointed to a string of three bytes

'

;test for character in .a ;get a single byte value (0-255} :set flags ;if not zero then fi ne ;'syntax error' ;save the valu(~ ;checjk tor comma ;ev!lluatc expression ;rest flag for type ;if numeric then syntax :~et lo of address :if zero , then it was nor a variable :~et lo of address of stri ng

:save it ;get hi of address of string

·save it '

-aa-.;c:-,-:t-o---;!r-:·-::::::::::::::::.--_· - ---.. -_-._-_____,____

c-·..., Th : -•- lr __!. _ ft __

which wr.rc takfn to be len~th, string ;,c1c1 r~!>.<> lo nnrl stri np, address hi) htXJ $c00h cmp $ 15 bee $c00h beq S!'OOh sta $c200 inv• $c0~6 Ida ($64),y Sc038 sta Sc201

Sc02a Sc02c $c02e ScO:lO $c032 $c03!i

ScO~~b

iny

Scmc: Ida Sc03e sla $c041 jsr $c044 jsr Sc047 bit Sc:049 bpi Sc:04b ldy

(S64).y Sc202 Saefcl $ad9c SOd ScOOb "'$00 Sc04d Ida (S64),y Sc04f beC'J Sc:OOb Sc:05l sla Sc:203 Sc:O!i4 iny Sc055 Ida ($64),y $c0!;7 sta $(·204 $c05a iny kO!ih Ida (S64),y ScOSd sta Sr20!i Sc-060 lcia S64 Sc.062 ldy $65 $c.064 jsr Sh&ih Sd>67 clr ScOAA Ida Sc-200 ScOOb arlr Sr203 $~ sta $14

:if kngrh is 7.Cro then syntax ; rom ra r~

IC'ngth with lnsrrt location

;is ir lcJ>.<; (i n~rt ion Impossible) ;lo; it ~CJII:ll (usc mnratcnarion) :s.wC' lrngth ;.y== .y 1 I :get string *I acidr~s lo

:save ir ;.y= .y I J ;get string *I arldrcss hi

:s.wc ir :rhcck for comma ;!'valuate cxpm!>.<;ion

;t<'}>t ty~ tlaR :nu meric then ·syntax error' ;.y == 0 ;get IC'ngrh of siring ,..2 ;if length is 1.cro then syntax ;save length ;.y= .y 1 I

:gel string *2 adrlrcss lo :s.w c string *2lo ;uidrcss ;.y = .y • I ;gcr string *2 hi address ;s.wC' it

;C'Ic<~n

I l

dl'.<;. srac

;get strlnR " I lcn~th ;nrld string *2 lcn!o'lth ;savC' IC'ngrh

$c070 bee $c075

;under 255 total length

Sc012 jmp $bG58 $c075 jsr $b4f4

;'string too long'

:make room tor litl'ing $c078 ldx ""SOS . $c07a Ida $c200,x : $c07d sta $22.x :transfer pointers to zero page $c07f dex ;string * l-Ien· $22, pointer ($:!3) $cOSO bpi $c07a ;string •2- len · $25, pointer ($22) $c082 ldy .. $00 ;transter string ~I. .... $1:084 Ida ($23).y ; $c08G sta ($33).y $c088 iny $c089 cpy $15 $c08b bne $c084 $c08d tya $c08e de Sc08f adc $33 $c09I sta $4 I $c093 Ida $34 Sc095 adc .t$00 $c097 sta. $42

I

II l

;until insert length achievt!d ;

;increase ($33) by .y ;and leave result in ($41 J

·-=========================-=--····--=-=========-~ ~__,1 _1=..,--------·_···-~~~~--------~ ...:Vo .: -i:.:: .;:u.;,..::::•;.:S<~..<..:.:.I.I,;!I~U·~0~2~J


Sc099 ldy ,..SUO Sc09b Ida (S26).y Sc09d sta (St! I ),y Sc09f iny SrOaO r py $25 Sr0a2 lme $<.:09Ll $cOat\ tya $c0a5 de Sr.Oa6 adc $11

$r0a8 sta $1 1 $r0aa bee ScOae $c0ac inc 5'12 ScOae Ida St! I ScObO soc S<:Ob 1 sbc S15 $rOb~ b<:s Sc0l.l7 $c0b5 dec 512 k0b7 sta St! I $c0b9 ldy s15 kOblJ Ida ($23),y $c0bu sta ($4 1).y $c0bf iny $cOcO <:JJY S22 $c0c2 Llne ScOblJ $cO<.:tl ldy • $00 $<.:0<:6 ltla $1 tl $<.:0<.:8 sta ($3Q.y $cOca iny kOd.J Ida $33 $c.:Ckd sla ($31).y $cOd iuy $<.:089 Ida $34 $t:081J sta ($3J).y Sc08d rts

;transfer string ...2

S02d I jsr $ffe4 S02d4 cmp•$Od S02d6 beq S02e7 S02d81dy SSe S02da sta ($&),y $02dciny . $02dd sty $8e $02dr cpy $8b $02e l beq $02e7 $02e3 Ida $90 $02e5 beq $02dl $02e7 jmp $ffcc

;to memory · ($41 ) ;finished'? ;nv ;inwease ($4 1} by ;value in .y/ .a ;and leave ;result ;in (S41 ) ;decrease {$4 1}

;get insert position ;transfer last half ;of string # I ;fin ished! ;no ;.y= O ;total length of new stnng ;slvre in in variable .

;gel string address lo ;store it in variable ;get string address hi ;store it in variable . . hed".. •I!IllS

S02dl hJy #$02 S02c2 Ida (S2d),y .{S2d) is start-of-variables (simple) S02c4 sta $0U8!:*.y ,this area is free space

iny

$0~c~

cpy "$UG $02ca bne $02C2

;yes ~

;get index to string, · start = 0 ;store it in the string ;increase index by one ;save new index value ;compare it to actual length of string ;they are equal-no room left ;should always be zero ;an always branch ;untalk fil e and return to basic

BASIC Loader For String Insert

;by value in S 15

Tltb last pru~ram, by Jim Butterfteld. uses the variable Ledt11i4ues. It is a program to return a stnng of characters in11ut lru111 li te disk. ll allows inputs tncluding colons. commas, aud semi- colons which, if used with an I PUP' stalentt:llt in ijASIC would cause a 'extra ignored' error. OPEN 1.8,2, " NAME " is needed before this code will work attd first variable delined must be a string variable.

$U~ c7

;get a char from file ;is it a return character?

,is it G? ;no, lets get some more

1000 rem string rnsert 1010 tor j = 49152 to 49364 : read x 1020 poke j,x; ch- ch + x : next 1030 if ch<> 25843 then print" checksum error" : end 1040 rem use sys49152:po,targ$,ins$ 1050data 169, 58, 32,255,174, 32, 158, 183 1060 data 138, 208, 3, 76, 8, 175, 134, 21 1070 data 32, 253, 174, 32, 158, 173, 36, 13 1080data 16, 241 , 165, 101,240, 237, 165, 71 1090 data 133, 63, 165, 72, 133, 64 , 160, 0 1100 data 177, 100, 240,223, 197, 21, 144, 219 1110data240,217, 141, O, 194, 200,177, 100 1120data 141 , 1, 194, 200,177, 100,141 , 2 1130 data 194, 32, 253, 174, 32, 158, 173, 36 1140data 13, 16, 192,1 60, o, 177, 100, 240 1150 data 186, 141 , 3, 194. 200, 177, 1oo, 141 1160data 4, 194, 200, 177, 100, 141, 5, 194 1170data 165, 100, 164, 101 , 32, 219, 182, 24 11 oo data 173, 0, 194, 109, 3, 194, 133, 20 1190data144, 3, 76, 88, 182, 32, 244, 180 1200data162, 5, 189, 0, 194,1 49, 34, 202 1210 data 16,248, 160, 0, 177, 35, 145, 51 1220data200,196. 21 , 208,247,1 52, 24, 10 ·1 1230data 51,133, 65, 165, 52, 105, o, 133 1240 data 66, 160, 0, 177, 38, 145, 65, 200 1250data 196, 37, 208, 247, 152, 24. 10 1. 65 1260 data 133, 65, 144, 2, 230, 66, 165, 65 1270 data 56, 229, 21 . 176, 2, 198, 66, 133 1280 data 65, 164 , 21 , 177, 35, 145, 65, 200 1290data196, 34 , 208. 247, 160, 0, 165, 20 1300 data 145, 63, 200. 165, 5 1, 145, 63. 200 1310data 165, 52, 145, 63, 96

-dft~ t

thi:, luvp has been executed. the string length is in $81J, :,lting addr ess in ($8c) and both $8e and $8f are zero.

$02cc Ida ,..$0 I $0:!ce jsr $fie() The Transactor

.

;command file liJ to talk 12

Volume 5 1 Issue 02


~----------------------- ---···· ·· ·· · ····

I

. . .. . ····-

················· ---------- - - - - - - - - - - - - - - - - ,

CIA Timers

Elizabeth Deal Malvern, PA

Timers un the CIA ch ij) are fun to work with. They are versatile little ucvin;!s. They• ran n u~asure time intr.rvals of several microseconds up to several rnin11tes. They can time a duration of a signal ueiug in one logic state, they can be used in continuous. recycling mode, or do a quick count anfl quit. They can lw. given a new timc value at any timc, they can be read reliably, the flags thcy ~~ c:an he mui corr~tly, and they can ring a bell for attention ... nee<i I go on? I"'' your imagination run wild - you can use those docks for all sor ts of terri fic experiments.

I wanteri the rlorks to pnnlcip:-.te in a simple SID orchestra. B11 t I soon tlisrovcrrd that tralninR a clock to be a musician isn't si mple The dock refused to keep the beat (a contradiction in terms?). At first I thOURht I coded the whole thing wrong, hut suhscqucnt snooplnR Into the operation or the timr~ rrvrnlcrl that there is a problem built into the CIA c-hip. Arrording to thc rhip description in the ProRrammer's Rcfrrcnc£' f.uirll', thr timers can be used in, what they call. 'extcmd<'rl mode'. That's fancy talk meani n~ timing events longN than about 1/ 15th of a second, precisely my goal. The chip offers rwo oprions in how to use the timers: you can scr thrm nnri rcnd rhem in a loop waitinj:! for the elapsed timr to pass. or ynH can set them and ask that they call you (intcrr11pt) when the ti me Is up.

They aren't even all that diffirult to use onre you get the drift of the jargon in the hook. I find these translation_<; helpful:

CRAIB i~ control regislt~r A or B - I hat is a p<mC'I of switches 011 top of dock A ami dock R. You fli p and turn th<~ switches ati you wish (position 0 to set thr. alarm, position 1 to set the

The sort of thinf.l I was codinp, did not need the speed of Mtenrlon nnri thc accuracy of the interrupt-generating fea· ture. And since it's dcvil:ishly rompticated to set up a whole alternate intcrn1 pt system immune to crashes. I decided to go the easy way Let the clock run. I can check it about the time I think it mlp,ht be done. I knew I had Jots of time to spurc So I coded somcthinp, like this:

dock - th is sort of thing).

K:R is interrupt c-oni rnl

rc•gisr c~r

- yoll tell it which (if any} events should call you (alarm): it tells you the stnrus of events (eight bits have come in). It's a neat r.ommunir.ation link. It's two things in on<~ plarr for two siflcrl talk. The only tricky thing hNC' is that onrc yott 'v~ askr<i it a question (has clock B done its's job?) the status, if thC' answer is yes, vanishe_<;_ Which is wonderful in a way, hffausr. it gets rr.~1 dy for the next event, but you mily need to rememhcr the srams if you arf' looking at more than onf' thing. I wish VIC: chip was huilllikc that .

I Sf'l the timers for some duration 2 do othN thinp,s, then look at the clock3 has the dock sN its 'all-done' fla~? 4 if not, waste more time i.e. goto 3 5 all done.

In any casf', I harl my sharr of prohlcms, :mrl this article discusses just one rnocie of thC' timers' operation, TIMING fairly LON(; P.VRNTS. hy romputer st:m<1ar<1s, that is. '---- - -

This didn't always work Thinp,s Rot stuck. Music sounded rat he-r odd, bc:-inp, off-beat. Some notes sounded twice as

------

The Yrartaoctor

83

Volume sw e 02 . . ... ....5..f. ..l__ ................ __,._


long as they should, and, (very infrequeully), the loop neve1 cnci<'ci c-rashing the computer which ju:.t sat there waiting for that flag to hC' SC't. Thinking I had a coding error, I rev ised1 ny appro:~rh . Rut subsequent snooping reveah:~d that while I mny wrll hav~ rociing problems, the chip h as prui.Jlems of its own whirh thr attached program ueiiiOtlsl rales in vivid colour ami noise.

It i nrltld('S two tests. You can cha11!Se the tiwiug by changing vnrinhlf' TM in Ra~c;ir code. Since I am only i uteresteLl in events r.xr<'edi ng 1/ I Sth second, Bask uses only one I.Jyte for time. This value should be greater titan zero. Test I puts the tim ers in the mode I was trying to use - no interrupt YIYlUC'.<;I. When you run it you will hear fairly regu lar rlir king noises and the colours shou ld I.Je coordinatccl . At some point (normally withi11 llu~ rirst 5- 15 seconcls) things fall apart. We miss Cl d ick and Lhe colors h0.comr. 11nsynchronized . The point of tl 1is exe1cise is to show that liming is taking plCice, that lil llt:!r B does in fact co ttnt down past zero, but that it sonteti mes forgets lo tell thC' flag r<'gister that it's mission is fi u islt~ . Hence, lo use this mode, the only reliable way seem:. to I.Je to code around the problem to watch the duck it:.t!lf amJ iguure the flag altogNher. T('~ t

2 clor!; 11

more difficul t thing: it tel ls Limer B nul uuly lu coun t h11t to Interrupt the computer wlteu the litue is up. Th is is a vital mode for c:ri tical tirnillg operations. hence we hnve to lrusl its reliability. I once tlluuglll that it. too, misheh;wed . Rut I can't uuplit:ale tl1e results any more (progrnm chang<'~'>!) . So while I can 't be 100% su re it never fails, I think I found a musician after Clll. If any of yo11 frcl like runni11g lest 2 fur a good. lung time, please share your results with all of us.

RcfcrcnccH

1. .li m Btlllerfield, Memory Maps ami Machine Language lr.c;sons without which I wouldn't know where to l:!ven begin rloing this sort of thing. 2. R W<'.<;t, Programming the PET/ CBM which talks of hardwar(' matters in som ewhat si mpler limns tha11

1000rem-------- ----------------- --1010 rem 6b26/cia timer- b hz deal

1020rem----------------------------

1050 tm - 08 : me =832 : bO- 176 1052 11 peek(mc)•peek(mc+ 1)<>16 • 75 then tor J = 832 to 1022 : read • · • ------v . • • '. ''' 1060 i$ = ·" :print" I I I i' I' I I ' ,' :' ' " 1070 print" <cr;ctrl;wipe + cr> timeout: :1ntbit 1080 input "-do test 1 2 "; i$ 1090 pokebO,tm 11 oo onasc(1$ + • 0 • )-48goto 1120.1130 1110 end 11 20 sysmc . goto 1060 1130 sysmc + 6 . sysmc + 3 . goto1 060 1135 rem source code below can be omitted, 11 37 rem data from 5000 on must be entered

-

I

'

11~0rem ------------------ -------- --

1150 sys700 ;pal source code 1160 .opt oo 11 70 • - $0340 ;save to $3ft 1180 ; 1190 Jmp test1 1200 1mp test2 1210 jmp nmtSW 1220 here .word mynm1 1230: 1240 p -17•40 + 28 ;for screen ;non-kb c•a 1250 cia2 = $ddOO 1260 ta2 = c1a2 + 4 ;timer a 1270 tb2 = c1a2 +6 :t1mer b 1280 cra2 = cta2 + $e ;ctrl reg a 1290 crb2 = cta2 + $t ,ctrl reg b ;1nt ctrl + flags 1300 1Cf2 - Cta2 + $d 131 0 c•a 1 ;the other eta - $dcOO 1320prb1 -cta1+1 :stop key here 1330 col - $d800 1340 mask1 -%00000010 1350 mask2 = %10000010 1360 ctrlky =$fb 1370 anynml "" $318 1380 nornm1 -$fe47 1390 inex - $febc 1400 val -$b0 :goes into tb2 1410 once -val+ 1 ;to always moves 1420 to -col+p 1430 in -col+p+ 1 ;In,noise when 1440 noise =$d4 18 ;timerb sets ftg

~ . Cornrnodore6~ Programmer 's Reference Uuide, hardware

1400 ;---------------------------------

appenciix. Cireat hook. The hanJware pages are rough read· ing for pC'oplC' new to this sort of tltiug, but all the information is nsr.ful if you can som eh ow ai.Jsurll their jargon into your own th inking.

11160 ;tb somet1mes fails to set a flag 14 10 ;show#1 - not asking for interrupt

The Transactor

1480 :------- -------------------------1490 test1 - • 1bOO Ida tcr2

Volume 5, luue 02


I 151 0 sei : Ida H%0111 i 111 : jsr setup 1520 Ida #mask 1 1530 wait ~ • 1540 jsr teststop: beq quit 1550 ; watch timer b reload 1 560 jsr watch 1570 ; check timeout flag,loop !f 1580 bit icr2 : beq wait 1590 ; flag worked this time 1600 jsr click : beq wait :always more 1610; back to basic 1620 quit eli : rts

o

1630;--------------------------------1640 ;showH2 - asking for an interrupt 1650 :seems to work most of the time i 660 ; "'"' '"' = .:::: ""(can't prove non-failure!) 1670·--------------------------------, ·1 680 nmisw- • 1690 ; clr fl ags in hope o1 surviving 1 700 ; what follows 1710 Ida icr2 : Ida 1%01 i 1 1111 : sta icr2 i 720 ; revector nmi stuff to here 1730 ; this can kill you i 7 40 Ida here : ldx here + i : jsr setvec 1750 : now tell the icr & clocks 1760 Ida i¥mask2 : jsr setup : rts 1770; t 780 mynmi ""' + t 790 pha : Ida lcr2 : and #2 : beq myi2 1800 txa.: pha ; tya: ph a : jsr click : jmp inex 181 0 myi2 pia : jmp nornmi

1820: t 830 test2 ... + 1840 ; nothing better to do loop 1850 jsr watch : jsr teststop : bne test2 1860 ; set things back to normal 1870 Ida #0: sta icr2 1880 fda #<nornmi : ldx: #>nornmi 1890 setvec - • 1900 sta anynmi : stx anynmi + 1 1910 rts 1920; 1930 teststop - • 1940 ldx prb 1 : cpx lctrlky : rts 1950 ; 1960 watch = • 1970 ; watches timer b reload 1980 ; iQnore qulck reading results 1990 ldx tb2 : cpx val : bee watch9 2000 cpx once : beq watch9 2010 inc to ;displ timeout

2020 watch9 stx once : rts 2030 :

2040 click = * ; & displ flag set 2050 inc in : ldx #8 : stx noise 2060 sig1 dex : bne sig1 2070 stx noise : rts ;z = 1 2080 ;

2090 setup = * 2100 sta icr2: sta to : sta in : inc in 21 10; init clocks {val*ta)whatevers 2120 ldx #$ff: stx ta2 : stx ta2 + 1 2130 inx: stx tb2 + 1 : stx once 2140 ldx val : stx tb2 2150; force load time.tb counts ta 2160 ; timeouts, cont mode,clocks run 2170 Ida #O/o0001 0001 : sta cra2 2180 Ida #Ofll01 0 10001 : sta crb2 2190 rts 2200 .end 2210 end 5000data 76, 75, 3, 76,151, 3, 76.106 5001 data 3 , 129, 3, 173, 13, 221 , 120. 169 5002data127, 32,213, 3 ,1 69. 2, 32, 175 5003 data 3, 240. 13, 32 , 101. 3 , 44, 13 5004 data 221 , 240, 243, 32. 198. 3. 240, 238 5005data 08 , 96, 173. 13 . 221.169, 127,141 5006 data 13, 221, 173, 73. 3 , 174, 74, 3 5007 data 3.2 . 168, 3 , 169, 130, 32. 213. 3 5008 data 96, 72. 173, 13. 2.21 , 41 . 2. 240 5009 data 10, 138, 72, 152. 72, 32. 198, 3 501 0 data 76, 188, 254, 104, 76, 71 , 254, 32 5011 data 181, 3, 32, 175, 3 , .208, 248. 169 S012data 0 ,1 41, 13, 221.169, 71.,162,254 5013 data 141, 24, 3. 142, 25. 3, 96, 174 5014 data 1, 220, 224,251 , 96, 174, 6, 221 5015 data 228, 1 76, 144, 7, 228. 177, 240 , 3 5016data238, 196, 218,134, 177, 96,230, 197 5017 data218, 162, 8, 142, 24. 212, 202,208 50l8data253, 142, 24,212, 96,1 41, 13, 221 5019 data 141, 196, 218, 141, 197,218, 238, 197 5020 data 210, 162, 255, i 42. 4, 22 1. 142, 5 5021 data221,.Z32, 142, 7,221 ,134, 177,166 5022data 176,142, 6, 221,169. 17,1 41. 14 5023data221, 169, 81,141, 15 , 221 , 96

I


r------------------·--·-------------·-------------------,

Commodore 64: 6526 Time Of Day Clock

Sornelimt>~'i

when you need it the most you can't get it. I'm referring to tlte lime. Tile Cornmodore 64's Tl$ function r.an sum~lillles cause d lillie frustration, lou. You will often find that Lhe value for Tl$ will l.Je off by a miuute or two after having run for ouly 2 hours, amJ if you're using dbk access in a program, you' ll find the time will be off by even more.

Therefore it would llldke a lot of sense to use the fiS26's Time Of Day duck (l'OD) inside the C61, so you can l<eep track of time more accurately. Ok, here we go! The Tl string is calculated on an inlermpl basis: every time the interrupt roulineti are called its value is incremented by one. Tl is mea'iured in jiffies. A jiffy is l / fiO of a second and Uti:; is how ofte11 llte interrupts ucc:ur. Sometimes people waul to tlisable the stop key or the run/ slop restore keys and in doing this you rnust rermJte th e interrupts. Depending on bow you do this you coulci corrupt the Tl$ timing. Usiug the TOD clock you can avoid this problem. The 6526 TOD dock Joes not depend 011 interrupts to update thr. li llie. The TOD dock is a free- running dock in the 6526 cflip . Also if you are using machine language programming and you need to wedge into the interrupt routin~:s ymt will ofltm upset the TIS firni11g and lhe time il givt~s you will hP. way orr the mark. What is needed is someth ing that is ac~r:miltr.nnd invisible to the Cn4 . The TOO doric is about as invisible <J~; you can get and a.<; for accuracy it's as goon as u. $100 quMIZ watr.h . All yo11 nc:r.d to cio i~ ~N thC' clock running and l hen you don't have to wor ry ahoul it agilin . You can check the time as often or a.s little as you like.

Mike Forani Burlington, Ont.

I 0 l .oad in the machine language routine that sets and reads rhe r.lor.k. lt is located at SCFOO-$Cf'F'F. (52992-5324 7 in der.imal) 20 Stop the rlork if it is already running. (umvedge the program if it is \'>'eclgcd in.) 30 Get the time in a 24 hour format. (eg. 22,14,45) 40 Poke the time values inro zero page for the machine language routine to nsr.. 50 ralt the machine l;mguilgc progrnm to setup the clock and wr.dgc into the interrupts so the code that displays the time will he cxccutcrl.

This short little program just sets everything up. Once it is fini~hcd the clock wit! be (lisplayed on the top right hand corner of th<' screen until you hit the run/stop restore or until you tmn the clock off by using the 'sys' in line 20. All

on

at this point is that the lime will be ron$l<lntly displ<\y(\d on the screen while the computer remains on. To get the time tnto a string incase you needed ro usc it for something you could try the following little

rhnt will he going

murine:

I 0 il$ = • • : for <1 = 32 to 39 : b{a- 32) = peek( I 024 + a) : next 20 for a= 0 to 7 : a$= a$+ chrS(b(a)) : next

30 print a$ This routine does the following: 10 Get the ti me off the screen and into an array. (it is always display~d)

Listr.(J after this artidr. is a machine language progrnm tht'lt sets and reads the T()f) r lodc To use this along with b;:~sic you could have a litt le program like the following: 10 ifa= Orh r~na = 1:lnarl "dork " ,8, 1

12•409fi I 1fi .. 2:i6 i :i 30 inpnt "C'ntcr time (hh,mm,s.s) " ;b(2), b(l ), h(O) 40 for a "" nto 2 : pokc2::i 1 i a, h(a) : nr.xl SO sys 12,..409fi 1 lfi,.,2:i6 20

SVS •

What this program docs is the following:

20 Turn the numbers in the array into characters and conc<ltcnatc 1hem [rllo a strlng. 30 Print the string. (you could use it for something else)

In doinR this the time can be taken orr the screen and you Ciln build your own Tl$, or something like it, when you need it.

The m<:~ch i n c languap,e program has two entry points: $CFOO and $CF03. The first entry point sets up and starts the clock and the second stops it. Here is a description of what the program does:

~[_:~~~~·~~~a~n=~~c~to~r~--·-·------------------------w----~~6~-----------·-··-···-··-- ___


r--------------------------... .

~-··"'·-

Setup

1) Reconstruct the input, at locations $fl>, $k, $ft.J, so it is in the pruj>er form for the 6526 TOO dock. 2) Set tl1e dock values and start it running. 3) Wtldl!le in at lhe IRQ vector and set a toggle flag. IRQ's occur 60 ti mes a secouu aud I uo uot neeu to update Ute duck ubplay that often . 'TOI!ll!lle' is used SO the uisplay is U!Jdated once every N inhmupts. N can be changed, initially it is set to 15. Therefore the display is updated every 15/ 60ths uf a St.'Conu, or 1Limes per seconu. 1) Return to BASIC anu leave the clock to running. If the dock is to ue tumeu off the co<ie is simply unwedged by replacing the wedged- in IRQ vedor value with the normal IRQ vector value.

The interrUJJl-driven JJ3rl of the 111achine lauguage cuue works as follows: Update I) See if ou r toggle is li!ne<.l llown yet. If it isn't, go to the

regular IRQ routines. 2) If the toggle is limed out theu put the current character colour in t11e colour table in case it is a kemal 2/64 and the screeu was cleared. !:$) Get the hours register anu check it fur the am/ pm bit, lhen get the minutes and the seconds. 4) Break apart the registers, so they can be displayed, and then display them. (ie. the register will read as KS23 and it must be IJruken down to *$32 and *$33 so it can be displayed.) 5) Go do the 1egular IRQ routine!>. All of this will be occuring in background interrupts while you are operating in HASIC or machine language. Also listed is a HASIC loader fur the lllochin~ la11guage program if yotJ do not have an assemblt:r vrujSrant. In case you want the clock to be displayed difrerently. ilertl are a couple of modifications you can make: I ) 12 hoUt clock. To do this you need tu put NOP's in thtl

machine language program at $d~e. Scf~l. $cf90. In the BASIC program do the following pokes after the program is loaded 10: poke 53134. 234. poke 53135. 234: poke 53 136,234

I

--··--·-·--·-----------~

2) Rate of display. If for som~ rr.ason you need to update and display the dock morr. thnn 4 times n second all you need to do is change th~ togglr. villilr.. In the machine lunRuaj:le program change the SOf t~t $rf5 1 ;mci Scf6a to a number between I and 2:>5. For the hasir program do the following poktls after the program is loacir.ci into memory: poke 530n,

XX : pok~5309R, XX

Where x.x is some numhr.r h~twc~n 1 anci 255 Por the display rate change I woulci suggC'_c;t !hilt you try to keep the toggle values behveen !i and 15. Th~ rc;tson for this is because you don't want to upciatr. the rlock every interrupt or you will slow down th~ speed of the Cfi4 and you must do it at least twic:e a ~conci so thr flilsh of th<' ':' cf.ln occur. The reason for having thr. program reside at $CFOO is just so that it doesn't get in th~ way of anything. (I hope). E11joy this lillie program. I hope it helps you in ciiscovcring a little more about the workings of the Commodore 64. In my next article we roulci ciisruss thr. way in which to use the 6526 TOO clock to gcncriltC' interrupts - AN ALARM CLOCK.

Editor's Note When I tried Mike's clork ciisplay on my 64, the dock seemed to tick like a ciripping fat I CCI -steady for a while then two quick ones, or two short ones, etc. The problem? An inaccurate quartz crystal. (That 1 in a rhous:md had to be mine} But everything <'I~ works just fine' and until I get the urge to write an extremely time S<'nsitivf' program, I prohably won't bother replacing it. If yours is running a little 'rough' too, and you neeclthe t~r.cmary, your service r.cnrcr can replace it in about I !i minutes (ie. 24 homs), or yon hackers can wip one in yourself for nro11nci!) hurks. 100 110 . '• 120 lflj . 130 ClllV 140 scrn 150 colour 160 -• 170 clrtab 180 cial 190

:wo

St.'CS

With these changes the clock will only display in a l:l hour mode. ie. 12:59:59 would roll to 01:00:00 instead of

:llO

mu1s

~:w

hrs

13:00:00.

230

;program vnriahlr.-s == $ea31 ... $0314

.. $0400 = S02R6

= Sd800

;normal irq routinr.s ;irq ve{:tor ;the screen stnrts hNr. ;rmrcnt c:hnrac:tcr colour value

= Sdd>O

;colour table ram ;cia number I irq's

= $fb = $k = Sfd

;seconds ;miuutes ·huu rs •

..

Tho traruac:to,.

Volume 5, luuo 02


240

• "" $d00

;the program resides at $d00 and up

720 730 ; 740 750

250

:wo

;set up for set time

270 280 290 300

760 ;

310 setup ;)40

330

340 set! I 350

jmp setup jmp kill

;start the clock ;stop the clock

se1• ldy "'2 sed

;no interrupts allowed

420 430 440 450 460

dey bpl setl l Jda hrs cmp "'S 13 bee setl4

470 480 490 500 510 540 setl4 5:;o 540 550 560 570

sec sbc "'$12

3~0

390

800 810 820 830 840 ;

;convert inputs to bed

clc

400 410 setl3

;)70 setl2

780 790

Ida "'0

ldx secs,y dex bmi setl3 adc 111 1 bee setl2 sta secs,y

360

770 kill

ora #J28

eli rts

;enable the irq again ;return to basic

. se1 Ida sta Ida sta

"'<irq . cmv #>irq cinv+ I

eli rts

;adding one in decimal ;this way a •23 will be· come a •$23

890

Ida

900 910

sta toggle Ida colour

920

ldy #7

930 loop 940

;check and see if pm. flag is to be set

950

960 970 980 990 1000

;set pm. bit

~~' 1 5

cmp *$ 12 bne okhere Ida #Q

beq okhere 1020 tohere and • %000 1I I II

Ida sees

1040

bcs okhere

;.a-seconds, .x.,., minutes ;.y.,hours

1050

S€1

10~0

600 610

stx cia I + l 0 sty cia I + 11 Ida ~~'0

sta cia I + 8

;tenths of seconds - dock starts here

sed de adc #$ 12

ti40

Ida cia ! + 15

630 640 650

and ~~' % 0111 1 111 ;clock not alarm

sta cia I + 15

660

Ida ,..<update

670

Sta CIIW Jda ,...>update

;set the 652G's time of day

1070 I080

1130 I 140 l l SO

;wedge irq so i can ;update the clock

The Trenaact...

;it must be pm so add 12 hours to value

Ida cial + 10 sta time + I Ida cia I + 9

;minutes

;seconds

sta time

1160 ;

sta cinv+ l ~~'15

;if pm then fix the hours value

1090 okhere sta time+ 2 J I 00 cld 1I I0 eli

1120

Ida

;turned from 235959 to

1010

clock

680 690 700 ; 710

;only need to update 4 times a second ;reset the toggle byte

000000

;get registers

cmp *$ 12

s~u

;decrement the toggle byte ;is it time to display the

;if a kernal 2 c64 then fix up the colour sta clrtab + 32,y ;table values dey bpl loop Ida cia! + 11 ;hours ;see if am or pm bmi tohere

1030

5~0

;put irq vector back ;to normal value

clock yet

ldx mms

sta cia! + 9

;stop displaying the dock

;go back to basic

870 update dec toggle 880 bne noupa

dd .

;interrupt so use a toggle

850 ;update the clock and display it 860 ;

sta hrs

ldy hrs

sta toggle

1170 1180

;i don't want to do it every •

••

1dx *2 ldy ~~'30

Volum• S, lnu• 02

I


1190 goer

Ida time,x

1200 1210 1220

sta temp+ 1 . JSr distim • my

1230 1240

iny

1250

Ida remp+ 1

1260 1270

iny sta scrn,y

1280

dex

1290

bpi goer

1300 . ' 1310

Ida ciat +8

;tod tenths of seconds

1320 1330 1340

cmp "'5 bcs abov5 Ida

;see if we sshould print a·:· ;or a ' ' inbetween the ;hours/ minutes/and sec· onds ;to 'hide' next Ida

scrn,y

sta

•ss

byt $2c 1360abov5 Ida "32 1350

1370 1380

;print the hours then min· utes ;and then the seconds

-o

sta scrn ;- 37 sta scrn+34

1390.•

1400 noupa •Jffip •trq 1410 :

1420 distim txa J430 pha 1440 Ida

.ro

;~o do

normal irq stuff

;make the value in temp a

screen printable 1450 1460 1470

sta temp Ida temp + I

ldx

~3

14RO disui

as!

a

14~0

rol t"mp

1500

dex

1510 1520

hpl disui lrla trmp+ I

}!)~()

;md *%00001111 om #$30 sta temp 1 l

154(} 1550

1!16() 157(} 1!180 1590 1600 1610; 1620 temp J6:30 toggle J610 time ) 650; 1660

~form

:take the 12 in one byte and put ;ir imo two bytes 31 and 32

pla tax Ida temp ora ~$3(} rt.s

•=•+2 *=•+1 * =.. ·t·:l

1000 rem c64 time of day clock display 1010 ior j .... 52992 to 53239 : read x 1020 poke j,x: ch ~ch +x: next 1030 if ch<> 31658 then print· checksum error" :end 1040 rem 1050 sys 52995 1060 input " enter time (hh,mm,ss) ";b{2), b(1), b(O) 1070 1or a to 2 : poke 251 +a, b(a) : next 1080 sys 52992 1090 end 1100data 76, 6, 207, 76, 87.207 1110 data 120, 160, 2. 248, 169, 0 1120 data 24, 182. 251, 202, 48, 4 1130data105, 1, 144,249,153.251 ·1140 data o. 136. 16, 238, 165, 253 1150data201, 19, 144, 7, 56,233 1160 data 18, 9, 128, 133. 253, 216 1170data 164, 253, 166,252,165, 251 1180data 141 , 9, 220, 142. 10,220 1190data 140, 11 , 220,169. 0, 141 ·t200data 8, 220, 173, 15,220, 41 '1210 data 127. 141 r 15, 220, 169, 100 1220data141 , 20, 3,169,207, 141 1230data 21 . 3,169, 15,141 , 250 1240 data 207. 88, 96, 120, 169, 49 1250data141 , 20, 3,169,234, 141 1260 data 21 , 3, 88, 96, 206, 250 1270 data207, 208, 103, 169, 15, 141 t280data250, 207, 173, 134, 2, 160 1290 data 7, 153, 32, 216, 136, 16 1300 data 250, 173, 1·1, 220, 48, 8 1310 data 201 , 18, 208, 15, 169, 0 1320data240, 11, 41, 31 , 201, 18 1330data 176. 5, 120,248, 24. t05 1340data 18. 141 ,253.207, 216, 88 1350data 173. 10,220.141 , 252,207 1360 data 173. 9, 220. 141 , 251. 207 1370 data 162, 2, 160, 30, 189, 251 t380data207, l41, 249,207, 32, 21'1 1390 data 207, 200, 200, 153, 0 , 4 1400data 173,249, 207, 200, 153, 0 1410 data 4, 202, 16, 232, 173, 8 1420 data 220, 201, 5, 176, 3, 169 1430data 58, 44, 169, 32. 141 , 37 1440data 4, 141, 34, 4, 76, 49 1450data234, 138, 72,169, 0. 141 1460data248, 207, 173.240.207, 162 1470 data 3. 10, 46, 248, 207, 202 1480data 16,249,173,240. 207, 4t 1490 data 15, 9, 48. 141 . 249, 207 1500data 104,170, 173, ?.48, 207, 9 1510data 48, 96

storage ;toggle byte ;times stored here ;t{~mporary

.end

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

,... ~~~:=:=··:::==· -:: : :. . :.: .:.:. :.:.:. : : : : .: : : : : : : : : :.....:·::. . . . . . . . . . . . . . . . ..... ..----- ~

- ·- - --____J Volu--·-···-........................ .... . ·- S, law• 02 ·~


JOYCURSOR:

Chris Zamara Downsview, Ont.

A Cheap Mouse

For Your Commodore 64

If you program like me, you probably find thm yom

100 rcrn • dal<:1 loader for "JOYCURSOR" •

fingers spend 90 percent of their time on just th rcl" keys on the keyboard - the shift, and the two cmsor control keys. Let's face it: when you're staring nt nn incorrigible program trying to f1nrl out what's wrong with it, buzzing the cursor nround the section of code you're contem platlnp, seems to help. Also, if you usc POWER, BASIC AID, or nnotht"r 11tility rhat lets you scroll your program up and down with the cmsor control keys, it's easy to while away the better part of a cup or coffee by scrolling the program up clm,•n up down up down until yo11 cnn'r sec stmight.

110 : 120 GS ... 0

: rem • checksum • 130 os ... 49 152 : rem • ObJect star I

140: 150 reau b : if r;<O Ill en 180 160 cs = cs + b 170 poke os.b: os = os + 1: goto150 180: 190 il cs w

" •

<>

12839 111en print" • checksum error

•J enu

200 210 sys 49152 :rem • enable ·JOY C URSOR · 220 print" • • Ok, JOYCURSOR is enabled. • • . 230: 240 end 250data120.169, 18,141 . 20. 3 260data169, 192,141, 2 1. 3. 88 270data 96, 145. 17, 29, 15?, 0 280data238, 17,192, 173 , 17,192 290 data 201 , 5 . 208, 85, 169, 0 300data14 1. 17, 192, 173, 0.220 310data201 . 127, 240. 73, 169. 1 320 data <11, 0 , 220. 208. 6, 173 330 data 13, 192, 32. 95, 192, 169 340 data 2. 44, 0. 220, 208, 6 350 data 173. 1<1 , 192. 32. 95, 192 360 data 169. 4, 44 , 0 , 220. 208 370data 6 , 173. 16,192, 32, 95 380 data 192. 169. 8 , 44, o, 220 390data208, 6. 173, 15.192, 32 400 data 95 , 192. 76, 113. 192, 166 410 data 198, 157. 119, 2, 230, 198 420 data 165, 198, 201, 10, 48, 4 1130 data 169, 0. 133, 198, 96, 76 440 data 49, 234 , -1

While doing this, I found mysr~lf wish ing that I could move arou nd the cursor withont having to wear out my hancl nn those thrt"e poorly positioned keys. I wanted something cxtNnal, something like the "mouse" used on some $10,000 1 svstems. \Veil, • what's the equivalent of n mouse on a Commodore 64? Rip,ht! The ubi<pritous joystick. Run the loader prosram shown hC!Iow. If you get a checksum error, rc-rhr.ck tht" OA1i\ statement values and try ngain . Whr.n ymr get a successful RUN, JOYCURSOR wil l be r.nahlr.d. With the joystick plugged into pon H2. you should he able ro moVf~ the cursor around in all directions, including cliagonally. You can change thC' o:;rr.rc1 thnrthr. cursor moves by POKEing a different Vtlh lc in location 49177 (it is originally sello 5). Use RU /STOP RESTORE. to & ;;able JOYCURSOR, and SYS 4~ I 52 to rr-C'nahle it. <mlOY!

'--- - - - - - -- - - ·- - -

l

the Transactor

90

yolum• s; lnu• o2


An Executive SX-64 Emulator Jim Butterfield Toronto, Ont. Can't get an SX-(i4, because you can't afford unt or they are out of ~ l.o~:k? Aud you SttY you llt:-\ld tu ~:hl:!<.:k vut o. program or two to l;Ct:J

Btt s ur~:! to indml~ l ht: ~>~m iwluns ol the ~::nd of line:; 230 i.lnd 250. Whun it's ready, RUN the program. It will take some time. bur

if it works OK on the SX- 6·1 as well as on your regular 6•1?

eventually fom program files will be wrin ~n on your disk. Rr.ru rn tht' SX-64

This procP<Jure will convert your Commodore 64 tnro t1 logict~ l SX-ti 4. It replaces the ROM and a little of the RAM with SX-64 infvt mation. Thu$, yuu can try your ha.nd ot running the machine.

to

irs nwner nn<l take your di<;k home

How To Re.ad lt Power up your Commodore 6'1. Important: if possible, disconnect external devices such as <> Link or Bu~r.ard. Enn~r 1h1~ fnllnwing

Not Much Difference

program:

I

ln fact. the SX-64 is ~·ery dose to a Commodore 64. The major differences are: absence of cassette tape: different background/ foreground ..:olors; a redefinition of the RUN /STOP key; Md

reinlitatelllt-lll of easy• screen POKEs. Thl:l

sut~e n

POKr: Jeaturt!.

together with a few minor clea nup~;. is in all new Commodore 64 units; hur if yo11r ma("hinc dutl'::'l ha<'k n f<'w months M mor£', it will

90 poke 53280 ,3:poke 53201 ,1 1oo a "" a + 1:tf a "" 5 g oto 120 11 0 load "sx" +Slr$(a).8.1 120 print chr$(3 i ); ·130 poke 1 ,53

ne new lor you . Commodore have very ca1efully preserved "entry points" In the computer'~ lugic. Almost anythi ug you code -machine language .. or BASIC - will still worl( on the 64 . We can aH think of system .. ·••fi~ntures that Wl' would havr. likr.d to ~e. changPrt or aclrl(>rl, bnt 'j' ·• ~rnmodore have stayed away from most of them. As a result, th~r~ ·s ¢xtellent corr•patibility betwee1 1 portable and regular 64.

BASIC is idtmticiii to that of prev1ous units; in fac.:t, it t·tasn't

chnnged si6c~ VXC- 20 clay~. Even though BASIC is the .same, the pro~e<hm~ gi\reil b!ilow lo<lds it i n; that w<~y, fun1 re changes rnay be

a.ccornodaten, ·· ..

.

How To Write II

Obtain ac.:tcss to an sx.:.&-1. Bring al"ng a disk and format it. Now: enter the following pr!'lgntim ··.••

1oo ctata 1024.20~$ .· · 1 10 data 55296,56'295 120 data 40960,49151

Run the program. When it's finished, you 'll have a pseudo-!;!X-64. Check it by comrnandi ng, LOAD " ANYTHING" - th~ CUIIIIJUlt:r

will reply DEVICE NOT AVAILABLE. The SX-61 do.f'-~n't have tape. How It'll Done

\1•/e write !our blocks: screen, color nybbles. BASIC R()fi.·J, and kt1rnal ROM. We wrile them as pmgra111 files. so the fir:;t two l;ytl:ls are the load addrE'ss. By tile way, you couldn't s.we the Kernal ROM from n typical mn<'hin~ Jnngn,..lgl' monitor, sinn! thl?re's no way you could lit in that last addre.-.s of 65535 (or $FFFF) In this case, Basic seems to have a slighl advantage over the monitor. We rnust set the screen background dnd border ..:olors separately, as well as the cursor color. since thev. an:: not stored within illlY. of the fuur arci.I::J mentioned. The rending program is elegant, but hard to read if you don't know the trick. Here tl is: alter BASIC perronns a LOAD, it always returns to the first sl<itemenl. Thus, there's really an invisible loop from line 110 back to 90. When all load~ are liHish~d . vill'iable A e4ua!s

5 aod Wtl :;kip ahead to set the cursor color.

130 daLa 57344.65535 140 fm j"" 1 to 8 150 read x:t ... t ·t· x 160 next j 170 rt t<>3~7628 then stop

180 restora 190 for j = 1 lo 4 200 read x,y 210 open 1,8 ..3, "O:sx • + Str$(j) + • ,p ,w • 220 xo/o - x/256:z. - x-x%,.256

Now: we've been reading this ROM information into RAM mem·

ory. But on the 6'1, we can switch ROM out and let R<\M take ove1·. lt we wanted to do this for just BASIC. we'd give POKE 1.54; for bot,h BASIC and Kernal, we must t>ay POKE 1.53 .

Using the same methods. you can switch logic bmwr.cn various g1~n erations of rhe Commodore M

Conclusion

230 p nnt#1 ,chr$(z);chr$(xu/o);

240 tor k.,... x to y 250 ;;r inL# t .GI Ir$(peek(k)); 260 ncXl k 270 close 1 280 next j

If yvu don't h <l Vf:l acx:es.s to an SX- 61. there wiii iJe TPlJG library to do the job for you.

3

disk in the

Now you have an SX-64. at least in a loRical sense. As I said before, you won' t lmd mttch dilference lrom the Commodore G4. 11ut at Le<~st yvu'll know how it r~:.o.ets. Now, if it only liad a handlt! . ..

I

9t .......... .......... - ....... ....... ~===============================================~==~· -----~ [~1~· franaoctor

~i;~~- stl!!Y..!..~~_j


Volume 5 Editorial Schedule Copy Due Printed

PAYS $40 per page for articles

1

Graphics and Sound

F\'!b 1

Mar19

Avrill

2

The Tr ansition to Machine Code

Apr 1

May21

.June 1

3

Software Prut~diou &

Jun I

Jul23

Augus t I

4

Business and Education

Aug 1

Sep 17

October 1

5

Hardware ar1d PeripberaJs

Octl

Nov 19

December I

6

Progrnmming Aids & llti11tie $1

D ec 1

.tan 19

FchrlUu ·y I / 8fi

We're also looking for

professionally drawn cartoons! Send all material to:

The Editor The Transactor 500 Steeles Avenue Milton, Ontario

Release Date

Pin~ cy

Volume 6 Editorial Schedule 1

Communications & Networking

Feb 1

Mar21

April l/R!l

2

Languages

Apr 1

May20

June I

3

Implementing The Science$!

.Jun 1

.lui 18

Augu At 1

4

Hardware & Software lnterfa.c ing

Aug 1

Sep 21

Octobe r 1

5

Re&ll.lfe ApplkatinnA

ONl

Nov 19

D~cmbcr

L9T3P7

1

Advertlsers and Authors should have material t'lubmiltcd no later than tbe 'Copy Due' date to be Included with Ih e

isnuc:.

GRAPH-TERM 64

PRO·LINE IIIISDFTWARE

A GRAPHICS TERMINAL PROGRAM FOR THECOM MODORE-64 GRAPH·TERM 64 is a 100 °!., machi ne-languag e program wh ic h • plo ts hi-res graphs generated by a mainframe computer o r the C·64 in standard Tektronix:•· format • downloads text (36 K) or p lot fill:lS (20K) • creates instant replay s o f text or graphs at high speed, s tow motion or stop action • creates hard copies of plo l s on lha Commodore 1520 Plotter In add ition, the m a chine lan guage subroutines used in GRAPH·TERM 64 are docurnentl:ld so you can use them in your o wn programs to create fa st . compact p i ')1 ti les and to drive the p lotter at t op speed.

A CANADIAN COMPANY

designing,

developing, manufacturing, publishing and

$49.95 u.s.

distributing • microcomputer software

TO ORDER Specify disk o r tape Add $4.00 postage and handling for U.S. and Canada Other foreign orders add 20 % M ichigan residents add 4% sales t a x

DF/\1f R FNQLJIRIES WELCOME AUTHOR'S SUBMISSIONS INVI I tO C A LL O R W RITE

BENNETT SOFTWARE CO. 3465 Yellowstone Dr. Ann Arbor, Ml 48105 (313) 665-4156 Dealer inquiries i nvit ed The 1520 plo tter and t he Commodore 64 are pro t1 1Jc t s of Commodore Bus iness M achin1:1s.

(116) 273-6350

PRO·LINE - · · l lllliiiO FTWARE 7'.', TI If QL I i ' •WiA Yf A~ I. Uf\.11 !I f.,.IS~:f~·S,'\lJ(JA

l'e$1fH~divc

UN I .AI<!U i'IY 'C>

92


The Intelligent Software Package For $ 35, you get all this on one disk:

INTERNKnON/\1. CENTR E, TORO~"TO NUVJ.iMUc R 19 & 30, DECE!viBER 1 & 2, 1984

DATA SASE;. A complete t1xed record-leng t" doto bose. Sort on any koy. soloct using full logical operators on any key or keys, perform numeric manipulation on fields All fioiCJs In a rocord fully cuslomiLoble. Screen editing for records. Con be used tor occounts·rece•voble. inventory control, or o s on oloctronlc rolodex. If you use your Com· rnadole fOf' nothing else, this prOQrom Will justily its expense.

WOfa:> PIK>a:SSOI?· A full·fflOttJred word proceS50r: very fast file commands (including di&k file catalog), screen edit.ng. stnng searches, full control over mmgins. spacing. paging. and justificu lion (oil commands imbedded in text). A very powerfuL eosy·lo-leom program. lncluciAs o proorom inlorto clng WfP with DATA BASE to creole <."Uslurn f01rn let1ers. SPREADSHEET: Turns your CommOdore ln1o a visible balancA shAAt . Scroon odltlng. Groat for fin ancial fon-Jcosllng.

BASEBALL MANAGFR· C'.oml)lles hatting stati stics for a baseball o r soflboll leoQue. Genaroles reports on o p lover, team. o r the entire league (Including standings).

/\11 programs will load and run on ony ond every Commodore computer having a minimum ot 101< I~AM; all program:; fttlly support tapo. disk. and printer. Any two pro-

E WORLD 0 COMMODORE II

gtorns on COS$ette, $20. Price includes shipping within USA ann Canada: Calif. rosldonts add 6%. For orders over 10

in qvontity, deduct 35%. S1nce th1s ad •~ the co tatoo. no response to Inquiries will be mode: huw~ver, docurnenlation ror any one program may be purchased seporote ly tor S? j")()Stpoid (rtenuctible from later order) Thonk you William Robbins. Box 3745, San Rofael, CA 94912

Why Blank "Cheat" Sheets? OX So now you've g ot bA,qt Commodore 64 10

11'1"1 wvtld. ond loll> ol complex sottwara 10 run on tt Une problem Unle::.s vvu work

TI1c Company dlac h ad the for~ght and imagination to design and hulld m nr e. compu ters for h ome, busin ess and educadon than any other wm be pre· sendng the mosr farsighted and imaginative sho w to elate "'tith exhibitors from around the World.

Because They're F~:::=":"-::=:~ Blank .. -:.· -:~...__.·-..... . .

. :.------· -

-..

The 1983 Canadian World of Commodore Show wa.s the largest and best attended sh ow in Commodor~ Internatio nal 's history. Large r thau auy other Commodore sh o w in the Wuclc..l and this year's show will be even larger.

wath some oJ these

r>rngroms everyday or are a compul ~:~r s;~uiu~. w ho con keep all those commands ....,..._~~~::~ strolcrhf? "1'5" tn one program means one !htng, r.::t rtd "F5" Jn unulh~r pmgrom means something elso. /\ cow compomes do n Hm o j\olu · 1JOI1 a d1e c\J r "cheat" sheet that atlaches to you{ kf:Y· board with olllll~ <.:u u tm<..md~ of one prOQram printed on It Groat tdoa. unlo55 you need lhAm tor t() o r ?0 programs You could purchase another disk drive tor lhe some lnve~lmt:tnl. Out lioluhon? Simple. A pgck oJ l2 11nod card!i. dtc cut Lo JU your keyooar<i nnd jttst wmting to be tilled w1th those problem commands you luryt11mutil ulhm Slm~Je? Yes. but eUecave Now you can hovo all y our proo10m c::ommond5 nght otJour finger bps on YOU I~ Vt:RY OWN. cus-tom desis:~ne · "cheul" sh1:1t1h•. On.lttt u cvuple pucks loduy1

1

PleaM MncS me the toUowtng·: r... •~: ,,. v s ;~.>twr. -----------~----------

I

_

1

I I

1 I

1

Q~v.

n em Sots 0 112 C M Koybo<Xtd Cheat Sheets lfi. $1595

_ 2 Pock.& <Z4 Sheets> tor S~4. 95 Total loi Merchandiie Shtppmg and Handl ing Conodfan Funcb Swcbarge

TOTAL ~Cl.om>

0 Pleaae Charge to. 0 Ma3terCard N umber --SHIP

I 1

1 1

ro,

Name - - - - - - A dd.rliln . - - -

Clty - - - - - - - ........ State 1Z1p _

o.,.r,u.., tmauu:~ '""U"'Li ~~ ni~ L'l;,.__, 4 ~~

JJ¥

&

J..lJ.I....'.

S ..- -

s

s

2.00

S 3.00 $ __

I I V L')A E~puea _

--------=-== --·

T-,..

PI1Ce

_

650 N. C>Sth Street wauwatosa. WI ~213

lll412f>7·3562

World of Commodore 11 l s designed ~pecilkally to ;.appeal to the in.tere~ts and Hted o; of p resenr

and po te ntial Commudun: o wne rs.

Come and explore the World of Commodore. 1 I

1 I I 1 I

I

I 1

I 1

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

world of cornrnadoren A HUNTER NICHOlS PRESENTATION. FOR MORE lNI10mtA'flO.N CALL

DF.RRIF. RANNO'J (416) 439-4140


• •

GET CONTROL ~~~: C64 A/0 DIGITAl 1/D

• .\,A I,.OG \'0 I>I CI'TAL CO)I \'U r f:ifl Hr. Chanu! ll 51J.L ~ C> 1 ;1; \'oh h p.,.u . Ou.al Ml l b UD r.o .)0 C IUH'tH.~II II " ~ ' •IIG"'" " -! ' Cvnl.•v\IG-d CtvQ e.,..;~ Of'

Alllf•

" • r h 1n• lADlU• R• •

STOCK HELPER'M Commodore 64 and VIC-20

t1

D 1Gr l~t

t O AKALOG COKVt l 1tJ-

0·1~

• u LL ~~t~ut , 4r1~~ ~~•r~

6 r cont r ol tlte zp~e 1l vf • P.t. ~vt~• ~ ~ l~e. " H Dt!;T'J,t1. TKPtiT$- n L C~.tll !l'•t..t tJ h. 't11ul t.-.,;1 ~ .. _u.h.u , Coauet , . 1 J u ~ l • r•••· or a~r 1 l• r •l• r ~ • ., tO 1UCt1Jol. OI,.JPU1':S- 'TT L Cqur• t. l Ill•• C-,u \ 1 ... 1 r,;la1c.• 'tnor. , t ura O.r\ • • ~ r n•.

r~~ r ro t

C-" n s U.l!.

'O't:&""l

e l\t q·

1 t',

li"'"

• pr1Ble r •

r nu;

CLOCK C AL.t."DEit• v UI1 bu LU'I 't l;la .. ILw" •

~~~ ~ ..1 1" .lll'ld 1\• 1' 11 1~· l • nlfU 8 i l'!'

,!Utr •o• ~~ ~r.-..- tt 1\\t fJuit. DY/ " OlTit MR/I'I:C/!t

••t

U(~ ' hh•1 !1,11

h

9a'c

oru)

I)Pt tal(OO

tAl'A Olilf. l"rt'f l'.. o"QI>p.& l' t• Y h. h u s• I •· l lliiMit.l •n4 ttvh, • •~· d t l-\'• t • ••• "·' •~ a~K "' *~' •d i 1 ~ Q.00

1tl t

Stock HELPER is a tool to maintain a history of stock prloos and market indicators on 'diskette. to display charts, end to calculate moving averages. Stock HELPER was designed and written by a "weekend investor" tor other weekend investors. Stock HELPER is available on diskette for: Commodore 64 $30.00 ($37 .00 Canadian) $27.00 ($33.25 Canadian) VIC-20 (16K) plus $1 .25 shipping ($1.55 Canadian)

&11

r•r~t ~ •r.

A CI~

.. '

U.fio t 1\Y' • I'l l

fi'J'l \n t II S A

The VIC· 20 ve rsion only chart9 26 bt weekly periods rather tl'la n 52 wealo.ly periods.

(M)agreeable software, inc. !:1925 Magnolia l ane • Plymouth . MN 55442 (612) 559-1 , 08 ' (M)egree~~ble snd HCLPER are trodomorl<~ ol tMIOQr(!ell.llle software. Inc Commodon~ 64 and VIC.20 aAJ tradOHTiariu; ol Cunt~>'Odor e EIA<:tronics ltd.

lf )'6-U !rZED P.1:1..l.\2-L11f U O !:lP££'0 t h • •~ (tOUIHS t. to. t he •u...,e r. QI. U NS'J to • b1&h po~(qr ~ n n ~~ f l9fPY 4l• ~ ~y•t~~ d ~- J ~~~4 eap~(ia l l~ f •r ' h•

c~~~~~lC 6~ ·~~1Ct ~Qap.,~ ct . tt l a p eT I uf ~~. PIO J$( ·~,·~· ~ i · · ·~t1 d.id: •1•t•n :_. •s.4 i • o pli a hacl t o p:r,.vi<• u:t"••• l y 'hl a }l au4 tc l t~ b le OOcfe i 1Cn . The QC T~ O J Sl •J •ten co n • i• ~• .t • • 6• 1 jSek \. .. 1\t.l~tl<=-• . ,..t.te 1 a ce;ol• • • ••a \ l y , • 11d • •t•~ d,u• d •t•!.. drive ••• cH ••lr• t11~ ,~~ll~ lL eT ~1 1 1 l•t•~ * ~~· 1 ~ , h r•• l ft ~ h . I ~·~ eni 6ae 1 uerter l ae~, "' ' td, ~ L iltd• .£1o l<. ihi-. u . 'Jh'tl Q I.~ JI CHl l ~9 1'1 tt9'S!H t-~t·:.h p luJ ~t lhlb l h.e

•r•a'

... ,~t14J. c dot o f the ~....-fll p uta r

a o6 e

db boP

(S.,;;

co l, )~ ¢<t>o. ~t (r-t l •

u

t.tle

d 1l , c . tG~m o4ore d1 ~ \ dr t v• ~ J i flt • t ~cptihf t ke d t•• \.~~ a.e.c.l\lnt:. QU liDI GJ! op•!a 'tlt• , 1\ol;'aY'r , ~\'sy l r&e.ttJ'errt-"& ~ v~w 4J • v~\ I Y {,v~ ~ l1e •l- ~ c\ t • ;~ t ~ e co~pw ~•r tr• or, . ~ l t l• • d~t ~ I. J•tndw t 111\.• v( 2:.0 , 000 t;U.II " or~ :~6iO'QT.4. O'UC" tf'l1 !:'ln •.- ' ••~,.. th11t1 l ~•

FnOj •v fl - ft fe «DU la tas 6

.,.,, ._.., .. ~_. ! ... .•••A ~ l ~ ~• · f~ l l

• «L

~r

Cu 11 t.tvUu

CU ir)lSK ~ (~ · 1 ~ ~• d l •a

t.••"

~t tl lt.iee

•~ •lett~-

. , . alao

• h- h .fo~o~l\ ~ "' ' "

!l.ullel C871• 1 •h•h -9" ara«.,;b

r.odcl

C}~O- l •t~vl v

~" . , .,.~

l'!otle l C'l\0· 1 4"d ),:;. •• a r •\ •u.•

$

a 1 th•

•"•~leble.

l& a~~•t

poa•ible •r•r•. A

2 ':1~,00

$1C95 . 00

a

~i~.oo

991 . 00

Cea!.eJ 111Q•1 J l.e • •<..'-lfPt.•6

KMMM PASCAL (~~H rAS~AL t o: ~~Nn ~4or~ Cb~ ~1 - tl~·~~ ~~• ~ ~ ~ ~ ~ ~~ ~~ •• ~t @h 1-t•l 1 onf1u•s••• CNHH P.\StAL l• o il~""• c~ •p 1 er t-t!ot a,on.,,.,. , ,. .. r-•""' '"' ,.. ""~ ... f fo • p••c• l •o~r~•· · · Y' S l' l l 'tteY , Lo,ptl er ond rro " •'•'~ri A r~'l 'l~ jl f"M ~ ~ • ~t a.:.i••t ~r J 11ot1 ••• a11.d • ar t t- !"'a•c• l .

• ••••.. •• •

••• .• •• . •••• . . \ <I?.OD

The computer language for the New Professional. BASM Is a unique blend or BASIC and standard 6510 Assembly language. This ingenious combination of familiarity and flexibility provides an easler transition to Assembly language while cutting your programming time by 75%! Your program will then run over 200 times laster than Commodore BASIC !

BASM- an entirely new programming environment for !he Commodore 64. (Also available for Atarl) ~

TO ORDER WAITE OR PHONE

~~

10730 White Oak Avenue

Al.UANCE

Grana cia Hills, CA. 91344 (818) 368·4089

~..;.., COMPUTER

ron INrOitM. TIQN,!5U VG4,11\ DtA.Ui ll (Ill ,

(M.!cRO I !§CH)

'"'-<:·-

·~·· . 01' o.:..... I'I(Wl. . JI.I'Q.I ~- . 'I IW:Itt ..l l

The Reference Transactor Coming This Fall! See News BRK for details


The

PAPER DISCOUNTED PRICE FOR MOST SYST. APPLE. ATARI, C-64, VIC 2D BRODERB.UND (GAMES)

Five y•ara of ••rvlc• to the PET oommunlt~.

c-64, VIC, ATARI, TRS-COLOR PROGRAMMER'S INSTITUT'E FUTUREHOUSE) " Edumate light Pen''

lode Runner 0 C

$41

Spare Change 0

$41 $41

Drr;~l

D Cll.oplltter c o &eato.x 0 c (Car1ridte version e.xtra) .Sank S1ree-l Writer D

$41 S36

$85

$36

C·&4, VIC, Atarl ''Piavgroumt Software" t. m. (UU!t Ught Pen. G·64 & Alari Animal Crackers D Computer Crayons D Alphabe-1AJcade 0 Bedtime Slorles o

$36

S36 $36

$36

"C.P.A. Complete Personal INFOCOM (ADVENTURES) Witness D Planet1all D

The Independent u.s. magazine for users of Commodore brand computers.

Account" t.m. C-64, VIC, TI\S. Color,

$59 $5!l

SYNAPSE (ATARI & C-64,

Complete Set {1 , 2 & 3) DT Finance lt1 0 T

GAMES)

Finaouu ~~~ DT

Fort Apo"alyps-e D T Dlue Mn 0 T

$41 $41

EI)ITOR$: .Jim and Ellen Straema

Sample l••u• free on requeat, from:

635 MAPLE

o

SIR.IUS (GAMES lor most) Snakl! Byte 0 Bandits D

MT. ZION, IL 62549 USA

$36

$41

TypeAUaco

$47

Squish'em C APPLE DC·64 SMA {SYSTEMS MGT.

$48

S41

ASSOC.)

54

P~ERI MAC

Documate-template C-64 Cl!de pro-64 ·- Tutorial for baih; plu:s sprite &

r,>OAD. WEST Hil l. ONTAAIO M 1E 4A9 CANADA TElEPHONE: {4161 262·1532

S16 $10

mush: gen.

THE 64 SOFTWARt HOUSE

- ..

Af :Sf'A!\t CHANG!. Ol"tiiAIK.J"' \-Vhl11lWINO .IAXXUN

"Elf~OQ(Rf!IJND'

-

OVASHVtO'rt..) S:HAMUS CASt n

sor<c~RfR ~tiGHT SIMULAJ'OII

.. -

{\NFOCOM)

0 li(J

410.95

TID TlD 0 T'O 0

39 0!'> ~9 95

J9Y~

411.95

SO O!t

(OATA [-of!J

c

.S9 Q~i 3J 96 23.%

C/0

;J9%

(M I,.'Sl l

I)

33.%

D D TiC> D

7o.9!> (\.:;.95

{SUBLOOJ (51~~RA]

SAMMY UGH!FOC)!

(HfS)

PAJM F.IRUSH DlllJC£: lff CASTlE WOLFfNSTf:.tN

39 9!>

iCON()

VIP TfflMl~IAl ELECTf<'Oi'.'lC CHfCKSOOK BANK S1RE£TWfo11R

(rJM~WOllKSi

0

STRIP FOKfR 5lAR MA7F

[) ()

~7.95

J2.05

finance 114 0 T

$36

l<IWISOFT (C-64) Paintplt·64 Art Of! your screen

$45

VICTORY SOFTWARE ztlf64 Dual Packs Ca.'lsettes (TI or Disks (0)

GAMES MetamorpholiS T u Creafors Revenge T 0 Labyrinth of Creator T 0

$30

$30 $30

Gala~:tie Conquest T D

$30

Kllngo Kong T 0 Cbomper Man T D

$30 $30

Annihilator T D

$30

$34

Engli~h

$34

hmlden> Garn&s

$34 $34 $34

Adventure Pack II (3 Prog) T D Bounty Hunter IAdw) T D Gme Robbers-Graphic (Adv} T D

$30 $30

$30

$24

(Disk version; S4. exira)

card. Personal chilqu.:ts tli>qtJire two or thrtte weeks to clear. All prices subjacl to chan~ without notice. Plel!!lo include $2.00 peer order tor pos.togo ana fHlndlinQ. Ouebec residents only Rdd P $.T

lf.l9 9S

?99S 37.95 36.9:,

Call Toll Free 1-(800)361-0847

. . INTRODUONG JliE Rll(t.'-AN

· f'l?'<NfEU 1;10 C."PS I YR WNli(JW (Y ONINI!Q J~IDI:NlS /\00

Finance 113 DT

PRECISION SOFTWilRE (SILl COM INT'L) Super 8a6e 64 Data Manayumenl systemo $117 Cale Re!lult (Easy) S108 Calc Result (Advanced) S2.02 (C) Cartridge IT) Tape (D) Oisk.etle P!aass call to-r info on your computer modol. a.vailability ond spec1tic pnce. Send corttlied cheque, money ordel! or call anctuse your visa or Mastet-

SPfCIALS I<OALA PAO A.Nf) PAINTH< & SliCK S11CK (JOYSTICK) WHIZ KiDS INTPO TO BA.<JiC

Toddler Tutor Prim&JV Math Tutor Math TUtor Golclta Math Games OeaJer Inquiries fof: Programme•' s Instltute Kiwisull Victory SQftware Comm• Data SMA

8USIN£$.S llOI...,t ACCOUN IN~ I

$36

$36 $$6

(3 Ptog) T D

EDUCATIONAL (VIC & C-64) I) t)

S94

Adventule Pack I

COMM' OATA

ENTERTAINMENT

Atari

except Western Canada, Nfld. and Montreal area (514) call collect CALL COLLECT (514) 325·6203

1% SAkES 1/i X

Ofll:lf:RING & JEflMS: 5!<1'10 CF..SH1Efl CH£0\, MONfY OIIDER, Or. Cii?T1'FlED CHEC<K VISA/MASlf.il<'.-A..?D Pl.f.ASf INCUIDE CARD NlJMBFI? II. f.XPIIl'V DATF AM) ~GNA11Jf~F. A00 S?.~..O fOI"l SHU'PlNG AND HANot~''G. AU IT£MS SU8JECHO AVMA91UTV. PRICES SUBJfC I 10 CliANG£ WI I HOUI NO ilCE. fOR CAlALot: SEND S! .b'J l?WHMA!lU .

ootwcon 9 n.m. aM 5 p .m. Eastern time

or s11t\d ord~tr tcdl864 JARRV EAST MONTREAL, QUE. H1P 3C1

95


Mr Toslerft Is your Commodwe 64 T• Disk Drive, Printer, MemOI'y, Joysdc:k, Monitor and Sound Chip operating correctly? You may n•ver know for sura. Mr. Tester Is a complete dJagnoade that

This Space Could Be ransactir II a Fo·r You!

lesll:

: 1.)

r-..u Joysddt operadon

ln .U axis , 2 .) Coatinuou or ttandard compreheulve • •mory ·test. 3.) .c ommodorefll SID chip test for sound analysis. ·4 .) Sc:reen allvmaent and color ten. · 5,) Co•pl~le read:! write Dbk Traek an4 Bloc:k Tett. $ ,) Diskeue lonn.at analysb to Waltl Don't do lilt c:hedl Floppys. 7 .) Complete priater teal. orderfrona 8.) Complete keyboard test. 9 .) Cauette read/write test. Jl.W Dlst. lac.

l(elly M. George

AdvcrtlGlng Man11911r 4168764741

13428 Route 23 Buder, N.J. 07405 20 1·838-9027

All this for only

•2995

COMMODORE OWNERS WE'LL AX YOUR FILES WITH

FANTASTIC FILERTM

' -

I

'

The all purpose Data Base management . system that provides: l.) Menu driven subsections All this for only

$29•

2 ..) Logical key :functions 95 3.) Average of 1000 records per disk . · ._---------'

4.) Fast record access time 5.) Search for records by record number or by spedftc search criteria 6.) Easy to edit, delete or update records 7.) Interface with FANTISTIC FORMS. to print mail· ing labels or columnar reports 8.) Complete reference manual 9.) Tec.hnkaJ support available to answer questions 1 0·. ) Up to 255 characters per record and up to 15 flelds

96

Micro-W. D.L

P.O. Box 113 Butler, N.J. 07405 ( 20 1 )2 "~·--=-----~~


CommOdore 64 .·:. . and

· . _ . : · · : : . _ , · . . ..: · · ,·. ·. . .

. .

. ·'

..· . "..

COl'lltiODORE -usER mu·r rEN sot<-n V.tU tE-

.

:.<· _:,,······

. . ...

. . .. . .. ·.·. . . .

.

supportin9 all COMMODORE computers Written by users. fo r users GAMES* UTILITIES EDUCATIONAL*

VIC~20 . ..

*

*

VIC 20t'" Vic 20 collec ti ons # 1. 2, 3. 4, 5. 6

over 70 progra ms per collection· Tape/ Disk· $10.0t.. Vic 20 collect ions it 7. 8 ovtn 50 programs per collection· Taoe/ Disk ·$1 0 .00

COltDIODORE 64""

S149 cu

64 collections # 1. ·2. 3. 4 . 5. 6, 7, over 25 f1fograms per co ll ection· Tape/Disk·$ 10 .00 Pt:r" (~ OM(!) 22 collec tions- Tape/ Disk· $10.00 DL~SJj"T"': Reset. Switeh

I

Telecommunl with a difference

L-~~--------~--~

Work.~

Unexcelled communication.s power and compatibility. especially for professionals <lncl serious compure.r users. Look us over; SuperTerm isn't;ust .. another' ' terminal program. Uke our famous Terminal-40, It's the one others will be Judged by. • EMUI.ATtON ... Most popular terminal protocols: cursor addressing. dt:<:~ r . llome. eK • EDITING- Furl-screen editing

on Vic 20 or Commodore 64 - $5 .00

SEIUAL C..UILES

tOFt.-$10.00

I.OC- Ll'l'l~,..

15Ft.-$ t 5.00

Operation Status Indicator A ssembled & TestP.d $20.00 All prices include shipping and ht'ndling. CHECK. MONEY ORDE RS,

VISA and .MASTERCARO accepted. For A Free Catofog Write:

or Receive Buffer

PubHe Domain, lue.

• UP/ DOWNLOAD FORMATS CBM. Xon-Xoff.

5025 S. Rangeline Rd., W. Milton, OH 4 5383 10 :00 a.m. • 5:00 p.m. EST - M on thru f-n. (51 3) 698·5638 or (51 3) 339d 725

ACI<·NAK, CompuSeNe, etc. • FLEXIBiliTY- Select l'li'iud. duplex. parJry. stopbrts, etc. Even work off·line. thf'n 11p1oaa to sysr.em! • DISPLAY MODES- 40 column; 00/13/ witl1 side-scrolhnq

VlC.: ~()- (tl lo.t~ ......, ( ~~'41 ft.1- tit<# l t s """'llfltll M ~ !lftl"'f•'h"'',. FIHitA-nlol":' I $! fl"tt,. It . ft•~~u·•d Tt. lhii"'•J' ot t o!'111''111'U:tUfC eu"ntn M1tCtu••11'.. I~

• fUNCT10N KEYS-8 staMard. 52 user-detinP.d • BUFFERS- Receive, Transmrt. Program. and S.Creen • PRINTING -Continuous printing with smart ASCII interface and parallel printer; buffered printing otherwise • OISK SUPPORT - DirectoJy, Copy, Rename, Scratch OptiOfls are selected by menus and EXEC file. Software

on disk w itll special cartridge module. Compatible with CSM a nd H£S AutomodellU; select ORIG/ANS mode,

mdnuar or autodial. THE B.ANI'IER MACHI

Write tor the full story on SuperTerm: or. If you already want that difference, order today!

Menu-driven program work~ like a

word pr<>ee~sor. Great ror businesses, schools, or organlzatlons.

Requir..-~:

CoHJru<J<Jo•f! 64 01 V IC-10. tfbk dliv" 01 D.!l<t~elte. .ltl<J comp;JtjDI~ mooem. VJC llt'f'!;IOn requires 161< memory expansion. Please ~pec;jly VIC or 64 wf!C(I. ordering.

only Jnterlac~ which $upports $tr1!amlng - vnd1ng characters Simultaneously to the screen and primer ··· w1th

Produces lar9e signs up to 13» talt by ;cmy le11glh. M"k" border~ of width& up to ¥..'' . E1ght sizes of let· teri from ;y,• to 8" high. Propor· tion,.,l $J)i1Cing. 1\Utoml)tic c~nter• ing, right and left just1t1cation. Use w ith Gemini 10 or 10X; Epson MX with Gr<lflfllX, or the RX or FX; Com· modore 1525£ or MPS 801; and the Banana. Four eKtra tontli avallable (S 'I9.9S each). Ti!pe o r disk $49.9~

SuperTerm.

M~nu D'iv~n Oiik Oper<~ting SyJtem

Smart ASCII Plus ...

9

S59 ~

T~

El(~n·t~

disk .~ommi'Jnd~ by r>!.adi ng thr. mtnu t~nd prt:ssing ju~t ont: key: l.OAD . SAVE, ll'litioJhze d isk, valldllte, $Crat,h, rename, C.OPY, auto list . renumber . se.,rcn. rcpt.9ce, ano more! Dl ~k S2?,95 Flu File !2.1 Ely Michael Riley. Save

Al ~o

gre.at for us<: with your own programs or most <~ppliPttion pr~rAms. 1.1'. •• word proc~ssors. Pr int m odes:

CBM Gra phiCSIW/mJny cJot··aclelr pnmersl. TRANSLATE, Det~yTRANSl.ATE, CBM/True ASCII, and PIPELINE. C.:>nlplete with !)lir1ter C<tblt." Jncl lfl<~nval. On di~k o r cas.s~tu.

UJ.>

lo 1 500 typkd I

I

!~COl tJ~ 0 11 4

15.41 disk drive. Print infomldlion o n labels o r in r>!port lormtot. SP.Iect

·--·..··-·-----····----·--

ruord~

Scrundump Print " copy of tho: C-64 ~c: r~.en ~imply by pr~~sing ju~t two keys. Th•s machint·language progr<'lm is compatible with most

sottware. S19.9!:i (lltS$matc 64 Analy~e your own games, dfld

mast~ r

games, book

openin~$ .

wotch your

S<lv~.

s<~me~.

pri nt, 11nd

in a ooiquo: "chess movi~ '' Memori7<>. 11ny bo11rd po~ition and recall it after you Mve plllyed through van.!~· 91lMI!S

trons. OISK S~9.Y!>

Formulator A lorm~ la scientific calculator for tasks whi<.: l1 requir.: r<~:~liliv~: <Hi lhmetit; c:omput<!ltion~. So!ive formulas and numeric e:xpresiioM. Ide<!I for r.ho:mistry, enginee•·· ing, or phy~ic~ 1tu d!'.nh . Tl'lp<"- or di~k sJq.9s $pa<:c kak:lcr An amoz!ng arcade simul.tlio!l. Yout rni,sion is to diC~Lt oy tho< o<no<:rr1y ~hlp~ . S19.95 Order Toll hUt 100.7611· 5645

tnlorm11tion: 703·4'l1-6S02 HOURS . 11) a.m. to~ p.m. MOIH8t

Cardinal SOftware

9 w11y~. Sort o n up to 3 Calcu late repo rt columM. IJ6tf) Jell Uavls Hwy. 1541'4040 ' 2031 Disk S59.95 WoodbridSf., VA 2~21'~1 CTRL_.4 Permits listing of C-64 Caullogs a vaUable. programs on non· Com mo d o re - : Soecity: Educ<lbonal. printer~. Li~l.$ cont10l llyrrtbOI5 in 6usln.,~s/Utllilr"'· o r n<:<!dcble fv rm. Di~k $24.95 G>~meVSimll lahon$. Commodore 64 II ~ liSII l~reo traOI!molrk Of Commodore EJ•ctroni;:s ltd kt:y~ .

Z

1 WEST i2nd ST. • KANSAS CrrYe MO • 64114 97


COMMODORE 64"'

N

o matter which direcrion you wish ro rrovel Jn. experience rhe advonroge of com purer communications wirh The SMART 64 Terminal. Discover the program thor puts you on the Right Rood to: Public-Access Networks, University

Systems, Private Com pony Compurer.s and Financial Services. The Slv\ART 64 Terminal designed w ith Quality-Bred features,

Affordable Pricing . . . And Service.

So why not travel rhe communications highways the SMAf\T woyl Accessories lnclvded:

1\~.>IUil

0

Selective 5roroge of P.ecefved 0 User-DefinedFun a/on Keys, 0 Formarred Lines. Doro. Screen Colors, Prinrerond 0 Review, Rearrange, Prinrflfes. D Alarm Ttmer Modem Serring. [ :J Send$/Re<eives ProgromJ al1d D 40 or 80 Col. Operorion•. f.J Sa-een Prfnf. Fifes ofANY 5JZ£. D Auto-Dial. D Disk Wedge CJvilr-/nl 0 Adju$/Oble rronsmir/receive robles allow cusrom requiremenTS. These and orher feotures make Thl> .iMART64 Terminal !'he best choice for grond rouring telecommufliCofion.~

MICROTECHNIC~

l6( om~ncdnrp 64 r.P9t\h1::'f'tali fmrlPm-.rf'\

ul Ct.><1\<l '<XIU<"' nulil ""'"1\1/JC.hif,.;-; hI( •5<Jp~<xnBO·otO!unV1 c-ortndg"

by Ooro'20 (c>JX"'~''Of'

O~oler

Avoilob ility

Call (203) 369·6~83

JQ.IN THE COMPUTER. REVOLUTION WITH A MASTERY OF THE KEYBOARD!

~T'U'l'Oll. ..:v1 "'·1•·r~·!~

t~ .., : "~ ·;.

Wtnu> mv.Ai)1!1lUJ ..... .... , ... ......... '"·* .. ..,.\>-,•,-.~,;,,;-,~~·

)'¢'

jiSO lUT IOI'IS~ P.O. DOX2940, NewHoven, Ct. Oo515

IFR (FLIGHT

SIMULATOR) CARTRIDGE

In the age of the computer. everyone

FORTH E VIC 20·

from the school ch~l d to the Chairman of the Board should be at home at the compu1er keyboard. Soon there will be

$39.95 COMMODORE 64 TAPE OR DISC

a computer terminal on every desk and

in every home. Learn how to use it right

$29.95

...and have some fun at the same time!

JOYSTICK REQUI'RED

Rated THE BEST e.cJucafional progn~m for the VIC 20TM

Put yourself in the pilot's seat ! A very challenging

by Ct(nltlv• Computing Magazine

realistic simulation of instrument flying In a light plane. Take off, navigate over diffi(;ult terrain. and land at one of the 4 airpo rts. Artinciel horizon. ILS. and other working instrurnents en screen. Full air· crA ft feaHJres . Realistic aircra ft performance slalls/spi•IS, etc. Tt<Jnsport you1sell to ;; real-time adventure in the sky Flight tested by professional p ilots and JUdged "terrific" 1 Sttipping and handling $1.00 per ..I order. CA residents add 6% tax. .

TYPING TUTOR PLUS WORD INVADERS The proven way to leBrn tou.eh t yping.

COMMOOORE64 Tape$21.95 COMMODORE64 Dlsk$24.95

VIC 20 (unexpanded) Tape $21.95 Typing Tutor plus Word Invaders makes !earning thP. kP.ybOI'Hd ea~y arid fun ! Typing Tutor teaches the keyboard in easy ~;>lepl:i . WtmJ hlVii\dars makes typing practice an entertah>log game. Highly praised by customers· " Typfng Tutor 15 great! " , " Fa11taslic ", " £x.cfllflilfll " , High quality " , " Our children (ages 7·15)/ilerafly wairin line to use it. ··. " Even my lillie !li.'lter likes it". " Word In·

vade rs is son sacfonaf.t ·· Customer comment says lt all ... " . .. it was everything you advertised 1t would M fn three week.'l, my 1.1 yeRr old son, wno nad never typed before. was typing 35 w.p.m. f had improved my typing speed 15 w.p.m. and my hus.band was able to keep up w1th his college typ1ng P.O. Box9403, San Rafael, CA94912 (415) 499.0850 class by practicing at home. " Programmers: Write to our New Program Manager concerning any eKcepllonal VIC 20rM or Commooorv &ll'fM gamli' or othif program you have d~JVelo~d.

99


'I

[

MICROCOMPUTER

C64

C. SUPPLI Call us for all your C-64 Software

PROVINCIAL PAYROLL

Memorex SS/DD $33.00/10 ECtype SS/DD 25.00/10 650.00 Single Superdrive 1050.00 Dual Superdrive Games on Disk· • • • • • • • • • • • • • • • • • • • • • • • • 39.95 Spy's Demise Pensate 39.95 Thunder Bombs 39.95 49.95 J-Bird (Best Arcade) Flight Simulator 37.95 Business on Disk· • • • • • • • • • • • • • • • • • • • • • • Personal Accountant (Best) 49.95 Multiplan 124.95 Data Manager 31.95 Electronic Checkbook 31.95 Money Manager 31.95 87.95 Bank Street Writer

A complete Canadian Payroll System lor Small

Business. • 50 Employees per disk ( 1541 ) • Calculate and Print Journals • Pnnt Cheques • Calculate submissions summary for Revenue Canada • Accumulates data and pnnts T -4s • Also available for 4032 and 8032 Commodore Compu ters. Available from your Commodore De<~ler .

To order: Sond money ordor. cerullecl cnequo. pol'$0nal cheques must clear our bank , VISA or MAS rEnCARD. (Include card Hand expiry date & sigro«turu) A<.ld 5% 1·01 shipping ar>d handling. Mio>imuoll S3 00 per order. Quebec residents !ldd ll% P.S.T.

ICROCOMPUTER SOLUTIONS

INTERNATIONAL MARKETING SERVICES

1262 DON MILLS RO. STF 4 DON MILLS. ONTAniO M3U 'I.W'/ TEL· (416J 447-<ttHl

P.O. Box 522. Boucherville, Quebec, J4B 6Y2 (51 4) 655-9232

Disk Software for the Commodore 64 ™

JOT-A-WORD™ A computenzed version of the old hve letter word game Simply pick a secret live letter word (one of the ulmost 5000 words contatned on the d1sk) and then play against the Jot-A-Word Gen~e or s1mply play a solitaire vers1oo. Start by typmg m a live latter wo rd. The Geme responds by te lling yuu how mc1ny letters your guess ami lht:~ titiCttll work have in common. Don't try lo t;heal, because t.hc Genie io too amo rt nnd it will nol <weep! non ·words or con tinue a gnmA th nt you have given It wrong scores This is a simple but shmulahng game for agl'ls 9 to senior citizen. A real c hallenge to your intellect, reasomog powers, log1c and d eduction sloll.s. It's simply hard to beat; as a fun c~n<.l ec.lucc~tionc~l expenencel Gtd!Jhic~; csnd music iidd to the enjoyment.

ONLY S

95

Micro·W. D.L 1342B RT. 23

. . ..

BUTLER, N.J. 07405 Dealers & Distributors Inq uiries In vited P( ~""' arf) li' US ct.

201-838-9027

llh

119

0

.,:··rr.:~

"The Genie is hcud to beat!"


r---· --..-· I WSI!Iir;l TO L A uaH WHC\1'11

a..te

TOLD Mil ....JR Pn/\CT ICEO

AT HOMt! Ot'\1 M IS COMPVTCR

... Here is your chance to play golf on a championship co'urse without all the headaches of getting a tee time, waiting for that slow foursome ahead of you , losing balls, getting rained out or spoiling o got)d handicap. This game may be played in the privacy of your home or in a clubhouse lounge for the enjoyment of many members. A challenge to even the best players, this game requires a high degree of practice, expertise and accuracy to attain a good score. PRO GOLF Features : PRO GOL F For The Commodore 64 TM

• A full range of golf c lubs (dnveway. fairway wood, wedge and irons 2-9) • Realistic shot distances depending on club and swing • The ability to hook or slice a shot

$34 .95 (d skette only)

wrrnen by George Ac1;Jms

avariable from your lor.AI m rArlcr

• Up to 4 players in one game

drstributed by tJACO Electronrcs Ltd. 20 Steelcase Hd. W. Markham. ON. L3R I 82 416-475-0740

• Detailed, colourtu l screen layouts of 18 different holes (tee, trees, sandtraps, rough . water, out of bounds) • Simulntod ball reaction to course hazards (e.g. ball bounces off trees)

Dealer Inquiries lnvrted

• Hole distances, par, yards to green,strokes taken on hole, total strokes per round and player totals displayed • A fu ll screen enlargement of greens for pulling

Name _ _ __ Address Prov/State _ __

• Acc urate putting simulation for angle and distance

Postal/Zip Code _ _ _ __

OMoney Order n VISA O MasterCard OCheque Ace# Exprry _ _ _ Please include numbers above name

• Practice of real golf skills - club selection , type of shot (normal, hook, slice), length of swing, special shot strategy (e.g. chipping, getting around or over trees, water, sandtraps)

Add $2.00 for shipping & handling Ontario m!lldonts add 7o/o solos tax. 100


WE'LL BACK YOU UP! ATTENTION COMMODORE 64 OWNERS If y ou o wn a disk d rive then y o u'll n e ed "The

Clone Mach ine". Take con trol of your 1541 drive. NEW IMPROVED WITH UN GUARD.* Pack<t!il• lncJu;:d:e•l

1.) ~mplete cmd thorough usen manual 2.) Copy w ith on• or two driY-

3.) lo1'"tlqate and back· up many ''PROTECTED" dlili ..... . . ' -l ~PY all file t"''Pft l!lcludlng relcrtin types ,._, 5.1 Edit a.nd Yiew track{block lo Hell or ASCll 6.) Dbrplay full contents of dtrectory and print 7.) Chcmge program aam... add de lete Ill" with ungle'keY•troke

$4 995 v~

8.1.EcriJY disk lnltia.lllatiOD 9.) Suppom up to four dr!YM • UNGUARD Now ollo- you to read. write and ve rify bad l!lec:tor• and erron oft your dl.ek makmg lt - Y to bcdc·up most protected •oft war• .

Micro .. W. D. I.

Dealers & Distrib utors Inquiries Invited

1342 B Rt. 23 Butle r, N.J. 07405

,.--- - - - - - -- - ········-- · - -, - --

---,---

CALL (20 1) 838-9027

COMMODORE COMPUTER PI{INTER ADAPTERS - addrcs>ab l e-~wit ch sel e~.:t~lJie u IJPer/ low1:r, lower/upper ca:;c. .... ,.,...,rk5 with BASIC, WORDPI{!l, VIS ICI\LC Jnd other so ftw,He. ·--t l t· t·. card edge connector for con · IIC<..lin)( 1.1i~b .tnd uthe-r peripherals

lo lhe PET. -power I rom prin ter

unlc~~

otherwise

noted. RS·232 SERI AL ADAPTERb,JUu rd Lc::~ tu 9600 -- power supply i ncludcd. MOO/I. II{)A

14~/Ja

. . . .. .

s 149.00

CE NTR ON ICSfNEC PARALLEL ADAPTER - Ccntron i<;s 36 pi n rihhon con nector - handles graph ic~.

MODEL ADA 1800 .. . . .. !729.00

COMMUNICATIONS ADAPTER· rort~ - 1r111~ ASCII !Jdu<.l rdte~ to 9600 -

\erial X [\Mallei '-l!IIWI ~ion

...

half or full duplex X -ON, X-QFF selerlabtc carriage r eturn delay -· 32 dl.nd~ler buffer - tentronics com·

patib lc. MOlll L SAD/ ... • •. • • • • S29S.OO

COMMODORE 64 CABLE ADAPTER MOO/. L A0..-1

IIIIi,_

to

RS-232

6·i10 ........ P 9.00

Pr-ces are i" US doll<lt$.

-

"Should've m a de a back-u p w ith the Clone Machine."

--------------,-;c==::::ii:-1

/!!J!)sstei)l COMPUTER INTERFACES

(~eeE-488~ (\ f!S - 232/

ANALOG AND DI GI TAL IN PUT/ OUTPU T M O D ULES The B USSter

line ol analop, and cl!gc tal prorlurl~ wa" rJp,ign!Yl to collect data ilnd

u . . ' •· .

to output signals w labora tory and ind u~tri­ a I ~qu•vrncnl in l.Onjunctiorl with a microcomputer system. I hese pnwt>rful ~Pii-rnnl ainf'fi morlulcs reduce a comput er' s workload by p.·ovidi'lg read o r wri ll! u~r<~li un~ to ~x t er 11ill devices. They are <:ont roll~l ~slave •nterfllce>lo reill-wnr ld phy~iri'll applir.alions. Contro l i~ over an IEEE ·~88 (GPIBl bus o r RS-l31 port. BU S~If;!r rl!lJt!ule> are avilil3ble in sever;tl digital and analog config11t<ttinM . ThE' in tr rn al butter .:~nd umer pr01:1de ilexihi lity hy· allc)wing the BUSStcr to tolle<:t datJ wh ile the ho~t c·omrutPr i,; busy with other !asks.

BUSSter A64- S4 cMnnotdigi!Oiinput modulo 10 read 64 digitaL signal&. autu-m butfor $495.00 auss ter 864-64 channel Cligitat output modulo to Gono 64 digital signals $495.00 8USSter C64- 64 chMnel digital i1~pulioutput module to read !32 and wnte 32 digital $'gnats Buill·•n buffer $495.00 016~· 16 cnanoet analog Input modulo to read up to 16 analog sfgna!s with 8 Oit resotuuon ('M~l BuiiHn buffer $495.00

ausster

BUSSter E18-16 channo:l •ecsioo of the E4 $695.00 Add the suffix ·G ror IEEE·4B8 (GP/8) or ·R for R S-232. All prices are USA only.

Pri~~~

And

~pecd lc.a­

tion& ~ubjec:t lo r.hange w1thout r101rce. 30 OAY TRIALPurchase a BUSSter product. use it, and 11 yuu are not completely sath;fi~KJ, 1111urn ct with•r1 30 days :.nd rt~c41ivo: a full relund. US Dollars Ouotll<l $10.00 Shipprnq & Handlrng MASTERCARD: VISA

BUSSt&r 002-32 channel version ol thll' 016 $595.00

rza;;;;o;;; u :;;::;;-] ~1

BUSStfH' E4-4 channel analog ou:put module In send 4 analog S1gnats With 12 oit 1eoolution (.06%) $496.00

Connecticut microComp uter, Inc. INSTRUMENT DIVISION 36 Do:l M<tr Olivo:

8 USStur E8-8 t:il«nn~l v~•s ion of the E4 $595.00

101

B1ook.field, Ct 06804 (203) 775·4595 TWX . 710·456·0052


?•

• • •

::::::::

-,

I ..- .

Write Advanced Programs Quic kly!

·

. THE TOOL For The Commodore 64 nr $65.00

Tired of writing ream s of code? Take a quantum jump into the future! Tommorrow 's programmers are using software development tools such as THE TOOL THE TOOL lets you make use of powerful machine language subroutines. Your programs w ill execute fast using less code. Input/output routines and professional looking screens are easily created.

(dtskotto only) developed by Mtcro Appltc alton available hom your local rotatler di~tr iuuttJd

uy PACO ElnctronrcG L1d 20 SteetCAse Ad Markham, ON L:JR 102 41 u-4 75·07 40

Features of THE TOOL include · • Screen Design functions which allow controlled input and output

w

Dealer lnquines Invited

• Htgh ResolutiOn Graphtcs with alpha/numeric display • Screen Savo and Load functions (for hi-res and text screens)

Name -------------------------------Address - - - - - - - - - - - - - - Prov/State _ __ Postal/Zip Code _ _ _ __

• Structured BASIC instructions, e .g . IF THEN ELSE • Programming Aids (e.g. auto, renumber, delete, find, trace, hardcopy) • 2 keystroke drsk commands (DOS support extensions)

Order OVISA D MasterCard D Cheque Ace# Expiry _ __ Please include numbers above name

• Game Design Instructions Goy, scroll, screen, colour) • A 50 page user manual

Add S2.00 for shippang & handling Ontano re!tdents add 7% sales tax. 102


- -

_____________________________________

..... .......................

CANADIAN SOFTWARE SOURCE:e•wre en.,

CM"144

A-P

100. . 1

I

- · - - - - · · o•e

-. ..,.., -

•• •

•-

it

I

o· !

'U: 114V , . , _ ,

COMPUTERWARE CATALOGUE SHOPPING

1

1-

COMMODORE

64 PRODUCTS

OVER

FOR ORDER OR FREE CATALOGUE WRITE OR PHONE CANADIAN SOFTWARE SOURCE BOX "340" STATION "W''. TORONTO, ONTARIO M6M 589 (416) 491-2942

f l p i7L Ortorio R6'ident' odd 1'~ iniM In< t>M<1 c-.M>!Ifll"1 d"~ or rr«#IV O<del. V«> I; ono "<X!er c ora P'ecxe ~ c:otd n..mbet. exp•f ocn ono slg<lot\;rll. ' E ·()<o~ ' "' u P ~ W>n·lf• ·', ~"",,c., ..., , .,,,,. d <Jo(.joe.J Dv loco!~""'-

Add S2 SO far lhlpping and hoN:IIinQ. All iteti'S:t.Jbjec~ "0 <r<allobW;ty Prices ~

10 cna-.g.. 'N'1I10Ut notiOfil.

COMMODORE 64TM COMAL

COMMODORE OWNERS

ADDS:

Join the world 's largest, active Commodore Owners Association.

• 40 Graphics Statements • 10 Sprite Statements • " LOGO'' TURTLE GRAPHICS

• Access to thousands of public domain programs on tape and disk for your Commodore 64, VIC 20 and PET/CBM.

• RUN-TIMl COMPILER • FAST program execution • auto line numbering • line renumbering

• Monthly Club Magazine

• progrC\m !>tructures

• Annual Convention

• merging program segments • • • • • • •

• Member Bulletin Board • Local Chapter Meetings

Send S1 .00 for Program Information Catalogue. (Free wllh membership).

Membership Fees for 12 Months

Canada U.S.A . Overseas

-

••

$20 Can .

lo ng variable names named procedures pM.;\mctcr passing local and globa l vari.:~bles random access dlsl< files stop key di!>able End Of File detection

What does this and more? COMAL What is the cost? Only $19.95

$20 u.s. $30 U.S.

All ll'ti S ilnd much, much mor.. nn dl ~k wirh mi\ny .,.,.mp h: ONLY S 19 9<; llhn AvAIIAbl .. COMIIl HIINOBOOI< . SIR. 9'> B£GINNINC"o C'OMIII 1o I Q OS STRUCTURto rROCiRIIMMING WITH COMIIl, $24 9S . f OUNOATIONS IN progrt~ms.

T.P.U.G. Inc. Department " M " 1912A Avenue Road, Suite 1 Toronto, Ontario , Canada MSM 4A 1

CO.'wlrUTlR STUDi t S \"VITH COMAL, S I Q.OS . CAPTAIN COMAL G!T'S ORGANI.t£0. ~ 19 95 . COMIIL lOOAY 1\l!'o\'SieUer. S 14,9~ . S('nd ch('ck or Money Order 1n US Doll3rs plus Sl hnndling to. COMAL USeI"$ Grovp, U.S. A.. Llmrtc:d. !> !>0 I C..roveiMd Tee., Madison. WI !>3 7 I 0 phone: 601!-lU · 4 432 . COMMOOOR£. 64 i< rroldcmNk ol Lommodore (Jec:tronin Lrd. CArTAIN ('OMAt ;, trademark of COMAL lhcr< Group, tJ <;A . I ;,"""d

• LET US KNOW WHICH MACHINE YOU USE •

103


----

Advertising Index

Software

lssu~ / P~e

Adv.,,u,.,,

04

us

116

01

02

f'rodud Nnmc (Oc$cnptton)

Manufacturer -~-

Academy Sohware lll'nntJI Sottv.·are Co. ~ton E<locotiuual Cumputing OlnadJllrl Sohwarc Source

73

77

78

f.4

79

r.._...,.A.T~tpt.•

Cardinal SoftwM~ COM/\L Users Croup Computer Alli~nce Ot<xl~r ity S.:.ltWdft: O)•;,dic Resources Corp. F.11~1 f rn I~ DU lie Info Mag I11c. lnpm Systems Inc. l~l• Hat hot Kiny Mic;ruw~n' Magreeable Sohware Microcomputer ~utrons Mkro-F<U JtttcrOSpce Mkmlr rhnir Snholit>nj Micro W. O.I.

72

62 65

68

81

71

68

81

71

IBC IBC 76

66

75 81

70 11 7~

82

74 71

69 i8 74 65

VJC'20/C64 Softwau; Graph-Term 64 EducauonafSottwnrc 91 lOS C64 Sollw dl ~ Commodore sohware 88 H:l 97 V1C20/C64 Gnmes. Uttll lle:s. Edu. 88 103 C64 COMAL 94 BASM (lsngua~te lor the 64) 112 C64tVlC 20 games Sup~rPET luforrnallor) 88 MAE Assemble r 79 95 Commodore software Typ.-o (wordpr·~sol? IBC IBC Laser Strike H1 2 VIC/64/f'ET software 81 94 Stock Helper C6-1 Provlndal Payroll 86 &5 C64 Software C641VIC 20 Btu.incs• Softwau: 91 C64 Termin al soflwar~ 89 HI 99 Cli4 JU'I'·A·WUfill 82 101 C64 Disk Utl liry 96 Mr. Tester (dla~n~M:tlc proR.)

89

98 92

.. "

96

69

Midwest Micro Inc.

83 7:1 76

PACO eJect ronics LAd.

r ..rlnrmiHI('e Micro Products P.F. Cvnunu11K.ation~ Pro U ne Sortware

64

80

72

fill

68

84

65 1\6

62

79 79

73 73

72 72

7fi

119

7~

74

78

66

83

64 73

110

7!-1

76 Psywrn Softw.u~: lnt' l Public Domain Inc. Sllimon lnternn llonal Willi~' ' ' Rubl.>iiiS Suftware

62 77

74

n:t

7S

'/4

114

67

7K

64

BC

BC

74

77

72

62

79

74 73

Jr.('

IR:

tn:

we

64

68 68 68

.~ A~..odales

BC

70 70 6S fi.'!

84

Accessories 1\dvertlser ..··-· ...

78

03

Ill

I Page OS Uti lll

foR

Mirm Wt>rlri E.IM"Iro nix Mi<lwe.t Mlc:ru l11c. Midwes~ Peripherals !'recision Technology Ri•.:hva.l" id....ornrnunlcations Zani m Systems

80

04

70

l.1~ur •

/ !'age

05

06

.__...:f.:.: h"" o...: Tr::..:a:::n.:.:t=a c.:.:: to,_,r_ _ __ _ · _.._.._.. _·--

02

Ol

02

Product Nam,. (O..vri(>linn)

93

C64 'Cheat Sheeu;' Soltwo.re review/ CJCdlil.RIIC 'CURSO R'. CG4 T~r,. M111V'7.inr World Of Commodore II show U1sk, pnntcrs. nnsc. Sut:.scrl lx>r lnfn

!J l

69

78

64 93

72 75

llU

7!1

71 74

66 77

Product Name (Description)

VIC20/CG4 f>rintPr, F:xp J:on;.m 94 AID Converter. Quikdilik 1\6 101 Analog/Otgttall/ 0 TravGS VIC Rabbit Eprorn Proaro.mmcr Curnmunicaticm< l\d BC BC Colour Monitors Tape Interlace VJC20 RAM E:xp<~nd VJC20/CM Prin ter Interface 85 U7 limart ASCII PIus VIC20 Ex pan de,. 83 VIC20/C64 E.xpander Board~ JI:'C C64 Link OEE£ adil.))tcll 1 50flw;,re Home contrQI h~rr!w3,.,.

nyt"" & l'iPrt_, 1nc. Tile Bt>ok CornfJ•uoy The Code works I hon1f'r Ni.-hnl irJt'l Mar k~lu!j S.:rvi<.'t'> Midnight Soltware Gazette Toronto l't::T Users liroup Za.ni111 Sy>!t'llo~

VIC20/C04 GraphiC<; lltil 97 VIC20/C64 Super'l'erm JO'l The TOU L(pmgrnmmatljl aad) 100 l'ro Ooll C6•1 Fonh J Bullcrhdd v!dco tutor tf'C CommodOie soh'"~'" PAL 64 (assembler) POWER 61 (programmtns aid) MaUPro 92 general C64 sollwnrc 9'1 Commodore 5<>ftwar~ StJperBaw 64 (data base} 93 VIC!ti ~I PET Software

ls~ue.,.

79

/\propos Techno!~ rgrJ \licrotedl Cunn..,.,lit:utrnK.ruComputer E.lstcrn How;e

GPnrS" M. OrAk t Micro W.D.I.

2 83 ISS 86

75

Hardware Adv<!rli>Cr

73

l:'nnt&:~lic ~'tier

7!.1

llfJ

85

95 103

I

1

Member~hip CADICA~f

Micro Appli cotlon

Pr~~hlon Sufiwdr~:

_ ....

Manufacturer ~--

Amd~k

fl\a.nuladurer

In(<>

Tutorial

- - - - - - _,_____ __1.:..:0::_:... 4 _ _ _ _ _ _ _::_ _ _ _ _ __ _ __Vi ::.::o,_,l:. u"' = •'-'5.,.,...:1::: 11=u•'-'0:;.;:2:.-_.

The Transactor Vol5 iss2  

The Tech/News Journal For Commodore Computers

Read more
Read more
Similar to
Popular now
Just for you