@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@P!( L(1   Y I`  d  Ld M * @  $ % CC$$)%1 Udߥ$9%: !0 S$% DD˙`  }J)Lr d M * @  $ % CC$$)%1 Udߥ$9%: !0 S$%} DD˙`  }J)Lr J  ((  p L ()   J}L= ( L 0q A    IB JC;? D W } LL  ` W )LA!  ߰")-݆ p" } $G@LL 08`Q")<2Q0 -G$Ș݆ UL# ; p8(()(0ʥ)NQ` }$GȘ݆LU )L ݆ L GȘ ݆LL )W>Z   HH)H }p h  hyhy D L> L JJ    ! LA*` BF }7'8  M HN H` 8 Z  \LdJJ!"! GFE@F (!L }EE !E^ ^ E E7EȩEdE/EȩE  D } .L }  ;F d  ;?F7F? ( .   Z D LL d } . D  L    p  E` , d)  D L) 0BM݊L݉} ML  N݆ L NLML [ TEqEHȱEqEh 0Gȹ G} HLL GɛL  LFREE SECTORS G) *Gȩ GȽG GȌ*jj >G} C8jJ3j2CD( C202C ԠBX` N 1? l LlD:RAMDISK}.COMLu L1 L ;LHL  T`  `8  ɐ     `TU  } L ? .  t`GBJ ~DEHI B V0dV!}QDEHI VF9 ,0 ,0 s0hhL  L` H hDHEh"}DEL8HI4 0 HI,0 0  9 .G VLO#},0 L4*IJ`llD1:AUTORUN.SYSNEED MEM.SAV TO LOAD THIS FILE.D8:MEM.SAV J y08 B|DEHI$} V0 0`B;DEL`?<0LV`@ʆ v s? F0Ξ05: [ BDEHI%} VY8 B V  @  /DE `E:D8:DUP.SYSERROR-SAVING USER MEMORY ON DISKTYPE Y TO &}STILL RUN DOS B;DE J  (` 9 V⪍ ઍ  -'}LLu ÝDEHILV 9 .l 9 .l  `` s$B BH(}I|DE V BLV nB,DE JLV B V BLVDEIʩ BꭝLu } 3E:}DISK OPERATING SYSTEM II VERSION COPYRIGHT 1984 ATARI CORP.A. DISK DIRECTORY I. FORMAT DISKB. RUN CARTRIDG*}E J. DUPLICATE DISKC. COPY FILE K. BINARY SAVED. DELETE FILE(S) L. BINARY LOADE. RENAME FILE M. RUN AT ADDRES+}SF. LOCK FILE N. CREATE MEM.SAVG. UNLOCK FILE O. DUPLICATE FILEH. WRITE DOS FILES P. FORMAT SINGLEL !N',}#"&))9(&*)/h)''-&؆莟R'S  vL/ˢ L }Insert DOS 2.0s, type Y Λx -}DEfHI 1莏#q! @ y0ɛ8A0,' ȅ 1 1ild! 1L!NO SUCH ITEMSELECT.} ITEM OR FOR MENU! 0 .z:*{}.|{ 1 0 0JB 18L%|DL/}%DIRECTORY--SEARCH SPEC,LIST FILE?[# 0 0 &|D3" 1L!NOT A DISK FILEN !B 1L!E# 1 !BD0}ED:}:1BJ|DE 1DEBHI 1 h0ߢ 0.1}  0?詛 1 y0YЛ 1 ;#L" ;#L! BL1TYPE "Y" TO DELETE...DELETE FILE SPEC2}COPY--FROM, TO?OPTION NOT ALLOWED092 FREE SECTORS COPYING---D2:BASIC4.TXTl# 0|D .L/%#3}##JB|DE 1BHID#E 1#0: B 1L!#͑### B 1#c$0SY4}S1}:## # # .#Ƚ# # 𩛙## 1,#PD#ELJ- <.BJD#E 5}1 1HH 0hh|DL%1}:̳# L% #D#EL% 1 0 . .0O% 1L!WILD CARDS NOT A6}LLOWED IN DESTINATION 0 <.|K}N 2 FORMAT. t* 5) 1L!`) 0NΞ 0 L1) 1 L!BAD LOAD FILELOAD FROM WHAT FILE?) 0 ?}0#B 1L!WHAT FILE TO LOCK?) 0 0$B 1L!WHAT FILE TO UNLOCK?DUP DISK-SOURCE,DEST DRIVES?TYPE "Y" IF OK TO US@}E PROGRAM AREACAUTION: A "Y" INVALIDATES MEM.SAV.FE! +L1   `*  70 2 2A} 0.* 1 y0 0)INSERT BOTH DISKS, TYPE RETURN^, 1 y038逍 N, 1L! ,B}C, t*  Lx+, 0 ^, 1 y0 , ,0,0 ,L+ ,I0 ,Vǭ0C}Ξ, 0 }, 1 y0C,ШC, 0K'!" H H 'h h Lx+!EF 5L1L!D,I,HhD}` NOT ENOUGH ROOMINSERT SOURCE DISK,TYPE RETURNINSERT DESTINATION DISK,TYPE RETURNE}`  `8 rL1`-* 1P* 1 y0Y`hhL!NAME OF FILE TO MOVE?- 0 0|DL% <.F},^ 1 70 0 .@L# .BJ 1  DEHIB V L1 ,} 1 70,L.  G}JB|,#P#DE 1 HI BDEHHII 1 B 1 ,^ 1 70,0La- B V,#PH},^ 1 70 0L#L!-* 1P* 1 y0Yj383}mm ݭI}}`8}``|* ? ɛ,`|:-)| / 1L!`DESTINATION CANT BE DOJ}S.SYS0 0H{ 24Δ 28/L!/) 2 Π 2 0 ξK}hAΞB,0 J 1 BDEHI,HÝDE 1HIHIDELSAVE-GIVE L}FILE,START,END(,INIT,RUN)O S0 1`BDEPHI V` S0H 1 L!M}0 0 1L~0`PLEASE TYPE 1 LETTER,0`hhL! 70 1L0L<1 ,;ɛ7,"ɛ:ݦ1ݥN}A"D|ݤD|ȩ:|ȩ|ɛ,,(/+.ީ1 1,ɛ`轤{NAMEO} TOO LONG B VL!` L1I H1EΝDL1|mDiE` V0`8d/8 i:222 1 LP}!ERROR- 128ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8TuR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8Tu05  15 2 2151^116115ύ011$r2ԭ5 3)5)5ԭx GT}@@L00)+& 2 L0=ɛ -L!1LV1L1 /3 3ȹ441L-4 v3 25 2H 2h͔5U}L3L3 2 k3U hh`DOC`QL3P1Lk0S1H /3h0B k3@ VL0LU!#$53 1181118V}1111Ε5 1Lk0552 1Ȍ1i111i11115Lk0pppB4f5&&&&&&&&^6f^6&&&&&W}&&A1@BJ D2ELVK@BHILV^Щ6 2BD2EJ VBD5EHI0 V0%5X}5 2iХiL[2 25 25`D:*.*` i@`8 ``@i `8@`0 BLV525<4Y}5`HH i ԍΗ552 ԍhh@ Lح1Э1Ѣ 24.4 24Z}4`D4E` 2BJ k3LVRH` 2BD4EhK)I JLV333= 50 THEN PRINT "H ";:HEADS = HEADS + 1 50 IF NUM < 50 THEN PRINT "T ";:TAILS = TAILS }+ 1 60 NEXT X 70 PRINT "There were ";HEADS;"heads and ";TAILS;" tails." 80 END We can do this many ways. We can test} for heads, and know that it must be a tail if it isn't a head, etc. This is your plain vanilla way with counters, and test}s, splitting a numerical range. Even though it looks like we could just use a numerical range of 1-2, and call "1" heads }and "2" tails, it usually happens that computers are more random over a broader range of numbers, than just guessing 1 or 2.} Try this and see what you come up with. We could test for odd/even to pick heads or tails also. Dividing a numerical ran}ge is a common algorithm for simulations.====== String Length: LEN() ====== This function returns a digit, giving the }length in characters of any valid string. Often handy to force a program to take in characters until a string reaches a ce}rtain length, or to reject input over a defined length. Perhaps my favorite is to "pad" a string out by adding blanks on the} end, until it reaches a pre-defined length, as in padding entries in a mailing list. A way to make all names 20 charact}ers in length before storing them in a record is: 75 IF LEN(NAME$)<20 THEN NAME$=NAME$+" ":GOTO 75 One of my top t}en favorite one-line short hacks.======== ATASCII: ASC() ======== Computers handle keyboard input, by assigning a numb}er to each possible key. Now fortunately for you and I, some of the parties got together, and established a standard, the A}SCII standard. This calls for MANY of the keys to have the same number assigned, by many different manufacturers. The num}bers, upper and lower case letters, and much punctuation is "in" the standard. Atari has 128 standard characters, and 128 c}haracters peculiar to Atari machines. Atari calls it's codes ATASCII for Atari ASCII. Here's some examples: Character } ATASCII Value 0 48 1 49 2 50 . } . 9 57 : 58 ; 59 < 60 . . } . . A 65 B 66 . . Z 90 . } . . . a 97 b 98 . . z 122} ...etc. These are IN the ASCII standard. Now, what does this mean to us? Well let's say we are bringing numerical in}put into a program, in response to a prompt for an integer. We are using string input, so we can take in any character. How} can we error check for non-numerical input being entered, which our program should ignore? A very quick and dirty way to} check whether or not we really took in a number, would be to go through the length of the string we took in, one digit at }a time, and check if the ASC() value of the character is greater than 39, and less than 58. If so, It would be a digit. } etc. 110 PRINT "ENTER a number "; 120 INPUT STRING$ 130 FOR X = 1 TO LEN(STRING$) 140 IF ASC(STRING(X)) }< 40 OR ASC(STRING(X)) >58 THEN ? "ERROR" 150 NEXT X etc. This is very handy for testing. Remember ASC() }gives you a number.======= Character: CHR$() ======= This is the opposite of ASC(). We can PRINT this one. For exam}ple: 35 PRINT CHR$(65) This prints an A. The numbers are the ATASCII numbers. Granted we could have just said: 35 }PRINT "A" This would have worked, but how about 10 PRINT CHR$(125). This clears the screen. Many characters are a}ccessible using CHR$(). Remember CHR$() gives us a character. CHR$() will print control characters on the screen. LPRINT a}nd CHR$() statements are used to communicate with printers, to alter type font, line spacing, margins, etc.========== }PEEK() ============ This function "looks" at the value in a memory location, numbered from 0 to 65535 in a 64K computer.} We have to print it to see it as: 10 PRINT PEEK(43234) This memory location will tell us what version of BASIC we ha}ve. 162 = version A 96 = version B 234 = version C========= POKE =========== This writes a new }value in a memory location, like: 10 POKE 622,1 This one will make our BASIC code scroll slowly when we list it. Resto}re normal speed by: 10 POKE 622,0========= TRAP =========== This tells the program where to go, when it encoun}ters an error. If we don't want it to halt, and print an Error statement, we just write code like: 235 TRAP 500 } etc. 500 PRINT "Oh, I'm stuck":STOP After it executes, we have to reset it by issuing another TRAP statement, or it w}ill revert to "normal" error trapping. This is frequently used to read in a file of unknown length, and using the TRAP state}ment to continue the program when it runs out of data, rather than quitting on an error. I use TRAP to detect and print a} message when the printer is turned off, and to send control back to an INPUT statement when I take in data that causes a c}rash. Easy error checking. When input is done, we can cancel the TRAP statement by assigning it a line number higher tha}n 32,767. That turns TRAP back off. This is frequently done by setting a variable named OFF = 40000 early in the program. W}hen we want to turn TRAP off, we issue the command TRAP OFF. This works, and also makes sense to the eyeball to let us kn}ow the status.----------------------------------- There are more built-in functions. This lesson is not all inclusive, b}ut will serve as an orientation, and as background to help you figure out the rest. When you have a few free moments, brow}se your BASIC manuals, and see what kind of functions you have available. ALL languages usually have functions. Once you }learn tricks like forced rounding, or random number ranges, it will usually translate over into another language. -------}---------Sample Problems:----------------Problem 5 Write a program that takes six guesses at the Illinois LOTTO number} (1-44). See if you can figure out a way to NOT guess a number more than once!-----------------------------------Proble}m 5A Write a coin flipping program that flips 100 coins, and keeps track of the number of heads and tails. Try it with} a numerical range of 1-2, and a range of 1-10, and a range of 1-1000. Are there differences in it's randomness ?--------}--------------------------- This concludes Lesson 5 of Learning To Program in Atari BASIC. Be sure to catch Lesson 6 whi}ch includes: SUBROUTINES RETURN Statement GOSUB ON GOSUB and more tricks & tips-------------}----------------------Contact me at: Jackson Beebe Prairie Data Fields 807 West Hill Street Urbana, IL 618}01 bye: Jackson Beebe Prairie Data Fields 807 West Hill Street Urbana, IL 618%TEXT&00LEARNING TO PROGRAM IN ATARI BASIC------------------------------------LESSON 6 Version 1.06 } Subroutines------------------------------------(C) COPYRIGHT 1987 by Jackson Beebe This lesson is placed in the Pub}lic Domain. Individuals, user groups and BBS's may reprint, copy or distribute it, as long as this notice remains intact wi}th the lesson.------------------------------------CONTENTS:------------------------------------ Subroutines GO}SUB Statement RETURN Statement POP Statement Error Checking ON_GOSUB Statement This is Lesson 6 of Lea}rning To Program in Atari BASIC, brought to you by Jackson Beebe. Contact me at the address at the end of the lesson.-----}-------------------------------Structure:------------------------------------ As we have discussed before, BASIC gets a }'bad rap' in the programming community, owing mainly to: 1. It's slow execution speed, as it's an INTERPRETED lang}uage. 2. It's lack of 'structure.' Execution speed is not really as big a problem lately with the advent of compilers} that can compile a BASIC program into object code and run it rapidly, but 8 bit Atari's are not receiving up-to-the-minute }new compilers, as are PC's. We do have Turbo BASIC, the fine PD BASIC for XL's and XE's from Germany that includes a co}mpiler, but for now we're learning about plain vanilla Atari BASIC. 'Structured Programming' is the new darling catch-phr}ase of the computer world. Structured languages like PASCAL, and perhaps "C", have rigid requirements for how we can code a}nd arrange code, to accomplish a job. BASIC, on the other hand, is very, very loose. It will let us write just about anythi}ng in any old way, and it will probably work. The drawback to BASIC's lack of structure is that we can write such a mish-mas}h of jumping around kludged up code, and without REMs, no one will ever be able to trouble-shoot, decipher, or maintain our } code. There are ways we can introduce some structure into BASIC that will allow us to program in more modern 'modules.'  } One of these techniques is to use subroutines. Subroutines are modules of code that we transfer control to, within a progr }am, execute the code in the module, then return.------------------------------------Subroutines:------------------------- }----------- The most popular use for subroutines, is to hold code that we use more than once in a program. Instead of cod }ing it out three, or four or more times throughout the program, we can code it once, put it in a subroutine, and call that }subroutine whenever we need to use that code. Isn't that clever? These subroutines may be placed anywhere in a program, a}t the beginning, in the middle, or at the end of a program. I think it's best to pick either the beginning, or end of a pro}gram. By convention, we often expect to find them there. Putting them in their own location, further contributes to 'struc}ture' which is desirable, at least in 1987. More on placement later. Subroutines are smaller 'packets' of code, that usual}ly perform some clearly defined function when called. They are equivalent to 'blocks of statements' or 'functions' in othe}r languages.------------------------------------GOSUB and RETURN Statements:------------------------------------ We se}nd the program to a subroutine using the command GOSUB followed by the line number of the beginning of the subroutine. The }subroutine will be made up of one or more lines of BASIC code, with the last statement being RETURN. Control returns to the} next executable statement after the GOSUB that called the subroutine. We'll restate this again later. It's important. Fo}r example, let's follow this printing program through: 10 REM *** GOSUB DEMO *** 20 ? "I'm at line 20" 30 GOSUB 80 4}0 GOSUB 110 50 ? "Back at line 50 to END" 60 END 70 REM * * SUBROUTINE * * 80 ? "I'm at line 80" 90 RETURN 100 REM} * * Subroutine * * 110 ? "I'm at line 110" 120 RETURN This program produces the output:I'm at line 20I'm at line 80}I'm at line 110Back at line 50 to END It always prints at 20, then goes directly to line 80's subroutine, and prints th}ere. Line 90 causes a return to line 40, the line following the line it went gosub at (line 30.) It then goes directly to l}ine 110, the second subroutine, prints, and line 120 causes a return to line 50, where it prints, and falls into line 60 to} end. You should be able to follow these comings and goings. Again, it always returns to the next executable statement fo}llowing the one it went GOSUB at. This could be in the MIDDLE of a line like this: 90 REM ** Another Demo ** 100 GOS}UB 200:? "end of line 100" 120 ? "At line 120" 130 END 200 ? "At line 200" 210 RETURNOUTPUT:At line 200end of l }ine 100At line 120 This leaves at the beginning of line 100, prints at 200, returns back to the remaining statement on l!}ine 100, to print "end of line 100". It prints at 120 and quits. You should study this until it makes sense. Here's a lo"}nger example. Let's say we have a program that brings in names from the keyboard, and checks them each to make sure only upp#}er or lower case letters were entered. (We wouldn't necessarily go about things this way in a formal program, but this is j$}ust a subroutine example.) 10 REM ** Input Names Program ** 20 REM Dimension variables 30 DIM FNAME$(15), MNAME$(15),%} LNAME$(15),IN$(15) 40 PRINT:PRINT:PRINT:PRINT 50 REM 60 PRINT "Input First Name "; 70 INPUT IN$ 80 GOSUB 100&}0 90 FNAME$=IN$ 100 REM 110 PRINT "Input Middle Name "; 120 INPUT IN$ 130 GOSUB 1000 140 MNAME$=IN$ 150 REM 160 PRI'}NT "Input Last Name "; 170 INPUT IN$ 180 GOSUB 1000 190 LNAME$=IN$ 200 PRINT:PRINT:PRINT 210 REM 220 PRINT FNAME;" ";(}MNAME;" ";LNAME 230 END 240 REM 990 REM ** CHECK SUBROUTINE **1000 FOR X = 1 TO LEN(IN$)1010 IF ASC(IN$(X)) < 64 OR )} ASC(IN$(X)) > 123 OR (ASC(IN$(X)) > 90 AND ASC(IN$(X)) < 97) THEN 10501020 NEXT X1030 RETURN:REM okay letters-r*}eturn1040 REM1050 PRINT "Non-alphabetical input"1060 FOR WAIT = 1 TO 350:NEXT WAIT1070 POP:GOTO 40:REM error-pop stack+} Okay, let's look at what we have here. This program dimensions variables at line 30. It brings in a string from the keyboa,}rd at 70, in a variable called IN$. Line 80 calls a subroutine at line 1000, that checks each letter in the string, from 1 -}to the length of the string. It checks to see that each character is either upper case (ASC between 65 and 90) or lower case.} (ASC between 97 and 122.) If the input is good, line 1030 sends control back to line 90. At this time, the input in IN$/} is assigned to FNAME$, and held there. Next the program brings in the middle name, as IN$ again, and sends it to line 1000'0}s subroutine for checking. If good, it returns, loads it into MNAME$, and inputs and checks the last name. The reason I ch1}oose IN$ as the variable in all the INPUT statements was so I could use the same subroutine to error check all three string2}s. To do that, I had to pick a variable name in line 1000 and use it for each test performed. The easiest way is to bring ea3}ch input in as IN$, and assign input to another variable after checking. At line 200, it prints out the total name and END'4}s. If a subroutine test fails (is 'bad' input), it jumps to line 1050, prints an error message, waits a moment, and start5}s itself over again. We were able to save a lot of code here by putting the test in a subroutine, and recycling it. If t6}his were a 'real' program, I would move the INPUT IN$ statements to the first statement in the subroutine. I didn't, for cla7}rity of sections and function in this lesson. Moving the INPUT to the subroutine would save three lines.-----------------8}-------------------Error Checking:------------------------------------ One thing that separates the real programmers, fr9}om the wing and a prayer kludgers, is the inclusion of excellent error checking. This usually involves checking for possibl:}e errors in input, etc. that would crash the program, and supplying user informative messages. It is my opinion that prog;}rams should always include error checking, as it isn't fair to a new user for a program to repeatedly crash, when trying to<} learn to operate it. It's a lousy way to learn, and only a few of us will persevere through too many crashes. There are =}many ways to accomplish error checking. This program includes a string character test. Using IF-THEN statements, we can test>} whether a 'good' character is within a stated range, in which case the IF-THEN statement tests true and executes the end o?}f the statement, or we can test whether a 'good' character is outside a stated range, in which case the statement tests fals@}e for a good character. A statement set up like that would only execute the end of the IF-THEN statement if it is a bad chaA}racter. (This is the test I used.) Many, many tests are possible with AND, OR, <, >, =, and others in all combinations.B} Note the order of stating the ASC of the string IN$, and the X'th character of the string. ASC(IN$(X)). Also note the waC}y we must arrange the parenthesis around the X. The FOR-NEXT loop increments to check each place in the string. This stringD} error checking routine is a genuine Handy Household Hack for your collection. You can include number checking, or other puE}nctuation commands easily, such as a hyphen, colon, etc.------------------------------------POP Statement:---------------F}--------------------- Atari BASIC includes a POP command to pop the stack if we jump out of a subroutine, or leave it othG}er than by the RETURN statement. Atari 8 bit computers use page one of memory, locations 256-511 for the 'stack'. At bootH}up time, the computer 'points to' location 511. Each time we call a subroutine, it puts new information 'on the stack' whichI} grows downward toward 256 to keep track of where it left from, and where to RETURN to. After it accomplishes a RETURN, it J}clears those addresses back off the stack. When we jump out of a subroutine, rather than RETURNing, we need to (should) POPK} the old, no longer needed addresses off the stack. Here's a couple examples, and a new topic, Nesting.-----------------L}------------------Nested Subroutines:----------------------------------- We can go from one subroutine level to another,M} to another, etc, going very 'deep.' Stack POPing, relates to coming back correctly to a desired place from nested levels, N}for example: 10 REM ** Nested Demo ** 20 ? "I'm starting at 20" 30 GOSUB 1000 40 ? "I'm back at 40 to END" 50 ENDO} 60 REM1000 ? "I'm gosub at 1000"1010 GOSUB 20001020 ? "I've returned to 1020"1030 RETURN1030 REM2000 "I'm gosub at 20P}00"2010 GOSUB 30002020 ? "I've returned to 2020"2030 RETURN2040 REM3000 ?"I'm gosub at 3000"3010 RETURNOUTPUT:I'm sQ}tarting at 20I'm gosub at 1000I'm gosub at 2000I'm gosub at 3000I've returned to 2020I've returned to 1020I'm back at 4R}0 to END Note that it goes one level at a time, and returns one level at a time. Step by step. Now let's try POP: 10 RS}EM ** POP Demo ** 20 ? "I'm starting at 20" 30 GOSUB 1000 40 ? "I'm back at 40 to END" 50 END 60 REM1000 ? I'm gosT}ub at 1000"1010 GOSUB 20001020 ? "I've returned to 1020"1030 RETURN1040 REM2000 ? "I'm gosub at 2000"2010 GOSUB 300020U}20 ? "I've returned to 2020"2030 RETURN2040 REM3000 ? "I'm gosub at 30003010 POP: POP: RETURNOUTPUT:I'm starting at V}20I'm gosub at 1000I'm gosub at 2000I'm gosub at 3000I'm back at 40 to END The thing to notice is that each time we isW}sued a POP command, it 'forgot' it's last gosub address. Often necessary to keep your returns straight, but in small prograX}ms, not necessary for single level subroutines etc.------------------------------------Fast/Slow Subroutines:-----------Y}------------------------- BASIC is pretty straight forward about finding a subroutine when called. It goes to the very beZ}ginning of a program, and looks at each line one at a time, to see if it's the desired line. Naturally if your subroutine is[} at the bottom of a lengthy program, there will be some delay before it executes. This is an example of a slow subroutine. \} The best applications for slow subroutines may be introductory screen messages, menus, etc. If speed is very necessary, ]}then put the subroutine as near the beginning of the program as possible. Usually we jump around fast subroutines with GOTO^}'s like this: 10 REM ** Fast Subroutine Demo ** 20 REM 30 GOTO 200:REM Jump around SR 40 REM 100 REM * * * Fast Sub_}routine * * 110 FOR X = 1 to LEN(IN$(X)) 120 IF IN$(X) = 65 THEN PRINT "A" 130 NEXT X 140 RETURN 150 REM 200 PRINT "WEL`}COME to EZ-LIST" 210 REM DIM IN$(15) 220 etc - rest of program To use the fast subroutine in the program, we would say:a} 335 GOSUB 110 The program would find it, execute it and return at 140 deeper into the body of the program to calling pb}lace. Kind of fun to experiment with. Try this for yourself.------------------------------------Gosub to REMs:----------c}-------------------------- I would caution you never to send a program to a REM at the beginning of a subroutine. It willd} work, but many programmers don't believe in REMs. Not only don't they write REMs in their programs, but they'll remove REMse} from our programs to gain space, add a hack, or just on principle. If you've used a REM for an address, it will crash. Grf}anted people perhaps shouldn't do that, but believe me they will, so always send to a good line, and precede it with a REM.g}------------------------------------ON_GOSUB Statement:------------------------------------ This statement works like q}-b%DOS SYSb*)DUP SYSb SAUTORUN SYSb _HELP DOCbhBASIC5 DOCbBASIC6 DOCbBASIC7 DOCON_GOTO (Lesson 3.) The syntax is: 10 ON VALUE GOSUB 111,222,333,444 When the variable stated, in this case VALUE has tr}he value of 1, control goes sub to the first line number specified, in this case 111. If the variable is 2, it goes sub tos} the second listed line number, etc. Of course the big difference between this and ON_GOTO, is that this one always returnst} to the following line number, and ON_GOTO does not return. 10 ON NUM GOSUB 935,25,250,190 This is a valid statement. u}Line numbers need not be in any particular order.------------------------------------ There is more we could say about v}subroutines, but this should get you started, and on your way. Many programmers keep libraries of subroutines for BASIC haw}cks, and use them in future programs. This is an excellent idea. By now you should be able to write quite a bit of straighx}t down code to do math, printing, etc. You should be able to puzzle out much of what you read in ANTIC and ANALOG magazinesy}' BASIC listings. For reference you should have a booklet or book or guide of some kind next to you with ATASCII codes, andz} perhaps Atari BASIC commands and examples. Again I recommend "The ANALOG Computing POCKET REFERENCE CARD" for $7.95. I in{}itially worried that I'd wear it out at the seams, but it's still going strong after almost two years! If you plan to con|}tinue on with Atari BASIC, or any other language for your Atari 8 bit, I suggest you go out and purchase a "Memory Map." Act}}ually this is a book, filled with each memory location, and exactly what it does, and what values will make it do which thi~}ngs. Don't get intimidated at it's size, or initial complexity, just buy it, and read it for pleasure. Keep it by the john}, or carry it to your doctor's appointment, or read 1/2 hour before bedtime. Keep a list in the back of your discoveries, f}or instance that: 621 controls the key click 752 " cursor on/off 622 " scroll speed 580 } " coldstart 82 " left margin etc. Check for "The Master Memory Map for the Atari" by Cra}ig Patchett & Robin Sherer or "Mapping The Atari" by Ian Chadwick. After you buy a disk drive and a printer, one of your n}ext needs is for a handy bookshelf. (Right after you buy a modem !)------------------------------------Sample Problems:-}-----------------------------------Problem 6 Write a program that displays a menu on the screen at startup, that allows} you to choose Addition, Subtraction, Multiplication or Division, then prompts you correctly to input two numbers, and add, }subtracts, multiples or divides them and displays the numbers and the answer. Use subroutines to accomplish each math fun}ction. Use error checking to check for numerical input, also in a subroutine.------------------------------------Problem} 6A Write a program that brings in a sentence from the keyboard, and counts how many digits, spaces, upper case letters a}nd lower case letters the sentence contains. It should print out all this info plus the length of the sentence.-----------}----------------------------------------------------------- This concludes Lesson 6 of Learning To Program in Atari BASIC}. Be sure to catch Lesson 7 which includes: Substrings DIM Statement Numerical Arrays Multi-Dimensional} Arrays CLR Statement Card Dealing------------------------------------Contact me at: Jackson Beebe P}rairie Data Fields 807 West Hill Street Urbana, IL 61801or 72550,317 on CompuServeor call the *PAC* BBS and lea}ve E-Mail to JACK BEEBE. bye01or 72550,317 on CompuServeor call the *PAC* BBS and lea@TEXT&00LEARNING TO PROGRAM IN ATARI BASIC----------------------------------LESSON 7 Version 1.06CONFESSIO}NS OF AN 8 BIT POWER USER or (How To Grow A Computer System)----------------------------------(C) COPYR}IGHT 1988 by Jackson Beebe This lesson is placed in the Public Domain. Individuals, user groups and BBS's may reprint, co}py or distribute it, as long as this notice remains intact with the lesson.---------CONTENTS:--------- Buying an 8 b}it Atari Computer The Atari 410 and 1010 Recorders Atari 1050 and SX 551 Disk Drives The Atari 1027 Printer Addin}g a Monitor A Dot Matrix Printer Interface Units for Printers, etc. The Atari XM-301 Modem Memory Upgrades Rep}lacement Power Supply A Different DOS A 2400 Baud Modem Hard Disks What Next? This is Lesson 7 of Learning To }Program in Atari BASIC, brought to you by Jackson Beebe. Contact me at the address at the end of the lesson.--------------}-------What to Buy and When?--------------------- Up to this point, we have focused our attention on the technical aspec}ts of Atari BASIC. FOR-NEXT, IF-THEN, GOTO, etc. Many people, especially new users, have asked questions about adding com}ponents to their computer. How you know what to buy and when? This seems like a good point at which to take a little brea}k from BASIC code, and discuss some of these points. I have outlined the way my own system grew, as I believe it's pretty t}ypical of Atari 8 bit systems.-------------------------------Buying An Atari 8 Bit Computer:----------------------------}--- For a hacker, I figure I acquired my Atari computer system in the "standard" way. I read computer magazines for abou}t three years, yearning for my very own home computer. Ah, what a thought, but oh, what a price. $900 for an Atari 800 with} 16K RAM when I was yearning. I yearned my way through the introduction of the 1200 XL, and REALLY wanted a 1450 XLD so b}ad (ZNOTE: Who Didn't?) that I called the Atari toll-free 800 number (remember that?) about 113 times over a two week perio}d before getting through to ask about it. The 1450 XLD was to have two double sided, double density drives, function keys, }etc. They said it would be released "any time now." (We're still waiting.) I yearned after an 800 XL, and a 130 XE, and f}inally in the fall of 1984, when the 800XL with 64K was only $170 at local discount stores, I struck. Wow, my OWN computer}. I had arrived. I took it home, hooked up all the cables and wires, connected it to my old small black and white TV set }and typed in: 10 FOR X = 1 to 10 20 PRINT "Hello World" 30 NEXT X 40 END and typed RUN. Look at it go, a real} program on my own home computer. I dug out my ANTIC and ANALOG magazines I had been buying even before I had a computer, a}nd typed in a few short programs. Boy, I was cookin' now. I went right out and bought a few more books. I was a happy man, w}ith a computer with all of 64K memory. How could a man ever fill up 64K? I was sure I was set forever.The current crop of} 8 bit Atari computers available new and used includes: Atari Model $$ Memory 800 Used 16K + } 600XL Used 16K 800XL New $80 64K 1200XL Used (strange) 65XE New $90 64}K 130XE New $130 128K (ANOTHER ZNOTE: With the increase in chip prices, computer prices have also increase a} bit. Not much, just enough to P*** a person off) All prices mentioned are mail order as of January 1988. Shipping is ext}ra. Atari promised to move many machines at Christmas 1987, and I hope many of those new users are reading this now. It }is important to note that this lesson is focused on the 8 bit Atari machines. The newest crop of Ataris, includes the 16 bit} Atari 520 ST and 1040 ST and the Atari PC clone. The ST's are faster, more up-to-date and expensive. This author is still} intrigued with "small is beautiful", and "less is more" etc, and is a die-hard Atari 8 bit fan. This is hard to explain I} guess. So far, the 8 and 16 bit communities are existing side by side. I hope this continues forever. Let's hope we all sh}are our common affection for computers, and for Atari, and don't degenerate into arguing over which is "best." Loving the }8 bit machines is a little like loving antiques. They're not the newest, but have a very broad charm of their own, with a w}ealth of information written and published about them. They are very inexpensive, yet offer an opportunity to own a computer} now, rather than saving up a great deal of money before you get started. If enough of us continue to support 8 bits, they }will continue a long time. My pick of the 8 bit machines to buy are the 800XL, and the 130XE. The 130XE appears to have }the most memory for the price. Both machines are upgradeable, the 800XL to 256K, and the 130XE to 320K or 576K. Again the 1}30XE looks like the best buy, but my personal bias is toward the 800XL. It's a small point but I prefer it's keyboard. It ha}s a crisper, more typewriter-like feel. The 130XE keys feel mushy to me. Again, it's a pretty even split, and you will hav}e to admit, either is a great buy at the price. I recommend upgrading the memory right away with either computer, but more }about that later. If you're reading this, chances are that you have one of these machines. If you're shopping, these repr}esent the absolute best value for the dollar in my book. Great machines, and access to a wealth of programs. You can make} a terrific buy, purchasing an 8 bit system from a user who converts to an ST machine, and sells the old system complete. Yo}u will usually gain up to $1000 worth of software for free in the deal, with books and manuals too.----------------------}--Atari 410/1010 Recorder:------------------------ Now I owned my own computer. I was a satisfied man...for about a week}. The novelty of typing each program into RAM was beginning to wear off. I wanted to be a POWER USER. I needed storage! Rig}ht about this time, my brother-in-law gave me a spare Atari 410 tape recorder, and I was riding high, again! I could now t}ype in huge programs, over days and days. I could load programs in a few (2-10) minutes, usually on the first try, or almost} usually the second try. This gave me the ability to write longer and longer BASIC programs, but loading and saving these }programs was more of an art than a science. I realigned the head on my recorder by recording a mono tape of the FM 'whit}e noise' between stations on my AM/FM receiver using my stereo cassette deck, and playing that tape back on my Atari 410 rec}order. I adjusted the head for maximum output on an oscilloscope connected between output pins of the DIN (monitor) connec}tor on the rear of the computer. Now my tapes loaded nearly every time, including the three commercial tapes I had by now, b}ut I still had a yearn for faster and bigger storage (sound familiar?) If your brother-in-law lends you a recorder, that'}s great. If not, then DON'T buy one of these. The money you spend, will be better used toward the more rapid purchase of an} Atari disk drive. Between you and I, I believe a disk drive is worth borrowing money for. The Atari 1010 recorder is a }bit flashier looking, and reportedly works a bit better than the 410. Keep in mind that both are very inexpensive (under $5}0) and aren't of the same quality as your $289 home stereo cassette deck. That brings up the question: "Can I use my own h}ome tape recorder to record Atari programs?" Unfortunately no. It's technically impossible as the computer expects custom c}ircuitry. I saw a used 600XL (16K) with a 1010 recorder recently for $50. Even at that it probably wasn't a good buy, com}pared to a new 65XE or 800XL for the few additional dollars. If your friend buys a used system for other components, maybe} she'll lend you the recorder. If you don't have other storage, then by all means, borrow it, and get going. Learn, go forw}ard. You can usually copy your tape programs over to disk when you upgrade later. Many user groups have recorders in the l}ibrary for members to check out. This is very worthwhile for beginners.----------------------1050/XF551 Disk Drive:----}------------------ Finally the day came when I had enough money saved to buy an Atari 1050 disk drive. 88K! I was happy a}gain! Now I not only had speedy saves and loads, but I could run commercial disks, and trade disks with friends. Hurray. I b}ought ten 5 1/4 diskettes, and figured I was set for years. Well, at least until I got a printer that is. Atari is not m}aking the 1050 SS/SD (Single Sided, Single Density) drive any longer. These remain excellent, sleek, trouble-free drives tha}t can be repaired many places if they fail. These are a good buy new or used, if you can find them. I have seen them new f}or $130-180, but they are nearly gone now. Used drives sell rapidly, for $70-130. If you buy a 1050, I recommend upgradi}ng it right away with ICD's US Doubler chips. They allow you to use Double Density, expanding the storage capacity of the d}isk to 180K. Wow, more than double! Although the modified drive will work normally with Atari DOS 2.0s, (Disk Operating Syst}em) you must use a double density DOS to achieve double density storage. More on this later. Don't worry, that's only ano}ther $50 plus postage to get everything working twice as good as new. The Atari SX 551 is the latest disk drive available}. They sell mail order for about $175. This is ALREADY a double density disk drive, therefore you don't have to upgrade it }to achieve 180K storage, as you do the 1050. You still need a DOS like SpartaDOS 3.2d that supports double density operatio}n. A double density DOS from Optimized Systems Software is supplied with it. I have not seen one of these drives personally} yet, but would not hesitate to purchase one. It is double sided, using both sides of the disk for double sided/double dens}ity (DS/DD) operation. Once you buy a single sided disk drive, like the 1050, buy a disk notcher for about $5 at a discou}nt store. You can notch the diskettes, and use them on the back by flipping them over. Attach a new label, and you're on you}r way. There was great controversy over whether this was workable or not, but all my friends and I have been doing it for s}everal years. All my several hundred disks are notched, and used on both sides. There are other brands of disk drives be}sides Atari. There are Rana (no longer made), Trax (no longer made), Indus, Percom etc. My personal opinion is that each of} these has some small quirk, that makes it less desirable to me than an Atari. Some don't check for bad sectors after they f}ormat a new disk. Some have trouble switching from single to double density automatically. When a drive breaks down it is a}n advantage to have a standard brand like Atari, when you seek repair. I believe we will always be able to have our Atari d}rives repaired. Many of my friends have other drives, and may disagree with me on this. Again, if it's a good enough buy, g}o for it. If it doesn't work out...sell it, and try again.-------------1027 Printer:------------- Soon I found a used} Atari 1027 letter quality printer for sale, with the old page-oriented Atari Word Processor, Home Filer, and Financial Mana}ger. Wow, now I was a junior POWER USER for sure. Thus began my longest period of satisfaction ever. I word-processed a g}reat deal, wrote tons of BASIC programs, read piles of magazines, typed in hundreds of programs, traded disks with friends,} and was a happy man, again! I bought a memory map, more books, and spent at least 3 months without needing anything! Th}e Atari 1027 is a letter quality Elite font (small) printer that isn't made any longer, but still often available mail order} for $90-130 or so. You'll find these printers sold with 800XL's or 130XE's through newspaper ads. Although designed for} single sheet use, I loaded mine with a 3500 sheet box of 8 1/2 by 11 inch continuous form paper WITHOUT perfs, only 8 1/2 }inches wide total. (The 1027's paper slot is too narrow to accept standard 9 1/2 inch wide paper with tear off perfs.) This }paper has tractor holes, but you can print between them. I still use this narrow paper for everyday drafts, BASIC listings}, etc. even on my dot matrix printer. There are no perf strips lying around to contend with, and printouts are easy to file.} Check with an office supply store. A box is $25-35. You can order ink rollers for a 1027 by mail for about $4 each. I al}ways reinked mine once or twice before replacing, by squirting the roller with WD-40! This is an excellent printer. Dec}eptively small. It's primary drawback is it's inability to print fonts other than elite. You must weigh it's $130 price, ag}ainst the $170-200 price range for dot matrix printers, that include NLQ, Near Letter Quality print, in multiple sizes and f}onts, with graphics ability. If the price is right, it's a great direct connect printer, that doesn't need a separate inte}rface to connect to an Atari computer.-----------------Adding a Monitor:----------------- After owning and programming} my computer for a while, I began to yearn for a better monitor. There were programs I used, that seemed to have information} down in the "grass" at the bottom of the screen, or showed a distortion at the edges. I believed, somewhat incorrectly, th}at I would get much better resolution with a monochrome monitor, than my TV set. How could I go wrong? All the POWER USERS }in the IBM PC magazines used monochrome monitors for their text work. What I didn't realize, is that they were using 80 colu}mns per screen line, as opposed to our 40 columns. Anyway, I found a used Zenith green screen at a local dealer, that had} been a floor demo. I bought it for $80, and took it home. Hmmm, I now needed a new cable to connect it to my 800XL. If yo}u ask 10 dealers, you will get ten very unique answers to the question of what kind of cable is required. I was told I need}ed cables ranging from $20, to "you can't buy those anymore." My advice is to buy a cable with a round 5 pin DIN connector }on one end, and four RCA plugs on the other. This will allow you to hook up any pins, including sound, that you desire. Don}'t worry about the brand, but do ask if you can return it if it doesn't work. I believe the one I use was labeled as a Comm}odore cable, but check with a good radio-TV parts store, or a Radio Shack store. I paid about $6 for mine. Connect each conn}ector briefly one at a time to find which is sound, color, brightness, and nothing. Once I got my beautiful monochrome gr}een screen connected...I had mixed feelings. Yes, text looked nice, and the screen images were smooth and uniform but...it }"trailed" streams of green light from rapidly moving bright objects. Very psychedelic. I had purchased a "slow" phosphor scr}een. Great for text, but horrible for Star Raiders. After this experience, I would recommend you take the trouble to try a } monitor you are not familiar with, before you spend your money. Generally, I am not a fan of monochrome monitors for 8 bit }s, unless the price is right. In graphics mode 0, 40 column text will still be made up of dots. However, a fairly 'fast' mon }itor, will easily beat an out-of-tune TV, and I've seen some nice amber screens. Color phosphors are generally very fast. T }ry them at a friend's first. One of the best deals, is to buy a bare chassis and CRT green monitor by mail order, and add  }connectors and power supply yourself. I believe the raw monitors without case sell for about $25. Check "Computer Shopper."} Well, just about the time I really felt discouraged, a friend called with news of a Commodore 1702 color monitor he'd see}n at a garage sale. I already knew from reading and talking to other owners, that this is the all around best monitor you c}an find for an Atari computer. The 1702 carried a new list of about $250, and sold at discount for $190. I bought mine used }for $125. Finally I was a happy man, again! I still have this monitor, and would not think of parting with it. It has bu}ilt in sound, chroma, luminence, beautiful color, great adjustments; what more can I say? I had been working with the col}or statements in BASIC, but didn't know what was going on with my black and white TV. The color monitor made an unbelievabl}e difference. Now my Star Raiders, Sub Commander, Chess and Flight Simulator programs were beautiful, and easy to read too.} It was just like buying a whole new system, or all new software. All the Commodore monitors, the 1702, and it's later re}placements 1802 and 1902 are excellent. The colors are rich, clear, and highly adjustable. They make an outstanding spar}e TV, connected to your VCR through their front panel connectors. You'll be impressed with one as a TV. Be sure and point ou}t this capability to your wife. For an 8 bit Atari with it's outstanding graphics, a color monitor is an excellent inves}tment. Amaze your friends with digitized pictures downloaded from bulletin boards. After a month or two of use, I became} intrigued with an article in ANTIC magazine November 1986 on adding a chroma output to the unused pin on the 800XL monito}r connector. It involves adding a .01 disc capacitor between R64 and R97, and the DIN connector. This is a very worthwhile m}od if you own a Commodore, NEC, or Hitachi monitor. It evened out my color, enriched it, and "smoothed" my background. It d}oesn't upgrade TV color. As I am handy with a soldering iron, and pretty daring, I had at it. I added a SPST slide switch,} to switch it in or out of the circuit (with the power off.) If you're not handy, have someone in your local user group do i}t. Members frequently do this kind of work for the cost of the parts!---------------------A Dot Matrix Printer:--------- }------------ By this time, I was a slight bit dissatisfied with the slow printouts of documents and BASIC listings and C !}source code, with the 1027 printer. I wanted to print "control characters" in my BASIC listings, and figured I could cure m"}y problem with a dot matrix printer. Within a few months, I found a Gemini 15 printer like new, in the newspaper for $190. #}The printer was exactly what I needed, and I loved it. What more could a guy want or need? Well, I really did need a copy $}of the brand new Atariwriter Plus Word Processor, with built in spelling checker, so a quick $50 bucks plus postage, and I %}was all set. The Star/Gemini (same company) printers remain favorites of the Atari community. They are usually Epson comp&}atible, extremely well built, sturdy, and frequently supported by Atari specific software. The models 10, 15, 10X and 15X a'}re still around used, and are probably a good buy, if they are significantly cheaper than a new Star such as the NX-10 ($170(}) with built-in NLQ, Near Letter Quality. The 10, 15, 10X and 15X do not come with NLQ. The 10's are 80 column, and 15's ar)}e 132 columns wide. By all means, don't turn down a used 15 or 15X if the price is right, just because you had planned on *}only buying an 80 column printer. One advantage of the 10, 10X, 15 and 15X is their use of standard typewriter ribbons, avai+}lable anywhere for $5. Atari sells several parallel printers that connect directly to the 8 bit computers, eliminating th,}e need for an interface. These are excellent printers. If you find one at a good price, or in a package deal, buy it. I -}lean toward buying a non-Atari printer, as I have a hunch I'll own a different computer someday. If you purchase a non-Atar.}i printer, even though it needs an interface to connect to your Atari, it will operate with any computer you own in the fut/}ure.----------------------------------Interface Units for Printers, etc:---------------------------------- Of course I0} had to spend another $50 bucks plus postage for a Supra MPP 1150 parallel printer interface, to hook the new printer up, bu1}t one look at all those wires, convinced me I was nearly a POWER USER by now. Non-Atari printers require a Parallel Print2}er Interface, to connect between the computer with it's serial output connector, and the printer. There are several choices3} available that range from providing the bare connectors required, to also providing extra connectors, serial connectors for4} modems, built in extra memory, hard disk controllers and connectors etc. The cheapest are the plain printer interfaces a5}s the Printer Connection for $40, or the P:R Connection from ICD for about $60, or the Supra MPP 1150. Both the P:R and MPP6} 1150 include an extra serial connector. If you buy an interface, I would make sure it includes the connector to provide for7} one more component, such as an Atari modem, or disk drive you may add in the future. Higher priced options include the 8}Atari 850 interface for $109, and the MIO from ICD for $170. Both have multiple parallel and serial connectors, but the MI9}O also includes 256K of useable RAM (really!) as well as a built-in port for a controller for a future hard disk, and abilit:}y to configure onboard RAM as multiple ramdisks, etc. For $300 you can buy an MIO with 1 meg of RAM onboard. ICD's product;}s which include SpartaDOS, are outstanding. As a company they are helping to insure the future of 8 bit Atari computing by <}their support and introduction of new products.-------------XM-301 Modem:------------- Well, it didn't take long to re=}alize that a modem was what I was really missing. Oh boy, all those FREE programs just hanging around out there on those lo>}cal bulletin boards, waiting for my call. Besides, the Atari XM 301 300 baud direct connect modem doesn't even need an inter?}face. A quick $50 bucks plus postage, and I was ready to roll again. Now I could use terms like baud, upload, download, and@} spend hours and hours looking for the perfect terminal program to replace XE-Term that came with the modem. Heck 300 baud A}is pretty fast. Well, kinda fast anyway. Now I entered a period of tremendous communication with other Atari users. That B}was one of my primary aims when I began; communicating with a large number of users for a small amount of money; and here I C}was. Modems represent an incredible return for spending $50-100. Here in Champaign-Urbana, Illinois, there are about 30 D}local free bulletin boards. Four of them have 8 bit Atari programs available for download. Then there's CompuServe, Genie,E} The Source, Delphi etc, featuring hundreds and hundreds of terrific up-to-date programs, available cheap if you don't "dawdF}le" on-line. I can download several programs for a dollars worth of connect charges. EXPRESS Ver. 3.0, Shareware by KeithG} Ledbetter in it's multiple versions for different machines and modems, turned out to be the terminal program I had beenH} seeking. Find it on a BBS. It features built-in user defined macros (you press one key and send your name or password !), I}phone number storage, with logons, X-modem and CRC uploading/downloading protocol, and many custom goodies. Written in ACTJ}ION, this is the finest software that exists for Atari 8 bit communication, and it's Shareware too.----------------MemoryK} Upgrades:---------------- Now what more could I want? Well, I really wanted a second disk drive, and had been reading L}articles about the new memory upgrades. Hmmmm, I'll bet I'd be a POWER USER if I soldered a few new boards in my computer, aM}nd plugged in a bunch of RAM chips! Additionally, I would be able to use 128K programs written for the 130XE's extra memoryN}, like Atariwriter Plus. There are four or five companies offering upgrades at present. Check ANTIC and ANALOG magazinesO}. When I bought mine, the two primary choices were the Newell 256KXL, and ICD's RAMBO kits. Both are available with or witP}hout RAM chips, and require fine soldering ability and some experience to install. The important difference is that the ICDQ} RAMBO kit will support ICD SpartaDOS when installed. The Newell kit will not, as installed, but can easily be made to do sR}o by sending it's output through a spare gate on the U19 chip, inverting it to resemble a RAMBO. See the text article on StoS}rmbringer BBS (206)-679-3496, or contact me. I purchased the Newell kit, because it came with a free double density up-tT}o-date version of MYDOS, a menu driven double density DOS. One advantage of this DOS, is it's ability to load into page 0, 1U}, or 2 of memory. Loading it in page 2, allows you to use it with a RAMBO upgrade, and also to use it with Turbo BASIC, theV} German Public Domain BASIC with so many features, and a compiler. Turbo BASIC conflicts in page one with SpartaDOS. More onW} Turbo BASIC in future lessons. One of my favorite experiences, was seeing the look on my wife's face when my upgrade kiX}t arrived, and I opened my 800XL up, and spread it around on the desk! The kit went in just as advertised. It required a tinY}y soldering iron, and took a couple hours. When I buttoned it back up, and tried the built-in ram check program, it had a Z}glitch. A quick call to Wes Newell diagnosed my problem as a tiny solder whisker between two connector pins. I installed a [}SPDT slide switch, that allows me to switch my upgrade to emulate a Newell or RAMBO, but actually I've never moved it from i\}t's RAMBO position since installation. If you are not handy, several members of local user groups may install these kits, ]}for little or no labor costs. I would recommend one of these kits immediately for an 800XL. Purchasers of a 130XE may just ^}think about buying a 256K MIO. My total cost was about $70 plus postage for the kit, RAM chips and MYDOS. I was a happy _}man again! Now I had that second disk drive. I used 192K of RAM as drive #8 (or any other number.) I finally could load my `}C compiler, linker, and text editor up into my ramdisk, and work extremely fast. Before upgrading, a save, compile, link ana}d run on a C program took about 5 minutes. With everything in ramdisk, the time dropped to under one minute. This saved houb}rs in a day. It also enlarged my Atariwriter Plus text capacity from about 12K to 45K. This is of practical everyday use to c}me. I can also load an entire disk side into ram for copying in one pass. Very handy. When I took my first FORTRAN coursed} in 1970, our university IBM mainframe had 812K of ram. I now have 256K of ram in my Atari 800XL, right on my desk. What me}ore could a man need?---------------------------Replacement Power Supplies:--------------------------- After several yf}ears of use, I started to notice occasional audio and video interference on my monitor. I correctly suspected a power supplyg} problem, and should have quit right then and looked into it. I didn't, but put off doing anything about it. Unfortunately,h} it WAS bad, and it's "spiking", wiped out my MPP 1150 interface. That was a quick $20 plus postage to get repaired. Be wari}ned. When they fail, the computer usually doesn't work at all or has a green screen and doesn't do much else, etc. Buyingj} my 800XL in 1984, I got the old "lump" style power supply. A sealed epoxy box that puts out 5 volts DC. These early suppliek}s had no cooling slots, and may conk out after several years use. These sell for $15-25 plus postage. Check the Yellow Pagl}es for Atari repair. I found a new supply (with cooling slots) in a Radio-TV repair store, off the shelf. I paid $25 (no pom}stage!) to avoid any down time.------DOS's:------ Once I had a modem, I noticed bulletin boards were filled with messan}ges like, "I'm not sure this runs under SpartaDOS, but I did try it with MYDOS." Oh my, what was all this? Why would anyono}e need more than one DOS? As mentioned in earlier lessons, the Disk Operating System or DOS, pronounced dahs, is the intp}erface between the user and the Central Processing Unit - CPU. DOS is supplied free when you purchase a DISK DRIVE. It doesnq}'t come with the computer, as it is the Disk Operating System. Most of us Atarians began with DOS 2.0s, Atari DOS version 2r}.0 single density DOS. DOS 2.0s is a plain vanilla, starter level DOS that does everything it is supposed to do. DOS 2.0s ss}tores data in 128K byte sectors on the disk. Atari's next released DOS was 3.0, a very non-standard DOS that stores data t}in 1000 byte sectors. As far as I know, no one uses this DOS. To do so means users of other commonly used DOSes like Spartau}DOS, TOPDOS, SMARTDOS, MYDOS etc, cannot read your disks. It also doesn't support ramdisks. If you have an original DOS 3v} disk, Atari will replace it free with Atari DOS 2.5, the most recent Atari DOS. There is a DOS 4 available cheap, but...itw} doesn't support ramdisks either, and better choices exist. DOS 2.5 is an intermediate kind of DOS. It will give you 1010x} sectors, still at 128 bytes per sector. It includes a few utilities, like "undelete" files and "fix" disks. It is menu driy}ven. It DOES support a 64K ramdisk. That's the good news. The bad news dawns on you when you install enough RAM for a 192K z}ramdisk, and try and use it! Hmmm, time for a new DOS. When your DOS does everything you need, and does it well, then you {}have it made. When you start acquiring new hardware, and needing new features, then you start shopping for a DOS. In my ca|}se, I upgraded my 800XL's memory and needed a double density DOS with ramdisk support. I now use SpartaDOS 3.2d. It stores }}data in 256 byte sectors. SpartaDOS is a command driven DOS as opposed to the familiar menu driven DOS. This means it gives ~}a prompt in DOS like: "D1:", and the cursor sits next to the colon and waits. If you wish, it has a menu option, and displa}ys every option you need, plus an extra bag full. It unerases files, supports subdirectories, (as does MYDOS), runs binary }files ending in .COM by typing their name, and best of all, operates like MS-DOS or PC-DOS on the PC machines. It uses many }of the same commands and structure of MS-DOS as DIR, CHKDSK etc. As many of us use those machines along with our Ataris, or} plan to use one of those in the future, this is a definite plus. A month or less spent with a command driven DOS, and you'l}l never use menus again. Somehow it alters your entire perception of the computer, allowing you to deal with it in a much m}ore flexible way. It's like upgrading your computer. Many utility files are available from ICD and written by users, distri}buted on BBS's. I recommend you buy this DOS with your US Doubler chips, when you upgrade. The DOS and chips are only $50 pl}us postage. A Best Buy. I believe users should not copy and distribute any DOS, other than the Atari DOS's 2.0s, 2.5, an}d 3. These three Atari DOS's, seem to be in a near Public Domain category, even though copyrighted. DOS 2.0s is the DOS to p}ut on a disk to send to someone else. The writing, debugging and maintaining of a DOS, is a sizeable piece of work. I b}elieve the best way for users to express support for the authors that provide these DOSes, is to purchase these products, an}d not pirate them. If you are a programmer, or certainly if you are a POWER USER, it is obvious that you should purchase }DOSes, and keep up with revisions of your personal favorite. I mean, what's another $50 mail order, plus postage?-------}---------2400 Baud Modem:---------------- A year's use of a 300 baud modem, exposed me to many users on BBS, discussing} their 1200 and 2400 baud modems. Obviously POWER USERS. After borrowing a Hayes 2400 from a friend for a month, I decided t}hat was what I needed. Well at least I needed 2400! After studying a PC Magazine review of more than 80 modems, I bought }a SmarTeam 2400 for about $245 plus postage. This is an excellent modem. Judged quieter at 1200 baud, where I use it most, }than many 1200 baud modems. Unfortunately it needed an interface to connect to my 800XL. Interested in spending minimal d}ollars, I bought an Atari 850. It functions perfectly, but I wish now I'd bought an MIO, as I'd add a hard disk next. That w}as $109 plus postage, plus about $30 for cables (ICD.) This modem is appreciated when downloading programs from CompuServ}e, both at 1200 and at 2400. The Avatex 1200's are reported to be good modems and are about $90 plus postage.-----------}Hard Disks:----------- Am I a POWER USER yet? Well I'm not certain, but I suspect that if I added a hard drive, I might }be. These are available from several manufacturers, and are as little as $185 for a 5 meg, but average about $500-600 for a} 20 meg. Again, you need a DOS that can support a hard disk, subdirectories, etc. A hard disk is a definite plus for any }system. It allows you to forget about floppys, except for backup, and just use the computer. New skills need to be learned }(keep those backups current.) Hopefully prices will fall even lower in the future, and many 8 bit systems may get a new leas}e on life with a hard drive added.----------What Next:---------- So have we exhausted all the possible needs a man co}uld have? Is there anything else a POWER USER would need? Well, actually there's the R-Time 8 cartridge that keeps time and} date with the power off, and there's the new 80 column card, and the new versions of software that will support it, but th}ere will hopefully always be more for the 8 bit user to yearn for. Support is at an all time high, while prices are at an a}ll time low. Let's enjoy it while we can. POWER TO THE PEOPLE. One thing in closing. Don't leave this article lying arou}nd where parents or wives might see it, as you approach them with "I've been thinking of buying an Atari computer. They're} only $130."------------------------------------This concludes Lesson 7 of Learning To Program In Atari BASIC. Be sure to} catch Lesson 8 which includes: Substrings Concatenation Numerical Arrays DIM Statements CLR statement}------------------------------------Contact me at: Jackson Beebe Prairie Data Fields 807 West Hill Street } Urbana, IL 61801or 72550,317 on CompuServe byeData Fields 807 West Hill Street U