• Vol'. 4, lssue 2, SepternlJer 1/83

• ' or

• •

YOUR CAMEL YOUR CAMEL IS YOU HA'JE ARRIVED

LIKES THIS PACE BURNING ACROSS AT A WATERHOtE •. THE DES'ERT SANDS 'tOUR rCA'MEL EATS WARNING­ HAPPILY WHILE YOU YOU NEED A DRINK REFJLL YOUR

• WATER-BAG

Also i�n th,is issue,: DEPARTIM'E',NTS:

• Conserving BASIC Memory A �B�it of Lower Case

PROGRAMMING: 8, Theory and Techniq,ues of Sorting � Part

Sol',,I ' ,,' ' ,' •

• Format ion Level II

• • Othello Colour

• �•� �ord,er�i��n�g� �Pr�i�oriti'es Level ,'lil' • • Regist er Display Program Peach • Towers of HanoJ Colour ***** ABOUT MICR0-80 *****

EDITOR: RYSZARD WIWATOWSKI ASSOCIATE EDITORS : SOFTWARE CHARLIE BARTLETT HARDWARE EDWIN PAAY

MICR0-80 is an international magazine devoted to the Tandy TRS-80 Model I, Model III and Col our mi crocomputers , the Dick Smi th System 80/Video Geni e and the Hitachi Peach. It is avai lable at the fol lowi ng prices:

12 MONTH SUB. SINGLE COPY MAGAZINE ONLY $ 26-00 $ 2-50 CASSETTE PLUS MAGAZINE $ 65-00 $ 4-00 (cass. only} DISK PLUS MAGAZ INE $125-00 $1 0-00 (disk only}

MICR0-80 is avai lable in the United Ki ngdom from : U.K. SUBSCRIPTION DEPT. 24 Woodhi ll Park, Pembury , Tunbridge Wel ls, KENT TN2 4NW

MAGAZINE ONLY £ 16-00 £ 1-50 CASSETTE PLUS MAGAZINE £ 43-60 £ N/ A DISK PLUS MAGAZINE £ 75-00 £ N/ A

MICR0-80 is avai lable in New Zeal and from : MICRO PROCESSOR SERVICES , 940A Columbo Street , CHRISTCHURCH N.Z. Ph 62894 MAGAZINE ONLY NZ$ 43-00 NZ$ 4-00 CASSETTE PLUS MAGAZINE NZ$ 89-00 NZ$ 5-00 DISK PLUS MAGAZINE NZ$175-00 NZ$1 5-00

MICR0-80 is despatched from Austral ia by ai rmai l to other countri es at the fol lowi ng rates :

(12 MONTH SUB} MAGAZINE CASS + MAG DISK + MAG PAPUA NEW GUINEA Aus$40-00 Aus$ 83-00 Aus$ 143-00 HONG KONG/SINGAPORE Aus$44-00 Aus$ 88-00 Aus$ 148-00 INDIA/JAPAN Aus$49-00 Aus$ 95-00 Aus$ 155-00 USA/MIDDLE EAST/CANADA Aus$55-00 Aus$102-00 Aus$ 162-00

Speci a 1 bu 1 k purchase rates are a 1 so avai l ab 1 e to computer shops etc. Please use the form in this issue to order your copy or subscri ption.

The purpose of MICR0-80 is to pub 1 ish software and other information to hel p you get the most from your TRS-80, System 80/Video Genie or Peach and its peri ph era 1 s. MICR0- 80 is in no way connected wi th any of the Tandy , Dick Smi th or Hitachi organisations.

** WE WILL PAY YOU TO PUBL ISH YOUR PROGRAMS ** Most of the 1 nformat1 on we pub 11sh 1 s prov1ded by our readers , to whom we pay royalti es. An app 1 i cation form contai ni ng fu 11 detai ls of how you can use your mi crocomputer to earn some extra jncome is included in every issue.

** CONTENT ** Each month we pub 1 ish at 1 east one app 1 i cations program in BASIC for each of the mi era­ computers we support. We a 1 so pub 1 ish Uti lity programs in BAS IC and Machine Language. We publ ish articles on hardware modifications , constructional articl es for useful peri ­ pherals, arti cles on programmi ng techniques both in Assembly Language and BASIC, new product revi ews for both hardware and software and we pri nt letters to the Editor.

** COPYRIGHT ** All the maten a 1 pub 1 i shed in this magazine is under copyri ght. This means that you must not copy it, except for your own use. This app 1 i es to photocopyi ng the magazine itself or maki ng copies of programs on tape or disk.

** LIABILITY ** The programs and other arti cles in MICR0-80" are publ ished in good faith and we do our utmost to ensure that they function as descri bed. However, no 1 i abi 1 i ty can be accepted for the fai lure of any program or other arti cle to function satisfactori ly or for any consequenti al damages arisi ng from thei r use for any purpose whatsoever. VOLUME 4, NO. 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 1

***** CONTENTS *****

REGULARS PAGE

EDITORIAL 2 PEEKING (UK) - From our U.K. Correspondent 2 INPUT/OUTPUT - Letters to the Edi tor 2

WHAT YOU HAVE MISSED 8 MICROBUGS 14

DEPARTMENTS

KALEI DOSCOPE 4 PEACH BOWL 5 GROUP ONE 6 FORM THREE 7

PROGRAMMING THEORY AND TECHNIQUES OF SORTING - Part 8 9

SOFTWARE

- TOWERS OF HANO I ...... •...... CC 14 & 19 OTHELLO .....•...... •...... •...... CC 15 & 21 TOWERS OF HAND I ...... •...... PEACH 14 & 23 REGI STER DISPLAY...... PEACH 15 & 24 DESERT CHASE .•...... L2/ 16K 16 & 25 FORMATION ...... •...... L2/ 1 6Kml 16 & 27 ORDERI NG PR IOR I TIES ...... L2/1 6K 18 & 23

MICR0-80 PRODUCTS CATALOGUE CENTRE

NEXT MONTH1 S ISSUE 35

CASSETTE/DISK EDI TION INDEX 36

ORDER FORM 36

MICR0-80 is Regi stered by Austral ia Post - Publi cation No. SBQ2207

AUSTRALIAN OFFICE AND EDITOR: MICR0-80 P.O. BOX 213 GOODWOOD, SOUTH AUSTRALIA, 5034. TEL. (08) 21 1 7244

U.K. SUBSCRIPTION DEPT: 24 WOODHILL PARK, PEMBURY, TUNBRIDGE WELLS, KENT TN2 4NW

Pri nted by: Shovel & Bul l Pri nters , 379 South Road, MILE END , S.A. , 5031

Publ i shed in Austral ia by: MICR0-80 433 Morphett Street, Adel aide, SA., 5000 VOLUME 4, NO. 2 (SEPTEMBER, 1983} MICR0-80 PAGE 2

***** EDITORIAL *****

With the announcement of a new range of computers, Tandy Austral ia offers somethi ng to interest everyone from the MC-10 Mi cro Colour Computer for $199.95 (avai lable in November}, through the new Model 4 to the Model s 12 and 16. There•s even a portable computer for the travel ling busi nes­ man.

The word • portab 1 e • takes on a new meani ng wi th the Mode 1 100 which is about the size of its own manual but lighter. It has a LCD di spl ay of 8 lines of 40 characters (wi th graphics capability} and is battery powered wi th a non-vol ati le memory. The basic hardware consi sts of a good keyboard, 8K of RAM (expandable to 24K} , a clock wi th cal endar , and interfaces to accommodate a Centronics printer, a RS-232-C port and a cassette recorder for data storage. The 32K of ROM pro vi des a BAS IC interpreter, a word processor, an address and appoi ntment faci lity and communications software. Once you become fami liar wi th these, I image that you can take and use the Model 100 literal ly anywhere.

The new Model 4 wi ll be avai lable in three configurations - l6K cassette (for $1 ,799}, 64K singl e drive (for $2, 799} and 64K two drive (for $3,299}. Model 3 owners can upgrade their computers with a ki t that includes a new keyboard , a new CPU board wi th 64K memory and the TRSDOS 6. 0 operating system wi th Di sk BASIC and sel ls for $1 ,299. CP/M Pl us for the Model 4 is expected within two to three months.

Meanwhi le, in the U.S. Tandy has released a new , smart-looki ng 64K Col our Computer (featuring a good qual ity keyboard} and the OS-9 real -time, multi -taski ng, multi -user operating system providing access to a broad range of existing appl ications software. The Multi -Pak Interface (priced around $US1 80} is an accessory al lowi ng the Colour Computer user to select one of four ROM packs at the fl ick of a switch or under software contra 1 . Undoubtedly these too wi ll be avai lable in Austral ia in the near future.

- 0000000000 -

***** PEEKing (UK} - by Tony Edwards *****

You wi ll remember the universal programmi ng language NOS-BASICODE reported in an earl ier issue of MICR0-80. Rather than die, thi s 1 anguage is sti ll deve 1 opi ng and the 1 a test deve 1 opment is NOS-BASICODE-2 , which includes the earl i er. version. These programmi ng languages have their origi n in the Dutch Broadcasting Corporation • s program 11Hobbyscoop11 (pronounced Hobby Scope}. Programs on computing, incl udi ng the transmi ssion of programs in BAS ICODE are output regul arly by Radi o Hi 1 versum 2 and 4 on the medi urn and VHF wave bands for reception in Hal l and , but these are easi ly recei ved in other European Countries.

For our readers in other parts of the world short-wave transmi ssions were tri ed but were not successful. However, the programs are now transmi tted to radi o stations worl d wide for re-trans­ mi ssion local ly. The program to look for is .. Radi o Activity .. , a 15 mi nute Engl ish language program which is re-transmi tted for local reception in Austral ia, USA, Canada, and parts of Africa and Asi a, as wel l as Europe. The local stati ons broadcast at suitabl e local times but the internal Dutch program is transmi tted at 1710 GMT on Sundays in the summer , and at 1810 on Sundays in the wi nter. It wi ll be found at 747kHz ( 401 metres ). Good 1 i steni ng ! The mai n program is in Dutch but it includes short expl anations in Engl ish.

- 0000000000 -

***** I NPtJT /OUPUT *****

From: John Veldthi us - Taranaki , N.Z.

Let me fi rst say what a fantastic magazi ne you have. Now for my question. I have bought the adventure game ca 11ed Asyl urn and have been going nutty for the last two months. I am stuck in the fi rst maze and cannot fi nd any way out. I have read the hints in Vol. 3, Issue 11 (October 1982} but these have been of no he 1 p at a 11. I have mapped the maze so far but sti 11 can • t fi nd anythi ng el se. Please hel p as I may end up in the 11 I nstitute11 at thi s rate.

From: Steven Bauer - Upwey , Vic.

These are questions which, hopeful ly, you wi ll answer or , if not , maybe one of your other readers wi ll be abl e to help.

Asyl um - how do I get out of the fi rst maze; please expl ai n each and every step.

To Bri an L. Hi 11 - Where did you buy the components? (for the 32K mod}. Di ck Smi th • s pri ce is over $23. VOLUME 4, NO. 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 3

From: Nick Lambropoulos - Mi ldura, Victori a.

It • s getti ng a bit monotonous,. I know , but I • m hoping, before everyone packs up and forgets about Asylum (?), which is usual ly widely tal ked about nowadays. I CRY OUT one final time for someone to te 11 me whereabout s the matches could be found in the Asyl urn, if it • s not too much trouble. I • m al so having troub 1 e figuri ng out what the hint means in the Guru • s room and what is in the other Dark Room. I would appreci ate any help given. Keep up the great work , Micro-80.

From: Jeremy Terhoeve - Townsvi lle, Qld.

Please can anyone te 11 me how to get past the gori lla in the second maze of Asyl urn? I cannot ful ly understand the hint the program gives here. Do you need a special object?

(To answer these questions , we need to refer to a profession a 1 by the name of Ron Hack who was gl ad to help by providi ng specific answers. Thanks very much, Ron. -Ed. )

From: Ron Hack - Reynel la, S.A.

To assist those readers sti ll seeking clues for the "Asylum" adventure and to refresh my own memory , I decided to p 1 ay the adventure agai n and answer the questions asked as I proceeded. Here goes -

GENERAL HINTS:

As you are aware, the adventure must be completed within a certain time. If you wi sh to take a break duri ng the game (for a cup of coffee or to write some c 1 ues for a magazine) ca11 up the vocabul ary as thi s stops the clock.

To John Veldthius, Taranaki , __ N.Z. _ On a large b 1 ank piece of paper draw 1 i ght penci 1 lines across and down the page equa 1 spaces apart , making a grid. As you proceed to move down the passages draw heavy 1 i nes marki ng the wa11 s as if you were looking down from above. Remember you wi 11 hyperspace in certai n p 1 aces and droppi ng things al ong the way wi ll help you to sort out where thi s occurs.

To Steven Bauer, Upwey , Vic.

It is impossible to give step by step instructions on getting out of the 1st maze (it would take up too much magazine space and possibly spoi l the adventure for others).

Hints: - You wi ll need to fi nd a key - Murderers can read - There are ei ght different corridors off the revol ving doors and not four as I thought for a long time. - Having mapped al l the maze you should fi nd it forms a rectangle.

To Nick Lambropou1os, Mi ldura, Vic.

The hint in the Guru's room is in Latin (so I've been told) and translated roughly means - In the dark , horses 1 ook 1 ike cows (and , as we know , donkeys 1 ook 1 ike horses) . Thi s tends to mean something once you meet the inmate outside the room ful l of water. Having met thi s inmate I suggest you try some tradi ng.

The matches are in the 2nd maze but you wi 11 have to so1 ve the my stery of the 20 room corridor before you find them. Refer to earl ier clues (MICR0-80 Oct. '82 ).

As to the other dark room and its contents - if you are curious try lighting a match to fi nd out.

To Jeremy Terhove, Townsvi lle, Qld.

You do need an object to he 1 p you pass the gori 11a in the 2nd maze and you • 11 fi nd it in that maze. You al so need an object you are already carryi ng assumi ng , of course, you have not dropped something si nee entering 2nd maze. The hint given at this stage of the adventure is a good clue as to what object may help you.

To Grant Barnes, Moe , Vi c.

You are wasting your time looking for the Professor 's Office unless you are up to this stage of the adventure. For what it's worth , the offi ce is in the final smal l maze and when you reach that stage you wi ll fi nd it easi ly enough.

Well , that • s it for now. I '11 just get in this strange contraption and...... WHEEEE - I wonder where I'll land! ! - 0000000000 - VOLUME 4, NO. 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 4 DEPARTMENTS ***** KALEIDOSCOPE *****

In this month 's issue we publ ish for the first time a program for the Colour Computer (Othel lo) submitted by one of our readers and we look forward to bri nging you more programs from our readers that show how they use their computers and how to improve your programmi ng skill s and your knowl edge of the Col our Computer. Towers of Hanoi - an interesting puzzle for you to try on your computer - demonstrates the use of recursive programming in BASIC and is worth looking at more closely. For those of you who cannot find the time to type in the programs from the magazine listings , and would prefer an easier method , we have good news - the Cassette Edition of the magazine, commencing with thi s issue, wi 11 inc 1 ude a 11 the Col our Computer programs contained in that issue! The cost of the magazi ne, pl us cassette subscription with be $65 for 12 issues and single cassettes wi ll be avai lable for $4.00 each.

Most of the Level 2 programs that we have converted are intended to run on a 16K Col our Computer with Extended Colour BASIC, but we seem to have slipped up with one of these quite unintentional ly. Here at MICR0-80 our Colour Computer consists of a 32K Extended Colour BASIC machine with one di sk dri ve. The Leve 1 2 programs are transferred, edited to remove the reserved words not used in Col our BASIC and to accommodate the sma 11er 32 x 16 di sp1 ay , and then tested on thi s machine. In most cases, what was a l6K Leve 1 2 program works fi ne on a l6K Co 1 our Computer, but in the case of "Sink the Enemy Navy", the memory requi red to run the program crept just over the l6K. How can you get a program to use less memory? Read on to find out.

BASIC PROGRAM MEMORY USAGE

To run a BASIC program, four wel l -defined and di stinct uses are made of the avai lable memory in your machine. These are illustrated in the fol lowing di agram:

Bottom of BAS IC memory

Program storage

Vari abl e storage

Free memory BAS IC interpreter 's Stack Space at RUN time Space reserved for storage of Stri ngs Top of avai lable memory

BASIC MEMORY USAGE

When you type in your BASIC program, the 1 i nes are tokeni zed to conserve memory and stored in the program storage area. However , if the program is to run successful ly (assumi ng there are no programmi ng or syntax errors) suffi cient memory must be avai lable for storing program vari ables, String storage and the BASIC stack, otherwi se the program wi ll stop during execution with an Out of Memory or Out of Stri ng Space error (the BASIC interpreter constantly checks the amount of free memory and, if it fal ls below a certain lower limi t, termi nates the program with an error ).

REDUCING MEMORY REQUI REMENT

When a program ha1 ts with an OM error , the answer is not necessari ly to rush out and buy more memory (an expensive sol ution but one almost guaranteed to work ). You can overcome the problem by making more efficient use of your avai lable memory by a combi nation of the fol lowing methods. Natural ly, there are compromi ses in some of these and a few viol ate what is known as "good pro­ gramming practice .. but I thi nk that under these circumstances the end justifi es the means.

1. Program Storage

Comments within a program are ignored by BASIC and serve only as documentation for the programmer. If you run out of memory , start by removing a 11 comments from the program (but keep a backup copy wi th the comments for future reference). However , be careful that you do not introduce other errors by doi ng thi s. For example, consider the fol lowi ng program segment : 20 REM CHECK KEYBOARD 30 A$=INKEY$: ....etc.

100 GOSUB 20

Deleti ng the remark line 20 wi ll produce an error at run time since line 100 references a non­ exi stent 1 i ne number. Line 20 can be del eted but 1 i ne 100 must a 1 so be changed to GOSUB 30 to produce the desired effect. VOLUME 4, NO. 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 5

Each BASIC line incurs a 5 byte overhead for the interpreter1 s use. By pl acing several statements on one 1 i ne you can save a good de a 1 of memory in the program storage area. For ex amp 1 e, the fol l owi ng portion of the program 11 Sink the Enemy Navy.. could be rewritten to use much less memory:

30 DIM C(l4,9 ) 40 DIM Bl (5) 50 DIM B2 (5) 60 DIM Cl (5) 70 DIM C2 (5) 80 DIM Dl (5) 90 DIM Dl (5) 100 DIM Sl (5) llO DIM (S2(5)

can be repl aced by:

30 DIM C(l4,9) , Bl (5), B2 (5), Cl (5) , C2( 5) , Dl (5), D2(5), Sl (5) , S2(5)

The total memory saved amounts to 40 bytes, not to mention the slightly faster execution time!

2. Stri ng Storage

The amount of stri ng space used and the amount requi red by a program are not necessari ly the same. However , there is good reason for al locating a generous amount of string space. Duri ng program executi on the interpreter makes use of stri ng space somewhat extravagantly. To illustrate, suppose A$ consists of the first 25 1 etters of the a 1 ph abet and you want to append the 1 etter uzu. You can do thi s wi th the statement A$=A$+11 Z11• What actual ly happens in the Stri ng Storage section is that the first string of 25 characters is di scarded as garbage and a new string of 26 characters is created and stored. If the amount of the string space is exhausted , the interpreter begins a .. garbage col l ecti on.. routine. Frequent use of this routine slows down program execution speed. The moral of the story is that if you can afford to be extravagant then a 11ow a generous amount of stri ng space in your CLEAR statement , but if memory is scarce, use only what is requi red.

3. Vari able Storage

Each time a new vari able is used within a program addi tional memory is used in the vari abl e storage area. When writing a 1 arge program you can be reasonably certai n that it wi ll use most of your avai lable memory. It would be wi se to consider your total vari able requirements (both in number and in use) at the outset and try to use as few as passi b 1 e to conserve memory and improve the execution speed of the program. As a general rul e, try to re-use exi sting vari ables whenever possi b 1 e because each new vari ab 1 e used within a program consumes some memory for the duration of the program, even if it is used only once. It is much easier to consider these needs in the initial stages of program devel opment than it is to make extensive changes to vari ables in an almost complete program.

There are occasions where the creation of a new vari ab 1 e can actual ly be used to save memory. To illustrate, suppose your program uses the number 20000 frequently, say, for exampl e twenty times in different parts of the program. You can save a substanti al amount of memory (about 80 bytes) by assigning V=20000 at the beginning of the program and using the vari able V in pl ace of the number 20000 el sewhere in the program. Not only does thi s save memory , but as a bonus, it increases the speed of the program and saves some typing as wel l.

IN SUMMARY

The p 1 ace to start when you 1 re tryi ng to save some memory is within the program storage area. More often than not , you can free enough memory here to use the program effectively without having to resort to more drastic measures. If you must economi ze in vari able usage and string space allocation, then perhaps the option of increasing your amount of physical memory should be considered. There are other ways to conserve memory such as abbrevi ating instructions and messages, or del eting parts of the program that you can do without, but these are more a matter of personal taste rather than techniques of programmi ng. So if you1 ve been frustrated by some large program that just wouldn1 t fit your 16K Colour Computer, try trimmi ng some of the fat!

- 0000000000 -

***** PEACH BOWL *****

Many who are new to BASIC find programmi ng in that language difficult and the idea of programmi ng in assembly 1 anguage (or machine 1 anguage) seems total ly out of the question. Thi s month we present .. Regi ster Di sp 1 ay11 which is a reasonably short machine 1 anguage uti 1 i ty that , apart from bei ng useful , may serve to teach you a little about this low-level programmi ng language. When you wi sh to 1 earn how to program in machine 1 anguage the p 1 ace to start is wi th a good book that expl ai ns the fundamental s and the instruction set of the processor you1 re using (in this case, the Mot oro 1 a 6809 ). A good ex amp 1 e is the book 11 Programming the 680911 by Rod nay Zaks which tends to be 1 ess formi dab 1 e than Mot oro 1 a 1 s own pub1 i cations. The Peach pro vi des VOLUME 4, NO. 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 6

an adequate machine code monitor that wi 11 a 11ow you to deve 1 op and test short m. 1. programs that you have assembled by hand.

For those of you who like puzzles, we have a version of "Towers of Hanoi .. for the Peach that should keep you amused for hours. The original puzzle would take innumerable lifetimes to solve, but thi s version is somewhat abbrevi ated. And good news for those of you who cannot fi nd the time to type in those long magazine listings - our cassette edi tion now includes the Peach programs pub 1 i shed in that issue of the magazine, commencing with thi s issue. The prices for cassettes will be the same as shown inside the front cover - $4.00 for a single cassette and $65.00 for a subscription that includes magazine plus cassette.

SECTOR EDITOR CORRECTION

If you had any prob 1 ems with thi s program after making the amendments pub 1 i shed 1 ast issue , then perhaps thi s correction may sol ve that probl em:

Change

60130 DATA 36,30,10,C6,0F,34, ...

to 601 30 DATA 36 ,30,10,C6,10,34, ...

Geof Drury , who developed the amendments to Sector Editor, al so passed on thi s correction.

The di scussion on conserving memory in Ka 1 ei do scope wi 11 a 1 so be of interest to new Peach users. (The Peach too uses a Microsoft BASIC interpreter ) . In the case of the Peach , it may be added that although the use of long vari able names does improve the clarity of a program, more memory is used to store the longer name and, in the case of very long programs , execution speed increases.

- 0000000000 -

***** GROUP ONE *****

Whi 1 e 'Desert Chase ' and 'Ordering Priorities ' are re 1 at i ve ly straightforward Leve 1 2 programs and should run in di sk systems without changes, the machine language uti lity 'Formation' is defi nitely for Level 2 systems only as presented. For di sk users, the changes required to use this uti lity with di sk BASIC involve rel ocating the program (not very diffi cult if you have an Editor/Assembler), modifying the initi aliser and using a different reserved word (such as NAME which doesn 't appear to be used by some di sk BASICs) and rewriting the I/0 routines to make use of di sk instead of cas sette. We would be pl eased to publish any adaptations devel oped by our di sk system readers.

If you are a novice computer enthusiast , or even perhaps a more seasoned user , you may fi nd the di scussion on conserving memory in thi s month's Kaleidoscope of particular interest. Al l of the mi crocomputers that we support use a version of Microsoft BASIC and the information presented there is equal ly appl icabl e to the Z80-based machines.

THE CASE OF THE LOWER CASE

At some stage in our rel ationships with our computers, many of us wi ll take a step further inside the machine and begi n to dabble with a hardware modi fi cation of some sort. More often than not, the apparent simplest of modi fi cations wi ll lead to a smal l hiccup that gradually grows to mammoth proportions the longer we struggle to overcome the diffi culty. Mr. Wi l son , one of our readers rel ates one such experience:

" I have instal led a lower case modi fi cation as descri bed in 11THE CUSTOM TRS-80 & OTHER MYSTERIES" which was advertised and purchased through your magazine by a fri end of mi ne. The mod was successfu 1 , because runni ng the sample program gives me lower case letters.

A 1 so running the short program as descri bed in MI CR0-80 November 1980 (Issue 12, page l 0), enab 1 es me to type in 1 ower case 1 etters , so everything in thi s department seems okay.

Now the problem is if I try to 1 oad the MICR0-80 Lower Case Dri vers (May, 1981 ) I get the message fol lowed by four and a ha1 f 1 i nes of garbage on the screen , fol l owed by the second prompt *? I type "/" then ENTER, the screen gi ves a fl i cker , it then sits there and does nothing. The writing stays on the screen and the only way to get any more keyboard action is to power down the computer.

So thi s bri ngs me to a few questions. Oh! by the way , my computer is a VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 7

Level II 16K TRS-80 (cassette based ) "G" board.

1. Is my tape faulty? 2. Is thi s mod compatible with yours? 3. If not , could you send me info on how to make it compatible? 4. If the tape i sn • t faulty and my mod is compati b 1 e with yours, H-E-L-P���

Keep up the good work on the best magazine out for • 80 users. Long 1 i ve the '80!� "

What would you say is the problem? Of course, it had to be a faulty tape; we ' ll send the man a new cassette but, as it was 1 ate in the afternoon , that waul d have to wait unti 1 tomorrow. For some reason, which now escapes me , I decided to take the tape home and check it on my System 80 - a stupid idea, upon reflection, as my internal cassette deck of early vintage is extremely fussy and wi ll fai 1 any tape that has the s 1 i ghtest flaw. But , 1 o and beho 1 d � Each dump 1 oaded perfectly!

More al armi ng than that was the fact that when executed , the results were exactly as reported by Mr. Wi l son in hi s 1 etter. For the record, my System 80 was fitted with a MICR0-80 1 ower case modifi cation over two years ago and which has recently been repl aced by a nameless brand because I now prefer an underline cursor. After thoroughly investigating the software aspect of thi s di lemma, which is where I assumed the trouble was , I took a long, hard look at the inst&l ­ lation instructi ons and di scovered to my surpri se: NOT ALL LOWER CASE MODIFICATIONS ARE EQUAL�

The original design of the TRS-80 and System 80 used a video RAM block that was only seven bits wide with bit 6 mi ssing. Instead , hardware was used to generate bit 6 from bits 5 and 7. :!"he typical lower case modifi cation invol ves the instal lation of an extra RAM chip for bit 6, a new character generator ROM (if required ), a 1 itt 1 e bit of wiring on the board to enab 1 e bit 6 and a software driver to enab 1 e you to make use of the new 1 ower case capabi 1 i ty. I expected to fi nd that when you write a zero into bit 6 of video RAM, you can read a zero from the same location (assumi ng that the chip is not faulty). A close look at the modification on p.108 in "The Custom TRS-80 and Other Mysteries" shows that what goes into bit 6 is not necessari ly the data on the bus. With thi s modifi cation you cannot store the val ues 0-31 in video RA;�, even though it's now 8 bits wide.

As the MICR0-80 Lower Case Driver loads into video RAM (expl aining the "garbage" \'Jhich is real ly a machine 1 anguage program) and executes from there to re1 ocate i tse 1 f to the top of memory , thi s situation is disastrous. No wonder the system hangs and needs to be powered down. The sol ution is to perform the other modification given in the same book on p.107 which simply connects the new chip to bit 6 of the data bus and a 11ow s video RAM to be used just 1 ike any other RAi�. Try the fol lowi ng program to see what happens in the video RAM of your '80:

1 0 CLS: AD%=15360 20 FOR I=0T0255 II. 30 PRINT@896 ," ' 40 POKE AD% ,I 50 IF PEEK(AD% )<> ITHENPRINT@896 ,"IN=";I;"OUT=";PEEK(AD% ); 60 FORJ=1T0200: NEXTJ 70 NEXTI

In the top left-hand corner of the screen , the character corresponding to the val ue OUT is di spl ayed and at the bottom you can see if your video RAM is 7 bits wide ( ab 1 e to store only 32 - 95 and 128 - 191), funny 8 bits (able to store only 32 - 255) or true 8 bits (able to store 0-255).

When it comes to hardware you must be careful not to make any fal se assumptions. If some problem deve 1 ops then you must check very carefully the hardware changes and any software you are trying to use. It is interesting to note how, in this case, the combination of hardware and software led to such a subtle problem. To accommodate lower case ASCII characters, the video RAM· must be ab 1 e to store va 1 ues in the range 32-1 27. Va1 ues in the range 0-31 (contra 1 codes) are not normal ly stored but are acted upon by the video driver routi ne. Therefore , thi s particul ar modifi cation made no provi sion for stori ng control codes. In writing the universal Lower Case Driver routi nes , Eddy sought to provide maximum flexibility by al lowi ng you to load them at any time without di sturbing any other uti lities or programs already in memory. �he logical p 1 ace to put them was into the video RAM and to re 1 ocate them from ther to free h1 gh memory. So the MICR0-80 lower case modification provided a true 8-bit video RAM which would allow you to store a m.l. program which could be executed from there (making video RAM Just like the rest of your RAM) .

- 0000000000 -

***** FORM THREE *****

For our Mode 1 3 readers, • Desert Chase • and • Ordering Priorities • are two Leve 1 2 programs that VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 8

should run with no probl ems but the machine language uti lity 'Formation' wi ll defi nitely not run without modifi cation . However , changes simi lar to those described in the October '82 Model 3 Movie Microbug (p .20) should enable you to use thi s uti lity on your Model 3.

Why don • t Mode 1 1 machine 1 anguage programs a 1 ways work on a Model 3? The two mai n reasons are that the Model 3 ROM takes up more user RAM from 42E9H to 43E8H and that the Mode 1 3 has an extra 2K of ROM to pro vi de extra features . The extra ROM and different hardware architecture of the Mode 1 3 required changes to the ori gina1 12K ROM found in the Model 1 . Thi s means that some ROM calls and entry poi nts are different on the Model 3, preventing many Model 1 m.l. programs running on the Mode1 3. I compared the contents of the ROM in our Mode 1 1 to that in our Mode 1 3 for addresses in the range 0000-2FFFH and the resu 1 ts are set out be 1 ow (Note that thi s may depend on the particular ROMs present ):

0003 - 0004 01Fl - 01Fl 124C - 124D 000E - 000F 01F3 - 01F4 1918 - 1918 0047 - 0048 01F8 - 020F 191C - 191C 0050 - 0062 021 2 - 0231 l B5D - 1 B5F 0066 - 0070 0235 - 0245 206D 206D 0082 - 0082 0247 - 025E 2073 2073 00AA - 00AA 0264 - 0282 2075 - 2075 00AE - 00AE 0284 - 02A7 2077 - 20B8 00B2 - 00B4 02E2 - 02E4 20BC - 20BC 00C6 - 00C6 03C2 - 03E9 20F7 - 20F7 00EA - 00EA 03EB - 0468 213B - 213B 00FF - 0101 046B - 0494 2167 2167 0106 - 010A 0496 - 049E 2B85 - 2B88 010D - 010F 04A0 - 04B7 2B8C - 2B8E 0112 - 0115 04B9 - 050C 2B9l - 2B93 01 18 - 011B 050E - 0532 2ClF - 2C42 01 1D - 0121 0534 - 05CF 2C7A - 2C7F 01 25 - 012C 05Dl - 05D3 2C8l - 2C82 01DA - 01EF 0674 - 0707 2C8A - 2C8C

Model 3 vs. Model 1 ROM differences

The tab 1 e above shows only the addresses (in Hexadeci rnal ) where the Mode 1 1 and Model 3 ROMs differ . Notice that the bul k of the changes are in the first 2K of the ROM {where the I/0 driver routines reside) whi le changes to the BASIC interpreter itself are rel atively minor . Although many entry poi nts for common routines have been mai ntai ned , the Model l 066CH entry to BASIC can no longer be used {the entry 1Al 9H should be used instead).

Adapting Model l m. l . programs is then a matter of changing ROM ca 11s and entry poi nts where they differ and moving those programs that reside at the bottom of BASIC's memory up to clear the extra scratch pad RAM area. With the aid of an Editor/Assembler and the source code listi ngs in the magazine, most Model l m.l . programs can , with a little effort , be made to run on your Model 3. If you have any additional information or a patch that you have developed , send it in to us and we wi ll include it in this section for the benefit of al l our Model 3 readers .

- 0000000000 -

***** WHAT YOU HAVE MISSED *****

Set out bel ow is a list of some of the programs publi shed in early issues of MICR0-80 magazine. Back issues are avai lable for $2.50 each or at the annual subscription rate for 12 or more copies . Cassette editions are avai lable for al l issues for $4.00 each whi lst di sks are avai lable for a 11 issues from September 1981 onwards. For 12 or more magazines with cassettes/di sks ordered at the same time, the relevant annual subscription rate appl ies. Programs for the Hitachi Peach/ TRS-80 Colour Computer were fi rst publ i shed in the Apri l 1982 issue.

Issue 6 - * May 1980 Issue 15 - February 1981 Issue 18 - May 1981 * Some issues incorrectly PINBALL {Ll ) ARITHMETIC (L 1) label led Apri l. KEYNOTE (Ll ) SORTING { L l) LEVEL II TBUG UPDATE (L2 ) NORMAL DISTRIBUTION {L2) SUB ATTACK (Ll ) MICROHEX (L2) DISASSEMBLER {L2) SPACE DRIVE {Ll ) SEA WOLF (L2) 12 HOUR CLOCK (L2) TRIG/BAS (L2) ASTRONOMY (L2) BONES {L2.) SUPER SIZZLER (L2) MURDER {L2) PHILATELIC ADVISER {L2 ) TIC-TAC-TOE (L2) UNI VERSAL LOWER-CASE HOUSEHOLD ACCOUNTS {L2) DRIVER ROUTINES (L2) CONNECTA and CONNECTX (L2)

Ll - Level l program CC - Colour Computer L2 - Level 2 program HP - Hitachi Peach VOLUME 4� NO. 2 (SEPTEMBER� 1983) MICR0-80 PAGE 9

The fol lowing back issues of MICR0-80 magazi ne are sti ll avai lable:

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov De.� lk

'79 0 I

'80 I I I X I I I X I X X I

'81 I I I I I I I I I I I I Q '82 I I I I I I I I I X

'83 I I

-.------

( - means never publ i shed� I means issue avai lable� x means issue out of pri nt).

- 0000000000 -

PROGRAMMING

***** THEORY AND TECHNIQUES OF SORTING - PART 8 ***** by Bernie Simson

In Part 7 of thi s series, it was shown how records from an input fi le for sorting were extracted , sorted in mai n memory and stored away in a workfile for later merging. Thi s arti cle will examine in more detai 1 the processes i nvo 1 ved in storing sorted sub 1 i sts of records in workfi 1 es , and some merging methods.

PRODUCTION OF SORTED SUBLI STS.

Since the external sort phase (merging) involves a great proportion of the total sort time due to di sk operations , it fol lows that to optimi se the sort , the total number of disk operati ons should be kept to a mi nimum� in particular, track seeks. Thi s occurs when the read/write head is instructed to find or write a record based on a random address, rather than a read or write of the next sequenti al record. Thi s is not always an easy criterion to al low for in a restricted di sk-based system, whi ch is usual ly the case with most microcomputer configurations.

A restricted di sk system is defined as a system having 1 ess than four head actuators. A head actuator refers to the mechani sm in a disk drive that control s the movement of the read/write head� notthe read/write head itself.

The reason for thi s is expl ained later; a system having four logical drives in two double sided di sk drives has only two head actuators, and is therefore considered a restri cted di sk system

Delimiter identifier Pointer, or Figure 1 - Typical workfile structure Sortkey entire record t 1 sorted sublist Merge or -- sublist workfile J

Delimiter record X

sorted sublist

Delimiter record X

I I ' I ' ' I , I VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 10 for optimum merge time purposes.

When a sub 1 i st has been sorted in memory and is ready for storage in a workfi l e, the records (or AD DROUT poi nters) are written out with the same sort key used to determi ne ordering in the internal sort phase. Thi s same sortkey is used to determi ne ordering during merging. Now, depending on which vari ation of merge technique is used , which is governed by the number of �ead actuators avai lable, the sorted sublist is written out to one workfi le, or several different workfi les. Also, a subl ist del imiter is written at the end of each sublist to separate them in the same workfi le. The del imi ter would obviously have to contai n some unique identifier to avoid it becomi ng confused with a sub 1 i st record. Figure 1 shows the format of a typical workfi le.

If more than one workfi le is used to store the sublists, then they are used in an alternating fashion , so that the subli sts are di stri buted fai rly evenly over the workfi les.

When al l the records from the input file have been extracted and sorted in memory , the result should be one or more workfi les contai ning sorted sublists separated by del imi ters. The workfi le(s) are then used as input to the merge process.

MERGING TECHNIQUES.

Thi s is where most of the di sk operations occur, so it is wi se to devote some extra thought to optimi sing thi s aspect of the sort if you are designing a sort package.

Two merge techniques wi 11 be shown, with some vari ations app 1 i cable to restri cted disk systems. The two merge types are :

Linear Merge, and Tree Merge.

LINEAR MERGE.

Li near merging is shown in Figure 2. Only one sub 1 i st workfi 1 e is required as input. It involves reading the sub 1 i st records and merging them with records in the merge workfi 1 e that was created

Figure 2 - Linear Merge SUBLIST WORKFIIE

pass p+l LTh"'EAR � MERGE MERGE WORKFILES

Sorted. sublist records (only (a) Linear Merge FI& sortk.eys shown) - � Merge workfiles B D G P 1----pass 1 1------

A R v X B D G P I L pass 2--t> - c G L M A B D G p R v x 1 Cpass 3 F R T v ---£> A B c D G G L M p R v x L l pass 4--t> A B c D F G G L M p R R T v v X I I l I

(b) Linear Merge TRACE VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 11 during the previous merge pass, to produce a new merge workfi 1 e. Thi s is then used as input to the next merge paSS9 together with the next sublist in the subl ist workfile. The merge workfi le output from each merge pass grows in a linear fashion.

Do not confuse sublist workfiles with merge workfi les. Subl ist workfi les are created when sorted subl i sts are stored on completion of each subl ist memory sort , whereas merge workfi les are temporary files created by the merge process. The internal operation itself is quite simple, and is common to both merge types. At any one point in time, two records from each fi 1 e to be merged are compared , and the one with the sma11 est sort key va1 ue is written out to another merge workfi 1 e, and the next record from the workfi 1 e from which the written record came , is read , and the com­ pari son repeated. A three-way merge could be imp1 emented if desired , i nvo1 vi ng reading 3 fi 1 es at one time, and writing out a record depending on the result of a three-way compari son , but this di scussion is restricted to a two-way merge to avoid confusion (if you aren 't confused alt�eady ).

A vari ation to thi s merge technique i nvo1 ves reading a11 the records in the sub1 i st workfi 1 e into memory , and using thi s array as one of the inputs to the merge (with the merge workfi 1 e). Thi s assumes that the enti re subl ist wi ll fit into memory. It should do so, as it was ori gi nal ly wri tten out from memory in the i nterna1 sort phase, un1 ess the sub1 i st was produced according to the process descri bed in Figure 2(A) of the previous arti cle (Part 7). You wi ll notice that in this case, the ori ginal input fi le is referenced to retrieve the entire record using the poi nter in the array as index , thereby creating a sub 1 i st in the workfi 1 e that is 1 arger than the sorted array.

Thi s variation is useful where only two head actuators are avai lable - one to read the merge workfi 1e, the other to write the new merge workfi 1 e, whi 1 e actua1 merge is taking p1 ace. Track seeks wi ll not occur , even though 3 fi les are involved , because the reading of the subl ist workfi le is not simultaneous with the reading and wri ting of the merge workfi les.

TREE MERGE.

Tree merging is shown in Figure 3. A1 though the sorted sub 1 i sts are distri buted over 2 sub 1 i st workfi 1 es, the structure of each is sti 11 consistent with Figure 1. However , you wi 11 noti ce the different algorithms as evi dent in the merge pass traces in Figure 2(B ) and 3(B). The tree merge creates multiple merge workfi les, agai n distributing them over another 2 new merge workfi les

Figure 3 - Tree Merge

Merge TREE workfiles Sublist workfiles MERGE

(a) Tree Merge FLOW

Sorted sublist reoords (only sortkeys shown) PASS 2 PASS 3

ABCDFGGI.MPRRIWX

ABBCDEfFGGHJKLLMOPPQRRRRRSS'ITWX

Final sorted file BEFHJKLOPQRRRSST

(b) Tree Merge TRACE VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 12 in an a 1 ternati ng fashion in the same way that the sub1 i st workfi 1 es were produced. These 2 new merge workfi 1 es are then used as input in the next pass to produce 2 more merge workfi 1 es , thi s time rep 1 acing the 2 merge workfi 1 es used as input in the previous pass. Thi s technique produces sub 1 i sts that are conti nual ly doub 1 i ng in size, unti 1 only 2 sub 1 i sts exist in separate workfi les, when they are fi nal ly merged to produce the final sorted fi le.

Now in order to e 1 imi nate track seek, the four workfi 1 es active during any one pass must exist on separate di sks under the contro 1 of separate head actuators. A doub 1 e sided drive has only one head actuator , so unless 2 workfi les are pl aced on the same tracks on each side of the di sk, track seek wi 11 occur. I don 1 t know of any DOS that wi ll al l ow , without comp 1 exi ty , contro 1 over where on the disk a fi le is pl aced.

If 1 ess than four head actuators are avai 1 ab 1 e, then it may be better to have only one sub 1 i st workfi 1 e, as in the Linear merge , rather than incur an overhead of two extra fi 1 es on the di sk. Track seek wi ll occur anyway.

If thi s vari ation is adopted , two subli sts are read simultaneously for merging, so it wi ll be necessary to mai ntai n some information as to the starti ng address of each subl ist, maybe by using a 1 inked 1 i st that is updated when the sub1 i st workfi 1 e is created. The output from thi s vari ati on is also just one workfi le, which is used as input for the next merge pass. The algorithm is the same as for the four-fi le Tree merge - doubl ing the subl ist sizes on each pass.

COMPARISON OF THE TWO MERGE ALGORITHMS.

The Linear merge is the simp 1 er to imp 1 ement , but the Tree merge is the more efficient. Thi s is usual ly the case in life .... deci sions , decisions.

The sort package designer must decide on a trade-off between simpl icity or efficiency, also taking into account the envi ronment in which the sort package wi ll be implemented , in particul ar , the likely number of head actuators avai lable.

To assi st the budding designer , I have prepared a table givi ng the maximum number of subl i sts servi ced by one head actuator duri ng a merge pass, for the two al gorithms. The smal ler the number , the less track seek activity.

MERGE TYPE : LINEAR LINEAR VARIATION TREE TREE VARIATION

NO. HEAD 4 l 1 l 2 ACTUATORS 2 2 l 2 2 1 3 2 3 3

Thi s gives an indication of the likely track seek activity for a given envi ronment , which wi ll have a bearing on the overal l effi ciency of a particul ar algorithm - for instance, the Tree merge algorithm, al though bei ng more efficient than the Linear variety as demonstrated bel ow , may turn out to be less efficient if bogged down in a multi tude of track seeks in each pass.

EFFICIENCY ANALYSES.

For the purposes of these ana lyses , it is assumed that track seek activity is the same for both al gorithms , and therefore does not enter into the compari sons.

An accurate measure of the effi ciency of a merge a 1 gori thm can be made by ex ami ni ng the average number of times any particul ar record in a workfi le is moved from the first pass to its pl acement in the final sorted fi 1 e. That 1 s what merging is a 11 about - moving records from one fi 1 e to another.

Thi s can be done by determi ning the number of passes that wi 11 be necessary to merge a 11 the subl ist records, governed by :

N. .. The number of records in the ori gina1 input fi 1 e (and therefore , the number of records in al l the subl ists),

S... The size of each sub 1 i st , which is governed by the internal sort array size (i.e. memory size).

Then the total number of records output in al l the passes is calculated , and final ly, thi s is divi ded by N to give the average times each record is moved.

LINEAR MERGE.

From the Trace in Figure 2(B), it is evi dent that each pass involves wri ti ng 4 more output records than in the previ ous pass, i.e. the output merge workfi le grows by the size of the input subli st.

If you were to list the number of output records for each pass, you would noti ce that the numbers represent an ari thmeti c progression, where the subl ist size is the first term, and al so the VOLUME 4� NO . 2 (SEPTEMBER� 1983) MICR0-80 PAGE 13 common difference.

So , substituting the vari ables in the arithmetic progression formula: Sum = (N/2)*(2*A + D*(N-1)) Where N = number of terms , A = First term� D = common difference� we get: Sum = (N/(2*S) )*(2*S + S* ((�/S)-1)) Because the number of passes = N/S (Al so the number of terms in the progression)� the fi rst term is S, and the common difference is also S.

Thi s formula can be simpl ified to: Sum = N* (S+N)/(2*S) Thi s represents the total number of records output in al l the passes, so the average number of records moved is: Ave = (S+N)/(2*S) Now for the Tree merge analysi s.

TREE MERGE .

From the trace in figure 3(B) , a rel ationship can be seen between the number of passes required to produce the fi na1 sorted fi 1 e, and the number of sub1 i sts in the workfi 1 e ( s) at the start of the first pass. Thi s rel ati onship is exponential , and is defined by: p 2 = L Where P = number of passes, and L = number of ori gina1 sub lists. Si nee L is defined by N/S (tot a1 number of records in the ori gina1 unsorted fi 1 e divided by size of each sub1 i st), the number of passes is derived as: P = LOG(N/S)/LOG(2) or LOG(N/S ) to Base 2.

For the purposes of thi s analysis, it is assumed that the number of sub1 i sts before the fi rst pass is a power of 2, i . e. 2 3 . Thi s is where the Tree merge a1 gori thm becomes more camp1 ex to implement , when the number of subl i sts is not a power of 2, so that during merging, a sublist is left unpai red and must be kept track of for merging in the next pass.

The rel ationship in Figure 3(B) is very simi lar to the number of accesses required to traverse a binary tree or to do a binary search, to locate an e 1 ement . Si nee in each pass, each sub list doubles in size, and the number of subl i sts are halved , the total number of output records written in each pass remains the same as N (total number of original records ). Therefore, the tot al number of records output is: N* ( LOG(N/S ) to Base 2) and the average number of times each record is moved is: Ave = LOG(N/S ) to Base 2, which al so happens to be the number of passes , a fact that is evi dent from the trace in figure 3(B) .

Now that the formulae have been derived for the 2 algorithms , thei r efficiencies can be compared, given different sort fi le sizes , and sub list sizes (i.e. memory sizes). Using the formulae, the average number of times each record is moved in the entire merge is:

N s LINEAR TREE (FILE SIZE ) (SUBLIST SIZE) MERGE MERGE

256 recs 64 recs 2.5 2 1024 64 8.5 4 1024 512 1.5 l 16384 512 16 .5 5 50000 2000 13 4.6 100 100 l 0

The figures obtai ned in the last line are correct according to the formulae. However, in practice, where the fi le size is the same as the sublist size (entire file fits in memory ), the Linear merge wi ll not transfer the sublist to a workfi le, as shown in the trace in Figure 2(B) .

Obvi ous1y , if al l the fi 1 e fits in memory , no merge is necessary, so a figure of zero means no merge, or record movement .

Thi s comparison demonstrates the efficiency of Tree merge over Linear merge but, as mentioned above, it may be affected by other factors such as track seek, so tri al and error may be the only way to determi ne which is most suited to a particular envi ronment . VOLUME 4, NO. 2 {SEPTEMBER, 1983 ) MICR0-80 PAGE 14

TO SUMMARISE ... Merging is the fi na1 process i nvo1 ved in sorting a fi 1 e of records. Its purpose is to combine sorted sub1 i sts produced by the i nterna1 sort process because the input fi 1 e is too big to fit in mai n memory at the one time.

The p 1 acement of sorted sub1 i st workfi 1 es in a restricted di sk-based system is important in order to optimi se sort time due to the effect of track seek activity. Therefore, some trade­ offs may be necessary to mi nimi se thi s.

Two merge a1 gori thms are Li near Merge and Tree merge. Tree merge is the more efficient in a system where track seek activity is not a limiting factor . Where it is, the choice as to which wi ll be more effi cient is governed by the parti cul ar envi ronment where the sort package is instal led.

- 00000000000 -

***** MICROBUGS *****

A1 though we make every effort to ensure accuracy in the materi a1 we pub1 ish, i nevi tab ly errors and omi ssions wi 11 occur . In thi s section, we pri nt corrections to those bugs that have been reported .

GOLF - July, 1983 Vol .3, No.l2 - page 27.

The listing publ i shed in the magazi ne contai ns a smal l error in line 2170 . It should read:

2170 IFSl

The cassette version of the program al so contai ns this error.

- 0000000000 -

S FTWARE

***** THE TOWERS OF HANO I - (Colour} by M. Byrne *****

The 'Towers of Hanoi ' is pl ayed with a number of di sks of differi ng sizes and three pegs on which the disks may be stacked . Initial ly the di sks are arranged on one peg in order of decreasing size. The object is to transfer them {in the 1 east number of moves) to another of the pegs so they are once agai n arranged in order of decreasing size. However , you may only move one di sk at a time and it must not be pl aced on a smal ler di sk.

Th is program al lows you to select the number of di sks {up to a maximum of 10 for the Hitachi Peach and 8 for the Colour Computer ) and whether you or the computer wi ll solve the problem.

The mai n vari ables used are:

N{3) holds the number of di sks on each peg. Pl {), P2 { ), P3{) are peg arrays. Each element holds the size of the di sk at that position. SK { ) the parameter stack. sc the source peg . DN the destination peg . AL the alternate peg . NM the move counter. SP the stack poi nter . B the base pointer for the stack elements of the previ ously invoked procedure. CT the number of disks. s the amount of del ay {for automatic operation). F the peg the di sk is moved from. T the peg the di sk is moved to. T1 , T2 used to test whether the move is legal . M is the mi nimum number of moves . TO the top di sk of the peg we are moving from.

Probably the feature which wi ll cause most confusion is the use of recursion . It appears to be a not-too-well-known fact that BASIC wi ll al low recursion {on most machines anyway) . Recursion is a means whereby a procedure or subroutine may cal l itself. This involves the use of a stack {which BAS IC provi des ) for stori ng the return address and another stack {which must be set up expl icitly) if parameters are to be passed to the cal led procedure .

The parameter stack is only real ly used when automatic operation is required as manual operation VOLUME 4, NO . 2 (SEPTEMBER, 1983 ) MICR0-80 PAGE 15 merely involves asking for moves and checki ng their val idity.

The current top-of -stack is indicated by SP . When used by the mai n procedure, the top stack e 1 ement ho1 ds the number of the a 1tern ate peg for thi s move , top of stack - 1 ho1 ds the number of destination peg for thi s move , top of stack - 2 holds the number of the source peg for this move whi le top of stack - 3 indicates the numbers of di sks sti ll to be moved .

When used by the shift procedures the top of stack contains the number of the destination peg and top of stack - 1 contains the number of the source peg .

Because the parameter stack must be exp 1 i citly set up and manipul ated in BASIC, the a 1 gori thm tends to become somewhat obscured. Al so if it is the first time you have encountered recursion, BASIC is not the ideal language to learn about it. For those of you who are interested in findi ng out more, the tree-di agram for the algorithm used in thi s program is given in the book 'An Intro­ duction to Problem Solvi ng Using Pascal ' by Kenneth Bowl es.

- 0000000000 -

***** OTHELLO - Colour Computer by S. Gi bbons *****

Othe11 o is wri tten for the 16K Tandy co 1 our computer. Othe11 o is a game of strategy for two players and is based on, and very similar to, the board game by the same name .

The rules are the same as the ori ginal and are explai ned in the program.

The p1 ayi ng board is made up of 64 squares ( 8 x 8) . The vert i ca1 and hori zonta1 positions are represented by numbers 1-8 shown at the top, bottom and both sides of the board.

The di sks are represented by squares which are b 1 ack on one side and white on the other . (Only one side of the di sk is shown at any time).

The di sks are pl aced alternately by each pl ayer starting with black . To pl ace a di sk on the board you give the hori zonta1 position then a comma f o11 owed by the verti ca1 position. The computer wi ll tel l you if you give the coordinates of an illegal position.

The progressive score is constantly shown at the top right hand corner throughout the game. The score is based on the amount of di sks each pl ayer has on the board in his possession.

The game wi 11 end when a11 the board has been fi 11 ed with di sks. The winner is determi ned by the colour which has the most di sks.

- 0000000000 -

***** REGISTER DISPLAY PROGRAM (Peach) - by D.J. Omond *****

Thi s provi des an easy means of exami ning register contents at any time duri ng the operation of a program . It is simi lar to the facility provided by the machine-l anguage monitor but whereas that can only be initi ated from the keyboard (MON + R), the Di spl ay Program can provide regi ster content information at any poi nt in a program then can revert either to the program under test, to BASIC command level or to the machine-l anguage monitor .

LOADING.

A short program written in BASIC 1 oads the data 1 i sting, sets the routine into operation to fi rst initial ize the Software Interrupt vector then provide a sample di spl ay. At thi s stage, the BASIC loading program can be discarded .

The location at which the operational program is stored in memory can be specified by the operator if desired during the BASIC loadi ng phase. Alternatively, the program can be stored in a "default" location at the top end of User RAM .

OPERATION .

The di spl ay program is initi ated by a Software Interrupt i.e. by a 3F instruction inserted in a program under test . A 1 ternati ve ly, an EXEC command inserted in a BASIC Program and directing control to the displ ay routine, provides return options as fol lows :-

(a) EXEC &H6F95 returns to the program under test (b) EXEC &H6F97 returns to BASIC command mode (c) EXEC &H6F9B returns to the machine-language monitor

On th e occurrence of a SWI , a11 regi sters are saved on the stack. The stack poi nter va 1 ue is VOLUME 4, NO . 2 (SEPTEMBER, 1983) MICR0-80 PAGE 16 derived (6F9F ) and placed on the stack. Use is made of various subroutines in the ROM to designate and di sp1 ay the regi ster contents e.g. 6FA7 prints 1 S 1 then 6FAC-6FB3 the SP val ue. 6FB9 refers to the regi ster headings table (used by MON ) then up to 6FCA, di splays registers CC, A, B, DP in successive loops.

6FDO to 6FEl prints the 2-byte registers X, Y, U and PC and 6FCC-E tests for completion. 6FE3- F is a stack of 11pri nt spaces 11 which is entered at vari ous level s to provi de the required number of bl anks for the screen displ ay.

The last two lines 6FF3-5 restore al l regi ster val ues (equivalent to RTI ) fol lowi ng which control moves to the PC val ue stored at the time of Software Interrupt. Thi s is the means by which the return options are tied to the point of entry into the di spl ay routine.

- 0000000000 -

***** DESERT - CHASE - L2/16K by A.N. Downey *****

In this game of hi gh adventure, the object is to travel a di stance, which varies between 200 and 300 mi les, across the vast Simpson Desert .

Your journey is made peri 1 ous due to hazards such as : wi 1 d tribesmen , 1 ack of water, sandstorms , etc . As al l good travel lers of the desert know , you must take care of yourself and your equi pment. However, if you fi nd yoursel f in troubl e you can always hope for help - although thi s is not always forthcomi ng .

The game is extremely easy to p 1 ay and is very addi ctive. Many hours have been spent at my keyboard trying to beat the odds. There is some strategy i nvo 1 ved in thi s game , however , with the number of random vari abl es included it is extremely difficult to rely upon this fact.

As for the program i tse1 f: al l 1 i ne numbers are in i nterva 1 s of 10, beginning at 10 so 11 AUT011 may be used through the program. I apologi se for the lengthy graphic lines (Line N0 1S 990 - 1430 ) . However , I am sure some of you can design your own routine for these. I assure you that , a 1 though 1 engthy , they are wel l worth the work involved . The distance required to trave 1 is set up in vari able R - contai ned in Line No. 20 . Thi s may be changed to suit your requirements (make it less for a shorter di stance).

I won 1t expl ain any more as it wi ll take some of the fun out of it, and the program is self­ prompting. So , good luck with your Desert Chase.

- 0000000000 -

***** FORMATION - L2/16K (C) by Davi d Gri gg *****

An Electronic Form Creation and Data Entry System .

INTRODUCTION.

Entering 1 arge amounts of data can be the most tedious and frustrating part of using a personal computer . Stori ng that data on cassette tape, if you don 1 t have di sk drives , can be even more time consumi ng and annoying. If data is to be entered during program execution , then appropri ate prompts can be wri tten into the program in the form of PRINT or INPUT statements, but thi s can be fiddly and diffi cult. Data entered in thi s way can only be stored on tape using the snail 1s­ pace PRINT # statements, and what1s more , there is always the chance that a program error wi ll cause execution to stop, which usual ly means losing data entered duri ng execution. Rather safer is enteri ng data in the form of DATA statements in the program itself. But having to type the word 11DATA11 at the beginning of every 1 i ne can be tedi ous . Commas have to be inserted between data i terns , and it is al l too easy , wi th a 1 ong 1 i st of numeri ca 1 data i terns , to 1 ose track of how many you have entered, or which order they are in, since there are no prompts . So thi s method of data entry can be equal ly tedious .

In a non-computer situation, we are al l used to fi lling in forms when information is wanted . A 1 though thi s can be wearyi ng, at 1 east we a 1 ways know what data is wanted , how much room we have to fi ll it in, and we can always go back to correct a previous entered item, if we have made a mi stake.

Busi ness computer systems have offered electronic form systems for data entry for some time, whereby an e 1 ectroni c form is presented on screen so that a re1 ati vely unsophi sticated operator can enter data in the same sort of way as fi 11i ng in a form by hand, with a 11 the advantages of that method .

FORMATION is a computer program for the Model 1 TRS-80 and the System 80 which gives you the same capabi lity, wi th the very val uable feature of being abl e to quickly and simply design your own e 1 ectroni c forms , then save the desi gn for future use. Data is stored in the form of DATA VOLUME 4, NO. 2 (SEPTEMBER, 1983) MICR0-80 PAGE 17 statements automatical ly appended to any existing BASIC program in memory . The data can then be stored on tape simply by using the CSAVE command in the normal manner .

HOW TO USE "FORMATION" .

1. Loading the program.

Turn on the computer then type SYSTEM (enter) . To the SYSTEM prompt answer FORMAT (enter }, and press the p 1 ay button on the recorder . When the prompt returns , type I (enter} , and the READY prompt wi ll appear . Now you can 1 oad any BAS IC program you wi sh to append data to. When you are ready to use FORMATION , type OPEN in command mode . The list of FORMATION opti ons should appear .

2. A Sample Form

To see how FORMAT ION works, choose option 4, FILLING EXISTING FORMS . The screen wi ll fi ll up wi th a sampl e el ectronic form , for a simple mail ing list program . Look at the format of the screen . The areas marked out by under 1 i ne symbol s ( ) are 11entry fields" . A b 1 inking block cursor wi ll be present at the begi nning of the first field.

Type in some appropri ate data, perhaps your own surname fit·st . Then hit ENTER (NEW LINE for the System 80 }. The b 1 ock cursor wi 11 skip to the beginning of the next entry field. The down arrow key would have the same effect (CTRL key for System 80 }. Before you enter your initials hit the up arrow key (or ESC Key) . The cursor wi ll skip back to the beginning of the previous fi e 1 d. Hit ENTER agai n to go forward to the next fie 1 d. Continue to fi 11 in appropri ate data in a 11 the fie 1 ds . If you make a mi stake, backspace in the usua1 way , or use the up arrow key (or ESC Key } to return to a previous field. Once al l the data is entered to your sati sfaction, hit CLEAR (or for the System 80 , hit shift @} . Al l the data wi ll vani sh , and the cursor wi ll be back at the beginni ng of the fi rst field.

Note that if you type right to the end of a fi eld, the cursor automatical ly ski ps to the next field. Simi larly, backspacing past the begi nning of a fi eld skips you back to the start of the previ ous field.

You can either continue to enter new data, or you may 1 ike to escape from thi s mode to see what has happened to your data. To do thi s, hit shift up arrow key (or shift ESC}. The list of opti ons wi ll return. Thi s time choose option 5, RETURN TO BASIC. The Ready prompt wi ll appear .

Now LIST. The data you have entered wi ll be listed as one or more DATA statements beginni ng at 1 i ne 32005 , wi th commas inserted between i terns which were entered in different entry fields. If an exi sting BASIC program had been in memory , these statements wou ld have been appended at the end of thi s program . To return to FORMAT ION type OPEN (enter).

3. Creati a New Form

To create your own electronic form , choose option 2, CREATE A NEW FORM . Or the exi sti ng form in memory can be modified or added to by choosing opti on l. If option 2 is chosen, the screen wi ll clear , and tne cursor wi ll appear at the top left of the screen .

You may now type in any text you choose to act as prompts . The down arrow key (or CONTROL} key wi 11 drop the cursor down one 1 i ne . The up arrow key (or ESC } key wi 11 jump it up one line. The backspace key acts normal ly, though you wi ll find that the cursor is non-destructi ve. If you want to wi pe out a character , you should use the space bar . On the TRS-80, the ri ght arrow key acts as a non-destructive forward space . The ENTER (or NEW LINE} key wi 11 move the cursor to the start of the next line. Using these keys , the cursor can be quickly moved around the screen to enter text wherever you 1 ike.

However , to create the vita1 entry fi e 1 ds, the underline symbo 1 must be used . This symbo 1 is accessible by hitting the @ key. An entry field begi ns wi th an underl ine symbol and continues to the end of a string of such symbo 1 s. Any break in thi s string creates a new entry field. So if you were to type " " thi s would establ ish one entry field four characters 1 ong , but typing " " creates four entry fi e 1 ds, each one character 1 ong . Entry fields can be created anywhere on the screen, and you may create up to 80 separate entry fields .

It wi ll be important for you to make a written record of which entry fie 1 ds you have estab- 1 i shed , what data they wi 11 contai n, and thei r order (from left to right , top to bottom) . The reason you need to note thi s is so that your BAS IC program wi 11 be able to access the data in the right order , and wi th the right type (numerical or string as appropri ate} .

Once the form is camp 1 ete to your sati sf action, type shift up arrow key (or shift ESC) to return to the option list. If your form is only for temporary usage, you can proceed to fi ll thi s form as you did wi th the sample form . However, you wi ll probably wi sh to save thi s form for future use. To do thi s, put a b 1 ank cassette in your recorder, and choose VOLUME 4, NO. 2 (SEPTEMBER, 1983} MICR0-80 PAGE 18

option 3. After you have pressed the record and p 1 ay buttons, you can save the form onto tape.

Note that the entire FORMATION program, complete wi th new form, is saved in thi s way . This means that any time you wi sh to use your own form, you need only load the one SYSTEM Program . FORMATION was designed in thi s way for your convenience .

NOTE : Some characters, if entered when fi lling in forms , wi ll be changed before they are inserted into the DATA statements . Thi s is because otherwi se they would act as del imiters and mess up the DATA statements. These characters are daub 1 e quotes ( 11 ) , comma (,), and the co1 on (:). t + They wi 11 be changed to the characters , , and + respectively. Your BASIC program may need to take this into account.

FORMATION COMMAND SUMMARY . CREATE MODE : TRS-80 SYSTEM 80 * Move cursor up one line t ESC * Move cursor down one line + CNTRL * Move cursor forward one space + not avai lable * Move cursor back one space + * Insert underl ine symbol @ @ * Move cursor to start of new line ENTER NEW LINE * Escape from thi s mode shift t· shift ESC FILL MODE : *Cursor to start of last fi el d t ESC * Cursor to start of next fi eld + CNTRL * Move cursor forward one space not avai lable * Move cursor back one space + + * Move cursor to start of next fi eld ENTER NEW LINE * Record data, start clean form CLEAR Shift @ * Escape from thi s mode shift t shift ESC FROM BASIC: Type OPEN (enter ) to return to FORMAT ION

NOTE : FORMATION makes extensive use of calls to the Microsoft Basic ROM in order to reduce the amount of memory it takes up. It is possi b 1 e that the program wi 11 not work wi th some late model TRS-8o •s wi th the revi sed ROM .

Thi s program is for L2/16K machines only. Users of Leve 1 2 machines wi th more than 16K MUST respond to MEMORY SIZE wi th 32767 . This program WILL NOT work on a Di sk Basic machine. SYSTEM 80 owners who do not have a ri ght arrow key may get around the prob 1 em of ri ght di recti on cursor movement by pressing the backspace key unti 1 the cursor wraps around the screen . The desired position may then be reached as it is approached from the ri ght side of the screen .

(The di stributi on di sk contai ns an offset version taki ng the user to Level 2).

- 000000000 -

***** PRIORITIES - L2/16K by A.F.J. Bel l *****

This program was written for two reasons. Firstly, because of the acti vities of the Razor Gang there was a need to be ab 1 e to review the acti viti es of my hospi ta1 and put them in order of pri ority. Secondly, I wanted to get some experience in using stri ng matrices .

The program enables one to specify up to 12 acti vities , and to assign a rank to the importance and to the feasi bi lity of each activity. Then the computer fi nds the product of the importance and the feasi bi lity, which can be taken as the relati ve pri ority which each activity should recei ve. One can revi ew, add or change data unti l one is sati sfi ed . One can then order the acti vities accordi ng to thei r importance, feasib ility, or priority, and printout the results.

Lines 10 to 120 are housekeeping. Line 60 sets my Mi cro 1 i ne 80 Li neprinter to 10 chrs/i n and 64 chrs/l ine, sets the page length to A4 size, and sets the linenumber counter to 0. You wi ll need to change thi s to suit your type of pri nter .

Lines 190 to 240 di sp 1 ay the options . The rather comp 1 i cated system in 1 i nes 220 to 2.40 enab 1 e one to use a single stroke INKEY$ system .

CHR$ ( 13) in lines 250 to 300 (the instructions ) is the contra 1 character for 1 i nefeed/carri age return .

Li nes 310 to 440 accept data from the keyboard , and puts the data as string va 1 ues in a stri ng matrix (two dimensional array) . Line 430 converts the stri ng val ues into numerical val ues , MICRO-SO PRODUCTS CAT 1

·8 PR

This catalogue contains a selection from the wide range of peripherals, interfaces, computers and software carried by MICR0-80 for your computer. If you don't see the item you want, contact us, we probably have it anyway! MICR0·80 has been supplying customers throughout Australia and the Pacific region by mail-order for 2112 years. Our customers findthis a simple and efficient way to do business. You may place your order by telephone or by mailing the order form from any issue of MICR0·80 magazine. Generally, it takes about one week from receipt of order until despatch. You should allow 2·3 days for your letter to. reach us and 7·10 days for the parcel to reach you, making a total turnaround time of 2112·3 weeks. WARRANTY AND SfRVICf All hardware products carry a 90 day parts and labour warranty either from the manufacturer/distributor or from MICR0·80 Pty Ltd. In many cases, warranty servicing can be arranged in your own city, otherwise goods will be repaired by our own team of technicians in our Adelaide workshops. TRADf·INS AND TERMS MICR0·80 can accept your existing equipment as a trade-in on new equipment. We can also arrange consumer mortgage financing or leasing on larger hardware purchases. Contact us for details.

TKSDOS 2.3 DECODED THE CUSTOM TRS·80 B AND OTHER MYSTERIES KS AND OTHER PIYSTERifS by James farnour by Dennis Bathory Kitsz The TRSDOS operating system Ever wanted to do things to explained with a fu lly your TRS-80 that Radio Shack commented source code listing, said couldn't be done? How a description of the command about reverse video, high line interpreter and the resolution graphics, and audible IJEf'XJDjrEIM1 subroutines used by the DOS keystrokes? commands, the file Now enough? How about management system, the error turning an 8-track into a mass .------, message processor and much, storage device, making music, much more. Excellent value at controlling a synthesiser, $.39.95 (plus $1.20 p. & p.) 7m'"'Cil��. TBS88 individual reverse characters, & OiliER;',\'\'STE'RIES .." and a real·time clock just to name a few? The Custom TRS·BO and Other My steries is packed with more than 290 pages of practical information and can be yours I for only $.39.95 (plus $1.20 p. & p.)

BASIC FASTfR AND BITTfR AND OTHfR MYSTERifS by Lewis Rosenfe lder Basic is not nearly as slow as 1 MACHINE LANGUAGE DISK 1/0 most programmers think. Basic and OTHER MYSTERIES faster and Better shows you by Michael Wagner IJ.4Sll' Ji.'.L."J'IER how to super charge your BASIC A.J.\TJ IlErrrER with almost .300 pages of fast, The guide to machine language functions and subroutines. disk software for TRS-80 Models You won't find any trivial ,------::::; 1 and .3 that explains what the poorly designed "check-book floppy drive system is all about, balancing" programs in this disk controller chips, read/write book - it's packed with usefu l access, head step and seek programs. commands, forced-interrupt Tutorial for the beginner, command, disk files, how instructive for the advanced, records are stored on disk, and invaluable for the creating a file, etc. You also get professionaL this book doesn't a disk formatter program, a just talk ...it shows howl Basic program to calculate passwords raster and Better is $.39.95 and much more for only $39.95 (plus $1.20 p. & p.) (plus $1.20 p. & p.) MICRO-SO PRODUCTS CAT 2

lntroducin NEW LN MODEL

The new LNW Model 2 is not just a microcomputer but a complete computer package that includes excellent hardware, extensive systems software and a ra nge of applica­ tion software. Manufactured by LNW Research corporation, the LNW Model 2 features: HARDWARE: SYSTEMS SOFTWARE:

• 4MHz Z80A microprocessor with 96K user LNWBASIC 4.0 - an extension to disk BASIC RAM. that allows full use of the LNW80s • 16K x 6 bits Graphics RAM, expandable to graphics capabilities through the 64K (four pages>. addition of powerful graphics • Printer; RS-232-C and cassette interfaces. commands such as CIRCLE, COLOR, • 12K BASIC in ROM (Level 2 compatible>. DRAW, etc. • support for single/double sided, DOSPLUS 3.4 - t h e fas t, re1· Ia ble and easy- single/double density, 5%" or 8" disk , to-use operating system that pro- drives. vides all the file control and disk • Full TRS-80 Model 1 compatibili1-u. �y. management you need for max- • Hi-res Colour and B W video & imum benefit from yo ur disk � 1 drives as well as an enhanced disk • �� ��� es Graphics Modes: R BASIC. - B & W 128 X 48 - B & w 480 x 192 LNW-CP/ M - the CP/M operating system - 8 colour 128 x 192 opens the door to a whole new - 8 colour 480 x 192 world of software. LNW-CP/ M was • Three text displays Modes: designed to be compatible with - 64 char x 16 lines application programs written for - 80 char x 16 lines CP/M 2.2 and provides the user - 80 char x 24 lines with a 61 K system

APPLICATION SOFTWARE: 3. Electric Pencil - an easy-to-use word 1. LNW small Business and Professional Ac­ processor. counting series - including General 4 .. Microterm -an intelligent terminal pro­ Ledger, Accounts Receivable, Accounts gram for communications. Payable and Payroll (U.S.A. 5. Chart-Ex - allows you to transform your conventionsJ. data into pie, line or bar charts on hi­ 2. Electric Spreadsheet - for financial plan- res display or prin ter with bit graphics. ning and forecasting.

The LNW80 Model 2 is perfect for the serious hobbyist or businessman seeking a higher performance, more reliable computer to replace his TRS-80 Model 1 without sacrificing a huge investment in software and programming experience.

LNW80 Model 2 computer ...... $2,850 (complete except for disk drives and monitorJ HI-RES Green Phosphor Monitor ...... $265 Super HI-RES Hitachi RGB Monitor ...... $1 ,250 TWo Single-sided 40 Track Double Density Disk Drives ...... $825 fin cabinet with power supply and cableJ All prices include Sales Ta x and are subject to change without notice. Prices are FOB Adelaide. Add $20 road freight anywhere in Australia. All equipment carries MICR0-80's Australia-wide 90 day warranty covering parts and labour. MICR0-80 PRODUCTS CAT 3

THE WILD WESf SPACE ATTACK STRIKE FORCE

This incredibly popular game craze It's up to you to keep the West Steady your nerves, keep a sharp As the primary defender of a world of now runs on your TRS-801 It's eat or beautiful with Outlaws and rene­ lookout, and prepare for battle to cities under deadly alien attack. your be eaten You run Scrarirnan around gade Indians on all sides.. Even the save your city. Fiendish aliens are all weaponry is the latest rapid tire train has been captured by Outlaws around, and it they destroy the city the maze. gobbling up everything in missiles, long range radar. and with all the payroll on board. Can you lose. your path Try to eat it all before nasty incendiary "star shells " Your force you clean up the Wild West? Price: $26.50 monsters devour you Excellent h1gh field can absorb only a limited number speed machine language action game Price: $26.50 of impacts A complex game of tram the Cornsott Group. With sound strategy, skill and reflexes from Melbourne House Price: $17.95 Price: $26•50

Soar swiftly over jagged landscape, Asteroids float ominously around the swooping high and low to avoid screen You must destroy the obstacles and enemy missiles attacks. asteroids before they destroy you' (Big With miles of wild terrain and tunnels asteroids break into little ones) Your to penetrate, you 're well armed with ship will respond to thrust, rotate. bombs and multiple forward missile hyperspace and lire. Watch out tor capability From Melbourne House. that saucer with the laser' Features sound. trainer mode and As reviewed in May 1981 Byte Magazine customizing program. . Price: $36.50 Price: $26.50

Your ship comes out of hyperspace As a vast panoramic moonscape under a convoy of aliens You destroy scrolls by. select one of many landing every one. But another set appears sights The more perilous the spot, the These seem more mtell1gent You more points scored ·· it you land eliminate them too Your fuel supply is safely You control LEM main engines d!mlmshmg. You must destroy two more and side thrusters One of the best sets belore you can dock The space uses of TRS-80 graphics we have ever stat1on IS now on your scanner With

seen From Adventure International sound 1 With sound Price: $26.50

Price: $26.50

METEOR MISSION II GALAXY INVASION DEFENSE COMMAND As your sh1p appears on the bottom of the maze eight allen ships appear on the As you look down on your view. The invaders are back' Alone, you The sound of the klaxon is calling you' top, all traveling directly at you ' You astronauts cry out lor rescue You Invaders have been spotted warping defend the all important nuclear fuel move toward them and fire missiles But must maneuver through the asteroids toward Earth You shift right and lett canisters from the repeated attacks of the more al1ens you destroy the faster and meteors (Can you get back to the as you tire your lasers. A lew break thieving aliens. repeatedly An alien the remammg ones become If you get space station?) Fire lasers to destroy formation and fly straight at you 1 You passes your guard . snatches a the asteroids. but watch out, there place you r linger on the lire button canister and llys straight ott Quick' too good you must endure the Flag· could be an alien Flagship lurking knowing that this shot_must connect' You have one last chance to blast him sh1p.. W1th sound effects' Includes sound effects' With sound effects' from the sky' With sound and voice $26.50 ,_Price: $26.50 Price: $26.50 ·Price: $26.50 , Price: MICRO-SO PRODUCTS CAT 4

MICR0-80 now offers you the widest range possible in entertainment software. These programs are supplied on cassette for the Levei ii/16K TRS-80 Model IIIII (except as noted). They are also suitable for the System 80 but sound may not be available unless a hardware mod ification has been fitted to reverse the roles of recorders #1 and #2.

DEFENCE PENETRATOR $20.95 JUNGLE BOY $2 1.50 DEFENCE PENETRATOR is based on one of the The ultimate challenge! Are your reflexes fast most popular arcade favourites of all time with enough to swing Jungle Boy from vine to vine? Can smooth graphics and sound effects. With realistic you swingthrough the jungle? Can you swim by the scrolling planetscape it's the best game yet. alligators? These are just some of the things you will fm d very challenging in Jungle Boy. BAT TLE STATION $2 1.50 The aim of the game is to defend your space station against the attack of four alien space ships. srELLARWARP $20.95 Animation with superior fighter craft brings you an MORGOTH $20.95 even greater challenge. As your computer ad­ Morgoth is a unique action packed adventure vances your level, the aliens become more allowing you to wander through the enchanted dangerous and the harder it is to stay alive! dominion of Morgoth and collect the lost treasures of KAZARD KALLAHAN. But Beware ! You must escape before the satanic Morgoth is aroused and seeks yea! HOPPY $2 1.50 KILLERBEETLES $2 1 .50 The aim of the game is to get your frogs across the The aim of the game is to dig traps. When a beetle busy highway without being squashed and then fa lls in you must fill it in to bury them, before they across the river by means of floating logs and can catch you. turtles.

SfARCRESfA $20.95 Star Cresta takes you beyond the limits of your com­ INSECT FRENzy $2 1.50 puter and into the Cosmic void itself! Beware ! Iron The aim to stop the centipede from getting you, all clad concentration and lightning relfexes are re­ is the time keeping an eye out for the giant spider. quired to destroy the evil empress.

JUNGLE RAIDERS $2 1.50 The aim of the game is to defend your four bases ALIEN CRESfA $2 1.50 from the marauding Jungle Raiders. Yo u kill all The aim is to defend your ship from numerous at­ the Jungle Raiders and they try to hit you with their tacks from an assortment of aliens. If you get hit spears or drag off all four of your bases. three times, it's all over. KILLER GORILLA $2 1 .50 Four completely different frames. Each one offering a different challenge, makes this one of the most RALLYRACER $20.95 complex and stimulating games ever written for a Drive through an action packed maze and try to hit TRS-80. The game keeps track of the top ten scores all the flags before Morgan the Mad motorist or along with a six character name for each score. Crazy Harry and his killer hoodlums catch you !

NOTE: As the prices of imported software may vary, these prices are valid for current stock only and prices are subject to change without notice. MICR0-80 PRODUCTS CAT 5

Storage with the

The LNDoubler is easily installed into your expansion interface and provides support for both 5 �" and 8" disk drives. Completely compatible with all the major Disk Operating Systems, the LNDoubler provides technically advanced, tested and reliable double-density operation with such features as:

• Analog phase lock loop data separation. as 5" or 8" drives and a switch is • Precision write precompensation. provided for drive 0. • High quality PCB will all contacts gold­ • Supports any mix of 5" or 8" drives, single plated. or double density, single or double sided. • Drives 1-3 may be software selected

The LNDoubler will inrease the formatted storage capacity of each 40 track single-sided drive by 80% to over l80Kbytes for just over half the cost of one disk drive. With an 8 inch double­ sided double-density disk drive,· you can have over one Megabyte of online storage! The LNDoubler 5/8 doubler with docurnentation is available for ... $2 plus $2.00 p.&p. NOTE: A sp ecial cable is required for 8" drive operation and 8" double-density operation requires a 3.55 MHz CP U sp eed-up modification.

is the state of the art in Disk Operating Systems fo r the Model 1 and Model 3 offering an order of magnitude increase in flexibility and performance over its predecessor DOSPLUS 3.4 and yet is easier to use and more friendly with a Help fa cilityexp laining the syntax of DOS commands. H1e huge manual of over 3.50 pages describes the system in detail and is sectioned and tagged so that you can find what you want more quickly Far greater flexibility is offered by the introduction of device drivers that are external to the system and that can be tailored to your needs. Some of the features offered by DOSPWS 3.5 are ... • Single and double density support with density re cognition. • Improved file control fa cilities and date stamping of files. • A keyboard driver that offers single key entry • An extensive Job Control La nguage. • Complete and detailed technical system information. • Two versions of BASIC plus a BASIC label fa cility • and much more. $160 When ordering by MAIL please specify Model 1 or Model 3 and include S 2 for freight DISK DRIVE HEADS CLEANING FIT A PERCOM DISKETTES 5" FLOPPY DATA SEPARATOR $44 & DIS TTES and eliminate CRC incl p. p. 3M Disk drives are expensive and so are Scotch Brand errors and locked-out diskettes. As with any magnetic recording device, a disk drive works • Reinforced centre hole tracks better and lasts longer if the head is • To suit soft sector format cleaned regularly. In the past, the $45 lus $2 p. & p. problem has been, how do you clean the • Rated for double density p head without pulling the mechanism When Ta ndy designed the TRS-80 apart and running the risk of damaging Box of 10 single-sided for expansion interface, they did not include delicate parts. 3M has come to our a data separator in the disk-controller rescue with SCGI'CH BRAND, non­ $59 incl p. & p. circuitry, despite the I.C. manufacturer:s abrasive head cleaning diskettes which recommendations to do so. The result 1s thoroughly clean the head in seconds. Box of 10 double-sided for that many disk drive owners suffer a lot The cleaning action is less abrasive than $69 incl p. & p. of Disk I/0 errors. The answer is a data an ordinary diskette and no residue is separator. This unit fits inside your left behind. Each kit contains: expansiOn mterface. It is supplied with 2 head cleaning diskettes full instructions and is a must for the 1 bottle of cleaning fluid serious disk user. 1 bottle dispenser cap MICR0-80 PRODUCTS CAT 6

The MICR0-80 interface does not interfere with the normal operation of The ultimate hi-resolution graphics yo ur Praxis 35 or ET-1 21 typewriter board fo r the TRS-80 Model 1 and which becomes a reliable, high qulaity, System 80 that provides 256 letter perfect printer. We are convinced programmable characters as well as the that you will be able to fit the interface ability to emulate a 384 x 192 dot yourself without hassles and be addressable screen. The hardware printing within the hour. Our interfaces capabilities of the PCG-80 enable you provide a Centronics compatible parallel to plot mathematical functions, display interface and are supplied with power arcs, circles, lines, waves and design supply, comprehensive fitting and display custom characters ranging instructions and user manual. The from 72 pixels to 18432 pixels. Yo u can cable to connect the interface to the mix graphics and characters anywhere computer is not included in the price. on the screen. We also offe r a fitting service in Ad elaide fo r only $35. PCG-80 to suit Model 1 only plus $ 5 p. &.. p. lnteface to suit Praxis 35 only PCG-80 to suit System 80 only plus $ 10 p. &.. p. plus $ 5 p. &.. p. Interface to suit ET-121 only plus $ 10 p. &.. p. (Note : Not suitable fo r later type japanese keyboards on TRS-80 Model 1).

plus $2.00 p. &. p. plus $2.00 p. &. p.

Large volume means we can buy The MICR0-80 modification features true below­ better and can pass the savings the-line descenders, a block cursor and symbols on to you. There are our proven, for the 4 playing-card suits. Each kit comes with prime, branded 200 nanosecond comprehensive fitting instructions and two chips, guaranteed for 1 2 months. universal lower-case driver routines on cassette A pair of DIP shunts is also to enable you to display lower case. These required to upgrade CPU memory routi nes are self-relocating, self-protecting and in the TRS-80 - these cost an will co-reside with other machine language additional $4.00. All kits come programs (the second includes keyboard­ complete with full, step-by-step debounce and flashing cursor). Fitting requires instructions which include labelled soldering inside the computer and should only photographs. No soldering is be carried out by an experienced hobbyist or required. You do not technician. A fitting service is available in capital have to be an experienced cities for only $20.00 and a list of installers is electronic technician to included with each kit. (Specify TRS-80 Model I install them. or System 80 when ordering.)

All prices include Sales Tax and are correct at time of publication but are subject to changes without notice_ All eq uipment carries MICR0-80's Australia-wide 90-day warranty covering parts and labour MICR0-80 PRODUCTS CAT 7

T MS & T TWARE

Yo u can increase your programming productivity, the execution speed and 'user friendliness' of your programs by using an enhanced Disk Operating System (DOS). To gether with the other utility software, you can get the most from your disk drives. Note: For DOSes, include $2.00 for freight. DOSPLUS 3.5 $160.00 NEWDOS 80 VERSION 2.0 $185.00 (Specify Model I or Model Ill) (Specify Model I or Model Ill) DOSPLUS 3.5 is a powerful, sophisticated DOS intended for the Newdos 80 suits the experienced user who has already used experienced user. The system can be configured to suit your require­ TRSDOS, understands the manual and is prepared to learn the ments, provides greatly enhanced features over 3.4 and new somewhat complicated syntax of one of the most powerful DOS's features like single-key entry, date-stamping of files, a Help file and available. With the correct hardware, Newdos 80 supports any mix more. More user friendly than 3.4, DOSPLUS 3.5 comes with a of single- or double-sided, single or double density, 5" or 8" disk very extensive stand-alone manual. drives with track counts up to 96. It provides powerful, flexible file handling in BASICincluding variable length records up to 4096 bytes. BMON by Edwin Paay $20.50 Definitely not for the beginner. The ultimate High Memory Basic Monitor L2/16-48K BMON Renumbers; Displays BASIC programs on the screen while MASTER DISK DIRECTORY $20.95 they are still loading; tells you the memory locations of the program FIND THE PROGRAM FAST !! PAYS FOR ITSELF BY RELEASING just loaded; lets you stop a load part-way through; merges two pro­ REDUNDANT DISK SPACE!! MASTER DIRECTORY records the grams, with automatic renumbering of the second so as to prevent directories of all your individual disks onto one directory disk. Then any clashes of line numbers; recovers your program even though it allows you examine them, find an individual file quickly, list files you did type NEW; makes one program invisible while you work alphabetically, weed out redundant files, identify disks with free on a second (saves hours of cassette time!); lists all the variables space, list files by extension, etc., etc. This program is invaluable used in the program; makes SYSTEM tapes; lets you Edit memory for the serious disk user and will pay for itself many times over. Not directly ... the list goes on and on. Cassette comes with 16K, 32K fully compatible with NEWDOS 80. and 48K versions, ready to load. Can anyone afford NOT to have BMON? THE FLOPPY DOCTOR/MEMORY DIAGNOSTIC Model Ill Disk $43.50 THE MICRO CLINIC offers two programs designed to thoroughly check out the two most trouble-prone sections of the TRS-80 - the disk system (controller and drives) and the memory arrays. Both programs are written in Z80 machine code and are supplied together on diskette for a minimum 32K, one disk system.

E

For Ta ndy Colour Computers with at least 16K of memory, choose from the following selection: SPACE FIGHTER $20.95 RACING DRIVER $23.50 You are out in space, armed with laser beams and your mission is Yo u drive along able to see only the road in front of you, leaving to shoot down five enemy fighters. Skill is required to keep your little time to avoid obstacles and hazards that you meet in your path. enemy in your sights to destroy them. �equires 16K Extended Col­ Featuring three levels of skill, colour and sound. Requires 16K Ex­ our BASIC. tended Colour BASIC. ESCAPE FROM MARS $20.95 A good first adventure that takes place on Mars where you have HAUNTED HOUSE $20.95 to explore the city and deal with the possibility of hostile aliens. A real adventure for the kids, with ghosts and goblins, treasures and problems. BREAKAWAY $20.95 Written in machine language for speed and features 15 levels of difficulty. TREK ADVENTURE $20.95 Yo u are in deep trouble aboard a starship abandoned by its crew. QUEST $25.50 An adventure played on a map of Alesia generated by your com­ puter. You must gather men and supplies by combat, exploration, PYRAMID $20.95 trading, etc. When your force is strong enough, you attack the citadel An exciting and challenging adventure where you hunt for treasure in a battle to the finish. in a pyrammid full of problems. MICR0-80 PRODUCTS CAT S

I I

Fe atures: • 80 cps bi-directional, logic seeking

• 40, 71, 80 or 142 characters per line

• Normal and italic alphanumeric, symbol and semi-graphic characters

• Unidirectional bit image graphics (8 x 640 or 8 x 1280 dot/line)

• Tractor and friction feed EPS compat le con ol codes

I

We are expanding our range of disk drives to include the new

These half-height, 51/4"disk drives represent the state of the art in both technological design and mechanical construction. With the characteric high quality of manufacture expected in Japanese products, these drives feature ultra-modern electronics, servo­ controlled direct drive motors and exceptional physical construction that provide extremely reliable, smooth and quiet operation in both single and double density. Tw o varieties will be available shortly: 40 track double sided and 80 track double sided. Please WRITE for further information.

OTHER PRINTERS AVAILABLE: EPSON RX-80 $995 Features: 100 cps, 6 character sizes, bit image and graphic modes. ITOH PROWRITER 8510 $1150 Features: 120 cps, bit graphics and proportional printing. EPSON FX-80 $1399 Features: 160 cps, 6 character sizes, proportional printing, bit graphics.

All prices include Sales Tax and are correct at time of publication but are subject to change without notice . All equipment carries MICR0-80's Australia-wide 90 day warranty covering parts and labour. Add $10 road freight anywhere in Australia. VOLUME 4, NO . 2 (SEPTEMBER, 1983) MICR0-80 PAGE 19

mul ti pl ies them, converts thi s value into a string val ue, and puts it in the array . Lines 330, 390 and 420 prevent inappropri ate: data enteri ng the matrix. Line 330 a 1 so assi gns a val ue in I(N) to each row of the stri ng matri x. Thi s array is used later when orde ring the data.

Li nes 450 to 570 echo the data (using lines 680 to 760) and a 11ow 1 i nes to be added or changed , and are quite strai ghtforward .

Perhaps the most important part of the program is found in 1 i nes 770 to 840 which arranges the values in descending order . Vari abl e T sets the val ues to be compared in line 800 , but it is not these va 1 ues which are transposed in line 810. The va 1 ues in the I(N) array are transposed instead . And the di sp 1 ay subroutine of ·1 i nes 680 to 760 pri nts the rows of data correspondi ng to the new order of I(N) .

Li nes 850 to 940 are a Screenpri nt subroutine. LN is used as a 1 i necounter si nee the 1 i nepri nter counts only one line for a ful l scan of the screen . Li nes 950 to 970 are a pagination subroutine, with the val ues set for A4 size pages .

Li nes 980 to 1050 are NOT used in the usual running of the program . They are used only when deve 1 oping and testing the program to avoi d havi ng to enter data by hand . They are called by line 320 which should be del eted when the program has been debugged .

- 0000000000 -

**** TOWERS OF HANOI **** 300 PR I NT;J>416, "FROM PEG" ;:INPUT F COLOUR COMPUTER 310 PRI NT@430, "TO PEG " ;::I N PUT T 320 IF F< 1 OR T< 1 OR F>3 OR T>3 THEN PRINT"NO SUCH PEG" : GOTO 290 10 'THE TOWERS OF HANO I 330 IF F=T THEN PR INT"NOT ALLOWE 20 ' BY D" : GOTO 290 30 ' MICHAEL BYRNE 340 IF N <=O THEN PRINT"THERE MODIFIED FOR THE COLOR ARE NO DISCS ON PEG ";F: GOT0290 COMPUTER BY MICR0-80 350 I=N :J=N 40 CLEAR 93 360 ON F GOTO 370 ,400 , 420 50 CL S : GOSUB 1430 : GOSUB 1510: :370 T1=P1 :ELSE T2 60 DIM N<3> ,P1 �P2 ,P3 390 GOTO 430 70 SC=1 : AL=2::DN=3:CT=O:P1 (0) =99: 400 T1=P2CI> :IF T=1 THEN T2=P1 :IF T=2 THEN T2=P2 CJ WANT" ;CT ):ELSE T2=P1 100 IF CT > MAX THEN PR INT"MAX IMU 430 IF T1 >T2 THEN PR INT"NOT ALLO M NUMBER IS 8" : GOT090 WED" : GOT0290 110 IF CT< =O THEN PRINT"SORRY , 440 SP=SP+2:SKCSP-1 )=F:SK=T THAT 'S NOT POSS I BLE ":GOTO 90 450 GOSUB 580 120 IF CT<=3 THEN PR INT"YOU HAVE 460 IF NC1)=0 AND N(2) =0 AND N<3 NO SENSE OF ADVENTURE BUT I SU >=CT THEN GOTO 470 : ELSE GOTO 290 PPOSE YOU HAVE TO START SOMEWHER 470 M=2ACT- 1: PR I NT:i>416� " E" ":PRINT@ 130 N<1>=CT :N<2>=0::N (3) =0 416, ""; 140 INPUT " AUTOMAT IC OR MANUAL ";MODE$ AT I ONS ! YOU DID IT" ELSE IF NM-M 150 IF MODE$< >"A" GOTO 270 <=M*0. 15 THEN PR INT"NOT BAD AT A 160 PR INT"HOW FAST " ::: INPUT " CO IS LL" FASTEST , 10 IS SLOWEST> ";S 490 PRINT"YOU TRANSFERRED ALL TH 170 CLS : GOSUB1 150 E DISCS IN ";NM; " MOVES 180 GOSUB530 :SP=4 500 PR INT"CARE FOR ANOTHER GAME " 190 SK =SC: SKK < :PRINT" "; SP-1 > =DN: SK =AL 510 INPUT AN$ 200 B=SP :: SP=SP+4 520 IF AN$="N" OR AN$="NO"THEN C 210 SK =SK :SK =SK LS: POKE359 ,126 : END ELSE GOT080 ::SK =SK :SK=SK 530 J=CT 540 FOR I=1 TO CT 220 IF CT< >1 THEN GOTO 250 550 P1 =J:J=J -1:NEXT I 230 SP=SP+2:SK=1:SK =3: 560 RETURN GOSUB 580 570 'SHIFT DISCS 240 GOT0260 580 NM=NM+1 : SE=SK :DE=SK :Y=23- 280 GOSUB 530 610 IF SE< >1 THEN 630 290 PR INT@416, " 620 TD=P 1 : X=10: GOTO 660 II u ' 630 IF SE< >2 THEN 650 1180 NEXT I 1570 PRINT"THERE ARE THREE PEGS 640 TD=P2 : X=32 : GOTO 660 1190 FORI=1376T01407 : POKE 1, 191 : ON ONE OFTHESE IS ARRANGED , I < 0 650 TD=P3 :X=52 NEXT I N ORDER OF-DECREAS ING SIZE, A N r c 660 P=2 ::: SIZE=TD 1200 PRINT:PRINT" 1 UMBER OF DISCS m THE OBJECT IS 3: 1"11 6"70 GOSUB 1320 2 3" TO MOVE ALLTHE DISCS FROM THE L .p. 680 I=N +1 : Y=23·- 1210 V=21 :X=10 EFT MOST PEG <1> TO THE RIGHT MO

690 IF DE< >1 THEN 710 1220 FOR I=CT TO 1 STEP -1 ST PEG (3) ." :z 700 P1 =TD: X=10: GOTO 740 1230 FOR J=1 TO I 1580 PRINT"SUBJECT TO THE FOLLOW 0 710 IF DE< >2 THEN 730 1240 SOUND 10*I ,1 ING" N 720 P2 =TD: X=32 : GOTO 740 1250 SET :SET < X-J-1,Y, I> 1590 PR INT"Cot4STRAINTS ::-":PRINT 730 P3 =TD: X=52 :SET :SET 1600 60SUB 1870 : CLS til 1"11 740 P= i 1260 SET :SET < X+J+1 ,Y, 1610 PR INT"!. ONLY 1 DISC MAY B -o -l 750 GOSUB 1320 I> :SET < X+J+1 ,Y-1 ,I>:SET < X+J+2,Y- E MOVED AT A TIME" 1"11 3: 760 N=N 1620 PR INT"2. A DISC MAY NOT BE c::o 770 N=N+1 1270 NEXT J PLACED ON TOP OF A DISC WH IC ("T'j ;;c 780 SP=SP-2 1280 V=Y-2 H IS SMALLER " 790 PR I NT�20, "MOVE ";NM; 1290 NEXT I 1630 GOSUB 1870 1.0 BOO RETURN 1300 RETURN 1640 PRINT@10, "PLAY IN6 HANOI" co w 810 �HANOI 1310 'SWITCH PROCEDURE 1650 PR INT@42 , "------":PR 820 IF SK >2 THEN GOTO 830 1320 IF P=2 THEN 1390 INT ELSE GOTO 1000 1330 FOR J=1 TO SIZE 1660 PR INT"THERE ARE TWO MODES 830 B=SP : SP=SP+4 1340 C=SIZE OF PLAY . THESE ARE UTOMATI 840 SK =SK -1 1350 SOUND 10*C, 1 C AND ANUAL AND YOU WIL

850 SK =SK 1360 SET :SET < X-J -1 ,Y- L BE ASKED TO SELECT ONE a '., " 860 SK =SK 1,C>:SET < X+J+1 ,V,C> :SET < X+J+1 �Y- 1670 PR INT"AUTOMAT IC OPERAT ION" 870 SK =SK 1,C> :SET

880 GOSUB 810 1,C> :SET :SET < X+J+2, Y, C ) YOU HOW MANY DISCS YOU WOULD 3: 1--1 890 B=SP: SP=SP+2 1370 NEXT J LIKE MOVED AND HOW FAST YOU WOUL n 900 SK =SK 1380 GOTO 1420 LIKE THEMMOVED. IT WILL THEN P ;;c D 0 9 10 SK =SK 1390 FOR J=l TO SIZE ROCEED TO TRANSFER THE DISCS FR I co 920 GOSUB 580 1400 RESET :RESET :RESET =SK -1 Y- l ):RESET :RESET =SK Y- 1 ):RESET :RESET 1710 PR INT@42 ,"------":PR 960 SK =SK 1410 NEXT J INT 970 SK =SK 1420 RETURN 1720 PR INT"MANUAL OPERAT ION" 980 GOSUB 810 1430 DS= STR I NGS <32, "*") 1730 PRINT"HERE YOU WILL BE ASKE 990 GOTO 1120 1440 PR INT�12B, DS D HOW MANY DISCS YOU WOULD LIKE 1000 B=SP : SP=SP+2 1450 PRINT DS :PRINT TO MOVE . THEN YOU WILL BE PROM 1010 SK =SK 1460 PR I NT�231, "T HE T 0 W PTED TO " ; 1020 SK =SK E R S" 1740 PRINT" TYPE THE NUMBER OF T 1030 GOSUB 580 1470 PRI NT�265,"0 F HAN0 I HE PEG THE DISC IS TO BE TAKEN 1040 B=SP : SP=SP+2 ":PRINT OFF AND THE NUMBER THE PEG THE D 1050 SK =SK 1480 PR INT DS ISC IS TO BEPLACED ON . " 1060 SK =SK 1490 PR INT DS 1750 PRINT"WHEN YOU HAVE SUCCESS 1070 GOSUB 580 1500 RETURN FULLY TRAN-SFERRED ALL DISCS YOU 1080 B=SP : SP=SP+2 1510 POKE359 ,57:SCREEN0 ,1:60SUB1 WILL BE TOLD HOW MANY MOVES Y 1090 SK =SK 900 : FORI=l TO 1000:NEXT I OU TOOK " 1100 SK =SK 1520 PRI NT�449, "INSTRUCT IONS "; : INPUT AN$ 1770 PRINT@lO, "SUGGEST ION" 1120 SP=SP-4 1530 IF ANS< >"Y" AND ANS< >"YES 1780 PRI NT�42, "------" : PR INT 1130 RETURN " THEN RETURN 1790 PRINT" IF YOU ARE UNSURE OF -o ::t= 1140 �DRAWPEGS 1540 CLS THE GAME TRY AUTOMAT IC OPERAT Ci) 1"11 1150 CLS :REM � PROC DRAWPEGS 1550 PRINT@lO,"INSTRUCT IONS" ION WITH ABOUT FOUR DISCS AND N 1160 FOR I=1 TO 8 1560 PRINT@42," ------":PRI LOW SPEED (E. G. 10) . THEN SIT 0 1170 POKE1093+l$32, 191: POKE1104+ NT BACK AND LETTHE COMPUTER DO ALL I*32 , 191:POKE11 14+I$32, 191 THE WORK " 1800 PR INT"AFTER ALL THAT IS WHA 120 FORX=22T041 :SET :SET :SET :SE 350 IFC=5 THEN SETELSE RE 0 r UB1870: CLS T<23, Y,3> :SET <22,Y,3) :SET <40,Y ,3 SET :RESET :SET <41,Y,3> :Y=Y+1: NEXT 1>:RESET =0C THEN370EL � OF MOVES REQUI RED IS GIVEN BY ,Y,6> :NEXT SE440 : - " 140 NEXT z 370 M=Y 0 1820 PR INT"M = 2 ...... N- 1" 150 Z=49 380 M=M-2: IFM<6 OR POINT=6 1830 PR INT"SO FOR 3 DISCS THAT' S 160 FORX=1 131+32T01 131+64+192STE THEN440 N 7 MOVES , 4 DISCS 15 MOVES UP T P32 390 IF POINT=C THEN400 ELSE (/') 0 THE MAX ' OF 8 DISCS WH ICH REQU 170 POKEX- 1,Z:POKEX+10, Z: Z=Z+1:N 380 1"1"1 IRES 255 MOVES. ":PRINT -o EXT 400 M=Y -; 1840 PRINT" HAVE FUN�" 1"1"1 180 Z=49 410 M=M-2: SOUND252, 1: I F POINT =C THEN440 1"1"1 1860 RETURN X,Z:POKEX+352, Z: Z=Z+1 : NEXT 420 IF C=5 THENGOSUB790ELSEGOSUB ;::J:l 1870 PR I NT�480, " PRESS W 200 CL$=CHR$ (128>+CHR$ (128> +CHR$ 800:: GOT04 10 HEN READY" ; <128 ) +CHR$ (128) +CHR$ (128) +CHR$ (1 430 60T04 10 1.0 00 1880 INPUT DS : CLS 28) +CHR$ (128 > +CHR$ (128> : CL$=CL$+ 440 IF POINT =0C THEN450EL w 1890 RETURN CL$+CL$+CL$ SE520 1900 FORX=1024T01055: POKEX ,191:P 210 SET <30, 15,5> :RESET <32, 14> :RE 450 M=Y OKEX+480, 191:NEXTX:FORY=OT016: PO SET <33, 14) :RESET <32, 15> :RESET <33 460 M=M+2 :IFM>23 OR POINT=6 KE 1024+Y*32, 191 :POKE1 055+Y*32, 19 , 15) THEN520 1:NEXTY 220 RESET <30, 16> :RESET<3 1,1 6> :RE 470 IF POINT=C THEN480ELSE4 1940 RETURN SET <30, 17> :RESET<3 1,1 7> :SET <32, 1 60 7,5> 480 M=Y 230 PR I NT�448 ,CL$; 490 M=M+2 : SOUND251 , 1:I F POINT =C THEN520 ...... **** OTHELLO **** PUT"WHITE'S TURN" ;A,B:C=S: OC=O ('"') 500 IFC=5 THENGOSUB790ELSEGOSUB8 ;::J:l 250 PR I NT@448,CL$ ; 00 : 60T0490 0 I COLOUR COMPUTER 260 IF GH=2 THENPRI NT�44B, "";:IN 510 GOT0490 00 0 PUT " BLACK"S TURN";A,B: C=O : OC=5 520 IF PO INT =OC THEN530EL 270 IFA< 1 ORA>8 OR B< 1 OR B>8 TH SE600 10 , ******************** ENPR INT@448, " INVAL ID MOVE"; :FORE 530 N=X * S. GIBBONS * =1T01000 : NEXT: GOT0230 540 N=N-2: IFN< 23 OR POINT =6 * 34 THE COMENARRA * 280 GH=GH+1:IFGH >2THENGH= 1 THEN600 *PARKWAY ,THORNLEIGH* 290 X=2* - 1:Y=2* =C THEN560ELSE5 * N. s.w . 2120 * 300 IF POINT=5 OR POINT=O THENPR I NT@448 ,"INVAL ID MOVE" 560 N=X 20 CLS ;:FORE= 1T01000: NEXT: IF C=O THEN 570 N=N-2:SOUND253, 1: IFPOINT =C THEN600 RINT:PRINT: PRINT 310 IF POINT =5 OR POINT 580 IFC=5THENSET :SET =0 Y, 5> :SET :SET EXT OR POINT =5 OR PO INT :RESET :RESE 50 PR INT"OO YOU NEED INSTRUCT ION ,Y-2> =0 OR PO INT =5 THEN T:RESET =5 600 IFPOINT =OC THEN610 EL 60 I$=INKEY$: IFI$="Y"THENGOT0 126 OR PO INT =0 OR PO INT =O OR POINT =5 OR POIN 610 N=X 70 60T060 T=O OR PO INT =5 OR 620 N=N+1 : IFN>40 OR POINT =6 80 CLSO PO INT =5 OR POINT =0 THEN680 90 6H=2 OR PO INT=0 OR POINT =C THEN640ELSE6 -o 100 POKE 1036, 15:POKE 1 037 ,20: POKE 2> =5 THEN780 20 )::a Ci) 1038,8: POKE 1039,5: POKE 1040, 12:PO 330 PR I NT@448, "INVALID MOVE";:FO 640 N=X 1"1"1 KE 1041, 12: POKE1042, 15 RE=1T01000: NEXT: IFGH=2THENGH= 1:6 650 N=N+2: SOUND254, 1:IFPOINT =C THEN680 660 IF C=5 THENSET :SET =0C THEN10 1320 GOSUB 1640 < 0 1,Y,5> :SET T I - c:: 5>ELSERESET :RESET :RE 1020 N= X:M=Y 0 CONT INUE ." 3: 1"11 SET 23 OR N>40 1340 GOSUB 1640 670 GOT0650 OR PO INT =6 THEN 1090 1350 I$=INKEY$: IFI$=" "THEN 1 360E +::> 680 IF POINT =0C THEN 69 1040 IF POINT =C THEN 1 050ELS LSE 1 350 z OELSE760 E1030 1360 GOSUB1650 : CLS 0 690 N=X:M=Y 1050 N=X : M=Y 1370 PR INT" OTHELLO" N 700 N=N+2: M=M-2:IF M< 6 OR N>40 0 1060 M=M+2:N=N+2 : SOUND248, 1:IFPO :PRINT R PO INT =6 THEN 760 INT =C THEN 1090 1380 GOSUB 1640 U'l 1"11 710 IFPOINT =C THEN720ELSE70 1070 IF C=5 THENGOSUB810ELSEGOSU 1390 PR INT"BLACK ALWAYS STARTS F ""0 0 ----1 B820 IRST . " 1"11 720 N=X : M=Y 1080 GOT01060 3: 1400 PR INT"A MOVE CONSISTS OF "0 co 730 N=N+2:M=M-2: SOUND255, 1:IFPOI 1090 IF POINT =0C THEN11 UTFLANK ING" YOUR OPPONENTS DISC =C THEN760 OOELSE 1170 > THEN FL IPPING THE OUTFLANK 740 IF C=5 THENSET :SET OVER TO YOUR COLOUR ( 1.0 1,M,5> :SET 23 WH ICH THE COMPUTER DOES FOR YOU co II w 5> ELSERESET :RESET :RE OR POINT =6 THEN1 170 ) • SET :RESET 1120 IF POINT =C THEN11 30ELS 1410 GOSUB1640 750 GOT0730 E1 110 1420 PR INT 760 GOSUB930 1130 N=X:M=Y 1430 PR INT"TO PLACE A DISC GIVE 770 GOT0830 1140 M=M+2 :N=N-2:SOUND247, 1:IFPO THE "X" COORD INATE FOLLOWED B 780 GOT0350 INT =C THEN1170 Y A COMMA ",� THEN THE "Y" COOR 790 SET :SET :SET < 1150 IF C=5 THENGOSUB810ELSEGOSU DINATE. " X,M+1 ,5>:SET :RETURN B820 1440 GOSUB1640 - 1160 GOT01 140 800 RESET :RESET :RESE 1450 PR I NT;(i)448, "HIT T 3: - 1170 � 1-f T:RESET :RETURN 0 CONT INUE " ("'") 810 SET :SET :SET < 1180 RETURN 1460 GOSUB 1640 :::0 0 N,M+1,5) :SET :RETURN 1190 PRI NT:G)448, ""; 1470 I$=INKEY$: IFI$=" "THEN1 480E I co 820 RESET :RESET :RESE 1200 IFBLS>WHS THENPR INT"BLACK W LSE 1470 0 T:RESET :RETURN INS BY ";BLS-WHS; "POINTS. "; 1480 GOSUB 1650:CLS : PR INT" 830 WHS=O:BLS=O: SP=O 1210 PRINT"WHITE WINS BY";WHS-BL OTHELLO" :PRINT 840 FORX=22T040STEP2 : FORY=8T024S S; "POINTS . "; 1490 GOSUB1640 TEP2 1220 FORE= 1 T04000 :NEXT:PRINT;(i)448 1500 PRINT"TO OUTFLANK MEANS TO 850 IFPOINT =O THENBLS=BLS+ 1 ,CL$; PLACE A DISC SO THAT YOUR OPP 860 IF POINT=6 THENSP=SP+1 1230 PR I NT@448, "ANOTHER GAME?? "; ONENTS ROW OF DISC IS BORDERE 870 IFPOINT =5 THENWHS=WHS+1 1240 I$=INKEY$: IFI$="Y"THENRUN D AT EACH END BY A DISC OF YOUR 880 NEXT: NEXT 1250 IFI$="N"THENENDELSE1 240 COLOUR ." 890 PR I NT:G)32+21, "WHITE: ";WHS; 1260 CLS 1510 GOSUB1640 900 PR I NT;(i)64+21, "BLACK: ";BLS; 1270 PRINT" OTHELLO" 1520 PRINT"A DISC MAY OUTFLANK I 910 IF SP=O THEN1190 1280 GOSUB 1640 N ANY DIRECT ION: HORAZONTAL 920 GOT0230 1290 PR INT: PRINT"OTHELLO IS A GA LY , VERTI CALLY OR DIAGONA 930 IF POINT =0C THEN940 ME OF STRATEGY FOR TWO PLAYERS LLY. " ELSE1010 • IT CONSISTS OF 64 DOUBLE SIDED 1530 GOSUB 1640 940 N=X : M=Y DISCS W 1540 PRINT"A DISC MAY OUTFLANK I 950 M=M-2:N=N-2: IFM<6 OR N<23 OR HICH ARE BLACK ON ONE SIDE AND N ANY NUMBER OF DIRECTO INS POINT =2 THEN1010 WH ITE ON THE OTHER. " AT THE SAMET IME. A DISC CAN ONLY 960 IF POINT =C THEN970ELSE9 1300 GOSUB 1640 BE PLACED ONE SQUARE AWAY FROM 50 1310 PR INT"EACH PLAYER CHOOSES H ANY DISC INANY DIRECT ION FROM TH 970 N=X : M=Y IS COLOUR BLACK OR WHITE WHICH E DISC . " 980 M=M-2:N=N-2: SOUND249, 1:IFPOI IS HIS COLOUR THROUGHOUT THE 15'50 GOSUB1640 ""0

