trs80 color basic quickref

1
5-Buff 6-Cyan 7-Magenta 8-0range Statements AUDIO ConnectsordisconnectscassetteoutputtoTV speaker. AUDIDDN AUDIO OFF CIRCLE ( J r , Y } ~ ~ , h " " . ' ' ' ' ' , e a d Drawsacirclewithcenterat point (x,y) radlu ,spec ifiedcolor c, height/wi dthratio (hw) of 0-4.Circlecanstartand endatspecifiedpoint(0-1). CIRCLE(128,8S),50,4t1,.5,.75 JJ CLEAR a,h Reserves n bytesofstringstoragespace .Erases variables. h specifi eshighestBASICaddress. CLEAR CLEAR 500 CLEAR 101' , 111000 CLOAD Loadsspecifi edprogramf efromcassette. I f ename isnotspecified,firstfileencount ered is loa ded.F enamemust beeightcharacter/sp acesorfewer. CLOAD CLOAD"PROGRAM" CLOADM Loadsmachine-l anguageprogramfromcassete. MD offsetaddresstoadd the loadingaddress may be specified. CLOADM"PROG" CLOADM CLOADM" PROG" , 1000 CLOSE d Clo sesopenfiles. CLOSE CLOSE-2 CLS c Clearsdisplaytospe cif iedcol orc.Ifcolor is not specifi ed,green is used. O-Back l-Green 2-Yellow 3-Blue 4-Red CLS CLS3 COLOR (lore _d , "adtgroaad) Set foregrou nd and backgroun color. COLOR,1,3 CONT Continuesprogramexecutionafterpressing (BREAK) or usingS TOPscatement. CONT CSAVE Savesprogramoncassette(programnamemustbe eightcharacte r/spacesorless).IfA is specif ied,programsaved isASCIIformat. CSAI. IE "PROGRAM" CSAIJE "PROGRAM" ,A CSAVEM aaDle, .''''', ead,traasfer Writesouta machine-langua gefile. CSAVEM"X",4E,SF,5F DATA Storesdatainyourprogram.Use READtoassignthis datatovariables. DATAS ,3 ,PEARS DATA PAPER, PEN DEF FN Definesnumericfunct ion DEFFN (X) =X*3 DEFUSR a Def inesentrypoin tfor USA function n.n = 0-9. DEFUSR5=45S43 DEL Deletesprogramlines. DEL DEL25 DEL 25 DEL -25 10-25 DIM Dimensionsoneor morearrays. OIMR(6S) ,W(1l0) DIMAR$(8,2S) DLOAD Loads BASIC program at specifi ed baud. baud. 0= 300 baud 1= 1200baud DLOAD "X " , 1 DRAW Drawsalinebeginning at specifi edstartingpoint of specifi edlength of specifi edcolor.Willalsodrawto scale,draw blanklines, draw non-updat edlines,andexecutesubstrings .If startingpoint is notspecifie d,last DRAW position or (128,9 6)is used. DRAW"BM100,100IS10IU25IBR25IND25IXA$I" EDIT Allowsediting of programline. nC Changes n number of characters. nO Deletes n numberof characters. I Allowsinsert ion of new characters. H D el et esrest of lineandallowsinsert. L Listscurrentlineandcontinuesedit . nSc Searches fornth occurrence of characterc. X E xt en ds l in e. tIBIEIl(j) Escapefromsubcommand. n (SPACEBAR) Movescursor n spacestoright. n S Movescursor n spacestoleft. ED IT 25lEBIE1ll END Endsprogram. END EXEC (address) Transferscontr olto machine -languag e programsatspecifie daddress.If address isomitted ,control is transfe rredtoaddressset inlastCLOADM. E ~ < E E){EC3211S3 FOR .• TO Createsaloop in programwhichtheComputermust STEP/ repeatfromthefirstnumbertothe lastnumberyouspecif y. NEXT UseSTEPto specifyhowmuchtoincrementthenumber eachtimethroughtheloop. I youomitSTEP,one is used. FOR }(=2 TO 5 : NE><T ~ < FDRA=1 TO 10STEP5 :NE)<TA FOR M=30 TO 10 STEP -5 : NUn M GET (start)-(ead), d_tlaatloa, G Readsthegraphic contents of arectangleintoanarrayfor futureusebyPUT. GET (5,20)-(3,8),V ,G GOSUB Callsasubroutinebeginnin gat speci fiedlinenumber. GOSUB 500 GOTO Jumpstospecifiedlinenumber. GOTO 300 IF TEST THEN .. ELSE action 1, action 2 Performsatest. IFitistrue,the Computerexecutesacti on 1. I fals e,action2 is executed. IFA=5THEN30 INPUT CausestheComputertostop andawaitinputfromthe keyboard. INPUT)<$ INPUT"NAME"; N$ INPUT#-l Inputsdatafromcassette. INPUT#-1,A INSTR (posltloa,search,target) Searchesforthefirst occurrence of target stringin search stringbegin ningat position. Returnsthepositionatwhichthematchis found. ?INSTR(5,X$,Y$) LET Assignsvaluetovariable(optiona l). LET A$ = "JOBA" LIST Listsspecif iedline(s)orentireprogramonscreen. LIST LIST50-85 LI ST 30 LIST-30 LIST30- LUST Listspecif iedprogramline(s)orentireprogramtoprinter. LLIST LLIST50-85 LLI ST 30 LLIST-30 LLIST30- LINE (Jrl,yl)-(d,v2), PSET or PRESET, SF Drawaline from (x1.y1) to (x2,y2). If (x1,y1) isomitted,thelastendpoint or (128,96) is used.PSETselectsforegroundcolorandPRESET selectsbackg roundcolor.,Bdraws aboxwith (x 1,yt) and (x2,y2) as theopposingcorners.,SFwilf intheboxwi th foregrou ndcolor. LINE(5,3)-(S,S) ,PSET LINE INPUT Inputlinefromkeyboard. LINEINPUTANSWER"IX$ MID$ (oldstr,position, length) Replacesaportion of o n , ~ stringwithanotherstring. MID$ (A$t14,2)="KS" MOTOR TurnscassetteONorOFF. MOTOR ON MOTOR OFF NEW Eraseseveryth inginmemory. NEW ON •• GOSUB Multi-wa ybranchtocall speci fiedsubroutin es. ON YGOSUB 50,100 ON .• . GOTO MUlti -waybranchtospecifiedlines . ON){ GOTO 190 ,200 OPEN m,#d,f Opensf e () at:ScreenorKeyboard(0); Cassette(-1);Printer(-2).Forinput(I),oroutput (0). OPEN "0" ,-1, "DATA" PAINT (.,V),I:," Paintsgraphicscre enstarting at point (x,y) withspecifiedcolorcandstoppingatborder (b) of specified color. PAINT (10,10) PCLEAR a Reserves n number of 1.5Kgraphicsmemory pages. PCLEAR 8 PCLS c Clearsscre enwithspecifiedcol orc.Ifcolorco deis omitted,currentbackgroundcolorisused.(SeeCLS forco or codes.) PCLS3 PCOpy Copygraphicsfromsourcepagetodestinationpage . PCOPY5 TO G PLAY Playsmusic of specifi ednote(A-G or 1-12),octave (0), volume(V),note-length(L),tempo(T),pause(P),andallows execution of substri gs.Alsosharps (# or +) andfl ats(-. PLAY"L1iA.;P8IV10IT3;L2iB-i9iXA$i" PMODE DIode, start-page Selectsresolu tionandfirst memorypage. PMODE 4,1 POKE (location,value) Putsvalue(0-255 )intospecified memory location. POKE15872,255 PRESET Resetapointto backgro undcolor. PRESET 5,6) PRINT Printsspeci fiedmessageornumberonTV scree n. PRINT "HI" PRINT#·l Writesdatatocassette. PRINTA$ ? A$ PRINT#-1,A PRINT#-2 Printsanitemorlistof itemsontheprinter. PRINT#-2,CAP$ PR I NT TAB Movesthecursortospecifiedcolumnposit ion. PRINTTAB(S) "NAME" I PRINT USING Printsnumbersinspecifiedformat. # Formatsnumbers. PRINTUSING" •••• "IG2.2 Decimalpoint. PRINTUSING" ...... 158.G Displayscommatoleft of everythirdcharacter. PRINTUSING" •• ##,"144.0 ++ Fillsleadingspaceswithasterisks. PRINTUSING"**# •••• "133.3 $ Places $ ahead of number. PRINTUSING"$## ••• "133,3 $$ Floatin gdollarsign. PRINTUSING"$$ •••• "111.S411 **$ Floatin gdollarsign. PRINTUSING"**$ ••• #"18.333 r Infirstposition ,causessignto beprinted.Inlast positi on,causessigntobe printedafterthenumber . PRINTUSING"+ ••• #"i-21G .. ~ \ . . . . . . Exponential format. PRINTUSING"··.·tttt"ISllG Minussignafternegativenumbers . PRINTUSING".# •• -"1-5311.7 Returnsfirststrin gcharacter. PR I NT US I NG . !" I" YELLOW" Ofosp8cesOfo Stringfield;lengthoffieldisnumberofspaces plus 2. PRINT USING"'X. x ; "BLUE" PRINT @location Printsspecif iedmessageatspecifiedtext screenlocation. PRINT@256,"HI" PRINT@256,A$ PSET (.,v,c) Setsaspecifiedpoint (x,y) tospecifie dcolorc. Ifc isomited,foregroundisused. PSET 5,6,3) PUT (sta;rt}-(end), source,actloa Storesgraphicsfrom source ontostart/e ndrectangleonthescreen.(Arrayrectangle sizemustmatch GET rectangle size.) PUT (3,2)-(5,6) ,V ,PSET READ Readsthenextitem in DATAlineandassigns i to specifiedvariable. READA$ READC,B REM Allowsinserti onof commentinprogramlne. Everyt hing afterREMis ignoredbyComputer. REMTH I SIS IGNORED 10 ?){$ :REM IGNORE RENUM aewllne,startllae,lacreDleat Allowsprogramline renumbering. RENUM 1000 ,5 1100 RESET (x,v) Resetsapoint. RESET (111 ti5) RESTORE SetstheComputer'spointerbacktofirstitemon the firstDATA line. RESTORE RETURN ReturnstheComputerfromsubroutinetotheBASIC wordfollowingGOSUB. RETURN RUN Executesaprogram. RUN SCREEN screea-type, color·set Selectseithergraph ics(1) or text(0)screenandcolor-set(0 or 1). SCREEN 1, 1 SET (x,V,c) Setsadot atspecifiedtextscreenlocat ionto specified color. SET( 111 ti3 ,3) SKIPF Skipstonextprogramon cassett etape,or toendof specifiedp rogram. SKIPF"PROGRAM" SOUND tone, duration Sounds specif ied tone for speci fied duration. SOUND 128,3 STOP Stopsexecuti onof aprogram. STOP THOFF Turnsoffprogramtracer. TROFF THON Turnsonprogramtracer. TRON Graphic Character Codes Eac h operator orgroupof oper ator s is prec edentoverthegroupbelow it. Operators Explanation Div isionby 0 Filealready OPEN Subscri pt out of range Can'tcontinue Redimensioned array Devic e numbererror Directstatement in f e Illega l functi on ca Bad fil e data Bad fil e mode Illeg al direct Inputpastendoff e Input/Outputerror Stringtoo long NEXT without FOR Fe notopen Outof data Outof memory Outof stri ngspace Overflow RETURN without GOSUB Syntaxerror Stringformulatoo compl ex Typemismatch Undefi ned line /0 AD BS CN DD DN DS FC FD FM ID IE 110 LS NF NO OD OM OS Ot RG SN ST TM UL Error Messages Abbreviation Abbrevi ationfor REM. $ Makesvariablestring type. Separates stat eme ntson thesamel ne. ? Same as PRINT punctu ation:spaces over tothe nex t 16-c olumn PRINT zone. PRINT punctua tion:separates items in a PRINT lis t butdoesnotadd spac es when theyareoutput. Special Characters Clearsthe screen . Signifi esend ofcurrent lne. Entersa space(blank) charact er and movescursor one spaceforward. Causescurrentlyexecuting progra m to pause (pre ssany key to continue). All-caps/upper-iowercase keyboa rd switc h. (Lowercase displa yed as revers ed capital s.) (SPACEBAR) Cancelslast character typed;moves cursorback one space . Erasescurrentl ne. Control Keys Interru pts anythi ng in progressand returns to comma nd leve. STR$ (numeric) Convert sa numeri cexpression to astrng. S$=STR$ (){) SQR (aamerie) Returnsthesquarerootofanumber. Y=SQR(5+3) AN (aamerie) Returnstangent of anglegiveninradians. Y=TAN(4S.7) Returnsconten tsorallowssetting of timer(0-65535). ?TlMER TlMER=0 SRa (aamerie) Callsuser'smachine-languagesubroutine. X=USR(Y) VAL (str) Convertsastringtoanumber. A=t,JAL (B$) VARPTR (var) Return saddressof pointer to thespecified variable. Y=USR(VARPTR(X) ) STRlNG$(Ieagt/J.eode or strlag) Returnsastringof characters(ofspecifiedlength)specifiedby ASCIIcodeorbythe firstcharacte r of thestring. ?STRING$(5,l',t" ) ?STRING$(S,91) i»OS (deriee) Returnscurrentprintposition.Device-1- printer.-2 = display. PRINTTAB(B)POS(0) i»POINT ( •• v) Testswhetherspecifi edgraphicscellisonor off andreturnscolorcode of specifiedcell. PPOINT (13,35) \lEM Findstheamountoffreememory. PRINTMEM \lID$ (str. pos.length) Return sa substr ingofanotherstring starti ngat pas. I length is omitt ed,theentirestringr ghtof position is returned. F$=MID$(A$,3) ?MID$(A$,3 ,2) EEK (Ioeatloa) Returnsthecontents of specified memory location. A=PEEK(32076) JOYSTK OJ Returnsthehorizont alorverticalcoordinate U) of theleftorrightjoystick: o = horizontal,leftjoystick 1 = vertic al,leftjoystick 2 = horizontal,r ghtjoystick 3 = vertic al,rightjoystick M=JOYSTK(0) H=JOYSTK(K) lEFT$ (str,length) Returnsleftportion (length characters)of string. P$=LEFT$(M$,7) lEN (str) Return sthe lengthofastring. ){=LEN (SEN$) l.OG (aamme) Returnsnaturalloga rittim. Y=LOG(353) POINT (x,y) Testswhetherspeci fiedgraphicsce ison oroff,x (horizontal) = 0-63; Y (vertical) = 0-31.Thevaluereturnedis -1 if thece isin atextcharacter:mode:0if itisoff,or thecolorcodeif it is on.SeeCLSfor colorcodes. I F PO INT( 10 ,10) THEN PR I NT "ON" ELSE PR I NT "OFF " RIGHT$ (str,length) Return sr ghtportionofstrng. ZIP$=RIGHT$(AD$,S) SGN (numeric) Return ss gnof speci fiednumericexpression: -1 ifar gumentisnegati ve o ifargument is 0 + 1 ifargumentisposit ive )(=SGN(A*B) SIN (numeric) Returnssineofanglegiven in radans. Y=SIN(S) CHR$ (code) Return scharacterforASCII,control,orgraphics code. ?CHR$(191) P$=CHR$(T) ASC (str) ReturnsASCIIcodeof firstcharact erof speci fied string. A=ASC (1$) ATN ( ...... erie) Returnsarctang entinradians. y= ( 3 Argumentrangesare indicat edbyspecialsymbols: numeric: (_10 38 , + 10 38 ) . x: (0-255) y: (0-191) location: (0-65535) code: (0-255) str: stringargument var: variablename ABS (numeric) Computesabsolutevalue. Y=ABS(S) EXP (a .... erie) Returnsnaturalexpo nentialofnumber (e"umlJe') . Y=EXP(7) EOF (f) ReturnsFALSE(0)if there is moredata:TRUE (-1)if endoffilehas beenread.Forcassette, (= - 1;forkeyboard , (=0. EOF=(-1) EOF(0) cos (...... eriel Returnscosine of ananglegiveninradians. Y = () FIX (a .... erie) Returnstrunca ted(wholenumber)value. Y=FIX<7.6) HEX$ (aamerie) Computeshexade cimalvalue. PRINTHEX$ (30) v=HEX$ (XL161 INKEY$ Checksthekeyboardandreturnsthekeybe ng presse d( fany). A$=INKEY$ INT (numeric) Convertsanumberto an integer. )(=INT(S.2) Functions 5 Exponentiation Unarynegative,positive Multiplication, division Additi on and concatenation,subtractio n Relat ionaltests PRINTCHR$ (code) Backsp acesand erasescurrent charac ter. Line fee d wth carr iage ret urn. Space Hex 08 00 20 Video Control Codes Dec 8 13 32 Forexample, to print pattern 9 in blue (code 3),type: C=128+16*(3-1)+9 ' CHR$ (C) Given the color (1- 8) andthe pattern (0- 15) , this formulaw generatethe correctcode: code = 128 + 16 · (color-1) +pattern 01 21 31 4 61 71 81 91 10 121 131 141 15 1 + -, + *,1 +, <,>,=,<=,>=,<> 1. Turn thetelev ision setON. 2. Selectchannel3or 4. 3. Setthe AntennaSwitchto "COMPUTER." 4. Turn onany acc essoryequipment(e.g.,aprinte r). 5. Ifyou'reusinga Program Pak'" ,insertitnow, beforeturnin g on the Computer. 6. Turn theComputerON. 7. Ifyou' re not using a Program Pak'·, th Color BASI C or ExtendedColorBASICstart-upmessagewillappear on theTV, followed by: OK TheComputeris nowreadyto use. Start-Up TRS·BO ® Color Computer 2 MICRO· COMPUTER SYSTEM Note: Informa tion pertaini ng to Extend ed Color BASIC only is shaded I <e this paragrap h. Non-shad ed informationpertains to bothExtended and non-Exte ndedColor BASIC.

Upload: dharmatech

Post on 10-Apr-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

8/8/2019 TRS80 Color Basic Quickref

http://slidepdf.com/reader/full/trs80-color-basic-quickref 1/2

5-Buff6-Cyan7-Magenta8-0range

Statements

AUDIO ConnectsordisconnectscassetteoutputtoTVspeaker.AUDIDDN

AUDIO OFF

CIRCLE ( J r , Y } ~ ~ , h " " . ' ' ' ' ' , e a d Drawsacirclewithcenteratpoint (x,y) radlu ,speci f iedcolorc, height/widthratio (hw) of0-4.Circlecanstartand endatspecifiedpoint(0-1).CIRCLE(128 ,8S) ,50 ,4 t1 , .5 , . 75 JJ

CLEAR a,h Reserves n bytesofstringstoragespace.Erasesvariables. h specifieshighestBASICaddress.CLEAR

CLEAR 500

CLEAR 101' , 111000

CLOAD Loadsspecifiedprogramf efromcassette. I f e nameisnotspecified,firstfileencountered is loaded.F enamemustbeeightcharacter/spacesorfewer.CLOAD

CLOAD"PROGRAM"

CLOADM Loadsmachine-languageprogramfromcassette.MD offsetaddresstoadd the loadingaddressmay bespecified.CLOADM"PROG"

CLOADMCLOADM" PROG" , 1000 -

CLOSE d Cl os esopen f i le s.CLOSE

CLOSE-2

CLS c Clearsdisplaytospec i fiedcolorc . I fcolor is notspecified,green is used.O-Backl-Green

2-Yellow3-Blue4-RedCLS

CLS3

COLOR (lore _d , "adtgroaad) Set foregroundand backgroun color.COLOR,1,3

CONT Continuesprogramexecutionafterpressing (BREAK)orusingS TOPscatement.CONT

CSAVE Savesprogramoncassette(programnamemustbeeightcharacter/spacesorless).IfA is specified,programsavedisASCIIformat.CSAI.IE "PROGRAM"

CSAIJE "PROGRAM" ,A

CSAVEMaaDle, . ' ' ' ' ' ,ead,traasfer Writesoutamachine-langua gefile.CSAVEM"X",4E,SF,5F

DATA Storesdatainyourprogram.Use READtoassignthisdatatovariables.DATAS ,3 ,PEARS

DATA PAPER, PEN

DEF FN DefinesnumericfunctionDEFFN (X) = X * 3

DEFUSR a De fi ne s ent r y po i nt f o rUSA function n.n = 0-9.

DEFUSR5=45S43

DEL Deletesprogramlines.DEL

DEL25

DEL 25

DEL -25

DEL 10 -25

DIM Dimensionsoneor morearrays.OIMR(6S) ,W(1l0)

DIMAR$(8,2S)

DLOAD Loads BASIC program at specified baud.baud.0= 300 baud 1 = 1200baudDLOAD "X " , 1

DRAW Drawsalinebeginning at specifiedstartingpointofspecifiedlengthof specifiedcolor.Willalsodrawto scale,drawblanklines,drawnon-updatedlines,andexecutesubstrings.Ifstartingpointis notspecified,last DRAW position or (128,96)isused.DRAW"BM100,100IS10IU25IBR25IND25IXA$I"

EDIT Allowseditingof programline.nC Changesn numberof characters.nO Deletes n numberof characters.I A l lows in se r ti on of new characters.H Del et es r es tof lineandallowsinsert.L Listscurrent l ineandcontinuesedi t.nSc Searchesfornth occurrence of characterc.X E xt en ds l in e.tIBIEIl(j) Escapefromsubcommand.n (SPACEBAR) Movescursornspacestoright.nS Movescursorn spacestoleft.ED IT 25lEBIE1ll

END Endsprogram.END

EXEC (address) Transferscontrolto machine-languageprogramsatspecifiedaddress.If address isomitted,control istransferredtoaddressset inlastCLOADM.E ~ < E CE){EC3211S3

FOR .•TO Createsaloop in programwhichtheComputermustSTEP/ repeatfromthefirstnumbertothe lastnumberyouspecify.NEXT UseSTEPto specifyhowmuchtoincrementthenumber

eachtimethroughtheloop. I youomitSTEP,one is used.FOR }(=2 TO 5 : NE><T ~ <FDRA=1 TO 10STEP5 :NE)<TA

FOR M=30 TO 10 STEP -5 : NU n M

GET (start)-(ead),d_tlaa t loa ,G Readsthegraphiccontents of arectangleintoanarrayfor futureusebyPUT.GET (5,20) - (3,8) ,V ,G

GOSUB Callsasubroutinebeginningat specifiedlinenumber.GOSUB 500

GOTO Jumpstospecifiedlinenumber.GOTO 300

IF TESTTHEN .. • ELSE action 1, action 2 P er fo rm s a te st .IFitistrue,the Computerexecutesaction 1. I false,action2 isexecuted.IFA=5THEN30

INPUT CausestheComputertostop andawaitinputfromthekeyboard.

INPUT)<$INPUT"NAME"; N$

