@L}5 _$% l0$)$$Hȱ$ UhL" `e$$%`$%`  R@W!( 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 ALLOWED697 FREE SECTORS COPYING---D8:COPY32.COMl# 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- 144ɛ+,' 20*.. өr2 1``2TOO MANY DIGITSINVALID HEXAQ}DECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uR} ECIMAL PARAMETER800 0 8 00`,0'D800 H,ɛh`2L1NEED D1 THRU D8uEiͩkΩ͙kCop j`j {j`Hi͝Νh`T}L"UNEM:D"NURͩkΩ͙kCop j`j {j`Hi͝Νh`)5DDFLASDISKBh@ @:PdQ;@,Q6.: DISK #69 堠V}fS +@1AR@S6-F:A`,%AV$F:Aa,i{AYW}'A@9A @KA@&]AA$oA@h{6-n;%@@pX}+-@@&/"7%; s116,6,6,7,6,6,6,6,6,6,6,2,2,2,2,2,2,2,2,112,2xE%@'@e.%@(FY}:A`,E%@)F:Aa,((( (( THE PAGE 6 LIBRARY(***************Z}*****((********************A-@A('The PAGE 6 Library consists of programs..(& collected[} from Users and User Groups//(' in the U.S.A, Australia and Gt.Britain//(& and to the best of our knowledge all/\}/(' programs are in the public domain.-@ @.(ӠԠҠAY@45B2y]}!AU5-@@P#F:B2y,"@#%D:MENU 6-@& AD:TITLE ^} DISK #69 堠" ## mixe@P@"@""I 1 h_}0ߢ 0.  0?詛 1 y0YЛ 1 ;#L" ;#L! 1 hp% 3 NAKEBQXYNPTTM@@AU a}  @dQ(>:A%,"-@@E(WHAT SCREEN COLOR DO YOU WANT?b}Q6-n#-@@#( 1: NORMALx"-@@"(2: AMBER*-@@*(3: REVERSE AMBERc}"-@@"(4: GREEN!-@@!(5: GREYB A`-@@4(SELECT A NUMBER8B Bd}Q  @)!@)P:,G("ERROR: SELECT A NUMBER FORM 1 TO 5Q A`//AAAA e}A01AAH'A @1 A@1A@T'A @1 A@1A@Vf}'A 1 A@1AA''A @1 A@1A@'A @1 A@g}}<;@0,;A0,;@,;@,;@,I(>:A%,[-@@ }(Documentation for TUh}RBO BASIC1-@@1(PRESS ٠ TO SCROLL6-@@,(CREEN OR RINTER03(6(;;7@i}<@,4S)7@<@,4sA";;7@<@,4P)7@<@,4pA,MAR@j} @M@@D1:TURBODOC.NEW6( AP@(6-%@@(J"@  Ak}pT A^5F:A,"A6#@5ARh,,($------------------------------------r( l} ** END **w-@A | +;@;@@D1:TURBODOC.NEW\m}(>:A%,"-@@X(0DID YOU SET PAPER TO THE TOP OF ITS FORM (Y/N)\$$7@<@,0YAn}3 3 330(>:A%,"-@@0( PRINTING!( A@(6-%@.@.@o}@P:&&(@ "@W A  A@@F:A,"A6#p}@.@@AR<6-6-@W&5-@+%@,83< ,,($--------------------q}----------------::3$ -%@-( ** END ** +&??r}PROGRAM BY RON. FETZER, 22 MONACO AVE, ELMONT, N.Y. 110030:SCROLLING ROUTINED##@@K:Ns})@X"@: ,Ab6-@$lPAGE ROUTINEv6-6-%@Q(@t}(@Q(@$ --&-@@"(@& $D:MENU} EXPANDED TURBO BASIC DOCUMENTATION ================================== by Ron. Fetzer This expanded docum v}entation isbased on the pioneering work of Daveand Laura Yearke of the Western NewYork Atari Users Group. The superb w}Turbo Basic by FrankOstrowski from Holland works only onthe Atari XL and Atari XE computers.It is completely compatible wi x}thATARI BASIC. In addition to theregular Atari Basic commands you get42 more commands and 22 morefunctions. You have a us y}eable RAM of34,021 bytes. This is 1,747 morebytes than Atari Basic. It runs 3times faster than Atari Basic and youhave a z}BASIC COMPILER that increasesthe speed 10 to 15 times more. The DOS commands are accessed inthe direct mode or the pro {}grammedmode. There is no Turbo Basic DOS.You have new graphics commands notavailable before. Turbo Basic isinsensitive to |} upper or lower orinverse characters for most of itscommands. You can have 256 variablenames. This documentation trie }}s toprovide programming examples for thenew commands. There is an index atthe end of this documentation foreasy finding o ~}f commands ** LOADING TURBO BASIC ** -------------------------- Turbo Basic gets loaded withouta cartrid }ge. 1. Turn on your diskdrive. 2. Insert the Turbo Basicdisk. 3. On the XE hold down theOPTION key and turn on the compute }r. ** DISK COMMANDS ** ------------------- The DOS functions are accessedin the direct or the progr }ammed mode.There is no Turbo-DOS. If you typeDOS you are directed to DOS 2.5. Youare now out of Turbo Basic. It issuggest }ed that you save your programfirst otherwise it is lost. You canget back into Turbo Basic by usingOPTION L on the DOS and }typingAUTORUN.SYS for the file name. FORMAT: BLOAD "D:name" EXAMPLE: BLOAD "D:TEST.BIN" This command is u }sed to loadbinary files. The file willautomatically load without having togive a memory address. It is justlike Option L }with /N on DOS 2.0 FORMAT: BRUN "D:name" EXAMPLE: BRUN "D:COMPILER.COM" This is used to load and RUN amac }hine language(Binary) file. Thefile will run automatically withouthaving to give a memory address. Itis the same as Option } L and Option Mon DOS 2.0 FORMAT: DELETE "D:name" (Wild cards are O.K.) EXAMPLE: DELETE "D:TEST.B }AS" DELETE "D8:test.bas" delete "D2:*.*" Delete "D2:TEST.???" 90 DELE }TE "D:*.*" This command erases from thedisk a file specified. The wild cardsymbols (*.* and ???) are permitted.The d }evice name (D:) has to be incapital letters. Inverse file namesare not permitted. In the programmedmode it has to be the l }ast item onthe line. This is the same as OptionD on DOS 2.0 FORMAT: DIR (Wild cards O.K.) EXAMPLE: DIR } DIR "D:*.*" DIR "D2:*.BAS" DIR "D:???.*" DIR "D8:*.*" 90 DIR " }D8:*.*" This command gives you the diskdirectory. Wild cards are permitted.In the programmed mode it has to bethe la }st item on the line. This isthe same as Option A on DOS 2.0 FORMAT: RENAME "D:old name,new name" }EXAMPLE: RENAME "D:FILE.OLD, FILE.NEW" RENAME "D8:*.TXT, *.BAS" This command }renames a file. Thefirst name is the OLD name, thesecond name is the NEW name. Thecomma between them is important. Wildca }rds are permitted. This is the sameas Option E on DOS 2.0 FORMAT: LOCK "D:name" EXAMPLE: LOCK "D:TEST.BAS" } LOCK "D2:SCREEN.???" LOCK "D8:*.*" 90 LOCK "D:*.*" This command locks a file so y }oucannot change it or erase it untilyou unlock it. Wild cards arepermitted. In the programmed mode ithas to be the last i }tem on the line.This is the same as Option F on DOS2.0 FORMAT: UNLOCK "D:name" EXAMPLE: UNLOCK "D:TEST.BAS" } UNLOCK "D2:SCREEN.???" UNLOCK "D8:*.*" 10 UNLOCK "D:*.*" This command is the op }posite of LOCK. It opens a file so it can bechanged. Wild cards are permitted. Inthe programmed mode it has to be thelast } item on the line. This is thesame as Option G on DOS 2.0 ** MEMORY ** ------------ FORMAT: } DPOKE m,v EXAMPLE: DPOKE 88,32750 90 DPOKE 88,32750 This command puts 2 bytes ofdata into 2 conse }cutive memorylocations. In the example above atPOKE 88 and POKE 89 integer 32750 isstored. FORMAT: DPEEK(m) E }XAMPLE: ? DPEEK(88) 90 ? DPEEK(88) This is the opposite of DPOKE.It retrieves a 2 byte integer from 2co }nsecutive locations. In the exampleabove at PEEK(88) and PEEK(89) FORMAT: MOVE m,m1,m2 EXAMPLE: MOVE 53248,3276 }8,1024 MOVE $D000,$8000,$400 This moves a whole block ofdata. The 'm' is the old address, the'm1' is th }e new address and the 'm2'is the lenght of the data in bytes FORMAT: -MOVE m,m1,m2 EXAMPLE: -MOVE 53248,32768,1 }024 -MOVE $D000,$8000,$400 This is the same as above exceptit copies with the last byte of theblock } FORMAT: BPUT #n,adr,len EXAMPLE: BPUT #3,ADR(B$), LEN(B$) EXAMPLE #2 100 CLS } 110 GRAPHICS 5:ADDR=DPEEK(88) 120 PRINT " FILL THE SCREEN" 130 FOR X = 1 TO (20*40) 140 POKE ADDR+X,RAND( }125) 150 NEXT X 160 ? "Now BPUT data onto RAMDISK D8:SCREEN" 170 CLOSE:OPEN #1,8,0,"D8: SCRE }EN" 180 BPUT #1,ADDR,20*40 190 CLOSE 200 ? "IT IS DONE!" 210 FOR Y= 1 TO 6000:NEXT Y 220 GRAPHICS 0 } This outputs a block of data toa device specified by the channelnumber(1-7). The block starts at'adr' and ends at ' }len'. In theexample above we wrote to the RAMDISK the screen data under the filename "SCREEN". It can be recoveredwith BG }ET. See the next command. FORMAT: BGET #n,adr,len EXAMPLE: BGET #3,ADR(B$), LEN(B$) } EXAMPLE #2 100 CLS 110 GRAPHICS 5:ADDR=DPEEK(88) 120 CLOSE:OPEN #1,4,0, "D8:SCREEN" 130 ? "BGE }T data from RAM DISK D8:'SCREEN'" 140 BGET #1,ADDR,20*40 150 CLOSE 160 FOR Y=1 TO 6000:NEXT Y 17 }0 GRAPHICS 0 BGET recovers a block of datasaved with BPUT. The '#n' is thechannel number(1-7), 'adr' is thememory ad }dress and 'len' is thelength of the data. FORMAT: %PUT #n,a EXAMPLE: %PUT #1,A EXAMPLE #2 1 }0 CLS 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 FOR X = 1 TO 5 40 INPUT "GIVE ME A NUMBER>",A 50 %PUT #1;A 6 }0 NEXT X:CLOSE 70 ?:? "I have saved the the numbers with %PUT to the RAM DISK under 'TEST'" 80 ?:?: }DIR "D8:*.*" This is the same as 'PRINT #1;A'except it is much faster and usesless memory. You must open a channelfo }r %PUT. See the demonstartionprogram on the front of this disk.Use RUN "D:PUTGET.TUR". If you have aXL computer list the p }rogram andchange all referrences from D8: toD1: and then run it. You can retrievethe numbers in EXAMPLE #2 by usingthe %G }ET program that follows. It isused with NUMBERS only. FORMAT: %GET #n,a EXAMPLE: %GET #1,A EXAMP }LE #2 10 CLS 20 CLOSE:OPEN #1,4,0,"D8:TEST" 30 FOR Y = 1 TO 5 40 %GET #1;A 50 ? A 60 NEXT Y:CL }OSE 70 ?:? "I have retrieved the numbers saved with %PUT by using %GET" 80 LIST It retrieves }the numbers savedwith %PUT. You must have a channelopen. It is the same as 'INPUT #1;A'except it is much faster. ** } GENERAL PROGRAMMING ** --------------------------- FORMAT: CLS EXAMPLE: CLS 10 CLS } EXAMPLE #2 10 CLS 20 FOR X=1 TO 50 30 ? " CLEAR SCREEN "; 40 NEXT X 50 GOTO 10 This c }ommand clears the screen.It is the same as pressingCNTRL+CLEAR or ? CHR$(125) FORMAT: CLS #n(channels 1-7) EX }AMPLE: CLS #3 90 CLS #3 EXAMPLE #2 10 CLS 20 ?:?:?:?:?:?:? "THIS WILL NOT BE }ERASED - IT IS BEFORE LINE 30(OPEN). TO STOP -->'BREAK'" 30 CLOSE:OPEN #3,4,0,"K:" 40 CLS #3 5 }0 ? "PRESS ANY KEY"; 60 GET #3,L 70 ?:? "YOU PRESSED THE "; CHR$(L);" KEY":? 80 CLS #3 90 GOTO 40 } This command clears the screenof any information that was therebecause of the opened channel. Thisis different from } CLS which clearsthe whole screen. FORMAT: PAUSE n EXAMPLE: PAUSE 50 90 PAUSE 100 }EXAMPLE #2 10 CLS 20 REPEAT:A=A+1 30 ? A;", "; 40 PAUSE 100 50 UNTIL A=20 EXAMPLE #3 } 10 CLS 20 X=10 30 REPEAT:A=A+1 40 ? A;", "; 50 PAUSE 10*X 60 UNTIL A=20 This command pu }ts a time delayof about 1/60 of a second into yourprogram for each number. PAUSE 60 =about 60/60 or 1 second delay. It is }the similar to 'FOR X = 1 TO 60:NEXTX'. Computed values are allowed.Negative values are not allowed. FORMAT: RENUM n },i,j EXAMPLE: RENUM 10,100,10 90 RENUM 100,10,10 EXAMPLE #2 10 CLS 20 ? "RENUMBE }R PLEASE!" 30 PAUSE 100 40 LIST 50 RENUM 10,100,20 60 LIST EXAMPLE #3 10 CLS 20 } X=3 30 ? " HELLO "; 40 GOTO X*10 50 REM X*10 WILL NOT BE RENUMBERED 60 RENUM 10,100,20 70 L }IST This command renumbers yourprogram. The 'n' is the program linenumber that you want to startrenumbering with. Th }e 'i' is thefirst NEW number. The 'j' is theincrement. It will not renumber linereferences which involve variables orcomp }uted values. See example #3. FORMAT: DEL n,i EXAMPLE: DEL 60,100 90 DEL 50,80 EXAMP }LE #2 10 CLS 20 ? "THIS LINE STAYS" 30 ? "30 GOES" 40 ? "40 GOES" 50 ? "50 GOES" 60 DEL 30,50 } 70 LIST This command deletes lines outof your program. 'n' = the startingnumber and 'i'= the ending number. Itc }an be used in the direct orprogrammed mode. FORMAT: DUMP EXAMPLE: DUMP 90 DUMP EXA }MPLE #2 10 CLS 20 DIM A$(35),B(5) 30 A$="DUMP - VARIABLES AND THEIR VALUES" 40 REPEAT:X=X+1 } 50 INPUT "GIVE ME A NUMBER>",C 60 B(X)=C:REM NUMBER ARRAY 70 UNTIL X=5 80 ? " NUMBERS" 90 FOR T = 1 TO } 5 100 ? B(T) 110 NEXT T 120 ?:? A$ 130 DUMP This command dumps the variablesused and their values }. For numericarrays the DUMed value will be shownas: (B,6. The DUMPed value is theDIMed value +1. String values areshown }with their length first andthen their DIMed value. PROCEDUREnames and labels and their linevalues are also listed. The NEW }command clears the DUMPed values.This command can be used in thedirect or the programmed mode. FORMAT: DUMP name } EXAMPLE: DUMP "P:" DUMP "D8:VARIB" 90 DUMP "P:" EXAMPLE #2 10 CLS 2 }0 DIM A$(40),B(5) 30 A$="DUMPed - VARIABLES" 40 FOR X = 1 TO 5 50 INPUT "GIVE ME A NUMBER>",C 60 B(X)=C:R }EM NUMBER ARRAY 70 NEXT X 80 FOR Y = 1 TO 5 90 ? B(Y):LPRINT B(Y) 100 NEXT Y 110 LPRINT:LPRINT A$ } 120 DUMP "P:" This command is the same asabove except we DUMP to a devicespecified. "P:" = printer or"D8:VARIB" = } Ram Disk. For example #2turn on your printer. This commandcan be used in the direct or theprogrammed mode. FORMAT: } TRACE TRACE - EXAMPLE: 10 TRACE 90 TRACE - EXAMPLE #2 10 TRACE 2 }0 CLS 30 ?:? " TRACING" 40 REPEAT:A=A+1 50 ? A;", "; 60 UNTIL A=10 70 TRACE - 80 ?:? 90 }? " NO TRACING" 100 REPEAT:B=B+1 110 ? B;", "; 120 UNTIL B=10 This command tells you what lineis abou }t to be executed. It is shownin [ ] on the screen. The TRACE isthe way you turn it ON. The TRACE - is the way you turn it }OFF. This isa great aid in de-bugging a program. FORMAT: INPUT "text";a,b... INPUT "text >",a,b... } EXAMPLE: 20 INPUT "Numbers";A 50 INPUT "Names";B$ 70 INPUT "Names &" Ages >>", }A$,B 90 INPUT "ADDRESS >" ,ADR$ EXAMPLE #2: 10 CLS 20 DIM A$(10) } 30 ? "THIS WILL PRINT ?":? 40 FOR X = 1 TO 3 50 INPUT "Names";A$ 60 NEXT X 70 ?:? 80 ? "No Symbol }- Use your own" :? 90 FOR Y = 1 TO 3 100 INPUT "Numbers >>",B 110 NEXT Y This command lets you u }se aprompt with the INPUT for easierprogramming. If you use a semicolonafter the prompt the usual '?' willbe printed. If }you use a comma afterthe prompt nothing will be printedand you have to include your ownsymbol with the prompt. See example }#2. FORMAT: GO TO EXAMPLE: 50 GO TO 20 GO TO 100 EXAMPLE #2 10 CLS 20 ? } " HELLO "; 30 GO TO 20 This command is the same as theusual GOTO FORMAT: *L (DEFAULT) *L - } EXAMPLE: 30 *L 90 *L - EXAMPLE #2 10 CLS:? 20 *L 30 ? "LINE # 50-70 INDENT }ON" 40 FOR X = 1 TO 5 50 ? " "; 60 ? " "; 70 ? " "; 80 NEXT X 90 LIST 100 PAUSE 300 1 }10 CLS:? 120 *L - 130 ? "LINE # 50-70 INDENT OFF" 140 LIST When listing a program withloops this comman }d either turns onthe indent on the loops or turns themoff. The *L turns it ON. This is thenormal default condition. The *L } - turns the indent OFF. This works notonly on the screen but also on theprinter. FORMAT: *F (or *F+) } *F - EXAMPLE: 70 *F 90 *F - EXAMPLE #2 10 CLS 20 ? "ILLEGAL REVERSE LOOP":? } 30 FOR X = 2 TO 1 40 ? X 50 NEXT X 60 PAUSE 200 70 *F 80 ?:? "ILLEGAL LOOP - NO EXECUTION } - '*F'" 90 FOR X = 2 TO 1 100 ? X 110 NEXT X 120 PAUSE 200 130 LIST Atari Basic has a bug. I }t allowsexecution of an illegal reverse loop.(FOR X=2 TO 1:? X:NEXT X). Thiscommand allows you to turn thisfeature off or } on. *F or *F + turnsit OFF. *F - turns the bug ON if youwant it. FORMAT: *B (or B+) *B - EXAMPL }E: 90 *B 200 *B - EXAMPLE #2 10 CLS:? 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 FOR X=1 }TO 3 40 INPUT "GIVE ME A NUMBER";A 50 %PUT #1;A 60 NEXT X:CLOSE 70 PAUSE 100:?:? 80 ? " I AM TRAPPIN }G 'BREAK' KEY" 90 *B 100 CLOSE:TRAP 180: OPEN #1,4,0,"D8:TEST" 110 ?:? 120 FOR Y = 1 TO }3 130 PAUSE 100 140 %GET #1;A 150 ? A;" TRY BREAK KEY" 160 NEXT Y:CLOSE 170 END 180 REM TRAP } 190 ?:? "BREAK KEY TRAPPED!" 200 GOTO 90 This command lets you trap thebreak key so your program cannotaccide }ntally be stopped by hittingthe BREAK key. This command workswith the TRAP command. The *B turnsit ON. The *B - truns it O }FF. FORMAT: -- EXAMPLE: 10 -- 90 -- EXAMPLE #2 10 -- 20 CLS 30 ? " }30 DASHES " 40 ? " HELLO " 50 -- 60 LIST This command prints 30 dashesacross the screen or the page whe }nyou LIST your program. It can be usedto make your program listingclearer. FORMAT: DSOUND n,f,d,v DSO }UND EXAMPLE: 10 DSOUND 1,72,12,8 90 DSOUND EXAMPLE #2 10 CLS 20 ?:? "PRESS 'RES }ET' TO STOP" 30 X = RAND(255) 40 ? X;", "; 50 DSOUND 1,X,12,8 60 PAUSE 25 70 DSOUND 80 DSOUND 0 },X,12,8 90 GOTO 30 This command pairs channels forincreased frequency range.n=channels(0-3). f=frequency range(0 }-255). d=distortion(0-15) 10 and 14produce pure tones. v=volume(0-15). 0is silent 15 is the laudest. DSOUNDturns all soun }d OFF. ** LINE LABELS ** ------------------- FORMAT: # name EXAMPLE: 120 # END } 120 # END_OF_FILE EXAMPLE #2 10 CLS 20 CLOSE:OPEN #1,8,0,"D8:TEST" 30 REPEAT:X=X+%1 4 }0 INPUT "GIVE ME A NUMBER";A 50 %PUT #1,A 60 UNTIL X=%3 70 CLOSE 80 CLOSE:OPEN #1,4,0,"D8:TEST" 90 T }RAP # END:%GET #1,A 100 ? A 110 GOTO 90 120 # END:IF ERR=136 THEN CLOSE This command gives the linenumb }er that has the '#' the VARIABLELABEL that follows the '#'. Forexample: '120 # END' will now becomea VARIABLE LABEL and it } will be inthe variable name table listed assuch (Use DUMP to see it). In example#2 see line #90 '90 TRAP # END...".It wi }ll go to line 120. This is thesame as if we wrote '90 TRAP 120...'except it is clearer the first way.When there is an EOL }error(136)channel #1 will be closed so no erroris printed. A better way would have been'120 # END_OF_FILE...' Theu }nderscore (_) is allowed invariables and labels and makes forclearer listings. We would have abetter discription of WHERE !}and WHATthe program does if we had used it.If you use line labels they can berenumbered. %1 and %3 in line 30 and60 are u!}sed because they save us 6bytes each and stand for the number 1and 3. See dicussion on constants. FORMAT: GO# name!} EXAMPLE: 60 GO# GET_KEY 100 GO# ERROR EXAMPLE #2 10 CLS 20 ?:? "PRESS ANY KEY" !} 30 CLOSE:OPEN #1,4,0,"K:" 40 # GET_KEY:GET #1,A 50 ? CHR$(A);", "; 60 GO# GET_KEY This is the same as!} GOTO exceptthe GO# looks for a label. You cannothave a space between the GO and #.For the (_) in line 40 see '# name'abo!}ve. Line 40 has the variable labelof '# GET_KEY'. Line 60 looks forthis label and it works just like aGOTO except the list!}ing is clearer. * MODIFICATION OF ATARI COMMANDS * ---------------------------------- FROMAT: CLOSE EXAMPLE: !}90 CLOSE 120 CLOSE: OPEN #1,4,0,"D8:TEST" This command closes ALL openedchannels. It is a !}good practice toclose a channel first before openingit. This command is the same as 'FORX=1 TO 7:CLOSE X:NEXT X' FOR! }MAT: DIM a(n) EXAMPLE: 10 DIM A(6) 30 DIM B$(20) This command automaticallyassigns a value of 0 t! }o all elementsin a numeric array and nullcharacters to all elements of astring. The LEN function is stillvariable and ini! }tially 0 FORMAT: GET name EXAMPLE: 20 GET A 90 GET K EXAMPLE #2 10 CLS:?:? ! } 20 GET A 30 ? "The key is ";CHR$(A); 40 ? " the ATASCII = ";A 50 GOTO 20 This command returns the ATA! }SCIIvalue of the key pressed. It is thesame as 'OPEN #1,4,0,"K:":GET#1;A:CLOSE #1'. The command waits fora key press and !}assigns the ATASCIIvalue to the variable. FORMAT: LIST n, EXAMPLE: LIST 90, This command list the program!}from the line specified to its endprovided the comma is used. FORMAT: ON a EXEC n1,n2,... EXAMPLE: 30 ON X EXEC!} START, MAIN_PROG,ENDING This command is the same as'ON...GOSUB' except it is used withPROCEDURE. The c!}ommand executes thePROCEDURES named. Instead of 'ON XGOSUB 200,300,400' we use variablelabel names of the PROCEDURES. See!}PROCEDURE FORMAT: ON a GO# n1,n2,... EXAMPLE: 70 ON X GO# NORMAL, UPSIDE_DOWN EXAMP!}LE #2 10 CLS:DIM A$(1) 20 ?:? 30 INPUT "Normal or Upside down";A$ 40 IF A$(1,1)="N" THEN X=1 !} 50 IF A$(1,1)<>"N" THEN X=2 60 ?:? 70 ON X GO# NORMAL,UPSIDE_DOWN 80 # NORMAL 90 POKE 755,2 100 ? !}"THIS IS PRINTED NORMALLY" 110 GOTO 20 120 # UPSIDE_DOWN:CLS 130 POKE 755,7:?:? 140 ? "THIS IS P!}RINTED UPSIDE DOWN" 150 PAUSE 200:POKE 755,2 160 GOTO 20 This command is the same asON...GOTO excep!}t we use variablelabel names instead of line numbers.In example #2 see line 70. FORMAT: POP EXAMPLE: 100 POP!} EXAMPLE #2 10 CLS:?:? 20 GOSUB 50 30 ? "I am the next line" 40 END 50 REM SUBROUTINE!} 60 POP 70 GOTO 90 80 RETURN 90 ? "I POPPED the RETURN line 30" 100 LIST The POP command!} will work withall 4 loops, the DO-LOOP, WHILE-WEND,FOR-NEXT and GOSUB. When TURBO BASICsees a DO, WHILE, FOR or GOSUB it!}saves its RETURN address on theruntime stack so it knows to whatline to return to. If you want BASICto 'FORGET' this retur!}n line use POP.Too many POPs can lead to errors andmake for poor programming. FORMAT: PUT n EXAMPLE: 60 PUT 90!} 20 PUT 89,69,83 EXAMPLE #2 10 REM SIMPLE WORDPROCESSOR 20 CLS:? 30 OPEN #1,4,0,"!}K:" 40 GET #1;A:R=R+1 50 IF R=37 THEN ? CHR$(155):R=0 60 PUT A 70 GOTO 40 This command is the same !}as'PRINT CHR$(A)';. It takes theATASCII number and converts it into acharacter. FORMAT: RESTORE #name EXAMPLE! }: 120 RESTORE #AGAIN 160 RESTORE #NUM_AGAIN EXAMPLE #2 10 CLS:? 20 DATA 1,2,3,4,5 !!} 30 # AGAIN 40 DATA 6,7,8,9,0 50 READ A 60 IF A=0 THEN 100 70 ? A;", "; 80 PAUSE 10 90 GOTO 50!"} 100 ?:? "NOW DOING LN 40 DATA AGAIN" 110 PAUSE 120 RESTORE #AGAIN 130 READ A 140 IF A=0 THE!#}N 170 150 ? A;", "; 160 GOTO 130 170 ?:LIST This command moves the datapointer back to the variable lab!$}el inthe DATA chain. In example #2 theRESTORE printed only the numbers inDATA ln. 40 because it came after '30#AGAIN'. It!%} did not start with ln.#20. It is the same as RESTORE 40except we use a variable label forclearer programming. The 0 was t!&}heflag. When the READ saw a 0 then theIF-THEN came in and directed it tosome other line. FORMAT: RND EXAMPLE:!'} 20 RND 40 X=RND 90 X=INT(RND*10) 100 X=INT(RND*10)+1 200 X=INT(RND*1!(}00) EXAMPLE #2 10 X=RND 20 ? X;", "; 30 GOTO 10 EXAMPLE #3 10 CLS:? !)}20 X=INT(RND*10) 30 PAUSE 25:? X;", "; 40 GOTO 20 In this command the dummyvariable (0) has been eliminated.!*} Youcan still use the ATARi way RND(0) ifyou want to. In the example ln. 90you get random numbers from 0-9. Inln. 100 you!+} get random numbers from1-10. In ln. 200 you get randomnumbers from 0-99 FORMAT: RAND(n) EXAMPLE: 10 X = RAND(!,}10) 90 X = RAND(100) EXAMPLE #2 10 CLS 20 X = RAND(100) 30 ? X;", "; 40 PUA!-}SE 25 50 GOTO 20 In this command the randomnumbers are printed as integers. Theystart with 0 and end with the nu!.}mber-1 in the parentheses. FORMAT: SOUND EXAMPLE: 90 SOUND EXAMPLE #2 10 R=R+1 20 Y =!/} RAND(255) 30 SOUND 0,Y,10,8 40 PAUSE 100 50 SOUND 60 X = RAND(255) 70 SOUND 1,X,12,8 80 PAUSE !0}50 90 SOUND 100 IF R=8 THEN SOUND: R=0:GOTO 120 110 GOTO 10 120 END This command turns all!1} soundsoff. It is the same as 'SOUND0,0,0,0 FORMAT: TRAP #name EXAMPLE: 90 TRAP #END 95 TRAP #EN!2}D_OF_FILE This command is the same as '90TRAP 150' except it uses variablelabel names. For an application seeexample!3} #2 on the command '#name' ** STRINGS AND ERRORS ** ------------------------- FORMAT: TIME EXAMP!4}LE: 95 ? TIME/60 EXAMPLE #2 10 CLS:?:? 20 ? "TIMING A LOOP":?:? 30 S=TIME:REM STARTING TIME !5} 40 FOR X=1 TO 120:? X;", ";: NEXT X 50 E=(TIME-S)/60:REM E=ELAPSED TIME-S, STARTING TIME 60 ?:?:!6}? INT(E*100)/100; " SECONDS" The TIME counter is active assoon as you turn on your computer. Itcounts 60 numb!7}ers per second. To geta readout in seconds use TIME/60. Toget a readout in minutes useTIME/3600. To get a readout in hours!8}use TIME/216000. The TIME counterwill continue as long as yourcomputer is turned on. If you want tostart the time counter!9} from thebeginning then press the RESETbutton. FORMAT: TIME$ EXAMPLE: 30 ? TIME$ EXAMPLE #2 !:} 10 CLS:?:? 20 DIM T$(6) 30 INPUT "SET TIME - HHMMSS"; T$ 40 INPUT "WHEN TO STOP - HHMMSS";S!;} 50 CLS 60 TIME$=T$ 70 REPEAT 80 POKE 755,0:REM NO CURSOR 90 POSITION 10,10:? "HOURS, MIN,SE!<}C:";:? TIME$ 100 X=VAL(TIME$) 110 UNTIL X=S 120 POSITION 10,12:? "RING! RING! RING!" 130 POKE 75!=}5,3:REM CURSOR This command prints the time ofday in the form of HOUR MINUTE SECOND(HHMMSS). In Europe they use 50 cy!>}clecurrent and European ATARI'S run onthis current as against 60 cycle inthe USA. As a result of this theTIME$ function i!?}s not accurate andgains 10 minutes each hour. FORMAT: INKEY$ EXAMPLE: 70 ? INKEY$ 90 A$=INKEY$ !@} EXAMPLE #2 10 REM SCREEN WRITER 20 ? INKEY$; 30 GOTO 20 EXAMPLE #3 10 CLS:DIM !A}A$(1):?:?:REM GAME 20 ? "HIT THE KEY OF THE LETTER ON THE SCREEN!" 30 PAUSE 150 40 R=RAND(90):IF R<65 !B}THEN 40 50 CLS:POSITION 19,12: ? CHR$(R) 60 PAUSE 55 70 A$=INKEY$ 80 IF A$=CHR$(R):GOTO 90: !C} ELSE:GOTO 100:ENDIF 90 ?:? "YOU GOT IT!":PAUSE 90: GOTO 40 100 ?:? "YOU MISSED IT!": PAUSE 90:GO!D}TO 40 This command returns thecharacter of the last key hat waspressed. In example #3 please noteline 70. Line 80 us!E}es and IF-ELSE-ENDIF command. FORMAT: INSTR(x$,a$,i) EXAMPLE: 50 ? INSTR(X$,A$,1) EXAMPLE #2 !F} 10 DIM X$(30),A$(5) 20 X$="MY HEART BELONGS TO DADDY" 30 A$="DADDY" 40 ? "DADDY IS AT POSIT. "; !G} 50 ? INSTR(X$,A$,1) This command returns thebeginning of a sub string. The x$ =the original string. The a$ = the su!H}bstring you want to find. The i = theposition in muneric form that youwant to search the original string.This command wil!I}l return the positionnumber where the sub string starts.Spaces are also counted. FORMAT: UINSTR(x$,a$) !J} UINSTR(x$,a$,i) EXAMPLE: 50 ? UINSTR(X$,A$) 20 ? UNISTR(X$,A$,5) EXAMPLE #2 10 DIM !K}X$(40),A$(8) 20 X$="WHERE HAVE ALL THE SOLDIERS GONE" 30 A$="soldiers" 40 ? "soldiers IS AT POSIT"; !L} 50 ? UINSTR(X$,A$) EXAMPLE #3 10 DIM X$(40),A$(8) 20 X$="ICH BIN EIN BERLINER" 30 A$="berl!M}iner" 40 ? "berliner IS AT POSIT."; 50 ? UINSTR(X$,A$,5) This command is the same asINSTR above. It searches!N} for thebeginning of a sub string.x$=original string. a$=sub string.i=starting position of the search.With UINSTR you can!O} have lower case,upper case or inverse as the substring. It does not distinguishbetween case. You can include oreliminate!P} the starting position ofthe search. See example #2 and #3. FORMAT: ERR EXAMPLE: 20 ? ERR !Q}90 ? "ERROR # ";ERR; " AT LINE ";ERL EXAMMPLE #3 10 CLS:DIM A$(15):?:? 20 TRAP 90:!R}READ A$ 30 ? A$ 40 GOTO 20 50 DATA MONDAY,TUESDAY, WEDNESDAY 60 DATA THURSDAY,FRIDAY 70 DATA!S} SATRUDAY,SUNDAY 90 REM ERROR TRAP ROUTINE 100 ?:? "ERROR # ";ERR; " AT LINE ";ERL 110 LIST DPEEK(186!T}):REM LIST ERROR LINE This command list the last errornumber FORMAT: ERL EXAMPLE: 20 ? ERL !U} 90 ? "ERROR # ";ERR; " AT LINE ";ERL This command prints the linenumber where the last erro!V}r occurred.See example #3 at 'ERR" ** LOOPS AND SUBROUTINES ** ----------------------------- In TURBO BASI!W}C you call asubroutine in 3 ways: 1) GOSUB - byline number. 2) PROCEDURE - by name.3) USR - by address. FORMAT: REP!X}EAT - UNTIL - EXIT EXAMPLE: 10 REPEAT:A=A+1 20 ? A 30 UNTIL A=6 EXAMPLE #2!Y} 10 CLS 20 A=64 30 ?:?:?:? 40 REPEAT:A=A+1 50 ? CHR$(A);", "; 60 UNTIL A=90 This command i!Z}s a loop. It willrepeat itself till the end conditionis met. The end condition must beincluded with the UNTIL statement.E![}XIT gets you out of the loop. SeeDO-LOOP FORMAT: WHILE - WEND - EXIT EXAMPLE: 10 A=10:WHILE A 20 !\}? A 30 A=A-1:WEND EXAMPLE #2 10 CLS:? 20 A=90:WHILE A:? CHR$(A); ", "; 3!]}0 IF A=65 THEN A=1 40 A=A-1:WEND This command is a loop. As longas the WHILE remains NON-ZERO theloop will execu!^}te. All statementsbetween WHILE and WEND will beexcecuted. In example #2, A=A-1 isthe reverse counter. We terminate thelo!_}op before it becomes zero with theIF-THEN. If you go out of this loopwith GOTO use the POP to clear thestack. Example #2 i!`}s the same as 'FORX=90 TO 64 STEP-1'. EXIT gets you outof the loop. See DO-LOOP FORMAT: DO - LOOP - EXIT EXAMP!a}LE: 10 DO:A=A+1 20 ? A;", "; 30 IF A=15O THEN EXIT 40 LOOP The DO-LOOP is an !b}infinte loopunless you use the EXIT command toget out of it. The DO and the LOOPare the 2 parts needed for this loop.Anyt!c}hing between them will beprinted. FORMAT: IF - ELSE - ENDIF IF - ENDIF EXAMPLE: 90 IF !d}X>3:? "TOO LARGE:ELSE:? "OK": ENDIF 10 IF A<7 ? "YES" :ENDIF !e} EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 IF A>5 40 PRINT A 50 GO# TOO_BIG !f} 60 ELSE 70 PRINT A 80 GO# A_IS_OK 90 ENDIF 100 # TO_BIG:? "THIS NUMBER IS TOO LARGE":?!g}:GO TO 20 110 # A_IS_OK:? "THIS NUMBER IS JUST RIGHT" 120 END EXAMPLE #3 10 CLS:?:?:D!q} bŠbbӣbb%DOS SYSb*)DUP SYSbSAUTORUN SYSb`MENU bjuTURBODOCNEWb RAMDISK COMIM A$(1) 20 INPUT "IS THIS PORRIDGE OK(Y/N)";A$ 30 IF A$(1,1)="N":GO# TOO_HOT: ELSE:GO# JUST_RIGHT:!r}ENDIF 40 # TOO_HOT:?:? "THIS PORRIDGE IS TOO HOT SAID GOLDILOCKS" :END 50 # JUST_RIGHT:? :? "THIS I!s}S JUST RIGHT SAID GOLDILOCKS" This command as NO THEN in it.It can be used with an ELSE or not.If you use it!t} on one line be sure tohave a colon before and after theELSE (:ELSE:). This command must beterminated with an :ENDIF. The !u}ENDIFhas a colon in front of it if it isused on one line. See example #3 line30. FORMAT: PROC - ENDPROC -(EXEC) !v} EXAMPLE: 10 EXEC START_PROG 20 END 30 PROC START_PROG 40 ? "HELLO" !w} 50 ENDPROC EXAMPLE #2 10 CLS:?:? 20 EXEC TOO_HARD 30 EXEC TOO_SOFT 40 EXEC JUST_RIGHT !x} 50 END 60 -- 70 PROC TOO_HARD 80 ? "GOLDILOCKS SAID THIS BED IS TOO HARD!":? 90 ENDPROC 1!y}00 -- 110 PROC TOO_SOFT 120 ? "GOLDILOCKS SAID THIS BED IS TOO SOFT!":? 130 ENDPROC 140 -- !z}150 PROC JUST_RIGHT 160 ? "GOLDILOCKS SAID THIS IS JUST RIGHT!" 170 ENDPROC This command is used lik!{}e GOSUBexcept we use a variable label name.Just like GOSUB you should have anEND statement somwhere in yourprogram. The P!|}ROC stand for procedureand is called by the EXEC (execute)command. The EXEC looks for the PROCname and then executes it. T!}}hecommand is terminated with ENDPROC.Anything between PROC and ENDPROCwill be executed. ** GRAPHICS ** !~} ---------------- To get a clear understanding ofthe various graphics modes, colors,screen postions and text wind!}ows etc.see the book "YOUR ATARI COMPUTER" byLon Poole et al. published byOsbrone/Mc Graw-Hill FORMAT: CIRCLE x,y,r!} EXAMPLE: 40 CIRCLE 160,96,20 EXAMPLE #2 10 GRAPHICS 8+16 20 COLOR 1 30 FOR X = 1 TO 90 !}STEP 3 40 CIRCLE 160,96,X 50 NEXT X 60 GOTO 20 EXAMPLE #3 10 GRAPHICS 8+16 20 COLOR !}1 30 FOR X=20 TO 300 STEP 20 40 CIRCLE X,96,80 50 NEXT X 60 GOTO 20 This command draws a circle. Th!}egraphic mode has to be stated in theprogram. x and y are the centerposition of the circle. r is theradius of the circle.!} FORMAT: CIRCLE x,y,r,r2 EXAMPLE: 30 CIRCLE 160,96,50,70 EXAMPLE #2 10 GRAPHICS 8+16 2!}0 COLOR 1 30 FOR X=1 TO 75 STEP 3 30 CIRCLE 160,96,X,X+25 40 NEXT X 50 GOTO 20 This command is the !}same asabove except we have a verticalradius r2 so we can draw true circlesor ellipses. x,y is the center of thecircle, r!} is the radius and r2 is thevertical radius. FORMAT: FCOLOR n EXAMPLE: 30 FCOLOR 3 EXAMPLE #2 !} 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 FCOLOR 3 50 FILLTO 80,48 60 FCOLOR 1 70 F!}ILLTO 80,93 80 GOTO 20 FCOLOR is usually used inconjunction with the FILLTO command.FCOLOR selects the fill in c!}olor. Thenumber of fill in colors depend onthe graphics mode. FORMAT: FILLTO x,y EXAMPLE: 70 FILLTO 80,93 !} This command fills in a shapewith the color selected by the FCOLORcommand. It is the same as XIO18,#6,0,0,"S:". The x and!} y are thestarting position INSIDE the shape.See example #2 under FCOLOR. FORMAT: PAINT x,y EXAMPLE: 40 PAINT !}80,48 EXAMPLE #2 10 GRAPHICS 7+16 20 COLOR 1 30 CIRCLE 80,48,45 40 PAINT 80,48 50 GO!}TO 20 This is also a type of fill incommand. This is a recursive routinethat will fill any closed shape. Thex and y !}have to be the positioninside the shape to be filled. FORMAT: TEXT x,y,a$ EXAMPLE: 40 TEXT 3,8,A$ !} EXAMPLE #2 10 CLS 20 DIM A$(4) 30 A$="WIND" 40 TEXT 3,8,A$ This command bit-blocks the textin A!}$ at position x,y ** CONSTANTS AND ERROR CODES ** --------------------------------- FORMAT: %0 %1 %2 %3 !}EXAMPLE: 20 X=%1 50 FOR T = %1 TO %3: ? T:NEXT T These 4 constants stand for thenumber!}s 0 to 3. They are used likeregular numbers. "X=1" uses 10 byteswhile "X=%1" uses 4 bytes. When youuse these numbers you s!}ave on eachnumber 6 bytes. It is goodprogramming to make variables ofnumbers that are used more than 3times. !} NEW ERROR CODES --------------- TURBO-BASIC prints out inEnglish all errors. You do not haveto look up th!}e error code numbersanymore. TURBO-BASIC has 8 new errorcodes not in ATARI-BASIC. The newerror codes are form 22 to 30 !} FORMAT: Error - 22 ?NEST The loops are not properly nested FORMAT: Error - 23 ?WHILE A WHILE-WEND!} loop with no corresponding WHILE FORMAT: Error - 24 ?REPEAT An UNTIL with no corresponding REPEAT !} FORMAT: Error - 25 ?DO A DO-LOOP with no corresponding DO FORMAT: Error - 26 ?EXIT EXIT is outsid!}e a loop FORMAT: Error - 27 ?XPROC Error in executing a procedure ( There is no END line in your progr!}am etc.) FORMAT: Error - 28 ?EXEC ENDPROC with no corresponding EXEC. FORMAT: Error - 29 ?PROC !} PROC does not exist FORMAT: Error - 30 ?# Variable name label dos not exist. FORMAT: Error - 15 !} Error 15 has been expanded toinclude an UNTIL which is in aREPEAT-UNTIL loop and which has beendeleted by mistake !} ** ARITHMETIC AND LOGIC ** ---------------------------- FORMAT: HEX$(n) EXAMPLE: 20 ? HEX$(32) !} EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A DECIMAL NUMBER";A 30 ? "DECIMAL ";A;" = HEX "; !} HEX$(A) 40 ?:GOTO 20 This command takes a decimalnumber and converts it into aHEXIDECIMAL number FORMAT:!} DEC(a$) EXAMPLE: 20 A$="FF":? DEC(A$) EXAMPLE #2 10 CLS:?:?: DIM A$(8) 20 INPUT "GIVE ME TH!}E HEX NUMBER";A$ 30 ? "HEX ";A$;" = DECIMAL "; DEC(A$) 40 ?:GOTO 20 This command changes aHE!}XIDECIMAL number to a decimalnumber. The HEX number must first beput into a string. FORMAT: n DIV i EXAMPLE: 2!}0 A=9:B=4:? A DIV B EXAMPLE #2 10 CLS:?:? 20 INPUT "GIVE ME A NUMBER";A 30 INPUT "GIVE ME A SM!}ALLER NUMBER";B 40 Q=A DIV B:R=A MOD B 50 ? A;"/";B;" = "; 60 ? Q;" REMAINDER ";R This command g!}ives you the wholenumber part of a division orfraction. Example 9/4=2 R 1. Thiscommand prints the 2. FORMAT: n MOD !}i EXAMPLE: 20 A=9:B=4:? A MOD B This command returns theremainder of a division as a wholenumber. Example 9/4=!}2 R 1 Thiscommand will print 1. See example #2above. FORMAT: FRAC(a) EXAMPLE: A=22/7:? FRAC(A) !}EXAMPLE #2 10 CLS:?:? 20 A=22/7 30 ? "THE FRACTION 22/7 = ";A 40 ? "THE DECIMAL PART OF 22/7 = "!};FRAC(A) This command prints the decimalpart of a fraction ONLY. Example22/7=3.142857... This command prints142857..!}. FORMAT: TRUNC(a) EXAMPLE: A=22/7:? TRUNC(A) EXAMPLE #2 10 CLS:?:? 20 A=22/7 30 ?!} "THE FRACTION 22/7 =";A 40 ? "THE INTEGER PART ="; TRUNC(A) This command prints the Integerpart of a fra!}ction ONLY. Example22/7=3.142857 it will print only 3 FORMAT: $nnnn EXAMPLE: 20 POKE $8000 EXAMP!}LE #2 10 CLS:?:? 20 FOR T = $0F TO $FF 30 ? T;", "; 40 NEXT T This command allows you to usehexid!}ecimal numbers but they areconverted to decimal numbers. Inexample #2 line 20 is converted to'FOR T = 15 TO 255. !} ** BOOLEAN LOGIC ** --------------------- The &, !, EXOR, are used inBOOLEAN logic. They are usually usedt!}o compare 2 bits. The bits have tobe positive. Negative numbers willgive you an error. Each program willprint out a table !}for you of theresult of comparing 2 bits FORMAT: n & i EXAMPLE: 10 CLS:?:? 20 ?,"BOOLEAN 'AND' (&)"!} 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 &","1 =",1&1 60 ? "0 &","1 =",0&1 70!} ? "1 &";"0 =",1&0 80 ? "0 &";"0 =",0&0 This command is the BOOLEAN'AND' FORMAT: n ! i EXAMPL!}E: 10 CLS:?:? 20 ? ,"BOOLEAN 'OR' (!)" 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 !}!","1 =",1!1 60 ? "0 !","1 =",0!1 70 ? "1 !","0 =",1!0 80 ? "0 !","0 =",0!0 This command is !}the BOOLEAN'OR' FORMAT: n EXOR I EXAMPLE: 10 CLS:?:? 20 ? " BOOLEAN 'EXCULSIVE OR' (EXOR) !} 30 ? 40 ? "BIT ONE","BIT TWO", "RESULT" 50 ? "1 EXOR";"1 =",1 EXOR 1 60 ? "0 EXOR";"1 =",0 EXOR 1!} 70 ? "1 EXOR","0 =",1 EXOR 0 80 ? "0 EXOR","0 =",0 EXOR 0 This command is the BOOLEAN"Exclusive Or' !} ** SELF BOOTING PROGRAMS ** ----------------------------- If you want to have a programthat runs itself upon b!}ooting up thedisk name it 'AUTORUN.BAS'. TURBO-BASIC looks for a BASIC file by thisname when the boot process is inoperat!}ion ** NOTES ** ------------- Variables, Procedure Names andlabels may contain the undersc!}ore(_). Now you can combine severalwords into a name that tells you WHATand WHERE it goes. This is apowerful feature t!}o make yourprograms more legible. EXAMPLES: 10 TRAP 200 10 TRAP #END_OF_FILE 60 X = 65 6!}0 # LAST_CHAR = 65 90 IF A$(1,1) = "Y" THEN 60 90 IF A$(1,1) = "Y" THEN # FETCH_LABEL DOUBLE !}QUOTES ------------- Double quotes are allowed inprint statements. Whenever you want aquote in a print st!}atement put indouble quotes. EXAMPLE: 30 ? "SHE SAID ""GOODBYE"" ANDSLAMMED THE DOOR" MULITIPLE L!}INE IF-ELSE-ENDIF ---------------------------- You can use several linesbetween IF and ELSE and ENDIF. Seeexample!} #2 of IF-ELSE-ENDIF on page24 ARRAYS ------ You can have only NUMBER arrays.Just like!} ATARI BASIC, TURBO-BASICdoes not allow string arrays. Numberarrays can be one or two dimensional. You must DIM each array!}.One dimensional array 'DIM A(5)'. Twodimesnional arrays 'DIM A(5,8)'. Fora tutorial on arrays and sorting seethe back of!} this disk. SORTING For a tutorial on sorting ofnumbers and strings see the back ofthis disk. !} ***************** * * * PUBLIC DOMAIN * * * *********!}******** I am collecting TURBO-BASICutilities to be put into the PublicDomain. Your help is appreciated. Ifyou have !}a utility to share pleasesend it to the author (I prefer it ona disk if possible) This documentation is in thePublic!} Domain and may be copied byanyone! The author of this documentaionapologizes for any omission ormistakes - they wer!}e accidental. If you cannot get this diskthrough any Public Domain sourceplease send $5.00 to the author tocover the!} expense of the disk, themailer and postage. If you have any comments orsuggestion about this documentation - they a!}re welcome. Please write to: RON FETZER 22 MONACO AVE ELMONT, N.Y. 11003 TURBO!}-BASIC DOCUMENTATION INDEX =============================== NAME PAGE ---- ---- !} ARITHMETIC 29 ARRAYS 33 *B 12 BGET 5 BLOAD !} 2 BOOLEAN LOGIC 31 BPUT 4 BRUN 2 CIRCLE 26 !} CLS 6 CLS #n 6 COMPUTERS 1 DEC 30 DEL !} 8 DELETE 2 DIM 15 DIR 2 DISK COMMANDS 1 DIV!} 30 DO-LOOP 24 DOS COMMANDS 1 DOUBLE QUOTES 33 DPEEK !} 4 DPOKE 3 DSOUND 13 DUMP 8 DUMP name 9 ERL !} 23 ERR 22 ERROR 15 29 ERROR 22 28 ERROR 23 !} 28 ERROR 24 29 ERROR 25 29 ERROR 26 29 ERROR 27 29 ERRO!}R 28 29 ERROR 29 29 ERROR 30 29 ERROR CODES 28 EXOR !} 32 *F 11 FCOLOR 27 FETZER, RON 34 FILLTO 27 FR!}AC 30 GENERAL PROGRAM 6 %GET 6 GET name 15 GO #name !} 14 GO TO 11 GRAPHICS 26 HEX$ 29 IF-ELSE-ENDIF 24, 33 !} INKEY$ 21 INPUT 10 INSTR 21 *L 11 LINE LABELS!} 13 LIST n 16 LOADING 1 LOCK 3 LOOPS & SUBROUTINES 23 !} MEMORY 1, 3 MOD 30 MODIFICATIONS 15 MOVE 4 -MOVE !} 4 #nnnn 31 # name 13 NOTES 33 NUMBER SORT 34 !} ON a EXEC n1,n2 16 ON a GO# n1,n2 16 OSTROWSKI, FRANK 1 PAINT 27 PAUSE !} 7 POP 16 PROC-ENDPROC 25 PUBLIC DOMAIN 34 %PUT 5 !} PUT n 17 RAND 18 RENAME 3 RENUM 7 REPEAT-UNTIL!} 23 RESTORE #name 17 RND 18 SLEF-BOOTING 32 SORT 34 !} SOUND 19 STRING SORTING 34 TEXT 28 TIME 19 TIME$ !} 20 TRACE 9 TRAP #name 19 TRUNC 31 UINSTR 22 !} UNDERSCORE 14, 33 UNLOCK 3 USEABLE RAM 1 VARIABLE LABLES 14 VARIABL!}ES NUMBERS 1 WHILE-WEND 23 ! 32 & 32 %0 - %3 2!}8 -- 13 23 ! 32 & 32 %0 - %3 2 "8<<  B JKIHiDiELV`L8 8 BLV`Lx%}8t8l Lu8hihiHHȱȱL8c !#3`Lu8JJJJ`H 8h`H%}ȩh Q8L8 Z8L8 8L8 8L8 8L8S:@9E:E9H '9 H9I9 8 '9h)0IC%}9D9L8 L :::: :Lr:::IEL[::i:iIIL[:`:i::i%}::L:`L{:w:w: C`L:L: D8:MEM.SAV: 8| 9 '9`L:L: D:DUP.SYS:̩ 8%} x:ɀL: '9`88 |9Y:X: '9L); D8:DUP.SYS; 8::88 9 '98? :`;WL`; 9%}Ln; ` :Y;Y;L;L;)} Setting Up ATARI 130XE Ram Disk; 9L; ; -9  %} L;D8:; :9 :Y;L