Dale’s Atari 800 Games › ACE newsletters
ACE newsletter, October 1985
The newsletter of ACE, the Atari Computer Enthusiasts of Eugene, Oregon. Read the scanned issue (PDF).
Scanned from my own copy of the newsletter. I sent my scans to Kay Savetz in 2021, and Kay put this one on the Internet Archive as ACE_1985_10.
Below is the text of the whole issue as read by machine OCR (Tesseract) from the scan. It hasn’t been corrected, so expect mistakes, especially in program listings. The PDF is the real thing.
Page 1 (scan)
Avan é Ng Computer ENTHUSIASTS 3662 Vine Maple Dr Eugene OR 97405 OCTOBER, 1985 Mike Dunn, Jim Bumpas & Larry Gold, Editors QUESTIONS AND ANSWERS MEETING
Page 2 (scan)
BUMPAS REVIEWS Our recent local user group meeting was spectacular enough to deserve comment here. The impressive thing was all the new activity around the Atari 130XE and the entire 8-bit line of Atari computers. ‘One company demonstrated a voice recognition system which had been developed on the C-64. But the extra memory in the Atari 130XE makes this system work much more efficiently. It’s very impressive to see someone speak ‘red’ into a microphone and have the Atari display the color red on the screen. Kirt Stockwell demonstrated his company’s new product, Mindlink, a high-powered BBS. Ralph Walden demonstrated his new product, an implementation of the C language with linker and editor. He told us @ “benchmark” test he ran was faster on his compiled C for the 8-bit Ataris than with DRI's C language for the STs, and faster than a C language he tested on an IBM PC! The $35 he asks for the disk seems very reasonable. ‘Another product, Upgrade, installs another 64k into your Atari 180XE to give you a total of 192k of memory! The software they provide permits dynamic assignment of the ramdisk to any drive from 1 to 3. They also had an old Atari 800 with memory expanded up to 256k! Imagine. An 8-bit Atari with twice the memory of a Macintosh and memory equal to the (perhaps soon to appear) C-Amigal The ST sort of took a back seat at this meeting. A HEX game was shown, as well as a demo disk of a game called SUNDOG. Stuff (This will be the section for STrelated material in ACE) I've been appointed “ST Librarian” for the ACE, and | already have three disks of demo programs, as well as some demo programs (advertisements) of some commercial programs available. If you specify color or monochrome, I'll mail you a disk for $15. HOW I MADE AN IBM-ST (An ST with 5.25” Disk Drive) By David Small, Antic Publishing Inc., Copyright 1985. Reprinted by Permission. You can read and write IBM PC disks on your Atari ST if you connect @ 40 track 5.25” disk drive to your 3.5” disk drive . . . You cannot use the disk drive from your 8-bit Atari . . . unless it is an ATR or Percom drive. . .. They are “industry standard” drives which communicate via standard 34-pin connectors. Warning: Before specifying how to hook up a 5.25” drive to your ST, we must caution you this is no job for electronics beginners. You need to understand and modify the circuitry of whatever 5.25" you are using. Debugging your new system can be a frustrating experience. Not only ‘that, when you open your ST drive you'll void the warranty. Ribbons & Pins: Of the 34 pins in the standard industry connector, only about 14 are used. The Atari ST brings these 14 wires out in a short, thick cable which plugs from the ST into the first drive's IN connector. This cable uses a non-standard 14-pin DIN connector, but it carries industry standard signals. Our goal is to get these signals to a standard 34-pin connector. Theoretically we could put a 34-pin edge connector ‘on one end of a ribbon cable and a 14-pin DIN connector on the other and we have our disk drive cable. However, in practice | can find a 14-pin DIN connector. Kinky Wiring: There's another catch. Atari does something kinky with the drive B select signal. It’s on pin 6 of the DIN connector when ‘coming from the ST. But inside drive A it’s switched from IN connector pin 6 to OUT connector pin 5 where it becomes drive select for drive B. This means Atari ST drives always listen on pin 5 for select, and the daisy chain scheme gives the proper drive the correct signal. Thus the two connectors on the back of the ST drive are not interchangeable, like other Atari drives. Plug your ST into the OUT connector and the drive won't work. Inside the Drive:: The method I choose to use is to tap into the signals inside the 3.5” ST drive. Besides voiding your warranty, this will probably require you to cut a slot in the drive case for the new ribbon cable. If you open up the drive (use a phillips screwdriver) you'll find the 14-pin DIN connector expands to (surprise!) an industry standard 34-pin ribbon cable, Of course, it does this inside the shield to prevent radio noise from leaking out. A small circuit board has the two 14-pin connectors (IN and OUT) mounted on it, and it connects to the 34-pin ribbon cable inside the drive. | put a “tap” from the 34-pin ribbon cable in the ative to the 34-pin ribbon cable running to my remote 5.25" drive. I then use a DB-40, 40-pin male and female clamp-on connector to clamp one side to the ribbon cable and the other to the remote drive's cable. Then | plug the two DB-40s together. You don't have to use a DB-40. Any clamp-on connector which covers the first 34 pins will work fine. Pin Swapping: But we're not done yet! We have to jump from pin 6 of the dIN connect (drive B select) to pin 12 of the ribbon cable (drive B select) to get this signal across. Otherwise it doesn’t show up on the 34-pin cable. This is easy to do on the bottom of the 3.5” drive's DIN connect board. Drive B Configuration: Almost done. Now we need to set the remote drive as drive B. Sometimes it’s called drive 1 or drive 2, depending on whether the manufacturer numbers drives at 0 or 1. When a drive is idle, a five-volt signal (HIGH) exists on the BUSY line. When the computer wants to access the drive, it pulls down this signal to zero (LOW). When the computer is finished with the drive, it releases the signal and the drive “pulls up” the signal to its original five volts. If two drives are hooked up, only one may contain pull up circuitry because the computer can only pull down five volts. Pull-up circuitry usually is contained in a chip in the drive. And now you are at a point where you must know enough about your 5.25” drive to figure out where the chip is. Since the ST drive A contains all the pull-up termination circuitry we need we must remove termination packs from the remote drive. In the cas: of my Tandon TM-100-2 drive | also need to deal with the select line termination, since it doesn’t go through the resistor pack. | have to clip resistor R14 from my Tandon to get rid of the added termination. Special Note: The ST monitor throws out a lot of magnetism. If you don't keep your drive at least one foot from the monitor, the disk’s heads will pick up the monitor's signals and confuse the read data. You'll immediately notice data error if you get your drive close to the monitor. This is good reason to use a fairly long ribbon cable (3 feet or so) [we haven't noticed this problem in-house — ANTIC ED]. ALL DONE! IBM ST; . . . With an IBM PC disk in that 40 track drive, . . . click on the B icon. It'll pull up the disk’s directory into folders and “text only” files, You'll notice on the top of the window a PC-DOS type of “pathname” consisting of multiple (if needed) folders and a filename. GEM simply turns the concept of pathnames into folder icons and moves you through the path by your actions of selecting, opening, or closing a folder. Of course, you can't run IBM programs because they are written in languages which the ST cannot understand. However, you can freely copy and use text files and the data within them. Furthermore, if you write back out from the ST to the PC disk, you'll find an IBM has no trouble reading what you wrote. ATARI - ATT&T DEAL? The headiine of the lead business story in the Sept. 9, 1985 issue of the San Jose Mercury reports that Atari and AT&T are “hammering out a sales deal.” AT&T will reportedly be selling Atari ST computers in their phone stores. The Mercury credits the story as originating in the Washington Post. This report said an agreement is under negotiation which will give Atari a major customer for the ST while giving American Telephone & Telegraph a low-cost entry into the home and small business personal computer market. The ST would be a natural fit into AT&T's upscale consumer phone marketing pipeline. Naturally, both Atari and AT&T responded with a big “No Comment” when asked to confirm that negotiations were going on. But that’s standard operating procedure at this stage of the game. ANTIC PUBLISHING INC., COPYRIGHT 1985. REPRINTED BY PERMISSION. TRAMIEL GOES FOR BLOOD IN ATARI “RIP-OFF” AD "9/4—According to the latest Adweek, an advertising trade magazine, the next Atari ad takes dead aim at the Mac, the C-Amiga and the IBM PCAT. “The first ad from Atari's latest agency shows the rival computers and their suggested list prices. A big headline shouts, "THERE'S ONLY ONE WORD FOR THESE PRICES: RIP-OFF.” “Not exactly the old Atari’s Alan Alda warm sell. The ad is to debut in Rolling Stone 9/26 as the latest proof that Jack Tramiel is no shrinking violet. Ireally hope such an ad campaign does not go far. | think the prices speak for themselves. We don't need to hear about those other computers in Atari ads. Let’s hear about what the Atari ST can do that the others can't,
Page 3 (scan)
S/T Applications, 10760 Hwy 116, Forestville, CA 95436 is a monthly magazine devoted to the Atari ST. Its first issue is 20 pages and subscriptions are $25 for 6 issues or $50 for 6 issues on disk. The first issue contains a couple of reviews and lists some software coming out for the ST. It also contains some information about the OS. The editor admits to no experience in producing a magazine, and this first issue is rather poorly photocopied. There is no advertizing, so the pages are full of content — which is sure to become more meaty as time goes on. | hope his reproduction improves quickly One of the more interesting items in this first issue appears on page 4 as a “Reader Comment”: “For those of you who didn’t see Computer Current's Aug 27-Sep 9 issue: On page 43 they tell how some insider at Atari sneaked these four icons in among the control characters as a joke. They make a picture of J.R. "Bob" Dobbs of the Church of the Sub-Genius. He is the invention of art students who wanted to create a bogus religion based on flying saucers, lunatic conspiracy theories and the occult. One of his sayings is "F - ‘em if they can't take a joke.” “if you check pages 63 and 65 of your sourcebook for Atari (ST) LOGO, you'll see these icons as chars 28 through 31, if you look carefully. They’te just to the right and above the two which make the Atari symbol. “Study the following listing to see the difference between print and type. TO BOB REPEAT 35 [TYPE CHAR 28 TYPE CHAR 29. PR “REPEAT 35 [TYPE CHAR 30 TYPE CHAR 31] PR "PR [F - ‘EM IF THEY CAN'T TAKE A JOKE.] END You can also print out the Atari logo with this short routine: TO ATARI REPEAT 25 [TYPE CHAR 14 TYPE CHAR 15 TYPE CHAR 32] END Lois Hansen Oakland, CA SynCalc Templates syn’ 17 Paul Dr., San Rafael, Ca. 94903.) The SynCalc Templates are designed to be used with SynCalc. They are 22 of the most commonly used spreadsheet formats. One might have to spend hours just setting up one of these. They cover everything from LINEAR REGRESSION CALCULATIONS, BOND PORTFOLIO EVALUATIONS, to COST ANALYSIS OF PAINTING A ROOM, and KITCHEN MEASUREMENT CONVERSION TABLES. There is something for everyone who uses a computer. Not only did Synapse cover the gamut in the different types of templates which can be used, but they made them simpte to use, The instructions fit into the notebook coming with SynCalc. They just make up another section to refer to very easily. Apart from the fact that the instructions are easy to use and read they cover everything. First off they start by telling you how to load the program once you have loaded SynCalc. Then they give you an instruction sheet for each template, even the index not only gives the name of the template but tells what it does. If you use SynCalc then you need this program as even if the templates don’t cover what you want they are easy to convert to what There is one function of this program which | have not used as yet and that is the increased memory which can be used if you have such This is a well thought out program which is a useful addition to the Synapse series. If they add a word processor to this series one could just buy the series and do about everything one might want with a computer. | hope they keep up the good work and bring out more of this type of program to update and enhance their other programs. This is the type of software which will make the computer a more useful tool for all to use. — LARRY GOLD ERACE WALLY’S WORD WORKS (365, Sunburst Communications, Elementary disk (grade levels: 4-6) This package adds the elements of whimsy delight and challenge to the practice of basic language skills. Identifying parts of speech is central to the study of sentences. Wally is a wallaby (a small kangaroo). The player plays by directing Wally over the sentence and picks up words with the arrow key/joystick, Then he drops that word into the correct pocket (ie; noun, verb, preposition, etc.). The player also get bonus points for evading the speedy Rovers who are little creatures who chase Wally when he has not picked up a word The main menu has 9 categories- Instructions, etc. The package can be tailored to fit the student's needs. It is a neat way to teach the parts of the sentence in a fun way. Available are two more disks in this series: Pocket Pitfalls and Rovers’ Revenge for more advanced studies. ‘As usual, Sunburst sends a bright orange notebook to hold the manual and disks. The instructions are simple to use with ideas. FAREWELL The Ness’ have been “unsung heroes” of ACE for a long time. They have spent many hours keeping our program library operating for several years. We all regret their moving on, and wish them the best of luck. The new Program Library chairpeople are Chuck and Jody Ross, 2222 Ironwood, Eugene, OR 97401 . Thanks again, Ron and Aaron! — M. Dunn, Co-Editor SO LONG, FAREWELL, & THANKS ‘After a year of trying to start a new career, | have decided to return to the airline industry and will be moving (my body only) to Memphis, Tennessee. My heart and home will always be here in Eugene and | will be commuting between the two as often as possible (but not often enough to take care of the library}. Aaron will be starting college at Oregon State this fall majoring in the sciences, and will also be unable to care for the library. Since they have had two years of rest, the duties of the library will be returned to the capable hands of Chuck and Jody Ross. We will certainly miss the early morning phone calls from overseas, the pile of mail arriving daily, and the most able assistance of our postal service in properly folding the disks we receive. The mail we have received from nearly every corner of the world has made this a most enjoyable task. We are proud to have been involved in the rapid growth of the library, from 17 disks in 1983 to nearly 70 now. However, this could not have been possible without the vast support we have received from our many readers. We have made many friends both for the library and ourselves and we hope to continue to hear from you. Thanks to the many contributors and correspondents such as Stan ‘Ockers in Ilinois, Paul Freeman in Maryland, Ed Slawson in Maine, Wayne Real in Australia, and Les Ellingham in England. The trouble is that if we mention a few, we will omit many others so we will just say THANKS TO ALL OF YOU. Locally, thanks are due to John Kelley in Portland for his many fine contributions, his warmth, friendship and hospitality. In Eugene, we have to say thank you to Mike Dunn, Larry Gold, Jim and Linda Bumpas, Chuck and Jody Ross, Kirt Stockwell, Dick Barkley, E.J. Knoll, Bob Browning, Bruce Ebling, Ruth Ellsworth, Don Marr and his staff at Computer Palace and to Stacy Goff (wherever you are]! We want all of you to know we truly appreciate your assistance. There are many more names which should be included, but space precludes listing them here. Your support and friendship will always remain dear to us. We want to say thanks to all of you who started your letters with, “Dear Mr. & Mrs. Ness...”, as father and son, we found this quite humorous. A very special thank you to Carole Ness, wife and mother, for her understanding and patience beyond reasonable limits, while we had computer equipment and library materials scattered throughout the house. Also we want to apologize for occasionally making disks instead ‘of keeping the lawn mowed or the garage cleaned. ‘Again, our thanks and best wishes to all of you. — Ron and Aaron Ness Play, demo, Definitions, 3
Page 4 (scan)
SORTING ROUTINES IN BASIC AND ACTION Sorting data is an excellent example of something which should be done by a computer and not done by hand. Sorting routines vary widely in complexity and speed of execution. This article discusses several sorting algorithms in both BASIC and ACTION. The actual execution times and source code are given for each algorithm. OVERVIEW ‘There are six program listings at the end of this article. Here is a short description of each: (1) NUM1000.BAS - Creates a test file of 1000 random numbers (2) NUM1000.ACT - Same as (1), written in ACTION (3) SORTNUM.BAS - BASIC Bubble and Heap sorts program for numbers (4) SORTNUM.ACT - Same as (3), written in ACTION (5) SORTSTR.BAS - BASIC Bubble and Heap sorts program for strings (6) QUICKSRT.ACT- Uses procedure from ACTION Toolkit to sort numbers If you compare the code, you can see that precisely the same algorithms were used for both Listings 3 and 4. A LISTed version of the BASIC program in Listing 3 was used to create the ACTION program in Listing 4. This was made easier by the fact that Listing 3 consisted of several sets of subroutines. The hardest part of the conversion was unraveling the spaghetti code between lines 680 and 730 of Listing 3. Some print statements were eliminated in the ACTION versions, since they run very fast. RESULTS The following table shows the number of seconds required to sort sets of numeric items. The input file contained random numbers between 1 and 1000, which were produced by the program in Listing 1. The following results are for the sort programs in Listings 3, 4, and 6. Items 100 999 BASIC Bubble Sort 115 13,513 Heap Sort 31 471 Machine Language Bubble Sort 1.60 173 ACTION! Bubble Sort 1.25 128 Heap Sort .50 7.0 Quick Sort .50 6.0 The following table is similar to the prior table, except that The input file contained sorted numbers between 1 and 1000: Items 100 999 BASIC Bubble Sort 1.5 5 Heap Sort 32 493 Machine Language Bubble Sort 11/60 20/60 ACTION! Bubble Sort 1/60 11/60 Heap Sort .50 7.3, Quick Sort .60 37 As shown above, the Bubble sort is very fast if the data is sorted, while the Quick sort is much slower! The Heap sort is not sensitive to whether the data is sorted or not. No table was prepared for the sort routines in Listing 4. These routines are similar to those in Listing 3, but they have been modified to sort string variables. The sorting times bear similar relationships to those shown above for the Bubble and Heap sorts. The file DUPSYS was used as a source of string data that would be constant. DISCUSSION OF SORTING ALGORITHMS The programs in Listings 1 and 2 create a test file that can be used by the other programs. This same data was used by each sort routine. Otherwise, some extraneous differences in execution time could result due to non-random numbers! Bubble Sort - BASIC: this is the simplest of all sort routines. Unfortunately, itis also the slowest, and the most inefficient. An increase in the number of elements by a factor of 10 increases the sort time by a factor of 117! The BASIC version of the bubble sort is shown in lines 500 to 600 of Listings 3 and 5. Bubble Sort - Machine language: This is approximately 75 times faster chan the BASIC version. This routine is from the March 1982 issue of Compute! magazine. It is the only published machine language sort for the ATARI | know of which actually works. This routine is contained in the DATA statements from line 6160 to 6330, and the setup is shown in lines 400 to 500 of Listings 3 and 5. The machine language version is quite fast, but it suffers from the same inefficiency as the BASIC version. RICHARD GROSZKIEWICZ SOFTWARE POLISH The method for calling the machine language bubble sort is clear when sorting strings, as shown in Listing 5. It is trickier when used to sort real numbers, as shown in Listing 4. This is because each real number is stored in six bytes of memory in ATARI BASIC. This is why the record length is declared as six in line 440. The machine language sort routine must be given the address of the array to be sorted. It is not possible to directly obtain the address of a real variable in ATARI BASIC. Instead, the string variable NUMS(4) is defined in line 1100 directly preceding the array $(999). The address of S(999) is equal to ADR(NUMS$)+4, since four bytes are allocated to the string NUMS. Cie last problem is that all arrays are allocated storage starting at the zeroth element. Since the first array element to be sorted is stored in S(1) instead of S(O), we must define the starting address to pass to the machine language sort as ADR(NUMS}+4+6, Bubble Sort - ACTION: This version of the bubble sort is 100 times faster then the BASIC version. This is faster then the machine language version of the bubble sort! The reason is ACTION stores the sort items as two byte integers instead of six bytes in memory. The machine language sort actually has to do three times as much work as a result. Heap Sort - BASIC: This algorithm is slightly more complicated than the bubble sort. It came from the April 1984 issue of PC TECH JOURNAL (which contains numerous other routines). The idea of this, routine is to pass through the data twice. It builds a “heap” the first time through. This is fairly fast for BASIC, and it is more efficient than the bubble sort. The heap sort starts out four times faster than the bubble sort, and ends up 30 times faster. Heap Sort - ACTION: This version of the heap sort is roughly 70 times faster than the BASIC version. This is a typical result of the type of speed improvement you can get by programming in ACTION! Quick Sort - ACTION: The actual algorithm for the quick sort is not shown in Listing 6. | cheated and used the version contained in the ACTION! Toolkit, and INCLUDEd it in my source code. There is a listing of the quick sort in Microsoft BASIC in the April 1984 issue of PC TECH JOURNAL. The quick sort is generally accepted as the most efficient sorting algorithm. It is alsc one of the most difficult to understand. I’ve included times for this algorithm to show that (a) it is very efficient on unsorted data, but (b) it becomes inefficient if the data is partially sorted already. SUMMARY /CONCLUSIONS Each of the sorting methods has strengths and weaknesses: Bubble Sort (BASIC): Very easy to understand, but too slow. Bubble Sort (M.L.): Fast for all but the largest arrays, very compact. Does not sort arrays correctly if they contain both negative and positive numbers. VP RAMBLINGS It is now October and the year is almost over. In the land of Atari many new things are happening. The one which has me excited is the laser-disk system allowing one to have a disk with say a complete encyclopedia on it and one can access any subject as quick as you can find it in the index, and with pictures. This can revolutionize libraries, and anywhere else where they store information. The new BBS is running very smoothly now as most of the bugs have been worked out. The only thing we have to do at this point is to change over to 1200 baud. We are working on that and soon we will have it running at that baud. Call the board and see what you think. | want to thank you all for your patience when we were having so much trouble with the board and many of you couldn't get on or your password was lost. We hope those problems and all the others are now gone forever. Remember this system requires you to put in your own PASSWORD and not one which we give you. Anyway, enjoy the board. We hope you will upload your programs to us so we may put them on the board for others to use and enjoy. As you may have surmised '"C” is the coming language for eight and sixteen bit machines, and we are publishing programs in this language. If you want to see more let us know and we can start a separate section devoted just to “C”. This month | have used several of XLEnt’s programs to do the newsletter. | hope you like what you see and next month | will have an indepth review of their products. 4 — Larry Gold
Page 5 (scan)
FILE: SORTSTR.BAS REN Cae PTamSORT THE Data REM CT a PCM BPOE STGRI/ERD OF SORT KEY 428 POKE 203,8:POKE 204,4 CS CMIABREC LENGTH=6 | WONT GSCENDING | 448 POKE 285,5:POKE 206 450 REH 468 AZUSRCADR (SORTS) , ADR (5S) , MD 478 RETURN 400 REH BUBBLE a 508 $18 T=8 520 FOR I=2 To K S38 LAST= (1-208 41 548 CURRENT=LAST#L 550 IF SSCLAST, CURRENT~1) (=59 (CURRENT, CURRENT#L-1) THEN 578 568 JOLDS=5$ (LAST, CURRENT-1) 25S (LA ST, CURRENT-1)=5$ (CURRENT , CURRENT#L-1) ; S$ (CURRENT, CURRENT#L-1) =HOLDS 57@ WEKT I:? 575 -1:TF KDA THEN 516 588? :RETURM S565 REN a 600 610 FOR LL=INT(H/2) TO 1 STEP -1 620 HOLDS=SS (LH CLL-1) #4, LLL? 638 GOSUB 68O:MEXT LLLL=1 640 FOR R=N-1 TO 4 STEP -1 650 MOLDS=55(LERFL, LEERHL)) 668 SSCLEREL, LECRE1)9=5$¢1,L) 678 GOSUB 680:NEXT R:? sRETURW 680 J=LL 690 2S 788 ON 2#SGHCJ-R) GOTO 710,720,730 710 IF SSCLACI“L) +1, LHS) (55 CLEUEL, (LC S#102) THEN Jost 728 IF MOLDS<SSCLECJ-1) #1, LJ) THEN SS (LH CT-1) #1, LET) 259 (LCL) +1, LD 60 T 0 698 738 HOLD25=1 ToS LHCI-4) 41, L4 RW 700 REM OLDS : HOLDS=SS (LHCI~1) +1, L* OLD25:? "."; RET IGETKEY ROUTINE] ' SORT BASIC 808 POKE 764,255 810 IF PEEK(7649=255 THEN 818 828 KEY=PEEK (764) 838 POKE 764,255 848 RETURN 880 REM PITHER BAUTTWES 988 OLOTINE=TINE 910 FLAG=1-FLAG 920 TIME=PEEK (20) +256% (PEEK (19) +2564PE EK C180) 930 TIME=IWT (1000XTIME/60) /1680 940 ELAPSE=TIME-OLOTIME 950 2 “TINE =; TIME 960 IF FLAG=@ THEN ? “ELAPSE E 978 RETURN 280 REM FELAPS a 1080 ? CHRS (125) 1918 POKE 712,8 1828 POKE 710, 4+16¥INT C16%RMDC1)) 1038 POKE 789,12 1100 DIM TYPS C1) , MUMS (4) , SORTS (1726) 1185 GOSUB 6800 ‘Which sort to execute’ Bubblesert" HL. Bubble" Heapsort":? :? C3) 1148 GOSuB 508 1150 IF KEY=21 1155 IF KEY=37 THEN TYPS: 1168 IF KEY=57 THEW TYPS: 1178 IF TYPSQ)"B™ AMD TYPS< PSQ"H" THEN GO TO 1148 120 2 “How many items do you wa nt to sor 1285 ? “Max = 999, Minimum = 16" 1218 INPUT MUMS 1220 TRAP 1216 1238 M=VAL CUMS) 1248 IF (10 THEN 1705 1250 IF W999 THEM 1265 1268 N=INT(H): TRAP 34567 1798 L=5 1888 DIM SSCWHL) , HOLDS CL) , MOLDZ$(L) 1805 SS=CHRS (8) 159 (HHLI=59;59(29=55 1818 WUMBER=WL 1828 ADDRESS=ADR (58) 1838 IO=1 1848 OPEN #I0,4,0,"D: DUP. SYS" 185@ GOSUB 7890 198 1988 1998 THEN TYPS: 2 RETURN REM 10. SORTS] iy iM" THEN GOSUB 4 2010 IF TYPS="B" THEN GOSUB S80 2028 IF TYP: THEN GOSUB 686 2900 RETURN 2990 REH LY :POKE 766,1 3100 FOR I=4 TO Mi? T,SSCLMCI-1)41, TH D:MEXT I 3908 POKE 766,6:RETURN 608 REM PUM GBey ample 3esumes records in PYM ss, number of record: is W CTRCMUgNced to pore starting and 6040 REM 6058 868 6078 6086 698 610 6118 6128 6125 6138 6148 6158 6168 6178 6168 6198 620 6218 6228 6230 6248 6258 6268 6278 6288 6298 6308 x18 6328 6330 700 fla miength, and ascend vs descnd REN PTA Bo TORT SORT KEY :VOKE 205, STR CTBENG OF SORT KEY:POKE 204, END} PIE BREC LENGT Joie Moment please. i FOR I=1 TO 126:READ & SORTSCII=CHRS (03 :MEKT I RETURN DATA 104,104, 133,217,104,133,216 ATA 104,133, 289,184,133, 208,169 DATA B,133,218,133,207,162,1 DATA 165, 216,133,214, 165,217,133 DATA 215,246,165, 214,133,212, 101 DATA 285, 133,214,165, 215,133, 213 DATA 105, 0,133, 215,164,203, 165 DATA 206,248, 10,177,214, 289,212 DATA 144,44,248,12,176,19,177 DATA 214,209,212,144,13,248,2 DATA 176,38, 208,196,204, 248,227 DATA 176,23, 144,223, 169,1,133 DATA 218,164,205, 136,177, 214,72 DATA 177,212, 145,214,104, 145,212 DATA 192,@,288,241,232,224,8 DATA 208,2,238, 207,228,208, 208 DATA 172, 165,289,197, 207,208,166 DATA 165,216,201, 0,208,144, 96 REM [cord 10 GET BYIES) 7e18 7028 778 7048 7958 TRAP 7188 TOCB=832+I0#16:POKE IOCB#2,7 ADRHI=INT (ADDRESS/2562 ORL O=ADDRESS-ADRIZS6 POKE IOCB+4,ADRLO:POKE IOCBtS, ADR
Page 6 (scan)
SORT BASIC CON'T
ar 7 MENU Written inc #7 © 5)
7068 NUMHI=INT (HUMBER/ 256) 7* This program lists a menu of */ /* remove the FREE SECTORS filename *
7078 NUPLO=MUMBER-256*NUMHT 7* “com files, and allows the */ /
7680 POKE TOCB+8,NUMLO:POKE IOCB+9,MUM /x user to select which file 47 count-=47;
aI 7* to run, */ — CloseallQ; /* close the directory *
7898 I=USRCADR (hhh VE") , TO*L6) ‘
71008 TRAP 44464:CLOSE HIO:RETURN main $¢ ifCicounty $¢
C BY WALDEN
ee STUDY.C EL
7 normal fort loop */
for Gi=4; i (185 ++i)
7 & complex for( loop */
¢ vald4; kt=12)
€ an infinite for€ loop. You could
/® get out of this with the break;
/% statement
eH)
% an example of the ?: statement
z= (ayb)? a
/® The above will assign to z either
7% a or b depending on which is larger
/* fatal error, so return to DOS #/
vain $¢ 7* run this program!
iC3;H4id $C
/® OVC recognizes only one ?: per line
int iocb,place,count,i, j,k, }fmargin;
char dirname (203, tmp (203,
filename (17*64] ;
/* (wildcard will be used unless */
7 the user specifies otherwise.
7 The default drive will be added */
7* by the normalizeQ function,
if (igetdos(dirname)) strcpytdirnane,
19) 5
7® don't allow any extentions */
if CGi=strche (dirname, '.13) > 0)
dirname (il
normalize (dirname, "COW"? ;
if(Ciocb=copen(dirname, ‘d')) ¢ @) $¢
printéConO FILES!\n"
7* Can't do a menu with no files! ¥/
exitO;
9
7% Wow we print the wenu ¥/
*
putchar('\f')3/% clear the screen */
*/
7* for future use */
I fmargi
7 Print all
for (plac:
tti,placet=i7) $¢
printeonnc- ", tA tid;
/* print the primary name only #/
(26 && place<count;
for (k=3; filename (placetk]
+k) putchar (filename Cplacetk]) ;
printfC"Can't open directory of putchar('\n');/% add the return #/
if Gi == 14) $C /% Second column #/
exitQ;
7% set the left margin */
Poke (8x52, 28);
7* reposition the cursor at the top o
7* read all the matching filenames */ f
printf("There 75",
G1)? “are i
7% so we split the printf statement
d playerZs\n", i,
aain® $€ /* run this program!
int i;
/® this will count the number of keys
7% pressed until the BREAK key
for (i=8;getchar 0)
printéc'\ntd keyts",
= 1)? "was"
NOTE is used instead of = in €
when used to compare two values
rather than assign one value to
another. Gi == 1) NOT Gi=i)!
It's a common mistake to make if
you're used to programming in BASIC
tepid;
7* the next column #/
‘ whileCcgetsCtmp,iocb) ) 8) $¢ position(26,0);
/® start with the drive #/ 9
strcpy(filenametcount, dirname) ; 9
7* add the primary name */ 7* restore the left margin #/
for (place=3,i=2; sti $¢ poke (0x52, 1fmargin) ;
/® stop if it's a space ¥/
ifGisspace(tmplil)) break;
else filename (countt(placet#)J=
position(2,23);
printé (Samoa) 5
7% until we get the correct input #/
while CisalphaCi=toupper (getkey 2)
& Gi-'A" > count/4799;
7% go run it! */
chain(filenamet (Ci-
9
Ab end of. the string #/.
filename fcount+place]=8;
7* add the extension ¥/
strcat(filenametcount,". COM") ;
9
7* Use the following line as a templat
7% to remove any files you don't want
7® to include in the nenu ¥/
if Gindex (filenametcount,":CC.")
continue;
else count#=17; /* next filename *
6
Page 7 (scan)
i FILE: SORTNUM. ACT
*
MODULE
RDEFINE GLOBAL VORIOBLE|
BYTE KEY, FLAG=(01, TYP, HFLAG
CARD ARRAY SCA
CARD «MK, I,T,H,
R,W2,L,LL, HOLD, RR, J,HOLOZ, JJ,RZ
| SUSI ERIC ROU SEAGIG SOO
*
PROC BUBBLE CO
*
=H
bo FTESTPRTO.
qr
FOR I=2 10 K
bo
IF 5€1-19)5(0) THEW
THI:H=S (1-4) :5 1-19 =5 009 15 (0) =H
FI
op
3} IF T=08C1/20) THEN PRIWTO".") FI
KET-1
UNTIL TKS
op
PRINTEC" "3
RETURN
| HDI IORI HIROTA III
*
PROC HEAPSHAPO) «=; UTA
_ IIIA IIIT III IRI IIE
*
J=LL
bo
FSUBGLESORT|
UNTIL HFLAG=1
SORT ACTION
IF JuCRR THEW
IF SQJ2(SCJ#1) THEW
Jastl FI. KEY=PEEK (764)
FI POKE(764, 255)
DO UNTIL PEEK(764)"255 00
RETURN
|S ESSERE THESE
IF JJ¢=RR THEN
IF HOLD{S(J? THEN
SCIN=50J) HFLAG=@ FIC x
FI PROC TIMER =; EERE
3 0 *
*
IF JJDRR OR HFLAG=1 THEN CARD tine
HOLD2=HOLD: HOLD=5 (1) BYTE p18=16,p19=19,p20=28
SCT3=HOLD2
FI flag = 1-flag
IF flag=@ } Mot Ast call
THEN = time = p20 + 256%
Cpls + 256%p18)
Print(Elapsed Time:
oD
Printe(tine/6@
RETURN PRINTC" AND “9
i HE is ialeledeipioiadielaleisiaiaiea PRINTCCTIME MOD 68)
® PrintE("/6@ seconds")
PRoc WEAPO RHEAPSORT) FI
i HEHE Hee
* 3 reset
RoW the
FOR L=4 To WZ clock
bo
LLsW2+i-L WO STEP 1!
HOLD=S(LL)
HEAPSHAP
i IF L=108(L/10) THEN PRINTCH,") PROC FIRSTSCREEN CD BCLEGa GND PRIN}
FI
BROS EBACE
0> = PRINTE 3
tes *
FOR R2=1 TO N-1
vo BYTE J,FIRST=(01
RZ MO STEP -4!
HOLD=5(R#1) IF FIRST=@ THEN GRAPHICS(@) FI
SORHI=S CAD FIRST==#1
HEAPSMAP CO POKE (712,62
i IF R=10"(R/10) THEN PRINTEH,I (16) POKE (710, 4416)
Fr POKE (709,12)
o> = PRINTEC ")
PRINTEC*
RETURN PRINTE(" Which sort to execute?)
; ” _— PRINTEC™
* PRINTEC* (8) Bubblesort"?
PROC GETKEY()
*
POKE (764,255)
aoa snunnaaaouenennirecniamuines PRENTEC!
jane PRINTEC “3
PRINTE(" CH) Heapsort™)
PRINTEC" ")
RETU
Page 8 (scan)
2 8 POKE 710,0:? CHRS (125) :222 0 E WAIT, CHECKING DATA!":FOR DEI ToL 10 DATA @,1,2,3,4,5,6,7,8,9, 8,8,18,11,12,13,14,15 AS OPEM W1,8,0,"D:RESCUE.DAT™ 20 DIM HEXS(91) , YSC1) ,HEX(22) :FOR H=6 TO 22:READ N:HERCKI=M:WENT KL IWE=99 QD=20736:HEM=AD:TRAP 68 25 TOTAL=@;LINE=LIWE+i8:? " LINE:"; IWE:READ HEXS:IF LEWCHEKS)()9@ THEM 11 t) 28 DATLIN=PEEK (183) #256XPEEK (184) :IF 0 ATLINADLINE THEN POKE 559,34:? “LIKE " FLIWE;" MISSING: ERD 38 FOR X=1 TO 89 STEP 2:DI=ASC(HERS(K, I-41 ASC (NERS (X41 , X41) 2-48: BYTE=H EXCDLIHLG+HER (DZ) 40 PUT 91, BYTE: TOTAL=TOTAL+BYTE:MERT X READ CHK:IF TOTAL=CHK THEM POKE 53279 3G0TO 25 58 GOTO 178 60 IF PEEKC195)<)6 THEN 138 70 POKE 559,34:? CHRS (125) ; CHRS (253) ;" WARNING, MAKE SURE PROGRAM IS SAVED!! 75 .7::7::7 " READY TO RUNCY/H) T vs 88 TRAP 1@8:CLOSE Wi:IF ¥! sTNPU 98 GET #1, BYTE:POKE MEN, BYTE: MEM-ERTL 95 GOTO 98 108 IF PEEK(1959=136 THEN A=USR(AD) :EN . 195 POKE 559,34:7 “ERROR ";PEEK (195): a 110 POKE 559,34:7 “NUMBER MISSING OR A ODED!" : END 120 POKE 559,34:7 “BAD DATA! 130 POKE 559,34:7 "ERROR ";PEEK (195): wD 1008 DATA 2865ESA@SFAZSEAIE7ZESCEAAING 8D0802A9578001820 STOSDOED4AICABDCBBZAD SE8D9SSIODGODAAIINGD IIS, 5404 1018 DATA A9688D07D4093E6D2F 0209036019 DOAIEZEDGFEZAIDESDSBEZAISIGDILOZAIESSD F482288053091480B3590901, 4644 1020 DATA BDCeSIIAeBDCHOZSDAIDZADIFDE 2901DGOAADLFDOZIOLFOFI4C7ESIADB4E200EA 4C7ESAN918A2069DIDSBESES, SISA 1838 DATA BADOFGEAILGSDS7S8AI118DBC596D SBSBAIOZBDGASIAIOBOSOSBSD4FSBSDGESEED CLOZA9OBBDSOGZAISSGDI1O2, 4724 1848 DATA AIFESDCISISOCESIAIEZSOBESIAI OIBDBFSIAIFCODCESIAIGRSOCISIBOBISIAISS ‘S8DBG59SDB4592068550 90080, 5938 RESCUE PLEAS 1858 DATA COS9BDO4D4OSCBZAGISZAI688DFS 19 BBD IBSINEDESIBDDIS899, 5989 O2A9946DC6022BAFSZAIMMEDIISIAMBESDHSSY 1258 DATA BOSCESCOCEIBSIADIBSIDEFOAITS BDO4DOAZCFAI1 1DOCEBE! SDIBSICEIBSIZOS456AD IBS IDOFSZOSASGADDE 1868 DATA DADGFEAIE48DBISIAIVBBOCISIOD 59185 9885DD059C9789BC5AI, 6062 C7S9SDC5SISDBDSISDLEDSSHCASIGNB759GDIA 1268 DATA BGSDCSSISDIEDELEDASSZOS45626 S98DICSIODCDSIODBESIGOCA, 6389 S54564CDESIADBASIGDGBSIAI 1 OBDSESEEDS7S8 1878 DATA S9AAZOBDSZZEFCSSAIGBGOCASIGD ABLBCESBSIOEGLGOBISOSECI , S118 CSS9SDLEDOAIZASDRIDZAIBESDALDZAISESDIG 1270 DATA 1AF9EI18G598199SD564CBIS5AILG 598060D04C2056 2D9E5SESER, S523 993D58884CBBSSCEBFSIZOFCSSOD4ESSBO4F 58 1088 DATA ESES27DOFS6GEEBASIAIL4EDBDS9 SOSESSADDF SIF BOF ACBFSIAZ, S119 2O8ASGAINABDE1D 28D 2 1280 DATA LIAIBBIDIDSSCASSDOF IGG8ER4C 2OFCSSA9908D010280045928, 5685 4151090809859 205456CE 9BSIDGF S60EEBDSS 1090 DATA BOSSZBASSSZOFCSSCECESICEDASS AZCICEBDSIDGOLGOBDIDSBC9, $599 ADCESISSESOSEDCESIACDESIAZVOBDALSBIDIF 1290 DATA 19F88G69819DSDS84C80560I1090 SPEGEOLADOFS6t ADC159, 6040 IOSECA4CLSS62ODESZ20965320545620C05428 1188 DATA DDCZSSFEQGESEOCEDOFIGOBDESSS ASGADCASIESBTACEESZADCS, A127 ESESES9DIFSICABDALSSIDIFSIGGCEIDSIFOGL 1300 DATA SIFOOSACZDSSADBESIDEFBECZOSG 608D7602809E592901D083CE , 6397 AZBOABOTCADOFDRGDOFAGOADCOSIFEISCEDISI 1118 DATA 9959AD9ES929@2D083EE99S INDIE DBBDAIZOBDBISIADF 5824902, 5047 S92 9@BDOGSEEISSIAIOSSDICSIADIESIZIGADS 1510 DATA BDFSOZACGZEAADFCOZCIZIDODAD O8CE9859A90480 9059009059, S216 FFSDFCOZADBES949FFSDBESIADBESIF 8634062 1120 DATA C99BDOSBCE9SS9N90180C259NDIG ECEECZEZZOSCS4ADB759DGOF , 6096 59C92FDOOZEEISSIADIISICI4 SOGSEEIISIAT 1328 DATA ADCISICIIDEBBAIOF SDBOSIGOB7 OF 6D9DSIADINSICIOADGOSAT, 5919 594006002 99SF BOTEEDISIADOADOZIOBFOOSEE 1130 DATA @B809A59NCIN5IBI435I1O6DICSI CSSPMDVADOZIGAF COTEECISI, S643 ANEESASSAIOLEGIOSCADOFAABAIGSEDIBSINE 1530 DATA ADBCDAZIEGFOOSEECSSIADCASIFO OD4N4ABDOIDZAIZEGDEZDZCECASIADCZSIFO4L 1148 DATA S9DOFIADIBSPEDOODBSAAIBEAAI CECFSIADCFSISOEZDECEDAS9, 6075 BFCADOREGOAD 1348 DATA ADDASIBDGLDEAIBOADCZSICGCBAS C159C94196960DCD59DA5B6O, 5545 CBSDO4D41084N987E5CBODR4D4SS4DEESESEAD 1150 DATA CECCS9ADCCSIF ADCDSIDOATEEBDSIORGADZSDLEDOTIGAICFECS 1752 DATA DOFGEECASSZ@BOSZADGADZCDCES9 IBBOF 2A8A9BBSDDISIGCLES, 6673 98290C75949CFBDC75IADC7SINORBIIEASF CO 1168 DATA AZATBEOZDOSECFS9AIGSODIBSIAZ COBIDOF SAOHEITESGICSCHOI, 6512 4BBEDOSIBDDISBIIONGEESCECESBSIADIBSIDE 1568 DATA DEF SAGHAIZECSICOCREIDGFSCERS FOADDISIDOCZAIGLSDCD5I68, 6412 SIFOOT4CATS7ADBESIODB4SIADBISIBANANICS 1178 DATA ADCBSIDOLSADD1S9DEBSAI4OBDCA ID7D5EID7DSF DSECSIDGEGS , 6201 SI4CA7S4ACCESIAIVBACSISANISLSOCBSIADDS 1378 DATA CEBISIADEISMEGSAICAGDBISIAD 591869@88DDO59ANCI70908E, 5395 B959OAANAI7D9D7DSEIDGEGSAI7CID7O5F 90GE 11BE DATA AIBABDCDSIBACBSIADOADZEDCCS? H64C62E4488A4GA2G0BDCES7, 5818 ACCESIAIGBBDIBSIBODISSIIGOSECREGCEIOSS 1588 DATA IDAGDOESESOIDOF SADBADZED1IOO ADIBSIOSFAGSIIOOGECSCARS, 6148 66ANG8403476CE008RCREE! 1198 DATA D@FS4CBISIADCISIC IAI D259F916GAI01ADDZ5IADDSSIDOTEADCISICI 1398 DATA CB900160A9018DDSS9EEBDSI, 6383 S9FOOLSOCEBSSIFOG1G@ADCE, 6118 1220 DATA S9BDCISIAIOZBOBSSICEBSSIADHS GA101161 ICISEF0G168N9008001078! 8082 1428 DATA edt DESDAGDZEEIISINI1OBDIBSI, 5632 ececececececececececececececececece 1278 DATA 2O5456CEIBSINDIBSIAFSAIBAZ SCOCECecacececocecec 616 @LZOSDSTADCSSIFOOTACZDSSADCASIFADIACGE 1458 DATA B78588ZB2CHCHPECECEDSCECEDEC 6c OZEZFIOTLT2I3I435I36373738 1240 DATA AIBBACCESIAZBAIIGAGECRESERHS 39 DOF78DC159205455A240BEDASIGECASIACIIS? 1448 DATA 75767777787 9BGBALESZ46SAGESZ 8
Page 9 (scan)
JAABED2OFESFFOOLFOS4ESFIFBECRORBERASE 1648 DATA aeanes jesaeet eeeoeeest 22OCACRCOCACeCacecececececececec 1848 DATA 1488 DATA SF7EFE7ESFO783018 aseesoeeeesoas FE7ESFO7eseieeSEALeL| 1518 DATA 7288658073006300750065e001 jeagReeesHe80bGG0R5IN07I90750R6 I006F 906£9000800022199027252F , 1631 1528 DATA 26260034262F 2038332F 2E( 2F32003821272500160020212721 32926250 ecececececececececececec, S71 1718 baTA ecececececececececececececec 23e9ee1secececacacecacec, 533 1948 DATA Bceceeseacececacecacecececec ecece jeoeseneae O88 eeacaeoges 1958 DATA ececececacececececececececece! ecec7neseeeaesen 19870008022, 527 ecececececececececacececececececece 1778 DATA acecececececacececececececec ecececiaseesl eeeeges 1978 DATA saeee 1598 DATA ececececececececececacececec acecececececececececacecececececececec ecececececececececececec, 54a DaTh ecececececececacecececececec jeeseaagagees OeeROR4E 1BECACECACACACEC , 491 jeseeeaeooaae
Page 10 (scan)
{ T DEMO
RESCUE CON'T ANPROM AUGUST
jeOSRSOZIZAIFACACIN BCOCACOCOCiAZIze1Fecececececececececec 19 REH ANALOG INPUT DEMO
188018, 597 15 OPEM #2,4,0,"K:
20 GR.2+16
38 706 ;"ANALOG IMPUT DEMO
408 786 ;"1. TEMPERATURE
58 76 ;"2.LIGHT LEVEL
68 286 ;"5. HUMIDITY
62 78651786; "PLUG SENSOR INTO PINS 7 A
cacececececececececec, 132 WD 9 OF JACK 1
ecececececec 75 GETH2,A
acececececec eceCececacecec, 437 88 7650-48
bata ececececececececececia
98 FOR TIME=1 TO 6@:NEKT TIME
95 OM A-48 GOTO 106,200,308
98 6.999
180 GR.2416
118 POKE 752,41
acecececececec, 483 128 P=PEEK (624)
ecececececececececececececec 125 P05.0,0
-PINLB/ 13474
140 746; "THE TEMPERATURE 15
" DEGREES
160 IF PEEK(764)<)255 THEW GET #2,A:G.
28
170 G.178
208 GR.2+16
218 POKE 752,14
220 P=PEEK (624)
225 P0S.8,8
230 746; "THE LIGHT LEVEL 15
2318 DATA BBBETCOBICOEBE7ESCOBICESEOGS
7E7ESCOBICSGE5667E7ESCOB7CEG667C7E5ESS acl
907E6078667E7E7E087E607C,, 3732 2148 DATA
2328 DATA 7078707808666666667E7E7EBG68 acecece
5060687E7E7E00666666667ESC1800181080018 4£21201F ACOCICIDIELSOCEC, 581
Le18eeee1FOssESFIFOECOFF 3210 2158 DATA SceceCecececececiadeisececec 25@ IF PEEK(764)()255 THEN GET #2,A:6.
2338 DATA FFFFFFFFFFFFFF7F7FSESE1C1C@8 Bcecececececececacecececececececececec 28
2300101010387CFEFEGOOSOGFFeeseERGeGESC aCaCACeCecececececacecec, 635 260 6.128
5E76667E7E3CO0183818187E, 4182 2168 DATA eCececececececececececececec 270 GR.2+16
248 2H6j;INT CL);
2340 DATA 7E7E@OICHGRC187E7E7EOO7ELSOC BCACaCeCececececececececececececececec 280 POKE 752,41
ACEB7ESCOBOCACICEC7E7ECCOG7EGA7COSEG7E ACACECe 527 298 P=PEEK (624)
30803C607C667E7ESCOO7E86 , 3228 e1BecAcececec 300 GR.2+16
2358 DATA OC18363838803C6563C667E 7ESC
eeeseeeees 318 POKE 752,1
SCOSTEQSOEICISSOCREOFOFSFCFEFFO103870F 236 328 P=PEEK (624)
LFSF7FFFEOFCFFFFFFFFFFFE 5501 2188 DATA 325 P0S.8,0
2368 DATA GOBGBOFOFEFFFFFF aeeensat 330 786; "THE HUMIDITY I5
FOFFO73FFFFFFFFFFFFF O@88Q10F 7FFFFFFF OL ca
U SAF FFFF7FSFLF OF, 5378 2198 DATA 340 7MO;INTCHD;"
2378 DATA @7@301FFFEFCFSFOESCOSOFFFFFF BCOCOCeCeCOCaCacacecececececicipiceede S58 IF PEEK(764)()255 THEN GET H2,:G.
FFFFFFFCEOFFFFFFFEF O8@00Q0FFFSCeeeeee 9871701 F ocacecececececec, 657 20
368 G.128
999 GR.1t16
1008 786; "PARTS LIST": 786; :786;“TEMPER
ATURE SENSOR: FENKAL THERMISTOR G
A45P2,50800 OHMS
CBC, 548 1010 706;"AT 25 DEGREES C.
1028 786; :7H6; "LIGHT SENSOR:
GENERAL ELECTRIC X-6 PHOTOCELL
‘7H6 5; 1786; “HUMIDITY SENSOR:
QO0OFFFFFFFFFFFFIFO7FFFF , 8802
2386 DATA FF7FOFeLA
2218 DATA
Fe scecacecal
7CFFFFF cocececet
FFIEL@41EBFFFFFFFF7F 3098 , 6548 2228 DATA
DATA COE7FFFFFFESCA9D3DFDFCFFFFFC scacecace
088 20
FF7F 4041414141 01F FFF ,6477 DEURY INDUSTRIES HYGROPAK WODEL HA
2410 DATA 3FFFFFFFFFFFFFCOFOFCFFFCFeC®
SO030F SFFFIFOF OSOGFF7E7EICIC1818000018 10 1048 G,1048
983,
Page 11 (scan)
SORT ACTION
PROC INITC) — ; ARACTSRTIRMNMCLONNRTTA IF KEY=28 THEM EMIT FI TO CHKLINE :LIST
PaRIBTCOD IF EMPTYP LIST COP (31
HEI CROC REIS IEEE PRINT ODD IF LISTP FIRST :LEST COP SE CHKLIWE FI
* TEMP=5(1) RST LIST CHKLIME BF :LISTI
PRINTCE (TEMP) OP SE CHKWRD FIRST :LIST CHKLIWE BF iL
carp a 0 Ist
eM
RETURN
bo TO DIGITS :MUMBER
FIRSTSCREENO IF (COUNT :HUMBER ) ( 4 COP :MHMBERT
GETKEYO) OP (WORD LAST BL BL :MUMBER LAST BL ;
IF KEY=21 THEW T' FI NUMBER LAST :MUMBER >
IF KEY=57 THEM T FI i Ss iaiiae EMD
*
UNTIL TYP=*B OR TYP="H PROC MAING TO CHKSUM :MUMBER :COUNT
op HURT OISO IG OTITIOIT Op: COUNT % i NUMBER
* EMD
vo
PRINTC"How many itens do") — 00 TO CHKHRD :HORD
PRINTC"you want to sort"? IMITO IF EMPTYP :WORD [OP @3
PRINTEC™ "3 OP DIGITS SUM CHKSUM ASCII LAST :WORD
PRINTER" ") IF TYP='8 THEN BUBBLE) FI COUNT :HORD CHKWRD BL :WORD
PRINTE (Max = 999, Minimum = 40 IF TYP='H THEN HEAPC) FI EMD
"a
PRIWTEC™ "3 TIMER ( TO ADDSUMS :LIST
PUTC'?) MEINPUTCO ROKE(732,1) IF EMPTYP :LIST COP 61
UNTIL WD9 AND WX1006 Bs OP DIGITS SUM CHKSUM LAST :LIST COUNT
oD Press any key to see list") sist gopsuMs BL :LIST
END
printec Press ESC to exit™?
PRNTSO TO FIWISH.UP
IF KEY=28 THEN EXIT FI DEFINE :TITLE LIST :INPUTS :INSTRUCTIO
nS
MAKE THING "TITLE LIST ADDSUMS :SUMSLI
ST :SUMSLIST
Q=IMPUTCD (3) oD CT TYPE [any more procedures to enter?
ScD=a 1
oD RETURN HOKE “LIST RC PR :LIST
CLOSEC3) IF :LIST = "¥ (L0G0.PROOF]
PR C1 TYPE (Output to Printer?)
WAKE “LIST RC PR :LIST
TIERO. PROOFER IN LOGO IF :LIsT = “¥ fCOPYONT
RETURK ERM [TITLE LIST INSTRUCTIONS
ERM CIMPUTS SUMSLISTI
PR £1 PONS PR {1 COPYOFF
To MAIN. PROC TYPE [Do you want to quit now?]
_ UBER SH AHAANSHASTSSERRIBTE MAKE “LIST RL MAKE “LIST RC PR LIST
* IF (FIRST :LIST 2 = “70 CMAKE “TITLE TF LIST = “M [LOGO.PROOFI
PROC PRATSO jSCERCUMEGTE] FIRST BF :LIST MAKE “INPUTS BF BF :LIS ER CCHKMRD CHKSUM DIGITS]
#8988982 ATORETGEDEEE TT] ER [CHKLINE ADDSUMS MAIN.PROCT
* IF (FIRST :LIST } = “END CFINISH.WP ST ER (LOGO.PROOF FINISH.UPY
oP! ERS RECYCLE
CARD TEMP IF WOT (FIRST :LIST 2 = “TO (MAKE “INS Exp
TRUCTIONS LPUT :LIST :INSTRUCTIONSI
GETKEYO) WAKE “SUMSLIST SE :SUMSLIST ADDSUMS CH To LoGo.PROOF
KLINE LIST MAKE “INSTRUCTIONS (1
FoR I=1 10 W TYPE ()1 WAIN. PROC MAKE “SUMSLIST 0
oo END CT PR (Enter your procedure:] PR {J
11
Page 12 (scan)
PROOFER CON'T
TYPE (71 HAIN. PROC
END
TO START
CT REPEAT 15 (PR [1]
PR CITHE LOGO PROOFREADER|I
PRO PR OD
PR [By Dave Arlington}
mR {for ATARI Explorer}
REPEAT 18 (PR C1]
PR «HtPress any key to continue.#)]
MAKE "LIST RC ER “START RECYCLE
Loco. PROOF
EMD
To copyon
SETWRITE "Pt
EMD
TO COPYOFF
SETHRITE 0
EMD
SWITCH 2.5
10 REM Modification to DOS 2.5 to
{1 REM store DUP.SYS and MEM. SAV
12 REM in the bank switch RAH
13 REM behind the 05 ROM fren 5c80e
14 REM to SFOFF
15 REM
16 REM This mod for 64K KL's only
20 REM Adapted from ANALOG #24 by
21 REM Robert Luce
22 REM
23) REM 380 BRB BHRBEHEHHEHEBEB SREB ABBE
24 REM written by Alec Benson 6/85
38 REM from ADELAIDE Atari
34 REM Club, Box 333, Norwood,
33 REM Australia S.A. S867 fug ‘8S
14 REM J88HRHHESEG BE REHEHEEEEE EEE
4@ REM REPRINTED ACE Newsletter
41 REM 3662 Vine Maple, Eugene, OR
188 CH=O:DIM AS (339)
128 READ A
130 CK=CK+A
140 5 (LEW CAS) #12 =CHRS (A)
156 WEXT I
160 IF CK()41072 THEN ? “ERROR IN DATA
STATEMENTS-CHECK TYPING’
176 OPER #1,8,8,
Mi; AS; :CLOSE 1
188 7 :? 3? "D:PATCH2S.OBJ CREATED: ERD
4
ND
PATCH2S. OBJ"
PRINT
DATA 255,255,231, 28, 233,28,32,192
e108
1028
pata
pata
1938
16
1048
pata
pata
pata
pata
1678
1088
1998
36
1100
1118
1120
use
pata
pata
pata
pata
pata
pata
pata
sia
11586
1168
pata
ata
paTa
1178
43
1180
1198
paTA
pata
pata
pata
pata
DATA
DATA
pata
pata
pata
paTA
DATA
para
DATA
pata
pata
pata
pata
pata
pata
pata
pata
pata
234
1418 DATA
1428 DATA
FLOATING PT.
FROM LAST MONTH:
BY BARKLEY
25, 70,253,136, 25, 32,05,24
1698, 133,242,135, 214, 169,29
133, 215,169,192,133,213,162, 19 /erioating Point Averagest/
2p /*first try with Acec F.P.¥/
32,119, 24,169,216,133,213,16 gq pains $¢
to int i,aver
7,32, 119,24, 32,78,24, 96 5@ char #str,af6] , SUME63 , {63 , 16];
469,0,135, 242, 169,224,133,21 59 atoftsum, "8.0";
78 for tire; iCiasttid $C
160,0,162,3,177,212,72,32 59 putehar(':"3;
85,24,104,165,212,32,78,24 gs getststr?;
200,208, 241,250,213, 282,16,2 yg —atof(a,str?;
an fadd(a, sum, SUM);
96,254, 182,25,0,24,240,75 ggg printecs 49.3 19.5AN0",
32,70,23,206,158,23,48,65 3, sun;
32,108,24,52,105,25,169,255 gii9 $9
141,158,24,441,157,24,162,16 929 itofCism?s
nize fdivésum,n,”;
169,47,157,68,3,169,24,157 gi4a ave=ftoi tw;
69,3,52,164,21,32,85,24 aise printec! n: | SUR av
162,21,169,8,135,242,133,214 pygq print é(nd 15.2F 25.24
w:
169,34,133,215,169,228,133,2 9479 getheyO;
aise $)
32,119, 24, 32,70, 24,1698
141,157, 24,141,158, 21, 76,146
25,19, 24,39, 24,32, 85,24
169,8,133,214, 138,212, 169,22
153,245, 169,31, 133,213, 162,2
208,18, 58,24, 146,24, 32,119
24,32, 78,24, 206, 187,21, 76
152,32, 32,102, 24,88, 169,112
444,14, 212, 169,10, 1464,14,218
MEETING
WED. OCT..9TH
96,120,169,8,141,14, 212,144
14,210,173, 4, 211, 41,254, 76
107,24,473,1,241,9,1,141
1,241, 96, 254, 254, 254,234, 32
156,25, 96,168,0,177, 214,145
212,208,208, 249,230, 213,236,
202, 208, 242,96, 234, 234, 234,2
234,254,234, 234,234, 254,234,
25,109, 25,32, 85,24,169,8
433,242,135, 214,169, 29,133,2
SOWeH EUGENE
HIGH
169,192,133, 215,162, 16, 32,44
24,169, 216 133, 215, 162,7,32
119,24, 32,78,24, 96,254,234
234, 234,254, 234, 234, 234,234,
234, 254,49, 51,53, 31,178,174
181,216,284
Page 13 (scan)
LOGO PROOFREADER
(Reprint: POKEY, August, 1985)
With the introduction of the amazing new 520ST, Atari has achieved
another first. The 520ST is the first inexpensive personal computer to
be shipped with LOGO as the language of choice. This is a very exciting
and innovative move. In the coming months, many interesting LOGO
projects and programs will be published in the Atari Explorer. One side
benefit to this is that many of these programs will run with only minor
changes on the 400/800/XL/XE series of Atari computers equipped with
the LOGO language. The LOGO proofreader is one of these programs.
Almost all computer publications which feature type-in BASIC
listings supply a proofreading program which checks your typing. The
LOGO Proofreader serves exactly the same purpose for type-in LOGO
listings. It provides an easy-to-use checksum for each procedure you
enter into the workspace, saving a lot of debugging time. All future LOGO
listings published in POKEY will have Proofreader checksums which you
can use to check your typing.
Using the Proofreader: Very carefully type the listing. (After all,
you don't have the proofreader yet!) When using the 520ST to type in
this listing | recommend clicking the LOGO text window to full screen.
Then, before doing anything else, save your workspace to disk under the
filename LPROOF. Later we'll show you how to use the Proofreader to
check itself.
To begin the program, type START. After a short title screen, you
will be prompted to being entering a procedure. Just type it in as you
normally would. The Proofreader checks each line as you type it. As an
example we'll use probably the most famous LOGO procedure, SQUARE.
‘Type this in:
TO SQUARE :SIDE
REPEAT 4 [FD :SIDE RT 901
END
When you type END and press RETURN, the Proofreader will define
the SQUARE procedure and ask if you have any more procedures to enter.
In this example we'll reply N. After asking whether you also want output
to the printer, the LOGO Proofreader will print the checksums for all the
procedures you have entered. In this example the Proofreader will print:
"MAKE "SQUARE [980 [590 695) |"
The first number in the checksum is ALWAYS the checksum for the
entire procedure. In this case, 980. If the number matches, the procedure
has been typed correctly and you need check no further.
If, on the other hand, you get something like: “MAKE “SQUARE [970
{590 690] |” then you will have to check the following list of numbers
to determine which line was typed incorrectly. In this case, the second
line was typed incorrectly. Each number in the list corresponds to each
line in the procedure, including the title line but excluding the END line.
The LOGO Proofreader assumes you will always type the last line (END)
in a procedure definition correctly. It is never included in the checksum
values.
After you have finished entering procedures and have determined
where all your typing mistakes are, you will have two choices. You will
be asked if you wish to quit now. If you answer N, you will be returned
to the main program where you may either enter some more procedures
or re-type the ones where you have made mistakes. If you answer Y to
quitting the LOGO Proofreader will erase itself and all variables including
the checksums, leaving only the procedures you have entered within the
program. After correcting any mistakes using the LOGO editor, you can
then save the entire workspace to disk.
How it Works
If all you are interested in is having the program work, you need read
no further. The following information is intended for those who want
to know some of the finer points of using list processing in LOGO. One
important point which should be made is this: Yes, Virginia, it is possible
‘to write utility and applications programs in LOGO.
Solving a problem in LOGO can be easy if you approach it in the right
way. Long before electron microscopes were invented, Greek
philosophers discussed the existence of the atom. They theorized that
if one took a piece of cloth and kept ripping it in half, that eventually
you would get a piece so small that it could not be divided further. The
language which LOGO is descended from, LISP, also refers to atoms.
Here it is used to describe a piece of a program which cannot be broken
down any further. From these small pieces we can construct a larger
problem solving program.
LOGO works much the same way. In the Proofreader program, the
smallest procedure is CHKSUM, which outputs the ASCII value of a letter
times its position in a word. CHKWRD adds these sums together to get
@ unique value for each word. For instance, CHKWRD “THE outputs 1
times the ASCII value of T plus 2 times the ASCII value of H plus 3 times
the ASCII value of E. If we know all the right letters are in the right places,
then the word must be spelled correctly.
CHKLINE takes the list the user types in and breaks it up into tits
individual words to apss on to CHKWRD. CHKLINE then outputs a list
of all the checksums to ADDSUMS. If we know all the words are spelled
right and in the right places, then the line must be typed correctly. If
all the lines are typed correctly and in the right place, then the procedure
must be typed correctly. This is a very good example of solving a problem
in LOGO. Take a very small problem (ls the letter in the right place?) and
use it to build a foundation to solve a large problem (Is the procedure
typed correctly?).
The Proofreader also uses another popular LOGO technique called
recursion. a LOGO can call any other procedure, even itself. Recursion
is when a LOGO procedure calls itself to help solve a problem. There
are generally two types of recursive calles. Tail recursion is where the
very last line in a procedure is a call to itself. This is very similar to BASIC
looping. The procedure keeps looping back to itself until some condition
is met to stop it. in the procedure MAIN.PROG, it keeps going back for
more lines from the user until they type END, at which time it calls the
FINISH.UP procedure and stops.
A more complicated type of recursion occurs in the procedure
CHKLINE. Since CHKWRD can only take a word as its input, CHKLINE
must break up a list into its individual words. But a list can contain other
lists as well as words. We need a procedure which can break those lists
inside lists into words. Sound familiar? That's the CHKLINE procedure!
Therefore the second line of CHKLINE checks to see if the first element
is yet another list. If it is, it calls itself to break up that list before it
continues. This way, CHKLINE can take the most complicated of lists
and break it into single words
The Proofreader uses other techniques which could take up a whole
article by themselves. The use of Global vs. Local variables, for instance.
The Proofreader uses global variables only in the main loops near top
level where user input is needed. All other values are passed through
the various procedures locally, where they only exist as long as the
procedure is running. This way the program has to only erase a few global
variables when it finishes up.
I hope you find the LOGO Proofreader a valuable addition to your
library, both as a useful utility and as a lesson in LOGO programming
WALDEN TEACHES C
In this article | will talk about two C statements which are very
powerful, yet difficult to understand, especially if you are used to Basic.
Elsewhere in this issue is a program listing called STUDY.C which
contains the examples | will refer to.
The Basic FOR statement contains three parts: The initialization
where the variable is assigned a value, the test where tha variable is
checked against some parameter, and the STEP value to increase the
variable. The C for( statement also has 3 parts, but unlike Basic, they
are totally unrelated to each other.
The variable you initialize does not have have to be either the variable
you test or the one you change. Here's how C handles the 3 parts. The
first part is used to initalize any number of variables, all separated by
commas. The end of the first section is set off by a semi-colon. The
variables will all be initialized at the beginning of the loop.
The next section is the test. You may test anything; there is no
requirement for the test have anything to do with the initialization. If
the test is true, then control will be passed to the body of the loop,
otherwise control jumps out of the loop. The third section is performed
at the end of the loop. In this section you can assign values, change
values, or even leave it blank and do nothing. The variables you change
do not have to have anything to do with either of the first two sections.
Take a look at the for examples given in STUDY.C
The second statement for which there is no counterpart in Basic,
is the 7: statement. Let's say you wanted to assign Z the value of A or
B, whichever is greater. If A is greater than B then Z will equal A, else
Z will equal B. Normally this requires two statements, The ?: statement
allows you to test a value and give one of two results depending on
whether the test value is true or false (I know, it sounds confusing - take
a look at the example in STUDY.C). Here's another example. Say you want
to print how many players there are in a game. If only one, then the word
“players” should be singular, otherwise it should have the ending “s”
By using the ?: statement we can print out the ending “'s” only if there
is more than one player. You could also use the same routine for printing
out verbs like “is” and “are” dependent on how many objects you are
describing. Look at STUDY.C for examples.
These two statements provide two examples of how C provides
shortcuts for commonly used program statements, It takes 4 while to
get used to them, but once you do you may end up wondering how you
lived without them.
— Ralph Walden
Page 14 (scan)
MENU.C MENUC will list a menu of all of the “COM” programs on a disk, and allow you to run any of them by pressing the corresponding letter. ‘A good use for this program is to end your C programs by chaining to MENU.COM. This way, the user can always have @ menu of programs to choose from. The only disadvantage is that you cannot pass parameters to the program being run by MENU. The listing of the program has been modified somewhat to improve readability. For example, the first char declaration should be typed in as one line rather than the two shown. There are several similar lines which are printed as two lines, but which you can type in as one line, The line which searches for CC.COM by using the index() function can be followed with any number of “else if(” lines to search for and ignore any COM files you don’t want listed in the menu, For those of you who are fairly new to C, | draw your attention to a couple of interesting lines. Look at the fori loop underneath the “Print all filenames” comment. This for( loop initializes, checks, and updates two variables in a single statement. Imagine doing this in Basic! Also took at the while( statement 4 lines from the bottom. With one statement ‘we input a character from the keyboard, change it to uppercase if needed, make sure it’s alphabetic and that it’s a viable menu option, and keep trying until we get a correct response. This is a good example of C’s ability to provide programming “shortcuts”; replacing with one line what normally takes several lines. 7 etd A ‘C’ NOTE For the past few weeks I've used two new “C’tLanguage products which look very nice. Although | haven't yet had time to do a complete review, some ACE members might want to look at these new "C” tools for themselves while | do my homework for a review. Let's look first at “C Self-Study Guide” by Jack Purdum (1985, Que Publishing, Inc., 7999 Knue Rd., Indianapolis, IN, 46250 $16.95). This 250 page soft-bound volume is by far the most cost-effective way I've found for learning to use C. Other C books give you rules, syntax, and finished examples of C programming. With my slow-motion brain, all of this seems to produce one “Gotcha!” after another.” What, you didn't notice that comma ... extra space . . . missing quote? Hah!” Purdum does it MY way, instead. Lots of examples of C functions, many WITH ERRORS ... . “What's wrong with this line?” (You're told what page holds the answer). That's the way | spend most of my programming time, and the way | really learn — by falling down a lot, ‘and getting up. Not by watching others walk, or run. Purdum also has a super idea which is new to me: He puts the questions for each chapter IN FRONT where you can see how much you already know — or don’t know — about Operators, Variables, Loops, Pointers, etc. This makes it simple to skip over familiar ground, and gives me new incentive to identify and fill gaps in my retained knowledge, not merely review the text | just finished reading. Now a second offering: DVC/65, the best-yet version of C for Atari. It’s by Ralph Walden, the author of ACE-C. This brand-new Freeware product is much more than just the C Development Compiler it claims to be: It's a whole programming system carefully crafted for the Atari, with its own special-purpose DOS, a superb editor, the most complete version of C for Atari which | have yet seen, and, best of all perhaps, 62 pages of very usable documentation. So far it has worked smoothly and easily, with convenient editing, fast assemblies, nearly automatic linking and respectable running times. You get the normal C 1/0 functions, including scanf() — at last! — as well as printf(); special Atari floating point functions; an assembly language interface; great graphics utilities; RAMdisk for XE and Mosaic Board owners. Plus lots of sample C source programs (20+), demos, and special goodies for you MAC-65 and ACTION fans! DVC/65 is issued as Freeware, which means the disk can be freely copied and distributed, while the documentation is coyrighted and available only from the author, for $35 (write to Ralph E. Walden, 1821 Jefferson, Eugene, OR 97402). So there you have it: early notice about two promising additions to your Atari C library. Next time I'll tell you what | learn about both, warts and a". C ya then! — Ralph Walden — Dick Barkley RESCUE MISSION by Geoffrey Thompson THE GAME: You are flying an unarmed helicopter carrying vital medical supplies through lengthy caverns in order to reach your agents who have been wounded behind enemy lines. The caverns are well protected with anti- aircraft batteries, space mines, rockets and lasers so the mission is dangerous and difficult and the caverns are lengthy. The only aid you have apart from your own skill is a radar scanner at the top of the screen to show your position in the cavern. The joystick controls the helicopter in any direction and you have three helicopters, each with a limited supply of fuel, The space bar will pause the game at any point. TYPING IT IN: Type as listed. Make sure you save a copy of the program before you RUN it. Before you type Run, ensure you have a formatted disk in drive 1. The program will check the data line by line and write a file to disk with the filename ‘D:RESCUE.DAT’ and then ask you if you are ready to run. AY’ will begin the game. To RUN the program subsequently, type in the short program and save with whatever filename you wish on the same disk as ‘D:RESCUE.DAT’. You can then RUN the program by typing RUN’D:(your filename)". — Nora Young DOS 2.5XL (Reprint: Feedback, August, 1985, Adelaide, Australia) When used with the XE computers, DOS 2.5 can make use of the extra memory available as a ramdisk. In addition, both DUPSYS and MEMSAV are stored on this ramdisk which allows instant access to DOS and automatic saving of any program in memory without a (normal) disk access. This latter feature can be implemented on XL machines with 64k of memory by using the RAM behind the operating system ROMs. A program to do this with DOS 2.0S was published in number 24 of Analog magazine. The program presented here makes the same modification to DOS 2.5. ‘Type in the program and save it. Now RUN the program and, if you have typed it in correctly, you will get the message that the file PATCH25.0BJ has been created. If you did not boot your system using DOS 2.5, do so now. go to the DOS menu and select option L. In response to the file name request, type PATCH25.0BJ. ‘To save the patched version of DOS 2.5 use the H option. Now reboot your system using the disk containing your patched version of DOS and away you go. — Alec Benson 14
Page 15 (scan)
DIGITAL LOGIC (Reprint: BRACE, July, 1985) Looking for something to do with your 520ST when .. . LOGO is the only language installed? Well, if you enjoy tinkering with electronics as | do, then you might enjoy this neat little project: A low cost, primitive (but effective) software circuit simulator. Due to time (and space) considerations this article will only outline the procedure and give one ‘or two short examples. To expand this idea into a full-blown program is going to require a little ingenuity and work on your part, but the results should be worth it. First of all, | should probably discuss just what a circuit simulator does. Loosely defined, it is a body of software which uses math (in this case boolean logic) to predict how an electronic circuit will behave. It is driven by inputs (let's see, if we apply a logic one here and a logic zero here... ) and calculates the outputs of the circuit ( ... what should we read at this output pin?). With a well-designed simulator you can spend afew minutes with your Atari finding out if a new circuit design is going to work the way you think it will instead of hours wire-wrapping, perhaps in vain. Well, ok. There might be a slight exaggeration there. Anyway, now that you have an idea of what a simulator does, let's delve into how it works. LOGO turns out to be a perfect language with which to implement a logic simulator because of the unique way in which it handles boolean logic. Where almost all other languages use zero to equal false and any number other than zero equals true, LOGO doesn’t use numbers at all ‘TRUE and FALSE are special inputs used only with the boolean operators in LOGO. In addition, LOGO has what are known as predicates. These are special primitives, or procedures, which test for a specific condition. If the condition exists, a predicate will output TRUE, if not it will output FALSE. There are two other features of LOGO which make it attractive for this kind of application: It is procedural and recursive. We won't run into the advantages of recursion in the short examples I'l give here, but you'll soon see how the procedural nature of LOGO makes things “easy as pie.” The key to understanding how this simulator works is knowing what goes on inside an integrated circuit. Let's take an LS7408 chip for example. ... The internal logic of this chip .. . is very simple. There are eight input pins arranged as four pairs. Each pair of input pins goes directly to he corresponding inputs of an AND gate. The output of each AND gate goes directly to one of the output pins of the chip. This may all seem extremely obvious to an experienced hobbyist, but it is necessary to look at each chip in this simplistic way. Each output pin must be defined in terms of the operation perfcrmed on the input pins. So, the output of pin three, for example, can be defined as being the result of pin one ANDed with pin two. In LOGO the definition of pin three can be something like this: TO 1S7408.3 OUTPUT ( AND LS7408.1 LS7408.2 ) END This is a procedure. When called, LS7408.3 will output the result of LS7408.1 ANDed with LS7408.2, which will also have been defined as procedures. In the above definition the OUTPUT 2ommand directs LOGO to return either a TRUE or FALSE to the calling procedure, depending upon the result of the AND operation. In accordance with LOGO syntax, the word AND comes first, followed by a list of its inputs. This is another advantage of LOGO: A boolean operation can have any number of inputs — not just two. The parentheses were optional in this instance. | just put them there for clarity. Having defined output pin three in terms of its inputs, we can now try it out to see if it works. First, however, we'll need three more small procedures to tie up loose ends: TO LS7408.1 OUTPUT TRUE END TO LS7408.2 OUTPUT FALSE END TO TEST : PRINT LS7408.3 END The first two procedures define the inputs to LS7408.3. The last one is necessary in order to both call it and to do something with the output. Simply type TEST at the LOGO prompt, and the word FALSE will be returned to you. You can try EDITing LS7408.1 and LS7408.2, changing the inputs to verify that everything workds properly. It will. In ‘the above example, TRUE (or logic one) ANDed with FALSE (logic zero) should, and does return a FALSE. Neat, huh? Are the old cogs turning upstairs? Beginning to see how this can be useful? Well, let's go on, shall we? 15 Ok. So we have seen how to simulate a simple AND gate, but | still haven't shown why LOGO is so superior to other languages for something like this. You're probably saying to yourself, “‘Sure, it's nifty, but | could have written a two line BASIC program to do the same thing: True, but this is only one gate. Where LOGO really shines is in the combination of lots of gates. Let's take the example where the output pins three, six and eight of our LS7408 are all feeding inputs of a NAND gate in an LS7410 chip. Now what do we do? Well, first off, we should define the other output pins of the LS7408: TO LS7408.6 OUTPUT ( AND LS7408.4 LS7408.5 ) END TO LS7408.8 OUTPUT ( AND LS7408.9 LS7408.10 ) END Now to define the output of the NAND gate in the LS7410: TO LS7410.8 OUTPUT ( AND LS7410.3 LS7410.4 LS7410.5 } END EDIT TEST to reflect the new circuit. TO TEST PRINT LS7410.6 1e the inputs to the 7408: TO 1S7408.4 OUTPUT TRUE END TO 1S7408.5 OUTPUT TRUE END TO LS7408.9 OUTPUT TRUE END TO LS7408.10 OUTPUT TRUE END So, is that it? Whoops! We forgot to tell the software how the two chips are interconnected. Let's see, we could write a bunch of procedures defining the inputs of the LS7410 to be equal to the respective outputs of the LS7408 chip. Seems like a lot of work, huh? But wait! LOGO is a procedural language. Since the outputs of the LS7408 have been defined as procedures, and since procddures can be used as inputs to boolean operations in LOGO, all we have to do is a little EDITing of our definition of the output of the LS7410: . TO LS7410.6 OUTPUT NOT ( AND LS7408.3 LS7408.6 LS7408.8 ) END ‘Now look at that. No, really. Sit back a second and look at what we just did. We defined the input pins of our triple input NAND gate to be the output pins of our three AND gates. Just to make sure the significance of this has sunk in, I'l outline what happens when you type TEST. LOGO first tries to print LS7410.6 but finds it has unresolved inputs. The first of these inputs is LS7408.3. So LOGO has to see what the output of LS7408.3 is. Sure enough, the inputs to this procedure are also unresolved. So, once again, LOGO traces back another step to the inputs of LS7408.3 until it either finds another procedure with unresolved inputs or a TRUE or FALSE. It will then keep at this until all of the inputs to LS7410.6 are resolved and it can print out the result (which will be TRUE, of course — that one lousy little FALSE input at LS7408.2 screws us up. Change it to TRUE and see what happens). This all occurs in 2 split second, and all we see is the answer, which is all we really want. Now where's your little two line BASIC program? You can get BASIC to do this, of course, but not so easily or so elegantly. Well, that’s about all Ill say on the subject right now. Obviously there is more we could say. Entire circuits can be built using the guidelines laid out here. More complex chips, such as flip-flops, shift registers, etc., will require a little ingenuity to properly simulate. Just remember to define ‘the output in terms of what happens to the inputs. Another area which needs attention is the inputs to the circuit. A procedure which takes patterns of ones and zeros and translates them into the TRUEs and FALSEs of the proper inputs is much preferred. But the thrust of this article is to get you started, and later, when you've mastered the concepts and programmed in all of those refinements, you can give me call and I'll be right over with a blank disk — Jeff Griffen
Page 16 (scan)
Atari Computer Enthusiasts ACE. is an independent, non-profit and tax exempt computer club. and user’s group with no conne¢ n to Atari Corp. We are a group interested in educating our members in the use of the Atari Computer and in giving the latest News, Reviews and Rumors. All our articles, reviews and programs come from you, our members. ‘Our membership is world-wide; membership fees include the ACE. Newsletter. Dues are $14 a year for U.S., and $24 a year Overseas Airmail and include about 10 issues a year of the ACE Newsletter. Subscription Dep't: 3662 Vine Maple Dr., Eugene, OR 97405. *President— Dick Barkley, 2907 Wingate, Eugene, OR 97405 503-344-5843 Vice Pres— Larry Gold, 1927 Mclean Bivd., Eugene, Or 97405 503-686-1490 8-bit Librarian— Chuck & Jody Ross, 2222 lronwood, Eugene 97401 (503) 342-4133 — Jim Bumpas, 4405 Dillard Rd., Eugene OR 97405 503-484-4746 Mike Dunn, 3662 Vine Maple Dr., Eugene, OR 97405 503-344-6193 Jim Bumpas, 4405 Dillard Rd., Eugene, OR 97405 503-484-4746 ERAGE, (Education SIG Editor)— Nora Young, 105 Hansen Lane, Eugene, OR 97404 / 503-688-1458 Send 50c stamps or coin ($1 overseas) to the Ness’ for the new, updated ACE Library List—new in May 85! Bulletin Board (503) 343-4352 On line 24 hours a day, except for servicing and updating. Consists of an 800 XL, 2 double-density double sided disk drives and 2 double- sided, double-density, 80-track disk drives, an Epson MX80 printer, a 1200 baud Prentice P212ST modem, running the Mindlink Bulletin Board software distributed by SofMark. Best of ACE books Volume 1 contains bound issues of the ACE Newsletter from the first issue, Oct 81 to June of 1982 ‘Volume 2 covers July 1982 to June 1983 Only $12 each ($2 extra for Airmail). Available only from: George Suetsugu 45-602 Apuapu St Kanoehe, Hi 96744 ‘ST Librari Editors — TS ugene OR 97405 FIRST CLASS MAIL 3562 Vine Maple 5 TYPESETTING FROM YOUR COMPUTER ATARI OWNERS: If you-have a modem, text editor, and com- munications program to send ASCII files, you should consider the improved readability and cost savings provided by TYPESETTING your program documentation, manuscript, newsletter, or other lengthy text instead of just reproducing it from line printer or daisy-wheel output. Computer typesetting by telephone offers you high quality, space-saving copy that creates the professional image you want! Hundreds of type styles to choose from with 8 styles and 12 sizes “on line! And it's easy to encode your copy with the few typesetting commands you need. COMPLETE CONFIDENTIALITY GUARANTEED — Bonded for your protection — PUBLICATION DESIGN, EDITING, & PRODUCTION Editing & Design Services 30 East 13th Avenue Eugene, Oregon 97401 Phone 503/683-2657 SortFinder Index Acomposite index of Atari related articles in four popular computer periodicals, including ACE. Volume tcovers April, 1981 to June, 1983. Volume 2 covers July, 1983 to December, 1985. Only $6 per printed copy or $11 per disk copy for ACE members: Jim Carr 2660 SW. DeArmond Corvallis, OR 97333