INPUT#-l Inputsdatafromcassette.INPUT#-1,A

INSTR (posltloa,search,target) Searchesforthefirstoccurrence of targetstringinsearch stringbeginningatposition.Returnsthepositionatwhichthematchis found.?INSTR(5,X$,Y$)

LET Assignsvaluetovariable(optional).LET A$ = "JOBA"

LIST Listsspecifiedline(s)orentireprogramonscreen.LISTLIST50-85

LI ST 30

L IST-30

LIST30-

LUST Listspecifiedprogramline(s)orentireprogramtoprinter.LLIST

LL IST50 -85LLI ST 30

LLIST-30

LLIST30-

LINE (Jrl,yl)-(d,v2), PSET or PRESET, SF Drawalinefrom (x1.y1) to (x2,y2). If (x1,y1) isomitted,thelastendpoint or(128,96) is used.PSETselectsforegroundcolorandPRESETselectsbackgroundcolor.,Bdraws aboxwith (x 1,yt)and(x2,y2) as theoppos ingcorners . ,SFwi ll f in theboxwithforegroundcolor.LINE(5,3) - (S,S) ,PSET

L INL

MIDsM

MO

M

NEW

ON

ON.O

OPECO

PAIw

c

PCL

p

PCLocP

PC

PLAve

PMm

