Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
412 views
Personal Programming Ti59
Personal Programming ti59 A Complete Guide Calculadora Programable Texas ti-59
Uploaded by
Leon Ziegler
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Personal Programming ti59 For Later
Download
Save
Save Personal Programming ti59 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
412 views
Personal Programming Ti59
Personal Programming ti59 A Complete Guide Calculadora Programable Texas ti-59
Uploaded by
Leon Ziegler
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Personal Programming ti59 For Later
Carousel Previous
Carousel Next
Save
Save Personal Programming ti59 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 254
Search
Fullscreen
Personal Programming Acomplete guide to a whoie new dimension in problem solving ease and power: handheld programming no oospaea te susaggyteagarien =KEY INDEX ‘This indexed keyboard provides a quick page reference to the description of each key. me vs evs meso me 6 TH vss fe) v8 (ej ves fo) vm OEE) vig O38 [na] -V-3 fiw] v3 vis [ce] V3 a) v3 mou =e me om OW (ike) v-43 v.30 [ei] v0 v.20 Mo G8 323 EE v2. 6 UV Gy 48 [Sto] v-23 V-23 [sum V-24 BEovs | aos avs me v0 sy v-48 [ee] v5 Tf vie [iy] viz ve eM ov. Ea vs vot v6 v2 v2 tf] ve v5 El vsz v2. EE V3 vie vss [4] V2 Cs] va fe] ve vin mvs mv vo «v2 vas me ve Ova tf v2 [3] ve veo MM vo OB v8 Mv GR vie Mm ore RA vw (o] v2 Ge va v2 El vw jefer to Appendix A and the inside back cover for service and warranty information. IMPORTANT Record the serial number from the bottom of the unit and purchase date in the space below. The serial number is identified by the words “SERIAL NO." on the bottom case. Always reference this information in any correspondence. TIPROGRAMMABLE ~ 5°? ‘Model No. SerialNo. Purchase Date ‘Copyright © 1977, 1979, Tpxas Instruments IncorporatedTABLE OF CONTENTS {GETTING ACOUAMITED— a quick ook Introduction Power Up . ‘Types of ‘Operations Running Library Programs: Calculations from the Keyboard 1 Writing Your Own Programs — An Example I Printing Capabilities ...... 1s Calculator Campus ooo eens : 6 I A“GUIDED KEY TOUR" —a look at the features and functions . Keyboard Basics Clearing the Display — Datanty Keye— COE ae Basic Operation Keys — 7 ES l=] AOS —The iebri On peri Systm nity Method Parentheses Keys — Dual Function Keys — (eae), TUL Memory Keys — ia = : Memory Arithmetic Keys — Sug Display Control... Standard Display ‘Scientific Notation Key — Engineering Notation Key: Fix Decimal Control— [i Algebraic Functions .. ‘Square, Square Root, Reciprocal Keys - =, ical Powers and Roots — Logarithms —[ing] Angular Mode Keys — MEN. IT. ‘Trigonometric Keys — I. EE. Conversions. : : Degree Format Conversions — EIA... Polar/Rectangular Conversions — BZ] Statistical Functions on Keys Mean, Variance and Standard Deviation Linear Regression ........ Wl. USING “BUILTIN” PROBLEM SOLUTIONS — aovessing solid-state software Program Libraries ..... . Program Library Module Running Library Programs Analyzing Library Programs (Downloading)TABLE OF CONTENTS (continued) atom IV. PROGRAMMING CONSIDERATIONS . What is Programming? . Elementary Programming : Placinga Variable in aProgram Mechanics of Programming .. Using User - Defined Keys (labels) Short-Form Addressing Keying in Your Program Displaying the Program Elapsed Time Program . Editing Programs... Improving the Elapsed Time Program Editing with Merged Code .... ‘Typical Programming Applications . Programmingis Personal .. Investment Calculation Program Pricing Control Program ... Spherical Coordinates Program . Advanced Programming . More About Labels ‘TFansfer Instructions . Unconditional Transfers The Go To Instruction ‘Subroutines . The Subroutine Instruction — Accessing or Calling Subroutines Things to Watch Out forin Subroutines . Library Programs as Subroutines. Biorhythm Program... Conditional Transfers (Decision Makers) Display Register vs Register .... Square Root Example Flag Operation .... ‘Special Functions of Flags. Metric Conversion Program Data Register Transfers — [ES ‘Conditional Looping Looping with the DSZ X!Program ..... More on Applications Bond Cost Program Quadratic Equation Program. Additional Techniques . Programming indirect In Data Registers Accessed Indirectly Indirect Transfer Statements. Other Features ........SRESE SAAS SSS EO TABLE OF CONTENTS (continued) Pee Program Optimization Iv-89 Programming Techniques to Simplty Usage Iv-89 Programming Techniques for Minimizing Steps (89 Service Charge Program ...... . 93 Programming Techniques for Speed : : - Ve98 Codebreaker (Game Program) . \V. THE DETAILS — An In-Depth Analysis of Features er and Functions. Basic Operations... oe Standard Display Data Entry Keys . Clearing Operations . Dual Function Keys ([2nd] and vd) Display Formats . Scientific Notation... Engineering Notation. Fix-Decimal Control Flashing Display : : : Arithmetic Calculations... ee eee Basic Functions — [¥ ). [=]. [2] (].[S) .- Algebraic Operating System Entry Method . Parentheses ...... : Dummy Operation with Parentheses Algebraic Functions. Reciprocal Logarithms : Powers of 10 and e Angle Calculations Angular Modes . ‘Trigonometric Functions . : Inverse Trigonometric Functions Degree, Radian, Grad Conversions - Integer and Absolute Value . Square and Square Root Roots and Powers Memory Capabilities Selection of Memory Size (Part Clearing Data Memory .... Storing and Recalling Data .. Direct Register Arithmetic Memory/Display Exchange Special Control Operations .... Printer Capabilities — IJ 00-08... Analysis of Library Program (Downloading) Signum Function ing . ‘Test Operations — Il 18-19 Increment/Decrement Data Registers — il 20-29/30-39° Printer Test Operation — lj 40 (T! Programmable 58C only).TABLE OF CONTENTS (continued) \ en me Conversions and Statistics v-30 Conversions ...... V-30 ‘Angle Conversions v-30 Polar/Rectangular System Conversions . v-30 Statistics. vs2 Data Entry vea2 Mean, Variance and Standard Deviation v-33 Linear Regression .. v-36 ‘Trend-Line Analysis v-39 ‘Statistics in Calculations General Programming .... Programming Your Calculator . ‘Storage Capacity and Partitioning . V-42, Basic Program Control Functions vas Lean Mode ...-..... vag Entering Your Program Running Your Program. ‘Working With Programs v8 Instruction Codes (key Codes} vas, Keystroke Storage - vst Editing Programs .. Feplacing an Instruction with Another. Deleting an Instruction : Inserting an instruction. v-s2 Labeling Program Parts . VES, User-Defined Keys as Labels v55 Common Labels . v6 Transfer Instructions Unconditional Transfer Instructions [GTO] and (SBR). Go To Instruction V-56 | Subroutines .. v58 Library Programs as Subroutines v0 Conditional Transfers (Test Instruct Register Comparisons ...... Decrement and Skip on Zero (SZ) Vea ; Flags. v45 Flags and Error Conditions Indiract Addressing : VI PRINTER CONTROL ... Selective Printing Listing Your Program. Listing Data Registers Tracing Your Calculations Augit Tail Symbols in Trace Mode . Special Control Operations for Printing ‘Alphanumeric Printing . : VET Plotting Data .... vi-40 List Program Labels Used . vit Printer Head Cleaning Sequence . wBN BONN Oe Sudha ans Hi p12 TABLE OF CONTENTS (continued) VII, MAGNETIC CARDS (Tl PROGRAMMABLE 59 ONLY) . Recording Cards .. Protecting a Program Reading Cards Reading a Card from a Program Caring for Magnetic Cards Handling Cards. Cleaning Cards Marking on Cards... Using the Head Cleaning Card Using the Drive Roller Cleaning Card Using the Calculator Diagnostic Card APPENDIX A— MAINTENANCE AND SERVICE INFORMATION . Battery and AC Operation In Case of Difficulty ... If You Have Questions or Need Assistance . For General Information For Technical Assistance. APPENDIX B—ERROR CONDITIONS . Errors Encountered When Aunning A Program. APPENDIX C — DISPLAYED RESULTS VERSUS ACCURACY . APPENDIX D— TROUBLESHOOTING PROGRAMS . Basic Considerations . Program Diagnosis WARRANTY .Personal Programming A complete owner's manual for Tl Programmable 58C/59 This 00K was developed oy ‘Toe Stat of ne Toxar neruments Learning Cento: Roger F Faish| ‘nates OGraay Dr-Raioh Ova, Ecuostons:Sohware rector ur conzneuvons by: PetarL Bontld Lane L Doulas anay Eazone Dniores A sexney ‘Chaves. MeCotum Heniy M Meer ‘ata Norington, J ‘Stato Prodromow ‘Sydney W Poland ‘Artwornandiayout wre coordinates sna executed: ‘alther and Davy Design Sua, ne. Bie Berens ee eNom ‘BRhrstoyitaecouing ores, waka Sees,I GETTING ACQUAINTED A QUICK LOOK INTRODUCTION ‘Today's handheld calculators can make it easy to utilize math in handling the problem situations that arise in many professional fields. A new speed, accuracy and confidence can now be part of our everyday life situations involving numbers and math from the routine to the most complex. Initially, “the basics” — addition, subtraction, multiplication and division — were the only calculator capablities available — and at the time, they were a revolutionary development. Next evolved calculators with more powerful math functions — squares, square roots, logarithms, trig functions, etc. These not only replaced the need for volumes of tables and charts, but also greatly increased the speed and accuracy possible in handing and solving the problems that arise in technical disciplines. Now — a new dimension! Progra mmabilty in a handheld calculator opens the gateways to vast new problem solving areas — areas that only a computer could enter before. This manual has been ‘specifically structured to start you programming right away. You'll see “hands on” how easy it really is to access the power of your Tl Programmable calculator. This manual is written for both the TI Programmabie 58C and §9. These two calculators differ by the following. Data Registers Program Steps Special Feature T1Programmable 58C Upto 60 Up to480 Constant Memory™ ‘T1Programmable 59 Upto 100 Upto 960 Magnetic Cards Both calculators provide the option to store data and program information for long periods. The TL Programmable 59 has magnetic cards which can be used to record information. The cards can later be read by the calculator to restore the information to the data and program memories. The TI Programmable 58C has a Constant Memory feature which prevents the data and program information from being lost when the power is switched off. This feature of the TI Programmable 58C also allows the battery pack to be changed or removed for installing the calculator on the optional printer without losing a program or stored data. Be sure to read Sections Vi, Vil and Appendix A for more details about the ‘special features unique to your calculator. Most other calculator functions and operations are identical. Where the operations of the calculators differ, ‘special notes have been made in the text. This book is organized like this: © W't tart ght in win some quick illustrations of just how easy using and programming your machine canbe. ®@ After that we'll follow with a tour of the key's features and functions of your machine. © Then welll go into a step-by-step discussion of programming. © Later in the manual we'll cover some of the more advanced programming features of your calculator, with a variety of application examples from various fields. ‘© The final section of the manual is a detailed and complete analysis of all calculator keys showing the full operating limits of the machine in various calculating situations. (if you are already quite familiar with calculators and programming and just want all the facts and details right away — you may want to skip directly to that section and review your machine in technical deta.) LLGetting Acquainted I A QUICK LOOK POWER UP The battery pack furnished with your calculator was charged at the factory before it was sent out to you. However, due to sell-discharging that happens in all batteries, the battery pack may require some charging before initial operation. If while you're first using your machine, the display becomes dim or erratic, the battery pack needs to be charged. Just turn the machine off, plug in your charger and walt a few minutes. Then proceed. You can be using your calculator while the battery pack is being charged. Note that the TI Programmable 58C has a Constant Memory teature which will save the program and data memory contents when turned off and for short periods with the battery pack removed. See Appendix A for complete battery and charging information. Slide the ON/OFF switch to the ON position and you should see a single zero in the display. This shows that the battery is charged and the calculator is ready for action. Turning the calculator ON automatically clears the TI Programmable 59. However, the Constant Memory feature of the Ti Programmable S8C retains the program and data memory contents, the partitioning, and the fix-decimal status that existed when last turned off. To check your calculator’s display, press the decimal point [=_] and the change sign[#/=| keys, then press eight repeatedly tofillthe display. An eight lignts all segments of each digit positionin the display. Note that the decimal point and minus sign progress to the left each time an eight is pressed. You can enter up to 10 digits into your calculator at any one time for either positive or negative numbers. All digit entries made after the tenth are simply ignored. Whenever you exceed the limits of the display or ask the calculator to do something it cannot do, the calculator lets you know by flashing the display. This flashing is stopped by pressing [CE] . ‘We'll be taking you on a “guided tour” of your machine, but remember that there's no substitute for just sitting down and exploring it an your own. This is one of the best ways to get to know what a versatile and Powerful device itis, The more you lean about its far reaching capabilities, the better itis able to serve your needs. TYPES OF OPERATIONS Basically there are 3 types of operations your calculator can handle for you: You can easily use one of the many Solid State Software™ programs built right into your machine to handle complex problems with a few keystrokes — OR — You can teach your calculator your own problem-solving methods, and it can remember and execute them for you whenever you want — OR — Your machine always stands ready to work as a high-powered manual calculator — ready to immediately handle “around-the-house” math as well as more intricate calculations with its advanced professional features. 12I Getting Acquainted A QUICK LOOK Running Library Programs \Without knowing anything about how to personally program your calculator, you can run many useful programs. A master library of prewritten Solid State Software programs is contained in a small module already inserted in the back of your calculator. This interchangeable module (other modules are available) contains a variety of general purpose programs described in the Master Library Manual. Through use of the program key Zi. each program can be “called-up” and used according to the writeup in the manual. Toillustrate how easy these programs are to use, let's play the "Hi-Lo" game. The object of the game is for you to guess a secret numbar in as few guesses as possible. The calculator ‘chooses a number in the range from 1 to 1023. The calculator responds to each of your guesses with a “100 low,” “too high,” or ‘correct’. Your score (number of guesses) is tallied by the calculator. Follow the ‘User Instructions and play. USER INSTRUCTIONS Step Procedure Enter Press Display 1 | Select program Li J 2 | Key in a series of random digits ‘Your Number w Your Number (1 to 199017) 3 | Generate secret number ww 0. 4 | Enter your guess (1 to 1023) Guess a) Clue Clue: -1. guessis iow 1. guess is high flashing 0. guess is correct 5 | Repeat Step 4 as needed 6 Display score 2 Score (number of guesses) ‘Most prerecorded programs are as easy to use as this. Actually dozens of program steps have been executed, but these are automatically handled for you. All you have to do Is enter the numbers you want to work on, and start the program. Here’s an important point — the key to using any of the Solid State Software programs is the li ‘manual. All of the ins, outs and details you need to get the most out of each library program are i inthe manual. So, refer to it whenever you're using any prerecorded program. it might be a good idea to ‘glance through your Master Library Manual right now. Get a feel for the programs that are already at your disposal — ready to help handle problems for you. 13Getting Acquainted I AQUICK LOOK Calculations From the Keyboard Your advanced TI calculator is equipped with AOS ™ method of entering problems, one of the most straightforward entry methods yet devised. Problems are easily solved by entering them directly into the calculator in the order they are written, left to right. For instance, to convert 100°C, 36°C, and —4°C to Fahrenheit, you need to multiply the Celsius reading by 9/5 and add 32. °F = °C X 9/5 + 32. Press Display 100 (<] 100. 9 ‘900. 180. 22) 212. ‘You can repeat this sequence to find 36°C = 96.8°F and —4°C = 24.8°F. (More will be said about the AOS: entry method and the calculating power it gives you later in the book.) Writing Your Own Programs — An Example ‘Once a calculation sequence has been determined and you have several values that need the same ‘sequence, you can press the [LRN] (learn) key and teach the calculator the sequence. For the above example, press [LRN] then key in the following: ez a BB eS [ZS] (to stop and display answer) Press [LRN] once more after the sequence — this tells the calculator to stop “leaming” the keystrokes you center. The calculator now remembers this sequence and is ready to perform this series of operations on any number (here, any Celsius reading) that you may enter into the display. 4I Getting Acquainted A QUICK LOOK ‘You're now ready to have your machine do the Celsius to Fahrenheit calculations on any number you enter. © Key in your Celsius value © Press [RST] (reset) to tell the calculator to start at the beginning '® Press [R/S] (run/stop) to begin program execution Press Display 212. 96.8 248 This is all you need to do to convert any Celsius reading to a Fahrenhelt equivalent. Writing your own program can be just as easy. This ability you've just seen in action — the ability to execute a program you have created — is one of the most powerful aspects of your calculator. Once a program is stored and you have tested it to verify its accuracy, you can use it over and aver again simply “at the touch of a key.” PRINTING CAPABILITIES ‘Your calculator is compatible with the PC-100A or PC-100C printing units. The printer can record the displayed value on paper whenever you tell ito. When solving problems directly from the keyboard, you can selectively print any or all desired intermediate resutts or provide @ complete listing of a stored program. When executing a program, print instructions encountered in the program cause automatic printing of the quantity in the display register. These printing features allow you to run a program while recording multiple ‘answers. The trace option on the printer prints all steps performed and the corresponding numerical results. Through use of the special control operations you can assemble and print any messages you need to identify segments ofthe listing or for tiles. Up to 20 characters can be printed per line, made up from a master set of 64 characters.Getting Acquainted I A QUICK LOOK CALCULATOR CAMPUS Your new calculator has many powerful structures that work together fo form a “community of benefits” all designed to work as an easy to use problem-solving system. in this section you've had a very quick look at some of these features in action. In the next section we'll take a brief “guided tour” ofthis working community in afitte more detail, and then get right on into the business (and pleasure) of programming.=a il A “GUIDED KEY TOUR” ALOOK AT THE FEATURES AND FUNCTIONS Before you plunge into some of the more advanced features of your machine, it will be useful to come along on a brief tour of the main features and functions available on the keyboard. This is particularly true if this is your first experience with an advanced calculator. Many calculator owners never fully access alt the power available in their machines — simply because they've never taken the time to see each key in action. In this section you'll get a quick key review — requiring only about 10-15 minutes of your time. This will generally familiarize you with the main keyboard features — so that as you move on in to programming, you'll be able to take full advantage of all that the machine can do. Anote to various users: Ityou're already familiar with advanced calculators with AOS entry method, you may want to skip this key tour section and get right into programming (Section IV). For a specific and detailed description of all the calculator’s various operations and capabilities, refer to Seetion V for an in-depth discussion of each key and feature. ‘As you proceed through this tour, be sure your calculator is out and handy. Check out each key and feature as it’s discussed. The best way to learn about your machine is to use it! maas A “Guided Key Tour” II ALOOK AT THE FEATURES AND FUNCTIONS KEYBOARD BASICS Clearing the Display — [ce], There are two procedures that allow you to clear the display register of your calculator depending upon your needs as you proceed through a problem. [CE] CLEAR ENTRY — The clear entry key clears the last number you entered into the display (provided that a function or operation key has not been pressed). Use of this key does not affect calculations in Progress. (So, if you accidentally hit 5 instead of 6 in the middle of an entry, just press [CE] and enter the ‘compiete correct number). The [CE] key may also be used to stop a flashing display created by an error condition. GENERAL CLEAR — The clear key clears the contents of the display register and any catculations in progress. If an error condition exists when this key is pressed, it too is removed. Data Entry Keys —[0]- (30,7 Numbers are entered into the machine with the data entry keys [0 ] ~ [SJ (=) ‘any number, the decimal point stays to the right of your entry until the decimal poi fractional part of the number is then keyed in, and the decimal sign of a number in the display just push the change sign key the sign back again). Pressing Places the first 10 digits of m in the display 3.141592654, 13 digits are carried in the internal display register, 3141592653590. [CE] does not remove this entry. Basic Operation Keys — &, Se Basic arithmetic is handled with the 5 basic operation keys Ong and [=]. ‘Your calculator has a powerful feature called AOS entry method which makes problem solution with these keys exceptionally easy. Basically, you just kay in the problem the way it's written, press. [==] and get ‘your result. The amazing feature of the AOS entry method is that it automatically sorts out mixed. ‘operations in a problem for you, and applies them in the correct order as it calculates your result. (We'll ‘say more about the AOS entry mathod on the next page.) When you prass the [= ] key, all pending operations things waiting to happen inside your calculator), are ‘completed. You get your result, and the calculator is cleared — ready to start on the next problem. Example: Calculate 15 +7 x 31 -4=7 wees Display: 228 NOTE: Observe that AOS entry method instructed the calculator to interpret the expression as 15 + (7 x 31) — 4, where 7 x 31 is calculated, then added to 15 and 4 subtracted from thi m2I ws A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS The AOS Entry Method ‘Mathematics is a science which adheres to a clearly defined set of rules. One such rule is that it never permits two differant answers to the same series of operations. Because of this requirement— one solution for any computation — mathematicians have established a universally accepted set of rules when mixed operations are used in one calculation. For example: the problem: 3+10-2x 144727 has only one right answerl (Know whatits? t's 8.) You can key this problem direct, leftto right into your calculator and you'll get the correct answer. The algebraic hierarchy of the calculator sorts the operations you enter, applies them in the correct order, and lets you see whiat it's doing along the way. Your calculator performs operations it received from you in the following universally accepted order: 1) Special Single Variable function keys — act on the displayed number immediately — as soon as you push the key. (We'll talk more about each of these keys later in the “tour” — but they include all the keys for the trig and log functions and their inverses, as well as square and square root, reciprocal, and conversions.) 2) Powers and Roots (y: and ‘/¥) are handled next (we'll discuss these further in this section.) 3), Multiplications and divisions are completed, followed by 4) Additions and subtractions. This algebraic hierarchy applies to each set of parentheses. Finally, the equais key completes all operations. ‘There are cases in problem solving where you want to be the one who specifies the order in which an ‘expression is evaluated. In these cases you can control the order with the parentheses keys, (C ] [_1} which are discussed in the next section. Parentheses demand a special frst ievel of attention in mathematics — and they're treated that way by your calculator.we I A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Parentheses Keys—(C), (7) In a variety of problems, you may need to specify the exact order in which expressions are evaluated, or the way in which numbers are grouped, as a problem is solved. Parentheses give you a way to cluster numbers and operations. By putting a series of numbers and operations in parentheses you tell the calculator “Evaluate this title problem first — down to a single number result, then use this result for the rest of the calculation.” Within each set of parentheses, your calculator operates according to the rules of algebraic hierarchy. You should use the parentheses if you have any doubts in your mind about how the calculator will handle an expression. Your calculator can have as many as 9 parentheses sels open at any ‘one time with as many as 8 operations pending, The following is an example of ths full capabilly ((2x(2x(2x(2x (2x (2+ 2y (2 + 2))-(2 + 2))) +2)=2) ‘As you key in this sequence, note that no calculations take place until the first closed parenthesis in. Your calculator remembers all instructions keyed in and interprets them when its supposed to. Note: an important point when using parentheses. You may otten see equations or expressions written with parentheses to imply multiplication: (2 + 1) (3 + 2) = 15. Your calculator will not perform implied mutiptications. You have to key in the operation between the parentheses: xa) 1D EO C)3 4) 20715. Here's an example using parentheses: Evaluate: 9X(4+9) +1 B+6+2)x7 In problems of this type — you want the calculator to evaluate the entire numerator, then divide by the entire denominator. You can be sure of this taking place by placing an extra set of parentheses around the numerator and denominator as you key in the problem. Press Display Comments 0 Clear any calculations in progress. xa] imal 9D] 13. (4 +9) is evaluated. 104, 8 x (4 + 9) s evaluated. 105. The value of the numerator. mim as3 GeO) «6 (3 +6 = 2)is evaluated. ba74 42. The value of the denominator. ee 25 The result, u4I A “Guided Key Tour’ ALOOK AT THE FEATURES AND FUNCTIONS Dual Function Keys — 2nd), [is¥] ‘Your calculator is equipped with numerous functions designed to save you time and increase the accuracy of your calculations. To allow you access to all of this power without loading the machine with keys, many of the calculator keys perform more than one function. The first function is printed right on the key. To use the first function of a key — just press it. To use the second function (written above the key), Just push the. key followad by the key right below the function. For example, to find the natural logarithm of a number, press [Ing]. To find the common logarithm of a ‘number, press [2nd] [in]. In order to distinguish the second function key, this manual shows it as [Bnd] First function operations, therefore, are indicated by [__]. Second functions are indicated by [2nd] Mill. The inverse key [INV] also provides additional calculator functions without increasing the number of keys, ‘on the keyboard. When you press the [INV] key before a particular function or key, the purpose of that function or key is reversed. The [INV] key works together with quite a few keys on your caiculator to provide extra functions, or to reverse an operation. The and [INV] keys allow 108 different keyboard operations to be performed using only 45 keys. For use with specific keys, see Dual Function Keys in Section V. msAc Il A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Memory Keys — Bi, 70) fits: | Each time you turn on your TI Programmable 59 there are 60 data registers for you to use. The number of data registers available on your T| Programmable 58C depends on the number last selected, even though the calculator has been tured off. Actually, the number of data registers available versus the amount of program memory is variable, (See Selection of Memory Size in MEMORY CAPABILITIES of Section V for complete details.) Data registers are special locations in the calculator where you can store numbers you may need to use later. The T! Programmable 58C retains numbers stored in the data registers even when ‘the calculator is tumed off. Because there is usually more than one data register available for your use, you must indicate which register you want to use by specifying its two-digit number XX. For example, [STO] 08. The [GE] and [CLR] keys do not attect what is in the memories; however, pressing (2nd) IIIB clears all data registers simultaneously (places a 0 in all registers). [ST] XX — STORE — This instruction stores the number held in the display register into data register XX(00-99) without disturbing the contents of the display register. (Any number previously stored in register XX is cleared out first) [RCL] XX — RECALL — This instruction simpiy brings the contents of data register XX to the display register. Again, the contents of data register XX are not disturbed. [ll Xx — MEMORY EXCHANGE — The exchange sequence simply swaps whatever is in data register XX with the contents of the display register. (The display register value is stored in register XX while the number stored in memory is called to the display register.) This key is handy in many situations allowing you to make a quick check or use what is in memory without losing what's in the display register. Example: Store and recall 3.21. Press Display Comments 2.21 [STO] 08 3.21 ‘Store 3.21 in register 8 ° Clear display [Rct}o8 3.21 Recall contents of register 8 16il A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Example: Evaluate: (A + 2) + A(A + 2) for A = 9.2069128. Oisplay Comments ° Clear any calculations in progress. 93069128 Stores Ain register 12. 11,3069128 A + 2is evaluated. 9.069128 Stores A + 2in register 12 and calls, Ato the display register. 11.3069128 Recalls A + 2 to the display register. (Note that a. Aand A +2) e 116,.5993643 Completes all pending operations to arrive at the final result. Note that the long value of A only had to be entered once, saving time and possible errors. The exchange key performs the task of a store and a recall also saving calculation effort. Memory Arithmetic Keys — Sua , Ia ‘There is aiso a series of key sequences that let you operate on the numbers stored in memory without ‘affecting other calculations in progress: 'S0aj XX — MEMORY SUM — This sequence allows you to add whatever is in the display register directly to what's stored in rogistor XX. The result of the addition is stored in the memory while the cisplay register is unaffected. Similarly, the sequence [INV] SUH XX subtracts the value in the display register from the contents of register XX. (Bad) [EE XX — MEMORY PRODUCT — This sequence causes the contents of register XX to be ‘multiplied by the display register value while [INV] [2nd] [[IEM XX divides register XX by the number in the ‘splay register. Again the result is left in memory and the display register is undisturbed. ‘These instructions perform similar to the way basic arithmetic operations do in normal keyboard eaiculations, except that results are accumulated in a data register instead of the display register. Example: Find the total cost of items of $28 and $6.60 with 5% sales tax. Press Display Comments: 28 (STO) 01 28. Store 28 in data register 1 6.6 SUM 01 66 ‘Add 6.6 to data register 1 1.05 [2nd) I 01 1.05 Multipty data register 1 by 1.05 [Reqjo1 96.33 Total CostA “Guided Key Tour” II ALOOK AT THE FEATURES AND FUNCTIONS DISPLAY CONTROL Standard Display ‘The display provides numerical information complete with negative sign and decimal point and flashes on and off for an overfiow, undertiow, or error condition. (A complete list of error conditions is found in ‘Appendix B.) An entry can contain as many as 10 digits. All digits entered after the tenth are ignored. floating decimal point — integer decimal floating minus sign ‘The terms display and display register are not synonymous. Display refers only to the digits you see in the calculator's display window. The display register is the internal egister that retains results to 13 digits. Ifa number is too large or too smalll to be handled by the standard format, the calculator automatically displays the number using scientific notation, For example, when 400,000 and 2,000,000 are multiplied together you get 800,000,000,000, a number too large for the 10-digit display. So, itis displayed as 8. x 10", Scientific Notation Key — [Fe] In many applications, particularly in science and engineering, you may find yourself needing to calculate with very large or small numbers. Such numbers are easily handled (by both you and your calculator) using scientific notation. A number in scientific notation is expressed as a base number (mantissa) times ten raised to some power (exponent). Number = Mantissa x 10%, ‘Toenter a number in scientific notation Enter the mantissa using up to 8 digits — (then pre: Press (££ ] (Enter Exponent) — “00” appears at the Enter the power of 10 (then press ‘Anumber such as —3.8901448 x 102° looks ike this in your display: In scientific notation the power of ten tells you where the decimal point would have to be if you were. writing the number out in longhand. m8 | . ‘ ,ll A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS A positive exponent tells you how many places the decimal point should be shifted to the right, a negative exponent — how many places to the left. Example: 2.9979 x 10" = 299,790,000,000 (Move decimal 11 places to the right and add zeros as needed) 1.6021 x 10 = 0.0000000076021 (Move decimal 9 places to the left and add zeros as needed) ‘Once you initiate the scienfitic notation format it stays there until you deliberately remove it. If you press (inv) [EE], the calculator returns to standard display format as soon as the value in the display is, within the range of the standard display. [GLR] removes this format when it clears the display. Engineering Notation Key — El Engineering notation is a modified form of scientific notation. The power (exponent) is always adjusted ‘to a multiple of three (10", 10-*, etc.). As a result, the mantissa may have one, two, or three digits to the left of the decimal point. This feature allows the calculator to display results in units that are easily used by the scientist, engineer or technician (such as 10~* for picofarads, 10-* for millimeters, 10° for kilograms, 10~* for microseconds). [CLR] does not remove engineering notation. The display may be converted to engineering notation at any time by pressing [2nd] [ET - “INv) [2nd] {EMI returns the display to standard display format. Example: Evaluate 8 x 98 x 30 in Engineering Format Press Display cir] 0. 00 98 784, 00 30(=) 23.52 03 Te: | 23520. Fix-Decimal Control — il ‘This convenient feature allows you to choose the number of digits you'd like to appear in the display to the ‘fight of the decimal point as you go through your calculations. Just press GBB, then press the desired number of decimal places (0 to 8). The calculator then rounds all subsequent results to this number of ‘decimal places for display only. However, you may still make entries with as many digits as you like as the calculator retains its own internal (13 digit) accuracy. [INV] [2nd] [JI removes fix-decimal. The TI Programmable 58C retains the fix-decimal selection, even while turned off. Example: 2 + 3 = 6666666667 Press Display 232) 6666066667 Gis 0.666667 (Gna) Mt 2 0.67 (2a) MEM © 1. (INV) (2nd) AED 6666666667 9aw A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS, ALGEBRAIC FUNCTIONS Square, Square Root, Reciprocal Keys — [=#], ‘These three easily accessible keys are essential for speedy handling of a variety of equation solving situations. All three of these keys act immediately on the number held by the display register without affecting other calculations in progress. (4) — SQUARE — Calculates the square of the number, x, in the display register. — SQUARE ROOT — Calculates the square root of the number, x, in the display register. [Vz] — RECIPROCAL — Divides 1 by the display register value x. Here's an example putting them all together: V4 + (1/s)* ~60 Powers And Roots — ‘Comments Clear any calculations in progress. VE W5 (ep The result This powertul key allows you to raise any positive number to a power. You may also use this key to find the roots of a positive number, For Powers (y*) © Enter the number (y) you want raised to © Enter the power (x). © Press [=] (or any operation key). Example: Calculate 2°. Press Display a 276) 64, For Roots (VV) © Enter the number (y) you want to find a © Enter the root (x). «© Press [=] (or any operation key). Example: Calculate 64. Press Display 0 64 (inv) (7*)6 (=) 2. NOTE: You should only enter positive values for y, a flashing display results for negative entries. m0su we A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS. Logarithms — [nz] , Is Logarithms are mathematical functions that enter into a variety of technical and theoretical calculations. Basically, if x = y’, then In x (to the base y) = 2. The keys discussed below give you immediate access to the logarithms of any positive number — without affecting calculations in progress — and without having ‘to deal with bulky tables. {Inz] — NATURAL LOGARITHM— Immediately calculates the natural logarithm (base ¢ = 2.718281828459) of the number held in the display register. (A flashing display results if this number is negative or zero.) The antilogarithm of the natural log (¢*) is found using the sequence [INV] [In] . (Znd] IEE — COMMON LOGARITHM — immediately calculates the common logarithm (base 10) of the display register value (Again, the value in the display should be positive). The antilogarithm of the ‘common log (10+ is found by pressing [INV] [2nd] a . ‘Example: Calculate the natural logarithm of (@*” + 10'2). Press Display ‘Comments (al ° Clear any calculations in ‘progress. We7 hy) 14.87973172 7 is evaluated. (2)1-2 Lin) (nd) 1584893192 10'2is evaluated. oD 30.72866365 Pending addition is completed. (inz} 3.425196888 The result.ew A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Angular Mode Keys — 3, EN, Gil Your calculator is equipped to handle a variety of calculations that involve angles — notably the trigonometric functions and polar/rectangular conversions, Angles can be measured in degrees, radians ‘or grads. Your catculator always powers up in the degree mode; however, you may select any one of three ‘common units for angular measure using the key sequences below; (EB — SELECT DEGREE MODE — In this mode all entered and calculated angles are measured in degrees, until another mode is selected. (One degree = 1/360 of a circle — a right angle equals 90°) (Gnd) (EZ — SELECT RADIAN MODE — In this mode all angles are measured in radians (one radian equals 1/(2z) of a circle — a right angle equals m/2 radians). EGI — SELECT GRAD MODE — In this mode alll angles are measured in grads (one grad equals 1/400 of a circle — a right angle equals 100 grads). Trigonometric Keys — EN, HE, EN ‘These functions immediately calculate the sine, cosine, and tangent of the angle held in the display register. The angle is measured in the units of the selected angular mode, © (hypotenuse) ine@=2 =D sing= 6 cos 0=— ..b, and c are the lengths of the sides. The sequences |INV] FEIN. ()8V] EEE. and [INV] afe used to calculate the inverses of these functions, The resulting angles are displayed in units corresponding to the selected angular mode. where: Inthe degree mode, all angles are interpreted in decimal format. (See Degree Format Conversions in Section V.) mzvif aS A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS CONVERSIONS Degree Format Conversions — 3 ‘There are two ways of representing an angle in degrees. One method is to use the decimal degree format DDD dd. Here DDD represents the integer portion of the angle while .dd denotes the traction portion written as a decimal. (You may use as many as 10 digits.) ‘The second method is to use the degree.minute-second format ODD.MMSSsss, Again, DDD represents, the whole angle. MM represents minutes and SS denotes seconds. If greater accuracy is desired, fractional seconds may be entered in the sss position. Observe that the decimal point separates the degrees from the minutes. Jo convert from the degree.minute-second format to decimal degrees enter the angle into the display (O0D.MMSSsss) and press [2nd] [IT . Pressing [1Nv] [2nd] reverses the conversion process and converts decimal degrees to degrees, minutes and seconds. ‘Two digits should always be submitted for minutes and two for seconds as the calculator looks at the fractional part of the entry two digits at a time. Trailing zeros need not be entered. Consider this example. Example: Convert 54°02'09.6" to its decimal equivalent and back. Press Display Comments 54,02096 54,036 DD.ddd fiw] (200) OS 54,02096 DD.MMSSs ‘This same process can be used to convert between hours, minutes and seconds and decimal hours. m3rx I A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Polar/Rectangular Conversions — [2 ‘This is an especially handy feature of your calculator that is particularly usetul in science and engineering applications. Working with the [zt] key — it's fast and easy to convert from polar to rectangular coordinates, or vice versa. Just follow the key sequences illustrated below: Polar Rectangular FROM: (A, 6) To: ‘To convert from polar to rectangular coordinates: © Enter your value for “R” © Press [zt] ‘* Enter your “@" value (be sure angular mode is correct) * Press. [EM to display “y" © Press [22] to display “x” msI A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS Polar AR. 8) TO: R ‘To convert from rectangular to polar coordinates: Enter your “x” value Press (=) ‘© Enter your “y” value © Press [INV] (2nd) {BEY to display “0” in selected angular units © Press [#21] to display “R” ya? Convert R = 45 meters, @ = 31.6" Lt | into rectangular coordinates <) x=? Display Comments ° ‘Clear any calculations in progress and select degree mode. 0. *Place R in the Tregister 316 Place degrees in display 23.87936577 Convert to rectangular coordinates, and display y. 38.32771204 Display x. (y is now in the register) ‘*NOTE: This conversion uses a special register known as the T-register accessed through the [az:t] (x ‘exchange t) key. The special applications of this register are discussed in various programming sections. nsA “Guided Key Tour” il ALOOK AT THE FEATURES AND FUNCTIONS STATISTICAL FUNCTIONS ON KEYS Mean, Variance and Standard Deviation ‘You may find yourself handling large sets of data points describing some particular factor or parameter of a large number of items. (These data could be test scores, sales figures, etc.) The most commonly used statistical calculations used to boil dawn such data to a few representative numbers are the mean, Variance, and standard deviation, The mean is the average value of your data—a measure of the central tendency of your data. The variance and standard deviation give you a feel for how variable the data are; a measure of how far the data differ from the mean. Reter to Statistics in Section V for a complete discussion of how to use these powerful functions. m6il A “Guided Key Tour” ALOOK AT THE FEATURES AND FUNCTIONS. Linear Regression Linear regression may sound like a highly technical or threatening tile to you — buti's a process that your calculator makes very easy to use. And its one that deais with one of the oldest problems in the world: predicting future events. In the linear regression situation you usually have data expressed as pairs of variables that you could plot on a graph. We usually label a pair of points Ike this with the letters x, y (x may be dollars in advertising while y is unit sales, or x may be a test score and y a performance record in the field, etc.), You want to make a prediction for some x value that you select — what will happen to y (or vice versa)? Your calculator can do this for you by mathematically drawing the “best straight line” through your data points. You may then use the straight line to make predictions. ‘Once the data are entered your calculator is ready to draw the best straight line through your points and gve you the following information from it: y Corr: How well data are related ay compute y' entery Intercept compute x’ enter x ‘Statistics involving non-linear curve fits, exponential population plots for example, can also be ‘accommodated by the calculator. ‘The use of these and other features is detailed in Statistics in Section V. wari USING “BUILT-IN” PROBLEM SOLUTIONS ACCESSING SOLID STATE SOFTWARE PROGRAMS ‘The term “software” may or may not be familiar to you — and actually thas a variety of definitions. Basically, it refers to the instructions and programs — things that usually can be written on paper— that {ella computer or calculator what to do, and a user like yourself how to use them. Your calculator has a ‘provision for an assortment of easy-to-use but extremely powerful programs to be inserted into the ‘calculator and used by you at the touch of a key. These programs — especially written to handle user needs in a variety of fields — are stored in a special library module in back of your machine. This module can be easily replaced with a different module. The program information is all contained in a tiny ‘s0kd-state “chip” of silicon — similar in construction to the silicon integrated circuit that is the heart and ‘brain of a calculator. Hence the term “Solfd State Software” programs. There's a lot of “software” — programs with easy-to-use features stored for you in your Solid State Software module. The advantages — allot of program capability is packed in tle space — easy to carry and use. — library programs are accessible from keyboard anytime. — the library programs are especially written to be easy to use, even by the beginning calculator user. ‘complete the effectiveness of each module, there is a library manual. All information peculiar to each ‘program is found in an easy-to-use format in this manual. PROGRAM LIBRARIES ‘AMaster Library that is a basic assortment of useful programs comes with your calculator. Other professional libraries can be obtained from most TI retailers or ordered directly from Texas Instruments. Each library contains a selection of programs that make it easy to use some of the powerful mathematical ‘techniques of the various professional fiekis, A library consists of a program library module, a manual @aining in detail the use of each program in that library, a storage case and a set of program labe! ‘cards, Any Solid State Software library designated for the TI Programmable 58 and 59 is aiso completely ‘compatible with the TI Programmable 58C. PROGRAM LIBRARY MODULE ‘The programs of each library are stored in library modules, one module for each library. A module can be ‘exsity inserted into the back of the calculator and used immediately. Modules are durable devices, but ‘should be handled with care for long life. CAUTION Be sure your body is free of static electricity before handling any module. ‘Tras is especially true when the charger is connected because this grounds the calculator. Just touch ‘some metal object to electrically discharge your body. The contents of a module can be severely @amaged by static discharges. See Appendix A for more on maintaining the modules.Using “Built-In” Problem Solutions ii ACCESSING SOLID STATE SOFTWARE PROGRAMS ‘The Master Library module is installed in the calculator at the factory, but can easily be removed or replaced with another. It is a good idea to leave the module in place in the calculator except when replacing it with another module. Be sure to follow these instructions when you need to remove or replace amodule. 1) Turn the calculator OFF. Loading or unloading a module with the calculator ON may cause the keyboard or display to lockout. Also, shorting the contacts can damage the module or calculator. 2) Slide out the smail panel covering the module compartment at the bottom of the back of the calculator. (See Diagram below) Again, eliminate all static charges before handling the module. 3) Remove the module. You may tum the calculator over and let the module fall out into your hand. 4) Insert the module, notched end first with the labeled side up into the compartment. The module should slip effortiessly into place, 5) Replace the cover panel, securing the module against the contacts, Avoid any action that could bend, contaminate or otherwise damage the contacts. m2Il Using “Built-In” Problem Solutions ACCESSING SOLID STATE SOFTWARE PROGRAMS RUNNING LIBRARY PROGRAMS ‘Once a library module has been loaded into the calculator, calling a particular program is done simply by ‘tequesting it by its number (each program in a library has its own number). The required sequence is ‘2nd, mm, where mm is the two-digit number assigned to the program you have chosen torun. If ‘mm is not in the current module, the display flashes, Jo use a program, caretully follow the instructions in the library manual. A program label card is included for each program. This nonmagnetic card specifies the user-defined key assignments and can be fitted into the window above these kays once it is separated from the sheet of labels.* Example: What is the value of $1000 after 20 years of compounding at an 8% interest rate? ‘The Compound interest program in the Master Library can readily solve this probiem. Press Display Comments 2nd) 18 0 Calculator goes to Compound Interest Program (PGM 18) 2nd] a 0.00 Initialize 20a] 20.00 Enter number of periods 8(e) 8.00 Enter interest rate 1000.00 Enter present value of] 4660.96 Calculate future value You can use this program over and over once you are there without having to use the PGM instruction again. Press or 00 to retum to program memory and keyboard operation or you can run another library program through use of the EI key. Library programs can also be called by other programs as explained in Subroutines in Seotion IV. This feature greatly expands the programming capabilities of your calculator. {1you want to find out which library is in the calculator at any time without having to open the module compartment, press [2nd] (FIM 1 EMR ((2nq] for the TI Programmable 58C) and the module number is displayed (and printed along with the module name if you have the calculator on a PC-100A or PC-100C), “Note that the blank label cards are provided as a convenience for labeling user-defined keys of personal programs using the TI Programmable 58C. m3Using “Built-In” Problem Solutions il ACCESSING SOLID STATE SOFTWARE PROGRAMS ANALYZING LIBRARY PROGRAMS (DOWNLOADING) Normally ibrary programs are confined to their module for ready access, whenever needed. When a program is used, processing actually enters the module and performs its task. To gain access to the library program, you can bring it into program memory. Now all the calculator's programming tools can be used to analyze the individual steps and alter the program to your particular needs if necessary. Actually, only a copy of a program is brought into program memory, the module contents can never be changed. ‘The procedure to “download a program is easy. 1) Verify that there is sufficient program memory space avaltable for the incoming program. See Partitioning in the next section. 2) Press (2nd) (MJ mm to designate which program to download. 3) Press [2nd] {EM 09 to download the program. This procedure piaces the requested program into program memory beginning at program location 000, ‘The downloaded program writes over any instructions previously stored in that part of program memory. Therefore, a program in program memory cannot download a module program. ‘Once in program memory, the program can be manipulated for whatever purposes you need. You cannot, however, place the altered program back into the library module. If you need to preserve the “new” rogram, you can write down each step on a coding form, record It onto a magnetic card (or cards) if you have aT! Programmable 59 or list tif you have an optional printing unit. The TI Programmable 58C will retain a program until changed or until battery power is lost for an extended period. A library module containing proprietary programs is protected from downloading. A request to download ‘one of these programs flashes the display. fa library module does not perform as expected, see Appendix A. m4IV PROGRAMMING CONSIDERATIONS WHAT IS PROGRAMMING? ‘Computers are having such an impact on everyday life that we've become familiar with terms such as computer-programmers, programming the computer, programming language, or just plain programming. For some people, these terms conjure up visions of super-sophisticated individuals ‘dealing in a highly complex field, and just the thought of becoming a programmer seems beyond the realm of possibility, at least without a great deal of training, Not so; the era of personal programming is here. In fact, calculator programming is simple, and most intriguing is the fact that anyone can be programming calculators after a couple of easy lessons. Texas Instruments programmable calculators are designed to make programming simple and easy. Your calculator is versatile enough to allow you to enjoy the speed and power that programming offers — whether you are someone using just basic arithmetic, or an aerospace engineer working with extremely ‘complex mathematics. The calculating power is there for everyone, but use only what is required for your application. You'll be amazed at how quickly and easily time-consuming problems can be solved with simple arithmetic and simple programs working together. Programming is togical thinking. In simplest terms, a program is a set of instructions telling a machine or a person how to do something. A calculator program, therefore, tells a calculator how to do something, in particular how to perform calculations. When you want your calculator to do a job all you really need to 0 is to tell it exactly what you want it to do and how you want it done. A program is a list of precise instructions in specific order to be executed faithfully in a literal way. ‘Alanguage is merely he means by which you can communicate with your calculator. There is even a language to communicate with the simplest four-function calculator. Applied to programming, a language ‘8 4 necessary means to communicate your program to your calculator. ‘Acalculator language is heavily weighted toward common sense and the use of arithmetic. f, therelore, you have experience in canying out arithmetic calculations, either with pencil and paper or on a calculator, you already know most of your calculator's programming language. The functions explained in this manua} for keyboard operation can be used in the same way in programs. A calculator (like any computer) performs with iteral faithfulness those and only those instructions given This characteristic makes working with these machines a mixed experience. The result is that you, the programmer, have to be careful whal you tell the calculator to do and the order in which you tell itto complete the instructions. A calculator does exactly what you instruct it to do, regardless of whether you want it done that way or not. The techniques we discuss here will allow you to start realizing the potential of your calculator and make you a functional part of the era of personal programming, elProgramming Considerations IV ELEMENTARY PROGRAMMING Placing a Variable in a Program Consider the following simple expression: ALB=C When using a basic four-function calculator, the values of A and B cannot be identified at a later time, they must be known at the time the expression is keyed in. After this first expression is keyed in and a result is obtained, to change either or both values you have to key in the entire expression again. With the programmable calculator you may key in the instructions leaving the values undefined and then get an answer at a later time by keying in only the values to be changed. Now with the simple arithmetic expression above, the four-function calculator may be just as fast to use as a programmable calculator. The real advantage of the programmable calculator can be seen in an expression like the one below. Let's say you're in a situation where an answer is needed for ten different values of A, assuming B and C do not change. Ax (B+ (1+ Ayo) = RESULT You'd like to be able to enter the equation just once, then change only the value of A for each calculation. With your programmable calculator it's easy to do just that. Let's go back and work with our simple expression again. Consider how to give instructions to the caloulator. First, write the instructions as if to instruct another person, and then convert them to calculator instructions. Take The First Value Given You i ‘Add To The Above Value ‘The Value Below 1 ‘Take The Second Value Given You q The Result Aand B are values that can be anything — they can vary. These values are often called variables. WweIV Programming Considerations As far as the calculator is concerned, if you don't enter the variable as part of the program, two things must be done: 1. Leave afole at the right spot in your instructions where you can place the variable at a later time. 2. Tell the calculator where to look for the variable value when it needs it. You can instruct the calculator to 00k for a variable either in the display or in one of its data registers. Here we'll redraw the instruction sequence, leaving holes where the variables should be inserted. Hole for Variable 1 C+] Hole for Variable 2 ] [=] Display result Now, if the calculator needs to use a displayed number as a variable, leave the hole empty. When the eakulator starts running through a program, whatever value is in the display is placed in the first hole. A value for the second variable must also be found in the display, so we'll need to stop the program just before the variable is needed and enter it into the display. Then when the program is restarted the calculator takes the displayed value and continues. ‘One technique that lets you leave holes in your program for new entries or data is to simply stop the program at that point with the (Bes) Fur/Stop) key. You're just telling the machine to hold everything so thal you can key the next value it needs into the display. (We can call this an implied hole since no gap is ‘actually lett between program instructions. By stopping execution at some point in the program we're ‘mptying that we want to do something at that point — make a data entry.)Programming Considerations Enter Variable 2 In Display Stop Program Variables in the Display Flow Chart The above method (stopping the program to enter data) is ideal when a completely new set of variables is to be used each time the program is run. You may find another technique preferable when only one value needs to be changed. In this procedure you use the calculator’s data registers to store the variables. if you want your calculator to find a variable in its memory, place the instruction to recall the variable from the appropriate data register right in your program. For example, recalling a variable stored in data register 1 is performed by the sequence (RCL! 01. v4 From the Keyboard From the Keyboard Implied Hole-Takes Variabie 1 From Display and Inserts Here Program Instruction Program Instruction — Stop So Next Variable Can Be Entered From the Keyboard From the Keyboard Implied Hole — Takes Variable From Display and Inserts Here Program Instruction Display ResultIV Programming Considerations From the Keyboard Prior to Store Variables in Data Registers Running the Program tand2 From the Keyboard Program Instructions = Stop Program Variables in Data Memory Flow Chart Let's briefly review what we've accomplished thus far. First, we identified a probiem and then considered ‘two methods for entering the variables (one with memory and the other without memory). Third, we Geveloped a simpie flow diagram for each method. Notice that a flow diagram is originated by graphically ‘separating the problem into individual steps or actions which solve the problem when performed from top w bottom, ‘The next important step is to use the flow diagram to help determine the keystrokes required to instruct the calculator to solve the problem. Notice in the two following examples that the [RST] key must be pressed before actually running the program. This assures that the program begins with instruction key is used to start the program. The following example shows the keystrokes lator to look for the variables in its display register. required to instruct the c wsProgramming Considerations Enter Variable 1 Into the Display i Press ‘Start Program q ‘Add Variabie 1 | To Variable 2 Entered Below Stop Program | —t Enter Variable 2 Into the Display Complete the | Addition | C=) 1 002 ‘Stop and Display | the Result | Variables in the Display Program The centered blocks in each flow diagram explain what you must do to run the program once you have keyed the program instructions into program memory. These instructions or keystrokes are found in the ‘ight halves of the biocks divided by doited lines. The numbers outside these blocks are the instruction numbers corresponding to the keystrokes inside the blocks. These keystrokes or program instructions may be keyed into program memory by placing the calculator in the learn mode. wsIV Programming Considerations Here's the procedure for getting a program into your calculator. 1. Press(2nd) [BE to clear the program memory. 2. Press the [LR] key to enter the learn mode. You will know you are in this mode by a unique display format 000 00. 3. Press each key shown in the flow diagram beginning at the top. Press only the keys shown. If you make a mistake, press LRN] and start over with step one. Changes in the display are explained below. 4. Press the key a second time to exit the lean mode and the unique display disappears leaving a single zero displayed. You are now ready to run the program. The three digits in the feft of the display should change as you enter a program. These three digits show ‘you at what program location or instruction number the program pointer is located. The program pointer ‘s an internal device used by the calculator to determine which instruction it should perform next when executing a program. In the learn mode the program pointer simply points to the next unfiled location in the program memory. Now you and your calculator can try out the program with the variables coming in through the display. 1. Tum the calculator ON and press (2nd) El - 2. Press the key to enter the learn mode. 3. Enter the program by pressing the sequence shown below (21k) 4. Press the [Lan] Key to exit from the learn mode. You have just programmed the calculator. Now solve the problem 227 + 34 =? by running the program. 1, Press [Gif] to clear any calculations in progress. 2. Press [RST] and enter 227 for variable 1 3. Press [R/3) . The number 227 remains in the display. 4, Enter 34 for variable 2 and press gain, The answer 261 is displayed. Before running any program, itis a safe practice to press the [CLA] key to ensure that there are no pending calculations left to cause erroneous results. Each time these keys are pressed, the program adds the values in data registers 1 and 2 and displays the result. Enter numbers of your own and run the program again. WaProgramming Considerations Now let's use data registers to hold our variables and write a new program. Store Variable 1 In Data Register 1 Store Variable 2 In Data Register 2 Press Start Recall Variable 1 From Data Register 1 Register oot ‘Add Variable 1 To Variable 2 Below Recall Variable 2 From Data Register 2 ‘Complete the ‘Addition 005, Stop and Display | the Result | Variables in Data Memory Program IVsIV Programming Considerations Perform the following sequence to enter this program into your calculator. 1. Turn the calculator ON and press [2nd] IE - 2. Press the [Lita] Key to enter the leam mode, 3. Enter the program by pressing the following sequence. (ra tal qo 4) (o] 2) i) 4. Press the [LRN] Key again to exit from the lean mode. This program looks for the variables in data registers 01 and 02. Therefore, store 227 in register 01 and 34 m register 02 as follows. 1. To Store 227 in memory 2. To Store 34 in memory 2 Enter 227 Enter 34 Press (STO) 01 Press [516] 02 ‘As noted in the flow diagram comments, the only keyboard operation needed to run the program is to press [RT] [R/S]. Alter pressing these keys, the answer 261 appears in the display and the problem is. solved. ‘Notice that entering the varlables from the keyboard into the display took fewer programmed keystrokes or instructions to the calculator, consequently less space was used in program memory. By using the data registers to store the variables, more instructions are placed in program memory, but the calculator computed the result from start to finish with no intermediate stops. Choosing one method over the other depends on your needs. ‘You should remember that flow diagrams can be very useful, particularly in helping to organize and lay out the approach to solving a particular problem. A flow diagram consists of what is happening while the program is running, and includes not only the instructions or program placed in the calculator’s program ‘memory, but also explains what you need to do manually at the keyboard to make the program run, like starting the program and inputting variables. The keystrokes shown are instructions the calculator recognizes and will follow. These keystrokes are stored in the calculator's program memory when the calculator is in the learn mode: essentially they are the program. v9Programming Considerations IV Mechanics of Programming The versatia arithmetic language permits both simple and complex programming. Simple programs may be entered, checked, and run with little effort or difficulty. Even though the language is designed to be as straightforward as possible a complex program requires forethought and planning. 'tyou have done little programming, you will find the following ideas useful. If you are familiar with programming concepts, the ideas will serve as a review and orient you toward calculator programming, ‘You should interpret the following only as a list of suggestions since you will undoubtedly develop your own programming style. 1. Define the problem very clearly and carefully. Identity the formulas, variables and desired results. ‘What is known? What is to be determined? How are the known and the unknown related? 2, Develop a method of solution (sometimes called an algorithm). Define the operation sequence of the numerical approach you want to use keeping in mind the calculating and programming capabilities of the calculator. (Remember, strictly speaking, calculators do not solve problems, you do. Your calculator carries out your solutions precisely the way you tell it to!) 3, Develop a flow diagram. itis often useful to develop drawings that help you visualize the flow of the Program. Here, you can picture interactions between various parts of the solution. It may even be Possible to simplify the program structure after itis flow charted. 4. Begin making data register assignments. Assign data registers to the numerous things you'll be. ‘operating on. You'll continue this task throughout the programming process. Itis a good idea to never store a quantity in memory without making a written note that the data register in question contains that quantity. 5. Translate the flow diagram into keystrokes, The coding forms are provided to help you here. Itis Useful to list all labels and memory registers in the space Indicated on the form. Use the comments column for easy reference to various segments of the program. 6. Enter the program. Press {LBN] and key in the complete program from the coding form. When entry is complete, press [LRN] to remove the calculator trom the learn mode. 7, Test the program. Check out the program using test problems representing as many cases as practical 8. Correct errors. Correct the coding form for any errors discovered while testing the program. 9. Edit the program. Place the calculator in the learn mode, complete the required corrections and press [LRN] to return to the keyboard operation. See page IV-21 for more information. 10. Retest the program. Repeat steps 7-9 as needed. 11, Record the program. If your calculator has magnetic card capability, record the program on magnetic cards. See Section VIl for more information. 12. Document user instructions. It's always a good idea to carefully write down step-by-step instructions describing how to use your program. Even the most powerful programs are useless if you don’t remember how to use them. Fill out a User Instructions form, detailing information required to run the program. W.10IV Programming Considerations Using User-Defined Keys (Labels) In running the previous sample programs, you used the and keys each time. Since returns the program pointer to instruction number 000, you may have concluded that every program must start al the beginning of program memory. As you gain programming experience, you will discover that this is not always practical. Your calculator has user-defined keys that may be used as /abels to provide easy access to any location within a program. Labels are placed in a program as reference points. When a user-defined key is placed in a program, pressing this key causes the program pointer to locate the label. The calculator then automatically begins running the program, starting calculations from the first instruction following the label. These keys are ‘through: ‘and their second functions [2nd] EB through oa which allow you to identify and access up to ten different reference points (programs or parts of programs). For example, with a minor addition to the first program example, the ‘RST [R/S] key sequence used to start the program could simply be [Cj or any other user-defined key. Since the [-¢_] key is user-defined, the addition to the program is simply to label the start of the program with [_C | using the or label key as shown in the following diagram. wilProgramming Considerations Store Variable 1 ln Data Register 1 a ‘Store Variable 2 In Data Register 2 | { Data Register 2 | Detine Label €1} “ ine Label € 1} To Start Program | 2d] AE 4 001 t ow Recall Variable 1 | From | RECON) Data Register t | 09 ‘Add Variabie 1 1 ToVariable2 | (4) Bolow | ' 008 Recall Variable 2 | From ‘Complete the | Addition I ‘Stop and Display | the Resutt | Enter the learn mode just as before and key in the ke) data register 1 and 34 in data register 2. Now press 007 rokes shown. Exil the learn mode and store 227 in . The answer 261 is displayed because Pressing [_¢ ] tells the calculator to find where IEG [ C_]is located in program memory and then begin executing the instructions or keystrokes following AIM LC] - ‘Now that you have an idea about how user-defined keys work, consider a second addition to the previous Program allowing variable 1 1o be stored in data register 1 by pressing (_A_] and variable 2 to be stored in data register 2 by pressing . Then, CC | is again used to obtain the answer. W.2Programming Considerations Below Recall Variable 2 From Data Register 2 Rare |(21 Complete the Addition Stop and Display the Result 7 00 Define Label LA} | oe ee Store Variable 1 002 re Variable 1 | InData Register | SLOT) vos ‘Stop Program | 04 t 008 Define Label [BJ | ‘as Varabieo | 208) MOC) + 006 Store Variable 2 oor ' inDataRegsier2 | STIL ][2] os ! ‘Stop Program | 008 (Samosa aeeacey rH ToCompute Sum | 222 RENCE] on t oe Recall Variable 1 + From; (Ret) (oJ) i 1 Data Register 1 | avs ‘Add Variable 1 | ToVariabie2 | ow t ons. 016. on7 ors wigProgramming Considerations IV Place your calculator in the learn mode and enter the program instructions. Press [LRN] again to exit the fear mode and try out the program. Note that variables 1 and 2 may be entered in etther order. Although this change increases the size of the program it is now much easier to use. The following comparison of these three programs provides an overall view of how the user-defined keys improve the usability of a program. Clearly, the third version is the easiest to use. First Version Second Version Third Version Enter 227 Enter 227 Enter 227 Press [STO] 01 Press (S10) 01 Press [A] Enter 34 Enter 34 Enter 34 Press [STO] 02 Press [STO] 02 Press Press [RST] [R75] Display 261 Display 261 Labels may be placed anywhere in a program instruction ‘sequence without altering the meaning of that sequence. They are simply ignored during instruction processing except for the purpose of locating desired point in program memory and do not affect pending operations. This statement is not intended to mean that a label can interrupt a sequence such as [RCL] 14 where more than one program location is involved in detining a single processing action. You should include needed labels in your original program design rather than add them as an afterthought. Then key your labels into program memory along with the rest of your code, just as though they were any other instructions, Of course, even the use of labels does not make practical a program that simply adds two numbers together as the number of keystrokes required for the operation is increased rather than reduced. tt ‘should be evident, however, that labels can be used as valuable tools in more sophisticated programs. wisIV Programming Considerations Short Form Addressing Up till now we have always used a two-digit address to access data registers. Thatis, stored in data register 1 for example, has been accomplished by using the sequence ‘cases, however, leading zeros are not needed to access data registers 0-9. This type of addressing, often called short form addressing, may be used whenever a nonnumeric keystroke immediately faliows the register address. Example: Store 227 in data register 1 and 34 in data register 2, then recall these values and compute ‘their sum, Press Display Comments 227 [S10] 01 227. Since the next entry is to be a numeric keystroke, the full address must be used. 34 (510) 2 34, Short form addressing may be used in the 1 227. last three occurrences since each fre (=] 261. address is followed by a nonnumeric keystroke. ‘Observe that when short form addressing is used the instruction is not completed until a nonnumeric key 1s pressed. That is, just as 227 is not recalled until pressed, 34 is not stored until [RCL] is pressed. I-15Programming Considerations IV Keying in Your Program Programming is the technique of determining what your instructions to the calculator are going to be. However, ance you have prepared these instructions you need to know how to enter them into the calculator. You have already been exposed to the learn mode; but this section ‘covers it in depth. Programs are developed through a logical organization of the problem. Although you don't need a calculator to develop the programs, you will want to try each program as it is presented in this manual. Therefore, this section is placed here with the intention of familiarizing you with the learn mode and hopefully assist you in bridging the gap between writing a program and using a program. Your calculator can recelve program instructions from the keyboard only when its in the learn mode. Conversely, any keystroke (except the four discussed in Editing Programs a few pages later) made when the calculator isin the leasn mode is recelved by the calculator as an instruction. This is an extremely important fact because il means instructions should be entered with care and that keyboard calculations cannot be performed in the learn mode. |tyou make a mistake while keying in an instruction, you don't need to start all over reentering the entire ‘Sequence of instructions. Your calculator has keys that make it possible to correct a keystroke entered by an erroneously pressed key, to delete instructions, and to add instructions. These keys are discussed in Editing Programs. Following these simple steps should allow you to enter any program. 1. From the keyboard, press [2nd] [IBM to position the program pointer at location 000 and clear all of program memory. "2. Pross [Zito place the calculator in the learn mode. (Refer to Displaying the Program on the opposite age for an explanation of the display format.) 3. Key In your program, nat forgetting any necessary [2nd] prefixes, 4. Make sure your program does not exceed the program memory size. If too many instructions are entered, the calculator switches to keyboard control, and the lear mode display format is conspicuously absent. 5. Switch from the learn mode to the keyboard control by pressing (TR). 6. Run test problems and correct or edit your program according to the procedures outlined in Editing Programs. v.16IV Programming Considerations Displaying the Program ‘The display format of the learn mode is designed to show you where the program pointer is positioned ‘and the instruction presently found at that location. Turn your calculator on and press (LRN) to enter the {earn mode. A unique display consisting of two groups of zeros should appear in the display. The group of three digits on the lett shows you where the program pointer is positioned in program memory. When writing a program, assign each instruction to a location in program memory. This not only allows. you to keep track of instructions, but tes the calculator the order in which to complete the instructions as well. Since your calculator can only understand numbers, each key is assigned a two-cigit code number known as akey code. The group of digits on the right dispiays the key code corresponding to the instruction stored in the program memory location indicated on the left. The general rules for coding the keys are: 1. Allnumeric keys are represented by their appropriate number, thus key [7] is coded as “07.” 2. All other first function keys are assigned key codes relative to their location on the keyboard. The first digit denotes in which of the nine rows (numbered 1-9 from top to bottom) the key is located. The second digit establishes the column lecation (numbered 1-5 from left to right). in the learn mode, a instruction (row 3, column 4) stored in program memory location 073 would appear as in the lay below. 3. Second functions are coded by adding five to the column position. The row number is not changed. For example, located above [¥=] (key code “34"), is coded as “39”. [2nd] II. however, located above the ( va] key (key code “35"), is represented by “30" rather than “40" as the row number remains the same. You may use the key code overlay supplied with your calculator to help acquaint yourself with these ‘eades. Key code charts are also found in Instruction Codes (Key Codes) in Section V. im special cases the instructions may be combined and stored in one program location. When this ‘rappens, the key codes are also combined ormergad into a single two-digit code. [RCL] 12 for example, is ‘swred in two program locations. [RCL] is stored in the frst location and the sequence [1] merged and stored in the second. In this example, the key codes are merged into the two-digit code “42”. Here, “12” is not interpreted as the user-defined key instruction as any memory operation tells the calculator to translate the next instruction it encounters into a data register address. Other special cases are discussed as they arise. IV-17Programming Considerations IV Elapsed Time Program Write a program that may be used to determine the elapsed time between two specified times. You may enter the time in hour.minute-second format (¢.g., 3:16:03 = 3.1603) and convert to decimal format for ‘computation using [2nd} EE . See the discussion of this conversion in Degree Format Conversion in Section Il. 7 000 Define Label [A] | asFirstTime | (Go ME 2] 01 f ove Convert To | Decimal Format | and Store 1 InMemory 1} {Stop Program) | 0s | Enter Second Time To o10 Display Elapsed Time In HourMinute-Second Format Press [R/S] To Display Result In Decimal Format osIV Programming Considerations Let's perform this exercise using the following procedure. First, press [2nd] jj to clear program memory and to place the program pointer at location 000 and then enter this program according to the procedure outlined below. z a Display 000 00 001 00 002 00 003 00 004 00 004 00 006 00 007 00 008 00 009 00 009 00 011 00 *011 00 013 00 014 00 015 00 016 00 017 00 *017 00 018 00 020 00 ao eae SRR g Ha Since you intially cleared program memory using [2nd] BI all Key codes are displayed as 00 as you ‘enter this program. This is because once a program location is filed the program pointer advances to the next location and displays the key code of the instruction stored there — not the instruction just entered. "These displays do not appear consistent; however, observe that short form addressing is used here. What happens is that the calculator is waiting for the data register address to be completed. In the first ‘occurrence, for example, if [STO] 04 ressed 005 00 would appear in the display. In the above, however, the nonnumeric keystroke [R/S] . tells the calculator that the address stored in 004 is complete in 005. The pointer then automatically advances to 006 as location 005 Is Iv-19Programming Considerations IV Follow this procedure to verify that you have entered the program correctly. If you have aPC-100A or PC-100C Printer, just press [RST] MEE 10 obtain this listing. Press |[R7S}to stop listing. Corresponding Display Keystrokes 000 76 (Poe) SE 001 11 iy 002 68 [2ng) 3 003 42 004 01 oD 005 91 Bw 006 88 (2ee) ES 007 22 cou) 008 44 wu 009 01 o 010 43 ott 01 o12 94 013 22 (inv) 014 88 (Gad) 015 91 016 43 017 01 018 94 ss 019 91 Now that you have correctly programmed your calculator, run this program using 2:16 for the first ime and ‘3:42:54 for the second. Enter Press Display Comments 2.15 ) 2.25 1, (H.MMSS}*t, (H.hh) 3.4254 RA 1.2754 t(H.MMSS)-~at (H.MMSS) 1.465 —At( H.hh) The elapsed time is 1 hour, 27 minutes, and $4 seconds, or 1.465 hours. itin running this program you obtain an output such as 6.396 in the hour.minute-second format interpret this result as 6 hours, 39 minutes, and 60 seconds which is equivalent to 6 hours and 40 minutes. 120 }IV Programming Considerations Editing Programs While in the learn mode you have the following capabilities: 1, Display the instruction stored at any program location you choose. 2. Replace an instruction with another. 3. Delete an instruction and close up the hole. 4. Create a space for an additional instruction without destroying previously programmed instructions. 5. Single-step forward or backward through program memory without disturbing its contents. These features allow you to inspect, correct, and modify a program without having to reenter correct instructions. pressed while in the learn mode without being interpreted as a program MERE, and IEE. Briefty, [SST] and [BsT| allow you to step forward and ‘backward through program memory and examine its contents one location al atime. From the keyboard, [SST] may be used to execute a program one step at a time allowing you to observe the results ‘of each operation. The {GBI instruction causes the current instruction and all following instructions to be advanced one location in program memory while inserting a null instruction at the current location. if an instruction is stored in the last program location itis ost as a result of pressing this key. Pressing 2nd) SEEM causes the instruction at the current program location to be deleted and shifts all following instructions back one location, and fills the last location with a zero. ‘Two additional keys useful in program editing are [RST] (Caution: [RST] performs several functions. See Basic Program Control Functions in Section V.) and [G¥0) . Pressing [RST] from the keyboard places the program pointer at 000. Pressing (@TO] followed by a three-digit absolute program address or a label, ‘epositions the program pointer to that location in program memory. (Leading zeros may be suppressed in short form addressing.) Pressing [GT0] followed by a label address causes the program pointer to be positioned at the first location following the label in the program. Entering the learn mode following any of the above sequences allows you to examine the contents of program memory at the desired location Note that if these keys are pressed while your calculator is in the learn mode they are interpreted ‘88 program instructions, you want to change a program sequence, locate the sequence using one of the methods described above and simply cover up the old instructions by entering the new ones or add and delete instructions as needed, welProgramming Considerations IV Improving the Elapsed Time Program Let's modify the last program so that the second time may be changed without reentering the first time. ‘Make the modification after the original program has been entered rather than keying in the entire program again. We need to do three things. First, use a label to enter the second time so that this segment of the program may be accessed directly. Second, provide a means of saving the first time so that it may be retrieved after computation. And third, set up the program to accept a new second time after computing the elapsed Set Up Program | ToAcceptNew | ‘Second Time | (First Time Is Placed In Memory 1, Time Difference In H.MS- Format is Stored InMemory 2 and Decimal Difference Is Leftin the Display Register) 1 i Display Elapsed ime In Hour Minuta-Second Format {Decimal Difference Is Saved In Memory 2) (2nd) 2) Display Result In Decimal Format time, T 00 Define Labet A} | asFirst Time | (2a) MEA oot } oe Convert To. i Decimal Format | and Store I so) InMemory 1 (R/S) (Stop Program) | a) 0s + 006 Define Label i ccd DMN] | ConvertTo 5 “~ DecimalFormat | (2nd) OH and Store | [soz] InMemory2 | oto SaveFirstTime | en and Call 1 Second Time To | Display Register! (FistTimets | Storedin | Memory 2) I ov q t os Compute Time [INV] SUMT] Difference In| Raj HourMinute-Second | we Format 1 LINE 2 EY oz ‘There is a mistake in the key sequence given above. 1v.22 See if you can find it before reading further, 026 oaIV Programming Considerations Press ([er9} (6) BEES a GGG0G8‘aG 86a (ad) a Display 006 88 006 00 006 00 007 00 008 88 009 22 009 00 009 00 010 00 011 00 011 00 012 00 013 00 013 00 014 00 018 43 021 22 023 91 023 00 023 00 024 00 025 00 025 00 026 00 027 00 027 00 028 00 Make the necessary changes according to the procedure outlined below: ‘Comments, Set program pointer to location 006 Enter learn mode Insert label [8 | ‘Advance program pointer one step Insert instructions 009-014 ‘Advance program pointer eight steps Insert Instructions 023-028 Exit learn mode 1v.23Programming Considerations IV You may use this procedure to verify that you have modified the program correctly. Press (st) (URN) Fae@eeaees Display 000 76 001 11 002 88 003 42 004 01 005 91 006 76 007 12 008 88 009 42 010 02 O11 43 012 01 013 48 014 02 015 22 016 44 017 01 018 43 019 07 020 94 021 22 022 @8 023 48 024 02 025 48 026 01 027 48 028 02 029 91 030 43 031 01 032 94 033 91 Corresponding Keystrokes @ icy oo aaa ae CACEERE DAMES SESIV Programming Considerations Run this program using 1:30 for the first time and 2:13:57 and 2:14:24 for the second times Enter Press Display Comments 13 w 15 t, (HH.MMSS)~t, (HH.hh) 2.1387 w 0.4387 te (HH.MMSS)-+at (HH.MMSS) eS) 15 2 ‘The example is discontinued here because this last answer is obviously wrong. The output should be the elapsed time in decimal hours; however, itis the negative value of the first time represented in decimal hours. Upon inspecting the flow diagram and the accompanying keystrokes, you can see that the desired output has not been lost. The exchange sequences of steps 023-28 have merely transferred this information to data register 2. Therefore, the problem may be eliminated by changing step 031. This correction can be made by simply replacing the instruction. Press Display Gols |G) 031 01 032 94 Now, run the program again. Enter 3 Display Comments 13 15 +4) (HH.MMSS)-+t, (HH. hh) 0.4357 ty (HH.MMSS)—=A t (HH.MMSS) 0.7325 at (HH.hh) 0.a4e4 tt (HH.MMSS) at (HH.MMSS) 0.74 “At (HH.hh) 1-28Programming Considerations IV Editing with Merged Code Let's suppose for a moment that the output in the above example had been left in data register 12 instead of 2. Hf this were the case you would need to store 12in program location 031. Here, you should be extra careful to ensure that this code is properly merged. (See Displaying the Program a few pages back.) One method of entering this code is described below. Press Display [a] 30 ° 030 43 (kai) 031 01 mr 032 94 itRN) 0 This procedure requires that the [RCL] instruction be reentered so as to instruct the calculator to automatically merge the data register address and store it in a single program location. Observe that short form addressing may be used for program addresses. 1.26IV Programming Considerations Typical Programming Applications PROGRAMMING IS PERSONAL Before proceeding, itis important to understand that programming Is very definitely a personal thing. This ts to say that two people programming the same problem do not necessarily arrive at the same program instructions, although they may get exactly the same result, This is because we are all individuals, and often approach a problem in different ways. Organization processes can differ as a result of different ‘educational and career backgrounds. An engineer with a great deal of mathematical training would probably need to choose an approach requiring the use of complex mathematical equations, whereas @ liberal arts major with jess mathematical training may solve his problems using basic arithmetic functions ina different approach. One person may be satisfied to use a set of instructions taking a great deal of program memory space, while another person may prefer to look for ways to condense his program to Use the minimum amount, Each of us will want to choose a familiar approach. Your style should grow as you get into the process of programming. You should even find this learning period adventurous and best of all — fun! Don't be afraid to make mistakes through exploration — your calculator won't mind. Tying up a large-scale computer can cost a lot of money, so beginning programmers are often kept away. Your calculator charges you essentially nothing for its time — so take advantage of this fabulous opportunity and experiment with alternate routes, functions, patterns and anything else you can think off INVESTMENT CALCULATION PROGRAM What advantages do programmable calculators offer? The programmable calculator is designed to obtain solutions faster and with less chance of making errors through repetitive entries. Now, to program a problem that demonstrates how it saves time. At one time or another everyone has had a savings account where they received interest on the money in the account. If 5% interest per year is received on an account worth $1000, at the end of one year $50 in interest is added making the account worth $1050. The $1000 in the account today is called the “present value” of the account because it has received no interest. But at the end of one yaar you would expect it to be worth $1050 which is its “future value.” Compounding interest means that once money is placed in an account itis left alone for two or more periods and at the end of each period, interest is added ‘to what was in the account at the beginning of that period. Thus interest is also earned on interest such that the original $1000 is worth: $1000 + $1000 (.05) = $1050 at the end of the first year $1050 + $1050 (.05) = $1102.50 at the end of the second yearProgramming Considerations IV Nearly everyone is familiar with but may not be aware of the expression for this concept, which can be “The future value of money equals its present value times one plus the interest rate multiplied by itsetf the number of compounding periods.” Mathematically: FV=PVx(1+in Before writing the program, you should logically lay out what is to be done. First the interest rate should be entered into the equation as a decimal, Let the calculator do this by dividing the interest rate by 100 atter itis entered. Also, savings institutions use various periods in compounding interest (quarterly, daily, etc.). Flexibility may be added to the program by providing a means to tell the calculator how the compounding is done. Incorporating these changes into the future value equation it may be rewritten as: : Pe nom [r (de*)] ‘The variables used above are: FV= future value of investment PV= present value of investment i= annual interest rate c= number of compounding periods per year n= number of years of investment Now you should decide whether to enter the variables into the display as each is called for or place them in memory to be recalled as needed. In this example they are placed in memory. This allows the variables to be entered individually making it easier to evaluate different possibilities. Note that when a program is. to be rerun using previously entered data, care must be taken to preserve the original data. This is the modification that was required by the elapsed time program example. ‘The approach has been decided, the equation structured to reflect the variables desired, and it has been determined how to handle the variables, Now diagram the approach and write the program. NOTE: In Europe itis usual to quote annual effective rates for compound interest. These are not simple uttiples of the compounding period rate of interest, but are themselves governed by the compound interest equation. For the sake of simplicity, only the U.S, method is used here. 1.28Programming Considerations Define Label [A] asPV Detine Label [8] asi Define Label asc Define Label asn (ej @ Define Label [E_] To Start Program Convert iTo Decimal Format Find Interest Per | | years] ‘Compounding Period Determine Compound { Interest Factor I ForexnPeriods | Multiply ByPV | ToFind FV tL Display FV Rounded To Cents Investment Calculation Program 1v29Programming Considerations IV USER INSTRUCTIONS Step Procedure Enter Press Display 1 | Clear Program Memory and Reset Program Pointer 2 | Enter Learn Mode 000 00 3 | Enter Investment Calculation Program 4 | ExitLearn Mode ° 5 | Enter Present Value Pv Pv 6 | Enter Annual Interest i i 7 | Enter Number of c c Compounding Periods Per Year 8 Enter Number of Years: a th n 9 | Compute Future Value ce] FV Variables May Be Entered In ‘Any Order — There Is No Need to Reenter Variables That Do Not Change For New Problems 1-30IV Programming Considerations Location Location andKeyCode Key Sequence and Key Code 000 76 025 01 001 11 026 00 (o] 002 42 027 00 (ol 003 01 028 55 =) 004 91 029 43 005 76 030 03 (3 006 12 031 85 +) 007 42 032 01 wm 008 02 033 95 E 009 91 034 45 F) 010 76 035 53 tO 11 13, 036 43, o12 42 037 03 cy) 013 03 038 65 od 014 Of 039 43 (Rei) 015 76 040 04 wo 016 14 41 54 017 42 042 65 018 04 043 43 (Rai) 019 Of 044 01 (1) 020 76 045 95 5 021 15 046 58 ma 022 43 047 02 (2) 023 02 048 91 024 65 Investment Calculation Program 1-31Programming Considerations IV Find the future value of a $3,000 investment 5 years from now if the annual return rate is 8% compounded daily and compounded monthly. Enter Press Display Comments 3000 fy 3000, Pv 8 (ay 8. i 365 365, c 5 @) 5. n ica 4475.28 Fv 12 we 12.00 c 4469.54 a +All results from this point on are displayed with the decimal fixed at two places. Also, the T| Programmable 58C will retain the fix-decimal at two places until you change it, even if turned off. PRICING CONTROL PROGRAM ‘Thus far we have used the calculator data registers primarily for storing and recalling variables. However, the calculator can add to, subtract from, multiply and divide the variables previously stored in data registers without recalling them. Using the memory in this fashion is often referred to as memory arithmetic. The value of memory arithmelic is demonstrated by the sample program below. Also note that an extremely useful program can be developed using only simple arithmetic, further emphasizing the fact that programmable calculators are ideal and easy to use in solving any type of program — not just ones involving complex mathematics. ‘Assume the normal purchase order received in a business is comprised of lke items selling at various prices. In order to invoice the customer, multiply the quantity for each line item by its unit price to find the fine item price. Then sum each line item price to determine the total order price. Additionally, to keep a record of the average unit price of each order, you must total the line item quantities and divide the sum into the total order price. This process is not difficult, but itis time consuming, Line Item Quantity Unit Price Line Item Price 1 100 $0.25 $ 25.00 2 200 0.15 30.00 3 50 0.35 17.50 4 150 0.40 60.00 5 300. 0.10 30.00 Total Order 800 $162.50 Order Avg. Unit Price $0.203125 1.32IV Programming Considerations A glance at the order immediately tells one to multiply, add, and divide. The key is how to organize the problem and what to instruct the calculator to do. Hyou need a program that can handle an unlimited number of line iterns, choose another approach. First, decide how to enter your variables. In the example below the variables are entered through the display while the program is running rather than storing them in data registers to be recalled at a later point in the program. if you use memory arithmetic to calculate the cumulative totals, each set of data is used only ‘once and does not need to be permanently stored in data registers. To save time lost by displaying intermediate data, the cumulative order quantity is stored in F, (data register 1 is denoted by A, data register 2 by R,, etc.), the cumulative order price is stored in R., and the current average unit price is, stored in Ry, The sample program is designed to display the line item price of a given line item after you enter the appropriate quantity and unit price; however, you may recall any of the other results whenever you need to see them. ‘One last note is that since the initial operations on A, and R, are to be sum instructions, the program should be equipped with an initialization routine which zeros these data registers. With this example, the importance of organizing the approach should be apparent. The first approach would have limited the capability of the program by fixing the number of line items that could be handled for any one order; the second approach allows an order to have an unlimited number of line items. 1-33Programming Considerations IV Now flowchart the problem and determine the keystrokes needed in the program. « Lo nmee shee | mete Rows toceres | MOM’ ws | on teehee iy | MNCS | ta Oweninecanshnve | 3] Quanity ardSave | STO Them Quantity | Enter Uni Price and Press FA) Fird Line tem Pricwand Cumuiave | OrerPree | Fing Curent ‘Average Unit Price wea Ente _______™ Gosttter fio Pross[B]T> | [2nd Display Cumuianve | [RCL Craer Quanity | aaa] Press to 1 2nd) EE) Display Cumulative ' L ‘fReL) "3 | ms Press [8] To Display Average Unit Pros ‘Order Price }___ 4) Pricing Control Program 134Programming Considerations USER INSTRUCTIONS Step Procedure Enter Press Display 1 | Clear Program Memory and rc | Reset Program Pointer 2 Enter Learn Mode (RN) 000 00 3 | Enter Pricing Control Program 4 | Exit Leam Mode o 5 | Initialize Program @ 00.00 6 | Enter Line Item Quantity Quantity mw Quantity 7 Enter Unit Price Unit Price Line Item Price Repeat Steps 6 and 7 for Each Line Item After Each Line item Entry the Following Variables May Be Displayed: Cumulative Quantity wo Order Quantity Cumulative Cost faa] Order Price Average Unit Price ( Average Price 1V-35Programming Considerations Location Location andKeyCode Key Sequence and KeyCode Key Sequence 000 76 oO 024 01 wo 001 15 e 025 95 ee) 002 47 fa 026 42 003 25 027 03 @ 004 58 (2nd) A 028 43 005 02 [2] 029 04 cz 006 91 RA 030 91 007 76 031 76 (2nd) 008 11 @ 032 12 009 44 (sum 033 43 010 ot ian} 034 01 Oo ont 42 035 91 012 04 ta 036 76 2nd) ON 013 91 037 13 014 49 mm 038 43 (Ret) 015 04 (4) 039 02 (J 016 43 049 91 017 04 4) 041 76 (eq) CN 018 44 SOM 042 14 (BI 019 02 ea 043 43 020 49 044 03 3] 024 02 045 91 022 55 023 43 Pricing Control Program 1V.36 <IV Now let's run the program using the data given earlier, Enter % GSE BE BE BH BH BRHF 3 a Programming Considerations Display 0.00 100.00 25.00 200.00 30.00 50.00 17.60 150.00 60.00 300,00 30.00 800.00 162.50 0.20 0.203125, Comments Initialize Quantity A Unit Price A Line Item Price Quantity 8 Unit Price B Line item Price Quantity C Unit Price © Line item Price Quantity D Unit Price D Line item Price Quantity & Unit Price E Line tem Price Total Order Quantity Total Order Price ‘Avg. Unit Price (Rounded) ‘Avg. Unit Price (Exact)Programming Considerations IV SPHERICAL COORDINATES PROGRAM ‘Write a program to convert from spherical to rectangular coordinates. X= psin cos 4 y= psin d sind 2= pcos Your calculator has a builtin function, [Zad] Ea] thats preprogrammed to convert from polar to rectangular coordinates. (See Conversions in Section V.) This function could be ‘very useful here. The easiest way to enter the spherical coordinates is to simply store p, 4, and @ in data registers Ri, Re, and Ri respectively. Instructing the calculator to place p in the Fregister and ¢ in the display register, allows 2 to be found by converting to rectangular coordinates using EE]. This conversion places p sin @ in the display register and p cos 6 (=z) in the T-register. Storing Z in Ru for safekeeping and Placing p sin ¢ in the Tregister, itis possible to use this conversion again to find x and y after recalling 6 to the display register. The program should be designed so as to display x, y, and z in the given order by using the [R/S] key. 1-38Programming Considerations T 900 1 nd) ME CAI Defi Label [AT | (s&s) Define Label 6}! [nd] KEN C81 C2 as Define Label asé ona 1 os Define Label 0] | ToCalculate | (2nd) EEN C2) Coordinates. | or on7 Convert (p, 6) To (2, p sin 6) oz Place psingin | TRogister ; _ tl andSiowez | (S10)[4] Ine 02s. 06 Convert(psing,6) | RAILS] Tolx. y) U Le 028 1 9 Display x | t 031 Pross RBI! (=) Displayy | [RR ose + 033 ; 4) Displayz | i 035 Spherical Coordinates Program vseProgramming Considerations USER INSTRUCTIONS Step Procedure Enter Display Noose ow 8A 88 8c Clear Program Memory and Reset Program Pointer Enter Learn Mode Enter Program Exit Learn Mode Enter p Enter d Enter ¢ Compute Coordinates and Display x Display y Display 2 w w tel @ A 000 00 1v-40IV Programming Considerations Location Location and KeyCode Key Sequence and KeyCode Key Sequence 000 76 (2nd) ON 019 32 oot 11 el 020 43 002 42 (Sto) 021 02 003 01 Ga 022 37 004 91 023 32 005 76 (zn) ( 024 42 006 12 (3) 025 04 007 42 026 43. 008 02 Ql 027 03 009 91 028 37 010 76 (2nd) 029 32 011 13 tc 030 91 012 42 [0] 031 32 013 03 Bl 032 91 014 91 033 43 018 76 (2nd) 034 04 016 14 is 035 91 017 43 018 01 a ‘Spherical Coor: WeltProgramming Considerations IV Example: Convert p = 19.6, = 60°, 6 = 60° to rectangular coordinates. x Enter Press Display Comments: gq Place calculator in degree mode. 19.6 a 196 Pp 60 60 oe 60 ca 60 8 By 8.487048057 x FA 147 y 98 z 1-42IV Programming Considerations ADVANCED PROGRAMMING More About Labels ‘As you remember, the user-defined keys (A-E, A’-E’) are designed for use as labels. Once a program segment is labeled with one of these keys, pressing it from the keyboard sends the program pointer to that part of the program and the program starts immediately. In addition to the user-defined keys, you can use almost any first or second function on the calculator as a label. For instance, (2nd) REG « (=2}. C=) (Cur) (2nd) BAM (EE) . [2n8) (EB and others can be labels. These are ‘Common Labels. Only the following keys cannot be used as labels. os MEE numbers (0 ]- [93 The only difference between the common labels and the user-defined labels is that pressing a common label from the keyboard cannot start program execution. Even though you have a program segment labeled x, for example, pressing [¢2] from the keyboard simply squares the displayed value. The keyboard sequence [670] [x2] [R/S] does cause the program to start running at label x*. Nonetheless, you now have over 60 more labels to work with. Common tabels can be used anywhere in a program as can the user-defined labels. However, you must rot spit obvious instruction clusters like [STO] 12 or [2nd] [EM 6 oF [INV [2nd] I . Throughout the remainder of this section we'll primarily discuss user-defined keys as labels because of their versatilty. Transfer Instructions ‘There are several important instructions that further increase the programming capabilities of your calculator. They allow you extra flexibility of control over the order in which your program instructions are executed, These new program controls are called Transfer Instructions or | just simply transfers. They can. diver the normal "top" flow of a program by jumping to some other location. Basically there are two types of transfers, termed unconditional and conditional. Unconditional transfer instructions immediately branch to wherever the program asks, unconditionally. Unconditional transfers are independent of all calculations. A conditional transfer instruction on the other hand tests some value and transfers to a location other than the one next in line if that value fulfils the conditions of the test. v.43Programming Considerations IV Unconditional Transfers + [G10] and [SBR] are called unconditional transfer instructions. [RST] automatically positions the program pointer at location 000. (GTO]and unconditionally place the pointer at the location you ‘specify. Note also that [RST] performs additional functions that you should be aware of. (See Basic Program Control Functions on page V-43.} THE GO TO INSTRUCTION — [679] Back in Editing Programs you learned how to use the Go To instruction trom the keyboard. It's just the ‘same when running a program, [STO] followed by an absolute address or a label causes the program Pointer to go immediately to that location. Processing continues at the new location. Short form addressing can be used with absolute addresses (program memory addresses). In the learn mode, for example, pressing (G10]9 is the same as [6T0]009 if and only if the next keystroke is not a ‘number. Key in the following little program that counts. Display Comments 0. Prepare for program 009 00 Go To location 009 and enter lear mode 010 00 Key in program O11 00 012 00 013 00 014 00 014 00 Location number did not advance, waiting for rest of address 0 Exit learn mode 016 00 Program pointer advanced when first [ERR] signaled the end of the incoming address Torun this program, exit the learn mode and press (GTO) 9 (R/S). inprogram memory, absolute addresses are stored in two program locations. For example, the ‘sequence [670] 136 occupies 3 program locations. The first location contains the struction while the address is stored in the next two. The hundreds digit of the address goes into the first of these locations and the last two digits are merged to occupy the next. The resulting key code sequence is 61 01 36 in program memory. This compact way of doing things is called “merging” and is completely automatic within the calculator. I-44IV Programming Considerations Ty the following exercise on your calculator. Display Comments 0. Clear program memory and display 0. ‘Sends the program pointer to location 136 136 00 137 00 jin location 136 000 00 Return to 000 001 00 Store (GTO]in 000 001 00 001 00 003 00 Memory waits for ali 3 digits betore storing address. 002 36 001 01 Address stored as explained 000 61 oO. 0. Execute program 137 00 ‘Transfer is instantly made to location 136 where the [R75] stored there is executed, leaving the program pointer at location 137. The same thing would work for a label, Pressing (670) [ x2]. for example, from the keyboard sends the program pointer to label x? and awaits further instructions. If you ask the calculator to find a label that doesn't exist, the display flashes its current value. ‘You can see here how the Go To instruction works when used from the keyboard or in a program, The other transfers operate much the same way. As soon as they are pressed from the keyboard or encountered in a program, they transfer to the requested program location. WasProgramming Considerations IV SUBROUTINES, ‘As you begin writing more and more programs, you'll often find sequences of calculations that are performed repeatedly. These are called Subroutines. Subroutines give you the capability to define a “subprocess’ or sequence of keystrokes that have a unique purpose. These you can label and reference at any time from anywhere in your program almost as easily as if a key on the keyboard was devoted to it. Once a subroutine has completed its purpose, the program pointer repositions itself tothe first program location following the point where you began using it. When you use a subroutine — it is often said that you “call” it — you are telling the machine to run a whole sequence of steps with a single subroutine instruction. It's @ good programming practice to write your programs so that they can be used as subroutines. Now, they can be used by other programs without having to be modified. You may do this by simply using [iN] [SBR] to halt program execution instead of (R/S). The remaining programs in this section are written using this technique. THE SUBROUTINE INSTRUCTION — [S8R] The subroutine instruction is a Go To that has been modified in two ways — from the keyboard, it can start rogram execution and in a program, it remembers where it transferred from. From the keyboard, pressing 136 sends the program pointer instantly to location 136 and m execution automatically starts at that point. Itis exactly the same as pressing [GTO] 136 [R/S]. The same thing happens when you press [SBR] [x2], the program starts running at label (x2}, wherever it may be. if 136 had been keyed into locations 000-002 as [G70] 136 was in the previous example, it would have been executed the same way. But, when executed, program location 003 is stored in the Subroutine Return Register. Now, if there is a calculation sequence beginning at 136 that you have ended ‘with [INV] [SBR], processing would look at the subroutine return register, find 003, and bounce back to location 003 where processing continues. To get processing to go back where it came from, simply end the subroutine with [INV] [SBR]. What actually has happened is that you have transferred to a subroutine at 136 and retum is automatic when the [INV] instruction is encountered. 1-46IV Programming Considerations ‘Actually, as many as six retum addresses can be stored in the subroutine return register at any one time, This means that a subroutine can contain and use or “call” a subroutine that can also call @ subroutine, etc., — up to six times. This tremendous capability is shown graphically. : [J ol oo oO @)) ea i] Ge! : : : inv] =) Cm | : ow) ow) I) cw] ic) q@) ©) QN (555) Main First Second Third Fourth Fifth ‘Sixth Program Level Level Level Level Level Level Ifthe sequence of steps shown above was written as part of a program, processing would flow as numbered above. Note that [INV] [SBR)ends each subroutine, Instructing the calculator to go to the subroutine retum register and retrieve the address that was stored last and transfer there. Processing usually ends up back in the main program — the one that started calling subroutines. By the way, [SBRlis merged in program memory to occupy only one location as key code 92. This code doesn't match the row/column key designations. When a program partis labeled with a user-defined key, that part can be executed from the keyboard simply by pressing the applicable label as we have seen. The same thing happens when one of these keys is encountered in a program — the program pointer goes to that label and processing continues. ‘These user-defined keys have an automatic (SBRlinstruction built in. So, if you label a program part with a user-defined key and end it with [INV] (SBR), that part is processed just as though you had called it with the [SBR|instruction. watProgramming Considerations IV ACCESSING OR CALLING SUBROUTINES To clarify the definition, a subroutine is a segment of a program designed for a specific purpose —to be written once, but used repeatedly. All subroutines must end with (SBR}to instruct processing to return to the sequence that called it. There are three methods of calling subroutines. * Absolute address, (SBR) 136 + Common label, Te) *+ User-defined label, (A) Labeling subroutines adds clarity and simplicity to the program instructions. A label descriptive of the Purpose of the subroutine can even be used. You should choose your labels well and record the meaning of each, Labeled subroutines can be placed anywhere in program memory because, when called, a label can be found regardless of where its. Also, a subroutine that is labeled is not affected by insert and delete instructions that are performed ahead of the subroutine in program memory. To have a program evalvate x* + 3x for incoming x values, simply key in the following, wasIV Programming Considerations For demonstration, let's let subroutines do our storing and racalling. The program looks like this. Main part of program Subroutines 000 Lb 001 A 002 SBR 012 Lol 003 © sto | ota sto 004 xe 014 STO 005 + 015 01 006 3 lh 016 INV SBR 007 x 017 Lot 008 SBR 018 RCL 0s RCL 019 RCL oo 80 = 020 01 oS —~{_024_INV SBR Enter any x value and press [_A_]. The sequence of processing is charted by the arrows. Note that a user-defined label is used to start the program because that's the easiest way to do it. The subroutine names were chosen to identify their respective segments, but other {abols could have been used just as well. THINGS TO WATCH OUT FOR IN SUBROUTINES ‘wo instructions that should be used very carefully in subroutines are Reset and Equals [=]. Also you need to be sure that the subroutine return register is cleared before the start of a new problem. The reset instruction, among its other functions, automatically clears the subroutine return register. f you do need to transfer to location 000 (the primary function of [RST]) in a subroutine, use [GTO}000 or a label it there is one at 000. The equals instruction completes a pending operations. if used in a subroutine, the pending operations not only of the subroutine, but those of the main program are completed as well. 1-49Programming Considerations IV Consider the following program segment to evaluate 4 + (1 +2) x 3. ) (34) og GB) Se (2nd) MEN C2?) of (2) ej ‘The equals here in subroutine [x7 }not only completes 1 + 2, but [inv] also the 4 + before returning to the x 3. The resulting answer is now 21 where it should be 13, This program can be easily modified to correctly handle the problem by using parentheses to evaluate the ‘subroutine. This sequence yields the correct answer, 13. 1-50IV Programming Considerations Beginning each subroutine with [_] and placing [7_]right before the (INV] [SBR] are a good habit to develop. It takes an extra keystroke as opposed to using [ =], but can save you much misery down the road, the primary advantage being that parentheses affect no pending operations other than those contained within that parenthesis set. ‘Avoiding the equals [=] instruction in such cases should impose no hardship as parentheses are designed to selectively complete expressions like this. However, there are some things you need to know tose the current display register value in the subroutine. Whenever a subroutine requires repeated access to the display register contents at the time of the call, you should store the variable in a data register prior to performing calculations and recall it whenever it is needed. If the contents of the display register are needed only to begin computation, the [CE] key may be used as a trick to pull this value inside the parentheses. This trick works the same in a program as it does from the keyboard. 22.18 XO In the above sequence th evaluate 2.18 x (2.18 +6) Pre: me Display: 17.8324 key pulls 2.18 inside the parentheses and enabies the calculator to 7.8324. Occasionally you may design a program so that completion of a program occurs inside a subroutine. In other words, the answer to your problem is found without returning control to the calling routine. In such situations return of control remains pending as the subroutine return register has not been cleared. Uniess you turn the calculator off, use [RST], or clear the return register using the[2nd] I instruction, difficulties may arise when you run a new problem, as erroneous transfers to the previous return addresses may result. To prevent such left-over return addresses from ruining future solutions, you should use the [RST] instruction to clear the subroutine return register. You may do this manually, but itis preferable, whenever possible, to include[RST] at a proper point in the program. IV51Programming Considerations IV LIBRARY PROGRAMS AS SUBROUTINES ‘You may often find it quite useful to extend the power of a program you write through effective use of library programs. The same instructions used to access these programs fram the keyboard can be built right into your program. The library programs simply become subroutines of your program in program memory. Thousands of instructions worth of subroutines are stored in each of the library modules. Each Program of a library is a subroutine. Most do not use[ =] [R/S] or[RST], are evaluated with parentheses and end in{inv} From the keyboard, pressing [iJ mm relocates the program pointer to the library program numbered mm. Upon completion ofa library program segment, the program pointer remains in that program. Ina program, the function of [Ml is similar to that of the instruction. The only difference is that (2nd) [fj mm tells the calculator to look for the subroutine in library program mm rather than in program memory of the calculator itself. Once the library routine is completed, the program pointer returns to the point of call in program memory and normal processing continues. The two-digit program ‘number is merged and stored in a single program location. {a segment of a library routine is identified by a user-defined key such as [A]. the program sequence required to execute that routine is [2nd] (J mm [A]. Ifa label such as Bis used, the sequence becomes fand} EI] mm (SBR) (Zed) MEI. Note that following [2nd] [MI mm with anything other than [SBR] or a user-defined key is not a Valid key sequence and can produce unwanted results. 1-52IV Programming Considerations BIORHYTHM PROGRAM Let's examine an illustrative example of subroutines in action in an interesting program situation. The theory of biorhythms states thal there are three cycles to your fe that started on the day you were born: 1. The Physical cycle — 23 days long 2. The Emotional cycle — 28 days long 3. The Intellectual cycle — 33 days long, ‘The first haif of each cycle is said to contain your “up days” while the lower half represents “down days.” “Physical” cycle ‘Emotional” cycle "4 —— “Intellectual” cycle ‘The amplitudes of these biorhythm cycles on a given day may be expressed as a value between —1 and 1 using the following equation. . Number of Days Since Birth Amplitude sin (% *~" Number of Days in Cycle Now let's write a program designed to determine the ampltudes.of a person's biorhythmic cycles. Since each cycle uses the same equation, a subroutine may be used to simplify your program. Also you can use program 20 of the Master Library as a subroutine to compute the number of days since: birth. In the sample program below, the amplitude of each cycle is computed using the subroutine labeled [Ej since the only difference between calculations is the number of days in the cycles. We can use stop the program and display the amplitudes cf the physical, emotional, and intellectual cycies in that order. [INV] [SBR] is not used here because it would return program control to the main program rather than stop execution (see The Subroutine Instruction — {SBR] a few pages back). The final result of the program \s the average of these three values. All results are rounded to two decimal places for display. 1V53Programming Considerations Sonn | PRENCE) Clear Data Registers | (2nd) IW5t Enter Birth Date Into LUrary Program (Stop Program} Define EJ] as Current Dale | r Enter Current Date | Ino Library Program | (aod) RAD 2] CO] L T Compute and Store 1 Numberot | Days Since Birth Found Display | MASTER UBRARY PROGRAM Call Subroutine 1 “rind Ampttale™ | of Physical Cycle I Call Subroutine (Et tude | Call Subroutine [E] ToFind Amplitude of intellectual Cycle Biorhythm ProgramIV Programming Considerations Location Location andKey Code Key Sequence and Key Code Key Sequence 000 76 o 027 15 BB 001 11 ial 028 43 002 47 029 07 003 36 a 030 55 © 004 20 By) 031 03 wy 005 11 tm 032 95 e 006 92 | 033 92 (Gw) 007 76 gi 034 76 (2nd) 008 12 @ 035 15 fe] 009 36 (2nd) 036 53 co 010 20 2 037 35 on 12 a 038 65 : 012 36 039 43 013 20 2) 040 00 Col 014 13 tc 041 65 Bo O15 42 (sto) 042 03 Es] 016 00 frm 043 06 @ O17 88 (ag) A 044 00 (0) 018 02 @ 045 54 ol 019 02 @ 046 38 ed) 020 03 Gl 047 44 som 021 15 re 048 07 wa 022 02 Ql 049 91 wm 023 08 (a) 050 92 (NY) (SBR 024 15 re] 025 03 Bg 026 03 a Biorhythm Program 1¥-55Programming Considerations IV USER INSTRUCTIONS Step Procedure Enter Press Display 1 | Clear Program Memory and Reset Program Pointer 2 | Enter Lear Mode 000 00 3 | Enter Biorhythm Program 4 | ExitLeam Mode 5 | Enter Birth Date MMDDYYYY =| CA] 0 6 | Enter Current Date and MMOD.YYYY ‘Amplitude of Cormpute Amplitude of Physical Cycle Physical Cycie 7 | Compute Amplitude of Amplitude of Emotional Cycle Emotional Cycle 8 | Compute Amplitude of ‘Amplitude of Intellectual Cycle Intellectual Cycle 9 | Compute Average Average Amplitude Amplitude Example: Fred was born on May 2, 1944, Calculate his biorhythm for March 1, 1977. (Assume the Biorhythm program is still in program memory) Press Display Comments 502.1944 (A) 0. Enter birth date 301.1977 0.82 ‘Amplitude of physical cycle 1.00 Amplitude of emotional cycle 0.76 Amplitude of intellectual cycle 0.86 Average amplitude Fred seems to be in pretty good shape for whatever he attempts to do. Use this program to determine where you are in your biorhythmic cycles. When using library programs as subroutines in your own program, be extra careful as to which data registers you use and which ones are used by the library program. If you bath attempt to use the same data registers for different purposes, program results can be erroneous. Iv-56IV Programming Considerations Conditional Transfers (Decision Makers) Other features that are very useful in problem solving, are instructions that are capable of making decisions in your programs. A family of what are called conditional transfer instructions make this decision-making process possible. Each time one of them is encountered in a program, it makes some test and decides whether to transter or not — strictly dependent upon the outcome of the test. ‘There are three types of conditional transfer instructions, differentiated by what they test. 1. Compare display register contents to T-register EM. EES 2. Test contents of data registers 0-9 3. Test status of program flags WEY A transfer address follows each of these instructions. the answer to the test is "yes" (test positive), transfer is made to that address. If the answer to test (test negative), the transfer is skipped. For instance, if the test [2nd] EEN [A] is positive, transfer is made to (“A ] just as if (676) CA] had been encountered. If x is not exactly equal the T-register value, no transfer takes place. DISPLAY REGISTER VS T-REGISTER Whatis this Fregister? Well, T stands for “TEST” and the register itself is a data memory type of register where numbers can be stored and recalled and compared against the displayed number. The key that gets numbers into and out of the T-register is the “x exchange t’ key. This key simply swaps whatever is inthe display register, callit x, witht, the contents Fregister. Initially, O is in the register. Key 5 into the machine and press [xt]. Zero is now in the display and your 5 is in the register. Press [zt] again and the S retums to the display while the zero goes back into the T-register. That's all this key does. stProgramming Considerations IV Several instructions are available to compare the current display register value with the contents of the ‘register. These “test” instructions are “x equal to t” BB] and "x greater than or equal tot" BE. A program memory address, either absolute or label, must follow each of these instructions whenever they are used. When a lest is made, tor instance, “Does x = 1?” and the answer is “yes,” a transfer is made to the address following the test instruction. If not, the address is ignored and processing continues as ‘though no test had even been made. Graphically, here's what happens. To ‘Address +—) Transfer address Specified | Next location YH These instructions are designed for use within a program to direct the flow of processing, but they can be used from the keyboard as well. Try these few keystrokes. Press Display Comments 5 [zat] 0. Put 5 into the Fregister 6 [nd] BE 123 6. Place 6 inthe display and tell the calculator to go to program location 123 it x 1 123 00 Sure enough transfer was made because Gis greater than 5 (URN) 4 [2rd] E111 4 Back to keyboard control and test for x = 4 123 00 Still location 123, no transfer was made because 4 is not greater than 5 Back to keyboard control and test forx = 5 Now we've transferred because the display equals the Teragister value 5, 1V-58IV Programming Considerations SQUARE ROOT EXAMPLE Problem: Find the square root of any number x, entered into the display. If the number is negative, change its sign, then take the square root. Display LJ square Root ofxProgramming Considerations IV Location and Key Code 000 76 001 002 29 003 77 004 12 005 94 006 76 007 12 008 34 009 92 Cin] (s8R]) Now you can exercise the program. Enter 4, for example, and press (“A.]. 2s the result. Enter —4 and press [A Jand you get the same thing, 2. ‘These test instructions can also be used with [INV]to reverse the conditions of the transfer as shown below. Instruction Sequence Question Asked (Test Made) fa Is the display register value exactly equal to the ‘Tregister value? (inv [2nd] ED \s the display register value unequal to the Tregister value? (2rd) Is the display register value greater than or equal to the Tregister value? [iy] fx=tf Is the display register value less than the Tregister value? When the answer is “yes” to any of the above questions, the flaw of processing transfers to the address, that immediately follows the instruction. If the answer is “no,” processing simply ignores the accompanying address and goes to the next location of program memory. 1v-60IV Programming Considerations FLAG OPERATION What is a program flag and how can it be used in a program? A flag is an internal switch that is either “ON" or “OFF.” (Figuratively speaking, a program flag is either raised or lowered.) A flag can be turned on (or sel} at some point ina program and tested at a later time. This raising, lowering and testing of flags is independent of the display register and data memory. Now, when would you want to use a flag? Flags have numerous uses, three are listed below. + Controlling program options manually from the keyboard before running a program + Program conditions set a flag for later testing * Keeping track of execution history — which path through the program has led to the present point? Actually, there are 10 individual flags, numbered 0-9, that you can use. Consequently, with each flag instruction you must specify to which flag you're referring. The instructions that control flags are defined below. + To set flag y, press [2nd] BEY + Toreset flag y, press [INV] [2nd] BRAY + To test flag y and transfer if itis set, press (2nd) INF y, then complete the instruction with a transfer address just like the test instructions, mentioned earlier. + To test flag y and transter if itis not set, press [INV] [2d] MIM . followed by a transfer address velProgramming Considerations IV These instructions operate from the keyboard as well as in a program. Key in the following and observe the effect of flags. Press Display (no) 0. (ena) Ba 4 0. (zea) MIEN 4 138 0. 138 00 (ang) NS 111 0. . 136 00 (Een! (NV) (2na) 4 0. (2nd) BQ 4 222 0 138 00 (URN) [NV] (2nd) MIEN 4 222 o 222 00 ‘Comments Clear program memory and display. This instruction also resets or turns off all program flags and clears the Fregister. Set flag number 4 Test flag 4, if set, go to location 136 ‘Transferred to 136 because flag is set Test flag 5, if sat, go to location 111 Did not transfer because flag is not set Reset flag 4 Test flag 4, if set, go to location 222 Flag is not set, so no transfer is made Test "If flag is not set — transfer to 222” Flag not set, so transfer to 222 is performed. ‘The Fiag test instruction behaves similar to the T-ragister tests. The difference is that these instructions test flags and the Tregister tests compare the display to the Tregister. Remember that the transfer address following this instruction can be an absolute address as was used in the exercise above or can be a label of either type (user-defined or common). Setting a flag that has already been set, resetting a flag that has already been reset, and the testing of a flag have no atfect on the status of the flag nor do they affect calculations. All flags can be reset at once with [RST] or (2nd) AO Also, note that you cannot directly see if a flag is set (on) or reset (off) in the display (as you can with the ‘Fregister or any other data memory). You can only "see" it by testing it. 1-02IV Programming Considerations The following situation illustrates the first of the three uses mentioned for flags, how they can be used manually from the keyboard. Suppose you are a train dispatcher in a switch tower. A train is going down the track. It encounters a signal at a junction. If the signal is raised, the train is switched to the San Francisco track. Ifthe signal is lowered, the train is transferred to the New York track. As a dispatcher, ‘you must raise or lower the signal which, in turn, controls which track the train takes. Likewise, you can manually set and reset flags to determine which part of a program is to be executed TRAIN STARTS, MANUALLY RAISE SIGNAL (SET FLAG) IF SAN FRANCISCO TRAIN LOWERED RAISED NEW YORK SAN FRANCISCO Manual (Keyboard) Flag Operation When working with a program, you can set flags manually from the keyboard to control program ‘operation. For instance, you may have a cost control program in the calculator and a series of credits and debits to be digested by your program. Since debits are to be handled differently than credits, set a flag for ‘he debits and the program should be designed to check the flag and process the incoming entries accordingly. Now, let's modify the train example to show how the trains themselves could raise and lower flags. This situation demonstrates the principle of program conditions setting flags. Let's say that the New York and San Francisco expresses are to be specially routed to their destinations. 1-63Programming Considerations IV RAISE SIGNAL LOWER SIGNAL (SET FLAG) (RESET FLAG) ‘SIGNAL RAISED CEST FLAG) LOWERED :W YORK SAN FRANCISCO Automatic (Program) Flag Operation “The routing system asks each train: “Are you a New York express?” f the answer is “yes,” a flag is raised. It the answer is “no,” the flag is lowered. This flag is checked later for routing — if itis raised, the train is, shunted to New York; ifthe flag is lowered, itis sent to San Francisoo, Similarly in a program, the most recently calculated value can be asked “Are you negative?” or "Are you greater than 10002” or many other questions. If the answer is “yes,” set a flag and test it later when you need to choose processing ‘options. ‘The third use of flags gives the program a means of remembering how it reached a given point. This is necessary in situations where what you wish to do depends on which path your program has taken. You recall that the program pointer only knows where it is and has no recollection of how it got there. Such recollective ability is sometimes needed, however, and the program flags provide a convenient way to do this. Just place [2nd] KJNFLy in one path and [INV] [2nd] EIEN in the other path. Itis not wise to leave this ‘other path blank as future runs of the program could cause errors ifthe flag is not reset. Then you can easily determine which path has been followed with (2nd] ff y. For instance, a flag can tell you which of two possible interest rates was applied in a program or if a number's sign has to be changed before it can be operated on or lots of other choices. AV-64IV Programming Con ‘SPECIAL FUNCTIONS OF FLAGS ‘Some flags are internally programmed to perform special functions as follows. Flag7 Flag 8 Flag 9 HEI instructs the calculator to set flag 7 if no error condition exists. Fiag 7 is set by the sequence (2nd) [IJIJ19 # an error condition does exist. (See SPECIAL CONTROL OPERATIONS on page V-27.) For the Tl Pro- grammable 58C only, [2nd] iJ 40 instructs the calculator to set flag 7 ifthe PC-100A or PC-100C printer is attached Setting flag 8 causes the calculator to stop a program if an error occurs while @ program is running. It you are using your calculator with the optional printer, you may control the trace mode of the printer with flag 9. If flag 9 is set, the printer is placed in the trace mode and calculated results are printed after each new function o operation. Ifflag 9 is reset, then results are printed only by a print instruction. Flag 9 may be used normally if you are not using the optional printer. METRIC CONVERSION PROGRAM Create a program that converts meters to feet and kilometers to miles. Now obviously there are quite a few ways to approach this problem. The method used below converts the entered data to feet and then tests to see whether the input data was in kilometers or meters. If the test indicates the entered value was in kilometers, convert to mi if not, display the answer in feet. Ris used to store the intermediate result while the test is being made, The conversion factors are: 1 km. = 1,000 meters. {meter = 3.28084 ft 1 mile = 5,280Programming Considerations Iv-66 Metric Conversion Program oo T T DefinefR]as 1 Define 8] | fino ]es 1 a) EC] asMees | Gal MINCE tL oot { ow Convert Kilometers; ° Reset Flag 0 To ToMelers os row Data | ad t Enteredin Meters | MHC) | wo SetFiagoT | Show Data Entered | (and) SN [0] InKilometers 1 7 one wo } 4 Convert Meters | (2nd) HEIN CC) Transfer ToC] ee ~-——~ To Feet | 3.28084 T Convert Feet 1 To Miles. | Eisee0 Yes | (Flag Reset) ; 02 Complete Pending | (2nd) MEI =) | “Operationsand | Se r—— Display Result ‘ow weProgramming Considerations USER INSTRUCTIONS Procedure Enter Press Display Clear Program Memory and {ana Reset Program Pointer Enter Learn Mode 000 00 Enter Metric Conversion Program Exit Learn Mode Enter Kilometers Kilometers wa Miles oR Enter Meters and Meters Feet ‘Compute Result Location Location and Key Code Key Sequence and Key Code Key Sequence 000 76 a 020 93 te oot 14 a 021 02 GQ 002 65 022 08 tay 003 01 oO 023 00 (0) 004 00 (oy 024 08 wz 005 00 Cl 025 04 wy 006 00 (0) 026 22 (ny) 007 86 LS) 027 87 q 008 00 fo) 028 00 wm 009 61 029 95 ez 010 13 te 030 55 011 76 (ad) 031 05 Be 012 12 @] 032 02 2) 013 22 (iw) 033 08 Bo 014 86 (na) 8 034 00 Co) 015 00 {o) 035 76 [ind] 016 76 on 036 95 eS 017 13 & 037 95 i] 018 65 038 92 019 03 B Metric Conversion Program eTProgramming Considerations IV Example: Key in the above program and then convert 50 meters to feet and 90 kilometers to miles. Enter Press Display Comments 50 ww 164.042 Meters —» Feet 90 [a] —_58.92840909 Kilometers > Miles DATA REGISTER TRANSFERS — [i This powerful instruction uses the contents of data registers 0-9 to decide whether or not to transfer. [il is used primarily for conditional looping so further discussion is postponed until that section. Creating Loops Otten in your problem solving, you may require certain processes to be repeated several times in ‘succession to achieve your required result. In this situation you can set up a “looping process.” Looping is @ programming technique where you instruct your calculator to perform a sequence of instructions over and over again unti it has done the job you have asked it to do. To create a loop, you simply provide the Program with an instruction that resets the program pointer to an earlier location. UNCONDITIONAL LOOPING ‘There are two methods of unconditional looping, loops back to program location 000 loops back to wherever you tell it. Let's create a program to count by fours. The ‘simple sequence Gt 2) &@ OB psy should do it if placed at the very start of program memary. After keying this sequence into program ‘memory, exit the learn mode, reset to location 000, enter a starting number and press (R/S) and watch it count. If you were to place the sequence in program memory starting at location 020, you could ‘replace [RST] with [GTo] 020 and accomplish the same thing. Just remember that initially you have to ‘begin execution at location 020. Be careful with [RST] because it also resets all flags and clears the subroutine return register. To exit from a loop, place a transfer inside the unconditional loop to transfer out under the conditions you specify. In the counting by fours example above, let's again count by fours beginning at 0 and stopping at 20. 1-68IV Programming Considerations Location andKeyCode Key Sequence Comments 000 02 a 001 00 to 002 32 (zal Store 20 in T-register 003 25 Ga} Clear display 004 76 (rd) 005 85 Label this segment as + 008 85 007 04 zy] 008 95 Se 009 66 Fras] Display each count 010 67 ma Test calculated value against T-register 011 00 ay 012 15 Skip to location 016 ifx = 20 013 61 Otherwise go back to label 014 85 015 91 & Stop when x = Once the program is stored in program memory, just press [RST] [R75] to execute it. Notice that the conditional test in location 010 tests each number that comes through and does nothing until the count reaches 20 then it transfers to 015 and stops. The looping is actually handled by [GTO].Programming Considerations IV CONDITIONAL LOOPING ‘The counting example can also be totally controlled by a conditional transfer instruction as was done by [GTO} in the previous example, Again let's count from 0 to 20. Location and Key Code 000 02 001 00 002 32 003 25 004 76 005 11 006 85 007 04 008 95 009 66 010 22 on 77 012 11 013 91 Here, [IN] (2nd) BIE controls the tooping, Comments f 5 g Label program part as A Reverse test and transfer to A if last calculated value less than 20 Stop when counting reaches 20 Ba (0) (zt) (ci) aw @ =) (aw) @ 1V-70IV Programming Considerations LOOPING WITH THE DSZ CONDITIONAL TRANSFER Whenever you know how many times a sequence should repeat itself, you can use the “Decrement and Skip on Zero” DSZ instruction to handle the looping. The sequence used here is [2nd] [BBM followed by atransfer address. X is the number of one of the 10 data registers 0-9 that can be used with this instruction. This versatile transfer decreases the magnitude of the contents of data register X by 1 (if the data register contents are less than 1 they are decremented to 0}, then tests the contents of register X. (For this discussion, let P represent the contents of data register X.) f Ris zero, the transfer address is skipped. ‘Otherwise the address causes the processing sequence to transfer. DSZ decrements register X and skips the transfer on zero. Graphically, this instruction sequence works like this. Decrement Yes, ‘Skip the transfer and continue No Transfer toaddress Like the other transfer instructions, DSZ can be used from the keyboard as well as in the program. Key in the following and see how. Press Display Comments 0. Clear program memory 2. Store 2 in data register 06 Decrements R, by 1, then asks, “Is Ry = 07" Ifo, transfer 136 00 Transfer made to 136 (CR) [Rex] OS 1. R, was 2 and is now 1 because of DSZ Dis i 1 Decrement and test again ‘TRN} 136 00 No transfer because Rs = 0 now [Rejo6 0. Re actually is 0 DSZis actually an effective counter that loops until it counts down to zero and then proceeds to another instruction. To see how this can be beneficial in a program, let's look at our “counting by" example one more time. We can see that the process of counting by fours to 20 takes 5 passes through the (+4=) loop. WwProgramming Considerations IV Location andKeyCode Key Sequence Comments 000 47 fc Clear all data memories 001 05 B 002 48 Pic] Store 6 in register 00 and clear display 003 00 Co] 004 76 Pi] Label this part A 005 11 006 85 007 04 008 95 009 66 Display each count 010 97 Decrement register 00 and test to see if A, is less than 1 011 00 (2) ow 11 {#R, is greater than 0, transfer to A 013 91 Stops when Ris zero DSZ canincrement R, (add 1 to R,) from the negative side of zero as well. A — 5 could have been used just as well in the above example. Also, [inv] [2nd] [EIM¥ stil decrements or increments the same as before, but the transfer is skipped on nonzero now instead of zero. For more details, see Decrement and Skip on Zero on page V-63. This instruction is also valuable when computing a series from 1 toN. You may use DSZ to compute the series by establishing a loop to evaluate the expression for different values of the variable and instructing the caloulator to recall the contents of the data register being decremented each time the variable is needed. (Note that the series is actually computed from N to 1 because DSZ decrements.) X! PROGRAM Now to exercise the principles of DSZ looping, let's design a program to compute factorials, XI, where Xt = x-(C— 1) +X = 2)+.. .+2+1. By definition of this function, X must be a positive integer and 0! = 1-72IV Programming Considerations Define Label Aasx T | (2d) EE) Initialize Program: | Store Xin Re, | Clear FRegister, | Store sin, | Instruct Calculator | To Stopit Error | Occurs Le ae wt csene | an integer | * | ed Em 20 l Display Fasting 1X1 | C23] Xt ProgramProgramming Considerations Location and Key Code 000 76 001 11 002 42 003 00 004 29 005 01 006 42 007 01 008 86 003 08 010 43 011 00 o12 67 013 12 014 22 015 7 016 34 017 22 018 59 019 67 020 13 In the sample program, 1 is stored in R so as to allow multiplication by memory arithmetic. As a complete programming exercise, the first three conditional transfers are included to trap out invalid entries, Note that if an invalid entry is made, the error condition created at location 027 halts the program since flag 8 is set earlier in the program, The actual loop occurs between locations 028-036. Iv Key Sequence a PRES ECB BUR EH Location and Key Code 021 76 022 34 023 43 024 00 025 33 026 94 027 34 028 76 028 13 030 43 031 00 032 49 033 01 034 97 035 00 036 13 037 76 038 12 039 43 040 01 041 92 X! Program HERO EPRARAR ER | EHEE giIV Programming Considerations Use of this program is very straightforward, Simply enter an x value less than 70 and press A} (70! overfiows the calculation limits of the calculator.) Example: Compute 6!; ~2!; 01; 7.31; 39! Enter Press Display Comments 6 720 é 2 mw “2 Invalid entry oO Clear error o 1 ol 73 "73" Invalid entry o ‘Clear error 39 2.0897882 46 30! NOTE: Quote marks in the display column indicate a flashing display. More on Applications BOND COST PROGRAM Many investors find buying bonds to be a secure and profitable means of putting their money to work. Others would be interested in buying bonds if they can analyze the potential earnings of their investments. Design a program that may be used to calculate the present value (cost) of a bond with periodic coupons using the formula where the cost of a bond is the sum of the discounted values of the ‘coupons and the maturity value. N Pv=l s (1 + YLD) + MV (1 + YLD)-* mM where: MV = maturity value N = number of periods to maturity (j= +, 2,...N) |= coupon value YLD = bond yield to maturity (interest per period) PV = present value or cost of bond You may write this program using a loop to complete the summation. Since you know the number of loops needed in advance, using the DSZ instruction is the most efficient means of programming the loop, especially since the contents of the data register being decremented may be used to supply the vatue for |. Also, you may save program space by using a subroutine to evaluate (1 + YLD)"*, x =], N. 1-75Programming Considerations IV Define [Bas LD Store nese vanabies Into rogitors 14 (Wis toed as ‘adecena) Deine Label CE] | toStar Program ‘StoreLoop Counter | anezeoR, | toeSunmation — | Compute (yD) « xen CallSubrovine To | Compae(s +¥0)~ | T 08 Compute and Store | Wey" | ax Subroutine fo | nd] EM SoM Comores YD" 2 BRIEF: a Rotrn to L os Main Progam _-———________—_ mi 5) Gocrement << Gertaue Summation Mutily Sumby ana Aaa v(t YUE" To The Product DispayPy | RowcodT 5 1 L ‘Canis on Bond Cost Program 1V-76Programming Considerations USER INSTRUCTIONS Procedure Enter z § Display Clear Program Memory and Reset Program Pointer Enter Learn Mode Enter Bond Cost Program Exit Learn Mode Enter Maturity Value Enter Number of Periods Enter Coupon Value Enter Periodic Bond Yield to Maturity Compute Present Value Variables That Do Not ‘Change Need Not Be Reentered For New Problems Mv YLD & 5 H €BEEE @ 000 00 0 MV N ' YLD/100 PV IV77Programming Considerations IV Location Location Location and Key Code Key Sequence andKeyCode Key Sequence andKey Code Key Sequence 000 76 (2) 027 43 (Rel) 054 05 ts 001 11 mw 028 02 [2] 085 43 002 42 @o 029 42 056 06 (é) 003 01 ™ 030 00 ) 057 44 (som) 004 91 031 20 058 05 Cs 005 76 (2nd) ON 032 42 (so) 059 43 Ral 006 12 @& 033 05 ww 060 05 Ss 007 42 034 71 061 58 (nq) 008 02 035 45 Be 062 02 Bz 009 91 038 65 063 91 010 76 fii] 037 43 084 76 [2nq) on 13 re 038 01 0 065 45 fea] 012 42 (50) 039 95 S&S 066 53 co 013 03 Bo 040 42 {S70 067 53 co 014 91 041 08 fe) 068 01 oj 015 76 (2a) ON 042 76 Ps] 069 85 016 14 a 043 44 SoM 070 43 fal 017 55 e 044 71 071 04 ta 018 of wm 045 45 ia] o72 54 m 019 00 (o] 046 44 073 45 020 00 [0] 047 05 ea 074 43 021 95 ea 048 97 (ind) a 075 00 (o] o22 42 049 00 (ol 076 94 028 04 (aj 050 44 = 077 54 oo 024 91 RA 054 43 078 92 (inv) 55] 025 76 (rd) 052 03 Ba 026 15 ia 053 49 a Bond Cost Program 1-78IV Programming Considerations Example: Find the present cost of a bond maturing in 12 years at $20,000 with an annual coupon value of $1,400 and a desired yield of 8%. Enter Press Display ‘Comments 20000 w 20000 wv 12 tw 12 N 1400 ce 1400 1 8 iia 08 YL inal 19492.78 PV ‘A purchase price of $18,492.78 yields 8% annually under these conditions. The total profit of such an investment is 12 x $1,400.00 + ($20,000.00 - $18,492.78) = $18,307.22, QUADRATIC EQUATION PROGRAM A particulany illustrative example of some of the techniques we've been reviewing is the following program designed to handle quadratic equation solutions. It may come in handy also if you find yourself faced with quadratics in problem-solving situations, Write a program that may be used to calculate the real or complex roots of the equation. axt + bx +0 = 0(a 40) The roots x:and xzare found by: +VeF= Fae soe RLV a 2a . 2a x In the event that the value of b? — 4acis positive or equal to zero, the roots are real and are computed according to the above equations. However, if b? - dac is negative, x,and x.are complex roots and must be divided into their real and imaginary parts as demonstrated below. Ke R4 GD and %=R-6-1) where: Since x, and x,are calculated using the same basic equations you may save program space by combining the routines and using a flag to indicate which root is being calculated. A separate routine is required to break up complex roots to their real and imaginary parts. You can determine whether the root is complex oF real by testing to see if b? — 4ac is negative. Note that when the roots are complex you don't need to compute x: as the values of R and | ara the same for both roots,ns IV You should also provide a means of displaying whether a root is real or compiex. Since b? ~ 4acis ‘negative when a root is complex you may create a flashing spay by taking the square root of this value before computing the real part of the root. (Note that V4ac — bis the actual expression evaluated rather than VBF= 4ac when b* — 4ac is negative. You may store this result and use it later in determining the Imaginary part of the root.) In the sample program below, the imaginary part of the root is determined by Pressing (R/S}after computing the real part of the root. As a safeguard, zero is displayed if the root has no imaginary part. This program is not suited for use as a subroutine since [= ]and [R7S]have been used. Programming Considera' Dielay ‘etine Cane ow P< imaginary Pated etre Cease Foot? Deters [een No Store abies vegies 13 oe Dielay Zero (easStoredin os Pl, on e DetneCET ee (ResetFag) Deine (| ° ax | ex woarag | compute te-aae Tero | Corputo an Desay Fasting | Re -oize | tear Fishing ‘Comput an Desolsy inva Bv0 Quadratic Equation Program IV-80,IV Programming Considerations USER INSTRUCTIONS Step Procedure Enter Press Display 1 | Clear Program Memory and Reset Program Pointer (2nd) 2 Enter Learn Mode 000 00 o Enter Quadratic Equation Program Exit Leam Mode ° Enter a (a + 0) a i) Enterb b w b 1 ica) Enter c ¢ ce oN Ome Compute x x; (Real) If Display Flashes Real Parl — Root Is Complex —Compute Imaginary Part x; (Imaginary) 9 | Compute x. x: (Real) I Display Flashes Real Part — Root ls Complex — Compute tmaginary Part x: (Imaginary) NOTE: If roots are real, there is no need to compute the imaginary part which is zero, if computed. Ifthe roots are complex, the imaginary parts of x, and x, are equal. So, the roots are x, = + (i +!) and x.= R-(r). 81Programming Considerations IV Location Location Location and Key Code KeySequence andKeyCode KeySequence andKeyCode Key Sequence 000 76 030 07 059 95 = 001 14 eu] 031 76 060 55 002 42 032 16 061 43, 003 01 oO 033 43 062 04 (aq 004 65 oy 034 02 m 063 95 Ee 005 02 035 33 a 064 91 006 95 J 036 75 5 065 00 a 007 42 (50 037 04 we 066 91 008 04 [a] 038 65 oO 067 76 oO 009 91 039 43 fa) 068 17 Gg 010 76 [2nd] 040 01 ian 069 34 mn 12, 041 65 070 42 i} o12 42 042 43 fa 071 05 Bw 013 02 ial 043 03 Bw 072 43, 014 91 [RA] 04a 95 ee 073 02 fz} 015 76 ol 045 29 074 94 016 13 il 046 22 (ay) 075 55 =) 017 42, 047 77 fa 076 43, 018 03 mm 048 17 (2nd) SO 077 04 ra] 019 91 049 34 078 95 = 020 76 Ps] 050 87 aa 079 91 mA 021 14 Ce] 051 01 oy 080 25 022 86 (nd) 052 18 081 43 [Rel] 023 01 ian 053 94 082 05 Gy 024 61 054 76 083 55 Sj 025 16 aed) 055 18 084 43 026 76 [2nd] 056 75 el 085 04 fa] 027 15, fa 087 43 086 95 yj 028 22 (iny] 058 02 m 087 91 029 86 na Quadratic Equation Program 1V-82IV Programming Considerations Example: Find the roots of the equation: Enter Press 15 w a Oe 2.28 me fo @ Find the roots of the equation: Enter Press. SEE 18x +3.7K +225 =0 Display 3. 37 2.25 = 1,088036702 — 1.978629965 XO+2x417=0. Display 2. 2. 7 woye Comments as2a b c Compute x: (Stable Display Indicates Root is Real) Compute x: Comments asea b c Compute Root (Flashing Display Indicates Roots are Compiex— F ls Displayed) Compute | 1-83Programming Considerations IV ADDITIONAL TECHNIQUES Programming Indirect Instructions ‘A whole new set of capabilities can be added to data memory operations, transfer sequences and special Control and library program addressing through use of the indirect instruction, [2nd] III]. The basic concept is simple. You go to some data register not to find the information you need, but for where to find the information. I's just like telling someone to "Go ask Sam where Fred is" instead of telling the person 10 "Go and find Fred’. You can see that if Sam knows where Fred is, Fred's whereabouts is immediately known to the person asking. But, for someone to just go and find Fred may take hours. in programming, it is sometimes much easier to obtain information indirectly like this. As a matter of fact, for some situations, Fred can never be found directly, so indirect methods are the only means available. Instructions are used indirectly by placing [2nd] (MM) and a data register number after the instruction. In this data register is found the information needed to complete the instruction. DATA REGISTERS ACCESSED INDIRECTLY All data register instructions (store, recall, exchange, sum, product) can use indirect addressing. Consider the sequence 5 (STO) [2nd] MIEN 09 Data Register Contents 6 0 =—+5 5 stored in register 7 8 0 5 [2nd] GM o9 ———-9 —_____">7 10 ° 1V-84IV Programming Considerations Let's write a program segment to clear a series of data registers. For simplicity, clear register 1 through X where you can vary X. Location and Key Code Key Sequence Comments 000 76 (na) To enter X and press A 001 11 wo 002 42 Store X in data register 00 003 00 0 004 76 Gea) 005 12 te) 006 25 (ari 007 72 (S10) (in) EN Zero is to be stored where register 00 says to 008 00 o 009 97 oa) SZ loop on register 00 010 00 0 on 12 a) Go to Bit ragister 00 not zero 012 92 [iw] Halts program when register 00 reaches zero First time through the loop, X is in register 00 so the (Ci) HMH00 stores a 0 in register X. DSZ then decrements register 00 to (X — 1). Now the indirect store sequence stores its 0 in register (X ~ 1), ic. The registers have been zeroed in reverse order which really should make little difference. Can you write @ program to clear them in numerical order? Nate here the special keycode 72 or ST) Zr] NEB. Several o! he ncrect instructions are merge ike this to save program space. For a complete lst, see Instruction Codes (Key Codes) on page V-48.Programming Considerations IV INDIRECT TRANSFER STATEMENTS The usefulness of indirect addressing may be extended to program transfers. Recall that there are two ways to specify a transfer address: by using the absolute location or a label in program memory, Indirect program addressing permits another, more flexible, method. You specify the data register in desired absolute address is to be found. A label address cannot be stored in a data register. Indirect transfer sequences are begun by placin: after either an unconditional transfer ‘statement ( ) of a conditional transter instruction ( [2nd) EY, (2nd) MM) . etc.). The sequence ‘must then be completed with the address of the data register containing the absolute address of the Program iocation you wish to transfer to. Try this sequence from the keyboard. Key Sequence Display Comments 35 (S70}18 35. ‘Store 36 in data register 18 (ME 18 (Rx) 035 00 Program pointer sent to location 035. ‘The DSZ instruction may also indirectly specity the register being decremented. That is, sequences such as (Bea) IER (2nd) MIN 12 (2nd) MNII14 are possible when using this instruction. Both the data register used by DSZ and its transfer address can be obtained indirectly. Here is @ graphical representation to demonstrate this method of transfer and how it may be used. Assume there are three separate sets of instructions that are to be included in the same program as shown below, SetX SetY SetZ x Ye Zz c c c Xe Ye Zz The center portion (C) of each set of instructions is the same, so it would be logical to write the common portion only once. It is an easy matter to use [G79] instructions at the ends of the segments X, and Y, to get to C {Z, flows directly to C), but how does the program appropriately transfer from C to X, Yz, and Z.? This problem may be solved using indirect addressing. Simply store the address of the third section before transferring to C and then end C with a [GTO] [2nd} [MM instruction. In the diagram, program locations are arbitrarily added to the beginning and end of each segment for ilustrative purposes.IV Programming Considerations XSet Y Set ZSet oo on os x Y Z 7 18 1 1 (10) cus |_21 St0l18 (aac ovo 81 STo}18 jc cas ows Label C Common (C) Segment (at0} I 18 oer Yo Xe 090 z eo 1 OTHER FEATURES You may also use [Znd} [Ito indirectly set and reset progam flags and to control the fix-decimal format option of the calculator. ‘Again, indirect flag control is accomplished by placing the number of the flag in a data register. For example, storing 6 in Ri. and completing the sequence [2nd] (HMI [2nd] EN 12 ettectively sets flag 6 while (2nd) MM (Zod) MEEN12 Ca jbranches to label {A }depending upon the status of flag 6. 1-8Programming Considerations IV ‘Since [Bnd] DATA Register 7 es 9 (Gna) MOM [2nd] MIE 12- (2rd) 10 0 "4 42 +9 13 is a branching instruction, the branch may also be performed indirectly. Sequences such [2nd) E12 [HMOs are therefore made possible. Contents ° Transfer address ° ° Flag to test 0 ‘An equivalent statement is (2nd) [IJ 9 126. Key this example into your calculator to see it work. Comments Store 126 in register 08 Store 9 in register 12 Setflag 9 Transfer is made to location 126 Similarly, fix-decimal can be controlled indirectly as the following example shows. Press Display 126 [St0]08 126. 9 (S10)12 9. Gas 8 (Gnd) MER (2a) 2 (Zed) MIEN (Gen 126 00 Press Display 2 (So12 2 (2nd) ME 2nd) MEE 12 2.00 ‘Comments Store 2 in register 12 Calculator placed in fix 2 format For more on indirect addressing, see INDIRECT ADDRESSING on page V-68. IV-88IV Programming Considerations Program Optimization ‘Of the many reasons to optimize a program, two are especially significant. One is to make the program ‘easier to use, and the second is to condense the program to fit in the partition established for program memory. PROGRAMMING TECHNIQUES TO SIMPLIFY USAGE Whether o not a program is easy to use depends upon your own particular needs and preferences. As a general rule, however, a well written program may be easily executed by just a few keystrokes (even by a person other than the programmer. Many programs require that the entire problem be restarted if a wrong entry or keystroke is made. This can be quite annoying and time consuming, especially when working with long and involved programs. ‘Simplifying error recovery procedures is one way to make a program easier to use. Usually, you may ‘accomplish this by storing and saving the original data. Also, beginning routines that perform memory arithmetic with a [STO] instruction is a good practice as the routine may be rerun without having to clear any data registers, PROGRAMMING TECHNIQUES FOR MINIMIZING STEPS Condensing a program to a smaller number of steps is a time-consuming exercise. If a program fits within the program memory partition and operates properly, any time spent to condense the program, in most cases, is unnecessary except for the personal satisfaction of doing it. ‘When attempting to reduce the number of program steps, you should look for sequences that appear ‘more than once. Then, if these sequences are long enough and needed often enough so that replacing them with subroutines reduces the amount of program space needed, do so. ‘Aprogram requiring numerous subroutines may still exceed the bounds of program memory. ‘Optimization of subroutines thus becomes important. There are many methods of combining separate program parts to save space. For instance, if a ‘subroutine call occurs as the fast operation of another routine, you may place the subroutine in line with ‘the first. 1v-89Programming Considerations IV A program lke this ‘can look lke this Ged) SO (and) a (sea) Ged) remove Sg So : (na) (ony) 38a] (sto) (ony) Se] Not only is @ savings of several steps realized, but one (evel of the subroutine return register has been freed. [INV] [SBR] Now acts like a [R/S], because the subroutine ratum register is clear. 1v-90IV Programming Considerations ‘As another illustration, consider the two sequences shown below: Workable Segment Efficient Segment Fosnagoeg- -- ‘The purpose here is to store a.1 or a 1 depending upon the results of the test. Both of these routines perform the same function; however, the second is four steps shorter than the first as the extraneous. instructions enclosed in the box have been eliminated.Programming Considerations IV In addition to the various techniques of combining separate routines there are also numerous Programming tricks that you may find valuable. In the next exampie the programmer desires to use only the rounded two-digit value of the number displayed in his calculations. Simply placing the calculator in fix-decimal does not work as most calculations continue to use the full unrounded value, Workable Segment Efficient Segment Basal -- fase. WS gH ‘The purpose and method of the routine on the ieft are fairy straightforward. The reasoning behind the Second sequence is more efficient but also more obscure. Since the [EE] instruction operates only on the displayed digits, this instruction discards the unwanted digits atter placing the display in fix-decimal. The routine then normalizes the display and continues using only the rounded value. ‘The following routines demonstrate thrae methods of performing the same operation: adding 10,000 to the display register. 1v92IV Programming Considerations -WHEIGE - Both the second and the third routine require the same number of program locations. The second method, however, is advantageous only when you wish to leave the display in scientific notation. ‘As you become more acquainted with the capabilities of your calculator, you will undoubtedly discover ‘short cuts that fit your needs. Be sure to record these sequences for future use as they will lassen the programming task. Until then, you may use the many step-saving features already built into your calculator in optimizing programs. These features inckide functions such as the memory ‘operations S0aj and [2nd] [EMI indirect instructions and the many special control operations. Hf you still have trouble fitting some programs into the allotted space you may be forced to break your program into segments and compute intermediate results before reprogramming the calculator to determine the final solution. Sometimes, however, if you are attempting to program in too straightforward ‘a manner, there is another alternative as illustrated in this next example. SERVICE CHARGE PROGRAM ‘As manager of a prominent local bank, you need a fast and easy method of determining the monthly service charge for the many customers who have accounts with your bank. The service charge for each account is calculated as follows: $0.10 per check for the first five checks (1-5), $0.09 per check for the next five (6-10), $0.08 per check for the next five (11-15), $0.07 per check for each check over 15.Programming Considerations IV A straightforward approach of solving this problem is demonstrated by the following flow diagram. Service Charge = 1.36 + (n — 15) x.07 Service Charge Program (Basic Approach) Service Charge ‘Stop =4kn Program ‘Service Charge Stop = 5 +(n-5)x.09 Program Service Charge Stop 95 + (n~ 10) x.08 ProgramIV Programming Considerations ‘Attempting to write a program following this approach would probably require at least eighty or ninety program locations. Although such a routine could easily fit within program memory. ifit were to be used as a subroutine, it may have to be streamlined significantly to allow room for the other program parts. Pethaps another solution would require fewer steps. Consider the following approach. Enter Number of Checks Compute nx $0.10 Loop Needed Yes | ? No Stop Program Service Charge Program (Advanced) ‘Ata first glance it would appear that a program following this line of thinking could be easily stored in the program memory of your calculator; however, the reasoning behind some of the sequences used is not readily apparent. Examine the logic here for a moment 1v-95Programming Considerations 1v-96 Store nin | Sto Loop Couns | In, Round | DisplaytoCents, | Clea egiter | Compute 9x$010 | ‘Subtract $0.01 For Each | “ Crack vers Over to; | (a) NEN] overs quutipicaton's | (210218) 4] Let Pending unit | ig ‘Tests Are Completed) | Subtract 5 From = (Muitiply By Now Value | [37] (wev)(sum@ C1) iPositiveorZero | RooG For Loops 1-3) ! is | im) ws Final | Coop Comptes a) BE CZ] 2 (es Se i ee Positive |] SBD ad orzo. | Ee ee wa | fe Mutipy By Zaroand | ret | mo Campin Penang | Ol ao Dipiay Ress Service Charge ProgramIV Programming Considerations ‘The program is fairly straightforward until location 022 where the multiplication in step 021 is left pending while an adjustment is made to n and tests are completed. The loop is used to reduce the charge on each check over 5 to $0.09; aver 10 to $0.08; over 15 to $0.07. The [2nd] [EE instruction asks which loop is in progress. For loops 1-3, the value of n |s tested; if it is negative, zero is placed in the display to complete the pending multiplication and the program is terminated upon computing the total service charge. Ifthe fourth loop is reached, the pending multiplication is always completed with zero, as the charge on each chack over 20 would otherwise be reduced to $0.08. The program then determines the total service ‘charge and halts the program. This last loop is not necessary for computation; however, its elimination ‘would require the use of additional program instructions and the idea is to minimize the size of the routine. Only two approaches have been made to this service charge problem. Realizing that there are many ways to program the solution to a problem, these two extremes show just how different programming techniques can be. Naturally, there are trade-offs. In this instance the second method requires less than half the program space needed for the first method; however, the first example demands less time for the program to run. Regardless of the approach you take to programming, bear in mind that the correct method is the one that works best for you. IV-97Programming Considerations IV Location Location and Key Code Key Sequence and Key Code Key Sequence 000 76 (ad ON 020 ot o 001 11 ew 021 65 ea] 002 42 022 05 Bw 003 ot In) 023 22 fw) 004 04 fa 024 44 005 42 025 01 mn 006 02 ira 026 43, Rel) 007 58 mm 027 01 wm 008 02 2] 028 22 (iw) 009 29 (2nd) 029 97 fs: | 010 93 Ge 090 02 @ ot oF mom 031 13 012 65 ia) 032 77 013 43 033 12 014 ot m 034 76 Pt] 015 76 035 13 oe 016 12 we 036 00 [] 017 75 Oo 037 95 Ee 018 $3 9 038 92 (inv) (56a) 019 00 (0) Service Charge Program Torun the program, simply key in some number of checks and press [}. For instance, 1 check costs $0.10, 6 checks cost $0.59 and 63 checks cost $4.71. Programming Techniques for Speed ‘There are occasions where some time can be saved by reducing the execution time of long running programs that are to be used many times. Under these conditions, different key sequences may result in faster and more efficient program operation. When a program is running, the most time-consuming operations are program transfers. Certainly, minimizing the number of transfer statements leads to a faster running program. Therefore, although the use of subroutines is emphasized in earlier discussions, when program space allows, you may replace subroutines with in-ine instructions to significantly increase speed. 1-98IV Programming Considerations Remember that a program step may be absolutely addressed with a 3-digit address or with a program label. If an absolute address is used, the program pointer is immediately positioned at the new location. However, if a label is used, the calculator must search for its location. The label search is always begun at location 000 and progresses through program memory until the desired location is found. Then, program execution is continued from that point. Naturally, when a programs initially entered into the calculator, itis difficult to know ahead of time what the absolute addresses will be. Also, editing a program often causes these addresses to change and significantly increases the difficulty of the task. The best procedure then is to write the original program using labels and convert to absolute addressing only after the program is completely debugged. Again, inserting addresses and deleting labels cause the addresses to change. However, this problem may be ‘overcome using the (2nd) instruction. {[ZRgEMM simply performs no operation when encountered in a program. Since this command does not interfere with execution (except when used as 4 label), it may be used as a space-holder when program space allows. This technique is illustrated below. 027 027 028 [nz] 028 029 (oa) 02s 073 o73 (2nd) o74 (nz) ova od oe 099 089 (Gro) 100 Ging} +100 a 101 nde 101 Mol Label Addressing Converted to Absolute Addressing Iv-99erations IV Note that location 075 is used as the absolute address since transferring to a label address positions the Program pointer at the first location following the label. Remember that the absolute address 075 is stored in two program locations rather than three. The first digit, 0, is stored in the first location following the transfer instruction using its standard key code. Then, the second and third digits are merged into the two-digit code "75" and stored in the next program location, Programming Con The transfer instruction itself must also be reentered so as to instruct the calculator to automatically merge the address. Use this key sequence for converting the previous example to absolute addressing, BEERS E~ BEE GB) co) / BBBAREES T¥-100IV Program Codebreaker (Game Program) This final programming example is not intended for the beginner, The techniques used are designed to make the most efficient use of the array of programming tools available to you. The game is fun to play and there is much to be learned from the program structure itself, ig Considerations “Codebreaker is a calculator game where the calculator generates a four-digit secret number and you try to guess it. Zeros are not allowed and no digit may be the same. Even with these restrictions there are 3024 possible codes, making slim your chances of guessing the number on your first guess. Your guess is automatically scored by the calculator. The score is displayed in the form “N’. “R” where Nis the number of digits in your trial number that appear in the secret number and are positioned correctly, Ris the number of digits in your guess which although correct, are improperly placed. For example, if the number generated by the calculator is 8261 and you guess 6285, you receive a score of 1.2. This indicates that one number you guessed is in the right place (the 2) and that two of your other numbers (8 ‘and 6) are present in the secret number, but not in the right place. A score of 4.0 indicates that your guess is correct. Test your skill by developing a program of your own for this game. Then, study the example given below. Optimize your program to use a minimum number of instructions. ‘The flow of processing in this example is easy to follow; however, the complexity of the code requires that the flow diagram and its explanation be presented simultaneously.” For the program to derive its secret number, it must have a starting point. A “seed” number is entered at [A for the calculator to work with WoLProgramming Considerations T-102 Flow Diagram Define Paras Seed Nurter Clear Memory ‘and Store Seedin Foe a Inorementincirect Rogster Pointer ana Loop Counter Generate Fandom Dat Comments This towne is used ‘establish tho code umber Store seed in data register ‘The generated digits are Indirectly sored accorcing ‘othe contents of Op codo26 isused io Irerement R by 1 ‘A wop is used to est new dais against z0ro ang Previously gonerated digits Torecuee unig time, amirimum numberof Tocps is used Suorouine PEot program {Sle used to generate a random ‘numbor x whered & X-< 1. The ‘numbers than mutpies by 10 te place tin the proper range ands integer vaue is places inthe test registor Using reurine [Jot program 15 0 gorerate ‘he number would requte ada ‘ional program space te establish the range of he eutout Also, routine [¢ Juses cata regisors BF, where subroutine Hi 00s nat Location ‘and Key Coae 000 7 oor 02 47 003 42 008 09 005 76 006 48 907 69 908 25 ow on ow o1a 42 om 06 aes os 96 ove 15 or 7 O16 a8 o19 65. 020 01 21 00 22 98 023 58 02a 32 Key Sequence oa cA Gnd) S10) ae Ew | Fy ji ASeERR Ap G Ee gets 8 Ha b EUSA aProgramming Considerations Location Flow Diagram Comments andKey Code Key Sequence Reject Diot Since the cata registers ate was 76. = inalyciesree, metestioop 026 67 weg teststhe geneaiea gt against 027 73 Fle ED zero Therwmaining aopstest 028 08 Tareforto gan previously generated 028 67 rae abel ST) digits I the cgi reiected, 030 42 0) anew dita generate without ircrementing RB sores “aD bath as an ndrect egister Now Dit painter ane 2 loop count cas 97 2 ‘The FB inctucton also 032 06 Ce ‘seresa dualpuposeintat 039-67 itcortts tho looping process “ranstr to and he nse pote Lave! EE ‘store ‘tne digits accopte, itis 02s 22 Random Digt inaecty store using Re as 72 asapoiner, 026 05 os 49 Senerais i nee fou digishave veen gos oo ‘anther gt >—N2, accepted, te cose s comple 2 ‘The testis made against 3 39 $2 ratherthanforasavings of 940 03 Fes progam step. The atematveis 061 77 Tvanater"e (ow one a4 Label si ‘Sip Program and 09 00 (e; Display 260 44 91 cal Detine CE] Thstowinels used wscoretme 045 78 =o as Guess payers quess 46 12 irl ‘Store Gusss ane “wo loops ae sac by is coutine, 087 42 Estaaian Major Thomaprloepisruncreater O48 12 oz Loop Counter ceacncagtin the guess 49 04 ical T O60 42 ones S] 1v-103Programming Considerations Flow Diagram 4 Extract Oigttor Testing TV-104 ‘Comments ‘This instruction sequence pick otf the lst cigitin the guess are ‘Stores tin the Tregiste go that itenay bo compared agains he code number. Ths dig i also removed rom the guess so that ‘he thre aig necomes the last dig for Bo second leap ara 0.07, The equation used i: Guess Digit = 10 x INV Ine S488 ‘The “EE Wick s again used tor diving an multiplying by 10, ‘The minor loop is used 1 ost the above dat against each cig Inthe code nue Here te cigitsotected from the player's quese is compared withthe digits appoaring in the ‘code numer. a mate is found, procassing is transtorrod (othe sconng section. “Tusinstruction makes sure at each ogi ‘guessed is compared toeach dit of the ‘secret number (unless ‘a match is tourain an earior comparison) ed serve dual functons, Location ‘and Key Code Key Sequence 052 76 ed 053 52 [ee] 066 43 = 055 12 Oe 036 52 ira] 07 oF a 058 96 z 059 42 is ‘60 12 Or 061 22 om 052 59 fe | 083 22 ‘u) 066 a8 sm 085 12 nom 086 52 zl 087 00 oy 088 00 fo} 068 32 a 070 04 D or a2 072 08 o 073 76 = ors 97 = 075.73, (Ue) a 078 08 = 77 67 a 07a 49 a 079 a7 a 80 06 ce) cai 97 2)Programming Considerations Flow Diagram ‘Ada Polat Some ‘Ciear tro match occurs, the ‘scaring segments bypassed. ‘The guessed agi iain the ight position when the toon counters areal the same love. the guessed digits in the wrong place score. point. I ‘tis corectly postionee, ‘Score point, Notice how easy the two routines are combined, Using GR} in ple of Scientific Display Nex! Digt anwere Lave] ‘Stop Program and Display Score “RA [EE Joaves 2 stops ast ‘alse places in the display register for use below. {2 exajorloop nas been por- formad for each aig ofthe ‘guess he program is terminates ard the scores splayed. In aceton to cating the score tothe display, the instruc ‘ion also 2¢r08 Fs (S88 location 101) tallow summation when the next guess is ntored, lacing the oalculator infix + alows ibe cisalayes even when this vanes 260. Location and Key Code Key Sequence 082 61 08s 25 om 76 085 43 086 43 087 06 one 32 089 43 (090 05 991 67 092 24 icra) za) a re wo zal se a [ena 093 @9 004 76 095 24 (096 01 97 44 098 13 099 76 100 25 rer 25 E@ GEESE t Be 102 97 Ez 103 05 eal a 108 82 a 105 48 106 13 tor 58 108 01 109 9 BERER a-a 1.105Programming Considerations IV ‘The program designed here requires the entry of a decimal “seed” number (between 0 and 199017) and pressing!_A_]. Once the secret number is derived, 2 zero appears in the display. Begin guessing by entering your guess and pressing [ 8 J. The validity of your guess is displayed as previously explained. Let's playa game. Enter Press Display ‘Comments 258 Ca] 0. Enter “seed” and wait until secret number determined. 1234 04 First guess seve (B] 24 Second guess 9238 [a] 1.0 Third guess 5694 Ca] 10 Fourth guess 5198 24 Fifth guess S718 (3) 40 Sixth guess is comect A proficient player seldom needs more than six guesses. W106V THE DETAILS ‘AN IN-DEPTH ANALYSIS OF FEATURES AND FUNCTIONS ‘Now for an in-depth analysis of each facet of your calculator. This section is specifically designed as a detailed reference to be used once you have a basic understanding of the calculator's functions. If you do not have a good understanding of the calculator, return to the earlier sections of this manual to obtain this: information. ‘Throughout this section, all discussions about keyboard operations and functions apply both to manual (number by number) calculations as well as to program calculations using those operations. BASIC OPERATIONS Standard Display in addition to power-on indication, the display provides numerical information complete with negative sign and decimal point and flashes on and off for an overflow, underflow or error condition. An entry can contain as many as 10 digits. All digits entered after the tenth are ignored. floating decimal point integer decimal floating minus sign portion ‘Any negative number is displayed with a minus sign immediately to the lett of the number. See Appendix C for the accuracy of all displayed results. vaThe Details V AN IN-DEPTH ANALYSIS OF FEATURES AND FUNCTIONS Data Entry Keys The keys have been selectively positioned on the keyboard to provide for efficient caloulator operation. Although many of the operations are obvious, some are not, The following instructions and examples can help you develop skill and confidence in using your calculator, [THROUGH [9 ] DIGITS — Enters the numbers 0 through 9. (2) — DECIMAL POINT — Enters the decimal point. The decimal point can be entered wherever Needed. If no decimal points entered, itis assumed to be to the right of the number, and appears when any operation or function key is pressed. A zero precedes the decimal point for numbers less than 1 unless all ten available display digits are used. Trailing zeros on the decimal portion of a number are not normally displayed. Only the first decimal point entered is accepted, all others are ignored. Pressing the ‘decimal point immediately atter an exponent entry allows you to alter the mantissa again, like changing its sign. [2nd] J — Pl — Enters the value of pi ij to 13 significant digits (3.141592653590) for calculations; display indicates the rounded value does not remove 7, however, it can be written over by another number. CHANGE SIGN — instructs the calculator to change the sign of the displayed number. When pressed after [EE], [2nd] [EBB or exponent entry, changes the sign of the exponent. The procedure for entering a positive number is simply to press the keys inthe left to right sequence exactly as the number is written. Each digit entry causes the displayed numbers to shift left as the new digit is entered. Only the first decimal point entered in any single number entry is accepted. Example: 7.892 ~ » + (—2) = 2.750407346 Press Display 7.892 [=] 7.892 (2nd) 3.141592654 4.750407346 -2 S 2.750407346V The Details ‘AN IN-DEPTH ANALYSIS OF FEATURES AND FUNCTIONS Clearing Operations — CLEAR ENTRY — Clears entries made with the digit, decimal point and change-sign keys: only when pressed before a function key. This key does not clear ‘calculated results, numbers recalled from. memory oF 7. also stops the flashing of the display when needed. Use of this key does not affect pending operation: — GENERAL CLEAR — Clears calculations in progress and the display. It resets scientific notation fo standard format and stops a flashing display. This key does not affect the contents of the data or program memories, the T-register, angular mode. engineering or fix-clecimal display formats or the partition, The calculator effectively clears itself after most calculations. When the [=] key is pressed to complete a calculation, the answer is displayed and the calculator is ready for the start of a new problem without pressing any of the clear keys. The contents of the data memories are not automatically cleared. [Gl — CLEAR PROGRAM — Clears all locations of program memory (and protection), clears the ‘subroutine retum register, resets all flags, clears the T-register and resets the program pointer to 000 when pressed from the keyboard, When encountered within a program it only zeros the T-register. [aad] [EJ — CLEAR DATA MEMORY — Instructs the calculator to clear all data memory registers as defined by the current partition. Dual Function Keys ( [2nq] and [inv] ) Most of your calculator's keys have dual functions. The first function is printed on the key and the second function is written above it. To execute a function shown on a key, simply press the desired key. To use the second function of a key. press the [2nd] key, then press the key immediately below the desired second function. For example, to find the natural fogarithm of a number, press {inz]|. To find the common logarithm of a number, press [2nd) [ini]. In order to distinguish the second function key, this manual shows it as {2ed] [EEL First function operations, therefore, are indicated by [__}. Second functions are indicated by [2nd] [ll- When [2nd] is pressed twice in succession, or if a key that does not have a second funetion is pressed ate, the calculator retums to first function operation. v3The Details V (AN IN-DEPTH ANALYSIS OF FEATURES AND FUNCTIONS The inverse key [INV] adds additional computing capabilities without increasing the number of keys on the keyboard just like the [2nd] key. When [INV] precedes another key, the purpose of that key is reversed. The inverse can be used with the following keys to obtain the indicated function. Pressing cancels an inverse key press. Inverse Function Function EE removes EE ENG removes ENG Fix log Inx y Int sin cos tan Prod divide into memory SUM subtract from memory OMS decimal to D.MS POR ROP. E+ ze x standard deviation list list data registers SBR return x=t xet xst x
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6129)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brene Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (934)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8215)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2923)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Tóibín
3.5/5 (2061)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2641)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2544)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
Huawei documents show Chinese tech giant’s involvement in surveillance programs - The Washington Post
PDF
No ratings yet
Huawei documents show Chinese tech giant’s involvement in surveillance programs - The Washington Post
1 page
This country’s social-security system could teach America a lesson
PDF
No ratings yet
This country’s social-security system could teach America a lesson
1 page
Financial surveillance in the West is more like China’s
PDF
No ratings yet
Financial surveillance in the West is more like China’s
1 page
India is now the most populous nation
PDF
No ratings yet
India is now the most populous nation
1 page
Undermoney Flyer
PDF
No ratings yet
Undermoney Flyer
2 pages
The Company That Defines U.S.-China Tech Rivalry Isn’t Going Anywhere
PDF
No ratings yet
The Company That Defines U.S.-China Tech Rivalry Isn’t Going Anywhere
1 page
KODA-Compact Extended Fact-Sheet
PDF
No ratings yet
KODA-Compact Extended Fact-Sheet
8 pages
Casa Modular 180730 - Koda-3.0
PDF
No ratings yet
Casa Modular 180730 - Koda-3.0
4 pages
KODA-LoftExtended 29.04.2020
PDF
No ratings yet
KODA-LoftExtended 29.04.2020
4 pages
Ampligen Trial in COVID-19 Patients With Cancer
PDF
No ratings yet
Ampligen Trial in COVID-19 Patients With Cancer
3 pages
Duston - Radio Construction For The Amateur
PDF
100% (1)
Duston - Radio Construction For The Amateur
41 pages
KODA-Loft - Indd 5 22.04.2020
PDF
No ratings yet
KODA-Loft - Indd 5 22.04.2020
4 pages
Microsoft Excel 2016 For Mac Quick Start Guide
PDF
No ratings yet
Microsoft Excel 2016 For Mac Quick Start Guide
4 pages
Adaptimmune's SPEAR T-Cell Platform Delivers Initial Responses in Four Solid Tumors Shares Up 60% Premarket
PDF
No ratings yet
Adaptimmune's SPEAR T-Cell Platform Delivers Initial Responses in Four Solid Tumors Shares Up 60% Premarket
1 page
Carmel, California I August 13, 2021
PDF
100% (1)
Carmel, California I August 13, 2021
316 pages
Sourcebook For Programmable Calculators INDICE
PDF
50% (2)
Sourcebook For Programmable Calculators INDICE
2 pages
Theranos Whistleblower Shook The Company-And His Family - WSJ
PDF
No ratings yet
Theranos Whistleblower Shook The Company-And His Family - WSJ
12 pages
TGTX Topline Results Ultimate I Ultimate Ii: Jumps 23%
PDF
No ratings yet
TGTX Topline Results Ultimate I Ultimate Ii: Jumps 23%
2 pages
Ti 59 - A Note On Battery Corrosion
PDF
No ratings yet
Ti 59 - A Note On Battery Corrosion
3 pages
Radio Constructor Manual - Lewis 1945
PDF
No ratings yet
Radio Constructor Manual - Lewis 1945
31 pages
Ti 59 Disassemble and Clean
PDF
No ratings yet
Ti 59 Disassemble and Clean
9 pages
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Yes Please
From Everand
Yes Please
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
Huawei documents show Chinese tech giant’s involvement in surveillance programs - The Washington Post
PDF
Huawei documents show Chinese tech giant’s involvement in surveillance programs - The Washington Post
This country’s social-security system could teach America a lesson
PDF
This country’s social-security system could teach America a lesson
Financial surveillance in the West is more like China’s
PDF
Financial surveillance in the West is more like China’s
India is now the most populous nation
PDF
India is now the most populous nation
Undermoney Flyer
PDF
Undermoney Flyer
The Company That Defines U.S.-China Tech Rivalry Isn’t Going Anywhere
PDF
The Company That Defines U.S.-China Tech Rivalry Isn’t Going Anywhere
KODA-Compact Extended Fact-Sheet
PDF
KODA-Compact Extended Fact-Sheet
Casa Modular 180730 - Koda-3.0
PDF
Casa Modular 180730 - Koda-3.0
KODA-LoftExtended 29.04.2020
PDF
KODA-LoftExtended 29.04.2020
Ampligen Trial in COVID-19 Patients With Cancer
PDF
Ampligen Trial in COVID-19 Patients With Cancer
Duston - Radio Construction For The Amateur
PDF
Duston - Radio Construction For The Amateur
KODA-Loft - Indd 5 22.04.2020
PDF
KODA-Loft - Indd 5 22.04.2020
Microsoft Excel 2016 For Mac Quick Start Guide
PDF
Microsoft Excel 2016 For Mac Quick Start Guide
Adaptimmune's SPEAR T-Cell Platform Delivers Initial Responses in Four Solid Tumors Shares Up 60% Premarket
PDF
Adaptimmune's SPEAR T-Cell Platform Delivers Initial Responses in Four Solid Tumors Shares Up 60% Premarket
Carmel, California I August 13, 2021
PDF
Carmel, California I August 13, 2021
Sourcebook For Programmable Calculators INDICE
PDF
Sourcebook For Programmable Calculators INDICE
Theranos Whistleblower Shook The Company-And His Family - WSJ
PDF
Theranos Whistleblower Shook The Company-And His Family - WSJ
TGTX Topline Results Ultimate I Ultimate Ii: Jumps 23%
PDF
TGTX Topline Results Ultimate I Ultimate Ii: Jumps 23%
Ti 59 - A Note On Battery Corrosion
PDF
Ti 59 - A Note On Battery Corrosion
Radio Constructor Manual - Lewis 1945
PDF
Radio Constructor Manual - Lewis 1945
Ti 59 Disassemble and Clean
PDF
Ti 59 Disassemble and Clean
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel