Featuring, this iuw: Library Corner ...... * 2 Winning Programs ...... 3 Best Sellers ...... 4 Book Reviews ...... 5 In the Key of HP ...... 6 New HP-ILVideo Interface ...... 7 HP-IL Linear Interpolation ...... 8 Generating HP-41 Bar Code ...... 9 HP-IL Control Functions ...... 10 Routines, Techniques, Tips, Etc...... 11 Feedback ...... 13

HEWLETT March-May 1982 Yo(. 6 No. 2 PACKARD ISINQ730-2037 HP Key Notes - Published Quarterly By Subscription: $5/yr.

HP-41's Again For the last Columbia flight, near the end before they can discuss the problem with of last March, the two HP-41 computers Mission Control. Aboard Columbia were purchased over-the-counter by NASA The second HP-41 computer acts as an Unless you have been hiding in an igloo from a Houston, Texas, office-equipment electronic secretary for the astronauts- near the North Pole for the last year or so, store, and were tested rigorously before reminding them of daily chores with you know all about the space shuttle being approved for flight. They are iden- alarms and flashing messages. Each morn- Columbia, which we featured on the cover tical to the hundreds of thousands of ing, the astronauts programmed their of V5N1. And, because you read KEY HP-41's sold since 1979. computer with five to ten alarms. That way NOTES, you know that the astronauts use One HP-41 computer, dedicated to what they didn't have to write down on paper all our HP-41 handheld computers onboard NASA calls the acquisition-of-signal pro- their scheduled activities. In other words, Columbia for various flight-related, radio- gram, was the only convenient means the ) contact, and backup operations. And, no, shuttle crew had to estimate the time, their programs are not in the Users' location, and radio frequency of their next Library nor are they for sale. They contain contact with Earth. Also, if the astronauts NASA proprietary information and are for are awakened at night by an alarm, they We Get Letters.. use only on the space shuttle. can tell at a glance how long it will be . And we know that you are going to not only like this one but also use it for your purposes. There's a lot of emphasis on a lot of words in that opening sentence, but for good reasons, as you will soon learn. Take a very close look at the photograph repro- duced here; we'll bet you'll never suspect what it represents. Anyway, before you peek inside KEY NOTES, here's the letter we received from Mrs. Keith Olson of Cupertino, California. "Some time ago, my husband bought an HP-41. Soon thereafter he Wanted a safe, fhSid~Mfbk

Astronaut Gordon Fullerton aboard Columbia on the last flight, using his HP-41. Notice that he is "sitting" in midair, in the "zero" gravity of outer spa'ce. (Photo courtesy of NASA.) Corvallis Library Corner age you to closely follow the Users'Library authors are well on their way toward Contributor's Guide for the HP-41, HP-67, earning enough Corvallis points to "pur- There are now over 4793 HP-67/97 and HP-97. Complete and orderly docu- chase" their favorite HP products. The programs and 1730.HP-41 programs mentation is essentjal to ensure the accep- point program is not retroactive. We can- in the Corvallis Users' Library, and we tance of a program into the Library. not exchange Library coupons for get more and more each and every day of We also encourage you to read the points, nor can we redeem "Users' Pro- the week. And, as much as we are grateful ongoing KEY NOTES column, "In the Key gram Library Europe" point certifi- for your excellent output, there are a few of HP." This column addresses some of the cates. subjects we'd like to see covered. For things we look for when we are reviewing example, Andrew N.. Cruickshank, a programs that are submitted to the Users' THE CUSTOM KEYBOARD Town Planner and Economist who lives in Library. (Corvallis Only) London, England, recently wrote and asked Programs that are submitted to the Foremost on the list of requested items is if we had any programs in his field- Corvallis Library for the HP-67 or HP-97 programs such as population projection, the custom keyboard. Everyone wants one! must include magnetic cards, and HP-41 The keyboard (with the standard key property development, regional economic programs must include either magnetic analysis, etc. And we are often surprised configuration) is presently obtainable cards, reproducible bar code, or a data only from the Corvallis Library for one that there aren't more programs for mini-cassette for use with the new farmers. point, or in lieu of the 25% discount offered HP-82161A Digital Cassette Drive. (The on orders of 6 or more Corvallis Users' But one must admit that, all in all, you cassette will be returned to you.) It would are a very prolific and excellent society of Library programs. In other words, if you take far too long to check and review all the order 6 or more programs and do not take calculator programmers, and we congratu- many program submittals if we had to key late each and every author who has taken the 25% discount, you can request a custom them in line by line. Also, there is always keyboard in lieu of the discount. the time to share a program through the an increased chance of error when someone Library. keys in handwritten keystrokes. MINI-SOLUTIONS The management of the Coruallis Users' ORDERING PROGRAMS Library reserves the right to reject pro- HP-67/97 and HP-41 programs featured grams which, in its opinion, do not in KEY NOTES are available from both the represent a significant contribution, are not Library in Corvallis and the Library in clearly or sufficiently documented, or are. Geneva (except where stated otherwise). not otherwise appropriate for the Coruallis Readers in Europe should order from Library. Geneva (address on back cover) to get quicker service. Readers elsewhere should order from Corvallis. Each program includes documentation and prerecorded THE CORVALLIS CONTEST magnetic cards; HP-41 programs include The 1982 Corvallis Users' Library bar code. Submittal Contest is well under way. Mail your order and a check or money The ten winners for March have been order to the Corvallis or GENEVA address chosen and these winners are featured on the back cover of KEY NOTES. Don't elsewhere in this column. All of our authors forget to include your State or local taxes. are to be congratulated for the fine Or, in the U.S., you can place your order by contributions they have made to the calling toll-free: 800-547-3400, except from Corvallis Library. Alaska and Hawaii. (In Oregon call 503- There are 50 more prizes to be awarded in 758-1010,NOT TOLL FREE.) this contest! Last year, 50% of the total When ordering from outside the U.S., contest entries arrived during the last attach your payment to your order. month of the contest, so send your pro- Much time is wasted and orders are held up grams in early to increase your chances of trying to match checks and orders that are Our new Solutions Book, Time Module winning. This contest runs through Solutions 100041-90395, is in stock and is sent in separately. Your payment can be in August, 1982. the form of an International Money order, a being shipped. It greatly compliments the HP-82182A Time Module, and demon- Foreign Draft, or the equivalent. Any payment must be in U.S. dollars, drawn on strates just how versatile and indispensible a U.S. bank, otherwise it will be returned to your HP-41 is. Time Module Solutions I and you. Another option for payment is to use THE POINT PROGRAM all solutions books are now available such major credit cards as American (Corvallis Only) recorded. Magnetic cards are $20* per book; Express, VISA, or Mastercard. The Corvallis point program has been mini-data cassettes are $12* for the first Orders are usually shipped within 2 enthusiastically received by everyone. For Solutions Book requested and $6* for each working days after they are received in those who missed the announcement, the subsequent book recorded on the same Corvallis. However, if you need a program authors of all HP-67/97/41 programs, cassette. yesterday, call us today at 503-757-2000, currently accepted for the Corvallis extension 3371. Although we can't get it to Library, arc being issued point certificates, you yesterday, if you call before 12:00 noon, (one per accepted program). These points we'll get it in the mail today. are then redeemable, by the Corvallis MINI-SERVICES Library, for a vast array of HP products. A mini-cassette duplicating service is a Depending on the amount of points you new Corvallis Users' Library offering. Send SUBMITTING PROGRAMS have accummulated, you can choose from us a cassette with your favorite collection of (Corvallis) products that range from a Solutions Book programs, and we will copy it for you-in Programs submitted to the Corvallis or a custom keyboard (presently valued at any quantity. The cost for this service is Users' Library should be on Hewlett- one point) to an HP-85 $12* per cassette requested (that $12* Packard standard Library submittal forms, (presently valued at 100 points)! A complete includes the price of the cassette). This new or they should include at least the docu- list of the available merchandise can be service provides an ideal opportunity for mentation required by those forms. To obtained from the Corvallis Users' Library. businesses, clubs, and organizations to maintain the high quality of the programs Now, in addition to the'opportunity to distribute their "custom" software collec- submitted to the Users' Library, we encour- win prizes in the contest, many diligent tions to members.

Page 2 KEY NOTES V6N2 May 1982 MANY REQUESTS (41) General Network Reduction Pro- multiplication or division, and SHADE In response to many customer requests, gram #01526C (Price: $12*) LINE, a sunrise to sunset history of a shadow and/or the S/L ratio. Required the Library, long ago, established stan- This program analyzes networks of up to dards by which programs are accepted for 80 elements. The allowed network elements accessories: Printer, 3 Memory Modules. the Corvallis Users' Library. Our review are resistors, capacitors, inductors, re- Card Reader or Wand recommended. (624 staff checks each program for complete and actors, and rigid voltage and current lines, 1317 bytes, 46 pages) accurate documentation, friendliness, and sources, in any serial or parallel combina- Author: Bill Kraengel, Jr. Valley Stream, New York ease of use. All programs submitted must tion. Output functions are voltages, cur- be accompanied by magnetic cards, bar rents, or impedances in any branch of the code (HP-41),or mini-data cassette (HP-41), network. If the printer is available, either (41) Fire Danger t01586C (Price $12*) and should solve a problem sophisticated amplitude or phase transfer functions can This program computes fire danger for enough to warrant its purchase. These be plotted. Required Accessories: 4 Memory both grasslands and forests; outputs in- guidelines will ensure top-quality software Modules for 80 network elements, Printer if clude a numerical index, a hazard rating for you. plots are desired. (443 lines, 905 bytes, 32 (LOW, MODERATE, HIGH, VERY HIGH, Our review staff is available to answer pages) and EXTREME), rate of spread on level any questions regarding either existing Author: Dieter Lange and sloping ground, and, in the case of Library programs or programs that you are Hamburg, Germany forest fires, flame height, the hazard of developing to submit to the Users' Library. crown fire, and spotting distance. A sub- Call 503-757-2000 and ask for extension And, the third winner for December was program computes a' drought index re- 2886 between 9 am and 4 pm. the game program Flipo t01477C (Price: quired for quantifying forest fires, and $12*) that we featured in V6Nlp5a. The another subprogram computes relative ORDER TURNAROUND TIME author of Flipo is Robert Swanson of humidity from meteorological data. Portland, Oregon. The Library has finally reached its goal Fire danger can be forecast and projected of giving you 48-hour turnaround on mail (Hearty congratulations are in order for forward from conditions in the morning or and TOLL-FREE phone orders, and we are these three authors! The time and effort on the day(s) before. proud to tell you that we intend to maintain that went into writing and documenting that goal. these programs is astounding. Thanks, to The complete program has three parts; Orders telephoned directly to the Library all three of you; we know you will enjoy the main program-Fire Danger-and two (503-757-2000X3371) always ship that same using your HP-41 CV$-Ed.) subprograms-Drought Index, and Rela- day, regardless of the number we may tive Humidity. The main program can be receive! used separately, or with either, or both The Corvallis Users' Library is your subprograms. A flow diagram for the Library. Write us with recommendations complete Fire Danger program is included. for services or with any suggestions on how Winning Programs Required accessories: 4 Memory Modules, we might serve you better. We announced the 1982 Users' Library and Printer is advantageous but not Submittal Contest in the last issue of HP essential. (863 lines, 2054 bytes, 45 pages) KEY NOTES. This contest began in March Author: Dr. Wilfred J.B. Crane and it will run through August. Each Canberra, Australia month, ten winning programs will be chosen on merit by our review panel. And, The authors of the following eight the authors of these winning programs get programs chose a prize of either a Time "Old" Contest Winners to choose a fabulous HP product as their Module or an Extended Functions/Memory prize. The top two winners every month Module. They are listed in no particular Because of the overwhelming number of may choose a prize of either an HP-IL order. programs submitted during December for Digital Cassette Drive or an HP-IL Ther- the 1981 Users' Library Contest, the mal Printer/Plotter (both include HP-IL (41) The Ultimate Calendar-A.D. and announcement of that month's winners Modules). The other eight winners may B.C. t01593C (Price: $8*) and the Grand Prize winners did not make choose either a Time Module or an Ex- Complete calendar from January 1, 45 the press date for the last issue of KEY tended Functions Module. B.C. to February 28,4904, the entire period NOTES. We are featuring these winners in Here are the ten winners for the month of of the Julio-Gregorian calendar that can be this issue. March. The authors of the first two calculated with certainty. Computes days The December winners all chose programs chose a Printer and a Cassette between dates, day of week, Julian day, HP-41CV's as their prizes and, as you Drive as their prizes. date of a specified number of days before or know, each of the Grand Prize winners is after a given date, converts Julian day to now the proud owner of an HP-85 Personal (41) Sun Shade t01692C (Price: $12*) calendar date. Rejects invalid dates. Pro- Computer! Architects, engineers, and designers of gram allows for Roman errors in inserting leap years between 45 B.C. and 8 B.C. as DECEMBER WINNERS solar-related equipment and structures will find this program useful. Its primary well as the Augustan and Gregorian (41) Sunpath Diagrams t01524C purpose is to compute the shadow cast by a corrections. Required accessories: 3 Mem- (Price: $lo*) shading device. The shading device may be ory Modules. (815 lines, 1554 bytes, 17 SUNPATH calculates solar altitudes and horizontal, vertical, or oblique. Sun alti- pages) azimuths for each daylight hour of the day, tude, sun azimuth, and effective sun Author: William Hutchins given date and site latitude. A blank chart latitude are computed for daylight hours at Los Angeles, California is furnished for plotting sunpaths for each any location in the world. Many other solar month. Illustrated procedures are given for geophysical parameters are available such (41) 1,2, or 3 Way ANOVA's t01579C using the results. Another program, labeled as declination, times of sunrise and sunset, (Price $8*) SUNTIME, converts from solar time to Equation of Time, etc. Time may be One-, two-, or three-way ANOVA's (ANal- local standard time and vice versa. Re- specified as either apparent solar time or ysis Of VAriance), without or with replica- quired Accessories: 2 Memory Modules for local standard time. A correction to stan- tion (equal or unequal), are calculated by either SUNPATHor SUNTZME, 3 Memory dard time may be made for daylight saving the unweighted means method modified to Modules for both simultaneously. (596 time employ exact total sum of squares. This is a lines, 1396 bytes, 23 pages) Two powerful new design tools are friendly program! Just set factors, levels Author: Ross McCluney introduced. A dimensionless S/L ratio that per factor, whether or not you desire a Cape Canaveral, Florida lets you calculate shading by a simple (Continued)

KEY NOTES V6N2 May 1982 Page 3

HP Computer Museum www.hpmuseum.net

For research and education purposes only. printer output (if the printer is attached), (41) Symbolic Logic-Summary and Best Sellers Applications #Ol694C (Price: $12') whether or not you desire replication (yes or We have had a lot of queries lately about no), and enter the values. The ANOVA This program is a relatively complete the popularity of certain programs, and table will come out either printed or flashed treatment of elementary symbolic logic. this is usually followed with the question: sequentially. Required accessories: At least Logical operators defined include AND, 3 Memory Modules. (600 lines, 1194 bytes, "What are the most popular programs in OR, NOT, IMPLICATION (if and only if), the Library?" So we compiled a list of the 17 pages) and EXCLUSIVE OR. The operators are best-selling programs since January 1982, Author: Dr. Nicholas Sinelair based an the definitions of Lukasiewicz and here they are. They are presented in London, Ontario, Canada (WookashAYueech; the "father" of RPN) numerical order, which is not necessarily and thus hold for one kind of threevalued their order of sales. Notice that most of logic. These same definitions will work for them have already appeared in KEY (67/97) Trigg's Trend Analysis Boolean Logic when the base is 2. Thus the #04776D (Price: $6*) NOTES. We congratulate these authors program may be used to simulate digital and encourage them to continue their level Levey-Jennings control charts are com- logic circuits. The user must write the of excellence in the future. monly used in laboratories to monitor programs to simulate these circuits, but analytical variation. Unfortunately, they examples are given to show how to do this HP-67/97 PROGRAMS do not permit the simple detection of non- expeditiously. A "cookbook" of compound Star Trek Advanced #00369D (Pri random trends with much sensitivity. This conditionals is included in the documenta- program provides Trigg's technique for the tion. Required accessories: I Memory $69 Author: L.G. Schneider quantitative detection of trends in quality Module. (186 lines, 398 bytes, 31 pages). English Metric Conversions #I00434 control data. Data may be stored on cards Author: Edward Keefe (Price: $6*) Author: E.R. Kool for ongoing evaluation. (105 lines, 7 pages) Ankeny, Iowa Stock Selection: Criteria of Ben Gra Author: Mike McDonald and James Rea #01544D (Price: Berkeley, California (41) Thermodynamic Properties of Author: K.L. Hellams Saturated and Superheated Steam Feeder Sizing and Voltage D (41) Auto Banner #Ol691C (Price: $6*) #01693C (Price $12') #01878D (Price: $6") Author: N.J. Tape Recorder Counter Conv This program, using commands from the Calculate the thermodynamic properties: #01917D (Price: $6*) Author: Extended Functions Module, will translate specific volume, enthalpy, and entropy, of Gehlar an ALPHA string and automatically print saturated (liquid and vapor) and super- Perspective Plot #02849D (Price: a Banner output. This program is incre- heated steam given temperature and pres- Author: L.H. Anderson dibly fast. The user simply keys in the sure. One equation of state, Martin's, is Oil or Gas Downhole Pressure Bu ALPHA sting, the HP-41 does the rest. In used over the entire range of temperature Analysis #03246D (Price: $6*) addition to the keyboard characters, 106 of and pressure, down to Vr= 0.56. The D.G. Olson the 127 special characters are also sup calculated properties are within the toler- Hex/Decimal, Hex Arithmetic fo ported by keying in the character number ances given by the International Skeleton Drocessors #0435013 (Price: $6*) and executing the function XTOA to add Tables (Steam). Required accessories: 4 b.~.Brown the character to the ALPHA string. Re- Memory Modules; Printer helpful. (1047 Astrophotography Exposure Guide quired accessories: One Memory Module, lines, 1765 bytes, 36 pages) #04551D (Price: $@)Author: J.P. Extended Functions Module, Printer. (103 Author: Robert Wooley lines, 205 bytes plus 92 data registers, 8 Midland, Missouri $12*) Auth pages) Author: Christopher Erickson Pullman, Washington GRAND PRIZE WINNERS HP-41 PRQGRAMS (41) Equilibrium Flash #01569C (Price: And now (drum roll), this is the announce- Simplex Algorithm #00320C (Price: $8') ment that you have been waiting for. Here Author: L.A. Esterhuizen Given the number of moles and the K are the Grand Prize winners of the 1981 Wizard of Pinball #00361C (P values (ratio of the fraction of the compon- Users' Library Contest. These three Author: C.A. Pearce ent in the vapor phase to the fraction in the winners each received a fabulous Plot of 2/3 Functions on one liquid phase) of up to 10 compounds, this HP-65 Personal Computer as their #00732C (Price: $6') Author: J.L. program will compute the equilibrium prize! Hunt the Wumpus I1 #00783C phase compositions. Ideal K's are calcu- (41) Superbeam #01044C (Price: $lo*) $6*) Author: B.J, Wheeler lated if the critical properties and boiling Author: Steven F. Dusterwald Football Super If1 #00803C (Price points of the components are furnished. A Author: J.P. Dublirer rugged algorithm is used that always (41) Acid-Baee Factors for Blood and Brain Interstitial Fluid #01030G The Caves #00900C (Price: $6*) A comes to a solution. Required accessories: 3 J. Surber Memory Modules. (487 lines, 1081 bytes, 11 (Price: $lo*) Authors: Thomas Adams and S. Richard Heisey Microcalc #01116C (Price: $6*) Au pages) N.C. Shammas Author Norman Samish (41) General Network Reduction Pro- Advanced Star Trek ff01321C ( Houeton, Texas gram #01526C (Price: $12*) Author: $12*) Author: J.P. Patterson Dieter Lange Rubik Cube Solution #01342C (41) Vented Loudspeaker BOXTunings The abstracts for the fist two programs $12*) Author: J.L. Gilby #01461C (Price: $12') were featured in V5N3p4,5. They were rn Phone Directory #01459C (Price: Using data on the loudspeaker in ques- winners for the month of September. And, Author: J.F. Glass tion, this program solves for the "optimum" the third program is listed as a December vented enclosure and permits the user to winner in this issue. 'US dollars Ord~rfifrom anywhere outside t vary the tuning parameters to test alter- We are very happy to express our thanks must ~ncludea negotiable check (or money order) dollars, drawn on a U.S. bunk. All orders fr nate tunings. A l/3-octave response listing to these three (whoops, four) authors for outsrde the US.and Canadn must rnclude is ~rovidedand, with the accessory printer, their contributions to the Users' Library. 10 percent fee for specral handling and atr the frequency response is plotted. Required Through the efforts of these authors and (For example, un order for twoprograms = acceesories: 4 Memory Modules. (660 lines, thousands of others, the Library will $1.20 = $13.20 total.) If you lrue in Europ order KEY NOTES Progrums drrectly from the 1643 bytes, 29 pages) continue to expand its services to the UPLE, but make eerdain you makepayment as Author: Thomas Bouliane hundreds of thousands of HP calculator by Users' Program Ljbrary Europe, the ahoue Buffalo, New York users. goodonl) for orders lo the Coruallzs Lrhrary.

Page 4 KEY NOTES V6N2 May 1982 If you would like to see what makes a Paulo, Singapore, Sydney, Tokyo, and Appendix B. Feedback Analysis and program popular and would like to order Toronto. Check at your local dealer or call Synthesis Programs any of the above programs, they are the publisher's agent to locate or order this Appendix C. Two-Ports, Transistors, and available from the Corvallis Library for the book. As a last resort, write to the ABCD Matrices listed prices. However, if you live outside publisher: the U.S., don't forget to add an additional McGraw-Hill Book Company For readers who want to apply the new 10 percent handling and postage fee for the 1221 Avenue of the Americas methods directly to their own designs or to order, and make sure that payment in U.S. New York, NY 10020 U.S.A. check the designs given in the book. 31 dollars accompanies your order. programs are provided, all written for the HP-41C or HP-41CV. These programs cover most aspects of the material in the book. FEEDBACK, by Fred D. Waldhauer, is One of these programs synthesizes feed- another new book just off the press. It is back systems for a prescribed performance; Book Reviews hardbound (with dust cover), 651 pages, another converts the HP-41 into a "two-port Books are reviewed or announced in KEY and in 6.3 by 9.1 inch format (16 by 23 cm). network calculator." Included are the four NOTES only as a service to our readers. A And because the programs in this book deal basic functions of addition, subtraction, review here does not represent an endorse- specifically with the HP-41, we know a lot multiplication, and the matrix inverse, as ment by Hewlett-Packard. If you are unsure of our readers will want to see it. well as lead interchange operations. This about the contents of a book, we suggest The author, Fred D. Waldhauer, is a "calculator within a calculator" is itself you first check with a local bookstore; if supervisor in the Transmission Technology programmable, and can convert numerical that fails, write to the publisher. Avail- Laboratory at Bell Laboratories in results into network propkrties including ability problems also should be addressed Holmdel, New Jersey. His work has con- loss, input and output impedances, and to the publisher, not to KEY NOTES. centrated on feedback processes and digital sensitivities as functions of frequency. COCKPIT COMPUTERS, by Paul communications. He is the author of papers An outgrowth of courses taught by the Garrison, a new book just released by the on circuits, feedback, and high-speed digi- author in Bell Laboratories, this book will McGraw-Hill Book Company, is a 249-page tal transmission, and holds 14 patents in serve as a text in courses and professional hardbound book (with dust cover) in 7.3 by these fields. Mr. Waldhauer is also a Fellow seminars. Electronics engineers, scientists, 9.1 inch format (18.5 by 23cm). A main of the IEEE (1977), a professional engineer technicians, and upper-division electrical selection of the Flying Book Club, it is (New Jersey), a member of the Audio engineering students should find it a more replete with practical tips for the con- Engineering Society, and he received his direct approach to the design of feedback scientious aviator, and it shows how to use M.S. in electrical engineering from Colum- systems and circuits. today's aviation calculators and computers bia University. The price is $47.50 (US. dollars) and, effectively, thus making any flight more This book describes the first new, origi- before you rule it out, remember that it efficient and saving considerable fuel in the nal approach to feedback in over 50 years, contains 31 programs for the HP-41, replete process. Although there are many aviation with important applications for electronic with example, listing, etc. Check your local computers and calculators described in circuit design. Mr. Waldhauer greatly bookstore or agent first, and remember that Cockpit Computers, readers of KEY simplifies feedback analysis and design by this is a new book that might take months NOTES will be interested in the fact that adopting a new pattern based on "anti- to get to faraway places. As a last resort, in the HP-41 is included. However, most of the causal analysisH-the analysis of feedback Europe and Asia contact: actual programs are for other types of from output to input. This approach makes John Wiley & Sons, Ltd. calculators. We recommend tha.t you look the feedback analysis problem easy to trace Baffins Lane, Chichester, before you buy. from the initial rough approximation to the Sussex PO 19 IUD On the plus side, the author thoroughly final exact analysis and design. It offers a England discusses such specific aviation problems neat solution to what has always been a In Australia and nearby areas, contact: as the time, fuel, and distance to climb; true difficult problem. Jacaranda-Wiley, Ltd. airspeed; estimate time en route; area In the book there are many examples and GPO Box 859 navigation; range and endurance; weight calculator programs that enable the reader Brisbane, Queensland 4001 and balance; and so on. to apply its principles to all problems Australia Paul Garrison, the author of this new involving feedback structures. Most of the In the US., Canada, and Mexico, contact: book, is not a new writer. He is not only a examples are derived from electrical cir- John Wiley & Sons, Inc. professional pilot but also a well-known cuits. These exam~lesranee - from audio- Wiley Interscience Division freelance writer who has written over 300 frequency design to microwave integrated 605 Third Avenue articles for such national flight magazines circuits. The Table Of Contents is: New York, NY 10158 as Air Progress Aero, Private Pilot, and 1. Feedback Amplifiers: An Alternate Plane and Pilot. He is the author of 20 prior Foundation books, including Inside Private Aviation, 2. Polynomials of Loss: Various Descrip- Cross Country Flying, and Gliders-How tions of Polynomials to Build and Fly Them. 3. Elements of Feedback Synthesis: A Something For Nothing Although this book has just been re- Case Study In the V5N3 issue of KEY NOTES, John leased, it does not include the new Hewlett- 4. Signal Flow Graphs of Polynomials, Loux discussed inoperative functions in Packard Interface Loop or its peripherals, Rational Functions, and Circuits the "In The Key of HP" column under the or even the new Time Module. So if you 5. Signal Delay in Feedback Systems subtitle "Indices." This discussion brought combine these new products with the 6. Two-Port Analysis of Circuits and in a lot of mail dealing with "no-ops," and information in the book, the book takes on Devices indices in general, and we thought you a whole new flavor. 7. Feedback Analysis of the Bipolar would enjoy seeing some of the suggestions Because it is a new book, you might not Transistor that we received. see it in your local bookstore for a month or 8. Two-Port Feedback Analysis First, Robert Whipple of Washington, more, especially if you live in faraway 9. Analog Integrated Circuit Design: D.C., has this to say. places. The price of the book is $24.95 (US. Feedback and Feedforward My candidate for filling the inoperative line dollars) and the publisher is McGraw-Hill 10. Output-Stage Design following an ISG or DSE is a single, solitary Book Company of New York. They also 11. Noise and Input Stages decimal point. As I understand it, this takes have offices in St. Louis and San Francisco, 12. Differential and Operational only one byte (the same as CLD) and it has the and in Aukland, Bogata, Hamburg, Johan- Ampli'fiers documentary advantage that it is visually as nesburg, London, Madrid, Mexico City, Appendix A. Programs For Manipulating close to a completely blank line as you can get Montreal, New Delhi, Panama, Paris, Sao Polynomials (Continued)

KEY NOTES V6N2 May 1982 Page 5 in a program listing. (This advantage is less programmatically accessible with the Library asks is that the authors of pronounced, of course. in a program listing powerful decision-making ability of the programs that use large or multiple data done in TRACE mode.) Instead of initializing a HP-41 makes it possible for a well-written files consider their options. nontested index with a value like 1.999 and program to handle virtually all aspects of incrementing it with a simple ISG, I initialize it cassette drive manipulation. DOCUMENTATION with the value 1 and follow the ISG with a The program author should keep in mind A point that again must be stressed is single decimal point, thus saving 3 bytes of that one of the main reasons that program- that a main reason that calculators and memory. mable calculators exist is for user con- software exist is for user convenience. And, from John Allen in Nashua, New venience. The Library therefore feels that it Program authors should realize that much Hampshire, we have this. is generally unacceptable for a submitted of a useful program's friendliness is lost ifit KEY NOTES is great and I appreciate your program to require manual intervention to is not documented well enough for the user suggestions for a "NOP" following DSE or ISG deal with programmatically manipulable to learn how to use it in a reasonable instruction. In the program I was writing, I features of a device. amount of time. couldn't use CLD because I wanted to Documentation of the content and use of preserve an AVIEW report. And X<>X, as you data files can be critical. The most obvious point out, takes one more byte, and also takes time that documentation of data file too long to write (I'm lazy). So why not DEG? It DATA SAVING contents becomes a concern is when a file of works fine and only takes one bytel So do RAD constant values is destroyed. The user must or GRAD, if you're in one of those modes. Because the HP-41 has a limit to the amount of read/write memory that it be supplied with enough information to be Now, Miles Abernathy of Austin, able to resurrect the file. Another hopefully Texas, has this to say. supports, programs that deal with (com- paratively) large volumes of data often find more common situation is where the user A handy "do nothing" step is LBL nn. If nn desires to write his/her own routines that is 00 to 15, it's only one byte, and it doesn't themselves critically limited in the amount of information that can be stored. Even if access the author's data files. To be able to change any register. do this, it is obviously important that the Thanks, to you three, and to everyone room can be found, many times data must be destroyed by manipulations in the user understands the internal organization who sent us setters dealing with this of the file. subject. program. In the latter case, further calcula- tion on the same data must be preceded by The Library expects that the documenta- re-storing the data. For this reason, per- tion that accompanies each program deal- haps the greatest advantage that. the ing with data files completely describes the cassette drive affordsis the ability to retain contents of any constant file and com- this data for further and future uses. pletely describes the internal organization In the Key of HP Cassette data files make it possible to of any variable file. The reasons for and Most of the information you find in KEY access data without loading all of it into methods in which the program manipu- NOTES is contributed by HP calculator calculator memory, thereby reducing the lates the file(s) also should be well users, just like yourself, who live in'all parts need for a large number of calculator data described. of the world. This ongoing column is, for registers. The cassette data file also can be the most part, written by John Loux who easily reused without being modified. ERRONEOUS ASSUMPTIONS is a Technical Advisor in the Corvallis Programs that generate and/or manipu- Most critical problems with programs Users' Library. His articles contain infor- late data files should take advantage of the stem from assumptions that the author has mation, tips, and techniques that will help cassette drive's ability to preserve initial made about the configuration and/or state you to write more useful and efficient data and not force the destruction of any of the calculator. Some invalid assump- programs. Here's his latest. accumulated data. In submitted programs, tions that may arise in dealings with data the purging or zeroing (clearing) of any files on the cassette drive are: THE DIGITAL data file should be well justified and well 1. The interface is in MANIO or CASSETTE DRIVE documented. AUTO10 mode. The assumption of one The HP-41 has been recently endowed or the other mode is invalid unless the with the ability to access and manipulate SINGLE VS. MULTIPLE program itself has set either mode. This large amounts of data and program infor- DATA FILES is not to say that the program must set mation. I am speaking, of course, of the What appears to be a convenient way to one or the other mode. Many application introduction of the HP 82161A Digital segregate groups of data turns out to yield programs may run equally well in either Cassette Drive. But, as with all technologi- the slowest rate of data access. Multiple mode, so long as the selected device in cal innovations, the advantages gained are data files are an excellent way to segregate MANIO is of the appropriate type. If coupled with increased responsibility. The unrelated information but one must weigh either mode is required, the program Users' Library is most concerned with the the benefits of segregation against the should set it. In certain instances, a programmatic manipulation of the cassette speed and efficiency of access. program may work differently (inten- drive. We know that program authors need Movement through a single data file is tionally) in either mode. In this type of to be made aware of the potential advan- relatively fast. Multiple blocks of informa- program, calculator flag 32 should be tages and disadvantages inherent to the tion can be stored in the same data file if tested in order to determine the current device before they can effectively generate "pointers" to the beginning register of each mode. application programs that use it. Hence, block are stored in calculator memory. 2. The file pointer is currently point- this article. These pointers can be recalled and used ing to the desired file. This assump- with the SEEKR and READRX functions tion is also invalid unless the program MANUAL MANIPULATION OF to access the desired block. Also, short itself has performed the required CASSETTE FUNCTIONS routines can be devised to calculate the SEEKR function. To a computer user, the computer's access necessary pointer value. In contrast, ad- 3. The file to be output to exists or to mass storage is seldom a concern and is dressing a new data file each time a doesn't exist. It is dangerous to often transparent. This is as it should be. different block of data is needed requires assume that if a file exists whose name The user should not be burdened with how the same seek function, and, in most cases, is the same as that which the program the currently used application program the added delay of searching the cassette uses that it is necessarily the file the stores and retrieves data or chains program directory for the file location and the delay user wants to be accessed. If the named sections. It is for just this reason that all of moving to the file. file exists, the user should be warned functions of the cassette drive (except There is no set rule to follow in judging either by the program or by the docu- NEWM) are programmable. The combina- between the two methods of data block mentation that the program may alter tion of the necessary functions being access. Both have their merits. All that the its contents. Unconditional creation of

Page 6 KEY NOTES V6N2 May 1982 data files can also cause problems if the system the functions are not encount- Page 24, under MI. After a file in another file exists that has the same ered. Therefore, a program does not require extended memory is purged, there is no name or if the program destroys any file a peripheral simply because it uses func- working file. Therefore, before subse- of the same name before creation. tions found only in that device. Neither can quently executing functions that operate on Creation, destruction, and modification a program claim to require a mass storage the working file, you should execute a of file information must be well docu- device simply because the Library requires function (such as -1 that defines the mented. In each of these cases, the some sort of mass storage media with each working file (that is, makes the specified program could query the user before the submittal. A program requires a peripheral file the working file-refer to "Working action is taken, thus making certain only when it cannot perform its function Files," page 23). For example, after execut- that it is desirable, without the device. ing write the name of an existing In order to make programs accessible to file in the ALPHA register, then execute the largest possible number of users IFLSlZEI-that file now becomes the working PROGRAM FILES authors should not write programs that file. After executing I=], you should The reader's first thought about the require peripherals unless they feel that the always define a working file before execut- usefulness of the cassette drive in conjunc- requirement is a definite enhancement to ing functions that operate on it; otherwise, tion with program storage is probably the program. all files in extended memory will be lost. along the lines of structuring a personal program library. Although this is a reason- Page 25, before Program File Opera- able pursuit, it may not be the most tions. If a register in a file contains a important program application of the New Special string of seven charact+ers all having cassette drive. character code 255, and if another file One way to optimize the use of calculator Service Offered closer to the beginning of extended memory memory is to split the program into We now offer at Corvallis, HP Dealer is purged, then all information from that functional segments that can be loaded as location, product information, prices, register to the end of extended memory may necessary from mass storage into calcu- Users' Library information, and service be lost. To ensure that this doesn't occur, lator memory. This technique may require prices and status for TDD (telecommunica- avoid appending, inserting, or adding to a more logical planning in order to maintain tions devices for the deaf) and TTY file more than six consecutive characters program integrity and consistency, but the (teletypewriter) users with hearing or having the character code 255. advantages gained by calculators with a speech impairments. Please dial 503- limit to their memory are in most cases well 758-5566(not toll-free). , Page 25, under Program File Opera- worth the effort. The program's sections tions. If you execute -] from the may "chain" each other into memory, each keyboard, be sure the calculator is posi- calling the next as its usefulness is tioned in program memory (as described exhausted. Alternatively, one master pro- Addendum for above). If the calculator is positioned to a gram may call several slave routines that program in a plug-in application module or replace each other in memory. 82180-90001 Manual device when you execute [SAVEPI, the The Library recommends that program If you own the HP82180A Extended information in the calculator's memory and files and subprogram files be documented Functions/Memory Module Owner's Man- in extended memory may be changed or in the same complete fashion as that ual, part number 82180-90001, dated Nov- lost. expected of all submitted programs. Subpro- ember 1981 or April 1982, you should mark grams require more documentation than the following changes in your copy of the "stand alone" programs in order to aid the manual. Later versions of the manual will user who desires to write hidher own have either the Addendum with them or the routines that access the subprograms. corrections will be incorporated in the New HP-IL Video The cassette drive supports status, write- manual. Interface Available all, and key-assignment files. Because the Page 8, under Configurations. If you Library is a user-oriented organization, we have the HP 8210412 Card Reader plugged The new HP 82163A Video Interface will recommend that you follow certain guide- into the calculator and an HP82181A be available at your local HP Dealer lines whenever you consider submitting Extended Memory Module plugged into sometime in June-probably by the time one of these types of files. First of all, many port 2, and you execute the card reader you are reading this KEY NOTES. With users feel inconvenienced by programs (or function m, some information in that this new device, the HP-41 will be capable documentation) that require key-assign- extended memory module may be changed. of displaying on a monitor or TV, 96 ments or that require a certain calculator Therefore, you should avoid using the Standard ASCII or inverse video char- status. For this reason, the Library recom- function if you are also using an extended acters, with up to 32 characters per line and mends that submitted prograps do not call memory module in port 2. 16 lines per display. The HP-41 also will be key-assignment or status files without first Page 17, under Clearing Programs. capable of screen control and cursor giving the user a choice. Defining the If you execute IPCLPS(from the keyboard, be control. The HP 82180A Extended Func- keyboard or status of the calculator is best sure the calculator is positioned in program tions Module will help to create the done in optional routines within the memory. You can position the calculator in necessary commands to enable screen and program, and these definitions should be program memory in any of the following cursor control. well described in the documentation. Sec- ways: The new HP-IL Video Interface is all that ondly, write-all files cause difficulties both Press -1 17 followed by (as is needed if you want just a convenient way for the Library and for program users. Plus, described under "Using 1-1 for to output data and programs in video. The programs recorded as PRIVATE present Positioning" in your calculator owner's HP-41 printer commands in this new the Library with obvious reproduction manual). module will allow all normal character ~roblems.For these reasons. the Librarv Press I-1 label using a output to occur in a very friendly manner. hiscourages the submittal of write-all fil' label in Program memory (one that is Flags 15 and 16 in the HP-41 will control and PRIVATE programs. listed in CATALOG 1). the PRINT (output) mode to the video Presslnm. display. For example, when flag 15 is SET, If the calculator is positioned to a program it will make the video display act like a DEVICE DEPENDENCY in a plug-in application module or device printer in TRACE mode; and when flag 16 It is not always obvious when a program when you execute m,the information is SET, it will make the video display act requires a peripheral. For example, a in the calculator's memory will be lost and like a printer in NORMAL mode. And, program may use peripheral functions in the calculator will display MEMORY when both flags are SET, they will put the such a way that if the peripheral is not in LOST. (Continued)

KEY NOTES V6N2 May 1982 Page 7 video display into a new "TRACE WITH except Oregon, please call toll-free (800)547- STACK OPTION" mode that will cause 3400. In Oregon, Alaska, and Hawaii, call New Club Formed stack registers X, Y, Z, and T to be (503)758-1010. in Germany "printed" (displayed) after each operation. If you do not live-near an HP Dealer, you If you can read the German language, Now you'll be able to "see" how you left the can order calculators and accessories you might be interested in a new Club that stack and what is in it! (Very nice, yes?) through the HP Corporate Parts Center. was founded in November of 1981. Called Finally, with both flags CLEAR, the video They will accept purchase orders ($20 CCD, for Computerclub Deutschland, the display will be in MANUAL mode. minimum), checks, money orders, and cash. Club had over 1,000 members by February Best of all, this new video interface is an However, C.O.D., credit card, and telephone 1982! And all of the members are HP-41 HP-IL device! Therefore, it will be com- orders will not be accepted. Be sure to users. patible with future HP-IL devices. And, include a $3.50 handling charge, plus your The Club prints a monthly newsletter, although you may be excited about state and local taxes. Mail your orders to: PRISMA, that contains many HP-41 pro- "seeing" your HP-41's innermost "secrets" grams, technical notes, Synthetic Program- on TV, be sure you call your local HP Hewlett-Packard Company ming, self-produced hardware, and much Dealer before you rush down to the store. Mail Order Department more. The newsletter is entirely written in This is going to be a popular peripheral, so P.O. Box 7220 German. Nearly all of the programs are for make sure the Dealer has one and can Mountain View, CA 94042 professional use, but a few games are demonstrate it for you. printed. And all printed programs include This notice and the above changes apply bar codes. only to domestic orders. Neither Corvallis Regular Club meetings are being held in Division nor the above Mail Order Depart- nearly every large city in Germany, and Add "Racing Stripes" ment will handle orders from anywhere members come from nearly all West- outside the U.S. European countries. In German law, the to Your Bar Code The Corvallis Users' Library will con- Club is a "gemeinutzig anerkannter einge- In KEY NOTES V5N3 we proposed a tinue to accept and process orders for tragener Verein," which, in English, means method to increase security for programs subscriptions (KEY NOTES and Library) a nonprofit, legal club, controlled by public reproduced in bar code. The method con- and programs. But remember that the commissions. However, there is a fee for sisted of printing the bars over red Library does not accept purchase membership. background. After some further testing orders for orders under $20. If you are interested in the CCD, write to (including some tests volunteered by the first chairman: Richard Nelson and Noel Brinkley of PPC), Oliver Rietschel, 1. Chairman we are back with the promised update. Computerclub Deutschlande. V. It was found that some copiers checked P.O. Box 373 relative contrast between printed informa- 2420 Eutin, W. Germany tion and a background color. These copiers KEY NOTES Corrections Be sure to include a self-addressed, stamped could easily produce duplicates that a wand Here is a letter from Nai Chi Lee, of Stony envelope. If you can't include stamps, you will read. Brook, New York, concerning an error (our can include at least two magnetic cards. Introducing the racing-stripe ap- error) that appeared in the last issue of (Note: CCD is not sponsored, nor in any proach! Several patterns and narrower KEY NOTES. way officially sanctioned, by Hewlett- stripes were tested. The stripes proved the With reference to my integer-packing Packard-Ed.) most successful, especially when printed to routine printed in V6Nlpl 1, please be overlay the leading and trailing edges of a informed of the following: row of bar code. These areas appear to be the most critical for the wand to success- 1. The program will not work as printed1 fully read the code. The error is in line 16. Delete it and Linear Interpolation The second discovery was that a thermal replace with -1, ABS (this is not On The HP-41 copier would not reproduce the red (as gray) equivalent to 1). because there is no carbon content in red 2. In the description, paragraph 2, first line: Here is a routine from the biggest state in ink. This problem is easily overcome by "number uvwxyz" should be "number the "lower 49." Austin is the capital of this printing the bars using a carbonless black abcdef." state-Texas- and it is the home of Philip ink. Now the thermal copier won't "see" the Petersen, who sent this routine. bars either! Also, in V6N1, on page 13, column a, the (41) This short routine linearly interpolates A combination of the two techniques second line in the routine MAG should be multiple times after initial conditions are set, should produce bar code that cannot be LBL A; and the name of the author of this using only register 00 for safekeeping. reproduced successfully by over 95% of the routine is Jeffrey Smith not Jeffery Besides the two ALPHA prompts (that take up copiers on the market. Smith. Sorry, Mr. Smith. In VGNlpllb, the many bytes), the routine is at peak efficiency In case you missed the specifications second paragraph of the description pre- and optimum ease of use. earlier, the color of inks recommended (all ceding John Hendricks' PRDMS routine "reds") in order of preference are: PMS should read: For HHhMM'SS, substitute Sl*LBL =INm l9*LBL 90 #199, PMS #485, PMS #185, PMS Warm 104, ACCHR for lines 08 through 19. 02 "KNOMH?' 11 ST- Y Red. The description of the "Stock Plotting" 03 PROHPT 12 XOY routine on the back page of V6N1 fails to mention that the calculator must be set to a 04 ST- Z 13 RCL 0R minimum size of 18 and that the printer Y5 - 14 /

mode switch must be set to MAN. 96 rfl 15 + A Change is in Order The "In the Key of HP" article in V5N3 97 ST0 90 16 STOP Starting June 1, 1982, Corvallis on page 7 has a confusing sentence in the Division will no longer accept direct- description of the modulo function. The 88 'UNKNOYN?" 17 CTU mail and telephone orders for calcu- second sentence of the second paragraph of 99 PROMPT 15 .END. lators and accessories. To order calcu- this description should read: A number can lators and accessories in the future, please be determined to be within a certain range Operating instructions: For tabular data contact your local authorized HP Dealer. if RANGE MOD X < RANGE. such as, They should have stock on hand for In V5N2, there is a typographical error a x immediate purchase. To locate your nearest on page 8. In answer 22 of the answers to r (unknown value) HP Dealer in the continental United States the HP-67/97 test, ST0 1 should be ST0I. b y

Page 8 KEY NOTES V6N2 May 1982 where a corresponds to x, b corresponds to y, Sending 8-Bit Data and r corres~ondsto the unknown value. cENTER) LX Creating a binary byte with a 1 At the pro'mpt-~~~~~?-keyin: a With the HP-41 decimal value of 160. BLDSPEC rmblR/SI (Note: This article presents the theory 32 BLDSPEC At the prompt-UNKNOWN?-key in: x behind Librarv Program- #01644C. Bar IENTERly lR/SI Code Generator, which appears in this Example problem: issue of KEY NOTES-Ed.) Figure 4. Creating a Byte Value Given the following properties of steam at There are two methods currently avail- Greater Than 127 1.5 MPa and 1.75 MP, estimate the values of able to the HP-41 user who wants to build The 1, BLDSPEC followed immediately T, Vf, and Vg at 1.58 Mpa. 8-bit binary bytes of any value. (For P(MPa) T(C) Vf vg example, in constructing bar code such as with a number 0 to 127 BLDSPEC will 1.50 198.32 0.001 154 0.131 77 that used in Library Program U01644C.) create byte values from 128 to 255. 1.58 7 ? ? The easiest method uses the XTOA func- As these special characters (byte values) are built in the X-register, they should be 1.75 205.76 0.001 166 0.1 1349 tion contained in the HP 82180A Extended recalled into the ALPHA register. When the Solution: Functions Module. The other, a more string is complete, the OUTA function is KEYSTROKES DISPLAY difficult method, uses the BLDSPEC func- I tion contained in the HP82160A HP-IL used to send it to the selected device. KNOWN? Interface Module. It is this second method This technique was used in the Bar Code Generator program (U01644C); however, it that forms the topic of the following would be valuable to anyone wishing to discussion. UNKNOWN? First, take a quick glance at figure 1. send binary bytes, other than the standard Now, if we were to look at the decimal ASCII set, to any HP-IL device. 200.700800 equivalent value of each bit in a binary (Because of the present data-handling (Tat 1.58MPa) byte, we would find that the value of any routines in the HP-41, null or zero bytes .001154 pmq byte with bit 7 set (the high order bit) would cannot be used as the first byte in a data ,001 166 1R/SI 0.001 158 yield a value equal to or greater than 128. s,tring. Additionally, the OUTA function (Vf at 1.58) ignores them even in the middle of a string. .13177- Life is never perfect, n'est-ce pas?-Ed.) .11349m 0.1 25920 128 64 32 16 8 4 2 1 Bitvalue (Vg at 1.58) x x x x x x x x A binary8-bit byte 7 6 5 4 3 2 1 0 Bit number

Figure 1. A Binary 8-Bit Byte The byte value is the sum of all of the bit Generating Bar Code values. - With the HP-41 On Creating and Using Because many readers have expressed a Cassette Data Files Bit Bit desire to be able to "create" bar code at Set Value 128 64 32 16 8 4 2 1 BitValue home or at the office-or anywhere, for that Data files must be "created" before they 1 2 1 0 0 01010 matter-we have included in this issue a can be used. Unlike program files, a data Bit Number 7 128 program that will satisfy most of that file has to be created so that you can specify desire. If that word "most" gives you the its size. With the HP-41, the HP 82160A %GEEE idea that this is not a perfect solution for HP-IL Interface Module, and the home-generated bar code, you are right. But HP 82161A Digital Cassette Drive, a file is Figure 2. Byte Value Example this program will enable you to print usable created by placing into the ALPHA register bar code. the name of the file (not more than 7 char- Creating a byte (or bit pattern) using There are some basic operating limits you acters), and by placing in the X-register the BLDSPEC is easy, and a simple matter, need to know. First, you must use the new number of required registers. For example, until we exceed 127 (decimal). But, first, HP82160A HP-IL Module and the new if we key in: BILL I3000 take a look at figure 3 in order to create a HP 82162A Thermal Printer. Second, you CREATE m,the cassette byte with a value of 0 to 127. must use the new black HP 82175A Ther- drive will "create" a file named "BILL" and mal Printing Paper. Third, you should the file will have 3000 registers. CLX read, in this issue, the article, "Sending 8- ENTERt Now, suppose we want to store 10 Cleating a binary byte with a Bit Data With the HP-41," because it registers (Rlo-Rig) of information into dacimal value of 32. 32 BLDSPEC explains the theory behind the following cassette file "BILL" at locations 100 program and a few software limitations. through 109. All we need to do is key in: Figure 3. Creating a Byte Value 0 to 127 But make no mistake about this: With the BILL 100 m*10.019 HP-41 the HP-IL Module, the new printer, The first part of this sequence will I. the new black paper, and the following position the cassette drive at register 100 in program, you can generate immediately file "BILL," and the second part will write This will leave in the X-register an alpha usable bar code. Here is an expanded HP-41 registers 10 through 19 into cassette abstract. drive registers 100 through 109. data byte-seen as a character-that is But suppose we now want to recover actually a bit pattern equivalent to the (41) Bar Code Generator #01644C those same 10 registers of information and decimal value used prior to the BLDSPEC (Price: $6;) place them into registers 00 through 09 in command. The CLX and ENTER com- This program, when coupled with know- the HP-41. That's no problem. Just key in mands are used to ensure that the ledge from the 82153-90019 Creating Your -1 -1 BILL 100 0.009 Y-register is clear and to prevent the Own HP-41 Bar Code manual (pages are -1 -1 and you can view those 10 BLDSPEC command from making an included in program), will allow the user to i registers in the HP-41 by recalling registers unwanted combined pattern. However, print up to 16 continuous bytes of bar-coded Roo through RogIn essence, we have made being able to combine patterns is useful in information. Required inputs are made as a duplicate copy of the information in Rlo to making byte values of 128 or greater. the decimal equivalent of the binary code. R,g and put it into Rooto hg. Keying in 127, BLDSPEC would yield a bit The program uses the BLDSPEC function pattern of 01111111. To set the 8th bit to create the binary codes needed to print You can assign these functions to keys or use the form: (which is actually bit 7; see figure l), follow bar code. This entire operation could be ALPHAl SEEKR m. the example in figure 4. (Continued)

KEY NOTES V6N2 May 1982 Page 9 simplified by using the XTOA COMMAND The printer in this example is at device can be used to make certain things happen IN THE HP 82180A Extended Functions Location 2 (see HP-IL ~oduleOwner's on the Interface Loop. Although these Module. However, this program is designed Manual, page 43). Key in: 2, IsELEdil ICLAl functions are really very bas~c,they are a for the users who do not have other modules SF17 252 [xTOnl 27 38 107 powerful set that allows a programmer to but still want to make their own bar code. ]49 49 72 ~~ll~ASTO 01 access information on just about any HP-IL So the Extended Functions Module is NOT -1 mj. This sequence sets your peripheral. required for this program. Requtred acces- printer to PARSE mode. The ALPHA Because it is not possible to discuss all of sorres: HP82160A HP-IL Module and string used to set the printer to PARSE these Control Functions in this short HP82162A Thermal Printer. (74 lines, 189 mode is now stored in register 01 and can be column let's look atjust a few, bytes, 13 pages) used again (m01 m).The SF 17 AUTOIO: As you know, the HP-41 was Author: Bill Schafer - suppresses the printer carriage return and designed to be a fully "friendly" device. The Corvallis, Oregon line feed. Now, "type-in" the following: AUTOIO (automatic input/output) func- Although this method does work, for -I-WANT-TO-SEE-PARSE- Irn tion also was designed to continue this really first-class long-term bar code that MODE-OPERATE-WITHOUT-THE- trend in its I/O operation. In this mode, the you might want for your day-to-day pro- iALPHnm HP-41 will automatically locate friendly gram use, you can't beat manufactured bar EXTENDED-I/O-ROM-INSTAL printer and mass storage peripheral de- code. Look back to page 5 of V5Nl and ALPHArn vices connected to it, then initiate printing review the article about our bar code LED. ml[acnl(PRBUFI. when it's supposed to occur, and also supplier, George Lithograph. Their ser- This might not be the best operating mode, interact with the mass memory (e.g., vice is good, their product is excellent, and but you have to admit it does work. HP 82161A) when it is supposed to transfer the price is right. They print all of the bar BARCODE: Refer to the Bar Code data and/or programs. In either case, the code that you see in the Library programs. Generator (#01644C) program and the HP-41 will automatically go to the first For more information regarding this ser- article "Sending &bit Data With the available printer or mass memory device in vice and an order form/price list, contact: HP-41" that appear elsewhere in this issue. the Interface Loop and attempt its opera- Dan Riopel STANDBY MODE: This one is easy! tion there. For example, ifyou have two George Lithograph From the ON position, just set the power printers in the Interface Loop and you want 650 Second Street switch to STANDBY, then key in: to cause an output on the second printer P.O. Box 77085x v]PWRDN -1. You will notice (see diagram), then you must "select" that San Francisco, CA 94107 USA that the POWER Light is now off, but the device prior to sending the data to it. HP-41, as the controller in the HP-IL' AUTOIO is, however, the normal "cold system, can turn on the printer and shut it start" condition. off. However, nothing is totally "free." We do not recommend leaving your printer con- What's So Great About tinuously in STANDBY mode during nor- the "New" HP-IL mal operating conditions; that is, using CASSETTE PRINTER PRINTER your computer system at your desk, re- PDEVICE 1 DEVICE2 DEVICE 3 Printer? charger plugged in, etc. The STANDBY I 1 If you have had reservations about mode (on both the printer and the cassette buying the new HP 82162A Thermal Print- drive) is provided to conserve battery power er, here are some features you might not during "remote" or automatic, unattended have thought about. When you examine conditions. (In other words, when the these at the counter display in your local calculator is set to run a program un- HP Dealer's store, you will get a better attended.) The recharger/AC adaptor insight of what this new printer can do for might not always be able to keep up with your system. the recharge rate plus supply continuous FORMAT: The FORMAT function power for operations, so use STANDBY allows you to automatically center text, or Only for its intended purpose. However, you can even left- or right-justify two you must admit that it is a powerful and columns of text or numbers or even a extremely useful new mode. combination of both. For example, make a Both of the HP-41 printers are excellent SELECT: If you want the second printer simple grocery list as follows: additions to your portable computer in the Interface Loop to be theactive device, -1 -1 GROCERY Im IFMT] system, but if you own the HP-IL Module, then you must select that device. As great You will notice that GROCERY will you owe it to yourself to check the added as the HP-41 is, unfortunately it cannot be automatically centered on the printout. features of the new HP82162A Thermal read your mind. So here's how it does this. Now, list the items and prices. Printer at your local HP Dealer. Don't There are two different plug connectors for forget to take along this article! the HP-IL Module, a male (small) and a female (large) connector. The male con- nector indicates the direction of data flow around the Interface Loop and thus con- Actually, this could be made into a simple You, HP-IL, and trols the location of devices in the loop. The subroutine that would do this task for any Control Functions Controller (the HP-41) is always device 0 listing. and, counting around the loop in the PARSE: The PARSE mode, as demon- Have you asked yourselfi "What good are direction of the male connectors (desig- strated here, needs the Extended Functions the general I/O functions in the HP 82160A nated by the arrow) in the above diagram, Module to simplify its implementation. HP-IL Module?" You have? Well, then, let's the second printer is at device location 3. However, if you look at the Bar Code take a look at some of them. So, if you want that particular printer to be Generator program on page 9, you will get the primary printing device, key in the some ideas on how to use BLDSPEC to CONTROL FUNCTIONS following: implement PARSE without using the Ex- On page 43 of the HP82160A HP-IL tended Functions Module. The PARSE Module Owner's Manual, the general I/O 3 [m11 SELECT mode will be supported in a much more functions are referred to as "Interface Now, all you need to do is execute a PRX or "friendly" manner with a future "extension Control Operations," There are 15 of these another print-command, and the second module" (we're still working on it); how- functions and, as it so happens, for some printer will happily start printing whatever ever, it 1s accessible. applications they are the only method that you are sending to it.

Page 10 KEY NOTES V6N2 May 1982 MANIO: How many times have you pause display, a small number (usually 1 or 2), wanted to do things with your HP-41 and press to adjust the watch. Repeat if Routines, Techniques, computer system that were not necessarily necessary. Similarly, if the watch is some- Tips, etc. "the norm?" Well, MANIO allows for such what fast, a negative 1 or 2 will do the trick. The routines and techniques furnished in For a fine setting, a fractional number like0.5 times by giving you more direct control this column are contributed by people from over what happens on the Interface Loop. or 0.2 might be required. all walks of life and with various levels of An example of this can be found right here It isvery interesting to note that, similar to a mathematical and programming skills. in this issue of KEY NOTES, wherein we real digital watch. this watch also switches While the routines might not be the wanted to create bar code on the HP 82162A from 24.0000 hours to 0 hours. ultimate in programming, they do present Thermal Printer without using an "exten- *LPL4 4 new ideas and solutions that others have sion" module. Placing the printer in the found for their application. You might have MANIO mode allows the HP-41 to send DSP4 RCL0 to modify them to fit your personal 8-bit commands for bar code quite easily. HHS+ };,:% y ? application. (The 8-bit mode instruction set is shown in Now, from San Diego, California, we tabular form on page 14 of the owner's FT08 ST-@ r present Jaroslaw Czajowski's "song manual for the HP 82162A.) But, in order to L! +nfls

and dance" routine. How much~ is~ that print bar code, you first must understand 4 PSE goose in the window? The one that goes what bar code really is. And a good way to EEX (;'TO! pF IBEEP g... learn is to look at program #01644C and the CHS tLPLE (41)This subroutine is an improved version article, "Sending 8-Bit Data With the of the "Flying Goose" routine that appeared in HP-41," appearing elsewhere in this issue. 5 EEX V3N4p3, with a little spice of sound added to Included with the documentation for ST01 5 it. Run, see, and hear it1 #01644C are some pages from the book, ?:L51 I - "Creating Your Own HP-41 Bar Code." RCL 1 ST+I 914LBL 'GOOSE" 184181 81 (This HP book was reviewed in V5Nlp5.) 02 SF 194LBL 81 To send 2 bytes of bar code, you first must ST+@ RTN ni put the printer in column mode, then tell it 2 034LBL 01 204LBL 01 that you want to send 2 bytes of bar code. 04 4 21 FS? 81 Using the HP 82180A Extended Functions 95 STO L 22 TONE 1 Module and the following routine you will And, back in the United States, Carl ' 06 FC?C 01 23 FC? 01 be able to do this. Vancini is busy working with his HP-97. Notice that, in this example, the printer is Mr. Vancini lives in Stamford, Connecticut. 07 SF 01 24 TOME IND 1 at location 2, which explains lines 02 and (67/97) 1 noticed that the short routine 984LBL 15 25 DSE L 03. And lines 10 through 13 specify the byte "Weighted Mean," developed for the 89 FS? 91 26 CT? 15 values of decimal 32 and 16. HP-67/97 by D.L. King (V5N2plOb) does not l@+LBL 01 27 ,889 produce the standard deviation. Here is a routine that produces the weighted mean 114LBL 01 28 ST11 L 02 HPNIO 11 XTOfl with the corresponding standard deviation. 124LBL 01 294LBL 16 93 2 1 !2 16 The only limitation is that the weights shall be 134LBL 01 38 TUNE IND L 94 SELECT 13 XTUFI non-zero integers (1.2.3,... ). To run, clear all 144LBL 01 31 ISC L registers, key-in the number, press ENTER, 85 CLi! 14 OUTFI key-in the weight, press b. After all numbers 154LBL 01 32 GTO 16 86 219 15 FlliTOIO and their weights are entered, press i to 164LBL 01 33 fTO 81 97 XTOFl 16 RTN obtain the weighted average, then press s to 174LBL 01 34 .END. 98 123 17 .END. obtain the standard deviation. 89 XT?U 631 #LPLE.' 081 *LBLb The mention of Oak Ridge, Tennessee, In the next issue (due in the mail by @@i 1 683 :+ brings to mind the sweet sound of a August 26), we will present more articles of 023 ST+@ 018 LSTX bluegrass mandolin echoing over the roll- ing green hills on a muggy, lazy, mid- this nature. 864 ,y=y . @:I DSZJ summer day. Thoughts turn to base- 80: A':] Bi2 6TOb conversion on the HP-41, and we bring you 086 RL 6:; RCLQ this routine from Richard Lyon, who lives 897 X2Y el4 RTN in Oak Ridge. (41) 1 enclose a short program for convert- ing an integer between 1 and 100,000,000 67/97 Routines (base 10) to another integer base between 2 and Tips Now, here is a short and interesting and 16. The result is recorded in the ALPHA- routine. Mathew Tomczik of St. Cloud, register, and the individual digits can be Pretoria is a capital city of South Africa Minnesota contributed this. copied down as they are posted if the result located close to some major diamond (67/97) 1 have found a special routine on contains more than 12 digits, or even if digits mining areas. Also, Pretoria is the home of my HP-67 to use when trying to find the log, in will be lost from the ALPHA-register, as in J.M.E. Graindor, the author of this next any base, of any number. Logbx:x>O, b> 1. the conversion of numbers greater than routine. 16,777,215 to base 2. Posting of the digits (67/97) Many programming tips referred @Bi rLP~fi QQ5 R f can be slowed down by squeezing-in a delay to the use of the HP-97 as a timer. Although loop, such as: we fully realize the inaccuracy of the 482 LN 806 - calculator as a timer, it nevertheless is 087 R J. 887 RTN 30a 20 possible to use it as a rather accurate digital O@+ LN 30b ST0 18 watch. 30c ST+ Y Here is a surprisingly short routine to this 30d - effect. Key in the present time in format Example Input Output 30e LBL A D HH.MMSS, press m, and presto, your digital 30f DSE 18 watch is running. If you perceive that the 30g GTO A. watch is somewhat slow, key in, during a (Continued)

KEY NOTES V6N2 May 1982 Page 11 With 20 as the input to register 18, the 014LBL =DISTRm 31 XEQ 03 This next contribution describes an delay is about 4 seconds between postings of 02 FIX 0 32 ARCL 04 interesting technique that many will find successive digits on my HP-41C. with my useful. It came to us from Humbert Hans current banery condition. 03 CF 29 33 'k +- Suarez, who is a student at the University Initially, ALPHA characters (0,1, ...9,A ,... F) 04 ST@ 00 . 34 XEQ 01 of Geneva in Switzerland. for the sixteen digits must be stored in 05 XOY 35 CLA (41) There is one problem that often occurs registers 00to 15. 86 STO 81 36 SF 01 The principle behind the program is that while creating HP-41 programs: You have two after finding the first (lefthand) digit by 07 HOD 37 RRCL 02 programs, one that begins with, say, LBL successive divisions by the base number, the 08 ST0 02 38 XEB 03 "MAIN", and one that begins with LBL fractional part of the quotient will disgorge Q9 BCL 01 39 FtRCL 05 "USER" that has a LBL 01, a LBL 02, and a successively lower digits when multiplied 10 xov 40+LBL 81 LBL 03. The program "MAIN" wishes to call successively by the base number. as subroutines sometimes LBL 01, sometimes Possible round-off error limits the initial 11 - 41 ClVIEH LBL 02, and sometimes LBL 03. But the integer 'to about 100,000,000 and also 12 ST0 03 42 FS? 55 calculator searches numeric labels solely in requires addition of a fractional increment to 13 RCL 90 43 CTO 02 the program from which these labels were the initial integer. I use 0.5. called. 14 RCL 91 44 PSE One solution could be to put global ALPHA Bl+LBL -FIUm 19 GTO 00 15 1 45 PSE labels by the LBL 01, LBL 02, and LBL 03. 62 1.1 204LRL 81 16 IRT 46 PSE However, this solution, consumes lots of 63 ST0 16 21 .1 17 ST# 04 47 PSE memory space and search time. A better solution is to put a GTO IND X at the 94 'NHBR' 22 ST- 16 18 1 4S+LBL 02 beginning of the "USER" program and to call 85 PROMPT 2.3 CLU 19 + 49 FC?C 81 LBL 01 by-1; XEQ "USER", and LBL 02 by- 06 STO 17 24 RDH 26 ST0 65 5fl RTN 2; XEQ "USER", and so on. 07 .5 25 XOY 21 CLU 51 flDV 1st solution 2nd solution 98 + 264LBL 02 22 ClRCL 09 52 flDY 99 'BflSE- 27 RCL X 23 'k OVER" 53 flDY LBL "MAIN" LBL "MAIN" 10 PROMPT 28 INT 24 XEQ 91 54 FtDV XEQ "1 " 1 11 ST0 Z 29 flRCL IN11 X 25 CLU 55 flDV XEQ 00 12 STO T 30 ClVIEH 26 RRCL 01 56 flDV XEQ "2" 13+LBL 68 31 - 27 'k PERIODS=' 2 57 RTN XEQ "3" XEQ 00 14 X>Y? 32 * 28 XEB 61 584LBL 83 15 GTO 91 33 DSE 16 29 CLCl 59 =k flT - END 3 16 1 34 CTO 82 30 flRCL 03 60 RTN XEQ 00 LBL "USER" 17 XOY . 35 .END. LBL 00 18 ISG 16 LBL"1" XEQ "USER" Don MacDonald of Newport Beach, California, sent this next tip. And, in his LBL "2" END C. Lamar Williams, previously known letter, he asked that we give credit to PPC for his elaborate work with letter-banner member Tim Kay. LBL "3" LBL "USER" printing on the HP-41 (V5N3p4), is keeping (41.67.97. ...) Here is the quickest way to GTO IND X up the good work in San Jose, California. determine if x is even or odd: END Here is one result of his work. -1 LBL 01 (41) Budget planners frequently need to XSY distribute an odd amount of money (2) over yx LBL 02 some odd number of time periods (N). This You will see 1 if x is even and -1 if x is odd. distribution usually needs to be nearly These steps leave x in the LAST X register. LBL 03 uniform, i.e., approximately the same amount (On the HP-41, the sequence: 2; MOD, will of money for each individual period. However, work as well. However, x will not be END the total amount of money (2) must be correct; preserved in the LASTXregister-Ed.) i.e., it cannot suffer round-off errors when (This is a good demonstration of "the law summing the "amount" for all of the periods. Now, from London, England, we have of conservation of bytes through conserva- The following routine "DISTR" does the trick1 this tip. It was sent to us by W.A.C. tion of global-ALPHA labels," Mr. Suarez; Just key-in the total number of periods (N), Mier-Jedrzejowicz. however, your second solution does not press m,key-in the total amount (2). (41) If you want to prompt for a value in the conserve search time, as implied by your "DISTR". and witness the answer. This middle of a program, and to store the value to letter. The first solution requires one global routine works with or without the printer. use it, but you do not want to disturb the label search, while the second solution stack, you can do it neatly on the HP-41 as requires a global label search, and then- The problem is: follows: because of the indirect GTO statement-a Z=AX+BY, 01 XSnn step-by-step local label search. So, our N=A+B, 02 RDN advice is: weigh the byte savings against where each variable is an integer; given N and 03 "message" the increased execution time before using 2, find A, X, B, Y. 04 PROMPT this technique-Ed.) The solution is: 05XSnn This technique came to us in a letter A = MOD(2.N) Line 01 saves the present X-value in titled, "How to Double Your Local B=N-A register nn; line 02 rolls the stack down in (ALPHA) Labels From 15 to 30." Undoubt- Y = INT(Z/N) preparation for line 04; line 03 is the ALPHA edly, this method has its drawbacks but, X=Y+l message requesting the new value. In line 04 then again, it may be just what you're Program lines 04-20 solve for A, B, X, and the new value lifts the stack, restoring Y, Z, looking for. The letter was sent to us by Y. The other program lines are for display with and T; line 05 saves the newvalue in register- Vandale John, who lives in Adinkerke, or without the printer. Have fun ... ! nn and restores X. Belgium.

Page 12KEY NOTES V6N2 May 1982 (41) This way of programming is very Next, we have two nice inputs from Here is a routine that will toggle a flag (e.g., interesting in programs made for such Robert Swanson of Portland, Oregon. flag 02) on alternate executions of a section of conversions as feet<>meters, inch<>mm, This is the man who brought us the a program (such as a loop). It requires that gallons<>liters, Farenheit<>Celsius, and so extraordinary gami! program "Flipo" another flag (here, flag 01) be toggled every on. For example: (V6Nlp5a), and both of the methods that he time. is discussing here were used to create that FC? 01 814LBL 'F( >Hm 87 STOP program. FS?C 02 024LBL II 0I+LBL 01 (41) If a program does not otherwise use FS? 30 the trigonometric mode flags (flag 42. GRAD SF 02 03 X=Y? 09 RDN mode; flag 43, RAD mode) for trigonometric FC?C 01 84 GTO 01 18 .3048 instructions, then one or both of them may be SF 01 85 .3048 11 / used as general purpose flags. Some advan- The always-false filler, FS? 30 (Catalog 06 12 .END. tages are: (1) display annunciators; (2) setting flag), for the AND Logic used to toggle flag 02, * (GRAD, RAD) and clearing (DEG) are one byte alternatively may be replaced by an always- instructions; (3) the execution time to set and false stack conditional whenever the relative clear these flags is only 20 msec (compared to status of the stack is known. How to use: 30msec for other user flags); and (4) the Position the calculator to the program status is maintained when the calculator is (GTO F< >M -1 1; off. Remember, however, that DEG clears Press (USERl on; either of the flags and that only one of the two (c) To convert 2.25 feet to meters, press flags can be in set mode at a given time. Flags Feedback 2.25 m, and see 0.6858; 42 and 43 are particularly useful in programs This new column contains reader feed- (d) To converting 0.6858 meters to feet, with three-way branch points. The following back about articles or routines that appear- press 0.6858 [ma and see 2.25 routine, "LOGIC," is an implementation of the ed in previous issues. Though much of the feet. truth table for the three types of AND logic, information presented here is useful on its As you can see, the '-1 key becomes a and also illustrates the use of the trigo- own, you will find that it is a good idea to shift function. This gives us 30 labels-A, A', nometric mode flags at a three-way branch have your library of KEY NOTES handy B, 6'. ... a, a', ... e, and el-good for 15 point. In this example, the user determines while reading this column. conversions. the branch (lines 11 through 14) by pressing Here's a notable comment from the land key 11 (XEQ A), 12 (XEQ 6). or 13 (XEQ C) in of windmills and wooden shoes. W.L.C. USER mode. Brunings from Bilthoven, Holland, read the "In the Key of HP" column in the last Here's a routine to help us through the issue with a critical eye. day. Don Thayer of San Leandro, Cali- 01+LBL 'LOGIC' 19 CTO 84 (V6Nlp7b) KEY NOTES gives many useful fornia, sent in this one. 82+LBL 8 284LBL 82 tips. But, one of the tips can be a pitfall-the (41) While converting my HP-67 programs 83 GRClD 21 XU? shortest way to divide by 100 using: 1 I for use with my HP-41 and its printer, I 84 CTO 01 22 X{=0? Look at this program fragment. discovered many of them required the RCL 00 conversion from a Gregorian Date to the 054LBL C 23 FS? 30 RCL 01 equivalent Julian Day number. Not wanting to 86 RIID 24 GTO 85 1 restructure the data register assignments, I 87 GTO 01 25 CTO 84 % developed the following program, titled 884LBL II 26+LBL 83 + "DAY," which uses only 72 bytes and does 27 FS? 81 Store 100 in register 00 and store 12 in not require any data registers other than the 894LBL 01 register 01. You wish to compute 100 + stack. The routine is valid from March 1900 18 'DO' 28 X=8? (12/100) = 100.121 But, with the above through February 2100 and was derived from 11 FS? 42 29 FS? 38 routine you get 12.12 the Standard Pack for the HP-67. 12 GTO 82 30 GTO 05 Of course, you can change the routine to: To use, enter the date in the form RCL 01 MM.DDWYY and execute DAY. Example: July 13 FS? 43 31YBL 84 1 4, 1980(7.041 980) = 2,444.425. 14 CTO 83 32 'SKIP' % 15 FS? 01 33+LBL 05 RCL 00 914L81 'DflY' 20 + 16 FC? 02 34 DEG + But, that is not always possible; i.e., when, 92 ENTERt 17 FS? 38 35 PROMPT 21 1 ' instead of RCLOO, the X-register contains the 83 INT 22 ST- 2 18 GTO 05 36 .END. result of a previous computation. 84 ST0 Z 23+LBL '09 (You're very right, Mr. Brunings. It would 85 24 CLX not be wise to go through all your programs - and indiscriminately change every 100; / to 86 1 E2 25 1 Instructions: Have your calculator in DEG a 1; WEd.) 87 * 26 + mode. To test flag:flag logic, set or clear flag Palmdale, California, is the home of 08 ENTEPt 27 30.6981 01 and flag 02 as desired, then XEQA. If both Paul Burke. Though Mr:Burke claims 09 INT flags are set, the routine halts with the that he isn't interested in stocks, he is 28 * message DO in the display; otherwise, SKIP interested in making the "STOCK" routine 18 ST0 T 29 INT appears. Arrange the stack at will and XEQ B that we printed on the back page of the last 11 - 30 XOY to test stack:stack logic. See DO whenever issue easier for us to use. Here's his letter. 12 1 E4 31 365.25 x < y AND x > 0. Finally, XEQ C and observe (V6Nlp16) (41) The routine for plotting 13 32 that DO is displayed only when flag 01 is set the weekly stock chart, "STOCK," does not * * AND x # 0 (flag:stack logic). It is easy to prove exploit the capabilities of the HP-41 and 14 XOY 33 INT that if another pair of flags is substituted for HP 82143A combination to their most useful 15 3 34 + flags 42 and 43, this simple routine would extent. Specifically, I prefer program initiation 16 X(=Y? 35 + require 'at least one additional byte. By the to start at the front of the program, and then 36 1728982 way, when you key in this routine, remember branch to subroutines only after the input 17 GTO 08 to use the top row of keys for the postfix data has been handled. The inputs for plotting 18 CLX 37 + instructions, like GTO 01, LBL 05, FC? 02, to itself could be entered from PROMPT'S asking 19 12 38 .END. reduce the number of keystrokes. (Continued)

I KEY NOTES V6N2 May 1982 Page 13 for the specific item as known to the user, (This does make the Stock Plotting these keys at a halt in the program, the instead of the input name used by PRPLOT, routine easier to use. Just add lines 92 to local-label search is bypassed and the which may not make too much sense in the 115 to the end of the listing from V6NIp16, function X<> Y or RDN is performed context of the program. This method then and add lines 01 to b5 to the .beginning of immediately. Using the local-ALPHA uses PRPLOTP for the actual plotting. that listing, then execute "BEGIN." The labels F and G will both moue the program I have found that this approach leads to HP-41 will ask the necessary questions and pointer, as mentioned in the letter, and faster use of any program, especially if you then prompt you for the weekly data to be clear the subroutine return stack. Of course, haven't used it for some time. The input - plotted. Be sure to set a minimum site of 18 if you can work around these two draw- prompts tailored to the particular require- and to have your printer switch set to backs, the method of using local-ALPHA ments of the program prevent confusion as to MAN-Ed.) labels has the advantage of not requiring what is meant by the input request. I am sure fi?wb7L~~t~bkYjbrWu&.mru~ndoryou to make key-assignments-Ed.) that only a few stock analysts could interpret lonsanQUsyourHP4llm~~e "AXIS?" and "X MIN?" correctly if they did not k#mhumAtrIrl.~~1111.Irprrd.lrthL Net, ns haw a valuable o~amtiantot use the program frequently enough to become &d$d.J-.p.h iEkabeod of M,them with a cUd redw. mafn2ormatioa familiar with the basic inputs required by c&hF&,-t)li.*had. eagar from Tam Ph#d d Barksky, PRPLOT, but they would need no refresher to pwioue suggmtfon. California. understand "PURCHASE PRICE?" or "START (V5N3p13a) (41) 1 have found Julius (V5N3pl4) (41) Regarding Vally Lam- DAY?." The listings enclosed indicate the way Zechmeister's idea, on how to find local labels brecht's routine, this and other routines with I would initialize the program, and request the quicker, very useful. My most commonly used card reader prompts should have flag 21 clear necessary plotting inputs, in terms the user program has many local labels and some large before the AVIEW statement. Otherwise, the could identify without reference to a coding routines. The search for a label often took as program may halt at the AVIEW and a normal sheet. long as the routine itself. With the example in program card-read will result. Incidently, KEY NOTES as an inspiration, I developed a RSUB (XROM 30.04) will not clear the same I use this approach a lot. It takes up some routlne to do the same from any spot in a program that contains it. I find it will work room in the machine for "gingerbread," but program for any label. Here is how I correctly without an END. the CV has room to spare for most programs. implemented it. (By the way, Vally Lambrechts' routine Also, having the program keep track of its own can be adapted to call subroutines from the inputs prevents the occasional "oopsl" when 01 LBL99 31 LBLI HP-IL Digital Cassette Drive or to call a prompt is misinterpreted due to ignorance of 02 STOP routines from Extended Memory-Ed.) the proper program functioning internally, 03 RTN 38 XEQ 99 Routines to solve the quadratic equation which should not have to be reviewed every GTO 39 GTO I are a popular subject in KEY NOTES,and time a program is run. 04 99 05 LBL F 40 LBL A these routines keep getting shorter and Anyway, here is an amended listing and 06 XOY i [INITIALIZATION] shorter. The quadratic equation is ax2 + bx output of what my "STOCK" routine would 07 GTO 99 51 "INPUT?" + c = 0 and the roots of this equation are look like... if I was interested in stocks. 08 LBL G 52 AVIEW b+ JG b- JG XI = andx2= 09 RDN 53 XEQ 99 2a 2a lOGTO 99 i (COMPUTATION) Thia mutiat war eantribubd by Paol 81+Ll?L 'BEGIN' 11 LBLA 75 GTO 99 Baker at Stilketa, Bklahoma. Tha pm 12GTOA pam wart. mtircly In rboh&, it handha , 82 'STRRT DflTEJ ' 13 LBLB 899 END bath 1-44 mxaptex m,and UP, MY 03 'kHHDD.YYYYm 14 GTO B 6f thb routin~-.xelndiwg the I.&& 84tb 84 PROHPT END-I.- S btu. CDZl yeu ktUrd? 05 GTU 'DBTE' 21 LBLH I (SHORT ROUTINE] (V5N3p13c) (41) When I saw Brent 30 GTO 99 Tranberg's quadratic solution routine, I be- 92+LBL 'IN' came curious as to how it could be modified to 93 'STOCK' This procedure allows for fast execution of solve for complex roots. Here's my simple XOY and RDN as well as faster local label suggestion: 94 RSTO 11 location after any pause in execution. It allows 95 'HIM PRICE?' a user to continue a routine or choose a new 01+LBL 'SLY' 12 X)Y? routine with a minimum of label search time. 96 PROHPT 82 XC) Z 13 SF 81 97 ST0 08 The key to this procedure is lines 01 to 04. Line 02 stops to show results or prompt for 83 ST/ Z 14 - 98 =HflX PRICE?' input. Line 03 returns if LBL 99 was XEQ'ed 64 / 15 FIBS 99 PROMPT but not if GTO'ed. Line 04 stops extra R/S's 85 -2 16 SBRT lee STO 01 from doing anything. Lines 05 through 10 do 06 / 17 ST- 2 101 'PURCHaSE PRICE?' the XOY and RDN functions rather than letting the HP-41 search for them (always the 87 EHTERt 18 XOY 102 PROHPT longest search). Unfortunately, this prevents 08 ENTERt 19 FC? 01 183 ST0 04 them from being used in response to a prompt 89 Xt2 28 + (leaves the HP-41 at line 03). The followinq 104 'STflRT DBY?' 18 Rt 21 .END. 185 PROHPT lines are branches to long routines followed by short routines. An XEQ 99 will stop, then 11 CF 81 186 ST0 88 return when R/S is pressed. A GTO 99 will 107 'TIHE SPflNJDRYS?' stop and not continue. The user executes the program just as before; 108 PROHPT (The concept used here is well worth however, flag 01 will remain activated in the 189 ST0 89 studying. The slow response of many display to indicate complex roots of the form lengthy programs can be eliminated by 'x,, = U f iV' where the real component U is 110 'UEEKLY PTS. ' taking advantage of the 'jump-distance in the X-register and the imaginary compon- 111 RVIEW storage" characteristics of the local-label ent V is in the Y-register. 112 7 GTO and XEQ statements. We do have a Thank you for a most informative news- 113 ST0 18 suggestion, though. Rather than using LBL letter. I read KEY NOTES cover to cover1 F for XoY and LBL C for RDN, try (Thank you, Mr. Baker, for a fine 114 XROH 'PRPLOT' assigning these functions to their respec- example of efficient programming, and for 115 .END. tive keys. Then, when you press one of the nice words about KEY NOTES-Ed.)

1I! Page 14KEY NOTES V6N2 May 1982 Here's an input from the northeast corner Now, let's travel to Sollentuna, Sweden, lContinued from page I) of the U.S., by a dedicated, prolific HP-41 where Gerhard Rombach is keeping busy usable carrying case for it. So he carved-out aficzorzado, Alan Zeichick, who lives in by reading KEY NOTES and programming the interior of a large book and lined ~twith Bangor, Maine. his HP-41. Here is his contribution. vinyl. The HP-41 equipment is always to- (V6Nlp13b) (41) 1 was reading the (V5N3~14~)(41) Fred Lipshultz's pro- gether, very inconspicuous, and can be used "Routines, Techniques, Tips, etc." column in gram "GEN2" was very clever-but you have without having to take it out of its book He the new KEY NOTES saw HP~~condensed to do the conversion the other way (converting had these pictures taken, but never got version of Mr. Price's Hyperbolic Trig pro- a number In any baseto a number in base 10.) around to sending them to you. So here they gram. Well, I thought, the HP version is more Here is my solution: Change the last line arel" aesthetically pleasing, but less functional; it (line 42) in "GEN2" to STOP and continue as really should have the Inverse hyperbolic follows. Otherwise you have to Store the base functions. too. SO, I wrote them. I kept the in reglsfer04 and the number In register 01. same format as the "HYP routine, assigning ASINH, ACOSH, and ATANH to local-ALPHA 4.3 CLX 58 X)B7 keys m, @, and 0.respectively-the most 44 STCl 03 59 SF 61 logical locations, slnce there are no local- 45 ST@ %5 69 RCL 94 ALPHAS in the same place as the inverse 464&L 03 61 RCL 9.3 trigonometric functions. I've set up my routines to be physically placed after the 47 RCL 62 YtX "HYP" routine. 49 X=#? 62 * 49 GTr? 94 23tL8L E 64 1 24 1 5% 1 E-1 65 ST+ 93 51 25 XOY * 66 XOY 52 INT 67 FS'?C el 26 + 53 27i' ST0 01 68 ST+ 05 -54 LFISTX 69 28 LASTX GTI! C13 5s FRC 29 - TBtLBL 04 56 1 El 71 YIEM 05 30 / 57 31 SBRT * 72 .EHD. 32 Lh 44 + 33 RTH 45 LN 34tLBL D 46 RTN New Club Formed in England I hope you find this worthy of attention. By Elsewhere in KEY NOTES you will find a the way, ~f ATANH is not needed, lines 23-33 notice about a new calculator club in can be deleted-the same as mentioned in your Germany. Just before we went to press, we "HYP routine. I llke to be consistent. received a letter about one more new club. (Definitely worthy of attention, Mr. Here's the letter. Zeichick. One thing you might want to try, ''I have recently formed a Users' Group for though; replace LBL E, LBL D,and LBL C, HP Personal Programmable Calculators in with LBL 10, LBL 09, and LBL 08. Then, Brita~nand would be grateful if you could glve use the XEQ key as an "inverse" key. For the Group a mention in the next issue of KEY A TANH press and then (which NOTES. The Group is called "PPC-GB" the calculator understands as lo), (Personal Programming Center-Great Brita~n) Now, you have the hyperbolics and their and is a chapter of PPC in the USA, but inverses all "assigned" to the most logical membership is open to all users of HP keys-Ed.) programmable calculators. (Continued) (Continued)

