Page 2
SHACK'S election and s ole expense, RADIO SHACK h asnoobligation t oreplace o r reoair e xpendable items RADIO SHACK makes nowarranty as tcthe design. capability. capacity,...
Page 3
CUSTOMER RADIO SHACK SOFTWARE LICENSE RADIO SHACK grantsto CUSTOMER a non-exclusve, p aid-uplécense t o usetheRADIO SHACK Software on onecomputer, s ubJect t o thefollowing provlS10ns: Except as otherwise provided in this Software License, applicablecopyright laws shali apply to the Software.
Page 4
This manual, which should be available in the Summer of 1982, will be a comprehensive PC-2 BASIC Programming Manual. In the meantime, many of your programming questions can be answered by referring to another Radio Shack book called "Problem Solving on the TRS-80 Pocket Computer"...
Page 5
Customers Besides being one of the smallest computers that Radio Shack provides, the TRS-80 PC-2 is one of the most powerful and versatile computers of its size available anywhere. Its powerful capabilities, as well as its "expandability", make it the ideal personal computer for business, scientific, engineering, or personal use.
Page 6
About This Manual This manualcontainsoperatinginstructionsfor the PC-2. The Language Reference Summaryincludesonly those command which canbe usedby the Computer w henit is not connected to an optionaldevice(suchasPrinter/ Cassette Interface). For a description of the commandswhich can be usedwith an optional device,seethat peripheral'soperation manual.
Page 7
Contents Customer Information.. Welcome to the World of Pocket Computing! 1/Description of the Pocket Computer . Keyboard Rear Panel Display 2/Setting Up the Pocket Computer ..13 Starting-Up Battery Installation External Power Supply 3/ Using the Pocket Computer .. Using the Keyboard PC-2 As A Calculator PC-2...
Page 8
Welcome to the World of Pocket Computing! The TRS-80 PC-2system consists of: A 66-Key keyboard for inputting programsand data into the Computer. A 26- character Display to exhibitdataresults andotherinformation.TheDisplay canalsobeused to exhibit graphics (7 X 156 dot pattern). An expanded BASIC Language that includesgraphic commands.
Page 9
1/Description of the Pocket Computer Before using the PC-2, it's important that you become familiar with it. Carefully read the following section. TRS-BO POWER Figure 1. PC-2 (Front View)
Page 10
When you'rereadyto turn theComputer O FF,press this key. Turns the PC-2 ON. If pressed whileyouarerunning a program, execution w ill ''break"(inter- rupt). Allows youto execute p rograms at linenumbers which have hadcertain k eys assigned to them as thefirst character of theline. Other keys permanently actascommand keys after ispressed.
Page 11
Subtraction Key. Allows you to subtract numeric values. Pressing before pressing this key will produce a comma (,). Addition Key. Allows you to add numeric values. Pressing before pressing this key produce a semicolon (;). Clear Key. Pressing this key will clear the Display and "release" errors. Pressing $8jÉj) before pressing CL will activate the CA (reset) function.
Page 12
Recall K ey. Pressing this keyonewill display thefunctionkeymenu for thecurrent r eserve m ode (1/11/111). Pressing this key againwill recallthe contentsof the originaldisplay. Pressing t his keywill advance t he Cursor,leaving a blankspace.Press ggjÉf) Spacerbar Key. beforepressing t his key andthe Exponential symbol w ill be produced andallowyouto raise a numeric expression to a power.
Page 13
BUSY SHIFT SMALL Figure 2. Sample PC-2 Display ProgramExecutionIndicator. This Indicatoris on during program execution. Whenprogram BUSY execution is complete, the Indicator goesoff. The PC-2will not turn off (manuallyby pressing or automatically after seven minutes) when the BUSY Indicator is on. @ SHIFT Shift Key Indicator.
Page 14
5 Operat Indicato This I ndicato will d isplay RUN w hen you are inthe RUN Mode. You must be inRUN Mode t oexecute ("run") p rograms orperform m anual calculations (use t he Computer like acalculator This Indicator willdisplay PRO when y ou are inPROgram Mode.
Page 15
Figure 3. PC-2 (Rear Panel) RAM/ROM Module Slot. Insert RAM or ROM Modulesinto this slot. Seeyour RAM/ROMModule user's gu ide for specific details. @ ALL RESE Button.If thePC-2 e ver " hangs up,' use aball-point pen to press thisbutton while pressing .
Page 16
(D Identificati Tag. Plac the permanentl adhesive Identification Tag h ere. 4 Batter Cove Remov this Cover togain a ccess tothe batteries which supply power tothe PC-2. Be careful notto lose thescrew which secures theCover; it isnotattached to theCover when removed. 5 Extern Powe Supply J ack.If youhave a nexternal power supply adaptor (optional/extra),...
Page 17
2/Setting Up the Pocket Computer Start-Up To turn the PC-2 on, simply pressthe key. The Computershouldrespond with the Readyprompt ( > ) andindicatorsthat tell you: • If the Computer waslast usedto compute degrees,radians,or gradients. • Which Operation Mode the Computer is in (PROgram,RUN, or RESERVE Mode). •...
Page 18
en the Comput isturned o n, t here a re four different power-up messages which c an bedisplayed: This messag canappearon power-upafter: Turningthe Computeron for the first time. • Battery replacement. • PressingALL RESET. To clear the Display and begin computing: Press 2.
Page 19
If this message appears, it means that one of the peripheral devices(such as a Printer/Cassette Interface) is not operating properly. Press CL to clear the display and continue computing. The Displaywill look like this on normal power-onandwhenoptional devices or memorymodulesareconnected. This is a sample display.
Page 20
Turning the Computer OFF you'r ready t oturn thePC-2 O FF, press the@ÉÉ) key.The Display willthen clear (be erased). If the BUSYindicator is on, pressBREAK beforepressing@ÉÉ) it is turned off, thePC-2 remembers programs, mode settings, Definable Keys, etc.thatwere being used theComput was t urned o n.When y ou turntheComputer back O N, t hose s ettings willbe displayed...
Page 21
Use a coin to carefully loosen the small screw which holds the Battery Cover in place. (Do not lose the screw!) Slide the Cover sideways until it is free from the Computer. Insert four Type AA alkaline batteries into place, matching the battery outline (in the battery slot of the Computer)
Page 22
thePC- ispowered by batteries. If theIndicator does notcome o n,replace thebatteries. If theIndicator still doesnot come on, check with your local Radio Shackstore. thatanexternal power supply will notrecharge thebatteries. When thebatteries arelow,replace t hem.
Page 23
3/Using the Pocket Computer You can start using your PC-2 as soon as it's been turned on. Since many symbols on the PC-2 keyboard are not common to other computers, this section will explain how to use the Computer keyboard. The PC-2 can also be used as a powerful calculator when in the ' 'immediate"...
Page 24
Using the Keyboard e PC- keyboar allows youtoenter allstandard textcharacters as well a smany s pecial key functions. Normal vs. Lowercase Option e PC- keyboar isusually i n Normal (uppercase only)Mode.Inthismode, allcharacters typed onthe keyboard will be uppercase. Toente theLowerca Mode, press .
Page 25
(e.g., CA) will reset the Computer. Resettingthe Computer by pressing @ , however, does not mean that the PC-2 will erase all programs and set all variables equal to zero as with most TRS-80's. All it means is that the Display and the memory "stack" will be cleared.
Page 26
• RESERV Mode where youassign v alues t o Function Keys andsetupFunction Keymenus. e Operati Mode I ndicator (on theDisplay) willtellyouwhich mode t heComputer isin. ss the keytoenter e ither P ROgram or RUN Mode (theIndicator willchange). Press MODE to enter RESERVE Mode. PROgram Mode Whene theOperati...
Page 27
its memory. Mode Once programs have been entered into the Computer's memory, you can run (execute) them in the RUN Mode. To enter the RUN Mode, press until RUN appears on the Display. Then type: . The Com- puter will go to the first program line number in memory and execute it. There are, however, a few ways to begin a program without typing RUN.
Page 28
r detail onusing t hePC-2 a s acalculator, see Using t hePC-2 A sA Calculator later i nthismanual. RESERVE Mode To entertheRESERVE M ode, p ress $iÉj) RESERVE w ill appear o ntheDisplay. I n thi s Operati Mode you can a ssig command statements orvalues toany ofthe Function...
Page 29
If a function key has not been assigneda value and you press it, the symbol above the key (!, # , $, etc.) will be displayed. To make a Function Key assignment: Be sure you're in the appropriate Function Key Mode (1/11/111)(press and the Indicator will go from I to II to III).
Page 30
r exampl youmight want t oassign theTIME statement to @ . Type TIME @(Remember that@ will servethe same function aspressing @iÉÉh) ) andthe Computerwill display: RESERVE Press Wheneve the Computeris in PROgram or RUN Mode(andReserve ModeI), andyou press , thecommand line will be displayed or executed immediately.
Page 31
In this instance, the menu lists the individual Function Keys (1 — 6) along with abbreviations that identify the complete value assigned to a particular key. Once a menu has been entered into the Computer's memory, you cannot edit or change that menu. To change the menu (e.g., if you add more values to Function Keys), you will have to re-type the entire menu for that Reserve Mode.
Page 32
youexittheRESERV Mode (forexample, goto RUN Mode), simply press ( TX)and themenus indicating the FunctionKeyassignments you havemade in eachRESERVE Mode will bedisplayed. Anothe methodletsyou check the contents s tored in eachkeyone-at-a-time. Justgointo a Reserve Mode (1/11/1 andpres a Function Key(such as @ ).
Page 33
Command Instruction Keys Command INPUT USING GOSUB CSAVE* MERGE* Table These commands will only be displayed if the PC-2 is connected to the optional/extra Printer/Cassette Interface. If you use these keys when the Computer is not connected to the optional device, a will appear.
Page 34
Program Line Number Definable Keys spACE Table Note that Definable Keys are divided accordingto rows. The top row of alpha-keyshavepermanentlyassigned progra statements; the bottomtwo rowsof alpha-keys (andtheequals keyandspacebar) areused for labeling program line numbers. For instance, y ou'll probablyusethe PRINTstatement s everal timesin asingle program.Instead of typing it over andover,just press CD whenyou'reready to use thestatement ina program line(or in immediate m ode).
Page 35
The Command Instruction Defined Keys may be specified in any of the Operation Modes (RUN, PRO, or RESERVE). If you are using the Computer by itself (e.g., the Computer is not connected to the Printer/Cassette Interface) and you press ($É) (CSAVE), CLD(CLOAD), or (MERGE), the Computer will display 'w".
Page 36
F.'EM Th i.S CüL4Plt.S t.ü 11--1. FOE: Tü 111.7 I .30 1411 When you cometo line 120in thisexample, t ype: 120 CD @ andtheComputer w ill display: Hint: you'rereadyto runthe program, setthe Computer i n RUNmode(press@é$untilRUNappears o n the Display); then press .
Page 37
commands, numeric values, etc.) you want. Function Keys can be assignedwhen the PC-2 is in the RESERVEOperation Mode. For instructions on assigning values to keys (Éj) , see RESERVE Mode earlier in this manual. Reserve Mode Change An additional Function Key feature is that the PC-2 really has 18 Function Keys, not just six. Pressthe CIS) key a few times.
Page 38
"toggle" the Displaybetween the programline you areworkingon or viewing,andthe menulinefor the current RESERVE Mode. To recallthe menu you createdfor a specific Reserve Mode (seeRESERVEMode),press . The menufor the current ReserveMode will be displayed. Press again and the program line you were currently typing in will be displayed and you can finish entering the line.
Page 39
(Pl) can be accessedfrom any of the Operation Modes. also has several other features. For instance, if you stop program execution (in RUN Mode) by pressing BREAK, the Display will indicate the program line in which the "break" occurred. go to PROgram Mode, then press (or (X) ).
Page 40
If thecurrent l ineisin themiddle of aprogram, pressingt willdisplay t henextlower n umbered program line. downwill activate a repeat function andtheComputer will scroll ' 'up" through theprogram until Holding C) the first program line is reached. Whenyou press SHIFT , the Computerwill display"vr¯ " (X) canbeused much thesame as except thatyoucannot single-step through aprogram bypressing...
Page 41
an underline ( Pressing@ will back the Cursor up one spaceand changeit to a blinking block ( Holding down will activate a repeat function and the Cursor will automatically move "backwards" until the first character in the line is reached. The Cursor can be backspaced in any of the Operation Modes.
Page 42
Ifyo u pres or t togo ontoanother program line, the Computer willnot r ealize you have changed aline. Anytimeaprogram isedited (changed), youmust p ress afterthechange! thatyoucan only delete o ne character atatime.If youwant t o erase twocharacters that a re next t oeach other,youwill have to position theCursor a ndpress twice.
Page 43
instance: ICIC!_ The underline is the "current" position of the Cursor and you need to insert the number 1 before TO. Press < until the Cursor is on top of the T (in TO). Press ($jÉj) and the Computer will push all characters including the character under the Cursor one more space to the right.
Page 44
PROgram Mode. Tabl 3 describe themathmatical functions t hePC-2 recognizes when you're using it asacalculator. PC-2 Mathematical Functions A TN (square root) Table...
Page 45
For a complete description of these functions, see a PC-2 programming guide. Table 4 lists the priority of operations the PC-2 uses. PC-2 Order of Mathematical Operations ) Any values enclosed in parentheses will be evaluated first. Retrievalofvajueöfrom yariables (Pl, ME Trigonometric functions (such as SIN, COS, TAN, etc.) will be evaluated next.
Page 46
First the expressionsin parentheses are evaluated: Next the functions are evaluated: Then the exponentiation is performed: Multiplication and division are then completed • Finally, addition and subtraction are performed: Arithmetic Calculations. You can perform all standardarithmeticfunctions (addition, subtraction, d ivision, multiplication,andexponentiation) w ith the PC-2 whileit is in the RUNMode.
Page 47
If you want to seethe original expression after you've pressed , press @ and the expression will appear on the left side of the Display and you can change (edit) or perform another calculation based on the expression. For example, if you want to know what 10 multiplied by 10 is without having to write a program, to enter the RUN Mode.
Page 48
type: and the PC-2will display the answer (64 in this case). Scientific Notation. Scientific notation is available simply by usingthe key. For example: CT¯D Trigonometr Functions ThePC-2 a llows y outo use thetrigonometric functions listed in Table 2 whenever it is in RUN Mode.
Page 49
To set the PC-2 to the appropriate Angle Calculation Mode: • To set the PC-2 to Degree Mode, type DEGREE and the Indicator will display DEG. In this mode, all angles are expressed in degrees. • To set the PC-2 to Radians Modes, type RADIAN ('Püj$) and the Indicator will display RAD.
Page 50
assign thevalue of 7to avariable n amed A and thevalue of 13to avariable n amed B . Youcan thenuse these variables in an equation such as: and the PC-2 will display: If youus e thearray format (n))where n isa numeric expression between 1and 26which specifies avariable storag location.
Page 51
The value you assign to variables will be retained until: or CLEAR is entered. • The values are changed by the execution of a program. e The variables are assigned new values. Recalling Values. Any time you need to recall a value assigned to a specific variable (A—Z), just type the variable (A, for instance) and press .
Page 52
exampl type A = 5 , then turntheComputer off (orletit turnitself o ff). Next, t urntheComputer onandtypeA . Thevalue youassigned to A (e.g., 5)will appear ontherightside of theDisplay. — one after Successi (Chained) C alculations. In some instances, youmaywantto perform several calculations —...
Page 53
(preceededby &) and press . The decimal equivalentwill be displayedon the right. For example: Press and the PC-2 will display: Combining Programming and Calculator Mode. Any valuesassignedto variablesin the RUN Mode can be used by the PC-2 when it is in the PROgrammable Mode. Press@é$ to enter the PROgram Mode and type in this one-line programwhich calculatesthe Averagemileageof a car (A) when you assign values to the variables: Then return...
Page 54
Next type: When the Ready prompt reappears, type: and the averagemileage(34.28571429) will be displayedon the right. Pocket Computer BASIC ThePC- recognize almost all standard B ASIC commands andstatements aswellasseveral non-standard BASIC keywords. Thissectionwill describe thosenon-standard B ASICcommands a ndstatements ( i.e.,thosecommands r ecognized If you're familiar with standard by the PC-2but not by mostother computers that usethe BASICLanguage).
Page 55
Note that most commands and statements can be abbreviated. For example, instead of typing GOTO, simply type G. followed by a line number. Keywords identified with an asterisk ( * ) will be described in this section. For details on all keywords listed, see Appendix A, a PC-2 programming guide or a BASIC language reference manual (such a problem solving on the...
Page 56
PC-2 Statements Abbreviation Statement Abbreviation Statement AREAD* NEXT ERROR CALL* PRINT RANDOM DATA REA. READ RES. RESTORE ERROR GOS. GOSUB STOP GRAD TROF. TROFF INPUT...
Page 57
PC-2 Statements Statement Abbreviation Statement Abbreviation TRON TRO. USING Table PC-2 Functions Function Abbreviation Function Abbreviation CHR$...
Page 58
PC-2 Functions Abbreviation Function Abbreviation Function MID$ PEEK STA. STATUS* POKE # * Table...
Page 59
AREAD Assign Display Contents to a Variable AREAD name name is numeric or character variable Abbreviations: AREA. When a definable key (see ) is usedto label and run a program,this statementwill assignthe Display contents to the variable name specified after AREAD. This allows you to input (assign) valuesto a variables without havingto usethe INPUT statement.
Page 60
To run this program,enterthe RUN Modeand,whenthe Readyprompt appears, t ype: and the PC-2 will display: NAME IAAI T ENI! you enterthe RUNMode andthe Ready promptisdisplayed, typea number whichrepresents thetotal for the year. Then press@ (Z) andthe PC-2will displaythe result. For instance, t ype: 1 •ztnr_}...
Page 61
and the PC-2 will display: MONTHLY AI.!EPAGE ARUN Automatic Program Execution on Start-Up ARUN Abbreviations: ARU. When ARUN is the first program statement in the first program line, the PC-2 will automatically execute (RUN) the program when you turn the Computer's power on.
Page 62
Example Set the PC-2to PROgramMode and enter the following program: FEINT When you press , the program Press to turn the Computer off. Press enter the RUN Mode. will automatically run.
Page 63
BEEP Turn Tone ON/OFF BEEP switch switch is ON or OFF. This statement turns BEEP tone ON or OFF. BEEP ON is effect after ALL RESET has been pressed or after the batteries have been removed from the Computer without first connecting an external power supply.
Page 64
BEEP Sound Tone BEEP number, frequency, duration numberis a numericexpression between0-65535andspecifies the numberof timesthe beepoccurs. frequenc is a numeric e xpression between 0-255 andspecifies thefrequency of thebeep.frequency i s optional; if omitted, 8 is used. durationisa numeric expression between 0-65279 andspecifies t he lengh of each beep.durationisoptional; if omitted, 160 is used.
Page 65
Example 11.7: WAIT BEEF CALL Execute a Machine-Language Routine CALL address, variable address is a numeric expression between 0-65535 and specifies the entry address of a machine-language program. variable is a numeric variable which has previously been defined. variable is optional; if omitted, machine-language subroutine...
Page 66
After execution of the called program is complete, it can RETurn to the BASIC program. If you includethe optionalvariable, the X register w ill bepointingat the location where the variable isstored. If variable is underfined before you use CALL, an ERROR 7 will occur. Notethat machine- language programs canonly be storedin the Primarymemorybuffer(see POKE#andPEEK #...
Page 67
lüü: CURSOR Position Cursor CURSOR position position is a numeric expression between 0-25 and specifies one of the 26 character positions available on the Display. position is optional; if omitted, O is used. Abbreviations: CUR. CURS. The CURSOR statement positions the Cursor at one of the 26 character positions on the Display.
Page 68
Example CURSOR NEXT Whenthis program is executed, the numberswill move acrossthe display from left to right. GCURSOR Selects Graphic Display Start Position GCURSOR position position is a numeric expressionbetween 0-155 decimal and specifies the dot column on the Display where printing will begin.
Page 69
GCURSORwill allow you to specifythe exactcolumnon the PC-2Displaywhereprinting will start. GCURSOR is like CURSOR but more precise. That is, CURSOR divides the Display into 26 columns; GCURSOR divides the Display into 156 columns. GCURSOR is most often used with GPRINT. For details on using GCURSOR with GPRINT, see GPRINT later in this manual.
Page 70
position 93) but it will betruncated(choppedoff) because it ran off the endof the Display. (Note: You could achievemuch the sameresult if you changedline 40 to: 40: CURSOR 16.) GPRINT Set Graphic Dots GPR INT pattern delimiter pattern delimiter . pattern is either a numeric expressionbetween0-127 decimal or a hexadecimal s tring which specifiesa combination of addressable dots on the Display.
Page 71
GPRINT can set or reset any dot (or pattern of dots) within the columns on the Display. For example, GPRINT 0 will turn all dots in a column off; GPRINT 127 (or GPRINT "7 F") will turn all dots in a column on. To specify which column, use GCURSOR.
Page 72
If youuse decimal numbers, youmust s pecify thedotsin terms of therows theyoccupy a sdescribed inTable 8. GPRINT Addressable Dot Numbering (Decimal) Column Table To turn on the Row 16 dot in a column (column 100, for instance),simply type (in RUN Mode):...
Page 73
and the fifth dot from the top of the Display in column 100 will be turned on. If you wish to turn on the dots in Rows 1 and 2, simply add the Row numbers together (1+2=3) and specify the sum. For example: and the first two dots in Column 100 witl light up.
Page 74
Forexample, t o forma box with a linethroughit like theonein Figure5: Figure 5 Mode)specifythe Column you wantthe first dot to bedisplayed in — Column140for First (in the instance. Rememb thePC-2 will automatically turnonthedotsin thenextcolumn (Column 141)if youseparate Row If youseparate R ownumbers w ithcommas ( ,), thePC-2 will leave a blankcolumn. numbers with semi-colons (;).
Page 75
If you use hexadecimal numbers to specify dots or combination of dots, you must think of the Columnsasbeing arranged as in Table 9: GPRINT Addressable Dot Numbering (Hexadecimal) Column Table In this arrangement,the seven rows are divided into a lower group of three rows and an upper group of four rows. Each group is numbered, from top to bottom, by powers of two.
Page 76
Of the two hexadecimal digits required,the first digit will represent the lowergroupandthe second digit will represent the upper group. Note that the lowergroup (1—4)must bespecifiedbeforethe uppergroup (1—8). To usehexadecimalnumberswith GPRINT, you must enclosethe numbersin quotesto createa string ("7F") or prefacethe numbersby the & sign (for instance,&7F). Table10describes t hedifferentpatterns that GPRINTcangenerate w henhexadecimal numbers areused:...
Page 78
To create a box (likethe onethatwasused in the previous e xample) butwithhexadecimal numbers, type(inthe Mode): GFF:INT and the box will be created. If youspecify asingle-digit Hexnumber, it mustbepreceded byazero(e.g., O Aislegal; A isillegal). Another way to accomplishthe samething is to usethe hexadecimalpreface&. For instance: •i.:rr,'..:•...
Page 79
To generate the same symbol but with hex numbers, type: LOCK/UNLOCK Locks/Unlocks Current Operation Mode LOCK UNLOCK This statement "locks" the PC-2 into the current Operation Mode (RUN, PROgram,or RESERVE). After LOCK is typed, you cannot change modes by pressing On initial start-up,the PC-2is not lockedinto any mode.
Page 80
Example To lock the PC-2 into the current Operation Mode, type: To unlock the PC-2 so you can change modes, type: PAUSE Print Message and Continue Execution Abbreviations: PAU. PAUS. PAUSE is a semi-automatic form of the PRINT statement. It holds whatever is on the Display for approximately one second and then goes on to the next program step.
Page 81
PAUSE hasa fixed delay value; PRINT hasa variable delay (SeeWAIT). Example In the following example,eachnumberwill be heldon the Displayfor approximately one secondbeforethe next number appears. Tü If-I PEEK* Returns Contents of address in Alternate Buffer PEEK # address address is numeric expression between 0-65535 and specifies a location in memory. Abbreviations: P E.
Page 82
a Primary buffer for program and data storage and an Alternate buffer for The PC-2 has two memory buffers data storage only. PEEK # returns (in decimal form) the value stored at the specified byte address of the Alternate buffer. The values returned represent an ASCII code.
Page 83
POINTwill return a numberbetween0-255. If Ois returned,then therearenot any dotsturned on in the specified column. If 255 (or 127) is returned,all of the dots in the specifiedcolumn areturned on. 255will be returnedif you specified GPRINT255or FF and127will bereturned if youspecified GPRINT127or 7F. The number the PC-2 returns will identify the dot pattern specified with GPRINT.
Page 84
0-255 decimal and specifies the ASCII value you wish to put into address. value may be repeated. POKE allows you to put values into specified memory locations. The PC-2usesPOKE just like other TRS-80's except you can use multiple values after a single address.
Page 85
POKE # Put Value Into Alternate Buffer Location POKE # address, value address is a numeric expressionbetween 0-65535 decimal and specifiesa memory location in the Alternate memory buffer. value is a numeric expression between 0-255 decimal and specifiesthe ASCII value you with to put into address.
Page 86
Example PüK.E# will store 20 in hexadecimal address 23FA. For a more detailed example of POKE # , see CALL. STATUS Check Memory Status STATUS number number is a numeric expression between 0-255. O returns the number of free bytes. 1 returns the number of bytes in use.
Page 87
STATUS is useful when you need to know how much memory the PC-2 has left for programming or how much memory you are using at any time. Example STATUS ü will display the number of free bytes. E,T AT LIE will display the number of bytes in use.
Page 88
TIME Set/Display Current Time TIME = month day hour . minutes seconds month is a number between 1—12 which specifies the month of the year. day is a two-digit number between 01 —31 which specifies the day of the month. hour is a two-digit number between 00—23 wh ich specifies the hour of the day.
Page 89
Example To set the time on July 28 as 11 A.M., type: .31.7Ü1 To display the current time, type: TIME and the PC-2 will display the time. For example: for September 12, 2:24:21 P.M. WAIT Specify Duration of PRINT WAIT delay delay is a numeric expressionbetween0-65535decimaland specifies the lengthof time the PRINT state- ment will be displayed.
Page 90
A WAIT statement should always precede a PRINT statement in your program. The lengthof time WAIT holdswhateveryou told the PC-2to print depends on the numberyou specify. e WAIT without a specified delay will wait for you to press • WAIT 0 causes the information to be displayed faster than you can keep up with it.
Page 91
Your PC-2 should provide you with years of trouble-free service. However, if you ever have problems with the Computer, check the symptom/cure table below. After that, if you still can't remedy the problem, contact your nearest Radio Shack store or computer center. Symptom Cure Can't change Operation Modes.
Page 92
5/Specifications CPU: CMOS 8-bit System ROM: 161<8 Memory Capacity: System Area: 0.9KB Fixed Memory Area: 0.6KB AS-Z$ BASIC Program/Data Area: 1.85KB Reserve Area: O. 19KB Expandable User Area: 161<8 (RAM. 22KB) Display: Dot LCD Display Display positions: 26 Columns Graphic display: 7 x 156 Dots Keyboard: 66 Keys...
Page 93
Power: 4 — Type AA Batteries (23—552) 9V DC Adaptor Expansion Capabilities: Plug-in RAM (41<8 RAM) Plug-in ROM/RAM (16KB ROM/2KB RAM) Dimensions: 195(W) x 86(D) x 25.50-1) mm Weight: Approx. 0.83 lbs. (375 g) (with batteries) 320 F Operating Temperature: 1040F (OOC-v 400C) 50 F 1310F (-150C...
Page 94
Appendix A/PC-2Language Reference Summary Argumentranges are indicatedbelowby specialletters: n: (-9.999999999 E-99, +9.999999999 E99) (0—255) str: string argument var: variable name Page Computes absolute value. Abbreviations: AB. Computes arccosine. Abbreviations: n 1 LIZ AREAD Assigns D isplay contents t o variable. M ustbeused witha Definable K eylabel. Abbreviations: A.
Page 95
Page Computes arcsine. Abbreviations: Computes arctangent. Abbreviations: BEEP switch Turns tone feature on or off. BEEP E.:EEP BEEP number, frequency, duration Sounds tone for specified number of times, frequency, and duration of each tone. Abbreviations: BEEP CALL address, var Calls the machine-language routine stored with specified entry address and will use specified variable values to execute.
Page 96
Page ErasesDisplay. El-S CONT Continuesexecution after BREAK or STOP. Abbreviations: C. CO. CON. Computes cosine. CURSOR position Display printing will startat oneof the26Display positions s pecified b y position. Abbreviations: CU. CUR. CURS. DATA expression Storesdatato beaccessed b y a READ statement. Abbreviations: DA. DAT. Converts d egrees, minutes, a ndseconds i nto decimal d egrees.
Page 97
Page Convertsdecimal degreesinto degrees,minutes, and seconds. Abbreviations: Computes natural antilog. (en) Abbreviations: Ends program execution. Abbreviations: E. EN. FOR .. TO .. STEP/NEXT Opens program loop. Abbreviations: STE. N. NE. Tü STEP GOSUB Transfers program control to the specified line. Abbreviations: GOS.
Page 98
Page GRAD SetsAngle Calculation to gradients. GPRINT pattern delimiter pattern delimiter ... Setsgraphicdots on the Display. Patter isbetwee 0-127; d elimiter isacomma orsemi-colon. Addreviations: GP.GPR. G PRI. GPRINT IF... THEN Tests conditional expression. Abbreviations: T. TH. THE. THEN INKEY$ Gets keyboard character if available. Abbreviations: INK.
Page 99
Page LEN (str) Returns the number of charactersin a string. Assignsvalue to variable (optional). Abbreviations: L E. LIST line Lists first program tine or specified line. Abbreviations: L. Ll. LIS. LIST lüü LOCK Locks in current Operation Mode. Abbreviations: LOC. Computes logarithm to base 10.
Page 100
Page MID$ (str, position, length) Takesa character(s) from the middle of the specifiedstring. Abbreviations: MID. Erasescurrent program from memory. NEWO Erasescurrent program and resetsthe Computer. ERROR GOTO Sets up an error-handling routine. Abbreviations: O. ER. ERR. ERRO. GOSUB Multi-way branch to specified subroutines. Abbreviations: GOS.
Page 101
Page Gets value in specified address from Primary memory buffer. PEEK address Gets value in specified addressfrom Alternate memory buffer. PEEK* address Abbreviations: PE. PEE. Returns value of Pl (3.141592654). Test dot pattern of specified column (0—155) on Display. POINT position Abbreviations: POI.
Page 102
Page PRINT USING Formatsstringsandnumbers for printing. Thewidthof anumeric fieldmust a lways beonemore thanthewidthof thedata. Formats numbers. Specifie Asterisk Fill of thespecified positions o f a Numbering fieldwhichdo not contain data. Decimal point. F'F..'I LIE I Displays a comma to the left of everythird digit left of thedecimal p oint. An extra # is required for each comma.
Page 103
Page RANDOM Reseeds the random number generator. Abbreviations: RA. RAN. RAND. RANDO. READ Reads value(s) from a DATA statement. Abbreviations: R EA. :REM Remark; instructs the PC-2to ignore the rest of the line. : REM RESTORE Resetsdata pointer to the first item in the data line. Abbreviations: RES.
Page 104
Page Executescurrent programor portion of it. Abbreviations: R. RUI. Returns sign component: —1, O, 1, if n is negative, zero, positive. Abbreviations: SG. Computes sine. Abbreviations: Computes square root. Abbreviations: STATUS number Checks the current memory status. number returns O = program steps available, 1 program steps used;...
Page 105
Page TIME month day hour. minutes seconds Sets or returns the current time. Abbreviations. TIM. TROFF Turn program trace off. Abbreviations: TROF. TRON Turn programtraceon. Abbreviations: TR. T RO. TE:üN UNLOCK Unlocks Operation Mode after it hasbeen locked. Abbreviations: I-IN. UNL. UNLO. UNLOC. (sto Converts a string to a number.
Page 106
Appendix B/PC-2 Error Codes Error Code Explanation Syntax Error. Incorrectly typed statement. Statement Without @FOR. READ statement without a DATA. Array variablealrea<si exists, Array specified without first DIMensioning it. I IJegaVVA/i@bfe nårne, DIMensioned array has more than two levels. Ärråysubscriptuxeee array s pecified Statement, Out of memory.
Page 107
Error Code Explanation Numberof arguments is inappropriatefor expression. There i snotaparenthesis following the@ when fixed memory array v ariables were specified. There isnotenough m emory a vailable t o load theprogram thatisloading. Command cannot be executed in the current mode. INPUTor AREADstatements h avebeenused asvariables o r a command hasbeen Line number is greater than 65535.
Page 108
Radio Shack reserves t henghttorefuse toservice theequipment ortovoidany remaining warranty on the equipment 2. If any Radio Shack computer equipment has been modified so that It is not within manufacturer'sspecifications,inciuding.but not Pmltedto. the installaton of any non-Radio Shack parts.cornponents,or replacementboards, then Radio...
Need help?
Do you have a question about the TRS-80 and is the answer not in the manual?
Questions and answers