NT =C THEN1010 GAME . THE GAME STARTS WITH 1560 D$=" •••••••••••••HIT FOR GAME OR FOR INS N B820 EACH EACH COLOUR CROSS ING TRUCT IONS AGAIN•••••••••• ••••••• N 1000 GOT0980 EACH OTHER. " 1570 FORZ=1TOLEN (D$) 230 B=SP : SP=SP+4 600 �======SH IFT DISCS < 1580 I$=INKEY$ 240 SK =SK :SK=SK :SK 610 NM=NM+1 : SE=SK :DE=SK 0 r 1590 PR I NT@448+10,MID$(D$, Z, 11) =SK :SK =SK 620 FOR I=1 TO 30*S: NEXT I c:: - - 3: 1600 IFI$=" "THENGOSUB1650: CLS:G 250 IF CT< >1 THEN GOTO 280 630 I=N :Y=16 rr1 OT080 260 SP=SP+2 :SK=1:SK =3: GOSUB 61 640 IF SE< >1 THEN 660 +=> 1610 IFI$=CHR$ <13> THENGOSUB1650: 0 650 TD=P 1 :X=17:GOTO 690 CLS : GOT0 1260 270 GOT0290 660 IF SE< >2 THEN 680 2 0 1620 FORE= 1T0100:NEXT 280 GOSUB 840 670 TD=P2: X=40 : GOTO 690 1630 NEXT: GOT0 1570 290 LOCATE7, 16: PRINT" ";:GOT0530 680 TD=P3 CI>: X=65 N 1640 FORE=255T01 STEP-20: SOUNDE, 1 300 CLS: GOSUB 1180 : S=O 690 P=2:SIZE=TD (./') : NEXT: RETURN 310 GOSUB 560 700 GOSUB 1360 rr1 710 I=N +1:Y=16- CI- 1> -o 1650 FORE= 1 T0255STEP20: SOUNDE ,1: 320 LOCATE7, 18:PRINT" -; .. . PR INT: NEXT: RETURN ' 720 IF DE< >1 THEN 740 rr1 3: 330 LOCATE7 ,18: PRINT"FROM PEG" ;:INPUT F 730 P1 =TD : X=17:GOTO 770 OJ rr1 340 LOCATE35, 18:PRINT"TO PEG" ;:INPUT T:L 740 IF DE< >2 THEN 760 A:! OCATE0, 19:PRINT" 750 P2 =TD: X=40 : GOTO 770

":LOCATE0, 19 760 P3 =TD: X=65 \.0 CX) **** TOWERS OF HANOI **** 350 IF F< 1 OR T< 1 OR F>3 OR T>3 THENPR IN 770 P= 1 w T"NO SUCH PEG ":GOTO 780 GOSUB 1360 HITACHI PEACH 320 790 N=NCSE> -1 360 IF F=T THENPR INT"NOT ALLOWED 800 NCDE >=N+1 ":GOTO 320 810 SP=SP-2 10 � THE TOWERS OF HANOI 370 IF NCF> <=OTHENPR INT"THERE ARE NO DIS 820 LOCATE30 ,3: PR INT"MOVE ";NM 20 � BY CS ON PEG ";F: GOT0320 830 RETURN 30 � MICHAEL BYRNE 380 I=NCF> :J=N 840 �======HANOI 50 � CANBERRA CITY 400 T1=P1 >2 THEN GOTO 860 ELSE GOT 3: 1-1 60 � A.C. T. 2601 410 IF T=2 THEN T2=P2 CJ> :ELSE T2=P3 0 1030 ("'") A:! 70 CLEAR 93 420 GOTO 460 860 B=SP : SP=SP+4 0 I 80 CLS: GOSUB 1450: GOSUB 1530:MAX=10:SCRE 430 T1=P2:IF T=1 THEN T2=P 1 :ELSE T 870 SK =SK -1 CX) 0 EN0 , ,1 2=P3 CJ> 880 SK CSP-2> =SK 90 DIM N<3> ,P1 ,P2 ,P3 ,SK<1 440 GOTO 460 890 SK =SK O*MAX> 450 T1=P3CI>:IF T=2 THEN T2=P2 :ELSE T 900 SK =SK 100 SC=1 : AL=2 :DN=3: CT=O:P1 <0>=99:P2 C0> =9 2=P1 910 GOSUB 840 9: P3<0>=99 460 IF T1>T2 THENPRINT"NOT ALLOWED 920 B=SP: SP=SP+2 110 NM=O:J=O: I=O:SP=O:B=O: CLS ":GOT0320 930 SK =SK 120 INPUT " HOW MANY DISCS WOULD YOU LIKE" 470 SP=SP+2:SK CSP- 1>=F: SKCSP> =T 940 SK =SK ;CT 480 GOSUB 610 950 GOSUB 610 130 IF CT >MAX THEN PR INT"THAT WILL TAKE 490 IF N<1>=0 AND N<2>=0 AND N<3> =CT THE 960 B=SP : SP=SP+4 SOME TIME AND FIRST YOU WILLHAVE TO CHA N GOTO 500: ELSE GOTO 320 970 SK =SK - 1 NGE LINE 10" :END 500 M=2..... CT - 1:LOCATE7, 18:PRINT" 980 SK =SK 140 IF CT<=O THEN PR INT"SORRY , THAT�s NO ":LOCAT 990 SK =SK T POSSIBLE": GOTO 120 E7 , 18:PRINT" "; 1000 SK =SK 150 IF CT<=3THEN PR INT"YOU HAVE NO SENSE 510 LOCATE1 ,19: IF NM=M THENPR INT"CONGRAT 1010 GOSUB 840 OF ADVENTURE - BUT I SUPPOSEYOU HAVE TO ULAT IONS � YOU DID IT" ELSE IF NM-M<=M*0- 1020 GOTO 1150 START SOMEWHERE" 15 THENPR INT"NOT BAD AT ALL" 1030 B=SP: SP=SP+2 160 N<1>=CT : N<2>=0: N<3> =0 520 LOCATE1,20: PRINT"YOU TRANSFERRED ALL 1040 SK =SK CB-2> 170 PR INT:PRINT"AUTOMAT IC OR MANUAL =SK R M> "; :GOSUB2050 530 LOCATE1,21:PRINT"CARE FOR ANOTHER GA 1060 GOSUB 610 180 IF IN$( )"A" GOTO 300 ME "; 1070 B=SP: SP=SP+2 190 PRINT: INPUT" HOW FAST =SK -o 10 IS SLOWEST> ";S 550 IF AN$= "N" THEN CLS: END ELSE GOT01 10 1090 SK CSP> =SK )::a G') 200 CLS: GOSUB1180 560 J=CT 1100 GOSUB 610 rr1

210 GOSUB560 :SP=4 570 FOR I=1 TO CT 1110 B=SP: SP=SP+2 N 220 SK =SC:SKK =DN 580 P1 =J:J=J - 1:NEXT I 1120 SK =SK w :SK =AL 590 RETURN 1130 SK =SK 1140 GOSUB 610 1590 PR INT" THERE ARE THREE PEGS. ON 1930 PR INT"IS WHAT IT IS THERE FOR. ":PRI < 1150 SP=SP-4 ONE OF THESE IS ARRANGED, NT 0 I 1160 RETURN 1600 PR INT"IN ORDER OF DECREAS ING SIZE, 1940 PR INT" FOR A GIVEN NUMBER OF DIS c:: ======DRAWPEGS 3: 1170 ' A NUMBER OF DISCS. ":PRINT CS , N, THE SMALLEST NUMBER OF " I"T1 1180 CLS: ' PROC DRAWPEGS 1610 PR INT" THE OB�ECT IS TO MOVE ALL 1950 PR INT"MOVES REQUIRED IS GIVEN BY • ..j::> 1190 LOCATE7,6:PRINT"";:A$=CHR$ (142> +CHR THE DISCS FROM THE LEFTMOST " $ ( 142) +CHR$ ( 142) 1620 PR INT"PEG (1) TO THE RIGHTMOST PEG 1960 PR INT" M = 2[N-1 :z 0 1200 FOR I=1 TO 10 <3> , SUB�ECT TO THE FOLLOW ING" 1970 PR INT"SO FOR 3 DISCS THAT' S 7 MOVES 1210 LOCATE7 ,6+I: PR INT" ";A$; " 1630 PR INT"CONSTRA INTS : - ":PRINT , 4 DISCS 15 MOVES UP TO" N ";A$; " 1640 PR INT" L ONLY ONE DISC MAY BE M 1980 PR INT"THE MAXIMUM OF 10 DISCS WH ICH (./) ";A$ OVED AT A TIME" REQU IRES 1023 MOVES. ":PRINT I"T1 1220 NEXT I 1650 PR INT" 2. A DISC MAY NOT BE PLAC -o 1990 PR INT" HAVE FUN� " -i II 1230 PR INT" ; ED ON TOP OF A DISC WH ICH" I"T1 2000 GOSUB 2020 3: 1240 FOR I=1 TO 25: PR INT A$ ; :NEXT I 1660 PR INT"IS SMALLER" OJ 20 10 RETURN I"T1 1250 PR INT: LOCATE7 ,4 :PRINT" 1 1670 GOSUB 2020 2020 LOCATE7 ,18:PR INT"PRESS WHE :;:o 2 1680 LOCATE30 ,3: PRINT"PLAYING HANOI" N READY "; 3" 1690 LOCATE30,4:PRINT" ------":PRI 2030 INPUT D$ : CLS 1.0 1260 Y= 16: X=17 co NT 2040 RETURN w 1270 FOR I=CT TO 1 STEP -1 1700 PRINT" THERE ARE TWO MODES OF PL 2050 IN$= INKEY$:: IFIN$=" " THEN2050ELSE IN=V 1280 FOR �=1 TO I AY . THESE ARE UTOMAT IC" AL < IN$) : RETURN 1290 LOCATEX-�,Y: PRI NTCHR$ (142> ; 1710 PR INT"AND ANUAL AND YOU WILL BE 1300 LOCATEX+�+2 ,Y:PRINTCHR$ <142> ; ASKED TO SELECT ONE. ":PRINT 1310 NEXT � 1720 PR INT"AUTOMAT IC OPERATION" 1320 Y=Y- 1 1730 PR INT" THE COMPUTER WILL ASK YOU 1330 NEXT I HOW MANY DISCS YOU WOULD LIKE" **** REG I STER DISPLAY **** 1340 RETURN 1740 PR INT"MOVED AND HOW FAST YOU WOULD 1350 '======SWI TCH PROCEDURE 3: LIKE THEM MOVED . IT WILL" HITACH I PEACH ...... 1360 IF P=2 THEN 1410 1750 PR INT"THEN PROCEED TO TRANSFER THE ("'") :;:o 1370 FOR �=1 TO SIZE DISCS FROM PEG 1 TO PEG 3" 0 I 1380 LOCATEX-� ,Y:PRINTCHR$ <142> ;:LOCATEX 1760 PR INT"USING PEG 2 AS AN INTERMEDIAT 10 '******* REGI STER DISPLAY PROGRAM *** co 0 +� +2, Y: PRINTCHR$ (142> ; E. " **** 1390 NEXT � 1770 GOSUB 2020 20 , 1400 GOTO 1440 1780 LOCATE30,3: PR INT"PLAYING HANOI" 30 ,. 1410 FOR �=1 TO SIZE 1790 LOCATE30,4:PRINT " ------":PRI 40 'Program loads display rout ine in mac 1420 LOCATEX-�,Y: PRI NTCHR$ (32> ;:LOCATEX+ NT hine �+2,Y: PRI NTCHR$ <32> ; 1800 PR INT"MANUAL OPERAT ION" 50 'language format at sel ected locatio 1430 NEXT � 1810 PR INT" HERE YOU WILL BE ASKED HO n in 1440 RETURN W MANY DISCS YOU WOULD LIKE" 60 "User RAM or a defaul t location at 1450 D$=STRING$ (63, "*"> 1820 PR INT"TO MOVE . THEN YOU WILL BE PR 6F90 1460 LOCATE7 ,7: PR I NTD$ OMPTED TO TYPE THE NUMBER OF" 70 "(top of User RAM> . 1470 LOCATE7 ,8: PR INT D$: PR INT 1830 PR INT"THE PEG THE DISC IS TO BE TAK 80 , 1480 LOCATE25, 10:PRINT"T HE T 0 WE EN OFF AND THE NUMBER OF THE " 90 'The program runs af ter loading and g R S" 1840 PR INT"PEG THE DISC IS TO BE PLACED ives 1490 LOCATE27, 11:PRINT"O F HAN0 I" ON . WHEN YOU HAVE SUCCESSFULLY" 100 "a sample display. :PRINT 1850 PR INT"TRANSFERRED ALL DISCS YOU WIL 110 , 1500 LOCATE7, 13: PRINT D$ L BE TOLD HOW MANY MOVES" 120 SCREEN O, ,O:CLEAR 300 , &H6FOO 1510 LOCATE7,14: PRINT D$ 1860 PR INT" IT TOOK. " 130 PR INT" I nsert RAM store location :xxx 1520 RETURN 1870 GOSUB2020 x :or DEFT " 1530 FORI=1 TO 1000: NEXT I 1880 LOCATE30 ,3:PRINT"SUGGEST ION" 140 A$= I NPUT$ (4) 1540 LOCATE7, 17:PRINT"DO YOU WANT INSTRU 1890 LOCATE30 ,4:PRINT"------"::PRINT 150 IF A$= "DEFT " THEN A$= " &H6F90" ELSE A CT IONS ";: GOSUB2050:AN$=IN$ 1900 PRINT" IF YOU ARE UNSURE OF THE $="&H"+A$ -o 1550 IF AN$< >"Y" THEN RETURN GAME TRY AUTOMAT IC OPERAT ION" 160 POKE &H0107,VAL

1560 CLS 1910 PR INT"WITH ABOUT FOUR DISCS AND LOW 170 POKE &H0 108,VAL <"&H"+

1570 LOCATE30 ,3:PRINT" INSTRUCT IONS" SPEED T ALL THE WORK - AFTER ALL THAT" 190 READ B$ 200 POKE VAL (A$)+I,VAL <"&H"+B$> JSR )$DD32 210 NEXT I < BSR SPC2 TO 6FEC : 2 SPACES 0 r 220 DATA 86,7E,B7,01 ,06,3F,39,3F,BD,A4,4 LDA ,X c::: 0,3F,BD 3: BRA RDP2 TO 6FCC rrl 230 DATA DC,E6, 33,6C,349 40, 1F� 43,86, 53 � B SPC5 JSR >$B1 16 +=- D,E8, 20 JSR )$B1 16 240 DATA 8D,40,A6,CO,BD,DD,32,A6,CO, BD , D JSR )$B1 16 :z 0 D,32,BD SPC2 JSR )$B116 250 DATA BO ,BE,8E,DE,20,BD, DE,31,A6, CO, B JSR )$B1 16 N D,DD,32 RTS 260 DATA 8D , 1D,A6,84,81 ,5B,26,F0,81 ,45,2 (./) EX IT PULS u DISCARD SP rrl 7, 23,BD PULS ""0 CC , A, B,DP, X,Y,U,PC RESTORE REGS . AND SP -! 270 DATA DE , 31,A6,CO,BD,DD,32,A6,CO, BD, D END rrl 3: D,32,8D co rrl 280 DATA OA,A6,84,20,E9,BD,B 1 , 16,BD, B1 ,1 :::0 6,BD, B1

290 DATA 16, BD,B1 , 16,BD,B1 , 16,39,35,40,3 1.0 5,FF,OO co **** L2/ 16K DESERT CHASE **** w 300 EXEC VAL (A$)

310 END TRS-80/SYSTEM-80

ORG $6790 LDA #$7E INITIALISE SWI VECTOR IN C/W 10 REM ------WR I TTEN BY : ANDREW N. DOWNEY ------STA )$0106 BAS IC LINES 160 AND 170 20 CLS : RANDOM:PR INT@O,CHR$ <23> ;"PLEASE STAND BY :" SW I RETURN TO PROGRAM 30 CLEAR < 1300) : DIM C$ <51>: DEFI NTA-Z : GOSUB1000: R=RND < 100) +200 RTS 40 CLS: PRINTTAB <25> ;"DESERT CHASE ":PRINTTAB <25> ;"======" ;: SW I 3: PR I NT@256,"WOULD YOU LIKE INSTRUCTIONS"; ...... JSR )$A440 RETURN TO BASIC 50 K$= I NKEY$: IFK$=""THEN50ELSEIFK$="N"THEN120 (""') SWI :::0 60 PR INT@128, CHR$ <30> ; 0 JSR )$DCE6 RETURN TO MON I 70 PR INT" co LEAU 12,S CALCULATE OR IGINAL STACK POI NTER 0 WELCOME TO �DESERT CHASE �. THE OBJECT IS TO TRAVEL ACROSS THE PSHS u SAVE IT VAST SIMPSON DESERT . THE DISTANCE VAR IES BETWEEN 200 MILES & TFR s,u STACK PO INTER : S TO U 300 MILES. A LARGE TR IBE OF HOSTILE NAT I VES IS RUMORED TO BE LDA #$53 CHARACTER S IN EX I STENCE AND IS SURE TO CHASE YOU. " JSR )$E820 PR INT S 80 PR INT" BSR SPC2 2 SPACES YOU HAVE BEEN GIVEN A SINGLE HUMP CAMEL - CHARLES C. CAMEL - LDA ,U+ TO HELP YOU IN YOUR VENTURE ." JSR )$DD32 2 BYTES FROM STACK 90 PR INT" LDA ,U+ AND PR INT WHEN ASKED FOR COMMANDS THE CURSOR WILL FLASH, AT THIS POINT, JSR )$DD32 PRESS KEY CORRESPOND ING TO THE NUMBER REQU IRED. " JSR )$BOBE CR/LF 100 PR INT: PR INT"PRESS ANY KEY TO CONT INUE " LDX #$DE20 PO INT TO REGI STER HEAD INGS TABLE 110 K$= I NKEY$: IFK$=" "THEN1 10 RDP 1 JSR )$0E3 1 PR INT HEAD INGS AND SPACE 120 CLS: PR I NT@O, "D ESER T - CHASE LDA ,U+ C 0 M M A N D S : JSR )$DD32 1 BYTE FROM STACK AND PRINT #1 DR INK FROM WATERBAG BSR SPC5 TO 6FE3: 5 SPACES #2 CONTINUE SLOWLY LDA 'X #3 AHEAD FULL SPEED CMPA #$58 TEST FOR END OF 1 BYTE REGS . #4 REST FOR THE NIGHT BNE RDP 1 TO 6FBC #5 CHECK SUPPL IES RDP2 CMPA #$45 TESTS FOR END OF HEAD INGS #6 WA IT FOR HELP" BEQ EX IT TO 6FF3 AND EX IT 130 PR I NT@512, " JSR 1 ""0 >$DE3 PR I NTS REG . HEAD ING AND SPACE YOU HAVE RENEWED YOUR WATER SUPPLY AT NEARBY WATER-HOLE AND HAVE LOA ,U+ ONE LITRE OF WATER . THIS WILL LAST YOU SIX DR INKS . IF FOUND BY rrla:; JSR )$DD32 PR INTS 2 BYTES FROM STACK HELP THEY WILL GIVE YOU 1/2 LITRE . IF HELP DOES NOT FIND YOU N LOA CJ1 ,U+ AFTER COMMAND 6, --- YOU DIE --- !!!" 140 PRINT"THE MINISTRY OF THE INTER IOR AND I WISH YOU GOOD LUCK 520 INPUT "#B WA IT FOR PAYMENT --- SUB COMMAND ";X:IFX<70RX >BTHEN I I 111 < 500 0 I 150 GOSUB940 530 PR I NT�512, CHR$ (31>;:IFX=BTHEN570 c:: 3: 160 IFC >RTHEN630 540 X1=RND<10> : IFX1 <5THEN560 1"1"1 170 Z=Z-1:IFZ=1PRINT"------WARNING ------YOU NEED A DR IN 550 PR INT .. ... K. " CONGRATULAT IONS, YOU SUCCESSFULLY ESCAPED !!!" :Q=O: GOT0 160 180 IFZOTHEN5 10 C4=34 : GOSUB9BO: GOTOB40 200 IFP<4THEN250 570 X1=RND <100 ) : IFXl >24THEN590 N 210 C1=C1+X2: IFC1;" YOUR RANSOM HAS BEEN PAID AND YOU ARE FREE TO GO . ":Q=O : GOT0160 1"1"1 "'0 THE NAT I VES HAVE CAPTURED YOU . CAMEL AND PEOPLE SOUP IS" 590 PR INT" -1 230 PR INT''THEIR FAVORITE DISH� ! ! ! ": C4=7: GOSUB9BO : GOTO 840 1"1"1 THE LOCAL ELDERS ARE COLLECT ING ••• JUST WAIT ..... :FORD= 1T01000: 3: 240 PR INT .. THE NATI VES ARE";C-Cl ; .. MILES BEHIND YOU .. o::J NEXT 1"1"1 250 IF C=O THEN 260 ELSE PRINT�1 01,C; "DOWN _ .. ;R-C;"TO GO ... ; 600 A=RND<10> :IFA>2THEN650 :::0 260 IFT2< 1THENC4=10 610 PR I NT�S12, CHR$ (31); II

270 GOSUB9BO :GOSUB950:T2=1:PRI NT�3B, "ENTER YOUR COMMAND "; YOU HAVE ARR I VED AT A WATER-HOLE ••••YOUR CAMEL u;) co 280 Y$=I NKEY$: IFY$< >""THEN290ELSEPRINT�5B, CHR$ (140> ;:FORD=1T0100 EATS HAPP ILY WHILE YOU REF ILL YOUR WATER-BAG":C4= 13:GOSUB9BO :FOR w :NEXT: PRINT�5B,CHR$ <12B> ;:FORD=1T0100:NEXT: GOT0280 D= 1 T02500:NEXT: Z=4: S=6: RETURN 290 IF ASC : IFT< >1THEN740 DONE ! ! !"; 330 C4=37 : GOSUB980 : PR I NT�512, CHR$ < 31 > ; •• 640 PR INT�512, CHR$ (31); II

HELP HAS FOUND YOU IN A STATE OF UNCONSCIOUSNESS. ":S=3:: Z=4: GOT01 YOU WIN, A PARTY IS BEING GIVEN IN YOUR HONOR •••••••

60 ••.••••• THE NAT I VES ARE PLANNING TO ATTEND ••••••••": C4=2B: GOS 340 F=F+1: IFF=BTHEN620 3: UB9BO : GOTOB40 foo-l 350 GOSUB 480 C'i 650 X1=RND<100> : IFX1 >5THEN720 :::0 360 X1=RND <10> :C=C+X 1:C4=1:60SUB980 660 C4=19:GOSUB9BO:PRINT�167,C$ ;:PRINT�423� C$ (C4> ; 0 I 370 PRINT�512,CHR$ (31>; .. 670 PR I NT�51251 " co 0 YOUR CAMEL LIKES THIS PACE 11 : 60TO 160 YOU HAVE BEEN CAUGHT IN A SANDSTORM ••••GOOD LUCK!":FORD=1T01000: 380 F=F+3: IFF >7THEN620 NEXT 390 GOSUB 4BO: X1=2$RND <10> :C=C+X 1:C4=22: GOSUB980 680 X5=RND <100> : X6=RND <100 > :IF X6<50THEN7 10 400 PRINT�512, CHR$ <31> ;" 690 C=C+XS: GOT07 10 YOUR CAMEL IS BURNING ACROSS THE DESERT SANDS": PRINT:GOTO 160 700 C=C-X5 410 C4= 10:60SUB9BO:PRINT�512,CHR$(3 1>;" 710 PR INT"YOUR NEW POSITION IS ";C;" MILES SO FAR ! '' : FORD= 1T01500 YOUR CAMEL THANKS YOU ! .. :NEXT:PRINT� 167,STR ING$ (23, 131>;:PRINT�423,STRING$ <23, 176> ;:RETU 420 F=O : GOT0170 RN 430 PRINT" 720 Xl=RND<100> :IFX 1 >5RETURN yOUR CAMEL HAS "; 7-F; •• GOOD DAYS LEFT . " 730 C1=C1+1 : C4=25:: GOSUB9BO:PRI NT�5 12,CHR$ (31>; .. 440 PRINT"YOU HAVE .. ;S;" DRI NKS LEFT IN YOUR WATER-BAG ... YOUR CAMEL HURT HIS HUMP . 450 PRINT"YOU CAN GO ";Z; " COMMANDS WITHOUT DRINKING. ":GOT0170 LUCK ILY THE NATI VES WERE FOOTWEARY� !B.": FORD=1T01500:NEXT: RETURN 460 S=S- 1:C4=31: GOSUB9BO:IFS :PRINT .. 470 PRI NT�512, " YOU DIED IN THE DESERT. ":IFF>7GOTOB40 BETTER WATCH FOR A WATER-HOLE !": Z=4: 60T0260 750 IFU>1THEN770 480 A=RND<100> :IFA>5THEN600 760 PRINT"THE NATI ONAL CAMEL'S UNION IS NOT ATTENDING YOUR FUNER 490 C4=4 : 60SUB9BO AL ":C4=49: GOSUB9BO :GOTOB40 500 PRI NT�512, "WILD TRI BESMEN HIDDEN IN THE SAND HAVE CAPTURED Y 770 IF U>3 THEN 790 ou . 780 PRINT"YOUR BODY WAS EATEN BY VULTURES AND IMPORTED CANN IBALS 11 LUCK ILY THE LOCAL ELDER HAS AGREED TO THEIR RANSOM :C4=4:GOSUB9BO: GOTOB40 DEMANDS ••••••• BUT ••••••• WATCH FOR THE NATIVES! !! 790 IF U>5 THEN 810 "'0 YOU HAVE A NEW OICCH E OF SUB-COMMANDS BOO PR INT ..THE LOCAL ELDER NOW USES YOUR SKULL FOR A MONEY PURSE ! )> G'> !!"::C4=43: GOSUB9BO :GOTOB40 1"1"1

--- •• 510 PRINT .. #7 ATTEMPT ESCAPE ; 810 IF U>7 THEN 830 N 0'1 820 PRINT"PEOPLE WITH LITTLE INTELL I GENCE SHOULD STAY OUT OF THE DESERT ":C4=46: GOSUB9BO :GOTOB40 830 PR INT"TURKEYS SHOULD FLY , NOT RIDE CAMELS" : C4==40 : GOSUB980 1180 C$ (24> =L6$+CHR$ (130 >+CHR$ (173) +CHR$ (144 > +CHR$ (160) +CHR$ (158 < 840 PRINTG>.960, "WANT A NEW CAMEL AND A NEW GAME "; )+CHR$ <129 ) +L4$+L7$ 0 r 850 K$=I NKEY$: IFK$="" THEN850 1190 C$ (25> =CHR$ (128> +CHR$ <191 )+CHR$ (143 > +CHR$ <13 1>+CHR$ (13 1)+CH c 860 IFK$="Y"THENT2=0 :GOT0 1 20ELSE870 3: R$ ( 143> +CHR$ ( 191 } +L4$+CHR$ < 160) +STR ING$ (3� 176) +CHR$ < 184) +CHR$ < 18 rr1 870 IFI<:$< >"N"THEN850El.SE890 8> +CHR$ (148) +L3$ .+::> 880 PR I NTG>512, "YOU DIED OF DEHYDRAT ION •••••• DIDN� T DR INK ENOUG 1200 C$ <26> =CHR$ (128 > +CHR$ (191 )+CHR$ (188 > +CHR$ (176) +CHR$ (176) +CH H. ":GOT0740 R$ ( 18B> +CHR$ (191) +L3$+CHR$ (176 ) +CHR$ (189 ) +CHR$ (188> +CHR$ (188) +CH z 0 890 FOR C2=1T010 R$ (190 > +CHR$ (176) +CHR$ (187 ) +CHR$ (191 ) +CHR$ (148) +L2$

900 CLS:: PRINTCHR$ (23) ::PRINT" •••••••••••••••••••••••••••••••• " 1210 C$ (27> =L9$+CHR$ (130) +CHR$ <170 ) +CHR$ (181 ) +L2$+CHR$ <170>+CHR$ N 910 PR INT" CH ICKEN! �" < 181 > +L5$ U'l 920 PR I NT " • • n • a • • n • • • • • • • • • • • • • • • • • • • • • • • • " 1220 C$ <28> =L4$+"CONGRATULAT IONS �"+L3$:: C$<29>=C$ (28> :C$ (30>=C$ (2 rr1 930 FORD= 1T0500 :NEXT::: NEXT: END 8) -o -l 940 Z=4: S=6 :C=O:Ci=O: Q=O: F=O : P=O : RETURN 1230 C$ (31 > =L6$+STRING$ (8, 191 > +CHR$ <189) +CHR$ (176 )+CHR$ (144 ) +L6$ rr1 3: 950 FORC2= 15527T015549 : POKEC2, 131 : POKEC2+256,176: NEXTC2 1240 C$ <32> =L6$+STR ING$ (8, 191 >+CHR$ (159) +CHR$ (13 1)+CHR$ (145) +L6$ o:l rr1 960 FORC2= 15526T01 5782STEP64: POKEC2 ,191: POKEC2+24 ,191 :NEXTC2 1250 C$ (33> =L8$+L8$+CHR$ (132) +L6$ ;;o 970 RETURN 1260 C$ (34>=L5$+L5$+CHR$ < 170> +L6$+L6$

980 PRINT@23 1 ,C$(C4 > ;:PR I NT@295,C$ (C4+1 >;:PRI NT@359,C$ (C4+2> ; 1270 C$ (35> =L5$+L5$+CHR$ (186) +CHR$ <144 ) +L6$+CHR$ <176> +CHR$ <188 )+ "' 00 990 RETURN CHR$ (176) +L2$ w 1000 L1$=STRING$ (23, 128) : L2$=STR ING$ (2, 128> : L3$=STR ING$ <3, 128> :L 1280 C$ (36)=L6$+CHR$ (180 ) +CHR$ <176) +CHR$ (176> +CHR$ (188) +CHR$ (190 4$=STR ING$ (4, 128) :L5$=STR ING$ (5, 128> : L6$=STR ING$ (6, 128> : L7$=STR I > +CHR$ < 188) +CHR$ < 188) +CHR$ ( 176) +CHR$ < 188) +CHR$ ( 188) +STR ING$ <3, 12 NG$(7, 128> : L8$=STRING$ <8, 128) :L9$=STR ING$ (9, 128) 8> +CHR$ (19 1)+L3$ 1010 C$ (1)=L9$+CHR$ (160 > +CHR$ (176>+CHR$ (176> +CHR$ (128> +CHR$ (128> 1290 C$ (37) =L 1$ +CHR$ <19 1)+CHR$ (143> +CHR$ (141> +L6$ 1300 C$ <38> =L4$+CHR$ (160 > +CHR$ <176> +L3$+STRING$ (5, 176) +CHR$ (144> 1020 C$ (2) =L7$+CHR$ (160 > +CHR$ (184 > +STR ING$ (3, 191) +CHR$ (189) +CHR$ +CHR$ (128 ) +CHR$ (144) +CHR$ (176) +CHR$ (176> +L3$ <176> +CHR$ <159 > +L8$ 1310 C$ (39>=L4$+CHR$ <170>+CHR$ <191>+STRI NG$ <3, 188) +STR ING$ <5, 191 1030 C$ (3) =L7$+CHR$ < 129) +CHR$ < 170> +CHR$ < 181 ) +CHR$ < 128} +CHR$ < 128> )+CHR$ (189 ) +CHR$ (188 ) +CHR$ (191 ) +CHR$ (189) +CHR$(191 )+L3$ +CHR$ (170> +CHR$ (181) +L9$ 1320 C$ (40>=L1$ ::;:;: 1-1 1040 C$ (4) =L1$:C$ (5)=L1$:C$(6)=L1$ 1330 C$ (41>=L7$+CHR$ (176) +CHR$ (188 > +STRING$ <3, 191 ) +CHR$ (188) +CHR (J ;;o 1050 C$ <7> =L8$+CHR$ (182)+CHR$ (140 )+CHR$ (185 ) +CHR$ (160 ) +CHR$ (156) $(176) +CHR$ (128) +CHR$ (188) +CHR$ (19 1)+CHR$ (140> +L5$ 0 I +CHR$ (188>+CHR$ (172> +CHR$ <144 ) +L7$ 1340 C$ (42>=L5$+STRING$ <5, 131>+CHR$(191)+CHR$ (179)+CHR$ <179> +STR 00 0 1060 C$ <8>=L5$+CHR$ (172)+CHR$ (188 ) +CHR$ (176>+CHR$ (176) +CHR$ (19 1) ING$(4, 131)+L6$ +CHR$ (176) +CHR$ <176>+CHR$ (179)+CHR$ (191> +CHR$ (179) +CHR$ (176)+CHR 1350 C$ <43>=L9$+CHR$ (160)+CHR$ (128 > +CHR$ (179) +CHR$ (128) +CHR$ (144 $(188) +CHR$ (156) +L5$ >+L9$ 1070 C$ (9) =L6$+CHR$ (139 > +CHR$ (143 ) +CHR$ (191>+STRI NG$ (5, 143> +CHR$ 1360 C$ <44> =L8$+CHR$ (184 ) +CHR$ (143) +CHR$ (189) +CHR$ (176> +CHR$ (190 (191 )+CHR$ <143 > +CHR$ (135 ) +L6$ > +CHR$ < 143 > +CHR$ < 180 > +L8$ 1080 C$ <10>=L1$:C$(11>=C$<1>:C$(12>=C$ <2> 1370 C$ (45> =L8$+CHR$ (139>+CHR$ (191) +CHR$ (183)+CHR$ <179> +CHR$ <187 1090 C$ (13> =L9$+CHR$ (160> +CHR$ (176) +CHR$ (144> +L5$+CHR$ (176> +CHR$ )+CHR$ (191 >+CHR$ (135 > +L8$ <1BB> +CHR$ (188} +CHR$ (179) +CHR$ (155) +CHR$ (191> 1380 C$ <46> =L4$+STRING$ (15, 188)+L4$ 1100 C$ (14>=CHR$ (160 > +CHR$ (140> +CHR$ <176> +CHR$ (140) +CHR$ <144 > +L2 1390 R2=RND <9> +9: C$(47) =L4$+CHR$ (191 >+CHR$ (191 )+" I.Q. ="+STR$ +CHR$ (189 > +CHR$ (176> +CHR$ (17 2> +CHR$ (128> +CHR$ <19 1)+CHR$ <19 1>+L4$ 6) +CHR$ <188 ) +CHR$ (143) +CHR$ (131 ) +L2$+CHR$ <130> +CHR$ (128> +CHR$ <19 1400 C$ (48> =L4$+STR ING$ (15, 143> +L4$ 1) 1410 C$ <49)=L6$+STR ING$ (9, 176>+CHR$ (144> +L5$ 1110 C$ (15>=CHR$ (129> +CHR$ (128> +CHR$ (19 1>+CHR$ (128) +CHR$ (130) +L2 1420 C$ (50) =L6$+CHR$ (19 1)+" N.C.U. "+CHR$ (170 ) +CHR$ (149> +L5$ $+CHR$ <129 ) +CHR$ <170 > +CHR$ (181) +L2$+CHR$ <170 > +CHR$ (181 ) +L2$+CHR$ 1430 C$ (51 > =L6$+STRING$ (4, 131>+CHR$ (171) +CHR$ (151 )+STRING$(3, 131 <176 > +STR ING$ (4, 188)+CHR$ <176) +CHR$ <191> ) +CHR$ < 129 > +L5$

1120 C$ (16> =L6$+"R • I • P ."+L4$ 1440 RETURN 1130 C$ (17> =L8$+CHR$ (160>+CHR$ (176> +CHR$ <176> +L7$+CHR$ (176) +L2$ 1140 C$ (18> =L4$+CHR$ (160 > +CHR$ (176) +CHR$ <176> +CHR$ (184 > +STR ING$ ( 3, 191>+CHR$ (189) +CHR$ (176) +CHR$ (176>+CHR$ <188 > +CHR$ (188)+CHR$ (17 **** L2/ 16K FORMAT ION **** 6> +CHR$ <131)+CHR$ (19 1)+CHR$ (13 1)+CHR$ <128> 1150 C$ (19>=STR ING$ (23, 191):C$(20>=C$(19) :C$(21>=C$ (19) TRS-80/SYSTEM-80 -o 1160 C$ (22>=L7$+CHR$ (160 ) +CHR$ (176>+CHR$ (176) +L5$+CHR$ <176> +CHR$ )> en (188 >+CHR$ <188 ) +CHR$ (176> +L4$ rr1 (i 1170 C$ (23> =L5$+CHR$ (164)+CHR$ <184> +STR ING$ <3, 191)+CHR$ (189)+CHR 00 100 DELAY '; EQU 006 H ;LELAY LOOP N $(176> +CHR$ (176)+CHR$ (188 ) +CHR$ <143) +CHR$ (13 1>+L7$ 00200 AMT,DLY EQU i300H ;AMOUNT Of-' DELAY -....J 00300 WR ITE EQU 0264H ;WRITES BYTE TO TAPE 04900 NAME DEFM 'FORMAT ' ;NAME FOR TAPE COPY < 00400 DISPLY EQU 28A7H ;DISPLAYS MESSAGE ON SCREEN 05000 MESS6 DEFM 'IS RECORDER READY ' 0 r 00500 SCREEN EQU 3COOH ;START OF SCREEN MEM 05 100 DEFB OOH c:: :::.:: 00600 ENDSCR EQU 3FFFH ;END OF SCREEN MEM 05200 OPT ION LD IX,XTAB ;SET IX TO TABLE 1"1"1

00700 ENDPRG EQU 40F9H ;END OF BAS IC PROGRAM PO I NTER 05300 LD IY,YTAB ;SET IV TO TABLE ..j::o 00800 CLS EQU 01C9H ;CLEARS SCREEN 05400 CALL CLS ;_CLEAR SCREEN :z 00900 GETCHR EQU 002BH ;GETS KEY DEPRESSED 05500 LD HL , MESS 1 ;DISPLAY OPT ION LIST 0 01000 GETVAL EQU 1BB3H ;GETS INPUT VALUE 05600 CALL DISPLY 01100 RECON EQU 02 12H ;TURNS RECORDER ON 05700 TST CALL GETVAL ;GET NO OF OPT ION CHOSEN N 01200 RECOF EQU 01F8H ; " " OFF 05800 RST 10H l/) 01300 LEDER EQU 0287H ;WRITES LEADER&SYNCH TO TAPE 05900 CALL VALACC ;EVAULATES NO . 1"1"1 -o 01400 OMERR EQU 19A7H ;OUT OF MEMORY ERROR 06000 CP 01H -i 1"1"1 01500 OPENCM EQU 417AH ;�OPEN' COMMAND POI NTER 06100 JP Z,MODFRM ;MODIFY FORM :::.:: 01600 c::c ORG 433FH ;LOW MEMORY START 06200 CP 02H 1"1"1 01700 FIRST NOP 06300 JP Z,MKFORM ;CREATE FORM :::0 01800 MEMSTR DEFS 1024D ;SPACE TO HOLD FORM 06400 CP 03H ..... 01900 MESS! DEFM * F 0 R M A T I 0 N *' 06500 JP Z,TAPE ;STORE ON TAPE 1.0 co 02000 DEFB OAH 06600 CP 04H w 02100 DEFM 'COPYRIGHT 1982 DAVID R. GR IGG' 06700 JP Z,FILL ;FILL FORMS 02200 DEFW OAOAH 06800 CP 05H 02300 DEFM 'OPTIONS ' 06900 JP Z,06CCH ;BACK TO BASIC 02400 DEFB OAH 07000 JP OPTION 02500 DEFB OAH 07 100 ; END OF CALL ING PROGRAM 02600 MESSO DEFM '1. MOD IFY EXISTING FORM 07200 SC2MEM LD BC, 1024D ;ROUT INE STORES SCREEN 02700 DEFB OAH 07300 LD HL , SCREEN ; DISPLAY IN MEMORY 02800 MESS2 DEFM '2. CREATE NEW FORM' 07400 LD DE , MEMSTR :::.:: 02900 DEFB OAH 07500 LD IR ,...._. ("'") 03000 MESS3 DEFM '3. STORE NEWLY-CREATED FORM' 07600 RET :::0 07700 ; 0 03100 DEFB OAH I 03200 MESS4 DEFM '4. FILL EXISTING FORMS' 07800 MEM2SC LD BC, 1024D ;ROUT INE RETURNS STORED co 0 03300 DEFB OAH 07900 LD HL , MEMSTR FORM FROM MEMORY TO 03400 MESS5 DEFM �5. RETURN TO BAS IC' 08000 LD DE , SCREEN SCREEN . 03500 DEFB OAH 08100 LD IR 03600 DEFB OOH 08200 RET 03700 BEGIN LD HL, OPT ION ;INITIALISATION ROUT INE 08300 ; 03705 LD ,HL ;SETS UP 'OPEN' COMMAND 08400 MODFRM CALL MEM2SC ;GET EX ISTING FORM 037 10 LD HL , LAST ;AS INTRO TO FORMAT 08500 JP MKFM02 037 15 XOR A ;FROM BASIC 08600 MKFORM CALL CLS CLEAR SCREBl 03720 LD , A ;ZEROS LAST BYTE OF PROG 08700 MKFM02 LD HL , SCREEN SET HL TO START OF SCREEN 03725 INC HL ;AND SPACES BEYOND FOR 08800 LOOP01 CALL GET KEY GET KEY BE ING DEPRESSED 03730 LD ,A ; NEW BASIC START 08900 TST2 CP 32D IS IT A CONTROL CHAR? 03735 LD <40A4H> ,HL ;RESET START OF BAS IC 09000 JP M,CONTRL IF LESS THAN 32 , CONTROL 03740 INC HL 09 100 CP 91D IS IT AN UP ARROW? 03745 LD ,A 09200 JP Z,UPARR 03750 INC HL 09300 CP 40H ;� KEY FOR CURSOR SYMBOL 03755 LD <40F9H> ,HL ;RESET END OF BASIC 09400 JP Z,ASYMBL 03760 LD <40FBH> ,HL ;RESET ARRAY POI NTER 09700 SK IP01 LD ,A ;DISPLAY CHARACTER ON SCREEN 03765 LD <40FDH> ,HL ;RESET FREE SPACE PTR 09800 INC HL 04200 LD IY,YTAB ;POINT IY TO TABLE 09900 CALL TESTHI ;ARE WE OVER END OF SCREEN? 04300 LD A,7DH 10000 JP LOOP0 1 04400 LD ,A INITIALISE LINE NO 10100 ; -o 04500 XOR A FOR DATA LINES TO 10900 UPARR CALL REPLCE ;RELACE CHAR COVERED BY CURSOR )::o en 04600 LD ,A 32000 11000 LD DE, 0040H 1"1"1 04700 JP 06CCH ;BACK TO BASIC 11010 XOR A N co 04800 11020 SBC HL, DE ;MOVE SCREEN POI NTER UP ONE LINE 11300 CALL TESTLO ;ARE WE BEYOND START OF SCREEN? 16900 LD A,L < 11500 JP LOOP0 1 17000 AND 192D ;AND TO START OF THAT LINE 0 r 11600 ; 17100 LD L,A c:: 3: 11700 CONTRL CP 08H ;IS IT BACK ARROW? 17200 CALL TESTHI ;NOT OVER END OF SCREEN? ["1'1 JP 11800 JP Z,BACKSP 17300 LOOP0 1 ..j:::o .. 11900 CP OAH ;IS IT DOWN ARROW? 17400 ; 12000 JP Z,DOWNAR 17500 TAPE CALL CLS :z 0 12100 CP 09H ;IS IT FORWARD ARROW? 17600 LD HL , MESS6 ;CHECK RECORDER O.K. 12200 JP Z,FWDARR 17700 CALL DISPLY N 12300 CP ODH ;IS IT CARR I AGE RET.? 17705 CALL GET VAL (./) 12400 JP Z,CARRET 17800 XOR A ["1'1 -o 12500 CP lBH ;SHIFT UP ARROW? 17900 CALL RECON ;TURN ON RECORDER -I 12600 JP Z,CLEAR 18000 LD HL , LAST ["1'1 3: 12700 JP LOOP0 1 18100 LD DE ,FIRST ;SET TO BOUNDAR IES OF PROGRAM co ["1'1 12800 ; 18200 XOR A ::::0 12900 ; 18300 SBC HL , DE ;NO OF BYTES TO MOVE 13000 ASYMBL LD A,5FH ;TURN @ INTO CURSOR SYMBOL 18400 INC HL � co 13100 JP SK IP01 18500 CALL LEDER ;WRITE LEADER & SYNCH BYTE w 13200 ; 18600 LD A, 55H 13300 18700 CALL WRITE 13400 REPLCE LD A, ;GET STORED CHARACTER 18800 LD B,06H 13500 LD ,A ;PUT IT BACK ON SCREEN 18900 PUSH HL 13600 RET 19000 LD HL , NAME ;PROGRAM NAME IS �FORMAT � 13700 ; 19100 LOOP40 LD A, 13800 BACKSP CALL REPLCE 19200 CALL WR ITE ;WRITE NAME TO TAPE 13900 DEC HL ;MOVE PO I NTER BACK 19300 INC HL 3: 14000 CALL TESTLO ;OVER START OF SCREEN? 19400 DJNZ LOOP40 ...... 14100 JP LOOP01 19500 POP HL (""') ::::0 14200 ; 19600 LOOP41 DEC H ;DECREASE HL BY 256BYTES 0 I 14300 DOWNAR CALL REPLCE 19700 JP M,SK I P40 ;LAST BLOCK IF MINUS . co 0 14400 LD DE , 64D ;INCREMENT SCREEN PO I NTER ONE LINE 19800 LD A,3CH 14500 ADD HL ,DE 19900 CALL WRITE 14600 CALL TESTHI ;OVER END OF SCREEN? 20000 XOR A 14700 JP LOOP0 1 20 100 CALL WR ITE ;256 BYTES IN BLOCK 14800 ; 20200 CALL WRTBTE ;WRITE THESE BYTES 14900 FWDARR CALL REPLCE 20300 JR LOOP41 15000 INC HL ;INCREMENT SCREEN POI NTER 20400 SK I P40 XOR A ;INCOMPLETE BLOCK 15100 CALL TESTH I ;OVER END OF SCREEN? 20500 CP L 15200 JP LOOP0 1 20600 JR Z,SKIP41 ;IF L ZERO, NO BYTES LEFT 15300 ; 20700 LD A, 3CH 15400 TESTHI LD A,H 20800 CALL WR ITE 15500 CP 40H ;GREATER THAN 3FFFH? 20900 LD A, L ;NO OF BYTES IN THIS BLOCK 15600 RET M 21000 CALL WR ITE 15700 LD HL , ENDSCR ;IF SO, SET TO 3FFFH 21100 CALL WRTBTE ;WRITE THESE BYTES 15800 RET 21200 SK IP41 LD A,78H ;END OF TAPE DATA 15900 ; 21300 CALL WRITE 16000 TESTLO LD A,H 21400 LD BC , BEGIN 16100 CP 3CH ;LESS THAN 3COOH? 21500 LD A, C 16200 RET p 21600 CALL WRITE ;WRITE OPERATI ONAL START 16300 LD HL , SCREEN ;IF SO , SET TO 3COOH 21700 LD A, B ; OF PROGRAM 16400 RET 21800 CALL WR ITE -o 16500 ; 21900 CALL RECOF ;TURN OFF RECORDER )> Ci) 16600 CARRET CALL REPLCE 22000 JP OPTION ;GO BACK FOR NEXT OPTION ["1'1

16700 LD DE , 64D ;MOVE PO I NTER UP ONE LINE 22 100 WRTBTE LD B,A ;SAVE A N 16800 ADD HL,DE 22200 LD A,E � 22300 CALL WR ITE ;WRITE START ADDRESS OF JP NZ , LOOP08 27600 < 22400 LD A,D ; TH IS BLOCK 27700 JP UPAR02 ;IF BEYOND START OF FLD , GO TO 0 r 22500 CALL WRITE 27800 ; LAST FIELD c: 3: 22600 ADD A,E ;ADD FOR CHECKSUM 27900 FWAR0 1 CALL REPLCE f"l1

22700 LD C,A 28000 INC HL ;INC . SCREEN PO INTER . +=- 22800 LOOP42 LD A, 28 100 INC C ;INC CHARS IN FIELD 22900 CALL WR ITE ;WRITE THIS BYTE TO TAPE z 28200 LD A, 29500 INC DE 24300 LD < IV> , A SAVE CURRENT CHARACTER 29600 INC DE ;JUMP UP TO NEXT TABLE ENTRY 24400 LOOP08 CALL GETKEY GET KEY BE ING PRESSED 29700 JR LOOP 12 24500 CP 32D IS IT A CONTROL CHAR? 29800 THERE LD A, 24600 JP M, CNT01 29900 LD L, A ;SET HL TO ADDRESS FROM TABLE 24700 CP 91D ;AN UP ARROW? 30000 INC DE 24800 JP Z,UPAR0 1 30100 LD A, 96D 3: 24805 CP ;SHIFT �? 30200 LD H,A ;HL NOW HAS SCREEN ADDRESS ...... ("") 24810 JP Z,CLER0 1 30300 INC DE :::0 24900 LD ,A ;OTHERWISE, PUT CHAR ON SCREEN 0 30400 LD A, ;LENGTH OF FIELD I 25000 INC C ;C IS NO OF CHARS PUT IN TH IS 30500 LD ,A ;STORE IN IY+1 CP 0 25100 INC HL ; ENTRY FIELD SO FAR 30600 POP BC ;RETURN BC 25200 LD A, ;GET LENGTH OF CURRENT FIELD 30700 RET 25300 CP C ;HAVE WE EXCEEDED IT? 30800 25400 JP Z,DNAR02; IF SO, JUMP TO NEXT FIELD 30900 ; 25500 JP LOOP08 31000 CNT01 CP OAH ;IS IT DOWN ARR? 25600 ; 31 100 JP Z,DNARO l 25700 UPAR01 CALL REPLCE 31200 CP 09H ;IS IT FWD ARROW? 25800 UPAR02 DEC B ;GO BACK TO LAST FIELD 31300 JP Z,FWAR0 1 25900 JP NZ , LOOP 10 31400 CP ODH ;IS IT CARRI AGE RETURN? 26000 LD B, 32100 JP Z�OPT ION 26700 CP B ;ARE WE OVER TOTAL FIELDS? 32200 JP LOOP08 26800 JP P,LOOP11 32300 26900 LD B,01H ;IF SO, SET TO FIRST FIELD. 32400 ; 27000 LOOP11 CALL GETFLD 32500 CLEAR CALL REPLCE 27100 JP LOOP07 SC2MEM ;SAVE FORM IN MEMORY 32600 CALL "'0 27200 ; 32700 LD HL, SCREEN )> Ci) 27300 BKAR01 CALL REPLCE 32800 LD ,OOH ;INITIAL ISE NO. OF FLDS =0 f"l1 27400 DEC HL ;DECREMENT SCREEN POI NTER 32900 PUSH IX w 0 27500 DEC c ;DEC. CHARS SO FAR IN FIELD 33000 POP DE ; DE NOW HAS TABLE START 33 100 DEC HL 38800 CP OOH < 33200 LOOP04 INC HL ;ADVANCE SCREEN POI NTER 38900 .JP NZ, SK IP25 0 r 33300 CALL TSTEND ;AT END OF SCREEN? 39400 D.JNZ LOOP26 ;REPEAT 256 TIMES c= ::::s:: 33400 .JP P,OPT ION ;IF SO , DONE , SO RETURN 39500 .JP LP f'T1 33500 LD A, ;SET CHARACTER ON SCREEN 39600 SK I P25 POP BC � 33600 CP 5FH ;IS IT CURSOR CHAR? 39700 RET ;WE7VE GOT A CHARACTER , SO RETURN ::z: 33700 .JP Z,ENTRY ;IF SO , NEW FIELD 39800 ; 0 33800 .JR LOOP04 39805 CLER0 1 CALL REPLCE 33900 ENTRY INC ;INCREASE TOTL NO . FIELDS 39900 LD B!I01H N 34000 INC DE 40000 LOOP13 LD A,08H tn 34 100 LD A,L ;SAVE ADDRESS OF THIS FIELD 40100 LD ,A ;INITIALISE LENGTH OF DATA LINE f'T1 -o 34200 LD ,A : IN TABLE 40200 LD HL , ;CURRENT END OF PROGRAM PTR -i f'T1 34300 INC DE 40300 LD DE , (40B1H> ;MEMORY SIZE ::::s:: o:l 34400 LD A,H 40400 XOR A f'T1 :::0 34500 LD , A 40500 PUSH HL .. 34600 INC DE 40600 SBC HL ,DE ;ARE WE OUT OF MEMORY?

34700 LD A,01H ;INITIALISE LENGTH OF FIELD =1 40700 .JP P,OMERR ;OUT OF MEMORY ERROR IF SO • 1..0 co 34800 LD ,A 40800 POP HL w 34900 LOOP05 LD A, 40900 LD E!l< IY+2> ;GET NEW LINE NO. 35000 INC A 41000 LD D, < IY+3 > ; FOR DATA LINE 35 100 CP 240D ; MAX FIELD LENGTH 41 100 INC DE 35200 .JP Z,LOOP04 ;IF GREATER , CUT OFF . 41200 INC DE 35300 LD ,A ;LENGTH NOW INCREMENTED 41300 INC DE 35400 INC HL 41400 INC DE 35500 CALL TSTEND ;AT END OF SCREEN? 41500 INC DE ;INCREMENT IT BY 5 35600 .JP P,OPT ION 41600 LD ,E ::::s:: 35700 LD A, 41700 LD ,E ;PUT IT IN DATA LINE :::0 0 35900 .JP NZ, LOOP04 ;IF NOT , END OF FIELD 41900 INC HL I .JP LOOP05 co 36000 42000 LD ,D ;LINE NO. NOW IN PLACE 0 36 100 ; 42100 INC HL 36200 TSTEND LD A,H 42200 LD , 136D ;DATA TOKEN 36300 CP 40H ;HL GREATER THAN 3FFFH? 42300 INC HL 36400 RET 42400 LD ,32 ;SPACE 36500 42500 INC HL 36600 ; 42600 PUSH HL 36700 VALACC LD A, <41E8H> ; SET CHAR IN BUFFER 42700 LOOP 15 CALL GETFLD ;GET ADRESS OF FIELD . 36800 SUB 30H; CHANGE ASCI I TO NO. 42800 POP DE ;DE NOW POINTS TO DATA LINE, 36900 RET 42900 LD C, ;LENGTH OF CURRENT FIELD 37000 ; 43000 LD A, < IY+4 ) ;LENGTH OF LINE SO FAR 37 100 SETKEY PUSH BC 43100 ADD A,C 37 105 LD BC , AMTDLY ; AMOUNT OF DELAY FOR KEYBOARD 43200 .JP C,ENDLNE ;NEED NEW DATA LINE 37 115 CALL DELAY ; DEBOUNCE . 43300 ;IF WE GET HERE , THERE 7S ENOUGH ROOM IN LINE 37200 LD A, ;SET CHAR FROM SCREEN 43400 LOOP14 LD A, ;GET CHAR FROM SCREEN 37300 LD ,A ;SAVE IN IV 43500 CP 22H ; QUOTES? 37400 LP LD , 143D ;PUT BLOCK CURSOR ON SCREEN 43600 .JP NZ , SKI P28 37500 LD B, OOH 43700 LD A,5BH ;UP ARROW INSTEAD 37600 LOOP25 CALL SETCHR ;GET KEY DEPRESSED 43800 .JP SK IP31 37700 CP OOH ;IF ZERO , NO KEY DEPRESSED 43900 SK I P28 CP 2CH ;COMMA? 37800 .JP NZ , SK IP25 44000 .JP NZ, SK IP29 38300 D.JNZ LOOP25 ;REPEAT 256 TIMES 44 100 LD A, 5CH ; DOWN ARROW INSTEAD -o 38400 LD A, ;RETURN CHARACTER . 44200 .JP SK IP31 )::» Ci) 38500 LD ,A ;DISPLAY IT 44300 SK I P29 CP 3AH ;COLON? f'T1 LD B,OOH 38600 44400 .JP NZ , SK I P30 � 38700 LOOP26 CALL GETCHR ;GET KEY DEPRESSED 44500 LD A, 5EH ;FORWARD ARROW INSTEAD 44600 J'P SK IP31 433F : 00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 < 44700 SK I P30 CP 5FH ;ENTRY FIELD ? 434F : 20 4D 41 49 4C 49 4E 47 20 4C 49 53 54 20 44 45 0 r 44800 JP Z,SKI P32 ; IF SO, NO MORE DATA IN FIELD 435F :: 4D 4F 4E 53 54 52 41 54 49 4F 4E 20 20 20 20 20 c:: 3: 44805 SK IP31. DEC C ;C HAS NO . OF PLACES IN FIELD 436F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 JT1

44810 JP Z,SKI P32 ;IF ZERO � AT END OF FIELD 437F :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ..j:::o 44900 LD ,A ;LOAD CHAR INTO DATA LINE 438F :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 439F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 :z 45000 INC DE 0 45 100 INC HL 43AF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 45200 INC ,A 43EF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 -i 43FF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 JT1 45700 INC DE 3: 440F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 co 45800 INC HL JT1 45900 INC 44 1F:: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 :::0 46000 INC B ;NEXT FIELD 442F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46100 PUSH DE 443F :: 20 53 54 52 45 45 54 2F 52 4F 41 44 20 5F 5F 5F "' co 46200 LD A, ;ARE WE AT END OF 444F :: 5F 5F 5F 5F 5F SF 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F w 46300 CP B ; FIELDS? 445F : 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 20 20 20 20 20 46400 JP P,LOOP15 ;IF NOT , GET NEXT 446F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46500 POP DE 447F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46600 ENDLNE XOR A 448F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46700 DEC DE ;END OF LINE ZERO OVER LAST COMMA 449F:: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46800 LD ,A 44AF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 46900 INC DE 44BF:: 20 54 4F 57 4E 2F 53 55 42 55 52 42 20 5F 5F 5F 47000 LD ,A ;END OF PROGRAM ZEROS 44CF :: 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 3: 47100 INC DE 44DF : 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F 20 20 20 20 20 � 44EF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ("") 47200 LD , A :::0 44FF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0 47300 INC DE ;NOW AT NEW VAR I ABLE START I LD HL , ;GET OLD VARI ABLE START 450F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 co 47400 0 47500 PUSH HL ;SAVE THIS POSITION 451F: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47600 LD HL, ENDPRG 452F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 47700 LD , E 453F: 20 53 54 41 54 45 20 20 20 20 20 20 20 5F 5F 5F 47800 INC HL 454F : 5F 5F 5F 5F 5F 5F 5F 5F 5F 5F SF 5F 5F SF SF SF 47900 LD , D ;RESET ENDPRG TO NEW POSITION 455F :: 5F 5F 5F SF 5F SF 5F SF 5F 5F 5F 20 20 20 20 20 48000 POP HL ;OLD VAR START IS SPOT 456F: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48100 DEC HL FOR NEW LINE POI NTER 457F:: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48200 DEC HL 458F: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48300 DEC DE 459F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48400 DEC DE 45AF :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48500 LD , E ;RESET LINE POINTER 45BF : 20 43 4F 55 4E 54 52 59 20 20 20 20 20 SF 5F SF 48600 INC HL 45CF :: SF 5F 5F SF 5F SF 5F SF 5F 5F SF 5F 5F SF 5F SF 48700 LD ,D 45DF :: 5F 5F 5F SF SF SF 5F 5F 5F SF 5F 20 20 20 20 20 48800 LD A, ;TOTAL NO OF FIELDS 45EF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 48900 CP B ;ARE WE FINISHED? 45FF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49000 JP P,LOOP 13 ;NO, SO CONT INUE 460F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49100 JP FILL 461F:: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49200 ; 462F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49300 YTAB DEFS 10H ;TABLE FOR ODD VAR I ABLES 463F :: 20 50 4F 53 54 20 43 4F 44 45 20 20 20 5F 5F SF 49400 XTAB DEFW OOOOH ;LOOKUP TABLE FOR ENTRY FIELDS 464F :: SF 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 465F :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49500 DEFW OOOOH -o 49600 DEFS 252D 466F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 )::o Ci) 49700 ; 467F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 JT1 49800 LAST NOP 46BF :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 w N 49900 END BEGIN 469F :: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4AOF : DD E5 D1 13 C5 05 CA 1D 4A 13 i3 13 18 F7 1A 6F < 46AF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A 1F: 13 iA 67 13 1A FD 77 01 C1 C9 FE OA CA EO 49 FE 0 I 46BF : 20 50 48 4F 4E 45 20 20 20 20 20 20 20 5F 5F 5F 4A2F :: 09 CA FE 49 FE OD CA EO 49 FE 08 CA F3 49 FE iF c: 3:: 46CF : 5F 5F 5F 5F 5F 5F 5F 5F 5F 20 20 20 20 20 20 20 4A3F : CA C7 4A FE 1B CA 38 48 C3 81 49 CD DD 48 CD 6F rr1 48 21 00 3C DD 36 00 00 DD E5 Di 28 23 CD SF 4A 46DF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A4F : .p. 46EF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A5F : F2 38 48 7E FE 5F CA 6A 4A 18 F1 DD 34 00 13 7D 4A6F :: 12 13 7C 12 13 3E 01 12 1A 3C FE FO CA 5B 4A 12 :z 46FF : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 0 470F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A7F : 23 CD SF 4A F2 3B 48 7E FE 5F C2 58 4A C3 77 4A 47 1F:: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A8F : 7C FE 40 C9 3A E8 41 D6 30 C9 C5 01 00 13 CD 60 N 472F : 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4A9F : 00 7E FD 77 00 36 SF 06 00 CD 28 00 FE 00 C2 C5 (./') 473F : 20 20 20 20 20 20 20 20 2A 20 46 20 4F 20 52 20 4AAF : 4A 10 F6 FD 7E 00 77 06 00 CD 2B 00 FE 00 C2 C5 rr1 4A 10 F6 C3 A4 4A C1 C9 CD DD 48 06 01 3E 08 FD "'0 474F : 4D 20 41 20 54 20 49 20 4F 20 4E 20 2A OA 43 4F 4ABF: -I 4ACF : 77 04 2A F9 40 ED 5B Bl 40 AF E5 ED 52 F2 A7 19 rr1 475F : 50 59 52 49 47 48 54 20 31 39 38 32 20 44 41 56 3:: 4ADF : El FD 5E 02 FD 56 03 13 13 13 i3 13 FD 73 02 FD Ct1 476F : 49 44 20 52 2E 20 47 52 49 47 47 OA OA 4F 50 54 rrl 477F : 49 4F 4E 53 OA OA 31 2E 20 4D 4F 44 49 46 59 20 4AEF : 72 03 73 23 72 23 36 88 23 36 20 23 E5 CD OD 4A :::0 478F : 45 58 49 53 54 49 4E 47 20 46 4F 52 40 OA 32 2E 4AFF : Di FD 4E 01 FD 7E 04 Bi DA 4D 48 7E FE 22 C2 15 __. 479F: 20 43 52 45 41 54 45 20 4E 45 57 20 46 4F 52 4D 480F : 4B 3E 5B C3 2E 4B FE 2C C2 iF 4B 3E 5C C3 2E 4B 1.0 co 47AF : OA 33 2E 20 53 54 4F 52 45 20 4E 45 57 4C 59 20 48 1F: FE 3A C2 29 4B 3E 5E C3 2E 4B FE 5F CA 3B 4B OD w 47BF : 43 52 45 41 54 45 44 20 46 4F 52 4D OA 34 2E 20 4B2F : CA 38 48 i2 i3 23 FD 34 04 C3 OA 48 3E 2C 12 13 47CF :: 46 49 4C 4C 20 45 58 49 53 54 49 4E 47 20 46 4F 4B3F : 23 FD 34 04 04 D5 DD 7E 00 B8 F2 FC 4A D1 AF 1B 47DF : 52 4D 53 OA 35 2E 20 52 45 54 55 52 4E 20 54 4F 4B4F : 12 13 12 i3 i2 i3 2A F9 40 E5 21 F9 40 73 23 72 47EF : 20 42 41 53 49 43 OA 00 21 3B 48 22 7A 41 21 81 485F : El 2B 2B 1B 1B 73 23 72 DD 7E 00 B8 F2 CC 4A C3 47FF : 4C AF 77 23 77 22 A4 40 23 77 23 22 F9 40 22 FB 486F : A5 49 20 08 OF 7D 20 52 45 43 4F 52 44 45 52 50 480F: 40 22 FD 40 FD 21 71 4B 3E 7D FD 77 03 AF FD 77 4B7F : 46 OB 09 88 3C 15 A7 3C 02 A9 3C 02 OC 3D iF 8C 48 1F: 02 C3 CC 06 46 4F 52 4D 41 54 49 53 20 52 45 43 488F : 3D 1F OC 3E 1F 8C 3E iF OC 3F 05 8C 3F OD 53 45 482F: 4F 52 44 45 52 20 52 45 41 44 59 00 DD 21 81 4B 489F: 54 20 54 4F 20 42 4F 55 4E 44 41 52 49 45 53 20 483F : FD 21 71 48 CD C9 01 21 40 47 CD A7 28 CD 83 18 4BAF : 4F 46 20 50 52 4F 47 52 41 4D i8 47 06 09 58 4F ;3 488F : 52 09 41 7C 47 1F 09 53 42 43 09 48 4C 2C 44 45 ("") 484F : D7 CD 93 4A FE 01 CA 87 48 FE 02 CA 8D 48 FE 03 :::0 48CF : 09 3B 4E 4F 20 4F 46 20 42 59 54 45 53 20 54 4F 0 485F : CA 24 49 FE 04 CA A5 49 FE 05 CA CC 06 C3 3B 48 I 486F: 01 00 04 21 00 3C 11 40 43 ED 80 C9 01 00 04 21 48DF : 20 4D 4F 56 45 EO 47 07 09 49 4E 43 09 48 4C 44 co 0 487F: 40 43 11 00 3C ED BO C9 CD 78 48 C3 90 48 CD C9 48EF : 48 26 09 43 4i 4C 4C 09 4C 45 44 45 52 09 3B 57 52 49 54 45 20 4C 45 41 44 45 52 20 26 20 53 59 488F : 01 21 00 3C CD 99 4A FE 20 FA BC 48 FE 5B CA AD 48FF : 489F: 48 FE 40 CA DB 48 77 23 CD 03 49 C3 93 48 CD DD 4COF : 4E 43 48 20 42 59 54 45 AS 48 09 09 4C 44 09 41 48AF: 48 11 40 00 AF ED 52 CD 08 49 C3 93 48 FE 08 CA 4C1F: 2C 35 35 48 OC 49 OB 09 43 41 4C 4C 09 57 52 49 48BF : E2 48 FE OA CA EC 48 FE 09 CA F9 48 FE OD CA 13 4C2F : 54 45 70 49 09 09 4C 44 09 42 2C 30 36 48 D4 49 08 09 50 55 53 48 09 48 4C 38 4A 25 09 4C 44 09 48CF: 49 FE 1B CA 4A 4A C3 93 48 3E 5F C3 A5 48 FD 7E 4C3F : 48 4C 2C 4E 41 4D 45 09 3B 50 52 4F 47 52 41 4D 48DF : 00 77 C9 CD DD 48 28 CD 08 49 C3 93 48 CD DD 48 4C4F : 20 4E 41 4D 45 20 49 53 20 27 46 4F 52 4D 41 54 48EF: 11 40 00 19 CD 03 49 C3 93 48 CD DD 48 23 CD 03 4C5F :: 27 9C 4A 10 4C 4F 4F 50 34 30 09 4C 44 09 4i 2C 48FF : 49 C3 93 48 7C FE 40 F8 21 FF 3F C9 7C FE 3C FO 4C6F : 28 48 00 490F : 21 00 3C C9 CD DD 48 11 40 00 19 7D E6 CO 6F CD 4C7F : 49 1F: 03 49 C3 93 48 CD C9 Oi 21 29 48 CD A7 28 CD B3 492F : 18 AF CD 12 02 21 81 4C 11 3F 43 AF ED 52 23 CD 493F: 87 02 3E 55 CD 64 02 06 06 E5 21 23 48 7E CD 64 494F: 02 23 10 F9 E1 25 FA 66 49 3E 3C CD 64 02 AF CD **** L2/ 16K ORDER ING PR IORITIES **** 495F : 64 02 CD 8C 49 18 EE AF 8D 28 OC 3E 3C CD 64 02 496F : 7D CD 64 02 CD 8C 49 3E 78 CD 64 02 01 F7 47 79 TRS-80/SYSTEM-80 497F: CD 64 02 78 CD 64 02 CD F8 01 C3 38 48 47 78 CD 498F : 64 02 7A CD 64 02 83 4F 1A CD 64 02 81 4F i3 10 499F: F7 79 CD 64 02 C9 CD 78 48 06 01 CD OD 4A 7E FD iO 'P R I 0 R I T I E S 49AF : 77 00 CD 99 4A FE 20 FA 29 4A FE 58 CA DO 49 FE 20 'AFJ Bel l 20/06/81 60 CA C7 4A 77 OC 23 FD 7E 01 89 CA E3 49 C3 8i 30 '49 Hyde Par k Rd , TRARALGON , 3844 498F : "'0 49CF: 49 CD DD 48 05 C2 DA 49 DD 46 00 CD OD 4A C3 AD 40 'Uses 5.3 KBytes including ULCBAS )::1 G') 49DF: 49 CD DD 48 04 DD 7E 00 B8 F2 ED 49 06 01 CD OD 50 CLS : IF PEEK <14312><>63 THEN PR INT"Linepri nter not ready" rr1 49EF : 4A C3 AD 49 CD DD 48 28 OD C2 B1 49 C3 D3 49 CD 60 LPRINT CHR$ (27> ;CHR$ (66> :POKE 16424,72:POKE 16425,0: LN=O w w 49FF: DD 48 23 OC FD 7E 01 89 FA EO 49 C3 81 49 OE 01 70 CLEAR lOOO : DEF INT A- Z 80 DIM SD$(12,3> ,HEAD$<4> ,PU$ <3> ,0PTN$(9 ),I(1 2> 550 IF F$("1" OR F$ >"9" GOTO 540 ELSE PR INT F$: SD$ ,2>=F$ < 90 FOR L=O TO 4:READ HEAD$ :NEXT �sets head ings etc 560 SD$(l (C) ,3)=STR$ (VAL

110 FOR L=O TO 3:READ PU$(L) :NEXT 590 PR I NT� 960, "0rdering by importance ••"; +=- 120 DATA "% %","% %","% %" , "% %" 600 GOSUB 770 : GOTO 190 ::z 130 CLS 7Sets & displays options 610 T=2 : H=3 0 140 FOR L= 1 TO 9: READ OPTN$ :NEXT 620 PR I NT� 960, "0rdering by feasi bi l ity •••"; 150 DATA Di splay Instructions, Input Data, Echo Data 630 GOSUB 770 : GOTO 190 N 160 DATA Add Li ne , Change Li ne 640 T=3 :H=4 V) 170 DATA Order by Importance,Order by Feasibility 650 PR I NT� 960 , "0rder ing by priority ••• "; ["11 ""0 180 DATA Order by Pr iority, End 660 GOSUB 770: GOTO 190 -I ["11 190 CLS: PR INT: PR INT CHR$ (23) TAB <12) "0ptions" :PRINT 670 CLS:PRINT"Goodbye ":GOSUB 950 : END 3: co 200 FOR L= 1 TO 9:PR INT L; " ";OPTN$ :NEXT 680 CLS: TITLE$=HEAD$ (0) +" "+HEAD$ �Displ ay subrout ine ["11 210 PR INT: PRINT"What is your choice ?" 690 PR INT TAB <32-LEN ;STR$(L> ; w 250 CLS:PR INT:PRINT CHR$ (23> �Instructions 730 FOR J=O TO 3 260 PRINT" Th is program wi ll help to dec-" ; CHR$ (13> ; "ide the rel 740 PR INT USING PU$ (J) ;SD$ ,J> ; at i ve priorities of ";CHR$ (13> ; "var i ous acti vities. " 750 NEXT J:PRINT 270 PRINT" Pl ease enter data as prompted. ";CHR$ (13> ; "Vou must pr 760 NEXT L: RETURN ess ENTER if the" ; CHR$ <13> ; "cursor is showi ng . If a mi st ake" ; CHR 770 FOR K= l TO N- 1 "Secondary index Bubble "Sort " & Di splay $<13> ;"is made when enter ing data then";CHR$ (13> ; "enter XXX as a subrout ine ct ivity name . To" 780 F=O 280 PRINT"finish enter ing data enter ZZZ ";CHR$<13> ; "as activity 790 FOR J=1 TO N-K 3: name. " 800 IF VAL > >= VAL ,T> > GOTO 820 � n 290 PR INT: PRINT"Press any key when ready" 810 F= 1:X=I :I=I :I(J+1 >=X :::0 0 300 R$=I NKEV$:: 1F R$=" " GOT0300 ELSE GOTO 190 820 NEXT J: IF F=O GOTO 840 I 310 CLS::PRINT CHR$ (23) �Accepts data 830 NEXT K CP 0 320 GOTO 980 840 GOSUB 680 : 60SUB 850 : RETURN 330 N=N+ 1 :I=N:: IF N>12 PR INT"No more space":FOR L= 1 TO 500: NEX 850 PR I NT� 960, "Press C to copy, 0 for options" ; 7Screenprint s T::GOTO 190 ubroutine 340 INPUT "Activity name ";A$:SD$ ,O>=LEFT$ (A$,25 > 860 R$= I NKEV$ :IF R$="" GOTO 860 350 IF SD$ <1 ,O> ="XXX" THEN N=N-1 : PR INT"Rewrite entry" ::: GOTO 34 870 IF R$= "0" GOTO 190 ELSE IF R$="C" GOTO 880 ELSE GOTO 860 0 880 V= 1 5360 360 IF SD$ <1 ,O>="ZZZ" THEN N=N-1 :: GOTO 190 890 FOR R=O TO 14 370 PRINT" Importance ? "; 900 FOR C=O TO 63 380 I$=1NKEV$:: IF I$=" " GOTO 380 910 LPRINT CHR$ >; 390 IF I$<"1" OR I$)"9" GOTO 380 ELSE PRINT I$::: SD$ , 1>=1$ 920 NEXT C,R: LPRINT" ":LN=LN+ 16: POKE 16425, LN 400 PR INT"Feasi bi lity ? "; 930 IF LN= >64 GOSUB 950 410 F$= I NKEV$: IF F$="" GOTO 410 940 RETURN 420 IF F$< "1" OR F$>"9" GOTO 410 ELSE PR INT F$: SD$ , 2> =F$ 950 IF PEEK <16425> <70 THEN LPR INT" ":80TO 950 7Pagi nation subro 430 SD$ ,3>=STR$ (VAL ,1>>*VAL ,2>>> ut ine 440 PR INT: GOTO 330 960 CLS ::: PRINT: PR INT::PR INT"Pl ease tear of f page, then press any I< 450 CLS �Echoes data ey" 460 H=1:GOSUB 680: GOSUB 850: GOTO 190 970 R$=INKEV$ :IF R$=" " GOTO 970 ELSE POKE 16425, 1:LN=O : RETURN 470 CLS:: PRINT CHR$ (23> "Add more line ":GOTO 330 980 CLS: INPUT"N = ";N "Test data subrout ine 480 CLS:PRINTCHR$ (23> "Which line wi ll you change";::INPUT C 990 FOR L= 1 TO N 490 INPUT"Activity name ";SD$ ,O> 1000 I =L

500 PR INT" Importance ? "; 1010 NO=RND <26> :SD$ ,O>=STR I NG$ <15� CHR$ < N0+64> > ""0 510 l$=INKEV$: IF I$="" GOTO 510 1020 N1=RND <9> :SD$,1>=STR$ tf) 520 IF I$("1" OR I$)"9" GOTO 510 ELSE PRINT I$::SD$,1> =I$ 1030 N2=RND <9> :SD$ ,2>=STR$ ["11 530 PRINT"Feasi bi l ity ? "; 1040 SD$ ,3>=STR$ (N1tN2 > w +=- 540 F$=INKEV$: IF F$=" " GOTO 540 1050 NEXT: GOTO 190 VOLUME 4, NO . 2 (SEPTEMBER, 1983) MICR0-80 PAGE 35

***** NEXT MONTH 'S ISSUE *****

Next month 's issue wi 11 contain at least the fo 11owi ng programs p 1 us the usua 1 features and arti cles . An {80) after a program title indicates that the program wi ll be for TRS-80 Model 1 /3 or System 80/Vi deo Genie. A ( CC) indicates that the program wi 11 be for the TRS-80 Co 1 our Computer and (Peach) that the program is for the Hitachi Peach. ** HAMBURGER (80) L2/16K ** ** HIGH RESOLUTION SCREEN SCORE SUBROUTINE (CC) ** It is your job to make hamburgers. You have got some buns, eggs, sal ad and meat . Thi s subroutine can be added to any basic The only troub 1 e is that whi 1 e you are program that requires a score di spl ay on tryi ng to put the hamburgers together, a high reso 1 uti on screen . The size of a couple of aggressive sausages are tryi ng the score numbers and their position can to catch you . The bigger the hamburger, easi ly be changed to suit your needs the bi gger your score. al l that has to be done to use the subroutine is to use the vari ab 1 e SC to contai n your ** XUSR SCREEN FILL SUBROUTINE (80) L2/4K ** score and then cal l the subroutine.

Thi s very short but powerful subroutine gives you a new function that you can use ** SYSTEM TAPE MAKER (80} L2/16K ** wi thi n your own programs . Wi th thi s program you can insert X=USR ( N) where N is a number Just for the Level 2 users , thi s uti lity from 1 to 255 and the screen wi ll fi ll gives your machine the abi 1 i ty to save with that character at machine 1 anguage any block of memory to tape , either from speed. a BASIC program or from the command mode . Al l you have to do is type SAVE name ** WORLD CHAMPIONSHIP BOXING (CC) ** addrl addr2 addr3 . Where name is a six digit name , addrl is the start address, If you ever f e 1t like a punch -up wi th your addr2 is the end address and addr3 is the computer, now' s your chance. The computer optional entry poi nt . controls one of the boxers and you contra 1 the other . If you don't want to get knocked out you better keep on the move - the computer wi ll show no mercy! ! ** BLOCK GAME (HP) **

** OTHELLO (HP} ** Thi s is a two player game in which each pl ayer controls a graphic line wi thin a This is the same game , (di fferent program confi ned area. As each p 1 ayer ' s 1 i ne moves , and author though) , as the one that appeared it gets longer and longer. You must try last issue for the Colour Computer . The to force your opponent to run into the game is p 1 ayed on an 8 x 8 board and you border - himself or you . The fi rst pl ayer must outfl ank your opponent to fl ip his to hit somethi ng is the loser. playi ng pieces to your colour .

E 0 � CJ') 01 a.. e E a...... ro Q) CJ') .r:: Q) ...... CJ') ...... 0 ro u .r:: c $ .'!::! Q) Q) "0 c > 0 0 roc Q)CJ') c. Q) ...... c..i E ...... s­ 0 Q) ro o c .n· > 0 4- - ...... ro CJ') c c E 15 '6 � s­ 0 a.. O'l ·;:;u c 0 � .r::...... s­ ...... 2 ...... o. CJ') c :::J Q) 0 '"0 .s "'0 > Q) Q) c ...... In ...... ro ro ro 0 :::J -o' .r:: 0' ...... uo c CJ') !:CO "0Q) • Q) ...... Q)l ro Q)c 0 BQ) e Q) O::: > ro E .s::: u ...... CJ') Q) -1-)1-4 Q_;t: > Q.. CJ') Q) :::=::: :::J e s- Q) .r:: a.. CJ') ...... Q) I: 0 '"0 ..... :::J "' .s . .... CJ') ;!:: In I: CJ') >0 I: 0 Q) Q) s: 0 O•r­ E -o Q)CJ') U-1-) ro "0 �_g E 01 res z :::J CJ') u Q).O CJ') r-- :::3 Q) Q) 0.. c.. c 0 0 .r:: l.U"' u... I- VOLUME 4, NO . 2 (SEPTEMBER, 1983) MICR0-80 PAGE 36

***** CASSETTE/DISK EDITION INDEX ***** The cassette editi on of MICR0-80 contai ns a 11 the app 1 i cab 1 e software listed each month, on cassette . For machine 1 anguage programs copies of both the source and object fi 1 e are provided. A 11 programs are recorded twi ce. Leve 1 1 programs can only be 1 oaded into a Leve 1 2 machine if the •Level 1 in Level 2• program from the MICR0-80 Software Li brary - Vol . 1 is loaded first .

Note : System 80/Video Genie computers have had different tape-counters fitted at different times. The approximate start positi ons shown are correct for the very early System 80 without the vo 1 ume contra 1 or 1 eve 1 meter . They are probably incorrect for 1 ater machines . The rates for a cassette subscripti on are pri nted on the inside front cover of each issue of the magazine .

The disk edition contai ns al l appl icable programs which can be executed from disk. Level 1 di sk programs are saved in NEWDOS format . Users require the Level I!CMD uti lity suppl ied with NEWDOS+ or NEWDOS 80 version 1.0 to run them.

APPROX. START POSITION SIDE 1 TYPE I.D. DISK FILESPEC CTR-41 CTR-80 SYSTEM 80

PRIORITIES L2/16K p PRIOR/BAS 18 10 5 II II 63 35 17

DESERT CHASE L2/16K D DESERT/BAS 105 58 30 184 103 58

FORMATION SYSTEM FORMAT FRMATION/CMD 257 144 84 II 281 157 92 FORMATION EDTASM FORMAT FRMATION/EDT 304 170 103

SIDE 2

FORMATION EDTASM FORMAT FRMATION/EDT 18 10 5

OTHELLO coco 0 170 95 II 193 108

TOWER OF HANOI coco T 215 120 II II 2.37 133

TOWER OF HANOI HITACHI TOWERS 261 146 II 323 181

REGISTER DISPLAY HITACHI REG/BAS 330 213 II 391 219

-i (1)::;,- 0 s: (") ::;,­ (") (1) (!) ::0 ..c :::l c d 0 (") CD Co 0 � 0 (/)(1) r- "'0 -i N N N c. ::0 (1)::;,- s: 0 l"tJ 0 3 3 3 � < 0 0 iii ...... 0 8l (") m ..... ?" ?" :::l C!) ::0 C)r- (1) C/) c (/) (/) (/) ..... :JJ OJ 0 (") ..... c c ::;,- cn O QJ (") (/) Cl) C/)-i u;· 0" 0" c O clo :::l :0 (/) � � 55 7\ - c 0" co (") "'0 u; (1) ...... (/) ::t ---� · QJ � · 0 0 ::t:-t' '"'I -i .....(1) 0 � 8 c. -c· � 0 c...... s: :5:: ...... 3 )>!=' 2 0" s: C!) )> � (1) (") (") (5' Ctc (") 0 ::0 :0 :::l cn o-; 0 0 0 (") ...... C!)s ooo� xo c s: :JJ � ::0 0 0 0 ::ON.. :::l 0 t::J 0 Co Co · )> ...... :::l .o :5:: CD l"tJ � z Co0 p 3 c.w c < :JJ "C "C () (I) ;r>c:;') en ::0 m 3 0 (!) c(/) (/)c � (J'I0 X 0" (!) 0 c CD a...... Co oo '"'I :::; 0 '!=' � �· (1)::;,- CD � we m (!)0.: c. (") tl- �:E ::l u; QJ 0 .... · (/) c. (") CD(/) 0 � 0 0 CD ...... QJ .c c...... CD...... � C'l� CD 0 ;::;: CD < (5' c. "'0 :::l ::0 ....� ;::;: Q (5' (")m :::l "Q r;· � SAVt: A PACKt:T ON MICR0·801S DISK DRIV:t: PACKAGt:S fOR TKS·80 MOD:EL I AND SYST:EM 80 MICROCOMPUT:EKS

SINGLE DRIVt: PACKAGE from... $499 DUAL DRIVt: PACKAGE from •.. $874

Bigger volume means lower cost price, which we are passing on to you. Avoid the annoying bundle of cables, wires and separate boxes. MICRO· SO is now offering our well·proven MPI disk drives in attractive, self-contained single or dual·drive cabinets complete with internal power supply. Our drive 0 and dual·drive packages also in· elude the appropriate version of DOSPLUS and dual·drive cable. The best news of all is the specially reduced package prices ... SA\ff $23 - $107 over our already low prices! Choose the appropriate system from the table below:

No. of No. of Dosplus - DRIVt: TYPE Capacity Price Tracks Heads Version

DRIVE 0 1 x MPI B5 1 40 1 lOOK 3.4 $499 $137.95 1 x MPI B52 40 2 200K 3.4 $639 $97.95 1 x MPI B92 80 2 400K 3.4 $799 $107.95 DRIVE 1 1 x MPI B5 1 40 1 lOOK $415 $33.00 1 x MPI B52 40 2 200K $525 $23.00 1 x MPI B92 80 2 400K $23.00 *Represents the saving compared with buying all the items included in the package separately

•Drive 0 package includes one bare disk drive, self-contained single· •Drive 1 package includes one bare disk drive and self-contained drive cabinet/power supply as illustrated, two drive cable and the ver· single-drive cabinet/power supply as illustrated. sion of DOSPLUS indicated.

If it's a dual·drive system you need, then take advantage of our dual·drive package and SAVE a further $40 on the price of two single·drive packages ...

No. of No. of Dosplus DRIVE TYPE Capacity Price Tracks Heads Version

2 x MPI B5 1 40 ea 1 ea 2 X lOOK 3.4 $874 2 x MPI B52 40 ea 2 ea 2 X 200K 3.4 $1125 2 x MPI B92 80 ea 2 ea 2 X 400K 3.4 $1454

Dual·drive package includes two bare disk drives, self-contained dual· NOTE: All 40 track drives are completely compatible with 35 track drive cabinet/power supply as illustrated, two drive cables and the operating systems such as TRSDOS. DOSPLUS allows you to realise an version of Dosplus indicated. additional l4% capacity compared with TRSDOS. Under DOSPLUS 3.4, 80 track drives can read 35/40 track diskettes. All disk drive components are still available separately:

BARt: DRIVt:S - MPI drives offer the fastest track·to·track accesstime (5 milliseconds) available. All drives are capable of operating in double density for 80% greater storage capacity.

Price freight Price MPI B51 40 track, single·head, lOOK $349 $5.00 Self-contained, single drive cabinet/power supply $99 $5.00 MPI B52 40 track, dual·head, 200K $449 $5.00 Self-contained, dual·drive cabinet/power supply $135 $5.00 MPI B92 80 track, dual·head, 400K $619 $5.00 Two drive cable $39 $2.00 Separate, dual-drive power supply $85 $8.00 Four drive cable $49 $2.00 DOSPLUS 3.4 $149.95 $2.00

Prices are fOB Adelaide. Add $5.00 freight for single drive package, $10.00 for dual·drive package. Prices are in Australian dollars. freight is road freight anywhere in Australia. All items carry a 90·day parts and labour warranty. Repairs to be carried out in our Adelaide workshops. LEVEL 2 ROM ASSEMBLY LA GE T OLKIT by Edwin Paay FOR TRS-80 MODEL 1, AND SYSTEM BONIDE

This is a new package consisting of two invaluable components:

• A ROM REFERENCE Manual which catalogues, describes and cross-references the useful and usable ROM routines which you can incorporate into your own machine language or BASIC programs.

• DBUG, a machine language disassembling debugging program to speed up the development of your own machine language programs. DBUG is distributed on a cassette and may used from disk or cassette. Part 1 of the ROM REFERENCE manual gives detailed explanations of the processes used for arithmetical ca lculations, logical operations, data movements etc. It also describes the various for­ mats used for BASIC, System and Editor/Assembly tapes. There is a special section devoted to those additional routines in the TRS-80 Model 3 ROM. This is the first time this information has been made available, anywhere. Differences between the System 80/Video Genie are also described. Part 1 is organised into subject specific tables so that you can quickly locate all the routines to carry out a given function and then choose the one which meets your requirements. Part 2 gives detailed information about each of the routines in the order in which they appear in the ROM. It describes their functions, explains how to use them in your own machine language programs and notes the effect of each on the various ZBO registers. Part 2 also details the contents of system RAM and shows you how to intercept BASIC routines. With this knowledge, you can add your own commands to BASIC, for instance, or position BASIC programs in high memory - the only restriction is your own imagination! The Appendices contain sample programmes which show you how you can usethe ROM routines to speed up your machine language programs and reduce the amount of code you need to write. DBUG: Eddy Paay was not satisfied with any of the commercially available debugging programs, so he developed his own. DBUG: allows you to single-step through your program; has a disassembler which disassembles the next instruction before executing it or allows you to bypass execution and pass on through the program, disassembling as you go; displays/edits memory in Hex or ASCII; allows Register editing; has the ability to read and write System tapes and all this on the bottom 3 lines of your screen, thus freeing the rest of the screen for program displays. Four ver­ sions of DBUG are included in the package to cope with different memory sizes. The best news of all Is the price. The complete level 2 ROM ASSEMBLY LANGUAGE TOOLKIT Is only:

- Aus. S29.95 + S2.00 p&p -UK £1 8.00 + £1.00 p&p SPE<..IAL OFFER TO OWNERS OF THE LEVEL II ROM REFERENCE MANUAL ... UPGRADE TO THIS ASSEMBLY LANGUAGE TOOKIT FOR ONLY $19.951 Send back your original Level II ROM Reference Manual plus a cheque, money order or Bankcard authorisation for S 19.95 plus S 2.00 p&p and we will send you the new ASSEMBLY LANGUAGE TOOLKIT