Back Issue and Subscription Information Back issues of KEY NOTES are available in U.S. dollars drawn on a U.S. bank. Or KEY NOTES is published quarterly in back to V3N3, which introduced the HP-41. you may use your American Express, February, May, August, and November. A An index of these will be furnished on VISA, or Mastercard account; be sure to one-year subscription in the U.S. and request. Available issues are: indude your account number and card Canada is $5" a year. It is free (worldwide) V3N3 August 1979 (12 pages) expiration date. Your order will be prompt- in 1982 if you are a member of the Corvallis V3N4 November 1979 (12 pages) ly mailed in an envelope. Users'Library ($20' U.S. and Canada; $35* V4N1 March 1980(1 2 pages) NO. OF U.S., MEXICO ALL OTHER elsewhere). Send your payment and com- V4N2 Jun-Aug 1980 (12 pages) ISSUES CANADA COUNTRIES plete name and address to the Corvallis V4N3 Sep-Dec 1980(1 2 pages) address on back cover. 1 $2.00 $3.50 To get KEY NOTES in Europe, contact V5N1 Jan-Apr 1981 (16pages) 2 $3.50 $5.00 V5N2 May-Aug 1981 (16 pages) the UPLE (Geneva address on back cover). 3 $5.00 $6.50 To get KEY NOTES elsewhere, contact V6N3 Sep-Dec 1981 (16 pages) 4 $6.00 68.00 V6N1 Jan-Feb 1982(1 6 pages) your nearest HP Sales Office or send your 5 $7.00 $9.00 name, address, and calculator serial num- Prices for KEY NOTES back issues are 6 $8 00 $10.00 ber to the Corvallis Users' Library. as follows. All prices include first-class or 7 $9.00 $11.00 air mail. Payment must accompany your 8 $1 0.00 ~i2.00 order and must be a check or money order 9 $11.00 $13.00 * U.S.dollars. See note at bottom ofpage 4

KEY NOTES V6N2 May 1982Page 15 "I hope that the Group will compliment KEY with deorbit-burn information. Should the "Thought you might like to see my portable NOTES, UPLE, and PPC by becoming a local shuttle encounter an emergency, however, office1 I am just finishing teaching a graduate forum for exchange of information, programs. the astronauts would rely on the HP-41 for course, "Hydrologic Analysis With Program- and applications; for personal contact be- these calculations. - mable Calculators," with Professor Lloyd W. tween members; for arranging meetings; and Two other programs-one to help balance Gay, at the University of Arizona. The course for the very important provision of a local the Columbia prior to re-entry, and another was accepted, like my license plate, with "expert" to aid new users (or even a shoulder to pin-point Earth observation sites-also much enthusiasm. to cry upon when a program doesn't work). are available to the crew and would be run "Being Assistant City Engineer. I could let "At present I am working on the prospect of on the HP-41's. the little wonders [HP-41 system] evaluate a summer conference (half or one day The HP-41's do not take the place of the some of the city's turnoff problems. We plan meeting) and am trying to arrange with HP-UK shuttle's larger, general-purpose compu- to present the HP-41 programs to prac- and Dealers to provide demonstration equip- ters. However, they do complement the titioners in a 3-day short-course this ment, speakers, and perhaps even a visit to shuttle's larger systems and provide the November." HP here in the UK. crew with personal-computer convenience. The letter was signed, "Waiting for my "I shall keep you informed of progress as Also, new and different HP-41 programs new tape drive, Very truly yours, Dr. the Group becomes more established and can be written between flights-quickly Brian M. Reich." We thank you, Dr. Reich send you a copy of our newsletter when it is enough to keep up with many of the for the photograph and for taking the time published. In the meanwhile, I would be astronauts' changing computational needs. to share your thoughts and your truly grateful for any advice or help that you can We are very proud of the HP-41, and we unique license plate with our readers. KEY offer-especially regarding user groups and are happy that NASA chose this handheld NOTES is always interested in hearing producing newletters." marvel for use on the space shuttle. Already about unique applications, situations, or With many thanks, David M. Burch the new Time Module is an asset to this what-have-you. We are happy to see our valued customers mission and, in the future, the new HP-IL We might add that Dr. Reich is a get together and form little groups, because Module and the various HP-IL peripherals Consulting Engineer and Hydrologist who it is a very good way to spread information, will surely prove their usefulness. We'll lives in Tucson, Arizona. ideas, and comradeship. If you are inter- keep you informed as NASA makes more ested in this new Group or want further use of the HP-41 svstem. information, contact ~r.Burch at the fol- lowing address. It would be a nice gesture to include a self-addressed, stamped envelope. David M. Burch/PPC-GB Well ...y ou can imagine how many HP-41 Astage, system "cases" we see every month, but we Rectory Lane. have to admit this one is, as they say, "far WINDLESHAM, Surrey. out." But we also have to admit that it's GU20 6BW England very clever and that it certainly does fulfill (Note: PPC-GM is not sponsored, nor in the security requirements that were in- any way officially sanctioned, by Hewlett- tended. We congratulate Keith Olson and Packard.) nominate him the "HP-41 Owner of the Quarter." Mr Olson works for Sperry/Univac in the Columbia.. .(Continued) Bay Area and uses his HP-41 system extensively at the office to make his job the HP-41 helped them to keep on top of all easier. If he is as clever at his job as he is in of their daily "housekeeping" activities. contriving unique cases for his calculator, In addition to helping the crew organize his employer should hold onto him! And, its time, the second HP-41 computer was before we forget it, thank you, Mrs. Olson kept ready for flight-critical, deorbit-burn for the letter and photos. calculations. Once during each orbit Now, here's another letter you will enjoy. around the Earth, the shuttle has an How many people do you know who have opportunity to land at one of six contin- "HP-41CV" on their automobile license gency locations. During a routine flight, plate? Well, now you know at least one! Mission Control supplies the shuttle crew Here's his letter.

HP KEY NOTES Hewlett-Packard Company FIRST-CLASS MAIL Corvallis Division U.S. POSTAGE March-May 1982 Vol. 6 No. 2 1000 N.E. Circle Boulevard Programming and operating tips, answers to Corvallis, Oregon 97330 U.S.A. PERMIT NO. 814 questions, and information about new pro- grams and developmente concerning Hewlett- Address Correction Requested PORTLAND, OR Packard handheld computers. Published quar- Return Postage Guaranteed terly. See page 15. Reader comments or contributions are welcomed. Please send them to oneof the following addresses.

Hewlett-PackardCompany Users' Library 1000 N.E.Circle Boulevard CorvaUis, Oregon 97330 USA Hewlett-Packard SA Users Program Library Europe 7, Rue du Bois-du-Lam P.O. Box, CH-1217Meyrin 2 Geneua-Switzerland

Page 16 KEY NOTES V6N2 May 1982 Printed ~n u.S A.