POm

PRE

PR

8/8/2019 TRS80 Color Basic Quickref

http://slidepdf.com/reader/full/trs80-color-basic-quickref 2/2

Graphic Character Codes

Each operator orgroupof operators is

precedentover thegroupbelow it.

Operators

i»OSprinPR

i»POIanPP

\lEMPR

\lID$staposF$

? M

EEK

locA=

JOYS

theo123M=

H=

lEFT

striP $

lEN (){=

l.OGY=

POIN(hotheit isI F

RIGHZI

SGN- 1o

+ 1)(=

SIN (Y=

CHR$ (code) ReturnscharacterforASCII,control,orgraphicscode.?C H R $(191)

P$=CHR$(T)

ASC (str) ReturnsASCIIcodeof firstcharacterof specifiedstring.A=ASC (1$)

ATN (. . . . . .erie) Returnsarctangentinradians.y= ( 3

Argumentrangesare indicatedbyspecialsymbols:

numeric: (_10 38, + 1038

) .

x: (0-255)y: (0-191)location: (0-65535)

code: (0-255)

str: stringargumentvar: variablename

ABS (numeric) Computesabsolutevalue.Y=ABS(S)

EXP (a . . . .erie) Returnsnaturalexponentialofnumber(e"umlJe').

Y= EXP( 7 )

EOF (f) ReturnsFALSE(0)if there is moredata:TRUE(-1)ifendoffilehas beenread.Forcassette,(= - 1;forkeyboard,(=0.

EOF=(-1)EOF(0)

cos (......eriel Returnscosineof ananglegiveninradians.Y= ()

FIX (a ....erie) Returnstruncated(wholenumber)value.Y=FIX<7 .6 )

HEX$ (aamerie) Computeshexadecimalvalue.PRINTHEX$ (30)

v=HEX$ (XL161

INKEY$ Checksthekeyboardandreturnsthekeybe ngpressed( fany).A$=INKEY$

INT (numeric) Convertsanumberto an integer.) ( =IN T( S.2 )

Functions

5

Exponentiation

Unarynegative,positive

Multiplication, division

Addition and concatenation,subtraction

Relationaltests

PRINTCHR$ (code)

Backspacesand erasescurrent character.Line feed wth carriage return.Space

Hex

080020

Video Contro l Codes

Dec

8

1332

Forexample, to print pattern 9 in blue (code 3),type:C=128+16*(3-1)+9

' CHR$ (C)

Given the color (1-8) andthe pattern (0-15), this formulawgeneratethe correctcode:

code = 128 + 16 · (color-1) +pattern

01 21 31 461 71 81 91 10

121 131 141 151

+-, +

*,1

+,

<,>,=,<=,>=,<>

1. Turn thetelevision setON.

2. Selectchannel3 or 4.

3. Setthe AntennaSwitchto "COMPUTER."

4. Turn onany accessoryequipment(e.g., aprinter).

5. Ifyou'reusinga ProgramPak'" ,insertitnow, beforeturning onthe Computer.

6. Turn theComputerON.

7. I f you 're not usi ng a P rogram Pak'·, t he Color BAS IC orExtendedColorBASICstart-upmessagewillappearon theTV,followed by: OK

TheComputeris nowreadyto use.

Start-Up

TRS· BO ®

Co lo r Compu t e r 2

M I C R O ·

C O M P U T E R

S Y S T E M

Note: Information pertaining to Extended Color BASIC only isshaded I <e this paragraph. Non-shaded informationpertains tobothExtended and non-ExtendedColor BASIC.