Ruble of Contents INTRODUCTORY NOTE CHAPTER 1. HOW TO USE THIS MANUAL, repairer. B CHAPTER 2. INTRODUCTION TO THE .. Description of System Description of Revs. . ., Description of Display . . .. ALL RESET Button. .. Cell Replacement . CHAPTER 3. USING THE PC1251 AS A CALCULATOR Start Up .bovine s . Shut Down. Auto OFf . Some Helpful Arms Simple Calculations . . Recalling Entries . Errors. .. Serial Calculations Negative Numbers . . Compound Calculations and Parentheses . . Using Variables in Calculations.
Tabla of Constants Relational Expressions . .. Logical Expressions . . Parentheses and Operator Precedence Calculator Mode . . Functions CHAPTER 5. PROGRAMMING THE PC-1251. Programs Begin ring to Program on the PC-1281. | Example 1 — Entering and Running Program . Example 2 — Editing a Program Example 3 — Using Variables in Programming . Example 4 — More Complex Programming Storing Programs in the PC-1251's Memory . CHAPTER 6. The DEF Key and La belled Programs . Reserve Mode . Templates .. CHAPTER 7.
Pseudo variables Numeric Functions . String Functions . CHAPTER 8. PROGRAMMING EXAMPLE! Loan Payments . Riot Machine Simulation. Federal Tax Estimator Relationship of Two Variables. Minefield Game. CHAPTER 1@. TROUBLESHOOTING Machine Operation ..o -onv . BASIC Debugging CHAPTER 11. MAINTENANCE OF THE PG-1251 .. APPENDICES Appendix A: Error Messages .. Appendix B: ASCII Character Code Chart . . . Appendix C: Formatting Output . ..
introductory Note Welcome to the world of SHARP owners! Few industries in the world today can match the rapid growth and technological advances being made in the field of personal computing, Computers which just a short time ago would have filled a huge room, required a Ph. D. to program, and cost thousands of dollars, now fit in the palm of your hand, are easily programmed, and cost so little that they are within the reach of nearly everyone.
How to Uss This Anal ‘ CHAPTER 1 8 HOW TO USE THIS MANUAL This manual is designed to introduce you to the capabilities and features of your PC-1251 and to serve as a valuable reference tool. Whether you are a “first time user’” or an Old hand™ with computers, you should acquaint yourself with the PC-1251 by reading and working through Chapters 2 through 6.
How to Use This Manual * Chapter 11 — The care and maintenance of your new computer. Detailed Appendices, at the end of the Manuel, provide you with useful charts, comparisons, and special discussions concerning the use and operation of the PC-1251.
Introduction ta the PC-1251 CHAPTER 2 "INTRODUCTION TO THE. PC-1251 The SHARP PC-1251 system consists B-character keyboard. 24-character display. Powerful BASIC in 24KB ROM. 8-bit COS processor. 4KB RAM, Optional CE-125 Printer/Microcassette Recorder. -@m@an-n fEDEERORCDEKMEE0 To familiarize you with the placement and functions of parts of the PC-1261 keyboard, we will now study each section of the keyboard. For now just locate the keys and read the description of each.
Introduction to the PC-1251 | DESCRIPTION. OF KEYS NS i~ = spc peafowl ENTER [DEAF] (ST ( [ [Z7] Alphabet keys. You are probably familiar with these keys from the standard typewriter keyboard. On the PC-1251 display, the characters always appear in the upper case. Equals key. On the PC-1257 this key is not used to indicate the end of a calculation; in BASIC programming this symbol has a special function, S Pace key. Pressing this key advances the cursor fearing a blank space.
{BRK Introduction to the PC-1251 Up Arrow key. Press this key to display the previous program line, Pressing [59FF] before pressing this key produces a right parenthesis. Backspace key. This key allows you to move the cursor 1o the left without erasing previously typed characters, Pressing [Amer) before pressing this key will DE Lee whatever character the cursor is “on top of . Forward key, This key allows you to move the cursor to the right without erasing previously typed characters.
introduction to the PC.1251 w5 19 Use this power slide switch to turn ON and OFF the PC-1251. Notice that the machine is ON when this switch is positioned in any one of thees modes, RUN, Program, and Re Serve. (8]~ (93] Number keys. The layout of these keys is similar to that found cA eL wal 0 > =] £xp, T on the standard calculator. Clear key. Pressing Clear erases the characters you have just typed in and “release’” errors. Pressing [SHIFT] before pressing this key activates the CA {reset) function.
Introduction to 1he PC-1251 e BUSY P DEF DEGRADE The liquid crystal display of the SHARP PC-1251 shows up to 24 characters at one time. Although you may input up to 80 characters including {Fa Er] in one line, only the first 24 characters are displayed. To review the remaining characters in a line, move the cursor to the far right and the display will ‘scroll’ — that is as characters drop off the left, new characters appear on the right. The display consists of: BUSY DEF DEGRADE SHIFT The prompt.
Introduction to the PC-1251 ALL RESET: Reset button. This button is used to reset the computer when Clear or CA is not sufficient to correct the problem. NOTE To reset the PC-1251 hold down any key on the keyboard and simultaneously press the RESET Hutton on the back. This preserves all programs, variables, and reserve armory. RL‘SE‘t bitten Press the ALL RESET button with) any pointed object such as a ballpoint pen. Do oot use sadly broken points such as mechanics! \ pencils or the tips of neediest, Hold d
Introductory Note PG-1251 . contrast Control Turn the control in the direction ot the arrow for the clearer display, and urn it in the opposite direction for the dimmer display. Adjust it so that tae display i easy to see. CELL REPLACEMENT The PC-1251 operates on the lithium cell alone. When connected to the CE-125, the PC-1251 can also he supplied from the CE-125 if it has enough power voltage and the lithium cell power decreases.
introduction to the PC-1251 {1} Turn off the computer by setting the power slide switch to the OFF position. {2) Remove the screws from the back cover with a small screw driver, {Fig. 1} (3] Remove the cell cover by siding it in the direction of the arrow shown in Figure 2. e Cell cover {5) Replace the cell cover by sliding it in the reverse direction of the arrow shown in figure 2.
Introduction to the PC1251 (B} Hulk the claws of the back cover anti the slits of the computer proper. (Fig. 4} Fig. 4 {7} Push the back cover in slightly while replacing the screws. {8} Turn on the computer by setting the power slide switch to the ON position and press the RESET button to clear the computer, “The display should look Ike this: L Prompt symbol If the display is blank or displays any other symbol than the prompt . remove the cells and install them again, then check the display.
Using the PC-1251 a5 a Calculator Now that you are familiar with the layout and components of the SHARP PC-1251, we will begin investigating the exciting capabilities of your new computer. Because the PC-1251 allows you the full range of calculating functions, plus the increased power of BASIC programming abilities {useful in more complex calculation, it is commonly referred to as a “‘smart”’ calculator.
Using the PC-1251 as a Calculator The PROMPT {3} tells you that the PC-1251 is awaiting input. As you enter data the prompt disappears and the CURSOR moves to the right indicating the next available location in the display. The right and left (& arrows nave the cursor within a line.
Using the PC-1251 as a Calculator ot Di spay. 051 109. 060 [Enter] 609. 190, 6.283185307 | (82 [A) [Enter 3. Beetle o & ] Even after the PC-1251 has displayed the results of your calculation, you ean re display our last entry. To recall, use the left (4] and right {® arrows. The left arrow character. recalls the expression with the cursor positioned after the last The right arrow [ recalls the expression with the cursor positioned “on top of” the first character.
Using the PC-1251 as » Calculator On second thought you decide that groups containing an odd number of participants might be more effective. Recall your last entry using the [« arrow, Input Display =] 300/6— To calculate the new number of groups you must replace the six with an odd number. Five seems to make more sense than seven. Because you recalled using the 47 arrow, the cursor is positioned at the end of the display. Use the [lto move the cursor one space to the left.
Using the PC-1261 as a Calculator Even a tired, overworked manager like you realizes that 6 does not seem o be a reasonable result when you are dealing with hundreds of people! Recall your entry using the input Display ] 3o0/5 Because you recalled using the (B the flashing cursor is now positioned ova the first character in the display, Te correct this entry vou wish to insert an added zero.
Using the PC-1251 as 3 Calculator The results seem much too large. |t you only have 308 people attending the meeting, how could you have 688 “small groups™? Recall your entry using the [# Input Display =l 2000/5 The flashing cursor is now positioned over the fists character in the display. To correct this entry eliminate one of the zeros. Using the (@ move the cursor to the first zero {or any erode. When deleting a character, you position the cursor “‘on top of the character to be deleted.
Using the CF-1251 a3 a Calculator Recalling your last entry is essential when you get the dreaded ERROR message. Let us imagine that, unintentionally, you typed this entry into the PC-1251; Input. Display (BB (8077 (7050 [even ERROR 1 Naturally you are surprised when this message appears! ERROR 1 is simply the computer’s way of saying, “I don't know what you want me to do here”, To find out what the problem is, recall your entry using either the (0 or (5] arrow.
Using the PC-1251 as a Calculator Of this amount you plan to use 15% for the final night's awards presentation. When performing serial calculations it {s not necessary to retype your previous results, but DO NOT Clear between entries. What is the awards budget? Input. Display. 45000, x, 15_ Nat ice that as you type in the second calculation { % . 16}, the computer automatically displays the result of your first calculation at the left of the screen and includes it in the new calculation.
Using the PC-1251 as a Calculator Since you want the awards dinner to be really special, you decide to stay with the planned agenda and spend the additional money. However, you wonder what percentage of the total budget wife be used up by this item. First, change the sign of the remaining sum: 675,021 | (Enter] ) 676. Now you add this result to yer original presentation budget: HEm® 7425, Dividing by 450@4 gives you the percentage of the total budget this new figure represents: Input Display (2] {ENTER 9.
Rising the PC-1251 as & Calculator t When performing compound calculations, the PC-1257 has specific rules of expression evaluation and operator priority {see APPENDIX DJ. Be sure you get the calculation you want by using parentheses to clarify your expressions: (675+675@) / 45000 or / 45080) To frustrate the difference that the placement of parentheses can make, try these two examples: Input Display (85 (00 080 Safes) $.165 o718 [ENTER) 6 071 817 (a1 (5) (B 675.
Using the PC-12851 a5 a Calculator Input Display R (=102 [ (ENTER) 387575, As you press the PC-1251 performs the calculation and displays the new value of R. You can display the current value of any variable by entering the alphabetic character it is stored under: input Display [ENTER| 37575, You can then perform calculations using your variable. The value of (R) will not change until you assign it a new value.
Using the CF-1251 as a Calculator There are certain limitations on the assignment of variables, and certain programming procedures which cause them to be changed. See Chapter 4 for a discussion of assignment, See Chapter § for a discussion of the use of variables in programming. In addition to combining several operators in ane calculation, the PC-1251 also allows you to perform several calculations one after the other — without having to press [ENTER] before moving on.
Concepts and Terms of BASIC In this Chapter we will examine some concepts and terms of the BASIC language. Because the PC-1251 uses many features of BASIC when used as a calculator some of these concepts are also useful for advanced calculator functions. in Chapter 3 you entered simple numbers for use in calculations, without worrying about the different ways that numbers can be represented, or the range of numbers that the SHARP PC-1251 can process.
Concepts and Terms of BASIC 1234 becomes 1.234 times 10% {3 places (o the right} 654321 becomes 6.54321 times 10° (5 places ta the right} 30125 becomes 1.25 times 187 {4 places to the left) Scientific notation is useful for menu shortcuts. You can see that it would take a lot of writing to show 1.8 times 18%7 — a 1 and 87 zeros But, in scientific notation this number looks like this: 1.
Concepts and Terms of BASIC The decimal system is only one of many different systems to represent numbers. Another which has become quite important when using computers is the hexadecimal system. The hexadecimal system is based on 16 instead of 10. To write hexadecimal numbers you use the familiar @ ~ 9 and B mare “digits”: A, B,C, D, E, and F. These correspond and 15.
Concepts and Terms of BASIC In addition to constants, whose values do not change during a program, BASIC has variables, whose values can change, Variables are names used to designate locations where Information is stored, These variables are like the letters used in algebraic equations. Just as there are numeric and string constants, there are numeric and string variables. Simple Numeric Variables You have already used simple numeric variables when working with the PC-1251 s a calculator in Chapter 3.
Concepts and Terms of BASIC Arrays are created using the DIM verb or command, To create an array you give its name and its size: DIM X {5} DIM Y (32) Note that DIM X(5) actually creates an array with six entries: X{® Xi X{20 X3 x@ X5 Similarly DIM Y(2, 2) creates an extra @ row and s extra @ column: Y@ Yi0.
Concepts and Terms of BASIC Loc. Num. Var. Str. Var. Num, Arr. Var, Str, Arr, Var. Al2) Aka) 3 C c8 Al3} A(4) 23 w w$ A{23) 2% X X$ Algal} 25 Y Y5 Algal) 26 z z$ A(26) NOTE: There are only twenty-six locations and you must be careful not to use the same location in two different ways. 1 you use location 24 to store a numeric value in X and then try to print X§, vou will get an Error 9.
Concepts and Terms of BASIC The PC-1251 has five numeric operators. These are the arithmetic operators which you used when exploring the use of the PG-1251 as @ calculator in Chapter 3: + Addition Subtraction * Multiplication / Division ~ Power A numeric expression is constructed in the same way that you entered composition calculator operations.
Concepts and Terms of BASIC NOTE: String quantities and numeric quantities cannot be combined in the same expression Unless one uses one of the functions which convert a siring value into a numeric value or vice versa: 157 + 10 is Hegira! 157 4T is 1516, not 28" Relational Expressions A relational expression compares two expressions and determines whether ihe stated relationship is True or False.
Concepts and Terms of BASIC Logical expressions are relational expressions which use the operators AND, OR, and NOT.
Concepts and Terms of BASIC Thus, 1 is inverted to 0, and 0 to 1 for each bit, which is called 1o take negative Then, the following will result when 1 and NOT 1 are added together: (1} + ITIIITIT1716 (NOT 1) Tt Thus, all bits become 1. According to the above number list, the bits become —1 indecision notation, that is 1+ NOT 1= —1. The relationship between numerical value X and its negative {NOT X) is: X +NOT X=-1 This results in an equation of NOT X = —X~1 ie.
Concepts and Terms of BASIC If you are a proficient programmer, there are certain applications where this type of operation can be very useful. Beginning programmers should stick to clear, simple True or False relational expressions, When evaluating complex expressions the PC-1251 follows a predefined set of priorities which determine the sequence in which operators are evaluated.
Concepts and Terms of BASIC LOG is a function which computes the fog to the base 16 of its argument. LOG (108) is 2 LOG {1000} is 3 A function can be used any place that a variable can be used. Many functions do not require the use of parentheses: LOG 108 is the same as LOG (198} When you use a function as part of the argument to the same function, you must tse parentheses: SIN {SIN) not SIN SIN 3@ You must also use parentheses for functions which have mare than one argument.
Programming the PC-1251 in the previous chapter we examined some of the congests and terms of the BASIC programming language. In this chapter you will use these elements to create programs on the PC-1257, Let us reiterate however, this is not a manual on how to program in BASIC., What this chapter will do is familiarize you with the use of BASIC on your PC-1251. A program consists of a set of instruction to the computer, Remember the PC-1251 is only a machine.
Programming the PC-1251 1¢: PRINT "HELLO" 2¢: READ B (18} 30: END Some statements require or allow an operand: 1¢; PRINT “HELLO™ 20: READ B{18} 30: END Operands provide information to the computer telling it what data the veil will act upon, Some verbs require operands, with either verbs they are optional. Certain verbs do not allow operands. (See Chapter 8 for a complete listing of BASIC verbs and their use an the PC-1261).
Programming the PC-125% After all your practice in using the PC-1251 as a calculator you are probably quite at home with the keyboard. From now on, when we show an entry, we will not show every keystroke. Remember to use to access characters above the keys and END EVERY LINE BY PRESSING THE [EWER] KEY, Now you are ready to program! Set the slide switch to the Program mode and enter this command: Input Display NEW | The NEW command clears the PC-1257s memory of all existing programs and data.
Programming the PC-1251 Example 2 — Editing a Program Suppose you wanted to change the message that your program was displaying, that is you wanted to edit your program. With a single line program you could just retype the entry, but as you develop more complex programs editing became a very important component of your programming. Let’s edit the program you have just written, Are you still in the RUN mode? If so switch back 1o the Program mode., You need 1o recall your program in order to edit it.
" Programming the PC-1251 This is a new kind of error message. Not only is the error type identified {our old friend the syntax error} but the Lina number in which the error occurs is also indicated. Switch back into the Program mode. You must be in the Program made to make changes in a program. Using the 1, recall the fast line of your program. Input Display t 10:PRINT “GOODBYE" The flashing cursor is positioned over the problem area.
Programming the PC-1251 Remember to press [ENTER] so the correction will be entered into the program., NOTE: If you wish to Delete an entire line from your program just type in the sine number and the original line will be eliminated, Example.3 — Using Variables in Programming If you are unfamiliar with the use of numeric and string variables in BASIC, reread these sections in Chapter 4, Using variables in programming allows much more sophisticated use of the PC125%'s computing abilities.
Programming the PC-1251 As your programs get org complex you may with to review them before you begin execution. To gook at your program, use the LIST command. LIST, which can only be used in the Program made, displays programs beginning with the fewest line number. Tey listing this program: Input Display LIST 16: INPUT Use the {17 and 32 arrows to move through your program until you have reviewed ihe entire program.
Programming the PC-1261 When you have stopped & program using the esx key, you can restart it using the CONT command. CONT stands for Continue. With the CONT command the program will restart on the line which was being executed when the s key was pressed. Example-4 — More Complex Programming The following program computes N Factorial (NI}, The program begin with 1 and computes N1 up to the limit which you enter. Enter this program.
Programming the PC-1261 You may use any numeric variable in a FOR/NEXT lap. You also do not have ta start counting at 1 and you can add any amount at each step. See Chapter 8 for derails. We have labeled this program with line numbers starting with 19¢. La belling programs with different line numbers allows you to have several programs in memory at one time.
Shortcuts TN SHORTCUTS The PC-1261 includes several features which make programming more convenient by reducing the number of keystrokes required to enter repetitive material, One such feature is in the availability of abbreviations for verbs and commands {See Chapter 8} This chapter discusses two additional features which can eliminate unnecessary typing — the DEF key and the Re Serve mode. O e Often you will want to store several different programs in the PC-1251's memory at one time.
Shortcuts Dead ; Brother time saving feature of the PC-1251 is the Re Serve mode. Within the memory of the PC-1281, 47 characters are designated for “Reserve Memory™, You can use this memory to store frequently used expressions, which are then recalled by a simple two keystroke operation, NOTE: You store the strings in the Re Serve mode and recall them for use in the RUN and Program modes.
Shortcuts Immediately the word "PRINT’ will appear in the display after the line number. Any character sequence can be stored in Re Serve Memory. The stored strings can be recalled at any time in either the Program or the RUN mode by typing (she T and the key that the string is stored under. The keys available are the same as those sad with DEF, i.e., those in the dark area of the keyboard.
Printer/Micracassette Recorder The CE-125 Printer/Microcassette Recorder altos you to add a printer and micro cassette recorder to your SHARP PC-1251 Pocket Computer. The CE-125 features: * 24 character wide thermal printer with approximately 48 fine per minute print speed. Convenient paper feed and tear bar, Simultaneous printing of calculations as desired, Easy control of display or printer output in BASIC.
Printer/Microcassette Reorder EXTERNAL PLAYBACK UNIT; CASSETTE CONNECTION JACK COMPARTMENT TAPE COUNTER RESET BUTTON TAPE COUNTER AC ADAPTER CON‘NECK'! PRINTER o Semitic Cotangent o sofas | 5 STOP/EJECT PAPER FEED KEY BUTTON PRINTER SWITCH FAST-FORWARD LOW BATTERY INDICATOR BUTTON { 44} REMOTE SWITCH REWIND BUTTON CONNECTOR PLAY BUTTON RECORD BUTTON (s} PRINTER/MIGROCASSETTE RECORDER (Front view) In the lower left comer of the machine is the cradle where you will connect the PC-1251 1o the CE-125.
Printer/Microcassette recorder The CE-125 is powered by a rechargeable Ni-Cad battery. It is necessary to recharge the battery when the low battery indicator comes ON. To recharge the battery, turn the computer and printer/recorder power OFF, connect the AC adapter (EA-23E) ta the printer/recorder, and plug the AC adapter into & wall outlet. It will take about 15 hours before the battery is fully changed.
Printor/Microcassette Recorder Always connect the recharge to the CE-125 first. Then plug the recharge into the wall socket. When the batteries in the CE-125 become discharged, the low battery indicator on the front of the unit lights up and the unit will not function. At this point you must recharge the batteries. When you first receive your CE-126 it Is likely that the batteries will have inadequate charge due to storage. The unit will require charging before its first use.
Primtar/Microcassette Recorder 3. Place the upper edge of the computer into the “cradle” so that the Printer/ Recorder guides match-up with the computer guide slots. 4. Lay the computer down flat. 6. Gently slide the computer to the left so that the pins on the Printer/Recorder are inserted into the plug on the computer. DO NOT FORCE the computer and Printer/Recorder together. If the two parts do nat mate easily, STOP and check to see that the parts are correctly aligned, 6.
Printer/Microrassetie Recorder Loading the Paper {1} Turn off the printer switch, {2) Open the paper cover. {Fi . Paper cover (3) Insert the leading edge of the roll of paper into the slot located in the paper tape compartment. {Fig, 2} {Fig. 3} NOTE: Use of irregular paper rope may cause \oar tapas coll irregular paper feeding o paper misted. @ Therefore, be sure 1o tighten the roll before using as shown in the figure.
Printer/Microcassetts Reorder {8} Install the roil of paper into the compartment, {6} Close the paper cover. (Fig. 5} Paper cover All of paper necessary to remove the paper, cut the paper on the paper roll compartment side and pull the remaining paper through the printer in the direction of normal paper movement. Do not pull the paper backwards as this may cause damage to printer mechanism, CAUTION: Paper taps is available wherever the CE-125 is sold.
Printer/Microcassette Recorder Programs which have been written with PRINT can be converted to work with the printer by including a PRINTMAKING statement in the program (see Chapter 8 for details). All PRINT statements following this statement will act as if they were PRINT statements. PRINT=PRINT will reset this condition to its normal state.
Printer/Microcassatte Recorder B UNLOADING THE CASSETTE TAPE 1. Depress the STOP/EJECT button to open the cassette compartment lid and remove the tape. 2. Press the cassette compartment lid down. Note: In the PLAY mode press the STOP/EJECT button once to stop the tape movement. Press it again to eject the tape. Use the manual controls for positioning the taps. Set the ‘REMOTE’ switch to QFF.
Printer/Microcassette Recorder \When a program or data is recorded on tape it will be preceded by a high pitched tone ot approximately 7 seconds. This tone serves to advance the tape past any leader and ta identity the beginning of each program or set of data. NOTE: Whenever you wish to read in something from tape, it is essential that the tape he positioned on ane of these leader tone areas. When searching for a filename, the Ape can read only in a toward direction.
Printer/Microcassette Re carder Be sure that the power is OFF on both units when connecting or disconnecting the CE-126 and the PC-1261, The printer should be operated on a level surface. The CE-125 should be kept away from extreme temperatures, moisture, dust, and loud raises. Use a soft, dry cloth to clean the CE-125, DO NOT use solvent or a wet lath. Keep foreign objects out of the CE-128. Clean tape heads periodically with any standard head cleaning kit.
Printer/Micracassette Recorder {longer than 7 characters, the excess is ignored. A good practice is to maintain a program log, which includes the program name, starting and stopping location on tape {use the counter numberless, and a brief description of what the program does. Press the[ERTERJkey. At this time you should hear s shrill buzzing sound, and the tape should be turning. Else the “BUSY" indicator should light up.
Printer/Microcassette Recorder 3. Transfer from Tape {1} Turn off the REMOTE switch. {2} Set the tape with contents for transfer recorded onto the tape recorder. While reading the tape counter, advance the tape to the vicinity of a position where the contents for transfer are recorded, {3} Press the PLAY button { 4} of the tape recorder ta make playback ready.
BASIC Reference CHAPTER 8 BASIC REFERENCE The following chapter is divided into three sections: Commands: Instructions which are used outside a program (o change the working environment, perform utilities, or control programs. Verbs: Action words used in programs to construct BASIC statements. Functions: Special operators used in BASIC programs to change one variable into another. Commands and verbs are arranged alphabetically.
BASIC Reference Control and Branching CHAIN END FOR...TO.. STEP Go Sub GOT IF THEN NEXT OGN ...Goo Sub ON.
BASIC Reference Pseudo variables Numeric Functions PINKEYE ABS MEM ACS Pl ASN ATN String Functions 08 ASC DEG CHRIS DMS LEFTS$ EXP LEN INT MID$ LOG RIGHTS LN STRUT RND VAL SGN SIN SOR TAN 87
Commands CLOD 1 CLOD 2 CLOD “filename” Abbreviations: CLEW, COLA. See also: CLOACA, CAVE, MERGE, PASS The CLOD command is used to goad a program saved on cassette tape.
Commands CLOD? 1 CLOD? 2 CLOD? “filename"” Abbreviations: GL0O.7, COLA? See also: CLOD, CAVE, MERGE, PASS The CLOD? command is used to compare a program saved on cassette tape with one stored in memory. |t can only he used with the optional CE-126 Printer/ Micro cassette Recorder. e The first form of the CLOD? command compares the program stored in memory with the first program stored an the tape, starting at the current position.
Commands CONT 1 CONT Abbreviations: C., CO., CON. See also RUN, STOP verb e The CONT command is used to continue a program which has been temporarily halted. When the STOP verb is used 1o halt a program during execution, the program can be continued by entering CONT in response to the prompt, When a program is halted using the Tex key, the program can be continued by entering CONT in response to the prompt, ‘: p CONT Continues an interrupted program execution.
Commands CAVE l 1 CAVE 2 CAVE “filename” 3 CAVE , “password” 4 CAVE “filename, “password” See also: CLOD AD, CLOACA, MERGE, PASS Abbreviations: CS., CS, GAY. The CAVE command is used to save a program to cassette tape. it can only be used with the optional GE-125 Printer/Microcassette Recorder.
Commands Go To 1 GOT expression Abbreviations: G., GO, GOT, See also: RUN [ The GOT command is used to start execution of a program. The GOT command can be used in place of the BUN command to start program execution at the line number. specified by the expression. GODOT differs from RUN in five respects: 1) The value of the interval for WAIT is not reset. 2) The display format established by USING statements is not cleared, 3} Variables and arrays are preserved. 4} PRINT = PRINT status is not reset.
Commands LIST 1 LIST 2 LIST expression i Abbreviations: L., LL, LIS See also: LILTS The LIST command is used to display a program. The LIST command may only be used in the Program made. The first form of the LIST command displays the statement with the lowest line number. The second form displays the statement with the nearest line number greater than the value of the expression. The Up Arrow and Down Arrow keys may then be © used to examine the program.
Commands LILTS 1 LILTS 2 LILTS expression 1, expression 2 Abbreviations: LL., LLI, ILLS. See also: LIST The LILTS command is used for printing a program on the optional CE-125 Printer/ Micro cassette Recorder. U The LILTS command may only be used in the Program mode. The first form prints all of the programs in memory.
Commands MERGE 1 MERGE 2 MERGE “filename" Abbreviations: REM, GERM. See also: CLOD, CLOACA, CAVE, PASS verb “The MERGE command is used to load a program saved on cassette tape and merge it with programs existing in memory, ft can only be used with the optional CE-125 Printer/Microcassette Recorder. The first form of the MERGE command loads the first program stored on the tape starting at the current position and merges it with programs already in memory.
Commands MERGE Now type: MERGE “DEPT” and press [g The computer will new load “DEPT” into memory IN ADDITION to the above program, After “DEPT” is loaded, you might find something in memory similar to this: 20: INPUT “ENTER METHOD: "DEPT” : REM >> SECOND MODULE << | 20: PRINT “INTEREST CHARGES" 30: INPUT “AMOUNT BORROWED: * ; B [»10: PRINT “DEPRECIATION ALLOWANCE" {etc} Note that unlike the CLOD command, the new program DD NOT replace the existing one and that some fine numbers have been duplicated, Also no
Commands MERGE 70 7" REM THIS (S MERGED PROGRAM 20 INPUT “ENTER DEPRECIATION: INPUT “NUMBER OF YEARS: Ete 1 Now you may make changes to the above program since it was the last MERGED portion. LINKING MERGED MODULES (programs) TOGETHER Since the processor executes your program lines in logical sequence, it will stop when it encounters a beak in the sequence in ling numbering, Le.
Commands NEW ] 1 NEW Abbreviations: none The NEW command is used to clear existing program or reserve memory. When used in the Program mode the NEW command clears alt programs and data which are currently in memory. When used in the Re Serve mode the NEW command clears all existing reserve memory. The NEW command is not defined in the RUN mode and will results inn ERRORS.
Commands PASS 1 PASS “character siting” Abbreviations: none See also: CAVE, CLOD The PASS command is used to set and cancel passwords. Passwords are used ta protect programs from inspection or modification by other users. A password consists of a character string which is no mare than seven characters long. The seven characters must be alphabetic or one of the following VHES%EL Tkt i Once a PASS command has been given ihe programs in memory are protected.
Commands Verbs RUN AREAS 1 RUN 2 RUN fine number Abbreviations: R., RU. See also: GOT The first form of the RUN command executes a program beginning with the lowest numbered statement in memory. The second form of the RUN command executes a program beginning with the specified line number, RUN differs from GOT in five respects: 1) The value of the interval for WAIT is reset. 2} The display format established by USING statements is cleared.
Verbs AREAS The AREAS verb is used to read in 2 single value to a program which is started using the DEE key.
Verb BEEP 1 BEEP expression Abbreviations: B., BE., BEE, The BEEP vert is used to produce an audible tone. i The BEEP verb causes the PC-1251 to emit one or more audible tones at 4 kHz, The number of beeps is determined by the expression, which must be numeric. The expression is evaluated, but only the integer part is used o determine the number of beeps. BEEP may also be used as s command using numeric literals and predefined variables.
Verbs CHAIN 1 CHAIN 2 CHAIN expression 4 CHAIN “filename”, expression Abbreviations: GH., TEA, TEAL See also: CLOD, CAVE, and RUN The CHAIN verb is used to start execution of a program which has hen stored on cassette tape. 1t can only be used in connection with the optional CE-125 Printer/ Micro cassette Recorder. To use the CHAIN verb one or more programs must be stored on cassette. Then, when the CHAIN vert is encountered in a running program, a program is loaded from the cassette and executed.
Verbs CHAIN For example, let's assume you have thees program sections named PRO-1, PRO~2, PRO-3. Each of these sections ends with a CHAIN statement. “PRO-1" Magnetic tape indicates the position of the tape recorder head.
Carbs CLEAR 1 CLEAR Abbreviations: CL., CL, LEA, See also: DIM The CLEAR verb is used to erase all variables which have been used in the program and to taser all reallocated variables 1o zero or NUL, The CLEAR verb recovers space which is being used to store variables. This might be done when the variables used in the first part of a program are not required in the second part and available space is limited.
Verbs DEGREE 1 DEGREE Abbreviations: DE., DEG,, DEG, EDGER, ‘ See also: GRAD and RADIAN [ The DEGREE verb is used to sangs the form of angular values to decimal degrees, The PC-1251 has three forms for representing angular values — decimal degrees, radians and gradient. These forms are used in specifying the arguments to the SIN, COS, and TAN functions and in returning the results from the ASN, ACS, and ATN functions.
Verbs. DATA 1 DATA expression list Abbreviations: DA., DAT. See also: READ, RESTORE “The DATA verb is used to provide values for use by the READ verb. When assigning initial values to an array, it is convenient to list the values in a DATA statement and use a READ statement in a FOR NEXT loop to load the values into the array. When the first READ s executed, the first value in the first DATA statement ls returned.
Verbs DIM 1 DIM dim fist Where: dim list is: dimension spec, or: dimension spec. , dim list and: dimension spec, numeric dim spec. or: string dim spec. and: numeric dim spec is: numeric name {size} and: string dim spec is: string name (dims) or: string name (dims) *Elan and: numeric name 5. valid numeric variable name and: string name is: valid string variable name and: dims is: size : size, size and: size is: number of elements and: len is! length of each string in a string array Abbreviations: D, D).
Verbs DiM \When a numeric array is dimension ed, all values are initially set to zero; in a string array the values are set to NUL. Al ) and AS[ ) may be dimension ed 10 sizes larger than 26 with the DIM statement. ln this case, part of the array is in the reallocated memory and part is in program memory. See Chapping 4. 19 DIM B{19) Reserves space for a numeric array with 11 elements.
Verses END 1 END Abbreviations: E., EN. The END verb is used to signal the end of 2 program. When multiple programs are {loaded into memory at the same time a mark must be included to indicate where each program ends so that execution does not continue farm one program to another, This s done by including an END verb as the last statement in the program, 19 PRINT “HELLHOLE” With these programs in memory a 'RUN 10" prints 20 END 'HELLO', but not “GOODBYE’, ‘RUN 39 prints 3@ PRINT "“GOODBYE" ‘GOODBYE".
Verbs FOR 1 FOR numeric variable = expression 1 TO expression 2 2 FOR numeric variable = expression 1 TO expression 2 STEP expression 3 Abbreviations: F.and FO.; STE, See also: NEXT The FOR verb is used in combination with the NEXT verb 1o repeat a series of operations a specified number of times.
Verbs FOR The group of statements enclosed of FOR/NEXT statements which by & FOR/NEXT pair can include another pair use a different loop variable as long as the enclosed pair is completely enclosed; ie., if a FOR statement Is included in the group, the matching NEXT must “nested” up to five levels deep, 1M FOR 1=1TOS 2@ PRINT I 30 NEXT -—J 48 FOR STEP 1+ 50 PRINT N 60 NEXT N — 70 FORNICATOR FOREFRONT 108 X=X%F 11¢ NEXT 128 PRINT X 130 NEXT — also be included.
Verbs GO SUB 1 Go Sub Abbreviations: HOS, GOSH. See also: GOT, ON GO SUB, ON GOT, RETURN The GO SUB verb is used to execute a BASIC subroutine. When you wish to execute the same group of statements several times in the course of a program or use a previously written set of statements in several programs, it is convenient to use the BASIC capability for subroutines using the GO SUB and RETURN verbs.
Verbs Ga To I | 1 GOT expression ‘ Abbreviations: G., GO., GOT. [ Ses also: GO SUB, ON...GOSUB, ON...GOTO The GOT verb is suds to transfer control to a specified line number. The GOT verb transfers control from one lactation in a BASIC program to another location. Unlike the GO SUB verb, GOT doss not “remember” the lactation from which the transfer scoured. The expression in a GOT statement may not include a comma, 4., TALL, 2 cannot be used.
Verbs GRAD 1 GRAD Abbreviations: GR., GRA. See also: DEGREE and RADIAN “The GRAD verb is used to change the form of angular values to gradient form. Use “The PC-1251 has three forms for representing angular values — decimal degrees, radians, and gradient. These forms are used in specifying the arguments to the SIN, COS, and TAN functions and in returning the results from the ASN, ACS, and ATN functions.
it ion THEN statement 2 IF condition statement Abbreviations: none for IF, T, TH,, THE, The iF .. THEN verb pair is used ta execute or not execute a statement depending on conditions at the time the program is run. Use In the normal running of a BASIC programs, statements are executed in the sequence in which they occur. The IF . .
Verbs 1€ THEN Note: “This unit is capable of calculation for a mantissa digits. To increase accuracy, however, the mantissa is calculated inside the unit up to 12 digits, the result of which is rounded to the 10th digits for display. For example, 5/ and 5/9 %9 are calculated as follows: 5/9 —-m 5 This is rounded to the 10th digit. Display ~— L— This is rounded to the 10th digit Display = 6. “Thus, calculations are carried out for mantissas digits.
Verbs F...THEN Rawer calculations are based on log x and 10%, thus tending to cause a difference in the results from these calculated inside the computer.
Verbs INPUT 1 INPUT input list Where: input list is: input group : input group , inputting and: input group is: var list opt , var list : prompt ; var list and: var fist variable variable , var list and: prompt is: any string constant Abbreviations: 1., IN,, NIP, INPUT. See also: INPUT #, READ Pur The INPUT verb is used to enter one or more values from the keyboard.
Carbs INPUT It the key is pressed and no input is provided, the variable retains the value it had before the INPUT statement. 18 INPUT A Clears the display and puts a question mark at the [eft edge. 20 INPUT A Displays ‘A=" and waits for input data. 3P INPUT A Displays ‘A =" When the data is input 'A =’ disappears and the data is displayed starting at deft edge. 49 INPUT Displays and waits for first input. After [ENTER] s pressed, display is cleared and is displayed at left edge.
Carbs INPUT # 1 INPUT # 2 INPUT # “filename” 3 INPUT # var list. 4 INPUT # “filename’ ; var list Where: var list is: or: variable . var list 1 Abbreviations: INEPT, INPUT. # See also: INPUT, PRINT #, READ “The INPUT # var is used to enter values from the cassette tape. 1 PRINT # saves the values of variables on tape.
Verbs INPUT # 128 INPUT INPUT # “FILL; A$ 3] 20 INPUT # “FILLING Searches the tape for the file ‘EILEEN’ and reads in as many values of G{ }aware available. NOTES: 1. When the prerecorded data on tape is transferred to a variable, the data and variable should be coincident in shape {numerical or string variable), size and length. An error (ERROR 8} will resit unless they are coincident in size and length. No error will occur when they are not coincident only in shape.
Carbs LET 1 LET variable = expression ! Abbreviations: LE. The LET verb is used to assign a value to a variable. Use The LET verb assigns the value of the expression to the designated variable. The type of the expression must match that of the variable, i.e, only numeric expressions can be assigned to numeric variables and only string expressions can be assigned to string variables, In order to convert from one type to the other, one of the explicit type conversion functions, STRUT or VAL, must be used.
Verbs PRINT 1 PRINT print exp 2 PRINT print ax pr , print exp 3 PRINT print st Where: print list is: print exp or: print exp ; p;int& and: printer is: expression : or: USING clause ; expression Tha USING clause is described separately under USING Abbreviations: LP., LP, LORI, PRINT.
Verbs NEXT 1 NEXT numeric variable Abbreviations: N., NE,, NEX, See also: FOR e The NEXT verb is used to mark the end of a group of statements which are being repeated in a FORTUNE loop. The use of the NEXT verb is described under FOR. The numeric variable in a NEXT statement must match the numeric variable in the corresponding FOR.
Verbs ON .. GO SUB 1 ON expression GO SUB expression list Where: expression st is: expression or: expression , expression list Abbreviations: 0.; HOS, GOSH. See also: GO SUB, GOT, ON GOT The GO SUB verb is used to execute one of a set of subroutines depending on the value of a control expression. 85 When the ON . .. GO SUB verb is executed the expression between ON and GO SUB is evaluated and reduced to an integer.
Carbs ] 1 ON expression GOT expression list Where: expression list is: expression or: expression , expression i Abbreviations: 0.; G, GO., GOT. See also: GO SUB, GOT, ON .. GO SUB The ON...GOTO verb is used to transfer control to one of a set of locations depending on the value of a control expression, When the ON GOT verb is executed the expression between ON and GOT is evaluated and reduced to an integer. If the value of the integer is 1, control is transferred to the first location in the list.
Verbs PAUSE 1 PAUSE print exp 2 PAUSE printer , printer 3 PAUSE print list Where: print fist ist principle . print ex| and: print exp st expression . or: USING clause ; expression : print list The USING clause is described separately under USING Abbreviations: PAY, PAYS, See also: PRINT, PRINT, USING, and WAIT The PAUSE verb is used 1o print information on the display for a short period. Use The PAUSE verb is used to display prompting information, results of calculations, etc.
Verbs PRINT 1 PRINT print exp 2 PRINT printer, printer 3 PRINT print list 4 PRINT = PRINT 5 PRINT = PRINT Where: print list ist print exp or: print exp and: print exp is: expression or: USING use ; expression The USING cause is described separately under USING print list ‘ Abbreviations: B, PR., PRI, PREEN. | See also: PRINT, PAUSE, USING, and WAIT The PRINT verb is used to print information on the display or printer of the CE-125 Printer/Microcassette Re carder.
Verbs PRINT 24 characters, only the left-most 24 appear in the display. There is no way to see the other characters. 10 A=10: “ABRADE" Display 26 PRINT A 19. 30 PRINT X3 ABRADE 49 PRINT PRINT A: B; X§ "19.20.
Verbs PRINT # 1 PRINT # 2 PRINT # “filename” 3 PRINT # var list 4 PRINT % “filename” ; var list Where: var list variable or: variable , var list Abbreviations: PRL #, PREEN. # See also: INPUT #, PRINT, READ The PRINT # verb is used to store values on the cassette tape. Using PRINT #the values of variables can be saved on tape.
Verbs PRINT # 1) 19 PRINT PRINT # “FILL; A$ 3 19 PRINT Saves all values the tape under the filename ‘FILL. Nate: 1. A variable above A{27) or a dimensional veritable must be secured into the program/data area before the PRINT# command is executed. If the variable is not designated before the PRINT# command, an error {ERROR 3) will result, 2. When a variable above A(27) is designated and the PRINT #command is executed, ERROR 3 occurs because the designated variable is not secured in the program/ data area.
Verbs RADIAN 1 RADIAN Abbreviations: BAD., RAD, RADIAN. i See also: DEGREE and GRAD | “The RADIAN verb is used to change the form of angular values to radian form. s The PC-1251 has three forms for representing angular values — decimal degrees, radians, and gradient. These forms are used in specifying the arguments 1o the SIN, €08, and TAN functions and in resuming the results from the ASN, ACS, and ATN functions.
Verbs RANDOM 1 RANDOM ‘ Abbreviations: RA., RAN., RAND., RAND. When tandem numbers are generated using the RND function, the PC-1251 begins with a predetermined “seed” or starting number, The RANDOM verb resets this seed to & new randomly determined value, The starting seed will be the same each teems the PC-1251 is turned on, s0 the sequence of random numbers generated with RND is the same each time, unless the seed is changed.
Verbs READ l 1 READ variable List | Where: variable list is: variable or: variable , variable fist Abbreviations: REA. See also: DATA, RESTORE The READ verb is used to read values from a DATA statement and assign them to variables. L] When assigning initial values convenient to list the values in a DATA statement and use a READ statement in a FOR NEXT loop to goad the values into the array, When the first READ is executed, the first value in the first DATA statement is returned.
Verbs REM 1 REM remark Abbreviations: none %5 7 The REM verb is used to include comments in a program, Often it is useful to includes explanatory comments in a program. These can provide titles, names of authors, dates of last edification, saga notes, reminders about algorithms used, stc. These comments are included by means of the REM statement, The REM statement has no effect on the program execution snd can be included anywhere in the program.
Verbs RESTORE | 1 res Tome 2 RESTORE expression Abbreviations: RES. REST., REST, ROSTER. See also: DATA, READ The RESTORE verb is used to reread values in a DATA statement of to change the order in which these values ars read. 83 In the regular use of the READ vert the PC-1251 begins reading with the first value in a DATA statement and proceeds sequentially through the remaining values.
Verbs RETURN J 1 RETURN | Abbreviations: RE., REGRET, TURRET. RETURN. [ See also: GO SUB, ON...GOSU8 Purpose i . The RETURN verb is used at the end of a subroutine to return control to the statement following the originating GOURD. A subroutine may have more than one RETURN statement, but the first one executed terminates the execution of the subroutine.
Verbs STOP 1 §TOP Abbreviations: 8., ST., §TQ., ‘ See also: END; CONT command The STOP verb is used to halt execution of a program for diagnostic purposes. When the STOP vert is encountered in program execution the PC-1251 execution halts and a massage is displayed such as 'BREAK IN 208 where 20@ is the number of the ling containing the STOP. STOP is used during the development of a program to check the flow of the program or examine the state of variables. Execution may be restarted using the CONT command.
Verbs TRON 1 TRON Abbreviations ¢ TR., TRO. See also: TOFF The TRON verb is used 1o initiate the trace mode. The trace made provides assistance in debugging programs. When the trace mode is on, the line number of each statement is displayed after each statement is executed. The PC-1251 then halts and waits for the Down Arrow key to be pressed before moving on to the next statement. The Up Trow key may be pressed to see the statement which has just been executed.
Corks USING 1 USING 2 USING “editing specification” 3 USING character variable Abbreviations: U,, US, USL, UNIS, See also: PRINT, PAUSE, PRINT Further guide to the use of USING is provided in Appendix ¢ The USING vert is used to contra the format of displayed or printed output, [ The USING verb can be used by itself or as a clause within a PRINT, PAUSE, or PRINT statement.
Verbs WAIT 1 WAIT 2 WAIT expression Abbreviations: W., WA, WAI. See also: PAUSE, PRINT The WAIT verb is used to control the length of time that displayed information is shown before program execution continues. In normal execution the PC-1251 halts execution after a PRINT command until the [ENTER) Key is pressed. The WAIT command causes the PC-1281 to display for a specified interval and than proceed automatically {similar to the PAUSE verve.
Functions Pseudo variables Pseudo variables Pseudosciences are 3 group of functions which take no argument and are used like simple variables wherever required. 1 IN KEYS PINKEYE is a string pseudo variable which has the value of the last key passed on the keyboard. [ENTER) , [8e¥) , BEE, [, (17, and (4] all have a value of NUL, PINKEYE is used te respond to the pressing of individual keys without waiting for the ENTER key to end the input.
Functions Numeric Functions Pl is a numeric pseudo variable which has the value identical to the use of the special Pl character {x} on the keyboard. Like other numbers the value of Pl is kept to 10 digit accuracy (3.141692654), “Guarnieri Functions Numeric functions are a group of mathematical operations which take a single numeric value and return a numeric value. They include trigonometric functions, logarithmic functions, and functions which operate on the integer and sign parts of a number.
Functions Pseudo variables ASN is a numeric function which returns the arc sine of the numeric argument. The arc sine is the angle whee sine is equal 1o the expression, The value returned depends on whether the PC-1251 Is in decimal degree, radian, or gradient mode for angles, ASN the decimal degree mode. i 1 ATN numeric expression ATN is a numeric function which returns the arc tangent of the numeric argument. The arc tangent is the angle whose tangent is equal to the expression.
Functions Numeric Functions L 1 EXP numeric expression EXP is a numeric function which rewrites the value of ¢ {2.718281828 — the base of the natural logarithms) raised to the value of the numeric argument, EXP 1 is 2.718281828. 1 INT numeric expression INT is a numeric function which returns the integer part of its numeric argument. Int Phis 3. 1 LOG numeric expression LOG is a numeric function which returns the logarithm to the base 18 of its numeric argument.
Functions Pseudo variables 1 RND numeric expression RAID is a numeric function which generates random numbers. It the value of the argument is less than one but greater than of equal to zero, the random number is less than one and greater than of equal to zeta. [f the argument is an integer greater than or equal to 1, the result is & random number greater than or equal to 1 and less than or squeal fo the argument.
Functions W Numeric Functions T SOR numeric expression numeric function which returns the square root of its argument. It is identical to the use of the special square root symbol v/ ) on the keyboard, SQR 405 2. 1 TAN numeric expression J TAN is a numeric function which returns the tangent of its angle argument, The value returned depends on whether the PC-1251 is in decimal degree, radian, or gradient mode for angles. TAN 4515 1.
Functions String Functions String functions are a group of operations used for manipulating strings. Some take @ string argument and return & numeric value. Some take a string argument and return a string. Some tee a numeric value and return a string. Somme take a string argument and ong Or two numeric arguments and return a string, Many dialects of BASING require the argument of a function to be enclosed in parentheses.
Functions String Functions 1 MID$ (swing expression , num. exp. 1, num. esp. 2} MID$ is a string function which returns a middle portion of the string first argument. The first numeric argument indicates the first character position to be included in the result. The second numeric argument indicates the number of characters that are to be included.
Programming Examples ‘ ' CHAPTER. 9 . PROGRAMMING EXAMPLES This chapter presents a series of programming examples which illustrate some of the potential programming capabilities of your PC-1251 computer, Each example is briefly discussed to indicate the logic and structure of the program and the way in which the PC-1251 is being used, This discussion js not meant to be a complete guide to programming. New programmers should consult a separate boa on how o program.
Programming Examples 20: 30: 40: 110: 120: 130: 150: 160: 170: Loan Payment Calculator Program SENTENCE Laudatory Program CAN PUT "PRINCIPAL? ;P INPUT “YEARLY _ INTEREST? ;| T INPUT “MONTHS? ;N (GANDHIAN A=T/8 ;A= {INT {{AX100) + 100: PRINT "MO. PAYMENT = ; A Z=A¥N PRINT “TOTAL . COST 2 X=z-p t PRINT “TOTAL .
Programming Examples bl When writing programs you often need to get stems into a particular order, e, 1o sort them. Many different sorting techniques have been developed, each of which is better or worse for particular circumstances. One of the simplest sorting {techniques is the “sort by search”. In this technique the program scans an array of unsorted data looking for the largest item. It puts this in the top element of 2 new array and goes back to ook for the next largest item.
110: 120: 140: 1502 160: 170: 180: 120:; : PRINT S{I} 210: 201 8 220 230: : INPUT "HOW MANY _ITEMS TO SORT? QUOIT) THEN LET T=J + O{T) £99 Sorting Program DIV O(N}, SN} FOR [+ TO N INPUT O (1) NEXT PAUSE “SORTING" Formation T=1 FOREFRONT NEXT s=0im NEXT F BEEP 2 PAUSE "DONE SORTING™ INPUT “DISPLAY OR PRINTER? ;A3 IF { LEFT$ THEN PRINT = PRINT FORNICATION NEXT PRINT = PRINT END 138 Find out how many values this time Allocate space for an array to half the data 81 }is for unsorted data, S{ } for sorted Lings
Programming Examples R ] “This program simulates the behavior of a simple slot making. The model simulated is based on three wheels covered with pictures of objects, One object from each wheel shows through the window at a time. In this simulation there are three abject which alternate around cache of the three wheels. On each play the wheels are spun and travel freely for a period of time. Then they begin to slow down and gradually come to a stop. The stopping point of each wheel is random.
Programming Examples =RND(T! :READ 100: 110: Bt 8 120: 130: 140: 180; 200: 210: 220: 230: 240: 2802 2603 70 Slot Machine Simulation Program 2T ReIn® simulation Program 1 §=0: F=10: G=B0: H=200 DIM R(3}, DI, PS{TIks RANDOM NEXT FOR =1 TOT NEXT 1 DATA * ORANGE LEMON ', CHERRY ” WAIT H PRINT *1% SLOT MACHINE" WAIT PRINT “PRESS ENTER TO START” REMORSE START OF TURN Yok M=0 FORNICATOR R{l) =B+ RND {C) IF {R{1) > M} THEN LET NEXT | WAIT 140 TINT (TUBA) =1/ T C=3KT: B=6 4T Set initial variables — § is amount of wi
280: FOR A=1 TO M 290: (F [A>C) THEN WAIT 300: FOR 1=1T0 3 310¢ IF THEN LET DI =D 3201 |F THEE LET Ditty 330: R =R 340: NEXT | 250: PRINT UPSIDE: PHIDIAS 360: NEXT A 370: WAIT H 380: PRINT LOPSIDED; PRUDENT 390: W=~ 400: IF AND [D{2) = D{3}} THEN LET W=2 410: IF WO THEN PRINT “YOURSELF” 420: tF W0 THEN PRINT “YOU —WIN 430: §=S+W 440: ON (2+ SGN (51} GOT 450,470,450 450: PRINT S0, §ABS (8] : GOT 50O PRINT "Y OU_ARE_BREAKING_EVE 1 GOT 500 : PRINT “SO_FAR_YOU_HAVE_WON 87; 8 500: INPUT "ANOTHER.
Programming Examples This program provides an estimate of United States Federal tax liability. It requests filing status, number of exemptions, salary income, self-employment income, other income, and amount of itemized deductions. Based on this information, it computes the taxable income. Next it reads in the tax table appropriate 10 the filing status and determines the amount of Federal Income Tax. If there is self-employment income the Racial Security tax is computed.
Programming Examples United States Federal Tax Estimator Program 10: DIM 20: USING " sades” 30: WAIT 128 40: PRINT “FILING STATUS" 50: PRINT “t=SINGLE" 60: PRINT *2=MARRIED FILING SPEAR” 76: PRINT "3=MARRIED Filing JOINT" BO: PRINT “4=HEAD OF HOUSEHOLD" 90: WAIT 100: INPUT "STATUS? “;F 1101 IF OR THEN GOT 40 120: INPUT “NO. OF EXEMPTIONS? ; 130: INPUT “EST. SALARY INCOME 140 INPUT “EST. § E. INCOME? " 8 .
Programming Examples 320: READ L. 330: FOR X=1TO L 340: READ BI XI, M{X), P{X} 350: IF (1 BLDG} THEN LET J=X 360: NEXT X 370: 380: PRINT “FIT = ;T 390 INPUT “AMT. OF ADD. TAX? " A 400: INPUT *AMT. OF TAX CREDITS? "; ¢ 410: 420: 1F 23> 3029.40 THEN LET 4301 |F Z>0 THEN PRINT “8.
850: REM LABTE FOR MARIE FINDLING SPARE. B51: DATA 13 ATA 00,0 863: DATA i DATA 2750, 124 ATA : DATA : DATA : DATA : DATA : DATA : DATA : DATA 22900,5728, 44 1 DATA .49 : DATA 42800,15124, 50 500: AEM LABTE FOR MARIE FINDLING POINTE 901: DATA 13 302: DATA 00,0 903: DATA 904: DATA 905: DATA B06: DATA 907: DATA 908: DATA 909: DATA 910: DATA 911: DATA 912: DATA 60060,17708, .48 914: DATA 95D: REM LABTE FOR HERD OF STAKEHOLDER 951: DATA 14 952: DATABOOK 863: DATA 954: DATA 955: DATA 956: DATA 8700,898, .
Programming Examples The PC-1261 is an excellent tonal for making many small statistical tests. As an example of this capability, this program ululates the basic tests which are often used to compare a series of paired observations, The program solicits the observations which are entered in pairs. When there is an independent and a dependent variable, the dependent variable is X and the independent is Y. [f the variables are independent, then simply assign one to X and one te Y.
Programming Examples Relationship of Two Variables Program 10: AD=0, E=0, V=0 20: INPUT “NUMBER OF OBSERVE? ";N 30: DIM X (M), YNE 40: WAIT 48 60: PAUSE “ENTER PAIRS OF OBS” FOR 1=1TON t Print “PAIR "1 INPUT “X7 7 XU INPUT Y2 ;YA 100: NEXT | 110: WAIT 128 120: INPUT "DISPLAY OR PRINTER? "/ W$ 130: iF (LEFTS THEN PRINT = PRINT 14D: INPUT "LIST OF DATA? "1 W§ 160: 1F { LEFTS (WS, THEN LET V=1 160: FOR I=1 TON 170; 1F (V=1] THEN PRINT X{I}, Y11} 180: ATAXIA} 190: 200: 210: 1)~ 2] 220: E= #HOOKY N 230: NEXT £ 2
Rag 278 280: 290: 300: 310: 2200 230! 340: 360: 370: 380: 380: 400: 410: 4200 430: : PRINT = PRINT 480: ramming Examples :1G=C/N TINT “MEAN OF Y = K= SOR (Jun-1) PRINT "STD, DEV. A M= SQ OR PRINT “STD. DEV, K THN) R=0/ SQR (kL) PRINT “SORREL.
Programming Examples T This program provides a simple minefield game. The game is played set of squares like a checkerboard. The top of the board is north, the bottom south, the left west, and the right east. The columns are numbered horizontally from left 1o right, from 1 to 18, The rows are numbered vertically from bottom 1o top, also from 1 to 10, You begin the game in the southwest corner, square (1, 1}. The object is to move to the northeast corner, square {19, 18).
Programming Examples 707 80 a0: 100: 110: : DIRNDL (8} 130: 140: 15 3 180 170 180 190: 200: 210 220 230: 240: 250: 280: 270: 280: =10 DIM WAIT 128 INPUT “DIFFICULTY LEVEL? ;B PRINT “ONE MINUTE FOR SETUP” FOREMOST FAL 3 =0 NEXT J NEXT ¥ FOR =1 TG B DIRNDL (S} IF (IX+Y} <5} THEN GOT 120 IF ({1 +8=X) + (145~ THEN GOT 120 Fixity NEXT§ Pyx =y PRINT YOU ARE AT (X", ;¥ )" GO SUE 400 BEEP C INPUT “WHICH WAY NOW? “; A$ D= VAL (A$) IF (id) OR THEN PRINT 1 TO 8 ONLY, PLEASE”: GOT 230 iF {D>6) THEN GO SUB 500 IF (D<4)
2480: 30D 310: 320: 400; 410; 420: 43Q: 440: 4501 4560: 500: 510: 520: 560: 570: 6001 810: 620: 650 &70: 700! 710: 750: 800: 8101 820 IF (D=1} OR (D=4 OR THEN GO SUB 650 IF THEN GOT 700 IF THEN GOT 750 GOT 200 =0 FOR 1=X=1TO X+1 FOR TO Y+1 IF THEN LET C=C+1 NEXT 4 NEXT 1 RETURN IF (Y =8) THEN PRINT “YOU ARE AT NORTH EDGE": GOTH 520 N RETURN 2 1F (Y=1) THEN PRINT “YQU ARE AT SOUTH EDGE”: GOT E70 Ye vat RETURN IF (X =8) THEN PRINT “YOU ARE AT EAST EDGE": GOT 620 pE] RETURN 1F (X=1) THEN PRINT “YQU ARE AT WEST
Trouble Shooting This chapter provides you with some hints on what to do when your SHARP PC-1251 does not do what you expect divided into twa parts — the first part deals with general machine operation and the second with BASIC programming, For each problem there are a series of suggestions provided.
Trouble Shooting BASIC Debugging When entering a new BASIC program, it is usual for it not 0 work the first time. Even if you are simply keying in a program that you know is correct, such as those provided in this manual, it is usual to make at least one typing error. new program of any length, it will probably contain at least one logic error as well Following are some general hints on how to find and correct your errors. You run your program and get an error eagerness: 1.
Maintenance To insure trouble-free operation of your SHARP PC-1251 we recommend the following: Always handle the pocket computer carefully as the liquid crystal display is made of glass, Keep the computer in an area free from extreme temperature changes, moisture, or dust. During warm weather, vehicles left in direct sunlight are subject to high temperature build up.. Prolonged exposure to high temperature may cause damage to your computer, Use only a soft, dry cloth 1o clean the computer.
APPENDIX A Error Messages TR ERROR MESSAGES The PC-1251 has nine different error messages. Error Number Meaning 1 Syntax Error. 3% /2 2 Calculation error. Either you have tried to use 2 number which exceeds the capacity of the PC-1267: 9.9 E99%10 or you have tried to divide by zeta: 5/ 3 DIV Orangery Error. ® Array variable already exists. Array specified without first Dimensionless it.
ASCII Character Code Chart 8 1/0 device error. An error has occurred in sending information between the PC-1281 and another device such as the printer or tape on the CE-125, Check the low battery indicator on the CE-125, Check all the connections. 8 Other. Some other error has occurred which is not one of the above errors. Often this'is due to an illegal value: CHRIS (1} or a misuse of reallocated variables: The fallowing chart shows the conversion values for use with CHRIS and ASC.
ASCII Character Code Chart wme@ B DOODAD First 4 bits Hex Binary | QUAHOG | 00@1 | €010 | 8311 @ge | @@l @110 0060 NUL 113 0007 114 9010 185 190 118 wee 10t 17 101 102 118 183 19 0111 104 120 1000 105 121 1681 198 122 970 187 123 108 124 1100 109 125 1181 118 128 1118 127 157
APPENDIX C Formatting Output It is sometimes important or useful to control the format as well the content of output. The PG-1251 controls display formats with the USING verb. This verb allows you to specify: * The number of digits * The location of the decimal point * Scientific notation format * The number of string characters These different formats are specified with an “output mask”.
APPENDIX C Formatting Output The desired number of digits Is specified using the ‘4" character, Each the mask reserves space for one digit, The display or print always contains as many characters as are designated in the mask. The number appears to the far right of this field; the remaining positions to the left are filled with spaces. Positive numbers therefore always have at least one space at the left of the field.
APPENDIX C Formatting Output NOTE: When the fixed decimal point system is formatted by the USING statement and a numerical value less than | is displayed (or printed) under PRINT verb, PAUSE vert or PRINT verb, the least significant digit will be dropped from the display if the displayed {or printed} digits are alt “3”, Example: With the entry of USING “ #7, designate the “USING” made and key in “PRINT A" [F A =01, “0.1" will be indicated on the display. T A= 0.01, “0.” will be displayed {as opposed to “0.
APPENDIX © Formatting Output Specifying Alphanumeric Masks String constants and variables are displayed using the character. Each ‘& indicates one character in the field to be displayed. The string will be positioned at the left end of this field, If the siring is shorter than the fled, the remaining spaces to the right will be filled with spaces.
APPENDIX D Expression Evaluation When the SHARP PC-1251 is given a complex expression, it evaluates the parts of the expression in a sequence which is determined by the priority of the individual parts of the expression, 1f you enter the expression: as either a calculation or as @ part of a program, the PC-1251 does not know if you meant: 100 109 2 ias =6 5445 o 5 8 Since the PC-1251 must have some way 1o decide between these options, it uses its rules of operator priority.
APPENDIX D Expression Evaluation When there are two or mare operators at the same priority level the expression will be evaluated from theft 1o right. {The exponentiation will be evaluated from right to left.) Note that with for example, the answer is the same whether the addition or the subtraction is done first. When an expression contains multiple nested parentheses, the innermost set is evaluated first and evaluation then proceeds outward.
APPENDIX D Expression Evaluation Starting with the expression: / 107 LOG 160 The PC-1257 would first evaluate the innermost set of parentheses.
APPENDIX E Feature Comparison APPENDIX E FEATURE COMPARISON OF THE PC-1211, PC-1251, AND PC-1500 The three SHARP pocket computers, the PC-1211, the PC-1251, and the PC-150¢ have many features in comment, but are some significant differences. Sometimes the same features are present, yet act in a slightly different fashion. In order to facilitate the wse of programs on different models the following comparison charts are provided.
APPENDIX E Feature Comparison PC-1211 PC-1251 PC-1500 Comments DEBUG DiM END FOR...
Verbs and Commands ] PC-1211 | PC-1251 APPENDIX E Feature Comparison RESTORE RETURN LINE RM TOFF RM TON ROTATE RUN SORGHUM §TOP TAB TEST TEXT TOFF TRON UNLOCK USING WAIT PC-1569 | Comments T TRIO W EWO P IOERI®W®E® DD See Note 3 Note 1: There are some minor differences between ths PC-1251 and the PC-1211 in the behavior of AREAS following PRINT, but these are unlikely to cause problems in ordinary usage.
APPENDIX E Feature Comparison in this and the following charts the features are simply marked with z °Y* when the machine has the feature.
APPENDIX E Feature Comparison P-1211[ PC-1251‘ PC150# | Comments I T ASC Y Y CHRIS v Y LEFTS ¥ ¥ LEN ¥ Y MID$ ¥ Y RIGHTS LY Y STIRS Y Y VAL ¥ Y ‘ PC—1211‘ PC-1251| PC-1580 ‘ Comments A Y ‘ See Note Note 4: Raising a negative number to a power with the * operator can result in incorrect signs. See Chapter Precautions for using the program on the PC-1211: 1, The PC-1251 is equipped with the commands not available with the PC-1211.
APPENDIX E Feature Comparison 3. When the RUN command is executed on the PC-12171, all variables can be retained. With the PC-1281, however, any variable above A[27) is cleared. {See page 80.) Therefore, if variables need to bs retained at the start of program execution, begin to execute the program with the GOT command or definable key operation. 4. Programs for the PC-1211, when loaded form its tape, can be used with the PC-1251.
APPENDIX F Numeric Precision P NUMERIC PRECISION ON THE PC-1251 Accuracy in Computations While the PC-1251 displays the results of calculations to an accuracy of 18 digits, 12 digits are used internal in calculations w© provide addition accuracy, For example: 5/9 yields 5.GBBS6EEE555 E 01 internally which is rounded to the 10th digit and displayed externally as 5.565565556 01 Similarly, yields E (¢ internally and when this is rounded to 10 digits externally, the display will show 5.
APPENDIX F Numeric Precision the branch would occur because the rounding would have occurred when the value wars assigned to B, Special Limits In addition to the general limits described above and in Chapter 4, certain functions of the PC-1251 have their own special limits. These are shown in the chart below. Functions Dynamic range log ¥ < 100 »=0,x <0: ERROR 2 \ (Ex.
W Model: Processor: Programming Language: Memory Capacity: Stack: Operators: Numeric Precision: Editing Features: Memory Protection: Display: Keys: Power Supply: Power Consumption: Operating Temperature: Dimensions: Weight: Accessories: Options: SPECIFICATIONS APPENDIX G Specifications APPENDIX G PC-1251 Pocket Computer 8 kit COS CPU BASIC Stern ROM: 24 K Bytes RAM System About 588 Bytes User Fixed Memory Area 208 Bytes (A~Z, Ra serve Area 48 Bytes Program/Data Area 3486 Bytes Sub-routine: 10 stacks Functio
Index Vo I TERN YNV é ABS AC adapter, CE-125 ACS ALL RESET AND AREAS ASC ASCII ASN ATN Arrays Auto off (Auto Power Off) BEEP Batteries, PC-1251 Busy CA key CE-128 131 128 183 1683 128 54 128 36 81 133 156 128 129 CHAIN CHRIS CLEAR CLOD GLAD? Cl Lear key CONT €os CAVE Cursor Cassette Commands Comparability Constants DATA DEF key DEG DEGREE Delete key BIM DMS Debugging Display END ENTER key EXP Editing calculations Editing programs Error Messages Exponentiation Expressions FF {Fast forward) FOR...TO...
Subgroup G070 GRAD Hexadecimal IF THEN PINKEYE INPUT INPUT # Insert key INT LEFT$ LEN LET LIST LILTS LN LOG PRINT La belled programs Limits of numbers Line numbers Logical expressions f.
Index Subroutines TAN TOFF TRON Tape, external Tape Tape counter 93 132 122 123 81 59 63 Templates Troubleshooting USING VAL Variables Verbs WAIT 51 182 124 134 40, 68 126
Program Examples Probably you have acquired knowledge on a number of program commands as you have proceeded to the function description up to this page. [T is necessary, however, to generate actual programs by yourself in addition to the instruction manual, so that you can generate programs freely using BASIC language. Like driving a car or playing tennis that can be improved by actual practice, you can improve your programming only by generating as many programs as possible regardless of your skill.
CONTENTS {program title} {page} NEWTON'S METHOD FOR FINDING ROOTS OF EQUATIONS -179 AVERAGE, VARIANCE AND STANDARD DEVIATION . . L0183 INTERSECTION BETWEEN CIRCLES AND STRAIGHT LINES NUMBER OF DAYS CALCULATION TYING PRACTICE MEMORY CHECKER BUG HUNT . Showing the bytes used in each program itself The number of bytes used in each program is shown at the end of each program listing. For instance, in the TYPING PRACTICE program, 475 were used bytes.
NEWTONS METHOD FOR FINDING ROOTS OF Program Title: EQUATIONS OVERVIEW (mathematical} Finding the roots of equations is usually troublesome, but by using Newton's Method the approximate roots of equations can be found. When 1 root is found, depending on the interval width, by using Newton's Method the starting point automatically changes. CONTENTS the absolute value of the distance between X, and X,.q is less than 107%, X,, s considered a root and is displayed.
How to type in the example: 1. Go into PRO made by operating the mode change key. 2, 600B = % X—1} % X+2 [enter) 510 RETURN [ENTER] That is all that had to be Dane, KEY OPERATION SEQUENCE Step Key Input Display Remarks e Waiting for starting paint 1 | BEE[A STARTING POINT Waiting for minute interval 2 o ENTER] | MINUTE INTERVAL=_ | Jollity + Waiting for interval width 3 | o.0001 INTERVAL = _ input 4 o5 ENTER] | ANSWER = 2.| Display of roast By repeatedly pressing the 5 ENTER) | ANSWER = 1.
(/ Newton's Method ™\ levitation subroutine/ [Trout starting 300 paint, interval and minute x=c interval) I Function calculation v-g X=A+L 320 Function calculation Newton's Method 300 calculation F=fF+W 350 Newton's Method calculation @ls are ‘] displayed ) display RETURN N Function calculation subroutine B 500 RETURN AN 181
PROGRAM LIST MEMORY CONTENTS Minute interval fix] X fix+h} MINUTE TERRY v v Starting point Interval x Flx} Initial flag 182
Program Title: AVERAGE, VARIANCE AND STANDARD DEVIATION OVERVIEW {f the data are input, the total sum, average, variance, and standard deviation will be calculated for you. Revision of input data as well as data with weights is possible. CONTENTS Total sum T fi Standard deviation o e perverse Variance U= Number of data entries (when there are no weights f;= 1) INSTRUCTIONS 1. At [DEF) (A, select whether or not there are any weights, then input the data. 2.
KEY OPERATION SEQUENCE Step No. Key Input Display Remarks B 0. OF DATA = _ Waiting fo number of dote 2 5 (LEFTER) | WEIGHTS =27 | Erlang for e mention of 3 1 Denier) | Xi1) = 7 4 14.
KEY OPERATION SEQUENCE Step Koy Input Display Remarks 1 | [BEF B X4} =141 2 [ENTER] [BER) € is used 10 input 3 [EWER] | X (21 =141 the revised values when tads errors are found 4 | BEEFCAKE) X2 REVISION VALUE = 7_ Revised value is input 5 142 [ENTER] | Fl21=1e ENTER 1 DEF (D] TOTAL SUM = 1072.5 Display of total sum 2 ENTER| | MEAN VALUE = 14,3 Display of average 3 VARIANCE = 1442432430602 | Display of variance T Display of standard deviate {ENTER) | STD.
FLOWCHART Data input With or without weight 40 Without weigh 50 With weighing ey N DI 70 Data input END Calculation C o D 300 [Total sum, average, variance, standard deviation 400 [Total sum, average] veneer, standard deviation 126 ) Data revision (= > 200 L ware ] 210 Sara display xta o, 230 @ Wit el With weight ey NN Tara medusa S 260 e 7__@ END Data revision c Darla (splash Fervid valve | s input ith vieighls=Y—— { Ly
ST VAL 5070 298 BRI TN Pl TINT “TOTAL SU: + PRINT PHLEGM VAL
Program Title: INTERSECTION BETWEEN CIRCLES AND STRAIGHT LINES OVERVIEW The points of intersection between circles and straight lines in the X—Y plane are found. CONTENTS The 2 pants of intersection between & circle and 2 straight line are P and Q. {Note} The angles are in degrees, minutes, and seconds and are 0 be input in the following way: 123.1423 = 123 degrees 14 minutes 23 seconds. P (X, Y,) INSTRUCTIONS BX,, ¥, 1. M the straight line is determined by 2 points, [BEF B is used.
KEY OPERATION SEQUENCE {when 2 points on the line are known} Step No. Key Input Display Remarks T DEFT Xo= 2 50 (Enter) [ENTER} NETTER] v2=_ 8 108 P 42.
FLOWCHART 1 2 points ars known sputnik radius R P#iifl— L KAOHSIUNG (X —H] Subroutine for finding the X—Y coordinates 140 Display of XY coordinates 150 Subroutine for finding the XY coordinates 160 splay of X—V | values END /% 1 point and 1 [ direction ante 500 500 3 are known 190 Wey /0K X—YX Y] ACS [X/W) 510 RETURN 600 /Subroutine fod finding the X—Y coordinates | { RETURN S
Program Site: NUMBER OF DAYS CALCULATION OVERVIEW How many days has it been since you were born? This program is convenient for answering such questions. By setting a certain day, this program will output the number of days that have passed since that day.
KEY OPERATION SEQUENCE Step No, Key Input Display Remarks 1 [BEE (A START YEAR = 2 1976 (EMITTER MONTH = ?fp‘fle'm *© 3 1w [ENTER]| DAY = 4 5 [ENTER] | END YEAR [ENTER)| DAY= 7 a [Enter] | DAYS= 2068. g [ENTER] | END YEAR = o | seer [EER] MONTH= [ENTER] | DAY = 1 1 [ENTER] DAYS = 3010.
FLOWCHART Calculation of, sum of days / Base bear, ST _ math, day ST 510 i a0 L [Tepee | Target year, £ math, dey J 80 520 INT (365.
PROGRAM LIST MEMORY CONTENTS 1BrvR 2B INCL Fox PN T I INPUT YET ANTHONY Sy« Year laser calculation) G23tI= INT INT (3R Aegean SEEING INT (HA1R8)+ INT RETURN &A@ T END Start year Month of base date ay of base date Month of target date Day of target date Number of days 198
Program Title: TYPING PRACTICE OVERVIEW Quick key operation! How fast and accurate is your typing? If you practice with this program, it will make programming much easier for you, Improve your skiff CONTENTS (such as calculation contents} The number of characters randomly chosen, The character arrangement doer randomly. The allotted time depends on the number of characters and the grade level. 3 is the shortest time allotment while 1 is the longest.
KEY OPERATION SEQUENCE Sep Key input Display Remarks 1 TUBERCLE] GRADE (1,2, 3)7 Grade input 2 1 ENTER) | AZTEC s (AD Aztec A 4 @ AZBDGC AZ Afr er the 10 questions are YOUR — SCORE = 80 answered the score is displayed I your score s higher Than YOUR SCORE IS BEST the high score the guidance is displayed > = When you want to play in 1 [CECA HIGH~SCORE~80 the mass grade SUBWAY 2 8] YOUR — SCORE = 80 > 187
FLOWCHART ) = High score " Grade Characters arranged according to random numbers 40 Series of problem tetrameters input character series §=1 Depending on After the loop has de and length been zed 10 grade and fen price: — < Trout exrsrs;Y — 87 | EN Character number count b m— 110 depending on the number of correct answers Paints are counted .
Program Title: SOFT LANDING GAME OVERVIEW This game involves landing a rocket, with only a limited amount of fuel, as softly as possible. The rocket is in free fall. The engine is used ta slow down the free falling rocket.
KEY OPERATION SEQUENCE ep Key Input Display Remarks 1 | DEF[A FARTHEST KA Keys designate fuel burned | H: 506 S: 56 F: 200 G:0 in unit time (8] H: a5z 5 -46 F: 191 C:9 Repeat {1 successful} SUCCESS ! FUEL LEFT: F =15 {1f tailed) GOOD BYE Wait for input o whether 3 7 REPLAY e s v Play again N > End 201
FLOWCHART . Initial setup Sh Lead data e «Serene display PINKEYE D3 7 TR 100 Burned dusk gty o > T Key not pressed N 130 — deft Calculation of the rocket's neigh and sped rocket higher than 160 peed and height under Want ta play again? 210 < Flay ageist\ Y s 202
Program Title: MEMORY CHECKER OVERVIEW Three line with a total of 18 characters will be displayed on the screen for approx. § seconds, Your memory will be tested by how well You input the above line after it has disappeared. CONTENTS The following type of line will be displayed for approx. & seconds.
FLOWCHART D 20 Construction of the problem line 150 splay of the e o e {Subroutine 500) (5 sen.) 160 b T Answer input ] 200 loosely ot ha | input 200 Redis ploy of the | (Subroutine 500} _problem line 200 Redissolve of the {Subroutine 520} answer input.
MEMORY CONTENTS columns of characters Index Fandom number generation Random number generation Counter input for REPLAY Cellini, Characters (1 ~6) TOMPKINS Number table {1 ~ 10} 3 columns after angering {1 -~ 3} Work (1 ~3) SARS work {1 ~3) 3 columns before answering {1 ~ 3) 208
Program Title: BUG HUNT OVERVIEW This is a game involving a man chasing after a bua. CONTENTS The bug moves according to random numbers. The man chases the bug and kills it, 8] The man moves by using the [ 4_ (8] keys. (PINKEYE is used) [Z] Each time the man moves one space, so does the bug, (Sometimes the bug will stay in the same place) v {initially the man is in position 0, 0. The bug is placed at & position that was chosen randomly. Hints are displayed as distance.
Concerning the display {mall characters are actual values) ] {x, y) DISTANCE=¢ E=¢ Present position Hint Remaining energy {X coordinate, Y coordinate) ({distance) @ Each time the man moves the display changes Bug is caught HIT! HIT! BANG! BANG! SCORE t ENERGY e Concerning the BEEP sound * Hint: When the distance is 1 the BEEP gods off 3 times the distance is greater than 3 no BEEP is given, * When the bug is caught, the BEEP goes off 5 times.
FLOWCHART T /Trivial dotting \ / RANDOM § [[Setting of bug position | A= RANDI B = RN DB ] 22— Distance calculation Bi Positions of the Bug and the man, T Judge from the distance | L=1 BEEP ‘ [Rs gin 2,4,6 0r 8 L KEYS used to move the man. Time pert §=5+1 Qut af the 9x3 range or G$ had read in other than2,4,8and 8, station of the bug and 0 the man Energy calculation] | —F ~— core display E\
MEMORY CONTENTS A Position of bug X coordinate B Position of bug Y coordinate c Amount of energy dded D E Remaining energy F Energy revel : Key read Distance between bug and man Size of bug movement s Time spent T Score Man position X coordinate Y Man position Y coordinate Z 213
Program Titch: DOUBLE ROTATION OVERVIEW Quickly Putin order A, B, This is a game that arranges randomly placed characters alphabetical order. When the letters are arranged in the right order, a score is displayed, The trick is to attack from the best place. The sooner the characters are arranged, the better, Iris fun to race with your friends, INSTRUCTIONS 1. After the program is initiated, by pressing DEF, (A] , “DOUBLE ROTATION™ is displaced. A random sequence of characters then displayed.
KEY OPERATION SEQUENCE Step No.
FLOWCHART 10 | 400 Initial setup L Random numbs | generated 74 110 [Haber is stared depending on random bumpers f— 170 A sequence of | alphabets | displayed § [ TINCTURES i D$ 210 Sequence of otters Is shifted according L(Q the input numbers: Arrange correctly? N 300 310 Game over score END 216
REFERENCE Graphic display and symbol printouts Using specific commands, the SHARP PC-1251 generates characters and figures for display. With special commands, the PC-1251 is also capable of printing special characters such as symbols and lowercase letters by using the GE-125, The following describes the display and printout procedures: If any command described here is incorrectly used, all programs input 1o the PC-1261 will entirely be voided or all keys will remain inoperative.
10: WAIT @ 2@: PRINT 30: CALL &11EQ 4f: AS= IN KEYS 50: IF A$ THEN 70 60: GOT PAUSE “YE: GOT 20 80: IF PAUSE "NO": GOT 20 90: GOT 20 16@: END Note: The Display Memory stores the contents to be displaced, This memory is also applied to a variety of calculations. Any calculation, if executed in the PC-1251 when the preceding command {1} designated the display meed, will destroy the display contents. Graphic display The PC-1251 Display has # maxim urn of 24 display digits, each consisting dots.
{Pattern Data} For example, the number of tads per box in each column increases exponentially with the actual value for display using the data for that column. {DOT} [EXPONENTIAL) YR Display Pattern {&10) —32 20 —B4 (&40} ' i Decimal Hexadecimal number number b T4+8+18432+4 64« 121 (&79) [ I 142448+ 16+32= 63 (&3F} ‘ e 14244+ (33F) 120 (&78) (&3C) The exponentially increased dot value becomes the pattern data for dismay.
REPEAT (7 START i INITIAL SETTING Enter the Printout Routine Prepare the Printout data Printout Command Exit the Printout Routine L NDJ RUN mode PEEK & 7FFF [ENTER Display 2 DIM Z$ (1% 3 POKE BC5C4, 2, 0, 121, 124, 194, 55,2, 13, 121, 124, 124, 56 DiM POKE &C5C4,2, 0, 121, 124, 91, 55,2, 13,121,124, 91, 56 DIM 248 POKE &C5C4, 2, B, 121, 124, 125, 55, 2,13, 121, 124, 125, 65 Make sure to executes this before stetting any program execution.
As shown in the Flow Chart above, it is necessary as the initial step to set forth the program to execute an array declaration and write the data following the POKE statement In the CE-126. After the writing is completed and before entering the printout operation, execute the command that actuates the Printout Routine to store the printout data in the data memory. Upon data entry, execute the printout command for printouts.
EXAMPLE 2: Typical program for the printout of all characters stored in the CE<128B. 1¢: DIM Z8{1) %3 {Printout results) ® 20: POKE &C5C4,2,6,121,1 24,125,86,2,13,121,1 24,125,655 % 3@: CALL 87DFE 4¢: GO SUB 508 5p: FOR A=1TO7: GO SUB 51¢: NEXT A 6d: GO SUB 500 7¢: A=9: GO SUB 51¢: GO SUB 508 88: FOR A=11TO12: & GO SUB B10: NEXT A z L2I4EETTAMR A 9@: GO SUB 50p 19@: FOR A=14 TO 15: GO SUB 610: NEXT A R sooty B g .
Lower digit Character Case Table Upper digit B8O 96 112 128 144 160 176 192 208 224 240 % 0 1]2]3 E|p O+ "8 Alo il |# — balalaika V]~ .